def add_block_list(self):
     block_list = NewBlock(self.conn, self.cursor, self.user_name)
     add_data = True
     while add_data:
         categories = ['Add Block', 'Edit Block', 'Exit']
         new_update = ask.ask_list('you want to do?', categories)
         if new_update == 'Edit Block':
             block_list.edit_data()
             add_data = ask.ask_y_n(
                 'Do you want to add/edit another block?')
         elif new_update == 'Add Block':
             file_number = 'test'
             check_file = False
             while not check_file:
                 file_number = input("Enter File Number: ")
                 print("File Number: " + file_number)
                 check_file = ask.ask_y_n("Is this file number correct")
             if not sql.check_file_number_exist(
                     self.cursor, file_number, table='block_list'):
                 block_list.add_data(file_number)
             else:
                 print(
                     'This file_number already exists. Add a new block if for '
                     + file_number)
                 block_type = ask.ask_list('Block type',
                                           ['biopsy', 'surgery'])
                 block_list.add_new_pk(file_number, block_type)
             add_data = ask.ask_y_n(
                 'Do you want to add/edit another block?')
         else:
             add_data = False
Beispiel #2
0
 def pet_report_identifier(self):
     module_name = self.module_list[0]
     check = False
     report_identifier = ['NA'] * 12
     while not check:
         pet_scan_date = ask.check_date('Please enter PET report date: ')
         pet_scan_number = input(
             'Please enter PET scan number as given on the report: ')
         pet_scan_source = input(
             'Please enter the facility at which PET scan was done: ')
         pet_scan_reg_number = input(
             "Please enter PET report registration number: ")
         pet_scan_history = input(
             'Please input patient history as given on report: ')
         pet_carcinoma_status = ask.ask_option(
             'Please enter breast cancer status',
             MultiTest.carcinoma_status)
         pet_cancer_location = ask.ask_list(
             'What is the location of the cancer', MultiTest.breast_cancer)
         pet_recurrence = ask.ask_y_n(
             'Does the patient have a previously detected recurrence/mets?')
         if pet_recurrence:
             pet_recurrence_known = input(
                 'Please describe the recurrence/metastasis: ')
         else:
             pet_recurrence_known = 'no_known_recurrence_or_metastasis'
         pet_procedure_body_region = ask.ask_list(
             "Region of body monitored by PET scan", PetReport.body_region)
         pet_procedure_fdg_dose_mci = ask.check_number_input(
             "Please enter dose of 18F-FDG used in mCi. ",
             "(Please enter only dose. If given in other units "
             "enter under additional notes.): ")
         pet_procedure_bsl = input(
             "Please enter basal sugar level with units as given: ")
         pet_scanner_name = ask.ask_list('Please enter name of scanner',
                                         PetReport.machine_name)
         pet_procedure_additional_notes = input(
             'Please enter additional notes, if any for PET scan and patient '
             'conditions: ')
         report_identifier = [
             self.file_number, pet_scan_date, pet_scan_number,
             pet_scan_source, pet_scan_reg_number, pet_scan_history,
             pet_carcinoma_status, pet_cancer_location,
             pet_recurrence_known, pet_procedure_body_region,
             pet_procedure_fdg_dose_mci, pet_procedure_bsl,
             pet_scanner_name, pet_procedure_additional_notes
         ]
         columns_list = names(module_name)
         check = sql.review_input(self.file_number, columns_list,
                                  report_identifier)
     return report_identifier
Beispiel #3
0
 def mammo_mass(self, mass_id):
     print(self.table, mass_id)
     check = False
     data_list = ask.default_data_list(self.col_list)
     while not check:
         mass_location = self.mammo_breast
         if self.mammo_breast == "bilateral":
             mass_location = ask.ask_option("Location of mass "
                                            + str(mass_id),
                                            RadioTables.breast)
         mass_quadrant = ask.ask_list('Quadrant location of lesion',
                                      Radio.lesion_quadrant)
         mammo_mass_shape = ask.ask_option("Shape of mass",
                                           RadioTables.mass_shape)
         mammo_mass_margin = ask.ask_option("Margins of mass",
                                            RadioTables.mass_margin)
         mass_nipple = input("Distance from nipple (cm): ")
         mass_dimension,
         mass_size_unit,
         mass_longest_dimension = self.lesion_size()
         modality = self.table
         data_list = [self.file_number, mass_location, mass_name,
                      mass_quadrant, mammo_mass_shape, mammo_mass_margin,
                      mass_nipple, mass_dimension, mass_longest_dimension,
                      mass_size_unit, modality]
         check = sql.review_input(self.file_number, columns=self.col_list,
                                  data=data_list)
         data_list = data_list + [self.user_name, sql.last_update()]
     return data_list
Beispiel #4
0
 def ihc_report(ihc_type):
     options = ['positive', 'negative', 'equivocal', 'not_done']
     proteins = ['er', 'pr', 'her2', 'fish']
     ihc_status = []
     for protein in proteins:
         option_list = [
             ihc_type + "_" + protein + '_' + status for status in options
         ]
         category = protein.upper() + ' status'
         ihc_value = ask.ask_list(category, option_list)
         ihc_status.append(ihc_value)
         if protein in {'er', 'pr'}:
             if 'positive' in ihc_value:
                 percent = input(protein.upper() +
                                 "(Percent/Grade, Enter '" + protein +
                                 "_percent_not_done' if "
                                 "%age not available): ")
             else:
                 percent = ihc_value
             ihc_status.append(percent)
         elif protein == 'her2':
             percent = input("HER2 Grade: ")
             ihc_status.append(percent)
     tumour_ki67 = input(
         "Ki67 Percent, number only, Enter 'Ki67_not_done' if test not done: "
     )
     data = ihc_status + [tumour_ki67]
     return data
Beispiel #5
0
 def mri_mass(self, mass_id):
     check = False
     data_list = ask.default_data_list(self.col_list)
     while not check:
         if self.mammo_breast == "bilateral":
             mass_location = ask.ask_option("Location of mass " + str(
                                            mass_id), RadioTables.breast)
         else:
             mass_location = self.mammo_breast
         check_t1_t2 = ask.ask_y_n('Are both T1 and T2 image analysis'
                                   'available for this mass?')
         type_of_imaging = ['T1', 'T2']
         if not check_t1_t2:
             type_of_imaging = ask.ask_list('Observation of this mass is a'
                                            'result of which type of'
                                            'imaging? ',
                                            RadioTables.mri_image_type)
         data_list = self.mri_mass_detail(type_of_imaging, mass_id)
         if type_of_imaging in {'T1', 'T2'}:
             data_list = [('{0}_{1}'.format(type_of_imaging, data)) for
                          data in data_list]
         mass_name = "Lesion " + str(mass_id)
         data_list = [self.file_number, mass_location, mass_name]+data_list
         check = sql.review_input(self.file_number, columns=self.col_list,
                                  data=data_list)
         data_list = [data_list] + [self.user_name, sql.last_update()]
         data_list = data_list + [self.user_name, sql.last_update()]
     return data_list
 def get_block_pk(self,
                  user_name,
                  col_filter_value,
                  col_select='block_id',
                  col_filter='block_type'):
     #retrieves a list of block_ids that correspond to a particular col_filter (block_type, file_number etc)
     new_block = NewBlock(self.conn, self.cursor, user_name)
     block_columns = ['file_number'] + names.block_list('all')
     block_list = sql.extract_multiple_value_select_column(
         self.conn, block_columns, self.table_name, self.file_number,
         col_select, col_filter, col_filter_value)
     block_id = ask.ask_list(
         str(col_filter_value) +
         ' block id information is to be entered for: ',
         block_list + ['not available', 'Other'])
     block_list = ask.flatten_nested_list(block_list)
     if block_id not in set(block_list):
         new_block.add_new_pk(self.file_number, block_type=col_filter_value)
         pk, number_of_blocks = self.get_block_information(
             block_id, block_data=['pk', 'number_of_blocks'])
     else:
         sql_statement = ("SELECT pk FROM block_list WHERE (block_id = '" +
                          block_id + "')")
         self.cursor.execute(sql_statement)
         pk_ = self.cursor.fetchall()
         pk = pk_[0][0]
         number_of_blocks = sql.get_value(
             col_name='number_of_blocks',
             table='block_list',
             pk_name='pk',
             pk=pk,
             cursor=self.cursor,
             error_statement="Enter number of blocks: ")
     return pk, str(block_id), number_of_blocks
 def get_block_id(self, col_filter_value):
     block_columns = ['file_number'] + names.block_list('all')
     block_list = sql.extract_multiple_value_select_column(
         self.conn,
         block_columns,
         table=self.table_name,
         file_number=self.file_number,
         col_select='block_id',
         col_filter='block_type',
         col_filter_value=col_filter_value)
     block_id = ask.ask_list(
         str(col_filter_value) +
         ' block id information is to be entered for: ',
         block_list + ['not available', 'Other'])
     block_list = ask.flatten_nested_list(block_list)
     if block_id not in set(block_list):
         number_of_blocks = 'not available'
     else:
         number_of_blocks = sql.get_value(col_name='number_of_blocks',
                                          table='block_list',
                                          pk_name='file_number',
                                          pk=self.file_number,
                                          cursor=self.cursor,
                                          error_statement="Enter number of "
                                          "blocks: ")
     return str(block_id), str(number_of_blocks)
