@@ -368,10 +368,6 @@ def get_merged_pat_batch_drugs(
368368 return pd .DataFrame () # Return an empty DataFrame in case of error
369369
370370
371- import os
372- import pandas as pd
373-
374-
375371def get_merged_pat_batch_diagnostics (
376372 client_idcode_list ,
377373 config_obj = None ,
@@ -571,11 +567,6 @@ def get_merged_pat_batch_mct_docs(
571567 # Apply data type filters for MCT documents
572568 batch_target = apply_data_type_mct_docs_filters (config_obj , batch_target )
573569
574- # larger batches returned as lists...
575- if isinstance (batch_target , list ) and len (batch_target ) >= 1 :
576-
577- batch_target = batch_target [0 ]
578-
579570 # Drop rows with NaN values in critical columns
580571 col_list_drop_nan = [
581572 "observation_valuetext_analysed" ,
@@ -717,10 +708,6 @@ def get_merged_pat_batch_epr_docs(
717708 text_column = "body_analysed" ,
718709 debug = config_obj .verbosity > 5 ,
719710 )
720- # larger batches returned as lists...
721- if isinstance (batch_target , list ) and len (batch_target ) >= 1 :
722-
723- batch_target = batch_target [0 ]
724711
725712 # Drop rows with NaN values in critical columns
726713 col_list_drop_nan = ["body_analysed" , "updatetime" , "client_idcode" ]
@@ -850,11 +837,6 @@ def get_merged_pat_batch_textual_obs_docs(
850837 search_string = f"{ bloods_time_field } :[{ global_start_year } -{ global_start_month } -{ global_start_day } TO { global_end_year } -{ global_end_month } -{ global_end_day } ]" ,
851838 )
852839
853- # larger batches returned as lists...
854- if isinstance (batch_target , list ) and len (batch_target ) >= 1 :
855-
856- batch_target = batch_target [0 ]
857-
858840 # Drop rows with no textualObs
859841 batch_target = batch_target .dropna (subset = ["textualObs" ])
860842 # Drop rows with empty string in textualObs
@@ -1429,9 +1411,6 @@ def get_merged_pat_batch_reports(
14291411 f"updatetime:[{ global_start_year } -{ global_start_month } -{ global_start_day } TO { global_end_year } -{ global_end_month } -{ global_end_day } ]" ,
14301412 )
14311413
1432- if isinstance (batch_target , list ) and len (batch_target ) >= 1 :
1433-
1434- batch_target = batch_target [0 ]
14351414 # Combine textualObs and basicobs_value_analysed into body_analysed
14361415 batch_target ["body_analysed" ] = (
14371416 batch_target ["textualObs" ].astype (str )
0 commit comments