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

Merge Sept update 23 into master #838

Merged
merged 129 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
d9ac7ca
Bump `{slfhelper}` version
Moohan Jul 26, 2023
d731bf7
Remove unnecessary code from `get_anon_chi` (#759)
SwiftySalmon Jul 28, 2023
1269b3b
Set the default reporter for `tar_outdated()` and friends
Moohan Jul 31, 2023
1ea0a1a
Comment out dataset writing targets
Moohan Jul 31, 2023
965f05c
Make sure `year` is added as the first variable
Moohan Jul 31, 2023
d75922a
Correct some documentation (#769)
Moohan Aug 1, 2023
5fd538f
Make some changes suggested by lintr
Moohan Aug 1, 2023
4c9c175
Document
Moohan Aug 1, 2023
6e55e84
Merge branch 'master' into development
Moohan Aug 1, 2023
9644e0e
Fix documentation typo
Moohan Aug 1, 2023
42e461f
Investigate missing datazone from episode file (#773)
Jennit07 Aug 2, 2023
720b20d
Remove some obsolete code (#770)
Moohan Aug 2, 2023
4a03434
Simplify `create_hscp_test_flags` (#772)
Jennit07 Aug 2, 2023
f6be11c
Rewrite case when statements (#780)
SwiftySalmon Aug 3, 2023
bb3dbd5
Update R-CMD-check.yaml (#781)
Moohan Aug 4, 2023
8aba847
WIP - add sc client tests
Jennit07 Aug 4, 2023
99ab85f
Update documentation
Jennit07 Aug 4, 2023
598d6ad
New function `create_sending_location_test_flags`
Jennit07 Aug 7, 2023
0339c4f
Update documentation
Jennit07 Aug 7, 2023
8857e0a
Style code
Jennit07 Aug 7, 2023
f207b25
Fix typo
Moohan Aug 7, 2023
f949576
Sort the data so `lag` works as expected
Moohan Aug 7, 2023
4e7b1c5
Use `""` in `select` instead of `.data$,,,`
Moohan Aug 7, 2023
a7243db
Update documentation
Moohan Aug 7, 2023
04399a4
added solve for hscp names (#789)
SwiftySalmon Aug 9, 2023
3820c19
Fix locality (#802)
Moohan Aug 14, 2023
f15039c
Merge branch 'development' into sept-update-23
Jennit07 Aug 14, 2023
8ea15c0
Add simple scripts for running targets as a workbench job (#767)
Moohan Aug 14, 2023
80799a2
Fix CHI duplicates of chi in individual file (#791)
lizihao-anu Aug 14, 2023
19779e3
Update NSU code for new 22/23 cohort (#784)
Jennit07 Aug 14, 2023
7e3215d
Amend `get_boxi_extract_path` function for archiving DN and CMH data …
Jennit07 Aug 14, 2023
612e069
Fix increase in total preventable beddays (#779)
lizihao-anu Aug 14, 2023
184ef65
Add 2324 targets/workbench job file
Moohan Aug 14, 2023
06c9944
Use `get_source_extract_path` in homelessness (#796)
Moohan Aug 14, 2023
9a0007a
Correct tests for NSU
Moohan Aug 14, 2023
51a0b05
fix warning on `:=` (#797)
lizihao-anu Aug 15, 2023
fc256e7
Update script for extracting NSU from SMRA space
Jennit07 Aug 15, 2023
0f25195
Add 2324 targets/workbench job file
Moohan Aug 14, 2023
c4a54f8
Use `get_source_extract_path` in homelessness (#796)
Moohan Aug 14, 2023
e36c97c
Correct tests for NSU
Moohan Aug 14, 2023
a724206
Update year in 99_NSU extract script
Jennit07 Aug 15, 2023
9e2ce2d
Update news for September 23 update (#811)
Jennit07 Aug 15, 2023
399a1f0
Apply styling
Jennit07 Aug 16, 2023
311f1c2
Fix issue with `case_match` types (#810)
Moohan Aug 16, 2023
1d9e6e9
Bug - Outpatients tests failing due to missing HSCP (#816)
Jennit07 Aug 16, 2023
516545c
fix read_sc_all_alarms_telecare with incorrect format in period (#814)
lizihao-anu Aug 16, 2023
c609ccf
Fix `convert_sending_location_to_lca` example
Moohan Aug 16, 2023
62a4174
Update script for extracting NSU from SMRA space
Jennit07 Aug 15, 2023
d310dfd
Update year in 99_NSU extract script
Jennit07 Aug 15, 2023
51c4a63
Update news for September 23 update (#811)
Jennit07 Aug 15, 2023
ee3943f
Apply styling
Jennit07 Aug 16, 2023
61283cc
Fix issue with `case_match` types (#810)
Moohan Aug 16, 2023
c88562c
Bug - Outpatients tests failing due to missing HSCP (#816)
Jennit07 Aug 16, 2023
1e06921
fix read_sc_all_alarms_telecare with incorrect format in period (#814)
lizihao-anu Aug 16, 2023
2c6853c
Fix `convert_sending_location_to_lca` example
Moohan Aug 16, 2023
e879f7d
Rename sheet name
Jennit07 Aug 16, 2023
7f1d259
Merge branch 'sept-update-23' into add-sc-client-tests
Jennit07 Aug 16, 2023
f6a1eac
fix warning on `:=` (#797)
lizihao-anu Aug 15, 2023
32c10e5
Add new function for counting records by sending location (#782)
Jennit07 Aug 16, 2023
2f25ae9
Merge branch 'sept-update-23' into add-sc-client-tests
Moohan Aug 16, 2023
4fcf101
Update R/process_tests_sc_client_lookup.R
Moohan Aug 17, 2023
f103e7a
Update documentation
Moohan Aug 17, 2023
acccac3
Update ref functions for Sep23 update
Jennit07 Aug 21, 2023
008b385
Updates target year for new `2324` file
Jennit07 Aug 21, 2023
b1a9a7b
add homelessness flags to the episode file. (#815)
SwiftySalmon Aug 22, 2023
e17c21e
Create HRI Variables (#778)
shintoLamp Aug 23, 2023
63ccf01
Remove future from the cohorts code (#821)
Moohan Aug 29, 2023
1bf2bb7
Use `col_select` instead of `columns` in tests
Jennit07 Sep 1, 2023
ff4d35f
Use `col_select` instead of `columns` in tests
Jennit07 Sep 1, 2023
400822e
Remove `slfhelper::get_chi()`
Jennit07 Sep 1, 2023
ea6eaf1
Remove `slfhelper::get_chi`
Jennit07 Sep 1, 2023
6b73bae
Add demographic flags for anon chi
Jennit07 Sep 1, 2023
5028d82
Only use hscp flags if recid is NOT 00B
Jennit07 Sep 1, 2023
550c94d
Update documentation
Jennit07 Sep 1, 2023
bf5f9b0
BUG - Fix for the episode file tests (#823)
SwiftySalmon Sep 1, 2023
628da4d
Remove rename of hscp - causes mismatched tests
Jennit07 Sep 4, 2023
d719b9b
Include `hscp2018` in variable list
Jennit07 Sep 4, 2023
2c465b5
Add HRI function to individual file pipeline
Jennit07 Sep 4, 2023
68f6f4d
Merge branch 'development' into sept-update-23
Jennit07 Sep 4, 2023
9d1e902
Revert "BUG - Fix for the episode file tests (#823)"
Jennit07 Sep 4, 2023
74d2212
Revert "Remove rename of hscp - causes mismatched tests"
Jennit07 Sep 4, 2023
9b18bd4
Update NEWS.md
Jennit07 Sep 5, 2023
cb16605
Update `check_year_valid` for 23/24 social care
Jennit07 Sep 5, 2023
fbb00e1
Update create_individual_file.R (#824)
lizihao-anu Sep 5, 2023
883605d
Lizihao anu patch 1 (#825)
lizihao-anu Sep 7, 2023
cea985c
Add HRI last
Jennit07 Sep 7, 2023
d950ce5
Add empty SC variables for 2324 - ep file
Jennit07 Sep 8, 2023
17fe86e
Add SC variables for 2324 - indiv file
Jennit07 Sep 8, 2023
ec1e99a
add condition for aggregating ch episodes
Jennit07 Sep 8, 2023
71d403c
New function for aggregating without sc variables
Jennit07 Sep 12, 2023
6e817b6
specify `chi_variable` in hri select list
Jennit07 Sep 12, 2023
8250d60
Implement new aggregate for sc variables
Jennit07 Sep 12, 2023
e9b30e5
Remove `dplyr::everything()`
Jennit07 Sep 12, 2023
ab5bc37
Declare social care variables for latest year
Jennit07 Sep 12, 2023
0ba7149
Style code
Jennit07 Sep 12, 2023
53af730
Update documentation
Jennit07 Sep 12, 2023
562869a
Include hl1 variables in aggregate
Jennit07 Sep 12, 2023
6089cb6
Revert "Include hl1 variables in aggregate"
Jennit07 Sep 12, 2023
d304633
Fix aggregation_by_chi (#829)
lizihao-anu Sep 18, 2023
b4a3a44
Update NEWS.md
Jennit07 Sep 18, 2023
a47cbb8
Only use hscp test flags if NOT 00B
Jennit07 Sep 19, 2023
15dde68
BUG - Fix episode file tests (#830)
Jennit07 Sep 20, 2023
633d430
Merge branch 'sept-update-23' into add-sc-client-tests
Jennit07 Sep 25, 2023
53ede24
Add tests for `compute_mid_year_age` (#809)
Moohan Sep 25, 2023
04c2685
Add a new function to set up keyring (#800)
Moohan Sep 25, 2023
9652c69
Add additional tests for `get_file_path` (#808)
Moohan Sep 25, 2023
bc2e4b3
Rename `run_episode_file()` -> `create_episode_file()` (#803)
Moohan Sep 25, 2023
854868e
Remove incorrect references to rds (#798)
Moohan Sep 25, 2023
ad98c3c
Make targets and tarchetypes required packages (#799)
Moohan Sep 25, 2023
a5bc79e
Update episode file functions to pass data through (#754)
Moohan Sep 26, 2023
b7ce1b1
Tests/it extract path (#807)
Moohan Sep 26, 2023
2f6f25c
Update workflow to run against the development branch (#795)
Moohan Sep 26, 2023
e6148a0
Merge branch 'development' into sept-update-23
Jennit07 Sep 26, 2023
381c74d
Update `create_episode_file`
Jennit07 Sep 26, 2023
85416a9
remove `run_episode_file`
Jennit07 Sep 26, 2023
6195c78
Update documentation
Jennit07 Sep 26, 2023
2982878
Merge branch 'sept-update-23' into add-sc-client-tests
Jennit07 Sep 26, 2023
978c3f9
new function for `client_lookup_path`
Jennit07 Sep 26, 2023
3292329
rename to `get_sc_lookup_paths`
Jennit07 Sep 26, 2023
798a169
Update documentation
Jennit07 Sep 26, 2023
ce8f84a
Use `get_sc_client_lookup_path`
Jennit07 Sep 26, 2023
e0e1888
Update client tests
Jennit07 Sep 26, 2023
54f6958
Update documentation
Jennit07 Sep 26, 2023
c547386
Style code
Jennit07 Sep 26, 2023
648a4da
add sc client tests to targets
Jennit07 Sep 26, 2023
2604303
remove client path from `get_source_extract_path`
Jennit07 Sep 26, 2023
55a5c0e
Update documentation
Jennit07 Sep 26, 2023
9635e0c
Add social care client tests (#783)
SwiftySalmon Sep 27, 2023
b11c89e
Merge branch 'master' into sept-update-23
Jennit07 Sep 28, 2023
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
^_targets\.R$
^_targets\.yaml$
^_SPSS_archived$
^run_targets_
7 changes: 7 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Classificat
cls
cmh
CNWs
Comhairle
codecov
commhosp
congen
Expand Down Expand Up @@ -97,6 +98,7 @@ hjust
hms
homecare
homev
hscdiip
hscp
hscpnames
htmlwidgets
Expand All @@ -115,13 +117,15 @@ keyring
keytime
keytimex
kis
lazydt
lgl
lintr
los
ltc
ltcs
lubridate
magrittr
Matern
markdownguide
Mcbride
mcmahon
Expand All @@ -148,6 +152,7 @@ outfile
pandoc
patflow
pattype
PCEC
phs
phsmethods
phsopendata
Expand Down Expand Up @@ -177,6 +182,7 @@ reasonwait
recid
reflectoring
refsource
renviron
rlang
rmarkdown
roxygen
Expand Down Expand Up @@ -215,6 +221,7 @@ submis
tadm
tarchetypes
tbl
Telecare
telecare
testthat
thom
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [master, main, main-R]
branches: [master, main, development]
pull_request:
branches: [master, main, main-R]
branches: [master, main, development]

name: R-CMD-check

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-changed-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: [main-R, master, main]
branches: [master, main, development]

name: lint-changed-files

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [master, main, main-R]
branches: [master, main, development]
pull_request:
branches: [master, main, main-R]
branches: [master, main, development]

name: test-coverage

Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ Imports:
rmarkdown (>= 2.17),
rstudioapi (>= 0.14),
scales (>= 1.2.0),
slfhelper (>= 0.9.0),
slfhelper (>= 0.10.0),
stringdist (>= 0.9.10),
stringr (>= 1.5.0),
tarchetypes (>= 0.7.6),
targets (>= 1.2.0),
tibble (>= 3.2.1),
tidyr (>= 1.3.0),
tidyselect (>= 1.2.0),
Expand All @@ -61,8 +63,6 @@ Suggests:
covr (>= 3.6.1),
roxygen2 (>= 7.2.3),
spelling (>= 2.2),
tarchetypes (>= 0.7.5),
targets (>= 0.14.3),
testthat (>= 3.1.7)
Remotes:
Public-Health-Scotland/phsmethods,
Expand Down
13 changes: 10 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(add_homelessness_date_flags)
export(add_homelessness_flag)
export(add_hri_variables)

Check failure on line 6 in NAMESPACE

View workflow job for this annotation

GitHub Actions / Check Spelling

`hri` is not a recognized word. (unrecognized-spelling)
export(add_nsu_cohort)
export(check_year_format)
export(clean_up_free_text)
Expand All @@ -13,6 +16,8 @@
export(convert_numeric_to_date)
export(convert_sending_location_to_lca)
export(convert_year_to_fyyear)
export(create_episode_file)
export(create_homelessness_lookup)
export(create_individual_file)
export(create_service_use_cohorts)
export(end_fy)
Expand All @@ -29,6 +34,7 @@
export(get_dev_dir)
export(get_dn_costs_path)
export(get_dn_raw_costs_path)
export(get_existing_data_for_tests)
export(get_file_path)
export(get_gp_ooh_costs_path)
export(get_gp_ooh_raw_costs_path)
Expand All @@ -49,6 +55,7 @@
export(get_readcode_lookup_path)
export(get_sc_at_episodes_path)
export(get_sc_ch_episodes_path)
export(get_sc_client_lookup_path)
export(get_sc_demog_lookup_path)
export(get_sc_hc_episodes_path)
export(get_sc_sds_episodes_path)
Expand All @@ -59,9 +66,7 @@
export(get_slf_chi_deaths_path)
export(get_slf_deaths_lookup_path)
export(get_slf_dir)
export(get_slf_ep_temp_path)
export(get_slf_gpprac_path)
export(get_slf_indiv_temp_path)
export(get_slf_postcode_path)
export(get_source_extract_path)
export(get_sparra_path)
Expand Down Expand Up @@ -132,8 +137,10 @@
export(process_tests_outpatients)
export(process_tests_prescribing)
export(process_tests_sc_ch_episodes)
export(process_tests_sc_client_lookup)
export(process_tests_sc_demographics)
export(process_tests_sds)
export(produce_episode_file_tests)
export(produce_source_extract_tests)
export(produce_test_comparison)
export(read_extract_acute)
Expand All @@ -157,7 +164,7 @@
export(read_sc_all_care_home)
export(read_sc_all_home_care)
export(read_sc_all_sds)
export(run_episode_file)
export(setup_keyring)
export(start_fy)
export(start_fy_quarter)
export(start_next_fy_quarter)
Expand Down
46 changes: 45 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
# March 2023 Update - Unreleased
# September 2023 Update - Unreleased
* Update of 2017/18 onwards to include bug fixes within the files.
* New 2023/24 files.
*No social care data available for new 2023/24 file.
* New NSU cohort for 2022/23 file.
* SPD and SIMD updated.
* Re addition of:
* HRIs in individual file.
* 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
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.
* Internal changes to SLF development:
* `DN` and `CMH` data are now archived in an HSCDIIP folder as the BOXI datamart is now closed down for these. Function `get_boxi_extract_path` has been updated to reflect this.
* Tests updated to include `HSCP`count.
* Tests created for `Delayed Discharges` extract and `Social care Client lookup`.


# June 2023 Update - Released 24-Jul-2023
* 2011/12 -> 2013/14 – These files have not been altered, other than to make them available in a new file type (parquet).
* 2017/18 – These files have been recreated using our new R pipeline, but the data has not changed. We did this so that we would have a good comparator file.
* 2018/19 -> 2022/23 – These files have been recreated using the R pipeline and are also using updated data (as in a ‘normal’ update).
* Files changed into parquet format.
* SLFhelper updated.
* 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.
* 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`.
* HRI's not included.
* Homelessness flags not included.
* Keep_population flag not included.


# March 2023 Update - Released 10-Mar-2023
* 2021/22 episode and individual files refreshed with updated activity.
* 2022/23 file updated and contains data up to the end of Q3.
* Social care data is available for 2022/23.
* Typo in the variable name `ooh_covid_assessment`
* Next update in May as a test run in R but won't be released.
* Next release in June.

# December 2022 Update - Released 07-Dec-2022
* Now using the 2022v2 Scottish Postcode Directory.
* Now using the 2020 Urban Rural classifications (instead of the older 2016 ones), this means variables such as `URx_2016` will now be called `URx_2020`.
Expand Down
6 changes: 3 additions & 3 deletions R/00-update_refs.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @family initialisation
latest_update <- function() {
"Jun_2023"
"Sep_2023"
}

#' Previous update
Expand All @@ -34,11 +34,11 @@

latest_update_date <- lubridate::my(latest_update())

previous_update_year <- lubridate::year(

Check warning on line 37 in R/00-update_refs.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/00-update_refs.R,line=37,col=3,[object_usage_linter] local variable 'previous_update_year' assigned but may not be used
latest_update_date - lubridate::period(months_ago, "months")
)

previous_update_month <- lubridate::month(

Check warning on line 41 in R/00-update_refs.R

View workflow job for this annotation

GitHub Actions / lint-changed-files

file=R/00-update_refs.R,line=41,col=3,[object_usage_linter] local variable 'previous_update_month' assigned but may not be used
latest_update_date - lubridate::period(months_ago, "months"),
label = TRUE,
abbr = TRUE
Expand All @@ -61,7 +61,7 @@
#'
#' @family initialisation
get_dd_period <- function() {
"Jul16_Mar23"
"Jul16_Jun23"
}

#' The latest financial year for Cost uplift setting
Expand All @@ -74,5 +74,5 @@
#'
#' @family initialisation
latest_cost_year <- function() {
"2223"
"2324"
}
Loading
Loading