FHIR Chat · Unable to determine type · IG creation

Stream: IG creation

Topic: Unable to determine type


view this post on Zulip Rich Boyce (Mar 14 2019 at 16:51):

Hi, I am working on the PDDI CDS IG using the most recent IG publisher I downloaded from HL7. Things seem to build fine on my machine but when I push to github and the code is pushed via webhook to https://us-central1-fhir-org-starter-project.cloudfunctions.net/ig-commit-trigger I see the following error on http://build.fhir.org/ig/HL7/PDDI-CDS/build.log. I am not sure what it means. Would someone be able to advise me on what to check/fix? Thanks!

view this post on Zulip Lloyd McKenzie (Mar 14 2019 at 18:07):

Just to confirm, you grabbed the publisher from http://build.fhir.org and have downloaded in the last few hours?

view this post on Zulip Rich Boyce (Mar 14 2019 at 20:38):

Just to confirm, you grabbed the publisher from http://build.fhir.org and have downloaded in the last few hours?

Yes. Here is the log from my local build with the publisher from http://build.fhir.org/org.hl7.fhir.igpublisher.jar : https://drive.google.com/open?id=1gZcoJnY9-CHhd49JdHFwRvgk-LCLssGn

view this post on Zulip Lloyd McKenzie (Mar 14 2019 at 20:46):

Not sure why there's a difference. @Grahame Grieve ?

view this post on Zulip Grahame Grieve (Mar 14 2019 at 20:51):

that part shouldn't be different

view this post on Zulip Rich Boyce (Mar 15 2019 at 12:39):

Is there something like a cache that could be making my build work while the remote one fails? Would it be possible for one of you to clone and build the PDDI CDS IG locally to see if you find the same issue as on the remote one?

view this post on Zulip David Pyke (Mar 15 2019 at 13:33):

Builds locally for me

view this post on Zulip Grahame Grieve (Mar 15 2019 at 19:01):

I get the same outcome as the build server - it fails

view this post on Zulip Lloyd McKenzie (Mar 15 2019 at 19:12):

Is everything committed?

view this post on Zulip Rich Boyce (Mar 15 2019 at 20:35):

I thought so but I will do some more testing tomorrow including checking it out on a different machine. Must be something like what Lloyd asks...

view this post on Zulip Rich Boyce (Mar 17 2019 at 02:15):

sure enough - did not work on a totally new machine. Error "java.lang.Exception: Unable to determine type for (long identifier) com.google.gson.JsonArray cannot be cast to com.google.gson.JsonObject``` -- I notice that this exception is raised by org.hl7.fhir.r5.formats.JsonParser.parseMedicationAdministration -- the R5 threw me off --- I specify <fhirVersion value="4.0.0"/> in the resources/ig.xml -- is the publisher looking somewhere else or how can I fix the version to be 4? thanks

view this post on Zulip Rich Boyce (Mar 19 2019 at 17:00):

I tried some more things to get past the error "Unable to determine type" but am out of ideas. I am trying to follow the docs and info in the thread but am missing something. The ig.json has an entry "specification": "http://hl7.org/fhir/R4" and the resources/ig.xml has <fhirVersion value="4.0.0"/> yet the error seems to be raised by an R5 parser java class so maybe I don't have the version set up correctly? Please help with any suggestions. Thanks.

view this post on Zulip Eric Haas (Mar 19 2019 at 17:35):

what happens if you remove the offending example?

medicationadministration-warfarin-nsaid-warfarin-prefetch

view this post on Zulip Grahame Grieve (Mar 19 2019 at 19:03):

the R5 thing is not the issue.

view this post on Zulip Grahame Grieve (Mar 19 2019 at 19:03):

no maybe -what's the stack look like?

view this post on Zulip Eric Haas (Mar 19 2019 at 19:05):

(deleted)

view this post on Zulip Eric Haas (Mar 19 2019 at 19:08):

This is from the latest build log on the autobuilder:

Check Generate /scratch/ig-build-temp-IAJ6LO/repo/temp/tbl_bck01101.png          (20.0159sec)
Check Generate /scratch/ig-build-temp-IAJ6LO/repo/qa/tbl_spacer.png              (20.0160sec)
Check Generate /scratch/ig-build-temp-IAJ6LO/repo/temp/tbl_spacer.png            (20.0160sec)
Initialization complete                                                          (20.0160sec)
Load Content                                                                     (20.0160sec)
Publishing Content Failed: Unable to determine type for  /scratch/ig-build-temp-IAJ6LO/repo/examples/medicationadministration-warfarin-nsaid-warfarin-prefetch: com.google.gson.JsonArray cannot be cast to com.google.gson.JsonObject (21.0747sec)
                                                                                 (21.0747sec)
