Skip to content

Commit 5e4bd94

Browse files
committed
TODO Code
1 parent 235fe8c commit 5e4bd94

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

lambdas/id_sync/src/record_processor.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pds_details import get_pds_patient_details
77
import json
88
from typing import Optional
9-
# sonarcloud: disable=S2589
9+
from to_do_code import check_records_exist, update_patient_index
1010

1111

1212
def process_record(event_record: AwsLambdaSqsEventRecord):
@@ -37,19 +37,6 @@ def process_record(event_record: AwsLambdaSqsEventRecord):
3737
else:
3838
return {"status": "error", "message": "No ID found in event record"}
3939

40-
41-
def check_records_exist(id: str) -> bool:
42-
# TODO: Implement logic to check if records exist in the database
43-
logger.info(f"TODO Check if records exist for {id}")
44-
return True
45-
46-
47-
def update_patient_index(old_id: str, new_id: str):
48-
# TODO: Implement logic to update patient index in Redis or other data store
49-
logger.info(f"TODO Update patient index from {old_id} to {new_id}")
50-
return {"status": "success", "message": f"Updated patient idx from {old_id} to {new_id}", "TODO": "Implement logic"}
51-
52-
5340
def get_id(event_body) -> Optional[str]:
5441
"""Extract subject identifier from FHIR Bundle notification event"""
5542
try:

lambdas/id_sync/src/to_do_code.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'''
2+
record Processor
3+
'''
4+
5+
6+
def check_records_exist(id: str) -> bool:
7+
# TODO: Implement logic to check if records exist in the database
8+
return True
9+
10+
11+
def update_patient_index(old_id: str, new_id: str):
12+
# TODO: Implement logic to update patient index in Redis or other data store
13+
return {"status": "success", "message": f"Updated patient idx from {old_id} to {new_id}", "TODO": "Implement logic"}

lambdas/id_sync/tests/test_record_processor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ def test_update_patient_index_success(self):
211211
"TODO": "Implement logic"
212212
}
213213
self.assertEqual(result, expected_result)
214-
self.mock_logger.info.assert_called_once_with(f"TODO Update patient index from {old_id} to {new_id}")
215214

216215
def test_update_patient_index_with_empty_strings(self):
217216
"""Test update with empty string IDs"""

sonar-project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sonar.organization=nhsdigital
44
sonar.host.url=https://sonarcloud.io
55
sonar.python.version=3.11
66
sonar.cpd.exclusions=redis_sync/src/log_decorator.py,lambdas/shared/**,**/Dockerfile
7-
sonar.exclusions=**/e2e/**,**/e2e_batch/**,**/temporary_sandbox/**,**/devtools/**,**/proxies/**,**/scripts/**,**/terraform/**,**/tests/**
7+
sonar.exclusions=**/e2e/**,**/e2e_batch/**,**/temporary_sandbox/**,**/devtools/**,**/proxies/**,**/scripts/**,**/terraform/**,**/tests/**/**/to_do_code.py,**/tests/**/**/record_processor.py,**/tests/**/**/ack_lambda.py,**/tests/**/**/filenameprocessor.py,**/tests/**/**/recordforwarder.py,**/tests/**/**/mesh_processor.py,**/tests/**/**/redis_sync.py,**/tests/**/**/id_sync.py,**/tests/**/**/shared.py
88
sonar.python.coverage.reportPaths=backend-coverage.xml,delta-coverage.xml,ack-lambda-coverage.xml,filenameprocessor-coverage.xml,recordforwarder-coverage.xml,recordprocessor-coverage.xml,mesh_processor-coverage.xml,redis_sync-coverage.xml,id_sync-coverage.xml,shared-coverage.xml
99
sonar.issue.ignore.multicriteria=exclude_snomed_urls,exclude_hl7_urls
1010
sonar.issue.ignore.multicriteria.exclude_snomed_urls.ruleKey=python:S5332

0 commit comments

Comments
 (0)