Skip to content

Commit bdfbe56

Browse files
test/adw-config-creation (#183)
* changing the data and creating config to support the expected responses * changing the data and creating config to support the expected responses * updated config and testdata to allign with the correct cohort data structure in dynamo * updated config and testdata to allign with the correct cohort data structure in dynamo
1 parent 947ac0a commit bdfbe56

17 files changed

Lines changed: 395 additions & 82 deletions
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
{
2+
"CampaignConfig": {
3+
"ID": "<<RANDOM_GUID>>",
4+
"Version": 1,
5+
"Name": "Automation RSV - Campaign 1",
6+
"Type": "O",
7+
"Target": "RSV",
8+
"Manager": "adam.waller1@nhs.net",
9+
"Approver": "adam.waller1@nhs.net",
10+
"Reviewer": "adam.waller1@nhs.net",
11+
"IterationFrequency": "X",
12+
"IterationType": "A",
13+
"IterationTime": "07:00:00",
14+
"DefaultCommsRouting": "CONTACT_GP",
15+
"StartDate": "20250601",
16+
"EndDate": "20260601",
17+
"ApprovalMinimum": 0,
18+
"ApprovalMaximum": 0,
19+
"Iterations": [
20+
{
21+
"ID": ",<<RANDOM_GUID>>",
22+
"DefaultCommsRouting": "CONTACT_GP",
23+
"Version": 1,
24+
"Name": "Automation RSV - Campaign 1 Iteration 1",
25+
"IterationDate": "20250601",
26+
"IterationNumber": 1,
27+
"CommsType": "I",
28+
"ApprovalMinimum": 0,
29+
"ApprovalMaximum": 0,
30+
"Type": "A",
31+
"IterationCohorts": [
32+
{
33+
"CohortLabel": "rsv_75_rolling",
34+
"CohortGroupCode": "rsv_age_range",
35+
"CohortGroupDescriptionPositive": "You are currently aged 75 to 79",
36+
"CohortGroupDescriptionNegative": "You are not currently aged 75 to 79",
37+
"Priority": 0
38+
},
39+
{
40+
"CohortLabel": "rsv_75to79_2024",
41+
"CohortGroupCode": "rsv_catch_up_age_range",
42+
"CohortGroupDescriptionPositive": "You turned 80 after 1 September 2024, so are eligible for the RSV vaccine until 31 August 2025",
43+
"CohortGroupDescriptionNegative": "You did not turn 80 after 1 September 2024 and get vaccinated by 31 August 2025",
44+
"Priority": 10
45+
},
46+
{
47+
"CohortLabel": "elid_all_people",
48+
"CohortGroupCode": "elid_all_people",
49+
"CohortGroupDescriptionPositive": "Our records do not say why you are eligible",
50+
"CohortGroupDescriptionNegative": "",
51+
"Priority": 10
52+
}
53+
],
54+
"IterationRules": [
55+
{
56+
"Type": "F",
57+
"Name": "Assure only already vaccinated taken from magic cohort",
58+
"Description": "Exclude anyone who has NOT been given a dose of RSV Vaccination from the magic cohort",
59+
"Operator": "is_empty",
60+
"AttributeTarget": "RSV",
61+
"AttributeLevel": "TARGET",
62+
"AttributeName": "LAST_SUCCESSFUL_DATE",
63+
"CohortLabel": "elid_all_people",
64+
"Priority": 100
65+
},
66+
{
67+
"Type": "F",
68+
"Name": "Assure only already vaccinated taken from magic cohort",
69+
"Description": "Exclude anyone who has NOT been given a dose of RSV within the last 25 years from the magic cohort",
70+
"Operator": "Y<=",
71+
"Comparator": "-25[[NVL:18000101]]",
72+
"AttributeTarget": "RSV",
73+
"AttributeLevel": "TARGET",
74+
"AttributeName": "LAST_SUCCESSFUL_DATE",
75+
"CohortLabel": "elid_all_people",
76+
"Priority": 110
77+
},
78+
{
79+
"Type": "F",
80+
"Name": "Under Age - Under 75 Years on day of execution",
81+
"Description": "Ensure anyone who has a PDS date of birth which determines their age to be less than 75 years is filtered out.",
82+
"Priority": 120,
83+
"AttributeLevel": "PERSON",
84+
"AttributeName": "DATE_OF_BIRTH",
85+
"Operator": "Y>",
86+
"Comparator": "-75"
87+
},
88+
{
89+
"Type": "F",
90+
"Name": "Exclude Too OLD",
91+
"Description": "Exclude anyone over 80",
92+
"Priority": 130,
93+
"AttributeLevel": "PERSON",
94+
"AttributeName": "DATE_OF_BIRTH",
95+
"Operator": "<",
96+
"Comparator": "-80"
97+
},
98+
{
99+
"Type": "S",
100+
"Name": "Dose Interval - Make NotActionable everyone who has been given a dose of RSV Vaccination in the last 25 years",
101+
"Description": "AlreadyVaccinated|##You've had your RSV vaccination\\nBased on our records, you recently had this vaccination. You do not need to do anything.",
102+
"Priority": 200,
103+
"AttributeLevel": "TARGET",
104+
"AttributeTarget": "RSV",
105+
"AttributeName": "LAST_SUCCESSFUL_DATE",
106+
"Operator": "Y>=",
107+
"Comparator": "-25",
108+
"RuleStop": "Y"
109+
},
110+
{
111+
"Type": "S",
112+
"Name": "Future Booking",
113+
"Description": "AlreadyBooked|You are already Booked.",
114+
"Priority": 200,
115+
"AttributeLevel": "TARGET",
116+
"AttributeTarget": "RSV",
117+
"AttributeName": "BOOKED_DATE",
118+
"Operator": "D>=",
119+
"Comparator": "0"
120+
},
121+
{
122+
"Type": "R",
123+
"Name": "Future Booking",
124+
"Description": "AlreadyBooked|You are already Booked.",
125+
"Priority": 1000,
126+
"AttributeLevel": "TARGET",
127+
"AttributeTarget": "RSV",
128+
"AttributeName": "BOOKED_DATE",
129+
"Operator": "D>=",
130+
"Comparator": "0",
131+
"CommsRouting": "AMEND_NBS"
132+
}
133+
],
134+
"ActionsMapper": {
135+
"BOOK_NBS": {
136+
"ExternalRoutingCode": "BookNBS",
137+
"ActionDescription": "",
138+
"ActionType": "ButtonAuthLink",
139+
"UrlLink": "http://www.nhs.uk/book-rsv",
140+
"UrlLabel": "Continue to booking"
141+
},
142+
"AMEND_NBS": {
143+
"ExternalRoutingCode": "AmendNBS",
144+
"ActionDescription": "",
145+
"ActionType": "ButtonAuthLink",
146+
"UrlLink": "http://www.nhs.uk/book-rsv",
147+
"UrlLabel": "Update or Cancel booking"
148+
},
149+
"CONTACT_GP": {
150+
"actionType": "InfoText",
151+
"actionCode": "ContactGP",
152+
"description": "Contact your GP surgery to get vaccinated",
153+
"UrlLink": "",
154+
"urlLabel": ""
155+
}
156+
}
157+
}
158+
],
159+
"AvailableActions": [
160+
{
161+
"actionType": "ButtonAuthLink",
162+
"actionCode": "BookNBS",
163+
"description": "",
164+
"urlLink": "http://www.nhs.uk/book-rsv",
165+
"urlLabel": "Continue to booking"
166+
},
167+
{
168+
"actionType": "Link",
169+
"actionCode": "FindWalkin",
170+
"description": "Find a walk-in service for RSV vaccinations",
171+
"urlLink": "www.england.nhs.uk/rsv-east",
172+
"urlLabel": ""
173+
},
174+
{
175+
"actionType": "InfoText",
176+
"actionCode": "ContactGP",
177+
"description": "Contact your GP surgery to get vaccinated",
178+
"urlLabel": ""
179+
}
180+
]
181+
}
182+
}

tests/e2e/data/dynamoDB/AUTO_RSV_SB_001.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000001",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_75_rolling",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75_rolling": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20230515"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000001",
@@ -28,12 +35,6 @@
2835
"13Q_FLAG": "N",
2936
"CARE_HOME_FLAG": "N",
3037
"DE_FLAG": "N"
31-
},
32-
{
33-
"NHS_NUMBER": "5000000001",
34-
"ATTRIBUTE_TYPE": "RSV",
35-
"BOOKED_APPOINTMENT_DATE": "<<DATE_TOMORROW>>",
36-
"BOOKED_APPOINTMENT_PROVIDER": "NBS"
3738
}
3839
]
3940
}

