Stream: IG creation
Topic: Bundle with structure defs
Michael van der Zel (Apr 25 2020 at 09:52):
From the IG publisher documentation I understand that it is possible to put structure definitions in one(1) bundle. But if I just create a bundle with structure definitions and run the publisher, it doesnot seem to work. The error is "Publishing Content Failed: No snapshot found".
Grahame Grieve (Apr 25 2020 at 11:57):
you need to register it as a bundle to treat as a source of independent resources that get processed, rather than just another bundle of stuff. Do this using the bundle extension
Jose Costa Teixeira (Apr 25 2020 at 13:45):
How do we do that? (Register as a bundle)
Grahame Grieve (Apr 25 2020 at 19:51):
use the extension http://hl7.org/fhir/StructureDefinition/igpublisher-bundle, instead of registering it as a normal resource
Jose Costa Teixeira (Apr 25 2020 at 20:36):
where is the extension defined? i cannot find it
Grahame Grieve (Apr 25 2020 at 20:38):
it's probably not formally defined
Jose Costa Teixeira (Apr 25 2020 at 20:50):
what is the context of the extension?
Jose Costa Teixeira (Apr 25 2020 at 20:51):
(where do I put it? directly under definition? or in the resource?)
Jose Costa Teixeira (Apr 25 2020 at 20:56):
and what is the value? a boolean to say it is a special resource, or the bundle id?
Jose Costa Teixeira (Apr 25 2020 at 20:56):
I can experiment and add it to the documentation
Grahame Grieve (Apr 25 2020 at 21:04):
you can see it being used in the test ig included in the ig publisher itself
Jose Costa Teixeira (Apr 25 2020 at 21:09):
ok
Jose Costa Teixeira (Apr 25 2020 at 21:15):
"resourceType" : "ImplementationGuide", "id" : "test-ig", "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/igpublisher-bundle", "valueString" : "test-ig-bnd" }, ... "definition" : { "resource" : [{ "reference" : { "reference" : "ValueSet/test-ig-bnd1" },
Jose Costa Teixeira (Apr 25 2020 at 21:15):
this?
Grahame Grieve (Apr 25 2020 at 21:16):
yes
Jose Costa Teixeira (Apr 25 2020 at 21:17):
only the extension on top is needed, i guess?
Grahame Grieve (Apr 25 2020 at 21:18):
not sure what you mean?
Jose Costa Teixeira (Apr 25 2020 at 21:19):
i mean for the IG to pick up the bundle.
Jose Costa Teixeira (Apr 25 2020 at 21:20):
the definition part that contains the valueset test-ig-bnd1 is not needed, right?
Jose Costa Teixeira (Apr 25 2020 at 21:21):
so if I do this, it will pick up the bundle and add all the resources in it:
"resourceType" : "ImplementationGuide", "id" : "test-ig", "extension" : [{ "url" : "http://hl7.org/fhir/StructureDefinition/igpublisher-bundle", "valueString" : "test-ig-bnd" }
Jose Costa Teixeira (Apr 25 2020 at 21:21):
or do i need to add the bundled resources in definition.resource as well?
Grahame Grieve (Apr 25 2020 at 21:22):
I'm not sure
Jose Costa Teixeira (Apr 25 2020 at 21:25):
i will test. thanks. should i create a structdef for the extension to add to the build?
Grahame Grieve (Apr 25 2020 at 21:35):
i'm not sure. Either that or move it to the /tools space, which will one day get it's own IG
Michael van der Zel (Apr 26 2020 at 09:38):
So do I say it right that the valueString of the extension is the id of the bundle with the structuredefs in it?
Grahame Grieve (Apr 26 2020 at 09:47):
yes
Jose Costa Teixeira (Apr 26 2020 at 12:04):
I just tried adding the bundle with that reference, got an npe - @Michael van der Zel if you try will you let us know?
Michael van der Zel (Apr 26 2020 at 12:32):
Hmm. Also NullPointer at org.hl7.fhir.igtools.publisher.Publisher.loadBundle(Publisher.java:3255)
Michael van der Zel (Apr 28 2020 at 14:35):
Michael van der Zel said:
Hmm. Also NullPointer at org.hl7.fhir.igtools.publisher.Publisher.loadBundle(Publisher.java:3255)
Any idea what is wrong here?
Grahame Grieve (Apr 29 2020 at 02:33):
try again with the latest version and tell me what link you get it on - 3255 is not the right line, and a code review gives me no ideas
Grahame Grieve (Apr 29 2020 at 02:34):
unless you have a bundle with an entry with no resource
Jose Costa Teixeira (Apr 29 2020 at 03:41):
java.lang.NullPointerException
at org.hl7.fhir.igtools.publisher.Publisher.loadBundle(Publisher.java:3258)
at org.hl7.fhir.igtools.publisher.Publisher.loadBundles(Publisher.java:3211)
at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:2800)
at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:814)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:680)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:7145)
Press any key to continue . . .
Grahame Grieve (Apr 29 2020 at 03:42):
for me that's nowhere near LoadBundle - can you resolve what line that is?
Jose Costa Teixeira (Apr 29 2020 at 03:45):
res.setUserData("loaded.resource", r);
Jose Costa Teixeira (Apr 29 2020 at 03:46):
near the end of loadBundle:
...
res.setUserData("loaded.resource", r);
r.setResEntry(res);
}
return changed || needToBuild;
}
Jose Costa Teixeira (Apr 29 2020 at 03:46):
oh no sorry
Jose Costa Teixeira (Apr 29 2020 at 03:46):
nevermind
Jose Costa Teixeira (Apr 29 2020 at 03:46):
pls let me check again
Jose Costa Teixeira (Apr 29 2020 at 03:55):
ok just to make clear if I understood correctly: you ask what line that is because your code has changed since, correct?
Jose Costa Teixeira (Apr 29 2020 at 03:56):
I looked at the code in the history at the time of the release I have and this is what's there:
Jose Costa Teixeira (Apr 29 2020 at 03:56):
if (!res.hasDescription())
res.setDescription(((CanonicalResource)r.getResource()).getDescription().trim());
res.setReference(new Reference().setReference(r.getElement().fhirType()+"/"+r.getId()));
}
Jose Costa Teixeira (Apr 29 2020 at 03:57):
(if the resource has no description, set it (from where?)
Grahame Grieve (Apr 29 2020 at 03:57):
looks like that should have an extra check for r.getresource not having a description. I've added that to the master code
Jose Costa Teixeira (Apr 29 2020 at 03:59):
what is r here (so that i can see if that fixes it)?
Jose Costa Teixeira (Apr 29 2020 at 03:59):
the bundle? or an entry in the bundle?
Grahame Grieve (Apr 29 2020 at 03:59):
if (!res.hasDescription() && ((CanonicalResource)r.getResource()).hasDescription())
res.setDescription(((CanonicalResource)r.getResource()).getDescription().trim());
Jose Costa Teixeira (Apr 29 2020 at 04:06):
where is the description missing? in my bundle both entries have a description.
Michael van der Zel (Apr 29 2020 at 06:39):
That was my thought to. Does the bundle need a description?
Grahame Grieve (Apr 29 2020 at 07:52):
no the the bundle. It's pulling each resource out and making a description for it.
Grahame Grieve (Apr 29 2020 at 07:52):
should be fixed now
Michael van der Zel (Apr 29 2020 at 07:56):
@Grahame Grieve The github project <https://github.com/FHIR/latest-ig-publisher> has no jars???
Grahame Grieve (Apr 29 2020 at 07:58):
no. I have had to move them - see https://fhir.github.io/latest-ig-publisher/
Michael van der Zel (Apr 29 2020 at 08:02):
Sorry. Still npe:
``` at org.hl7.fhir.igtools.publisher.Publisher.loadBundle(Publisher.java:3333)
``` at org.hl7.fhir.igtools.publisher.Publisher.loadBundles(Publisher.java:3281)
Michael van der Zel (Apr 29 2020 at 08:04):
if (!res.hasDescription() && ((CanonicalResource)r.getResource()).hasDescription()) {
Grahame Grieve (Apr 29 2020 at 08:04):
what have you got in this bundle?
Grahame Grieve (Apr 29 2020 at 08:05):
Specifically, what types of resources?
Grahame Grieve (Apr 29 2020 at 08:05):
Evidently you have something that is not a CanonicalResource.
Michael van der Zel (Apr 29 2020 at 08:06):
Just StrutureDefinitions.
Grahame Grieve (Apr 29 2020 at 08:06):
weird.
Jose Costa Teixeira (Apr 29 2020 at 08:13):
i have this
<extension url="http://hl7.org/fhir/StructureDefinition/igpublisher-bundle">
<valueString value="test-ig-bnd"/>
</extension>
Jose Costa Teixeira (Apr 29 2020 at 12:30):
This works as of v1.0.85
Jose Costa Teixeira (Apr 29 2020 at 12:30):
thank you!
Michael van der Zel (Apr 29 2020 at 18:03):
I get another exception now: java.lang.Exception: No snapshot found on http://hl7.org/ehrs/StructureDefinition/Section-OV
at org.hl7.fhir.igtools.publisher.Publisher.generateSnapshots(Publisher.java:4172)
Jose Costa Teixeira (Apr 29 2020 at 18:07):
can i reproduce?
Michael van der Zel (Apr 29 2020 at 18:11):
Ah. I got it. I expected the folders to still being auto processed. Now I had to add the profiles explicitly in the ImplementationGuide.json and now it almost works. Now have no index.html generated ...
Michael van der Zel (Apr 29 2020 at 18:14):
My mistake. I moved the ig from xml to json and forgot the index page.
Michael van der Zel (Apr 29 2020 at 18:49):
The resulting ig now also has a "Other" section with the Bundle in there. Can I remove that somehow? And for some reason it uses @name instead of @title to render. So the Artifact index and TOC are now "ugly" computer friendly names and I expect the human friendly title to be used there.
Jose Costa Teixeira (Apr 29 2020 at 19:03):
I think we need to address this in the template.
@Lloyd McKenzie should i create an issue in the template to decide how to handle bundles?
Michael van der Zel (Apr 29 2020 at 20:57):
And in this case not just Bundles, but specifically the entries of the Bundle as if it were separate files.
Jose Costa Teixeira (Apr 29 2020 at 21:09):
Yes, that
Lloyd McKenzie (Apr 29 2020 at 23:28):
You can assign a grouping to the Bundle yourself in the IG if you know it contains profiles or extensions or something. (If it's a mixed bag of various stuff, you may need to define a distinct grouping). All of that said, do we want the Bundle to get propagated to output as a Bundle or propagated to the output as a collection of artifacts? I suspect what's wanted is the latter. In that case, we want the Bundle to point to the IG as an input, but not as an output - sort of similar to how we deal with spreadsheets. However, there's no extension yet to flag a Bundle that we want split apart. @Grahame Grieve, thoughts?
Grahame Grieve (Apr 29 2020 at 23:31):
The extension http://hl7.org/fhir/StructureDefinition/igpublisher-bundle which has a type of id marks a bundle to be split out and process as individual pieces, rather than just an example bundle
Lloyd McKenzie (Apr 29 2020 at 23:32):
So you put the extension at the root of the IG and reference the id of the bundle to split? And after load that bundle won't be listed anymore, the extension will be gone and you'll have references to the structures from within the Bundle - is that accurate?
Lloyd McKenzie (Apr 29 2020 at 23:32):
Is that extension documented anywhere?
Grahame Grieve (Apr 29 2020 at 23:34):
And after load that bundle won't be listed anymore, the extension will be gone and you'll have references to the structures from within the Bundle - is that accurate?
no. The individual resources will be pulled out but the bundle itself will also remain, I think
Jose Costa Teixeira (Apr 30 2020 at 04:57):
right, the bundle also stays there
image.png
Michael van der Zel (Apr 30 2020 at 07:12):
Yes. I have the same result as the image of Jose. The full path looks ugly. It would make sense to remove that bundle after spitting, as Lloyd says.
Lloyd McKenzie (Apr 30 2020 at 14:06):
Why would we want the Bundle to stay?
Lloyd McKenzie (Apr 30 2020 at 14:07):
Why would someone looking at the IG care that the source was in a Bundle rather than individual files?
Grahame Grieve (Apr 30 2020 at 22:37):
well, I'd consider making it go away, but before I would consider that, I'd have to search to see if anyone is using it anywhere, and whether that would matter. Does anyone want to do that?
Lloyd McKenzie (Apr 30 2020 at 23:01):
Searching across public Github (including HL7 projects), only place it's found is within the IG-Publisher itself. (Git search is pretty amazing - I'm impressed :>)
Grahame Grieve (Apr 30 2020 at 23:01):
ok. so I can't make the bundle go away - because that's where QA errors are reported against.
Grahame Grieve (Apr 30 2020 at 23:02):
I could stop it from rendering but that would mean I couldn't point to it from the qa page
Lloyd McKenzie (Apr 30 2020 at 23:03):
yuck. We can't get the QA errors to report against the published structure definitions? (Presumably if the Bundle itself is invalid, the publisher would just die?)
Grahame Grieve (Apr 30 2020 at 23:04):
no because they are reported against the source file
Grahame Grieve (May 01 2020 at 02:56):
I've been reflecting on this
Grahame Grieve (May 01 2020 at 02:57):
I'm not going to stop publishing the bundle. It's for the template to not link to it if it's a referenced bundle. At the discretion of the author
Lloyd McKenzie (May 01 2020 at 03:05):
So basically the template can just strip Bundles that aren't marked as examples? (on the premise that the only other use is that they're bundles of input resources)
Lloyd McKenzie (May 01 2020 at 03:06):
I could add a parameter to the template to have it not do that, but I think that would be the appropriate default behavior.
Lloyd McKenzie (May 01 2020 at 03:07):
As a rule, someone looking at a published IG should have no insight into how the source material was organized/packaged.
Lloyd McKenzie (May 01 2020 at 03:07):
(and changing the approach to managing the input shouldn't impact the publication)
Michael van der Zel (May 02 2020 at 09:42):
Maybe we can put the source material in a zip? That would help too.
Jose Costa Teixeira (May 02 2020 at 11:47):
Lloyd McKenzie said:
So basically the template can just strip Bundles that aren't marked as examples? (on the premise that the only other use is that they're bundles of input resources)
they can be history as well
Last updated: Apr 12 2022 at 19:14 UTC