Skip to content

Commit

Permalink
Update external constant term
Browse files Browse the repository at this point in the history
  • Loading branch information
atuonufure committed Jan 11, 2024
1 parent 3c76e69 commit da9ca01
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fhirpathpy/engine/evaluators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand All @@ -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]

Expand Down

0 comments on commit da9ca01

Please sign in to comment.