def check_file(conn, cursor, table, file_number, user_name, folders, file):
    from add_edit.edit_record import edit_record
    from add_edit.add_new import add_new
    from reports.radiology import Radiology
    if table != 'radiology':
        sql_statement = "SELECT rowid FROM " + table + " WHERE file_number = ?"
        cursor.execute(sql_statement, (file_number, ))
        data = cursor.fetchall()
        if len(data) == 0:
            if table not in {"follow_up_data", "pet_reports", 'radiology'}:
                cursor.execute("INSERT INTO " + table + "(file_number) VALUES ('" + file_number + "')")
            print(file_number + " does not exist in table " + table + ". Enter new record")
            add_new(conn, cursor, file_number, table, user_name, folders, file)
        else:
            todo = ask.ask_list(file_number + " already exists in table " + table + ".", ["Edit record",
                                                                                        "Add new record for same file number",
                                                                                         "Edit None"])
            if todo == "Edit record":
                edit_record(conn, cursor, file_number, table, user_name, folders, file)
            elif todo == "Add new record for same file number":
                print("Add additional record module TBD")
        ask_table = ask.ask_y_n("Add another table?")
    else:
        radio = Radiology(conn, cursor, file_number, user_name)
        tables = radio.tables
        for tab in tables:
            ask_table = True
            while ask_table:
                sql_statement = "SELECT rowid FROM " + tab + " WHERE file_number = ?"
                cursor.execute(sql_statement, (file_number, ))
                dat = cursor.fetchall()
                if len(dat) == 0:
                    print(file_number + " does not exist in table " + tab)
                    enter_tab = ask.ask_y_n('Enter data?')
                    if enter_tab:
                        cursor.execute("INSERT INTO " + tab + "(file_number) VALUES ('" + file_number + "')")
                        add_new(conn, cursor, file_number, tab, user_name, folders, file)
                else:
                    todo = ask.ask_list(file_number + " already exists in table " + tab + ".", ["Edit record", "Edit None"])
                    if todo == "Edit record":
                        edit_record(conn, cursor, file_number, tab, user_name, folders, file)
            #     data.append(dat)
            # print(data, 'length data is =', len(data))          
            # # remove later - test_function
                ask_table = ask.ask_y_n("Add another data set for " + tab + "?")
    return ask_table
Beispiel #9
0
 def usg_mass(self, mass_id):
     print(self.table, mass_id)
     check = False
     data_list = ask.default_data_list(self.col_list)
     while not check:
         mass_location = self.mammo_breast
         if self.mammo_breast == "bilateral":
             mass_location = ask.ask_option("Location of mass "
                                            + str(mass_id),
                                            RadioTables.breast)
         location_clock = ask.check_number_input("What is the clock"
                                                 "position of mass "
                                                 + str(mass_id) + "?",
                                                 'Please enter only numbers'
                                                 ' additional paramters '
                                                 'can be entered '
                                                 'next')
         location_add = input('Additional parameters for clock position')
         location_clock = location_clock + location_add + " o'clock"
         mass_quadrant = 'data_not_available'
         quad = ask.ask_y_n('Is the quadrant location given?')
         if quad:
             mass_quadrant = ask.ask_list('what is the quadrant location',
                                          Radio.lesion_quadrant)
         mass_shape = ask.ask_list("Shape of mass " + str(mass_id),
                                   RadioTables.mass_shape)
         mass_name = "lesion_" + str(mass_id)
         mass_dimension,
         mass_size_unit,
         mass_longest_dimension = self.lesion_size()
         mass_margin = ask.ask_option("Margin of mass " + str(mass_id),
                                      RadioTables.mass_margin_usg)
         mass_echo = ask.ask_option("Echo pattern of mass " + str(mass_id),
                                    RadioTables.mass_echo)
         mass_id = "Mass " + str(mass_id)
         modality = self.table
         data_list = [self.file_number, mass_name, mass_location,
                      location_clock, mass_quadrant, mass_shape,
                      mass_margin, mass_echo, mass_dimension,
                      mass_longest_dimension, mass_size_unit, modality]
         check = sql.review_input(self.file_number, columns=self.col_list,
                                  data=data_list)
         data_list = data_list + [self.user_name, sql.last_update()]
     return data_list
Beispiel #10
0
 def lesion_size():
     mass_size = ask.check_size_input("Mass dimensions (without unit): ")
     mass_size_unit = 'NA'
     if mass_size != 'NA':
         mass_size_unit = ask.ask_list("Mass dimensions unit: ",
                                       RadioTables.mass_units)
     mass_name = "lesion_" + str(mass_id)
     mass_dimension, mass_longest_dimension = mass_size
     mass_longest_dimension = ask.convert_mm_to_cm(
                              mass_longest_dimension, mass_size_unit)
     return mass_size, mass_size_unit, mass_longest_dimension
Beispiel #11
0
def add_insert():
    import sqlite3
    import helper_function.ask_y_n_statement as ask
    import sql.add_update_sql as add_update_sql
    from datetime import datetime
    import os
    import textwrap
    from helper_function.pccm_names import db_tables

    folders = "d:/repos/pccm_db/main/DB"
    file = 'PCCM_BreastCancerDB_check_new_all_2_2019-05-27.db'
    #file = 'PCCM_BreastCancerDB_all_data_rituja_surgery_data.db'
    check_path = False
    while not check_path:
        print('\nDatabase file ' + file + ' in folder ' + folders +
              ' is being used\n')
        check_location = ask.ask_y_n('Is this correct?')
        if not check_location:
            print("\n File is currently set as " + file)
            file = input(
                'Please enter database file name (with .db extension): ')
            print("\n Folder is currently set as " + folders)
            folders = input(
                'Please enter database folder name (full path as given above): '
            )
        else:
            check_path = True
    path = os.path.join(folders, file)
    if os.path.isfile(path):
        conn = sqlite3.connect(path)
        cursor = conn.cursor()
        user_name = input("Please input username/user_id: ")
        folder_next = True
        files_table_added = []
        while folder_next:
            check = False
            while not check:
                file_number = input("File Number: ")
                print("File Number: " + file_number)
                check = ask.ask_y_n("Is this file number correct")
            check_table = True
            while check_table:
                table = ask.ask_list("Table", db_tables())
                file_table = file_number + "-" + table
                files_table_added.append(file_table)
                check_table = add_update_sql.check_file(
                    conn, cursor, table, file_number, user_name, folders, file)
            folder_next = ask.ask_y_n("Add/update another record?")
    else:
        note = "current path: '" + path + "' to database is not valid. Check path and database name and run " \
                                          "start_pccm_db() again."
        wrapper = textwrap.TextWrapper(width=100)
        string = wrapper.fill(text=note)
        print(string)
Beispiel #12
0
 def block_description_df(self, block_id_list, block_desc_df):
     for block in block_id_list:
         print("For Block ID " + self.block_id + ', Block reference: ' +
               block)
         block_type = ask.ask_list("Block type", self.block_type_list)
         block_desc = input("Block Description for block " + block + ": ")
         block_desc_df.loc[block] = [
             self.pk, self.file_number, self.block_id, block, block_type,
             block_desc, self.user_name,
             sql.last_update()
         ]
     return block_desc_df
Beispiel #13
0
 def get_table(self, type_action):
     table = ask.ask_list(
         'What type of Radiology data do you want to enter'
         '/edit? ', list(self.tables))
     type_action = ask.ask_y_n('Do you want to add data or edit data',
                               yes_ans='add',
                               no_ans='edit')
     table = table.lower()
     if type_action == 'add':
         self.add_radio(table)
     if type_action == 'edit':
         self.edit_radio(table)
