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

Bug - Tidy commhosp variable #1045

Merged
merged 7 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# March 2025 Update - Unreleased
* 24/25 files have been updated, containing data up to December 2024.
* 17/18 - 23/24 files have been updated.
* The variable `commhosp` has been tidied up - now shows Y/N for all available datasets
Jennit07 marked this conversation as resolved.
Show resolved Hide resolved

# December 2024 Update - released 10-Dec-24
* 24/25 files have been updated, containing data up to September 2024.
* 17/18 - 23/24 files have been updated.
Expand Down Expand Up @@ -83,7 +88,7 @@
* Homelessness Flags.
* Bug fixes:
* Blank `datazone` in A&E. This has been fixed and was due to PC8 postcode format matching onto SLF pc lookup.
* Large increase in preventable beddays. This was caused due to an SPSS vs R logic difference. Uses SPSS logic which

Check warning on line 91 in NEWS.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`SPSS` is not a recognized word. (unrecognized-spelling)

Check warning on line 91 in NEWS.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`SPSS` is not a recognized word. (unrecognized-spelling)
brings the difference down to `3.3%`.
* Issue with `locality` which showed `locality` in each row instead of its true `locality`. This has now been fixed.
* Duplicated CHI in the individual file. The issue was identified when trying to include HRIs. This has now been corrected.
Expand All @@ -102,7 +107,7 @@
* Removal of `keydate1_dateformat` and `keydate2_dateformat`.
* `dd_responsible_lca` – This variable now uses CA2019 codes instead of the 2-digit ‘old’ LCA code.
* Preventable beddays - not able to calculate these correctly. * Death fixes not included.
* Variables not ordered in R like they used to be in SPSS.

Check warning on line 110 in NEWS.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`SPSS` is not a recognized word. (unrecognized-spelling)
* End of HHG.
* New variable `ch_postcode`.
* rename of variables `cost_total_net_incdnas`, `ooh_outcome.1`, `ooh_outcome.2`, `ooh_outcome.3`, `ooh_outcome.4`, `totalnodncontacts`.
Expand Down Expand Up @@ -163,7 +168,7 @@
* Fixed a bug where CH costs was not referring to end of year.
* e.g. 2018 costs relates to 2017/18
* The changes to Homelessness described in the March update have been properly implemented.
* We now use [`{haven}`](https://haven.tidyverse.org/news/index.html) to compress the SPSS files which compresses them better than SPSS does 🤷

Check warning on line 171 in NEWS.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`SPSS` is not a recognized word. (unrecognized-spelling)

Check warning on line 171 in NEWS.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`SPSS` is not a recognized word. (unrecognized-spelling)
♂️
* `cij_marker` is now a numeric instead of a string which changes empty strings to missing instead of blank using sysmis.
* Check code of the form `cij_marker = "x"`. `x` now needs to be a numeric.
Expand Down
4 changes: 3 additions & 1 deletion R/process_extract_ae.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ process_extract_ae <- function(data, year, write_to_disk = TRUE) {
smrtype = add_smrtype(.data$recid)
) %>%
# Allocate the costs to the correct month
create_day_episode_costs(.data$record_keydate1, .data$cost_total_net)
create_day_episode_costs(.data$record_keydate1, .data$cost_total_net) %>%
# clean up commhosp values
dplyr::mutate(commhosp = dplyr::if_else(.data$commhosp == 1L, "Y", "N"))


# Factors ---------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion R/process_extract_outpatients.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ process_extract_outpatients <- function(data, year, write_to_disk = TRUE) {
# Allocate the costs to the correct month
create_day_episode_costs(.data$record_keydate1, .data$cost_total_net) %>%
# sort by chi record_keydate1
dplyr::arrange(.data$chi, .data$record_keydate1)
dplyr::arrange(.data$chi, .data$record_keydate1) %>%
# clean up commhosp values
dplyr::mutate(commhosp = dplyr::if_else(.data$commhosp == 1L, "Y", "N"))

# Factors ---------------------------------------
outpatients_clean <- outpatients_clean %>%
Expand Down
3 changes: 2 additions & 1 deletion R/read_extract_ae.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ read_extract_ae <- function(
"Total Net Costs" = readr::col_double(),
"Age at Midpoint of Financial Year" = readr::col_double(),
"Case Reference Number" = readr::col_character(),
"Significant Facility Code" = readr::col_character()
"Significant Facility Code" = readr::col_character(),
"Community Hospital Flag" = readr::col_character(),
)
) %>%
# rename variables
Expand Down
Loading