Skip to content

Comments

VED-382: Use configurable disease mappings in backend.#618

Merged
nhsdevws merged 107 commits intomasterfrom
VED-382-backend-configurable-disease-mapping
Jul 7, 2025
Merged

VED-382: Use configurable disease mappings in backend.#618
nhsdevws merged 107 commits intomasterfrom
VED-382-backend-configurable-disease-mapping

Conversation

@mfjarvis
Copy link
Contributor

Summary

  • Routine Change

Reviews Required

  • Dev
  • Test
  • Tech Author
  • Product Owner

Review Checklist

ℹ️ This section is to be filled in by the reviewer.

  • I have reviewed the changes in this PR and they fill all or part of the acceptance criteria of the ticket, and the code is in a mergeable state.
  • If there were infrastructure, operational, or build changes, I have made sure there is sufficient evidence that the changes will work.
  • I have ensured the changelog has been updated by the submitter, if necessary.

self.repository = ImmunizationRepository(table=self.table)

def tearDown(self):
self.redis_patcher.stop()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already done in the superclass

self.patient = {"id": "a-patient-id", "identifier": {"value": "an-identifier"}}

def tearDown(self):
patch.stopall()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already done in the superclass

self.patient = {"id": "a-patient-id"}

def tearDown(self):
super().tearDown()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already done in the superclass

from src.mappings import DiseaseCodes, VaccineTypes
from src.fhir_repository import ImmunizationRepository
from src.models.utils.validation_utils import get_vaccine_type
from mappings import DiseaseCodes, VaccineTypes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought mappings.py was deleted


def test_create_patient_with_vaccine_type(self):
"""Patient record should have a sort-key based on vaccine-type"""
self.mock_redis_client.hget.return_value = VaccineTypes.flu
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with "FLU" as we're deleting mappings.py

self.patient = {"id": "a-patient-id", "identifier": {"value": "an-identifier"}}

def tearDown(self):
return super().tearDown()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant method

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gone


def tearDown(self):
super().tearDown()
patch.stopall()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already done in the superclass

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gone

self.imms_repo.update_immunization.assert_not_called()

def test_post_validation_failed(self):
def test_post_validation_failed_get_by_all(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like two separate tests (which would make the mocking easier to understand)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_post_validation_failed_get_by_all_invalid_target_disease &
test_post_validation_failed_get_by_all_missing_patient_name

self.pds_service.get_patient_details.assert_not_called()

def test_post_validation_failed(self):
def test_post_validation_failed_get(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like two separate tests. Also deja vu

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_post_validation_failed_get_invalid_target_disease &
test_post_validation_failed_get_missing_patient_name

@@ -383,7 +416,7 @@ def test_pre_validation_failed(self):

def test_post_validation_failed(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh dear these tests aren't very good are they? 😅

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_post_validation_failed_create_invalid_target_disease &
test_post_validation_failed_create_missing_patient_name

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2025

@nhsdevws nhsdevws merged commit da26e47 into master Jul 7, 2025
8 checks passed
@nhsdevws nhsdevws deleted the VED-382-backend-configurable-disease-mapping branch July 7, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants