Skip to content

Commit

Permalink
Use rename_hscp function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennit07 committed Nov 20, 2023
1 parent 6bd69de commit 24939d6
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 96 deletions.
7 changes: 1 addition & 6 deletions R/process_tests_acute.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
process_tests_acute <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_extract_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_ae.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_ae <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_extract_tests(old_data,
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_alarms_telecare.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
process_tests_alarms_telecare <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_at_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_care_home.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_care_home <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_ch_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_cmh.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ process_tests_cmh <- function(data, year) {

old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_cmh_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_delayed_discharges.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
process_tests_delayed_discharges <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_dd_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_district_nursing.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ process_tests_district_nursing <- function(data, year) {
~ tidyr::replace_na(.x, 0.0)
))

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_dn_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_gp_ooh.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_gp_ooh <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_extract_tests(old_data,
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_home_care.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_home_care <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_hc_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_homelessness.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
process_tests_homelessness <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_slf_homelessness_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_maternity.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_maternity <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_extract_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_mental_health.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_mental_health <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_extract_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_nrs_deaths.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_nrs_deaths <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_nrs_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_outpatients.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_outpatients <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_extract_tests(old_data,
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_prescribing.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_prescribing <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_pis_tests(old_data),
Expand Down
7 changes: 1 addition & 6 deletions R/process_tests_sds.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
process_tests_sds <- function(data, year) {
old_data <- get_existing_data_for_tests(data)

if ("hscp" %in% names(data)) {
data <- data %>%
dplyr::rename("hscp2018" = "hscp")
} else {
data <- data
}
data <- rename_hscp(data)

comparison <- produce_test_comparison(
old_data = produce_source_sds_tests(old_data),
Expand Down

0 comments on commit 24939d6

Please sign in to comment.