Search code examples
hl7-fhir

Run IG Publisher with unpacked FHIR package


I am using "IG Publisher" to generate static documentation for a custom HL7 FHIR server.

The documentation is generated with:

java -jar org.hl7.fhir.igpublisher.jar -spec package.tgz -ig ig.json

Where package.tgz is downloaded from https://www.hl7.org/fhir/stu3/package.tgz.

At every run of this, IG Publisher unpacks the package.tgz file which takes 1-2 minutes. Since the files are static, there is no reason for spending time on this unpacking all the time. So I would like to unpack package.tgz once and for all - and then just point IG Publisher to the directory where these unpacked files are found. Something like this:

java -jar org.hl7.fhir.igpublisher.jar -spec ./package/ -ig ig.json 

Is this possible?


Solution

  • Rather than passing the spec, allow the NPM package manager to find it and use it. It'll cache the opened version and will only grab a new version if the spec has changed. (If you base your IG on the 'current' draft, that'll be often as commits happen regularly, but if you point to R4 or STU3 or DSTU2, changes should be very rare.) Note that the publisher will still take 10-20 seconds each time you run it to load the specification into memory.