Stream: implementers
Topic: ImplementationGuide resource - IGpublisher needs xml?
Travis Stenerson (Feb 09 2018 at 22:31):
I'm trying to use a JSON ImplementationGuide resource to run the publisher, and it's failing. "unable to parse XML". Is there a way to make it OK with a json file or must the IG resource file be in XML?
Grahame Grieve (Feb 09 2018 at 22:38):
looks to me like json should be ok, but it does require you to have .json in the file name
Grahame Grieve (Feb 09 2018 at 22:38):
if it does, put a stack dump here
Travis Stenerson (Feb 09 2018 at 22:45):
It does. Here's the output:
(how do I code block markup this? got it)
Stack Dump (for debugging): (20.0200sec) java.lang.Exception: Unable to parse XML for ...\Evinance-DSS-IG at org.hl7.fhir.igtools.publisher.Publisher.loadFromXml(Publisher.java:1894) at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1345) at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:378) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:352) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4087) Exception in thread "main" java.lang.NullPointerException at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4097)
Grahame Grieve (Feb 09 2018 at 22:49):
oh right. I looked at the wrong line. I'll try and fix this in the next 24 hours
Travis Stenerson (Feb 09 2018 at 22:51):
Thanks Grahame.
Eric Haas (Feb 09 2018 at 23:43):
@Travis Stenerson I think we have colloquially called the two different key definitions files "ig.json" (the ig-publisher definitions file) and "ig.xml" (the implementation guide resource). ( I'm not sure the auto-publisher will work if you call them anything else ) Anyway be aware of this if you hear these names being bantied about. Meanwhile I'll try to call them something else... :-)
Travis Stenerson (Feb 10 2018 at 20:59):
it was working fine with the XML ImplementationGuide resource and ig build file called something other than ig.json/ig.xml (the name you can see above). I've begun making more use of the python client library for creating resources, trying to streamline IG creation since I'm managing a few, and it doesn't have an as_xml() method unfortunately (as far as I can tell). I suppose I can write one if only the XML resource is usable for the publisher.
Grahame Grieve (Feb 10 2018 at 21:06):
wait for the next build to success (13036) and then try again
Travis Stenerson (Feb 11 2018 at 02:29):
Sorry Grahame I didn't understand that. Wait for 13036?
Grahame Grieve (Feb 11 2018 at 02:48):
yes it's built now, so try with the latest IG publisher from build.fhir.org
Travis Stenerson (Feb 11 2018 at 03:32):
Thanks! I'll try it out Monday.
Travis Stenerson (Feb 12 2018 at 16:21):
Hi Grahame, is the download link updated on build.fhir.org? I am still getting a 69.3 MB file, same size as the previous, and the error persists. Did I use the wrong link? http://build.fhir.org/org.hl7.fhir.igpublisher.jar
Grahame Grieve (Feb 12 2018 at 19:30):
13036 is not posted... I don't know why
Grahame Grieve (Feb 12 2018 at 20:52):
@Travis Stenerson try again
Travis Stenerson (Feb 12 2018 at 23:06):
Seems to work. But I am getting a weird error now from extensions :
Error parsing path\StructureDefinitions\request-group-code: com.google.gson.JsonObject cannot be cast to com.google.gson.JsonArray(38.0953sec)
Lloyd McKenzie (Feb 12 2018 at 23:15):
Do you have a "pattern" element declared that's not valid? (e.g. forgetting to wrap the "coding" element inside an array)
Travis Stenerson (Feb 12 2018 at 23:22):
I don't think so. My differential hasn't changed though I've been using a very old publisher until now. Differential.element is below:
[ { "id": "Extension", "path": "Extension" }, { "id": "Extension.url", "path": "Extension.url", "fixedUri": "http://evinance.com/fhir-DSTU3/StructureDefinition/request-group-code" }, { "id": "Extension.valueCodeableConcept", "path": "Extension.valueCodeableConcept", "min": 1, "max": "1", "type": [ { "code": "CodeableConcept" } ] } ]
Lloyd McKenzie (Feb 12 2018 at 23:27):
Is there any stack trace associated with that error?
Travis Stenerson (Feb 12 2018 at 23:27):
Yes:
Stack Dump (for debugging): (38.0958sec) java.lang.Exception: Error parsing path\StructureDefinitions\request-group-code: com.google.gson.JsonObject cannot be cast to com.google.gson.JsonArray at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1940) at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:1676) at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:382) at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:352) at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4087) Caused by: java.lang.ClassCastException: com.google.gson.JsonObject cannot be cast to com.google.gson.JsonArray at com.google.gson.JsonObject.getAsJsonArray(JsonObject.java:172) at org.hl7.fhir.dstu3.formats.JsonParser.parseStructureDefinitionProperties(JsonParser.java:17058) at org.hl7.fhir.dstu3.formats.JsonParser.parseStructureDefinition(JsonParser.java:17013) at org.hl7.fhir.dstu3.formats.JsonParser.parseResource(JsonParser.java:19745) at org.hl7.fhir.dstu3.formats.JsonParserBase.parse(JsonParserBase.java:90) at org.hl7.fhir.dstu3.formats.ParserBase.parse(ParserBase.java:58) at org.hl7.fhir.igtools.publisher.Publisher.parse(Publisher.java:2163) at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1937) ... 4 more Exception in thread "main" java.lang.NullPointerException at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4097)
Lloyd McKenzie (Feb 13 2018 at 01:47):
Can you show the whole resource?
John Silva (Feb 13 2018 at 01:59):
While you're discussing the IG Publisher ... has anyone created a dockerized version of this? This would save a bunch of effort in setting one up. Thanks. (I did Google for one and only found a 'test one' that seemed to be a person's attempt at creating one.)
Lloyd McKenzie (Feb 13 2018 at 02:11):
See https://chat.fhir.org/#narrow/stream/implementers/subject/ig.20publisher.20as.20Docker.20image
John Silva (Feb 13 2018 at 15:03):
I had found this Dockerfile someone has on GitHub; haven't tried to create a docker image from it yet though.
https://github.com/robstwd/assorted-dockerfiles/blob/master/alpine-fhir-ig-publisher/Dockerfile
Travis Stenerson (Feb 13 2018 at 15:08):
@Lloyd McKenzie Yes, thank you. it's in the codeblock below. I just create the differential and run the publisher, it's always worked with an older version of the jar file.
edit: I found the error. I forgot to make contact an array. Thanks for the help.
Eric Haas (Feb 13 2018 at 17:09):
FYI we are trying to move these IG questions to the IG creation stream
Travis Stenerson (Feb 13 2018 at 18:38):
Didn't know that stream existed. Thanks Eric.
Last updated: Apr 12 2022 at 19:14 UTC