diff --git a/src/Hl7.Fhir.Base/FhirPath/ElementNavFhirExtensions.cs b/src/Hl7.Fhir.Base/FhirPath/ElementNavFhirExtensions.cs index e66eb4fe7b..468bfb6f6b 100644 --- a/src/Hl7.Fhir.Base/FhirPath/ElementNavFhirExtensions.cs +++ b/src/Hl7.Fhir.Base/FhirPath/ElementNavFhirExtensions.cs @@ -283,7 +283,7 @@ internal static P.Time BoundaryTime(P.Time time, long? precision, int minutes, i "code" when input is ScopedNode sn => inParams.WithCode(code: sn.Value as string, context: sn.LocalLocation), "Coding" => inParams.WithCoding(input.ParseCoding()), "CodeableConcept" => inParams.WithCodeableConcept(input.ParseCodeableConcept()), - "System.String" => inParams.WithCode(code: input.Value as string, context: "No context available"), + "string" or "System.String" => inParams.WithCode(code: input.Value as string, context: "No context available"), _ => null, }; diff --git a/src/Hl7.FhirPath.R4.Tests/PocoTests/FhirPathTest.cs b/src/Hl7.FhirPath.R4.Tests/PocoTests/FhirPathTest.cs index d9b9f5c926..fb2810ce09 100644 --- a/src/Hl7.FhirPath.R4.Tests/PocoTests/FhirPathTest.cs +++ b/src/Hl7.FhirPath.R4.Tests/PocoTests/FhirPathTest.cs @@ -383,6 +383,12 @@ public static IEnumerable MemberOfTestData() }, "memberOf('http://hl7.org/fhir/ValueSet/observation-vitalsignresult')", true }; // memberOf with string objects + yield return new object[] { new FhirString("85353-1"), "memberOf('http://hl7.org/fhir/ValueSet/observation-vitalsignresult')", true }; + yield return new object[] { new FhirString("male"), "memberOf('http://hl7.org/fhir/ValueSet/administrative-gender')", true }; + yield return new object[] { new FhirString("female"), "memberOf('http://hl7.org/fhir/ValueSet/administrative-gender')", true }; + yield return new object[] { new FhirString("no-idea"), "memberOf('http://hl7.org/fhir/ValueSet/administrative-gender')", false }; + + // memberOf with inline string objects yield return new object[] { new FhirBoolean(), "'85353-1'.memberOf('http://hl7.org/fhir/ValueSet/observation-vitalsignresult')", true }; yield return new object[] { new FhirBoolean(), "'male'.memberOf('http://hl7.org/fhir/ValueSet/administrative-gender')", true }; yield return new object[] { new FhirBoolean(), "'female'.memberOf('http://hl7.org/fhir/ValueSet/administrative-gender')", true };