Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename datazone to datazone2011 #744

Merged
merged 3 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ hms
homecare
hscp
hscpnames
IDPC
infyyear
ipdc
itle
Expand All @@ -100,6 +101,7 @@ keydate
keyring
keytime
keytimex
kis
los
ltc
ltcs
Expand Down
2 changes: 1 addition & 1 deletion R/fill_geographies.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"hbrescode",
"hscp",
"lca",
"datazone",
"datazone2011",
"hbpraccode",
"hbtreatcode",
"gpprac"
Expand Down Expand Up @@ -161,13 +161,13 @@
#'
#' @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

Check warning on line 164 in R/fill_geographies.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/fill_geographies.R,line=164,col=81,[line_length_linter] Lines should not be more than 80 characters.
# e.g. cascade_hscp_lca <- function(hscp, lca) {...}
# Would take HSCP and populate any missing LCA using it
data <- data %>%
dplyr::mutate(
# If we can, 'cascade' the geographies upwards
# i.e. if they have an LCA use this to fill in HSCP2018 and so on for hbrescode

Check warning on line 170 in R/fill_geographies.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/fill_geographies.R,line=170,col=81,[line_length_linter] Lines should not be more than 80 characters.
# Codes are correct as at August 2018
lca = dplyr::case_when(
!is_missing(lca) ~ lca,
Expand Down
2 changes: 1 addition & 1 deletion R/process_extract_acute.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
)
) %>%
# Recode GP practice into 5 digit number
# We assume that if it starts with a letter it's an English practice and so recode to 99995.

Check warning on line 42 in R/process_extract_acute.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_acute.R,line=42,col=81,[line_length_linter] Lines should not be more than 80 characters.
dplyr::mutate(gpprac = convert_eng_gpprac_to_dummy(.data$gpprac)) %>%
# Calculate the total length of stay (for the entire episode, not just within the financial year).

Check warning on line 44 in R/process_extract_acute.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_acute.R,line=44,col=81,[line_length_linter] Lines should not be more than 80 characters.
dplyr::mutate(
stay = calculate_stay(year, .data$record_keydate1, .data$record_keydate2),
# create and populate SMRType
Expand All @@ -49,8 +49,8 @@
) %>%
# Apply new costs for C3 specialty, these are taken from the 2017/18 file
fix_c3_costs(year) %>%
# initialise monthly cost/beddays variables in a separate data frame for matching

Check warning on line 52 in R/process_extract_acute.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_acute.R,line=52,col=81,[line_length_linter] Lines should not be more than 80 characters.
convert_monthly_rows_to_vars(.data$costmonthnum, .data$cost_total_net, .data$yearstay) %>%

