2323 DiagnosticTestOutcomePage ,
2424 OutcomeOfDiagnosticTest ,
2525)
26- from pages .screening_subject_search .episode_events_and_notes_page import (
27- EpisodeEventsAndNotesPage ,
28- )
2926from pages .screening_subject_search .reopen_episode_page import ReopenEpisodePage
3027from utils .appointments import (
3128 AppointmentAttendance ,
32- book_appointments ,
3329 book_post_investigation_appointment ,
3430)
3531from utils .calendar_picker import CalendarPicker
6258from utils .sspi_change_steps import SSPIChangeSteps
6359
6460
65- @pytest .mark .wip
6661@pytest .mark .vpn_required
6762@pytest .mark .regression
6863@pytest .mark .surveillance_regression_tests
6964def test_scenario_5 (page : Page , general_properties : dict ) -> None :
7065 """
71- Discharge below/in-age patient for no contact
66+ Scenario: 5: Discharge below/in-age patient for no contact
7267
7368 X500-X505-A99-A59-A259-A315-A361-A323-A317-A318-A380-X513-X398-X387-X377-C203 [SSCL27b] X900-X600-X615-X625-X398-X387-X377-C203 [SSCL27a]
7469
@@ -136,6 +131,7 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
136131 },
137132 user_role ,
138133 )
134+
139135 # When I receive an SSPI update to change their date of birth to "62" years old
140136 SSPIChangeSteps ().sspi_update_to_change_dob_received (nhs_no , 62 )
141137
@@ -175,6 +171,7 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
175171
176172 # And I record contact with the subject with outcome "Suitable for Endoscopic Test"
177173 ContactWithPatientPage (page ).record_contact ("Suitable for Endoscopic Test" )
174+
178175 # Then my subject has been updated as follows:
179176 subject_assertion (
180177 nhs_no ,
@@ -422,13 +419,15 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
422419 "X398" ,
423420 "Discharge from surveillance - no contact (letter to patient)" ,
424421 )
422+
425423 # Then my subject has been updated as follows:
426424 subject_assertion (
427425 nhs_no ,
428426 {
429427 "latest event status" : "X387 Discharged from Surveillance - Patient Letter Printed"
430428 },
431429 )
430+
432431 # And there is a "X387" letter batch for my subject with the exact title "Discharge from surveillance - no contact (letter to GP)"
433432 # When I process the open "X387" letter batch for my subject
434433 batch_processing (
@@ -467,11 +466,13 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
467466 "surveillance due date reason" : "Discharge from Surveillance - Cannot Contact Patient" ,
468467 }
469468 subject_assertion (nhs_no , criteria )
469+
470470 # When I view the subject
471471 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
472472 # And I reopen the subject's episode for "Reopen due to subject or patient decision"
473473 SubjectScreeningSummaryPage (page ).click_reopen_surveillance_episode_button ()
474474 ReopenEpisodePage (page ).click_reopen_due_to_subject_or_patient_decision ()
475+
475476 # Then my subject has been updated as follows:
476477 criteria = {
477478 "calculated fobt due date" : "Null" ,
@@ -503,20 +504,25 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
503504 "surveillance due date reason" : "Reopened episode" ,
504505 }
505506 subject_assertion (nhs_no , criteria )
507+
506508 # When I receive an SSPI update to change their date of birth to "43" years old
507509 SSPIChangeSteps ().sspi_update_to_change_dob_received (nhs_no , 43 )
510+
508511 # Then my subject has been updated as follows:
509512 subject_assertion (nhs_no , {"subject age" : "43" })
513+
510514 # When I view the subject
511515 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
512516 # And I advance the subject's episode for "Book Surveillance Appointment"
513517 SubjectScreeningSummaryPage (page ).click_advance_surveillance_episode_button ()
514518 AdvanceSurveillanceEpisodePage (page ).click_book_surveillance_appointment_button ()
519+
515520 # Then my subject has been updated as follows:
516521 subject_assertion (
517522 nhs_no ,
518523 {"latest event status" : "X600 Surveillance Appointment Invited" },
519524 )
525+
520526 # When I view the subject
521527 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
522528 # And I choose to book a practitioner clinic for my subject
@@ -525,38 +531,44 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
525531 # And I set the practitioner appointment date to "today"
526532 # And I book the earliest available post investigation appointment on this date
527533 book_post_investigation_appointment (page , "The Royal Hospital (Wolverhampton)" )
534+
528535 # Then my subject has been updated as follows:
529536 subject_assertion (
530537 nhs_no ,
531538 {"latest event status" : "X610 Surveillance Appointment Made" },
532539 )
540+
533541 # And there is a "X610" letter batch for my subject with the exact title "Surveillance Appointment Invitation Letter"
534542 # When I process the open "X610" letter batch for my subject
535543 batch_processing (
536544 page ,
537545 "X610" ,
538546 "Surveillance Appointment Invitation Letter" ,
539547 )
548+
540549 # Then my subject has been updated as follows:
541550 subject_assertion (
542551 nhs_no ,
543552 {
544553 "latest event status" : "X615 Surveillance Appointment Invitation Letter Printed "
545554 },
546555 )
556+
547557 # When I view the subject
548558 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
549559 # And I view the event history for the subject's latest episode
550560 # And I view the latest practitioner appointment in the subject's episode
551561 # And the practitioner DNAs the practitioner appointment
552562 AppointmentAttendance (page ).mark_as_dna ("Practitioner did not attend" )
563+
553564 # Then my subject has been updated as follows:
554565 subject_assertion (
555566 nhs_no ,
556567 {
557568 "latest event status" : "X625 Practitioner did not attend Surveillance Appointment"
558569 },
559570 )
571+
560572 # When I view the subject
561573 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
562574 # And I select the advance episode option for "Discharge from Surveillance - No Patient Contact"
@@ -581,20 +593,23 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
581593 "X398" ,
582594 "Discharge from surveillance - no contact (letter to patient)" ,
583595 )
596+
584597 # Then my subject has been updated as follows:
585598 subject_assertion (
586599 nhs_no ,
587600 {
588601 "latest event status" : "X387 Discharged from Surveillance - Patient Letter Printed"
589602 },
590603 )
604+
591605 # And there is a "X387" letter batch for my subject with the exact title "Discharge from surveillance - no contact (letter to GP)"
592606 # When I process the open "X387" letter batch for my subject
593607 batch_processing (
594608 page ,
595609 "X387" ,
596610 "Discharge from surveillance - no contact (letter to GP)" ,
597611 )
612+
598613 # Then my subject has been updated as follows:
599614 criteria = {
600615 "calculated fobt due date" : "2 years from episode end" ,
@@ -625,5 +640,6 @@ def test_scenario_5(page: Page, general_properties: dict) -> None:
625640 "surveillance due date reason" : "Discharge from Surveillance - Cannot Contact Patient" ,
626641 }
627642 subject_assertion (nhs_no , criteria )
643+
628644 # When I log out
629645 LogoutPage (page ).log_out ()
0 commit comments