Skip to content

Commit

Permalink
WIP: Use model for is_fn
Browse files Browse the repository at this point in the history
  • Loading branch information
projkov committed Dec 22, 2023
1 parent 3441034 commit c99db9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fhirpathpy/engine/invocations/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ def type_fn(ctx, coll):


def is_fn(ctx, coll, type_info):
# TODO: It's incorrect place to setup model. Fix it.
TypeInfo.model = ctx.get("model")
if not coll:
return []
if len(coll) > 1:
Expand Down
2 changes: 1 addition & 1 deletion fhirpathpy/engine/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def is_type(type_name, super_type):
while type_name:
if type_name == super_type:
return True
type_name = TypeInfo.model.type2Parent.get(type_name)
type_name = TypeInfo.model.get("type2Parent").get(type_name)
return False

def is_(self, other):
Expand Down

0 comments on commit c99db9c

Please sign in to comment.