@extends('layouts.patient') @section('title', 'Patient Dashboard') @section('content') @php $statusLabel = str_replace('_', ' ', $patientProfile?->co_cm_status ?? 'not enrolled'); $latestAssessment = $latestAssessments->first(); $consentLabel = match ($latestConsent?->decision) { App\Models\CoCmConsent::DECISION_SIGNED => 'Signed', App\Models\CoCmConsent::DECISION_REFUSED => 'Declined', default => 'Not completed', }; $consentClass = match ($latestConsent?->decision) { App\Models\CoCmConsent::DECISION_SIGNED => 'status-pill-good', App\Models\CoCmConsent::DECISION_REFUSED => 'status-pill-critical', default => 'status-pill-warning', }; $pendingAssessmentCount = $pendingAssessmentPacket?->items->count() ?? 0; $taskLabels = [ App\Models\FollowUpTask::TYPE_REPEAT_ASSESSMENT_DUE => 'Repeat assessment due', App\Models\FollowUpTask::TYPE_PSYCHIATRIC_REVIEW_REQUEST => 'Care team review', App\Models\FollowUpTask::TYPE_WARM_HANDOFF_FOLLOW_UP => 'Warm handoff follow-up', 'referral_scheduling' => 'Care coordinator follow-up', 'decline_follow_up' => 'Follow-up check-in', ]; @endphp

Patient Portal

Welcome, {{ auth()->user()->name }}

Your care team, care plan, screening history, messages, and secure video handoff access live here.

Program Status

{{ $statusLabel }}

Consent

{{ $consentLabel }}

@if ($latestConsent?->signed_at)

{{ $latestConsent->signed_at->format('M j, Y') }}

@endif

Latest Score

@if ($latestAssessment)

Score {{ $latestAssessment->total_score }}

{{ $latestAssessment->assessmentTemplate?->name ?? 'Assessment' }}

@else

No scores yet

@endif

Unread Messages

{{ $unreadMessageCount }}

Care Plan Goals

Goals shared by your care coordinator.

{{ $activeCareGoals->count() }} active
@forelse ($activeCareGoals as $goal) @empty @endforelse
Goal Action Steps Target

{{ $goal->goal_statement }}

{{ $goal->action_steps ?: 'No action steps recorded yet.' }} {{ $goal->target_date?->format('M j, Y') ?? 'Not set' }}
No active care goals have been added yet.

Assessments

Recent PHQ-9, GAD-7, and assigned screening history.

{{ $pendingAssessmentCount }} assigned
@if ($pendingAssessmentPacket)
{{ $pendingAssessmentCount }} assessment{{ $pendingAssessmentCount === 1 ? '' : 's' }} assigned for kiosk or patient completion.
@endif
@forelse ($latestAssessments as $response) @empty @endforelse
Assessment Score Completed

{{ $response->assessmentTemplate?->name ?? 'Assessment' }}

Score {{ $response->total_score }} {{ $response->created_at->format('M j, Y') }}
No completed assessments yet.

Next Steps

Open follow-up items from your care team.

{{ $openFollowUps->count() }} open
@forelse ($openFollowUps as $task)

{{ $taskLabels[$task->type] ?? ucfirst(str_replace('_', ' ', $task->type)) }}

@if ($task->assessmentTemplate)

{{ $task->assessmentTemplate->name }}

@endif
Due {{ $task->due_at?->format('M j') ?? 'soon' }}
@empty

No open follow-up items.

@endforelse

Recent Messages

Secure messages from your care team.

{{ $recentMessages->count() }} recent
@forelse ($recentMessages as $message)

{{ $message->sender?->id === auth()->id() ? 'You' : ($message->sender?->name ?? 'Care team') }}

{{ $message->body }}

{{ $message->created_at->format('M j, g:ia') }}
@empty

No secure messages yet.

@endforelse
@endsection