FHIR Chat · NPE: Cannot invoke String.equals(Object) because code is nul · IG creation

Stream: IG creation

Topic: NPE: Cannot invoke String.equals(Object) because code is nul


view this post on Zulip Alexander Henket (Jun 14 2021 at 15:53):

FHIR IG Publisher 1.1.73 (June 5 , 2021). I'm getting the error below here. What can I do for tracing the issue better?

...
Processing Conformance Resources                                                 (00:39.0844)
Generating Snapshots                                                             (00:43.0070)
Generating Narratives                                                            (00:45.0574)
Publishing Content Failed: Cannot invoke "String.equals(Object)" because "code" is null (00:52.0592)
                                                                                 (00:52.0594)
Use -? to get command line help                                                  (00:52.0596)
                                                                                 (00:52.0597)
Stack Dump (for debugging):                                                      (00:52.0598)
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "code" is null
    at org.hl7.fhir.r5.terminologies.CodeSystemUtilities.getCode(CodeSystemUtilities.java:443)
    at org.hl7.fhir.r5.terminologies.CodeSystemUtilities.getCode(CodeSystemUtilities.java:434)
    at org.hl7.fhir.r5.renderers.TerminologyRenderer.getDisplayForProperty(TerminologyRenderer.java:259)
    at org.hl7.fhir.r5.renderers.TerminologyRenderer.addTableHeaderRowStandard(TerminologyRenderer.java:229)
    at org.hl7.fhir.r5.renderers.CodeSystemRenderer.generateCodeSystemContent(CodeSystemRenderer.java:171)
    at org.hl7.fhir.r5.renderers.CodeSystemRenderer.render(CodeSystemRenderer.java:60)
    at org.hl7.fhir.r5.renderers.CodeSystemRenderer.render(CodeSystemRenderer.java:43)
    at org.hl7.fhir.r5.renderers.ResourceRenderer.render(ResourceRenderer.java:74)
    at org.hl7.fhir.igtools.publisher.Publisher.generateNarratives(Publisher.java:1155)
    at org.hl7.fhir.igtools.publisher.Publisher.loadConformance(Publisher.java:3907)
    at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:889)
    at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:744)
    at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:8557)

view this post on Zulip Grahame Grieve (Jun 14 2021 at 16:42):

can I reproduce it?

view this post on Zulip Grahame Grieve (Jun 14 2021 at 16:46):

but it comes from a uri of a property. it's a bug in my code - will be fixed next release

view this post on Zulip Alexander Henket (Jun 14 2021 at 17:59):

I found it ... somewhat. My ig had properties like this below. I removed all of them and that got me passed this issue. Not sure which was the culprit:

     <!--copyright year is a mandatory parameter-->
      <parameter>
         <code value="copyrightyear"/>
         <value value="2020+"/>
      </parameter>
      <!--releaselabel should be the ballot status for HL7-published IGs.-->
      <parameter>
         <code value="releaselabel"/>
         <value value="CI Build"/>
      </parameter>
      <parameter>
         <code value="find-other-resources"/>
         <value value="true"/>
      </parameter>
      <!--List any URLs we purposely have in our set but do not match the guides preferred URL-->
      <parameter>
         <code value="special-url"/>
         <value value="http://decor.nictiz.nl/fhir/ValueSet/2.16.840.1.113883.2.4.3.11.60.121.11.10--20200901000000"/>
      </parameter>

view this post on Zulip Alexander Henket (Jun 14 2021 at 17:59):

I had lots of 'special-url' parameters. I've not yet seen how rewrite those (if those are still necessary)

view this post on Zulip Grahame Grieve (Jun 14 2021 at 18:02):

that's... weird. I wouldn't have thought that rendering a code system (where problem happens) is at all related to a special-url on a value set

view this post on Zulip Alexander Henket (Jun 14 2021 at 18:28):

Well after fixing this, new issues popped up, but not NPE. It might be a combination of factors. Resource.ids exceeding 64 characters, an xml example with a missing namesapce and then some ... I'll come back here if there's something I can't fix. So far, error between my keyboard and chair.

view this post on Zulip Alexander Henket (Jun 15 2021 at 07:00):

@Grahame Grieve found the part that really made the difference:

<parameter>
  <code value="find-other-resources"/>
  <value value="true"/>
 </parameter>

Removing this one specifically, solves the error. I'm sure this is combined with the specific input files I have.

view this post on Zulip Alexander Henket (Jun 15 2021 at 08:06):

The side effect of removing this instruction seems to be that the IG Publisher does not pick up any profiles, and as such cannot validate any example.

view this post on Zulip Alexander Henket (Jun 15 2021 at 08:22):

Maybe that is within expectation but, this parameter yields the same error.

<parameter>
        <code value="autoload-resources"/>
        <value value="true"/>
 </parameter>

view this post on Zulip Grahame Grieve (Jun 15 2021 at 08:32):

well, I'm not sure about that, but this will be fixed in the next release, due in the next 48 hours

view this post on Zulip Alexander Henket (Jun 15 2021 at 08:34):

Nice. Removing all Codesystem resources also does the trick until that new release 'hits the streets'


Last updated: Apr 12 2022 at 19:14 UTC