FHIR Chat · Using IG publisher to validate a Struct definition · IG creation

Stream: IG creation

Topic: Using IG publisher to validate a Struct definition


view this post on Zulip Brian Reinhold (Sep 09 2018 at 20:51):

For the IG publisher I need to create Structure Definitions for profiles by encoding xml. Is there a way to use IG publisher to validate that I created the structure definition correctly with setting up an entire guide and referencing the structure definition in some page? Kind of a minimal IG implementation containing only a structure definition or a single page with containing a structure definition

view this post on Zulip Grahame Grieve (Sep 09 2018 at 20:52):

yes. but someone emailed me to say it's not working. I'm going to test it otday

view this post on Zulip Brian Reinhold (Sep 09 2018 at 20:53):

yes. but someone emailed me to say it's not working. I'm going to test it otday

Okay, good to know. I need to work on my SDs and I am kind of a noob at it working at the xml level.

view this post on Zulip Grahame Grieve (Sep 09 2018 at 23:46):

ok so you just run the latest IGPublisher, and instead of -ig xxx pointing at an IG.json file, you use -source [folder] -output [folder] where the first folder is where your profiles are, and the second folder is where any generated html views are put

view this post on Zulip Brian Reinhold (Sep 10 2018 at 08:45):

ok so you just run the latest IGPublisher, and instead of -ig xxx pointing at an IG.json file, you use -source [folder] -output [folder] where the first folder is where your profiles are, and the second folder is where any generated html views are put

Command lines are always a challenge; one misunderstanding of syntax and you are done.

In the directory where I have the jar file I have created a resources and output directory. The resources directory contains the structure definition.

I type from the command line one of these

E:\Ruby25-x64\IG_Publisher>igpublisher.jar -resources -output

E:\Ruby25-x64\IG_Publisher>igpublisher.jar -source [resources] -output

E:\Ruby25-x64\IG_Publisher>igpublisher.jar -source [resources] -destination [output]

and nothing happens. The output directory is always empty.

Do you mean create a new ig.json file and put the respective commands in there? I will give that a try and see what happens
Or perhaps the control file?

view this post on Zulip Grahame Grieve (Sep 10 2018 at 13:24):

what version of the IG publisher are you using?

view this post on Zulip Brian Reinhold (Sep 10 2018 at 13:26):

what version of the IG publisher are you using?

I downloaded it from the current build but not today. I just downloaded another one a few minutes ago and am going to try that. Otherwise, how can I tell the version (from the application)?

Is this the correct command?

org.hl7.fhir.igpublisher.jar -source [resources] -destination [output]

view this post on Zulip Oliver Egger (Sep 10 2018 at 13:39):

you need to have java installed and add java -jar before to execute the ig publisher: java -Xms3550m -Xmx3550m -jar org.hl7.fhir.igpublisher.jar ...

view this post on Zulip Grahame Grieve (Sep 10 2018 at 13:40):

first line in the log is :

view this post on Zulip Brian Reinhold (Sep 10 2018 at 13:40):

you need to have java installed and add java -jar before to execute the ig publisher: java -Xms3550m -Xmx3550m -jar org.hl7.fhir.igpublisher.jar ...

I have a JDK installed and have been able to build IG guides with other completed projects. The infrastructure is there.

view this post on Zulip Grahame Grieve (Sep 10 2018 at 13:40):

FHIR Implementation Guide Publisher (vXX, gen-code v3.6.0-14947) @ Monday, 10 September 2018 11:40:14 PM

view this post on Zulip Grahame Grieve (Sep 10 2018 at 13:41):

what's the XX?

view this post on Zulip Brian Reinhold (Sep 10 2018 at 13:44):

FHIR Implementation Guide Publisher (vXX, gen-code v3.6.0-14947) @ Monday, 10 September 2018 11:40:14 PM

These are the first lines in the log when I build a finished IG (I just downloaded the current one). Prior to the download I could not build the finished project but got an error which I am guessing was a version inconsistency.

Okay, on the command line I get the version 3.6.0-d4d5de9f

Now I get this with the just downloaded version:

