Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Support returning total bed days and total critical care days from patients.admitted_to_hospital#748

Merged
rebkwok merged 2 commits intomainfrom
total-admission-days
Mar 8, 2022
Merged

Support returning total bed days and total critical care days from patients.admitted_to_hospital#748
rebkwok merged 2 commits intomainfrom
total-admission-days

Conversation

@rebkwok
Copy link
Contributor

@rebkwok rebkwok commented Mar 7, 2022

Fixes #742

patients.admitted_to_hospital already returns days_in_critical_care, however this will return the number of days for the first or last matching admission.

This allows the return options of total_critical_care_days_in_period and total_bed_days_in_period by summing the days for all admissions during the period. In the case where there are two or more admissions recorded with the same admission date, we take the max number of days to avoid counting the sames days more than once.

For total_bed_days_in_period, the return value required is number of days, but the data recorded is number of nights (sometimes 0, which counts as one bed day).

Copy link
Member

@iaindillingham iaindillingham left a comment

Choose a reason for hiding this comment

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

This is really clear. Thanks for commenting on the adjustment, and making it explicit in the code.

@rebkwok rebkwok merged commit 5ddd138 into main Mar 8, 2022
@rebkwok rebkwok deleted the total-admission-days branch March 8, 2022 11:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APCS: support returning "total bed days"

2 participants