From 4b5ea7d4d5a71c0723195c100dff5d83aacf4a05 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 9 Dec 2020 11:10:16 +1100 Subject: [PATCH] Actually fix it this time --- .../org/hl7/fhir/r5/conformance/ProfileUtilities.java | 7 +++++++ .../hl7/fhir/r5/renderers/utils/ElementWrappers.java | 10 +--------- 2 files changed, 8 insertions(+), 9 deletions(-) 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;