Skip to content

Commit df943c8

Browse files
committed
reverting some changes
1 parent 2697aca commit df943c8

File tree

6 files changed

+5
-22
lines changed

6 files changed

+5
-22
lines changed

lambdas/id_sync/src/id_sync.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ def handler(event_data: Dict[str, Any], _context) -> Dict[str, Any]:
2424

2525
logger.info("id_sync processing event with %d records", len(records))
2626

27-
# Use explicit loops instead of list comprehensions so we can more
28-
# easily inspect intermediate results and avoid building temporary
29-
# comprehension constructs.
3027
results = []
3128
nhs_numbers = []
3229
error_count = 0

lambdas/id_sync/src/ieds_db_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_ieds_table():
2222

2323

2424
def ieds_update_patient_id(old_id: str, new_id: str, items_to_update: list | None = None) -> dict:
25-
"""Update the patient ID in the IEDS table."""
25+
"""Update the patient ID (new NHS number) in the IEDS table."""
2626
logger.info(f"ieds_update_patient_id. Update patient ID from {old_id} to {new_id}")
2727
if not old_id or not new_id or not old_id.strip() or not new_id.strip():
2828
return make_status("Old ID and New ID cannot be empty", old_id, "error")

lambdas/id_sync/src/pds_details.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def pds_get_patient_id(nhs_number: str) -> str:
4343
:return: PDS patient ID
4444
"""
4545
try:
46-
logger.info(f"get_pds_patient_id. nhs_number: {nhs_number}")
4746
patient_details = pds_get_patient_details(nhs_number)
4847
if not patient_details:
4948
return None

lambdas/id_sync/src/record_processor.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,15 @@ def process_nhs_number(nhs_number: str) -> Dict[str, Any]:
6969
# Compare demographics from PDS to each IEDS item, keep only matching records
7070
matching_records = []
7171
discarded_count = 0
72-
discarded_records = []
7372
for detail in ieds_resources:
7473
logger.info("Processing IEDS record: %s", detail)
7574
if demographics_match(pds_patient_resource, detail):
7675
matching_records.append(detail)
7776
else:
7877
discarded_count += 1
79-
discarded_records.append(detail)
8078

8179
if not matching_records:
82-
logger.info("No records matched PDS demographics: %d\nDiscarded:\n%s", discarded_count,
83-
json.dumps(discarded_records, indent=2), default=str)
80+
logger.info("No records matched PDS demographics: %d", discarded_count,)
8481
return make_status("No records matched PDS demographics; update skipped", nhs_number)
8582

8683
response = ieds_update_patient_id(

lambdas/shared/src/common/clients.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22
import logging
33
from boto3 import client as boto3_client, resource as boto3_resource
44

5+
logging.basicConfig(level=logging.INFO)
56
logger = logging.getLogger()
6-
logger.setLevel(logging.INFO) # Root logger level
7-
8-
if logger.hasHandlers():
9-
logger.handlers.clear()
10-
11-
console = logging.StreamHandler()
12-
console.setLevel(logging.INFO) # Handler must also allow INFO logs
13-
14-
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
15-
console.setFormatter(formatter)
16-
17-
logger.addHandler(console)
7+
logger.setLevel(logging.INFO)
188

199
STREAM_NAME = os.getenv("SPLUNK_FIREHOSE_NAME", "firehose-name-not-defined")
2010
CONFIG_BUCKET_NAME = os.getenv("CONFIG_BUCKET_NAME", "variconfig-bucketable-not-defined")

lambdas/shared/tests/test_common/test_clients.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ def test_logger_is_initialized(self):
5858

5959
def test_logger_set_level(self):
6060
"""Test that logger level is set to INFO"""
61-
self.mock_logger_instance.setLevel.assert_called_once_with(logging.INFO)
61+
self.mock_logger_instance.setLevel.assert_called_once_with(logging.INFO)

0 commit comments

Comments
 (0)