fhir-data-pipes
fhir-data-pipes copied to clipboard
Unable to Query Extensions Values
trafficstars
Description
When attempting to query FHIR extensions using ViewDefinition, the expected results are not returned. However, the same FHIRPath works correctly in FHIRPath.js.
Steps to Reproduce
- Use the following Patient resource sample:
{
"resourceType": "Patient",
"id": "1238",
"extension": [
{
"url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity",
"extension": [
{
"url": "ombCategory",
"valueCoding": {
"system": "urn:oid:2.16.840.1.113883.6.238",
"code": "2186-5",
"display": "Not Hispanic or Latino"
}
},
{
"url": "text",
"valueString": "Not Hispanic or Latino"
}
]
}
]
}
- Use the following ViewDefinition query:
{
"resourceType": "http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition",
"text": "Minimal ViewDefinition for testing extensions",
"fhirVersion": ["4.0"],
"select": [
{
"column": [
{
"path": "getResourceKey()",
"name": "id"
},
{
"path": "extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity').extension.where(url = 'ombCategory').valueCoding.display",
"name": "extension_debug"
}
]
}
],
"name": "patient_minimal",
"status": "draft",
"resource": "Patient"
}
- Test in views tab (or) Run Full Pipeline:
Expected Outcome
- The FHIRPath should correctly return
Not Hispanic or Latino. - This works in FHIRPath.js, but not in fhir-data-pipes.
Actual Outcome
- The FHIRPath returns
nullforextension_debugcolumn
Request for Assistance
Please help determine if this is an issue with fhir-data-pipes ViewDefinition processing or if there is a mistake in the query format.
It is working with this pattern. closing the issuue
{
"path": "extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity').extension.where(url = 'ombCategory').(value as Coding).display",
"name": "extension_debug"
}
Thanks for reporting this issue and the update. I have not got to this yet and like to see why the first pattern doesn't work if it is expected to; so reopening.