Skip to content

Commit

Permalink
Merge branch 'care_home_update' of github.com:Public-Health-Scotland/…
Browse files Browse the repository at this point in the history
…source-linkage-files into care_home_update
  • Loading branch information
marjom02 committed Jun 20, 2024
2 parents 06dbab6 + c993b5b commit 471e9f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/process_sc_all_care_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ process_sc_all_care_home <- function(
# earlier than the previous discharge date.
# creates a CIS flag for CHI across all of scotland
# and a CIS for social care ID and sending location for just that LA
ch_markers <- matched_deaths_data %>%
ch_chi_markers <- matched_deaths_data %>%
# uses the chi to flag continuous stays. Will flag cases even if in another LA
dplyr::group_by(.data[["chi"]]) %>%
# create variable for previous discharge date + 1 day
Expand Down Expand Up @@ -272,6 +272,7 @@ process_sc_all_care_home <- function(
# This is the same but uses the social care id and sending location so can be used for
# episodes that are not attached to a CHI number
# This will restrict continuous stays to each Local Authority
sc_ch_id_markers() <- chi_chi_markers %>%
dplyr::group_by(.data[["social_care_id"]], .data[["sending_location"]]) %>%
# create variable for previous discharge date + 1 day
dplyr::mutate(previous_discharge_date_sc = dplyr::lag(.data[["ch_discharge_date"]]) + lubridate::days(1L)) %>%
Expand All @@ -296,7 +297,7 @@ process_sc_all_care_home <- function(


# Do a recode on the old reason for admission for respite stays.
adm_reason_recoded <- ch_markers %>%
adm_reason_recoded <- sc_ch_id_markers %>%
dplyr::group_by(
.data[["social_care_id"]],
.data[["sending_location"]],
Expand Down

0 comments on commit 471e9f1

Please sign in to comment.