From ccfd715a5a2663253d825112f089b844eac1234f Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Sat, 29 Jan 2022 09:17:29 +1100 Subject: [PATCH] fix problem validating extension context on choice types --- .../org/hl7/fhir/validation/instance/utils/NodeStack.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/NodeStack.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/NodeStack.java index f1d0cc8f4..21348ee50 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/NodeStack.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/utils/NodeStack.java @@ -119,7 +119,7 @@ public class NodeStack { } res.logicalPaths = new ArrayList(); if (type != null) { - // type will be bull if we on a stitching point of a contained resource, or if.... + // type will be null if we on a stitching point of a contained resource, or if.... res.type = type; String tn = res.type.getPath(); String t = tail(definition.getPath()); @@ -128,8 +128,10 @@ public class NodeStack { } for (String lp : getLogicalPaths()) { res.logicalPaths.add(lp + "." + t); - if (t.endsWith("[x]")) + if (t.endsWith("[x]")) { + res.logicalPaths.add(lp + "." + t.substring(0, t.length() - 3) + ".ofType("+type.getPath()+")"); res.logicalPaths.add(lp + "." + t.substring(0, t.length() - 3) + type.getPath()); + } } res.logicalPaths.add(tn); } else if (definition != null) {