Skip to content

Commit

Permalink
Merge branch 'december-2024' into sequence-extracts-tests-writing
Browse files Browse the repository at this point in the history
  • Loading branch information
lizihao-anu authored Oct 15, 2024
2 parents b4f8dc4 + e61f1af commit d924cbd
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 24 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# September 2024 Update - Unreleased
# September 2024 Update - released 13-Sep-24
* New 24/25 files created
* New NSU cohort for 23/24 available
* New SPARRA scores calculated from April 24/25
Expand Down
1 change: 0 additions & 1 deletion R/fill_geographies.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ fill_gpprac_geographies <- function(
#'
#' @return data with matched HSCP and LCA codes
cascade_geographies <- function(data) {
# TODO rework this function into a series of smaller functions which operate on vectors
# e.g. cascade_hscp_lca <- function(hscp, lca) {...}
# Would take HSCP and populate any missing LCA using it
data <- data %>%
Expand Down
1 change: 0 additions & 1 deletion R/process_extract_alarms_telecare.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ process_extract_alarms_telecare <- function(
"smrtype",
"chi",
"dob",
# "person_id",
"gender",
"postcode",
"sc_send_lca",
Expand Down
1 change: 0 additions & 1 deletion R/process_extract_care_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ process_extract_care_home <- function(
"recid",
"smrtype",
"chi",
# "person_id",
"dob",
"gender",
"postcode",
Expand Down
1 change: 0 additions & 1 deletion R/process_extract_gp_ooh.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ process_extract_gp_ooh <- function(year,
)

# Keep the location descriptions as a lookup.
# TODO write the GP OoH lookup out using some functions
location_lookup <- ooh_clean %>%
dplyr::group_by(.data$location) %>%
dplyr::summarise(
Expand Down
3 changes: 1 addition & 2 deletions R/process_extract_home_care.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ process_extract_home_care <- function(
tidyselect::starts_with("hc_cost_"),
"cost_total_net",
"hc_provider",
"hc_reablement",
# "person_id"
"hc_reablement"
) %>%
slfhelper::get_anon_chi()

Expand Down
1 change: 0 additions & 1 deletion R/process_extract_homelessness.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ process_extract_homelessness <- function(
dplyr::rename(hl1_completeness = "pct_complete_all") %>%
dplyr::mutate(hl1_completeness = round(.data$hl1_completeness, 1))

# TODO - Include person_id (from client_id)
final_data <- hl1_data %>%
dplyr::select(
"year",
Expand Down
1 change: 0 additions & 1 deletion R/process_extract_sds.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ process_extract_sds <- function(
"smrtype",
"chi",
"dob",
# "person_id",
"gender",
"postcode",
"sc_send_lca",
Expand Down
6 changes: 0 additions & 6 deletions R/process_sc_all_alarms_telecare.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ process_sc_all_alarms_telecare <- function(
# Replace social_care_id with latest if needed (assuming replace_sc_id_with_latest is a custom function)
data <- replace_sc_id_with_latest(data)

# data$person_id <- paste0(
# data$sending_location,
# "-",
# data$social_care_id
# )

# Deal with episodes that have a package across quarters
data[, pkg_count := seq_len(.N), by = list(
Expand Down Expand Up @@ -125,7 +120,6 @@ process_sc_all_alarms_telecare <- function(
dob = data.table::last(dob),
postcode = data.table::last(postcode),
recid = data.table::last(recid),
# person_id = data.table::last(person_id),
sc_send_lca = data.table::last(sc_send_lca)
), by = list(
sending_location,
Expand Down
1 change: 0 additions & 1 deletion R/process_sc_all_care_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ process_sc_all_care_home <- function(
)) %>%
dplyr::select(
"chi",
# "person_id",
"gender",
"dob",
"postcode",
Expand Down
6 changes: 0 additions & 6 deletions R/process_sc_all_sds.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ process_sc_all_sds <- function(
"SDS",
convert_sc_sending_location_to_lca(sending_location)
)]
# sds_full_clean_long$person_id <- paste0(
# sds_full_clean_long$sending_location,
# "-",
# sds_full_clean_long$social_care_id
# )

# Group, arrange and create flags for episodes
sds_full_clean_long[,
Expand Down Expand Up @@ -176,7 +171,6 @@ process_sc_all_sds <- function(
dob = data.table::last(dob),
postcode = data.table::last(postcode),
recid = data.table::last(recid),
# person_id = data.table::last(person_id),
sc_send_lca = data.table::last(sc_send_lca)
), by = list(sending_location, social_care_id, smrtype, episode_counter)]
rm(sds_full_clean_long)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ phs_db_connection <- function(dsn, username = Sys.getenv("USER")) {
}


# TODO- check R conversion for SC demog lookup. This may differ
#' Social Care Demographic Lookup File Path
#'
#' @description Get the file path for the Social Care Demographic lookup file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ source("All_years/04-Social_Care/00-Social_Care_functions.R")
sc_con <- phs_db_connection(dsn = "DVPROD")

# Read demographic file
# TODO replace the demographic file with R code
demog_file <- read_demog_file(
social_care_dir = social_care_dir,
latest_update = latest_update()
Expand Down

0 comments on commit d924cbd

Please sign in to comment.