Skip to content

Commit a4bd111

Browse files
authored
VED-1081-Remove-redundant-V2-to-V5-Identifier-Uplift-code (#1238)
* Removed V@-V5 uplift * Update error_const
1 parent b8e7e7c commit a4bd111

3 files changed

Lines changed: 0 additions & 56 deletions

File tree

lambdas/recordprocessor/src/constants.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
"LOCATION_CODE_TYPE_URI",
4141
]
4242

43-
TPP_V2_SUPPLIER_IDENTIFIER_SYSTEM = "YGA"
44-
TPP_V5_SUPPLIER_IDENTIFIER_SYSTEM = "https://tpp-uk.com/Id/ve/vacc"
45-
EMIS_V2_SUPPLIER_IDENTIFIER_SYSTEM = "YGJ"
46-
EMIS_V5_SUPPLIER_IDENTIFIER_SYSTEM = "https://emishealth.com/identifiers/vacc"
47-
4843

4944
class Diagnostics:
5045
"""Diagnostics messages"""

lambdas/recordprocessor/src/process_row.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
from common.clients import logger
44
from constants import (
5-
EMIS_V2_SUPPLIER_IDENTIFIER_SYSTEM,
6-
EMIS_V5_SUPPLIER_IDENTIFIER_SYSTEM,
7-
TPP_V2_SUPPLIER_IDENTIFIER_SYSTEM,
8-
TPP_V5_SUPPLIER_IDENTIFIER_SYSTEM,
95
Diagnostics,
106
)
117
from convert_to_fhir_imms_resource import convert_to_fhir_imms_resource
@@ -21,17 +17,6 @@ def process_row(target_disease: list, allowed_operations: set, row: dict) -> dic
2117
action_flag = (row.get("ACTION_FLAG") or "").upper()
2218
unique_id_uri = row.get("UNIQUE_ID_URI")
2319

24-
# This code the relevant constants can be safely removed once DPS carries out it's data migration to update legacy
25-
# identifiers as it should become redundant. However, it may be worth keeping in case legacy format identifiers are
26-
# received for some reason. Please see issue VED-904 for more information.
27-
if unique_id_uri == TPP_V2_SUPPLIER_IDENTIFIER_SYSTEM:
28-
unique_id_uri = TPP_V5_SUPPLIER_IDENTIFIER_SYSTEM
29-
row["UNIQUE_ID_URI"] = TPP_V5_SUPPLIER_IDENTIFIER_SYSTEM
30-
31-
if unique_id_uri == EMIS_V2_SUPPLIER_IDENTIFIER_SYSTEM:
32-
unique_id_uri = EMIS_V5_SUPPLIER_IDENTIFIER_SYSTEM
33-
row["UNIQUE_ID_URI"] = EMIS_V5_SUPPLIER_IDENTIFIER_SYSTEM
34-
3520
unique_id = row.get("UNIQUE_ID")
3621
local_id = f"{unique_id}^{unique_id_uri}"
3722

lambdas/recordprocessor/tests/test_process_row.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -241,42 +241,6 @@ def test_process_row_missing_unique_id_uri(self):
241241
)
242242
self.assertEqual(response["diagnostics"]["statusCode"], 400)
243243

244-
def test_process_row_successfully_uplifts_legacy_tpp_uri(self):
245-
"""
246-
Test that process_row gives the expected output.
247-
These tests check that the row is valid and matches the expected output.
248-
"""
249-
legacy_tpp_row = deepcopy(ROW_DETAILS)
250-
legacy_tpp_row["UNIQUE_ID_URI"] = "YGA"
251-
252-
expected_successful_result_tpp = deepcopy(expected_successful_result)
253-
expected_successful_result_tpp["identifier"][0]["system"] = "https://tpp-uk.com/Id/ve/vacc"
254-
255-
# call 'process_row' with required details
256-
imms_fhir_resource = process_row(TargetDiseaseElements.RSV, Allowed_Operations, legacy_tpp_row)
257-
# validate if the response with expected result
258-
self.assertDictEqual(imms_fhir_resource["fhir_json"], expected_successful_result_tpp)
259-
self.assertEqual(legacy_tpp_row["UNIQUE_ID_URI"], "https://tpp-uk.com/Id/ve/vacc")
260-
self.assertEqual(imms_fhir_resource["local_id"], "RSV_002^https://tpp-uk.com/Id/ve/vacc")
261-
262-
def test_process_row_successfully_uplifts_legacy_emis_uri(self):
263-
"""
264-
Test that process_row gives the expected output.
265-
These tests check that the row is valid and matches the expected output.
266-
"""
267-
legacy_emis_row = deepcopy(ROW_DETAILS)
268-
legacy_emis_row["UNIQUE_ID_URI"] = "YGJ"
269-
270-
expected_successful_result_emis = deepcopy(expected_successful_result)
271-
expected_successful_result_emis["identifier"][0]["system"] = "https://emishealth.com/identifiers/vacc"
272-
273-
# call 'process_row' with required details
274-
imms_fhir_resource = process_row(TargetDiseaseElements.RSV, Allowed_Operations, legacy_emis_row)
275-
# validate if the response with expected result
276-
self.assertDictEqual(imms_fhir_resource["fhir_json"], expected_successful_result_emis)
277-
self.assertEqual(legacy_emis_row["UNIQUE_ID_URI"], "https://emishealth.com/identifiers/vacc")
278-
self.assertEqual(imms_fhir_resource["local_id"], "RSV_002^https://emishealth.com/identifiers/vacc")
279-
280244

281245
if __name__ == "__main__":
282246
unittest.main()

0 commit comments

Comments
 (0)