Skip to content

Commit

Permalink
update tests to use chi
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed May 22, 2024
1 parent 869be10 commit 1a34fb7
Show file tree
Hide file tree
Showing 25 changed files with 98 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/process_tests_acute.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#'
#' @export
process_tests_acute <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_ae.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_ae <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_alarms_telecare.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#'
#' @export
process_tests_alarms_telecare <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_care_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_care_home <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
3 changes: 3 additions & 0 deletions R/process_tests_cmh.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ process_tests_cmh <- function(data, year) {
return(data)
}

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_delayed_discharges.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#'
#' @export
process_tests_delayed_discharges <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
3 changes: 3 additions & 0 deletions R/process_tests_district_nursing.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ process_tests_district_nursing <- function(data, year) {
return(data)
}

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)
data <- rename_hscp(data)

Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_gp_ooh.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_gp_ooh <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_home_care.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_home_care <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_homelessness.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#'
#' @export
process_tests_homelessness <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_it_chi_deaths.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#'
#' @export
process_tests_it_chi_deaths <- function(data, update = previous_update()) {

data <- data %>%
slfhelper::get_chi()

comparison <- produce_test_comparison(
old_data = produce_it_chi_deaths_tests(
read_file(get_slf_chi_deaths_path(update = update))
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_ltcs.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_ltcs <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

# Find and flag any duplicate chis and chi/postcode combinations
duplicates <- data %>%
dplyr::summarise(
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_maternity.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_maternity <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_mental_health.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_mental_health <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_nrs_deaths.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_nrs_deaths <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_outpatients.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_outpatients <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_prescribing.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_prescribing <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_sc_all_at_episodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#'
#' @export
process_tests_sc_all_at_episodes <- function(data) {

data <- data %>%
slfhelper::get_chi()

comparison <- produce_test_comparison(
old_data = produce_sc_all_episodes_tests(
read_file(get_sc_at_episodes_path(update = previous_update()))
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_sc_all_ch_episodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#'
#' @export
process_tests_sc_all_ch_episodes <- function(data) {

data <- data %>%
slfhelper::get_chi()

comparison <- produce_test_comparison(
old_data = produce_sc_all_episodes_tests(
read_file(get_sc_ch_episodes_path(update = previous_update()))
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_sc_all_hc_episodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#'
#' @export
process_tests_sc_all_hc_episodes <- function(data) {

data <- data %>%
slfhelper::get_chi()

comparison <- produce_test_comparison(
old_data = produce_sc_all_episodes_tests(
read_file(get_sc_hc_episodes_path(update = previous_update()))
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_sc_all_sds_episodes.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#'
#' @export
process_tests_sc_all_sds_episodes <- function(data) {

data <- data %>%
slfhelper::get_chi()

comparison <- produce_test_comparison(
old_data = produce_sc_all_episodes_tests(
read_file(get_sc_sds_episodes_path(update = previous_update()))
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_sc_demographics.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#'
#' @export
process_tests_sc_demographics <- function(data) {

data <- data %>%
slfhelper::get_chi()

comparison <- produce_test_comparison(
old_data = produce_sc_demog_lookup_tests(
read_file(get_sc_demog_lookup_path(update = previous_update()))
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_sc_sandpit.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#' @export
#'
process_tests_sc_sandpit <- function(type = c("at", "hc", "ch", "sds", "demographics", "client"), year = NULL) {

data <- data %>%
slfhelper::get_chi()

comparison <- produce_test_comparison(
old_data = produce_sc_sandpit_tests(
read_file(get_sandpit_extract_path(type = {{ type }}, year = year, update = previous_update())),
Expand Down
4 changes: 4 additions & 0 deletions R/process_tests_sds.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
#'
#' @export
process_tests_sds <- function(data, year) {

data <- data %>%
slfhelper::get_chi()

old_data <- get_existing_data_for_tests(data)

data <- rename_hscp(data)
Expand Down
4 changes: 4 additions & 0 deletions R/produce_sc_all_episodes_tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#'
#' @family social care test functions
produce_sc_all_episodes_tests <- function(data) {

data <- data %>%
slfhelper::get_chi()

data %>%
# create test flags
create_demog_test_flags(chi = .data$chi) %>%
Expand Down

0 comments on commit 1a34fb7

Please sign in to comment.