BYOC_ID: 45966 Refactor sc demographics#1313
Conversation
| if (!fs::file_exists(get_sandpit_extract_path(type = "demographics"))) { | ||
| sc_demog %>% | ||
| write_file(get_sandpit_extract_path(type = "demographics"), | ||
| group_id = 3206 # hscdiip owner | ||
| ) | ||
|
|
||
| sc_demog %>% | ||
| process_tests_sc_sandpit(type = "demographics") | ||
| } | ||
|
|
There was a problem hiding this comment.
I've removed this intermediate saving of extracts. I think this would be redundant in the automation. However, if anyone has reasons to keep this, please let me know. I think this will also appear in other social care datasets!
Good spot - i think i still need to add this to |
Change made. Ready for another review/test once we have the data. Thanks @LucyEmma22 for all your suggestions |
| # Function | ||
| get_spd_path(), | ||
| get_spd_data(BYOC_MODE), | ||
| format = "file" |
There was a problem hiding this comment.
Should this be removed as spd_data is now a tibble rather than a filepath?
| get_slf_ch_name_lookup_path(), | ||
| slf_ch_name_lookup_data, | ||
| get_slf_ch_name_lookup_data(BYOC_MODE), | ||
| format = "file" |
There was a problem hiding this comment.
Should this be removed as slf_ch_name_lookup_data is now a tibble rather than a filepath?
| slf_ch_name_lookup_path, | ||
| get_slf_ch_name_lookup_path(), | ||
| slf_ch_name_lookup_data, | ||
| get_slf_ch_name_lookup_data(BYOC_MODE), |
There was a problem hiding this comment.
Should this be:
get_slf_ch_name_lookup_data(
denodo_connect = get_denodo_connection(BYOC_MODE = BYOC_MODE),
BYOC_MODE = BYOC_MODE
)
| spd_data, | ||
| # Function | ||
| get_spd_path(), | ||
| get_spd_data(BYOC_MODE), |
There was a problem hiding this comment.
Should this be:
get_spd_data(
denodo_connect = get_denodo_connection(BYOC_MODE = BYOC_MODE),
BYOC_MODE = BYOC_MODE
)
| age = as.difftime(180, units = "days") | ||
| ) | ||
| uk_postcode_data, | ||
| get_uk_postcode_data(BYOC_MODE) |
There was a problem hiding this comment.
Should this be:
get_uk_postcode_data(
denodo_connect = get_denodo_connection(BYOC_MODE = BYOC_MODE),
BYOC_MODE = BYOC_MODE
)
| "combined_deaths", | ||
| "chi_deaths" | ||
| ) | ||
| types = c("demog") |
There was a problem hiding this comment.
I think this should be types = c("sc_demog_lookup")?
There was a problem hiding this comment.
Aye. It should be sc_demog_lookup to match the current changes.
| spd_data, | ||
| # Function | ||
| get_spd_data(BYOC_MODE), | ||
| format = "file" |
There was a problem hiding this comment.
Should this be removed as spd_data is now a tibble rather than a filepath?
| tar_target( | ||
| slf_ch_name_lookup_data, | ||
| get_slf_ch_name_lookup_data(BYOC_MODE), | ||
| format = "file" |
There was a problem hiding this comment.
Should this be removed as slf_ch_name_lookup_data is now a tibble rather than a filepath?
| # Target name | ||
| spd_data, | ||
| # Function | ||
| get_spd_data(BYOC_MODE), |
There was a problem hiding this comment.
Should this be:
get_spd_data(
denodo_connect = get_denodo_connection(BYOC_MODE = BYOC_MODE),
BYOC_MODE = BYOC_MODE
)
| tar_target( | ||
| # Target name | ||
| uk_postcode_data, | ||
| get_uk_postcode_data(BYOC_MODE) |
There was a problem hiding this comment.
Should this be:
get_uk_postcode_data(
denodo_connect = get_denodo_connection(BYOC_MODE = BYOC_MODE),
BYOC_MODE = BYOC_MODE
)
| # Care home name look up------ | ||
| tar_target( | ||
| slf_ch_name_lookup_data, | ||
| get_slf_ch_name_lookup_data(BYOC_MODE), |
There was a problem hiding this comment.
Should this be:
get_slf_ch_name_lookup_data(
denodo_connect = get_denodo_connection(BYOC_MODE = BYOC_MODE),
BYOC_MODE = BYOC_MODE
)
There was a problem hiding this comment.
I think the following targets also need to be added to this script?
source_gp_lookup
tests_source_gp_lookup
source_pc_lookup
tests_source_pc_lookup
all_care_home
tests_all_care_home
|
|
||
| # postcode data | ||
| spd_file <- read_file(spd_path) %>% | ||
| spd_file <- get_spd_data(BYOC_MODE) %>% |
There was a problem hiding this comment.
This should be in the parameter now
| spd_file <- read_file( | ||
| path = spd_path, | ||
| col_select = c( | ||
| spd_file <- get_spd_data(BYOC_MODE) %>% |
There was a problem hiding this comment.
This should be in the parameter
| ch_name_lookup <- openxlsx::read.xlsx(ch_name_lookup_path, | ||
| detectDates = TRUE | ||
| ) %>% | ||
| ch_name_lookup <- get_slf_ch_name_lookup_data(BYOC_MODE) %>% |
There was a problem hiding this comment.
add this to the parameter
PR not ready - WIP
Opening as a draft to review changes.
TODO:
get_sc_demog_lookup_path()to work in byoc modespd_path = get_spd_path()uk_pc_path = get_uk_postcode_path()spd_pathand update accordinglyThis PR is linked with SC Care Homes. Please merge care home branch into demographics branch before testing in development.
Data not ready in SDL - On hold for testing locally/in BYOC
#1299