|
14 | 14 | from utils.appointments import book_appointments, book_post_investigation_appointment |
15 | 15 | from utils.oracle.oracle import OracleDB |
16 | 16 | from utils.investigation_dataset import InvestigationDatasetCompletion |
17 | | -from utils.datasets.investigation_datasets import ( |
18 | | - get_default_general_information, |
19 | | - get_default_drug_information, |
20 | | - get_default_endoscopy_information, |
21 | | - get_normal_smokescreen_information, |
22 | | -) |
23 | | -from utils.sspi_change_steps import SSPIChangeSteps |
24 | 17 | from pages.screening_subject_search.subject_screening_summary_page import ( |
25 | 18 | SubjectScreeningSummaryPage, |
26 | 19 | ) |
|
35 | 28 | ) |
36 | 29 | from pages.screening_practitioner_appointments.appointment_detail_page import ( |
37 | 30 | AppointmentDetailPage, |
| 31 | + ReasonForCancellationOptions, |
38 | 32 | ) |
39 | 33 | from pages.screening_subject_search.advance_fobt_screening_episode_page import ( |
40 | 34 | AdvanceFOBTScreeningEpisodePage, |
|
50 | 44 | ColonoscopyDatasetsPage, |
51 | 45 | FitForColonoscopySspOptions, |
52 | 46 | ) |
53 | | -from pages.screening_subject_search.contact_with_patient_page import ( |
54 | | - ContactWithPatientPage, |
55 | | -) |
56 | | -from pages.organisations.organisations_page import OrganisationSwitchPage |
57 | 47 | from pages.datasets.investigation_dataset_page import ( |
58 | 48 | InvestigationDatasetsPage, |
59 | 49 | FailureReasonsOptions, |
|
66 | 56 | OutcomeAtTimeOfProcedureOptions, |
67 | 57 | YesNoOptions, |
68 | 58 | CompletionProofOptions, |
69 | | - AdenomaSubTypeOptions, |
70 | 59 | EndoscopyLocationOptions, |
71 | 60 | OpticalDiagnosisConfidenceOptions, |
72 | 61 | OpticalDiagnosisOptions, |
73 | 62 | PolypAccessOptions, |
74 | 63 | PolypClassificationOptions, |
75 | | - PolypDysplasiaOptions, |
76 | 64 | PolypExcisionCompleteOptions, |
77 | 65 | PolypInterventionDeviceOptions, |
78 | | - PolypInterventionExcisionTechniqueOptions, |
79 | 66 | PolypInterventionModalityOptions, |
80 | 67 | PolypInterventionRetrievedOptions, |
81 | | - PolypInterventionSuccessOptions, |
82 | | - PolypReasonLeftInSituOptions, |
83 | 68 | PolypTypeOptions, |
84 | | - ReasonPathologyLostOptions, |
85 | 69 | SerratedLesionSubTypeOptions, |
86 | | - YesNoUncertainOptions, |
87 | | -) |
88 | | -from pages.screening_subject_search.reopen_fobt_screening_episode_page import ( |
89 | | - ReopenFOBTScreeningEpisodePage, |
90 | 70 | ) |
91 | 71 | from classes.repositories.person_repository import PersonRepository |
| 72 | +from pages.login.select_job_role_page import SelectJobRolePage |
92 | 73 |
|
93 | 74 |
|
94 | | -@pytest.mark.wip |
95 | 75 | @pytest.mark.usefixtures("setup_org_and_appointments") |
96 | 76 | @pytest.mark.vpn_required |
97 | 77 | @pytest.mark.regression |
@@ -640,5 +620,205 @@ def test_scenario_11(page: Page) -> None: |
640 | 620 | EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link() |
641 | 621 |
|
642 | 622 | # And The Screening Centre cancels the practitioner appointment with reason "Screening Centre Cancelled" |
| 623 | + AppointmentDetailPage(page).check_cancel_radio() |
| 624 | + AppointmentDetailPage(page).select_reason_for_cancellation_option( |
| 625 | + ReasonForCancellationOptions.SCREENING_CENTRE_CANCELLED |
| 626 | + ) |
| 627 | + |
| 628 | + # And I press OK on my confirmation prompt |
| 629 | + AppointmentDetailPage(page).click_save_button(accept_dialog=True) |
| 630 | + |
| 631 | + # Then my subject has been updated as follows: |
| 632 | + subject_assertion( |
| 633 | + nhs_no, |
| 634 | + { |
| 635 | + "latest event status": "A417 Post-investigation Appointment Cancelled by SC", |
| 636 | + }, |
| 637 | + ) |
| 638 | + |
| 639 | + # And there is a "A417" letter batch for my subject with the exact title "Post-Investigation Appointment Cancelled (Screening Centre)" |
| 640 | + # When I process the open "A417" letter batch for my subject |
| 641 | + batch_processing( |
| 642 | + page, |
| 643 | + "A417", |
| 644 | + "Post-Investigation Appointment Cancelled (Screening Centre)", |
| 645 | + "A422 - Post-investigation Appointment Cancellation Letter Printed", |
| 646 | + ) |
| 647 | + |
| 648 | + # When I advance the subject's episode for "Post-investigation Appointment Required" |
| 649 | + SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button() |
| 650 | + AdvanceFOBTScreeningEpisodePage( |
| 651 | + page |
| 652 | + ).click_post_investigation_appointment_required_button() |
| 653 | + |
| 654 | + # Then my subject has been updated as follows: |
| 655 | + subject_assertion( |
| 656 | + nhs_no, |
| 657 | + { |
| 658 | + "latest event status": "A360 - Post-investigation Appointment Required", |
| 659 | + }, |
| 660 | + ) |
| 661 | + |
| 662 | + # When I view the subject |
| 663 | + screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
643 | 664 |
|
| 665 | + # And I choose to book a practitioner clinic for my subject |
| 666 | + SubjectScreeningSummaryPage(page).click_book_practitioner_clinic_button() |
| 667 | + |
| 668 | + # And I set the practitioner appointment date to "today" |
| 669 | + # And I book the earliest available post investigation appointment on this date |
| 670 | + book_post_investigation_appointment(page, "The Royal Hospital (Wolverhampton)", 1) |
| 671 | + |
| 672 | + # Then my subject has been updated as follows: |
| 673 | + subject_assertion( |
| 674 | + nhs_no, |
| 675 | + { |
| 676 | + "latest event status": "A410 - Post-investigation Appointment Made", |
| 677 | + }, |
| 678 | + ) |
| 679 | + |
| 680 | + # And there is a "A410" letter batch for my subject with the exact title "Post-Investigation Appointment Invitation Letter" |
| 681 | + # When I process the open "A410 - Post-Investigation Appointment Invitation Letter" letter batch for my subject |
| 682 | + batch_processing( |
| 683 | + page, |
| 684 | + "A410", |
| 685 | + "Post-Investigation Appointment Invitation Letter", |
| 686 | + "A415 - Post-investigation Appointment Invitation Letter Printed", |
| 687 | + ) |
| 688 | + |
| 689 | + # When I view the subject |
| 690 | + screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
| 691 | + |
| 692 | + # And I view the event history for the subject's latest episode |
| 693 | + SubjectScreeningSummaryPage(page).expand_episodes_list() |
| 694 | + SubjectScreeningSummaryPage(page).click_first_fobt_episode_link() |
| 695 | + |
| 696 | + # And I view the latest practitioner appointment in the subject's episode |
| 697 | + EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link() |
| 698 | + |
| 699 | + # And I attend the subject's practitioner appointment "yesterday" |
| 700 | + AppointmentDetailPage(page).mark_appointment_as_attended( |
| 701 | + datetime.today() - timedelta(days=1) |
| 702 | + ) |
| 703 | + |
| 704 | + # Then my subject has been updated as follows: |
| 705 | + subject_assertion( |
| 706 | + nhs_no, |
| 707 | + { |
| 708 | + "latest event status": "A416 - Post-investigation Appointment Attended", |
| 709 | + }, |
| 710 | + ) |
| 711 | + |
| 712 | + # When I view the subject |
| 713 | + screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
| 714 | + |
| 715 | + # And I view the advance episode options |
| 716 | + SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button() |
| 717 | + |
| 718 | + # And I select the advance episode option for "Record Diagnosis Date" |
| 719 | + AdvanceFOBTScreeningEpisodePage(page).click_record_diagnosis_date_button() |
| 720 | + |
| 721 | + # And I enter a Diagnosis Date of "today" |
| 722 | + RecordDiagnosisDatePage(page).enter_date_in_diagnosis_date_field(datetime.today()) |
| 723 | + |
| 724 | + # And I save Diagnosis Date Information |
| 725 | + RecordDiagnosisDatePage(page).click_save_button() |
| 726 | + |
| 727 | + # Then my subject has been updated as follows: |
| 728 | + criteria = { |
| 729 | + "latest episode diagnosis date reason": "Null", |
| 730 | + "latest episode has diagnosis date": "Yes", |
| 731 | + "latest episode includes event status": "A50 Diagnosis date recorded", |
| 732 | + "latest event status": "A416 Post-investigation Appointment Attended", |
| 733 | + } |
| 734 | + subject_assertion(nhs_no, criteria) |
| 735 | + |
| 736 | + # When I view the subject |
| 737 | + screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
| 738 | + |
| 739 | + # And I select the advance episode option for "Enter Diagnostic Test Outcome" |
| 740 | + SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button() |
| 741 | + AdvanceFOBTScreeningEpisodePage(page).click_enter_diagnostic_test_outcome_button() |
| 742 | + |
| 743 | + # And I select Outcome of Investigation Complete |
| 744 | + DiagnosticTestOutcomePage(page).select_test_outcome_option( |
| 745 | + OutcomeOfDiagnosticTest.INVESTIGATION_COMPLETE |
| 746 | + ) |
| 747 | + |
| 748 | + # And I save the Diagnostic Test Outcome |
| 749 | + DiagnosticTestOutcomePage(page).click_save_button() |
| 750 | + |
| 751 | + # Then my subject has been updated as follows: |
| 752 | + criteria = { |
| 753 | + "latest episode includes event status": "A316 Post-investigation Appointment Attended", |
| 754 | + "latest event status": "A430 Post-investigation Appointment Attended - Diagnostic Result Letter not Printed", |
| 755 | + } |
| 756 | + subject_assertion(nhs_no, criteria) |
| 757 | + |
| 758 | + # When I switch users to BCSS "England" as user role "Hub Manager" |
| 759 | + LogoutPage(page).log_out(close_page=False) |
| 760 | + BasePage(page).go_to_log_in_page() |
| 761 | + UserTools.user_login(page, "Hub Manager State Registered at BCS01") |
| 762 | + |
| 763 | + # And I process the open "A183 - GP Result (Abnormal)" letter batch for my subject |
| 764 | + batch_processing( |
| 765 | + page, |
| 766 | + "A183", |
| 767 | + "GP Result (Abnormal)", |
| 768 | + ) |
| 769 | + |
| 770 | + # Then my subject has been updated as follows: |
| 771 | + criteria = { |
| 772 | + "latest episode includes event status": "A167 GP Abnormal FOBT Result Sent", |
| 773 | + "latest event status": "A430 Post-investigation Appointment Attended - Diagnostic Result Letter not Printed", |
| 774 | + } |
| 775 | + subject_assertion(nhs_no, criteria) |
| 776 | + |
| 777 | + # When I switch users to BCSS "England" as user role "Screening Centre Clerk" |
| 778 | + LogoutPage(page).log_out(close_page=False) |
| 779 | + BasePage(page).go_to_log_in_page() |
| 780 | + UserTools.user_login(page, "Screening Centre Clerk at BCS001") |
| 781 | + SelectJobRolePage(page).select_option_for_job_role("Screening Centre Clerk") |
| 782 | + SelectJobRolePage(page).click_continue_button() |
| 783 | + |
| 784 | + # And there is a "A430" letter batch for my subject with the exact title "Result Letters Following Post-investigation Appointment" |
| 785 | + # And I process the open "A430" letter batch for my subject |
| 786 | + batch_processing( |
| 787 | + page, |
| 788 | + "A430", |
| 789 | + "Result Letters Following Post-investigation Appointment", |
| 790 | + ) |
| 791 | + # Then my subject has been updated as follows: |
| 792 | + criteria = { |
| 793 | + "which diagnostic test": "Latest not-void test in latest episode", |
| 794 | + "calculated fobt due date": "2 years from diagnostic test", |
| 795 | + "calculated lynch due date": "Null", |
| 796 | + "calculated surveillance due date": "Unchanged", |
| 797 | + "ceased confirmation date": "Null", |
| 798 | + "ceased confirmation details": "Null", |
| 799 | + "ceased confirmation user id": "Null", |
| 800 | + "clinical reason for cease": "Null", |
| 801 | + "latest episode accumulated result": "Abnormal", |
| 802 | + "latest episode recall calculation method": "Diagnostic test date", |
| 803 | + "latest episode recall episode type": "FOBT Screening", |
| 804 | + "latest episode recall surveillance type": "Null", |
| 805 | + "latest episode status": "Closed", |
| 806 | + "latest episode status reason": "Episode Complete", |
| 807 | + "latest event status": "A65 Abnormal", |
| 808 | + "lynch due date": "Null", |
| 809 | + "lynch due date reason": "Unchanged", |
| 810 | + "lynch due date date of change": "Unchanged", |
| 811 | + "screening due date": "Calculated FOBT Due Date", |
| 812 | + "screening due date date of change": "Today", |
| 813 | + "screening due date reason": "Recall", |
| 814 | + "screening status": "Recall", |
| 815 | + "screening status reason": "Recall", |
| 816 | + "surveillance due date": "Null", |
| 817 | + "surveillance due date date of change": "Unchanged", |
| 818 | + "surveillance due date reason": "Unchanged", |
| 819 | + "symptomatic procedure date": "Null", |
| 820 | + "symptomatic procedure result": "Null", |
| 821 | + "screening referral type": "Null", |
| 822 | + } |
| 823 | + subject_assertion(nhs_no, criteria) |
644 | 824 | LogoutPage(page).log_out() |
0 commit comments