FHIR Chat · java.lang.Error: no value for null · committers

Stream: committers

Topic: java.lang.Error: no value for null


view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 13:52):

I'm getting this error while applying some changes for R5:

Exception in thread "main" java.lang.Error: no value for null on DeviceDefinitionProductionIdentifierInUDI
        at org.hl7.fhir.definitions.generators.xsd.XSDGenerator.encodeType(XSDGenerator.java:418)
        at org.hl7.fhir.definitions.generators.xsd.XSDGenerator.generateElement(XSDGenerator.java:325)
        at org.hl7.fhir.definitions.generators.xsd.XSDGenerator.generateType(XSDGenerator.java:211)
        at org.hl7.fhir.definitions.generators.xsd.XSDGenerator.generate(XSDGenerator.java:123)

Can anyone tell me what is missing?

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 13:53):

on this branch: https://github.com/HL7/fhir/commits/costateixeira-oo

view this post on Zulip Grahame Grieve (Dec 07 2021 at 18:40):

I can't reproduce?

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 18:57):

ok, i guess i need to clean first

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 19:01):

still broken on my end

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 19:02):

what is this code supposed to check?

    private String encodeType(ElementDefn e, TypeRef type, boolean params) throws Exception {
    if (type.isResourceReference())
      return "Reference";
    else if (type.isCanonical())
      return "canonical";
    else if (type.isCodeableReference())
      return "CodeableReference";
        else if (type.getName().equals("code")) {
            String en = null;
            if (e.hasBinding()) {
                BindingSpecification cd = e.getBinding();
                if (cd != null && isEnum(cd)) {
                  if (cd.getValueSet() == null) {
                    throw new Error("no value for "+cd.getUri()+" on "+cd.getName());
                  }

view this post on Zulip Grahame Grieve (Dec 07 2021 at 19:03):

getting the type name for something. Do you get this with a new checkout ?

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 19:11):

no, I'm using the branch https://github.com/HL7/fhir/tree/costateixeira-oo

view this post on Zulip Grahame Grieve (Dec 07 2021 at 19:46):

well, looking at that, the value set for the element DeviceDefinition.productionIdentifierInUDI is not defined

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 20:56):

      <type>
        <code value="code"/>
      </type>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
          <valueString value="DeviceProductionIdentifierInUDI"/>
        </extension>
        <strength value="required"/>
        <description value="The production identifier(s) that are expected to appear in the UDI carrier."/>
        <valueSet value="http://hl7.org/fhir/ValueSet/device-productidentifierinudi"/>
      </binding>

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 20:58):

the VS is defined

<?xml version="1.0" encoding="UTF-8"?>

<ValueSet xmlns="http://hl7.org/fhir">
  <id value="device-productidentifierinudi"/>
  <meta>
    <profile value="http://hl7.org/fhir/StructureDefinition/shareablevalueset"/>
  </meta>
  <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
    <valueCode value="oo"/>
  </extension>
  <url value="http://hl7.org/fhir/ValueSet/device-productidentifierinudi"/>
  <version value="4.6.0"/>
  <name value="DeviceProductionIdentifierInUDI"/>
  <description value="Device Production Identifier in UDI"/>
  <compose>
    <include>
      <system value="http://hl7.org/fhir/device-productidentifierinudi"/>
    </include>
  </compose>
</ValueSet><?xml version="1.0" encoding="UTF-8"?>

<ValueSet xmlns="http://hl7.org/fhir">
  <id value="device-productidentifierinudi"/>
  <url value="http://hl7.org/fhir/ValueSet/device-productidentifierinudi"/>
  <version value="4.6.0"/>
  <name value="DeviceProductionIdentifierInUDI"/>
  <description value="Device Production Identifier in UDI"/>
  <compose>
    <include>
      <system value="http://hl7.org/fhir/device-productidentifierinudi"/>
    </include>
  </compose>
</ValueSet>

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 20:58):

and the codesystem is defined too

view this post on Zulip John Moehrke (Dec 07 2021 at 21:18):

you have named the valueset and the codesystem the same

view this post on Zulip Grahame Grieve (Dec 07 2021 at 21:19):

but are they loaded - what would make them load?

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 21:37):

I looked at other resources , where I saw that VS and CS having the same id would be OK

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 21:40):

@Grahame Grieve what does "make them load" mean? Isn't it sufficient to define the VS and the CS as XMLs, and set the right references? elementDefinition --binding--> ValueSet --compose.include--> CodeSystem

view this post on Zulip John Moehrke (Dec 07 2021 at 21:42):

well they are not exactly named the same thing

view this post on Zulip John Moehrke (Dec 07 2021 at 21:42):

the valueset sometimes is "production", where the codesystem is always "product"

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 21:47):

Ah i see. I have a name mismatch

view this post on Zulip Jose Costa Teixeira (Dec 07 2021 at 21:53):

Thanks @John Moehrke I would not have noticed that ever

view this post on Zulip John Moehrke (Dec 07 2021 at 21:54):

did you get it working?


Last updated: Apr 12 2022 at 19:14 UTC