Skip to content

Commit

Permalink
Merge branch 'master' into episode/anon_chi
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 authored Jul 18, 2023
2 parents 2d97da5 + 3b2c54d commit 9e3505e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 19 deletions.
11 changes: 6 additions & 5 deletions R/fill_geographies.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ make_gpprac_lookup <- function(data) {
}

fill_postcode_geogs <- function(data) {
spd <- read_file(get_slf_postcode_path())
slf_pc_lookup <- read_file(get_slf_postcode_path())

filled_postcodes <- dplyr::left_join(
data,
Expand All @@ -102,7 +102,7 @@ fill_postcode_geogs <- function(data) {
) %>%
# Fill geographies
dplyr::left_join(
spd,
slf_pc_lookup,
by = "postcode",
suffix = c("_old", "")
) %>%
Expand All @@ -117,10 +117,11 @@ fill_postcode_geogs <- function(data) {
cascade_geographies() %>%
dplyr::mutate(
hbrescode = dplyr::coalesce(.data$hb2018, .data$hbrescode),
hscp = dplyr::coalesce(.data$hscp2018, .data$hscp),
lca = dplyr::coalesce(.data$lca, .data$lca_old)
hscp2018 = dplyr::coalesce(.data$hscp2018, .data$hscp),
lca = dplyr::coalesce(.data$lca, .data$lca_old),
datazone2011 = dplyr::coalesce(.data$datazone2011, .data$datazone2011_old)
) %>%
dplyr::select(!c("hb2018", "hscp2018", "lca_old", "most_recent_postcode"))
dplyr::select(!c("hb2018", "hscp", "lca_old", "datazone2011_old", "most_recent_postcode"))

return(filled_postcodes)
}
Expand Down
36 changes: 22 additions & 14 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ list(
process_lookup_sc_demographics(
sc_demog_data,
write_to_disk = write_to_disk
)
),
priority = 0.9
),
tar_target(
tests_sc_demog_lookup,
Expand All @@ -70,7 +71,8 @@ list(
process_it_chi_deaths(
data = it_chi_deaths_extract,
write_to_disk = write_to_disk
)
),
priority = 0.9
),
tar_target(
tests_it_chi_deaths,
Expand All @@ -83,7 +85,8 @@ list(
gpprac_ref_path = gpprac_ref_path,
spd_path = spd_path,
write_to_disk = write_to_disk
)
),
priority = 0.9
),
tar_target(
tests_source_gp_lookup,
Expand All @@ -96,16 +99,17 @@ list(
simd_path = simd_path,
locality_path = locality_path,
write_to_disk = write_to_disk
)
),
priority = 0.9
),
tar_target(
tests_source_pc_lookup,
process_tests_lookup_pc(source_pc_lookup)
),
## Cost Lookups ##
tar_target(ch_cost_lookup, process_costs_ch_rmd()),
tar_target(dn_cost_lookup, process_costs_dn_rmd()),
tar_target(hc_cost_lookup, process_costs_hc_rmd()),
tar_target(ch_cost_lookup, process_costs_ch_rmd(), priority = 0.8),
tar_target(dn_cost_lookup, process_costs_dn_rmd(), priority = 0.8),
tar_target(hc_cost_lookup, process_costs_hc_rmd(), priority = 0.8),
tar_target(gp_ooh_cost_lookup, process_costs_gp_ooh_rmd()),
## Social Care - 'All' data ##
tar_target(
Expand All @@ -122,7 +126,8 @@ list(
all_at_extract,
sc_demog_lookup = sc_demog_lookup,
write_to_disk = write_to_disk
)
),
priority = 0.5
),
tar_target(
all_home_care_extract,
Expand All @@ -138,7 +143,8 @@ list(
all_home_care_extract,
sc_demog_lookup = sc_demog_lookup,
write_to_disk = write_to_disk
)
),
priority = 0.5
),
tar_target(
all_care_home_extract,
Expand All @@ -157,7 +163,8 @@ list(
ch_name_lookup_path = slf_ch_name_lookup_path,
spd_path = spd_path,
write_to_disk = write_to_disk
)
),
priority = 0.5
),
tar_target(
tests_all_care_home,
Expand All @@ -177,7 +184,8 @@ list(
all_sds_extract,
sc_demog_lookup = sc_demog_lookup,
write_to_disk = write_to_disk
)
),
priority = 0.5
),
tar_map(
list(year = years_to_run),
Expand Down Expand Up @@ -256,14 +264,14 @@ list(
get_boxi_extract_path(year = year, type = "GP_OoH-c"),
format = "file"
),
tar_target(ooh_data,
tar_qs(
ooh_data,
read_extract_gp_ooh(
year,
diagnosis_data_path,
outcomes_data_path,
consultations_data_path
),
format = "rds"
)
),
### Target source processed extracts ###
tar_target(source_acute_extract, process_extract_acute(
Expand Down

0 comments on commit 9e3505e

Please sign in to comment.