|
30 | 30 | create(:vaccination_record, :already_had, patient:, programme:, location:) |
31 | 31 | end |
32 | 32 |
|
| 33 | + its(:consent_status) { should be(:not_required) } |
| 34 | + its(:consent_vaccine_methods) { should be_empty } |
33 | 35 | its(:date) { should eq(vaccination_record.performed_at.to_date) } |
34 | 36 | its(:disease_types) { should eq(%w[human_papillomavirus]) } |
35 | 37 | its(:dose_sequence) { should be_nil } |
|
46 | 48 | create(:vaccination_record, patient:, programme:, location:) |
47 | 49 | end |
48 | 50 |
|
| 51 | + its(:consent_status) { should be(:not_required) } |
| 52 | + its(:consent_vaccine_methods) { should be_empty } |
49 | 53 | its(:date) { should eq(vaccination_record.performed_at.to_date) } |
50 | 54 | its(:disease_types) { should eq(%w[human_papillomavirus]) } |
51 | 55 | its(:dose_sequence) { should be_nil } |
|
62 | 66 | create(:vaccination_record, patient:, programme:, location:) |
63 | 67 | end |
64 | 68 |
|
| 69 | + its(:consent_status) { should be(:no_response) } |
| 70 | + its(:consent_vaccine_methods) { should be_empty } |
65 | 71 | its(:date) { should eq(vaccination_record.performed_at.to_date) } |
66 | 72 | its(:disease_types) { should be_nil } |
67 | 73 | its(:dose_sequence) { should eq(2) } |
|
73 | 79 | context "with consent for the next dose" do |
74 | 80 | before { create(:consent, :given, patient:, programme:) } |
75 | 81 |
|
| 82 | + its(:consent_status) { should be(:given) } |
| 83 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
76 | 84 | its(:status) { should be(:due) } |
77 | 85 | its(:date) { should eq(vaccination_record.performed_at.to_date) } |
78 | 86 | its(:disease_types) { should be_empty } |
|
88 | 96 | create(:vaccination_record, :unwell, patient:, programme:, location:) |
89 | 97 | end |
90 | 98 |
|
| 99 | + its(:consent_status) { should be(:given) } |
| 100 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
91 | 101 | its(:date) { should eq(vaccination_record.performed_at.to_date) } |
92 | 102 | its(:disease_types) { should eq(programme.disease_types) } |
93 | 103 | its(:location_id) { should be_nil } |
|
120 | 130 | create(:vaccination_record, :refused, patient:, programme:, location:) |
121 | 131 | end |
122 | 132 |
|
| 133 | + its(:consent_status) { should be(:given) } |
| 134 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
123 | 135 | its(:date) { should eq(vaccination_record.performed_at.to_date) } |
124 | 136 | its(:disease_types) { should eq(programme.disease_types) } |
125 | 137 | its(:location_id) { should be_nil } |
|
151 | 163 | ) |
152 | 164 | end |
153 | 165 |
|
| 166 | + its(:consent_status) { should be(:given) } |
| 167 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
154 | 168 | its(:date) { should eq(vaccination_record.performed_at.to_date) } |
155 | 169 | its(:disease_types) { should eq(programme.disease_types) } |
156 | 170 | its(:location_id) { should be_nil } |
|
176 | 190 | create(:attendance_record, :absent, patient:, session:) |
177 | 191 | end |
178 | 192 |
|
| 193 | + its(:consent_status) { should be(:given) } |
| 194 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
179 | 195 | its(:date) { should eq(attendance_record.date) } |
180 | 196 | its(:disease_types) { should eq(programme.disease_types) } |
181 | 197 | its(:location_id) { should be_nil } |
|
207 | 223 | ) |
208 | 224 | end |
209 | 225 |
|
| 226 | + its(:consent_status) { should be(:given) } |
| 227 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
210 | 228 | its(:date) { should eq(Date.tomorrow) } |
211 | 229 | its(:disease_types) { should eq(programme.disease_types) } |
212 | 230 | its(:dose_sequence) { should be_nil } |
|
224 | 242 | create(:triage, :invite_to_clinic, patient:, programme:) |
225 | 243 | end |
226 | 244 |
|
| 245 | + its(:consent_status) { should be(:given) } |
| 246 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
227 | 247 | its(:date) { should be_nil } |
228 | 248 | its(:disease_types) { should eq(programme.disease_types) } |
229 | 249 | its(:dose_sequence) { should be_nil } |
|
241 | 261 | create(:triage, :do_not_vaccinate, patient:, programme:) |
242 | 262 | end |
243 | 263 |
|
| 264 | + its(:consent_status) { should be(:given) } |
| 265 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
244 | 266 | its(:date) { should be_nil } |
245 | 267 | its(:disease_types) { should eq(programme.disease_types) } |
246 | 268 | its(:dose_sequence) { should be_nil } |
|
255 | 277 |
|
256 | 278 | before { create(:consent, :given, :needing_triage, patient:, programme:) } |
257 | 279 |
|
| 280 | + its(:consent_status) { should be(:given) } |
| 281 | + its(:consent_vaccine_methods) { should contain_exactly("injection") } |
258 | 282 | its(:date) { should be_nil } |
259 | 283 | its(:disease_types) { should eq(programme.disease_types) } |
260 | 284 | its(:dose_sequence) { should be_nil } |
|
269 | 293 |
|
270 | 294 | before { create(:consent, :refused, patient:, programme:) } |
271 | 295 |
|
| 296 | + its(:consent_status) { should be(:refused) } |
| 297 | + its(:consent_vaccine_methods) { should be_empty } |
272 | 298 | its(:date) { should be_nil } |
273 | 299 | its(:disease_types) { should be_empty } |
274 | 300 | its(:dose_sequence) { should eq(1) } |
|
286 | 312 | create(:consent, :given, patient:, programme:, parent: create(:parent)) |
287 | 313 | end |
288 | 314 |
|
| 315 | + its(:consent_status) { should be(:conflicts) } |
| 316 | + its(:consent_vaccine_methods) { should be_empty } |
289 | 317 | its(:date) { should be_nil } |
290 | 318 | its(:disease_types) { should be_empty } |
291 | 319 | its(:dose_sequence) { should be(1) } |
|
298 | 326 | context "when consent is needed" do |
299 | 327 | let(:programme) { Programme.menacwy } |
300 | 328 |
|
| 329 | + its(:consent_status) { should be(:no_response) } |
| 330 | + its(:consent_vaccine_methods) { should be_empty } |
301 | 331 | its(:date) { should be_nil } |
302 | 332 | its(:disease_types) { should be_nil } |
303 | 333 | its(:dose_sequence) { should be_nil } |
|
316 | 346 | context "when not eligible" do |
317 | 347 | let(:patient) { create(:patient, year_group: 20) } |
318 | 348 |
|
| 349 | + its(:consent_status) { should be(:no_response) } |
| 350 | + its(:consent_vaccine_methods) { should be_empty } |
319 | 351 | its(:date) { should be_nil } |
320 | 352 | its(:disease_types) { should be_nil } |
321 | 353 | its(:dose_sequence) { should be_nil } |
|
0 commit comments