diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/ExpressionNode.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/ExpressionNode.java index 49f66e8fc..60f842147 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/ExpressionNode.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/model/ExpressionNode.java @@ -389,7 +389,9 @@ public class ExpressionNode { b.append(")"); } if (inner != null) { - b.append("."); + if (!((ExpressionNode.Kind.Function == inner.getKind()) && (ExpressionNode.Function.Item == inner.getFunction()))) { + b.append("."); + } b.append(inner.toString()); } if (operation != null) { diff --git a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java index b8a9c1cca..1f6a38c6d 100644 --- a/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java +++ b/org.hl7.fhir.r4/src/main/java/org/hl7/fhir/r4/utils/FHIRPathEngine.java @@ -1080,6 +1080,7 @@ public class FHIRPathEngine { case Lower: return checkParamCount(lexer, location, exp, 0); case Upper: return checkParamCount(lexer, location, exp, 0); case ToChars: return checkParamCount(lexer, location, exp, 0); + case IndexOf : return checkParamCount(lexer, location, exp, 1); case Substring: return checkParamCount(lexer, location, exp, 1, 2); case StartsWith: return checkParamCount(lexer, location, exp, 1); case EndsWith: return checkParamCount(lexer, location, exp, 1); diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExpressionNode.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExpressionNode.java index ad872b3fd..46cde7c49 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExpressionNode.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/ExpressionNode.java @@ -390,7 +390,9 @@ public class ExpressionNode { b.append(")"); } if (inner != null) { - b.append("."); + if (!((ExpressionNode.Kind.Function == inner.getKind()) && (ExpressionNode.Function.Item == inner.getFunction()))) { + b.append("."); + } b.append(inner.toString()); } if (operation != null) {