FHIR Chat · Extensions on Polymorphic types · conformance

Stream: conformance

Topic: Extensions on Polymorphic types


view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:50):

I am looking at a problem in IPS for @Rob Hausam

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:50):

The current differential looks like this:

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:52):

        <element id="MedicationStatement.effective[x]">
            <path value="MedicationStatement.effective[x]"/>
            <slicing>
                <discriminator>
                    <type value="type"/>
                    <path value="$this"/>
                </discriminator>
                <rules value="open"/>
            </slicing>
            <min value="1"/>
            <max value="1"/>
            <mustSupport value="true"/>
        </element>
        <element id="MedicationStatement.effectiveDateTime">
            <path value="MedicationStatement.effectiveDateTime"/>
            <sliceName value="effectiveDateTime"/>
            <type>
                <code value="dateTime"/>
            </type>
        </element>
        <element id="MedicationStatement.effectiveDateTime:data-absent-reason">
            <path value="MedicationStatement.effectiveDateTime.extension"/>
            <sliceName value="data-absent-reason"/>
            <short value="effective[x] absence reason"/>
            <definition value="Provides a reason why the effective is missing."/>
            <max value="1"/>
            <type>
                <code value="Extension"/>
                <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
            </type>
            <mustSupport value="true"/>
        </element>
        <element id="MedicationStatement.effectivePeriod">
            <path value="MedicationStatement.effectivePeriod"/>
            <sliceName value="effectivePeriod"/>
            <type>
                <code value="Period"/>
            </type>
        </element>
        <element id="MedicationStatement.effectivePeriod:data-absent-reason">
            <path value="MedicationStatement.effectivePeriod.extension"/>
            <sliceName value="data-absent-reason"/>
            <short value="effective[x] absence reason"/>
            <definition value="Provides a reason why the effective is missing."/>
            <max value="1"/>
            <type>
                <code value="Extension"/>
                <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
            </type>
            <mustSupport value="true"/>
        </element>

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:53):

summary:

  • the effective[x] element is must-support + sliced by type
  • on both of the types, the data-absent extension is must-support

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:53):

I don't think it should be sliced. So I think it should be like this:

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:54):

        <element>
            <path value="MedicationStatement.effective[x]"/>
            <min value="1"/>
            <max value="1"/>
            <mustSupport value="true"/>
        </element>
        <element>
            <path value="MedicationStatement.effectiveDateTime"/>
            <type>
                <code value="dateTime"/>
            </type>
        </element>
        <element>
            <path value="MedicationStatement.effectiveDateTime.extension"/>
            <sliceName value="data-absent-reason"/>
            <short value="effective[x] absence reason"/>
            <definition value="Provides a reason why the effective is missing."/>
            <max value="1"/>
            <type>
                <code value="Extension"/>
                <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
            </type>
            <mustSupport value="true"/>
        </element>
        <element>
            <path value="MedicationStatement.effectivePeriod"/>
            <type>
                <code value="Period"/>
            </type>
        </element>
        <element>
            <path value="MedicationStatement.effectivePeriod.extension"/>
            <sliceName value="data-absent-reason"/>
            <short value="effective[x] absence reason"/>
            <definition value="Provides a reason why the effective is missing."/>
            <max value="1"/>
            <type>
                <code value="Extension"/>
                <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
            </type>
            <mustSupport value="true"/>
        </element>

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:54):

e..g just take the slicing out.

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:54):

but this is even simpler:

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:55):

        <element>
            <path value="MedicationStatement.effective[x]"/>
            <min value="1"/>
            <max value="1"/>
            <mustSupport value="true"/>
        </element>
        <element>
            <path value="MedicationStatement.effective[x].extension"/>
            <sliceName value="data-absent-reason"/>
            <short value="effective[x] absence reason"/>
            <definition value="Provides a reason why the effective is missing."/>
            <max value="1"/>
            <type>
                <code value="Extension"/>
                <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
            </type>
            <mustSupport value="true"/>
        </element>

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:55):

that is - just define the extension on the choice type

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:56):

the great thing is the snapshot generater/validator don't actually work for any of these combinations...

