Fix for bundle renderer trying to render resources from the wrong version

This commit is contained in:
Grahame Grieve 2020-11-27 10:36:39 +11:00
parent 3687734828
commit c4a396546a
3 changed files with 17 additions and 0 deletions

View File

@ -399,4 +399,14 @@ public class BundleRenderer extends ResourceRenderer {
return "??"; 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;
}
} }

View File

@ -939,5 +939,8 @@ public class ProfileDrivenRenderer extends ResourceRenderer {
return path.substring(path.lastIndexOf(".")+1); return path.substring(path.lastIndexOf(".")+1);
} }
public boolean canRender(Resource resource) {
return context.getWorker().getResourceNames().contains(resource.fhirType());
}
} }

View File

@ -366,4 +366,8 @@ public abstract class ResourceRenderer extends DataRenderer {
return fullUrl.replace(":", "-"); return fullUrl.replace(":", "-");
} }
public boolean canRender(Resource resource) {
return true;
}
} }