Skip to content

Commit

Permalink
Merge branch 'main' into PRMP-1182
Browse files Browse the repository at this point in the history
  • Loading branch information
steph-torres-nhs authored Dec 18, 2024
2 parents 3ca2b1e + 8bdeea0 commit 98e4e49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lambdas/services/bulk_upload_metadata_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def csv_to_staging_metadata(csv_file_path: str) -> list[StagingMetadata]:
logger.info("Parsing bulk upload metadata")

patients = {}
with open(csv_file_path, mode="r") as csv_file_handler:
with open(
csv_file_path, mode="r", encoding="utf-8", errors="replace"
) as csv_file_handler:
csv_reader: Iterable[dict] = csv.DictReader(csv_file_handler)
for row in csv_reader:
file_metadata = MetadataFile.model_validate(row)
Expand Down
4 changes: 2 additions & 2 deletions lambdas/tests/unit/utils/test_lloyd_george_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_validate_name_with_wrong_first_name(mocker, mock_pds_patient):
validate_patient_name_using_full_name_history(
lg_file_patient_name, mock_pds_patient
)
assert mock_validate_name.call_count == 2
assert mock_validate_name.call_count == 3


def test_validate_name_with_wrong_family_name(mocker, mock_pds_patient):
Expand All @@ -344,7 +344,7 @@ def test_validate_name_with_wrong_family_name(mocker, mock_pds_patient):
validate_patient_name_using_full_name_history(
lg_file_patient_name, mock_pds_patient
)
assert mock_validate_name.call_count == 2
assert mock_validate_name.call_count == 3


def test_validate_name_with_historical_name(mocker, mock_pds_patient):
Expand Down
2 changes: 0 additions & 2 deletions lambdas/utils/lloyd_george_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ def validate_patient_name_using_full_name_history(
)

for name in pds_patient_details.name:
if name.use == "usual":
continue
historic_first_name_in_pds: str = name.given[0]
historic_family_name_in_pds = name.family
if validate_patient_name(
Expand Down

0 comments on commit 98e4e49

Please sign in to comment.