fix various rendering issues from core spec

This commit is contained in:
Grahame Grieve 2022-02-19 21:41:50 +11:00
parent d66c5abec0
commit a1912cd423
4 changed files with 12 additions and 10 deletions

View File

@ -104,7 +104,7 @@ public class BundleRenderer extends ResourceRenderer {
xn.para().b().tx("Exception generating narrative: "+e.getMessage()); xn.para().b().tx("Exception generating narrative: "+e.getMessage());
} }
} }
root.blockquote().addChildren(xn); root.blockquote().para().addChildren(xn);
} }
} }
} }
@ -156,7 +156,7 @@ public class BundleRenderer extends ResourceRenderer {
List<BaseWrapper> sections = section.children("section"); List<BaseWrapper> sections = section.children("section");
for (BaseWrapper child : sections) { for (BaseWrapper child : sections) {
if (nested) { if (nested) {
addSection(x.blockquote(), child, level+1, true); addSection(x.blockquote().para(), child, level+1, true);
} else { } else {
addSection(x, child, level+1, true); addSection(x, child, level+1, true);
} }
@ -241,7 +241,7 @@ public class BundleRenderer extends ResourceRenderer {
List<SectionComponent> sections = section.getSection(); List<SectionComponent> sections = section.getSection();
for (SectionComponent child : sections) { for (SectionComponent child : sections) {
if (nested) { if (nested) {
addSection(x.blockquote(), child, level+1, true); addSection(x.blockquote().para(), child, level+1, true);
} else { } else {
addSection(x, child, level+1, true); addSection(x, child, level+1, true);
} }
@ -300,7 +300,7 @@ public class BundleRenderer extends ResourceRenderer {
xn = makeExceptionXhtml(e, "generating narrative"); xn = makeExceptionXhtml(e, "generating narrative");
} }
} }
root.blockquote().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes())); root.blockquote().para().getChildNodes().addAll(checkInternalLinks(b, xn.getChildNodes()));
} }
} }
} }

View File

@ -245,7 +245,7 @@ public class CodeSystemRenderer extends TerminologyRenderer {
if (cs == null) { if (cs == null) {
return false; return false;
} }
return CodeSystemUtilities.hasCode(cs, code); return code == null ? false : CodeSystemUtilities.hasCode(cs, code);
} }
return false; return false;
} }

View File

@ -223,7 +223,7 @@ public class PatientRenderer extends ResourceRenderer {
@Override @Override
public boolean render(XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException { public boolean render(XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException {
describe(x, r); describe(x.para(), r);
return false; return false;
} }
} }

View File

@ -168,11 +168,13 @@ public class QuestionnaireResponseRenderer extends ResourceRenderer {
r.getCells().add(gen.new Cell(null, context.getDefinitionsTarget() == null ? "" : context.getDefinitionsTarget()+"#item."+linkId, linkId, null, null)); r.getCells().add(gen.new Cell(null, context.getDefinitionsTarget() == null ? "" : context.getDefinitionsTarget()+"#item."+linkId, linkId, null, null));
r.getCells().add(gen.new Cell(null, null, text, null, null)); r.getCells().add(gen.new Cell(null, null, text, null, null));
r.getCells().add(gen.new Cell(null, null, null, null, null)); r.getCells().add(gen.new Cell(null, null, null, null, null));
if (answers.size() == 0) { if (answers == null || answers.size() == 0) {
r.getCells().add(gen.new Cell(null, null, null, null, null)); r.getCells().add(gen.new Cell(null, null, null, null, null));
if (items != null) {
for (BaseWrapper si : items) { for (BaseWrapper si : items) {
renderTreeItem(gen, r.getSubRows(), q, si); renderTreeItem(gen, r.getSubRows(), q, si);
} }
}
} else if (answers.size() == 1) { } else if (answers.size() == 1) {
BaseWrapper ans = answers.get(0); BaseWrapper ans = answers.get(0);
renderAnswer(gen, q, r, ans); renderAnswer(gen, q, r, ans);