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

Choice elements are not handled properly #38

Closed
jsdebruin1981 opened this issue Feb 21, 2024 · 1 comment
Closed

Choice elements are not handled properly #38

jsdebruin1981 opened this issue Feb 21, 2024 · 1 comment

Comments

@jsdebruin1981
Copy link

According to the FHIR specification:

2.9.1.1 Polymorphism in FHIR
For choice elements, where elements can be one of multiple types, e.g. Patient.deceased[x]. In actual instances these will be present as either Patient.deceasedBoolean or Patient.deceasedDateTime. In FHIRPath, choice elements are labeled according to the name without the '[x]' suffix, and children can be explicitly treated as a specific type using the as operation:

(Observation.value as Quantity).unit

The implementation does not handle those, the FHIRpath path only recognizes the actual fieldname, e.g. valueQuantity etc....

@ir4y
Copy link
Member

ir4y commented May 13, 2024

Hi @jsdebruin1981

This feature is supported.
You need to specify a version of FHIR to emable this feature.
Here is a related unit test https://github.com/beda-software/fhirpath-py/blob/master/tests/cases/fhir-quantity.yaml#L64

@ir4y ir4y closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants