Fix narrative generator generating duplicate anchors (prefix 'hc')
This commit is contained in:
parent
635ac6f109
commit
045718d582
|
@ -110,6 +110,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
|
|||
p.b().tx("Generated Narrative: "+r.fhirType()+(context.isContained() ? " #"+r.getId() : ""));
|
||||
if (!Utilities.noString(r.getId())) {
|
||||
p.an(r.getId());
|
||||
p.an("hc"+r.getId());
|
||||
}
|
||||
idDone = true;
|
||||
}
|
||||
|
@ -119,6 +120,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
|
|||
}
|
||||
if (!Utilities.noString(r.getId()) && !idDone) {
|
||||
x.para().an(r.getId());
|
||||
x.para().an("hc"+r.getId());
|
||||
}
|
||||
try {
|
||||
StructureDefinition sd = r.getDefinition();
|
||||
|
@ -479,7 +481,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
|
|||
Reference r = (Reference) e;
|
||||
if (r.getReference() != null && r.getReference().contains("#")) {
|
||||
if (containedIds.contains(r.getReference().substring(1))) {
|
||||
x.ah(r.getReference()).tx("See "+r.getReference());
|
||||
x.ah("#hc"+r.getReference().substring(1)).tx("See "+r.getReference());
|
||||
} else {
|
||||
// in this case, we render the resource in line
|
||||
ResourceWrapper rw = null;
|
||||
|
@ -493,7 +495,7 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
|
|||
} else {
|
||||
String ref = context.getResolver() != null ?context.getResolver().urlForContained(context, res.fhirType(), res.getId(), rw.fhirType(), rw.getId()) : null;
|
||||
if (ref == null) {
|
||||
x.an(rw.getId());
|
||||
x.an("hc"+rw.getId());
|
||||
RenderingContext ctxtc = context.copy();
|
||||
ctxtc.setAddGeneratedNarrativeHeader(false);
|
||||
ctxtc.setContained(true);
|
||||
|
|
|
@ -361,8 +361,10 @@ public abstract class ResourceRenderer extends DataRenderer {
|
|||
} else {
|
||||
c = x.ah(r.getReference());
|
||||
}
|
||||
} else if ("#".equals(r.getReference())) {
|
||||
c = x.ah("#");
|
||||
} else {
|
||||
c = x.ah(r.getReference());
|
||||
c = x.ah("#hc"+r.getReference().substring(1));
|
||||
}
|
||||
} else {
|
||||
c = x.span(null, null);
|
||||
|
@ -610,7 +612,7 @@ public abstract class ResourceRenderer extends DataRenderer {
|
|||
|
||||
String id = getPrimitiveValue(r, "id");
|
||||
if (doId) {
|
||||
div.an(id);
|
||||
div.an("hc"+id);
|
||||
}
|
||||
|
||||
String lang = getPrimitiveValue(r, "language");
|
||||
|
|
|
@ -198,6 +198,14 @@ public abstract class XhtmlFluent {
|
|||
}
|
||||
}
|
||||
|
||||
public XhtmlNode imgT(String src, String alt) {
|
||||
if (alt == null) {
|
||||
return addTag("img").attribute("src", src).attribute("alt", ".");
|
||||
} else {
|
||||
return addTag("img").attribute("src", src).attribute("alt", alt).attribute("title", alt);
|
||||
}
|
||||
}
|
||||
|
||||
public XhtmlNode img(String src, String alt, String title) {
|
||||
return addTag("img").attribute("src", src).attribute("alt", alt).attribute("title", title);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue