Update app.py
Browse files
app.py
CHANGED
@@ -290,8 +290,7 @@ def create_ui(agent):
|
|
290 |
"assets/user.png",
|
291 |
"assets/assistant.png"
|
292 |
),
|
293 |
-
render=False
|
294 |
-
bubble_full_width=False
|
295 |
)
|
296 |
with gr.Column(scale=1):
|
297 |
final_summary = gr.Markdown(
|
@@ -333,11 +332,7 @@ def create_ui(agent):
|
|
333 |
|
334 |
def update_progress(current, total, stage=""):
|
335 |
progress = f"{stage} - {current}/{total}" if stage else f"{current}/{total}"
|
336 |
-
return
|
337 |
-
value=progress,
|
338 |
-
visible=True,
|
339 |
-
label=f"Progress: {progress}"
|
340 |
-
)
|
341 |
|
342 |
prompt_template = """
|
343 |
Analyze the patient record excerpt for missed diagnoses only. Provide a concise, evidence-based summary as a single paragraph without headings or bullet points. Include specific clinical findings (e.g., 'elevated blood pressure (160/95) on page 10'), their potential implications (e.g., 'may indicate untreated hypertension'), and a recommendation for urgent review. Do not include other oversight categories like medication conflicts. If no missed diagnoses are found, state 'No missed diagnoses identified' in a single sentence.
|
@@ -374,7 +369,7 @@ Patient Record Excerpt (Chunk {0} of {1}):
|
|
374 |
"chatbot": history,
|
375 |
"download_output": None,
|
376 |
"final_summary": "",
|
377 |
-
"progress_text":
|
378 |
}
|
379 |
|
380 |
extracted = []
|
@@ -455,9 +450,9 @@ Patient Record Excerpt (Chunk {0} of {1}):
|
|
455 |
|
456 |
yield {
|
457 |
"chatbot": history,
|
458 |
-
"download_output":
|
459 |
"final_summary": summary,
|
460 |
-
"progress_text":
|
461 |
}
|
462 |
|
463 |
except Exception as e:
|
@@ -467,7 +462,7 @@ Patient Record Excerpt (Chunk {0} of {1}):
|
|
467 |
"chatbot": history,
|
468 |
"download_output": None,
|
469 |
"final_summary": f"Error occurred during analysis: {str(e)}",
|
470 |
-
"progress_text":
|
471 |
}
|
472 |
|
473 |
def clear_and_start():
|
@@ -477,7 +472,7 @@ Patient Record Excerpt (Chunk {0} of {1}):
|
|
477 |
"", # final_summary
|
478 |
"", # msg_input
|
479 |
None, # file_upload
|
480 |
-
|
481 |
]
|
482 |
|
483 |
# Event handlers
|
|
|
290 |
"assets/user.png",
|
291 |
"assets/assistant.png"
|
292 |
),
|
293 |
+
render=False
|
|
|
294 |
)
|
295 |
with gr.Column(scale=1):
|
296 |
final_summary = gr.Markdown(
|
|
|
332 |
|
333 |
def update_progress(current, total, stage=""):
|
334 |
progress = f"{stage} - {current}/{total}" if stage else f"{current}/{total}"
|
335 |
+
return {"value": progress, "visible": True, "label": f"Progress: {progress}"}
|
|
|
|
|
|
|
|
|
336 |
|
337 |
prompt_template = """
|
338 |
Analyze the patient record excerpt for missed diagnoses only. Provide a concise, evidence-based summary as a single paragraph without headings or bullet points. Include specific clinical findings (e.g., 'elevated blood pressure (160/95) on page 10'), their potential implications (e.g., 'may indicate untreated hypertension'), and a recommendation for urgent review. Do not include other oversight categories like medication conflicts. If no missed diagnoses are found, state 'No missed diagnoses identified' in a single sentence.
|
|
|
369 |
"chatbot": history,
|
370 |
"download_output": None,
|
371 |
"final_summary": "",
|
372 |
+
"progress_text": {"value": "Starting analysis...", "visible": True}
|
373 |
}
|
374 |
|
375 |
extracted = []
|
|
|
450 |
|
451 |
yield {
|
452 |
"chatbot": history,
|
453 |
+
"download_output": report_path if report_path and os.path.exists(report_path) else None,
|
454 |
"final_summary": summary,
|
455 |
+
"progress_text": {"visible": False}
|
456 |
}
|
457 |
|
458 |
except Exception as e:
|
|
|
462 |
"chatbot": history,
|
463 |
"download_output": None,
|
464 |
"final_summary": f"Error occurred during analysis: {str(e)}",
|
465 |
+
"progress_text": {"visible": False}
|
466 |
}
|
467 |
|
468 |
def clear_and_start():
|
|
|
472 |
"", # final_summary
|
473 |
"", # msg_input
|
474 |
None, # file_upload
|
475 |
+
{"visible": False} # progress_text
|
476 |
]
|
477 |
|
478 |
# Event handlers
|