|
347 | 347 | programme: "Flu" |
348 | 348 | end |
349 | 349 |
|
350 | | - describe "vaccination not administered" do |
351 | | - before do |
352 | | - create( |
353 | | - :vaccination_record, |
354 | | - :not_administered, |
355 | | - programme: programmes.first, |
356 | | - patient:, |
357 | | - session:, |
358 | | - performed_at: Time.zone.local(2025, 5, 31, 13), |
359 | | - performed_by: user, |
360 | | - notes: "Some notes.", |
361 | | - vaccine: programmes.first.vaccines.find_by!(upload_name: "Gardasil") |
362 | | - ) |
363 | | - end |
364 | | - |
365 | | - include_examples "card", |
366 | | - title: "Vaccination not given: Unwell", |
367 | | - date: "31 May 2025 at 1:00pm", |
368 | | - notes: "Some notes.", |
369 | | - by: "JOY, Nurse", |
370 | | - programme: "HPV" |
371 | | - end |
372 | | - |
373 | 350 | describe "historical upload" do |
374 | 351 | let(:date_and_time) { Time.zone.local(2026, 3, 4, 11, 30) } |
375 | 352 |
|
|
394 | 371 | programme: "HPV" |
395 | 372 | end |
396 | 373 |
|
397 | | - describe "discarded vaccination" do |
398 | | - before do |
399 | | - create( |
400 | | - :vaccination_record, |
401 | | - :discarded, |
402 | | - programme: programmes.first, |
403 | | - patient:, |
404 | | - session:, |
405 | | - performed_at: Time.zone.local(2025, 5, 31, 13), |
406 | | - discarded_at: Time.zone.local(2025, 5, 31, 14), |
407 | | - performed_by: user |
408 | | - ) |
409 | | - end |
410 | | - |
411 | | - include_examples "card", |
412 | | - title: "Vaccinated with Gardasil 9", |
413 | | - date: "31 May 2025 at 1:00pm", |
414 | | - by: "JOY, Nurse", |
415 | | - programme: "HPV" |
416 | | - |
417 | | - include_examples "card", |
418 | | - title: "Vaccination record archived", |
419 | | - date: "31 May 2025 at 2:00pm", |
420 | | - programme: "HPV" |
421 | | - end |
422 | | - |
423 | 374 | describe "self-consent" do |
424 | 375 | before do |
425 | 376 | create( |
|
708 | 659 | end |
709 | 660 |
|
710 | 661 | describe "vaccination records" do |
711 | | - context "for the MMRV variant" do |
| 662 | + let(:programme) { Programme.hpv } |
| 663 | + |
| 664 | + context "for an administered vaccination record" do |
| 665 | + before do |
| 666 | + create( |
| 667 | + :vaccination_record, |
| 668 | + programme:, |
| 669 | + patient:, |
| 670 | + session:, |
| 671 | + performed_at: Time.zone.local(2025, 5, 31, 13), |
| 672 | + performed_by: user, |
| 673 | + notes: "Some notes.", |
| 674 | + vaccine: programme.vaccines.find_by!(upload_name: "Gardasil9") |
| 675 | + ) |
| 676 | + end |
| 677 | + |
| 678 | + include_examples "card", |
| 679 | + title: "Vaccinated with Gardasil 9", |
| 680 | + date: "31 May 2025 at 1:00pm", |
| 681 | + notes: "Some notes.", |
| 682 | + by: "JOY, Nurse", |
| 683 | + programme: "HPV" |
| 684 | + end |
| 685 | + |
| 686 | + context "for an MMRV variant record" do |
712 | 687 | let(:programme) do |
713 | 688 | Programme::Variant.new(Programme.mmr, variant_type: "mmrv") |
714 | 689 | end |
715 | | - let(:programmes) { [programme] } |
716 | 690 |
|
717 | 691 | before do |
718 | 692 | create( |
|
729 | 703 | date: "31 May 2025 at 1:00pm", |
730 | 704 | programme: "MMRV" |
731 | 705 | end |
| 706 | + |
| 707 | + context "for a not administered record" do |
| 708 | + before do |
| 709 | + create( |
| 710 | + :vaccination_record, |
| 711 | + :not_administered, |
| 712 | + programme:, |
| 713 | + patient:, |
| 714 | + session:, |
| 715 | + performed_at: Time.zone.local(2025, 5, 31, 13), |
| 716 | + performed_by: user, |
| 717 | + notes: "Some notes.", |
| 718 | + vaccine: programmes.first.vaccines.find_by!(upload_name: "Gardasil") |
| 719 | + ) |
| 720 | + end |
| 721 | + |
| 722 | + include_examples "card", |
| 723 | + title: "Vaccination not given: Unwell", |
| 724 | + date: "31 May 2025 at 1:00pm", |
| 725 | + notes: "Some notes.", |
| 726 | + by: "JOY, Nurse", |
| 727 | + programme: "HPV" |
| 728 | + end |
| 729 | + |
| 730 | + context "for a discarded record" do |
| 731 | + before do |
| 732 | + create( |
| 733 | + :vaccination_record, |
| 734 | + :discarded, |
| 735 | + programme:, |
| 736 | + patient:, |
| 737 | + session:, |
| 738 | + performed_at: Time.zone.local(2025, 5, 31, 13), |
| 739 | + discarded_at: Time.zone.local(2025, 5, 31, 14), |
| 740 | + performed_by: user |
| 741 | + ) |
| 742 | + end |
| 743 | + |
| 744 | + include_examples "card", |
| 745 | + title: "Vaccinated with Gardasil 9", |
| 746 | + date: "31 May 2025 at 1:00pm", |
| 747 | + by: "JOY, Nurse", |
| 748 | + programme: "HPV" |
| 749 | + |
| 750 | + include_examples "card", |
| 751 | + title: "Vaccination record archived", |
| 752 | + date: "31 May 2025 at 2:00pm", |
| 753 | + programme: "HPV" |
| 754 | + end |
| 755 | + |
| 756 | + context "for a discarded Imms API record" do |
| 757 | + before do |
| 758 | + create( |
| 759 | + :vaccination_record, |
| 760 | + :discarded, |
| 761 | + :sourced_from_nhs_immunisations_api, |
| 762 | + programme:, |
| 763 | + patient:, |
| 764 | + session:, |
| 765 | + performed_at: Time.zone.local(2025, 5, 31, 13), |
| 766 | + discarded_at: Time.zone.local(2025, 5, 31, 14), |
| 767 | + performed_by: user |
| 768 | + ) |
| 769 | + end |
| 770 | + |
| 771 | + it "doesn't render card 'vaccinated'" do |
| 772 | + expect(rendered).not_to have_css( |
| 773 | + ".app-timeline__header", |
| 774 | + text: "Vaccinated with" |
| 775 | + ) |
| 776 | + end |
| 777 | + |
| 778 | + it "doesn't render card 'archived'" do |
| 779 | + expect(rendered).not_to have_css( |
| 780 | + ".app-timeline__header", |
| 781 | + text: "Vaccination record archived" |
| 782 | + ) |
| 783 | + end |
| 784 | + end |
732 | 785 | end |
733 | 786 |
|
734 | 787 | describe "patient merge events" do |
|
0 commit comments