Stream: implementers
Topic: SearchParameter clarification
Richard Kavanagh (Feb 24 2021 at 09:23):
Can someone give me a bit of help with creating SearchParameters, I'm looking at some published examples but I'm struggling...
If I take a look at http://www.hl7.org/fhir/us/core/SearchParameter-us-core-ethnicity.html this defines a SP against a complex extension.
What I can't see is how the expression is targeting the specific inner extension, the expression used is:
Patient.extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity').extension.value.code
My particular use case is just for a "simple" extension with a single CodeableConcept element. So if I have extension http://acme.org/myExtension do I use a path along the lines of
Patient.extension.where(url = ' http://acme.org/myExtension').extension.value.code
or simply
Patient.extension.where(url = ' http://acme.org/myExtension')
thanks.
Lloyd McKenzie (Feb 24 2021 at 14:39):
It looks like it's not targeting a specific inner extension - as specified, it's searching on all of the children. If you wanted a specific child, you'd need a where clause on the inner .extension as well that filtered by URL (which could be a simple URL if you were looking for a component of a complex extension) For a simple extension with a CodeableConcept, it'd just be Patient.extension.where(url='http://acme.org/myExtension').value if your search type is 'token'.
Last updated: Apr 12 2022 at 19:14 UTC