@@ -22,7 +22,6 @@ def process_csv_to_fhir(incoming_message_body: dict) -> int:
2222 """
2323 encoder = "utf-8" # default encoding
2424 try :
25- # and encoder to the incoming message body
2625 incoming_message_body ["encoder" ] = encoder
2726 interim_message_body = file_level_validation (incoming_message_body = incoming_message_body )
2827 except (InvalidHeaders , NoOperationPermissions , Exception ) as e : # pylint: disable=broad-exception-caught
@@ -77,14 +76,11 @@ def process_rows(file_id, vaccine, supplier, file_key, allowed_operations, creat
7776 row_id = f"{ file_id } ^{ row_count } "
7877 logger .info ("MESSAGE ID : %s" , row_id )
7978 # Log progress every 1000 rows and the first 10 rows after a restart
80- if ( total_rows_processed_count % 1000 == 0 ) :
79+ if total_rows_processed_count % 1000 == 0 :
8180 logger .info (f"Process: { total_rows_processed_count + 1 } " )
82- if ( start_row > 0 and row_count <= start_row + 10 ) :
81+ if start_row > 0 and row_count <= start_row + 10 :
8382 logger .info (f"Restarted Process (log up to first 10): { total_rows_processed_count + 1 } " )
8483
85- total_rows_processed_count += 1
86- logger .info (f"Process row: { total_rows_processed_count } " )
87-
8884 # Process the row to obtain the details needed for the message_body and ack file
8985 details_from_processing = process_row (target_disease , allowed_operations , row )
9086 # Create the message body for sending
@@ -97,6 +93,7 @@ def process_rows(file_id, vaccine, supplier, file_key, allowed_operations, creat
9793 ** details_from_processing ,
9894 }
9995 send_to_kinesis (supplier , outgoing_message_body , vaccine )
96+ total_rows_processed_count += 1
10097
10198 except Exception as error : # pylint: disable=broad-exception-caught
10299 # if error reason is 'invalid continuation byte', then it's a decode error
0 commit comments