Fix NPE rendering code systems with some kinds of properties

This commit is contained in:
Grahame Grieve 2021-06-15 08:49:08 +10:00
parent 435e0261e0
commit 7d512d6ed0
2 changed files with 4 additions and 1 deletions

View File

@ -256,7 +256,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer {
if (cs == null) { if (cs == null) {
return null; return null;
} }
ConceptDefinitionComponent cc = CodeSystemUtilities.getCode(cs, code); ConceptDefinitionComponent cc = code == null ? null : CodeSystemUtilities.getCode(cs, code);
return cc == null ? null : cc.getDisplay(); return cc == null ? null : cc.getDisplay();
} }

View File

@ -430,6 +430,9 @@ public class CodeSystemUtilities {
} }
public static ConceptDefinitionComponent getCode(CodeSystem cs, String code) { public static ConceptDefinitionComponent getCode(CodeSystem cs, String code) {
if (code == null) {
return null;
}
for (ConceptDefinitionComponent cc : cs.getConcept()) { for (ConceptDefinitionComponent cc : cs.getConcept()) {
ConceptDefinitionComponent cd = getCode(cc, code); ConceptDefinitionComponent cd = getCode(cc, code);
if (cd != null) { if (cd != null) {