Stream: committers
Topic: java.lang.Error: no value for null
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?
Jose Costa Teixeira (Dec 07 2021 at 13:53):
on this branch: https://github.com/HL7/fhir/commits/costateixeira-oo
Grahame Grieve (Dec 07 2021 at 18:40):
I can't reproduce?
Jose Costa Teixeira (Dec 07 2021 at 18:57):
ok, i guess i need to clean first
Jose Costa Teixeira (Dec 07 2021 at 19:01):
still broken on my end
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());
}
Grahame Grieve (Dec 07 2021 at 19:03):
getting the type name for something. Do you get this with a new checkout ?
Jose Costa Teixeira (Dec 07 2021 at 19:11):
no, I'm using the branch https://github.com/HL7/fhir/tree/costateixeira-oo
Grahame Grieve (Dec 07 2021 at 19:46):
well, looking at that, the value set for the element DeviceDefinition.productionIdentifierInUDI is not defined
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>
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>
Jose Costa Teixeira (Dec 07 2021 at 20:58):
and the codesystem is defined too
John Moehrke (Dec 07 2021 at 21:18):
you have named the valueset and the codesystem the same
Grahame Grieve (Dec 07 2021 at 21:19):
but are they loaded - what would make them load?
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
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
John Moehrke (Dec 07 2021 at 21:42):
well they are not exactly named the same thing
John Moehrke (Dec 07 2021 at 21:42):
the valueset sometimes is "production", where the codesystem is always "product"
Jose Costa Teixeira (Dec 07 2021 at 21:47):
Ah i see. I have a name mismatch
Jose Costa Teixeira (Dec 07 2021 at 21:53):
Thanks @John Moehrke I would not have noticed that ever
John Moehrke (Dec 07 2021 at 21:54):
did you get it working?
Last updated: Apr 12 2022 at 19:14 UTC