Skip to content

Commit

Permalink
set rulebase to add not applicable message to empty list after fliter…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
weilixu committed Aug 2, 2024
1 parent d3225f8 commit 42f6166
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rct229/rule_engine/rule_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,17 @@ def evaluate(self, rmds, data={}):
# Evaluate the actual rule check
result = self.rule_check(context, calc_vals, data)
if isinstance(result, list):
# The result is a list of outcomes
outcome["result"] = result
if len(result) == 0:
# empty list:
outcome["result"] = RCTOutcomeLabel.NOT_APPLICABLE
not_applicable_msg = self.get_not_applicable_msg(
context, data
)
if not_applicable_msg:
outcome["message"] = not_applicable_msg
# The result is a list of outcomes
else:
outcome["result"] = result
# using is False to include the None case.
elif self.is_primary_rule is False:
# secondary rule applicability check true-> undetermined, false -> not_applicable
Expand Down

0 comments on commit 42f6166

Please sign in to comment.