2626 AppointmentDetailPage ,
2727 ReasonForCancellationOptions ,
2828)
29+ from pages .screening_subject_search .advance_fobt_screening_episode_page import (
30+ AdvanceFOBTScreeningEpisodePage ,
31+ )
32+ from pages .screening_subject_search .record_diagnosis_date_page import (
33+ RecordDiagnosisDatePage ,
34+ )
2935
3036
3137@pytest .mark .wip
38+ @pytest .mark .usefixtures ("setup_org_and_appointments" )
3239@pytest .mark .vpn_required
3340@pytest .mark .regression
3441@pytest .mark .fobt_regression_tests
@@ -294,41 +301,25 @@ def test_scenario_4(page: Page) -> None:
294301 )
295302
296303 # And there is a "A183" letter batch for my subject with the exact title "Practitioner Clinic 1st Appointment"
297- batch_processing (
298- page ,
299- "A183" ,
300- "Practitioner Clinic 1st Appointment" ,
301- "A183 1st Colonoscopy Assessment Appointment Requested" ,
302- True ,
303- )
304-
305- # And there is a "A183" letter batch for my subject with the exact title "GP Result (Abnormal)"
306- batch_processing (
307- page ,
308- "A183" ,
309- "GP Result (Abnormal)" ,
310- "A183 1st Colonoscopy Assessment Appointment Requested" ,
311- True ,
312- )
313-
314304 # When I process the open "A183 - Practitioner Clinic 1st Appointment" letter batch for my subject
315305 # Then my subject has been updated as follows:
316306 batch_processing (
317307 page ,
318308 "A183" ,
319309 "Practitioner Clinic 1st Appointment" ,
320- "A25 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
321- False ,
310+ "A25 - 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
311+ True ,
322312 )
323313
314+ # And there is a "A183" letter batch for my subject with the exact title "GP Result (Abnormal)"
324315 # When I process the open "A183 - GP Result (Abnormal)" letter batch for my subject
325316 # Then my subject has been updated as follows:
326317 batch_processing (
327318 page ,
328319 "A183" ,
329320 "GP Result (Abnormal)" ,
330- "A167 GP Abnormal FOBT Result Sent" ,
331- False ,
321+ "A167 - GP Abnormal FOBT Result Sent" ,
322+ True ,
332323 )
333324
334325 # When I switch users to BCSS "England" as user role "Screening Centre Manager"
@@ -366,15 +357,10 @@ def test_scenario_4(page: Page) -> None:
366357 page ,
367358 "J4" ,
368359 "Appointment Cancellation (Patient to Consider)" ,
369- "J22 Appointment Cancellation letter sent (Patient to Consider)" ,
360+ "J22 - Appointment Cancellation letter sent (Patient to Consider)" ,
370361 False ,
371362 )
372363
373- # # TODO: But there is no "J22" letter batch for my subject with the exact title "Subject Discharge (Refused Appointment)"
374- # batch_processing.assert_batch_absence(
375- # nhs_no, "J22", "Subject Discharge (Refused Appointment)"
376- # )
377-
378364 # When I switch users to BCSS "England" as user role "Hub Manager"
379365 LogoutPage (page ).log_out (close_page = False )
380366 BasePage (page ).go_to_log_in_page ()
@@ -404,22 +390,14 @@ def test_scenario_4(page: Page) -> None:
404390 )
405391
406392 # And there is a "J20" letter batch for my subject with the exact title "Practitioner Clinic 1st Appt Cancelled (Patient To Reschedule)"
407- batch_processing (
408- page ,
409- "J20" ,
410- "Practitioner Clinic 1st Appt Cancelled (Patient To Reschedule)" ,
411- "J20 Appointment Requested (Patient to Reschedule Letter)" ,
412- True ,
413- )
414-
415393 # When I process the open "J20" letter batch for my subject
416394 # Then my subject has been updated as follows:
417395 batch_processing (
418396 page ,
419397 "J20" ,
420398 "Practitioner Clinic 1st Appt Cancelled (Patient To Reschedule)" ,
421- "A25 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
422- False ,
399+ "A25 - 1st Colonoscopy Assessment Appointment Booked, letter sent" ,
400+ True ,
423401 )
424402
425403 # When I switch users to BCSS "England" as user role "Screening Centre Manager"
@@ -452,30 +430,13 @@ def test_scenario_4(page: Page) -> None:
452430 )
453431
454432 # And there is a "J24" letter batch for my subject with the exact title "Subject Discharge (Screening Centre)"
455- batch_processing (
456- page ,
457- "J24" ,
458- "Subject Discharge (Screening Centre)" ,
459- "J24 Screening Centre Discharge Patient" ,
460- True ,
461- )
462-
463433 # When I process the open "J24 - Subject Discharge (Screening Centre)" letter batch for my subject
464434 # Then my subject has been updated as follows:
465435 batch_processing (
466436 page ,
467437 "J24" ,
468438 "Subject Discharge (Screening Centre)" ,
469- "J25 Patient discharge sent (Screening Centre discharge patient)" ,
470- False ,
471- )
472-
473- # And there is a "J25" letter batch for my subject with the exact title "GP Discharge (Discharged By Screening Centre)"
474- batch_processing (
475- page ,
476- "J25" ,
477- "GP Discharge (Discharged By Screening Centre)" ,
478- "J25 Patient discharge sent (Screening Centre discharge patient)" ,
439+ "J25 - Patient discharge sent (Screening Centre discharge patient)" ,
479440 True ,
480441 )
481442
@@ -484,25 +445,30 @@ def test_scenario_4(page: Page) -> None:
484445 BasePage (page ).go_to_log_in_page ()
485446 UserTools .user_login (page , "Hub Manager State Registered at BCS01" )
486447
448+ # And there is a "J25" letter batch for my subject with the exact title "GP Discharge (Discharged By Screening Centre)"
487449 # And I process the open "J25" letter batch for my subject
488450 # Then my subject has been updated as follows:
489451 batch_processing (
490452 page ,
491453 "J25" ,
492454 "GP Discharge (Discharged By Screening Centre)" ,
493- "P202 Waiting Completion of Outstanding Events" ,
455+ "P202 - Waiting Completion of Outstanding Events" ,
494456 False ,
495457 )
496458
497459 # When I view the subject
498460 screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
499461
500- # # TODO: And I select the advance episode option for "Record Diagnosis Date"
501- # # And I select Diagnosis Date Reason "Patient choice"
462+ # And I select the advance episode option for "Record Diagnosis Date"
463+ AdvanceFOBTScreeningEpisodePage (page ).click_record_diagnosis_date_button ()
464+
465+ # # TODO: And I select Diagnosis Date Reason "Patient choice"
466+ RecordDiagnosisDatePage (page ).record_diagnosis_date_with_reason (
467+ date = datetime .now (), reason_text = "Patient Choice"
468+ )
469+
502470 # # And I save Diagnosis Date Information
503- # CallAndRecallUtils().record_diagnosis_date(
504- # nhs_no, reason="Patient choice", has_diagnosis_date=False
505- # )
471+ RecordDiagnosisDatePage (page ).click_save_button ()
506472
507473 # Then my subject has been updated as follows:
508474 subject_assertion (
@@ -511,29 +477,29 @@ def test_scenario_4(page: Page) -> None:
511477 "calculated FOBT due date" : "2 years from latest J25 event" ,
512478 "calculated lynch due date" : "Unchanged" ,
513479 "calculated surveillance due date" : "Unchanged" ,
514- "ceased confirmation date" : None ,
515- "ceased confirmation details" : None ,
516- "ceased confirmation user ID" : None ,
517- "clinical reason for cease" : None ,
480+ "ceased confirmation date" : "Null" ,
481+ "ceased confirmation details" : "Null" ,
482+ "ceased confirmation user ID" : "Null" ,
483+ "clinical reason for cease" : "Null" ,
518484 "latest episode accumulated result" : "Definitive abnormal FOBT outcome" ,
519485 "latest episode diagnosis date reason" : "Patient choice" ,
520486 "latest episode has diagnosis date" : "No" ,
521487 "latest episode includes event status" : "A52 No diagnosis date recorded" ,
522488 "latest episode recall calculation method" : "Date of last patient letter" ,
523489 "latest episode recall episode type" : "FOBT Screening" ,
524- "latest episode recall surveillance type" : None ,
490+ "latest episode recall surveillance type" : "Null" ,
525491 "latest episode status" : "Closed" ,
526492 "latest episode status reason" : "Discharged" ,
527493 "latest event status" : "J26 GP Discharge letter sent (Discharge by Screening centre)" ,
528- "lynch due date" : None ,
494+ "lynch due date" : "Null" ,
529495 "lynch due date date of change" : "Unchanged" ,
530496 "lynch due date reason" : "Unchanged" ,
531- "screening due date" : None ,
497+ "screening due date" : "Null" ,
532498 "screening due date date of change" : "Today" ,
533499 "screening due date reason" : "Awaiting failsafe" ,
534500 "screening status" : "Recall" ,
535501 "screening status reason" : "Recall" ,
536- "surveillance due date" : None ,
502+ "surveillance due date" : "Null" ,
537503 "surveillance due date reason" : "Unchanged" ,
538504 "surveillance due date date of change" : "Unchanged" ,
539505 },
0 commit comments