Use short assessment labels on the ward board.
Deploy Ladill Care / deploy (push) Successful in 1m5s

Full template names blew out headers and action buttons; show NEWS2/Braden/Morse/Pain with the full name on hover.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-20 16:53:43 +00:00
co-authored by Cursor
parent 4c0dbc22d8
commit 5fd402c043
3 changed files with 28 additions and 10 deletions
@@ -14,6 +14,18 @@ class NursingAssessmentService
/** @var list<string> */ /** @var list<string> */
public const NURSING_PACK_CODES = ['news2', 'braden', 'morse', 'pain_nrs']; public const NURSING_PACK_CODES = ['news2', 'braden', 'morse', 'pain_nrs'];
/** Compact board labels — full names stay on the assessment form. */
public static function shortLabel(string $code): string
{
return match ($code) {
'news2' => 'NEWS2',
'braden' => 'Braden',
'morse' => 'Morse',
'pain_nrs' => 'Pain',
default => strtoupper(str_replace('_', ' ', $code)),
};
}
/** /**
* @return Collection<int, AssessmentTemplate> * @return Collection<int, AssessmentTemplate>
*/ */
@@ -21,12 +21,14 @@
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white"> <div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
<table class="min-w-full text-sm"> <table class="min-w-full text-sm">
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500"> <thead class="bg-slate-50 text-left text-xs uppercase tracking-wide text-slate-500">
<tr> <tr>
<th class="px-4 py-3">Patient</th> <th class="px-4 py-3">Patient</th>
<th class="px-4 py-3">Latest vitals</th> <th class="px-4 py-3">Latest vitals</th>
@foreach ($templates as $template) @foreach ($templates as $template)
<th class="px-4 py-3">{{ $template->name }}</th> <th class="px-4 py-3 whitespace-nowrap" title="{{ $template->name }}">
{{ \App\Services\Care\NursingAssessmentService::shortLabel($template->code) }}
</th>
@endforeach @endforeach
<th class="px-4 py-3"></th> <th class="px-4 py-3"></th>
</tr> </tr>
@@ -38,11 +40,11 @@
$vitals = $row['vitals']; $vitals = $row['vitals'];
@endphp @endphp
<tr> <tr>
<td class="px-4 py-3 font-medium"> <td class="px-4 py-3 font-medium whitespace-nowrap">
{{ $row['patient']?->fullName() }} {{ $row['patient']?->fullName() }}
<div class="text-xs text-slate-400">{{ $row['bed']?->label ?? 'No bed' }}</div> <div class="text-xs font-normal text-slate-400">{{ $row['bed']?->label ?? 'No bed' }}</div>
</td> </td>
<td class="px-4 py-3 text-xs text-slate-600"> <td class="px-4 py-3 text-xs text-slate-600 whitespace-nowrap">
@if ($vitals) @if ($vitals)
BP {{ $vitals->bp_systolic }}/{{ $vitals->bp_diastolic }} BP {{ $vitals->bp_systolic }}/{{ $vitals->bp_diastolic }}
· P {{ $vitals->pulse }} · P {{ $vitals->pulse }}
@@ -54,7 +56,7 @@
</td> </td>
@foreach ($templates as $template) @foreach ($templates as $template)
@php $assessment = $row['assessments']->get($template->code); @endphp @php $assessment = $row['assessments']->get($template->code); @endphp
<td class="px-4 py-3"> <td class="px-4 py-3 whitespace-nowrap">
@if ($assessment) @if ($assessment)
<a href="{{ route('care.assessments.show', $assessment) }}" class="text-sky-600 hover:text-sky-800"> <a href="{{ route('care.assessments.show', $assessment) }}" class="text-sky-600 hover:text-sky-800">
{{ $assessment->status === 'completed' {{ $assessment->status === 'completed'
@@ -68,12 +70,16 @@
@endforeach @endforeach
<td class="px-4 py-3 text-right"> <td class="px-4 py-3 text-right">
@if ($canCapture && $engineEnabled) @if ($canCapture && $engineEnabled)
<div class="inline-flex flex-wrap justify-end gap-1"> <div class="inline-flex flex-nowrap justify-end gap-1">
@foreach ($templates as $template) @foreach ($templates as $template)
<form method="POST" action="{{ route('care.care-units.assessments.start', [$unit, $visit]) }}"> <form method="POST" action="{{ route('care.care-units.assessments.start', [$unit, $visit]) }}">
@csrf @csrf
<input type="hidden" name="template_code" value="{{ $template->code }}"> <input type="hidden" name="template_code" value="{{ $template->code }}">
<button type="submit" class="rounded border border-slate-200 px-2 py-1 text-xs text-slate-700 hover:bg-slate-50">{{ $template->name }}</button> <button
type="submit"
title="{{ $template->name }}"
class="rounded border border-slate-200 px-2 py-1 text-xs text-slate-700 hover:bg-slate-50"
>{{ \App\Services\Care\NursingAssessmentService::shortLabel($template->code) }}</button>
</form> </form>
@endforeach @endforeach
</div> </div>
@@ -146,8 +146,8 @@ class CareNursingAssessmentsAndPerformanceTest extends TestCase
->get(route('care.care-units.assessments', $this->unit)) ->get(route('care.care-units.assessments', $this->unit))
->assertOk() ->assertOk()
->assertSee('Ama') ->assertSee('Ama')
->assertSee('NEWS2 (Nursing early warning)') ->assertSee('NEWS2')
->assertSee('Pain NRS (010)') ->assertSee('>Pain<', false)
->assertDontSee('PAIN_NRS'); ->assertDontSee('PAIN_NRS');
} }