Skip to content

Commit b46487e

Browse files
committed
Enhance eligibility check tests with comprehensive response data and dynamic header support
- Updated multiple response JSON files to include detailed eligibility suggestions for COVID, MMR, and RSV conditions. - Modified the eligibility_check.feature to include additional test cases for various NHS numbers and corresponding JSON responses. - Refactored eligibility_check_steps.py to support querying the eligibility API with dynamic headers, improving flexibility and maintainability. - Added functionality to log and save actual API responses for better debugging and validation.
1 parent 949a6df commit b46487e

16 files changed

Lines changed: 630 additions & 203 deletions
Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
11
{
2-
"meta": { "lastUpdated": "2025-07-04T10:23:53.470846+00:00" },
2+
"meta": {
3+
"lastUpdated": "2025-07-15T09:44:41.227460+00:00"
4+
},
35
"processedSuggestions": [
6+
{
7+
"actions": [],
8+
"condition": "COVID",
9+
"eligibilityCohorts": [
10+
{
11+
"cohortCode": "covid_cohort_group",
12+
"cohortStatus": "NotEligible",
13+
"cohortText": "You are not currently in a covid cohort"
14+
}
15+
],
16+
"status": "NotEligible",
17+
"statusText": "Status.not_eligible",
18+
"suitabilityRules": []
19+
},
20+
{
21+
"actions": [],
22+
"condition": "MMR",
23+
"eligibilityCohorts": [
24+
{
25+
"cohortCode": "mmr_cohort_group",
26+
"cohortStatus": "NotEligible",
27+
"cohortText": "You are not currently in an mmr cohort"
28+
}
29+
],
30+
"status": "NotEligible",
31+
"statusText": "Status.not_eligible",
32+
"suitabilityRules": []
33+
},
434
{
535
"actions": [],
636
"condition": "RSV",
737
"eligibilityCohorts": [
838
{
9-
"cohortCode": "eli_291_cohort_3_group",
39+
"cohortCode": "rsv_cohort_group",
1040
"cohortStatus": "NotEligible",
11-
"cohortText": "You are not in eli_291_cohort_3"
41+
"cohortText": "You are not currently in an RSV cohort"
1242
}
1343
],
1444
"status": "NotEligible",
1545
"statusText": "Status.not_eligible",
1646
"suitabilityRules": []
1747
}
1848
],
19-
"responseId": "83b4aa78-f429-4fd5-915b-c8956ca261c9"
49+
"responseId": "7a57f8e6-1e7c-457a-af83-9968f68383d6"
2050
}
Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
11
{
2-
"responseId": "<<IGNORE_RESPONSE_ID>>",
32
"meta": {
4-
"lastUpdated": "<<IGNORE_DATE>>"
3+
"lastUpdated": "2025-07-15T09:44:44.544273+00:00"
54
},
65
"processedSuggestions": [
76
{
8-
"condition": "RSV",
9-
"status": "Actionable",
10-
"statusText": "You should have the RSV vaccine",
7+
"actions": [],
8+
"condition": "COVID",
9+
"eligibilityCohorts": [
10+
{
11+
"cohortCode": "covid_cohort_group",
12+
"cohortStatus": "NotEligible",
13+
"cohortText": "You are not currently in a covid cohort"
14+
}
15+
],
16+
"status": "NotEligible",
17+
"statusText": "Status.not_eligible",
18+
"suitabilityRules": []
19+
},
20+
{
21+
"actions": [],
22+
"condition": "MMR",
1123
"eligibilityCohorts": [
1224
{
13-
"cohortCode": "rsv_age_rolling",
14-
"cohortText": "You are aged 75 to 79 years old.",
15-
"cohortStatus": "Actionable"
25+
"cohortCode": "mmr_cohort_group",
26+
"cohortStatus": "NotEligible",
27+
"cohortText": "You are not currently in an mmr cohort"
1628
}
1729
],
18-
"suitabilityRules": [],
19-
"actions": [
30+
"status": "NotEligible",
31+
"statusText": "Status.not_eligible",
32+
"suitabilityRules": []
33+
},
34+
{
35+
"actions": [],
36+
"condition": "RSV",
37+
"eligibilityCohorts": [
2038
{
21-
"actionType": "CareCardWithText",
22-
"actionCode": "BookLocal",
23-
"description": "##Getting the vaccine\nYou can get an RSV vaccination at your GP surgery.\nYour GP surgery may contact you about getting the RSV vaccine. This may be by letter, text, phone call, email or through the NHS App. You do not need to wait to be contacted before booking your vaccination."
39+
"cohortCode": "rsv_cohort_group",
40+
"cohortStatus": "NotEligible",
41+
"cohortText": "You are not currently in an RSV cohort"
2442
}
25-
]
43+
],
44+
"status": "NotEligible",
45+
"statusText": "Status.not_eligible",
46+
"suitabilityRules": []
2647
}
27-
]
48+
],
49+
"responseId": "a1264578-da65-46fa-92ba-c1a09d498f31"
2850
}
Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,50 @@
11
{
2-
"responseId": "<<IGNORE_RESPONSE_ID>>",
32
"meta": {
4-
"lastUpdated": "<<IGNORE_DATE>>"
3+
"lastUpdated": "2025-07-15T09:44:47.658192+00:00"
54
},
65
"processedSuggestions": [
76
{
8-
"condition": "RSV",
9-
"status": "Actionable",
10-
"statusText": "You should have the RSV vaccine",
7+
"actions": [],
8+
"condition": "COVID",
9+
"eligibilityCohorts": [
10+
{
11+
"cohortCode": "covid_cohort_group",
12+
"cohortStatus": "NotEligible",
13+
"cohortText": "You are not currently in a covid cohort"
14+
}
15+
],
16+
"status": "NotEligible",
17+
"statusText": "Status.not_eligible",
18+
"suitabilityRules": []
19+
},
20+
{
21+
"actions": [],
22+
"condition": "MMR",
1123
"eligibilityCohorts": [
1224
{
13-
"cohortCode": "rsv_age_catchup",
14-
"cohortText": "You turned 80 between 2nd September 2024 and 31st August 2025",
15-
"cohortStatus": "Actionable"
25+
"cohortCode": "mmr_cohort_group",
26+
"cohortStatus": "NotEligible",
27+
"cohortText": "You are not currently in an mmr cohort"
1628
}
1729
],
18-
"suitabilityRules": [],
19-
"actions": [
30+
"status": "NotEligible",
31+
"statusText": "Status.not_eligible",
32+
"suitabilityRules": []
33+
},
34+
{
35+
"actions": [],
36+
"condition": "RSV",
37+
"eligibilityCohorts": [
2038
{
21-
"actionType": "CareCardWithText",
22-
"actionCode": "BookLocal",
23-
"description": "##Getting the vaccine\nYou can get an RSV vaccination at your GP surgery.\nYour GP surgery may contact you about getting the RSV vaccine. This may be by letter, text, phone call, email or through the NHS App. You do not need to wait to be contacted before booking your vaccination."
39+
"cohortCode": "rsv_cohort_group",
40+
"cohortStatus": "NotEligible",
41+
"cohortText": "You are not currently in an RSV cohort"
2442
}
25-
]
43+
],
44+
"status": "NotEligible",
45+
"statusText": "Status.not_eligible",
46+
"suitabilityRules": []
2647
}
27-
]
48+
],
49+
"responseId": "98b7c6ec-13a5-48bc-af50-94ceaaa10893"
2850
}
Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
11
{
2-
"meta": { "lastUpdated": "2025-07-04T10:24:57.489704+00:00" },
2+
"meta": {
3+
"lastUpdated": "2025-07-15T09:44:50.667999+00:00"
4+
},
35
"processedSuggestions": [
6+
{
7+
"actions": [],
8+
"condition": "COVID",
9+
"eligibilityCohorts": [
10+
{
11+
"cohortCode": "covid_cohort_group",
12+
"cohortStatus": "NotEligible",
13+
"cohortText": "You are not currently in a covid cohort"
14+
}
15+
],
16+
"status": "NotEligible",
17+
"statusText": "Status.not_eligible",
18+
"suitabilityRules": []
19+
},
20+
{
21+
"actions": [],
22+
"condition": "MMR",
23+
"eligibilityCohorts": [
24+
{
25+
"cohortCode": "mmr_cohort_group",
26+
"cohortStatus": "NotEligible",
27+
"cohortText": "You are not currently in an mmr cohort"
28+
}
29+
],
30+
"status": "NotEligible",
31+
"statusText": "Status.not_eligible",
32+
"suitabilityRules": []
33+
},
434
{
535
"actions": [],
636
"condition": "RSV",
737
"eligibilityCohorts": [
838
{
9-
"cohortCode": "eli_291_cohort_3_group",
39+
"cohortCode": "rsv_cohort_group",
1040
"cohortStatus": "NotEligible",
11-
"cohortText": "You are not in eli_291_cohort_3"
41+
"cohortText": "You are not currently in an RSV cohort"
1242
}
1343
],
1444
"status": "NotEligible",
1545
"statusText": "Status.not_eligible",
1646
"suitabilityRules": []
1747
}
1848
],
19-
"responseId": "a0337485-f8ae-4bd4-a359-f6632743c788"
49+
"responseId": "317d721a-1ffd-4621-b660-562d8143501d"
2050
}
Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,50 @@
11
{
2-
"responseId": "<<IGNORE_RESPONSE_ID>>",
32
"meta": {
4-
"lastUpdated": "<<IGNORE_DATE>>"
3+
"lastUpdated": "2025-07-15T09:44:53.772820+00:00"
54
},
65
"processedSuggestions": [
76
{
7+
"actions": [],
8+
"condition": "COVID",
9+
"eligibilityCohorts": [
10+
{
11+
"cohortCode": "covid_cohort_group",
12+
"cohortStatus": "NotEligible",
13+
"cohortText": "You are not currently in a covid cohort"
14+
}
15+
],
16+
"status": "NotEligible",
17+
"statusText": "Status.not_eligible",
18+
"suitabilityRules": []
19+
},
20+
{
21+
"actions": [],
22+
"condition": "MMR",
23+
"eligibilityCohorts": [
24+
{
25+
"cohortCode": "mmr_cohort_group",
26+
"cohortStatus": "NotEligible",
27+
"cohortText": "You are not currently in an mmr cohort"
28+
}
29+
],
30+
"status": "NotEligible",
31+
"statusText": "Status.not_eligible",
32+
"suitabilityRules": []
33+
},
34+
{
35+
"actions": [],
836
"condition": "RSV",
9-
"status": "Actionable",
10-
"statusText": "You should have the RSV vaccine",
11-
"eligibilityCohorts": [],
12-
"suitabilityRules": [],
13-
"actions": [
37+
"eligibilityCohorts": [
1438
{
15-
"actionType": "CardWithText",
16-
"actionCode": "ManageLocal",
17-
"description": "##You have an RSV vaccination appointment\nContact your healthcare provider to change or cancel your appointment."
39+
"cohortCode": "rsv_cohort_group",
40+
"cohortStatus": "NotEligible",
41+
"cohortText": "You are not currently in an RSV cohort"
1842
}
19-
]
43+
],
44+
"status": "NotEligible",
45+
"statusText": "Status.not_eligible",
46+
"suitabilityRules": []
2047
}
21-
]
48+
],
49+
"responseId": "ac77be57-2406-401d-b195-9728507f7559"
2250
}
Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,50 @@
11
{
2-
"responseId": "<<IGNORE_RESPONSE_ID>>",
32
"meta": {
4-
"lastUpdated": "<<IGNORE_DATE>>"
3+
"lastUpdated": "2025-07-15T09:44:56.893166+00:00"
54
},
65
"processedSuggestions": [
76
{
7+
"actions": [],
8+
"condition": "COVID",
9+
"eligibilityCohorts": [
10+
{
11+
"cohortCode": "covid_cohort_group",
12+
"cohortStatus": "NotEligible",
13+
"cohortText": "You are not currently in a covid cohort"
14+
}
15+
],
16+
"status": "NotEligible",
17+
"statusText": "Status.not_eligible",
18+
"suitabilityRules": []
19+
},
20+
{
21+
"actions": [],
22+
"condition": "MMR",
23+
"eligibilityCohorts": [
24+
{
25+
"cohortCode": "mmr_cohort_group",
26+
"cohortStatus": "NotEligible",
27+
"cohortText": "You are not currently in an mmr cohort"
28+
}
29+
],
30+
"status": "NotEligible",
31+
"statusText": "Status.not_eligible",
32+
"suitabilityRules": []
33+
},
34+
{
35+
"actions": [],
836
"condition": "RSV",
9-
"status": "NotActionable",
10-
"statusText": "You should have the RSV vaccine",
11-
"eligibilityCohorts": [],
12-
"suitabilityRules": [
37+
"eligibilityCohorts": [
1338
{
14-
"ruleType": "S",
15-
"ruleCode": "AlreadyVaccinated",
16-
"ruleText": "##You've had your RSV vaccination\nBased on our records, you recently had this vaccination. You do not need to do anything."
39+
"cohortCode": "rsv_cohort_group",
40+
"cohortStatus": "NotEligible",
41+
"cohortText": "You are not currently in an RSV cohort"
1742
}
1843
],
19-
"actions": []
44+
"status": "NotEligible",
45+
"statusText": "Status.not_eligible",
46+
"suitabilityRules": []
2047
}
21-
]
48+
],
49+
"responseId": "aef6e6ca-de67-4af5-b439-76381d0d9871"
2250
}

0 commit comments

Comments
 (0)