@php $money = fn ($minor) => config('care.billing.currency').' '.number_format($minor / 100, 2); $formatValue = function ($key, $value) use ($money) { if (str_ends_with($key, '_minor')) return $money((int) $value); return $value; }; @endphp

{{ $label }}

{{ $from }} to {{ $to }}

@if ($canExport) Export CSV @endif
@if ($type === 'clinical' && isset($data['diagnoses']))
@forelse ($data['diagnoses'] as $row) @empty @endforelse
DiagnosisCount
{{ $row->description }}{{ $row->total }}
No diagnoses in period.
@elseif ($type === 'assessments')

Summary

@foreach ($data['summary'] ?? [] as $key => $value)
{{ str_replace('_', ' ', $key) }}
{{ $value }}
@endforeach

By clinical form

@forelse ($data['by_template'] ?? [] as $row) @empty @endforelse
Template Started Completed
{{ $row->template_name }} ({{ $row->template_code }}) {{ $row->total }} {{ $row->completed }}
No assessments in period.

Pathway activations

@forelse ($data['by_pathway'] ?? [] as $row) @empty @endforelse
Pathway Activations Still active
{{ $row->pathway_name }} {{ $row->total }} {{ $row->still_active }}
No pathway activations in period.

Average scores

@forelse ($data['score_averages'] ?? [] as $row) @empty @endforelse
Instrument Completions Avg total Avg max
{{ $row->template_code }} {{ $row->completions }} {{ $row->avg_total !== null ? round((float) $row->avg_total, 2) : '—' }} {{ $row->avg_max !== null ? round((float) $row->avg_max, 2) : '—' }}
No scored completions in period.
@else
@foreach ($data as $key => $value)
{{ str_replace('_', ' ', $key) }}
{{ $formatValue($key, $value) }}
@endforeach
@endif