Use -? to get command line help                                                  (21.0747sec)
                                                                                 (21.0747sec)
Stack Dump (for debugging):                                                      (21.0747sec)
java.lang.Exception: Unable to determine type for  /scratch/ig-build-temp-IAJ6LO/repo/examples/medicationadministration-warfarin-nsaid-warfarin-prefetch: com.google.gson.JsonArray cannot be cast to com.google.gson.JsonObject
    at org.hl7.fhir.igtools.publisher.Publisher.loadAsElementModel(Publisher.java:2458)
    at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1842)
    at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:610)
    at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:554)
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:5103)
Caused by: java.lang.ClassCastException: com.google.gson.JsonArray cannot be cast to com.google.gson.JsonObject
    at com.google.gson.JsonObject.getAsJsonObject(JsonObject.java:205)
    at org.hl7.fhir.r5.formats.JsonParser.parseMedicationAdministrationProperties(JsonParser.java:15886)
    at org.hl7.fhir.r5.formats.JsonParser.parseMedicationAdministration(JsonParser.java:15842)
    at org.hl7.fhir.r5.formats.JsonParser.parseResource(JsonParser.java:27554)
    at org.hl7.fhir.r5.formats.JsonParserBase.parse(JsonParserBase.java:113)
    at org.hl7.fhir.r5.formats.ParserBase.parse(ParserBase.java:79)
    at org.hl7.fhir.r5.elementmodel.ObjectConverter.convert(ObjectConverter.java:117)
    at org.hl7.fhir.igtools.publisher.Publisher.loadAsElementModel(Publisher.java:2451)
    ... 4 more
Exception in thread "main" java.lang.NullPointerException
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:5113)

view this post on Zulip Grahame Grieve (Mar 20 2019 at 21:54):

just looking at this again. @Rich Boyce what version of FHIR is this supposed to be based on?

view this post on Zulip Rich Boyce (Mar 21 2019 at 19:58):

@Grahame Grieve - we are trying for R4 since its the current official release

view this post on Zulip Grahame Grieve (Mar 21 2019 at 20:23):

so you need "version" : "4.0.0" in your config.json

view this post on Zulip Grahame Grieve (Mar 21 2019 at 20:23):

since you don't, it's being treated as R5, and the model for MedAdmin is different in R5 now

view this post on Zulip Rich Boyce (Mar 21 2019 at 21:28):

@Grahame Grieve Thank you. That did help. Interestingly, there is still a problem with the MedicationAdministration resource created in our IG that is not obvious to me when I cross-walk it with the R4 spec. Unless I comment out in ig.xml the offending resource, the publisher stops with the following exception:

Stack Dump (for debugging):                                                      (12.0882sec)
org.hl7.fhir.exceptions.FHIRException: MedicationAdministration null
        at org.hl7.fhir.igtools.publisher.IGKnowledgeProvider.doReplacements(IGKnowledgeProvider.java:134)
        at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1868)
        at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:610)
        at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:554)
        at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:5103)
Exception in thread "main" java.lang.NullPointerException
        at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:5113)

The bad resource is here: https://github.com/HL7/PDDI-CDS/blob/master/examples/medicationadministration-warfarin-nsaid-warfarin-prefetch.xml

and the reference to it in ig.xml is as follows:

   <resource>
      <reference>
        <reference value="MedicationAdministration/medicationadministration-warfarin-nsaid-warfarin-prefetch" />
      </reference>
      <name value="medicationadministration-warfarin-nsaid-warfarin-prefetch" />
      <exampleBoolean value="true" />
    </resource>

The only thing I saw that might trigger an issue was the use of the extension for the effectivePeriod. I tested that by replacing it with the ordinary period below and the publisher was still not happy -- Any ideas?

        <start value="2011-05-23" />
        <end value="2011-05-27" />

view this post on Zulip Grahame Grieve (Mar 21 2019 at 22:08):

null error is always a bug in my code even if there's a genuine underlying error. if you commit the version fix Ill have a look

view this post on Zulip Rich Boyce (Mar 21 2019 at 22:32):

Done just now : https://github.com/HL7/PDDI-CDS

view this post on Zulip Grahame Grieve (Mar 21 2019 at 23:22):

ok should be better - try again

view this post on Zulip Rich Boyce (Mar 22 2019 at 13:46):

That worked! Thank you for your help.


Last updated: Apr 12 2022 at 19:14 UTC