This is a complex request for a pediatric behavioral health measurement-based care (MBC) platform. Let me think through what this entails:
Core Concepts of Measurement-Based Care:
- Regular administration of validated assessment tools (PHQ-A, GAD-7, etc.)
- Tracking scores over time
- Visual dashboards showing progress
- Alerts for concerning trends
- Reporting for payers/insurance
Key Features to Build:
- Patient management
- Assessment administration (age-appropriate screening tools)
- Score tracking and visualization
- Progress dashboards
- Payer reporting (session counts, outcomes, quality metrics)
- Clinical decision support
Pediatric-Specific Considerations:
- Parent/guardian proxy reporting
- Age-appropriate assessments
- Developmental considerations
- Family involvement metrics
Assessment Tools for Pediatrics:
- PHQ-A (Adolescent PHQ-9 modified)
- SCARED (Screen for Child Anxiety Related Disorders)
- Vanderbilt (ADHD)
- PSC (Pediatric Symptom Checklist)
- C-SSRS (Columbia Suicide Severity Rating Scale)
- CGI (Clinical Global Impression)
UI Components:
- Navigation sidebar
- Patient list/search
- Assessment administration forms
- Dashboard with charts
- Progress tracking visualization
- Payer report generation
- Alert system
Design Approach:
- Professional, clinical aesthetic
- Calming colors appropriate for behavioral health
- Clear data visualization
- Accessible and easy to read
- Not playful/childish despite being pediatric - it's a clinical tool for providers
Color Palette:
- Primary: Deep teal/blue-green (clinical, calming)
- Secondary: Soft lavender/purple (behavioral health association)
- Accent: Warm coral/orange for alerts
- Neutral: Soft grays
- Background: Very light gray with subtle warmth
Typography:
- Clean, professional sans-serif
- High readability
Let me create a comprehensive single-page application with:
- Dashboard view with aggregate metrics
- Patient detail view with individual tracking
- Assessment administration
- Payer reporting section
This will be a substantial piece of work. Let me structure it well.
Pediatric Behavioral Health Measurement-Based Care Platform
This is a comprehensive clinical platform for tracking pediatric mental health outcomes with assessment tools, progress dashboards, and payer reporting. Here's my approach:
Design Philosophy:
- Clinical yet approachable aesthetic with a calming teal palette
- Clear data visualization for outcome tracking
- Professional typography (DM Sans + Fraunces) for credibility
- Subtle depth through layered cards and soft shadows
Key Features:
- Patient roster with risk stratification
- Assessment administration (PHQ-A, SCARED, Vanderbilt)
- Longitudinal outcome tracking charts
- Payer quality metric reports
- Alert system for concerning trends
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MindMeasure Peds | Measurement-Based Care Platform</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700&display=swap" rel="stylesheet">
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
display: ['Fraunces', 'serif'],
body: ['DM Sans', 'sans-serif'],
},
colors: {
bg: '#f7f9fa',
fg: '#1a2e35',
muted: '#6b8594',
accent: '#0d9488',
'accent-light': '#5eead4',
card: '#ffffff',
border: '#e2e8f0',
warning: '#f59e0b',
danger: '#ef4444',
success: '#10b981',
lavender: '#a78bfa',
'lavender-light': '#ddd6fe',
}
}
}
}
</script>
<style>
:root {
--bg: #f7f9fa;
--fg: #1a2e35;
--muted: #6b8594;
--accent: #0d9488;
--accent-light: #5eead4;
--card: #ffffff;
--border: #e2e8f0;
}
* { box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--fg); }
.font-display { font-family: 'Fraunces', serif; }
/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
/* Animations */
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
from { opacity: 0; transform: translateX(-20px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
0% { transform: scale(0.8); opacity: 1; }
100% { transform: scale(1.4); opacity: 0; }
}
.animate-fade-in-up {
animation: fadeInUp 0.5s ease-out forwards;
}
.animate-slide-in {
animation: slideIn 0.4s ease-out forwards;
}
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Chart styling */
.chart-line {
stroke-dasharray: 1000;
stroke-dashoffset: 1000;
animation: drawLine 1.5s ease-out forwards;
}
@keyframes drawLine {
to { stroke-dashoffset: 0; }
}
/* Focus states */
.focus-ring:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.3);
}
/* Risk indicators */
.risk-low { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }
.risk-moderate { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.risk-high { background: linear-gradient(135deg, #ef4444 0%, #f87171 100%); }
/* Background pattern */
.bg-pattern {
background-image:
radial-gradient(circle at 20% 80%, rgba(13, 148, 136, 0.05) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.05) 0%, transparent 50%);
}
/* Tab indicator */
.tab-indicator {
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Progress bar animation */
.progress-fill {
transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Modal backdrop */
.modal-backdrop {
backdrop-filter: blur(4px);
}
/* Score gauge */
.score-gauge {
transition: stroke-dashoffset 1s ease-out;
}
</style>
</head>
<body class="min-h-screen bg-pattern">
<div class="flex min-h-screen">
<!-- Sidebar -->
<aside class="w-64 bg-card border-r border-border flex-shrink-0 hidden lg:flex flex-col">
<div class="p-6 border-b border-border">
<div class="flex items-center gap-3">
<div class="w-10 h-10 rounded-xl bg-gradient-to-br from-accent to-teal-600 flex items-center justify-center">
<svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/>
</svg>
</div>
<div>
<h1 class="font-display font-semibold text-fg">MindMeasure</h1>
<p class="text-xs text-muted">Pediatric Care</p>
</div>
</div>
</div>
<nav class="flex-1 p-4 space-y-1" role="navigation" aria-label="Main navigation">
<button class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-lg text-accent bg-accent/10 font-medium transition-all focus-ring" data-view="dashboard" aria-current="page">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"/>
</svg>
Dashboard
</button>
<button class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-lg text-muted hover:bg-bg hover:text-fg transition-all focus-ring" data-view="patients">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"/>
</svg>
Patients
</button>
<button class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-lg text-muted hover:bg-bg hover:text-fg transition-all focus-ring" data-view="assessments">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"/>
</svg>
Assessments
</button>
<button class="nav-item w-full flex items-center gap-3 px-4 py-3 rounded-lg text-muted hover:bg-bg hover:text-fg transition-all focus-ring" data-view="reports">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
Payer Reports
</button>
</nav>
<div class="p-4 border-t border-border">
<div class="flex items-center gap-3 p-3 rounded-lg bg-bg">
<div class="w-9 h-9 rounded-full bg-gradient-to-br from-lavender to-purple-500 flex items-center justify-center text-white font-medium text-sm">
DR
</div>
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-fg truncate">Dr. Rachel Kim</p>
<p class="text-xs text-muted">Child Psychiatrist</p>
</div>
</div>
</div>
</aside>
<!-- Main Content -->
<main class="flex-1 overflow-auto">
<!-- Header -->
<header class="sticky top-0 z-30 bg-bg/80 backdrop-blur-lg border-b border-border">
<div class="flex items-center justify-between px-6 py-4">
<div class="flex items-center gap-4">
<button class="lg:hidden p-2 rounded-lg hover:bg-card transition-colors focus-ring" id="mobileMenuBtn" aria-label="Open menu">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/>
</svg>
</button>
<div>
<h2 class="font-display text-xl font-semibold text-fg" id="pageTitle">Clinical Dashboard</h2>
<p class="text-sm text-muted" id="pageSubtitle">Welcome back, Dr. Kim</p>
</div>
</div>
<div class="flex items-center gap-3">
<!-- Search -->
<div class="relative hidden md:block">
<input
type="search"
placeholder="Search patients..."
class="w-64 pl-10 pr-4 py-2 rounded-lg border border-border bg-card text-fg placeholder-muted text-sm focus-ring transition-shadow"
aria-label="Search patients"
>
<svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
</div>
<!-- Notifications -->
<button class="relative p-2 rounded-lg hover:bg-card transition-colors focus-ring" aria-label="View notifications">
<svg class="w-5 h-5 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"/>
</svg>
<span class="absolute top-1.5 right-1.5 w-2 h-2 bg-danger rounded-full" aria-label="New notifications"></span>
</button>
<!-- Date -->
<div class="hidden sm:flex items-center gap-2 px-3 py-2 rounded-lg bg-card border border-border text-sm">
<svg class="w-4 h-4 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"/>
</svg>
<span class="text-fg" id="currentDate"></span>
</div>
</div>
</div>
</header>
<!-- Content Views -->
<div class="p-6">
<!-- Dashboard View -->
<section id="dashboardView" class="space-y-6" role="tabpanel" aria-label="Dashboard">
<!-- Stats Grid -->
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 opacity-0 animate-fade-in-up" style="animation-delay: 0.1s; animation-fill-mode: forwards;">
<div class="bg-card rounded-2xl p-5 border border-border shadow-sm hover:shadow-md transition-shadow">
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-accent/10 flex items-center justify-center">
<svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"/>
</svg>
</div>
<span class="text-xs font-medium text-success bg-success/10 px-2 py-1 rounded-full">+12%</span>
</div>
<p class="text-2xl font-semibold text-fg font-display">47</p>
<p class="text-sm text-muted">Active Patients</p>
</div>
<div class="bg-card rounded-2xl p-5 border border-border shadow-sm hover:shadow-md transition-shadow">
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-lavender/20 flex items-center justify-center">
<svg class="w-5 h-5 text-lavender" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
</svg>
</div>
<span class="text-xs font-medium text-muted bg-bg px-2 py-1 rounded-full">This week</span>
</div>
<p class="text-2xl font-semibold text-fg font-display">23</p>
<p class="text-sm text-muted">Pending Assessments</p>
</div>
<div class="bg-card rounded-2xl p-5 border border-border shadow-sm hover:shadow-md transition-shadow">
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-warning/10 flex items-center justify-center">
<svg class="w-5 h-5 text-warning" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
</div>
<span class="text-xs font-medium text-danger bg-danger/10 px-2 py-1 rounded-full">Urgent</span>
</div>
<p class="text-2xl font-semibold text-fg font-display">5</p>
<p class="text-sm text-muted">High Risk Alerts</p>
</div>
<div class="bg-card rounded-2xl p-5 border border-border shadow-sm hover:shadow-md transition-shadow">
<div class="flex items-center justify-between mb-3">
<div class="w-10 h-10 rounded-xl bg-success/10 flex items-center justify-center">
<svg class="w-5 h-5 text-success" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
</div>
<span class="text-xs font-medium text-success bg-success/10 px-2 py-1 rounded-full">+8%</span>
</div>
<p class="text-2xl font-semibold text-fg font-display">78%</p>
<p class="text-sm text-muted">Treatment Response</p>
</div>
</div>
<!-- Charts Row -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 opacity-0 animate-fade-in-up" style="animation-delay: 0.2s; animation-fill-mode: forwards;">
<!-- Outcome Trends Chart -->
<div class="lg:col-span-2 bg-card rounded-2xl p-6 border border-border shadow-sm">
<div class="flex items-center justify-between mb-6">
<div>
<h3 class="font-display font-semibold text-fg">Outcome Trends</h3>
<p class="text-sm text-muted">Average symptom scores over time</p>
</div>
<div class="flex gap-2">
<button class="chart-filter px-3 py-1.5 text-xs font-medium rounded-lg bg-accent/10 text-accent transition-colors" data-range="30">30 Days</button>
<button class="chart-filter px-3 py-1.5 text-xs font-medium rounded-lg text-muted hover:bg-bg transition-colors" data-range="90">90 Days</button>
<button class="chart-filter px-3 py-1.5 text-xs font-medium rounded-lg text-muted hover:bg-bg transition-colors" data-range="180">6 Months</button>
</div>
</div>
<div class="h-64 relative" id="outcomeChart" aria-label="Outcome trends chart">
<svg class="w-full h-full" viewBox="0 0 600 200" preserveAspectRatio="none">
<!-- Grid lines -->
<defs>
<linearGradient id="gradientDepression" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#0d9488;stop-opacity:0.3"/>
<stop offset="100%" style="stop-color:#0d9488;stop-opacity:0"/>
</linearGradient>
<linearGradient id="gradientAnxiety" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#a78bfa;stop-opacity:0.3"/>
<stop offset="100%" style="stop-color:#a78bfa;stop-opacity:0"/>
</linearGradient>
</defs>
<!-- Horizontal grid lines -->
<line x1="0" y1="40" x2="600" y2="40" stroke="#e2e8f0" stroke-width="1"/>
<line x1="0" y1="80" x2="600" y2="80" stroke="#e2e8f0" stroke-width="1"/>
<line x1="0" y1="120" x2="600" y2="120" stroke="#e2e8f0" stroke-width="1"/>
<line x1="0" y1="160" x2="600" y2="160" stroke="#e2e8f0" stroke-width="1"/>
<!-- Area fills -->
<path class="chart-area" d="M0,140 Q75,130 150,120 T300,100 T450,80 T600,70 L600,200 L0,200 Z" fill="url(#gradientDepression)"/>
<path class="chart-area" d="M0,120 Q75,115 150,100 T300,95 T450,85 T600,75 L600,200 L0,200 Z" fill="url(#gradientAnxiety)"/>
<!-- Depression line -->
<path class="chart-line" d="M0,140 Q75,130 150,120 T300,100 T450,80 T600,70" fill="none" stroke="#0d9488" stroke-width="3" stroke-linecap="round"/>
<!-- Anxiety line -->
<path class="chart-line" d="M0,120 Q75,115 150,100 T300,95 T450,85 T600,75" fill="none" stroke="#a78bfa" stroke-width="3" stroke-linecap="round" style="animation-delay: 0.3s"/>
<!-- Data points - Depression -->
<circle cx="0" cy="140" r="5" fill="#0d9488" class="chart-point"/>
<circle cx="150" cy="120" r="5" fill="#0d9488" class="chart-point"/>
<circle cx="300" cy="100" r="5" fill="#0d9488" class="chart-point"/>
<circle cx="450" cy="80" r="5" fill="#0d9488" class="chart-point"/>
<circle cx="600" cy="70" r="5" fill="#0d9488" class="chart-point"/>
<!-- Data points - Anxiety -->
<circle cx="0" cy="120" r="5" fill="#a78bfa" class="chart-point"/>
<circle cx="150" cy="100" r="5" fill="#a78bfa" class="chart-point"/>
<circle cx="300" cy="95" r="5" fill="#a78bfa" class="chart-point"/>
<circle cx="450" cy="85" r="5" fill="#a78bfa" class="chart-point"/>
<circle cx="600" cy="75" r="5" fill="#a78bfa" class="chart-point"/>
</svg>
<!-- Legend -->
<div class="absolute bottom-0 left-0 flex gap-6 text-xs">
<div class="flex items-center gap-2">
<span class="w-3 h-3 rounded-full bg-accent"></span>
<span class="text-muted">Depression (PHQ-A)</span>
</div>
<div class="flex items-center gap-2">
<span class="w-3 h-3 rounded-full bg-lavender"></span>
<span class="text-muted">Anxiety (SCARED)</span>
</div>
</div>
</div>
</div>
<!-- Risk Distribution -->
<div class="bg-card rounded-2xl p-6 border border-border shadow-sm">
<h3 class="font-display font-semibold text-fg mb-2">Risk Distribution</h3>
<p class="text-sm text-muted mb-6">Current patient stratification</p>
<div class="relative w-40 h-40 mx-auto mb-6">
<svg class="w-full h-full transform -rotate-90" viewBox="0 0 100 100">
<circle cx="50" cy="50" r="40" fill="none" stroke="#e2e8f0" stroke-width="12"/>
<circle cx="50" cy="50" r="40" fill="none" stroke="#10b981" stroke-width="12" stroke-dasharray="175.93" stroke-dashoffset="0" class="score-gauge"/>
<circle cx="50" cy="50" r="40" fill="none" stroke="#f59e0b" stroke-width="12" stroke-dasharray="62.83" stroke-dashoffset="-175.93" class="score-gauge" style="animation-delay: 0.2s"/>
<circle cx="50" cy="50" r="40" fill="none" stroke="#ef4444" stroke-width="12" stroke-dasharray="12.57" stroke-dashoffset="-238.76" class="score-gauge" style="animation-delay: 0.4s"/>
</svg>
<div class="absolute inset-0 flex items-center justify-center flex-col">
<span class="text-2xl font-display font-semibold text-fg">47</span>
<span class="text-xs text-muted">Total</span>
</div>
</div>
<div class="space-y-3">
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<span class="w-3 h-3 rounded-full bg-success"></span>
<span class="text-sm text-muted">Low Risk</span>
</div>
<span class="text-sm font-medium text-fg">28</span>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<span class="w-3 h-3 rounded-full bg-warning"></span>
<span class="text-sm text-muted">Moderate</span>
</div>
<span class="text-sm font-medium text-fg">14</span>
</div>
<div class="flex items-center justify-between">
<div class="flex items-center gap-2">
<span class="w-3 h-3 rounded-full bg-danger"></span>
<span class="text-sm text-muted">High Risk</span>
</div>
<span class="text-sm font-medium text-fg">5</span>
</div>
</div>
</div>
</div>
<!-- Alerts and Recent Activity -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 opacity-0 animate-fade-in-up" style="animation-delay: 0.3s; animation-fill-mode: forwards;">
<!-- Clinical Alerts -->
<div class="bg-card rounded-2xl p-6 border border-border shadow-sm">
<div class="flex items-center justify-between mb-4">
<h3 class="font-display font-semibold text-fg">Clinical Alerts</h3>
<span class="text-xs font-medium text-danger bg-danger/10 px-2 py-1 rounded-full">5 Active</span>
</div>
<div class="space-y-3" id="alertsList">
<!-- Alerts populated by JS -->
</div>
</div>
<!-- Recent Assessments -->
<div class="bg-card rounded-2xl p-6 border border-border shadow-sm">
<div class="flex items-center justify-between mb-4">
<h3 class="font-display font-semibold text-fg">Recent Assessments</h3>
<button class="text-sm text-accent hover:text-accent/80 transition-colors">View All</button>
</div>
<div class="space-y-3" id="recentAssessments">
<!-- Assessments populated by JS -->
</div>
</div>
</div>
</section>
<!-- Patients View -->
<section id="patientsView" class="hidden space-y-6" role="tabpanel" aria-label="Patients">
<div class="flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between">
<div class="relative flex-1 max-w-md">
<input
type="search"
placeholder="Search by name, MRN, or diagnosis..."
class="w-full pl-10 pr-4 py-2.5 rounded-xl border border-border bg-card text-fg placeholder-muted text-sm focus-ring"
id="patientSearch"
aria-label="Search patients"
>
<svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
</svg>
</div>
<div class="flex gap-2">
<select class="px-4 py-2.5 rounded-xl border border-border bg-card text-fg text-sm focus-ring" id="riskFilter" aria-label="Filter by risk level">
<option value="all">All Risk Levels</option>
<option value="high">High Risk</option>
<option value="moderate">Moderate</option>
<option value="low">Low Risk</option>
</select>
<button class="px-4 py-2.5 rounded-xl bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors focus-ring flex items-center gap-2" id="addPatientBtn">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"/>
</svg>
Add Patient
</button>
</div>
</div>
<!-- Patient Table -->
<div class="bg-card rounded-2xl border border-border shadow-sm overflow-hidden">
<div class="overflow-x-auto">
<table class="w-full" role="table">
<thead>
<tr class="border-b border-border bg-bg/50">
<th class="text-left px-6 py-4 text-xs font-semibold text-muted uppercase tracking-wider">Patient</th>
<th class="text-left px-6 py-4 text-xs font-semibold text-muted uppercase tracking-wider">Age</th>
<th class="text-left px-6 py-4 text-xs font-semibold text-muted uppercase tracking-wider">Diagnosis</th>
<th class="text-left px-6 py-4 text-xs font-semibold text-muted uppercase tracking-wider">Risk</th>
<th class="text-left px-6 py-4 text-xs font-semibold text-muted uppercase tracking-wider">Last Assessment</th>
<th class="text-left px-6 py-4 text-xs font-semibold text-muted uppercase tracking-wider">Progress</th>
<th class="text-right px-6 py-4 text-xs font-semibold text-muted uppercase tracking-wider">Actions</th>
</tr>
</thead>
<tbody id="patientTableBody">
<!-- Populated by JS -->
</tbody>
</table>
</div>
</div>
</section>
<!-- Assessments View -->
<section id="assessmentsView" class="hidden space-y-6" role="tabpanel" aria-label="Assessments">
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Assessment Cards -->
<div class="assessment-card bg-card rounded-2xl p-6 border border-border shadow-sm hover:shadow-lg transition-all cursor-pointer group" data-assessment="phqa">
<div class="w-12 h-12 rounded-xl bg-accent/10 flex items-center justify-center mb-4 group-hover:bg-accent/20 transition-colors">
<svg class="w-6 h-6 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<h3 class="font-display font-semibold text-fg text-lg mb-1">PHQ-A</h3>
<p class="text-sm text-muted mb-4">Patient Health Questionnaire - Adolescent</p>
<div class="flex items-center justify-between text-xs">
<span class="text-muted">9 items</span>
<span class="text-muted">Depression</span>
</div>
</div>
<div class="assessment-card bg-card rounded-2xl p-6 border border-border shadow-sm hover:shadow-lg transition-all cursor-pointer group" data-assessment="scared">
<div class="w-12 h-12 rounded-xl bg-lavender/20 flex items-center justify-center mb-4 group-hover:bg-lavender/30 transition-colors">
<svg class="w-6 h-6 text-lavender" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<h3 class="font-display font-semibold text-fg text-lg mb-1">SCARED</h3>
<p class="text-sm text-muted mb-4">Screen for Child Anxiety Related Disorders</p>
<div class="flex items-center justify-between text-xs">
<span class="text-muted">41 items</span>
<span class="text-muted">Anxiety</span>
</div>
</div>
<div class="assessment-card bg-card rounded-2xl p-6 border border-border shadow-sm hover:shadow-lg transition-all cursor-pointer group" data-assessment="vanderbilt">
<div class="w-12 h-12 rounded-xl bg-warning/10 flex items-center justify-center mb-4 group-hover:bg-warning/20 transition-colors">
<svg class="w-6 h-6 text-warning" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<h3 class="font-display font-semibold text-fg text-lg mb-1">Vanderbilt</h3>
<p class="text-sm text-muted mb-4">ADHD Diagnostic Parent Rating Scale</p>
<div class="flex items-center justify-between text-xs">
<span class="text-muted">55 items</span>
<span class="text-muted">ADHD</span>
</div>
</div>
<div class="assessment-card bg-card rounded-2xl p-6 border border-border shadow-sm hover:shadow-lg transition-all cursor-pointer group" data-assessment="psc">
<div class="w-12 h-12 rounded-xl bg-success/10 flex items-center justify-center mb-4 group-hover:bg-success/20 transition-colors">
<svg class="w-6 h-6 text-success" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<h3 class="font-display font-semibold text-fg text-lg mb-1">PSC-35</h3>
<p class="text-sm text-muted mb-4">Pediatric Symptom Checklist</p>
<div class="flex items-center justify-between text-xs">
<span class="text-muted">35 items</span>
<span class="text-muted">General</span>
</div>
</div>
<div class="assessment-card bg-card rounded-2xl p-6 border border-border shadow-sm hover:shadow-lg transition-all cursor-pointer group" data-assessment="cssrs">
<div class="w-12 h-12 rounded-xl bg-danger/10 flex items-center justify-center mb-4 group-hover:bg-danger/20 transition-colors">
<svg class="w-6 h-6 text-danger" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
</div>
<h3 class="font-display font-semibold text-fg text-lg mb-1">C-SSRS</h3>
<p class="text-sm text-muted mb-4">Columbia Suicide Severity Rating Scale</p>
<div class="flex items-center justify-between text-xs">
<span class="text-muted">6 items</span>
<span class="text-muted">Suicide Risk</span>
</div>
</div>
<div class="assessment-card bg-card rounded-2xl p-6 border border-border shadow-sm hover:shadow-lg transition-all cursor-pointer group" data-assessment="cgas">
<div class="w-12 h-12 rounded-xl bg-blue-100 flex items-center justify-center mb-4 group-hover:bg-blue-200 transition-colors">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"/>
</svg>
</div>
<h3 class="font-display font-semibold text-fg text-lg mb-1">CGAS</h3>
<p class="text-sm text-muted mb-4">Children's Global Assessment Scale</p>
<div class="flex items-center justify-between text-xs">
<span class="text-muted">1 item</span>
<span class="text-muted">Functioning</span>
</div>
</div>
</div>
</section>
<!-- Reports View -->
<section id="reportsView" class="hidden space-y-6" role="tabpanel" aria-label="Payer Reports">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Report Configuration -->
<div class="lg:col-span-1 space-y-6">
<div class="bg-card rounded-2xl p-6 border border-border shadow-sm">
<h3 class="font-display font-semibold text-fg mb-4">Generate Report</h3>
<div class="space-y-4">
<div>
<label class="block text-sm font-medium text-fg mb-2">Payer</label>
<select class="w-full px-4 py-2.5 rounded-xl border border-border bg-card text-fg text-sm focus-ring" id="payerSelect">
<option value="medicaid">Medicaid</option>
<option value="bluecross">Blue Cross Blue Shield</option>
<option value="aetna">Aetna</option>
<option value="united">United Healthcare</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-fg mb-2">Report Type</label>
<select class="w-full px-4 py-2.5 rounded-xl border border-border bg-card text-fg text-sm focus-ring" id="reportType">
<option value="quality">Quality Metrics</option>
<option value="utilization">Utilization Report</option>
<option value="outcomes">Outcomes Summary</option>
<option value="compliance">Compliance Report</option>
</select>
</div>
<div>
<label class="block text-sm font-medium text-fg mb-2">Date Range</label>
<div class="grid grid-cols-2 gap-2">
<input type="date" class="px-4 py-2.5 rounded-xl border border-border bg-card text-fg text-sm focus-ring" id="reportStart">
<input type="date" class="px-4 py-2.5 rounded-xl border border-border bg-card text-fg text-sm focus-ring" id="reportEnd">
</div>
</div>
<button class="w-full px-4 py-3 rounded-xl bg-accent text-white font-medium text-sm hover:bg-accent/90 transition-colors focus-ring" id="generateReportBtn">
Generate Report
</button>
</div>
</div>
<!-- Quick Stats -->
<div class="bg-card rounded-2xl p-6 border border-border shadow-sm">
<h3 class="font-display font-semibold text-fg mb-4">This Period</h3>
<div class="space-y-4">
<div class="flex items-center justify-between">
<span class="text-sm text-muted">Sessions Completed</span>
<span class="text-lg font-semibold text-fg">312</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-muted">Assessments Administered</span>
<span class="text-lg font-semibold text-fg">89</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-muted">Improvement Rate</span>
<span class="text-lg font-semibold text-success">78%</span>
</div>
<div class="flex items-center justify-between">
<span class="text-sm text-muted">Remission Rate</span>
<span class="text-lg font-semibold text-accent">42%</span>
</div>
</div>
</div>
</div>
<!-- Report Preview -->
<div class="lg:col-span-2 bg-card rounded-2xl p-6 border border-border shadow-sm">
<div class="flex items-center justify-between mb-6">
<div>
<h3 class="font-display font-semibold text-fg">Quality Metrics Report</h3>
<p class="text-sm text-muted">Medicaid - Q4 2024</p>
</div>
<div class="flex gap-2">
<button class="px-3 py-2 rounded-lg border border-border text-sm text-muted hover:bg-bg transition-colors focus-ring">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"/>
</svg>
</button>
<button class="px-3 py-2 rounded-lg border border-border text-sm text-muted hover:bg-bg transition-colors focus-ring">
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"/>
</svg>
</button>
</div>
</div>
<!-- Metrics Grid -->
<div class="grid grid-cols-2 gap-4 mb-6">
<div class="p-4 rounded-xl bg-success/5 border border-success/20">
<div class="flex items-center gap-2 mb-2">
<svg class="w-5 h-5 text-success" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<span class="text-sm font-medium text-success">HEDIS Met</span>
</div>
<p class="text-2xl font-display font-semibold text-fg">94%</p>
<p class="text-xs text-muted">Follow-up after hospitalization</p>
</div>
<div class="p-4 rounded-xl bg-success/5 border border-success/20">
<div class="flex items-center gap-2 mb-2">
<svg class="w-5 h-5 text-success" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
<span class="text-sm font-medium text-success">Target Exceeded</span>
</div>
<p class="text-2xl font-display font-semibold text-fg">87%</p>
<p class="text-xs text-muted">Assessment completion rate</p>
</div>
<div class="p-4 rounded-xl bg-warning/5 border border-warning/20">
<div class="flex items-center gap-2 mb-2">
<svg class="w-5 h-5 text-warning" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
<span class="text-sm font-medium text-warning">Near Target</span>
</div>
<p class="text-2xl font-display font-semibold text-fg">68%</p>
<p class="text-xs text-muted">Treatment adherence</p>
</div>
<div class="p-4 rounded-xl bg-accent/5 border border-accent/20">
<div class="flex items-center gap-2 mb-2">
<svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"/>
</svg>
<span class="text-sm font-medium text-accent">Improved</span>
</div>
<p class="text-2xl font-display font-semibold text-fg">+12%</p>
<p class="text-xs text-muted">vs. previous period</p>
</div>
</div>
<!-- Detailed Metrics Table -->
<div class="border border-border rounded-xl overflow-hidden">
<table class="w-full text-sm">
<thead>
<tr class="bg-bg/50 border-b border-border">
<th class="text-left px-4 py-3 font-medium text-muted">Metric</th>
<th class="text-center px-4 py-3 font-medium text-muted">Target</th>
<th class="text-center px-4 py-3 font-medium text-muted">Actual</th>
<th class="text-center px-4 py-3 font-medium text-muted">Status</th>
</tr>
</thead>
<tbody class="divide-y divide-border">
<tr>
<td class="px-4 py-3 text-fg">Initial Assessment within 14 days</td>
<td class="px-4 py-3 text-center text-muted">90%</td>
<td class="px-4 py-3 text-center text-fg font-medium">92%</td>
<td class="px-4 py-3 text-center"><span class="px-2 py-1 rounded-full text-xs bg-success/10 text-success">Met</span></td>
</tr>
<tr>
<td class="px-4 py-3 text-fg">Follow-up within 7 days (high risk)</td>
<td class="px-4 py-3 text-center text-muted">95%</td>
<td class="px-4 py-3 text-center text-fg font-medium">97%</td>
<td class="px-4 py-3 text-center"><span class="px-2 py-1 rounded-full text-xs bg-success/10 text-success">Met</span></td>
</tr>
<tr>
<td class="px-4 py-3 text-fg">Monthly assessment frequency</td>
<td class="px-4 py-3 text-center text-muted">80%</td>
<td class="px-4 py-3 text-center text-fg font-medium">87%</td>
<td class="px-4 py-3 text-center"><span class="px-2 py-1 rounded-full text-xs bg-success/10 text-success">Met</span></td>
</tr>
<tr>
<td class="px-4 py-3 text-fg">Care plan documentation</td>
<td class="px-4 py-3 text-center text-muted">100%</td>
<td class="px-4 py-3 text-center text-fg font-medium">96%</td>
<td class="px-4 py-3 text-center"><span class="px-2 py-1 rounded-full text-xs bg-warning/10 text-warning">Near</span></td>
</tr>
<tr>
<td class="px-4 py-3 text-fg">Clinical improvement (50% reduction)</td>
<td class="px-4 py-3 text-center text-muted">70%</td>
<td class="px-4 py-3 text-center text-fg font-medium">78%</td>
<td class="px-4 py-3 text-center"><span class="px-2 py-1 rounded-full text-xs bg-success/10 text-success">Met</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
</div>
</main>
</div>
<!-- Assessment Modal -->
<div id="assessmentModal" class="fixed inset-0 z-50 hidden" role="dialog" aria-modal="true" aria-labelledby="modalTitle">
<div class="absolute inset-0 bg-fg/20 modal-backdrop" id="modalBackdrop"></div>
<div class="absolute inset-4 md:inset-auto md:top-1/2 md:left-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:w-full md:max-w-2xl md:max-h-[90vh] bg-card rounded-2xl shadow-2xl overflow-hidden flex flex-col">
<div class="flex items-center justify-between p-6 border-b border-border">
<div>
<h2 id="modalTitle" class="font-display font-semibold text-fg text-lg">PHQ-A Assessment</h2>
<p id="modalSubtitle" class="text-sm text-muted">Patient Health Questionnaire - Adolescent</p>
</div>
<button class="p-2 rounded-lg hover:bg-bg transition-colors focus-ring" id="closeModalBtn" aria-label="Close modal">
<svg class="w-5 h-5 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div class="flex-1 overflow-auto p-6">
<div class="mb-6">
<label class="block text-sm font-medium text-fg mb-2">Select Patient</label>
<select class="w-full px-4 py-2.5 rounded-xl border border-border bg-card text-fg text-sm focus-ring" id="assessmentPatient">
<!-- Populated by JS -->
</select>
</div>
<div id="assessmentQuestions" class="space-y-4">
<!-- Populated by JS -->
</div>
</div>
<div class="p-6 border-t border-border bg-bg/50">
<div class="flex items-center justify-between">
<div id="assessmentProgress" class="text-sm text-muted">Question 1 of 9</div>
<div class="flex gap-3">
<button class="px-4 py-2 rounded-xl border border-border text-muted hover:bg-card transition-colors focus-ring" id="cancelAssessment">Cancel</button>
<button class="px-4 py-2 rounded-xl border border-border text-fg hover:bg-card transition-colors focus-ring" id="prevQuestion">Previous</button>
<button class="px-4 py-2 rounded-xl bg-accent text-white font-medium hover:bg-accent/90 transition-colors focus-ring" id="nextQuestion">Next</button>
</div>
</div>
</div>
</div>
</div>
<!-- Patient Detail Modal -->
<div id="patientModal" class="fixed inset-0 z-50 hidden" role="dialog" aria-modal="true">
<div class="absolute inset-0 bg-fg/20 modal-backdrop" id="patientModalBackdrop"></div>
<div class="absolute inset-4 md:inset-auto md:top-1/2 md:left-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:w-full md:max-w-4xl md:max-h-[90vh] bg-card rounded-2xl shadow-2xl overflow-hidden flex flex-col">
<div class="flex items-center justify-between p-6 border-b border-border">
<div class="flex items-center gap-4">
<div class="w-12 h-12 rounded-full bg-gradient-to-br from-accent to-teal-600 flex items-center justify-center text-white font-medium" id="patientAvatar">
EM
</div>
<div>
<h2 class="font-display font-semibold text-fg text-lg" id="patientName">Emma Martinez</h2>
<p class="text-sm text-muted" id="patientInfo">14 years old | MRN: 2024-0892</p>
</div>
</div>
<button class="p-2 rounded-lg hover:bg-bg transition-colors focus-ring" id="closePatientModal" aria-label="Close">
<svg class="w-5 h-5 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
</svg>
</button>
</div>
<div class="flex-1 overflow-auto p-6">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
<!-- Patient Info -->
<div class="md:col-span-1 space-y-4">
<div class="p-4 rounded-xl bg-bg">
<h4 class="text-sm font-medium text-fg mb-3">Clinical Info</h4>
<div class="space-y-2 text-sm">
<div class="flex justify-between">
<span class="text-muted">Diagnosis</span>
<span class="text-fg" id="patientDiagnosis">MDD, Recurrent</span>
</div>
<div class="flex justify-between">
<span class="text-muted">Risk Level</span>
<span class="text-warning font-medium" id="patientRisk">Moderate</span>
</div>
<div class="flex justify-between">
<span class="text-muted">Treatment</span>
<span class="text-fg" id="patientTreatment">CBT + Fluoxetine</span>
</div>
<div class="flex justify-between">
<span class="text-muted">Sessions</span>
<span class="text-fg" id="patientSessions">12</span>
</div>
</div>
</div>
<div class="p-4 rounded-xl bg-bg">
<h4 class="text-sm font-medium text-fg mb-3">Current Scores</h4>
<div class="space-y-3">
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-muted">PHQ-A</span>
<span class="text-fg font-medium" id="currentPHQA">8</span>
</div>
<div class="h-2 bg-border rounded-full overflow-hidden">
<div class="h-full bg-warning rounded-full progress-fill" style="width: 40%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-muted">SCARED</span>
<span class="text-fg font-medium" id="currentSCARED">22</span>
</div>
<div class="h-2 bg-border rounded-full overflow-hidden">
<div class="h-full bg-lavender rounded-full progress-fill" style="width: 55%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-muted">CGAS</span>
<span class="text-fg font-medium" id="currentCGAS">65</span>
</div>
<div class="h-2 bg-border rounded-full overflow-hidden">
<div class="h-full bg-success rounded-full progress-fill" style="width: 65%"></div>
</div>
</div>
</div>
</div>
</div>
<!-- Progress Chart -->
<div class="md:col-span-2">
<h4 class="text-sm font-medium text-fg mb-4">Progress Over Time</h4>
<div class="h-64 relative">
<svg class="w-full h-full" viewBox="0 0 500 200" preserveAspectRatio="none" id="patientChart">
<!-- Generated by JS -->
</svg>
</div>
<div class="mt-6">
<h4 class="text-sm font-medium text-fg mb-3">Assessment History</h4>
<div class="space-y-2 max-h-40 overflow-auto" id="assessmentHistory">
<!-- Generated by JS -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
// Data
const patients = [
{ id: 1, name: 'Emma Martinez', initials: 'EM', age: 14, mrn: '2024-0892', diagnosis: 'MDD, Recurrent', risk: 'moderate', lastAssessment: '2024-01-15', progress: 35, phqa: 8, scared: 22, cgas: 65, sessions: 12 },
{ id: 2, name: 'Liam Johnson', initials: 'LJ', age: 12, mrn: '2024-0234', diagnosis: 'GAD', risk: 'low', lastAssessment: '2024-01-18', progress: 60, phqa: 4, scared: 15, cgas: 78, sessions: 8 },
{ id: 3, name: 'Sophia Chen', initials: 'SC', age: 16, mrn: '2024-0567', diagnosis: 'ADHD, Combined', risk: 'low', lastAssessment: '2024-01-12', progress: 45, phqa: 3, scared: 12, cgas: 72, sessions: 15 },
{ id: 4, name: 'Noah Williams', initials: 'NW', age: 10, mrn: '2024-0102', diagnosis: 'ADHD, Inattentive', risk: 'high', lastAssessment: '2024-01-10', progress: -10, phqa: 18, scared: 35, cgas: 45, sessions: 6 },
{ id: 5, name: 'Olivia Brown', initials: 'OB', age: 15, mrn: '2024-0789', diagnosis: 'MDD, Single Episode', risk: 'moderate', lastAssessment: '2024-01-14', progress: 20, phqa: 12, scared: 28, cgas: 55, sessions: 10 },
{ id: 6, name: 'Ethan Davis', initials: 'ED', age: 13, mrn: '2024-0345', diagnosis: 'Social Anxiety', risk: 'low', lastAssessment: '2024-01-16', progress: 55, phqa: 5, scared: 18, cgas: 70, sessions: 9 },
{ id: 7, name: 'Ava Wilson', initials: 'AW', age: 11, mrn: '2024-0678', diagnosis: 'Separation Anxiety', risk: 'moderate', lastAssessment: '2024-01-11', progress: 15, phqa: 7, scared: 30, cgas: 58, sessions: 7 },
{ id: 8, name: 'Lucas Miller', initials: 'LM', age: 17, mrn: '2024-0901', diagnosis: 'Bipolar I', risk: 'high', lastAssessment: '2024-01-08', progress: -5, phqa: 20, scared: 40, cgas: 40, sessions: 20 },
];
const alerts = [
{ id: 1, patient: 'Lucas Miller', type: 'danger', message: 'PHQ-A score increased to 20 (severe)', time: '2 hours ago' },
{ id: 2, patient: 'Noah Williams', type: 'danger', message: 'Missed follow-up appointment', time: '1 day ago' },
{ id: 3, patient: 'Ava Wilson', type: 'warning', message: 'SCARED score elevated (30)', time: '2 days ago' },
{ id: 4, patient: 'Olivia Brown', type: 'warning', message: 'No assessment in 30 days', time: '3 days ago' },
{ id: 5, patient: 'Emma Martinez', type: 'info', message: 'Assessment due this week', time: '5 days ago' },
];
const recentAssessments = [
{ patient: 'Liam Johnson', assessment: 'SCARED', score: 15, date: '2024-01-18', change: -5 },
{ patient: 'Emma Martinez', assessment: 'PHQ-A', score: 8, date: '2024-01-15', change: -3 },
{ patient: 'Sophia Chen', assessment: 'Vanderbilt', score: 12, date: '2024-01-12', change: -2 },
{ patient: 'Noah Williams', assessment: 'PHQ-A', score: 18, date: '2024-01-10', change: +4 },
{ patient: 'Ethan Davis', assessment: 'SCARED', score: 18, date: '2024-01-16', change: -4 },
];
const phqaQuestions = [
'Little interest or pleasure in doing things',
'Feeling down, depressed, or hopeless',
'Trouble falling/staying asleep, or sleeping too much',
'Feeling tired or having little energy',
'Poor appetite or overeating',
'Feeling bad about yourself - or that you are a failure',
'Trouble concentrating on things',
'Moving or speaking slowly, or being fidgety/restless',
'Thoughts that you would be better off dead or of hurting yourself'
];
const answerOptions = [
{ value: 0, label: 'Not at all' },
{ value: 1, label: 'Several days' },
{ value: 2, label: 'More than half the days' },
{ value: 3, label: 'Nearly every day' }
];
// State
let currentView = 'dashboard';
let currentQuestion = 0;
let assessmentAnswers = [];
let selectedPatient = null;
// DOM Elements
const navItems = document.querySelectorAll('.nav-item');
const views = {
dashboard: document.getElementById('dashboardView'),
patients: document.getElementById('patientsView'),
assessments: document.getElementById('assessmentsView'),
reports: document.getElementById('reportsView')
};
// Initialize
function init() {
setCurrentDate();
renderAlerts();
renderRecentAssessments();
renderPatientTable();
populatePatientSelect();
setupEventListeners();
}
function setCurrentDate() {
const date = new Date();
const options = { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric' };
document.getElementById('currentDate').textContent = date.toLocaleDateString('en-US', options);
// Set default report dates
const endDate = date.toISOString().split('T')[0];
const startDate = new Date(date.setMonth(date.getMonth() - 3)).toISOString().split('T')[0];
document.getElementById('reportStart').value = startDate;
document.getElementById('reportEnd').value = endDate;
}
function renderAlerts() {
const container = document.getElementById('alertsList');
container.innerHTML = alerts.map(alert => `
<div class="flex items-start gap-3 p-3 rounded-xl ${alert.type === 'danger' ? 'bg-danger/5' : alert.type === 'warning' ? 'bg-warning/5' : 'bg-bg'} transition-colors hover:bg-opacity-80 cursor-pointer">
<div class="w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 ${
alert.type === 'danger' ? 'bg-danger/10' : alert.type === 'warning' ? 'bg-warning/10' : 'bg-accent/10'
}">
<svg class="w-4 h-4 ${
alert.type === 'danger' ? 'text-danger' : alert.type === 'warning' ? 'text-warning' : 'text-accent'
}" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>
</svg>
</div>
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-fg">${alert.patient}</p>
<p class="text-xs text-muted">${alert.message}</p>
</div>
<span class="text-xs text-muted flex-shrink-0">${alert.time}</span>
</div>
`).join('');
}
function renderRecentAssessments() {
const container = document.getElementById('recentAssessments');
container.innerHTML = recentAssessments.map(assessment => `
<div class="flex items-center gap-3 p-3 rounded-xl bg-bg hover:bg-border/30 transition-colors cursor-pointer">
<div class="w-8 h-8 rounded-lg ${assessment.assessment === 'PHQ-A' ? 'bg-accent/10' : assessment.assessment === 'SCARED' ? 'bg-lavender/20' : 'bg-warning/10'} flex items-center justify-center">
<svg class="w-4 h-4 ${assessment.assessment === 'PHQ-A' ? 'text-accent' : assessment.assessment === 'SCARED' ? 'text-lavender' : 'text-warning'}" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/>
</svg>
</div>
<div class="flex-1 min-w-0">
<p class="text-sm font-medium text-fg">${assessment.patient}</p>
<p class="text-xs text-muted">${assessment.assessment} - Score: ${assessment.score}</p>
</div>
<div class="text-right">
<span class="text-xs font-medium ${assessment.change < 0 ? 'text-success' : 'text-danger'}">
${assessment.change < 0 ? '' : '+'}${assessment.change}
</span>
<p class="text-xs text-muted">${assessment.date}</p>
</div>
</div>
`).join('');
}
function renderPatientTable() {
const tbody = document.getElementById('patientTableBody');
tbody.innerHTML = patients.map(patient => `
<tr class="border-b border-border hover:bg-bg/50 transition-colors cursor-pointer patient-row" data-patient-id="${patient.id}">
<td class="px-6 py-4">
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-full bg-gradient-to-br from-accent to-teal-600 flex items-center justify-center text-white text-sm font-medium">
${patient.initials}
</div>
<div>
<p class="font-medium text-fg">${patient.name}</p>
<p class="text-xs text-muted">MRN: ${patient.mrn}</p>
</div>
</div>
</td>
<td class="px-6 py-4 text-fg">${patient.age}</td>
<td class="px-6 py-4 text-fg text-sm">${patient.diagnosis}</td>
<td class="px-6 py-4">
<span class="px-2.5 py-1 rounded-full text-xs font-medium ${
patient.risk === 'high' ? 'bg-danger/10 text-danger' :
patient.risk === 'moderate' ? 'bg-warning/10 text-warning' :
'bg-success/10 text-success'
}">
${patient.risk.charAt(0).toUpperCase() + patient.risk.slice(1)}
</span>
</td>
<td class="px-6 py-4 text-sm text-muted">${formatDate(patient.lastAssessment)}</td>
<td class="px-6 py-4">
<div class="flex items-center gap-2">
<div class="w-16 h-1.5 bg-border rounded-full overflow-hidden">
<div class="h-full rounded-full ${patient.progress >= 0 ? 'bg-success' : 'bg-danger'}" style="width: ${Math.min(Math.abs(patient.progress), 100)}%"></div>
</div>
<span class="text-xs font-medium ${patient.progress >= 0 ? 'text-success' : 'text-danger'}">
${patient.progress >= 0 ? '+' : ''}${patient.progress}%
</span>
</div>
</td>
<td class="px-6 py-4 text-right">
<button class="p-2 rounded-lg hover:bg-bg transition-colors" aria-label="View patient details">
<svg class="w-4 h-4 text-muted" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"/>
</svg>
</button>
</td>
</tr>
`).join('');
}
function populatePatientSelect() {
const select = document.getElementById('assessmentPatient');
select.innerHTML = patients.map(p => `<option value="${p.id}">${p.name} (${p.mrn})</option>`).join('');
}
function formatDate(dateStr) {
const date = new Date(dateStr);
return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
}
function setupEventListeners() {
// Navigation
navItems.forEach(item => {
item.addEventListener('click', () => switchView(item.dataset.view));
});
// Chart filters
document.querySelectorAll('.chart-filter').forEach(btn => {
btn.addEventListener('click', (e) => {
document.querySelectorAll('.chart-filter').forEach(b => {
b.classList.remove('bg-accent/10', 'text-accent');
b.classList.add('text-muted');
});
e.target.classList.add('bg-accent/10', 'text-accent');
e.target.classList.remove('text-muted');
});
});
// Assessment cards
document.querySelectorAll('.assessment-card').forEach(card => {
card.addEventListener('click', () => openAssessment(card.dataset.assessment));
});
// Modal controls
document.getElementById('closeModalBtn').addEventListener('click', closeAssessmentModal);
document.getElementById('modalBackdrop').addEventListener('click', closeAssessmentModal);
document.getElementById('cancelAssessment').addEventListener('click', closeAssessmentModal);
document.getElementById('prevQuestion').addEventListener('click', prevQuestion);
document.getElementById('nextQuestion').addEventListener('click', nextQuestion);
// Patient modal
document.getElementById('closePatientModal').addEventListener('click', closePatientModal);
document.getElementById('patientModalBackdrop').addEventListener('click', closePatientModal);
// Patient table rows
document.getElementById('patientTableBody').addEventListener('click', (e) => {
const row = e.target.closest('.patient-row');
if (row) {
const patientId = parseInt(row.dataset.patientId);
openPatientModal(patientId);
}
});
// Search and filter
document.getElementById('patientSearch').addEventListener('input', filterPatients);
document.getElementById('riskFilter').addEventListener('change', filterPatients);
// Generate report
document.getElementById('generateReportBtn').addEventListener('click', generateReport);
// Keyboard navigation
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape') {
closeAssessmentModal();
closePatientModal();
}
});
}
function switchView(view) {
currentView = view;
// Update nav
navItems.forEach(item => {
if (item.dataset.view === view) {
item.classList.add('text-accent', 'bg-accent/10');
item.classList.remove('text-muted');
item.setAttribute('aria-current', 'page');
} else {
item.classList.remove('text-accent', 'bg-accent/10');
item.classList.add('text-muted');
item.removeAttribute('aria-current');
}
});
// Update views
Object.keys(views).forEach(key => {
if (key === view) {
views[key].classList.remove('hidden');
} else {
views[key].classList.add('hidden');
}
});
// Update header
const titles = {
dashboard: ['Clinical Dashboard', 'Welcome back, Dr. Kim'],
patients: ['Patient Roster', 'Manage and view patient records'],
assessments: ['Assessments', 'Administer standardized measures'],
reports: ['Payer Reports', 'Generate quality and outcomes reports']
};
document.getElementById('pageTitle').textContent = titles[view][0];
document.getElementById('pageSubtitle').textContent = titles[view][1];
}
function openAssessment(type) {
const modal = document.getElementById('assessmentModal');
const title = document.getElementById('modalTitle');
const subtitle = document.getElementById('modalSubtitle');
const assessments = {
phqa: ['PHQ-A Assessment', 'Patient Health Questionnaire - Adolescent'],
scared: ['SCARED Assessment', 'Screen for Child Anxiety Related Disorders'],
vanderbilt: ['Vanderbilt Assessment', 'ADHD Diagnostic Rating Scale'],
psc: ['PSC-35 Assessment', 'Pediatric Symptom Checklist'],
cssrs: ['C-SSRS Assessment', 'Columbia Suicide Severity Rating Scale'],
cgas: ['CGAS Assessment', "Children's Global Assessment Scale"]
};
if (assessments[type]) {
title.textContent = assessments[type][0];
subtitle.textContent = assessments[type][1];
}
currentQuestion = 0;
assessmentAnswers = new Array(phqaQuestions.length).fill(null);
renderQuestion();
modal.classList.remove('hidden');
document.body.style.overflow = 'hidden';
}
function closeAssessmentModal() {
document.getElementById('assessmentModal').classList.add('hidden');
document.body.style.overflow = '';
}
function renderQuestion() {
const container = document.getElementById('assessmentQuestions');
const q = phqaQuestions[currentQuestion];
container.innerHTML = `
<div class="space-y-4">
<p class="text-fg font-medium">Over the last 2 weeks, how often have you been bothered by:</p>
<p class="text-lg text-fg">${q}</p>
<div class="space-y-2">
${answerOptions.map(opt => `
<label class="flex items-center gap-3 p-3 rounded-xl border border-border hover:border-accent hover:bg-accent/5 cursor-pointer transition-all ${
assessmentAnswers[currentQuestion] === opt.value ? 'border-accent bg-accent/10' : ''
}">
<input type="radio" name="answer" value="${opt.value}" class="sr-only" ${
assessmentAnswers[currentQuestion] === opt.value ? 'checked' : ''
} onchange="selectAnswer(${opt.value})">
<div class="w-5 h-5 rounded-full border-2 ${
assessmentAnswers[currentQuestion] === opt.value ? 'border-accent bg-accent' : 'border-border'
} flex items-center justify-center">
${assessmentAnswers[currentQuestion] === opt.value ? '<div class="w-2 h-2 rounded-full bg-white"></div>' : ''}
</div>
<span class="text-fg">${opt.label}</span>
</label>
`).join('')}
</div>
</div>
`;
document.getElementById('assessmentProgress').textContent = `Question ${currentQuestion + 1} of ${phqaQuestions.length}`;
document.getElementById('prevQuestion').style.visibility = currentQuestion === 0 ? 'hidden' : 'visible';
document.getElementById('nextQuestion').textContent = currentQuestion === phqaQuestions.length - 1 ? 'Submit' : 'Next';
}
function selectAnswer(value) {
assessmentAnswers[currentQuestion] = value;
renderQuestion();
}
function prevQuestion() {
if (currentQuestion > 0) {
currentQuestion--;
renderQuestion();
}
}
function nextQuestion() {
if (assessmentAnswers[currentQuestion] === null) {
return;
}
if (currentQuestion < phqaQuestions.length - 1) {
currentQuestion++;
renderQuestion();
} else {
// Submit assessment
const total = assessmentAnswers.reduce((a, b) => a + b, 0);
alert(`Assessment complete! Total score: ${total}/27\nSeverity: ${getSeverity(total)}`);
closeAssessmentModal();
}
}
function getSeverity(score) {
if (score <= 4) return 'Minimal';
if (score <= 9) return 'Mild';
if (score <= 14) return 'Moderate';
if (score <= 19) return 'Moderately Severe';
return 'Severe';
}
function openPatientModal(patientId) {
selectedPatient = patients.find(p => p.id === patientId);
if (!selectedPatient) return;
document.getElementById('patientAvatar').textContent = selectedPatient.initials;
document.getElementById('patientName').textContent = selectedPatient.name;
document.getElementById('patientInfo').textContent = `${selectedPatient.age} years old | MRN: ${selectedPatient.mrn}`;
document.getElementById('patientDiagnosis').textContent = selectedPatient.diagnosis;
document.getElementById('patientRisk').textContent = selectedPatient.risk.charAt(0).toUpperCase() + selectedPatient.risk.slice(1);
document.getElementById('patientRisk').className = `font-medium text-${selectedPatient.risk === 'high' ? 'danger' : selectedPatient.risk === 'moderate' ? 'warning' : 'success'}`;
document.getElementById('patientSessions').textContent = selectedPatient.sessions;
document.getElementById('currentPHQA').textContent = selectedPatient.phqa;
document.getElementById('currentSCARED').textContent = selectedPatient.scared;
document.getElementById('currentCGAS').textContent = selectedPatient.cgas;
renderPatientChart();
renderAssessmentHistory();
document.getElementById('patientModal').classList.remove('hidden');
document.body.style.overflow = 'hidden';
}
function closePatientModal() {
document.getElementById('patientModal').classList.add('hidden');
document.body.style.overflow = '';
}
function renderPatientChart() {
const chart = document.getElementById('patientChart');
// Generate mock historical data
const phqaData = [selectedPatient.phqa + 6, selectedPatient.phqa + 4, selectedPatient.phqa + 2, selectedPatient.phqa];
chart.innerHTML = `
<defs>
<linearGradient id="patientGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#0d9488;stop-opacity:0.3"/>
<stop offset="100%" style="stop-color:#0d9488;stop-opacity:0"/>
</linearGradient>
</defs>
<line x1="0" y1="50" x2="500" y2="50" stroke="#e2e8f0" stroke-width="1"/>
<line x1="0" y1="100" x2="500" y2="100" stroke="#e2e8f0" stroke-width="1"/>
<line x1="0" y1="150" x2="500" y2="150" stroke="#e2e8f0" stroke-width="1"/>
<path d="M0,${180 - phqaData[0] * 5} L166,${180 - phqaData[1] * 5} L333,${180 - phqaData[2] * 5} L500,${180 - phqaData[3] * 5}" fill="none" stroke="#0d9488" stroke-width="3" stroke-linecap="round"/>
${phqaData.map((d, i) => `<circle cx="${i * 166}" cy="${180 - d * 5}" r="5" fill="#0d9488"/>`).join('')}
<text x="0" y="195" class="text-xs fill-muted">Oct</text>
<text x="166" y="195" class="text-xs fill-muted">Nov</text>
<text x="333" y="195" class="text-xs fill-muted">Dec</text>
<text x="480" y="195" class="text-xs fill-muted">Jan</text>
`;
}
function renderAssessmentHistory() {
const container = document.getElementById('assessmentHistory');
const history = [
{ type: 'PHQ-A', score: selectedPatient.phqa, date: selectedPatient.lastAssessment },
{ type: 'SCARED', score: selectedPatient.scared, date: '2024-01-08' },
{ type: 'PHQ-A', score: selectedPatient.phqa + 2, date: '2023-12-15' },
{ type: 'CGAS', score: selectedPatient.cgas, date: '2023-12-01' },
];
container.innerHTML = history.map(h => `
<div class="flex items-center justify-between p-2 rounded-lg bg-bg text-sm">
<span class="text-muted">${h.type}</span>
<span class="font-medium text-fg">${h.score}</span>
<span class="text-xs text-muted">${formatDate(h.date)}</span>
</div>
`).join('');
}
function filterPatients() {
const search = document.getElementById('patientSearch').value.toLowerCase();
const risk = document.getElementById('riskFilter').value;
const rows = document.querySelectorAll('.patient-row');
rows.forEach(row => {
const patientId = parseInt(row.dataset.patientId);
const patient = patients.find(p => p.id === patientId);
const matchesSearch = patient.name.toLowerCase().includes(search) ||
patient.mrn.includes(search) ||
patient.diagnosis.toLowerCase().includes(search);
const matchesRisk = risk === 'all' || patient.risk === risk;
row.style.display = matchesSearch && matchesRisk ? '' : 'none';
});
}
function generateReport() {
const payer = document.getElementById('payerSelect').value;
const type = document.getElementById('reportType').value;
const start = document.getElementById('reportStart').value;
const end = document.getElementById('reportEnd').value;
// Simulate report generation
const btn = document.getElementById('generateReportBtn');
btn.textContent = 'Generating...';
btn.disabled = true;
setTimeout(() => {
btn.textContent = 'Generate Report';
btn.disabled = false;
alert(`Report generated successfully!\n\nPayer: ${payer}\nType: ${type}\nPeriod: ${start} to ${end}`);
}, 1500);
}
// Make selectAnswer global
window.selectAnswer = selectAnswer;
// Initialize on load
document.addEventListener('DOMContentLoaded', init);
</script>
</body>
</html>
Key Features
Clinical Dashboard:
- Real-time metrics for active patients, pending assessments, and risk alerts
- Outcome trends chart showing depression (PHQ-A) and anxiety (SCARED) scores over time
- Risk distribution visualization with donut chart
- Clinical alerts with severity indicators
Patient Management:
- Searchable patient roster with filtering by risk level
- Risk stratification (high/moderate/low) with visual indicators
- Progress tracking showing symptom improvement/decline
- Detailed patient modal with longitudinal charts
Assessment Administration:
- Six validated pediatric assessment tools (PHQ-A, SCARED, Vanderbilt, PSC-35, C-SSRS, CGAS)
- Interactive questionnaire with progress tracking
- Automated scoring and severity classification
Payer Reporting:
- Quality metrics dashboard with HEDIS compliance indicators
- Configurable reports by payer, type, and date range
- Export-ready format with target vs. actual comparisons
Design Highlights:
- Calming teal/lavender palette appropriate for behavioral health
- Fraunces display font for warmth and approachability
- Layered card system with subtle depth
- Accessible with full keyboard navigation and ARIA labels
- Respects prefers-reduced-motion