Skip to content

BYOC_ID: 44535 Refactor A&E#1266

Open
OluwatobiOni wants to merge 24 commits into
developmentfrom
refactor-ae
Open

BYOC_ID: 44535 Refactor A&E#1266
OluwatobiOni wants to merge 24 commits into
developmentfrom
refactor-ae

Conversation

@OluwatobiOni

Copy link
Copy Markdown
Collaborator

Opening a draft PR for refactoring ae. Will be updated when changes required for NSS to make are made.

Comment thread R/process_extract_ae.R Outdated
Comment thread R/process_extract_ae.R Outdated
# c_year_cup <- convert_fyyear_to_year(check_year_format(year))
#
# ae_cup_file <- dplyr::tbl(
# denodo_connect_cup,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# denodo_connect_cup,
# denodo_connect,

@lizihao-anu lizihao-anu changed the title Refactor A&E BYOC_ID: 44535 Refactor A&E Mar 19, 2026
@LucyEmma22

Copy link
Copy Markdown
Collaborator

TO-DO:

read_extract_ae

  1. Check assumption that arrival_financial_year == financial_year
  2. Replace care_reference_number with case_reference_number
  3. Remove data type corrections

process_extract_ae

  1. Remove ae_cup_file read in from disk and uncomment ae_cup_file read in from denodo
  2. Replace placeholder for data path in denodo - dbplyr::in_schema("sdl", "sdl_ae_cup_source_placeholder")
  3. Replace placeholder for year - dplyr::filter(year == c_year_cup)

@LucyEmma22

Copy link
Copy Markdown
Collaborator

Comparison of data read in from disk (old) to data read in from Denodo (new):

Old Data: 36 columns; 1571185 rows
New Data: 36 columns; 1618925 rows

Data Types:

         col       new          old
1   keytime1 character hms difftime
2   keytime2 character hms difftime
3     gender character      numeric
4 ae_patflow character      numeric
5        age integer64      numeric
6   commhosp integer64    character

Comment thread _targets.R

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Might need to revert these changes if we test targets with a new script?

Comment thread R/read_extract_ae.R Outdated
# TO-DO: Remove this when data types are fixed
extract_ae <- extract_ae %>%
mutate(keytime1 = hms::parse_hms(keytime1),
keytime2 = hms::parse_hms(keytime2),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

May need to keep changes for keytime1 and keytime2 if data type is not available in Denodo. Need to check this conversion is accurate.

@Jennit07 Jennit07 added the On hold Waiting for something / someone outside of our control label Apr 13, 2026
@Jennit07

Copy link
Copy Markdown
Collaborator

Dependency missing: A&E CUP file

@OluwatobiOni OluwatobiOni marked this pull request as ready for review June 8, 2026 10:31
@OluwatobiOni

Copy link
Copy Markdown
Collaborator Author

ae cup file has now been made available but some UAT to-dos before this PR is ready for testing:

IN THE AE FILE:

  • commhosp is currently integer64. Character is expected.
  • patient_sex, patient_flow_code, and age_at_midpoint_of_financial_year are cast as integer but these do not affect the output because their values are whole numbers anyway.

IN THE AE CUP FILE:

  • cup_marker is currently integer64. Should be cast as numeric
  • ed_arrival_time is currently character. Should be cast as TIME (HH:MM:SS)
  • ed_discharge_time is currently character. Should be cast as TIME (HH:MM:SS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BYOC On hold Waiting for something / someone outside of our control

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants