NikilDGr8 commited on
Commit
4222cb7
1 Parent(s): fd256c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -30
app.py CHANGED
@@ -227,36 +227,20 @@ with gr.Blocks() as demo:
227
  patient_name_input = gr.Textbox(label="Patient’s Name", value="", interactive=True)
228
  textboxes_left = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(3, len(oral_health_assessment_form)//2)]
229
  with gr.Column():
230
- 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)-4)]
231
- clinical_findings_input = gr.Textbox(label="Clinical Findings", interactive=True)
232
- dropdown_referred = gr.Dropdown(choices=["NONE", "ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], value="NONE", label="Referred to", interactive=True)
233
- dropdown_Calculus = gr.Dropdown(choices=["+", "++", "+++"], label="Calculus", interactive=True)
234
- dropdown_stains = gr.Dropdown(choices=["+", "++", "+++"], label="Stains", interactive=True)
235
- dropdown_treatment_plan = gr.Dropdown(choices=["Scaling", "Filling", "Pulp therapy/RCT", "Extraction", "Medication", "Referral"], label="Treatment plan", interactive=True)
236
-
237
- transcribe_button.click(
238
- fn=main,
239
- inputs=[audio_input, doctor_name_input, location_input],
240
- outputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [clinical_findings_input, dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains]
241
- )
242
-
243
- save_button = gr.Button("Save")
244
- save_output = gr.HTML()
245
-
246
- save_button.click(
247
- fn=save_answers,
248
- inputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [clinical_findings_input, dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains],
249
- outputs=save_output
250
- )
251
-
252
  download_button = gr.Button("Download CSV")
253
- download_file = gr.File(label="Download CSV")
254
-
255
- download_button.click(
256
- fn=gradio_download,
257
- inputs=[],
258
- outputs=download_file
259
- )
260
 
261
- # Launch the Gradio app
262
  demo.launch()
 
227
  patient_name_input = gr.Textbox(label="Patient’s Name", value="", interactive=True)
228
  textboxes_left = [gr.Textbox(label=oral_health_assessment_form[i], value="", interactive=True) for i in range(3, len(oral_health_assessment_form)//2)]
229
  with gr.Column():
230
+ 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)-3)]
231
+ textboxes_right.append(gr.Textbox(label="Clinical Findings", interactive=True))
232
+ textboxes_right.append(gr.Dropdown(choices=["NONE", "ORAL MEDICINE & RADIOLOGY", "PERIODONTICS", "ORAL SURGERY", "CONSERVATIVE AND ENDODONTICS", "PROSTHODONTICS", "PEDODONTICS", "ORTHODONTICS"], value="NONE", label="Referred to", interactive=True))
233
+ textboxes_right.append(gr.Dropdown(choices=["+", "++", "+++"], label="Calculus", interactive=True))
234
+ textboxes_right.append(gr.Dropdown(choices=["-", "+", "++", "+++"], label="Stains", interactive=True))
235
+ textboxes_right.append(gr.Dropdown(choices=["Scaling", "Filling", "Pulp therapy/RCT", "Extraction", "Medication", "Referral"], label="Treatment plan", interactive=True))
236
+ oha_output = gr.Textbox(label="OHA Output", value="", interactive=False)
237
+ save_button = gr.Button("Save to Supabase", elem_id="save_button", interactive=True)
238
+ transcribe_button.click(fn=main, inputs=[audio_input, doctor_name_display, location_display], outputs=[oha_output])
239
+ save_button.click(fn=save_answers, inputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right, outputs=[oha_output])
240
+
241
+ with gr.Tab("Download Data"):
 
 
 
 
 
 
 
 
 
 
242
  download_button = gr.Button("Download CSV")
243
+ download_output = gr.File()
244
+ download_button.click(fn=gradio_download, outputs=download_output)
 
 
 
 
 
245
 
 
246
  demo.launch()