Stream: implementers
Topic: IG builder: only first element in differential
Martin von Siebenthal (Jan 09 2018 at 16:57):
Hi, I am trying to run IG builder with the test-ig examples from FHIR svn. I tried both DSTU 3 branch and master with the respective igbuilder jar. For resources created from the spreadsheet all elements are shown in the differential view, but for the test-ig-sd example the differential view only shows the first element. Same if I try with own StructureDefinitions exported from Forge. Does that sound familiar to anyone? only-first-element-in-differential.PNG
Lloyd McKenzie (Jan 09 2018 at 17:07):
If you create a profile, the differential will only show the elements listed in the spreadsheet, not everything. Is that what's happening for you?
Eric Haas (Jan 09 2018 at 17:28):
Other examples using the the IG Builder here: https://github.com/Healthedata1/IG-Sampler as Lloyd stated the Diff only shows only the stuff you have profiled. The Snapshot shows everything.
Michel Rutten (Jan 09 2018 at 18:01):
@Martin von Siebenthal note that Forge provides a configuration setting in the Options menu to toggle saving with snapshot component (disabled by default). If you enable this option, then Forge will generate the snapshot component when saving a profile.
Grahame Grieve (Jan 09 2018 at 21:44):
it doesn't matter whether you save the snapshot or not - the IG publisher will generate it if it wants to.
Grahame Grieve (Jan 09 2018 at 21:45):
this immediately makes me think that the differential is out of order - the spreadsheet sorts, but if you provide a SD directly, it doesn't
Martin von Siebenthal (Jan 10 2018 at 07:28):
Thanks for your quick replies! The StructureDefinitions I tried have multiple elements profiled, both the test-ig example and my own. The problem is that I only get the first of them displayed in differential. I don't know where in the chain it goes wrong. But the intermediate *-sd.csv that is built in the temp folder already has only the first profiled element correct. Multiplicities of the other profiled elements are as in the base resource and not taken from the SD xml. test-ig-sd.xml has only one multiplicity constraint. But it has for example a mustSupport on generalPractitioner which does not make it to the test-ig-sd.csv.
Martin von Siebenthal (Jan 10 2018 at 07:43):
@Grahame Grieve which order do you mean? The order in which the elements in the differential appear compared to the order in the base resource SD? This looks the same. The test-ig-sd.xml has the constrained elements in the same order as the base resource: Patient.active, Patient.gender, ....., Patient.generalPractitioner. Or how does the spreadsheet sort?
Lloyd McKenzie (Jan 10 2018 at 14:46):
Double check what version you're declaring. Patient.active has moved around. If you're building against the wrong version of FHIR, the sort order would be wrong.
Martin von Siebenthal (Jan 10 2018 at 15:44):
@Lloyd McKenzie In the json control file I have "specification": “http://hl7.org/fhir/” and “version” : “3.0.1”.
In the tests\ig30\resources\test-ig-sd.xml I changed fhirVersion value="1.4.0" to “3.0.1” but no change. The forge example profile sd.xml already said version “3.0.1” when exported from Forge.
IG publisher says "Definitions 3.0.1.-11917" when running.
Anywhere else where I may be pointing to a too old version? Thanks for your help.
Lloyd McKenzie (Jan 10 2018 at 16:19):
I would have expected the change from 1.4.0 to 3.0.1 would do it. I can't think of anything else that would be relevant. Are you able to post your differential?
Martin von Siebenthal (Jan 10 2018 at 16:43):
You mean post here? I am just trying to use the tests\ig30 example from FHIR svn, where the differential on the patient is
<differential>
<!--
make active required
fix the type for deceased
fix the value for gender
constrain birthdate
-->
<element>
<path value="Patient.active"/>
<min value="1"/>
</element>
<element>
<path value="Patient.gender"/>
<fixedCode value="female"/>
</element>
<element>
<path value="Patient.birthDate"/>
<constraint>
<key value="tst-1"/>
<severity value="error"/>
<human value="A full date is required"/>
<expression value="length() = 8"/>
</constraint>
</element>
<element>
<path value="Patient.deceased[x]"/>
<type>
<code value="dateTime"/>
</type>
<mustSupport value="true"/>
</element>
<element>
<path value="Patient.generalPractitioner"/>
<type>
<code value="Reference"/>
<profile value="http://hl7.org/fhir/StructureDefinition/Organization"/>
<aggregation value="contained"/>
</type>
<mustSupport value="true"/>
</element>
</differential>
I tried one on CareTeam with only multiplicities (my forge example. Just clicked some, not trying to make clinical sense in this example):
<differential>
<element id="CareTeam.subject">
<path value="CareTeam.subject" />
<min value="1" />
</element>
<element id="CareTeam.context">
<path value="CareTeam.context" />
<min value="1" />
</element>
<element id="CareTeam.period">
<path value="CareTeam.period" />
<min value="1" />
</element>
<element id="CareTeam.reasonCode">
<path value="CareTeam.reasonCode" />
<min value="1" />
<max value="1" />
<mustSupport value="true" />
</element>
<element id="CareTeam.reasonReference">
<path value="CareTeam.reasonReference" />
<min value="1" />
<max value="1" />
</element>
<element id="CareTeam.note">
<path value="CareTeam.note" />
<min value="1" />
<max value="1" />
</element>
</differential>
Lloyd McKenzie (Jan 10 2018 at 17:33):
That looks fine for 3.0.1. Can you attach the StructureDefinition that's generated by the build process?
Eric Haas (Jan 10 2018 at 17:35):
Look at the qa.html file to see what is wrong with the StructureDefinition for this profile test-ig-sd.xml
its missing the id element and the order of elements is wrong. I think that is the problemo
Lloyd McKenzie (Jan 10 2018 at 17:37):
What's wrong with the order?
Eric Haas (Jan 10 2018 at 18:05):
date
was in the wrong place. After fixing the qa issues, I can't get it to render either. it will only display a single element in the diff even if comment out active will only display gender etc. Mysterious.
Eric Haas (Jan 10 2018 at 18:14):
here is my modified sd.xml filetest-ig-sd.xml
Michel Rutten (Jan 11 2018 at 09:51):
The Patient.generalPractitioner element has an invalid profile constraint. This should be a typeProfile constraint, since the referenced profile constrains the target of the reference (Organization), not the reference itself.
Don't know if this fixes the rendering error...
Martin von Siebenthal (Jan 11 2018 at 10:11):
I'm getting the same "only first profiled element" symptom in rendering with above CareTeam differential, which only has multiplicities and a mustSupport.... indeed mysterious as some of the IG sampler examples such as structuredefinition-template-basic2.xml are also xml (non-spreadsheet) based and properly generated Dec 13, 2017...???
Grahame Grieve (Jan 11 2018 at 10:55):
does anyone have an example of this that is open source somewhere so I can have a look at it?
Martin von Siebenthal (Jan 11 2018 at 13:07):
I have my dummy example that I can zip and post. Here? Or do you have a location where I can drop it?
Eric Haas (Jan 11 2018 at 19:12):
@Grahame Grieve look at /tests/ig30 out of the build.
Eric Haas (Jan 11 2018 at 19:12):
and run it out of the box and you will see profile #1 only list the first element in the diff
Grahame Grieve (Jan 11 2018 at 20:25):
ok
Last updated: Apr 12 2022 at 19:14 UTC