@@ -622,10 +622,11 @@ def test_base_eligible_and_icb_example(
622622@pytest .mark .parametrize (
623623 ("last_successful_date" , "expected_status" , "test_comment" ),
624624 [
625- ("20240101 " , Status .not_actionable , "last_successful_date is a past date" ),
625+ ("20240601 " , Status .not_actionable , "last_successful_date is a past date" ),
626626 ("20250101" , Status .not_actionable , "last_successful_date is today" ),
627627 # Below is a non-ideal situation (might be due to a data entry error), so considered as actionable.
628628 ("20260101" , Status .actionable , "last_successful_date is a future date" ),
629+ ("20230601" , Status .actionable , "last_successful_date is a long past" ),
629630 ("" , Status .actionable , "last_successful_date is empty" ),
630631 (None , Status .actionable , "last_successful_date is none" ),
631632 ],
@@ -658,14 +659,28 @@ def test_not_actionable_status_on_target_when_last_successful_date_lte_today(
658659 iteration_rules = [
659660 rule_builder .IterationRuleFactory .build (
660661 type = rules .RuleType .suppression ,
661- name = rules .RuleName ("You have already been vaccinated against RSV" ),
662- description = rules .RuleDescription ("Exclude anyone Completed RSV Vaccination" ),
662+ name = rules .RuleName ("You have already been vaccinated against RSV in the last year" ),
663+ description = rules .RuleDescription (
664+ "Exclude anyone Completed RSV Vaccination in the last year"
665+ ),
666+ priority = 10 ,
667+ operator = rules .RuleOperator .day_gte ,
668+ attribute_level = rules .RuleAttributeLevel .TARGET ,
669+ attribute_name = rules .RuleAttributeName ("LAST_SUCCESSFUL_DATE" ),
670+ comparator = rules .RuleComparator ("-365" ),
671+ attribute_target = rules .RuleAttributeTarget ("RSV" ),
672+ ),
673+ rule_builder .IterationRuleFactory .build (
674+ type = rules .RuleType .suppression ,
675+ name = rules .RuleName ("You have a future booking to be vaccinated against RSV" ),
676+ description = rules .RuleDescription ("Exclude anyone with future Completed RSV Vaccination" ),
677+ priority = 10 ,
663678 operator = rules .RuleOperator .day_lte ,
664679 attribute_level = rules .RuleAttributeLevel .TARGET ,
665680 attribute_name = rules .RuleAttributeName ("LAST_SUCCESSFUL_DATE" ),
666681 comparator = rules .RuleComparator ("0" ),
667682 attribute_target = rules .RuleAttributeTarget ("RSV" ),
668- )
683+ ),
669684 ],
670685 iteration_cohorts = [rule_builder .IterationCohortFactory .build (cohort_label = "cohort1" )],
671686 )
0 commit comments