Skip to content

Commit ae70fc1

Browse files
committed
test(all): Add HTN scenarios
1 parent 785349b commit ae70fc1

10 files changed

+2811
-0
lines changed
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
Feature: Contactable Overdue Patients
2+
___
3+
As a tester
4+
Given I have some "overdue" tracked entity instances with contact information in the system
5+
When I export analytics
6+
Then I should see the "HTN - Contactable overdue patients" program indicator data as expected
7+
___
8+
9+
Scenario: All patients must have a patient phone number
10+
Given I am signed in as a user with role "Superuser"
11+
And I have access to an organisation unit at level 5
12+
And I register that organisation unit for program "Hypertension & Diabetes"
13+
14+
Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
15+
| GEN - Given name | Callable |
16+
| GEN - Family name | Patient |
17+
| GEN - Sex | MALE |
18+
| HTN - Does patient have hypertension? | YES |
19+
| HTN - Does patient have diabetes? | YES |
20+
| GEN - Date of birth | 32 |
21+
| Address (current) | Rose Gardens |
22+
| Patient Phone Number | 345672781624 |
23+
| District | KOLARA |
24+
| HTN - Consent to record data | true |
25+
| HTN - NCD Patient Status | ACTIVE |
26+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
27+
| Systole | 142 |
28+
| Diastole | 95 |
29+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo"
30+
31+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
32+
| GEN - Given name | Unreachable |
33+
| GEN - Family name | Patient |
34+
| GEN - Sex | MALE |
35+
| HTN - Does patient have hypertension? | YES |
36+
| HTN - Does patient have diabetes? | YES |
37+
| GEN - Date of birth | 32 |
38+
| Address (current) | Rose Gardens |
39+
| District | KOLARA |
40+
| HTN - Consent to record data | true |
41+
| HTN - NCD Patient Status | ACTIVE |
42+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
43+
| Systole | 142 |
44+
| Diastole | 95 |
45+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo"
46+
47+
When I wait for 1 second
48+
And I export the analytics
49+
50+
Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be
51+
| thisMonth | 1 |
52+
| 1_MonthAgo | 1 |
53+
| 2_MonthsAgo | 1 |
54+
| 3_MonthsAgo | 1 |
55+
| 4_MonthsAgo | 1 |
56+
| 5_MonthsAgo | 1 |
57+
| 6_MonthsAgo | 0 |
58+
| 7_MonthsAgo | 0 |
59+
| 8_MonthsAgo | 0 |
60+
| 9_MonthsAgo | 0 |
61+
| 10_MonthsAgo | 0 |
62+
| 11_MonthsAgo | 0 |
63+
| 12_MonthsAgo | 0 |
64+
65+
Scenario: All overdue patients has to be hypertensive
66+
Given I am signed in as a user with role "Superuser"
67+
And I have access to an organisation unit at level 5
68+
And I register that organisation unit for program "Hypertension & Diabetes"
69+
70+
Given I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
71+
| GEN - Given name | Priyanka |
72+
| GEN - Family name | Chopra |
73+
| GEN - Sex | MALE |
74+
| HTN - Does patient have hypertension? | YES |
75+
| HTN - Does patient have diabetes? | YES |
76+
| GEN - Date of birth | 32 |
77+
| Address (current) | Rose Gardens |
78+
| Patient Phone Number | 345672781624 |
79+
| District | KOLARA |
80+
| HTN - Consent to record data | true |
81+
| HTN - NCD Patient Status | ACTIVE |
82+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
83+
| Systole | 142 |
84+
| Diastole | 95 |
85+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo"
86+
87+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
88+
| GEN - Given name | Alia |
89+
| GEN - Family name | Bhatt |
90+
| GEN - Sex | MALE |
91+
| HTN - Does patient have hypertension? | NO |
92+
| HTN - Does patient have diabetes? | YES |
93+
| GEN - Date of birth | 32 |
94+
| Address (current) | Rose Gardens |
95+
| Patient Phone Number | 345672781624 |
96+
| District | KOLARA |
97+
| HTN - Consent to record data | true |
98+
| HTN - NCD Patient Status | ACTIVE |
99+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
100+
| Systole | 142 |
101+
| Diastole | 95 |
102+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo"
103+
104+
When I wait for 1 second
105+
And I export the analytics
106+
107+
Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be
108+
| thisMonth | 1 |
109+
| 1_MonthAgo | 1 |
110+
| 2_MonthsAgo | 1 |
111+
| 3_MonthsAgo | 1 |
112+
| 4_MonthsAgo | 1 |
113+
| 5_MonthsAgo | 1 |
114+
| 6_MonthsAgo | 0 |
115+
| 7_MonthsAgo | 0 |
116+
| 8_MonthsAgo | 0 |
117+
| 9_MonthsAgo | 0 |
118+
| 10_MonthsAgo | 0 |
119+
| 11_MonthsAgo | 0 |
120+
| 12_MonthsAgo | 0 |
121+
122+
Scenario: Dead patients should not be included
123+
Given I am signed in as a user with role "Superuser"
124+
And I have access to an organisation unit at level 5
125+
And I register that organisation unit for program "Hypertension & Diabetes"
126+
127+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
128+
| GEN - Given name | Test |
129+
| GEN - Family name | TEST |
130+
| GEN - Sex | MALE |
131+
| HTN - Does patient have hypertension? | YES |
132+
| HTN - Does patient have diabetes? | YES |
133+
| GEN - Date of birth | 32 |
134+
| Address (current) | Rose Gardens |
135+
| Patient Phone Number | 345672781624 |
136+
| District | KOLARA |
137+
| HTN - Consent to record data | true |
138+
| HTN - NCD Patient Status | ACTIVE |
139+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
140+
| Systole | 142 |
141+
| Diastole | 95 |
142+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo"
143+
144+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
145+
| GEN - Given name | Test |
146+
| GEN - Family name | TEST |
147+
| GEN - Sex | MALE |
148+
| HTN - Does patient have hypertension? | YES |
149+
| HTN - Does patient have diabetes? | YES |
150+
| GEN - Date of birth | 32 |
151+
| Address (current) | Rose Gardens |
152+
| Patient Phone Number | 345672781624 |
153+
| District | KOLARA |
154+
| HTN - Consent to record data | true |
155+
| HTN - NCD Patient Status | ACTIVE |
156+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
157+
| Systole | 142 |
158+
| Diastole | 95 |
159+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo"
160+
And That TEI was updated on "2_MonthsAgo" with the following attributes
161+
| HTN - NCD Patient Status | DIED |
162+
163+
When I wait for 1 second
164+
And I export the analytics
165+
166+
Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be
167+
| thisMonth | 1 |
168+
| 1_MonthAgo | 1 |
169+
| 2_MonthsAgo | 1 |
170+
| 3_MonthsAgo | 1 |
171+
| 4_MonthsAgo | 1 |
172+
| 5_MonthsAgo | 1 |
173+
| 6_MonthsAgo | 0 |
174+
| 7_MonthsAgo | 0 |
175+
| 8_MonthsAgo | 0 |
176+
| 9_MonthsAgo | 0 |
177+
| 10_MonthsAgo | 0 |
178+
| 11_MonthsAgo | 0 |
179+
| 12_MonthsAgo | 0 |
180+
181+
Scenario: TEI are not marked as overdue anymore if they have visited after the due date.
182+
Given I am signed in as a user with role "Superuser"
183+
And I have access to an organisation unit at level 5
184+
And I register that organisation unit for program "Hypertension & Diabetes"
185+
186+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
187+
| GEN - Given name | Rose |
188+
| GEN - Family name | Mary |
189+
| GEN - Sex | FEMALE |
190+
| HTN - Does patient have hypertension? | YES |
191+
| HTN - Does patient have diabetes? | YES |
192+
| GEN - Date of birth | 32 |
193+
| Address (current) | Rose Gardens |
194+
| Patient Phone Number | 345672781624 |
195+
| District | KOLARA |
196+
| HTN - Consent to record data | true |
197+
| HTN - NCD Patient Status | ACTIVE |
198+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
199+
| Systole | 142 |
200+
| Diastole | 95 |
201+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo_Minus_1_Day"
202+
203+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
204+
| GEN - Given name | Angel |
205+
| GEN - Family name | John |
206+
| GEN - Sex | FEMALE |
207+
| HTN - Does patient have hypertension? | YES |
208+
| HTN - Does patient have diabetes? | YES |
209+
| GEN - Date of birth | 32 |
210+
| Address (current) | Rose Gardens |
211+
| Patient Phone Number | 345672781624 |
212+
| District | KOLARA |
213+
| HTN - Consent to record data | true |
214+
| HTN - NCD Patient Status | ACTIVE |
215+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
216+
| Systole | 142 |
217+
| Diastole | 95 |
218+
And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data
219+
| Result of call | REMOVE_FROM_OVERDUE |
220+
| HTN - Remove from overdue list because: | OTHER |
221+
And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" which was scheduled on "5_MonthsAgo" with following data
222+
| Systole | 142 |
223+
| Diastole | 95 |
224+
225+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
226+
| GEN - Given name | Angel |
227+
| GEN - Family name | John |
228+
| GEN - Sex | FEMALE |
229+
| HTN - Does patient have hypertension? | YES |
230+
| HTN - Does patient have diabetes? | YES |
231+
| GEN - Date of birth | 32 |
232+
| Address (current) | Rose Gardens |
233+
| District | KOLARA |
234+
| HTN - Consent to record data | true |
235+
| HTN - NCD Patient Status | ACTIVE |
236+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
237+
| Systole | 142 |
238+
| Diastole | 95 |
239+
And That TEI has a "Calling report" event on "5_MonthsAgo_Plus_1_Day" with following data
240+
| Result of call | REMOVE_FROM_OVERDUE |
241+
| HTN - Remove from overdue list because: | OTHER |
242+
And That TEI has a "Hypertension & Diabetes visit" event on "3_MonthsAgo" which was scheduled on "5_MonthsAgo" with following data
243+
| Systole | 142 |
244+
| Diastole | 95 |
245+
246+
When I wait for 1 second
247+
And I export the analytics
248+
249+
Then The value of "PI":"HTN - Contactable overdue patients" with period type "Months" should be
250+
| thisMonth | 1 |
251+
| 1_MonthAgo | 1 |
252+
| 2_MonthsAgo | 1 |
253+
| 3_MonthsAgo | 2 |
254+
| 4_MonthsAgo | 2 |
255+
| 5_MonthsAgo | 1 |
256+
| 6_MonthsAgo | 1 |
257+
| 7_MonthsAgo | 0 |
258+
| 8_MonthsAgo | 0 |
259+
| 9_MonthsAgo | 0 |
260+
| 10_MonthsAgo | 0 |
261+
| 11_MonthsAgo | 0 |
262+
| 12_MonthsAgo | 0 |
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
Feature: Contactable overdue patients called
2+
___
3+
As a tester
4+
Given I call some contactable patients
5+
When I export the analytics
6+
Then I should should see correct "HTN - Contactable overdue patients called" data
7+
___
8+
9+
Scenario: Contactable called overdue patients should be counted
10+
Given I am signed in as a user with role "Superuser"
11+
And I have access to an organisation unit at level 5
12+
And I register that organisation unit for program "Hypertension & Diabetes"
13+
14+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
15+
| GEN - Given name | Rose |
16+
| GEN - Family name | Mary |
17+
| GEN - Sex | FEMALE |
18+
| HTN - Does patient have hypertension? | YES |
19+
| HTN - Does patient have diabetes? | YES |
20+
| GEN - Date of birth | 32 |
21+
| Address (current) | Rose Gardens |
22+
| Patient Phone Number | 345672781624 |
23+
| District | KOLARA |
24+
| HTN - Consent to record data | true |
25+
| HTN - NCD Patient Status | ACTIVE |
26+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
27+
| Systole | 142 |
28+
| Diastole | 95 |
29+
And That TEI has a "Hypertension & Diabetes visit" event scheduled for "6_MonthsAgo_Minus_1_Day"
30+
And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data
31+
| Result of call | REMIND_TO_CALL_LATER |
32+
And That TEI has a "Calling report" event on "3_MonthsAgo_Plus_1_Day" with following data
33+
| Result of call | AGREE_TO_VISIT |
34+
35+
When I wait for 1 second
36+
And I export the analytics
37+
38+
Then The value of "PI":"HTN - Contactable overdue patients called" with period type "Months" should be
39+
| 3_MonthsAgo | 1 |
40+
| 4_MonthsAgo | 0 |
41+
| 5_MonthsAgo | 0 |
42+
| 6_MonthsAgo | 1 |
43+
| 7_MonthsAgo | 0 |
44+
45+
Scenario: Assume calls only happen to overdue patients, and count all patients called
46+
Given I am signed in as a user with role "Superuser"
47+
And I have access to an organisation unit at level 5
48+
And I register that organisation unit for program "Hypertension & Diabetes"
49+
50+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
51+
| GEN - Given name | Frances |
52+
| GEN - Family name | Bourgois |
53+
| GEN - Sex | FEMALE |
54+
| HTN - Does patient have hypertension? | YES |
55+
| HTN - Does patient have diabetes? | YES |
56+
| GEN - Date of birth | 32 |
57+
| Address (current) | Rose Gardens |
58+
| Patient Phone Number | 345672781624 |
59+
| District | KOLARA |
60+
| HTN - Consent to record data | true |
61+
| HTN - NCD Patient Status | ACTIVE |
62+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
63+
| Systole | 142 |
64+
| Diastole | 95 |
65+
And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data
66+
| Result of call | AGREE_TO_VISIT |
67+
And That TEI has a "Calling report" event on "3_MonthsAgo_Plus_1_Day" with following data
68+
| Result of call | AGREE_TO_VISIT |
69+
70+
When I wait for 1 second
71+
And I export the analytics
72+
73+
Then The value of "PI":"HTN - Contactable overdue patients called" with period type "Months" should be
74+
| 3_MonthsAgo | 1 |
75+
| 4_MonthsAgo | 0 |
76+
| 5_MonthsAgo | 0 |
77+
| 6_MonthsAgo | 1 |
78+
| 7_MonthsAgo | 0 |
79+
80+
Scenario: Only managed patients should be counted (Hypertensive, alive, and in-facility)
81+
Given I am signed in as a user with role "Superuser"
82+
And I have access to an organisation unit at level 5
83+
And I register that organisation unit for program "Hypertension & Diabetes"
84+
85+
# Create the patients
86+
And I create a new TEI on "7_MonthsAgo" for this Facility with the following attributes
87+
| GEN - Given name | Nonne |
88+
| GEN - Family name | Hypertensive |
89+
| GEN - Sex | MALE |
90+
| HTN - Does patient have hypertension? | NO |
91+
| HTN - Does patient have diabetes? | YES |
92+
| GEN - Date of birth | 32 |
93+
| Address (current) | By the beach |
94+
| District | KOLARA |
95+
| HTN - Consent to record data | true |
96+
| HTN - NCD Patient Status | ACTIVE |
97+
And That TEI has a "Hypertension & Diabetes visit" event on "7_MonthsAgo" with following data
98+
| Systole | 119 |
99+
| Diastole | 69 |
100+
And That TEI has a "Calling report" event on "6_MonthsAgo_Plus_1_Day" with following data
101+
| Result of call | AGREE_TO_VISIT |
102+
And I create a new TEI on "5_MonthsAgo" for this Facility with the following attributes
103+
| GEN - Given name | Swimming with|
104+
| GEN - Family name | The Fishes |
105+
| GEN - Sex | MALE |
106+
| HTN - Does patient have hypertension? | NO |
107+
| HTN - Does patient have diabetes? | YES |
108+
| GEN - Date of birth | 32 |
109+
| Address (current) | By the beach |
110+
| District | KOLARA |
111+
| HTN - Consent to record data | true |
112+
| HTN - NCD Patient Status | ACTIVE |
113+
And That TEI has a "Calling report" event on "4_MonthsAgo" with following data
114+
| Result of call | AGREE_TO_VISIT |
115+
116+
When I wait for 1 second
117+
And I export the analytics
118+
119+
Then The value of "PI":"HTN - Contactable overdue patients called" with period type "Months" should be
120+
| 3_MonthsAgo | 0 |
121+
| 4_MonthsAgo | 0 |
122+
| 5_MonthsAgo | 0 |
123+
| 6_MonthsAgo | 0 |
124+
| 7_MonthsAgo | 0 |

0 commit comments

Comments
 (0)