diff --git a/R/process_sc_all_care_home.R b/R/process_sc_all_care_home.R index 9f6bcaa3c..6cbce20f6 100644 --- a/R/process_sc_all_care_home.R +++ b/R/process_sc_all_care_home.R @@ -59,9 +59,8 @@ process_sc_all_care_home <- function( fixed_ch_provider <- name_postcode_clean %>% dplyr::select(-ch_name_validated, -open_interval, -latest_close_date, -ch_name_old, -ch_postcode_old) %>% - # Changes in data definitions, 6 is no longer coded as 'other', this is now '5 = other' dplyr::mutate( - ch_provider = dplyr::if_else(is.na(.data[["ch_provider"]]), 5L, .data[["ch_provider"]]) # (n = 2) + ch_provider = dplyr::if_else(is.na(.data[["ch_provider"]]), 6L, .data[["ch_provider"]]) # (n = 2) ) %>% # sort data dplyr::arrange( diff --git a/R/process_tests_care_home.R b/R/process_tests_care_home.R index e26e71133..4c0a20173 100644 --- a/R/process_tests_care_home.R +++ b/R/process_tests_care_home.R @@ -54,12 +54,11 @@ produce_source_ch_tests <- function(data, dplyr::mutate( n_episodes = 1L, ch_name_missing = is.na(.data$ch_name), - # Changes in the data definitions, 6 is no longer coded as 'other', this is now '5 = other' - ch_provider_1_to_4 = dplyr::case_when( - .data$ch_provider %in% c("1", "2", "3", "4") ~ 1L, + ch_provider_1_to_5 = dplyr::case_when( + .data$ch_provider %in% c("1", "2", "3", "4", "5") ~ 1L, TRUE ~ 0L ), - ch_provider_other = .data$ch_provider == "5", + ch_provider_other = .data$ch_provider == "6", ch_adm_reason_missing = is.na(.data$ch_adm_reason) ) %>% create_lca_test_flags(.data$sc_send_lca) %>%