From da9ca0119b151153dc98d5098a88ffc65efb25d2 Mon Sep 17 00:00:00 2001 From: atuonufure Date: Thu, 11 Jan 2024 02:20:29 +0100 Subject: [PATCH] Update external constant term --- fhirpathpy/engine/evaluators/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fhirpathpy/engine/evaluators/__init__.py b/fhirpathpy/engine/evaluators/__init__.py index cafa18c..431e36a 100644 --- a/fhirpathpy/engine/evaluators/__init__.py +++ b/fhirpathpy/engine/evaluators/__init__.py @@ -100,11 +100,10 @@ def literal_term(ctx, parentData, node): return [node["text"]] -# TODO def external_constant_term(ctx, parent_data, node): ext_constant = node["children"][0] ext_identifier = ext_constant["children"][0] - varName = identifier(ctx, parent_data, ext_identifier)[0] + varName = identifier(ctx, parent_data, ext_identifier)[0].replace("`", "") if not varName in ctx["vars"]: return [] @@ -114,6 +113,9 @@ def external_constant_term(ctx, parent_data, node): # For convenience, we all variable values to be passed in without their array # wrapper. However, when evaluating, we need to put the array back in. + if value is None: + return [] + if not isinstance(value, list): return [value]