Stream: tooling
Topic: conflicting advice
Nick George (Mar 09 2020 at 20:09):
For ig publisher:
https://wiki.hl7.org/IG_Publisher_Documentation: Make sure you use the correct version of the IG publisher for your guide (check the versions in the log), since the IG publisher only supports the version of FHIR it's been made for.
https://wiki.hl7.org/FHIR_IG_Publishing_tool: Always use the current version of the IG Publisher from the build site - no other version is supported. You use this version irrespective of the FHIR version of the IG you are publishing.
Nick George (Mar 09 2020 at 20:11):
Also, it's very hard to debug the IG publisher tool. So far All I get is Publishing Content Failed: null
... I'm sure I'm doing something wrong but the tool gives no help
Grahame Grieve (Mar 09 2020 at 20:19):
I don't know why there's 2 different copies of the same page. Fertile grounds for confusion. The correct documentation is at https://confluence.hl7.org/display/FHIR/IG+Publisher+Documentation
Grahame Grieve (Mar 09 2020 at 20:19):
you should get more output than just Publishing Content Failed: null.. what's the full log?
Nick George (Mar 09 2020 at 20:20):
java.lang.NullPointerException at org.hl7.fhir.r5.context.SimpleWorkerContext.loadFromPackage(SimpleWorkerContext.java:324) at org.hl7.fhir.r5.context.SimpleWorkerContext.fromPackage(SimpleWorkerContext.java:178) at org.hl7.fhir.r5.context.SimpleWorkerContext.fromPackage(SimpleWorkerContext.java:171) at org.hl7.fhir.igtools.publisher.SpecificationPackage.fromPackage(SpecificationPackage.java:79) at org.hl7.fhir.igtools.publisher.Publisher.loadPack(Publisher.java:2238) at org.hl7.fhir.igtools.publisher.Publisher.loadCorePackage(Publisher.java:2197) at org.hl7.fhir.igtools.publisher.Publisher.initializeFromJson(Publisher.java:1783) at org.hl7.fhir.igtools.publisher.Publisher.initialize(Publisher.java:1209) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:660) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6933)
Grahame Grieve (Mar 09 2020 at 20:25):
what precedes that in the output? there's something wrong inside the package somewhere?
Nick George (Mar 09 2020 at 20:26):
almost certainly something wrong in my set up, but I could use a bit more info from the tool to fix it
Nick George (Mar 09 2020 at 20:28):
ok, here's full output:
java -jar ~/org.hl7.fhir.publisher.jar -ig 'third_party/fhir/spec/google/r4/ig.json' FHIR IG Publisher Version 1.0.70-SNAPSHOT (Git# 196f41f987ab). Built 2020-03-05T17:43:55.608+11:00 (4 days old) Detected Java version: 1.8.0_181-google-v7 from /usr/local/buildtools/java/jdk8-google-v7-64/jre on amd64 (64bit). 15565MB available Parameters: -ig third_party/fhir/spec/google/r4/ig.json dir = [...]/nickgeorge/ig/google3, path = /[...]/home/nickgeorge/bin:/usr/local/google/home/nickgeorge/google-cloud-sdk/bin:/usr/lib/google-golang/bin:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Run time = Monday, March 9, 2020 1:05:11 PM PDT (2020-03-09T13:05:11-07:00) Package Cache: /[...]/home/nickgeorge/.fhir/packages (00:00.0044) Load Configuration from /[...]/nickgeorge/ig/google3/third_party/fhir/spec/google/r4/ig.json (00:00.0047) Root directory: /[...]/nickgeorge/ig/google3/third_party/fhir/spec/google/r4 (00:00.0054) Terminology Cache is at /usr/local/google/home/nickgeorge/fhircache. 0 files in cache (00:00.0063) Core Package hl7.fhir.r5.core#current Publishing Content Failed: null (00:01.0687) (00:01.0687) Use -? to get command line help (00:01.0687) (00:01.0687) Stack Dump (for debugging): (00:01.0687) java.lang.NullPointerException at org.hl7.fhir.r5.context.SimpleWorkerContext.loadFromPackage(SimpleWorkerContext.java:324) at org.hl7.fhir.r5.context.SimpleWorkerContext.fromPackage(SimpleWorkerContext.java:178) at org.hl7.fhir.r5.context.SimpleWorkerContext.fromPackage(SimpleWorkerContext.java:171) at org.hl7.fhir.igtools.publisher.SpecificationPackage.fromPackage(SpecificationPackage.java:79) at org.hl7.fhir.igtools.publisher.Publisher.loadPack(Publisher.java:2238) at org.hl7.fhir.igtools.publisher.Publisher.loadCorePackage(Publisher.java:2197) at org.hl7.fhir.igtools.publisher.Publisher.initializeFromJson(Publisher.java:1783) at org.hl7.fhir.igtools.publisher.Publisher.initialize(Publisher.java:1209) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:660) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6933)
Grahame Grieve (Mar 09 2020 at 20:28):
hmm do you mean to be publishing an R5 guide?
Nick George (Mar 09 2020 at 20:29):
No, hence why I was looking up advice on version, and came upon the contradictory advice in those pages
Grahame Grieve (Mar 09 2020 at 20:29):
it's not to do with anything in the tool. it's in the source of your guide.
Nick George (Mar 09 2020 at 20:30):
FWIW, my command was the simplest, java -jar ~/org.hl7.fhir.publisher.jar -ig 'third_party/fhir/spec/google/r4/ig.json'
Grahame Grieve (Mar 09 2020 at 20:30):
it's not the command. it's what's in ig.json
Nick George (Mar 09 2020 at 20:31):
anyway to know what about it? or just fiddle with things until it works?
Grahame Grieve (Mar 09 2020 at 20:33):
what does your ig.json have for the property version
?
Nick George (Mar 09 2020 at 20:33):
nothing
Nick George (Mar 09 2020 at 20:34):
I'll try adding an r4 version num
Grahame Grieve (Mar 09 2020 at 20:35):
indeed you need to do that.
Nick George (Mar 09 2020 at 20:36):
FWIW it's listed as optional here: https://confluence.hl7.org/display/FHIR/IG+Publisher+Documentation
Grahame Grieve (Mar 09 2020 at 20:36):
obviously no one has tested an R5 IG lately - it triggers that rather unfortunate bug.
Nick George (Mar 09 2020 at 20:36):
ah ok
Grahame Grieve (Mar 09 2020 at 20:36):
I'll fix it next update
Nick George (Mar 09 2020 at 20:36):
hmm does the ig.json have to be in a resources directory?
Nick George (Mar 09 2020 at 20:37):
this is kind of strange - I called
java -jar ~/org.hl7.fhir.publisher.jar -ig 'third_party/fhir/spec/google/r4/ig.json'
Grahame Grieve (Mar 09 2020 at 20:37):
I think it has not to be
Nick George (Mar 09 2020 at 20:37):
and got
java.io.FileNotFoundException: third_party/fhir/spec/google/r4/resources/ig.json (No such file or directory)
Nick George (Mar 09 2020 at 20:37):
note the added 'resources' directory there
Grahame Grieve (Mar 09 2020 at 20:40):
I expect that this means you have "source": "resources\ig.json"
in third_party/fhir/spec/google/r4/ig.json
Nick George (Mar 09 2020 at 20:44):
nah, ig.json
Nick George (Mar 09 2020 at 20:45):
(OOC - why does the ig.json need an address to itself?)
Nick George (Mar 09 2020 at 20:46):
I do have paths : {resources: ["resources"]}
Grahame Grieve (Mar 09 2020 at 20:53):
the ig.json need an address to itself?)
it doesn't. source
is a reference to the ImplementationGuide resource. I'm just guessing that this is what is says based on your error message. a stack would help
Nick George (Mar 09 2020 at 20:53):
oooooh, there are two different ig.jsons...
Nick George (Mar 09 2020 at 21:14):
FYI it seems some fields marked optional are not in fact optional
Nick George (Mar 09 2020 at 21:14):
e.g., if "paths" is missing, then https://github.com/HL7/fhir-ig-publisher/blob/master/org.hl7.fhir.publisher.core/src/main/java/org/hl7/fhir/igtools/publisher/Publisher.java#L1709 is a nullptr
Grahame Grieve (Mar 09 2020 at 21:21):
I'll fix. thanks
Nick George (Mar 09 2020 at 21:56):
sorry, one more - is there another flag/config option I need to generate the html pages? I have "template": "hl7.fhir.template",
but that doesn't seem enough, the only html I get is the qa stuff
Grahame Grieve (Mar 09 2020 at 22:03):
hmm where do you have that? you wouldn't have a json file if you were using the template.
Grahame Grieve (Mar 09 2020 at 22:03):
it should be generated in output
Nick George (Mar 09 2020 at 22:05):
which json file? are you saying I should drop the "source" if there is a template? I get a bunch of stuff generated in output
but nothing that looks like html pages
(Just to be clear here, my goal is to just point to some profiles json files and get as normal-looking FHIR IG page as possible. )
Nick George (Mar 09 2020 at 22:05):
I do see qa.html
Nick George (Mar 09 2020 at 22:06):
I have the template
param in my ig.json (the one that I point the publisher script to, not the resource)
Grahame Grieve (Mar 09 2020 at 22:07):
it certainly looks like you just jumped in without starting from a working example. There's 2 different ways - the old way, and the new way. the old way uses the json file to set things up and is very flexible. whether that's good or bad is up to you. But it's not well documented - typical open source project. Or you can use the new way, using templates and and ig.ini instead. That means you do whatever the template says that you do, but that's much easier. but you can't mix them
Grahame Grieve (Mar 09 2020 at 22:07):
as to why you're not getting output now... I don't know; it all depends on how you set up the templateing in your ig.json
Nick George (Mar 09 2020 at 22:09):
hmm ok, can you give me a pointer to the "new" way? sorry if I'm going about this wrong but it's hard to find a canonical entry point for learning these...
Nick George (Mar 09 2020 at 22:10):
is there a tutorial/ minimal working example of the new way?
Lloyd McKenzie (Mar 09 2020 at 22:10):
Yes - start here: https://github.com/fhir/sample-ig
Lloyd McKenzie (Mar 09 2020 at 22:11):
There's also the beginning of some instructions/guidance here: https://build.fhir.org/ig/FHIR/ig-guidance/
Nick George (Mar 09 2020 at 22:14):
Ok, will take a look. Thanks Grahame and Lloyd!
Nick George (Mar 09 2020 at 22:49):
why does it make "ig-new.json" and "ig-new.xml"? There are so many extra files that seem to get generated!
Nick George (Mar 09 2020 at 22:49):
those are in input, not output
Lloyd McKenzie (Mar 09 2020 at 23:06):
Those are created only if you use the old approach - they're intended to help you migrate to the new
Nick George (Mar 09 2020 at 23:36):
I see. Sorry for being helpless here, but are the requirements listed somewhere that I'm missing? e.g., tthere seems to be a requirement around menu.xml that is not clear to me. It complains that it's not found in third_party/fhir/spec/google/r4/temp/pages/_includes
- I assume I'm not supposed to manually add something to temp
? just putting it in pages didn't help
Nick George (Mar 09 2020 at 23:38):
also it's just super tough to work around errors like Exception generating resource third_party/fhir/spec/google/r4/input/resources/google::Bundle/google-resources: null (00:15.0736)
java.lang.NullPointerException
..if I can humbly suggest putting a little more detail into error messages.
Grahame Grieve (Mar 10 2020 at 00:21):
that's a java error. Any time you see that you can assume that it's an unexpected situation. That's why there's a stack trace - always report the stack trace for an NPE
Grahame Grieve (Mar 10 2020 at 00:22):
Lloyd is still working on documenting the templates approach
Lloyd McKenzie (Mar 10 2020 at 03:23):
The menu file is required by the template. Put it in the same folder as it is in the sample IG - (input/includes)
David Hay (Mar 10 2020 at 03:43):
I'd also suggest you take a look at shorthand / sushi. This helps getting started...
Chris Moesel (Mar 10 2020 at 05:15):
I'd also suggest you take a look at shorthand / sushi. This helps getting started...
Yep. If you have a FSH project with a package.json
, one .fsh
file (with even the simplest profile), and an empty ig-data
folder, we'll generate a working IG for you. More details on IG configuration in the SUSHI README: https://github.com/FHIR/sushi#ig-generation
Chris Moesel (Mar 10 2020 at 05:17):
And @Nick George -- I remember you were trying FSH/SUSHI at the Connectathon and had some great feedback. If you've decided that FSH/SUSHI isn't going to do the trick for you, I'd love to hear where it fell short (feel free to IM).
Nick George (Mar 10 2020 at 23:00):
sorry, mind pointing me to where org.hl7.fhir.r5.utils.NarrativeGenerator is written? still debugging NPEs...
Nick George (Mar 10 2020 at 23:00):
I don't see it on github, sorry if missing it
Pétur Valdimarsson (Mar 10 2020 at 23:02):
Nick George said:
sorry, mind pointing me to where org.hl7.fhir.r5.utils.NarrativeGenerator is written? still debugging NPEs...
Nick George (Mar 10 2020 at 23:02):
huh it's owned by hapi?
Pétur Valdimarsson (Mar 10 2020 at 23:04):
I...think so?
Lloyd McKenzie (Mar 10 2020 at 23:08):
Much of the core FHIR Java content is owned by HAPI
Nick George (Mar 10 2020 at 23:19):
interesting
Nick George (Mar 10 2020 at 23:23):
Gonna keep posting issues as I run into them... hopefully it's helpful to see it from a fresh set of eyes.. Currently working on
org.hl7.fhir.exceptions.FHIRFormatError: Unknown type ElementDefinition at org.hl7.fhir.r4.formats.XmlParser.parseType(XmlParser.java:24274)
Seems I need to link in the base version somehow?
Grahame Grieve (Mar 10 2020 at 23:45):
I don't know how you can get that error. what on earth are you doing?
Grahame Grieve (Mar 10 2020 at 23:46):
this is an IG?
Grahame Grieve (Mar 10 2020 at 23:46):
and everytime... I'll ask for the stack.
Nick George (Mar 11 2020 at 00:09):
org.hl7.fhir.exceptions.FHIRFormatError: Unknown type ElementDefinition at org.hl7.fhir.r4.formats.XmlParser.parseType(XmlParser.java:24274) at org.hl7.fhir.r4.formats.XmlParserBase.parseType(XmlParserBase.java:133) at org.hl7.fhir.r4.formats.ParserBase.parseType(ParserBase.java:92) at org.hl7.fhir.r4.formats.ParserBase.parseType(ParserBase.java:83) at org.hl7.fhir.igtools.publisher.Publisher$TypeParserR4.parseType(Publisher.java:437) at org.hl7.fhir.r5.utils.NarrativeGenerator.parseType(NarrativeGenerator.java:1061) at org.hl7.fhir.r5.utils.NarrativeGenerator$BaseWrapperMetaElement.getBase(NarrativeGenerator.java:625) at org.hl7.fhir.r5.utils.NarrativeGenerator.renderLeaf(NarrativeGenerator.java:1426) at org.hl7.fhir.r5.utils.NarrativeGenerator.addColumnValues(NarrativeGenerator.java:1365) at org.hl7.fhir.r5.utils.NarrativeGenerator.generateByProfile(NarrativeGenerator.java:1239) at org.hl7.fhir.r5.utils.NarrativeGenerator.generate(NarrativeGenerator.java:1144) at org.hl7.fhir.igtools.publisher.Publisher.generateNarratives(Publisher.java:929) at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:3341) at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:805) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:666) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:6933)
Nick George (Mar 11 2020 at 00:10):
What I'm trying to do is to, given an existing bundle of extensions and profiles, generate a FHIR-like webpage using the basic templates. In a perfect world, what I'd want is to just be able to point to the ig.ini, and point to the directory of the bundles, and say "go nuts". But it seems a lot of other things have to be just so for that
Last updated: Apr 12 2022 at 19:14 UTC