From 4e602b07e93569992772dbe0f81747d15da07aba Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 11 Nov 2020 10:04:47 +1100 Subject: [PATCH] fix problem rendering multiple manifestations for an allergy reaction --- .../org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java | 5 ++++- .../main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java index 12235debe..124ddd4ff 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java @@ -824,7 +824,10 @@ public class ProfileDrivenRenderer extends ResourceRenderer { if (p == null || p.getValues().size() == 0 || p.getValues().get(0) == null) td.tx(" "); else { - renderLeaf(res, p.getValues().get(0), e, td, td, false, showCodeDetails, displayHints, path, indent); + for (BaseWrapper vv : p.getValues()) { + td.sep(", "); + renderLeaf(res, vv, e, td, td, false, showCodeDetails, displayHints, path, indent); + } } } } diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java index 32a8bbf02..d48e436f9 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlNode.java @@ -843,11 +843,11 @@ public class XhtmlNode implements IBaseXhtml { public XhtmlNode sep(String separator) { - // if there's already text, add the separator - if (seperated) { + // if there's already text, add the separator. otherwise, we'll add it next time + if (!seperated) { + seperated = true; return this; } - seperated = true; return tx(separator); }