MedQA / pages /1_Home.py
mgbam's picture
Update pages/1_Home.py
6720639 verified
# /home/user/app/pages/1_Home.py
import streamlit as st
from config.settings import settings
from pathlib import Path
from assets.logo import get_logo_path
from services.logger import app_logger
# --- Authentication Check ---
if not st.session_state.get("authenticated_user_id"):
st.warning("Please log in to access this page.")
try:
st.switch_page("app.py")
except st.errors.StreamlitAPIException:
st.info("Please navigate to the main login page.")
st.stop()
authenticated_username = st.session_state.get("authenticated_username", "User")
app_logger.info(f"User '{authenticated_username}' accessed Home page.")
# --- Page Content ---
st.title(f"Dashboard - {settings.APP_TITLE}")
st.subheader(f"Welcome, {authenticated_username}!")
st.markdown(f"""
This application is designed to assist healthcare professionals by leveraging AI for insights and information retrieval.
Please remember the following:
- **Purpose:** This tool is for informational and educational support.
- **Not a Substitute:** It is NOT a diagnostic tool and does NOT replace your clinical judgment or patient consultation.
- **PHI:** **Do NOT enter real Patient Health Information (PHI) into this demonstration system.**
- **Simulation:** Features involving 'Quantum' aspects are currently simulated for illustrative purposes.
""")
st.markdown(settings.MAIN_DISCLAIMER_SHORT, unsafe_allow_html=True) # Short reminder
st.markdown("---")
st.header("Key Features")
st.markdown("""
- **AI-Powered Consultation (`Consult` page):** Engage with an AI assistant. You can provide (simulated) patient context to guide the conversation.
- **Consultation Reports (`Reports` page):** Review and download summaries of your AI consultation sessions.
- **Secure User Authentication:** Your interactions within this demo are tied to your account.
""")
st.markdown("---")
st.header("How to Get Started")
st.markdown("""
1. Familiarize yourself with the disclaimers and capabilities outlined here.
2. Navigate to the **`Consult`** page to start a new session with the AI.
* You will be prompted to provide optional (simulated) patient context.
3. Use the **`Reports`** page to view and download past consultation summaries.
""")
st.markdown("---")
# Display Logo
# logo_path_str = get_logo_path() # Already done in app.py sidebar, might be redundant here unless desired
# if logo_path_str:
# logo_file = Path(logo_path_str)
# if logo_file.exists():
# try:
# st.image(str(logo_file), width=120, caption=f"{settings.APP_TITLE} - Demo")
# except Exception as e:
# app_logger.warning(f"Could not display logo on Home page: {e}")
st.caption(f"Version 0.1.0 (Demonstration) | {settings.APP_TITLE}")