kenmandal's picture
feat: add polypharmacy, PCP collaboration, ED avoidance, age-in-place, concierge timeline, medication intelligence
e1134c5
"""Sidebar component with persona selection and system status."""
import streamlit as st
from config import APP_NAME, APP_VERSION, PERSONAS
from data.synthetic import get_staff_metrics
def render_sidebar() -> str:
"""Render the sidebar and return the selected persona key."""
with st.sidebar:
st.markdown(
f"<h2 style='color:#38bdf8; margin-bottom:0;'>{APP_NAME}</h2>"
f"<p style='color:#64748b; font-size:0.75rem;'>v{APP_VERSION} | HIPAA-Safe Demo</p>",
unsafe_allow_html=True,
)
st.divider()
# Persona selector
persona_labels = {v["label"]: k for k, v in PERSONAS.items()}
selected_label = st.selectbox(
"Switch Workspace",
options=list(persona_labels.keys()),
format_func=lambda x: f"{PERSONAS[persona_labels[x]]['icon']} {x}",
)
persona_key = persona_labels[selected_label]
st.caption(PERSONAS[persona_key]["description"])
st.divider()
# System status
st.markdown("**System Status**")
staff = get_staff_metrics()
st.metric(
"Admin Burden Reduced",
f"{staff['paperwork_mins_saved_today']} mins",
staff["avg_documentation_time_delta"],
)
st.success("QHIN Pipeline: Active", icon="✅")
st.info("Agent Swarm: 6 Agents Online", icon="🤖")
st.divider()
# Compliance badges
st.markdown("**Compliance**")
st.markdown(
'<span class="alert-badge alert-low">HIPAA Compliant</span> '
'<span class="alert-badge alert-low">SOC 2 Type II</span>',
unsafe_allow_html=True,
)
st.divider()
st.caption(
"All data shown is synthetic and for demonstration purposes only. "
"No real PHI/PII is used in this application."
)
return persona_key