diff --git a/fhirpathpy/engine/__init__.py b/fhirpathpy/engine/__init__.py index cf7c8c3..c6ba34f 100644 --- a/fhirpathpy/engine/__init__.py +++ b/fhirpathpy/engine/__init__.py @@ -127,7 +127,7 @@ def func(data): if node_type == "AnyAtRoot": ctx["$this"] = ctx["$this"] if "$this" in ctx else ctx["dataRoot"] - return do_eval(ctx, ctx["dataRoot"], param) + return do_eval(ctx, ctx["$this"], param) if node_type == "Identifier": if param["type"] == "TermExpression":