Beispiel #14
0
 def pet_breast_cancer(self):
     module_name = self.module_list[2]
     breast_report = [
         'NA',
     ] * 7
     check = False
     while not check:
         pet_breast = ask.ask_y_n(
             'Does this report describe a breast cancer?')
         if pet_breast:
             print('\nPlease describe primary breast lesion\n')
             pet_breast_lesion_size = input(
                 'Dimensions of breast lesion/s: ')
             pet_breast_lesion_size_unit = ask.ask_list(
                 'Unit of breast lesion size', ['mm', 'cm'])
             pet_breast_lesion_suv = ask.check_number_input(
                 'Please enter SUV max of breast lesion: ',
                 'Please enter only SUV not description')
             pet_breast_lesion_location = input(
                 'Please enter description of lesion location: ')
             pet_breast_lesion_type = input(
                 'Please input description of lesion: ')
             pet_breast_lesion_comments = input(
                 'Please input any additional notes for breast lesion: ')
             pet_breast_nodes = ask.ask_y_n(
                 'Does the report describe breast related nodes?')
             if pet_breast_nodes:
                 pet_breast_nodes_description = input(
                     'Please enter nodes description as given: ')
             else:
                 pet_breast_nodes_description = 'nodes_not_described'
             pet_breast_skin = ask.ask_y_n(
                 'Does the PET report describe any skin changes?')
             if pet_breast_skin:
                 pet_breast_lesion_skin = input(
                     'Please enter description of skin changes: ')
             else:
                 pet_breast_lesion_skin = 'skin_changes_not_described'
         else:
             pet_breast_lesion_size, pet_breast_lesion_size_unit, pet_breast_lesion_suv, pet_breast_lesion_location,\
             pet_breast_lesion_type, pet_breast_lesion_comments, pet_breast_nodes_description, \
             pet_breast_lesion_skin = ['no_breast_cancer', ] * 8
         breast_report = [
             pet_breast_lesion_size, pet_breast_lesion_size_unit,
             pet_breast_lesion_suv, pet_breast_lesion_location,
             pet_breast_lesion_type, pet_breast_lesion_comments,
             pet_breast_nodes_description, pet_breast_lesion_skin
         ]
         columns_list = names(module_name)
         check = sql.review_input(self.file_number, columns_list[:-2],
                                  breast_report)
     data_list = breast_report + [self.user_name, sql.last_update()]
     return data_list
 def surgery_block_information_0(self):
     module_name = self.module_list[0]
     check = False
     data_list = ['NA']*17
     surgery_block_data_type = 'primary'
     while not check:
         data_type = ask.ask_y_n("Is surgery type: '" + surgery_block_data_type + "'")
         if not data_type:
             surgery_block_data_type = ask.ask_option("Type of surgery", ['revision', 'recurrence'])
         block_list_table = BlockInformation(self.conn, self.cursor, self.file_number)
         block_data = ['block_sr_number', 'block_location', 'current_block_location', 'block_series']
         block_sr_number, block_location, current_block_location, surgery_block_series = \
             block_list_table.get_block_information(self.surgery_block_id, block_data)
         surgery_block_source = ask.ask_option("Pathology Lab (source of block)", PathReports.path_labs)
         breast_cancer_yes_no = ask.ask_y_n('Is this a case of breast cancer (Unilateral OR Bilateral)',
                                            yes_ans="breast_cancer_yes", no_ans="breast_cancer_no")
         pathology_report_available_yes_no = ask.ask_y_n('Is the pathology report available', yes_ans="yes",
                                                         no_ans="no")
         nat = ask.ask_y_n('Has Neo-Adjuvant therapy been administered to the patient (NACT or NAHT)?')
         if nat:
             nact = ask.ask_list('What type of therapy has been givent to the patient?',
                                 ['NACT', 'NAHT', 'NACT_and_NAHT'])
             neoadjuvant_therapy = nact.lower() + '_yes'
             surgery_block_primary_tissue = 'treated_tissue'
         else:
             neoadjuvant_therapy = 'nact_no'
             surgery_block_primary_tissue = 'primary_tissue'
         date_of_surgery = ask.check_date("Date of Surgery: ")
         surgeon_s = ask.ask_option("Name of the Surgeon/s", PathReports.surgeon)
         surgery_hospital_id = input("Hospital ID: ")
         surgery_lesion_site = ask.ask_list("Lesion on", ["right_breast", "left_breast", "bilateral"])
         surgery_type = self.bilateral_treatment(surgery_lesion_site, 'Type of surgery', PathReports.surgery_type)
         data_list = [self.file_number, surgery_block_data_type, block_sr_number, block_location,
                      current_block_location, self.surgery_block_id, self.surgery_number_of_blocks,
                      surgery_block_series, breast_cancer_yes_no, pathology_report_available_yes_no,
                      neoadjuvant_therapy, str(surgery_block_primary_tissue).lower(), surgery_block_source,
                      date_of_surgery, surgeon_s, surgery_hospital_id, surgery_lesion_site, surgery_type]
         columns_list = names(module_name)
         check = sql.review_input(self.file_number, columns_list, data_list)
     return data_list
Beispiel #16
0
def block_location_format():
    block_location = 'To be entered'
    location = False
    while location == False:
        print("Block Location")
        block_cab = input("Cabinet No: ")
        block_drawer = input("Drawer Number: ")
        block_col = input("Column Number: ")
        block_pos = ask.ask_list("Is Block in", ["Front", "Back"])
        block_location = block_cab + "-" + block_drawer + "-" + block_col + block_pos[
            0]
        print("Block location is " + block_location)
        location = ask.ask_y_n("Is this correct?")
    return block_location
Beispiel #17
0
def patient_status():
    status = ask.ask_option("Status at last follow up", [
        "Survivor", "Deceased", "Lost to follow-up",
        'Case of Non Malignant Breast Disease', "Other"
    ])
    if status == "Survivor":
        type_survivor = ask.ask_list("the Survivor is ",
                                     FollowUpStatus.survivor_status)
        status = status + ": " + type_survivor
    if status == "Deceased":
        type_death = ask.ask_option("Cause of death",
                                    FollowUpStatus.deceased_status)
        status = status + ": " + type_death
    return status
Beispiel #18
0
 def block_description(self):
     block_desc_df = pd.DataFrame(columns=self.block_desc_df_cols)
     try:
         blocks = int(self.block_no)
         print('number of blocks: ' + str(blocks))
     except ValueError:
         blocks = int(input('Number of blocks in report: '))
     if blocks == 0:
         block_desc_df.loc[blocks] = ['No blocks in report', 'NA', 'NA']
     else:
         block_id_list = self.create_block_id(blocks)
         block_desc_df = self.block_description_df(block_id_list,
                                                   block_desc_df)
         sql.print_df(block_desc_df)
         check = ask.ask_y_n("Are block descriptions correct?")
         while not check:
             to_correct = ask.ask_y_n("Correct all entries?")
             if not to_correct:
                 to_do = True
                 while to_do:
                     pk_val = 'block_reference'
                     pk = input("Enter block to change: ")
                     #index = block_id_list.index(pk)
                     #print (block_desc_df.loc[index, :])
                     # print(block_desc_df.loc[block_desc_df[pk_val] == 'foo'])
                     data = block_desc_df.loc[block_desc_df[pk_val] == pk]
                     print(data.to_string())
                     # print(block_desc_df.loc[pk])
                     # df_cols = self.block_desc_df_cols[-2]
                     col_change = ask.ask_list("Name of column to change",
                                               self.block_desc_df_cols)
                     new_val = input("Enter correct value for " +
                                     col_change + ' for ' + pk)
                     block_desc_df.loc[pk, col_change] = new_val
                     sql.print_df(block_desc_df)
                     to_do = ask.ask_y_n("Make more changes?")
                 check = True
             else:
                 block_desc_df = self.block_description_df(
                     block_id_list, block_desc_df)
                 check = ask.ask_y_n("Are block descriptions correct?")
     block_descriptions_all = self.block_description_for_db(block_desc_df)
     return block_desc_df, block_descriptions_all
 def get_block_information(self, block_id, block_data):
     if block_id == 'not available':
         search_col = 'file_number'
         search_val = self.file_number
     else:
         search_col = 'block_id'
         search_val = block_id
     sql_statement = ("SELECT DISTINCT " + ', '.join(block_data) +
                      " FROM block_list WHERE " + search_col + "= '" +
                      search_val + "'")
     df = pd.read_sql(sql_statement, self.conn)
     block_details = []
     for col in block_data:
         block_detail = list(pd.unique(df[col].values))
         if len(block_detail) > 1:
             detail = ask.ask_list(
                 'Please choose the correct ' + col + ': ',
                 block_detail + ['not available'])
             block_detail = detail
         block_details.append(block_detail)
     return ask.flatten_nested_list(block_details)
 def surgery_block_information_2(self):
     module_name = self.module_list[2]
     data_list = ['NA', ] * 18
     check = False
     while not check:
         ihc_report = BlockDescription.ihc_report(ihc_type='Tumour_surgery_block')
         surgery_er, surgery_er_percent, surgery_pr, surgery_pr_percent, surgery_her2, surgery_her2_grade, \
         surgery_fish, surgery_ki67 = ihc_report
         surgery_subtype = breast_cancer_subtype('surgery', surgery_er, surgery_pr, surgery_her2,
                                                surgery_her2_grade, surgery_fish)
         node_details = self.node_details()
         sentinel_node_number_removed, sentinel_node_number_positive, axillary_node_number_removed, \
         axillary_node_number_positive, apical_node_number_removed, apical_node_number_positive = node_details
         surgery_perinodal_spread = ask.ask_list('Perinodal Spread',
                                                 ask.create_yes_no_options
                                                 ('Perinodal Spread', not_cancer='requires_follow_up'))
         pathological_pt = input('Pathological T Status (Enter T0/T1/T2 etc as given in report): ')
         pathological_pn = input('Pathological N Status (Enter N0/N1/N2 etc as given in report): ')
         metastasis = ask.ask_y_n('Did the patient have metastasis at diagnosis?')
         nat = sql.get_value(col_name='neoadjuvant_therapy', table=self.table_name, pk=self.fk, cursor=self.cursor,
                             pk_name='fk', error_statement='what is the nact status?')
         if nat != 'nact_no':
             prefix = 'yp'
         else:
             prefix = 'p'
         pathological_stage, clinical_stage = BlockDescription.stage(pathological_pt, pathological_pn, metastasis,
                                                                     prefix)
         data_list = [surgery_er, surgery_er_percent, surgery_pr, surgery_pr_percent, surgery_her2,
                      surgery_her2_grade, surgery_fish, surgery_ki67, surgery_subtype, sentinel_node_number_removed,
                      sentinel_node_number_positive, axillary_node_number_removed, axillary_node_number_positive,
                      apical_node_number_removed, apical_node_number_positive, surgery_perinodal_spread,
                      pathological_pt, pathological_pn, str(metastasis).lower(), pathological_stage, clinical_stage,
                      self.user_name, sql.last_update()]
         columns_list = names(module_name)
         check = sql.review_input(self.file_number, columns_list[:-2], data_list[:-2])
     return data_list
