FHIR Chat · slicing across reference with resolve() · IG creation

Stream: IG creation

Topic: slicing across reference with resolve()


view this post on Zulip Rob Hausam (Apr 29 2020 at 23:03):

@Grahame Grieve Now that you've released the update for this in v4.2.22 "Fix problem evaluating "type" discriminators ending with .resolve()", can you provide an example (at least one) of the syntax that the code is expecting to be used for the discriminator path and the slice details for a specific type on the referenced resource (the "other end" of the resolve())?

view this post on Zulip Grahame Grieve (Apr 29 2020 at 23:08):

this, from http://hl7.org/fhir/profiling.html

List.entry type item.resolve() Entries are differentiated by the type of the target element that the reference points to

view this post on Zulip Rob Hausam (Apr 29 2020 at 23:33):

Yes. I've actually looked at that probably a hundred times - but the details aren't really there. And it certainly didn't work as expected before. It would be good to know what has changed and how it has changed now, and to see some full example(s) of how it is supposed to work (especially with Composition, rather than List).

view this post on Zulip Rob Hausam (Apr 29 2020 at 23:35):

Composition.section.entry isn't modeled the same as List.entry - the example for List doesn't (or didn't) fit for Composition.

view this post on Zulip Grahame Grieve (Apr 30 2020 at 02:54):

ok, well, here's an example using list. Here's the profile which says that the list has 1 Condition, followed by 1..3 Observations:

<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-slicing-type-resolve"/>
  <url value="http://hl7.org/fhir/test/StructureDefinition/profile-slicing-type-resolve"/>
  <version value="0.1.0"/>
  <name value="TestProfileTypeResolve"/>
  <title value="Test Profile Type Resolve"/>
  <status value="draft"/>
  <date value="2030-04-30T06:30:54+00:00"/>
  <publisher value="HL7"/>
  <fhirVersion value="4.0.0"/>
  <kind value="resource"/>
  <abstract value="false"/>
  <type value="List"/>
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/List"/>
  <derivation value="constraint"/>
  <differential>
    <element id="List.entry">
      <path value="List.entry"/>
      <slicing>
        <discriminator>
          <type value="type"/>
          <path value="item.resolve()"/>
        </discriminator>
        <ordered value="false"/>
        <rules value="closed"/>
      </slicing>
    </element>
    <element id="List.entry:slice1">
      <path value="List.entry"/>
      <sliceName value="slice1"/>
      <min value="1"/>
      <max value="1"/>
    </element>
    <element id="List.entry:slice1.item">
      <path value="List.entry.item"/>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition"/>
      </type>
    </element>
    <element id="List.entry:slice2">
      <path value="List.entry"/>
      <sliceName value="slice2"/>
      <min value="1"/>
      <max value="3"/>
    </element>
    <element id="List.entry:slice2.item">
      <path value="List.entry.item"/>
      <type>
        <code value="Reference"/>
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation"/>
      </type>
    </element>
  </differential>
</StructureDefinition>

view this post on Zulip Grahame Grieve (Apr 30 2020 at 02:54):

here's a list that validates:

<List xmlns="http://hl7.org/fhir">
  <contained>
     <Condition>
       <id value="i1"/>
       <subject>
         <reference value="Patient/example"/>
       </subject>
    </Condition>
  </contained>
  <contained>
    <Observation>
      <id value="i2"/>
      <status value="final"/>
      <code>
        <text value="final"/>
      </code>
    </Observation>
  </contained>
  <status value="current"/>
  <mode value="working"/>
  <entry>
    <item>
      <reference value="#i1"/>
    </item>
  </entry>
  <entry>
    <item>
      <reference value="#i2"/>
    </item>
  </entry>
</List>

and here's one that doesn't (2 errors):

<List xmlns="http://hl7.org/fhir">
  <contained>
     <Condition>
       <id value="i1"/>
       <subject>
         <reference value="Patient/example"/>
       </subject>
    </Condition>
  </contained>
  <contained>
     <Condition>
      <id value="i2"/>
       <subject>
         <reference value="Patient/example"/>
       </subject>
    </Condition>
  </contained>
  <status value="current"/>
  <mode value="working"/>
  <entry>
    <item>
      <reference value="#i1"/>
    </item>
  </entry>
  <entry>
    <item>
      <reference value="#i2"/>
    </item>
  </entry>
</List>

view this post on Zulip Rob Hausam (Apr 30 2020 at 02:56):

Thanks. I'm working on some instances that could server as example(s), too, based on our Composition.section.entry slicing.


Last updated: Apr 12 2022 at 19:14 UTC