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 94a4b26c1..c6ff21760 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 @@ -3148,10 +3148,16 @@ public class ProfileUtilities extends TranslatingUtilities { private ElementDefinition getElementByName(List elements, String contentReference) { - for (ElementDefinition ed : elements) - if (ed.hasSliceName() && ("#"+ed.getSliceName()).equals(contentReference)) + for (ElementDefinition ed : elements) { + if (("#"+ed.getPath()).equals(contentReference)) { return ed; - return null; + } + if (("#"+ed.getId()).equals(contentReference)) { + return ed; + } + } + throw new Error("getElementByName: can't find "+contentReference+"in "+elements.toString()); +// return null; } private ElementDefinition getElementById(List elements, String contentReference) {