Skip to content

Commit

Permalink
Use constant name different from module name for fhirpath fn registry
Browse files Browse the repository at this point in the history
  • Loading branch information
m0rl committed Feb 10, 2024
1 parent 5102f22 commit c4f3aae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions fhirpathpy/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import fhirpathpy.engine.util as util
from fhirpathpy.engine.nodes import TypeInfo
from fhirpathpy.engine.evaluators import evaluators
from fhirpathpy.engine.invocations import invocations
from fhirpathpy.engine.invocations import invocation_registry


def check_integer_param(val):
Expand Down Expand Up @@ -48,10 +48,10 @@ def doInvoke(ctx, fn_name, data, raw_params):
if isinstance(fn_name, list) and len(fn_name) == 1:
fn_name = fn_name[0]

if type(fn_name) != str or not fn_name in invocations:
if type(fn_name) != str or not fn_name in invocation_registry:
raise Exception("Not implemented: " + str(fn_name))

invocation = invocations[fn_name]
invocation = invocation_registry[fn_name]

if "nullable_input" in invocation and util.is_nullable(data):
return []
Expand Down Expand Up @@ -167,10 +167,10 @@ def func(data):


def infix_invoke(ctx, fn_name, data, raw_params):
if not fn_name in invocations or not "fn" in invocations[fn_name]:
if not fn_name in invocation_registry or not "fn" in invocation_registry[fn_name]:
raise Exception("Not implemented " + fn_name)

invocation = invocations[fn_name]
invocation = invocation_registry[fn_name]
paramsNumber = len(raw_params)

if paramsNumber != 2:
Expand Down
2 changes: 1 addition & 1 deletion fhirpathpy/engine/invocations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import fhirpathpy.engine.invocations.aggregate as aggregate
from fhirpathpy.engine.nodes import FP_DateTime, FP_Quantity, FP_Time

invocations = {
invocation_registry = {
"empty": {"fn": existence.empty_fn},
"not": {"fn": existence.not_fn},
"exists": {"fn": existence.exists_macro, "arity": {0: [], 1: ["Expr"]}},
Expand Down

0 comments on commit c4f3aae

Please sign in to comment.