|
31 | 31 | from pages.screening_subject_search.patient_advised_of_diagnosis_page import ( |
32 | 32 | PatientAdvisedOfDiagnosisPage, |
33 | 33 | ) |
| 34 | +from pages.datasets.subject_datasets_page import SubjectDatasetsPage |
| 35 | +from pages.datasets.colonoscopy_dataset_page import ( |
| 36 | + ColonoscopyDatasetsPage, |
| 37 | + FitForColonoscopySspOptions, |
| 38 | +) |
34 | 39 |
|
35 | 40 |
|
36 | | -@pytest.mark.wip |
37 | 41 | @pytest.mark.usefixtures("setup_org_and_appointments") |
38 | 42 | @pytest.mark.vpn_required |
39 | 43 | @pytest.mark.regression |
@@ -458,92 +462,82 @@ def test_scenario_7(page: Page) -> None: |
458 | 462 | screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
459 | 463 |
|
460 | 464 | # And I edit the Colonoscopy Assessment Dataset for this subject |
| 465 | + SubjectScreeningSummaryPage(page).click_datasets_link() |
| 466 | + SubjectDatasetsPage(page).click_colonoscopy_show_datasets() |
461 | 467 |
|
462 | 468 | # And I update the Colonoscopy Assessment Dataset with the following values: |
463 | | - |
464 | | - logging.info(f"NHS NUMBER: {nhs_no}") |
465 | | - LogoutPage(page).log_out() |
466 | | - |
467 | | - |
468 | | -@pytest.mark.wip2 |
469 | | -def test_test(page: Page) -> None: |
470 | | - nhs_no = "9625261559" |
471 | | - UserTools.user_login(page, "Screening Centre Manager at BCS001") |
| 469 | + ColonoscopyDatasetsPage(page).select_fit_for_colonoscopy_option( |
| 470 | + FitForColonoscopySspOptions.NO |
| 471 | + ) |
| 472 | + ColonoscopyDatasetsPage(page).click_dataset_complete_radio_button_yes() |
| 473 | + ColonoscopyDatasetsPage(page).save_dataset() |
472 | 474 |
|
473 | 475 | # And I view the subject |
474 | 476 | screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
475 | 477 |
|
476 | | - # And I view the advance episode options |
| 478 | + # And I advance the subject's episode for "Not Suitable for Diagnostic Tests" |
477 | 479 | SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button() |
478 | | - |
479 | | - # And I select Subsequent Assessment Appointment Required reason "Previous attendance, further assessment required" |
480 | 480 | AdvanceFOBTScreeningEpisodePage( |
481 | 481 | page |
482 | | - ).click_and_select_subsequent_assessment_appointment_required( |
483 | | - "Previous attendance, further assessment required" |
484 | | - ) |
| 482 | + ).click_not_suitable_for_diagnostic_tests_button() |
485 | 483 |
|
486 | 484 | # Then my subject has been updated as follows: |
487 | 485 | subject_assertion( |
488 | | - nhs_no, {"latest event status": "J1 Subsequent Assessment Appointment Required"} |
| 486 | + nhs_no, {"latest event status": "J15 Not Suitable for Diagnostic Tests"} |
489 | 487 | ) |
490 | 488 |
|
491 | | - # When I view the subject |
492 | | - screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
493 | | - |
494 | | - # And I choose to book a practitioner clinic for my subject |
495 | | - SubjectScreeningSummaryPage(page).click_book_practitioner_clinic_button() |
496 | | - |
497 | | - # And I select "BCS001" as the screening centre where the practitioner appointment will be held |
498 | | - # And I set the practitioner appointment date to "today" |
499 | | - # And I book the "earliest" available practitioner appointment on this date |
500 | | - book_appointments( |
| 489 | + # And there is a "J15" letter batch for my subject with the exact title "Subject Discharge (Unsuitable For Further Diagnostic Tests)" |
| 490 | + # When I process the open "J15" letter batch for my subject |
| 491 | + batch_processing( |
501 | 492 | page, |
502 | | - "BCS001 - Wolverhampton Bowel Cancer Screening Centre", |
503 | | - "The Royal Hospital (Wolverhampton)", |
| 493 | + "J15", |
| 494 | + "Subject Discharge (Unsuitable For Further Diagnostic Tests)", |
| 495 | + "J16 - Patient Discharge Sent (Unsuitable for Diagnostic Tests)", |
504 | 496 | ) |
505 | 497 |
|
506 | | - # Then my subject has been updated as follows: |
507 | | - subject_assertion( |
508 | | - nhs_no, |
509 | | - { |
510 | | - "latest event status": "J34 Subsequent Appointment Requested", |
511 | | - }, |
512 | | - ) |
| 498 | + # When I switch users to BCSS "England" as user role "Hub Manager" |
| 499 | + LogoutPage(page).log_out(close_page=False) |
| 500 | + BasePage(page).go_to_log_in_page() |
| 501 | + UserTools.user_login(page, "Hub Manager State Registered at BCS01") |
| 502 | + |
| 503 | + # And there is a "J16" letter batch for my subject with the exact title "GP Discharge (Not Suitable For Diagnostic Tests)" |
| 504 | + # And I process the open "J16" letter batch for my subject |
513 | 505 |
|
514 | | - # And there is a "J34" letter batch for my subject with the exact title "Practitioner Clinic 1st Subsequent Appointment" |
515 | | - # When I process the open "J34" letter batch for my subject |
516 | 506 | batch_processing( |
517 | 507 | page, |
518 | | - "J34", |
519 | | - "Practitioner Clinic 1st Subsequent Appointment", |
520 | | - "J35 - Subsequent Appointment Booked, letter sent", |
| 508 | + "J16", |
| 509 | + "GP Discharge (Not Suitable For Diagnostic Tests)", |
| 510 | + "J17 - GP Discharge Sent (Unsuitable for Diagnostic Tests)", |
521 | 511 | ) |
522 | 512 |
|
523 | | - # When I view the event history for the subject's latest episode |
524 | | - screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
525 | | - SubjectScreeningSummaryPage(page).expand_episodes_list() |
526 | | - SubjectScreeningSummaryPage(page).click_first_fobt_episode_link() |
527 | | - |
528 | | - # And I view the latest practitioner appointment in the subject's episode |
529 | | - EpisodeEventsAndNotesPage(page).click_most_recent_view_appointment_link() |
530 | | - |
531 | | - # And I attend the subject's practitioner appointment "today" |
532 | | - AppointmentDetailPage(page).mark_appointment_as_attended(datetime.today()) |
533 | | - |
534 | 513 | # Then my subject has been updated as follows: |
535 | | - subject_assertion( |
536 | | - nhs_no, |
537 | | - { |
538 | | - "latest event status": "J10 Attended Colonoscopy Assessment Appointment", |
539 | | - }, |
540 | | - ) |
541 | | - |
542 | | - # When I view the subject |
543 | | - screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no) |
544 | | - |
545 | | - # And I edit the Colonoscopy Assessment Dataset for this subject |
546 | | - |
547 | | - # And I update the Colonoscopy Assessment Dataset with the following values: |
548 | | - |
549 | | - logging.info(f"NHS NUMBER: {nhs_no}") |
| 514 | + criteria = { |
| 515 | + "calculated fobt due date": "2 years from latest J16 event", |
| 516 | + "calculated lynch due date": "Unchanged", |
| 517 | + "calculated surveillance due date": "Unchanged", |
| 518 | + "ceased confirmation date": "Null", |
| 519 | + "ceased confirmation details": "Null", |
| 520 | + "ceased confirmation user id": "Null", |
| 521 | + "clinical reason for cease": "Null", |
| 522 | + "latest episode accumulated result": "Definitive abnormal FOBT outcome", |
| 523 | + "latest episode recall calculation method": "Date of last patient letter", |
| 524 | + "latest episode recall episode type": "FOBT Screening", |
| 525 | + "latest episode recall surveillance type": "Null", |
| 526 | + "latest episode status": "Closed", |
| 527 | + "latest episode status reason": "Clinical Reason", |
| 528 | + "latest event status": "J17 GP Discharge Sent (Unsuitable for Diagnostic Tests)", |
| 529 | + "lynch due date": "Null", |
| 530 | + "lynch due date date of change": "Unchanged", |
| 531 | + "lynch due date reason": "unchanged", |
| 532 | + "screening due date": "Calculated FOBT due date", |
| 533 | + "screening due date date of change": "Today", |
| 534 | + "screening due date reason": "Recall", |
| 535 | + "screening status": "Recall", |
| 536 | + "screening status date of change": "Today", |
| 537 | + "screening status reason": "Recall", |
| 538 | + "surveillance due date date of change": "Unchanged", |
| 539 | + "surveillance due date reason": "unchanged", |
| 540 | + "surveillance due date": "Null", |
| 541 | + } |
| 542 | + subject_assertion(nhs_no, criteria) |
| 543 | + LogoutPage(page).log_out() |
0 commit comments