Fix for NPEs

This commit is contained in:
Grahame Grieve 2023-05-22 17:15:44 +10:00
parent 30290b9567
commit 7339d0ae1d
3 changed files with 18 additions and 5 deletions

View File

@ -113,6 +113,9 @@ public class Manager {
}
public static ParserBase makeParser(IWorkerContext context, FhirFormat format) {
if (format == null) {
throw new Error("Programming logic error: no format known");
}
switch (format) {
case JSON : return new JsonParser(context);
case XML : return new XmlParser(context);

View File

@ -1413,12 +1413,17 @@ public class ElementDefinition extends BackboneType implements ICompositeType {
, ordered, rules);
}
public String fhirType() {
return "ElementDefinition.slicing";
public String fhirType() {
return "ElementDefinition.slicing";
}
}
}
@Override
public String toString() {
return (ordered == null ? "??" : "true".equals(ordered.asStringValue()) ? "ordered" : "unordered")+"/"+
(rules == null ? "??" : rules.asStringValue())+" "+discriminator.toString();
}
}
@Block()
public static class ElementDefinitionSlicingDiscriminatorComponent extends Element implements IBaseDatatypeElement {
@ -1671,6 +1676,11 @@ public class ElementDefinition extends BackboneType implements ICompositeType {
}
@Override
public String toString() {
return (type == null ? "??" : type.getCode()) + "="+(path == null ? "??" : path.asStringValue());
}
}
@Block()

View File

@ -167,7 +167,7 @@ public class ElementWrappers {
Property family = b.getChildByName("family");
Property given = wrapped.getChildByName("given");
String s = given != null && given.hasValues() ? given.getValues().get(0).primitiveValue() : "";
if (family != null && family.hasValues())
if (family != null && family.hasValues() && family.getValues().get(0).primitiveValue() != null)
s = s + " " + family.getValues().get(0).primitiveValue().toUpperCase();
return s;
} else {