Skip to content

Commit

Permalink
correct count on hard sequential triggers needed, to match spec
Browse files Browse the repository at this point in the history
  • Loading branch information
pbugni committed Mar 28, 2024
1 parent 0946f74 commit ee5503f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions portal/trigger_states/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def opted_out_domains(self):
def sequential_threshold_reached(self):
"""Returns True IFF at least one domain above sequential threshold
Business rule says when >= 2 sequential hard triggers for a given
Business rule says when >= 3 sequential hard triggers for a given
domain are achieved, the user gets the option to opt-out of follow
up from clinician. This convenience method looks through all domains
in triggers to see if at least one has adequate sequential count of
Expand All @@ -175,7 +175,7 @@ def sequential_threshold_reached(self):
return

for domain, link_triggers in self.triggers['domain'].items():
if link_triggers.get(sequential_hard_trigger_count_key, 0) > 1:
if link_triggers.get(sequential_hard_trigger_count_key, 0) > 2:
return True

def reminder_due(self, as_of_date=None):
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/trigger_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def mock_triggers():
'joint_pain': {
'ironman_ss.4': 'hard', 'ironman_ss.6': 'soft'},
'insomnia': {
'_sequential_hard_trigger_count': 2,
'_sequential_hard_trigger_count': 3,
'_opt_out_this_visit': True},
'fatigue': {'ironman_ss.9': 'hard'},
'anxious': {'ironman_ss.12': 'soft'},
Expand Down

0 comments on commit ee5503f

Please sign in to comment.