NikilDGr8 commited on
Commit
f77b91e
·
verified ·
1 Parent(s): 1f40843

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -33,7 +33,10 @@ form_fields = [
33
  "Medical history",
34
  "Dental history",
35
  "Clinical Findings",
36
- "Referred to"
 
 
 
37
  ]
38
 
39
  # Oral Health Assessment Form
@@ -126,9 +129,6 @@ def main(audio: str, doctor_name: str, location: str) -> list:
126
  answers = fill_textboxes(context)
127
  answers_list = [doctor_name, location, ""] # Initial patient name field empty
128
  answers_list += [answers.get(field, "") for field in form_fields]
129
- answers_list.append("") # Default for "Calculus"
130
- answers_list.append("") # Default for "Stains"
131
- answers_list.append("") # Default for "Treatment plan"
132
  return answers_list
133
 
134
  def save_answers(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, Calculus: str, stains: str) -> str:
@@ -238,16 +238,15 @@ with gr.Blocks() as demo:
238
 
239
  audio_input.change(fn=enable_transcribe_button, inputs=audio_input, outputs=transcribe_button)
240
 
241
-
242
  def update_textboxes(audio: str, doctor_name: str, location: str):
243
  context = transcribe_audio(audio)
244
 
245
  if "Error" in context:
246
- return [context] * (len(oral_health_assessment_form) - 5) # Adjust for the number of fields
247
 
248
  answers = fill_textboxes(context)
249
  answers_list = [doctor_name, location, ""] # Initial patient name field empty
250
- answers_list += [answers.get(field, "") for field in form_fields[:-1]] # Exclude "Referred to"
251
  return answers_list
252
 
253
  transcribe_button.click(
 
33
  "Medical history",
34
  "Dental history",
35
  "Clinical Findings",
36
+ "Referred to",
37
+ "Treatment plan",
38
+ "Calculus",
39
+ "Stains"
40
  ]
41
 
42
  # Oral Health Assessment Form
 
129
  answers = fill_textboxes(context)
130
  answers_list = [doctor_name, location, ""] # Initial patient name field empty
131
  answers_list += [answers.get(field, "") for field in form_fields]
 
 
 
132
  return answers_list
133
 
134
  def save_answers(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, Calculus: str, stains: str) -> str:
 
238
 
239
  audio_input.change(fn=enable_transcribe_button, inputs=audio_input, outputs=transcribe_button)
240
 
 
241
  def update_textboxes(audio: str, doctor_name: str, location: str):
242
  context = transcribe_audio(audio)
243
 
244
  if "Error" in context:
245
+ return [context] * len(oral_health_assessment_form) # Adjust for the number of fields
246
 
247
  answers = fill_textboxes(context)
248
  answers_list = [doctor_name, location, ""] # Initial patient name field empty
249
+ answers_list += [answers.get(field, "") for field in form_fields]
250
  return answers_list
251
 
252
  transcribe_button.click(