Stream: implementers
Topic: Adding a new slice to an existing slide in a derived profile
Rick Geimer (Jul 20 2017 at 19:13):
I need some help getting the IG publisher to recognize a new slice in a derived profile added to an existing slice defined in a base profile.
My base profile looks like this:
<element id="Composition.section"> <path value="Composition.section"/> <slicing> <discriminator> <type value="value"/> <path value="code"/> </discriminator> <rules value="open"/> </slicing> </element> <element id="Composition.section:health_concerns_section_slice"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> <valueString value="Section"/> </extension> <path value="Composition.section"/> <sliceName value="health_concerns_section_slice"/> <short value="Health Concerns Section"/> <min value="1"/> <max value="1"/> </element> <element id="Composition.section:health_concerns_section_slice.code"> <path value="Composition.section.code"/> <short value="Health concerns section code"/> <min value="1"/> <patternCodeableConcept> <coding> <system value="http://loinc.org"/> <code value="75310-3"/> </coding> </patternCodeableConcept> </element> ... other slices follow
In my derived profile I am trying to add a new slice for a "Payers" section. I tried doing the following:
<element id="Composition.section:payer_section_slice"> <path value="Composition.section" /> <sliceName value="payer_section_slice" /> <short value="Payers Section" /> <max value="1" /> </element> <element id="Composition.section:payer_section_slice.code"> <path value="Composition.section.code"/> <short value="Payers section code"/> <min value="1"/> <patternCodeableConcept> <coding> <system value="http://loinc.org"/> <code value="48768-6"/> </coding> </patternCodeableConcept> </element>
... but no luck. I also tried repeating the slicing declaration in the derived profile, but that didn't work either.
<element id="Composition.section"> <path value="Composition.section"/> <slicing> <discriminator> <type value="value"/> <path value="code"/> </discriminator> <rules value="open"/> </slicing> </element> <element id="Composition.section:payer_section_slice"> <path value="Composition.section" /> <sliceName value="payer_section_slice" /> <short value="Payers Section" /> <max value="1" /> </element> <element id="Composition.section:payer_section_slice.code"> <path value="Composition.section.code"/> <short value="Payers section code"/> <min value="1"/> <patternCodeableConcept> <coding> <system value="http://loinc.org"/> <code value="48768-6"/> </coding> </patternCodeableConcept> </element>
The IG builds fine, but the new Payer section doesn't show up in the differential or snapshot rendering in the derived profile.
Any ideas?
Eric Haas (Jul 21 2017 at 00:10):
I need some help getting the IG publisher to recognize a new slice in a derived profile added to an existing slice defined in a base profile.
My base profile looks like this:
<element id="Composition.section"> <path value="Composition.section"/> <slicing> <discriminator> <type value="value"/> <path value="code"/> </discriminator> <rules value="open"/> </slicing> </element> <element id="Composition.section:health_concerns_section_slice"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name"> <valueString value="Section"/> </extension> <path value="Composition.section"/> <sliceName value="health_concerns_section_slice"/> <short value="Health Concerns Section"/> <min value="1"/> <max value="1"/> </element> <element id="Composition.section:health_concerns_section_slice.code"> <path value="Composition.section.code"/> <short value="Health concerns section code"/> <min value="1"/> <patternCodeableConcept> <coding> <system value="http://loinc.org"/> <code value="75310-3"/> </coding> </patternCodeableConcept> </element> ... other slices followIn my derived profile I am trying to add a new slice for a "Payers" section. I tried doing the following:
<element id="Composition.section:payer_section_slice"> <path value="Composition.section" /> <sliceName value="payer_section_slice" /> <short value="Payers Section" /> <max value="1" /> </element> <element id="Composition.section:payer_section_slice.code"> <path value="Composition.section.code"/> <short value="Payers section code"/> <min value="1"/> <patternCodeableConcept> <coding> <system value="http://loinc.org"/> <code value="48768-6"/> </coding> </patternCodeableConcept> </element>... but no luck. I also tried repeating the slicing declaration in the derived profile, but that didn't work either.
<element id="Composition.section"> <path value="Composition.section"/> <slicing> <discriminator> <type value="value"/> <path value="code"/> </discriminator> <rules value="open"/> </slicing> </element> <element id="Composition.section:payer_section_slice"> <path value="Composition.section" /> <sliceName value="payer_section_slice" /> <short value="Payers Section" /> <max value="1" /> </element> <element id="Composition.section:payer_section_slice.code"> <path value="Composition.section.code"/> <short value="Payers section code"/> <min value="1"/> <patternCodeableConcept> <coding> <system value="http://loinc.org"/> <code value="48768-6"/> </coding> </patternCodeableConcept> </element>The IG builds fine, but the new Payer section doesn't show up in the differential or snapshot rendering in the derived profile.
Any ideas?
What I do is hand edit the slicing after the ig pub generates it and the use this sd instead
Rick Geimer (Jul 21 2017 at 00:46):
@Eric Haas You you hand edit what? The generated HTML? Or do you take the generated StructureDefinition and hand edit that (differential and snapshot) then feed it back to the IG publisher again? If so, do the Differential and Snapshot tabs render correctly?
Rick Geimer (Jul 21 2017 at 13:41):
For now I may just ditch adding slices, reslicing, etc. and instead copy the base profile and modify it directly. This is for a comment-only ballot, so I will mention in the IG description that we will try to get the inheritance working properly before going back for STU.
Eric Haas (Jul 26 2017 at 20:34):
@Eric Haas You you hand edit what? The generated HTML? Or do you take the generated StructureDefinition and hand edit that (differential and snapshot) then feed it back to the IG publisher again? If so, do the Differential and Snapshot tabs render correctly?
I hand edit the SD - delete text, snapshot and edit the diff
Michel Rutten (Jul 27 2017 at 07:47):
Hi @Eric Haas, the derived profile should repeat the slice entry. Then you can add constraints on existing named slices and introduce new named slices. Forge supports this BTW.
Rick Geimer (Jul 27 2017 at 19:18):
@Michel Rutten Yes, it worked fine for me in Forge, but the IG publisher would not recognize the new slice when it generated the snapshot and differential diagrams.
Eric Haas (Jul 27 2017 at 19:42):
adding a new slice to another profile ( using the same discriminator worked for me in IG pub. I get slice1 in profile1 and add slice2 in profile2 based on profile 1.
<?xml version="1.0" encoding="UTF-8"?> <StructureDefinition xmlns="http://hl7.org/fhir"> <id value="template-basic2"/> <url value="http://www.fhir.org/guides/test/StructureDefinition/template-basic2"/> <!-- snip ... --> <baseDefinition value="http://www.fhir.org/guides/test/StructureDefinition/template-basic"/> <derivation value="constraint"/> <differential> <element id="Basic"> <path value="Basic"/> <definition value="This is a simple example Template."/> <mustSupport value="false"/> <isModifier value="false"/> </element> <!-- ****** the discriminator is defined in the profile upon which this profile is based ********* <element id="Basic.identifier"> <path value="Basic.identifier"/> <slicing> <discriminator> <type value="value"/> <path value="system"/> </discriminator> <rules value="open"/> </slicing> <min value="1"/> <max value="*"/> <type> <code value="Identifier"/> </type> <mustSupport value="true"/> <isModifier value="false"/> </element> --> <!--add a slice in the new profile --> <element id="Basic.identifier:slice2"> <path value="Basic.identifier"/> <sliceName value="slice2"/> <min value="1"/> <max value="1"/> <type> <code value="Identifier"/> </type> <mustSupport value="true"/> <isModifier value="false"/> </element> <element id="Basic.identifier:slice2.system"> <path value="Basic.identifier.system"/> <min value="1"/> <max value="1"/> <type> <code value="uri"/> </type> <fixedUri value="http://acme.org/identifiers2"/> <mustSupport value="true"/> <isModifier value="false"/> </element> </differential> </StructureDefinition>
Eric Haas (Jul 27 2017 at 19:43):
tried to add a discriminator in profile2 and that did not work for me
Last updated: Apr 12 2022 at 19:14 UTC