@props(['note', 'encounter', 'notePool'])
@php
$statuses = \App\Modules\Consultations\Enums\NoteStatus::class;
// Resolved from the versions already loaded for this encounter — walking
// the relation would cost a query per version, per note.
$history = \App\Modules\Consultations\Models\EncounterNote::chainFrom($note, $notePool);
/*
| The status enum reports a Bootstrap contextual name, because that is what
| it was written against. Mapped here rather than changed there: the same
| enum labels this note in the API and in the printed record.
*/
$pill = match ($note->status->tone()) {
'success' => 'px-pill--green',
'warning' => 'px-pill--amber',
'danger' => 'px-pill--red',
'primary', 'info' => 'px-pill--blue',
default => 'px-pill--grey',
};
@endphp
@endif
{{-- Whitespace preserved: clinicians format notes with line breaks. --}}
{{ $note->body }}
{{--
Earlier versions are shown, not hidden behind an audit screen nobody
opens. "What did the record say before it was amended?" is a question a
clinician asks in the room, and burying the answer defeats the purpose
of keeping it.
--}}
@if ($history !== [])
{{ __('consultations::messages.notes.show_history') }} ({{ count($history) }})
@foreach ($history as $previous)
@endforeach
@endif
{{--
Three acts, three weights.
Signing is the one this screen is for and takes the filled button;
amending is ordinary and takes the quiet one; marking a note as entered
in error is the destructive one and is the only thing here in red.
--}}