From a85adcf88d26905e9843eeb4874dd5adb14b0c40 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 24 Jun 2020 17:27:08 +1000 Subject: [PATCH] enhancements to questionnaire renderer --- .../fhir/r5/renderers/QuestionnaireRenderer.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java index da40e77f2..ade9d92f1 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/QuestionnaireRenderer.java @@ -136,8 +136,19 @@ public class QuestionnaireRenderer extends TerminologyRenderer { } if (i.hasEnableWhen()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br")); - defn.getPieces().add(gen.new Piece(null, "Enable When: ", null)); - defn.getPieces().add(gen.new Piece(null, "todo", null)); + Piece p = gen.new Piece(null, "Enable When: ", null); + defn.getPieces().add(p); + if (i.getEnableWhen().size() == 0) { + XhtmlNode x = new XhtmlNode(NodeType.Element, "span"); + p.getChildren().add(x); + renderEnableWhen(x, i.getEnableWhenFirstRep()); + } else { + XhtmlNode x = new XhtmlNode(NodeType.Element, "ul"); + p.getChildren().add(x); + for (QuestionnaireItemEnableWhenComponent qi : i.getEnableWhen()) { + renderEnableWhen(x.li(), qi); + } + } } if (i.hasAnswerValueSet()) { if (!defn.getPieces().isEmpty()) defn.addPiece(gen.new Piece("br"));