Skip to content

Commit

Permalink
Add QC hosp_admissions and icu_admissions
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanpaulrsoucy committed Oct 11, 2023
1 parent 833c146 commit 19601b6
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions R/qc.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,44 @@ process_qc <- function(uuid, val, fmt, ds,
e_fmt()
)
},
"hosp_admissions" = {
switch(
fmt,
"prov_ts" = {
ds |>
dplyr::filter(
.data$Regroupement == "R\u00E9gion" & # unicode
.data$Croisement == "RSS99" & # all of Quebec
# note that Hors QC has 0s for this value anyway
.data$Date != "Date inconnue") |>
dplyr::transmute(
date = as.Date(.data$Date),
value = as.integer(.data$hos_quo_tot_pour_n)) |>
dplyr::filter(!is.na(.data$value)) |>
helper_ts(loc = "prov", val, prov, convert_to_cum = TRUE)
},
e_fmt()
)
},
"icu_admissions" = {
switch(
fmt,
"prov_ts" = {
ds |>
dplyr::filter(
.data$Regroupement == "R\u00E9gion" & # unicode
.data$Croisement == "RSS99" & # all of Quebec
# note that Hors QC has 0s for this value anyway
.data$Date != "Date inconnue") |>
dplyr::transmute(
date = as.Date(.data$Date),
value = as.integer(.data$hos_quo_si_pour_n)) |>
dplyr::filter(!is.na(.data$value)) |>
helper_ts(loc = "prov", val, prov, convert_to_cum = TRUE)
},
e_fmt()
)
},
e_val()
)
},
Expand Down

0 comments on commit 19601b6

Please sign in to comment.