{{-- Compact risk indicator — a clickable pill. Clicking it opens a modal listing the flagged risk factors, banners, and any auto-upgrade notice. Expects: $registration, $riskResult, $priorVisit (nullable), $draftVisit Design rationale: multiple stacked banners (risk + triage reminder + severity banners + close warnings) cluttered the encounter. Most of the time the risk is low and the clinician doesn't need to see anything. When the risk is moderate/high, a single amber or red pill is enough to signal "open this to see why". For LOW risk with no flags, this partial renders nothing. --}} @php $level = $riskResult['level'] ?? 'low'; $factors = $riskResult['factors'] ?? []; $banners = $riskResult['banners'] ?? []; $autoUpgraded = $riskResult['auto_upgraded'] ?? false; // Nothing to show? Stay out of the way. $hasAnything = count($factors) > 0 || count($banners) > 0 || $level !== 'low' || $autoUpgraded; $palette = [ 'low' => ['bg' => '#ecfdf5', 'bar' => '#10b981', 'text' => '#065f46', 'label' => 'LOW RISK'], 'moderate' => ['bg' => '#fffbeb', 'bar' => '#f59e0b', 'text' => '#92400e', 'label' => 'MODERATE RISK'], 'high' => ['bg' => '#fef2f2', 'bar' => '#dc2626', 'text' => '#991b1b', 'label' => 'HIGH RISK'], ]; $c = $palette[$level] ?? $palette['low']; @endphp @if($hasAnything)
@if(! ($draftVisit->triage_complete ?? false)) Triage incomplete — record BP, pulse, temp, weight @endif
{{-- Modal (hidden by default) --}} @endif @once @endonce