Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.
#chargement de packages
library(tidyverse)
library(gtsummary)
library(lubridate)
setwd("C:/Users/SB545911/Desktop/Documents")
getwd()
Import de la base de donnes issue d une requete BO
Extraction des RUM de 2022 des lits dedies soins palliatifs
concatenation des RUM appartenant au meme sejour :
3 paires de 2 RUM appartenant au meme RSS
lisp<-read.csv(file ="C:/Users/SB545911/Desktop/lisp2022.csv",sep=";",head=T)
Description generale
summary(lisp)
No_RSS Date_Debut_Sejour Date_Fin_Sejour Duree_Sejour Age Ghm
Min. :1661403 Length:185 Length:185 Min. : 1.00 Min. :34.00 Length:185
1st Qu.:1680634 Class :character Class :character 1st Qu.: 8.00 1st Qu.:67.00 Class :character
Median :1698718 Mode :character Mode :character Median : 15.00 Median :77.00 Mode :character
Mean :1698060 Mean : 21.81 Mean :75.99
3rd Qu.:1714405 3rd Qu.: 31.00 3rd Qu.:87.00
Max. :1729935 Max. :146.00 Max. :98.00
GHS Valorisation_GHS Duree_RUM Mode_Entree Provenance Mode_Sortie
Min. : 274 Min. : 1583 Min. : 0.00 Min. :6.000 Min. :1.000 Min. :7.000
1st Qu.:2140 1st Qu.: 5714 1st Qu.: 5.00 1st Qu.:6.000 1st Qu.:1.000 1st Qu.:8.000
Median :7993 Median : 5714 Median :11.00 Median :7.000 Median :1.000 Median :9.000
Mean :5471 Mean : 6596 Mean :15.45 Mean :6.908 Mean :1.472 Mean :8.627
3rd Qu.:7993 3rd Qu.: 6992 3rd Qu.:19.00 3rd Qu.:8.000 3rd Qu.:1.000 3rd Qu.:9.000
Max. :7993 Max. :16842 Max. :86.00 Max. :8.000 Max. :5.000 Max. :9.000
NA's :58
Destination Code_DP Libelle_DP UF
Min. :1.00 Length:185 Length:185 Length:185
1st Qu.:3.00 Class :character Class :character Class :character
Median :6.00 Mode :character Mode :character Mode :character
Mean :4.75
3rd Qu.:7.00
Max. :7.00
NA's :157
View(lisp)
lisp$No_RSS<-as.character(lisp$No_RSS)
lisp$Date_Debut_Sejour<-dmy(lisp$Date_Debut_Sejour)
lisp$Date_Fin_Sejour<-dmy(lisp$Date_Fin_Sejour)
lisp$GHS<-as.factor(lisp$GHS)
lisp$Ghm<-as.factor(lisp$Ghm)
lisp$Mode_Entree<-as.factor(lisp$Mode_Entree)
lisp$Provenance<-as.factor(lisp$Provenance)
lisp$Mode_Sortie<-as.factor(lisp$Mode_Sortie)
lisp$Destination<-as.factor(lisp$Destination)
lisp$Code_DP<-as.factor(lisp$Code_DP)
lisp$UF<-as.factor(lisp$UF)
summary(lisp)
No_RSS Date_Debut_Sejour Date_Fin_Sejour Duree_Sejour Age Ghm
Length:185 Min. :2022-01-06 Min. :2022-01-14 Min. : 1.00 Min. :34.00 23Z02Z :97
Class :character 1st Qu.:2022-03-07 1st Qu.:2022-04-11 1st Qu.: 8.00 1st Qu.:67.00 04M093 :11
Mode :character Median :2022-06-08 Median :2022-06-23 Median : 15.00 Median :77.00 06M053 : 7
Mean :2022-05-25 Mean :2022-06-16 Mean : 21.81 Mean :75.99 04M073 : 4
3rd Qu.:2022-07-25 3rd Qu.:2022-08-22 3rd Qu.: 31.00 3rd Qu.:87.00 05M093 : 4
Max. :2022-10-14 Max. :2022-10-27 Max. :146.00 Max. :98.00 17M153 : 4
(Other):58
GHS Valorisation_GHS Duree_RUM Mode_Entree Provenance Mode_Sortie Destination Code_DP
7993 :97 Min. : 1583 Min. : 0.00 6:90 1 :112 7: 18 1 : 6 Z515 :127
1163 :11 1st Qu.: 5714 1st Qu.: 5.00 7:22 5 : 15 8: 33 3 : 5 C341 : 8
2140 : 7 Median : 5714 Median :11.00 8:73 NA's: 58 9:134 6 : 7 C61 : 3
1153 : 4 Mean : 6596 Mean :15.45 7 : 10 J690 : 3
1755 : 4 3rd Qu.: 6992 3rd Qu.:19.00 NA's:157 C170 : 2
6528 : 4 Max. :16842 Max. :86.00 C182 : 2
(Other):58 (Other): 40
Libelle_DP UF
Length:185 SB_HEMATO ONCOLOGIE_HC :50
Class :character SB_MED GERIATRIQUE 1_HC :21
Mode :character SB_MED GERIATRIQUE 2_HC : 2
SB_MED POLYVALENTE_HC : 1
SB_PNEUMOLOGIE 1_HC :57
SB_PNEUMOLOGIE 2_HC :10
SB_UOP_HC :44
Attention, l’um de soins palliatifs n’est pas forcement l’um retenue dans le groupage
Sur les 185 RUM, 127 avaient le Z51.5 en DP
50 uop : 44 geriatrie 1 : 21 pneumologie 2 : 10 geriatrie 2 : 2 medecine polyvalente : 1
regroupement d uf pneumologie : 67 hematologie oncologie : 50 uop : 44 geriatrie : 23 medecine geriatrique 1 : 21 medecine polyvalente : 1
## prendre le sous ensemble des RUM dont le ghm 23z02z
ghmpallia<-subset(lisp,Ghm=="23Z02Z")
summary(ghmpallia)
No_RSS Date_Debut_Sejour Date_Fin_Sejour Duree_Sejour Age Ghm
Length:97 Min. :2022-01-06 Min. :2022-01-14 Min. : 1.00 Min. :47.00 23Z02Z :97
Class :character 1st Qu.:2022-03-07 1st Qu.:2022-04-11 1st Qu.: 10.00 1st Qu.:67.00 01M213 : 0
Mode :character Median :2022-05-31 Median :2022-06-13 Median : 19.00 Median :74.00 01M263 : 0
Mean :2022-05-15 Mean :2022-06-09 Mean : 24.87 Mean :74.35 01M264 : 0
3rd Qu.:2022-07-08 3rd Qu.:2022-08-08 3rd Qu.: 32.00 3rd Qu.:83.00 01M303 : 0
Max. :2022-10-11 Max. :2022-10-27 Max. :146.00 Max. :96.00 01M304 : 0
(Other): 0
GHS Valorisation_GHS Duree_RUM Mode_Entree Provenance Mode_Sortie Destination Code_DP
7993 :97 Min. :5672 Min. : 1.00 6:40 1 :56 7:13 1 : 4 Z515 :97
274 : 0 1st Qu.:5714 1st Qu.: 8.00 7:16 5 : 6 8:24 3 : 4 C169 : 0
297 : 0 Median :5714 Median :15.00 8:41 NA's:35 9:60 6 : 5 C170 : 0
298 : 0 Mean :5709 Mean :20.11 7 : 7 C180 : 0
316 : 0 3rd Qu.:5714 3rd Qu.:28.00 NA's:77 C182 : 0
317 : 0 Max. :5714 Max. :77.00 C20 : 0
(Other): 0 (Other): 0
Libelle_DP UF
Length:97 SB_HEMATO ONCOLOGIE_HC :31
Class :character SB_MED GERIATRIQUE 1_HC :16
Mode :character SB_MED GERIATRIQUE 2_HC : 0
SB_MED POLYVALENTE_HC : 1
SB_PNEUMOLOGIE 1_HC :26
SB_PNEUMOLOGIE 2_HC : 6
SB_UOP_HC :17
#16,4 jours
#On compte 97 sejours avec GHM soins palliatifs
#duree moyenne rum 20,1 jours duree mediane 15 jours (q1-q3 8-28), min-max (1-77jours)
#valorisation 5672 euros (janv-fev 2022) puis 5714 euros (nouveau tarif mars 2022)
a<-ghmpallia[,8:9]
sum_valo<-apply(a,2,sum)
sum_valo
Valorisation_GHS Duree_RUM
553796 1951
#pour 97 sejours avec GHM soins palliatifs, une valorisation de 553 796 euros
# on compte 60 deces sur 97 rum soit 60%
#variable duree sejour en factorielle
ghmpallia$duree_sejour_fact<-as.factor(ghmpallia$Duree_Sejour)
summary(ghmpallia$duree_sejour_fact)
1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 19 20 21 22 23 25 26 27 28 30 31
3 3 4 1 5 1 3 2 2 3 2 2 3 6 4 4 4 1 2 2 1 3 2 1 1 1 4
32 34 35 41 42 44 45 46 47 51 52 53 55 56 60 61 73 77 88 146
4 2 1 2 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1
Combien de sejours sont inferieures a la borne de 4 jours
Sur les 97 sejours: 10 sont entre 1 et 3 jours 19 entre 4 et 12 jours 68 plus de 12 jours
creation de variable “nb_bas” pour nombre de jours sous la borne basse “nb_haut” pour nombre de jours au dela de la borne haute
ghmpallia$nb_bas<-4-ghmpallia$Duree_Sejour
summary(ghmpallia$nb_bas)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-142.00 -28.00 -15.00 -20.87 -6.00 3.00
ghmpallia$nb_bas[ghmpallia$nb_bas<0|ghmpallia$Mode_Sortie=="9"]<-0
#si deces
ghmpallia$nb_haut<-ghmpallia$Duree_Sejour-11
summary(ghmpallia$nb_haut)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-10.00 -1.00 8.00 13.87 21.00 135.00
ghmpallia<-ghmpallia%>%mutate(nb_hautbis=if_else(Mode_Sortie!="9",nb_haut-1,nb_haut))
ghmpallia<-ghmpallia%>%mutate(nb_hautter=if_else(nb_hautbis<0,0,nb_hautbis))
names(ghmpallia)
[1] "No_RSS" "Date_Debut_Sejour" "Date_Fin_Sejour" "Duree_Sejour" "Age"
[6] "Ghm" "GHS" "Valorisation_GHS" "Duree_RUM" "Mode_Entree"
[11] "Provenance" "Mode_Sortie" "Destination" "Code_DP" "Libelle_DP"
[16] "UF" "duree_sejour_fact" "nb_bas" "nb_haut" "nb_hautbis"
[21] "nb_hautter"
ghmpallia%>%select(4,12,17,20)
save(ghmpallia,file="ghmpallia.Rdata")
head(ghmpallia)
names(ghmpallia)
[1] "No_RSS" "Date_Debut_Sejour" "Date_Fin_Sejour" "Duree_Sejour" "Age"
[6] "Ghm" "GHS" "Valorisation_GHS" "Duree_RUM" "Mode_Entree"
[11] "Provenance" "Mode_Sortie" "Destination" "Code_DP" "Libelle_DP"
[16] "UF" "duree_sejour_fact" "nb_bas" "nb_haut" "nb_hautbis"
[21] "nb_hautter"
ghmpallia%>%select(1,4,12,17,20,21)
Estimer la valo
apply(recette,2,sum)
Duree_RUM tarif
1951 1269550
pour 97 rum, valo de 1269550
Etude la valo des séjours dont GHM different de 23Z02Z, où le patient pourra aller dans une uM précédente. Ces sejours representent 88 sejours/197 jours donc dans 45% des cas, GHM different 23Z02Z quelle est la valo des ces 88 sejours ?
ghmdiff<-lisp%>%filter(Ghm!="23Z02Z")
summary(ghmdiff)
No_RSS Date_Debut_Sejour Date_Fin_Sejour Duree_Sejour Age Ghm
Length:88 Min. :2022-01-06 Min. :2022-01-25 Min. : 2.00 Min. :34.0 04M093 :11
Class :character 1st Qu.:2022-03-20 1st Qu.:2022-04-16 1st Qu.: 8.00 1st Qu.:69.0 06M053 : 7
Mode :character Median :2022-06-19 Median :2022-07-06 Median :13.50 Median :78.0 04M073 : 4
Mean :2022-06-04 Mean :2022-06-23 Mean :18.43 Mean :77.8 05M093 : 4
3rd Qu.:2022-08-09 3rd Qu.:2022-08-29 3rd Qu.:24.75 3rd Qu.:88.0 17M153 : 4
Max. :2022-10-14 Max. :2022-10-27 Max. :86.00 Max. :98.0 07M063 : 3
(Other):55
GHS Valorisation_GHS Duree_RUM Mode_Entree Provenance Mode_Sortie Destination Code_DP
1163 :11 Min. : 1583 Min. : 0.00 6:50 1 :56 7: 5 1 : 2 Z515 :30
2140 : 7 1st Qu.: 6303 1st Qu.: 4.00 7: 6 5 : 9 8: 9 3 : 1 C341 : 8
1153 : 4 Median : 7064 Median : 7.00 8:32 NA's:23 9:74 6 : 2 C61 : 3
1755 : 4 Mean : 7574 Mean :10.32 7 : 3 J690 : 3
6528 : 4 3rd Qu.: 8915 3rd Qu.:12.25 NA's:80 C170 : 2
2526 : 3 Max. :16842 Max. :86.00 C182 : 2
(Other):55 (Other):40
Libelle_DP UF
Length:88 SB_HEMATO ONCOLOGIE_HC :19
Class :character SB_MED GERIATRIQUE 1_HC : 5
Mode :character SB_MED GERIATRIQUE 2_HC : 2
SB_MED POLYVALENTE_HC : 0
SB_PNEUMOLOGIE 1_HC :31
SB_PNEUMOLOGIE 2_HC : 4
SB_UOP_HC :27
On note une valorisation allant de 1583 à 16842 euros avec une moyenne de de 7574 euros. IL y a 6 transferts d’un autre établissement et 8 venant du domicile. Pour ces 14 personnes, nous pouvons appliquer les tarifs GHS7994 et voir si le montant est supérieur au GHS actuel.
Information à recuperer les monorum
recup_norum<-read.csv(file ="C:/Users/SB545911/Desktop/recup_norum.csv",sep=";",head=T)
str(recup_norum)
recup_norum$No_RSS<-as.character(recup_norum$No_RSS)
lisp2<-lisp%>%left_join(recup_norum)
names(lisp2)
save(lisp2,file="lisp2.Rdata")
Faire les simulations pour les monorum DP soins pallia=>multiplier valo GHS par 1,14 DP != soins pallia : regarder ce qui est plus valorisant entre GHS 7994 et GHS actuel
monorum<-subset(lisp2,lisp2$Nb_RUM==1)
dim(monorum)
[1] 95 17
save(monorum, file="monrum.Rdata") #95 rum
summary(monorum)
No_RSS Date_Debut_Sejour Date_Fin_Sejour Duree_Sejour Age Ghm
Length:95 Min. :2022-01-06 Min. :2022-01-14 Min. : 1.00 Min. :47.00 23Z02Z :57
Class :character 1st Qu.:2022-03-08 1st Qu.:2022-04-08 1st Qu.: 6.00 1st Qu.:64.00 04M093 : 7
Mode :character Median :2022-06-13 Median :2022-06-22 Median :13.00 Median :74.00 06M053 : 5
Mean :2022-05-23 Mean :2022-06-10 Mean :17.83 Mean :74.09 17M153 : 3
3rd Qu.:2022-07-14 3rd Qu.:2022-08-07 3rd Qu.:23.50 3rd Qu.:84.00 04M094 : 2
Max. :2022-10-14 Max. :2022-10-27 Max. :86.00 Max. :96.00 07M063 : 2
(Other):19
GHS Valorisation_GHS Duree_RUM Mode_Entree Provenance Mode_Sortie Destination Code_DP
7993 :57 Min. : 1583 Min. : 1.00 6: 0 1 :22 7: 9 1 : 4 Z515 :57
1163 : 7 1st Qu.: 5714 1st Qu.: 6.00 7:22 5 :15 8:16 3 : 2 C341 : 5
2140 : 5 Median : 5714 Median :13.00 8:73 NA's:58 9:70 6 : 3 C182 : 2
6528 : 3 Mean : 6261 Mean :17.83 7 : 6 C56 : 2
1164 : 2 3rd Qu.: 6830 3rd Qu.:23.50 NA's:80 C61 : 2
2526 : 2 Max. :13101 Max. :86.00 C763 : 2
(Other):19 (Other):25
Libelle_DP UF Nb_RUM
Length:95 SB_HEMATO ONCOLOGIE_HC :40 Min. :1
Class :character SB_MED GERIATRIQUE 1_HC :21 1st Qu.:1
Mode :character SB_MED GERIATRIQUE 2_HC : 1 Median :1
SB_MED POLYVALENTE_HC : 0 Mean :1
SB_PNEUMOLOGIE 1_HC :17 3rd Qu.:1
SB_PNEUMOLOGIE 2_HC : 4 Max. :1
SB_UOP_HC :12
57/95 ont DP Z51.5 70/95 sont deces duree 1 a 86 jours, moy 18 jours
TARIF pour les ghm 23z02z : appliquer le GHS7994 (x1.15 GHS 7993)
simulation tarif autre ghm
autreghm<-subset(monorum, Ghm!="23Z02Z")
summary(autreghm)
No_RSS Date_Debut_Sejour Date_Fin_Sejour Duree_Sejour Age Ghm
Length:38 Min. :2022-01-19 Min. :2022-01-25 Min. : 2.00 Min. :56.00 04M093 : 7
Class :character 1st Qu.:2022-03-11 1st Qu.:2022-04-27 1st Qu.: 6.00 1st Qu.:64.50 06M053 : 5
Mode :character Median :2022-06-24 Median :2022-07-10 Median :10.00 Median :74.50 17M153 : 3
Mean :2022-06-03 Mean :2022-06-18 Mean :14.84 Mean :75.00 04M094 : 2
3rd Qu.:2022-08-03 3rd Qu.:2022-08-16 3rd Qu.:13.75 3rd Qu.:85.75 07M063 : 2
Max. :2022-10-14 Max. :2022-10-27 Max. :86.00 Max. :96.00 09M113 : 2
(Other):17
GHS Valorisation_GHS Duree_RUM Mode_Entree Provenance Mode_Sortie Destination Code_DP
1163 : 7 Min. : 1583 Min. : 2.00 6: 0 1 : 6 7: 2 1 : 1 C341 : 5
2140 : 5 1st Qu.: 6303 1st Qu.: 6.00 7: 6 5 : 9 8: 5 3 : 1 C182 : 2
6528 : 3 Median : 7007 Median :10.00 8:32 NA's:23 9:31 6 : 0 C56 : 2
1164 : 2 Mean : 7090 Mean :14.84 7 : 1 C61 : 2
2526 : 2 3rd Qu.: 7334 3rd Qu.:13.75 NA's:35 C763 : 2
3561 : 2 Max. :13101 Max. :86.00 J690 : 2
(Other):17 (Other):23
Libelle_DP UF Nb_RUM
Length:38 SB_HEMATO ONCOLOGIE_HC :13 Min. :1
Class :character SB_MED GERIATRIQUE 1_HC : 5 1st Qu.:1
Mode :character SB_MED GERIATRIQUE 2_HC : 1 Median :1
SB_MED POLYVALENTE_HC : 0 Mean :1
SB_PNEUMOLOGIE 1_HC : 9 3rd Qu.:1
SB_PNEUMOLOGIE 2_HC : 2 Max. :1
SB_UOP_HC : 8
Nouveau tarif : simulGHS7994
autreghm$nb_bas<-4-autreghm$Duree_Sejour
summary(autreghm$nb_bas)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-82.00 -9.75 -6.00 -10.84 -2.00 2.00
autreghm$nb_bas[autreghm$nb_bas<0|autreghm$Mode_Sortie=="9"]<-0
summary(autreghm$nb_bas)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0 0 0 0 0 0
#si deces
autreghm$nb_haut<-autreghm$Duree_Sejour-12
summary(autreghm$nb_haut)
Min. 1st Qu. Median Mean 3rd Qu. Max.
-10.000 -6.000 -2.000 2.842 1.750 74.000
autreghm<-autreghm%>%mutate(nb_hautbis=if_else(Mode_Sortie!="9",nb_haut-1,nb_haut))
autreghm<-autreghm%>%mutate(nb_hautter=if_else(nb_hautbis<0,0,nb_hautbis))
names(autreghm)
[1] "No_RSS" "Date_Debut_Sejour" "Date_Fin_Sejour" "Duree_Sejour" "Age"
[6] "Ghm" "GHS" "Valorisation_GHS" "Duree_RUM" "Mode_Entree"
[11] "Provenance" "Mode_Sortie" "Destination" "Code_DP" "Libelle_DP"
[16] "UF" "Nb_RUM" "nb_bas" "nb_haut" "nb_hautbis"
[21] "nb_hautter"
autreghm%>%select(4,12,18,21)
autreghm<-autreghm%>%mutate(tarif=6595.17+nb_hautter*430.05-nb_bas*1501.75)
je peux prendre les monorum ghm differents 23z + en plus de l’ensemble des autres ghm23z
names(autreghm)
[1] "No_RSS" "Date_Debut_Sejour" "Date_Fin_Sejour" "Duree_Sejour" "Age"
[6] "Ghm" "GHS" "Valorisation_GHS" "Duree_RUM" "Mode_Entree"
[11] "Provenance" "Mode_Sortie" "Destination" "Code_DP" "Libelle_DP"
[16] "UF" "Nb_RUM" "nb_bas" "nb_haut" "nb_hautbis"
[21] "nb_hautter" "tarif"
autreghm%>%select(1,4,8,22,18,21)
#je cree une variable meilleurtarif : le meilleur de valorisation ghs et de tarif
autreghm$Valorisation_GHS<-as.numeric(autreghm$Valorisation_GHS)
autreghm<-autreghm%>%mutate(meilleur_tarif=if_else(tarif>Valorisation_GHS,tarif,Valorisation_GHS))
str(autreghm)
'data.frame': 38 obs. of 23 variables:
$ No_RSS : chr "1661470" "1661505" "1665307" "1665865" ...
$ Date_Debut_Sejour: Date, format: "2022-01-19" "2022-01-25" "2022-01-27" ...
$ Date_Fin_Sejour : Date, format: "2022-01-25" "2022-01-29" "2022-02-02" ...
$ Duree_Sejour : int 6 4 6 12 7 15 33 13 11 8 ...
$ Age : int 63 56 73 69 63 92 86 64 76 68 ...
$ Ghm : Factor w/ 52 levels "01M213","01M263",..: 1 26 44 48 23 51 11 11 23 11 ...
$ GHS : Factor w/ 52 levels "274","297","298",..: 1 26 44 48 23 51 11 11 23 11 ...
$ Valorisation_GHS : num 5653 6805 7039 8915 6259 ...
$ Duree_RUM : int 6 4 6 12 7 15 33 13 11 8 ...
$ Mode_Entree : Factor w/ 3 levels "6","7","8": 2 3 3 3 3 3 2 3 3 3 ...
$ Provenance : Factor w/ 2 levels "1","5": 1 NA NA NA NA NA 1 NA NA NA ...
$ Mode_Sortie : Factor w/ 3 levels "7","8","9": 2 3 3 3 3 3 3 3 3 3 ...
$ Destination : Factor w/ 4 levels "1","3","6","7": NA NA NA NA NA NA NA NA NA NA ...
$ Code_DP : Factor w/ 40 levels "C169 ","C170 ",..: 38 6 16 26 5 33 15 10 4 9 ...
$ Libelle_DP : chr "Douleurs chroniques irr\xe9ductibles, autres et non pr\xe9cis\xe9es " "carcinome h\xe9patocellulaire " "tumeur maligne de l'ovaire " "lymphome angio-immunoblastique \xe0 cellules T " ...
$ UF : Factor w/ 7 levels "SB_HEMATO ONCOLOGIE_HC ",..: 5 5 1 1 5 2 2 5 1 5 ...
$ Nb_RUM : int 1 1 1 1 1 1 1 1 1 1 ...
$ nb_bas : num 0 0 0 0 0 0 0 0 0 0 ...
$ nb_haut : num -6 -8 -6 0 -5 3 21 1 -1 -4 ...
$ nb_hautbis : num -7 -8 -6 0 -5 3 21 1 -1 -4 ...
$ nb_hautter : num 0 0 0 0 0 3 21 1 0 0 ...
$ tarif : num 6595 6595 6595 6595 6595 ...
$ meilleur_tarif : num 6595 6805 7039 8915 6595 ...
names(autreghm)
[1] "No_RSS" "Date_Debut_Sejour" "Date_Fin_Sejour" "Duree_Sejour" "Age"
[6] "Ghm" "GHS" "Valorisation_GHS" "Duree_RUM" "Mode_Entree"
[11] "Provenance" "Mode_Sortie" "Destination" "Code_DP" "Libelle_DP"
[16] "UF" "Nb_RUM" "nb_bas" "nb_haut" "nb_hautbis"
[21] "nb_hautter" "tarif" "meilleur_tarif"
autreghm%>%select(1,4,8,22,18,21,23)
summary(autreghm)
No_RSS Date_Debut_Sejour Date_Fin_Sejour Duree_Sejour Age Ghm
Length:38 Min. :2022-01-19 Min. :2022-01-25 Min. : 2.00 Min. :56.00 04M093 : 7
Class :character 1st Qu.:2022-03-11 1st Qu.:2022-04-27 1st Qu.: 6.00 1st Qu.:64.50 06M053 : 5
Mode :character Median :2022-06-24 Median :2022-07-10 Median :10.00 Median :74.50 17M153 : 3
Mean :2022-06-03 Mean :2022-06-18 Mean :14.84 Mean :75.00 04M094 : 2
3rd Qu.:2022-08-03 3rd Qu.:2022-08-16 3rd Qu.:13.75 3rd Qu.:85.75 07M063 : 2
Max. :2022-10-14 Max. :2022-10-27 Max. :86.00 Max. :96.00 09M113 : 2
(Other):17
GHS Valorisation_GHS Duree_RUM Mode_Entree Provenance Mode_Sortie Destination Code_DP
1163 : 7 Min. : 1583 Min. : 2.00 6: 0 1 : 6 7: 2 1 : 1 C341 : 5
2140 : 5 1st Qu.: 6303 1st Qu.: 6.00 7: 6 5 : 9 8: 5 3 : 1 C182 : 2
6528 : 3 Median : 7007 Median :10.00 8:32 NA's:23 9:31 6 : 0 C56 : 2
1164 : 2 Mean : 7090 Mean :14.84 7 : 1 C61 : 2
2526 : 2 3rd Qu.: 7334 3rd Qu.:13.75 NA's:35 C763 : 2
3561 : 2 Max. :13101 Max. :86.00 J690 : 2
(Other):17 (Other):23
Libelle_DP UF Nb_RUM nb_bas nb_haut
Length:38 SB_HEMATO ONCOLOGIE_HC :13 Min. :1 Min. :0 Min. :-10.000
Class :character SB_MED GERIATRIQUE 1_HC : 5 1st Qu.:1 1st Qu.:0 1st Qu.: -6.000
Mode :character SB_MED GERIATRIQUE 2_HC : 1 Median :1 Median :0 Median : -2.000
SB_MED POLYVALENTE_HC : 0 Mean :1 Mean :0 Mean : 2.842
SB_PNEUMOLOGIE 1_HC : 9 3rd Qu.:1 3rd Qu.:0 3rd Qu.: 1.750
SB_PNEUMOLOGIE 2_HC : 2 Max. :1 Max. :0 Max. : 74.000
SB_UOP_HC : 8
nb_hautbis nb_hautter tarif meilleur_tarif
Min. :-10.000 Min. : 0.000 Min. : 6595 Min. : 6595
1st Qu.: -6.750 1st Qu.: 0.000 1st Qu.: 6595 1st Qu.: 6595
Median : -2.500 Median : 0.000 Median : 6595 Median : 7334
Mean : 2.658 Mean : 5.974 Mean : 9164 Mean : 9702
3rd Qu.: 1.750 3rd Qu.: 1.750 3rd Qu.: 7348 3rd Qu.: 8986
Max. : 74.000 Max. :74.000 Max. :38419 Max. :38419
recetteautreghm<-autreghm%>%select(9,22)
apply(recetteautreghm,2,sum)
Duree_RUM tarif
564.0 348237.8
#au total 564 jours pour recette complete 348 237 euros
#en changeant le dp, on passe d'une valo moyenne de 7090 euros à 9702
en 2022 : 97/185=52% sejours ghm 23z02z avec simulation nouveaux tarifs ghs 7994 avec recette totale 1 269 550 euros 38/185=21% sejours ghm !=23z02z monrum avec obtention meilleure simulation avec recette complete 348 237 euros 50/185=27% sejours ghm!=23z02z multirum simulation impossible dont la valo est :397 056 (valo ghs mais pas tarif total, variable non dispo sur bo)
duree moyenne rum lisp 15,45 jours 15 lits 365 jours 5475 lits jours 5475/15,45=354 taux occupation 90% 0,90*354=318,9 rum lisp/rss
APPLICATION SIMULATION 0.52319=166 sejours 23z02z soit 2 172 631 euros 0.21319=67 sejours soit 613 996 euros 0.27*319=86 sejours soit 682 936 euros
somme recette 3 469 563 euros