Skip to content

Commit

Permalink
Add warning to deprecated old vaccine data types (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanpaulrsoucy committed Oct 6, 2023
1 parent ff856b1 commit 9866266
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 107 deletions.
24 changes: 17 additions & 7 deletions R/process_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
#' \item vaccine_administration_dose_4
#' \item vaccine_administration_dose_5
#' \item vaccine_administration_last_6_months
#' \item vaccine_total_doses
#' \item vaccine_dose_1
#' \item vaccine_dose_2
#' \item vaccine_dose_3
#' \item vaccine_dose_4
#' \item vaccine_additional_doses
#' \item hospitalizations
#' \item hospitalizations_cum
#' \item hosp_admissions
Expand All @@ -56,7 +50,6 @@ process_dataset <- function(uuid,
"recovered",
"active",
"testing",
"vaccine_distribution",
"vaccine_coverage_dose_1",
"vaccine_coverage_dose_2",
"vaccine_coverage_dose_3",
Expand All @@ -70,6 +63,7 @@ process_dataset <- function(uuid,
"vaccine_administration_dose_4",
"vaccine_administration_dose_5",
"vaccine_administration_last_6_months",
"vaccine_distribution_total_doses",
"hospitalizations",
"hospitalizations_cum",
"hosp_admissions",
Expand All @@ -94,10 +88,26 @@ process_dataset <- function(uuid,
stop("Specified UUID does not exist in datasets.json.")
}

# warn about deprecated values:
if (val %in% c(
"vaccine_administration",
"vaccine_completion",
"vaccine_total_doses",
"vaccine_dose_1",
"vaccine_dose_2",
"vaccine_dose_3",
"vaccine_dose_4",
"vaccine_additional_doses",
"vaccine_distribution"
)) {
warning("Value has been deprecated: ", val)
}

# for backwards compatibility: rename val
val <- dplyr::case_when(
val == "vaccine_administration" ~ "vaccine_total_doses",
val == "vaccine_completion" ~ "vaccine_dose_2",
val == "vaccine_distribution" ~ "vaccine_distribution_total_doses",
TRUE ~ val
)

Expand Down
6 changes: 0 additions & 6 deletions man/process_ab.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_bc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_can.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 4 additions & 10 deletions man/process_dataset.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_mb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_nb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_nl.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_ns.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_nt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_nu.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_on.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_on_phu.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_pe.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_qc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_sk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions man/process_yt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9866266

Please sign in to comment.