Check warning on line 53 in R/process_extract_acute.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_acute.R,line=53,col=81,[line_length_linter] Lines should not be more than 80 characters.
# add yearstay and cost_total_net variables
dplyr::mutate(
yearstay = rowSums(dplyr::across(tidyselect::ends_with("_beddays"))),
Expand Down Expand Up @@ -79,7 +79,7 @@
"hbrescode",
"lca",
"hscp",
"datazone",
"datazone2011",
"location",
"hbtreatcode",
"yearstay",
Expand Down
2 changes: 1 addition & 1 deletion R/process_extract_district_nursing.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @return the final data as a [tibble][tibble::tibble-package].
#' @export
#' @family process extracts
process_extract_district_nursing <- function(

Check warning on line 16 in R/process_extract_district_nursing.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_district_nursing.R,line=16,col=1,[object_length_linter] Variable and function names should not be longer than 30 characters.
data,
year,
costs = read_file(get_dn_costs_path()),
Expand Down Expand Up @@ -107,7 +107,7 @@
"gender",
"gpprac",
"postcode",
"datazone",
"datazone2011",
"lca",
"hscp",
"hbrescode",
Expand Down
2 changes: 1 addition & 1 deletion R/process_extract_gp_ooh.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#' @export
#' @family process extracts
process_extract_gp_ooh <- function(year, data_list, write_to_disk = TRUE) {
diagnosis_extract <- process_extract_ooh_diagnosis(data_list[["diagnosis"]], year)

Check warning on line 16 in R/process_extract_gp_ooh.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_gp_ooh.R,line=16,col=81,[line_length_linter] Lines should not be more than 80 characters.
outcomes_extract <- process_extract_ooh_outcomes(data_list[["outcomes"]], year)

Check warning on line 17 in R/process_extract_gp_ooh.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_gp_ooh.R,line=17,col=81,[line_length_linter] Lines should not be more than 80 characters.
consultations_extract <- process_extract_ooh_consultations(data_list[["consultations"]], year)

Check warning on line 18 in R/process_extract_gp_ooh.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/process_extract_gp_ooh.R,line=18,col=81,[line_length_linter] Lines should not be more than 80 characters.


# Join data ---------------------------------
Expand Down Expand Up @@ -111,7 +111,7 @@
"gpprac",
"postcode",
"hbrescode",
"datazone",
"datazone2011",
"hscp",
"hbtreatcode",
"location",
Expand Down
2 changes: 1 addition & 1 deletion R/process_extract_mental_health.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ process_extract_mental_health <- function(data, year, write_to_disk = TRUE) {
"hbrescode",
"lca",
"hscp",
"datazone",
"datazone2011",
"location",
"hbtreatcode",
"stay",
Expand Down
2 changes: 1 addition & 1 deletion R/read_extract_acute.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ read_extract_acute <- function(year, file_path = get_boxi_extract_path(year = ye
disch = "Discharge Type Code",
falls_adm = "Falls Related Admission (01)",
lca = "Geo Council Area Code",
datazone = "Geo Data Zone 2011",
datazone2011 = "Geo Data Zone 2011",
postcode = "Geo Postcode [C]",
hscp = "Geo HSCP of Residence Code - current",
conc = "Lead Consultant/HCP Code",
Expand Down
2 changes: 1 addition & 1 deletion R/read_extract_district_nursing.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ read_extract_district_nursing <- function(
lca = "Patient Council Area Code (Contact)",
postcode = "Patient Postcode [C] (Contact)",
gpprac = "Practice Code (Contact)",
datazone = "Patient Data Zone 2011 (Contact)",
datazone2011 = "Patient Data Zone 2011 (Contact)",
hbpraccode = "Practice NHS Board Code 9 (Contact)",
hbtreatcode = "Treatment NHS Board Code 9",
chi = "UPI Number [C]",
Expand Down
2 changes: 1 addition & 1 deletion R/read_extract_mental_health.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ read_extract_mental_health <- function(
hbrescode = "NHS Board of Residence Code - current",
lca = "Geo Council Area Code",
hscp = "Geo HSCP of Residence Code - current",
datazone = "Geo Data Zone 2011",
datazone2011 = "Geo Data Zone 2011",
location = "Treatment Location Code",
hbtreatcode = "Treatment NHS Board Code - current",
yearstay = "Occupied Bed Days (04)",
Expand Down
2 changes: 1 addition & 1 deletion R/read_extract_nrs_deaths.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ read_extract_nrs_deaths <- function(
dplyr::rename(
death_location_code = "Death Location Code",
lca = "Geo Council Area Code",
datazone = "Geo Data Zone 2011",
datazone2011 = "Geo Data Zone 2011",
postcode = "Geo Postcode [C]",
hscp = "Geo HSCP of Residence Code - current",
death_board_occurrence = "NHS Board of Occurrence Code - current",
Expand Down
2 changes: 1 addition & 1 deletion R/read_extract_ooh_consultations.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ read_extract_ooh_consultations <- function(
postcode = "Patient Postcode [C]",
hbrescode = "Patient NHS Board Code 9 - current",
hscp = "HSCP of Residence Code Current",
datazone = "Patient Data Zone 2011",
datazone2011 = "Patient Data Zone 2011",
gpprac = "Practice Code",
ooh_case_id = "GUID",
attendance_status = "Consultation Recorded",
Expand Down
2 changes: 1 addition & 1 deletion R/run_episode_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ run_episode_file <- function(processed_data_list, year, write_to_disk = TRUE) {
"cij_dis_spec",
"cost_total_net",
"hscp",
"datazone",
"datazone2011",
"attendance_status",
"deathdiag1",
"deathdiag2",
Expand Down
Loading