Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -227,12 +227,12 @@ 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)-
|
|
|
231 |
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)
|
232 |
dropdown_Calculus = gr.Dropdown(choices=["+", "++", "+++"], label="Calculus", interactive=True)
|
233 |
dropdown_stains = gr.Dropdown(choices=["+", "++", "+++"], label="Stains", interactive=True)
|
234 |
dropdown_treatment_plan = gr.Dropdown(choices=["Scaling", "Filling", "Pulp therapy", "Extraction", "Medication"], label="Treatment plan", interactive=True)
|
235 |
-
clinical_findings_input = gr.Textbox(label="Clinical Findings", value="What are the mentioned clinical findings", interactive=True)
|
236 |
|
237 |
def enable_transcribe_button(audio_path: str):
|
238 |
return gr.update(interactive=True)
|
@@ -253,18 +253,18 @@ with gr.Blocks() as demo:
|
|
253 |
transcribe_button.click(
|
254 |
fn=update_textboxes,
|
255 |
inputs=[audio_input, doctor_name_input, location_input],
|
256 |
-
outputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains]
|
257 |
)
|
258 |
|
259 |
save_button = gr.Button("Save Form")
|
260 |
save_output = gr.HTML(label="Save Output")
|
261 |
|
262 |
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, Calculus: str, stains: str):
|
263 |
-
return save_answers(doctor_name, location, patient_name, age, gender, chief_complaint, medical_history, dental_history, clinical_findings, treatment_plan, referred_to,Calculus, stains)
|
264 |
|
265 |
save_button.click(
|
266 |
fn=handle_submission,
|
267 |
-
inputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains],
|
268 |
outputs=save_output
|
269 |
)
|
270 |
|
|
|
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", "Extraction", "Medication"], label="Treatment plan", interactive=True)
|
|
|
236 |
|
237 |
def enable_transcribe_button(audio_path: str):
|
238 |
return gr.update(interactive=True)
|
|
|
253 |
transcribe_button.click(
|
254 |
fn=update_textboxes,
|
255 |
inputs=[audio_input, doctor_name_input, location_input],
|
256 |
+
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]
|
257 |
)
|
258 |
|
259 |
save_button = gr.Button("Save Form")
|
260 |
save_output = gr.HTML(label="Save Output")
|
261 |
|
262 |
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, Calculus: str, stains: str):
|
263 |
+
return save_answers(doctor_name, location, patient_name, age, gender, chief_complaint, medical_history, dental_history, clinical_findings, treatment_plan, referred_to, Calculus, stains)
|
264 |
|
265 |
save_button.click(
|
266 |
fn=handle_submission,
|
267 |
+
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],
|
268 |
outputs=save_output
|
269 |
)
|
270 |
|