Spaces:
Runtime error
Runtime error
Commit
·
e21c8bf
1
Parent(s):
499be80
Update app.py
Browse files
app.py
CHANGED
@@ -234,6 +234,23 @@ def analyse_query(query):
|
|
234 |
question_index += 1
|
235 |
if question_index < len(questions):
|
236 |
current_question = questions[question_index]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
return f"After you answer the patient's query, if you think it is the right time, ask him the following question like a doctor would normally do :{current_question}"
|
238 |
else:
|
239 |
patient_info = {
|
@@ -499,6 +516,8 @@ def bot(history):
|
|
499 |
|
500 |
"""#Demo"""
|
501 |
|
|
|
|
|
502 |
|
503 |
def move_next_page(a, b, c, d):
|
504 |
patient_info1 = a + b
|
@@ -625,7 +644,7 @@ with gr.Blocks(css=css) as demo:
|
|
625 |
view_report, outputs=[page1, page2, chatbot, html_block, pdf_report]
|
626 |
)
|
627 |
back_btn.click(
|
628 |
-
|
629 |
)
|
630 |
|
631 |
demo.queue()
|
|
|
234 |
question_index += 1
|
235 |
if question_index < len(questions):
|
236 |
current_question = questions[question_index]
|
237 |
+
patient_info = {
|
238 |
+
"name": patient_info1,
|
239 |
+
"age": patient_info2,
|
240 |
+
"gender": patient_info3,
|
241 |
+
"symptoms": "",
|
242 |
+
"medications": "",
|
243 |
+
"conditions_allergies":"",
|
244 |
+
"lifestyle_changes": "",
|
245 |
+
"header_image": base64.b64encode(
|
246 |
+
open("logo1.png", "rb").read()
|
247 |
+
).decode(),
|
248 |
+
"medical_image": base64.b64encode(
|
249 |
+
open("lung disease.png", "rb").read()
|
250 |
+
).decode(),
|
251 |
+
}
|
252 |
+
generate_report(patient_info)
|
253 |
+
print("Report generated")
|
254 |
return f"After you answer the patient's query, if you think it is the right time, ask him the following question like a doctor would normally do :{current_question}"
|
255 |
else:
|
256 |
patient_info = {
|
|
|
516 |
|
517 |
"""#Demo"""
|
518 |
|
519 |
+
def back():
|
520 |
+
return gr.update(visible=False),gr.update(visible=True),gr.update(visible=True),gr.update(visible=True),gr.update(visible=False)
|
521 |
|
522 |
def move_next_page(a, b, c, d):
|
523 |
patient_info1 = a + b
|
|
|
644 |
view_report, outputs=[page1, page2, chatbot, html_block, pdf_report]
|
645 |
)
|
646 |
back_btn.click(
|
647 |
+
back, outputs=[page1, page2, chatbot, html_block, pdf_report]
|
648 |
)
|
649 |
|
650 |
demo.queue()
|