FHIRPath for US race

23 views
Skip to first unread message

Jozef Aerts

unread,
Jan 19, 2022, 10:58:08 AM1/19/22
to HAPI FHIR
I have a bit of trouble understanding how FHIRPath works on HAPI_FHIR for extensions like for US "Race".
I currently have in my code:

String fhirPath = "extension.where(url='http://hl7.org/fhir/us/core/StructureDefinition/us-core-race').extension.valueCoding.display";
String race = engine.evaluateToString(patientResource, fhirPath);
but that doesn't return anything.

I keep trying ... but any help is highly appreciated!
Best,
Jozef

Jozef Aerts

unread,
Jan 19, 2022, 1:02:07 PM1/19/22
to HAPI FHIR
With some literature research and some trial and error, I found the solution. The FHIRPath must be:
"extension('http://hl7.org/fhir/us/core/StructureDefinition/us-core-race').extension.value.display"
so ... NOT using "where(...)"
and the second error I made was to use "valueCoding": it must be "value", as essentially it is value[x] ...
Hope this helps other people too! ...
Reply all
Reply to author
Forward
0 new messages