diff --git a/libs/constants.py b/libs/constants.py index 323a2142e4a..e96530146c2 100644 --- a/libs/constants.py +++ b/libs/constants.py @@ -1,3 +1,4 @@ +from re import ASCII from typing import Final @@ -95,6 +96,12 @@ class test_data_file_paths: VACCS_HPV_NEGATIVE: Final[str] = ( f"test_data/hpv/i_negative.csv{escape_characters.SEPARATOR}test_data/hpv/o_negative.csv" ) + VACCS_HIST_HPV_POSITIVE: Final[str] = ( + f"test_data/hpv/i_hist_positive.csv{escape_characters.SEPARATOR}test_data/hpv/o_hist_positive.csv" + ) + VACCS_HIST_HPV_NEGATIVE: Final[str] = ( + f"test_data/hpv/i_hist_negative.csv{escape_characters.SEPARATOR}test_data/hpv/o_hist_negative.csv" + ) VACCS_HPV_DUP_1: Final[str] = f"test_data/hpv/i_dup_1.csv{escape_characters.SEPARATOR}test_data/hpv/o_dup_1.csv" VACCS_HPV_DUP_2: Final[str] = f"test_data/hpv/i_dup_2.csv{escape_characters.SEPARATOR}test_data/hpv/o_dup_2.csv" VACCS_HPV_INVALID_STRUCTURE: Final[str] = ( @@ -151,3 +158,7 @@ class test_data_file_paths: CLASS_HEADER_ONLY: Final[str] = ( f"test_data/class_list/i_header_only.csv{escape_characters.SEPARATOR}test_data/class_list/o_header_only.csv" ) + + +class file_encoding: + ASCII = "ascii" diff --git a/libs/testdata_ops.py b/libs/testdata_ops.py index 553e98fc36e..5d61f19324a 100644 --- a/libs/testdata_ops.py +++ b/libs/testdata_ops.py @@ -15,12 +15,14 @@ def create_file_from_template(self, template_path: str) -> str: _file_text = [] _ctr = -1 _dt = get_new_datetime() + _hist_dt = get_offset_date(offset_days=-730) for _ln in _template_text.split(escape_characters.NEW_LINE): _ln = _ln.replace("<>", f"9{self.get_new_nhs_no(valid=True)[:9]}") _ln = _ln.replace("<>", self.get_new_nhs_no(valid=False)) _ln = _ln.replace("<>", f"F{_dt}{_ctr}") _ln = _ln.replace("<>", f"L{_dt}{_ctr}") _ln = _ln.replace("<>", _dt[:8]) + _ln = _ln.replace("<>", _hist_dt) _file_text.append(_ln) _ctr += 1 return self.fo.create_file(content=escape_characters.NEW_LINE.join(_file_text)) diff --git a/libs/wrappers.py b/libs/wrappers.py index 22488cdc2c1..8395a4c10df 100644 --- a/libs/wrappers.py +++ b/libs/wrappers.py @@ -1,7 +1,9 @@ +import base64 +import os import time from datetime import datetime, timedelta -from libs.constants import escape_characters +from libs.constants import escape_characters, file_encoding def convert_time_units_to_seconds(time_unit: str) -> int: @@ -32,12 +34,12 @@ def wait(timeout: str): def get_link_formatted_date_time(): - _ampm = datetime.now().strftime(format="%p").lower() + _am_or_pm = datetime.now().strftime(format="%p").lower() try: _dt = datetime.now().strftime(format="%-d %B %Y at %-I:%M") # Linux (Github Action) except: - _dt = datetime.now().strftime(format="%#d %B %Y at %#I:%M") # Windows (Dev PC) - return f"{_dt}{_ampm}" + _dt = datetime.now().strftime(format="%#d %B %Y at %#I:%M") # Windows (Dev VDI) + return f"{_dt}{_am_or_pm}" def get_new_datetime() -> str: @@ -56,9 +58,26 @@ def clean_file_name(file_name: str) -> str: return file_name -def get_future_date(offset_days: int) -> str: - _future_date = datetime.now() + timedelta(days=offset_days) +def get_offset_date(offset_days: int) -> str: + _offset_date = datetime.now() + timedelta(days=offset_days) if offset_days != 0: - while _future_date.weekday() >= 5: - _future_date = _future_date + timedelta(days=1) - return _future_date.strftime("%Y%m%d") + while _offset_date.weekday() >= 5: + _offset_date = _offset_date + timedelta(days=1) + return _offset_date.strftime("%Y%m%d") + + +def get_project_root() -> str: + _project_root = os.path.dirname(__file__) + while os.path.basename(_project_root.lower()) != "manage-vaccinations-in-schools-testing": + _project_root = os.path.dirname(_project_root) + return _project_root + + +def get_base64_encoded_string(text): + text_bytes = text.encode(file_encoding.ASCII) + return base64.b64encode(text_bytes).decode(file_encoding.ASCII) + + +def get_base64_decoded_string(encoded_string): + base64_bytes = encoded_string.encode(file_encoding.ASCII) + return base64.b64decode(base64_bytes).decode(file_encoding.ASCII) diff --git a/pages/pg_sessions.py b/pages/pg_sessions.py index 979370c46df..84fee10c6e6 100644 --- a/pages/pg_sessions.py +++ b/pages/pg_sessions.py @@ -286,7 +286,7 @@ def update_triage_outcome_positive(self, file_paths): self.verify_activity_log_entry() def schedule_a_valid_session(self, for_today: bool = False): - _future_date = get_future_date(offset_days=0) if for_today else get_future_date(offset_days=10) + _future_date = get_offset_date(offset_days=0) if for_today else get_offset_date(offset_days=10) _expected_message = f"Session dates {self.__get_display_formatted_date(date_to_format=_future_date)}" self.click_unscheduled() self.click_school1() diff --git a/test_data/hpv/i_dup_1.csv b/test_data/hpv/i_dup_1.csv index 7ed6700be8f..88e7a9511db 100644 --- a/test_data/hpv/i_dup_1.csv +++ b/test_data/hpv/i_dup_1.csv @@ -1,2 +1,2 @@ TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED -P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, diff --git a/test_data/hpv/i_dup_2.csv b/test_data/hpv/i_dup_2.csv index 7ed6700be8f..88e7a9511db 100644 --- a/test_data/hpv/i_dup_2.csv +++ b/test_data/hpv/i_dup_2.csv @@ -1,2 +1,2 @@ TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED -P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, +P_Gardasil9,R1L,142181,Bohunt School Wokingham,9000000000,ChildFirst1,ChildLast1,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, diff --git a/test_data/hpv/i_hist_negative.csv b/test_data/hpv/i_hist_negative.csv new file mode 100644 index 00000000000..d95440991d3 --- /dev/null +++ b/test_data/hpv/i_hist_negative.csv @@ -0,0 +1,37 @@ +TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED +N_InvalidODSCode,MAVIS,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyOrgCode,,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptySchoolURN,R1L,,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_NotKnownSchoolEmpty,R1L,888888,,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_LongNHSNumber,R1L,142181,Bohunt School Wokingham,<>1,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_ShortNHSNumber,R1L,142181,Bohunt School Wokingham,947310353,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyForename,R1L,142181,Bohunt School Wokingham,<>,,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyLastname,R1L,142181,Bohunt School Wokingham,<>,<>,,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidFormatDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20102608,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_FutureDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20300628,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_NonLeapYearDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100229,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Transgender,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyPostCode,R1L,142181,Bohunt School Wokingham,,<>,<>,20100228,Female,,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidPostCode,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,1AA AA1,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_FutureVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,20301231,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyVaccGiven,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_FluVaccGiven,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,AstraZeneca Fluenz Tetra LAIV,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyBatchNumber,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,Nasal,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,10,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidProfFName,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,ProfFName,,,Clinic,00:01, +N_InvalidProfSName,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,ProfSName,,Clinic,00:01, +N_InvalidProfEmail,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@invalid-example.com,Clinic,00:01, +N_InvalidClinic,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,2,,,nurse.joy@example.com,Invalid Clinic,00:01, +N_InvalidTime,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,32:00, +N_InvalidReason,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,00:01,Did not attend1 +N_InvalidVaccinatedFlag,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,X,1,,,nurse.joy@example.com,,00:01, +N_InvalidCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,10,,,nurse.joy@example.com,,00:01, +N_TimeInFuture,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,23:00, diff --git a/test_data/hpv/i_hist_positive.csv b/test_data/hpv/i_hist_positive.csv new file mode 100644 index 00000000000..fe7479c3c3d --- /dev/null +++ b/test_data/hpv/i_hist_positive.csv @@ -0,0 +1,10 @@ +TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED +P_Gardasil9,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_Gardasil,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil,AutoBatch1,20301231,Right Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_Cervarix,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Cervarix,AutoBatch1,20301231,left upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_NFA,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3VZ,<>,Gardasil9,AutoBatch1,20301231,left arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_Add_Not_Known,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Gardasil9,AutoBatch1,20301231,left arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_AllowPastExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20120730,right upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_SiteRAU,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_SiteRAL,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_NotVaccinated,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,,,,,1,N,1,,,nurse.joy@example.com,Clinic,00:01,Did not attend diff --git a/test_data/hpv/i_negative.csv b/test_data/hpv/i_negative.csv index ebe02891638..b19e76701bd 100644 --- a/test_data/hpv/i_negative.csv +++ b/test_data/hpv/i_negative.csv @@ -1,36 +1,37 @@ TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED -N_InvalidODSCode,MAVIS,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyOrgCode,,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptySchoolURN,R1L,,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_NotKnownSchoolEmpty,R1L,888888,,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_LongNHSNumber,R1L,142181,Bohunt School Wokingham,<>1,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_ShortNHSNumber,R1L,142181,Bohunt School Wokingham,947310353,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyForename,R1L,142181,Bohunt School Wokingham,<>,,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyLastname,R1L,142181,Bohunt School Wokingham,<>,<>,,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_InvalidFormatDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20102608,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_FutureDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20300628,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_NonLeapYearDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100229,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_InvalidGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Transgender,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyPostCode,R1L,142181,Bohunt School Wokingham,,<>,<>,20100228,Female,,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_InvalidPostCode,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,1AA AA1,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_FutureVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,20301231,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyVaccGiven,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_FluVaccGiven,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,AstraZeneca Fluenz Tetra LAIV,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyBatchNumber,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,Nasal,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_InvalidDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,10,Y,1,,,nurse.joy@example.com,Clinic,12:00, -N_EmptyCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,,,,nurse.joy@example.com,Clinic,12:00, -N_InvalidProfFName,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,ProfFName,,,Clinic,12:00, -N_InvalidProfSName,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,ProfSName,,Clinic,12:00, -N_InvalidProfEmail,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@invalid-example.com,Clinic,12:00, -N_InvalidClinic,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,2,,,nurse.joy@example.com,Invalid Clinic,12:00, +N_InvalidODSCode,MAVIS,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyOrgCode,,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptySchoolURN,R1L,,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_NotKnownSchoolEmpty,R1L,888888,,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_LongNHSNumber,R1L,142181,Bohunt School Wokingham,<>1,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_ShortNHSNumber,R1L,142181,Bohunt School Wokingham,947310353,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyForename,R1L,142181,Bohunt School Wokingham,<>,,<>,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyLastname,R1L,142181,Bohunt School Wokingham,<>,<>,,20100811,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidFormatDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20102608,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_FutureDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20300628,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_NonLeapYearDOB,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100229,Male,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidGender,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Transgender,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyPostCode,R1L,142181,Bohunt School Wokingham,,<>,<>,20100228,Female,,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidPostCode,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,1AA AA1,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_FutureVaccDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,20301231,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyVaccGiven,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_FluVaccGiven,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,AstraZeneca Fluenz Tetra LAIV,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyBatchNumber,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,,left thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidAnatomicalSite,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,Nasal,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidDoseSeq,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,10,Y,1,,,nurse.joy@example.com,Clinic,00:01, +N_EmptyCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,,,,nurse.joy@example.com,Clinic,00:01, +N_InvalidProfFName,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,ProfFName,,,Clinic,00:01, +N_InvalidProfSName,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,ProfSName,,Clinic,00:01, +N_InvalidProfEmail,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@invalid-example.com,Clinic,00:01, +N_InvalidClinic,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,2,,,nurse.joy@example.com,Invalid Clinic,00:01, N_InvalidTime,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,32:00, -N_InvalidReason,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,12:00,Did not attend1 -N_InvalidVaccinatedFlag,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,X,1,,,nurse.joy@example.com,,12:00, -N_InvalidCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,10,,,nurse.joy@example.com,,12:00, +N_InvalidReason,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,00:01,Did not attend1 +N_InvalidVaccinatedFlag,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,X,1,,,nurse.joy@example.com,,00:01, +N_InvalidCareSetting,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,10,,,nurse.joy@example.com,,00:01, +N_TimeInFuture,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100228,Female,DN9 1PB,<>,Gardasil9,Batch1,20301231,left thigh,1,Y,1,,,nurse.joy@example.com,,23:00, diff --git a/test_data/hpv/i_positive.csv b/test_data/hpv/i_positive.csv index 3d4b5f8f161..269accafc59 100644 --- a/test_data/hpv/i_positive.csv +++ b/test_data/hpv/i_positive.csv @@ -1,10 +1,10 @@ TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,VACCINATED,CARE_SETTING,PERFORMING_PROFESSIONAL_FORENAME,PERFORMING_PROFESSIONAL_SURNAME,PERFORMING_PROFESSIONAL_EMAIL,CLINIC_NAME,TIME_OF_VACCINATION,REASON_NOT_VACCINATED -P_Gardasil9,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_Gardasil,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil,AutoBatch1,20301231,Right Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_Cervarix,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Cervarix,AutoBatch1,20301231,left upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_NFA,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3VZ,<>,Gardasil9,AutoBatch1,20301231,left arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_Add_Not_Known,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Gardasil9,AutoBatch1,20301231,left arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_AllowPastExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20120730,right upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_SiteRAU,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_SiteRAL,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,12:00, -P_NotVaccinated,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,,,,,1,N,1,,,nurse.joy@example.com,Clinic,12:00,Did not attend +P_Gardasil9,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20301231,Left Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_Gardasil,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil,AutoBatch1,20301231,Right Thigh,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_Cervarix,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Cervarix,AutoBatch1,20301231,left upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_NFA,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3VZ,<>,Gardasil9,AutoBatch1,20301231,left arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_Add_Not_Known,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,ZZ99 3WZ,<>,Gardasil9,AutoBatch1,20301231,left arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_AllowPastExpiryDate,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20120730,right upper arm,1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_SiteRAU,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (upper position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_SiteRAL,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,Gardasil9,AutoBatch1,20320730,right arm (lower position),1,Y,1,,,nurse.joy@example.com,Clinic,00:01, +P_NotVaccinated,R1L,142181,Bohunt School Wokingham,<>,<>,<>,20100811,Male,DN9 1PB,<>,,,,,1,N,1,,,nurse.joy@example.com,Clinic,00:01,Did not attend diff --git a/test_data/hpv/i_positive_old.csv b/test_data/hpv/i_positive_old.csv deleted file mode 100644 index 102392085e9..00000000000 --- a/test_data/hpv/i_positive_old.csv +++ /dev/null @@ -1,17 +0,0 @@ -TEST_DESC_IGNORED,ORGANISATION_CODE,SCHOOL_URN,SCHOOL_NAME,NHS_NUMBER,PERSON_FORENAME,PERSON_SURNAME,PERSON_DOB,PERSON_GENDER_CODE,PERSON_POSTCODE,DATE_OF_VACCINATION,VACCINE_GIVEN,BATCH_NUMBER,BATCH_EXPIRY_DATE,ANATOMICAL_SITE,DOSE_SEQUENCE,LOCAL_PATIENT_ID,LOCAL_PATIENT_ID_URI,CARE_SETTING,VACCINATED -P_Gardasil9,R1L,110158,Eton College,<>,<>,<>,20100811,Male,DN9 1PB,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_Gardasil,R1L,110158,Eton College,<>,<>,<>,20100819,Male,DN38 6JP,20240514,Gardasil,123013325,20220730,Left Thigh,2,LocalPatient3,www.LocalPatient3,1,Y -P_Cervarix,R1L,110158,Eton College,<>,<>,<>,20100808,Male,N8 7RE,20240514,Cervarix,123013325,20220730,Left Thigh,3,LocalPatient3,www.LocalPatient3,1,Y -P_Gardasil9,R1L,888888,Test-Auto School,<>,<>,<>,20100818,Female,HD9 2DD,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_Gardasil,R1L,999999,Homeschooled,<>,<>,<>,20100813,Female,DN17 1UE,20240514,Gardasil,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_Cervarix,R1L,110158,Eton College,<>,<>,<>,20100817,Female,LA22 9SJ,20240514,Cervarix,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_NFA,R1L,110158,Eton College,<>,<>,<>,20100811,Male,ZZ99 3VZ,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_Add_Not_Known,R1L,110158,Eton College,<>,<>,<>,20100811,Male,ZZ99 3WZ,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_Site_LB,R1L,110158,Eton College,<>,<>,<>,20100811,Male,DN34 4SE,20240514,Gardasil9,123013325,20220730,Left Buttock,1,LocalPatient3,www.LocalPatient3,1,Y -P_Site_RB,R1L,110158,Eton College,<>,<>,<>,20100831,Male,TS8 9EF,20240514,Gardasil9,123013325,20220730,Right Buttock,1,LocalPatient3,www.LocalPatient3,1,Y -P_Site_LT,R1L,110158,Eton College,<>,<>,<>,20100829,Not Known,HU5 3SG,20240514,Gardasil9,123013325,20220730,Left Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_Site_LUA,R1L,110158,Eton College,<>,<>,<>,20100821,Female,ZZ99 3AZ,20240514,Gardasil9,123013325,20220730,Left Upper Arm,1,LocalPatient3,www.LocalPatient3,1,Y -P_Site_RUA,R1L,110158,Eton College,<>,<>,<>,20100830,Male,NE39 1AD,20240514,Gardasil9,123013325,20220730,Right Upper Arm,1,LocalPatient3,www.LocalPatient3,1,Y -P_Site_RT,R1L,110158,Eton College,<>,<>,<>,20100808,Male,SK16 4HT,20240514,Gardasil9,123013325,20220730,Right Thigh,1,LocalPatient3,www.LocalPatient3,1,Y -P_AllowPastExpiryDate,R1L,110158,Eton College,<>,<>,<>,20100827,Female,BH23 8BY,20240514,Gardasil9,123013325,20120730,Left Thigh,1,www.LocalPatient3,www.LocalPatient3,1,Y -P_NotVaccinated,R1L,110158,Eton College,<>,<>,<>,20100827,Female,BH23 8BY,20240514,Gardasil9,123013325,20120730,Left Thigh,1,www.LocalPatient3,www.LocalPatient3,1,N diff --git a/test_data/hpv/o_hist_negative.csv b/test_data/hpv/o_hist_negative.csv new file mode 100644 index 00000000000..a034794a020 --- /dev/null +++ b/test_data/hpv/o_hist_negative.csv @@ -0,0 +1,29 @@ +Row 1 ORGANISATION_CODE: Enter an organisation code that matches the current organisation. +Row 2 ORGANISATION_CODE: Enter an organisation code that matches the current organisation. +Row 3 SCHOOL_URN: The school URN is not recognised. If you’ve checked the URN, and you believe it’s valid, contact our support organisation. +Row 4 SCHOOL_NAME: Enter a school name. +Row 5 NHS_NUMBER: Enter an NHS number with 10 characters. +Row 6 NHS_NUMBER: Enter an NHS number with 10 characters. +Row 7 PERSON_FORENAME: Enter a first name. +Row 8 PERSON_SURNAME: Enter a last name. +Row 9 PERSON_DOB: Enter a date of birth in the correct format. +Row 10 PERSON_DOB: Enter a date of birth in the correct format. +Row 11 PERSON_DOB: is not part of this programme +Row 12 PERSON_DOB: Enter a date of birth in the correct format. +Row 13 PERSON_GENDER_CODE/PERSON_GENDER: Enter a gender or gender code. +Row 14 PERSON_GENDER_CODE/PERSON_GENDER: Enter a gender or gender code. +Row 15 PERSON_POSTCODE: Enter a valid postcode, such as SW1A 1AA +Row 16 PERSON_POSTCODE: Enter a valid postcode, such as SW1A 1AA +Row 17 DATE_OF_VACCINATION: Enter a date in the correct format +Row 18 DATE_OF_VACCINATION: The vaccination date is outside the programme. Enter a date before today. +Row 19 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil9. +Row 20 VACCINE_GIVEN: Enter a valid vaccine, eg Gardasil9. +Row 21 BATCH_NUMBER: Enter a batch number. +Row 22 BATCH_EXPIRY_DATE: Enter a batch expiry date. +Row 23 ANATOMICAL_SITE: Enter an anatomical site. +Row 25 DOSE_SEQUENCE: The dose sequence number cannot be greater than 3. Enter a dose sequence number, for example, 1, 2 or 3. +Row 26 DOSE_SEQUENCE: must be less than or equal to 3 +Row 27 CARE_SETTING: Enter a care setting. +Row 32 TIME_OF_VACCINATION: Enter a time in the correct format +Row 34 VACCINATED: You need to record whether the child was vaccinated or not. Enter ‘Y’ or ‘N’ in the ‘vaccinated’ column.BATCH_EXPIRY_DATE: must be blankBATCH_NUMBER: must be blankANATOMICAL_SITE: must be blankREASON_NOT_VACCINATED: Enter a valid reasonVACCINE_GIVEN: must be blank +Row 35 CARE_SETTING: Enter a valid care setting. diff --git a/test_data/hpv/o_hist_positive.csv b/test_data/hpv/o_hist_positive.csv new file mode 100644 index 00000000000..1e717177385 --- /dev/null +++ b/test_data/hpv/o_hist_positive.csv @@ -0,0 +1,5 @@ +Completed +Programme HPV +Type Immunisation list +Imported by Nurse Joy +9 vaccination records diff --git a/test_data/hpv/o_negative.csv b/test_data/hpv/o_negative.csv index 2a49f5517da..6657b0b2b2b 100644 --- a/test_data/hpv/o_negative.csv +++ b/test_data/hpv/o_negative.csv @@ -32,3 +32,4 @@ Row 31 CLINIC_NAME: Enter a clinic name Row 32 TIME_OF_VACCINATION: Enter a time in the correct format Row 34 VACCINATED: You need to record whether the child was vaccinated or not. Enter ‘Y’ or ‘N’ in the ‘vaccinated’ column.BATCH_EXPIRY_DATE: must be blankBATCH_NUMBER: must be blankANATOMICAL_SITE: must be blankREASON_NOT_VACCINATED: Enter a valid reasonVACCINE_GIVEN: must be blank Row 35 CARE_SETTING: Enter a valid care setting. +Row 36 TIME_OF_VACCINATION: Enter a time in the past diff --git a/tests/test_08_vaccs_upload.py b/tests/test_08_vaccs_upload.py index a34ac472fe3..b0791d7199c 100644 --- a/tests/test_08_vaccs_upload.py +++ b/tests/test_08_vaccs_upload.py @@ -54,3 +54,13 @@ def test_reg_hpv_no_record(self, test_setup): @pytest.mark.order(806) def test_reg_hpv_empty_file(self, test_setup): self.programmes_page.upload_invalid_files(file_paths=test_data_file_paths.VACCS_HPV_EMPTY_FILE) + + @pytest.mark.vaccinations + @pytest.mark.order(807) + def test_reg_hpv_historic_positive_file_upload(self, test_setup): + self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HIST_HPV_POSITIVE) + + @pytest.mark.vaccinations + @pytest.mark.order(808) + def test_reg_hpv_historic_negative_file_upload(self, test_setup): + self.programmes_page.upload_hpv_vaccination_records(file_paths=test_data_file_paths.VACCS_HIST_HPV_NEGATIVE) diff --git a/utils/001_cleanup.py b/utils/001_cleanup.py new file mode 100644 index 00000000000..747df5160c4 --- /dev/null +++ b/utils/001_cleanup.py @@ -0,0 +1,16 @@ +import os + +# This script is to be used manually before any commits in new code to avoid committing any reports or working files. +folders_to_clean = ["working", "reports"] + + +def cleanup() -> None: + for _folder in folders_to_clean: + _all_files = os.listdir(_folder) + for _file in _all_files: + if _file != ".gitkeep": + os.remove(os.path.join(_folder, _file)) + + +if __name__ == "__main__": + cleanup()