File size: 1,916 Bytes
5f15338 e1134c5 5f15338 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | """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
|