Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ questions = [
|
|
22 |
"What is the chief complaint regarding the patient's oral health?",
|
23 |
"List the Medical history mentioned",
|
24 |
"Give the Dental history in detail",
|
25 |
-
"
|
26 |
]
|
27 |
|
28 |
# List of form fields in the correct order
|
@@ -49,7 +49,7 @@ oral_health_assessment_form = [
|
|
49 |
"Chief complaint",
|
50 |
"Medical history",
|
51 |
"Dental history",
|
52 |
-
"Clinical Findings",
|
53 |
"Treatment plan",
|
54 |
"Referred to",
|
55 |
"Calculus",
|
@@ -232,7 +232,9 @@ with gr.Blocks() as demo:
|
|
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 |
-
|
|
|
|
|
236 |
def enable_transcribe_button(audio_path: str):
|
237 |
return gr.update(interactive=True)
|
238 |
|
@@ -252,18 +254,18 @@ with gr.Blocks() as demo:
|
|
252 |
transcribe_button.click(
|
253 |
fn=update_textboxes,
|
254 |
inputs=[audio_input, doctor_name_input, location_input],
|
255 |
-
outputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains]
|
256 |
)
|
257 |
|
258 |
save_button = gr.Button("Save Form")
|
259 |
save_output = gr.HTML(label="Save Output")
|
260 |
|
261 |
-
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):
|
262 |
-
return save_answers(doctor_name, location, patient_name, age, gender, chief_complaint, medical_history, dental_history, clinical_findings, treatment_plan, referred_to,Calculus, stains)
|
263 |
|
264 |
save_button.click(
|
265 |
fn=handle_submission,
|
266 |
-
inputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains],
|
267 |
outputs=save_output
|
268 |
)
|
269 |
|
|
|
22 |
"What is the chief complaint regarding the patient's oral health?",
|
23 |
"List the Medical history mentioned",
|
24 |
"Give the Dental history in detail",
|
25 |
+
"What are the mentioned clinical findings?" # Updated question for Clinical Findings
|
26 |
]
|
27 |
|
28 |
# List of form fields in the correct order
|
|
|
49 |
"Chief complaint",
|
50 |
"Medical history",
|
51 |
"Dental history",
|
52 |
+
"Clinical Findings", # Added Clinical Findings
|
53 |
"Treatment plan",
|
54 |
"Referred to",
|
55 |
"Calculus",
|
|
|
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 |
+
# Added Clinical Findings textbox with prompt
|
236 |
+
clinical_findings_input = gr.Textbox(label="Clinical Findings", value="What are the mentioned clinical findings", interactive=True)
|
237 |
+
|
238 |
def enable_transcribe_button(audio_path: str):
|
239 |
return gr.update(interactive=True)
|
240 |
|
|
|
254 |
transcribe_button.click(
|
255 |
fn=update_textboxes,
|
256 |
inputs=[audio_input, doctor_name_input, location_input],
|
257 |
+
outputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains, clinical_findings_input] # Added Clinical Findings
|
258 |
)
|
259 |
|
260 |
save_button = gr.Button("Save Form")
|
261 |
save_output = gr.HTML(label="Save Output")
|
262 |
|
263 |
+
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) -> str:
|
264 |
+
return save_answers(doctor_name, location, patient_name, age, gender, chief_complaint, medical_history, dental_history, clinical_findings, treatment_plan, referred_to, Calculus, stains)
|
265 |
|
266 |
save_button.click(
|
267 |
fn=handle_submission,
|
268 |
+
inputs=[doctor_name_display, location_display, patient_name_input] + textboxes_left + textboxes_right + [dropdown_referred, dropdown_treatment_plan, dropdown_Calculus, dropdown_stains, clinical_findings_input],
|
269 |
outputs=save_output
|
270 |
)
|
271 |
|