Using the FHIR IG Publisher
This page documents the use of the FHIR IG Publisher jar to publich FHIR Implementation Guides. See FHIR Implementation Guides for further information about FHIR Implementation Guides.
Downloading the Publisher
- Get the publisher itself: [https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar]
- Get the publishers helper: you need to install Jekyll in order to publish the said implementation guide. See Windows and Linux instructions.
The instructions below assume that the publisher jar is called org.hl7.fhir.publisher.jar.
Use the latest version of the IG publisher, irrespective of the version of the FHIR you are publishing the FHIR IG for - it supports R2, R3, R4 and the current build.
The publisher can be run as a GUI application, or run from the command line.
Running in GUI mode
Windows: double-click on org.hl7.fhir.publisher.jar or right-click and select 'Open'.
Linux: double-click on org.hl7.fhir.publisher.jar or right-click and select 'Open With Oracle Java 8 Runtime'.
You can also run it the command line:
java -jar org.hl7.fhir.publisher.jar
Note that this doesn't work in OpenJDK - if you are using openJDK, your only option is to run it from the command prompt, as described below.
This is the IG builder:
To use it, 'Choose' an implementation guide control JSON file, and click 'Execute'. The implementation guide will be built, and then the IG publisher will watch for changes until and do incremental rebuilds until you click 'Stop'.
Running in command line mode
To run in command line mode, run the IG Publisher like this:
java -jar org.hl7.fhir.publisher.jar -ig [source] (-tx [url]) (-packages [directory]) (-watch)
- -ig: a path or a url where the implementation guide JSON control file is found (see control file format documentation)
- -tx: (optional) address to use for terminology server (default is http://fhir3.healthintersections.com.au - which is currently the only supported option)
- -packages: (optional) directory containing packages (tarball/gzips with implementation guide-associated artifacts with extension .tgz) to be used for packages to load without using package management infrastructure
- -watch (optional): if this is present, the publisher will not terminate; instead, it will stay running, and watch for changes to the IG or its contents and re-run when it sees changes. Note that changes the spec or to dependent implementation guides (see below) are not picked up during watch mode
- -resetTx - clear out the txCache (see comments below about managing the freshness of the txCache)
- -resetTxErrors - delete any errors from the tcCache, but leave successful operations in the cache
Open the command prompt, then paste the following, with the paths adjusted for your computer:
java -jar "C:\Users\VadimPeretokin\Desktop\fhir-publisher\org.hl7.fhir.publisher.jar" -ig "C:\Users\VadimPeretokin\Desktop\fhir-git\tests\ig\test-ig.json" -watch
Linux: Open the terminal (usually Ctrl+Alt+T), then paste the following, with the paths adjusted for your computer:
java -jar '/home/vadi/Programs/fhir-publisher/org.hl7.fhir.publisher.jar' -ig '/home/vadi/Programs/fhir-git/tests/ig/test-ig.json' -watch
Validating without publishing
There is an alternative mode, where you run the IG publisher against a collection of conformance resources (profiles, logical models, value sets etc) without defining an implementation guide. This allows you to validate a set of profiles, and see what they look like. To run the IG publisher in this mode:
java -jar org.hl7.fhir.publisher.jar -source [source] -destination [dest] (-tx [url])
Where source is a directory containing the conformance resources, destination is where to put the generated output (validation.html is the most important). In this case, the IG publisher uses its own internal control file and renders a simple version of the output.