diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java index 1817f6994..b9f3ded2a 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/BundleRenderer.java @@ -399,4 +399,14 @@ public class BundleRenderer extends ResourceRenderer { return "??"; } + public boolean canRender(Bundle b) { + for (BundleEntryComponent be : b.getEntry()) { + ResourceRenderer rr = RendererFactory.factory(be.getResource(), context); + if (!rr.canRender(be.getResource())) { + return false; + } + } + return true; + } + } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java index 124ddd4ff..4d283ca7f 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ProfileDrivenRenderer.java @@ -939,5 +939,8 @@ public class ProfileDrivenRenderer extends ResourceRenderer { return path.substring(path.lastIndexOf(".")+1); } + public boolean canRender(Resource resource) { + return context.getWorker().getResourceNames().contains(resource.fhirType()); + } } \ No newline at end of file diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java index deb2b4a38..62d148a63 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/ResourceRenderer.java @@ -366,4 +366,8 @@ public abstract class ResourceRenderer extends DataRenderer { return fullUrl.replace(":", "-"); } + public boolean canRender(Resource resource) { + return true; + } + } \ No newline at end of file