From de3ec0d27b8169767cc7562834c38c4c0732124a Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 14 Feb 2023 12:34:19 +1100 Subject: [PATCH] fix npe + render OperationDefinition parameter standards status --- .../r5/conformance/AdditionalBindingsRenderer.java | 2 +- .../r5/renderers/OperationDefinitionRenderer.java | 13 +++++++++++-- .../hl7/fhir/r5/renderers/TerminologyRenderer.java | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/AdditionalBindingsRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/AdditionalBindingsRenderer.java index 31dba831d..26aeb0a33 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/AdditionalBindingsRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/AdditionalBindingsRenderer.java @@ -320,7 +320,7 @@ public class AdditionalBindingsRenderer { } private void renderPurpose(XhtmlNode td, String purpose) { - boolean r5 = context.getWorker() == null ? false : VersionUtilities.isR5Plus(context.getWorker().getVersion()); + boolean r5 = context == null || context.getWorker() == null ? false : VersionUtilities.isR5Plus(context.getWorker().getVersion()); switch (purpose) { case "maximum": td.ah(r5 ? "valueset-additional-binding-purpose.html#additional-binding-purpose-maximum" : corePath+"extension-elementdefinition-maxvalueset.html", "A required binding, for use when the binding strength is 'extensible' or 'preferred'").tx("Max Binding"); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java index 2563b0750..ec540c8a9 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/OperationDefinitionRenderer.java @@ -15,6 +15,7 @@ import org.hl7.fhir.r5.renderers.utils.RenderingContext.KnownLinkType; import org.hl7.fhir.r5.renderers.utils.Resolver.ResourceContext; import org.hl7.fhir.r5.utils.EOperationOutcome; import org.hl7.fhir.r5.utils.ToolingExtensions; +import org.hl7.fhir.utilities.StandardsStatus; import org.hl7.fhir.utilities.Utilities; import org.hl7.fhir.utilities.xhtml.XhtmlNode; @@ -102,9 +103,17 @@ public class OperationDefinitionRenderer extends TerminologyRenderer { XhtmlNode tr; tr = tbl.tr(); tr.td().addText(p.getUse().toString()); - tr.td().addText(path+p.getName()); - tr.td().addText(Integer.toString(p.getMin())+".."+p.getMax()); XhtmlNode td = tr.td(); + td.addText(path+p.getName()); + StandardsStatus ss = ToolingExtensions.getStandardsStatus(p); + if (ss != null) { + td.tx(" "); + XhtmlNode a = td.ah("versions.html#std-process", "Standards Status = "+ss.toDisplay()); + a.style("padding-left: 3px; padding-right: 3px; border: 1px grey solid; font-weight: bold; color: black; background-color: "+ss.getColor()); + a.tx(ss.getAbbrev()); + } + tr.td().addText(Integer.toString(p.getMin())+".."+p.getMax()); + td = tr.td(); StructureDefinition sd = p.getType() != null ? context.getWorker().fetchTypeDefinition(p.getType().toCode()) : null; if (sd == null) td.tx(p.hasType() ? p.getType().toCode() : ""); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java index b71e465c6..d20c7b2a7 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/TerminologyRenderer.java @@ -293,7 +293,7 @@ public abstract class TerminologyRenderer extends ResourceRenderer { ref = context.fixReference(ref); XhtmlNode a = li.ah(ref == null ? "?ngen-11?" : ref.replace("\\", "/")); - a.addText(value); + a.addText(vs.present()); } else { CodeSystem cs = getContext().getWorker().fetchCodeSystem(value); if (cs != null) {