NikilDGr8 commited on
Commit
fcc60cf
·
verified ·
1 Parent(s): 51b3fe0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -23,7 +23,6 @@ questions = [
23
  "List the Medical history mentioned",
24
  "Give the Dental history in detail",
25
  "Please give all the clinical findings which were listed"
26
- # "What treatment plan is recommended?" -- Removed as we are using a dropdown for this
27
  ]
28
 
29
  # List of form fields in the correct order
@@ -34,7 +33,6 @@ form_fields = [
34
  "Medical history",
35
  "Dental history",
36
  "Clinical Findings",
37
- # "Treatment plan", -- Removed
38
  "Referred to"
39
  ]
40
 
@@ -51,7 +49,7 @@ oral_health_assessment_form = [
51
  "Clinical Findings",
52
  "Treatment plan",
53
  "Referred to",
54
- "Options",
55
  "Stains"
56
  ]
57
 
@@ -123,7 +121,7 @@ def main(audio: str, doctor_name: str, location: str) -> list:
123
  answers = fill_textboxes(context)
124
  answers_list = [doctor_name, location, ""] # Initial patient name field empty
125
  answers_list += [answers.get(field, "") for field in form_fields]
126
- answers_list.append("") # Default for "Options"
127
  answers_list.append("") # Default for "Stains"
128
 
129
  return answers_list
@@ -142,7 +140,7 @@ def save_answers(doctor_name: str, location: str, patient_name: str, age: str, g
142
  "Clinical Findings": clinical_findings,
143
  "Treatment plan": treatment_plan,
144
  "Referred to": referred_to,
145
- "Options": options,
146
  "Stains": stains,
147
  "Submission Date and Time": current_datetime
148
  }
@@ -226,7 +224,7 @@ with gr.Blocks() as demo:
226
  with gr.Column():
227
  textboxes_right = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(len(oral_health_assessment_form)//2, len(oral_health_assessment_form)-5)]
228
  dropdown_referred = gr.Dropdown(choices=["NONE","ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], label="Referred to", interactive=True)
229
- dropdown_options = gr.Dropdown(choices=["+", "++", "+++"], label="Options", interactive=True)
230
  dropdown_stains = gr.Dropdown(choices=["+", "++", "+++"], label="Stains", interactive=True)
231
  dropdown_treatment_plan = gr.Dropdown(choices=["Scaling", "Filling", "Pulp therapy/RCT", "Extraction", "Medication", "Referral"], label="Treatment plan", interactive=True)
232
 
@@ -250,18 +248,18 @@ with gr.Blocks() as demo:
250
  transcribe_button.click(
251
  fn=update_textboxes,
252
  inputs=[audio_input, doctor_name_input, location_input],
253
- outputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_options, dropdown_stains]
254
  )
255
 
256
  save_button = gr.Button("Save Form")
257
  save_output = gr.HTML(label="Save Output")
258
 
259
  def handle_submission(doctor_name: str, location: str, patient_name: str, age: str, gender: str, chief_complaint: str, medical_history: str, dental_history: str, clinical_findings: str, treatment_plan: str, referred_to: str, options: str, stains: str):
260
- return save_answers(doctor_name, location, patient_name, age, gender, chief_complaint, medical_history, dental_history, clinical_findings, treatment_plan, referred_to, options, stains)
261
 
262
  save_button.click(
263
  fn=handle_submission,
264
- inputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_options, dropdown_stains],
265
  outputs=save_output
266
  )
267
 
 
23
  "List the Medical history mentioned",
24
  "Give the Dental history in detail",
25
  "Please give all the clinical findings which were listed"
 
26
  ]
27
 
28
  # List of form fields in the correct order
 
33
  "Medical history",
34
  "Dental history",
35
  "Clinical Findings",
 
36
  "Referred to"
37
  ]
38
 
 
49
  "Clinical Findings",
50
  "Treatment plan",
51
  "Referred to",
52
+ "Calculus",
53
  "Stains"
54
  ]
55
 
 
121
  answers = fill_textboxes(context)
122
  answers_list = [doctor_name, location, ""] # Initial patient name field empty
123
  answers_list += [answers.get(field, "") for field in form_fields]
124
+ answers_list.append("") # Default for "Caclulus"
125
  answers_list.append("") # Default for "Stains"
126
 
127
  return answers_list
 
140
  "Clinical Findings": clinical_findings,
141
  "Treatment plan": treatment_plan,
142
  "Referred to": referred_to,
143
+ "Calculus": Calculus,
144
  "Stains": stains,
145
  "Submission Date and Time": current_datetime
146
  }
 
224
  with gr.Column():
225
  textboxes_right = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(len(oral_health_assessment_form)//2, len(oral_health_assessment_form)-5)]
226
  dropdown_referred = gr.Dropdown(choices=["NONE","ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], label="Referred to", interactive=True)
227
+ dropdown_Calculus = gr.Dropdown(choices=["+", "++", "+++"], label="Calculus", interactive=True)
228
  dropdown_stains = gr.Dropdown(choices=["+", "++", "+++"], label="Stains", interactive=True)
229
  dropdown_treatment_plan = gr.Dropdown(choices=["Scaling", "Filling", "Pulp therapy/RCT", "Extraction", "Medication", "Referral"], label="Treatment plan", interactive=True)
230
 
 
248
  transcribe_button.click(
249
  fn=update_textboxes,
250
  inputs=[audio_input, doctor_name_input, location_input],
251
+ outputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains]
252
  )
253
 
254
  save_button = gr.Button("Save Form")
255
  save_output = gr.HTML(label="Save Output")
256
 
257
  def handle_submission(doctor_name: str, location: str, patient_name: str, age: str, gender: str, chief_complaint: str, medical_history: str, dental_history: str, clinical_findings: str, treatment_plan: str, referred_to: str, options: str, stains: str):
258
+ return save_answers(doctor_name, location, patient_name, age, gender, chief_complaint, medical_history, dental_history, clinical_findings, treatment_plan, referred_to,Calculus, stains)
259
 
260
  save_button.click(
261
  fn=handle_submission,
262
+ inputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains],
263
  outputs=save_output
264
  )
265