Skip to content

Commit

Permalink
Update evaluate
Browse files Browse the repository at this point in the history
  • Loading branch information
atuonufure committed Jan 17, 2024
1 parent 3f5b9ab commit 64e196f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fhirpathpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from fhirpathpy.parser import parse
from fhirpathpy.engine import do_eval
from fhirpathpy.engine.util import arraify, get_data, set_paths
from fhirpathpy.engine.nodes import FP_Type
from fhirpathpy.engine.nodes import FP_Type, ResourceNode

__title__ = "fhirpathpy"
__version__ = "0.2.1"
Expand Down Expand Up @@ -72,7 +72,13 @@ def evaluate(resource, path, context={}, model=None):
int: Description of return value
"""
node = parse(path)
if isinstance(path, dict):
node = parse(path["expression"])
if "base" in path:
resource = ResourceNode.create_node(resource, path['base'])
else:
node = parse(path)

return apply_parsed_path(resource, node, context, model)


Expand Down

0 comments on commit 64e196f

Please sign in to comment.