Beispiel #21
0
    def edit_block_id(self):
        file_number = 'test'
        check_file = False
        while not check_file:
            print('add_update_patient')
            file_number = input("Enter File Number: ")
            print("File Number: " + file_number)
            check_file = ask.ask_y_n("Is this file number correct")
        action = ask.ask_list('What values are to be updated?', [
            'patient_name', 'mr_number', 'date_of_birth', 'date_first_visit',
            'block_sr_number', 'block_location', 'block_type', 'block_id',
            'current_block_location', 'blocks_received_at_pccm',
            'number_of_blocks', 'block_series', 'consent'
        ])
        columns_action = [action] + ['update_by', 'last_update']
        update_user = [self.user_name, sql.last_update()]
        if action == 'consent':
            data = list(self.get_consent(file_number)) + update_user
            print(data)
            sql.update_multiple_key(self.conn,
                                    self.cursor,
                                    self.table_name,
                                    columns=[
                                        'consent_discussed', 'consent',
                                        'update_by', 'last_update'
                                    ],
                                    key_name='file_number',
                                    key_value=file_number,
                                    data=data)
        elif action in {
                'patient_name', 'block_sr_number', 'block_location',
                'blocks_received_at_pccm', 'mr_number', 'date_of_birth',
                'date_first_visit'
        }:
            data_old = sql.get_value_no_error(col_name=action,
                                              table=self.table_name,
                                              pk=file_number,
                                              pk_name='file_number',
                                              cursor=self.cursor)
            print(action + ' is currently set as: ' + data_old)
            change = ask.ask_y_n('Do you want to change this?')
            if change:
                data_new = ['NA'] + update_user
                check = False
                while not check:
                    if action in {
                            'blocks_recieved_at_pccm', 'date_of_birth',
                            'date_first_visit'
                    }:
                        data = ask.check_date('Please enter ' + action + ': ')
                    elif action == 'block_location':
                        data = block_location_format()
                    else:
                        data = input('Please input ' + action)
                    if action in BlockList.unique_values:
                        check = sql.check_value_not_exist(
                            self.cursor, action, data, self.table_name)
                    else:
                        check = True
                    data_new = [data] + update_user
                sql.update_multiple_key(self.conn,
                                        self.cursor,
                                        self.table_name,
                                        columns=columns_action,
                                        key_name='file_number',
                                        key_value=file_number,
                                        data=data_new)
        elif action in {
                'current_block_location', 'number_of_blocks', 'block_series',
                'block_type', 'block_id'
        }:
            check = False
            block_list = sql.extract_select_column_key(self.conn,
                                                       self.columns,
                                                       self.table_name,
                                                       col_select='block_id',
                                                       key_name='file_number',
                                                       key_value=file_number)

            block_id = ask.ask_list(
                action + ' information is to be entered for: ', block_list)
            pk = sql.extract_select_column_key(self.conn,
                                               self.columns_db,
                                               self.table_name,
                                               col_select='pk',
                                               key_name='block_id',
                                               key_value=block_id)
            # function returns a set so need to convert to str.
            pk = list(pk)[0]
            data = action
            while not check:
                print('BlockList.edit_values[action]: ',
                      BlockList.edit_values[action])
                data = ask.ask_list(action + ' of ' + block_id,
                                    BlockList.edit_values[action])
                if action in BlockList.unique_values:
                    check = sql.check_value_not_exist(self.cursor, action,
                                                      data, self.table_name)
                else:
                    check = True
            if data is set:
                data = list(data)
            data_new = [data] + update_user
            print(data_new, pk)
            sql.update_multiple_key(self.conn,
                                    self.cursor,
                                    self.table_name,
                                    columns=columns_action,
                                    key_name='pk',
                                    key_value=str(pk),
                                    data=data_new)
 def ihc_biopsy_data(self):
     col_list = names.names_biopsy('ihc_biopsy_data')
     try:
         columns = names.names_biopsy('biopsy_report_info')
         biopsy_ihc_report_pccm = sql.extract_select_column_key(
             conn=self.conn,
             columns=columns,
             table=self.table_name,
             key_name='pk',
             key_value=self.pk,
             col_select='biopsy_ihc_report_pccm')
     except ValueError:
         biopsy_ihc_report_pccm = ask.ask_list(
             "Is the biopsy IHC report available?", [
                 "biopsy_ihc_report_pccm_yes", "biopsy_ihc_report_pccm_no",
                 'doctors_notes_available', 'path_history_notes_'
                 'available', 'requires_specialist_input'
             ])
     data_list = ['NAv'] * 11
     try:
         columns = names.names_biopsy('biopsy_details')
         benign = sql.extract_select_column_key(conn=self.conn,
                                                columns=columns,
                                                table=self.table_name,
                                                key_name='pk',
                                                key_value=self.pk,
                                                col_select='benign')
         # print('Diagnosis is :', benign)
         if benign.lower() == 'false':
             benign = False
         elif benign.lower() == 'true':
             benign = True
         else:
             benign = ask.ask_y_n("Is the diagnosis for this block benign?")
     except ValueError:
         benign = ask.ask_y_n("Is the diagnosis for this block benign?")
     check = False
     while not check:
         if benign:
             # print(str(benign))
             print('Diagnosis is benign so IHC has not been considered')
             biopsy_er, biopsy_er_percent, biopsy_pr, biopsy_pr_percent, biopsy_her2, biopsy_her2_grade, biopsy_fish,\
             biopsy_ki67, biopsy_subtype = ['NA'] * 9
         else:
             print('biopsy_ihc_report_pccm: ' + biopsy_ihc_report_pccm)
             if biopsy_ihc_report_pccm[0] != 'biopsy_ihc_report_pccm_no':
                 print('Please input all data for ' + self.biopsy_block_id +
                       ' block only')
                 biopsy_er, biopsy_er_percent, biopsy_pr, biopsy_pr_percent, biopsy_her2, biopsy_her2_grade, \
                 biopsy_fish, biopsy_ki67 = BlockDescription.ihc_report('biopsy')
             else:
                 biopsy_er, biopsy_er_percent, biopsy_pr, biopsy_pr_percent, biopsy_her2, biopsy_her2_grade, \
                 biopsy_fish, biopsy_ki67 = ['NAv'] * 8
             biopsy_subtype = breast_cancer_subtype('biopsy', biopsy_er,
                                                    biopsy_pr, biopsy_her2,
                                                    biopsy_her2_grade,
                                                    biopsy_fish)
         fnac_lymph_node = ask.ask_list(
             "Lymph Node FNAC",
             ask.create_yes_no_options('Lymph Node FNAC'))
         fnac_lymph_node_location, fnac_lymph_node_diagnosis = (
             fnac_lymph_node, ) * 2
         if fnac_lymph_node == "lymph_node_fnac_yes":
             fnac_lymph_node_location = input(
                 "Please enter lymph node biopsy location: ")
             fnac_lymph_node_diagnosis = ask.ask_list(
                 "Lymph Node FNAC diagnosis",
                 ask.create_yes_no_options('Lymph Node FNAC '
                                           'diagnosis',
                                           yes='malignant',
                                           no='non_malignant'))
         data_list = [
             biopsy_er, biopsy_er_percent, biopsy_pr, biopsy_pr_percent,
             biopsy_her2, biopsy_her2_grade, biopsy_fish, biopsy_ki67,
             biopsy_subtype, fnac_lymph_node, fnac_lymph_node_location,
             fnac_lymph_node_diagnosis
         ]
         check = sql.review_input(self.file_number, col_list[:-2],
                                  data_list)
     data = data_list + [self.user_name, sql.last_update()]
     return data
 def biopsy_report_info(self):
     module = 'biopsy_report_info'
     col_list = names.names_biopsy(module)
     check = False
     data_list = [self.file_number] + (['To be done'] * 18)
     while not check:
         block_list_table = BlockInformation(self.conn, self.cursor,
                                             self.file_number)
         block_data = [
             'block_sr_number', 'block_location', 'current_block_location',
             'blocks_received_at_pccm', 'block_series'
         ]
         block_sr_number, block_location, current_block_location, blocks_received_at_pccm, biopsy_block_series = \
             block_list_table.get_block_information(block_id=self.biopsy_block_id, block_data=block_data)
         fnac = ask.ask_list('FNAC done for breast lesion?',
                             ['fnac_breast_yes', 'fnac_breast_no'])
         if fnac == 'fnac_breast_no':
             fnac_breast, fnac_breast_date, fnac_slide_id, fnac_diagnosis, fnac_diagnosis_comments = (
                 fnac, ) * 5
         else:
             fnac_breast = ask.ask_list('FNAC location', [
                 'left_breast', 'right_breast', 'requires_specialist_input'
             ])
             fnac_breast_date = ask.check_date('Date of FNAC test: ')
             fnac_slide_id = input('Enter FNAC slide ID: ')
             fnac_diagnosis = input(
                 'Enter diagnosis for FNAC breast as given in report: ')
             fnac_diagnosis_comments = input(
                 'Enter additional comments for FNAC diagnosis: ')
         biopsy_date = ask.check_date('Date of Biopsy: ')
         reason_path_report = ask.ask_list('Reason for pathology report', [
             'diagnosis', 'bilateral_diagnosis', 'review_biopsy',
             'nact_follow up', 'recurrence_diagnosis', 'revision_surgery',
             'requires_specialist_input'
         ])
         biopsy_site = ask.ask_list('Biopsy_site', [
             'left_breast', 'right_breast', 'left_axilla', 'right_axilla',
             'requires_specialist_input'
         ])
         biopsy_report_pccm = ask.ask_list(
             "Is the biopsy report available?", [
                 "biopsy_report_pccm_yes", "biopsy_report_pccm_no",
                 'doctors_notes_available', 'path_history_notes',
                 'requires_specialist_input'
             ])
         if biopsy_report_pccm != 'biopsy_report_pccm_no':
             biopsy_block_source = ask.ask_option('Source of Biopsy Block',
                                                  PathReports.path_labs)
             biopsy_lab_id = input("Biopsy Lab ID/SID: ")
         else:
             biopsy_block_source, biopsy_lab_id = ('NAv', ) * 2
         biopsy_ihc_report_pccm = ask.ask_list(
             "Is the IHC report available?", [
                 "biopsy_ihc_report_pccm_yes", "biopsy_ihc_report_pccm_no",
                 'doctors_notes_available', 'path_history_notes_available',
                 'requires_specialist_input'
             ])
         data_list = [
             self.file_number, block_sr_number, block_location,
             current_block_location, blocks_received_at_pccm, fnac_breast,
             fnac_breast_date, fnac_slide_id, fnac_diagnosis,
             fnac_diagnosis_comments, reason_path_report, biopsy_site,
             biopsy_report_pccm, biopsy_ihc_report_pccm,
             self.biopsy_block_id, self.biopsy_number_of_blocks,
             biopsy_block_series, biopsy_date, biopsy_block_source,
             biopsy_lab_id
         ]
         print(data_list)
         check = sql.review_input(self.file_number, col_list, data_list)
     data = data_list
     return data
    def biopsy_details(self):
        col_list = names.names_biopsy('biopsy_details')
        try:
            columns = names.names_biopsy('biopsy_report_info')
            biopsy_report_pccm = sql.extract_select_column_key(
                conn=self.conn,
                columns=columns,
                table=self.table_name,
                key_name='pk',
                key_value=self.pk,
                col_select='biopsy_report_pccm')
        except ValueError:
            biopsy_report_pccm = ask.ask_list(
                "Is the biopsy report available?", [
                    "biopsy_report_pccm_yes", "biopsy_report_pccm_no",
                    'doctors_notes_available', 'path_history_notes',
                    'requires_specialist_input'
                ])
        data_list = ['NAv'] * 3 + ['False'] + ['NAv'] * 3
        if biopsy_report_pccm != 'biopsy_report_pccm_no':
            check = False
            while not check:
                print('Please input all data for ' + self.biopsy_block_id +
                      ' report only')
                biopsy_type = ask.ask_list("Biopsy Type",
                                           PathReports.biopsy_type)
                biopsy_diagnosis = ask.ask_list("Biopsy Diagnosis: ",
                                                PathReports.diagnosis)
                biopsy_comments = input(
                    'Enter any additional comments on the diagnosis: ')
                benign = ask.ask_y_n('Is the diagnosis of ' +
                                     str(biopsy_diagnosis) +
                                     ' describing a benign condition ('
                                     'If diagnosis is not available '
                                     'enter NO here)')
                if benign:
                    biopsy_tumour_grade, biopsy_lymph_emboli, dcis_biopsy = [
                        'benign condition'
                    ] * 3
                else:
                    biopsy_tumour_grade = ask.ask_option(
                        "Tumour Biopsy Grade", PathReports.grade)
                    biopsy_lymph_emboli = ask.ask_list(
                        "Are Lymphovascular emboli seen?",
                        ask.create_yes_no_options(
                            'Lymphovascular emboli Biopsy',
                            not_cancer='requires_follow_up'))
                    dcis_biopsy = ask.ask_list(
                        "Does the biopsy show DCIS",
                        ask.create_yes_no_options(
                            'dcis biopsy', not_cancer='requires_follow_up'))

                data_list = [
                    biopsy_type, biopsy_diagnosis, biopsy_comments,
                    str(benign), biopsy_tumour_grade, biopsy_lymph_emboli,
                    dcis_biopsy
                ]
                check = sql.review_input(self.file_number, col_list, data_list)
        else:
            print(
                '\nBiopsy report is not available. Data for biopsy_type, biopsy_diagnosis, biopsy_comments, '
                'tumour_grade, lymph_emboli, dcis_biopsy has been entered as NAv\n'
            )
        return data_list
