Difference between revisions of "FHIR IG Publishing tool"
(Created page with "= Introduction = = Technical Description / Pre-requisites = = Configuring an implementation guide = = Support for logical models =") |
|||
Line 1: | Line 1: | ||
= Introduction = | = Introduction = | ||
− | + | The FHIR team provides an tool used for publishing [[FHIR Implementation Guides]]. The tool takes the input of the implementation guide (resources, narrative, template) and converts it to a set of different types of files: | |
+ | * generated HTML pages | ||
+ | * resources (+ canonical redirections) | ||
+ | * some zip files | ||
+ | * qa.html which contains information about the errors/issues found in the build process | ||
− | + | The "FHIR IG" is the set of files produced by the IG publishing tool. These files can be posted to a web server. | |
− | = | + | == Installing == |
+ | |||
+ | # Get the publisher itself: this is a java jar called <code>org.hl7.fhir.igpublisher.jar</code>. You can get it from the downloads (e.g. [http://build.fhir.org/downloads.html http://build.fhir.org/downloads.html]) for the version of FHIR you are using (or, if you build locally, from your own publish directory). The jar includes everything from the spec that is required to generate the implementation guide. | ||
+ | # Get the publishers helper: you need to install Jekyll in order to publish the said implementation guide. See [http://jekyll-windows.juthilo.com/1-ruby-and-devkit/ Windows] and [http://jekyll.tips/jekyll-casts/install-jekyll-on-linux/ Linux] instructions. | ||
+ | |||
+ | 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. | ||
+ | |||
+ | The publisher can be run as a GUI application, or run from the command line. It can also can be hosted in a server - if you want to host it, talk to Grahame Grieve. | ||
+ | |||
+ | Alternatively, you can use the IG Publisher in web server mode. If you do this, you don't need any installed software. | ||
+ | |||
+ | == Using the IG Publisher Web Server == | ||
+ | |||
+ | The IG publisher lives at [[http://hapi.fhir.org/igweb]]. From there, you can upload a ip file containing the contents of the IG. After processing, you can download the output. | ||
+ | |||
+ | Note that it's a little inconvenient to flip between modes (running locally vs using the web publisher) because the standard folder structures include /qa, /temp, and /output - you don't want to upload these - they can be very large (though the IG server will ignore them if you do). Also, the web publisher maintains it's own terminology server cache, and may give different results for expansions etc than if you are using your own txCache in the folder and not keeping it up to date. | ||
+ | |||
+ | You can also use the API to the IG web publisher directly. To do this, POST a zip containing the IG content to http://hapi.fhir.org/igweb/process (Content-Tyepe: application/zip), and after a period of seconds, a zip file containing the generated output will be returned. | ||
+ | |||
+ | == Running in GUI mode == | ||
+ | |||
+ | '''Windows''': double-click on org.hl7.fhir.igpublisher.jar or right-click and select 'Open'. | ||
+ | |||
+ | '''Linux''': double-click on org.hl7.fhir.igpublisher.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.igpublisher.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: | ||
+ | |||
+ | [[File:ig-builder.png]] | ||
+ | |||
+ | 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.igpublisher.jar -ig [source] (-tx [url]) (-watch) | ||
+ | |||
+ | parameters: | ||
+ | * -ig: a path or a url where the implementation guide JSON control file is found (see [[#Control_file|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) | ||
+ | * -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 | ||
+ | |||
+ | Advanced parameters: | ||
+ | * -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 | ||
+ | |||
+ | Windows example: | ||
+ | |||
+ | [https://www.lifewire.com/how-to-open-command-prompt-2618089 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.igpublisher.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.igpublisher.jar' -ig '/home/vadi/Programs/fhir-git/tests/ig/test-ig.json' -watch |
Revision as of 05:16, 25 April 2018
Contents
Introduction
The FHIR team provides an tool used for publishing FHIR Implementation Guides. The tool takes the input of the implementation guide (resources, narrative, template) and converts it to a set of different types of files:
- generated HTML pages
- resources (+ canonical redirections)
- some zip files
- qa.html which contains information about the errors/issues found in the build process
The "FHIR IG" is the set of files produced by the IG publishing tool. These files can be posted to a web server.
Installing
- Get the publisher itself: this is a java jar called
org.hl7.fhir.igpublisher.jar
. You can get it from the downloads (e.g. http://build.fhir.org/downloads.html) for the version of FHIR you are using (or, if you build locally, from your own publish directory). The jar includes everything from the spec that is required to generate the implementation guide. - Get the publishers helper: you need to install Jekyll in order to publish the said implementation guide. See Windows and Linux instructions.
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.
The publisher can be run as a GUI application, or run from the command line. It can also can be hosted in a server - if you want to host it, talk to Grahame Grieve.
Alternatively, you can use the IG Publisher in web server mode. If you do this, you don't need any installed software.
Using the IG Publisher Web Server
The IG publisher lives at [[1]]. From there, you can upload a ip file containing the contents of the IG. After processing, you can download the output.
Note that it's a little inconvenient to flip between modes (running locally vs using the web publisher) because the standard folder structures include /qa, /temp, and /output - you don't want to upload these - they can be very large (though the IG server will ignore them if you do). Also, the web publisher maintains it's own terminology server cache, and may give different results for expansions etc than if you are using your own txCache in the folder and not keeping it up to date.
You can also use the API to the IG web publisher directly. To do this, POST a zip containing the IG content to http://hapi.fhir.org/igweb/process (Content-Tyepe: application/zip), and after a period of seconds, a zip file containing the generated output will be returned.
Running in GUI mode
Windows: double-click on org.hl7.fhir.igpublisher.jar or right-click and select 'Open'.
Linux: double-click on org.hl7.fhir.igpublisher.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.igpublisher.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.igpublisher.jar -ig [source] (-tx [url]) (-watch)
parameters:
- -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)
- -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
Advanced parameters:
- -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
Windows example:
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.igpublisher.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.igpublisher.jar' -ig '/home/vadi/Programs/fhir-git/tests/ig/test-ig.json' -watch