updated the code with the changes ✅✅
Browse files- mediSync/app.py +21 -1
mediSync/app.py
CHANGED
|
@@ -465,9 +465,27 @@ def create_interface():
|
|
| 465 |
logging.warning(f"Could not get URL parameters: {str(e)}")
|
| 466 |
appointment_id_value = ""
|
| 467 |
|
|
|
|
| 468 |
appointment_id = gr.Textbox(
|
|
|
|
| 469 |
visible=False,
|
| 470 |
-
value=appointment_id_value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
)
|
| 472 |
|
| 473 |
gr.Markdown("""
|
|
@@ -574,6 +592,8 @@ def create_interface():
|
|
| 574 |
This tool is for educational and research purposes only. It is not intended to provide medical advice or replace professional healthcare. Always consult with qualified healthcare providers for medical decisions.
|
| 575 |
""")
|
| 576 |
|
|
|
|
|
|
|
| 577 |
# Consultation completion section
|
| 578 |
with gr.Row():
|
| 579 |
with gr.Column():
|
|
|
|
| 465 |
logging.warning(f"Could not get URL parameters: {str(e)}")
|
| 466 |
appointment_id_value = ""
|
| 467 |
|
| 468 |
+
# Appointment ID Textbox (hidden)
|
| 469 |
appointment_id = gr.Textbox(
|
| 470 |
+
label="Appointment ID",
|
| 471 |
visible=False,
|
| 472 |
+
value=appointment_id_value if appointment_id_value else ""
|
| 473 |
+
)
|
| 474 |
+
|
| 475 |
+
# Function to load appointment ID from URL parameters
|
| 476 |
+
def load_appointment_id():
|
| 477 |
+
try:
|
| 478 |
+
from gradio.context import Context
|
| 479 |
+
if hasattr(Context, 'request') and Context.request:
|
| 480 |
+
return Context.request.query_params.get("appointment_id", "")
|
| 481 |
+
except:
|
| 482 |
+
pass
|
| 483 |
+
return ""
|
| 484 |
+
|
| 485 |
+
# Load appointment ID when interface loads
|
| 486 |
+
interface.load(
|
| 487 |
+
fn=load_appointment_id,
|
| 488 |
+
outputs=appointment_id
|
| 489 |
)
|
| 490 |
|
| 491 |
gr.Markdown("""
|
|
|
|
| 592 |
This tool is for educational and research purposes only. It is not intended to provide medical advice or replace professional healthcare. Always consult with qualified healthcare providers for medical decisions.
|
| 593 |
""")
|
| 594 |
|
| 595 |
+
|
| 596 |
+
|
| 597 |
# Consultation completion section
|
| 598 |
with gr.Row():
|
| 599 |
with gr.Column():
|