Beispiel #25
0
    def update_patient(self, file_number, block_id):
        block_df = self.block_data
        check = False
        while not check:
            print('update_patient')
            pk = uuid.uuid4().hex
            patient_name = self.get_value_and_check_value(
                col_name='patient_name',
                file_number=file_number,
                input_statement='Please enter patient name: ',
                integer=False)
            block_sr_number = self.get_value_and_check_value(
                col_name='block_sr_number',
                file_number=file_number,
                input_statement='Please enter block serial number: ',
                integer=True)
            if block_sr_number != 'block_not_available':
                block_location_check = sql.get_value_no_error(
                    'block_location', self.table_name, file_number,
                    'file_number', self.cursor)
                block_location = block_location_check
                print('block_location: ' + str(block_location))
                block_location_check = ask.ask_y_n('Is this correct?')
                while not block_location_check:
                    block_location = block_location_format()
                    block_location_check = self.check_block_value_not_exist(
                        value_name='block_location',
                        value=block_location,
                        table=self.table_name)
                blocks_received_at_pccm = sql.check_db_value(
                    col_name='blocks_received_at_pccm',
                    table=self.table_name,
                    file_number=file_number,
                    cursor=self.cursor,
                    error_statement='Please enter date blocks recieved at PCCM'
                    ' (dd.mm.yyyy): ')
                block_type = ask.ask_list('Block type', ['biopsy', 'surgery'])
                if block_id == 'block_id':
                    block_id = self.check_block_value_in_db(
                        input_statement='Please enter block id: ',
                        value_name='block_id',
                        integer=False)

                number_of_blocks = ask.check_number_input(
                    'Please enter number of blocks recieved at PCCM: ',
                    'Number of blocks has to be a whole number or NA')
                block_series = input(
                    "Series of blocks recieved (Please separate series by ';'): "
                )
                current_block_location = ask.ask_list(
                    'Current location of block', names.block_list('location'))
                consent_discussed, consent = self.get_consent(file_number)
            else:
                block_type = ask.ask_list('Block type', ['biopsy', 'surgery'])
                if block_id == 'block_id':
                    block_id = self.check_block_value_in_db(
                        input_statement='Please enter block id: ',
                        value_name='block_id',
                        integer=False)
                block_location, blocks_received_at_pccm, number_of_blocks, block_series, current_block_location, \
                consent_discussed, consent = (block_sr_number, )*7
            data_list = [
                pk, file_number, patient_name, block_sr_number, block_location,
                block_type, block_id, current_block_location,
                blocks_received_at_pccm, number_of_blocks, block_series,
                consent_discussed, consent, self.user_name,
                sql.last_update()
            ]
            block_df.loc[pk] = data_list
            check, block_df = sql.review_df_row(block_df)
        print("error check in update_patient")
        sql.print_df(block_df)
        return block_df
Beispiel #26
0
    def add_update_patient(self):
        block_df = self.block_data
        file_number = 'test'
        check_file = False
        while not check_file:
            print('add_update_patient')
            file_number = input("Enter File Number: ")
            print("File Number: " + file_number)
            check_file = ask.ask_y_n("Is this file number correct")
        check = False
        while not check:
            if sql.check_file_number_exist(self.cursor, file_number,
                                           self.table_name):
                print('add_update_patient_not_checck')
                pk = uuid.uuid4().hex
                patient_name = self.get_value_and_check_value(
                    col_name='patient_name',
                    file_number=file_number,
                    input_statement='Please enter patient name: ',
                    integer=False)
                block_sr_number = self.get_value_and_check_value(
                    col_name='block_sr_number',
                    file_number=file_number,
                    input_statement='Please enter block serial number: ',
                    integer=True)
                # block_location = 'block_location'
                block_location_check = sql.get_value_no_error(
                    col_name='block_location',
                    table=self.table_name,
                    pk=file_number,
                    pk_name='file_number',
                    cursor=self.cursor)
                if not block_location_check:
                    print(
                        'Block location already exists for another file_number'
                    )
                    while not block_location_check:
                        block_location = block_location_format()
                        block_location_check = sql.check_value_not_exist(
                            self.cursor,
                            value_name='block_location',
                            value=block_location,
                            table=self.table_name)
                else:
                    block_location = block_location_check
                blocks_received_at_pccm = sql.get_value_no_error(
                    col_name='blocks_received_at_pccm',
                    table=self.table_name,
                    pk=file_number,
                    pk_name='file_number',
                    cursor=self.cursor)
                if not blocks_received_at_pccm:
                    blocks_received_at_pccm = ask.check_date_or_today(
                        'Please enter date blocks recieved at PCCM (or '
                        'today): ')
                consent_discussed, consent = self.get_consent(file_number)
            else:
                pk = uuid.uuid4().hex
                patient_name = input('Please enter patient name: ')
                block_sr_number = self.check_block_value_in_db(
                    input_statement='Please enter block serial number: ',
                    value_name='block_sr_number',
                    integer=True)

                block_pccm = ask.ask_y_n(
                    'Have these blocks been recieved at PCCM?')
                block_location, blocks_received_at_pccm = [
                    'NA',
                ] * 2
                if block_pccm:
                    block_location_check = False
                    while not block_location_check:
                        block_location = block_location_format()
                        block_location_check = sql.check_value_not_exist(
                            self.cursor,
                            value_name='block_location',
                            value=block_location,
                            table=self.table_name)
                    blocks_received_at_pccm = ask.check_date_or_today(
                        'Please enter date blocks recieved at PCCM (or '
                        'today): ')
                consent_discussed, consent = self.get_consent(file_number)
            block_type = ask.ask_list('Block type', ['biopsy', 'surgery'])
            block_id = self.check_block_value_in_db(
                input_statement='Please enter block id: ',
                value_name='block_id',
                integer=False)
            number_of_blocks = ask.check_number_input(
                'Please enter number of blocks recieved at PCCM: ',
                'Number of blocks has to be a whole number or NA')
            block_series = input(
                "Series of blocks recieved (Please separate series by ';'): ")
            current_block_location = ask.ask_list('Current location of block',
                                                  names.block_list('location'))
            data_list = [
                pk, file_number, patient_name, block_sr_number, block_location,
                block_type, block_id, current_block_location,
                blocks_received_at_pccm, number_of_blocks, block_series,
                str(consent_discussed), consent, self.user_name,
                sql.last_update()
            ]
            # error check
            print("error check in loop 1")
            sql.print_df(block_df)
            block_df.loc[pk] = data_list
            print("error check in loop 2")
            sql.print_df(block_df)
            check, block_df = sql.review_df_row(block_df)
        # error check
        print("error check out of loop_to_db")
        sql.print_df(block_df)
        return block_df
