File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -62,15 +62,16 @@ def process_nhs_number(nhs_number: str) -> Dict[str, Any]:
6262 return make_status (f"No records returned for ID: { nhs_number } " , nhs_number )
6363
6464 # Compare demographics from PDS to each IEDS item, keep only matching records
65- matching_records , discarded_records = [], []
65+ matching_records = []
66+ discarded_count = 0
6667 for detail in ieds_resources :
6768 if demographics_match (pds_patient_resource , detail ):
6869 matching_records .append (detail )
6970 else :
70- discarded_records . append ( detail )
71+ discarded_count += 1
7172
7273 if not matching_records :
73- logger .info ("No records matched PDS demographics: %d" , len ( discarded_records ) )
74+ logger .info ("No records matched PDS demographics: %d" , discarded_count )
7475 return make_status ("No records matched PDS demographics; update skipped" , nhs_number )
7576
7677 response = ieds_update_patient_id (
@@ -79,7 +80,7 @@ def process_nhs_number(nhs_number: str) -> Dict[str, Any]:
7980 response ["nhs_number" ] = nhs_number
8081 # add counts for observability
8182 response ["matched" ] = len (matching_records )
82- response ["discarded" ] = len ( discarded_records )
83+ response ["discarded" ] = discarded_count
8384 return response
8485
8586
You can’t perform that action at this time.
0 commit comments