From 1df68c95a44f6f8f445c93a7e4cbfea08be15054 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Mon, 16 Jan 2023 10:13:11 +1100 Subject: [PATCH] Fix rendering when binding strength missing --- .../hl7/fhir/r5/renderers/StructureDefinitionRenderer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java index 619d5e960..32125968a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/StructureDefinitionRenderer.java @@ -382,7 +382,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { public void scanBindings(Set cols, List list, ElementDefinition ed) { if (ed.hasBinding()) { - if (ed.getBinding().hasValueSet()) { + if (ed.getBinding().hasValueSet() && ed.getBinding().hasStrength()) { switch (ed.getBinding().getStrength()) { case EXAMPLE: cols.add("example"); @@ -770,7 +770,7 @@ public class StructureDefinitionRenderer extends ResourceRenderer { List res = new ArrayList<>(); if (element.hasBinding()) { ElementDefinitionBindingComponent b = element.getBinding(); - if (type.equals(b.getStrength().toCode())) { + if (b.hasStrength() && type.equals(b.getStrength().toCode())) { ElementDefinitionBindingAdditionalComponent ab = new ElementDefinitionBindingAdditionalComponent(); res.add(ab.setAny(false).setDocumentation(b.getDescription()).setValueSet(b.getValueSet())); } @@ -990,6 +990,9 @@ public class StructureDefinitionRenderer extends ResourceRenderer { } private Row makeChoiceElementRow(HierarchicalTableGenerator gen, Row prow, ElementChoiceGroup grp, ElementDefinition parent, boolean isConstraintMode) { + if (context.getStructureMode() != StructureDefinitionRendererMode.SUMMARY) { + return prow; + } Row row = gen.new Row(); row.setAnchor(parent.getPath()+"-"+grp.getName()); row.setColor(context.getProfileUtilities().getRowColor(parent, isConstraintMode));