view this post on Zulip Grahame Grieve (Dec 20 2018 at 03:56):

there's a rule that you can't do the second, because how you can define children for no type... unless they are extensions....

view this post on Zulip Michel Rutten (Jan 07 2019 at 10:58):

If I understand correctly, according to the new new rules for choice types in R4 (that I still need to implement in dotnet API...), a slicing introduction is no longer required when introducing constraints on specific choice types.
As for the second, even shorter version; theoretically a slice introduction can define constraints on the common base type for the whole slice group - in this case Element, which defines the common Element.extension child element. This implies that it should be possible (well defined/parseable) to introduce common extensions inside of a slice group, and even nested/complex extensions.
Not claiming that the dotnet API currently supports the proposed behavior - I suspect that we haven't implemented this (yet).

view this post on Zulip Grahame Grieve (Jan 16 2019 at 13:30):

Decision after discussion on Tuesday evening in San Antonio:

view this post on Zulip Grahame Grieve (Jan 16 2019 at 13:31):

the last form is supported for extension only as a special case. modifierExtension (applicable in truly corner cases) is not supported

view this post on Zulip Michel Rutten (Jan 17 2019 at 09:41):

Seems like I missed out on a fun discussion ;p
Too my understanding, a profile is allowed to introduce _any_ constraints on (child elements of) MedicationStatement.effective[x], and such constraints apply to all specific types in the type slice.
So why is this particular example special? i.e. why do we need additional rules?

view this post on Zulip Grahame Grieve (Jan 17 2019 at 14:20):

in effect, we ruled that it wasn't special; I was just confirming that other people agreed with that

view this post on Zulip Rob Hausam (Feb 01 2019 at 17:12):

@Grahame Grieve It appears that the fix for this isn't complete?

