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

Output the individual file with anon_chi #748

Merged
merged 7 commits into from
Jul 19, 2023

Conversation

Moohan
Copy link
Member

@Moohan Moohan commented Jul 17, 2023

By default it expects the input episode file to have anon_chi and it will output anon_chi but I've added parameters to deal with other situations if required.

Moohan and others added 3 commits July 17, 2023 14:43
I've added this as a parameter so you can output CHI if desired, but the default is for anon_chi.

For the tests, it swaps back to CHI as there are some tests which specifically us the CHI number.
@Moohan Moohan requested a review from Jennit07 July 17, 2023 14:14
#746)

* rename `hscp` to `hscp2018`

* rename `spd` as `slf_pc_lookup`

* Add `datazone2011` to coalesce code

* Rename `datazone` to `datazone2011`

* include `datazone2011_old` in selections

* Update R/fill_geographies.R

---------

Co-authored-by: James McMahon <[email protected]>
@Moohan Moohan linked an issue Jul 17, 2023 that may be closed by this pull request
@Moohan Moohan changed the base branch from master to create_individual_file_stable July 17, 2023 15:13
@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Jul 19, 2023

@check-spelling-bot Report

🔴 Please review

See the 📂 files view or the 📜action log for details.

Unrecognized words (5)

consulations
gls
hhg
nrs
sparra

To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:Public-Health-Scotland/source-linkage-files.git repository
on the individual/anon_chi branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/Public-Health-Scotland/source-linkage-files/actions/runs/5597636503/attempts/1'

To have the bot do this for you, reply quoting the following line:
@check-spelling-bot apply updates.

Available 📚 dictionaries could cover words not in the 📘 dictionary

This includes both expected items (215) from .github/actions/spelling/expect.txt and unrecognized words (5)

Dictionary Entries Covers
cspell:swift/src/swift.txt 205 1
cspell:npm/npm.txt 288 1
cspell:latex/latex.txt 424 1
cspell:filetypes/filetypes.txt 264 1

Consider adding them using (in .github/workflows/spelling.yml):

      with:
        extra_dictionaries:
          cspell:swift/src/swift.txt
          cspell:npm/npm.txt
          cspell:latex/latex.txt
          cspell:filetypes/filetypes.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Copy link
Collaborator

@Jennit07 Jennit07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to merge

@Jennit07 Jennit07 merged commit dabbf57 into create_individual_file_stable Jul 19, 2023
11 of 12 checks passed
@Jennit07 Jennit07 deleted the individual/anon_chi branch July 19, 2023 10:15
Moohan added a commit that referenced this pull request Jul 19, 2023
* Until L594

* Converted until L677

* Until L731

* Update documentation

* Remove test ref

* Style code

* WIP writing functions to fill postcode in line with previous DOB functions

* Update documentation

* implement quick fix for running 22/23

* Style code

* Fix missed comma

* Exclude DD code for now - TEMP fix

* Correct/rename variables

* Style code

* Include NSU in `check_year_valid`

* Update `check_year_valid_tests`

* Update documentation

* Update `add_nsu_cohort` to pick up years valid

* Style code

* remove extra `!`

* Exclude `cij_delay`

* Style code

* improve `max_no_inf()`

* Use pmin/max instead of `rowwise`

* improve `min_no_inf()`

* Use n_distinct(cij_marker)

* deal with distinct(ch_chi_cis)

* use n_distinct(ooh_case_id)

* remove `find_non_duplicates`

* Use dplyr::if_else()

Co-authored-by: James McMahon <[email protected]>

* Fix typo in `ooh_covid_assessment`

* Move `ooh_case_id` to aggregate

* Use `slfhelper::ltc_vars`

* Remove `clean_up_dob`
Already done in `correct_demographics`

* Update documentation

* [check-spelling] Update metadata

Update for https://github.com/Public-Health-Scotland/source-linkage-files/actions/runs/4981058958/attempts/1
Accepted in #654 (comment)

