updated the index for the end element when one passes a patients list to batch_flat_table_initializer script