vvr_had_ght: ~ VVR - Attribuer les recettes GHT sur des rapss

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Reproduire la valorisation BR et coefficients géo/prudentiels du tableau VALR d'epmsi

Usage

1
vvr_had_ght(p, ghts, coeff_geo = 1.07, coeff_prudent = NULL)

Arguments

p

Un noyau de paramètres créé avec noyau_pmeasyr

ghts

Un tibble contenant une ligne par tarif GHT - année séquentielle des tarifs - type de domicile

coeff_geo

Coefficient géographique, au choix (peut être mis à 1)

coeff_prudent

Coefficient prudentiel, par défaut la fonction créé ce coefficient automatiquement, sinon il peut-être mis à 1 ou autre

Details

Cette fonction ne tient pas compte du fichier de conventions ESMS (cas des finess non conventionnés non pec ici)

Value

Un tibble contenant les valorisations GHT des sous-séquences de la table rapss$ght PAPRICA (et donc des séjours), les coefficient géo et prudentiels sont présents dans la table, la colonne tarif n'en tient pas compte, et il faut multiplier par le nb journées GHT pour obtenir la valorisation totale.

Author(s)

G. Pressiat

See Also

irapss, iano_had

Examples

 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
## Not run: 
library(pmeasyr)
library(dplyr, warn.conflicts = F)

p <- noyau_pmeasyr(
  finess = '750712184',
  annee  = 2018,
  mois   = 12,
  path   = '~/Documents/data/had',
  progress = FALSE,
  tolower_names = TRUE,
  lib = FALSE
)

adezip(p, type = "out", liste = c('rapss', 'ano'))

library(nomensland)
ghts <- get_table('tarifs_had_ght') %>%
  tidyr::gather(type_tarif, tarif, - paprica_numght, - lib_ght) %>%
  mutate(anseqta = stringr::str_extract(type_tarif, '[0-9]{4}'),
         typdom    = substr(type_tarif, 6, nchar(type_tarif)))


# Utiliser cette fonction
base_ght <- vvr_had_ght(p, ghts)



ano <- iano_had(p)

library(stringfix)
# calculer le montant Base remboursement et le nb de journées valorisées
base_ght %>% 
  inner_join(distinct(ano, noseqsej, .keep_all = TRUE), by = 'noseqsej') %>%
  # filtre sur séjours facturables
  filter(factam %in% c('1', '2')) %>% 
  mutate(tarif = tarif * joursght * cgeo * cprudent) %>% 
  summarise(
    euros =  sum(tarif, na.rm = TRUE) %>% round(.,2) %>% 
       formatC(., big.mark = " ", format = "f", digits = 2) %+% "€",
    nbj = sum(joursght))

##| euros      | nbj   |
##|------------|-------|
##| xxx xxx,xx€| x xxx |

## End(Not run)

GuillaumePressiat/pmeasyr2 documentation built on May 11, 2019, 3 p.m.