Project Details

macros2.py funtion filtrosfinales()

September 12th 2023

"The dynamic path ruta_pend4 is set for the ""Pendientes4.xlsx"" file, which will be located in the output folder corresponding to the current day within the project folder structure. The slope file ""Pendientes4.xlsx"" is read into a DataFrame called df_pend4 using the 'openpyxl' engine. A series of filters and conditions are applied to the DataFrame df_pend4 to update the ""Categorization"" column and the ""Bogotá Process Assignment"" column based on certain criteria: Filter 6.13: If the ""Categorization"" column is ""MEDICAL ADVISOR"" and the ""Bogotá Process Assignment"" column is ""SUPERVISOR"", the ""Categorization"" column is updated with ""MEDICAL ADVISOR"". Filter 6.14: If the ""Categorization"" column is ""SUPERVISOR"" and the ""Bogotá Process Assignment"" column is ""MEDICAL ADVISOR"", the ""Categorization"" column is updated with ""SUPERVISOR"". Filter 6.15: If the column ""Description of the Benefit or Medicine"" contains the word ""BIOMETRICS"", both the ""Categorization"" column and the ""Bogotá Process Assignment"" column are updated with ""MEDICAL ADVISOR"". Filter 6.16: If the ""Benefit Code or Medicine"" column has the code ""1006007"", both the ""Categorization"" column and the ""Bogotá Process Assignment"" column are updated with ""SUPERVISOR"". The ""Pendientes4.xlsx"" file is updated with the changes made to the DataFrame df_pend4. Finally, the function returns a value of 2 if executed successfully. Otherwise, it returns the error line along with an explanatory message of the error." library:sys, pandas, datetime, os, openpyxl

macros2.py funtion filtrosfinales()