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

Variable time unit support for Encounter.length #267

Open
cragun47 opened this issue Oct 4, 2021 · 0 comments
Open

Variable time unit support for Encounter.length #267

cragun47 opened this issue Oct 4, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cragun47
Copy link
Contributor

cragun47 commented Oct 4, 2021

Improve the calculation of FHIR Encounter.length to support hours and days. Encounter.length is the duration of a patient visit. Currently length is calculated from PV1.44 and PV1.45 in minutes (in PV1_DURATION_LENGTH) As fall back, PV2.11 is used, but when it is, it is interpreted as days.

Minutes is useful for an office visit, but not helpful for hospital stays.

This work item is to create a "sliding scale" to apply time units, minutes, hours, days when date is calculated from PV1.44 and PV1.45
When the length is 3 hours or less use minutes
When the length is 3 hours to 72 hours use hours with one decimal point of accuracy (accurate to 6 minutes
When the length is over 72 hours (3 days) use days with two decimal points of accuracy (accurate to 15 minutes)

If PV1.44 or PV1.45 is not provided, PV2.11 should still be used as fallback and interpreted as days.
If PV1.44 and PV1.45 are both provided and have the same granularity, use the formula above as it fits. Example if the values have hours but no minutes, calculate the hours and if the hours is > 72, then shift to days.
If PV1.44 and PV1.45 are both provided but have different time granularity, use the coarsest granularity and round the second value up to the same granularity.

@cragun47 cragun47 added Hackathon candidate Issues for the Alvearie Hackathon enhancement New feature or request good first issue Good for newcomers labels Oct 4, 2021
@LisaWellman LisaWellman removed the Hackathon candidate Issues for the Alvearie Hackathon label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants