-
Notifications
You must be signed in to change notification settings - Fork 1
/
ghm.Rmd
610 lines (435 loc) · 22.1 KB
/
ghm.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
---
title: "Référentiels GHM"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{ghm}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup, echo = FALSE, message = FALSE, warning = FALSE}
library(dplyr)
library(stringr)
library(refpmsi)
library(tidyr)
```
## CMD
Intitulé du référentiel : **cmd**
Mise à jour : 25 mai 2024
Référentiel des libellés des CMD (Catégories Majeures de Diagnostics).
Référentiel non annualisé.
### Variables
```{r var cmd, echo = FALSE}
refpmsi::refpmsi("cmd") %>% dplyr::glimpse()
```
## Sous-CMD
Intitulé du référentiel : **sous_cmd**
Mise à jour : 25 mai 2024
Référentiel des libellés des sous-CMD
Référentiel non annualisé.
### Variables
```{r var sous_cmd, echo = FALSE}
refpmsi::refpmsi("sous_cmd") %>% dplyr::glimpse()
```
## GHS Public
Intitulé du référentiel : **ghs_public**
Mise à jour : 25 mai 2024
Référentiel des GHS et GHM du secteur public (ex-DGF).
Référentiel annualisé au sens du PMSI MCO (2018 à 2024).
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables
**ghs** = code GHS
**ghm** = code GHM
**ghm_libelle** = libellé du GHM
**ghm_bb** = borne basse du GHM
**ghm_bh** = borne haute du GHM
**ghs_tarif** = tarif du GHS
**ghs_exb** = tarif journalier EXB (EXtrême Bas)
**ghs_exh** = tarif journalier EXH (EXtrême Haut)
**annee_pmsi** = année PMSI
```{r var ghm dgf, echo = FALSE}
refpmsi::refpmsi("ghs_public") %>% dplyr::glimpse()
```
## GHS Privé
Intitulé du référentiel : **ghs_prive**
Mise à jour : 25 mai 2024
Référentiel des GHS et GHM du secteur privé (ex-OQN).
Référentiel annualisé au sens du PMSI MCO (2018 à 2024).
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables
**ghs** = code GHS
**ghm** = code GHM
**ghm_libelle** = libellé du GHM
**ghm_bb** = borne basse du GHM
**ghm_bh** = borne haute du GHM
**ghs_tarif** = tarif du GHS
**ghs_exb** = tarif journalier EXB (EXtrême Bas)
**ghs_exh** = tarif journalier EXH (EXtrême Haut)
**annee_pmsi** = année PMSI
```{r var ghm oqn, echo = FALSE}
refpmsi::refpmsi("ghs_prive") %>% dplyr::glimpse()
```
## GHM intermédiaire
Intitulé du référentiel : **ghm_intermediaire**
Mise à jour : 25 mai 2024
Référentiel des GHM avec GHS intermédiaire
Référentiel annualisé au sens PMSI MCO (2020-2024)
### Variables
```{r var ghm_intermediaire, echo = FALSE}
refpmsi::refpmsi("ghm_intermediaire") %>% dplyr::glimpse()
```
## GHS Mono UHCD
Intitulé du référentiel : **ghs_monouhcd**
Mise à jour : 25 mai 2024
Référentiel annualisé au sens PMSI MCO (2021-2024)
Pour chaque GHS UHCD et par année PMSI MCO, la liste des GHM associés
### Variables
```{r var ghm_monorum_uhcd_public, echo = FALSE}
refpmsi::refpmsi("ghs_monouhcd") %>% dplyr::glimpse()
```
## Regroupement GHM
Intitulé du référentiel : **ghm_regroupement**
Mise à jour : 25 mai 2024
Référentiel des regroupements des GHM en DA (Domaine d'Activité), GA (Groupe d'Activité) et GP (Groupe de Planification).
Référentiel annualisé au sens du PMSI MCO (2018-2024).
Pour l'année PMSI MCO 2024, dans l'attente de la publication de la version 2024 du référentiel par l'ATIH, on a projeté l'année 2023 en 2024.
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables
**ghm** = code GHM
**ghm_libelle** = libellé du GHM
**aso** = code ASO du GHM (Activité de SOins)
**da** = code DA du GHM
**da_libelle** = libellé du DA
**gp** = code GP du GHM
**gp_libelle** = libellé du GP
**ga** = code GA du GHM
**ga_libelle** = libellé du GA
**da_gp** = concaténation des codes DA et GP du GHM
**da_gp_ga** = concaténation des codes DA, GP et GA du GHM
**annee_pmsi** = année PMSI
```{r var ghm_regroupement, echo = FALSE}
refpmsi::refpmsi("ghm_regroupement") %>% dplyr::glimpse()
```
## Regroupement des racines de GHM
Intitulé du référentiel : **rghm_regroupement**
Mise à jour : 25 mai 2024
Référentiel des regroupements des racines de GHM en DA (Domaine d'Activité), GA (Groupe d'Activité) et GP (Groupe de Planification).
Référentiel annualisé au sens du PMSI MCO (2018-2024)
Pour l'année PMSI MCO 2024, dans l'attente de la publication de la version 2024 du référentiel par l'ATIH, on a projeté l'année 2023 en 2024.
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables
**rghm** = code racine GHM
**rghm_libelle** = libellé racine GHM
**aso** = code ASO racine GHM (Activité de Soins)
**da** = code DA racine GHM
**da_libelle** = libellé du DA
**gp** = code GP racine GHM
**gp_libelle** = libellé du GP
**ga** = code GA racine GHM
**ga_libelle** = libellé du GA
**da_gp** = concaténation des codes DA et GP de la racine GHM
**da_gp_ga** = concaténation des codes DA, GP et GA de la racine GHM
**annee_pmsi** = année PMSI
```{r var rghm_regroupement, echo = FALSE}
refpmsi::refpmsi("rghm_regroupement") %>% dplyr::glimpse()
```
## OVALIDE - Table GHMINFO_exDGF
Intitulé du référentiel : **ovalide_ghminfo_dgf**
Mise à jour : 25 mai 2024
Informations issues de la table OVALIDE `GHMINFO_exDGF`.
Les informations redondantes avec d'autres référentiels de `refpmsi::` (ex : cma, bb, bh, ...) ne sont pas reprises.
Référentiel annualisé au sens du PMSI MCO (2018-2024).
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables
**ghm** = code GHM
**tghm** = type du GHM (C : chirurgical; M : médical; X : autre)
**dms** = durée moyenne de séjour nationale
**pctdc** = taux de décès national
**mage** = age moyen
**pctcourt** = pourcentage de séjours courts (parmi les séjours de durée > 1 jour) où durée d'un séjour court = borne basse ou borne basse +1
**pvalo** = code GHS du GHS le plus valorisé dans les GHM multi-GHS
**pctpvalo** = taux de séjours aux GHS plus élevés
**pctcma4** = pourcentage de séjours de niveau 4 par sous-cmd (sous-cmd = 3 premières positions des GHM)
**pctautres** = pourcentage de séjours avec un DA autres (.8)
**annee_pmsi** = année PMSI
```{r var ovalide_ghminfo_dgf, echo = FALSE}
refpmsi::refpmsi("ovalide_ghminfo_dgf") %>% dplyr::glimpse()
```
## OVALIDE - Table GHMINFO_exOQN
Intitulé du référentiel : **ovalide_ghminfo_oqn**
Mise à jour : 25 mai 2024
Informations issues de la table OVALIDE `GHMINFO_exOQN`.
Les informations redondantes avec d'autres référentiels de `refpmsi::` (ex : cma, bb, bh, ...) ne sont pas reprises.
Référentiel annualisé au sens du PMSI MCO (2018-2024).
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables
**ghm** = code GHM
**tghm** = type du GHM (C : chirurgical; M : médical; X : autre)
**dms** = durée moyenne de séjour nationale
**pctdc** = taux de décès national
**mage** = age moyen
**pctcourt** = pourcentage de séjours courts (parmi les séjours de durée > 1 jour). Durée d'un séjour court = borne basse ou borne basse +1
**pvalo** = code GHS du GHS le plus valorisé dans les GHM multi-GHS
**pctpvalo** = taux de séjours aux GHS plus élevés
**pctcma4** = pourcentage de séjours de niveau 4 par sous-cmd (sous-cmd = 3 premières positions des GHM)
**pctautres** = pourcentage de séjours avec un DA autres (.8)
**annee_pmsi** = année PMSI
```{r var ovalide_ghminfo_oqn, echo = FALSE}
refpmsi::refpmsi("ovalide_ghminfo_oqn") %>% dplyr::glimpse()
```
## OVALIDE - Table RacineINFO_exDGF
Intitulé du référentiel : **ovalide_racineinfo_dgf**
Mise à jour : 25 mai 2024
Informations issues de la table OVALIDE `RacineINFO_exDGF`.
Référentiel annualisé au sens du PMSI MCO (2018-2024).
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables
**racine** = code racine GHM
**pctdc** = taux de décès national
**conf** = confirmation de codage nécessaire pour la racine GHM (1 : OUI ; 0 : NON)
**age2** = effet de l’âge pour les moins de 2 ans (1 : OUI ; 0 : NON)
**age69** = effet de l’âge pour les plus de 69 / 79 ans (1-3 : OUI pour les plus de 69 ans ; 2-4-6 : OUI pour les plus de 79 ans ; 0 : NON)
**pctcma2** = pourcentage de séjours de niveau 2 dans la racine GHM
**pctcma3** = pourcentage de séjours de niveau 2 dans la racine GHM
**pctexb** = pourcentage de séjours en dessous de la borne basse
**pctssacte** = taux de séjours de 0 jours sans acte
**app** = racine apparentée à la racine GHM
**pctapp** = pourcentage de séjours dans la racine apparentée
**annee_pmsi** = année PMSI
```{r var ovalide_racineinfo_dgf, echo = FALSE}
refpmsi::refpmsi("ovalide_racineinfo_dgf") %>% dplyr::glimpse()
```
## OVALIDE - Table RacineINFO_exOQN
Intitulé du référentiel : **ovalide_racineinfo_oqn**
Mise à jour : 25 mai 2024s
Informations issues de la table OVALIDE `RacineINFO_exOQN`.
Référentiel annualisé au sens du PMSI MCO (2018-2024).
Il est recommandé de ne charger que la ou les année(s) PMSI utile(s).
### Variables du référentiel
**racine** = code racine GHM
**pctdc** = taux de décès national
**conf** = confirmation de codage nécessaire pour la racine GHM (1 : OUI ; 0 : NON)
**age2** = effet de l’âge pour les moins de 2 ans (1 : OUI ; 0 : NON)
**age69** = effet de l’âge pour les plus de 69 / 79 ans (1-3 : OUI pour les plus de 69 ans ; 2-4-6 : OUI pour les plus de 79 ans ; 0 : NON)
**pctcma2** = pourcentage de séjours de niveau 2 dans la racine GHM
**pctcma3** = pourcentage de séjours de niveau 2 dans la racine GHM
**pctexb** = pourcentage de séjours en dessous de la borne basse
**pctssacte** = taux de séjours de 0 jours sans acte
**app** = racine apparentée à la racine GHM
**pctapp** = pourcentage de séjours dans la racine apparentée
**annee_pmsi** = année PMSI
```{r ovalide_racineinfo_oqn, echo = FALSE}
refpmsi::refpmsi("ovalide_racineinfo_oqn") %>% dplyr::glimpse()
```
## Liste des actes CCAM de classification en CMD
Intitulé du référentiel : **liste_A_mco**
Mise à jour : 10 septembre 2024
Dernière version (2024)
[Source](https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/telecharger/gratuit/17904/3913)
### Variables
```{r var liste_A_mco, echo = FALSE}
refpmsi::refpmsi("liste_A_mco") %>% dplyr::glimpse()
```
## Liste des diagnostics CIM de classification en CMD
Intitulé du référentiel : **liste_D_mco**
Mise à jour : 10 septembre 2024
Dernière version (2024)
[Source](https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/telecharger/gratuit/17904/3913)
### Variables
```{r var liste_D_mco, echo = FALSE}
refpmsi::refpmsi("liste_D_mco") %>% dplyr::glimpse()
```
## Dénombrement Base nationale MCO des GHM
Intitulé du référentiel : **denombrement_mco_ghm**
Mise à jour : 10 septembre 2024
Dernière version (2023)
[Source](https://www.atih.sante.fr/sites/default/files/public/content/4807/denombrement_2023.xlsx)
### Variables
```{r var denombrement_mco_ghm, echo = FALSE}
refpmsi::refpmsi("denombrement_mco_ghm") %>% dplyr::glimpse()
```
## Dénombrement Base nationale MCO des GHS
Intitulé du référentiel : **denombrement_mco_ghs**
Mise à jour : 10 septembre 2024
Dernière version (2023)
[Source](https://www.atih.sante.fr/sites/default/files/public/content/4807/denombrement_2023.xlsx)
### Variables
```{r var denombrement_mco_ghs, echo = FALSE}
refpmsi::refpmsi("denombrement_mco_ghs") %>% dplyr::glimpse()
```
## Exemples
### Chargement du référentiel des GHS Public des années 2023 et 2024
```{r ghs_chargement_affichage, eval = TRUE, echo = TRUE}
# Chargement du référentiel des GHS-GHM Public des années 2023 et 2024
ghs_2023_2024 <- refpmsi::refpmsi("ghs_public",2023:2024)
ghs_2023_2024
```
### Référentiel des libellés des GA
On retient, pour chaque GA (Groupe d'Activité) le libellé correspondant à l'année PMSI MCO la plus récente
```{r ga_libelle, eval = TRUE, echo = TRUE}
ghm_regroupement <- refpmsi(ghm_regroupement)
ga_libelle <- ghm_regroupement %>%
dplyr::distinct(ga,ga_libelle,annee_pmsi) %>%
dplyr::group_by(ga) %>%
dplyr::summarise(ga_libelle = ga_libelle[annee_pmsi == max(annee_pmsi)])
head(ga_libelle)
```
### Rattachement du libellé GHM aux GHM des RUM
Soit un jeu de données `jeu_ghm` composé de 17 RUM correspondant à 14 séjours.
```{r ghm_jeu_libelle, echo = FALSE}
jeu_ghm <- tibble::tibble(no_rum = c(rep(1L,10L),1,2,1,2,3,1,1),
no_rss = c(seq(1L:10L),11,11,12,12,12,13,14),
ghm = c("06K02Z","08C321","04M053","05M092",
"06M12T","04M053","20Z041",
"08K041","01M201","06M12T","05M092","05M092",
"04M053","04M053","04M053","16M11T","16M11T"),
dp_rum = c("D122","S8220","J181","I5001",
"R104","J181","F102","S730","S0600",
"R104","I5009","I472","J189","J960","J189","D508","D509"),
jp = c(0L,3L,10L,7L,0L,0L,29L,2L,3L,0L,
2L,1L,2L,11L,11L,0L,0L),
ghs = c("2119","2808","1144","1754","2200",
"1144","7267","3033","268",
"2206","1754","1754","1144","1144","1144","6186","6118"),
annee_rss = c("2024","2023","2023","2024","2024",
"2023","2023","2024","2023",
"2024","2023","2023","2024","2024","2024","2024","2024"))
jeu_ghm
```
```{r ghm_association_libelle_affichage, eval = TRUE, echo = TRUE}
# chargement des GHM Public 2023 et 2024
ghm_2023_2024 <- refpmsi::refpmsi("ghs_public", 2023:2024)
jeu_ghm_libelle <- jeu_ghm %>%
# rattachement des libellés aux GHM via la jointure (ghs, annee_pmsi)
dplyr::left_join(ghm_2023_2024 %>% dplyr::select(ghs,ghm_libelle,annee_pmsi),
join_by(ghs == ghs, annee_rss == annee_pmsi))
jeu_ghm_libelle
```
### Rattachement DMS nationale aux séjours
Dans un premier temps, on rattache les DMS nationales issues d'OVALIDE MCO à chaque séjour.
Puis on compare la DS des séjours avec ces DMS nationales pour les séjours pour lesquels cela a un sens (séjours avec une DS > 0).
```{r ghm_dms_affichage, eval = TRUE, echo = TRUE}
# Chargement des DMS OVALIDE des années PMSI 2023 et 2024
dms_ovalide <- refpmsi::refpmsi("ovalide_ghminfo_dgf", 2023:2024) %>% dplyr::select(ghm,dms,annee_pmsi)
dms_ovalide
jeu_ghm_dms <- jeu_ghm %>%
# rattachement des DMS OVALIDE
dplyr::left_join(dms_ovalide, join_by(ghm == ghm, annee_rss == annee_pmsi)) %>%
# nouvelle variable ecart_dms
# nouvelle variable ratio_ecart_dms. = NA pour les cas jp = 0
dplyr::mutate(ecart_dms = jp - dms,
ratio_ecart_dms = ifelse(jp != 0L, round(jp/dms,2), NA_real_))
jeu_ghm_dms %>% print(n = 15, width = Inf)
```
Cas d'usage : filtrer les séjours qui ont une DS >= 2,5 x la DMS nationale de leur GHM pour repérer des séjours, à priori, particulièrement longs.
```{r ghm_dms_2.5_affichage, eval = TRUE, echo = TRUE}
sejour_more_2.5_dms <- jeu_ghm_dms %>% dplyr::filter(ratio_ecart_dms >= 2.5)
sejour_more_2.5_dms %>% print(width = Inf)
```
### Case mix en DA (Domaine d'Activité) des séjours
```{r case_mix_da_affichage, eval = TRUE, echo = TRUE}
case_mix_da <- jeu_ghm %>%
# rattachement des codes DA aux séjours
dplyr::left_join(refpmsi::refpmsi("ghm_regroupement",2023:2024) %>% dplyr::select(ghm,da,da_libelle,annee_pmsi),
join_by(ghm == ghm, annee_rss == annee_pmsi)) %>%
# regroupement en DA
group_by(da,da_libelle) %>%
# calcul du nombre de RUM et du nombre de séjours par DA
dplyr::summarise(nb_rum = dplyr::n(),
nb_sejour = dplyr::n_distinct(no_rss),
.groups = "drop")
case_mix_da
```
### Séjours et gradation des prises en charge ambulatoires
On repère les séjours concernés par la gradation des prises en charge ambulatoires et groupés avec le GHS intermédiaire.
```{r ghm_gradation_affichage, eval = TRUE, echo = TRUE}
sejour_ghs_intermediaire <- jeu_ghm %>%
# rattachement GHS plein et GHS intermédiaire pour les GHM concernés
dplyr::left_join(refpmsi::refpmsi(ghm_intermediaire),
join_by(ghm == ghm_intermediaire, annee_rss == annee_pmsi)) %>%
# filtre sur les séjours dont le GHS == le GHS intermédiaire associé au GHM
dplyr::filter(ghs == ghs_intermediaire)
sejour_ghs_intermediaire
```
### Liste des codes CIM-10 d'une liste D
```{r mco_fg_listes_chargement_affichage, eval = TRUE, echo = TRUE}
# Chargement du référentiel des listes D et A de l'algorithme de groupage MCO
mco_fg_listes <- refpmsi::refpmsi("mco_fg_listes", 2021)
mco_fg_listes
```
On choisit d'extraire les codes CIM-10 de la liste D-0401 ""Bronchite ou asthme"
Le DP d'un séjour appartenant à cette liste amène le séjour concerné en racine 04M03 "Bronchites et asthme, âge supérieur à 17 ans" ou 04M02 "Bronchites et asthme, âge inférieur à 18 ans"
```{r d_0401_affichage, eval = TRUE, echo = TRUE}
liste_D_0401 <- mco_fg_listes %>%
# on ne garde que des variables qui nous intéressent pour une liste en D
dplyr::select(mco_fg_liste_code, mco_fg_liste_lib, mco_fg_cmd, mco_fg_code) %>%
dplyr::filter(mco_fg_liste_code == "D-0401")
liste_D_0401
```
Script similaire pour extraire les actes CCAM PMSI d'une liste A.
### Diagnostics d'entrée d'une CMD
On choisit d'extraire les diags d'entrée de la CMD 01
```{r cmd_01_affichage, eval = TRUE, echo = TRUE}
# on a chargé le référentiel mco_fg_listes dans la variable mco_fg_listes
diag_cmd_01 <- mco_fg_listes %>%
dplyr::filter(mco_fg_cmd == "01", mco_fg_liste_type == "D") %>%
# argument.keep_all = TRUE pour garder les colonnes
dplyr::distinct(mco_fg_code, .keep_all = TRUE) %>%
# colonnes qui nous intéressent + réordonnancement
dplyr::select(mco_fg_code, mco_fg_cmd, mco_fg_liste_code, mco_fg_liste_lib)
diag_cmd_01
```
### Rattachement des libellés des listes D aux DP
Soit un mini-jeu de données de 12 séjours avec le DP, le GHM et l'année PMSI du séjour
```{r jeu_dp_ghm, echo = FALSE}
jeu_dp_ghm <- tibble::tibble(no_rss = seq(1:12),
dp_rss = c("I5010","S7220","H269","Z380",
"S7200","S0600","R074","J441",
"K358","R53+0","S7200","I5011"),
ghm_rss = c("05M091","08M041","02C05J","15M05A",
"08C471","01M201","05M13T","04M202",
"06C091","23M20Z","08C471","05M092"),
annee_rss = sample(c("2023","2024"),12,replace = TRUE))
jeu_dp_ghm
```
1ere étape : construire le tibble des diagnostics d'entrée de toutes les CMD concernées par une introduction de groupage par le DP
```{r diag_cmd_affichage, eval = TRUE, echo = TRUE}
# on a chargé le référentiel mco_fg_listes dans la variable mco_fg_listes
diag_cmd <- mco_fg_listes %>%
dplyr::filter(mco_fg_liste_type == "D") %>%
# nest_by = group_by + summarise + rowwise (expérimental dplyr 1.0.7)
dplyr::nest_by(mco_fg_cmd, .key = "diag_entree") %>%
# dégroupage du rowwise généré par nest_by
dplyr::ungroup() %>%
# traitement de la list_column des diags d'entrée
dplyr::mutate(diag_entree = purrr::map(diag_entree, ~ dplyr::distinct(.x, mco_fg_code, .keep_all = TRUE) %>% dplyr::select(c("mco_fg_code", "mco_fg_liste_code", "mco_fg_liste_lib"))))
diag_cmd
```
2eme étape : rattachement du libellé de la liste D correspondant au DP pour la CMD du séjour
```{r jeu_dp_ghm_liste_D_affichage, eval = TRUE, echo = TRUE}
jeu_dp_ghm_liste_D <- jeu_dp_ghm %>%
# extraction de la CMD du séjour
dplyr::mutate(cmd_rss = stringr::str_sub(ghm_rss,1,2)) %>%
dplyr::left_join(diag_cmd %>% tidyr::unnest(diag_entree),
# jonction via dp et cmd. Rappel : plusieurs listes D possibles pour un DP
join_by(dp_rss == mco_fg_code, cmd_rss == mco_fg_cmd))
jeu_dp_ghm_liste_D
```
Remarque : pas de libellé de liste D pour le DP Z380 "Enfant unique, né à l'hôpital" d'un séjour classé dans la CMD 15 "Nouveau-nés, prématurés et affections de la période périnatale" car, dans cette CMD, le groupage ne commence pas par le DP.
## Sources
[Manuel de groupage GHM 2024 - Volume 1](https://www.atih.sante.fr/sites/default/files/public/content/4713/volume_1_14_02_2024.pdf) (ATIH)
[TArifs MCO 2018-2024](https://www.atih.sante.fr/tarifs-mco-et-had) (ATIH)
[Arrêté tarifaire MCO 2023](https://www.legifrance.gouv.fr/download/pdf?id=wbSfyB0QarBmS_OXWPwKuVZQxHw5YMz-RNeqeEq8Hqs=) (Ministère de la Santé - Arrêté 2023)
[Arrêté tarifaire MCO 2022](https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000045530951) (Ministère de la Santé - Arrêté 2022)
[Arrêté tarifaire MCO 2021](https://www.legifrance.gouv.fr/jorf/id/JORFTEXT000043306334) (Ministère de la Santé - Arrêté 2021)
[Arrêté tarifaire MCO 2020](https://www.legifrance.gouv.fr/jo_pdf.do?id=JORFTEXT000041663256) (Ministère de la Santé - Arrêté 2020)
[Arrêté tarifaire MCO 2019](https://www.legifrance.gouv.fr/jo_pdf.do?id=JORFTEXT000038219729) (Ministère de la Santé - Arrêté 2019)
[Arrêté tarifaire MCO 2018](https://www.legifrance.gouv.fr/eli/arrete/2018/2/28/SSAH1805897A/jo/texte) (Ministère de la Santé - Arrêté 2018)
[Regroupements des GHM et RGHM 2023](https://www.atih.sante.fr/regroupement-des-ghm-en-2023) (ATIH)
[OVALIDE MCO - Tables de référence 2024](https://www.atih.sante.fr/sites/default/files/public/content/4778/ovalide_0.zip) (ATIH)
[Données du volume 2 du manuel des GHS 2024](https://www.atih.sante.fr/plateformes-de-transmission-et-logiciels/logiciels-espace-de-telechargement/id_lot/3913) (ATIH)