0
votes

Slicing of DataElements is defined once per path (only one set of discriminators per unique path). This works for built-in elements, but extension is (and must be) sliced only by url. As a result, it appears that further (more detailed) slicing of an extension isn't possible.

For example, consider an extension to Patient for research authorizations, ext url "http://example.com/DataElement/researchAuth".

It has an extension sub-element "authorizationType" (http://example.com/DataElement/researchAuth.type) of type Code. Here are two instances of this extension (one type "local", one "national").

<extension url="http://example.com/DataElement/researchAuth">
  <extension url="http://example.com/DataElement/researchAuth.type">
    <valueCode value="local" />
  </extension>
  <extension url="http://example.com/DataElement/researchAuth.flag>
    <valueBoolean value="true" />
  </extension>
</extension>
<extension url="http://example.com/DataElement/researchAuth">
  <extension url="http://example.com/DataElement/researchAuth.type">
    <valueCode value="national" />
  </extension>
  <extension url="http://example.com/DataElement/researchAuth.flag>
    <valueBoolean value="false" />
  </extension>
</extension>

The StructureDefinition for this would include (from Patient):

...snip...
<element>
  <path value="Patient.extension" />
  <slicing>
    <discriminator value="url" />
  </slicing>
</element>

I could add an element for researchAuthorization by using type.Profile to define the extension URL, but can I add a slicing as shown?

<element>
  <path value="Patient.extension" />
  <slicing>
    <discriminator value="url" />
  </slicing>
</element>
<element>
  <path value="Patient.extension" />
  <name value="researchAuthorization" />
  <slicing>
    <discriminator value="url" />
    <discriminator value="extension["http://example.com/DataElement/researchAuth.type"].code" />
  </slicing>
  <type>
    <profile value="http://example.com/DataElement/researchAuth" />
  </type>
</element>

The second is now legal since it "satisfies" the first slicing via type.profile.@value being fixed?

1

1 Answers

0
votes

It's possible for a set of sliced data to have multiple discriminators. Whether the existing tooling will support this for extensions is a different question. You may need to manually author your profile.