|
6 | 6 | let(:hpv_programme) { Programme.hpv } |
7 | 7 | let(:flu_programme) { Programme.flu } |
8 | 8 | let(:session) { create(:session, programmes: [hpv_programme, flu_programme]) } |
9 | | - let(:latest_location) { session.location } |
10 | 9 |
|
11 | 10 | let(:component) { described_class.new(session) } |
12 | 11 |
|
|
66 | 65 | context "they have been vaccinated during the session" do |
67 | 66 | before do |
68 | 67 | create( |
69 | | - :patient_vaccination_status, |
70 | | - :vaccinated, |
| 68 | + :patient_programme_status, |
| 69 | + :vaccinated_fully, |
71 | 70 | patient:, |
72 | | - programme: flu_programme, |
73 | | - latest_location: |
| 71 | + programme: flu_programme |
74 | 72 | ) |
75 | 73 | end |
76 | 74 |
|
77 | | - include_examples "displays correct children due vaccination", "Flu", 1 |
78 | | - include_examples "displays correct count", "Flu", "No response", 0 |
79 | | - include_examples "displays correct count", |
80 | | - "Flu", |
81 | | - "Consent given for nasal", |
82 | | - 0 |
83 | | - include_examples "displays correct count", |
84 | | - "Flu", |
85 | | - "Consent given for gelatine-free injection", |
86 | | - 0 |
87 | | - include_examples "displays correct count", "Flu", "Consent refused", 0 |
| 75 | + include_examples "displays correct children due vaccination", "Flu", 0 |
| 76 | + include_examples "displays correct count", "Flu", "Needs consent", 0 |
| 77 | + include_examples "displays correct count", "Flu", "Needs triage", 0 |
| 78 | + include_examples "displays correct count", "Flu", "Has a refusal", 0 |
| 79 | + include_examples "displays correct count", "Flu", "Unable to vaccinate", 0 |
| 80 | + include_examples "displays correct count", "Flu", "Due nasal spray", 0 |
| 81 | + include_examples "displays correct count", "Flu", "Due injection", 0 |
88 | 82 | include_examples "displays correct count", "Flu", "Vaccinated", 1 |
89 | 83 | end |
90 | 84 |
|
|
93 | 87 |
|
94 | 88 | before do |
95 | 89 | create( |
96 | | - :patient_consent_status, |
97 | | - :given_without_gelatine, |
| 90 | + :patient_programme_status, |
| 91 | + :due_nasal, |
98 | 92 | patient: patients.first, |
99 | 93 | programme: flu_programme |
100 | 94 | ) |
101 | 95 |
|
102 | 96 | create( |
103 | | - :patient_consent_status, |
104 | | - :given_nasal_only, |
| 97 | + :patient_programme_status, |
| 98 | + :due_injection_without_gelatine, |
105 | 99 | patient: patients.second, |
106 | 100 | programme: flu_programme |
107 | 101 | ) |
108 | 102 | end |
109 | 103 |
|
110 | 104 | include_examples "displays correct children due vaccination", "Flu", 2 |
111 | | - include_examples "displays correct count", "Flu", "No response", 0 |
112 | | - include_examples "displays correct count", |
113 | | - "Flu", |
114 | | - "Consent given for nasal", |
115 | | - 1 |
116 | | - include_examples "displays correct count", |
117 | | - "Flu", |
118 | | - "Consent given for gelatine-free injection", |
119 | | - 1 |
120 | | - include_examples "displays correct count", "Flu", "Consent refused", 0 |
| 105 | + include_examples "displays correct count", "Flu", "Needs consent", 0 |
| 106 | + include_examples "displays correct count", "Flu", "Needs triage", 0 |
| 107 | + include_examples "displays correct count", "Flu", "Has a refusal", 0 |
| 108 | + include_examples "displays correct count", "Flu", "Unable to vaccinate", 0 |
| 109 | + include_examples "displays correct count", "Flu", "Due nasal spray", 1 |
| 110 | + include_examples "displays correct count", "Flu", "Due injection", 1 |
121 | 111 | include_examples "displays correct count", "Flu", "Vaccinated", 0 |
122 | 112 | end |
123 | 113 |
|
124 | 114 | context "there's a patient that did not consent" do |
125 | 115 | before do |
126 | 116 | create( |
127 | | - :patient_consent_status, |
128 | | - :refused, |
| 117 | + :patient_programme_status, |
| 118 | + :has_refusal_consent_refused, |
129 | 119 | patient:, |
130 | 120 | programme: flu_programme |
131 | 121 | ) |
132 | 122 | end |
133 | 123 |
|
134 | 124 | include_examples "displays correct children due vaccination", "Flu", 1 |
135 | | - include_examples "displays correct count", "Flu", "No response", 0 |
136 | | - include_examples "displays correct count", |
137 | | - "Flu", |
138 | | - "Consent given for nasal", |
139 | | - 0 |
140 | | - include_examples "displays correct count", |
141 | | - "Flu", |
142 | | - "Consent given for gelatine-free injection", |
143 | | - 0 |
144 | | - include_examples "displays correct count", "Flu", "Consent refused", 1 |
| 125 | + include_examples "displays correct count", "Flu", "Needs consent", 0 |
| 126 | + include_examples "displays correct count", "Flu", "Needs triage", 0 |
| 127 | + include_examples "displays correct count", "Flu", "Has a refusal", 1 |
| 128 | + include_examples "displays correct count", "Flu", "Unable to vaccinate", 0 |
| 129 | + include_examples "displays correct count", "Flu", "Due nasal spray", 0 |
| 130 | + include_examples "displays correct count", "Flu", "Due injection", 0 |
145 | 131 | include_examples "displays correct count", "Flu", "Vaccinated", 0 |
146 | 132 | end |
147 | 133 |
|
148 | 134 | context "patient was vaccinated in previous years" do |
149 | 135 | before do |
150 | 136 | create( |
151 | | - :patient_vaccination_status, |
152 | | - :vaccinated, |
| 137 | + :patient_programme_status, |
| 138 | + :vaccinated_fully, |
153 | 139 | patient:, |
154 | 140 | programme: hpv_programme, |
155 | 141 | academic_year: AcademicYear.current - 1 |
156 | 142 | ) |
157 | 143 | end |
158 | 144 |
|
159 | 145 | include_examples "displays correct children due vaccination", "HPV", 0 |
160 | | - include_examples "displays correct count", "HPV", "No response", 0 |
161 | | - include_examples "displays correct count", "HPV", "Consent given", 0 |
162 | | - include_examples "displays correct count", "HPV", "Consent refused", 0 |
163 | | - include_examples "displays correct count", "HPV", "Vaccinated", 0 |
164 | 146 | end |
165 | 147 |
|
166 | 148 | context "patient had seasonal vaccination in previous years" do |
167 | 149 | before do |
168 | 150 | create( |
169 | | - :patient_vaccination_status, |
170 | | - :vaccinated, |
| 151 | + :patient_programme_status, |
| 152 | + :vaccinated_fully, |
171 | 153 | patient:, |
172 | 154 | programme: flu_programme, |
173 | 155 | academic_year: AcademicYear.current - 1 |
174 | 156 | ) |
175 | 157 | end |
176 | 158 |
|
177 | 159 | include_examples "displays correct children due vaccination", "Flu", 1 |
178 | | - include_examples "displays correct count", "Flu", "No response", 0 |
179 | | - include_examples "displays correct count", |
180 | | - "Flu", |
181 | | - "Consent given for nasal", |
182 | | - 0 |
183 | | - include_examples "displays correct count", |
184 | | - "Flu", |
185 | | - "Consent given for gelatine-free injection", |
186 | | - 0 |
187 | | - include_examples "displays correct count", "Flu", "Consent refused", 0 |
188 | | - include_examples "displays correct count", "Flu", "Vaccinated", 0 |
189 | 160 | end |
190 | 161 |
|
191 | 162 | context "patient was vaccinated for HPV but elsewhere" do |
|
201 | 172 | end |
202 | 173 |
|
203 | 174 | include_examples "displays correct children due vaccination", "HPV", 0 |
204 | | - include_examples "displays correct count", "HPV", "No response", 0 |
205 | | - include_examples "displays correct count", "HPV", "Consent given", 0 |
206 | | - include_examples "displays correct count", "HPV", "Consent refused", 0 |
207 | | - include_examples "displays correct count", "HPV", "Vaccinated", 0 |
208 | 175 | end |
209 | 176 |
|
210 | 177 | context "patient refused HPV vaccine elsewhere" do |
|
219 | 186 | end |
220 | 187 |
|
221 | 188 | include_examples "displays correct children due vaccination", "HPV", 1 |
222 | | - include_examples "displays correct count", "HPV", "No response", 0 |
223 | | - include_examples "displays correct count", "HPV", "Consent given", 0 |
224 | | - include_examples "displays correct count", "HPV", "Consent refused", 0 |
225 | | - include_examples "displays correct count", "HPV", "Vaccinated", 0 |
226 | 189 | end |
227 | 190 |
|
228 | 191 | context "with multiple patients and one was vaccinated for HPV elsewhere" do |
|
248 | 211 | end |
249 | 212 |
|
250 | 213 | include_examples "displays correct children due vaccination", "HPV", 1 |
251 | | - include_examples "displays correct count", "HPV", "No response", 0 |
252 | | - include_examples "displays correct count", "HPV", "Consent given", 0 |
253 | | - include_examples "displays correct count", "HPV", "Consent refused", 0 |
254 | | - include_examples "displays correct count", "HPV", "Vaccinated", 0 |
255 | 214 | end |
256 | 215 | end |
257 | 216 |
|
|
260 | 219 |
|
261 | 220 | before do |
262 | 221 | create( |
263 | | - :patient_consent_status, |
264 | | - :given_injection_only, |
| 222 | + :patient_programme_status, |
| 223 | + :has_refusal_consent_refused, |
265 | 224 | patient: patients.first, |
266 | 225 | programme: hpv_programme |
267 | 226 | ) |
268 | 227 | create( |
269 | | - :patient_vaccination_status, |
270 | | - :vaccinated, |
| 228 | + :patient_programme_status, |
| 229 | + :cannot_vaccinate_unwell, |
271 | 230 | programme: hpv_programme, |
272 | | - patient: patients.second, |
273 | | - latest_location: |
| 231 | + patient: patients.second |
274 | 232 | ) |
275 | 233 | create( |
276 | | - :patient_consent_status, |
277 | | - :refused, |
| 234 | + :patient_programme_status, |
| 235 | + :vaccinated_fully, |
278 | 236 | programme: hpv_programme, |
279 | 237 | patient: patients.third |
280 | 238 | ) |
281 | 239 | end |
282 | 240 |
|
283 | 241 | include_examples "displays correct children due vaccination", "HPV", 3 |
284 | | - include_examples "displays correct count", "HPV", "No response", 0 |
285 | | - include_examples "displays correct count", "HPV", "Consent given", 1 |
286 | | - include_examples "displays correct count", "HPV", "Consent refused", 1 |
| 242 | + include_examples "displays correct count", "HPV", "Needs consent", 0 |
| 243 | + include_examples "displays correct count", "HPV", "Needs triage", 0 |
| 244 | + include_examples "displays correct count", "HPV", "Has a refusal", 1 |
| 245 | + include_examples "displays correct count", "HPV", "Unable to vaccinate", 0 |
| 246 | + include_examples "displays correct count", "HPV", "Due vaccination", 1 |
287 | 247 | include_examples "displays correct count", "HPV", "Vaccinated", 1 |
288 | 248 | end |
289 | 249 |
|
|
0 commit comments