pick up resource language when generating narrative

This commit is contained in:
Grahame Grieve 2019-11-10 21:06:56 +11:00
parent f3b97771d5
commit 3524b16172
1 changed files with 3 additions and 0 deletions

View File

@ -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);