Merge pull request #1591 from hapifhir/2024-04-gg-bundle-links
update to bundle rendering to fix broken links
This commit is contained in:
commit
92cf25588d
|
@ -84,9 +84,11 @@ public class BundleRenderer extends ResourceRenderer {
|
||||||
if (be.has("resource")) {
|
if (be.has("resource")) {
|
||||||
if (be.getChildByName("resource").getValues().get(0).has("id")) {
|
if (be.getChildByName("resource").getValues().get(0).has("id")) {
|
||||||
root.an(be.get("resource").fhirType() + "_" + be.getChildByName("resource").getValues().get(0).get("id").primitiveValue());
|
root.an(be.get("resource").fhirType() + "_" + be.getChildByName("resource").getValues().get(0).get("id").primitiveValue());
|
||||||
|
root.an("hc"+be.get("resource").fhirType() + "_" + be.getChildByName("resource").getValues().get(0).get("id").primitiveValue());
|
||||||
} else {
|
} else {
|
||||||
String id = makeIdFromBundleEntry(be.get("fullUrl").primitiveValue());
|
String id = makeIdFromBundleEntry(be.get("fullUrl").primitiveValue());
|
||||||
root.an(be.get("resource").fhirType() + "_" + id);
|
root.an(be.get("resource").fhirType() + "_" + id);
|
||||||
|
root.an("hc"+be.get("resource").fhirType() + "_" + id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
root.hr();
|
root.hr();
|
||||||
|
@ -305,9 +307,11 @@ public class BundleRenderer extends ResourceRenderer {
|
||||||
if (be.hasResource()) {
|
if (be.hasResource()) {
|
||||||
if (be.getResource().hasId()) {
|
if (be.getResource().hasId()) {
|
||||||
x.an(be.getResource().getResourceType().name() + "_" + be.getResource().getId());
|
x.an(be.getResource().getResourceType().name() + "_" + be.getResource().getId());
|
||||||
|
x.an("hc"+be.getResource().getResourceType().name() + "_" + be.getResource().getId());
|
||||||
} else {
|
} else {
|
||||||
String id = makeIdFromBundleEntry(be.getFullUrl());
|
String id = makeIdFromBundleEntry(be.getFullUrl());
|
||||||
x.an(be.getResource().getResourceType().name() + "_" + id);
|
x.an(be.getResource().getResourceType().name() + "_" + id);
|
||||||
|
x.an("hc"+be.getResource().getResourceType().name() + "_" + id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x.hr();
|
x.hr();
|
||||||
|
|
|
@ -380,7 +380,7 @@ public abstract class ResourceRenderer extends DataRenderer {
|
||||||
if (tr.getReference().startsWith("#")) {
|
if (tr.getReference().startsWith("#")) {
|
||||||
onPage = true;
|
onPage = true;
|
||||||
if (context.getRules() == GenerationRules.IG_PUBLISHER || (tr != null && tr.getKind() != ResourceReferenceKind.BUNDLE)) {
|
if (context.getRules() == GenerationRules.IG_PUBLISHER || (tr != null && tr.getKind() != ResourceReferenceKind.BUNDLE)) {
|
||||||
c = x.ah("#hc"+r.getReference().substring(1));
|
c = x.ah("#hc"+tr.getReference().substring(1));
|
||||||
} else {
|
} else {
|
||||||
c = x;
|
c = x;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue