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

Unexpected behavior for Quantity without a code #1497

Open
brynrhodes opened this issue Feb 6, 2025 · 1 comment
Open

Unexpected behavior for Quantity without a code #1497

brynrhodes opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels

Comments

@brynrhodes
Copy link
Member

In the following library:

library TestQuantity

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'

context Patient

define TestQuantity: FHIRHelpers.ToValue(FHIR.Quantity { value: FHIR.decimal { value: 1001 }, unit: FHIR.string { value: 'mg/dL' } }) >= 200 'mg/dL'

The TestQuantity expression unexpectedly returns null, when according to the logic in the FHIRHelpers library, the unit element should be treated as a UCUM unit unless there is explicit declaration that it is not.

@brynrhodes brynrhodes added the bug label Feb 6, 2025
@brynrhodes brynrhodes self-assigned this Feb 6, 2025
@brynrhodes
Copy link
Member Author

Note that this is somewhat related to this issue:

#961

The proposed fix is to ensure that when casting Quantity values to Quantity-sub-type values, all the elements of the Quantity are considered (as opposed to just the value and code, which is what it currently does).

This is an improvement on, but still not a complete fix for issue 961. The full fix is documented as TODOs in the FHIRModelResolver classes.

brynrhodes added a commit that referenced this issue Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant