def metastasis_symp(conn, cursor, file_number, table):
    from add_update_sql import update_single
    from ask_y_n_statement import ask_y_n
    met_none = ask_y_n("Metastatis Symptoms Present?")
    met = []
    if not met_none:
        met = [["No Metastatis Symptoms"]]
    else:
        met_bone = ask_y_n("Bone Pain")
        if met_bone:
            met.append(["Bone Pain"])
        met_cough = ask_y_n("Cough")
        if met_cough:
            met.append(["Cough"])
        met_jaundice = ask_y_n("Jaundice")
        if met_jaundice:
            met.append(["Jaundice"])
        met_headache = ask_y_n("Headache")
        if met_headache:
            met.append(["Headache"])
        met_weight = ask_y_n("Weight loss")
        if met_weight:
            met.append(["WeightLoss"])
    met_flat = [item for sublist in met for item in sublist]
    data_met = "; ".join(met_flat)
    update_single(conn, cursor, table, "Metatasis_Symptoms", file_number,
                  data_met)
예제 #2
0
def metastasis_symp (conn, cursor, file_number, table):
    from add_update_sql import update_single, review_input
    from ask_y_n_statement import ask_y_n
    check = False
    while not check:
        met = []
        met_bone = ask_y_n("Bone Pain")
        if met_bone:
            met.append(["Bone Pain"])
        met_cough = ask_y_n("Cough")
        if met_cough:
            met.append(["Cough"])
        met_jaundice = ask_y_n("Jaundice")
        if met_jaundice:
            met.append(["Jaundice"])
        met_headache = ask_y_n("Headache")
        if met_headache:
            met.append(["Headache"])
        met_weight = ask_y_n("Weight loss")
        if met_weight:
            met.append(["WeightLoss"])
        met_flat = [item for sublist in met for item in sublist]
        data_met = "; ".join(met_flat)
        if met_flat == []:
            data_met = "No Metastatis Symptoms"
        check = review_input(file_number, ["Metastasis_Symptoms"], [data_met])
    update_single(conn, cursor, table, "Metatasis_Symptoms", file_number, data_met)
def metastasis_symp(conn, cursor, file_number, table):
    from add_update_sql import update_single
    print("Metastatis Symptoms: ")
    met = []
    met_none = input("(y/n): ")
    if str.lower(met_none) == "n":
        met = [["No Metastatis Symptoms"]]
    else:
        met_bone = input("Bone Pain (y/n): ")
        if str.lower(met_bone) == "y":
            met = ["Bone Pain"]
        met_cough = input("Cough (y/n): ")
        if str.lower(met_cough) == "y":
            met.append(["Cough"])
        met_jaundice = input("Jaundice (y/n): ")
        if str.lower(met_jaundice) == "y":
            met.append(["Jaundice"])
        met_headache = input("Headache (y/n): ")
        if str.lower(met_headache) == "y":
            met.append(["Headache"])
        met_weight = input("Weightloss (y/n): ")
        if str.lower(met_weight) == "y":
            met.append(["Weightloss"])
    met_flat = [item for sublist in met for item in sublist]
    data_met = "; ".join(met_flat)
    update_single(conn, cursor, table, "Metatasis_Symptoms", file_number,
                  data_met)
def cancer_history(conn, cursor, file_number, mr_number, name, table):
    from breast_cancer_tables import cancer_table
    from add_update_sql import update_single
    previous_cancer_history_y_n = input('Previous history of cancer (y/n): ')
    if str.lower(previous_cancer_history_y_n) == 'y':
        cancer_table(conn, cursor, file_number, mr_number, name)
        previous_cancer_history_y_n = "Previous history of cancer"
    else:
        previous_cancer_history_y_n = "No previous history of cancer"
    update_single(conn, cursor, table, "Previous_Cancer_History_y_n",
                  file_number, previous_cancer_history_y_n)
def med_history(conn, cursor, file_number, mr_number, name, table):
    from breast_cancer_tables import med_history_table
    from add_update_sql import update_single
    medical_history_y_n = input('Medical_History_y_n :')
    if (str.lower(medical_history_y_n) == 'y'):
        med_history_table(conn, cursor, file_number, mr_number, name)
        medical_history_y_n = "Previous medical history present"
    else:
        medical_history_y_n = "No previous medical history present"
    update_single(conn, cursor, table, "Medical_History_y_n", file_number,
                  medical_history_y_n)
def phys_act(conn, cursor, file_number, mr_number, name, table):
    from breast_cancer_tables import physical_activity_table
    from add_update_sql import update_single
    phys_act = input("Physical Activities (y/n): ")
    if str.lower(phys_act) == "y":
        physical_activity_table(conn, cursor, file_number, mr_number, name)
        phys_act = "Physical Activities Performed"
    else:
        phys_act = "No Physical Activities"
    update_single(conn, cursor, table, "Physical_Activity_y_n", file_number,
                  phys_act)
def nut_supplements(conn, cursor, file_number, mr_number, name, table):
    from add_update_sql import update_single
    from breast_cancer_tables import nut_supp_table
    nut_supplements = input("Nutritional supplements taken (y/n): ")
    if str.lower(nut_supplements) == "y":
        nut_supp_table(conn, cursor, file_number, mr_number, name)
        nut_supplements = "Nutritional supplements taken"
    else:
        nut_supplements = "No nutritional supplements taken"
    update_single(conn, cursor, table, "Nutritional_supplements_y_n",
                  file_number, nut_supplements)
def cancer_history(conn, cursor, file_number, table):
    from breast_cancer_tables import cancer_table
    from add_update_sql import update_single
    from ask_y_n_statement import ask_y_n
    previous_cancer_history_y_n = ask_y_n("Previous history of cancer ?")
    if previous_cancer_history_y_n:
        cancer_table(conn, cursor, file_number)
        previous_cancer_history_y_n = "Previous history of cancer"
    else:
        previous_cancer_history_y_n = "No previous history of cancer"
    update_single(conn, cursor, table, "Previous_Cancer_History_y_n",
                  file_number, previous_cancer_history_y_n)
def med_history(conn, cursor, file_number, table):
    from breast_cancer_tables import med_history_table
    from ask_y_n_statement import ask_y_n
    from add_update_sql import update_single
    medical_history_y_n = ask_y_n("Other Medical History ?")
    if medical_history_y_n:
        med_history_table(conn, cursor, file_number)
        medical_history_y_n = "Previous medical history present"
    else:
        medical_history_y_n = "No previous medical history present"
    update_single(conn, cursor, table, "Any_Other_Medical_History_y_n",
                  file_number, medical_history_y_n)
def family_cancer(conn, cursor, file_number, table):
    from add_update_sql import update_single
    from breast_cancer_tables import family_cancer_table
    from ask_y_n_statement import ask_y_n
    family_cancer_history_y_n = ask_y_n('Cancer history in Family')
    if family_cancer_history_y_n:
        family_cancer_table(conn, cursor, file_number)
        family_cancer_history_y_n = "Family History of Cancer"
    else:
        family_cancer_history_y_n = "No Family History of Cancer"
    update_single(conn, cursor, table, "FamilyCancer_history_y_n", file_number,
                  family_cancer_history_y_n)
def phys_act(conn, cursor, file_number, table):
    from breast_cancer_tables import physical_activity_table
    from add_update_sql import update_single
    from ask_y_n_statement import ask_y_n
    phys_act = ask_y_n("Any Physical Activities ?")
    if phys_act:
        physical_activity_table(conn, cursor, file_number)
        phys_act = "Physical Activities Performed"
    else:
        phys_act = "No Physical Activities"
    update_single(conn, cursor, table, "Physical_Activity_y_n", file_number,
                  phys_act)
def nut_supplements(conn, cursor, file_number, table):
    from add_update_sql import update_single
    from breast_cancer_tables import nut_supp_table
    from ask_y_n_statement import ask_y_n
    nut_supplements = ask_y_n("Nutritional supplements taken")
    if nut_supplements:
        nut_supp_table(conn, cursor, file_number)
        nut_supplements = "Nutritional supplements taken"
    else:
        nut_supplements = "No nutritional supplements taken"
    update_single(conn, cursor, table, "Nutritional_supplements_y_n",
                  file_number, nut_supplements)
