@php $libelleSousType = \App\Enums\Cmu\SousTypeStructure::tryFrom((string) $sous_type)?->libelle() ?? 'Structure conventionnée'; $libelleActes = match ($sous_type) { 'LABORATOIRE' => 'examen', 'IMAGERIE' => 'acte d\'imagerie', 'PHARMACIE' => 'ordonnance honorée', default => 'prise en charge', }; $actionPrimaire = $sous_type === 'PHARMACIE' ? ['label' => 'Dispenser une ordonnance', 'href' => route('cmu.structure.pharmacie.dispenser'), 'icon' => ""] : ['label' => 'Nouvelle prise en charge', 'href' => route('cmu.pec.nouvelle'), 'icon' => ""]; @endphp {{ $etablissement->code }} · {{ $etablissement->nom_officiel }}
Bonjour {{ auth('cmu')->user()->prenoms }} {{-- ============ Action primaire en grand ============ --}}
{!! $actionPrimaire['icon'] !!}
{{ $actionPrimaire['label'] }}
Action principale de votre poste — un clic pour démarrer.
{{-- ============ KPIs ============ --}}
@if($sous_type === 'PHARMACIE' && $kpis['lignes_indispo'] > 0)
{{ $kpis['lignes_indispo'] }} ligne(s) marquée(s) INDISPONIBLE sur des dispensations passées. Ces médicaments restent à honorer dans une autre pharmacie ou ici, dès remise en stock.
@endif
{{-- ============ Graph 14 jours ============ --}} @php $maxJ = max(1, $serie_14j->max()); @endphp
@foreach($serie_14j as $jour => $valeur) @php $h = max(2, round(100 * $valeur / $maxJ)); @endphp
{{ substr($jour, 8, 2) }}/{{ substr($jour, 5, 2) }}
@endforeach
{{-- ============ Répartition catégorie ============ --}} @php $totalCat = max(1, $repartition->sum('total_gnf')); @endphp
@forelse($repartition as $r) @php $part = round(100 * $r->total_gnf / $totalCat, 1); $libCat = \App\Enums\Cmu\CategorieActe::tryFrom($r->categorie)?->libelle() ?? $r->categorie; @endphp
{{ $libCat }} {{ $r->nombre }} · {{ \App\Support\Fg::gnfCourt($r->total_gnf) }}
@empty
Aucun acte facturé ce mois.
@endforelse
{{-- ============ Top actes + dernières PEC ============ --}}
@forelse($top_actes as $a) {{ $a->code }} {{ $a->libelle }} {{ $a->quantite }} {{ \App\Support\Fg::gnf($a->total_gnf) }} @empty Aucun acte sur la période. @endforelse @forelse($pecs_recentes as $p) {{ $p->numero_pec }}
{{ $p->dossier?->prenoms }} {{ mb_strtoupper($p->dossier?->nom ?? '') }}
{{ \App\Support\Fg::ius((string) $p->dossier?->ius) }}
{{ \App\Support\Fg::gnf((int) $p->total_actes_gnf) }} @empty Aucune PEC enregistrée. @endforelse