FHIR Chat · example for a profiled composition on section codes? · implementers

Stream: implementers

Topic: example for a profiled composition on section codes?


view this post on Zulip Oliver Egger (Feb 21 2017 at 17:08):

has anyone an example for a profiled composition on sections (fixing the codes and order for the sections in which they are appearing in the composition) with the latest R3 StructureDefinition format?

I tried it with the following:

    <element id="Composition">
            <path value="Composition" />
            <min value="1" />
            <max value="1" />
        </element>

        <element id="Composition.section">
            <path value="Composition.section" />
            <slicing>
                <discriminator>
                    <type value="value" />
                    <path value="code.coding.code" />
                </discriminator>
                <ordered value="true" />
                <rules value="closed" />
            </slicing>
            <min value="2" />
            <max value="2" /> 
        </element>

        <!-- first slice -->
        <element id="Composition.section:sectionmed">
            <path value="Composition.section" />
            <sliceName value="sectionmed" />
            <min value="1" />
            <max value="1" />
        </element>
... snip ...

however the validator spits outs the message with two sections in a sample file:

  Error @ Composition.section[1] (line 35, col11) : Profile ..., Element matches more than one slice
  Error @ Composition.section[2] (line 57, col11) : Profile ..., Element matches more than one slice
  Error @ Composition (line 1, col42) : Profile ...., Element 'Composition.section[sectionmed]' minimum required = 1, but only found 0

I think I did not setup the path value correctly, but I'm not 100% sure, the examples about slicing are not yet following the new syntax as far as I have found. any help greatly appreciated.

view this post on Zulip Lloyd McKenzie (Feb 21 2017 at 17:50):

There's currently a bug in how the validator handles slicing in a couple of areas. I hope to get to it tomorrow. (So the problem is likely mine, not yours.)

view this post on Zulip Richard Kavanagh (Feb 22 2017 at 12:06):

We are doing this in DSTU2 using Forge to build the StructureDefinitions. Looking at you definition of your first slice what within it makes it a uniquie slice? Should you now have something that states the "code" of the section that resolves to that slice as that is what your discriminator is based on.

view this post on Zulip Oliver Egger (Mar 17 2017 at 10:48):

Hi @Lloyd McKenzie . I just upgraded today to trunk and retried the validator, however I get still the same error message with my composition.(Element matches more than one slice). Could you already look into the slicing bug of the validator?

view this post on Zulip Lloyd McKenzie (Mar 17 2017 at 21:47):

@Oliver Egger On my list for this weekend. Has kept getting pushed back :(

view this post on Zulip Richard Kavanagh (Mar 17 2017 at 23:37):

@Oliver Egger Which example/profile? We have had this error a few times and managed to resolve it

view this post on Zulip Oliver Egger (Mar 20 2017 at 08:56):

Hi @Richard Kavanagh . Thanks for you message. I have problems with slicing/validating a specific extensions as well as two sections in a Composition:

Example: https://github.com/ahdis/chmed16af/blob/master/resources/Composition/chmed16af-mp-composition-s01.xml
Profile: https://github.com/ahdis/chmed16af/blob/master/resources/StructureDefinition/chmed16af-mp-composition.xml

  Error @ Composition.extension (line 8, col93) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-mp-composition, Element matches more than one slice
  Error @ Composition.section[1] (line 40, col11) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-mp-composition, Element matches more than one slice
  Error @ Composition.section[2] (line 62, col11) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-mp-composition, Element matches more than one slice
  Error @ Composition.section[3] (line 102, col11) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-mp-composition, Element matches more than one slice
  Error @ Composition (line 1, col42) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-mp-composition, Element 'Composition.section[sectionmed]': minimum required = 1, but only found 0
  Error @ Composition (line 1, col42) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-mp-composition, Element 'Composition.section[sectionnote]': minimum required = 1, but only found 0

I tried a simliar setup following the BP profile from http://build.fhir.org/bp.profile.xml.html for time of gestation with two coded entries in components:

Example: https://github.com/ahdis/chmed16af/blob/master/resources/StructureDefinition/chmed16af-obs-timeofgestation.xml
Profile: https://github.com/ahdis/chmed16af/blob/master/resources/Observation/chmed16af-observation-s01-timeofgestation.xml

But I get also similar errors:

  Error @ Observation.code.coding (line 15, col17) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-obs-timeofgestation, Element matches more than one slice
  Error @ Observation.component[1] (line 24, col16) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-obs-timeofgestation, Element matches more than one slice
  Error @ Observation.component[2] (line 39, col16) : Profile http://emediplan.ch/fhir/chmed16af/StructureDefinition/chmed16af-obs-timeofgestation, Element matches more than one slice

So thats why I first thought its a problem with the validator after @Lloyd McKenzie message. But if you have any idea why my profiles are not working I would be glad to try alternate approaches.

view this post on Zulip Lloyd McKenzie (Mar 22 2017 at 04:06):

@Oliver Egger Right now, the issue is with snapshot generation, not the validator. It's an evil bit of code, so it's taking a while.

view this post on Zulip Oliver Egger (Mar 23 2017 at 08:35):

trying to dig deeper into the validation problems:

This raises the questions for me, if the snapshot in the http://hl7.org/fhir/StructureDefinition/bodyheight profile is not correct or the error message comes from the validator. @Lloyd McKenzie any idea how i can track down further the problem?

view this post on Zulip Michel Rutten (Mar 23 2017 at 10:24):

@Oliver Egger seems that in the http://hl7.org/fhir/StructureDefinition/bodyheight profile, the differential introduces a slicing component on the element with id "Observation:vitalsignsprofile.code.coding" (xml line 2938), but that slicing component is missing from the snapshot...?

view this post on Zulip Lloyd McKenzie (Mar 23 2017 at 15:02):

Yes, that's the problem. Snapshot generation is currently broken when slicing is involved. There are at least two issues, possibly more. Grahame is working on it. We'll plan to release a patch for the main spec next week that fixes this and a few other things.

view this post on Zulip Michel Rutten (Mar 23 2017 at 15:08):

Poor Grahame, snapshots and slicing hurts my brain... ;p

view this post on Zulip Lloyd McKenzie (Mar 23 2017 at 15:13):

As I said, "evil code" . . .

view this post on Zulip Oliver Egger (Mar 23 2017 at 16:47):

thanks @Lloyd McKenzie and @Michel Rutten for your feedback and glad to hear that it is on the agenda, you have my support for testing ...


Last updated: Apr 12 2022 at 19:14 UTC