Stream: implementers
Topic: Differences in shapshots from forge and the validator
Hans van Amstel (Jun 19 2020 at 12:08):
I created two snapshots for a STU3 profile that we use one snapshot with the validator 5.0.7 and one with forge 24.2.0.0.
There were quite some differences, see below.
Could someone please help us in understanding this. Are these differences both correct from a FHIR perspective?
Defining the base resource. The actual HL7 base resource is Observation
Forge:
<base>
<path value="Resource" />
<min value="0" />
<max value="*" />
</base>
Validator:
<base>
<path value="Observation"/>
<min value="0"/>
<max value="*"/>
</base>
In the snapshot for almost anything related to extension, a slicing element in the forge generated snapshot
Forge:
<element id="Observation.modifierExtension">
<path value="Observation.modifierExtension" />
<slicing>
<discriminator>
<type value="value" />
<path value="url" />
</discriminator>
<description value="Extensions are always sliced by (at least) url" />
<rules value="open" />
</slicing>
<short value="Extensions that cannot be ignored" />
Validator:
<element id="Observation.modifierExtension">
<path value="Observation.modifierExtension"/>
<short value="Extensions that cannot be ignored"/>
Difference in referencing a valueset, valueSetUri vs valueSetReference
Forge:
<binding>
<strength value="required" />
<valueSetUri value="http://hl7.org/fhir/ValueSet/ucum-vitals-common" />
</binding>
Validator:
<binding>
<strength value="required"/>
<valueSetReference>
<reference value="http://hl7.org/fhir/ValueSet/ucum-vitals-common"/>
</valueSetReference>
</binding>
valueQuantity vs value[x] in the path
Forge:
<element id="Observation.value[x]:valueQuantity">
<path value="Observation.valueQuantity" />
Validator:
<element id="Observation.value[x]:valueQuantity">
<path value="Observation.value[x]"/>
Difference with the differential of the original profile. value[x] rewritten to valueQuantity in the validator generated snapshot in the element id
Original profile differential:
<element id="Observation.value[x]:valueQuantity.system">
<path value="Observation.valueQuantity.system" />
<min value="1" />
<fixedUri value="http://unitsofmeasure.org" />
</element>
Forge:
<element id="Observation.value[x]:valueQuantity.system">
<path value="Observation.valueQuantity.system" />
<min value="1" />
<fixedUri value="http://unitsofmeasure.org" />
</element>
Validator:
<element id="Observation.valueQuantity:valueQuantity.system">
<path value="Observation.valueQuantity.system"/>
<min value="1"/>
<fixedUri value="http://unitsofmeasure.org"/>
</element>
Lloyd McKenzie (Jun 19 2020 at 15:19):
Ward's already looking. @Grahame Grieve
Grahame Grieve (Jun 19 2020 at 19:57):
- I don't think that the extensions thing matters? I'm not sure which is more correct either
- in this particular case, the URL is also the canonical URL, so they both say the same thing though I think the validator is more correct. Where it would matter would be if the reference was not be a canonical URL
- I think the validator is correct
- I think the validator is wrong, and it's also surprising. I'll investigate sometime next week
Hans van Amstel (Jun 26 2020 at 06:53):
Any update? Thanks for the clarification Grahame. On the first issue about defining the base resource I guess the validator is correct?
Matthijs van der Wielen (Jun 29 2020 at 08:32):
Hi @Hans van Amstel ,
I've looked into point "2" about the valueset referencing, and when I test this Forge is doing this correctly.
In forge there is this option: image.png
If this box is unchecked you say that the value set is a reference and it's rendered as in your provided example. If the box is checked it is rendered the same as the java validator does. This is correct behavior in our opinion.
Abel Enthoven (Jun 29 2020 at 08:44):
hi @Grahame Grieve on point 3 (path Observation.value[x]): I see why the path would be 'Observation.value[x]'. The upside is that 'Observation.value[x]' is also the path of the slice header, which makes identifying the slices easy.
But it also means that the path 'Observation.valueQuantity.system' is then not visually a sub-path of its parent-path 'Observation.value[x]', which is quite confusing to both tools and users. So I see a downside to either of the solutions from a technical point of view.
I have to say I find the 'Observation.valueQuantity'-solution more attractive since the path-tree is more readable and the x-to-type-replacement happens where it is introduced (slice-header => slice). No need to read the contents of the slice to determine the root of the child path.
The documentation about id (https://www.hl7.org/fhir/elementdefinition.html#id, third bullet) seems to hint at this form of type-sliced paths too.
Hans van Amstel (Jun 29 2020 at 13:58):
@Matthijs van der Wielen Thanks for the reply. for me it's hard to judge what is correct and what not as I can not find definitive spec. The difference between the outputs of the HL7 validator and Forge puzzles me the most as the input is the same.
Hans van Amstel (Jun 29 2020 at 14:11):
Besides this I also did an experiment with the vitalsigns profile of the hl7 website (http://hl7.org/fhir/STU3/vitalsigns.profile.xml.html) and manually removed the snapshot part. Then I used the Forge(24.2.0.0) and HL7 validator(5.0.7) to recreate this snapshot. I was not able to do so and the difference was quite large.
If someone could help me understand why this differences and where I can find to help me understand what is correct that would really help us.
--- Snapshot difference 1 ---
Profile as is on the hL7 FHIR site:
<element id="Observation.valueQuantity">
<path value="Observation.valueQuantity"/>
Forge
<element id="Observation.value[x]:valueQuantity">
<path value="Observation.valueQuantity" />
Hl7 Validator:
<element id="Observation.value[x]">
<path value="Observation.value[x]"/>
--- Snapshot difference 2 ---
7x a difference similar to this one
Profile as is on the hL7 FHIR site:
<element id="Observation.valueQuantity.id">
<path value="Observation.valueQuantity.id"/>
Forge:
<element id="Observation.value[x]:valueQuantity.id">
<path value="Observation.valueQuantity.id" />
HL7 Validator:
<element id="Observation.value[x]:valueQuantity.id">
<path value="Observation.value[x].id"/>
--- Snapshot difference 3 ---
Profile as is on the hL7 FHIR site
<element id="Observation.component.valueQuantity">
<path value="Observation.component.valueQuantity"/>
Forge:
<element id="Observation.component.value[x]:valueQuantity">
<path value="Observation.component.valueQuantity" />
Hl7 Validator:
<element id="Observation.component.value[x]">
<path value="Observation.component.value[x]"/>
<slicing>
<discriminator>
<type value="type"/>
<path value="$this"/>
</discriminator>
<ordered value="false"/>
<rules value="closed"/>
</slicing>
--- Snapshot difference 4 ---
7x a difference similar to this one
Profile as is on the hL7 FHIR site
<element id="Observation.component.valueQuantity.id">
<path value="Observation.component.valueQuantity.id"/>
Forge:
<element id="Observation.component.value[x]:valueQuantity.id">
<path value="Observation.component.valueQuantity.id" />
Hl7 Validator:
<element id="Observation.component.value[x]:valueQuantity.id">
<path value="Observation.component.value[x].id"/>
Sorry for again posting a long post :wink:
Grahame Grieve (Jun 29 2020 at 20:43):
STU3 is a long way behind
Grahame Grieve (Jun 29 2020 at 20:43):
so differences would be expected.
Grahame Grieve (Jun 29 2020 at 20:43):
R4 should be up to date
Hans van Amstel (Jun 29 2020 at 23:09):
@Grahame Grieve Ok I can understand that STU3 is a long way behind.
The problem we face is that we have a FHIR STU3 server that implements what is called the FHIR 3 way on how to define slicing. This is suppose to be: "Observation.component.valueQuantity". The R4 way of slicing is supposed to be "Observation.component.value[x]". Is this correct?
This is the same with how it is described on the HL7 FHIR STU3 sites (eg:http://hl7.org/fhir/STU3/vitalsigns.profile.xml.html) in the snapshot and also on the HL7 FHIR R4 sites( eghttps://www.hl7.org/fhir/vitalsigns.profile.xml.html).
With the validator we are trying to create snapshots for our FHIR STU3 server but because of this difference we are not able to do so.
If this is a correct interpretation (STU3 slicing and the R4 slicing) I would expect when using the the tooling and specifying --version 3 the output to be in accordance to "Observation.component.valueQuantity" .
Or am I missing something?
Matthijs van der Wielen (Jun 30 2020 at 07:34):
@Hans van Amstel The difference between Forge and the java validator is not something I can tell you anything useful about. In STU3 the definition of Binding looks like this: image.png
This tells me that the Forge snaphot is correct on the point of the valueset (in STU3).
For R4 this looks different: image.png
Last updated: Apr 12 2022 at 19:14 UTC