Signed-off-by: check-spelling-bot <[email protected]>

* Use `start_next_fy_quarter` in place of rowwise

* Style code

* Use `compute_mid_year_age`

* convert code into data.table for improving speed

* Update `get_fy_dates`function

* remove `date_from_fy`, use `get_fy_dates`

* Update documentation

* Remove `clean_up_postcode` function
Not needed anymore

* Remove non duplicates function/move to aggregate

* Style code

* Update documentation

* Add time stamps to `create_individual_file`

* Style code

* remove `clean_up_postcode`

* Deal with ch cis episodes

* Style code

* add .data$

* Turn ch aggregate into a data table

* Style code

* use ch_chi_cis

* remove `preventable_admissions` from aggregate

* exclude `hh_in_fy` for now

* Style code

* Test - exclude `sc_` vars from aggregate

* Style code

* Exclude for now

* exclude for now

* Style code

* automate `check_year_valid`

* Return dummy file path for NSU not valid

* Style code

* Fix brackets in aggregate

* TEMP - exclude variables

* Use `phsmethods::sex_from_chi`

* Style code

* Add ungroup()

* lowercase dob

* Remove as.data.table

* rewrite aggregate_by_chi with data.table

* Style code

* minor changes

* Use the updated function

* to properly import data.table

* remove redundant columns dob postcode and gpprac

* minor changes to remove redundant postcode gpprac columns

* Style code

* rename columns with small letters

* Style code

* newaggregate_ch_episodes

* Update documentation

* add functions to replace regular expressions to select column/variables

* Update documentation

* Style code

* minor changes

* add a missing variable, cij_delay

* Style code

* add variables cij_delay, preventable_beddays

* add missing variables health_net_cost, health_net_costincdnas, and cmh, dd sds columns

* Style code

* add more variables needed

* Style code

* Update R/link_delayed_discharge_eps.R

* Style code

* amend costs

* Style code

* Revert "amend costs"

This reverts commit 8048e68.

* Add DN and cij_delay back in

* fix the issue

* Style code

* remove running in chunks

* Style code

* Update tests to include missing variables

* Remove unnecessary comma

* fix the bug of preventable_beddays

* Update documentation

* fix total ae_attendances

* fix the bug of preventable_admissions

* fix the bug of hbrescode etc

* minor fix

* minor fix

* Style code

* Fix some warnings being produced by the tests

* Fix failing test

* remove running in chunks

* Style code

* Update the targets config to use `timestamp_positives` as the default reporter

* fix the bug of preventable_beddays

* Update documentation

* fix total ae_attendances

* fix the bug of preventable_admissions

* fix the bug of hbrescode etc

* minor fix

* minor fix

* Style code

* fix home care cost

* add ipdc to fix maternity

* fix preventable addmission and care home cost

* fix preventable_admissions and calculate preventable_beddays here

* add monthly_beddays and yearstay to dd

* Style code

* fix preventable_admissions and preventable_beddays

* Style code

* include parameter for write to disk/year

* Add lookups to indiv file creation pipeline

* include parameter for write to disk/year

* fix delay discharge beddays and yearstay

* Style code

* fix preventable issues

* Style code

* fix the issue of preventable stuff

* Style code

* Update R/aggregate_by_chi_zihao.R

* Update documentation

* Fix minor typos

* [check-spelling] Update metadata

Update for https://github.com/Public-Health-Scotland/source-linkage-files/actions/runs/5443581387/attempts/1
Accepted in #709 (comment)

Signed-off-by: check-spelling-bot <[email protected]>

* Remove some obsolete comments

* Remove some unnecessary brackets

* Reformat some code

* Use some `dplyr` functions for readability

* Style code

* Update R/link_delayed_discharge_eps.R

* Style code

* Remove some code which is no longer needed

We now match on these variables after

* Work out preventable admissions with similar indicators

* Lowercase variable names

* Restore `cij_delay`

* Restore DN variables

* Tidy the code and use integers where possible