Beispiel #27
0
def surgery_information(file_number):
    check = False
    while not check:
        surgery_date,surgery_hospital,surgery_patient_hospital_id,surgery_date_admission, surgery_hospital_ward, \
        surgery_name_anaesthetist, surgery_name_surgeon, surgery_lesion_location, surgery_type, surgery_incision, \
        surgery_type_subtype, surgery_type_level_subtype, oncoplastic_surgery_type, oncoplastic_surgery_flap, \
        oncoplastic_surgery_plan, oncoplastic_surgery_tumour_filled_by, oncoplastic_surgery_nac_graft, \
        oncoplastic_surgery_primary_pedicle, oncoplastic_surgery_secondary_pedicle, reconstruction_surgery_implant_type,\
        reconstruction_surgery_implant_size, contralateral_surgery, contralateral_surgery_type, \
        contralateral_surgery_type_details, surgery_notes = (" ", )*25
        surgery_date = input("Date of surgery: ")
        surgery_hospital = ask.ask_list("Name of hospital",
                                        SurgeryLists.hospitals)
        surgery_patient_hospital_id = input("Patient ID at the hospital: ")
        surgery_hospital_ward = input("Name of hospital ward: ")
        surgery_date_admission = input("Date of admission: ")
        surgery_name_anaesthetist = ask.ask_list("Name of Anaesthetist",
                                                 SurgeryLists.anesthetists)
        surgery_name_surgeon = ask.ask_list("Name of the Surgeon/s",
                                            SurgeryLists.surgeon)
        lesion = ask.ask_list("Location of lesion", SurgeryLists.lesion)
        if lesion in {"Right Breast", "Left Breast", "Both Breasts"}:
            surgery_lesion_location = lesion_location(lesion)
        else:
            surgery_lesion_location = 'Requires specialist Input'
        surgery_incision = ask.ask_list('Incision type', SurgeryLists.incision)
        if surgery_incision == 'Circum-areolar':
            type = ask.ask_list('Pleaes define margine', [
                'At areolar margin', 'Away from margin', 'Data not in report'
            ])
            surgery_incision = surgery_incision + ': ' + type
        surgery_type = ask.ask_list("Types of Surgery", [
            "Conservative Breast Surgery", "Implant Based Reconstruction",
            'Requires Specialist Input'
        ])
        if surgery_type == "Conservative Breast Surgery":
            surgery_type_subtype = ask.ask_list(
                "Type of Breast Conservation Surgery",
                ['Conventional Surgery', 'Oncoplastic Surgery', 'Other'])
            if surgery_type_subtype == "Conventional Surgery":
                surgery_type_level_subtype = ask.ask_list(
                    "type of conventional surgery",
                    SurgeryLists.conventional_surgery_subtype)
                if surgery_type_level_subtype == 'Extreme Resection':
                    guide = ask.ask_list('Surgery guide', SurgeryLists.guide)
                    surgery_type_level_subtype = surgery_type_level_subtype + ': ' + guide
                oncoplastic_surgery_type, oncoplastic_surgery_flap, oncoplastic_surgery_plan, \
                oncoplastic_surgery_tumour_filled_by,oncoplastic_surgery_nac_graft, oncoplastic_surgery_primary_pedicle, \
                oncoplastic_surgery_secondary_pedicle, reconstruction_surgery_implant_type, \
                reconstruction_surgery_implant_size = ("Not applicable for Conventional Breast Conservation", )*9
            elif surgery_type_subtype == "Oncoplastic Surgery":
                surgery_type_level_subtype = ask.ask_option(
                    "Level of oncoplastic surgery",
                    SurgeryLists.oncoplastic_levels)
                if surgery_type_level_subtype == "Level 1":
                    oncoplastic_surgery_type = ask.ask_list(
                        "Type of level 1 oncoplastic surgery",
                        SurgeryLists.level_1_type)
                    if oncoplastic_surgery_type == "Type 2: Volume Displacment":
                        oncoplastic_surgery_flap = ask.ask_list(
                            "Type of flap used", SurgeryLists.level_2_flap)
                        oncoplastic_surgery_plan, oncoplastic_surgery_tumour_filled_by, oncoplastic_surgery_nac_graft, \
                        oncoplastic_surgery_primary_pedicle, oncoplastic_surgery_secondary_pedicle, \
                        reconstruction_surgery_implant_type, reconstruction_surgery_implant_size, \
                        surgery_type_level_subtype = ("Not applicabel for Level 1, Type 2 Oncolplastic Surgery with " \
                                                      "volume displacement",)* 8
                    elif oncoplastic_surgery_type == 'Type 1: Simple oncoplastic – mammoplasty':
                        oncoplastic_surgery_flap = "No flap for Simple oncoplastic – mammoplasty"
                        oncoplastic_surgery_plan, oncoplastic_surgery_tumour_filled_by, oncoplastic_surgery_nac_graft, \
                        oncoplastic_surgery_primary_pedicle, oncoplastic_surgery_secondary_pedicle, \
                        reconstruction_surgery_implant_type, reconstruction_surgery_implant_size, \
                        surgery_type_level_subtype = ("Not applicabel for Level 1: Type 1 Simple oncoplastic – "
                                                      "mammoplasty",) * 8
                elif surgery_type_level_subtype == "Level 2: Therapeutic Mammoplasty":
                    oncoplastic_surgery_type = ask.ask_list(
                        "Subtypes of Therapeutic Mammoplastty",
                        ["Simple "
                         "Therapeutic", "Extreme "
                         "Therapeutic"])
                    oncoplastic_surgery_flap = "Therapeutic Mammoplasty"
                    if oncoplastic_surgery_type == "Simple Therapeutic":
                        oncoplastic_surgery_plan = ask.ask_list(
                            "Type of Plan used", SurgeryLists.simple_plan)
                        oncoplastic_surgery_tumour_filled_by = oncoplastic_surgery_type
                        oncoplastic_surgery_nac_graft = "No NAC Graft, " + oncoplastic_surgery_type
                        oncoplastic_surgery_primary_pedicle = ask.ask_list(
                            "Type of pedicle used",
                            SurgeryLists.simple_pedicle)
                        oncoplastic_surgery_secondary_pedicle = "No secondary pedicle, " + oncoplastic_surgery_type
                    if oncoplastic_surgery_type == "Extreme Therapeutic":
                        oncoplastic_surgery_tumour_filled_by = ask.ask_list(
                            "Tumour filled by",
                            ["Extended Primary Pedicle", "Secondary Pedicle"])
                        oncoplastic_surgery_plan = ask.ask_list(
                            "Type of Plan used", SurgeryLists.simple_plan)
                        oncoplastic_surgery_nac_graft = ask.ask_y_n(
                            "Is NAC graft done?")
                        if not oncoplastic_surgery_nac_graft:
                            oncoplastic_surgery_nac_graft = "NAC not grafted "
                            oncoplastic_surgery_primary_pedicle = ask.ask_list(
                                "What is Nipple On (primary pedicle) "
                                "pedicle used?", SurgeryLists.primary_pedicle)
                            oncoplastic_surgery_secondary_pedicle = ask.ask_list(
                                "What is the secondary pedicle used?",
                                surgery_tables.pedicle("secondary"))
                        else:
                            oncoplastic_surgery_nac_graft = "Nipple areola complex is grafted"
                            oncoplastic_surgery_primary_pedicle = oncoplastic_surgery_nac_graft
                            oncoplastic_surgery_secondary_pedicle = ask_option(
                                "What is the pedicle used?",
                                surgery_tables.pedicle("secondary"))
                        reconstruction_surgery_implant_type, reconstruction_surgery_implant_size = \
                            (oncoplastic_surgery_plan, )*2
                elif surgery_type_level_subtype == "Level 3: Volume Replacement":
                    oncoplastic_surgery_flap = ask_option(
                        "Type of flap used",
                        ["Local Flaps", "LD Flaps", "Mini LD"])
                    if oncoplastic_surgery_flap == "Local Flaps":
                        flap_type = ask_option(
                            "type of flap",
                            ["Thoraco-epigastric Flap", "LICAP", "TDAP"])
                        oncoplastic_surgery_flap = "Local " + flap_type
                        oncoplastic_surgery_plan, oncoplastic_surgery_tumour_filled_by, oncoplastic_surgery_nac_graft, \
                        oncoplastic_surgery_primary_pedicle, oncoplastic_surgery_secondary_pedicle = \
                            ("Not applicable for volume replacment oncoplasty", )*5
            else:
                other = surgery_type_subtype
                oncoplastic_surgery_type, oncoplastic_surgery_flap, oncoplastic_surgery_plan, \
                oncoplastic_surgery_tumour_filled_by, oncoplastic_surgery_nac_graft, oncoplastic_surgery_primary_pedicle, \
                oncoplastic_surgery_secondary_pedicle, reconstruction_surgery_implant_type, \
                reconstruction_surgery_implant_size, surgery_type_level_subtype = (other,) * 10
        elif surgery_type == "Implant Based Reconstruction":
            surgery_type_subtype = ask_option("Type of surgery", [
                'Non Sling – Conventional IBRS', 'Sling ALDS',
                'Advanced Sling (AALDS)', 'LD Flap', 'LD Flap + Implant',
                'TDAP + Implant', 'LICAP + Implant', 'Implant'
            ])
            reconstruction_surgery_implant_type = ask_option(
                "Type of implant used", ["Fixed Volume", "Dual Lumen"])
            if reconstruction_surgery_implant_type == "Fixed Volume":
                fixed_type = ask_option(
                    "Type of fixed volume implant",
                    ["Smooth", "Textured", "Microtextured"])
                reconstruction_surgery_implant_type = reconstruction_surgery_implant_type + " " + fixed_type
            reconstruction_surgery_implant_size = input(
                "Size of implant used: ")
            surgery_incision = ask_option(
                "Type of incision used",
                surgery_tables.incision("reconstruction"
                                        "_incision"))
            surgery_type_level_subtype, oncoplastic_surgery_type, oncoplastic_surgery_flap, \
            oncoplastic_surgery_plan,oncoplastic_surgery_tumour_filled_by,oncoplastic_surgery_nac_graft,\
            oncoplastic_surgery_primary_pedicle,oncoplastic_surgery_secondary_pedicle = \
                ("Not applicable for reconstruction surgery", )*8
        else:
            surgery_incision,surgery_type_subtype,surgery_type_level_subtype,oncoplastic_surgery_type,\
            oncoplastic_surgery_flap,oncoplastic_surgery_plan,oncoplastic_surgery_tumour_filled_by,\
            oncoplastic_surgery_nac_graft,oncoplastic_surgery_primary_pedicle,oncoplastic_surgery_secondary_pedicle,\
            reconstruction_surgery_implant_type,reconstruction_surgery_implant_size = (surgery_type, ) *12
        contralateral_surgery = ask_option(
            "Was Contralateral Surgery done?",
            ["Yes", "No", "Requires Specialist Input"])
        if contralateral_surgery == "Yes":
            contralateral_surgery_type = ask_option(
                "Type of Contralateral Surgery Done", [
                    "Symmetrisation",
                    "Prophylactic Masstectomy with Reconstruction", "Other"
                ])
            if contralateral_surgery_type == "Symmetrisation":
                contralateral_surgery_type_details = ask_option(
                    "Type of Symmetrisation",
                    ["Same as other side", "Different from other side"])
                if contralateral_surgery_type_details == "Different from other side":
                    contralateral_surgery_type_details = input(
                        "Please give details of symmetrisation: ")
            else:
                contralateral_surgery_type_details = input(
                    "Please give details of " + contralateral_surgery_type)
            contralateral_surgery = "Contralateral Surgery Performed"
        elif contralateral_surgery == "No":
            contralateral_surgery, contralateral_surgery_type, contralateral_surgery_type_details = \
                ("Contralateral Surgery Not Performed", )*3
        elif contralateral_surgery == "Requires Specialist Input":
            contralateral_surgery_type, contralateral_surgery_type_details = (
                'Requires Specialist Input', ) * 2
        surgery_notes = input(
            "Additional Surgery Notes and comments (if available): ")
        data_list = [
            surgery_date, surgery_hospital, surgery_patient_hospital_id,
            surgery_date_admission, surgery_hospital_ward,
            surgery_name_anaesthetist, surgery_name_surgeon,
            surgery_lesion_location, surgery_type, surgery_incision,
            surgery_type_subtype, surgery_type_level_subtype,
            oncoplastic_surgery_type, oncoplastic_surgery_flap,
            oncoplastic_surgery_plan, oncoplastic_surgery_tumour_filled_by,
            oncoplastic_surgery_nac_graft, oncoplastic_surgery_primary_pedicle,
            oncoplastic_surgery_secondary_pedicle,
            reconstruction_surgery_implant_type,
            reconstruction_surgery_implant_size, contralateral_surgery,
            contralateral_surgery_type, contralateral_surgery_type_details,
            surgery_notes
        ]
        col_list = names('surgery_information')
        check = add_update_sql.review_input(file_number, col_list, data_list)
    return data_list
