diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java index b58ff56e2..7999bf032 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/conformance/ProfileUtilities.java @@ -488,6 +488,13 @@ public class ProfileUtilities extends TranslatingUtilities { return getChildList(profile, e.getContentReference()+"."+path.substring(p.length()+1), null, diff); } else if (e.getContentReference().startsWith("#")) { return getChildList(profile, e.getContentReference().substring(1), null, diff); + } else if (e.getContentReference().contains("#")) { + String url = e.getContentReference().substring(0, e.getContentReference().indexOf("#")); + StructureDefinition sd = context.fetchResource(StructureDefinition.class, url); + if (sd == null) { + throw new DefinitionException("Unable to find Structure "+url); + } + return getChildList(sd, e.getContentReference().substring(e.getContentReference().indexOf("#")+1), null, diff); } else { return getChildList(profile, e.getContentReference(), null, diff); } diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java index 73a4c7f06..0cbc02f30 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/utils/ElementWrappers.java @@ -85,15 +85,7 @@ public class ElementWrappers { element.getNamedChildrenWithWildcard(name, elements); else element.getNamedChildren(name, elements); - if (child.hasContentReference()) { - ElementDefinitionResolution nchild = context.getProfileUtilities().resolveContentRef(structure, child); - if (nchild == null) { - throw new DefinitionException("Unable to resolve content reference "+child.getContentReference()); - } - list.add(new PropertyWrapperMetaElement(context, nchild.getSource(), nchild.getElement(), elements)); - } else { - list.add(new PropertyWrapperMetaElement(context, structure, child, elements)); - } + list.add(new PropertyWrapperMetaElement(context, structure, child, elements)); } } return list;