Skip to content

Commit

Permalink
new section for sc_ch_id_markers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed Jul 17, 2024
1 parent 1a6c230 commit 58bc740
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/process_sc_all_care_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ process_sc_all_care_home <- function(
.data[["sending_location"]]
) %>%
# fills in CIS identifier for all cases
tidyr::fill(ch_chi_cis, .direction = c("down")) %>%
tidyr::fill(ch_chi_cis, .direction = c("down"))


# 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 %>%
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 Down

0 comments on commit 58bc740

Please sign in to comment.