From d77e6c4303682f42a6aafcf67d7c74c808038d26 Mon Sep 17 00:00:00 2001 From: marjom02 Date: Wed, 21 Aug 2024 13:29:40 +0100 Subject: [PATCH 1/3] minor changes to social care code --- R/process_sc_all_care_home.R | 2 +- R/process_sc_all_home_care.R | 2 +- R/replace_sc_id_with_latest.R | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/R/process_sc_all_care_home.R b/R/process_sc_all_care_home.R index 4e4db583f..73232d5e6 100644 --- a/R/process_sc_all_care_home.R +++ b/R/process_sc_all_care_home.R @@ -401,7 +401,7 @@ process_sc_all_care_home <- function( "ch_provider_description", "ch_nursing", "ch_adm_reason", - "type_of_admission", + # "type_of_admission", "sc_latest_submission" ) %>% slfhelper::get_anon_chi() diff --git a/R/process_sc_all_home_care.R b/R/process_sc_all_home_care.R index 275001c64..52cab0568 100644 --- a/R/process_sc_all_home_care.R +++ b/R/process_sc_all_home_care.R @@ -37,7 +37,7 @@ process_sc_all_home_care <- function( # Match on demographic data --------------------------------------- matched_hc_data <- replaced_dates %>% - dplyr::left_join( + dplyr::right_join( sc_demog_lookup, by = c("sending_location", "social_care_id") ) %>% diff --git a/R/replace_sc_id_with_latest.R b/R/replace_sc_id_with_latest.R index 9478ebefe..215816753 100644 --- a/R/replace_sc_id_with_latest.R +++ b/R/replace_sc_id_with_latest.R @@ -48,6 +48,9 @@ replace_sc_id_with_latest <- function(data) { .data$latest_sc_id, .data$social_care_id ) - ) + ) %>% + dplyr::filter(!(is.na(period))) + + return(return_data) } From 94cc6ea439ea3c7e5462fc769aa06adc18354aab Mon Sep 17 00:00:00 2001 From: SwiftySalmon Date: Wed, 21 Aug 2024 12:33:27 +0000 Subject: [PATCH 2/3] Style code --- R/process_sc_all_care_home.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/process_sc_all_care_home.R b/R/process_sc_all_care_home.R index 73232d5e6..f090008d6 100644 --- a/R/process_sc_all_care_home.R +++ b/R/process_sc_all_care_home.R @@ -401,7 +401,7 @@ process_sc_all_care_home <- function( "ch_provider_description", "ch_nursing", "ch_adm_reason", - # "type_of_admission", + # "type_of_admission", "sc_latest_submission" ) %>% slfhelper::get_anon_chi() From 6864531983951d9f275e5907f73bf2fba627417f Mon Sep 17 00:00:00 2001 From: Megan McNicol <43570769+SwiftySalmon@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:38:47 +0100 Subject: [PATCH 3/3] Update process_sc_all_care_home.R --- R/process_sc_all_care_home.R | 1 - 1 file changed, 1 deletion(-) diff --git a/R/process_sc_all_care_home.R b/R/process_sc_all_care_home.R index f090008d6..524be1b2f 100644 --- a/R/process_sc_all_care_home.R +++ b/R/process_sc_all_care_home.R @@ -401,7 +401,6 @@ process_sc_all_care_home <- function( "ch_provider_description", "ch_nursing", "ch_adm_reason", - # "type_of_admission", "sc_latest_submission" ) %>% slfhelper::get_anon_chi()