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 4b2babf89..db365675c 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 @@ -1841,7 +1841,7 @@ public class DataRenderer extends Renderer implements CodeResolver { else x.tx("?"); if (q.has("low") && q.child("low").has("unit")) - x.tx(" "+q.child("low").child("unit")); + x.tx(" "+q.child("low").primitiveValue("unit")); } public String displayPeriod(ResourceWrapper p) { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java index a3187026a..3a8faa241 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DiagnosticReportRenderer.java @@ -149,13 +149,13 @@ public class DiagnosticReportRenderer extends ResourceRenderer { if (r == null) container.tx(context.formatPhrase(RenderingContext.DIAG_REP_REND_UNABLE)); else if (r.getResource().fhirType().equals("Patient")) - generatePatientSummary(container, r.getResource()); + generatePatientSummary(status, container, r.getResource()); else container.tx(context.formatPhrase(RenderingContext.GENERAL_TODO)); } - private void generatePatientSummary(XhtmlNode c, ResourceWrapper r) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome { - new PatientRenderer(context).describe(c, r); + private void generatePatientSummary(RenderingStatus status, XhtmlNode c, ResourceWrapper r) throws FHIRFormatError, DefinitionException, FHIRException, IOException, EOperationOutcome { + new PatientRenderer(context).buildSummary(status, c, r); } private List fetchObservations(List list) throws UnsupportedEncodingException, FHIRException, IOException { diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java index 4241bdadb..033f42145 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java @@ -150,6 +150,9 @@ public abstract class ResourceRenderer extends DataRenderer { public abstract void buildNarrative(RenderingStatus status, XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException, FHIRException, EOperationOutcome; public abstract String buildSummary(ResourceWrapper r) throws UnsupportedEncodingException, IOException; + public void buildSummary(RenderingStatus status, XhtmlNode x, ResourceWrapper r) throws UnsupportedEncodingException, IOException { + x.tx(buildSummary(r)); + } public String canonicalTitle(ResourceWrapper r) { if (r.has("title")) { @@ -870,7 +873,7 @@ public abstract class ResourceRenderer extends DataRenderer { boolean sfirst = true; p = plateStyle(div.para()); if (versionId != null) { - p.tx(context.formatPhrase(RenderingContext.RES_REND_VER, versionId)); + p.tx(context.formatPhrase(RenderingContext.RES_REND_VER, versionId.primitiveValue())); sfirst = false; } if (lastUpdated != null) { diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java index f91e98801..a68dbe688 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xml/XMLUtil.java @@ -545,6 +545,14 @@ public class XMLUtil { return res; } + public static Element addChild(Document doc, Element element, String name, String namespace, int indent) { + Node node = doc.createTextNode("\n"+Utilities.padLeft("", ' ', indent)); + Element child = doc.createElementNS(namespace, name); + element.appendChild(child); + element.appendChild(node); + return child; + } + public static Element insertChild(Document doc, Element element, String name, String namespace, int indent) { Node node = doc.createTextNode("\n"+Utilities.padLeft("", ' ', indent)); Element child = doc.createElementNS(namespace, name); diff --git a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache index 509af9203..ee1b35490 100644 --- a/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache +++ b/org.hl7.fhir.validation/src/test/resources/txCache/org.hl7.fhir.validation/4.0.1/loinc.cache @@ -7545,6 +7545,52 @@ v: { "system" : "http://loinc.org", "version" : "2.77", "server" : "http://tx-dev.fhir.org/r4", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "58410-2", + "display" : "CBC panel - Blood by Automated count" +}, "valueSet" :null, "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "CBC panel - Blood by Automated count", + "code" : "58410-2", + "system" : "http://loinc.org", + "version" : "2.77", + "server" : "http://tx-dev.fhir.org/r4", + "unknown-systems" : "", + "issues" : { + "resourceType" : "OperationOutcome" +} + +} +------------------------------------------------------------------------------------- +{"code" : { + "system" : "http://loinc.org", + "code" : "58410-2" +}, "url": "http://hl7.org/fhir/ValueSet/report-codes--0", "version": "4.0.1", "langs":"", "useServer":"true", "useClient":"false", "guessSystem":"false", "activeOnly":"false", "membershipOnly":"false", "displayWarningMode":"false", "versionFlexible":"false", "profile": { + "resourceType" : "Parameters", + "parameter" : [{ + "name" : "profile-url", + "valueString" : "http://hl7.org/fhir/ExpansionProfile/dc8fd4bc-091a-424a-8a3b-6198ef146891" + }] +}}#### +v: { + "display" : "CBC panel - Blood by Automated count", + "code" : "58410-2", + "system" : "http://loinc.org", + "version" : "2.77", + "server" : "http://tx-dev.fhir.org/r4", "unknown-systems" : "", "issues" : { "resourceType" : "OperationOutcome"