From cec6425a7f4e2daa6e5f0c843ca96c9c953de9b4 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 11 Nov 2023 08:26:18 +1100 Subject: [PATCH] Add rendering of II.system --- .../java/org/hl7/fhir/r5/renderers/DataRenderer.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index 2627640dd..fc18c91fb 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -19,6 +19,7 @@ import java.util.List; import org.hl7.fhir.exceptions.DefinitionException; import org.hl7.fhir.exceptions.FHIRException; import org.hl7.fhir.exceptions.FHIRFormatError; +import org.hl7.fhir.r5.context.ContextUtilities; import org.hl7.fhir.r5.context.IWorkerContext; import org.hl7.fhir.r5.context.IWorkerContext.ValidationResult; import org.hl7.fhir.r5.model.Address; @@ -53,6 +54,7 @@ import org.hl7.fhir.r5.model.IdType; import org.hl7.fhir.r5.model.Identifier; import org.hl7.fhir.r5.model.MarkdownType; import org.hl7.fhir.r5.model.Money; +import org.hl7.fhir.r5.model.NamingSystem; import org.hl7.fhir.r5.model.Period; import org.hl7.fhir.r5.model.PrimitiveType; import org.hl7.fhir.r5.model.Quantity; @@ -1198,7 +1200,14 @@ public class DataRenderer extends Renderer implements CodeResolver { private String displayIdentifier(Identifier ii) { String s = Utilities.noString(ii.getValue()) ? "?ngen-9?" : ii.getValue(); - + NamingSystem ns = context.getContext().getNSUrlMap().get(ii.getSystem()); + if (ns != null) { + if (ns.hasWebPath()) { + s = ""+ns.present()+"#"+s; + } else { + s = ns.present()+"#"+s; + } + } if (ii.hasType()) { if (ii.getType().hasText()) s = ii.getType().getText()+":\u00A0"+s;