|
32 | 32 | from parameter_parser import patient_identifier_system, process_search_params |
33 | 33 | from tests.utils.generic_utils import load_json_data |
34 | 34 | from tests.utils.values_for_tests import ValidValues |
35 | | -from utils.mock_redis import MOCK_REDIS_V2D_RESPONSE |
36 | 35 |
|
37 | 36 | class TestFhirControllerBase(unittest.TestCase): |
38 | 37 | """Base class for all tests to set up common fixtures""" |
@@ -1607,6 +1606,19 @@ def test_immunization_unhandled_error(self, mock_get_supplier_permissions): |
1607 | 1606 | self.assertEqual(body["issue"][0]["code"], "exception") |
1608 | 1607 |
|
1609 | 1608 | class TestSearchImmunizations(TestFhirControllerBase): |
| 1609 | + MOCK_REDIS_V2D_RESPONSE = { |
| 1610 | + "PERTUSSIS": "[{\"code\": \"27836007\", \"term\": \"Pertussis (disorder)\"}]", |
| 1611 | + "RSV": "[{\"code\": \"55735004\", \"term\": \"Respiratory syncytial virus infection (disorder)\"}]", |
| 1612 | + "3in1": "[{\"code\": \"398102009\", \"term\": \"Acute poliomyelitis\"}, {\"code\": \"397430003\", \"term\": \"Diphtheria caused by Corynebacterium diphtheriae\"}, {\"code\": \"76902006\", \"term\": \"Tetanus (disorder)\"}]", |
| 1613 | + "MMR": "[{\"code\": \"14189004\", \"term\": \"Measles (disorder)\"}, {\"code\": \"36989005\", \"term\": \"Mumps (disorder)\"}, {\"code\": \"36653000\", \"term\": \"Rubella (disorder)\"}]", |
| 1614 | + "HPV": "[{\"code\": \"240532009\", \"term\": \"Human papillomavirus infection\"}]", |
| 1615 | + "MMRV": "[{\"code\": \"14189004\", \"term\": \"Measles (disorder)\"}, {\"code\": \"36989005\", \"term\": \"Mumps (disorder)\"}, {\"code\": \"36653000\", \"term\": \"Rubella (disorder)\"}, {\"code\": \"38907003\", \"term\": \"Varicella (disorder)\"}]", |
| 1616 | + "PCV13": "[{\"code\": \"16814004\", \"term\": \"Pneumococcal infectious disease\"}]", |
| 1617 | + "SHINGLES": "[{\"code\": \"4740000\", \"term\": \"Herpes zoster\"}]", |
| 1618 | + "COVID19": "[{\"code\": \"840539006\", \"term\": \"Disease caused by severe acute respiratory syndrome coronavirus 2\"}]", |
| 1619 | + "FLU": "[{\"code\": \"6142004\", \"term\": \"Influenza caused by seasonal influenza virus (disorder)\"}]", |
| 1620 | + "MENACWY": "[{\"code\": \"23511006\", \"term\": \"Meningococcal infectious disease\"}]" |
| 1621 | + } |
1610 | 1622 | def setUp(self): |
1611 | 1623 | super().setUp() |
1612 | 1624 | self.service = create_autospec(FhirService) |
@@ -1919,7 +1931,7 @@ def test_post_search_immunizations_for_unauthorized_vaccine_type_search_403(self |
1919 | 1931 |
|
1920 | 1932 | @patch("fhir_controller.process_search_params", wraps=process_search_params) |
1921 | 1933 | def test_uses_parameter_parser(self, process_search_params: Mock): |
1922 | | - self.mock_redis_client.hkeys.return_value = MOCK_REDIS_V2D_RESPONSE |
| 1934 | + self.mock_redis_client.hkeys.return_value = self.MOCK_REDIS_V2D_RESPONSE |
1923 | 1935 | lambda_event = { |
1924 | 1936 | "multiValueQueryStringParameters": { |
1925 | 1937 | self.patient_identifier_key: ["https://fhir.nhs.uk/Id/nhs-number|9000000009"], |
|
0 commit comments