added the updated implementation code ππ
Browse files- mediSync/app.py +8 -9
mediSync/app.py
CHANGED
|
@@ -463,17 +463,16 @@ def create_interface():
|
|
| 463 |
title="MediSync: Multi-Modal Medical Analysis System",
|
| 464 |
theme=gr.themes.Soft()
|
| 465 |
) as interface:
|
| 466 |
-
# Get appointment ID from URL parameters
|
| 467 |
-
try:
|
| 468 |
-
from gradio.context import Context
|
| 469 |
-
appointment_id_value = Context.request.query_params.get("appointment_id", "") if hasattr(Context, 'request') else ""
|
| 470 |
-
except Exception as e:
|
| 471 |
-
logging.warning(f"Could not get URL parameters: {str(e)}")
|
| 472 |
-
appointment_id_value = ""
|
| 473 |
-
|
| 474 |
appointment_id = gr.Textbox(
|
| 475 |
visible=False,
|
| 476 |
-
value=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 477 |
)
|
| 478 |
|
| 479 |
gr.Markdown("""
|
|
|
|
| 463 |
title="MediSync: Multi-Modal Medical Analysis System",
|
| 464 |
theme=gr.themes.Soft()
|
| 465 |
) as interface:
|
| 466 |
+
# Get appointment ID from URL parameters using JavaScript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 467 |
appointment_id = gr.Textbox(
|
| 468 |
visible=False,
|
| 469 |
+
value="",
|
| 470 |
+
_js="""
|
| 471 |
+
function() {
|
| 472 |
+
const params = new URLSearchParams(window.location.search);
|
| 473 |
+
return params.get('appointment_id') || '';
|
| 474 |
+
}
|
| 475 |
+
"""
|
| 476 |
)
|
| 477 |
|
| 478 |
gr.Markdown("""
|