From 0e19c5f31b2293494a699db9c8ef2c025f2a7a79 Mon Sep 17 00:00:00 2001 From: Jennifer Thom Date: Wed, 28 Aug 2024 16:20:31 +0100 Subject: [PATCH] Update `run_slf_manually` scripts --- .../run_episode_file_1718.R | 4 - .../run_episode_file_1819.R | 4 - .../run_episode_file_1920.R | 4 - .../run_episode_file_2021.R | 4 - .../run_episode_file_2122.R | 4 - .../run_episode_file_2223.R | 4 - .../run_episode_file_2324.R | 4 - .../run_episode_file_2425.R | 75 +++++++++++++++++++ .../run_individual_file_2425.R | 9 +++ 9 files changed, 84 insertions(+), 28 deletions(-) create mode 100644 Run_SLF_Files_manually/run_episode_file_2425.R create mode 100644 Run_SLF_Files_manually/run_individual_file_2425.R diff --git a/Run_SLF_Files_manually/run_episode_file_1718.R b/Run_SLF_Files_manually/run_episode_file_1718.R index f679ea669..b405b5b6e 100644 --- a/Run_SLF_Files_manually/run_episode_file_1718.R +++ b/Run_SLF_Files_manually/run_episode_file_1718.R @@ -18,10 +18,6 @@ processed_data_list <- list( "source_cmh_extract_1718", store = targets_store ), - cmh = targets::tar_read( - "source_cmh_extract_1718", - store = targets_store - ), dn = targets::tar_read( "source_dn_extract_1718", store = targets_store diff --git a/Run_SLF_Files_manually/run_episode_file_1819.R b/Run_SLF_Files_manually/run_episode_file_1819.R index d7a65690e..fb3227512 100644 --- a/Run_SLF_Files_manually/run_episode_file_1819.R +++ b/Run_SLF_Files_manually/run_episode_file_1819.R @@ -18,10 +18,6 @@ processed_data_list <- list( "source_cmh_extract_1819", store = targets_store ), - cmh = targets::tar_read( - "source_cmh_extract_1819", - store = targets_store - ), dn = targets::tar_read( "source_dn_extract_1819", store = targets_store diff --git a/Run_SLF_Files_manually/run_episode_file_1920.R b/Run_SLF_Files_manually/run_episode_file_1920.R index e3c2ebeb0..e2e21bdac 100644 --- a/Run_SLF_Files_manually/run_episode_file_1920.R +++ b/Run_SLF_Files_manually/run_episode_file_1920.R @@ -18,10 +18,6 @@ processed_data_list <- list( "source_cmh_extract_1920", store = targets_store ), - cmh = targets::tar_read( - "source_cmh_extract_1920", - store = targets_store - ), dn = targets::tar_read( "source_dn_extract_1920", store = targets_store diff --git a/Run_SLF_Files_manually/run_episode_file_2021.R b/Run_SLF_Files_manually/run_episode_file_2021.R index c66f4572d..cf98e80de 100644 --- a/Run_SLF_Files_manually/run_episode_file_2021.R +++ b/Run_SLF_Files_manually/run_episode_file_2021.R @@ -18,10 +18,6 @@ processed_data_list <- list( "source_cmh_extract_2021", store = targets_store ), - cmh = targets::tar_read( - "source_cmh_extract_2021", - store = targets_store - ), dn = targets::tar_read( "source_dn_extract_2021", store = targets_store diff --git a/Run_SLF_Files_manually/run_episode_file_2122.R b/Run_SLF_Files_manually/run_episode_file_2122.R index cde974be2..3bcbf2466 100644 --- a/Run_SLF_Files_manually/run_episode_file_2122.R +++ b/Run_SLF_Files_manually/run_episode_file_2122.R @@ -18,10 +18,6 @@ processed_data_list <- list( "source_cmh_extract_2122", store = targets_store ), - cmh = targets::tar_read( - "source_cmh_extract_2122", - store = targets_store - ), dn = targets::tar_read( "source_dn_extract_2122", store = targets_store diff --git a/Run_SLF_Files_manually/run_episode_file_2223.R b/Run_SLF_Files_manually/run_episode_file_2223.R index ee83082f1..af0447eed 100644 --- a/Run_SLF_Files_manually/run_episode_file_2223.R +++ b/Run_SLF_Files_manually/run_episode_file_2223.R @@ -18,10 +18,6 @@ processed_data_list <- list( "source_cmh_extract_2223", store = targets_store ), - cmh = targets::tar_read( - "source_cmh_extract_2223", - store = targets_store - ), dn = targets::tar_read( "source_dn_extract_2223", store = targets_store diff --git a/Run_SLF_Files_manually/run_episode_file_2324.R b/Run_SLF_Files_manually/run_episode_file_2324.R index 508689f6d..bdf16e0f8 100644 --- a/Run_SLF_Files_manually/run_episode_file_2324.R +++ b/Run_SLF_Files_manually/run_episode_file_2324.R @@ -18,10 +18,6 @@ processed_data_list <- list( "source_cmh_extract_2324", store = targets_store ), - cmh = targets::tar_read( - "source_cmh_extract_2324", - store = targets_store - ), dn = targets::tar_read( "source_dn_extract_2324", store = targets_store diff --git a/Run_SLF_Files_manually/run_episode_file_2425.R b/Run_SLF_Files_manually/run_episode_file_2425.R new file mode 100644 index 000000000..699c197b3 --- /dev/null +++ b/Run_SLF_Files_manually/run_episode_file_2425.R @@ -0,0 +1,75 @@ +library(targets) +library(createslf) + +year <- "2425" + +targets_store <- fs::path("/conf/sourcedev/Source_Linkage_File_Updates/", "_targets") + +processed_data_list <- list( + acute = targets::tar_read( + "source_acute_extract_2425", + store = targets_store + ), + ae = targets::tar_read( + "source_ae_extract_2425", + store = targets_store + ), + cmh = targets::tar_read( + "source_cmh_extract_2425", + store = targets_store + ), + dn = targets::tar_read( + "source_dn_extract_2425", + store = targets_store + ), + deaths = targets::tar_read( + "source_nrs_deaths_extract_2425", + store = targets_store + ), + homelessness = targets::tar_read( + "source_homelessness_extract_2425", + store = targets_store + ), + maternity = targets::tar_read( + "source_maternity_extract_2425", + store = targets_store + ), + mental_health = targets::tar_read( + "source_mental_health_extract_2425", + store = targets_store + ), + outpatients = targets::tar_read( + "source_outpatients_extract_2425", + store = targets_store + ), + gp_ooh = targets::tar_read( + "source_ooh_extract_2425", + store = targets_store + ), + prescribing = targets::tar_read( + "source_prescribing_extract_2425", + store = targets_store + ), + care_home = targets::tar_read( + "source_sc_care_home_2425", + store = targets_store + ), + home_care = targets::tar_read( + "source_sc_home_care_2425", + store = targets_store + ), + at = targets::tar_read( + "source_sc_alarms_tele_2425", + store = targets_store + ), + sds = targets::tar_read( + "source_sc_sds_2425", + store = targets_store + ) +) + +# Run episode file +create_episode_file(processed_data_list, year = year) %>% + process_tests_episode_file(year = year) + +## End of Script ## diff --git a/Run_SLF_Files_manually/run_individual_file_2425.R b/Run_SLF_Files_manually/run_individual_file_2425.R new file mode 100644 index 000000000..843eb505c --- /dev/null +++ b/Run_SLF_Files_manually/run_individual_file_2425.R @@ -0,0 +1,9 @@ +library(createslf) + +year <- "2425" + +episode_file <- arrow::read_parquet(get_slf_episode_path(year)) + +# Run individual file +create_individual_file(episode_file, year = year) %>% + process_tests_individual_file(year = year)