Skip to content

Commit

Permalink
use anon_chi for sc demogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed May 21, 2024
1 parent a280507 commit d3b596c
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions R/process_lookup_sc_demographics.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ process_lookup_sc_demographics <- function(
dplyr::n_distinct(sc_demog_lookup$chi) # 524810
dplyr::n_distinct(sc_demog_lookup$social_care_id) # 636404

sc_demog_lookup <- sc_demog_lookup %>%
slfhelper::get_anon_chi()

if (write_to_disk) {
write_file(
Expand Down
2 changes: 1 addition & 1 deletion R/process_sc_all_alarms_telecare.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
process_sc_all_alarms_telecare <- function(
data,
sc_demog_lookup = read_file(get_sc_demog_lookup_path()),
sc_demog_lookup = read_file(get_sc_demog_lookup_path()) %>% slfhelper::get_chi(),
write_to_disk = TRUE) {
# Data Cleaning-----------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion R/process_sc_all_care_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#'
process_sc_all_care_home <- function(
data,
sc_demog_lookup = read_file(get_sc_demog_lookup_path()),
sc_demog_lookup = read_file(get_sc_demog_lookup_path()) %>% slfhelper::get_chi(),
it_chi_deaths_data = read_file(get_slf_chi_deaths_path()),
ch_name_lookup_path = read_file(get_slf_ch_name_lookup_path()),
spd_path = read_file(get_spd_path()),
Expand Down
2 changes: 1 addition & 1 deletion R/process_sc_all_home_care.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#'
process_sc_all_home_care <- function(
data,
sc_demog_lookup = read_file(get_sc_demog_lookup_path()),
sc_demog_lookup = read_file(get_sc_demog_lookup_path()) %>% slfhelper::get_chi(),
write_to_disk = TRUE) {
replaced_dates <- data %>%
dplyr::filter(.data$hc_start_date_after_period_end_date != 1) %>%
Expand Down
2 changes: 1 addition & 1 deletion R/process_sc_all_sds.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#'
process_sc_all_sds <- function(
data,
sc_demog_lookup = read_file(get_sc_demog_lookup_path()),
sc_demog_lookup = read_file(get_sc_demog_lookup_path()) %>% slfhelper::get_chi(),
write_to_disk = TRUE) {
# Match on demographics data (chi, gender, dob and postcode)
matched_sds_data <- data %>%
Expand Down
1 change: 1 addition & 0 deletions R/read_lookup_sc_demographics.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ read_lookup_sc_demographics <- function(sc_dvprod_connection = phs_db_connection

if (!fs::file_exists(get_sandpit_extract_path(type = "demographics"))) {
sc_demog %>%
slfhelper::get_anon_chi(chi = "chi_upi") %>%
write_file(get_sandpit_extract_path(type = "demographics"))

sc_demog %>%
Expand Down

0 comments on commit d3b596c

Please sign in to comment.