@@ -36,27 +36,6 @@ def user_login(page: Page, username: str) -> None:
3636 raise ValueError ("Environment variable 'BCSS_PASS' is not set" )
3737 CognitoLoginPage (page ).login_as_user (user_details ["username" ], password )
3838
39- @staticmethod
40- def get_subject_with_criteria (episode_type , episode_status , has_referral_date , has_diagnosis_date , diagnosis_date_reason ):
41- # Example implementation: fetch NHS number from a test data file based on criteria
42- test_data_file = Path (os .getcwd ()) / "test_subjects.json"
43- if not test_data_file .exists ():
44- # Fallback to dummy NHS number if file does not exist
45- return "1234567890"
46- with open (test_data_file , "r" ) as file :
47- subjects = json .load (file )
48- for subject in subjects :
49- if (
50- subject .get ("episode_type" ) == episode_type and
51- subject .get ("episode_status" ) == episode_status and
52- subject .get ("has_referral_date" ) == has_referral_date and
53- subject .get ("has_diagnosis_date" ) == has_diagnosis_date and
54- subject .get ("diagnosis_date_reason" ) == diagnosis_date_reason
55- ):
56- return subject .get ("nhs_number" , "1234567890" )
57- # If no match found, then exception is raised
58- raise SubjectNotFoundError ("No NHS number found using the provided criteria." )
59-
6039 @staticmethod
6140 def retrieve_user (user : str ) -> dict :
6241 """
@@ -80,7 +59,3 @@ def retrieve_user(user: str) -> dict:
8059
8160class UserToolsException (Exception ):
8261 pass
83-
84- class SubjectNotFoundError (Exception ):
85- """Raised when no subject matches the provided criteria."""
86- pass
0 commit comments