44from utils .screening_subject_page_searcher import verify_subject_event_status_by_nhs_no
55from utils .batch_processing import batch_processing
66from pages .logout .log_out_page import LogoutPage
7+ from utils .oracle .oracle_specific_functions import (
8+ get_subjects_for_investigation_dataset_updates ,
9+ )
10+ from utils .subject_demographics import SubjectDemographicUtil
711from utils .investigation_dataset import (
812 InvestigationDatasetCompletion ,
913 InvestigationDatasetResults ,
1519@pytest .mark .vpn_required
1620@pytest .mark .smokescreen
1721@pytest .mark .compartment6
18- def test_compartment_6 (page : Page ) -> None :
22+ def test_compartment_6 (page : Page , smokescreen_properties : dict ) -> None :
1923 """
2024 This is the main compartment 6 method
2125 This test fills out the investigation datasets for different subjects to get different outcomes for a diagnostic test
2226 based on the test results and the subject's age, then prints the diagnostic test result letters.
2327 If the subject is old enough and they get a high-risk or LNPCP result, then they are handed over
2428 into symptomatic care, and the relevant letters are printed.
29+ Here old refers to if a subject is over 75 at recall
2530 """
2631
2732 # For the following tests 'old' refers to if a subject is over 75 at recall
@@ -30,51 +35,57 @@ def test_compartment_6(page: Page) -> None:
3035
3136 UserTools .user_login (page , "Screening Centre Manager at BCS001" )
3237
33- # This needs to be repeated for two subjects, one old and one not - High Risk Result
34- # Older patient
38+ # Older patient - High Risk Result
3539 logging .info ("High-risk result for an older subject" )
36- nhs_no = "9687319364"
40+ subjects_df = get_subjects_for_investigation_dataset_updates (
41+ smokescreen_properties ["c6_eng_number_of_subjects_to_record" ],
42+ smokescreen_properties ["c6_eng_org_id" ],
43+ )
44+ nhs_no = subjects_df ["subject_nhs_number" ].iloc [0 ]
45+ SubjectDemographicUtil (page ).update_subject_dob (nhs_no , False )
3746 InvestigationDatasetCompletion (page ).complete_with_result (
3847 nhs_no , InvestigationDatasetResults .HIGH_RISK
3948 )
4049 AfterInvestigationDatasetComplete (page ).progress_episode_based_on_result (
4150 InvestigationDatasetResults .HIGH_RISK , False
4251 )
4352
44- # Younger patient
53+ # Younger patient - High Risk Result
4554 logging .info ("High-risk result for a younger subject" )
46- nhs_no = "9462733759"
55+ nhs_no = subjects_df ["subject_nhs_number" ].iloc [1 ]
56+ SubjectDemographicUtil (page ).update_subject_dob (nhs_no , True )
4757 InvestigationDatasetCompletion (page ).complete_with_result (
4858 nhs_no , InvestigationDatasetResults .HIGH_RISK
4959 )
5060 AfterInvestigationDatasetComplete (page ).progress_episode_based_on_result (
5161 InvestigationDatasetResults .HIGH_RISK , True
5262 )
5363
54- # This needs to be repeated for two subjects, one old and one not - LNPCP Result
55- # Older patient
64+ # Older patient - LNPCP Result
5665 logging .info ("LNPCP result for an older subject" )
57- nhs_no = "9434999847"
66+ nhs_no = subjects_df ["subject_nhs_number" ].iloc [2 ]
67+ SubjectDemographicUtil (page ).update_subject_dob (nhs_no , False )
5868 InvestigationDatasetCompletion (page ).complete_with_result (
5969 nhs_no , InvestigationDatasetResults .LNPCP
6070 )
6171 AfterInvestigationDatasetComplete (page ).progress_episode_based_on_result (
6272 InvestigationDatasetResults .LNPCP , False
6373 )
6474
65- # Younger patient
75+ # Younger patient - LNPCP Result
6676 logging .info ("LNPCP result for a younger subject" )
67- nhs_no = "9773554414"
77+ nhs_no = subjects_df ["subject_nhs_number" ].iloc [3 ]
78+ SubjectDemographicUtil (page ).update_subject_dob (nhs_no , True )
6879 InvestigationDatasetCompletion (page ).complete_with_result (
6980 nhs_no , InvestigationDatasetResults .LNPCP
7081 )
7182 AfterInvestigationDatasetComplete (page ).progress_episode_based_on_result (
7283 InvestigationDatasetResults .LNPCP , True
7384 )
7485
75- # This needs to be repeated for 1 subject, age does not matter - Normal Result
86+ # Any patient - Normal Result
7687 logging .info ("Normal result for any age subject" )
77- nhs_no_normal = "9039985766"
88+ nhs_no_normal = subjects_df [ "subject_nhs_number" ]. iloc [ 4 ]
7889 InvestigationDatasetCompletion (page ).complete_with_result (
7990 nhs_no_normal , InvestigationDatasetResults .NORMAL
8091 )
0 commit comments