* Supply `year` as a parameter to `clean_up_ch`

* Supply `year` as a parameter to `clean_individual_file`

* Only keep required variables to save memory

* Rename the parameter so the documentation works

* Use `setnames` to change names to lower

* Remove unneeded code

* Update file path name

* Trim the return code

* Some fixes

* Correctly compute `ooh_cases`

* Update documentation

* Style code

* [check-spelling] Update metadata

Update for https://github.com/Public-Health-Scotland/source-linkage-files/actions/runs/5466392495/attempts/1
Accepted in #719 (comment)

Signed-off-by: check-spelling-bot <[email protected]>

* Add targets for the individual file

* Fix missed pipe

* Style code

* Update some targets to only run once a week

* Make the deaths lookup unique

* Add `year` back to the individual file

* Remove `cost_total_net_inc_dnas` from the indiv file  (#737)

* Drop `cost_total_net_inc_dnas`

* Rename `health_net_costincdnas` to `health_net_cost_inc_dnas`

* Join slf lookups onto individual file (#724)

* Create function for matching on slf lookups

* fix some build warnings

* Add `hbrescode` to select list

* Pass lookups as parameters/deal with hbrescode

* Update R/create_individual_file.R

---------

Co-authored-by: James McMahon <[email protected]>

* Join sc client variables onto individual file (#740)

* New function for matching sc client to indiv file

* Style code

* [check-spelling] Update metadata

Update for https://github.com/Public-Health-Scotland/source-linkage-files/actions/runs/5555048903/attempts/1
Accepted in #740 (comment)

Signed-off-by: check-spelling-bot <[email protected]>

* Code layout

* Style code

* Remove redundant sc variables

Co-authored-by: James McMahon <[email protected]>

* Update comments

Co-authored-by: James McMahon <[email protected]>

* Update comments

Co-authored-by: James McMahon <[email protected]>

* Sort order of parameters to pass `data` first

* Update documentation

* Style code

* Update R/create_individual_file.R

* Update R/create_individual_file.R

* Update R/create_individual_file.R

* Style code

---------

Signed-off-by: check-spelling-bot <[email protected]>
Co-authored-by: Jennit07 <[email protected]>
Co-authored-by: James McMahon <[email protected]>
Co-authored-by: Moohan <[email protected]>

* Update documentation

* Output the individual file with `anon_chi` (#748)

* Make episode file output with `anon_chi`

I've added this as a parameter so you can output CHI if desired, but the default is for anon_chi.

For the tests, it swaps back to CHI as there are some tests which specifically us the CHI number.

* Output `anon_chi` in the individual file

* Style code

* Sort variables with issues `hbrescode` (HB2018), `datazone` and `hscp` (#746)

* rename `hscp` to `hscp2018`

* rename `spd` as `slf_pc_lookup`

* Add `datazone2011` to coalesce code

* Rename `datazone` to `datazone2011`

* include `datazone2011_old` in selections

* Update R/fill_geographies.R

---------

Co-authored-by: James McMahon <[email protected]>

* Fix for anon_chi being NA

---------

Co-authored-by: Moohan <[email protected]>
Co-authored-by: Jennit07 <[email protected]>

---------

Signed-off-by: check-spelling-bot <[email protected]>
Co-authored-by: Mandy Norrbo <[email protected]>
Co-authored-by: jr-mandy <[email protected]>
Co-authored-by: shintoLampgit config --global user.email [email protected]  git config --global user.name shintoLamp <[email protected]>
Co-authored-by: shintoLamp <[email protected]>
Co-authored-by: Jennit07 <[email protected]>
Co-authored-by: Jennifer Thom <[email protected]>
Co-authored-by: Jennit07 <[email protected]>
Co-authored-by: Zihao Li <[email protected]>
Co-authored-by: lizihao-anu <[email protected]>
Co-authored-by: Moohan <[email protected]>
Co-authored-by: Zihao Li <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use anon_chi
2 participants