tests/e2e/data/dynamoDB/AUTO_RSV_SB_002.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000002",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_75_rolling",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75_rolling": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20230515"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000002",

tests/e2e/data/dynamoDB/AUTO_RSV_SB_003.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000003",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_age_catchup",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75to79_2024": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20221120"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000003",

tests/e2e/data/dynamoDB/AUTO_RSV_SB_004.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000004",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_75_rolling",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75_rolling": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20230515"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000004",

tests/e2e/data/dynamoDB/AUTO_RSV_SB_005.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000005",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_75_rolling",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75_rolling": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20230515"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000005",

tests/e2e/data/dynamoDB/AUTO_RSV_SB_006.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000006",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_75_rolling",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75_rolling": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20230515"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000006",

tests/e2e/data/dynamoDB/AUTO_RSV_SB_007.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000007",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_75_rolling",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75_rolling": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20230515"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000007",

tests/e2e/data/dynamoDB/AUTO_RSV_SB_008.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
{
55
"NHS_NUMBER": "5000000008",
66
"ATTRIBUTE_TYPE": "COHORTS",
7-
"COHORT_MEMBERSHIPS": [
8-
{
9-
"COHORT_LABEL": "rsv_75_rolling",
10-
"DATE_JOINED": "20250101"
7+
"COHORT_MAP": {
8+
"cohorts": {
9+
"M": {
10+
"rsv_75_rolling": {
11+
"M": {
12+
"dateJoined": {
13+
"S": "20230515"
14+
}
15+
}
16+
}
17+
}
1118
}
12-
]
19+
}
1320
},
1421
{
1522
"NHS_NUMBER": "5000000008",

0 commit comments

Comments
 (0)