Stream: implementers
Topic: Search _elements
Madeline Hoskins (Aug 13 2019 at 13:19):
I am trying to create a Bundle of search queries using the _elements tag. The patientId and encounterId are already in context, as we are using SMART on FHIR. I am trying to retrieve information about a prescription from an EMR for the given patient. Would the below query be valid to retrieve the identifier.value of the intended pharmacy to fill the prescription?
{
"request": {
"method": "GET",
"url": "/MedicationRequest?_elements=dispenseRequest.performer:Organization.identifier.value"
}
}
Michele Mottini (Aug 13 2019 at 13:46):
No - _elements
specify which element of the resource being searched should be returned, it cannot be used to navigate into referenced resource. You should add &_include=MedicationRequest:intended-performer
to return also the performer in the result bundle.
Michele Mottini (Aug 13 2019 at 13:47):
Also: the fact that the patient and encounter are in context for SMART does not influence the searches - you should still specify the patient in the search
Madeline Hoskins (Aug 13 2019 at 18:34):
Where are you advising to add the &_include..... part above? Are you suggesting to not use the _elements tag at all?
Michele Mottini (Aug 13 2019 at 19:22):
The request should be: .../MedicationRequest?patient=xxxx&&_include=MedicationRequest:intended-performer
where xxxx
is the patient id.
_elements
is used to reduce the amount of data returned - that is not what you want to do here if I understand correctly
Ardon Toonstra (Mar 13 2020 at 12:11):
Hi there!
Does the search result parameter _elements also work for elements in extensions? If zo, how does this look like in the search url?
http://hl7.org/fhir/search.html#elements
Grahame Grieve (Mar 13 2020 at 12:37):
not really.
Lloyd McKenzie (Mar 13 2020 at 16:31):
Do we need to define a convention to support this?
Ardon Toonstra (Mar 13 2020 at 21:55):
Mm, not sure.. in the end we were able to go for another route or it didn't seemed to be needed anymore. So not really sure if there is a hard practical use case.
Jens Villadsen (Mar 14 2020 at 20:09):
It would be nice to have it
Lloyd McKenzie (Mar 14 2020 at 21:05):
Then submit a change request :)
Jens Villadsen (Mar 16 2020 at 23:07):
https://jira.hl7.org/browse/FHIR-26596
Last updated: Apr 12 2022 at 19:14 UTC