E:\Ruby25-x64\IG_Publisher\PHD-IG>java -jar org.hl7.fhir.igpublisher.jar -source [resources] -destination [output]
FHIR Implementation Guide Publisher (v3.6.0-d4d5de9f, gen-code v3.6.0-14947) @ Monday, September 10, 2018 9:55:47 AM
Detected Java version: 1.8.0_144 from C:\Program Files\Java\jre1.8.0_144 on amd64 (64bit). 3618MB available
[E:\Ruby25-x64\IG_Publisher\PHD-IG] -source [resources] -destination [output]
Package Cache: C:\Users\brian\.fhir\packages
Using inbuilt IG template in [resources] (00.0006sec)
Root directory: C:\Users\brian\AppData\Local\Temp\fhir-ig-scratch (00.0215sec)
Terminology Cache is at C:\Users\brian\fhircache. 8 files in cache (00.0220sec)
Contacting Build Server... (00.0220sec)
... done (01.0023sec)
Checking hl7.fhir.core-current currency (01.0031sec)
... ok: is 1, must be 1 (01.0031sec)
Load hl7.fhir.core-current package from C:\Users\brian\.fhir\packages\hl7.fhir.core#current (01.0032sec)
Load Terminology Cache from C:\Users\brian\fhircache (06.0409sec)
Connect to Terminology Server at http://tx.fhir.org/r4 (06.0416sec)
-tx cache miss: Connect to http://tx.fhir.org/r4
Initialization complete (07.0480sec)
Load Content (07.0481sec)
Publishing Content Failed: null (07.0598sec)
(07.0598sec)
Use -? to get command line help (07.0598sec)
(07.0598sec)
Stack Dump (for debugging): (07.0598sec)
java.lang.NullPointerException
at org.hl7.fhir.igtools.publisher.SimpleFetcher.scan(SimpleFetcher.java:216)
at org.hl7.fhir.igtools.publisher.Publisher.loadResources(Publisher.java:1954)
at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1677)
at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:545)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:503)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4865)
Exception in thread "main" java.lang.NullPointerException
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4875)

Could the null pointer exception be caused by the fact these resources only exist locally? But in the structure definition I have
<url value="http://hl7.org/fhir/StructureDefinition/PhdPatient" />

and that does not yet exist at the given location... though the plan is that it will when all done.

I have more information. I get the same error when I put in a structure definition that I know is good; I can publish an IG guide and this structure definition is part of it. So there is something wrong I am doing trying to work with a single resource. Most likely the command line.

And it must be really late for you down under.

view this post on Zulip Grahame Grieve (Sep 10 2018 at 19:10):

bug - looks like you specified a non-existent folder for -source

view this post on Zulip Grahame Grieve (Sep 10 2018 at 19:13):

I updated the code to not fail - should be available in about 60min. but... looks like you passed the literal "[resources]" not the actual folder where the resources are

view this post on Zulip Grahame Grieve (Sep 10 2018 at 19:16):

if you want a notification of when it's available, watch this topic:

view this post on Zulip Grahame Grieve (Sep 10 2018 at 19:16):

https://chat.fhir.org/#narrow/stream/142-committers.2Fnotification/subject/FHIR.20Build.20Status

view this post on Zulip Brian Reinhold (Sep 10 2018 at 19:16):

I updated the code to not fail - should be available in about 60min. but... looks like you passed the literal "[resources]" not the actual folder where the resources are

the actual names of my folders are
PHD-IG
----resources
----pages
----output
----qa
----temp
----txCache
----template
----historypage
----examples

They are all empty except for a structure definition in the 'resources' folder

view this post on Zulip Grahame Grieve (Sep 10 2018 at 19:17):

try passing in the absolute folder names then

view this post on Zulip Brian Reinhold (Sep 10 2018 at 19:21):

try passing in the absolute folder names then

Okay, gave it a whirl. Still get the same null pointer exception at
at org.hl7.fhir.igtools.publisher.SimpleFetcher.scan(SimpleFetcher.java:216)

command line is
java -jar org.hl7.fhir.igpublisher.jar -source [E:\Ruby25-x64\IG_Publisher\PHD-IG\resources] -destination [output]

I didnt put a full path to output ....

view this post on Zulip Grahame Grieve (Sep 10 2018 at 19:22):

take out the []

view this post on Zulip Brian Reinhold (Sep 10 2018 at 19:24):

take out the []

That was it. Now I get an error but its an error on my structure definition. THAT I expect. I will try a structure definition I know is valid

The valid structure worked but the output does not let me view it as I hoped.
I am going to try and make a minimal IG that has one markdown page containing one Structure definition
That should do the trick

view this post on Zulip Grahame Grieve (Sep 10 2018 at 19:58):

why didn't the view work?

view this post on Zulip Brian Reinhold (Sep 10 2018 at 20:03):

why didn't the view work?

I got a whole bunch of files generated in the output directory. When I looked at the index.html it had the usual headers and menus but they all gave 404 errors. I wanted to be able to view the structure like on the FHIR web site in the Resoruce Context structure.

I know that can be done from within a finished guide so now I am trying a minimal IG guide. One page one structure definition. Trying to set up the ig.json and IGImplementationGuild.xml files for this to work. Still not familiar enough with the options but its coming. Come a ways in two days for never having worked with it before.

At least I know my PhdDevice structure definition is good (not finished all the differentials yet) but what is done so far must be okay.


Last updated: Apr 12 2022 at 19:14 UTC