process res: Medication-uv-ips                                                   (35.0253sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Medication-uv-ips.structuredefinition - overriding from 0.1 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips because MedicationStatement.effective[x] has children (MedicationStatement.effective[x].extension) and multiple types (dateTime, Period) in profile MedicationStatement-uv-ips

view this post on Zulip Grahame Grieve (Feb 01 2019 at 20:56):

hmm how did you get the igpublisher you used for that?

view this post on Zulip Rob Hausam (Feb 02 2019 at 04:19):

@Grahame Grieve Just now saw this. I used the IG Publisher from the latest current build (as of this morning).

view this post on Zulip Grahame Grieve (Feb 02 2019 at 21:09):

so Idon't know why you're getting different results to me. are you current against the latest version of IPS?

view this post on Zulip Rob Hausam (Feb 03 2019 at 13:18):

Yes, all current. I'll refresh and recheck all of it and try again - and if I get the same errors I'll give you all of the details.

view this post on Zulip Rob Hausam (Feb 04 2019 at 02:00):

After wiping the temp and output folders and the ips cache, that error went away (not sure which one of those fixed it).

view this post on Zulip Grahame Grieve (Feb 04 2019 at 02:52):

strange

view this post on Zulip Rob Hausam (Feb 04 2019 at 05:25):

@Grahame Grieve Well, I guess I was wrong - missed the error on the last look, but it's still there (and there are more instances now after making the extension usage consistent):

process res: Device-uv-ips                                                       (21.0084sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Device-uv-ips.structuredefinition - overriding from 0.2 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/DeviceUseStatement-uv-ips because DeviceUseStatement.timing[x] has children (DeviceUseStatement.timing[x].extension) and multiple types (Timing, Period, dateTime) in profile DeviceUseStatement-uv-ips
process res: ImagingStudy-uv-ips                                                 (21.0095sec)
process res: Immunization-uv-ips                                                 (21.0112sec)
process res: MedicationStatement-uv-ips                                          (21.0138sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Immunization-uv-ips because Immunization.occurrence[x] has children (Immunization.occurrence[x].extension) and multiple types (dateTime, string) in profile Immunization-uv-ips
process res: Medication-uv-ips                                                   (21.0163sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Medication-uv-ips.structuredefinition - overriding from 0.1 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips because MedicationStatement.effective[x] has children (MedicationStatement.effective[x].extension) and multiple types (dateTime, Period) in profile MedicationStatement-uv-ips
process res: Observation-alcoholuse-uv-ips                                       (21.0182sec)
process res: Observation-media-uv-ips                                            (21.0198sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-alcoholuse-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-alcoholuse-uv-ips
process res: Observation-imaging-uv-ips                                          (21.0210sec)
Error in snapshot generation: Differential for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-media-uv-ips with id: Media.context has an element that is not marked with a snapshot match
process res: Observation-laboratory-uv-ips                                       (21.0248sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Observation-laboratory-uv-ips.structuredefinition - overriding from 0.2 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-imaging-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-imaging-uv-ips
process res: Observation-member-imaging-uv-ips                                   (21.0296sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-laboratory-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-laboratory-uv-ips
process res: Observation-member-laboratory-uv-ips                                (21.0316sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Observation-member-laboratory-uv-ips.structuredefinition - overriding from 0.2 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-member-imaging-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-member-imaging-uv-ips
process res: Observation-member-pathology-uv-ips                                 (21.0340sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Observation-member-pathology-uv-ips.structuredefinition - overriding from 0.2 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-member-laboratory-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-member-laboratory-uv-ips
process res: Observation-pathology-uv-ips                                        (21.0365sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Observation-pathology-uv-ips.structuredefinition - overriding from 0.2 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-member-pathology-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-member-pathology-uv-ips
process res: Observation-pregnancy-edd-uv-ips                                    (21.0388sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pathology-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-pathology-uv-ips
process res: Observation-pregnancy-outcome-uv-ips                                (21.0404sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pregnancy-edd-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-pregnancy-edd-uv-ips
process res: Observation-pregnancy-status-uv-ips                                 (21.0428sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pregnancy-outcome-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-pregnancy-outcome-uv-ips
process res: Observation-tobaccouse-uv-ips                                       (21.0443sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pregnancy-status-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-pregnancy-status-uv-ips
process res: Observation-uv-ips                                                  (21.0457sec)
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-tobaccouse-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-tobaccouse-uv-ips
process res: Organization-laboratory-uv-ips                                      (21.0472sec)
Business version mismatch in /Users/rhausam/git-repo/fhir-ips/resources/Organization-laboratory-uv-ips.structuredefinition - overriding from 0.2 to 0.2.0
Unable to generate snapshot for http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-uv-ips because Observation.effective[x] has children (Observation.effective[x].extension) and multiple types (dateTime, Period, Timing, instant) in profile Observation-uv-ips

Whenever it hits the effective[x] or timing[x] element that triggers the "Unable to generate snapshot" error, the snapshot generation appears as being truncated at that point (prior to rendering the extension in the snapshot):
Screen-Shot-2019-02-03-at-23.22.47.png Screen-Shot-2019-02-03-at-23.23.52.png

view this post on Zulip Rob Hausam (Feb 06 2019 at 21:22):

@Grahame Grieve Have you had a chance yet to look at the snapshot issues with this?

view this post on Zulip Grahame Grieve (Feb 06 2019 at 23:51):

ok will commit fix soon

view this post on Zulip Rob Hausam (Jul 31 2019 at 16:40):

@Grahame Grieve @Michel Rutten One thing I think it never occurred to me (until now) to clarify - are all of the fixes to this expected to be available for use with the current R4 release based on using the newer validator and IG publisher, or do they depend also on further updates to the R4 spec itself (i.e. CI build or R5, or maybe R4 technical correction)?

view this post on Zulip Michel Rutten (Jul 31 2019 at 16:47):

I think the intention is to:
1) improve tooling implementations, fix bugs
2) Publish R4 technical correction
If feasible, i.e. if the required changes are compatible. However incompatible changes will need to wait for R5.

view this post on Zulip Rob Hausam (Jul 31 2019 at 16:57):

So, I think you are confirming that an IG and profiles that are based on the current released version of R4 (4.0.0), using the latest tooling, wouldn't be able to make use of these enhancements?

view this post on Zulip Michel Rutten (Jul 31 2019 at 17:00):

It depends... If we succeed to address this by improving tooling, then you may be able to use this on R4 (4.0.0). If something requires a correction or change in the FHIR spec, then you will need to wait for R4.1 (or R5).

view this post on Zulip Rob Hausam (Jul 31 2019 at 17:01):

Right. That's what I would like to clarify - where exactly are we now with that?

view this post on Zulip Michel Rutten (Jul 31 2019 at 17:01):

I guess we're currently still investigating...

view this post on Zulip Michel Rutten (Jul 31 2019 at 17:04):

Maybe @Grahame Grieve can shed some more light?

view this post on Zulip Rob Hausam (Jul 31 2019 at 21:26):

There is something wrong (or at least incomplete) about this. When we add the dataAbsentReason extension to MedicationStatement.effective[x] in the IPS profile, that itself seems to work OK, but then in both the differential and the snapshot the IG Publisher no longer renders the effectiveDateTime and effectivePeriod choices. And if instead you try to slice it, that does show the choices but with all three elements as siblings, and then it's not really obvious that effectiveDateTime and effectivePeriod are actually the choices for effective[x] (and that effective[x] itself can't actually exist).

And when you are just adding the extension to the base effective[x] element (not explicitly slicing) the build qa shows these information messages (at least they're not errors):

Bundle/IPS-examples-Bundle-01: Bundle.entry[5].resource.effective.ofType(Period).start  information Could not verify slice for profile http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips
Bundle/IPS-examples-Bundle-01: Bundle.entry[6].resource.effective.ofType(Period).start  information Could not verify slice for profile http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips

And if instead I explicitly slice the two types, in addition to the sibling element rendering that I mentioned before I also get a broken link error that it can't resolve the effective[x].extension (I don't have a copy of that error message at the moment).

view this post on Zulip Grahame Grieve (Jul 31 2019 at 21:58):

how do I reproduce this?

view this post on Zulip Rob Hausam (Aug 01 2019 at 00:54):

the non-sliced version is in the IPS IG repo, if you build that
and the code for the (implicit) slicing is commented out in MedicationStatement-uv-ips.structuredefinition.xml in lines 158-177

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:10):

ok, the non-sliced version, since you shouldn't slice. Here's the diff:

 <element id="MedicationStatement.effective[x]">
      <path value="MedicationStatement.effective[x]"/>
      <min value="1"/>
      <max value="1"/>
      <mustSupport value="true"/>
    </element>
    <element id="MedicationStatement.effective[x].extension">
      <path value="MedicationStatement.effective[x].extension"/>
      <short value="effective[x] absence reason"/>
      <definition value="Provides a reason why the effective is missing."/>
      <max value="1"/>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
      </type>
      <mustSupport value="true"/>
    </element>

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:10):

and here's the rendering:

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:11):

pasted image

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:11):

that seems exactly what is expected to me

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:12):

turning to the snapshot:

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:12):

   <element id="MedicationStatement.effective[x]">
      <path value="MedicationStatement.effective[x]"/>
      <short
             value="The date/time or interval when the medication is/was/will be taken"/>
      <definition
                  value="The interval of time during which it is being asserted that the patient is/was/will be taking the medication (or was not taking, when the MedicationStatement.taken element is No)."/>
      <comment
               value="This attribute reflects the period over which the patient consumed the medication and is expected to be populated on the majority of Medication Statements. If the medication is still being taken at the time the statement is recorded, the &quot;end&quot; date will be omitted.  The date/time attribute supports a variety of dates - year, year/month and exact date.  If something more than this is required, this should be conveyed as text."/>
      <min value="1"/>
      <max value="1"/>
      <base>
        <path value="MedicationStatement.effective[x]"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code value="dateTime"/>
      </type>
      <type>
        <code value="Period"/>
      </type>
      <mustSupport value="true"/>
      <isModifier value="false"/>
      <isSummary value="true"/>
      <mapping>
        <identity value="workflow"/>
        <map value="Event.occurrence[x]"/>
      </mapping>
      <mapping>
        <identity value="w5"/>
        <map value="FiveWs.done[x]"/>
      </mapping>
      <mapping>
        <identity value="rim"/>
        <map value=".effectiveTime"/>
      </mapping>
    </element>
    <element id="MedicationStatement.effective[x].id">
      <path value="MedicationStatement.effective[x].id"/>
      <representation value="xmlAttr"/>
      <short value="Unique id for inter-element referencing"/>
      <definition
                  value="Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.id"/>
        <min value="0"/>
        <max value="1"/>
      </base>
      <type>
        <code>
          <extension
                     url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
            <valueString value="string"/>
          </extension>
          <extension
                     url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
            <valueString value="xsd:string"/>
          </extension>
          <extension
                     url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
            <valueString value="xsd:string"/>
          </extension>
        </code>
      </type>
      <isModifier value="false"/>
      <isSummary value="false"/>
      <mapping>
        <identity value="rim"/>
        <map value="n/a"/>
      </mapping>
    </element>
    <element id="MedicationStatement.effective[x].extension">
      <path value="MedicationStatement.effective[x].extension"/>
      <slicing>
        <discriminator>
          <type value="value"/>
          <path value="url"/>
        </discriminator>
        <description value="Extensions are always sliced by (at least) url"/>
        <rules value="open"/>
      </slicing>
      <short value="effective[x] absence reason"/>
      <definition value="Provides a reason why the effective is missing."/>
      <min value="0"/>
      <max value="1"/>
      <base>
        <path value="Element.extension"/>
        <min value="0"/>
        <max value="*"/>
      </base>
      <type>
        <code value="Extension"/>
        <profile
                 value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
      </type>
      <mustSupport value="true"/>
      <isModifier value="false"/>
      <isSummary value="false"/>
      <mapping>
        <identity value="rim"/>
        <map value="ANY.nullFlavor"/>
      </mapping>
    </element>

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:13):

that also seems right to me

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:13):

and the rendering:

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:14):

pasted image

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:14):

the id is missing a type.... I think otherwise it is how I expect it to be

view this post on Zulip Grahame Grieve (Aug 01 2019 at 01:18):

it may be that this is working different for me, since I have a few unreleased fixes. @Rob Hausam

view this post on Zulip Rob Hausam (Aug 01 2019 at 01:51):

yes, I saw that you made more changes - I might do a local build to check, unless you are going to be releasing imminently

view this post on Zulip Grahame Grieve (Aug 01 2019 at 02:03):

it's building, but that takes 90min right now

view this post on Zulip Rob Hausam (Aug 01 2019 at 03:57):

@Grahame Grieve With the new 0.9.47 IG Publisher I'm not seeing any difference (that I've been able to notice) with what was there before. It still does seem strange to me that the effectiveDateTime and effectivePeriod choices aren't being rendered in the snapshot, whereas they are in the core spec. That doesn't seem great to me, but I can probably live with it. I'm also still getting the "Could not verify slice" information messages in the qa that I posted above. Do we just ignore those?

