Stream: implementers
Topic: Contained Resource Exploit
natus (Nov 10 2018 at 15:17):
Hi
From the doc: http://hl7.org/fhir/search.html#containedType it is possible to get a contained resource that match the criteria:
Encounter?patient._id:exists=true&_contained=both
This syntax would allow to get a bundle of Encounters. Each Encounter resource would contain a Patient.
Is this valid ?
In particular my goal is to avoid my client to make 2 requests to get the Encounters, and then the Patients informations.
Josh Mandel (Nov 12 2018 at 14:45):
It sounds like what you want is "GET /Encounter?_include=Encounter:patient" @natus
natus (Nov 12 2018 at 15:22):
@Josh Mandel thanks. _include would add Patient resources in the bundle together with the Encoutenr resources.
I am looking for a way to include the Patient resources within the encounter resources.
Lloyd McKenzie (Nov 12 2018 at 17:08):
Resource containment is not a "transport" mechanism. It's used for maintaining resoruces that can't exist independently. If a resource exists as a stand-alone resource, conveying it as a contained resource would be inappropriate. Containment is intended for use in situations where you have a little bit of information about a target resource, but not enough for it to exist independently. E.g. a provider where you've got a name and type but not an identifier; a medication where you have a name but not a code, etc.
Lloyd McKenzie (Nov 12 2018 at 17:09):
There's no mechanism in FHIR that allows a query to request resources to be contained in a response and we wouldn't contemplate doing so. Resources would only be returned as "contained" in a query response if they were stored that way on the server.
natus (Nov 12 2018 at 17:10):
@Lloyd McKenzie Thanks loyd. Your answer is so clear it should be in the documentation.
Lloyd McKenzie (Nov 12 2018 at 17:11):
If you think there's an appropriate place to add more clarification, feel free to submit a change proposal :) (Click on the link at the bottom of any page in the spec.)
natus (Nov 12 2018 at 17:12):
Click on the link at the bottom of any page in the spec.
Never seen that before, maybe a first proposal would be to make this appear on the top of any page.
Thanks
Michael Riley (Nov 12 2018 at 18:55):
Seconded on clarifying contained vs referenced resources. I think maybe some elaboration could happen in section 2.3.0 http://hl7.org/fhir/references.html Conatined Reference is all the way at the bottom of the page at 2.3.0.5 but maybe it could be described right after the traditional resourcereferencedt, instead of much furthur down the page.
Last updated: Apr 12 2022 at 19:14 UTC