Stream: implementers
Topic: Contained resources and Bundles
Ken Sinn (Dec 11 2019 at 22:18):
We have a FHIR server with a MedicationDispense resource available for Read, which references Contained Patient and Practitioner resources, since we only have fragments of these entities, and the entity info is captured as point-in-time of the drug dispensation, so it doesn't make sense for these contained resources to exist independently.
So a Read on this MedicationDispense will return a MedicationDispense resource, with the Contained Patient and Practitioner resources. A Search against this MedicationDispense resource will return a Searchset Bundle resource, with multiple MedicationDispense resources as Bundle.entry.resource -- but the previously contained Patient and Practitioner resources are now also found as Bundle.entry.resource.
Is this correct?
If feels like the logic required to return a Searchset is a lot more work, as the server has to disassemble and flatten all the containment, and the requester has to look across all elements within the bundle rather than just looking at MedicationDispense.contained as in the Read.
Follow-up question - does this mean that the fragment/contained Patient and Practitioner resources in Bundle.entry.resource will need to have Bundle.entry.search.mode="include" (even though this was not a result of a _include search parameter -- though that's just semantics and nitpicking).
Grahame Grieve (Dec 11 2019 at 23:47):
Is this correct?
no. if they're contained resources, you leave them as contained resources
Lloyd McKenzie (Dec 12 2019 at 02:39):
Contained entries should remain contained. If you have enough patient identity to know that multiple dispenses are for the same patient or by the same practitioner, then those shouldn't be contained. Contained is for resources that have no identity outside the containing resource.
Ken Sinn (Dec 12 2019 at 18:45):
Thank you -- We ran into validation errors when using HAPI for validation, and the errors were related to referencing the contained resources. The same sample message ran fine in HL7 FHIR Validator, so we're checking in with the HAPI forums.
Grahame Grieve (Dec 12 2019 at 19:30):
there was a bug that was fixed there - might be a version issue with the validator - the HAPI one runs behind the snapshot
Last updated: Apr 12 2022 at 19:14 UTC