def habits(conn, cursor, file_number, table):
    from add_update_sql import update_multiple, update_single
    from ask_y_n_statement import ask_option, ask_y_n
    category = "Diet"
    options = ["Vegetarian", "Non-Vegetarian", "Ovo-Vegetarian", "Other"]
    diet = ask_option(category, options)
    alcohol = ask_y_n("Alcohol consumption")
    if alcohol:
        alcohol_consump = "Alcohol Consumption"
        alcohol_age = input("Consumption of alcohol from which age (yrs): ")
        alcohol_quant = input("Quantity of alcohol consumed per week: ")
        alcohol_duration = input("Duration of alcohol consumption: ")
        alcohol_comments = input(
            "Additional comments for alcohol consumption: ")
    else:
        alcohol_consump = "No Alcohol Consumption"
        alcohol_age = "NA"
        alcohol_quant = "NA"
        alcohol_duration = "NA"
        alcohol_comments = "NA"
    columns = "Diet", "Alcohol_y_n", "Alcohol_Consumption_age_yrs", "Quantity_alcohol_per_week", "Duration_alcohol", "Comments_alcohol"
    new_data = diet, alcohol_consump, alcohol_age, alcohol_quant, alcohol_duration, alcohol_comments
    update_multiple(conn, cursor, table, columns, file_number, new_data)
    tobacco = ask_y_n("Tobacco consumption")
    if tobacco:
        tobacco = "Tobacco consumption"
        tobacco_type = input("Type of tobacco consumption: ")
        tobacco_age = input("Consumption of tobacco from which age (yrs): ")
        tobacco_quant = input("Quantity of tobacco consumed per week: ")
        tobacco_duration = input("Duration of tobacco consumption: ")
        tobacco_comments = input(
            "Additional comments for tobacco consumption: ")
    else:
        tobacco = "No Tobacco Consumption"
        tobacco_type = "NA"
        tobacco_age = "NA"
        tobacco_quant = "NA"
        tobacco_duration = "NA"
        tobacco_comments = "NA"
    columns = "Tobacco_y_n", "Type_tobacco", "Tobacco_consumption_age_yrs", "Quantity_tobacco_per_week", "Duration_tobacco", "Comments_tobacco"
    new_data = tobacco, tobacco_type, tobacco_age, tobacco_quant, tobacco_duration, tobacco_comments
    update_multiple(conn, cursor, table, columns, file_number, new_data)
    other_del_habits = input(
        "Other Deleterious Habits (if present give details): ")
    update_single(conn, cursor, table, "Other_Deleterious_Habits", file_number,
                  other_del_habits)
def det_by(conn, cursor, table, file_number):
    from add_update_sql import update_single
    check = False
    while not check:
        print("Detected by 1. Self, 2. Physician 3. Screening Camp")
        determined_by = input("Please enter 1, 2, or 3: ")
        if determined_by == "1":
            determined_by = "Self"
            check = True
        elif determined_by == "2":
            determined_by = "Physician"
            check = True
        elif determined_by == "3":
            sc_id = input("Screening Camp ID: ")
            determined_by = "Screening Camp ID " + sc_id
            check = True
    update_single(conn, cursor, table, "Detected_by", file_number,
                  determined_by)
def habits(conn, cursor, file_number, table):
    from add_update_sql import update_multiple, update_single
    alcohol = input("Alcohol consumption (y/n): ")
    alcohol_consump = "No Alcohol Consumption"
    alcohol_age = "No Alcohol Consumption"
    alcohol_quant = "No Alcohol Consumption"
    alcohol_duration = "No Alcohol Consumption"
    alcohol_comments = "No Alcohol Consumption"
    if str.lower(alcohol) == "y":
        alcohol_consump = "Alcohol Consumption"
        alcohol_age = input("Consumption of alcohol from which age (yrs): ")
        alcohol_quant = input("Quantity of alcohol consumed per week: ")
        alcohol_duration = input("Duration of alcohol consumption: ")
        alcohol_comments = input(
            "Additional comments for alcohol consumption: ")
    columns = "Alcohol_y_n", "Alcohol_Consumption_age_yrs", "Quantity_alcohol_per_week", "Duration_alcohol", "Comments_alcohol"
    new_data = alcohol_consump, alcohol_age, alcohol_quant, alcohol_duration, alcohol_comments
    update_multiple(conn, cursor, table, columns, file_number, new_data)
    tobacco = input("Tobacco consumption (y/n)")
    tobacco_type = "No Tobacco Consumption"
    tobacco_age = "No Tobacco Consumption"
    tobacco_quant = "No Tobacco Consumption"
    tobacco_duration = "No Tobacco Consumption"
    tobacco_comments = "No Tobacco Consumption"
    if str.lower(tobacco) == "y":
        tobacco = ("Tobacco consumption")
        tobacco_type = input("Type of tobacco consumption: ")
        tobacco_age = input("Consumption of tobacco from which age (yrs): ")
        tobacco_quant = input("Quantity of tobacco consumed per week: ")
        tobacco_duration = input("Duration of tobacco consumption: ")
        tobacco_comments = input(
            "Additional comments for tobacco consumption: ")
    else:
        tobacco = "No Tobacco Consumption"
    columns = "Tobacco_y_n", "Type_tobacco", "Tobacco_consumption_age_yrs", "Quantity_tobacco_per_week", "Duration_tobacco", "Comments_tobacco"
    new_data = tobacco, tobacco_type, tobacco_age, tobacco_quant, tobacco_duration, tobacco_comments
    update_multiple(conn, cursor, table, columns, file_number, new_data)
    other_del_habits = input("Other Deleterious Habits: ")
    update_single(conn, cursor, table, "Other_Deleterious_Habits", file_number,
                  other_del_habits)