From c4185492a507e0e49adb46cd010229231939a70f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 29 May 2020 15:06:45 +1000 Subject: [PATCH] fix bug rendering content references in profiles --- .../hl7/fhir/r5/conformance/ProfileUtilities.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 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 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) {