More about contained resources
September 17, 2015 Leave a comment
So this is going to be a really short post.
There was a question on the Implementers chat about the ability for contained resources to reference each other (ie where there are multiple contained resources within the same parent.
Here’s the question (slightly paraphrased):
The FHIR spec states that Contained resources can’t contain other resource (understandable). But I thought I had seen references from those contained resources to other contained resources within the same parent. Is that valid?
eg: a Medication resource is contained within a MedicationStatemement resource. The Medication references other Medication and Substance resources, also contained within the MedicationStatemement.
And Lloyd replied:
Contained resources can reference other contained resources so long as they’re all contained in the same “real” resource instance.
Containment doesn’t establish hierarchy, it just provides a packaging mechanism for resources that are unable to stand alone by placing them inside a resource that can stand on its own. Hierarchy is established by resolving references.
Containment isn’t a mechanism to address “single unit of work” – for that use either messaging or transaction.
There are a number of important points here – about contained resources, hierarchy and ‘Unit of Work’ – so I thought I’d record them here for when I forget later 🙂
Recent Comments