Skip to content

Commit

Permalink
1018 moving dd hl1 (#1019)
Browse files Browse the repository at this point in the history
* moving dd and homelessness to front

* fix typos

* Update documentation

* Style code

---------

Co-authored-by: lizihao-anu <[email protected]>
Co-authored-by: Jennit07 <[email protected]>
  • Loading branch information
3 people authored Oct 25, 2024
1 parent ffa3d0c commit 4107720
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions R/create_episode_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @param processed_data_list containing data from processed extracts.
#' @param year The year to process, in FY format.
#' @param homelessness_lookup the lookup file for homelessness
#' @param sc_client scoial care lookup file
#' @param sc_client social care lookup file
#' @param write_to_disk (optional) Should the data be written to disk default is
#' `TRUE` i.e. write the data to disk.
#' @param anon_chi_out (Default:TRUE) Should `anon_chi` be used in the output
Expand Down Expand Up @@ -41,6 +41,10 @@ create_episode_file <- function(
episode_file <- dplyr::bind_rows(processed_data_list) %>%
slfhelper::get_chi() %>%
write_temp_data(year, file_name = "ep_temp1", write_temp_to_disk) %>%
add_homelessness_flag(year, lookup = homelessness_lookup) %>%
add_homelessness_date_flags(year, lookup = homelessness_lookup) %>%
link_delayed_discharge_eps(year, dd_data) %>%
write_temp_data(year, file_name = "ep_temp1-2", write_temp_to_disk) %>%
create_cost_inc_dna() %>%
apply_cost_uplift() %>%
store_ep_file_vars(
Expand Down Expand Up @@ -127,11 +131,8 @@ create_episode_file <- function(
write_temp_data(year, file_name = "ep_temp2", write_temp_to_disk) %>%
correct_cij_vars() %>%
fill_missing_cij_markers() %>%
add_homelessness_flag(year, lookup = homelessness_lookup) %>%
add_homelessness_date_flags(year, lookup = homelessness_lookup) %>%
add_ppa_flag() %>%
write_temp_data(year, file_name = "ep_temp3", write_temp_to_disk) %>%
link_delayed_discharge_eps(year, dd_data) %>%
add_nsu_cohort(year, nsu_cohort) %>%
match_on_ltcs(year, ltc_data) %>%
correct_demographics(year) %>%
Expand Down
1 change: 0 additions & 1 deletion R/link_delayed_discharge_eps.R
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ link_delayed_discharge_eps <- function(
# keep variables from ep files
dplyr::select(
-c(
"ep_file_row_id",
"year",
"recid",
"record_keydate1",
Expand Down
3 changes: 1 addition & 2 deletions R/write_temp_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ write_temp_data <-
full_file_name
)

cli::cli_alert_info(stringr::str_glue("Writing {full_file_name} to disk started at {Sys.time()}"))

write_file(data,
path = file_path
)
cli::cli_alert_info(stringr::str_glue("Writing {full_file_name} to disk finished at {Sys.time()}"))
}
return(data)
}
Expand Down
2 changes: 1 addition & 1 deletion man/create_episode_file.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4107720

Please sign in to comment.