@@ -1042,10 +1042,19 @@ def test_eligibility_results_when_multiple_cohorts(
10421042 ("magic cohort group" , "magic negative description" ),
10431043 ("rsv_age_range" , "rsv_age_range negative description" ),
10441044 ],
1045- "all the cohorts are not- eligible" ,
1045+ "rsv_75_rolling is not base-eligible & magic cohort group not eligible by F rules " ,
10461046 ),
10471047 (
1048- person_rows_builder (nhs_number = "123" , cohorts = [], postcode = "SW19" , de = False , icb = "QE1" ),
1048+ person_rows_builder (nhs_number = "123" , cohorts = ["rsv_75_rolling" ], postcode = "AC01" , de = True , icb = "QE1" ),
1049+ Status .not_eligible ,
1050+ [
1051+ ("magic cohort group" , "magic negative description" ),
1052+ ("rsv_age_range" , "rsv_age_range negative description" ),
1053+ ],
1054+ "all the cohorts are not-eligible by F rules" ,
1055+ ),
1056+ (
1057+ person_rows_builder (nhs_number = "123" , cohorts = ["rsv_75_rolling" ], postcode = "SW19" , de = False , icb = "QE1" ),
10491058 Status .not_actionable ,
10501059 [
10511060 ("magic cohort group" , "magic positive description" ),
@@ -1054,7 +1063,7 @@ def test_eligibility_results_when_multiple_cohorts(
10541063 "all the cohorts are not-actionable" ,
10551064 ),
10561065 (
1057- person_rows_builder (nhs_number = "123" , cohorts = [], postcode = "AC01" , de = False , icb = "QE1" ),
1066+ person_rows_builder (nhs_number = "123" , cohorts = ["rsv_75_rolling" ], postcode = "AC01" , de = False , icb = "QE1" ),
10581067 Status .actionable ,
10591068 [
10601069 ("magic cohort group" , "magic positive description" ),
@@ -1063,20 +1072,20 @@ def test_eligibility_results_when_multiple_cohorts(
10631072 "all the cohorts are actionable" ,
10641073 ),
10651074 (
1066- person_rows_builder (nhs_number = "123" , cohorts = [], postcode = "AC01" , de = False , icb = "NOT_QE1" ),
1075+ person_rows_builder (nhs_number = "123" , cohorts = ["rsv_75_rolling" ], postcode = "AC01" , de = False , icb = "NOT_QE1" ),
10671076 Status .actionable ,
10681077 [("magic cohort group" , "magic positive description" )],
10691078 "magic_cohort is actionable, but not others" ,
10701079 ),
10711080 (
1072- person_rows_builder (nhs_number = "123" , cohorts = [], postcode = "SW19" , de = False , icb = "NOT_QE1" ),
1081+ person_rows_builder (nhs_number = "123" , cohorts = ["rsv_75_rolling" ], postcode = "SW19" , de = False , icb = "NOT_QE1" ),
10731082 Status .not_actionable ,
10741083 [("magic cohort group" , "magic positive description" )],
10751084 "magic_cohort is not-actionable, but others are not eligible" ,
10761085 ),
10771086 ],
10781087)
1079- def test_cohort_groups_and_their_descriptions_when_magic_cohort_is_having_the_best_status (
1088+ def test_cohort_groups_and_their_descriptions_when_magic_cohort_is_present (
10801089 person_rows : list [dict [str , Any ]],
10811090 expected_status : str ,
10821091 expected_cohort_group_and_description : list [tuple [str , str ]],
@@ -1089,19 +1098,20 @@ def test_cohort_groups_and_their_descriptions_when_magic_cohort_is_having_the_be
10891098 iterations = [
10901099 rule_builder .IterationFactory .build (
10911100 iteration_cohorts = [
1092- rule_builder .MagicCohortFactory .build (),
10931101 rule_builder .Rsv75RollingCohortFactory .build (),
1102+ rule_builder .MagicCohortFactory .build (),
10941103 ],
10951104 iteration_rules = [
1096- # common rules
1105+ # F common rule
10971106 rule_builder .DetainedEstateSuppressionRuleFactory .build (type = rules .RuleType .filter ),
1107+ # F rules for rsv_75_rolling
1108+ rule_builder .ICBFilterRuleFactory .build (
1109+ type = rules .RuleType .filter , cohort_label = rules .CohortLabel ("rsv_75_rolling" )
1110+ ),
1111+ # S common rule
10981112 rule_builder .PostcodeSuppressionRuleFactory .build (
10991113 comparator = rules .RuleComparator ("SW19" ),
11001114 ),
1101- # rules for specific cohorts
1102- rule_builder .ICBFilterRuleFactory .build (
1103- cohort_label = rules .CohortLabel ("rsv_75_rolling" ),
1104- ),
11051115 ],
11061116 )
11071117 ],
0 commit comments