From 93c7c3da68ffb6f562f87bb3e471c46f20fd23b4 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Wed, 23 Oct 2024 23:00:13 +1030 Subject: [PATCH] fix type evaluation of .item() in FHIRPath --- .../src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java index 7a63e0c59..126ee57cc 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/fhirpath/FHIRPathEngine.java @@ -3430,7 +3430,7 @@ public class FHIRPathEngine { case Item : { checkOrdered(focus, "item", exp); checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_Integer)); - return focus; + return focus.toSingleton(); } case As : { checkParamTypes(exp, exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, TypeDetails.FP_String));