Stream: implementers
Topic: Contained v _include
René Spronk (Jun 28 2019 at 07:15):
During a recent FHIR training course one of the attendees observed "we use contained resources in a response (e.g. when GETting an Observation) because this avoids the client from having to fetch all referenced resources" - contained remains a difficult thing to explain to those learning FHIR, which may be a sign we need better wording on it. For this specific use case, as an alternative approach (question:) if a client searched for e.g. an Observation, could a server (at its own initiative) _include all resources referenced by that Observation in the response bundle? To me: yes, as long as the self link in the response bundle exposes this behaviour.
https://hl7.org/fhir/R4/references.html#contained "If the data available when the resource is constructed does not include record keys or absolute identification information, then a properly identified resource cannot be assembled" - (question:) so if a resource doesn't have a reliable (logical) Id NOR a (business) identifier, THEN it would automatically be a candidate to be an included resource? Or put in another way: if a resource has either a logical.id or a business.identifier, it shall never be a contained resource?
Lloyd McKenzie (Jun 28 2019 at 13:41):
I'm nervous about automatically including data that the client didn't ask for. First, it unnecessarily bulks up the response - with costs in performance and bandwidth. Second, there could be privacy considerations around disclosing information that wasn't asked for. However, it would certainly be good for us to be more explicit about how 'contained' should and should not be used - and to provide pointers to implementers on better solutions for those who are tempted to abuse it. Added GF#22780
Richard Townley-O'Neill (Jul 01 2019 at 04:11):
Is it good practice to contain the items in a list in the list resource? That is done for the examples of FamilyMedicalHistory? e.g. http://build.fhir.org/list-example-familyhistory-f201-roel.html.
Last updated: Apr 12 2022 at 19:14 UTC