FHIR Chat · No slicing on the root element · implementers

Stream: implementers

Topic: No slicing on the root element


view this post on Zulip Katarina (Aug 21 2019 at 12:06):

Hello,
I created a profile with an extension with forge and validated the xml that is generated by forge.
For validation I use the FHIR Validator (https://wiki.hl7.org/index.php?title=Using_the_FHIR_Validator).
The validation output shows the following error "No slicing on the root element [element.first().slicing.empty()]".
I found out, that the problem is that the extension is the first element in the differential in the xml.
When I change the order of the elements, so that the extension is not first element, I get no error.
Why is the xml produced by forge not in the right order? Or is the validation tool not working correctly?
Has anyone had the same problem?

view this post on Zulip Lloyd McKenzie (Aug 21 2019 at 12:12):

This might be a validator problem rather than a Forge problem. @Grahame Grieve, is this another sparse differential issue we haven't dealt with?

view this post on Zulip Lloyd McKenzie (Aug 21 2019 at 12:13):

It may be a candidate for a technical correction for R4 too if this is being enforced on differential

view this post on Zulip Katarina (Aug 21 2019 at 13:53):

I tried also validate on Simplifier and $validate on vonk, both are showing the same error.

view this post on Zulip Katarina (Aug 21 2019 at 13:57):

Are there other fhir validation tools that can check Profiles. For example if a ValueSet that is used in a binding is defined for example in a repository?
Or that the profile follows some defined naming conventions?

view this post on Zulip Grahame Grieve (Aug 21 2019 at 19:36):

you'll have to share an instance (actually, both profile and test case) so we can understand what you are doing

view this post on Zulip Michel Rutten (Aug 22 2019 at 09:10):

Hi @Katarina, as Grahame mentions, is it possible to share an instance?
Forge indeed generates sparse differentials and the first element doesn't need to be the root. This is compliant to the FHIR spec. Validators should accept this; if they complain, then this indicates a bug in the validation logic.
Also see the definition of invariant sdf-20:
http://hl7.org/fhir/structuredefinition.html
The expression applies to the root element without "." in the path - not the first element in the list.

view this post on Zulip Katarina (Aug 22 2019 at 09:20):

Instance:

<?xml version="1.0" encoding="utf-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
<url value="https://example.de/fhir/StructureDefinition/ClinicalInformation" />
<id value="clinicalInformation"/>
<version value="0.1"/>
<name value="ClinicalInformation" />
<status value="draft" />
<fhirVersion value="3.0.1" />
<kind value="resource" />
<abstract value="false" />
<type value="Condition" />
<baseDefinition value="http://fhir.de/StructureDefinition/condition-de-basis/0.2" />
<derivation value="constraint" />
<differential>
<element id="Condition.extension">
<path value="Condition.extension" />
<slicing>
<discriminator>
<type value="value" />
<path value="url" />
</discriminator>
<rules value="open" />
</slicing>
</element>
<element id="Condition.extension:infection">
<path value="Condition.extension" />
<sliceName value="infection" />
<type>
<code value="Extension" />
<profile value="https://example.de/fhir/StructureDefinition/Infection" />
</type>
</element>
<element id="Condition.evidence.code.coding.system">
<path value="Condition.evidence.code.coding.system" />
<binding>
<strength value="required" />
<valueSetUri value="https://example.de/fhir/ValueSet/symptom" />
</binding>
</element>
</differential>
</StructureDefinition>

view this post on Zulip Katarina (Aug 22 2019 at 09:25):

For this profile I got the mentioned error. When I changed the order so that the Condition.evidence.code.coding.system element appears first the error disappears.

view this post on Zulip Katarina (Aug 22 2019 at 09:26):

I also had the error that the id element was not in the right order.

view this post on Zulip Michel Rutten (Aug 22 2019 at 09:36):

The Condition.extension element(s) should definitely appear first in the element list, before resource-specific fields, as for all common fields derived from abstract base DomainResource.

view this post on Zulip Michel Rutten (Aug 22 2019 at 09:37):

So this looks like a bug in the validator

view this post on Zulip Katarina (Aug 22 2019 at 10:29):

Ok, thank you. Are there other validation tools that I overlooked?

view this post on Zulip Michel Rutten (Aug 22 2019 at 10:48):

Possibly, but I am only aware of the open source .NET and HAPI/Java validator implementations.
@Ewout Kramer I am surprised that the .NET validator trips on this? Should be able to handle sparse differentials.

view this post on Zulip Grahame Grieve (Aug 22 2019 at 22:09):

oh - this is an error in invariant sdf-20, which is going to be fixed in the technical correciton

view this post on Zulip Michel Rutten (Aug 23 2019 at 09:03):

I thought we already fixed that?
http://hl7.org/fhir/structuredefinition.html#invs
sdf-20:
element.where(path.contains('.').not()).slicing.empty()
This expression only matches an actual root element (single path segment), and not the first element in the list.

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

the technical correction to R3 isn't yet made.

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

the week after Atlanta

view this post on Zulip Michel Rutten (Aug 23 2019 at 12:47):

Indeed, sdf-20 in STU3 is still broken. Thanks.

view this post on Zulip Katarina (Jan 06 2020 at 15:50):

Hi, when I validate my Profile with the FHIR Validator (https://wiki.hl7.org/index.php?title=Using_the_FHIR_Validator) I get error "No slicing on the root element [element.first().slicing.empty()]" Does anybody know what this means? Maybe adding an extension is forbidden for the resource type?

<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="myName" />
<url value="https://example/fhir/StructureDefinition/MyName" />
<version value="0.1" />
<name value="MyName" />
<title value="MyName" />
<status value="draft" />
<description value="MyName" />
<fhirVersion value="3.0.1" />
<mapping>
<identity value="rim" />
<uri value="http://hl7.org/v3" />
<name value="RIM Mapping" />
</mapping>
<mapping>
<identity value="cda" />
<uri value="http://hl7.org/v3/cda" />
<name value="CDA (R2)" />
</mapping>
<mapping>
<identity value="w5" />
<uri value="http://hl7.org/fhir/w5" />
<name value="W5 Mapping" />
</mapping>
<kind value="resource" />
<abstract value="true" />
<type value="Composition" />
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Composition" />
<derivation value="constraint" />
<differential>
<element id="Composition.extension">
<path value="Composition.extension" />
<slicing>
<discriminator>
<type value="value" />
<path value="url" />
</discriminator>
<rules value="open" />
</slicing>
</element>
...
</differential>
</StructureDefinition>

view this post on Zulip Grahame Grieve (Jan 10 2020 at 03:27):

that's an error in the 3.0 definitions. The invariant as written in the spec assumes that you have the first element as "Composition". This was fixed in R4

view this post on Zulip Katarina (Jan 17 2020 at 13:43):

In R4 the same error occurs.

Also the error occurs for complex extensions:

<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="example"/>
<url value="https://example.de/fhir/StructureDefinition/example"/>
<version value="0.1"/>
<name value="example"/>
<status value="draft"/>
<fhirVersion value="3.0.1"/>
<mapping>
<identity value="rim"/>
<uri value="http://hl7.org/v3"/>
<name value="RIM Mapping"/>
</mapping>
<kind value="complex-type"/>
<abstract value="false"/>
<contextType value="resource"/>
<context value="Composition.subject"/>
<type value="Extension"/>
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/Extension"/>
<derivation value="constraint"/>
<differential>
<element id="Extension.extension">
<path value="Extension.extension"/>
<slicing>
<discriminator>
<type value="value"/>
<path value="url"/>
</discriminator>
<rules value="open"/>
</slicing>
</element>
<element id="Extension.extension:group">
<path value="Extension.extension"/>
<sliceName value="group"/>
</element>
<element id="Extension.extension:group.url">
<path value="Extension.extension.url"/>
<fixedUri value="group"/>
</element>
<element id="Extension.extension:group.value[x]:valueString">
<path value="Extension.extension.valueString"/>
<sliceName value="valueString"/>
<type>
<code value="string"/>
</type>
</element>
<element id="Extension.extension:facility">
<path value="Extension.extension"/>
<sliceName value="facility"/>
</element>
<element id="Extension.extension:facility.url">
<path value="Extension.extension.url"/>
<fixedUri value="facility"/>
</element>
<element id="Extension.extension:facility.value[x]:valueReference">
<path value="Extension.extension.value[x]"/>
<sliceName value="valueReference"/>
<type>
<code value="Reference"/>
<targetProfile value="https://example.de/fhir/StructureDefinition/example123"/>
</type>
</element>
<element id="Extension.url">
<path value="Extension.url"/>
<fixedUri value="https://example.de/fhir/StructureDefinition/example"/>
</element>
<element id="Extension.value[x]">
<path value="Extension.value[x]"/>
<max value="0"/>
</element>
</differential>
</StructureDefinition>

Maybe it has to do with vonk? I use Vonk.Server/3.1.1.

view this post on Zulip Grahame Grieve (Jan 17 2020 at 19:53):

@Christiaan Knaap

view this post on Zulip Christiaan Knaap (Jan 20 2020 at 08:05):

@Katarina : If I validate the first SD ('MyName') against R4 on Vonk, it succeeds:
POST https://vonk.fire.ly/R4/$validate
If you validate it against R3 it indeed fails on sdf-20 because that was incorrect in the R3 spec.
The second ('example') is not valid in R4 because of the <contextType> and <context> elements.

view this post on Zulip Katarina (Jan 20 2020 at 09:22):

thank you.

view this post on Zulip Katarina (Jan 20 2020 at 15:47):

How is rule sdf-20 defined in R4? I looked into the specs, both STU3 (https://www.nuget.org/packages/Hl7.Fhir.Specification.STU3/1.5.0-beta1) and R4 (https://www.nuget.org/packages/Hl7.Fhir.Specification.R4/1.5.0-beta1) contain expression "element.where(path.contains('.').not()).slicing.empty()". Or where can I find the new definition?

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

those packages are not official HL7 packages and should not be used (they should never have been defined)

view this post on Zulip Alexander Zautke (Jan 20 2020 at 20:19):

That's what it is currently used by Vonk in STU3: https://raw.githubusercontent.com/FirelyTeam/fhir-net-api/develop-stu3/src/Hl7.Fhir.Core/Model/Source/profiles-resources.xml

view this post on Zulip Alexander Zautke (Jan 20 2020 at 20:20):

Compared to https://raw.githubusercontent.com/FirelyTeam/fhir-net-api/develop-r4/src/Hl7.Fhir.Core/Model/Source/profiles-resources.xml

view this post on Zulip Alexander Zautke (Jan 20 2020 at 20:23):

If you validate on Simplifier against the the hl7.fhir.r3.core package, you can see that it's already fixed in STU3 3.0.2: https://simplifier.net/packages/hl7.fhir.r3.core/3.0.2/files/61200/~json

view this post on Zulip Alexander Zautke (Jan 20 2020 at 20:25):

Vonk is currently using the .NET API version 1.4.0 (based on STU3 3.0.1 and R4 4.0.0), as soon as the 1.5.0 (based on FHIR STU3 3.0.2 / R4 4.0.1) becomes stable Vonk will upgrade as well.

view this post on Zulip Alexander Zautke (Jan 20 2020 at 20:25):

So everything should be aligned soon :)


Last updated: Apr 12 2022 at 19:14 UTC