updated UI code ✅✅
Browse files- mediSync/app.py +14 -1
mediSync/app.py
CHANGED
@@ -352,6 +352,7 @@ def complete_appointment(appointment_id):
|
|
352 |
return {"status": "error", "message": f"Error: {str(e)}"}
|
353 |
|
354 |
def create_interface():
|
|
|
355 |
app = MediSyncApp()
|
356 |
example_report = """
|
357 |
CHEST X-RAY EXAMINATION
|
@@ -534,11 +535,23 @@ def create_interface():
|
|
534 |
)
|
535 |
|
536 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
appointment_id_input = gr.Textbox(
|
538 |
label="Appointment ID",
|
539 |
placeholder="Enter your appointment ID here...",
|
540 |
info="This will be automatically populated if you came from the doctors page",
|
541 |
-
value=
|
542 |
elem_id="appointment_id_input"
|
543 |
)
|
544 |
|
|
|
352 |
return {"status": "error", "message": f"Error: {str(e)}"}
|
353 |
|
354 |
def create_interface():
|
355 |
+
import urllib.parse
|
356 |
app = MediSyncApp()
|
357 |
example_report = """
|
358 |
CHEST X-RAY EXAMINATION
|
|
|
535 |
)
|
536 |
|
537 |
with gr.Row():
|
538 |
+
# --- Appointment ID auto-population logic (reference: working_hugging_face_code.py) ---
|
539 |
+
import urllib.parse
|
540 |
+
try:
|
541 |
+
url_params = {}
|
542 |
+
if hasattr(gr, 'get_current_url'):
|
543 |
+
current_url = gr.get_current_url()
|
544 |
+
if current_url:
|
545 |
+
parsed = urllib.parse.urlparse(current_url)
|
546 |
+
url_params = urllib.parse.parse_qs(parsed.query)
|
547 |
+
default_appointment_id = url_params.get('appointment_id', [''])[0]
|
548 |
+
except Exception:
|
549 |
+
default_appointment_id = ""
|
550 |
appointment_id_input = gr.Textbox(
|
551 |
label="Appointment ID",
|
552 |
placeholder="Enter your appointment ID here...",
|
553 |
info="This will be automatically populated if you came from the doctors page",
|
554 |
+
value=default_appointment_id,
|
555 |
elem_id="appointment_id_input"
|
556 |
)
|
557 |
|