0

I'm trying to generate documentation of my HL7 FHIR profiles using IG Publisher (publisher.jar). I'm running it on command line on macOS. I've uploaded the IG resource on Simplifier and it validates with no errors. The problem is that i'm getting java.lang.NullPointerException. Full output below:

   java -jar publisher.jar -ig fsh-generated/resources/ImplementationGuide-nfz.pozplus.json -tx n/a
FHIR IG Publisher Version 1.1.120 (Git# 210e48f945ad). Built 2022-05-13T15:20:39.709Z (8 days old)
Detected Java version: 11.0.10 from /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home on Mac OS X/x86_64 (64bit). 2048MB available
dir = /Users/marcingrudzien/Library/CloudStorage/OneDrive-Osobisty/Praca/iEHReu/NFZ/POZ-Plus/FHIR/sushi-test/NfzTest, path = /Users/marcingrudzien/.gem/ruby/3.1.2/bin:/Users/marcingrudzien/.rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/bin:/Users/marcingrudzien/.rubies/ruby-3.1.2/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Postgres.app/Contents/Versions/latest/bin
Parameters: -ig fsh-generated/resources/ImplementationGuide-nfz.pozplus.json -tx n/a
Start Clock @ sobota, 21 maja 2022 20:56:04 czas środkowoeuropejski letni (2022-05-21T20:56:04+02:00)

API keys loaded from /Users/marcingrudzien/fhir-api-keys.ini                     (00:00.0027)
Package Cache: /Users/marcingrudzien/.fhir/packages                              (00:00.0030)
Load Configuration from /Users/marcingrudzien/Library/CloudStorage/OneDrive-Osobisty/Praca/iEHReu/NFZ/POZ-Plus/FHIR/sushi-test/NfzTest/fsh-generated/resources/ImplementationGuide-nfz.pozplus.json (00:00.0053)
Root directory: /Users/marcingrudzien/Library/CloudStorage/OneDrive-Osobisty/Praca/iEHReu/NFZ/POZ-Plus/FHIR/sushi-test/NfzTest/fsh-generated/resources (00:00.0084)
Publishing Content Failed: null                                                  (00:00.0086)
                                                                                 (00:00.0087)
Use -? to get command line help                                                  (00:00.0087)
                                                                                 (00:00.0087)
Stack Dump (for debugging):                                                      (00:00.0088)
java.lang.NullPointerException
    at org.hl7.fhir.igtools.publisher.Publisher.initializeFromJson(Publisher.java:2947)
    at org.hl7.fhir.igtools.publisher.Publisher.initialize(Publisher.java:2168)
    at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:854)
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:10144)

I hope someone here could help me. I could provide any additional information, if needed.

1 Answers1

0

From the stack dump, you are missing a "path" property in your json config file, but I highly recommend that you switch to using the new set up, a ini file that points to a template and a IG resource. Use something like the sample-ig as a starter (https://github.com/FHIR/sample-ig) or see the how-to (https://build.fhir.org/ig/FHIR/ig-guidance/index.html)

Grahame Grieve
  • 3,538
  • 3
  • 15
  • 17
  • Thank you for your answer! I've switched to ig.ini. It looks like this: `[IG] ig = fsh-generated/resources/ImplementationGuide-nfz.pozplus.json template = fhir.base.template#current` Unfortunatelly I still have NullPointerException, but now it fails on `determineActualIG` method. Do you have any idea how to fix this? `Exception in thread "main" java.lang.NullPointerException at org.hl7.fhir.igtools.publisher.Publisher.determineActualIG(Publisher.java:10274) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:10104)` – Marcin Grudzień May 22 '22 at 13:48
  • you need a -ig parameter. – Grahame Grieve May 22 '22 at 20:19
  • Hmm... I have a ig parameter in my ig.ini. I thought it would be enough. If I add -ig I'm getting the same problem as in original question (Publisher.java:2947) :/ – Marcin Grudzień May 23 '22 at 07:24
  • you should probably seek help here: https://chat.fhir.org/#narrow/stream/179252-IG-creation – Grahame Grieve May 23 '22 at 11:09