From b1a7e562ff0041037e6f51aaf48cbc8bfa39930b Mon Sep 17 00:00:00 2001 From: Jennit07 <67372904+Jennit07@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:44:16 +0100 Subject: [PATCH] Check scripts are in snake case (#793) * Update `get_boxi_extract_path` for DN/CMH data * Remove extra function * Update documentation * change `get_boxi_extract_path` to snake_case * change `get_source_extract_path` to snake_case * Update documentation * Update targets with snake_case * Fix typo * Style code --------- Co-authored-by: Jennit07 Co-authored-by: James McMahon Co-authored-by: Megan McNicol <43570769+SwiftySalmon@users.noreply.github.com> Co-authored-by: SwiftySalmon --- R/create_individual_file.R | 2 +- R/get_boxi_extract_path.R | 54 ++++++++--------- R/get_source_extract_path.R | 82 +++++++++++++------------- R/link_delayed_discharge_eps.R | 2 +- R/process_extract_acute.R | 2 +- R/process_extract_ae.R | 7 ++- R/process_extract_alarms_telecare.R | 2 +- R/process_extract_care_home.R | 2 +- R/process_extract_cmh.R | 2 +- R/process_extract_delayed_discharges.R | 2 +- R/process_extract_district_nursing.R | 2 +- R/process_extract_gp_ooh.R | 2 +- R/process_extract_home_care.R | 2 +- R/process_extract_maternity.R | 2 +- R/process_extract_mental_health.R | 2 +- R/process_extract_nrs_deaths.R | 2 +- R/process_extract_outpatients.R | 2 +- R/process_extract_prescribing.R | 2 +- R/process_extract_sds.R | 2 +- R/process_lookup_deaths.R | 2 +- R/process_lookup_sc_client.R | 2 +- R/read_extract_acute.R | 2 +- R/read_extract_ae.R | 2 +- R/read_extract_cmh.R | 2 +- R/read_extract_district_nursing.R | 2 +- R/read_extract_gp_ooh.R | 6 +- R/read_extract_homelessness.R | 2 +- R/read_extract_maternity.R | 2 +- R/read_extract_mental_health.R | 2 +- R/read_extract_nrs_deaths.R | 2 +- R/read_extract_ooh_consultations.R | 2 +- R/read_extract_ooh_diagnosis.R | 2 +- R/read_extract_ooh_outcomes.R | 2 +- R/read_extract_outpatients.R | 2 +- _targets.R | 24 ++++---- man/get_boxi_extract_path.Rd | 4 +- man/get_source_extract_path.Rd | 4 +- man/join_sc_client.Rd | 2 +- man/link_delayed_discharge_eps.Rd | 2 +- man/process_slf_deaths_lookup.Rd | 2 +- man/read_extract_acute.Rd | 2 +- man/read_extract_ae.Rd | 2 +- man/read_extract_cmh.Rd | 2 +- man/read_extract_district_nursing.Rd | 2 +- man/read_extract_gp_ooh.Rd | 6 +- man/read_extract_homelessness.Rd | 2 +- man/read_extract_maternity.Rd | 2 +- man/read_extract_mental_health.Rd | 2 +- man/read_extract_nrs_deaths.Rd | 2 +- man/read_extract_ooh_consultations.Rd | 2 +- man/read_extract_ooh_diagnosis.Rd | 2 +- man/read_extract_ooh_outcomes.Rd | 2 +- man/read_extract_outpatients.Rd | 2 +- 53 files changed, 140 insertions(+), 137 deletions(-) diff --git a/R/create_individual_file.R b/R/create_individual_file.R index e6ac8d1d1..021ffe6ab 100644 --- a/R/create_individual_file.R +++ b/R/create_individual_file.R @@ -750,7 +750,7 @@ join_slf_lookup_vars <- function(individual_file, join_sc_client <- function( individual_file, year, - sc_client = read_file(get_source_extract_path(year, "Client")), + sc_client = read_file(get_source_extract_path(year, "client")), sc_demographics = read_file(get_sc_demog_lookup_path(), col_select = c("sending_location", "social_care_id", "chi") )) { diff --git a/R/get_boxi_extract_path.R b/R/get_boxi_extract_path.R index 6096525e5..a4c2e4abc 100644 --- a/R/get_boxi_extract_path.R +++ b/R/get_boxi_extract_path.R @@ -13,23 +13,23 @@ get_boxi_extract_path <- function( year, type = c( - "AE", - "AE_CUP", - "Acute", - "CMH", - "Deaths", - "DN", - "GP_OoH-c", - "GP_OoH-d", - "GP_OoH-o", - "Homelessness", - "Maternity", - "MH", - "Outpatients" + "ae", + "ae_cup", + "acute", + "cmh", + "deaths", + "dn", + "gp_ooh-c", + "gp_ooh-d", + "gp_ooh-o", + "homelessness", + "maternity", + "mh", + "outpatients" )) { type <- match.arg(type) - if (type %in% c("DN", "CMH")) { + if (type %in% c("dn", "cmh")) { dir <- fs::path(get_slf_dir(), "Archived_data") } else { dir <- get_year_dir(year, extracts_dir = TRUE) @@ -41,19 +41,19 @@ get_boxi_extract_path <- function( file_name <- dplyr::case_match( type, - "AE" ~ "A&E-episode-level-extract", - "AE_CUP" ~ "A&E-UCD-CUP-extract", - "Acute" ~ "Acute-episode-level-extract", - "CMH" ~ "Community-MH-contact-level-extract", - "DN" ~ "District-Nursing-contact-level-extract", - "GP_OoH-c" ~ "GP-OoH-consultations-extract", - "GP_OoH-d" ~ "GP-OoH-diagnosis-extract", - "GP_OoH-o" ~ "GP-OoH-outcomes-extract", - "Homelessness" ~ "Homelessness-extract", - "Maternity" ~ "Maternity-episode-level-extract", - "MH" ~ "Mental-Health-episode-level-extract", - "Deaths" ~ "NRS-death-registrations-extract", - "Outpatients" ~ "Outpatients-episode-level-extract" + "ae" ~ "a&e-episode-level-extract", + "ae_cup" ~ "a&e-ucd-cup-extract", + "acute" ~ "acute-episode-level-extract", + "cmh" ~ "community-mh-contact-level-extract", + "dn" ~ "district-nursing-contact-level-extract", + "gp_ooh-c" ~ "gp-ooh-consultations-extract", + "gp_ooh-d" ~ "gp-ooh-diagnosis-extract", + "gp_ooh-o" ~ "gp-ooh-outcomes-extract", + "homelessness" ~ "homelessness-extract", + "maternity" ~ "maternity-episode-level-extract", + "mh" ~ "mental-health-episode-level-extract", + "deaths" ~ "nrs-death-registrations-extract", + "outpatients" ~ "outpatients-episode-level-extract" ) boxi_extract_path_csv_gz <- fs::path( diff --git a/R/get_source_extract_path.R b/R/get_source_extract_path.R index 37ed545cf..f8b3f5d16 100644 --- a/R/get_source_extract_path.R +++ b/R/get_source_extract_path.R @@ -10,28 +10,28 @@ #' @export #' #' @family extract file paths -get_source_extract_path <- function( - year, - type = c( - "Acute", - "AE", - "AT", - "CH", - "Client", - "CMH", - "DD", - "Deaths", - "DN", - "GPOoH", - "HC", - "Homelessness", - "Maternity", - "MH", - "Outpatients", - "PIS", - "SDS" - ), - ...) { +get_source_extract_path <- function(year, + type = c( + "acute", + "ae", + "at", + "ch", + "client", + "cmh", + "dd", + "deaths", + "dn", + "gp_ooh", + "hc", + "homelessness", + "maternity", + "mh", + "outpatients", + "pis", + "sds" + ), + ...) { + if (year %in% type) { cli::cli_abort("{.val {year}} was supplied to the {.arg year} argument.") } @@ -46,24 +46,26 @@ get_source_extract_path <- function( file_name <- dplyr::case_match( type, - "Acute" ~ "acute_for_source", - "AE" ~ "a_and_e_for_source", - "AT" ~ "alarms-telecare-for-source", - "CH" ~ "care_home_for_source", - "CMH" ~ "cmh_for_source", - "Client" ~ "client_for_source", - "DD" ~ "delayed_discharge_for_source", - "Deaths" ~ "deaths_for_source", - "DN" ~ "district_nursing_for_source", - "GPOoH" ~ "gp_ooh_for_source", - "HC" ~ "home_care_for_source", - "Homelessness" ~ "homelessness_for_source", - "Maternity" ~ "maternity_for_source", - "MH" ~ "mental_health_for_source", - "Outpatients" ~ "outpatients_for_source", - "PIS" ~ "prescribing_for_source", - "SDS" ~ "sds_for_source" - ) %>% + "acute" ~ "acute_for_source", + "ae" ~ "a_and_e_for_source", + "at" ~ "alarms-telecare-for-source", + "ch" ~ "care_home_for_source", + "cmh" ~ "cmh_for_source", + "client" ~ "client_for_source", + "dd" ~ "delayed_discharge_for_source", + "deaths" ~ "deaths_for_source", + "dn" ~ "district_nursing_for_source", + "gp_ooh" ~ "gp_ooh_for_source", + "hc" ~ "home_care_for_source", + "homelessness" ~ "homelessness_for_source", + "maternity" ~ "maternity_for_source", + "mh" ~ "mental_health_for_source", + "dd" ~ "dd_for_source", + "outpatients" ~ "outpatients_for_source", + "pis" ~ "prescribing_file_for_source", + "sds" ~ "sds-for-source" + ) + %>% stringr::str_glue("-{year}.parquet") source_extract_path <- get_file_path( diff --git a/R/link_delayed_discharge_eps.R b/R/link_delayed_discharge_eps.R index 5fb19b651..b4c3b2f5b 100644 --- a/R/link_delayed_discharge_eps.R +++ b/R/link_delayed_discharge_eps.R @@ -11,7 +11,7 @@ link_delayed_discharge_eps <- function( episode_file, year, - dd_data = read_file(get_source_extract_path(year, "DD"))) { + dd_data = read_file(get_source_extract_path(year, "dd"))) { episode_file <- episode_file %>% dplyr::mutate( # remember to revoke the cij_end_date with dummy_cij_end diff --git a/R/process_extract_acute.R b/R/process_extract_acute.R index 70ff29370..c327f4b66 100644 --- a/R/process_extract_acute.R +++ b/R/process_extract_acute.R @@ -113,7 +113,7 @@ process_extract_acute <- function(data, year, write_to_disk = TRUE) { if (write_to_disk) { write_file( acute_processed, - get_source_extract_path(year, "Acute", check_mode = "write") + get_source_extract_path(year, "acute", check_mode = "write") ) } diff --git a/R/process_extract_ae.R b/R/process_extract_ae.R index d4ab9bf7c..5e16af767 100644 --- a/R/process_extract_ae.R +++ b/R/process_extract_ae.R @@ -192,7 +192,7 @@ process_extract_ae <- function(data, year, write_to_disk = TRUE) { # Read in data--------------------------------------- ae_cup_file <- read_file( - path = get_boxi_extract_path(year, "AE_CUP"), + path = get_boxi_extract_path(year, "ae_cup), col_type = readr::cols( "ED Arrival Date" = readr::col_date(format = "%Y/%m/%d %T"), "ED Arrival Time" = readr::col_time(""), @@ -292,11 +292,12 @@ process_extract_ae <- function(data, year, write_to_disk = TRUE) { ) if (write_to_disk) { + write_file( ae_processed, - get_source_extract_path(year, "AE", check_mode = "write") + get_source_extract_path(year, "ae", check_mode = "write") ) - } + } return(ae_processed) } diff --git a/R/process_extract_alarms_telecare.R b/R/process_extract_alarms_telecare.R index 9a0745a04..0ef686881 100644 --- a/R/process_extract_alarms_telecare.R +++ b/R/process_extract_alarms_telecare.R @@ -64,7 +64,7 @@ process_extract_alarms_telecare <- function( if (write_to_disk) { at_data %>% write_file( - get_source_extract_path(year, type = "AT", check_mode = "write") + get_source_extract_path(year, type = "at", check_mode = "write") ) } diff --git a/R/process_extract_care_home.R b/R/process_extract_care_home.R index cbf6d417c..177229755 100644 --- a/R/process_extract_care_home.R +++ b/R/process_extract_care_home.R @@ -143,7 +143,7 @@ process_extract_care_home <- function( if (write_to_disk) { write_file( ch_processed, - get_source_extract_path(year, type = "CH", check_mode = "write") + get_source_extract_path(year, type = "ch", check_mode = "write") ) } diff --git a/R/process_extract_cmh.R b/R/process_extract_cmh.R index a2adad75e..bbce59f0f 100644 --- a/R/process_extract_cmh.R +++ b/R/process_extract_cmh.R @@ -73,7 +73,7 @@ process_extract_cmh <- function(data, if (write_to_disk) { write_file( cmh_processed, - get_source_extract_path(year, "CMH", check_mode = "write") + get_source_extract_path(year, "cmh", check_mode = "write") ) } diff --git a/R/process_extract_delayed_discharges.R b/R/process_extract_delayed_discharges.R index 3c56807f9..c16748a2d 100644 --- a/R/process_extract_delayed_discharges.R +++ b/R/process_extract_delayed_discharges.R @@ -110,7 +110,7 @@ process_extract_delayed_discharges <- function( if (write_to_disk) { write_file( dd_final, - get_source_extract_path(year, "DD", check_mode = "write") + get_source_extract_path(year, "dd", check_mode = "write") ) } diff --git a/R/process_extract_district_nursing.R b/R/process_extract_district_nursing.R index 9d1df62a6..02f23719f 100644 --- a/R/process_extract_district_nursing.R +++ b/R/process_extract_district_nursing.R @@ -135,7 +135,7 @@ process_extract_district_nursing <- function( if (write_to_disk) { dn_episodes %>% - write_file(get_source_extract_path(year, "DN", check_mode = "write")) + write_file(get_source_extract_path(year, "dn", check_mode = "write")) } return(dn_episodes) diff --git a/R/process_extract_gp_ooh.R b/R/process_extract_gp_ooh.R index 2b536878a..3503888b6 100644 --- a/R/process_extract_gp_ooh.R +++ b/R/process_extract_gp_ooh.R @@ -127,7 +127,7 @@ process_extract_gp_ooh <- function(year, data_list, write_to_disk = TRUE) { if (write_to_disk) { final_data %>% - write_file(get_source_extract_path(year, "GPOoH", check_mode = "write")) + write_file(get_source_extract_path(year, "gp_ooh", check_mode = "write")) } return(final_data) diff --git a/R/process_extract_home_care.R b/R/process_extract_home_care.R index 874ad899c..857f3006f 100644 --- a/R/process_extract_home_care.R +++ b/R/process_extract_home_care.R @@ -104,7 +104,7 @@ process_extract_home_care <- function( if (write_to_disk) { write_file( hc_processed, - get_source_extract_path(year, type = "HC", check_mode = "write") + get_source_extract_path(year, type = "hc", check_mode = "write") ) } diff --git a/R/process_extract_maternity.R b/R/process_extract_maternity.R index 64fa4e205..7bb016243 100644 --- a/R/process_extract_maternity.R +++ b/R/process_extract_maternity.R @@ -112,7 +112,7 @@ process_extract_maternity <- function(data, year, write_to_disk = TRUE) { if (write_to_disk) { write_file( maternity_processed, - get_source_extract_path(year, "Maternity", check_mode = "write") + get_source_extract_path(year, "maternity", check_mode = "write") ) } diff --git a/R/process_extract_mental_health.R b/R/process_extract_mental_health.R index ffea63d28..b8d89377d 100644 --- a/R/process_extract_mental_health.R +++ b/R/process_extract_mental_health.R @@ -117,7 +117,7 @@ process_extract_mental_health <- function(data, year, write_to_disk = TRUE) { if (write_to_disk) { write_file( mh_processed, - get_source_extract_path(year, "MH", check_mode = "write") + get_source_extract_path(year, "mh", check_mode = "write") ) } diff --git a/R/process_extract_nrs_deaths.R b/R/process_extract_nrs_deaths.R index ecb10d2e0..71e19d456 100644 --- a/R/process_extract_nrs_deaths.R +++ b/R/process_extract_nrs_deaths.R @@ -27,7 +27,7 @@ process_extract_nrs_deaths <- function(data, year, write_to_disk = TRUE) { if (write_to_disk) { deaths_clean %>% - write_file(get_source_extract_path(year, "Deaths", check_mode = "write")) + write_file(get_source_extract_path(year, "deaths", check_mode = "write")) } return(deaths_clean) diff --git a/R/process_extract_outpatients.R b/R/process_extract_outpatients.R index 341ee0f1a..86262e6b3 100644 --- a/R/process_extract_outpatients.R +++ b/R/process_extract_outpatients.R @@ -87,7 +87,7 @@ process_extract_outpatients <- function(data, year, write_to_disk = TRUE) { if (write_to_disk) { write_file( outpatients_processed, - get_source_extract_path(year, "Outpatients", check_mode = "write") + get_source_extract_path(year, "outpatients", check_mode = "write") ) } diff --git a/R/process_extract_prescribing.R b/R/process_extract_prescribing.R index 68c388b83..c54a55b65 100644 --- a/R/process_extract_prescribing.R +++ b/R/process_extract_prescribing.R @@ -52,7 +52,7 @@ process_extract_prescribing <- function(data, year, write_to_disk = TRUE) { if (write_to_disk) { write_file( pis_clean, - get_source_extract_path(year, "PIS", check_mode = "write") + get_source_extract_path(year, "pis", check_mode = "write") ) } diff --git a/R/process_extract_sds.R b/R/process_extract_sds.R index bd9e93a3f..d8c43507c 100644 --- a/R/process_extract_sds.R +++ b/R/process_extract_sds.R @@ -58,7 +58,7 @@ process_extract_sds <- function( if (write_to_disk) { outfile %>% - write_file(get_source_extract_path(year, type = "SDS", check_mode = "write")) + write_file(get_source_extract_path(year, type = "sds", check_mode = "write")) } return(outfile) diff --git a/R/process_lookup_deaths.R b/R/process_lookup_deaths.R index 6485d4e7f..1150059a7 100644 --- a/R/process_lookup_deaths.R +++ b/R/process_lookup_deaths.R @@ -16,7 +16,7 @@ process_slf_deaths_lookup <- function( year, nrs_deaths_data = read_file( - get_source_extract_path(year, "Deaths"), + get_source_extract_path(year, "deaths"), col_select = c("chi", "record_keydate1") ), chi_deaths_data = read_file(get_slf_chi_deaths_path()), diff --git a/R/process_lookup_sc_client.R b/R/process_lookup_sc_client.R index 87e6b107d..e5ea3447b 100644 --- a/R/process_lookup_sc_client.R +++ b/R/process_lookup_sc_client.R @@ -124,7 +124,7 @@ process_lookup_sc_client <- function(data, year, write_to_disk = TRUE) { if (write_to_disk) { write_file( sc_client_lookup, - get_source_extract_path(year, "Client", check_mode = "write") + get_source_extract_path(year, "client", check_mode = "write") ) } diff --git a/R/read_extract_acute.R b/R/read_extract_acute.R index 84baa6f5b..7a227db73 100644 --- a/R/read_extract_acute.R +++ b/R/read_extract_acute.R @@ -6,7 +6,7 @@ #' @return a [tibble][tibble::tibble-package]. #' #' @export -read_extract_acute <- function(year, file_path = get_boxi_extract_path(year = year, type = "Acute")) { +read_extract_acute <- function(year, file_path = get_boxi_extract_path(year = year, type = "acute")) { # Read BOXI extract extract_acute <- read_file(file_path, col_type = readr::cols( diff --git a/R/read_extract_ae.R b/R/read_extract_ae.R index dab886816..e426a167c 100644 --- a/R/read_extract_ae.R +++ b/R/read_extract_ae.R @@ -6,7 +6,7 @@ #' read_extract_ae <- function( year, - file_path = get_boxi_extract_path(year = year, type = "AE")) { + file_path = get_boxi_extract_path(year = year, type = "ae")) { extract_ae <- read_file(file_path, col_type = readr::cols( "Arrival Date" = readr::col_date(format = "%Y/%m/%d %T"), diff --git a/R/read_extract_cmh.R b/R/read_extract_cmh.R index da627a67a..0beb4ea4a 100644 --- a/R/read_extract_cmh.R +++ b/R/read_extract_cmh.R @@ -5,7 +5,7 @@ #' @export read_extract_cmh <- function( year, - file_path = get_boxi_extract_path(year = year, type = "CMH")) { + file_path = get_boxi_extract_path(year = year, type = "cmh")) { # Specify years available for running if (file_path == get_dummy_boxi_extract_path()) { return(tibble::tibble()) diff --git a/R/read_extract_district_nursing.R b/R/read_extract_district_nursing.R index e84856586..59b1142e5 100644 --- a/R/read_extract_district_nursing.R +++ b/R/read_extract_district_nursing.R @@ -5,7 +5,7 @@ #' @export read_extract_district_nursing <- function( year, - file_path = get_boxi_extract_path(year = year, type = "DN")) { + file_path = get_boxi_extract_path(year = year, type = "dn")) { if (file_path == get_dummy_boxi_extract_path()) { return(tibble::tibble()) } diff --git a/R/read_extract_gp_ooh.R b/R/read_extract_gp_ooh.R index 3a711c2f8..ca7d32b51 100644 --- a/R/read_extract_gp_ooh.R +++ b/R/read_extract_gp_ooh.R @@ -13,9 +13,9 @@ #' @export #' @family process extracts read_extract_gp_ooh <- function(year, - diagnosis_path = get_boxi_extract_path(year = year, type = "GP_OoH-d"), - outcomes_path = get_boxi_extract_path(year = year, type = "GP_OoH-o"), - consultations_path = get_boxi_extract_path(year = year, type = "GP_OoH-c")) { + diagnosis_path = get_boxi_extract_path(year = year, type = "gp_ooh-d"), + outcomes_path = get_boxi_extract_path(year = year, type = "gp_ooh-o"), + consultations_path = get_boxi_extract_path(year = year, type = "gp_ooh-c")) { ooh_extracts <- list( "diagnosis" = read_extract_ooh_diagnosis(year, diagnosis_path), "outcomes" = read_extract_ooh_outcomes(year, outcomes_path), diff --git a/R/read_extract_homelessness.R b/R/read_extract_homelessness.R index 64ebb639e..58888c5b8 100644 --- a/R/read_extract_homelessness.R +++ b/R/read_extract_homelessness.R @@ -5,7 +5,7 @@ #' @export read_extract_homelessness <- function( year, - file_path = get_boxi_extract_path(year = year, type = "Homelessness")) { + file_path = get_boxi_extract_path(year = year, type = "homelessness")) { # Specify years available for running if (file_path == get_dummy_boxi_extract_path()) { return(tibble::tibble()) diff --git a/R/read_extract_maternity.R b/R/read_extract_maternity.R index d92295690..e03b50e12 100644 --- a/R/read_extract_maternity.R +++ b/R/read_extract_maternity.R @@ -5,7 +5,7 @@ #' @export read_extract_maternity <- function( year, - file_path = get_boxi_extract_path(year = year, type = "Maternity")) { + file_path = get_boxi_extract_path(year = year, type = "maternity")) { # Read BOXI extract extract_maternity <- read_file(file_path, col_type = readr::cols( diff --git a/R/read_extract_mental_health.R b/R/read_extract_mental_health.R index fa236ecb1..687e656d0 100644 --- a/R/read_extract_mental_health.R +++ b/R/read_extract_mental_health.R @@ -5,7 +5,7 @@ #' @export read_extract_mental_health <- function( year, - file_path = get_boxi_extract_path(year = year, type = "MH")) { + file_path = get_boxi_extract_path(year = year, type = "mh")) { # Read BOXI extract extract_mental_health <- read_file(file_path, col_types = readr::cols_only( diff --git a/R/read_extract_nrs_deaths.R b/R/read_extract_nrs_deaths.R index efcc0f148..c852748b9 100644 --- a/R/read_extract_nrs_deaths.R +++ b/R/read_extract_nrs_deaths.R @@ -5,7 +5,7 @@ #' @export read_extract_nrs_deaths <- function( year, - file_path = get_boxi_extract_path(year = year, type = "Deaths")) { + file_path = get_boxi_extract_path(year = year, type = "deaths")) { extract_nrs_deaths <- read_file(file_path, col_types = readr::cols_only( "Death Location Code" = readr::col_character(), diff --git a/R/read_extract_ooh_consultations.R b/R/read_extract_ooh_consultations.R index 4e16527a3..d6f19c127 100644 --- a/R/read_extract_ooh_consultations.R +++ b/R/read_extract_ooh_consultations.R @@ -5,7 +5,7 @@ #' @return a [tibble][tibble::tibble-package] with OOH Consultations extract data read_extract_ooh_consultations <- function( year, - file_path = get_boxi_extract_path(year = year, type = "GP_OoH-c")) { + file_path = get_boxi_extract_path(year = year, type = "gp_ooh-c")) { # Read consultations data consultations_extract <- read_file(file_path, col_types = readr::cols( diff --git a/R/read_extract_ooh_diagnosis.R b/R/read_extract_ooh_diagnosis.R index 33ef7eb5c..c93d5aaa1 100644 --- a/R/read_extract_ooh_diagnosis.R +++ b/R/read_extract_ooh_diagnosis.R @@ -6,7 +6,7 @@ #' read_extract_ooh_diagnosis <- function( year, - file_path = get_boxi_extract_path(year = year, type = "GP_OoH-d")) { + file_path = get_boxi_extract_path(year = year, type = "gp_ooh-d")) { # Load extract file diagnosis_extract <- read_file(file_path, # All columns are character type diff --git a/R/read_extract_ooh_outcomes.R b/R/read_extract_ooh_outcomes.R index 949e17133..acfd8ae50 100644 --- a/R/read_extract_ooh_outcomes.R +++ b/R/read_extract_ooh_outcomes.R @@ -5,7 +5,7 @@ #' @return a [tibble][tibble::tibble-package] with OOH Outcomes extract data read_extract_ooh_outcomes <- function( year, - file_path = get_boxi_extract_path(year = year, type = "GP_OoH-o")) { + file_path = get_boxi_extract_path(year = year, type = "gp_ooh-o")) { ## Load extract file outcomes_extract <- read_file(file_path, # All columns are character type diff --git a/R/read_extract_outpatients.R b/R/read_extract_outpatients.R index 20b4880bf..9ff60a36f 100644 --- a/R/read_extract_outpatients.R +++ b/R/read_extract_outpatients.R @@ -5,7 +5,7 @@ #' @export read_extract_outpatients <- function( year, - file_path = get_boxi_extract_path(year = year, type = "Outpatient")) { + file_path = get_boxi_extract_path(year = year, type = "outpatient")) { # Read BOXI extract extract_outpatients <- read_file(file_path, col_type = readr::cols( diff --git a/_targets.R b/_targets.R index e358d9baa..c6f0a5c3f 100644 --- a/_targets.R +++ b/_targets.R @@ -206,47 +206,47 @@ list( ### target data extracts ### tar_file_read( acute_data, - get_boxi_extract_path(year, type = "Acute"), + get_boxi_extract_path(year, type = "acute"), read_extract_acute(year, !!.x) ), tar_file_read( ae_data, - get_boxi_extract_path(year, type = "AE"), + get_boxi_extract_path(year, type = "ae"), read_extract_ae(year, !!.x) ), tar_file_read( cmh_data, - get_boxi_extract_path(year, type = "CMH"), + get_boxi_extract_path(year, type = "cmh"), read_extract_cmh(year, !!.x) ), tar_file_read( dn_data, - get_boxi_extract_path(year, type = "DN"), + get_boxi_extract_path(year, type = "dn"), read_extract_district_nursing(year, !!.x) ), tar_file_read( homelessness_data, - get_boxi_extract_path(year, type = "Homelessness"), + get_boxi_extract_path(year, type = "homelessness"), read_extract_homelessness(year, !!.x) ), tar_file_read( maternity_data, - get_boxi_extract_path(year, type = "Maternity"), + get_boxi_extract_path(year, type = "maternity"), read_extract_maternity(year, !!.x) ), tar_file_read( mental_health_data, - get_boxi_extract_path(year, type = "MH"), + get_boxi_extract_path(year, type = "mh"), read_extract_mental_health(year, !!.x) ), tar_file_read( nrs_deaths_data, - get_boxi_extract_path(year, type = "Deaths"), + get_boxi_extract_path(year, type = "deaths"), read_extract_nrs_deaths(year, !!.x) ), tar_file_read( outpatients_data, - get_boxi_extract_path(year, type = "Outpatient"), + get_boxi_extract_path(year, type = "outpatient"), read_extract_outpatients(year, !!.x) ), tar_file_read( @@ -256,17 +256,17 @@ list( ), tar_target( diagnosis_data_path, - get_boxi_extract_path(year = year, type = "GP_OoH-d"), + get_boxi_extract_path(year = year, type = "gp_ooh-d"), format = "file" ), tar_target( outcomes_data_path, - get_boxi_extract_path(year = year, type = "GP_OoH-o"), + get_boxi_extract_path(year = year, type = "gp_ooh-o"), format = "file" ), tar_target( consultations_data_path, - get_boxi_extract_path(year = year, type = "GP_OoH-c"), + get_boxi_extract_path(year = year, type = "gp_ooh-c"), format = "file" ), tar_qs( diff --git a/man/get_boxi_extract_path.Rd b/man/get_boxi_extract_path.Rd index 9a97ac199..c012ac3ef 100644 --- a/man/get_boxi_extract_path.Rd +++ b/man/get_boxi_extract_path.Rd @@ -6,8 +6,8 @@ \usage{ get_boxi_extract_path( year, - type = c("AE", "AE_CUP", "Acute", "CMH", "Deaths", "DN", "GP_OoH-c", "GP_OoH-d", - "GP_OoH-o", "Homelessness", "Maternity", "MH", "Outpatients") + type = c("ae", "ae_cup", "acute", "cmh", "deaths", "dn", "gp_ooh-c", "gp_ooh-d", + "gp_ooh-o", "homelessness", "maternity", "mh", "outpatients") ) } \arguments{ diff --git a/man/get_source_extract_path.Rd b/man/get_source_extract_path.Rd index e51cbb2c7..48c665a83 100644 --- a/man/get_source_extract_path.Rd +++ b/man/get_source_extract_path.Rd @@ -6,8 +6,8 @@ \usage{ get_source_extract_path( year, - type = c("Acute", "AE", "AT", "CH", "Client", "CMH", "DD", "Deaths", "DN", "GPOoH", - "HC", "Homelessness", "Maternity", "MH", "Outpatients", "PIS", "SDS"), + type = c("acute", "ae", "at", "ch", "client", "cmh", "dd", "deaths", "dn", "gp_ooh", + "hc", "homelessness", "maternity", "mh", "outpatients", "pis", "sds"), ... ) } diff --git a/man/join_sc_client.Rd b/man/join_sc_client.Rd index a30719698..4ed9cf896 100644 --- a/man/join_sc_client.Rd +++ b/man/join_sc_client.Rd @@ -7,7 +7,7 @@ join_sc_client( individual_file, year, - sc_client = read_file(get_source_extract_path(year, "Client")), + sc_client = read_file(get_source_extract_path(year, "client")), sc_demographics = read_file(get_sc_demog_lookup_path(), col_select = c("sending_location", "social_care_id", "chi")) ) diff --git a/man/link_delayed_discharge_eps.Rd b/man/link_delayed_discharge_eps.Rd index 245fa2754..981c01dc3 100644 --- a/man/link_delayed_discharge_eps.Rd +++ b/man/link_delayed_discharge_eps.Rd @@ -7,7 +7,7 @@ link_delayed_discharge_eps( episode_file, year, - dd_data = read_file(get_source_extract_path(year, "DD")) + dd_data = read_file(get_source_extract_path(year, "dd")) ) } \arguments{ diff --git a/man/process_slf_deaths_lookup.Rd b/man/process_slf_deaths_lookup.Rd index 2ecde97ce..8ad103a2a 100644 --- a/man/process_slf_deaths_lookup.Rd +++ b/man/process_slf_deaths_lookup.Rd @@ -6,7 +6,7 @@ \usage{ process_slf_deaths_lookup( year, - nrs_deaths_data = read_file(get_source_extract_path(year, "Deaths"), col_select = + nrs_deaths_data = read_file(get_source_extract_path(year, "deaths"), col_select = c("chi", "record_keydate1")), chi_deaths_data = read_file(get_slf_chi_deaths_path()), write_to_disk = TRUE diff --git a/man/read_extract_acute.Rd b/man/read_extract_acute.Rd index a924c2f80..1c63d7edf 100644 --- a/man/read_extract_acute.Rd +++ b/man/read_extract_acute.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_acute( year, - file_path = get_boxi_extract_path(year = year, type = "Acute") + file_path = get_boxi_extract_path(year = year, type = "acute") ) } \arguments{ diff --git a/man/read_extract_ae.Rd b/man/read_extract_ae.Rd index 803b281ac..1a15efbc1 100644 --- a/man/read_extract_ae.Rd +++ b/man/read_extract_ae.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_ae( year, - file_path = get_boxi_extract_path(year = year, type = "AE") + file_path = get_boxi_extract_path(year = year, type = "ae") ) } \arguments{ diff --git a/man/read_extract_cmh.Rd b/man/read_extract_cmh.Rd index 1f76e8292..f0701e41c 100644 --- a/man/read_extract_cmh.Rd +++ b/man/read_extract_cmh.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_cmh( year, - file_path = get_boxi_extract_path(year = year, type = "CMH") + file_path = get_boxi_extract_path(year = year, type = "cmh") ) } \arguments{ diff --git a/man/read_extract_district_nursing.Rd b/man/read_extract_district_nursing.Rd index 9f4188a5f..07065a3c5 100644 --- a/man/read_extract_district_nursing.Rd +++ b/man/read_extract_district_nursing.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_district_nursing( year, - file_path = get_boxi_extract_path(year = year, type = "DN") + file_path = get_boxi_extract_path(year = year, type = "dn") ) } \arguments{ diff --git a/man/read_extract_gp_ooh.Rd b/man/read_extract_gp_ooh.Rd index 73e6672d9..1a4231d41 100644 --- a/man/read_extract_gp_ooh.Rd +++ b/man/read_extract_gp_ooh.Rd @@ -6,9 +6,9 @@ \usage{ read_extract_gp_ooh( year, - diagnosis_path = get_boxi_extract_path(year = year, type = "GP_OoH-d"), - outcomes_path = get_boxi_extract_path(year = year, type = "GP_OoH-o"), - consultations_path = get_boxi_extract_path(year = year, type = "GP_OoH-c") + diagnosis_path = get_boxi_extract_path(year = year, type = "gp_ooh-d"), + outcomes_path = get_boxi_extract_path(year = year, type = "gp_ooh-o"), + consultations_path = get_boxi_extract_path(year = year, type = "gp_ooh-c") ) } \arguments{ diff --git a/man/read_extract_homelessness.Rd b/man/read_extract_homelessness.Rd index bb03535d5..7ec69d301 100644 --- a/man/read_extract_homelessness.Rd +++ b/man/read_extract_homelessness.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_homelessness( year, - file_path = get_boxi_extract_path(year = year, type = "Homelessness") + file_path = get_boxi_extract_path(year = year, type = "homelessness") ) } \arguments{ diff --git a/man/read_extract_maternity.Rd b/man/read_extract_maternity.Rd index 6fe10b491..9a04d34f1 100644 --- a/man/read_extract_maternity.Rd +++ b/man/read_extract_maternity.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_maternity( year, - file_path = get_boxi_extract_path(year = year, type = "Maternity") + file_path = get_boxi_extract_path(year = year, type = "maternity") ) } \arguments{ diff --git a/man/read_extract_mental_health.Rd b/man/read_extract_mental_health.Rd index 3b6e0b619..58115215c 100644 --- a/man/read_extract_mental_health.Rd +++ b/man/read_extract_mental_health.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_mental_health( year, - file_path = get_boxi_extract_path(year = year, type = "MH") + file_path = get_boxi_extract_path(year = year, type = "mh") ) } \arguments{ diff --git a/man/read_extract_nrs_deaths.Rd b/man/read_extract_nrs_deaths.Rd index d7b63b2db..8b810aebd 100644 --- a/man/read_extract_nrs_deaths.Rd +++ b/man/read_extract_nrs_deaths.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_nrs_deaths( year, - file_path = get_boxi_extract_path(year = year, type = "Deaths") + file_path = get_boxi_extract_path(year = year, type = "deaths") ) } \arguments{ diff --git a/man/read_extract_ooh_consultations.Rd b/man/read_extract_ooh_consultations.Rd index 05d0bda31..b4ecc62f6 100644 --- a/man/read_extract_ooh_consultations.Rd +++ b/man/read_extract_ooh_consultations.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_ooh_consultations( year, - file_path = get_boxi_extract_path(year = year, type = "GP_OoH-c") + file_path = get_boxi_extract_path(year = year, type = "gp_ooh-c") ) } \arguments{ diff --git a/man/read_extract_ooh_diagnosis.Rd b/man/read_extract_ooh_diagnosis.Rd index b0d015554..93a8196cf 100644 --- a/man/read_extract_ooh_diagnosis.Rd +++ b/man/read_extract_ooh_diagnosis.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_ooh_diagnosis( year, - file_path = get_boxi_extract_path(year = year, type = "GP_OoH-d") + file_path = get_boxi_extract_path(year = year, type = "gp_ooh-d") ) } \arguments{ diff --git a/man/read_extract_ooh_outcomes.Rd b/man/read_extract_ooh_outcomes.Rd index bd563cd12..4bf02fcb5 100644 --- a/man/read_extract_ooh_outcomes.Rd +++ b/man/read_extract_ooh_outcomes.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_ooh_outcomes( year, - file_path = get_boxi_extract_path(year = year, type = "GP_OoH-o") + file_path = get_boxi_extract_path(year = year, type = "gp_ooh-o") ) } \arguments{ diff --git a/man/read_extract_outpatients.Rd b/man/read_extract_outpatients.Rd index 8fb31475b..92a46376b 100644 --- a/man/read_extract_outpatients.Rd +++ b/man/read_extract_outpatients.Rd @@ -6,7 +6,7 @@ \usage{ read_extract_outpatients( year, - file_path = get_boxi_extract_path(year = year, type = "Outpatient") + file_path = get_boxi_extract_path(year = year, type = "outpatient") ) } \arguments{