fix for rendering bundles on ElementModels

This commit is contained in:
Grahame Grieve 2020-12-09 10:11:06 +11:00
parent 8a6b797c92
commit 0cf371c657
2 changed files with 6 additions and 2 deletions

View File

@ -6486,4 +6486,8 @@ public class ProfileUtilities extends TranslatingUtilities {
return "true".equals(ToolingExtensions.readStringExtension(profile, ToolingExtensions.EXT_MUST_SUPPORT));
}
public ElementDefinitionResolution resolveContentRef(StructureDefinition structure, ElementDefinition element) {
return getElementById(structure, structure.getSnapshot().getElement(), element.getContentReference());
}
}

View File

@ -119,7 +119,7 @@ public class BundleRenderer extends ResourceRenderer {
// * The subject resource Narrative
// * The Composition resource Narrative
// * The section.text Narratives
ResourceWrapper comp = (ResourceWrapper) entries.get(0).getChildByName("resource").getValues().get(0);
ResourceWrapper comp = (ResourceWrapper) entries.get(0).getChildByName("resource").getAsResource();
ResourceWrapper subject = resolveReference(entries, comp.get("subject"));
if (subject != null) {
if (subject.hasNarrative()) {
@ -175,7 +175,7 @@ public class BundleRenderer extends ResourceRenderer {
if (entry.has("fullUrl")) {
String fu = entry.get("fullUrl").primitiveValue();
if (ref.equals(fu)) {
return (ResourceWrapper) entry.getChildByName("resource").getValues().get(0);
return (ResourceWrapper) entry.getChildByName("resource").getAsResource();
}
}
}