diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java index cf570ac85..539846276 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/utils/FHIRPathEngine.java @@ -4151,7 +4151,6 @@ public class FHIRPathEngine { String param = nl.get(0).primitiveValue(); List result = new ArrayList(); - if (focus.size() == 1) { String cnt = focus.get(0).primitiveValue(); if ("hex".equals(param)) { @@ -4164,7 +4163,6 @@ public class FHIRPathEngine { result.add(new StringType(new String(enc.decode(cnt)))); } } - return result; } diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java index 4e9b9139a..efabcca85 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/instance/InstanceValidator.java @@ -2037,10 +2037,18 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat } } else if (ctxt.getType() == ExtensionContextType.EXTENSION) { contexts.append("x:" + ctxt.getExpression()); - String ext = stack.getElement().getNamedChildValue("url"); + String ext = null; + if (stack.getElement().getName().startsWith("value")) { + NodeStack estack = stack.getParent(); + if (estack != null && estack.getElement().fhirType().equals("Extension")) { + ext = estack.getElement().getNamedChildValue("url"); + } + } else { + ext = stack.getElement().getNamedChildValue("url"); + } if (ctxt.getExpression().equals(ext)) { ok = true; - } else { + } else if (ext != null) { plist.add(ext); } } else if (ctxt.getType() == ExtensionContextType.FHIRPATH) {