Fix narrative generation issue
This commit is contained in:
parent
056e41d19d
commit
ba2ff9390d
|
@ -104,14 +104,19 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
|
|||
|
||||
@Override
|
||||
public boolean render(XhtmlNode x, ResourceWrapper r) throws FHIRFormatError, DefinitionException, IOException {
|
||||
boolean idDone = false;
|
||||
XhtmlNode p = x.para();
|
||||
if (context.isAddGeneratedNarrativeHeader()) {
|
||||
x.para().b().tx("Generated Narrative: "+r.fhirType());
|
||||
}
|
||||
if (!Utilities.noString(r.getId())) {
|
||||
x.an(r.getId());
|
||||
p.b().tx("Generated Narrative: "+r.fhirType());
|
||||
p.an(r.getId());
|
||||
idDone = true;
|
||||
}
|
||||
if (context.isTechnicalMode() && !context.isContained()) {
|
||||
renderResourceHeader(r, x);
|
||||
renderResourceHeader(r, x, !idDone);
|
||||
idDone = true;
|
||||
}
|
||||
if (!Utilities.noString(r.getId()) && !idDone) {
|
||||
x.para().an(r.getId());
|
||||
}
|
||||
try {
|
||||
StructureDefinition sd = r.getDefinition();
|
||||
|
|
|
@ -398,12 +398,16 @@ public abstract class ResourceRenderer extends DataRenderer {
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void renderResourceHeader(ResourceWrapper r, XhtmlNode x) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
protected void renderResourceHeader(ResourceWrapper r, XhtmlNode x, boolean doId) throws UnsupportedEncodingException, FHIRException, IOException {
|
||||
XhtmlNode div = x.div().style("display: inline-block").style("background-color: #d9e0e7").style("padding: 6px")
|
||||
.style("margin: 4px").style("border: 1px solid #8da1b4")
|
||||
.style("border-radius: 5px").style("line-height: 60%");
|
||||
|
||||
String id = getPrimitiveValue(r, "id");
|
||||
if (doId) {
|
||||
div.an(id);
|
||||
}
|
||||
|
||||
String lang = getPrimitiveValue(r, "language");
|
||||
String ir = getPrimitiveValue(r, "implicitRules");
|
||||
BaseWrapper meta = r.getChildByName("meta").hasValues() ? r.getChildByName("meta").getValues().get(0) : null;
|
||||
|
|
Loading…
Reference in New Issue