They look complex and often appear in bundles received from external software. Here’s an example use case.
Let’s say we’re importing legacy data from an older system into our FHIR server. We have access to most of the data, but not all.
Part of the import is pulling in procedures carried out before the FHIR server existed.
Alongside the procedure, we have the surgeon’s name: Maria Smith. But we don’t have any unique ID for her. No hospital ID, no social security number.
Chances are Dr Maria already exists as a Practitioner in our FHIR server, but we can’t connect to her by name only as there could be more than one Dr. Maria in a large hospital.
So we create our Procedure resource, and inside that resource’s contained resources we create a Practitioner resource with her name and an ID of “Practitioner”.
We then add this Practitioner as an actor to the Procedure’s Performed element using the reference “#Practitioner”.
Contained resources are not complete resources. They cannot have extensions. They cannot contain other resources — no nesting. They cannot be referenced outside their parent resource.
They don’t have an independent existence in our FHIR server. You can’t write a query to find them.
More about contained resources: http://hl7.org/fhir/R4/references.html#contained
Sign up to “The Tuesday FHIR Sessions” and receive an email every Tuesday where I go deep on a single FHIR topic.