fix bug in renderer rendering R3 resources

This commit is contained in:
Grahame Grieve 2021-11-22 21:30:34 +11:00
parent 83c8228f29
commit 7cc9c59bf9
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
Validator:
* no changes
Other code changes
* fix bug in renderer rendering R3 resources

View File

@ -473,10 +473,10 @@ public abstract class ResourceRenderer extends DataRenderer {
}
private String getPrimitiveValue(BaseWrapper b, String name) throws UnsupportedEncodingException, FHIRException, IOException {
return b != null && b.getChildByName(name).hasValues() ? b.getChildByName(name).getValues().get(0).getBase().primitiveValue() : null;
return b != null && b.has(name) && b.getChildByName(name).hasValues() ? b.getChildByName(name).getValues().get(0).getBase().primitiveValue() : null;
}
private String getPrimitiveValue(ResourceWrapper r, String name) throws UnsupportedEncodingException, FHIRException, IOException {
return r.getChildByName(name).hasValues() ? r.getChildByName(name).getValues().get(0).getBase().primitiveValue() : null;
return r.has(name) && r.getChildByName(name).hasValues() ? r.getChildByName(name).getValues().get(0).getBase().primitiveValue() : null;
}
}