From eacc22a08881cd4d11855ee05d9a1a66eed95a5f Mon Sep 17 00:00:00 2001 From: karthikeyannhs <174426205+Karthikeyannhs@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:08:44 +0100 Subject: [PATCH] removed "PERSON" prefix req in nhs number --- src/eligibility_signposting_api/repos/person_repo.py | 2 +- tests/fixtures/builders/repos/person.py | 2 +- tests/integration/repo/test_person_repo.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/eligibility_signposting_api/repos/person_repo.py b/src/eligibility_signposting_api/repos/person_repo.py index 02d7c396e..41ea20745 100644 --- a/src/eligibility_signposting_api/repos/person_repo.py +++ b/src/eligibility_signposting_api/repos/person_repo.py @@ -36,7 +36,7 @@ def __init__(self, table: Annotated[Any, Inject(qualifier="person_table")]) -> N self.table = table def get_eligibility_data(self, nhs_number: NHSNumber) -> list[dict[str, Any]]: - response = self.table.query(KeyConditionExpression=Key("NHS_NUMBER").eq(f"PERSON#{nhs_number}")) + response = self.table.query(KeyConditionExpression=Key("NHS_NUMBER").eq(nhs_number)) logger.debug("response %r for %r", response, nhs_number, extra={"response": response, "nhs_number": nhs_number}) if not (items := response.get("Items")): diff --git a/tests/fixtures/builders/repos/person.py b/tests/fixtures/builders/repos/person.py index 999d45e98..6cc418e19 100644 --- a/tests/fixtures/builders/repos/person.py +++ b/tests/fixtures/builders/repos/person.py @@ -31,7 +31,7 @@ def person_rows_builder( # noqa:PLR0913 faker = Faker("en_UK") faker.add_provider(PersonDetailProvider) - key = f"PERSON#{nhs_number}" + key = nhs_number date_of_birth = date_of_birth if date_of_birth is not ... else faker.date_of_birth(minimum_age=18, maximum_age=99) gender = gender if gender is not ... else choice(get_args(Gender)) postcode = postcode if postcode is not ... else faker.postcode() diff --git a/tests/integration/repo/test_person_repo.py b/tests/integration/repo/test_person_repo.py index b7519d9b4..7a444d20e 100644 --- a/tests/integration/repo/test_person_repo.py +++ b/tests/integration/repo/test_person_repo.py @@ -20,10 +20,10 @@ def test_person_found(person_table: Any, persisted_person: NHSNumber): assert_that( actual, contains_inanyorder( - has_entries({"NHS_NUMBER": f"PERSON#{persisted_person}", "ATTRIBUTE_TYPE": "PERSON"}), - has_entries({"NHS_NUMBER": f"PERSON#{persisted_person}", "ATTRIBUTE_TYPE": "COHORTS"}), - has_entries({"NHS_NUMBER": f"PERSON#{persisted_person}", "ATTRIBUTE_TYPE": "COVID"}), - has_entries({"NHS_NUMBER": f"PERSON#{persisted_person}", "ATTRIBUTE_TYPE": "RSV"}), + has_entries({"NHS_NUMBER": persisted_person, "ATTRIBUTE_TYPE": "PERSON"}), + has_entries({"NHS_NUMBER": persisted_person, "ATTRIBUTE_TYPE": "COHORTS"}), + has_entries({"NHS_NUMBER": persisted_person, "ATTRIBUTE_TYPE": "COVID"}), + has_entries({"NHS_NUMBER": persisted_person, "ATTRIBUTE_TYPE": "RSV"}), ), )