Beispiel #28
0
 def add_block_id(self, file_number):
     block_df = self.block_data
     pk = uuid.uuid4().hex
     data_list = self.columns
     check = False
     while not check:
         check_name = False
         while not check_name:
             patient_name = input('Please enter patient name: '),
             print('Patient name: ' + str(patient_name))
             check_name = ask.ask_y_n('Is name correct')
         mr_number = self.check_block_value_in_db(
             input_statement='Please enter MR number: ',
             value_name='mr_number',
             integer=True)
         date_of_birth = self.get_value_and_check_value(
             col_name='date_of_birth',
             file_number=file_number,
             input_statement='Please input patient date of birth '
             '(format: dd.mm.yyyy): ',
             integer=False)
         date_first_visit = ask.check_date(
             'Please enter date of first visit: ')
         block_sr_number = self.check_block_value_in_db(
             input_statement='Please enter block serial number: ',
             value_name='block_sr_number',
             integer=True)
         block_pccm = ask.ask_y_n(
             'Have these blocks been recieved at PCCM?')
         block_location, blocks_received_at_pccm = [
             'NA',
         ] * 2
         if block_pccm:
             block_location_check = False
             while not block_location_check:
                 block_location = block_location_format()
                 block_location_check = sql.check_value_not_exist(
                     self.cursor,
                     value_name='block_location',
                     value=block_location,
                     table=self.table_name)
             blocks_received_at_pccm = ask.check_date_or_today(
                 'Please enter date blocks recieved at PCCM (or '
                 'today): ')
         consent_discussed, consent = self.get_consent(file_number)
         block_id = self.check_block_value_in_db(
             input_statement='Please enter block id: ',
             value_name='block_id',
             integer=False)
         block_type = ask.ask_list('Block type', ['biopsy', 'surgery'])
         if blocks_received_at_pccm == 'NA':
             number_of_blocks, block_series, current_block_location = [
                 'NA',
             ] * 3
         else:
             number_of_blocks = ask.check_number_input(
                 'Please enter number of blocks recieved at PCCM: ',
                 'Number of blocks has to be a whole number or NA')
             block_series = input(
                 "Series of blocks recieved (Please enter series in the form A-B and separate "
                 "series by '|' e.g, A-B|E): ")
             current_block_location = ask.ask_list(
                 'Current location of block',
                 BlockList.edit_values['current_block_location'])
         data_list = [
             pk, file_number, patient_name, mr_number, date_of_birth,
             date_first_visit, block_sr_number, block_location, block_type,
             block_id, current_block_location, blocks_received_at_pccm,
             number_of_blocks, block_series,
             str(consent_discussed), consent, self.user_name,
             sql.last_update()
         ]
         block_df.loc[pk] = data_list
         check, block_df = sql.review_df_row(block_df)
     return data_list[1:], pk
Beispiel #29
0
 def update_block_id(self, file_number, block_type):
     block_df = self.block_data
     pk = uuid.uuid4().hex
     data_list = self.columns
     check = False
     while not check:
         patient_name = sql.get_value_no_error(col_name='patient_name',
                                               table=self.table_name,
                                               pk=file_number,
                                               pk_name='file_number',
                                               cursor=self.cursor)
         mr_number = sql.get_value_no_error(col_name='mr_number',
                                            table=self.table_name,
                                            pk=file_number,
                                            pk_name='file_number',
                                            cursor=self.cursor)
         date_of_birth = sql.get_value_no_error(col_name='date_of_birth',
                                                table=self.table_name,
                                                pk=file_number,
                                                pk_name='file_number',
                                                cursor=self.cursor)
         date_first_visit = sql.get_value_no_error(
             col_name='date_first_visit',
             table=self.table_name,
             pk=file_number,
             pk_name='file_number',
             cursor=self.cursor)
         block_sr_number = sql.get_value_no_error(
             col_name='block_sr_number',
             table=self.table_name,
             pk=file_number,
             pk_name='file_number',
             cursor=self.cursor)
         block_location = sql.get_value_no_error(col_name='block_location',
                                                 table=self.table_name,
                                                 pk=file_number,
                                                 pk_name='file_number',
                                                 cursor=self.cursor)
         blocks_received_at_pccm = sql.get_value_no_error(
             col_name='blocks_received_at_pccm',
             table=self.table_name,
             pk=file_number,
             pk_name='file_number',
             cursor=self.cursor)
         consent_discussed = sql.get_value_no_error(
             col_name='consent_discussed',
             table=self.table_name,
             pk=file_number,
             pk_name='file_number',
             cursor=self.cursor)
         consent = sql.get_value_no_error(col_name='consent',
                                          table=self.table_name,
                                          pk=file_number,
                                          pk_name='file_number',
                                          cursor=self.cursor)
         block_id = self.check_block_value_in_db(
             input_statement='Please enter block id: ',
             value_name='block_id',
             integer=False)
         if blocks_received_at_pccm == 'NA':
             number_of_blocks, block_series, current_block_location = [
                 'NA',
             ] * 3
         else:
             number_of_blocks = ask.check_number_input(
                 'Please enter number of blocks recieved at PCCM: ',
                 'Number of blocks has to be a whole number or NA')
             block_series = input(
                 "Series of blocks recieved (Please enter series in the form A-B and separate "
                 "series by '|' e.g, A-B|E): ")
             current_block_location = ask.ask_list(
                 'Current location of block',
                 BlockList.edit_values['current_block_location'])
         data_list = [
             pk, file_number, patient_name, mr_number, date_of_birth,
             date_first_visit, block_sr_number, block_location, block_type,
             block_id, current_block_location, blocks_received_at_pccm,
             number_of_blocks, block_series,
             str(consent_discussed), consent, self.user_name,
             sql.last_update()
         ]
         # print(data_list, self.columns_db)
         block_df.loc[pk] = data_list
         check, block_df = sql.review_df_row(block_df)
     return data_list[1:], pk
