Stream: IG creation
Topic: Adding examples to an IG's profile
Jose Costa Teixeira (Nov 16 2019 at 12:52):
Is there a magic way to add an example instance to the "examples" tab of a profile in an IG?
Jose Costa Teixeira (Nov 16 2019 at 12:52):
Lloyd McKenzie (Nov 16 2019 at 12:55):
Declare the example to be an example of that profile in the IG
Jose Costa Teixeira (Nov 16 2019 at 13:10):
<resource> <reference> <reference value="Communication/be.comm1"/> </reference> <fhirVersion value="4.0.1"/> <name value="Communication example 1"/> <description value="1st example"/> <exampleCanonical value="https://www.ehealth.fgov.be/standards/fhir/StructureDefinition/be-communication"/> <groupingId value="examples"/> </resource>
Jose Costa Teixeira (Nov 16 2019 at 13:11):
I added this, where the exampleCanonical is the same as my profile's URL
Jose Costa Teixeira (Nov 16 2019 at 13:11):
doesn't show in the examples
Jose Costa Teixeira (Nov 16 2019 at 13:12):
what am I missing?
Lloyd McKenzie (Nov 16 2019 at 13:21):
Not sure. I expect to start working on the publisher again next week. I've added this to my list of things to check is working properly
Jose Costa Teixeira (Nov 16 2019 at 13:22):
ok thanks
Grahame Grieve (Nov 16 2019 at 15:32):
this is the be ig? I can probably look on Monday
Eric Haas (Nov 16 2019 at 19:21):
I find the examples tab overkill if you have 1 or 2 example. Devoting a whole page to a one or two item list seems like a wasted click so I usually stick em inline in a custom introductions. If you have a substantial number of examples then it makes sense, but I question whether the IG should be crammed with examples rather than devoting an external site just to examples. Reduces overall overhead and maintenance of the IG and balloting.
Lloyd McKenzie (Nov 16 2019 at 19:48):
I prefer consistent location - the examples are in the same place whether you have one or fifty
Jose Costa Teixeira (Nov 18 2019 at 08:08):
this is the be ig? I can probably look on Monday
Yes. that would be good, thanks (assuming it is a quick fix. this is not most urgent).
Grahame Grieve (Nov 29 2019 at 07:11):
is this sorted?
Jose Costa Teixeira (Nov 29 2019 at 07:23):
my build is now failing, so I can't test.
Jose Costa Teixeira (Nov 29 2019 at 07:24):
Exception in thread "main" java.lang.Error: type on first differential element!
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:457)
Jose Costa Teixeira (Nov 29 2019 at 07:24):
I'm getting new publisher to see if that works
Jose Costa Teixeira (Nov 29 2019 at 07:29):
nope
Jose Costa Teixeira (Nov 29 2019 at 07:30):
Can anyone help with this issue?
Exception in thread "main" java.lang.Error: type on first differential element! at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSnapshot(ProfileUtilities.java:457) at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshot(Publisher.java:3786) at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshots(Publisher.java:3739) at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:3194) at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:768) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:656) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6635)
Grahame Grieve (Nov 29 2019 at 09:16):
no I'll have to debug that. It shouldn't happen
Jose Costa Teixeira (Dec 01 2019 at 17:30):
@Grahame Grieve I checked and this issue is introduced from 1.0.0 to 1.0.1. there were quite some changes then, sorry I cannot point to anything specific.
Grahame Grieve (Dec 01 2019 at 18:42):
how can I reproduce this?
Jose Costa Teixeira (Dec 01 2019 at 22:44):
https://github.com/hl7-be/be-core
Grahame Grieve (Dec 09 2019 at 12:34):
hmm Unable to resolve the package 'hl7.be.fhir.template'
Jose Costa Teixeira (Dec 09 2019 at 12:59):
it is a local package.
I took all the logical models out and it builds OK, so I think the issue is with those
Kevin Mayfield (Dec 09 2019 at 13:09):
We have the same issue with https://github.com/HL7-UK/UK-STU3/
I've linked in examples via profile notes as a work around.
Jose Costa Teixeira (Dec 09 2019 at 13:16):
can you explain "linked in examples via profile notes"?
Jose Costa Teixeira (Dec 09 2019 at 13:16):
you simply make the jsons available, or...?
Kevin Mayfield (Dec 09 2019 at 13:21):
This example section https://hl7-uk.github.io/UK-STU3/CareConnect-Organization-1.html#examples
is created manually by this xml https://github.com/HL7-UK/UK-STU3/blob/master/input/pagecontent/CareConnect-Organization-1-intro.xml
Jose Costa Teixeira (Dec 09 2019 at 14:25):
(indeed my logical models were a mess, I'm fixing those now)
Jose Costa Teixeira (Dec 09 2019 at 14:28):
@Lloyd McKenzie adding the examples to the IG - is that inside the template (ant / xslt) or in the IG Publisher itself?
If the former, I can see if I can work on it
Lloyd McKenzie (Dec 09 2019 at 14:32):
Adding examples shouldn't involve changing the template. Just stick them in your IG. If you're using template auto-magic to find the list of profiles, you'll need to make sure that your examples declare the profile they comply with. (We'll strip out the profile declaration on publication unless there's an extension saying to keep it.)
Kevin Mayfield (Dec 09 2019 at 14:36):
So this should work?
<resource> <reference> <reference value="Encounter/encounter-2"></reference> </reference> <name value="Encounter transfer example"></name> <description value="Hospital Inpatient Transfer"></description> <exampleCanonical value="StructureDefinition/CareConnect-Encounter-1"></exampleCanonical> <groupingId value="uk-examples"></groupingId> </resource>
The profile CareConnect-Encounter-1 is in my IG.
Lloyd McKenzie (Dec 09 2019 at 14:50):
Yes
Jose Costa Teixeira (Dec 09 2019 at 15:08):
My question is about putting the examples here
Jose Costa Teixeira (Dec 09 2019 at 15:08):
Jose Costa Teixeira (Dec 09 2019 at 15:11):
in this case, I do have an example but it doesn't show there, where it belongs (?)
Jose Costa Teixeira (Dec 09 2019 at 15:13):
In the IG, it is the same thing as @Kevin Mayfield
I also tried excluding the grouping but that did not make it appear in the "examples" section.
Kevin Mayfield (Dec 09 2019 at 15:22):
Yep I get the same message in the Examples tab
Jose Costa Teixeira (Dec 09 2019 at 15:25):
this is what the layout says
{% if site.data.pages[basepath].examples.size > 0 %}
Examples for the {{[id]}} Profile.
{% for example in site.data.pages[basepath].examples %} {% endfor %}
{{example.title}}{% else %}
No examples are currently available for the {{id}} Profile.
{% endif %}
John Moehrke (Dec 09 2019 at 15:33):
My theory was that the examples needed to be marked with the profile.. but I did that and they didn't show up in the examples tab of the profile. They did get recognized as examples on the artifacts page, vs just 'other' examples.
Jose Costa Teixeira (Dec 09 2019 at 15:34):
yes, that is what we are looking for here.
Lloyd McKenzie (Dec 09 2019 at 16:36):
in template/onGenerate-ig-updated.xml, do you see the profile listed on the example resource?
Kevin Mayfield (Dec 09 2019 at 16:54):
In my onGenerate-ig-updated.xml I have this entry
<resource> <extension url="http://hl7.org/fhir/tools/StructureDefinition/resource-information"> <valueString value="Encounter"/> </extension> <extension url="http://hl7.org/fhir/StructureDefinition/implementationguide-page"> <valueUri value="encounter-2.html"/> </extension> <reference> <reference value="Encounter/encounter-2"/> </reference> <name value="Encounter transfer example"/> <description value="Hospital Inpatient Transfer"/> <exampleCanonical value="StructureDefinition/CareConnect-Encounter-1"/> <groupingId value="uk-examples"/> </resource>
Jose Costa Teixeira (Dec 09 2019 at 18:59):
I have exactly the same.
When I don't put the groupingId in the IG .xml, the template generates a groupingId. In my case this grouping is called
"_ex_example"
Jose Costa Teixeira (Dec 09 2019 at 18:59):
<resource> <extension url="http://hl7.org/fhir/tools/StructureDefinition/resource-information"> <valueString value="Communication"/> </extension> <extension url="http://hl7.org/fhir/StructureDefinition/implementationguide-page"> <valueUri value="be.comm1.html"/> </extension> <reference> <reference value="Communication/be.comm1"/> </reference> <fhirVersion value="4.0.1"/> <name value="Communication example 1"/> <description value="New message from DZOP to nurse"/> <exampleCanonical value="https://www.ehealth.fgov.be/standards/fhir/StructureDefinition/be-communication"/> <groupingId value="_ex_example"/> </resource>
Lloyd McKenzie (Dec 09 2019 at 19:08):
And you're using the current IG template and you're not seeing those example instances show up as examples for their respective profiles?
Jose Costa Teixeira (Dec 09 2019 at 19:10):
current ig template = hl7.fhir.template ?
Lloyd McKenzie (Dec 09 2019 at 19:12):
y - or fhir.base.template
Jose Costa Teixeira (Dec 09 2019 at 19:22):
Correct, using the current template. Tried both, deleted my ig\template folder.
Kevin Mayfield (Dec 09 2019 at 19:23):
Yep also on hl7.fhir.template
Lloyd McKenzie (Dec 09 2019 at 19:25):
Ok. I'll add to my list of broken publisher/publisher template stuff. What you're doing seems correct.
Last updated: Apr 12 2022 at 19:14 UTC