BYOC_ID: 45986 Refactor PIS#1326
Open
LucyEmma22 wants to merge 8 commits into
Open
Conversation
Jennit07
reviewed
Jun 16, 2026
Comment on lines
+79
to
+100
| get_it_prescribing_path <- function(year, it_reference = NULL, BYOC_MODE, ...) { | ||
| if (isTRUE(BYOC_MODE)) { | ||
| return("dummy_BYOC_it_prescribing_path") | ||
| } else { | ||
| it_reference <- check_it_reference(it_reference) | ||
| if (is.null(it_reference)) { | ||
| it_pis_path <- get_file_path( | ||
| directory = fs::path(get_slf_dir(), "IT_extracts/anon-chi-IT"), | ||
| file_name_regexp = stringr::str_glue( | ||
| "anon-SCTASK[0-9]{{7}}_PIS_{convert_fyyear_to_year(year)}.parquet" | ||
| ) | ||
| ) | ||
| } else { | ||
| it_reference <- check_it_reference(it_reference) | ||
|
|
||
| it_pis_path <- get_file_path( | ||
| directory = fs::path(get_slf_dir(), "IT_extracts/anon-chi-IT"), | ||
| file_name = stringr::str_glue( | ||
| "anon-SCTASK{it_reference}_PIS_{convert_fyyear_to_year(year)}.parquet" | ||
| it_pis_path <- get_file_path( | ||
| directory = fs::path(get_slf_dir(), "IT_extracts/anon-chi-IT"), | ||
| file_name = stringr::str_glue( | ||
| "anon-SCTASK{it_reference}_PIS_{convert_fyyear_to_year(year)}.parquet" | ||
| ) | ||
| ) | ||
| ) | ||
| } | ||
| return(it_pis_path) |
Collaborator
There was a problem hiding this comment.
Did you get inspiration from the IT CHI deaths here?
Collaborator
There was a problem hiding this comment.
sorry getting confused with SPD file paths!
Jennit07
reviewed
Jun 16, 2026
| # Format prescribing | ||
| dplyr::mutate( | ||
| dob = lubridate::dmy(.data$dob) | ||
| dob = lubridate::as_date(.data$dob) |
Jennit07
reviewed
Jun 16, 2026
Jennit07
left a comment
Collaborator
There was a problem hiding this comment.
I need to come back to this PR to test when the data is available. It looks okay but im a little confused with how to handle the IT file paths. It looks like this was inspired by the CHI deaths file paths which has previously passed the tests with NSS. But my first thought was to handle this similar to the SPD file paths. This would maintain the consistency in the code. Happy to discuss/do further testing on this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TO-DO:
get_it_prescribing_pathhas been refactored likeget_it_deaths_pathbut this currently returns a dummy path ifBYOC_MODE = TRUE.