FHIR Chat · json preference? · IG creation

Stream: IG creation

Topic: json preference?


view this post on Zulip Jens Villadsen (Jan 31 2019 at 09:37):

It seems like the IG pub has a preference for json ...

Load Content                                                                     (11.0715sec)
Publishing Content Failed: Unable to determine type for  /Users/jvi/Documents/fut-core/resources/structuredefinition/ITCompetenceLevel: Not a JSON Object: null (12.0139sec)
                                                                                 (12.0139sec)
Use -? to get command line help                                                  (12.0139sec)
                                                                                 (12.0139sec)
Stack Dump (for debugging):                                                      (12.0139sec)
java.lang.Exception: Unable to determine type for  /Users/jvi/Documents/fut-core/resources/structuredefinition/ITCompetenceLevel: Not a JSON Object: null
    at org.hl7.fhir.igtools.publisher.Publisher.loadAsElementModel(Publisher.java:2405)
    at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1789)
    at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:583)
    at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:527)
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4936)
Caused by: java.lang.IllegalStateException: Not a JSON Object: null
    at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:90)
    at org.hl7.fhir.r4.formats.JsonParser.parseStructureDefinitionProperties(JsonParser.java:23579)
    at org.hl7.fhir.r4.formats.JsonParser.parseStructureDefinition(JsonParser.java:23478)
    at org.hl7.fhir.r4.formats.JsonParser.parseResource(JsonParser.java:27655)
    at org.hl7.fhir.r4.formats.JsonParserBase.parse(JsonParserBase.java:92)
    at org.hl7.fhir.r4.formats.ParserBase.parse(ParserBase.java:58)
    at org.hl7.fhir.r4.elementmodel.ObjectConverter.convert(ObjectConverter.java:90)
    at org.hl7.fhir.igtools.publisher.Publisher.loadAsElementModel(Publisher.java:2398)
    ... 4 more
Exception in thread "main" java.lang.NullPointerException
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4946)
  • is there an easy fix to this - or should I convert all my extensions to json (I've already done it with a single one and that worked)

view this post on Zulip Oliver Egger (Jan 31 2019 at 10:27):

strange, i have no problems defining them in xml (e.g. https://github.com/hl7ch/ch-core/blob/master/resources/structuredefinition/ch-ext-ech-10-line.xml)

view this post on Zulip Jens Villadsen (Jan 31 2019 at 10:27):

The really strange part is that I used your project as starting point (@Oliver Egger )

view this post on Zulip Jens Villadsen (Jan 31 2019 at 10:29):

@Oliver Egger - btw - would you happen to know of a service that generates a narrative?

view this post on Zulip Grahame Grieve (Jan 31 2019 at 10:42):

the iG Publisher will generate narrative

view this post on Zulip Grahame Grieve (Jan 31 2019 at 10:45):

the error means that you have a problem with your json format - probably a wrong version issue. Note that the IG publisher is reading at as R4 but the location of the problem suggests that you're using R3

view this post on Zulip Jens Villadsen (Jan 31 2019 at 11:39):

@Grahame Grieve ok, that makes sense. I'm using R3, and that is probably the reason why. Are there flags available to force it to R3 or is it published for different versions?

(Its still a bit weird that is works when I convert the files to json though.)

view this post on Zulip Jens Villadsen (Jan 31 2019 at 11:43):

@Grahame Grieve - could the R3/R4 issue also be the case that I don't see any narrative being generated on my resources?

view this post on Zulip Jens Villadsen (Jan 31 2019 at 12:00):

@Grahame Grieve - ... one more for the grinder:

Watching for changes on a 5sec cycle
Publishing Content Failed: Can't have an exampleFor unless the file has exactly one resource

Use -? to get command line help

Stack Dump (for debugging):
java.lang.Exception: Can't have an exampleFor unless the file has exactly one resource
    at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1792)
    at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:538)
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4936)
Exception in thread "main" java.lang.NullPointerException
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4946)

view this post on Zulip Grahame Grieve (Jan 31 2019 at 12:27):

the narrative thing is not linked to version

view this post on Zulip Grahame Grieve (Jan 31 2019 at 12:27):

you delcare the version you are using

view this post on Zulip Grahame Grieve (Jan 31 2019 at 12:27):

what version have you said?

view this post on Zulip Grahame Grieve (Jan 31 2019 at 12:28):

xml and json behave differently across versions because of how things reflect into the serialization

view this post on Zulip Grahame Grieve (Jan 31 2019 at 12:29):

you can't have an example for a bundle. the tool can

view this post on Zulip Grahame Grieve (Jan 31 2019 at 12:29):

't figure out what it's an example for

view this post on Zulip Jens Villadsen (Jan 31 2019 at 13:19):

So ... after having dug into it I've found a way through that sort of works. I'l continue to make my profiles as R3 but serialize them as json. If they are expresssed in json I can continue to have my IG expressed in R4. That seem to work and makes it a bit easier to go to r4 when that time arrives ... this spring


Last updated: Apr 12 2022 at 19:14 UTC