FHIR Chat · Bundle with structure defs · IG creation

Stream: IG creation

Topic: Bundle with structure defs


view this post on Zulip 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".

view this post on Zulip 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

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 13:45):

How do we do that? (Register as a bundle)

view this post on Zulip 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

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 20:36):

where is the extension defined? i cannot find it

view this post on Zulip Grahame Grieve (Apr 25 2020 at 20:38):

it's probably not formally defined

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 20:50):

what is the context of the extension?

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 20:51):

(where do I put it? directly under definition? or in the resource?)

view this post on Zulip 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?

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 20:56):

I can experiment and add it to the documentation

view this post on Zulip Grahame Grieve (Apr 25 2020 at 21:04):

you can see it being used in the test ig included in the ig publisher itself

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 21:09):

ok

view this post on Zulip 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"
      },

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 21:15):

this?

view this post on Zulip Grahame Grieve (Apr 25 2020 at 21:16):

yes

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 21:17):

only the extension on top is needed, i guess?

view this post on Zulip Grahame Grieve (Apr 25 2020 at 21:18):

not sure what you mean?

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 21:19):

i mean for the IG to pick up the bundle.

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 21:20):

the definition part that contains the valueset test-ig-bnd1 is not needed, right?

view this post on Zulip 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"
  }

view this post on Zulip Jose Costa Teixeira (Apr 25 2020 at 21:21):

or do i need to add the bundled resources in definition.resource as well?

view this post on Zulip Grahame Grieve (Apr 25 2020 at 21:22):

I'm not sure

view this post on Zulip 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?

view this post on Zulip 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

view this post on Zulip 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?

view this post on Zulip Grahame Grieve (Apr 26 2020 at 09:47):

yes

view this post on Zulip 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?

view this post on Zulip Michael van der Zel (Apr 26 2020 at 12:32):

Hmm. Also NullPointer at org.hl7.fhir.igtools.publisher.Publisher.loadBundle(Publisher.java:3255)

view this post on Zulip 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?

view this post on Zulip 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

view this post on Zulip Grahame Grieve (Apr 29 2020 at 02:34):

unless you have a bundle with an entry with no resource

view this post on Zulip 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 . . .

view this post on Zulip Grahame Grieve (Apr 29 2020 at 03:42):

for me that's nowhere near LoadBundle - can you resolve what line that is?

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 03:45):

  res.setUserData("loaded.resource", r);

view this post on Zulip 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;
  }

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 03:46):

oh no sorry

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 03:46):

nevermind

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 03:46):

pls let me check again

view this post on Zulip 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?

view this post on Zulip 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:

view this post on Zulip 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()));
      }

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 03:57):

(if the resource has no description, set it (from where?)

view this post on Zulip 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

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 03:59):

what is r here (so that i can see if that fixes it)?

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 03:59):

the bundle? or an entry in the bundle?

view this post on Zulip Grahame Grieve (Apr 29 2020 at 03:59):

    if (!res.hasDescription() && ((CanonicalResource)r.getResource()).hasDescription())
      res.setDescription(((CanonicalResource)r.getResource()).getDescription().trim());

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 04:06):

where is the description missing? in my bundle both entries have a description.

view this post on Zulip Michael van der Zel (Apr 29 2020 at 06:39):

That was my thought to. Does the bundle need a description?

view this post on Zulip Grahame Grieve (Apr 29 2020 at 07:52):

no the the bundle. It's pulling each resource out and making a description for it.

view this post on Zulip Grahame Grieve (Apr 29 2020 at 07:52):

should be fixed now

view this post on Zulip 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???

view this post on Zulip Grahame Grieve (Apr 29 2020 at 07:58):

no. I have had to move them - see https://fhir.github.io/latest-ig-publisher/

view this post on Zulip 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)

view this post on Zulip Michael van der Zel (Apr 29 2020 at 08:04):

if (!res.hasDescription() && ((CanonicalResource)r.getResource()).hasDescription()) {

view this post on Zulip Grahame Grieve (Apr 29 2020 at 08:04):

what have you got in this bundle?

view this post on Zulip Grahame Grieve (Apr 29 2020 at 08:05):

Specifically, what types of resources?

view this post on Zulip Grahame Grieve (Apr 29 2020 at 08:05):

Evidently you have something that is not a CanonicalResource.

view this post on Zulip Michael van der Zel (Apr 29 2020 at 08:06):

Just StrutureDefinitions.

view this post on Zulip Grahame Grieve (Apr 29 2020 at 08:06):

weird.

view this post on Zulip 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>

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 12:30):

This works as of v1.0.85

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 12:30):

thank you!

view this post on Zulip 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)

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 18:07):

can i reproduce?

view this post on Zulip 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 ...

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip 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?

view this post on Zulip 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.

view this post on Zulip Jose Costa Teixeira (Apr 29 2020 at 21:09):

Yes, that

view this post on Zulip 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?

view this post on Zulip 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

view this post on Zulip 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?

view this post on Zulip Lloyd McKenzie (Apr 29 2020 at 23:32):

Is that extension documented anywhere?

view this post on Zulip 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

view this post on Zulip Jose Costa Teixeira (Apr 30 2020 at 04:57):

right, the bundle also stays there
image.png

view this post on Zulip 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.

view this post on Zulip Lloyd McKenzie (Apr 30 2020 at 14:06):

Why would we want the Bundle to stay?

view this post on Zulip 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?

view this post on Zulip 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?

view this post on Zulip 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 :>)

view this post on Zulip 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.

view this post on Zulip 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

view this post on Zulip 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?)

view this post on Zulip Grahame Grieve (Apr 30 2020 at 23:04):

no because they are reported against the source file

view this post on Zulip Grahame Grieve (May 01 2020 at 02:56):

I've been reflecting on this

view this post on Zulip 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

view this post on Zulip 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)

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip Lloyd McKenzie (May 01 2020 at 03:07):

(and changing the approach to managing the input shouldn't impact the publication)

view this post on Zulip Michael van der Zel (May 02 2020 at 09:42):

Maybe we can put the source material in a zip? That would help too.

view this post on Zulip 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