render multiple values for properties if they exist

This commit is contained in:
Grahame Grieve 2020-09-22 22:00:37 +10:00
parent 58b6969544
commit 278697f72b
1 changed files with 11 additions and 9 deletions

View File

@ -416,15 +416,17 @@ public class CodeSystemRenderer extends TerminologyRenderer {
for (PropertyComponent pc : properties) {
td = tr.td();
boolean first = true;
ConceptPropertyComponent pcv = CodeSystemUtilities.getProperty(c, pc.getCode());
if (pcv != null && pcv.hasValue()) {
if (first) first = false; else td.addText(", ");
if (pcv.hasValueCoding()) {
td.addText(pcv.getValueCoding().getCode());
} else if (pcv.hasValueStringType() && Utilities.isAbsoluteUrl(pcv.getValue().primitiveValue())) {
td.ah(pcv.getValue().primitiveValue()).tx(pcv.getValue().primitiveValue());
} else {
td.addText(pcv.getValue().primitiveValue());
List<ConceptPropertyComponent> pcvl = CodeSystemUtilities.getPropertyValues(c, pc.getCode());
for (ConceptPropertyComponent pcv : pcvl) {
if (pcv.hasValue()) {
if (first) first = false; else td.addText(", ");
if (pcv.hasValueCoding()) {
td.addText(pcv.getValueCoding().getCode());
} else if (pcv.hasValueStringType() && Utilities.isAbsoluteUrl(pcv.getValue().primitiveValue())) {
td.ah(pcv.getValue().primitiveValue()).tx(pcv.getValue().primitiveValue());
} else {
td.addText(pcv.getValue().primitiveValue());
}
}
}
}