clintk.text_parser.section_manager module

Module to manage sections found by parser

clintk.text_parser.section_manager.main_splitter(df, columns)[source]

splits all the entries of df

Using main_splitter causes to split texts into several rows, one text is split into the number of sections it contains

Parameters:
  • df (pd.DataFrame)
  • columns (list of str)
Returns:

Return type:

pd.DataFrame

clintk.text_parser.section_manager.reduce_dic(dico, sections)[source]

merges key, values of a dictionary

@TODO find sections names using regex

Parameters:
  • dico (dict)
  • sections (list of str) – name of the sections to keep as in ReportsParser.sections
Returns:

concatenated contents of sections

Return type:

str

clintk.text_parser.section_manager.splitter(patient_id, date, cycle, report_dict)[source]

splits the report into the number of keys in report_dict

Parameters:
  • patient_id
  • date
  • cycle
  • report_dict