Beispiel #30
0
 def nact_test(self):
     col_drug = names("nact_drug_table")
     drug_table = pd.DataFrame(columns=col_drug)
     col_tox = names('nact_tox_table')
     toxicity = pd.DataFrame(columns=col_tox)
     nact_status, place_nact, details_nact, plan_nact, date_start_nact,
     patient_weight_nact, nact_drugs_administered, number_cycles_nact,
     cycle_weekly_frequency, drugs_totaldose, drugs_unit, toxicity_type,
     toxicity_grade, toxicity_treatment, toxicity_response,
     nact_change_due_to_toxicity, tumour_response_check_method,
     tumour_response_nact, tumour_size, tumour_size_unit,
     date_tumour_size_checked, nact_response_impression,
     nact_response_node, nact_completion_status, nact_end_date,
     trastuzumab_use_nact, trastuzumab_regime_nact,
     trastuzumab_courses_taken_nact, hormone_therapy_nact,
     hormone_therapy_type_nact, hormone_therapy_duration,
     horomone_therapy_side_effects = [
         'NA',
     ] * 33
     data_list = [
         'NA',
     ] * 30 + [self.user_name, sql.last_update()]
     check = False
     while not check:
         nact_status = ask.ask_y_n_na(
             "Has neo adjuvant therapy been done for the patient (Please check for chemotherapy and/hormone therapy)?"
         )
         if nact_status == 'Yes':
             place_nact = ask.ask_y_n_na(
                 "Has neo adjuvant therapy been done at PCCM?", "At PCCM",
                 "Outside", "Not Certain, requires follow-up")
             details_nact = ask.ask_y_n(
                 "Are neo adjuvant therapy details available?",
                 "Details Available", "Follow-up required")
             if details_nact == "Follow-up required":
                 plan_nact, date_start_nact, patient_weight_nact, nact_drugs_administered, number_cycles_nact, cycle_weekly_frequency, drugs_totaldose, drugs_unit, toxicity_type, toxicity_grade, toxicity_treatment, toxicity_response, toxicity_at_cycle, nact_change_due_to_toxicity, tumour_response_check_method, tumour_response_nact, tumour_size, tumour_size_unit, date_tumour_size_checked, nact_response_impression, nact_response_node, nact_completion_status, nact_end_date, trastuzumab_use_nact, trastuzumab_regime_nact, trastuzumab_courses_taken_nact, hormone_therapy_nact, hormone_therapy_type_nact, hormone_therapy_duration, dhoromone_therapy_side_effects = (
                     details_nact, ) * 30
             elif details_nact == "Details Available":
                 plan_nact = input(
                     "What is the plan of NACT (for eg., 4 cycles AC followed by 12 cycles Paclitaxel; "
                     "Include hormone therapy plan here):")
                 date_start_nact = ask.check_date(
                     "Date of starting neo-adjuvant therapy: ")
                 patient_weight_nact = input(
                     "Weight of patient at start of therapy (in kgs): ")
                 check_wt = ask.ask_y_n(
                     "Is weight at any other time point mentioned in report "
                     "(with date, if given)?")
                 while check_wt:
                     other_wt = input(
                         "Time point at which weight mentioned: ")
                     other_wt = other_wt + " " + \
                         input("Weight of patient at " + other_wt + ": ")
                     patient_weight_nact = patient_weight_nact + "; " + other_wt
                     check_wt = ask.ask_y_n(
                         "Is weight at any other time point mentioned in report "
                         "(with date, if given)?")
                 drug_admin = drug_table_enter(file_number, drug_table)
                 data_drug = col_drug[1:]
                 data_drug_list = []
                 for index in data_drug:
                     data_drug = "; ".join(list(drug_admin.loc[:, index]))
                     data_drug_list.append(data_drug)
                 nact_drugs_administered, number_cycles_nact, cycle_weekly_frequency, drugs_totaldose, drugs_unit\
                     = data_drug_list
                 toxicity = tox_table(file_number, nact_drugs_administered,
                                      toxicity)
                 columns = col_tox
                 tox_details = []
                 for column in columns:
                     tox_detail = toxicity.loc[:, column].drop_duplicates()
                     tox_details.append(list(tox_detail))
                 tox_details = ask.join_lists(tox_details, "; ")
                 print(tox_details)
                 file_number, nact_drugs_administered, toxicity_type, toxicity_grade, toxicity_treatment, toxicity_response, \
                     toxicity_at_cycle, nact_change_due_to_toxicity = tox_details
                 tumour_response_check_method = ask.ask_option(
                     "Response to NACT measured by",
                     ['Mammography', 'SonoMammography'])
                 if tumour_response_check_method not in {
                         'Mammography', 'SonoMammography'
                 }:
                     tumour_response_nact, tumour_size, tumour_size_unit, date_tumour_size_checked, nact_response_impression, \
                         nact_response_node, nact_response_impression, nact_response_node = (
                             tumour_response_check_method,)*8
                 else:
                     tumour_response_nact = ask.ask_list(
                         "Response of tumour",
                         ["Partial", "Complete", "No Effect", "Other"])
                     tumour_size = input(
                         "Tumour size (without unit, e.g., 2 x 4 x 5) after treatment: "
                     )
                     tumour_size_unit = ask.ask_option(
                         "Tumour size unit", ['mm', 'cm'])
                     date_tumour_size_checked = ask.check_date(
                         "Date tumour size checked: ")
                     nact_response_impression = input(
                         'Please input impression given in report for NACT response: '
                     )
                     nact_node = ask.ask_y_n(
                         'Does the report mention node response? ')
                     nact_response_node = 'nact_node_response_not_mentioned'
                     if nact_node:
                         nact_response_node = input(
                             'Please input statement on node response to NACT: '
                         )
                 trast_nact = ask.ask_y_n("Trastuzumab used?")
                 if trast_nact:
                     trastuzumab_regime_nact = ask.ask_option(
                         "Trastuzumab use was",
                         ["Sequential", "Concurrent"])
                     trastuzumab_use_nact = "Trastuzumab used"
                     trastuzumab_courses_taken_nact = input(
                         "Number of courses of trastuzumab/herceptin taken: "
                     )
                 else:
                     trastuzumab_use_nact, trastuzumab_regime_nact, trastuzumab_courses_taken_nact, \
                         = ("no_neo_adjuvant_trastuzumab", )*3
                 nact_end_date = ask.check_date(
                     "Date of completion of NACT: ")
                 complete_nact = ask.ask_y_n(
                     "Was NACT completed as per schedule? ")
                 if complete_nact:
                     nact_completion_status = "nact_complete"
                 else:
                     nact_completion_status = ask.ask_option(
                         "Reason for discontinuation", [
                             "Toxicity", "Reluctance of patient",
                             "Progression on chemotherapy",
                             "Advised by treating doctor",
                             "Death due to toxicity",
                             "Death due to progressive disease",
                             "Preferred treatment at another centre",
                             "Death due to unrelated cause",
                             "Patient was unable to afford treatment"
                         ])
                     nact_completion_status = "NACT incomplete: " + nact_completion_status
                 hormone_therapy = ask.ask_y_n_na(
                     "Was hormone therapy given?")
                 if hormone_therapy == 'Yes':
                     hormone_therapy_nact = "naht_given"
                     hormone_therapy_type_nact = ask.ask_option(
                         "Hormone therapy type",
                         ["Sequential", "Concurrent"])
                     hormone_therapy_duration = input(
                         "What was the duration of therapy? ")
                     therapy_side = ask.ask_y_n_na(
                         "Were any side effects observed ?")
                     horomone_therapy_side_effects = 'no_side_effects'
                     if therapy_side == 'Yes':
                         horomone_therapy_side_effects = input(
                             "Please give details of side effects observed: "
                         )
                     nact_naht = ask.ask_y_n(
                         'Was chemotherapy given in addition to hormone therapy?'
                     )
                     if nact_naht:
                         nact_status = 'nact_and_naht_given'
                     else:
                         nact_status = 'naht_given'
                 elif hormone_therapy == 'No':
                     hormone_therapy = "no_naht"
                     nact_status = "nact_given"
                     hormone_therapy_nact, hormone_therapy_type_nact, hormone_therapy_duration, \
                         horomone_therapy_side_effects = (
                             hormone_therapy,) * 4
                 else:
                     hormone_therapy_nact, hormone_therapy_type_nact, hormone_therapy_duration, \
                         horomone_therapy_side_effects = (
                             hormone_therapy,) * 4
                     nact_status = "nact_given"
         data_list = [
             nact_status, place_nact, details_nact, plan_nact,
             date_start_nact, patient_weight_nact, nact_drugs_administered,
             number_cycles_nact, cycle_weekly_frequency, drugs_totaldose,
             drugs_unit, toxicity_type, toxicity_grade, toxicity_treatment,
             toxicity_response, toxicity_at_cycle,
             nact_change_due_to_toxicity, tumour_response_check_method,
             tumour_response_nact, tumour_size, tumour_size_unit,
             nact_response_impression, nact_response_node,
             date_tumour_size_checked, nact_completion_status,
             nact_end_date, trastuzumab_use_nact, trastuzumab_regime_nact,
             trastuzumab_courses_taken_nact, hormone_therapy_nact,
             hormone_therapy_type_nact, hormone_therapy_duration,
             horomone_therapy_side_effects, self.user_name,
             sql.last_update()
         ]
         col_list = names("neo_adjuvant_therapy")
         check = sql.review_input(file_number, col_list, data_list)
     return data_list, drug_table, toxicity