4141from pages .screening_subject_search .diagnostic_test_outcome_page import (
4242 DiagnosticTestOutcomePage ,
4343 OutcomeOfDiagnosticTest ,
44+ ReasonForOnwardReferral ,
45+ ReferralProcedureType ,
4446)
4547
4648
@@ -394,9 +396,9 @@ def test_scenario_8(page: Page) -> None:
394396 # "surveillance due date reason": "Unchanged",
395397 # }
396398 # subject_assertion(nhs_no, criteria)
397- nhs_no = "9668188616"
399+
398400 # When I view the subject
399- screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
401+ # screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
400402
401403 # # And I reopen the subject's episode for "Reopen to Reschedule Diagnostic Test"
402404 # SubjectScreeningSummaryPage(page).click_reopen_fobt_screening_episode_button()
@@ -487,95 +489,102 @@ def test_scenario_8(page: Page) -> None:
487489 # subject_assertion(nhs_no, criteria)
488490
489491 # When I view the subject
490- screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
492+ # screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
491493
492- # And I edit the Investigation Dataset for this subject
493- SubjectScreeningSummaryPage (page ).click_datasets_link ()
494- SubjectDatasetsPage (page ).click_investigation_show_datasets ()
495-
496- # And I set the following fields and values within the Investigation Dataset for this subject:
497- general_information = {
498- "site" : 1 ,
499- "practitioner" : 1 ,
500- "testing clinician" : 1 ,
501- "reporting radiologist" : 2 ,
502- "fit for subsequent endoscopic referral" : YesNoOptions .YES ,
503- }
504-
505- # And I set the following fields and values within the Contrast, Tagging & Drug Information:
506- # And I add the following Additional Bowel Preparation drugs and values within the Investigation Dataset for this subject:
507- contrast_tagging_and_drug = {
508- "iv buscopan administered" : CancerRadiologyYesNoOptions .NO ,
509- "contraindicated" : YesNoOptions .NO ,
510- "iv contrast administered" : IVConstantAdministeredOptions .NO ,
511- "tagging agent given" : TaggingAgentDrugAdministeredOptions .YES ,
512- "additional bowel preparation administered" : AdditionalBowelPrepAdministeredOptions .YES ,
513- "drug_type1" : DrugTypeOptions .PICOLAX ,
514- "drug_dose1" : "1" ,
515- }
516-
517- # And I add the following "Tagging Agent Given" drugs and doses within the Investigation Dataset for this subject:
518- # | Gastrografin | 1 |
519- tagging_agent_given_drug_information = {
520- "drug_type1" : DrugTypeOptions .GASTROGRAFIN ,
521- "drug_dose1" : "1" ,
522- }
523-
524- # And I set the following fields and values within the Radiology Information:
525- # And I set the following fields and values within the Radiology Information:
526- radiology_information = {
527- "examination_quality" : ExaminationQualityOptions .GOOD ,
528- "scan_position" : ScanPositionOptions .DUAL ,
529- "procedure_outcome" : ProcedureOutcomeOptions .LEAVE_DEPARTMENT ,
530- "late_outcome" : RadiologyLateOutcomeOptions .NO_COMPLICATIONS ,
531- "segmental_inadequacy" : SegmentalInadequacyOptions .NO ,
532- "intracolonic_summary_code" : IntracolonicSummaryCodeOptions .CX_INADEQUATE_STUDY ,
533- "extracolonic_summary_code" : ExtracolonicSummaryCodeOptions .E4_IMPORTANT_REQUIRES_ACTION ,
534- }
535-
536- suspected_findings = {
537- "extracolonic summary code" : ExtracolonicSummaryCodeOptions .E4_IMPORTANT_REQUIRES_ACTION ,
538- }
494+ # # And I edit the Investigation Dataset for this subject
495+ # SubjectScreeningSummaryPage(page).click_datasets_link()
496+ # SubjectDatasetsPage(page).click_investigation_show_datasets()
497+
498+ # # And I set the following fields and values within the Investigation Dataset for this subject:
499+ # general_information = {
500+ # "site": 1,
501+ # "practitioner": 1,
502+ # "testing clinician": 1,
503+ # "reporting radiologist": 2,
504+ # "fit for subsequent endoscopic referral": YesNoOptions.YES,
505+ # }
506+
507+ # # And I set the following fields and values within the Contrast, Tagging & Drug Information:
508+ # # And I add the following Additional Bowel Preparation drugs and values within the Investigation Dataset for this subject:
509+ # contrast_tagging_and_drug = {
510+ # "iv buscopan administered": CancerRadiologyYesNoOptions.NO,
511+ # "contraindicated": YesNoOptions.NO,
512+ # "iv contrast administered": IVConstantAdministeredOptions.NO,
513+ # "tagging agent given": TaggingAgentDrugAdministeredOptions.YES,
514+ # "additional bowel preparation administered": AdditionalBowelPrepAdministeredOptions.YES,
515+ # "drug_type1": DrugTypeOptions.PICOLAX,
516+ # "drug_dose1": "1",
517+ # }
518+
519+ # # And I add the following "Tagging Agent Given" drugs and doses within the Investigation Dataset for this subject:
520+ # # | Gastrografin | 1 |
521+ # tagging_agent_given_drug_information = {
522+ # "drug_type1": DrugTypeOptions.GASTROGRAFIN,
523+ # "drug_dose1": "1",
524+ # }
525+
526+ # # And I set the following fields and values within the Radiology Information:
527+ # # And I set the following fields and values within the Radiology Information:
528+ # radiology_information = {
529+ # "examination_quality": ExaminationQualityOptions.GOOD,
530+ # "scan_position": ScanPositionOptions.DUAL,
531+ # "procedure_outcome": ProcedureOutcomeOptions.LEAVE_DEPARTMENT,
532+ # "late_outcome": RadiologyLateOutcomeOptions.NO_COMPLICATIONS,
533+ # "segmental_inadequacy": SegmentalInadequacyOptions.NO,
534+ # "intracolonic_summary_code": IntracolonicSummaryCodeOptions.CX_INADEQUATE_STUDY,
535+ # }
536+
537+ # suspected_findings = {
538+ # "extracolonic summary code": ExtracolonicSummaryCodeOptions.E4_IMPORTANT_REQUIRES_ACTION,
539+ # }
539540
540541 # # And I set the following radiology failure reasons within the Investigation Dataset for this subject:
541542 # # | No failure reasons | NOTE - this can be left as default - there is only one option
542543
544+ # # And I open all minimized sections on the dataset
545+ # # And I mark the Investigation Dataset as completed
546+ # # # When I press the save Investigation Dataset button
547+ # # # And I press OK on my confirmation prompt
548+ # InvestigationDatasetCompletion(page).complete_dataset_with_args(
549+ # general_information=general_information,
550+ # contrast_tagging_and_drug=contrast_tagging_and_drug,
551+ # tagging_agent_given_drug_information=tagging_agent_given_drug_information,
552+ # radiology_information=radiology_information,
553+ # suspected_findings = suspected_findings,
554+ # )
543555
544- # And I open all minimized sections on the dataset
545- # And I mark the Investigation Dataset as completed
546- # # When I press the save Investigation Dataset button
547- # # And I press OK on my confirmation prompt
548- InvestigationDatasetCompletion (page ).complete_dataset_with_args (
549- general_information = general_information ,
550- contrast_tagging_and_drug = contrast_tagging_and_drug ,
551- tagging_agent_given_drug_information = tagging_agent_given_drug_information ,
552- radiology_information = radiology_information ,
553- suspected_findings = suspected_findings ,
554- )
555-
556- # Then my subject has been updated as follows:
557- # TODO: For this assertion I'm getting:
558- # [ASSERTION MISMATCH] Key: 'latest episode accumulated result' | Expected: 'Abnormal' | Actual: '<missing>'
556+ # # Then my subject has been updated as follows:
559557 # criteria = {
560558 # "latest episode accumulated result": "Abnormal",
561559 # }
562560 # subject_assertion(nhs_no, criteria)
563561
564- # # When I view the subject
565- # screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
562+ nhs_no = "9668188616" # TODO: Remove when subject search is re-added
566563
567- # # And I select the advance episode option for "Enter Diagnostic Test Outcome"
568- # SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
569- # AdvanceFOBTScreeningEpisodePage(page).click_enter_diagnostic_test_outcome_button()
564+ # When I view the subject
565+ screening_subject_page_searcher .navigate_to_subject_summary_page (page , nhs_no )
570566
571- # # And I select Outcome of Diagnostic Test "Refer Another Diagnostic Test"
572- # DiagnosticTestOutcomePage(page).select_test_outcome_option(
573- # OutcomeOfDiagnosticTest.REFER_ANOTHER_DIAGNOSTIC_TEST
574- # )
567+ # And I select the advance episode option for "Enter Diagnostic Test Outcome"
568+ SubjectScreeningSummaryPage (page ).click_advance_fobt_screening_episode_button ()
569+ AdvanceFOBTScreeningEpisodePage (page ).click_enter_diagnostic_test_outcome_button ()
570+
571+ # And I select Outcome of Diagnostic Test "Refer Another Diagnostic Test"
572+ DiagnosticTestOutcomePage (page ).select_test_outcome_option (
573+ OutcomeOfDiagnosticTest .REFER_ANOTHER_DIAGNOSTIC_TEST
574+ )
575+
576+ # And I select Radiological or Endoscopic Referral value "Radiological"
577+ DiagnosticTestOutcomePage (page ).select_referral_procedure_type (
578+ ReferralProcedureType .RADIOLOGICAL
579+ )
580+
581+ # And I select Reason for Onward Referral value "Currently Unsuitable for Endoscopic Referral"
582+ DiagnosticTestOutcomePage (page ).select_reason_for_onward_referral (
583+ ReasonForOnwardReferral .CURRENTLY_UNSUITABLE_FOR_ENDOSCOPIC_REFERRAL
584+ )
575585
576- # # # TODO: And I select Radiological or Endoscopic Referral value "Radiological"
577- # # # And I select Reason for Onward Referral value "Currently Unsuitable for Endoscopic Referral"
578- # # # And I set any onward referring clinician
586+ # And I set any onward referring clinician TODO: This step is not selecting a clinician so needs to be fixed
587+ DiagnosticTestOutcomePage (page ).select_first_valid_onward_referral_consultant ()
579588
580589 # # And I save the Diagnostic Test Outcome
581590 # DiagnosticTestOutcomePage(page).click_save_button()
@@ -586,7 +595,7 @@ def test_scenario_8(page: Page) -> None:
586595 # }
587596 # subject_assertion(nhs_no, criteria)
588597
589- # # # When I advance the subject's episode for "Post-investigation Appointment Required"
598+ # # When I advance the subject's episode for "Post-investigation Appointment Required"
590599 # screening_subject_page_searcher.navigate_to_subject_summary_page(page, nhs_no)
591600 # SubjectScreeningSummaryPage(page).click_advance_fobt_screening_episode_button()
592601 # AdvanceFOBTScreeningEpisodePage(
0 commit comments