@extends('layouts.admin') @section('title', 'Billing Rule Settings') @section('content')

Every rule set below is placeholder data

Pending compliance and coding review. Changing a threshold or band width never edits an effective row — it always creates a new dated version, leaving history untouched.

New version
@php $payerStyles = [ 'medicare' => ['icon' => 'bg-accent-muted', 'iconText' => 'text-accent', 'bar' => 'bg-accent', 'pill' => 'bg-accent-muted text-accent border-accent/20'], 'medicaid' => ['icon' => 'bg-status-good/10', 'iconText' => 'text-status-good', 'bar' => 'bg-status-good', 'pill' => 'bg-status-good/10 text-status-good border-status-good/20'], 'fqhc' => ['icon' => 'bg-brand-orange-muted', 'iconText' => 'text-brand-orange', 'bar' => 'bg-brand-orange', 'pill' => 'bg-brand-orange-muted text-brand-orange border-brand-orange/20'], 'commercial' => ['icon' => 'bg-status-serious/10', 'iconText' => 'text-status-serious', 'bar' => 'bg-status-serious', 'pill' => 'bg-status-serious/10 text-status-serious border-status-serious/20'], ]; $fallbackStyle = ['icon' => 'bg-surface-3', 'iconText' => 'text-ink-secondary', 'bar' => 'bg-ink-muted', 'pill' => 'status-pill-neutral']; @endphp @forelse ($ruleSets as $payerType => $versions) @php $activeVersion = $versions->first(fn ($rs) => $rs->effective_end === null && $rs->is_active); $style = $payerStyles[$payerType] ?? $fallbackStyle; @endphp

{{ $payerType }}

@if ($activeVersion) Active @endif
@if ($activeVersion)

Active since {{ $activeVersion->effective_start->format('M j, Y') }} · amber band {{ $activeVersion->approaching_threshold_minutes }} min

@endif
@foreach ($versions as $ruleSet) @php $isActive = $ruleSet->effective_end === null && $ruleSet->is_active; @endphp @endforeach
Name Effective Amber band Codes Status
{{ $ruleSet->name }} {{ $ruleSet->effective_start->format('M j, Y') }} → {{ $ruleSet->effective_end?->format('M j, Y') ?? 'current' }} {{ $ruleSet->approaching_threshold_minutes }} min
@foreach ($ruleSet->codes as $code) {{ $code->code }} @endforeach
@if ($isActive) Active @else Historical @endif
@empty

No billing rule sets yet

Create the first versioned rule set to start computing billing periods.

New version
@endforelse
@endsection