From 3524b16172b353d01e292162c7344c78ac5328ac Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sun, 10 Nov 2019 21:06:56 +1100 Subject: [PATCH] pick up resource language when generating narrative --- .../main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java index 6d492a12e..e41509d82 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/NarrativeGenerator.java @@ -2505,6 +2505,9 @@ public class NarrativeGenerator implements INarrativeGenerator { private void inject(DomainResource r, XhtmlNode x, NarrativeStatus status) { if (!x.hasAttribute("xmlns")) x.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"); + if (r.hasLanguage()) { + x.setAttribute("xml:lang", r.getLanguage()); + } if (!r.hasText() || !r.getText().hasDiv() || r.getText().getDiv().getChildNodes().isEmpty()) { r.setText(new Narrative()); r.getText().setDiv(x);