view this post on Zulip Grahame Grieve (Aug 01 2019 at 04:00):

oh - the way they are in the core spec - that's a different set of code.

view this post on Zulip Grahame Grieve (Aug 01 2019 at 04:00):

but it raises an interesting question - the rendering of children would run into the rendering of choices if I brought the choice rendering across - they're not differentiated

view this post on Zulip Grahame Grieve (Aug 01 2019 at 04:00):

I'll look into the slice validation

view this post on Zulip Rob Hausam (Aug 01 2019 at 04:01):

ok

view this post on Zulip Rob Hausam (Aug 01 2019 at 04:04):

yes, the choice and child rendering is in the same space so they have the potential to collide or be confused - but maybe there is some way to differentiate them and indicate that they are distinct?

view this post on Zulip Rob Hausam (Jan 20 2020 at 19:36):

I'm resurrecting this somewhat old thread, as I'm not sure exactly where we've gotten with it (in the R4 technical correction, particularly). When I build the IPS IG with the latest publisher I'm getting a snapshot error on the MedicationStatement-uv-ips profile, which uses the data-absent-reason extension on effective[x]:

Error in snapshot generation: The profile http://hl7.org/fhir/uv/ips/StructureDefinition/MedicationStatement-uv-ips has 2 elements in the differential (id: MedicationStatement.effective[x], id: MedicationStatement.effective[x]:data-absent-reason) that don't have a matching element in the snapshot: check that the path and definitions are legal in the differential (including order)
Differential:
  MedicationStatement : [0..null]
  MedicationStatement.id : [0..null]
  MedicationStatement.status : [0..null]
  MedicationStatement.medication[x] : CodeableConcept([CanonicalType[http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips]])|Reference[0..null]
  MedicationStatement.effective[x] : [1..1]
  MedicationStatement.effective[x].extension : Extension([CanonicalType[http://hl7.org/fhir/StructureDefinition/data-absent-reason]])[0..1]
  MedicationStatement.subject : Reference[0..null]
  MedicationStatement.subject.reference : [1..null]
  MedicationStatement.informationSource : [0..null]
  MedicationStatement.dosage : [0..null]
  MedicationStatement.dosage.text : [0..null]
  MedicationStatement.dosage.timing : [0..null]
  MedicationStatement.dosage.route : CodeableConcept([CanonicalType[http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips]])[0..null]
Snapshot:
  MedicationStatement : [0..*]  constraints=5
  MedicationStatement.id : string[0..1]
  MedicationStatement.meta : Meta[0..1]  constraints=1
  MedicationStatement.implicitRules : uri[0..1]  constraints=1
  MedicationStatement.language : code[0..1]  constraints=1
  MedicationStatement.text : Narrative[0..1]  constraints=1
  MedicationStatement.contained : Resource[0..*]
  MedicationStatement.extension : Extension[0..*]  constraints=2
  MedicationStatement.modifierExtension : Extension[0..*]  constraints=2
  MedicationStatement.identifier : Identifier[0..*]  constraints=1
  MedicationStatement.basedOn : Reference[0..*]  constraints=1
  MedicationStatement.partOf : Reference[0..*]  constraints=1
  MedicationStatement.status : code[1..1]  constraints=1
  MedicationStatement.statusReason : CodeableConcept[0..*]  constraints=1
  MedicationStatement.category : CodeableConcept[0..1]  constraints=1
  MedicationStatement.medication[x] : CodeableConcept([CanonicalType[http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips]])|Reference[1..1]  constraints=1
  MedicationStatement.subject : Reference[1..1]  constraints=1
  MedicationStatement.subject.id : string[0..1]
  MedicationStatement.subject.extension : Extension[0..*] (slicing by url)  constraints=2
  MedicationStatement.subject.reference : string[1..1]  constraints=1
  MedicationStatement.subject.type : uri[0..1]  constraints=1
  MedicationStatement.subject.identifier : Identifier[0..1]  constraints=1
  MedicationStatement.subject.display : string[0..1]  constraints=1
  MedicationStatement.context : Reference[0..1]  constraints=1
  MedicationStatement.effective[x] : dateTime|Period[0..1]  constraints=1
  MedicationStatement.dateAsserted : dateTime[0..1]  constraints=1
  MedicationStatement.informationSource : Reference[0..1]  constraints=1
  MedicationStatement.derivedFrom : Reference[0..*]  constraints=1
  MedicationStatement.reasonCode : CodeableConcept[0..*]  constraints=1
  MedicationStatement.reasonReference : Reference[0..*]  constraints=1
  MedicationStatement.note : Annotation[0..*]  constraints=1
  MedicationStatement.dosage : Dosage[0..*]  constraints=1
  MedicationStatement.dosage.id : string[0..1]
  MedicationStatement.dosage.extension : Extension[0..*] (slicing by url)  constraints=2
  MedicationStatement.dosage.modifierExtension : Extension[0..*]  constraints=2
  MedicationStatement.dosage.sequence : integer[0..1]  constraints=1
  MedicationStatement.dosage.text : string[0..1]  constraints=1
  MedicationStatement.dosage.additionalInstruction : CodeableConcept[0..*]  constraints=1
  MedicationStatement.dosage.patientInstruction : string[0..1]  constraints=1
  MedicationStatement.dosage.timing : Timing[0..1]  constraints=1
  MedicationStatement.dosage.asNeeded[x] : boolean|CodeableConcept[0..1]  constraints=1
  MedicationStatement.dosage.site : CodeableConcept[0..1]  constraints=1
  MedicationStatement.dosage.route : CodeableConcept([CanonicalType[http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips]])[0..1]  constraints=1
  MedicationStatement.dosage.method : CodeableConcept[0..1]  constraints=1
  MedicationStatement.dosage.doseAndRate : Element[0..*]  constraints=1
  MedicationStatement.dosage.doseAndRate.id : string[0..1]
  MedicationStatement.dosage.doseAndRate.extension : Extension[0..*] (slicing by url)  constraints=2
  MedicationStatement.dosage.doseAndRate.type : CodeableConcept[0..1]  constraints=1
  MedicationStatement.dosage.doseAndRate.dose[x] : Range|Quantity([CanonicalType[http://hl7.org/fhir/StructureDefinition/SimpleQuantity]])[0..1]  constraints=1
  MedicationStatement.dosage.doseAndRate.rate[x] : Ratio|Range|Quantity([CanonicalType[http://hl7.org/fhir/StructureDefinition/SimpleQuantity]])[0..1]  constraints=1
  MedicationStatement.dosage.maxDosePerPeriod : Ratio[0..1]  constraints=1
  MedicationStatement.dosage.maxDosePerAdministration : Quantity([CanonicalType[http://hl7.org/fhir/StructureDefinition/SimpleQuantity]])[0..1]  constraints=1
  MedicationStatement.dosage.maxDosePerLifetime : Quantity([CanonicalType[http://hl7.org/fhir/StructureDefinition/SimpleQuantity]])[0..1]  constraints=1

This appears to be related to the use of the extension on the polymorphic type. Maybe there is something that we need to change for this in the profile?:

        <element id="MedicationStatement.effective[x]">
            <path value="MedicationStatement.effective[x]"/>
            <min value="1"/>
            <max value="1"/>
            <mustSupport value="true"/>
        </element>
        <element id="MedicationStatement.effective[x]:data-absent-reason">
            <path value="MedicationStatement.effective[x].extension"/>
            <short value="effective[x] absence reason"/>
            <definition value="Provides a reason why the effective is missing."/>
            <max value="1"/>
            <type>
                <code value="Extension"/>
                <profile value="http://hl7.org/fhir/StructureDefinition/data-absent-reason"/>
            </type>
            <mustSupport value="true"/>
        </element>

Or maybe this hasn't been fully implemented in the snapshot generator? I don't know if we have any explicit documentation on it - I didn't see any in the Extensibility section. @Grahame Grieve?

view this post on Zulip Grahame Grieve (Jan 20 2020 at 19:49):

is this in the currently committed IPS?

view this post on Zulip Rob Hausam (Jan 20 2020 at 19:49):

yes

view this post on Zulip Rob Hausam (Jan 20 2020 at 20:12):

By the way, this particular snapshot generation error and two others that I fixed (by re-ordering the elements correctly) didn't show up in the IG build qa page on in the report of errors, warnings and info at the end of the build. I assume that they should? They are quite easy to overlook, otherwise, being buried in the rather voluminous build log output.

view this post on Zulip Grahame Grieve (Jan 20 2020 at 23:44):

actually, the reason is much more prosaic - you have the elements out of order in your differential, and you're not getting an error because the IG publisher sorts your differential before it processes it directly, but composition depends on it and so it gets the snapshot generated internally without sorting. So you see the error associated with that internal iteration, but not the later one which would be linked to qa.

view this post on Zulip Rob Hausam (Jan 21 2020 at 00:47):

Yes, thanks (and apologies for bothering you with it). The order was what I first thought about and looked at, but somehow I still missed that effective[x] and subject were still in the wrong order. :(

view this post on Zulip Grahame Grieve (Jan 21 2020 at 00:47):

well, in the future it will be an explicit error


Last updated: Apr 12 2022 at 19:14 UTC