FHIR Chat · Constraining an extension defined elsewhere - is this OK? · implementers

Stream: implementers

Topic: Constraining an extension defined elsewhere - is this OK?


view this post on Zulip Rob Eastwood (Feb 07 2019 at 01:37):

Hello, I am attempting to derive a profile from an existing profile of Condition, as found in the HL7 Australia IG: AU Condition. Note that this AU Condition profile includes an extension to add the capability to represent the recorder of the condition data (with references to 3 STU3 participant resources); as the R4 Condition counterpart does.

So, in my derived profile from the above I am adding a number of constraints such as adding must support etc, however the constraint of interest here regards the recorder extension. What I am trying to do is swap out the reference to the STU3 participants with more constrained versions that we have defined in a non-public IG.

In order to do this I have added the following into the condition profile structure definition:

<element id="Condition.extension:recorder.valueReference:valueReference">
      <path value="Condition.extension.value[x]"/>
      <sliceName value="valueReference"/>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/patient-dh-base-1"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/practitioner-dh-base-1"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/relatedperson-dh-base-1"/>
      </type>
</element>

The IG builds without error or warnings however this appears in the generated differential table - ie the original recorder STU3 references as well as our local constrained variations:
pasted image

That may be OK, but the generated structuredefinition file reverts the extension's references to the STU3 like so (and is also rendered as such on the snapshot tab) :

<element id="Condition.extension:recorder.valueReference:valueReference">
      <path value="Condition.extension.valueReference"/>
      <sliceName value="valueReference"/>
      <short value="Who recorded the record"/>
      <definition
                  value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="Extension.value[x]"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/Practitioner"/>
      </type>
      <type>
        <code value="Reference"/>
        <targetProfile
                       value="http://hl7.org/fhir/StructureDefinition/RelatedPerson"/>
      </type>
</element>

My first question therefore is - is this form of constraint acceptable; or should I be considering another approach, like creating a new extension maybe or adding invariants?
And if it is acceptable, how to make it work (so that the snapshot contains the desired references to my constrained variants?

Thank you!

view this post on Zulip Rob Eastwood (Feb 07 2019 at 01:40):

Hi @Brett Esler and @Brian Postlethwaite - this is the query that I chatted with you a couple of days ago - FYI.


Last updated: Apr 12 2022 at 19:14 UTC