hl7-fhirfhir-net-api

Resolving references to contained resources - does versioning apply?


When resolving absolute or relative reference, we must take into account the version of the resource as specified in meta.versionId of the resource being referenced, if the reference contains a versionId. Does the same logic apply to references to contained resources? I ask because the Fhir .net API appears to contain version logic in functions for resolving absolute references with version specified (BundleExtensions.FindEntry), but does not have any version specific logic for in functions for resolving contained resources (DomainResource.FindContainedResource).

The FHIR documentation around referencing resources does not appear to talk about whether or not versioning applies when referencing contained resources.


Solution

  • Contained resources do not have an independent existence, and they cannot have a versionId (among other things), so also cannot be referenced with a version. See http://www.hl7.org/fhir/references.html#contained for more information.

    When you need to change data to contained resources, you will need to update the source/parent resource which will then get a new version.