Add ward MAR board plus nursing notes and SBAR handovers.
Deploy Ladill Care / deploy (push) Successful in 52s
Deploy Ladill Care / deploy (push) Successful in 52s
Nurses can chart given/held/refused doses from active prescriptions on placed patients, and document chronologic notes and unit shift handovers. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -24,7 +24,19 @@
|
||||
: null;
|
||||
$permissions = app(\App\Services\Care\CarePermissions::class);
|
||||
$canManageUnit = $permissions->can($member, 'admin.departments.manage');
|
||||
$canMar = $permissions->can($member, 'mar.view');
|
||||
$canNotes = $permissions->can($member, 'nursing.notes.view');
|
||||
$canHandover = $permissions->can($member, 'nursing.handover.view');
|
||||
@endphp
|
||||
@if ($canMar)
|
||||
<a href="{{ route('care.care-units.mar', $unit) }}" class="btn-primary">MAR board</a>
|
||||
@endif
|
||||
@if ($canNotes)
|
||||
<a href="{{ route('care.care-units.notes', $unit) }}" class="btn-secondary">Nursing notes</a>
|
||||
@endif
|
||||
@if ($canHandover)
|
||||
<a href="{{ route('care.care-units.handovers', $unit) }}" class="btn-secondary">Handovers</a>
|
||||
@endif
|
||||
@if ($canManageUnit)
|
||||
<a href="{{ route('care.care-units.edit', $unit) }}" class="btn-secondary">Edit unit</a>
|
||||
<a href="{{ route('care.staff-assignments.create', ['care_unit_id' => $unit->id]) }}" class="btn-secondary">Assign staff</a>
|
||||
@@ -37,7 +49,7 @@
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold text-slate-900">Patients on this unit</h2>
|
||||
<p class="text-sm text-slate-500">Active visit placements — foundation for MAR and ward boards.</p>
|
||||
<p class="text-sm text-slate-500">Active visit placements — open MAR, notes, and handovers from the actions above.</p>
|
||||
</div>
|
||||
<p class="text-sm font-medium text-slate-700">{{ $placedVisits->count() }} placed</p>
|
||||
</div>
|
||||
@@ -64,6 +76,9 @@
|
||||
<td class="py-3 pr-4">{{ $visit->bed?->label ?? '—' }}</td>
|
||||
<td class="py-3 pr-4 whitespace-nowrap">{{ $visit->placed_at?->format('d M Y H:i') ?? '—' }}</td>
|
||||
<td class="py-3 text-right whitespace-nowrap">
|
||||
@if ($canMar ?? false)
|
||||
<a href="{{ route('care.visits.mar', $visit) }}" class="mr-2 text-indigo-600 hover:text-indigo-800">MAR</a>
|
||||
@endif
|
||||
@if ($canPlace)
|
||||
<form method="POST" action="{{ route('care.visits.placement.destroy', $visit) }}" class="inline" onsubmit="return confirm('Discharge placement and free the bed?')">
|
||||
@csrf @method('DELETE')
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
@php
|
||||
$summaries = old('patient_summaries', $patientSummaries ?? $handover?->patient_summaries ?? []);
|
||||
@endphp
|
||||
|
||||
<x-app-layout title="New handover · {{ $unit->name }}">
|
||||
<div class="mx-auto max-w-3xl space-y-6">
|
||||
<div>
|
||||
<p class="text-sm text-slate-500">
|
||||
<a href="{{ route('care.care-units.handovers', $unit) }}" class="text-indigo-600 hover:text-indigo-800">Handovers</a>
|
||||
<span class="text-slate-300">/</span>
|
||||
New
|
||||
</p>
|
||||
<h1 class="mt-1 text-2xl font-semibold text-slate-900">SBAR ward handover</h1>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{ route('care.care-units.handovers.store', $unit) }}" class="space-y-5 rounded-2xl border border-slate-200 bg-white p-6">
|
||||
@csrf
|
||||
<div class="grid gap-4 sm:grid-cols-3">
|
||||
<div>
|
||||
<label class="block text-sm font-medium">From shift</label>
|
||||
<select name="from_shift" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
<option value="">—</option>
|
||||
@foreach ($shiftCodes as $value => $label)
|
||||
<option value="{{ $value }}" @selected(old('from_shift') === $value)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium">To shift</label>
|
||||
<select name="to_shift" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
<option value="">—</option>
|
||||
@foreach ($shiftCodes as $value => $label)
|
||||
<option value="{{ $value }}" @selected(old('to_shift') === $value)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Received by</label>
|
||||
<input type="text" name="received_by" value="{{ old('received_by') }}" class="mt-1 w-full rounded-lg border-slate-300 text-sm" placeholder="Incoming nurse name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Situation</label>
|
||||
<textarea name="situation" rows="2" class="mt-1 w-full rounded-lg border-slate-300 text-sm">{{ old('situation') }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Background</label>
|
||||
<textarea name="background" rows="2" class="mt-1 w-full rounded-lg border-slate-300 text-sm">{{ old('background') }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Assessment</label>
|
||||
<textarea name="assessment" rows="2" class="mt-1 w-full rounded-lg border-slate-300 text-sm">{{ old('assessment') }}</textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Recommendation</label>
|
||||
<textarea name="recommendation" rows="2" class="mt-1 w-full rounded-lg border-slate-300 text-sm">{{ old('recommendation') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 class="text-sm font-semibold text-slate-900">Patients on unit</h2>
|
||||
<div class="mt-3 space-y-3">
|
||||
@forelse ($summaries as $i => $summary)
|
||||
<div class="rounded-xl border border-slate-100 bg-slate-50 p-3">
|
||||
<input type="hidden" name="patient_summaries[{{ $i }}][visit_id]" value="{{ $summary['visit_id'] ?? '' }}">
|
||||
<input type="hidden" name="patient_summaries[{{ $i }}][patient_name]" value="{{ $summary['patient_name'] ?? '' }}">
|
||||
<input type="hidden" name="patient_summaries[{{ $i }}][bed]" value="{{ $summary['bed'] ?? '' }}">
|
||||
<p class="text-sm font-medium">{{ $summary['patient_name'] ?? 'Patient' }} @if (!empty($summary['bed'])) · {{ $summary['bed'] }} @endif</p>
|
||||
<textarea name="patient_summaries[{{ $i }}][note]" rows="2" class="mt-2 w-full rounded-lg border-slate-300 text-sm" placeholder="Handover points for this patient">{{ $summary['note'] ?? '' }}</textarea>
|
||||
</div>
|
||||
@empty
|
||||
<p class="text-sm text-slate-500">No placed patients to include.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button type="submit" class="btn-secondary">Save draft</button>
|
||||
<button type="submit" name="complete" value="1" class="btn-primary">Complete handover</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,73 @@
|
||||
<x-app-layout title="Handover · {{ $unit->name }}">
|
||||
<div class="mx-auto max-w-3xl space-y-6">
|
||||
<div>
|
||||
<p class="text-sm text-slate-500">
|
||||
<a href="{{ route('care.care-units.handovers', $unit) }}" class="text-indigo-600 hover:text-indigo-800">Handovers</a>
|
||||
<span class="text-slate-300">/</span>
|
||||
{{ $statuses[$handover->status] ?? $handover->status }}
|
||||
</p>
|
||||
<h1 class="mt-1 text-2xl font-semibold text-slate-900">
|
||||
{{ $shiftCodes[$handover->from_shift] ?? ($handover->from_shift ?: 'Shift') }}
|
||||
→
|
||||
{{ $shiftCodes[$handover->to_shift] ?? ($handover->to_shift ?: 'Shift') }}
|
||||
</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">
|
||||
{{ ($handover->handed_over_at ?? $handover->created_at)?->format('d M Y H:i') }}
|
||||
@if ($handover->received_by) · Received by {{ $handover->received_by }} @endif
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4 rounded-2xl border border-slate-200 bg-white p-6 text-sm">
|
||||
<div>
|
||||
<h2 class="font-semibold text-slate-900">Situation</h2>
|
||||
<p class="mt-1 text-slate-700 whitespace-pre-wrap">{{ $handover->situation ?: '—' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="font-semibold text-slate-900">Background</h2>
|
||||
<p class="mt-1 text-slate-700 whitespace-pre-wrap">{{ $handover->background ?: '—' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="font-semibold text-slate-900">Assessment</h2>
|
||||
<p class="mt-1 text-slate-700 whitespace-pre-wrap">{{ $handover->assessment ?: '—' }}</p>
|
||||
</div>
|
||||
<div>
|
||||
<h2 class="font-semibold text-slate-900">Recommendation</h2>
|
||||
<p class="mt-1 text-slate-700 whitespace-pre-wrap">{{ $handover->recommendation ?: '—' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="rounded-2xl border border-slate-200 bg-white p-6">
|
||||
<h2 class="text-sm font-semibold text-slate-900">Patient summaries</h2>
|
||||
<div class="mt-3 space-y-3">
|
||||
@forelse ($handover->patient_summaries ?? [] as $summary)
|
||||
<div class="rounded-xl border border-slate-100 bg-slate-50 p-3 text-sm">
|
||||
<p class="font-medium">{{ $summary['patient_name'] ?? 'Patient' }} @if (!empty($summary['bed'])) · {{ $summary['bed'] }} @endif</p>
|
||||
<p class="mt-1 text-slate-600 whitespace-pre-wrap">{{ $summary['note'] ?: '—' }}</p>
|
||||
</div>
|
||||
@empty
|
||||
<p class="text-sm text-slate-500">No patient lines.</p>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($canWrite)
|
||||
<form method="POST" action="{{ route('care.care-units.handovers.complete', [$unit, $handover]) }}">
|
||||
@csrf
|
||||
<input type="hidden" name="from_shift" value="{{ $handover->from_shift }}">
|
||||
<input type="hidden" name="to_shift" value="{{ $handover->to_shift }}">
|
||||
<input type="hidden" name="received_by" value="{{ $handover->received_by }}">
|
||||
<input type="hidden" name="situation" value="{{ $handover->situation }}">
|
||||
<input type="hidden" name="background" value="{{ $handover->background }}">
|
||||
<input type="hidden" name="assessment" value="{{ $handover->assessment }}">
|
||||
<input type="hidden" name="recommendation" value="{{ $handover->recommendation }}">
|
||||
@foreach ($handover->patient_summaries ?? [] as $i => $summary)
|
||||
<input type="hidden" name="patient_summaries[{{ $i }}][visit_id]" value="{{ $summary['visit_id'] ?? '' }}">
|
||||
<input type="hidden" name="patient_summaries[{{ $i }}][patient_name]" value="{{ $summary['patient_name'] ?? '' }}">
|
||||
<input type="hidden" name="patient_summaries[{{ $i }}][bed]" value="{{ $summary['bed'] ?? '' }}">
|
||||
<input type="hidden" name="patient_summaries[{{ $i }}][note]" value="{{ $summary['note'] ?? '' }}">
|
||||
@endforeach
|
||||
<button type="submit" class="btn-primary">Mark completed</button>
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,51 @@
|
||||
<x-app-layout title="Handovers · {{ $unit->name }}">
|
||||
<div class="space-y-6">
|
||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div>
|
||||
<p class="text-sm text-slate-500">
|
||||
<a href="{{ route('care.care-units.show', $unit) }}" class="text-indigo-600 hover:text-indigo-800">{{ $unit->name }}</a>
|
||||
<span class="text-slate-300">/</span>
|
||||
Ward handovers
|
||||
</p>
|
||||
<h1 class="mt-1 text-2xl font-semibold text-slate-900">Shift handovers</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">SBAR handovers scoped to this care unit.</p>
|
||||
</div>
|
||||
@if ($canWrite)
|
||||
<a href="{{ route('care.care-units.handovers.create', $unit) }}" class="btn-primary">New handover</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
||||
<table class="min-w-full text-sm">
|
||||
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
|
||||
<tr>
|
||||
<th class="px-4 py-3">When</th>
|
||||
<th class="px-4 py-3">Shifts</th>
|
||||
<th class="px-4 py-3">Status</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-50">
|
||||
@forelse ($handovers as $handover)
|
||||
<tr>
|
||||
<td class="px-4 py-3 whitespace-nowrap">
|
||||
{{ ($handover->handed_over_at ?? $handover->created_at)?->format('d M Y H:i') }}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{ $shiftCodes[$handover->from_shift] ?? ($handover->from_shift ?: '—') }}
|
||||
→
|
||||
{{ $shiftCodes[$handover->to_shift] ?? ($handover->to_shift ?: '—') }}
|
||||
</td>
|
||||
<td class="px-4 py-3">{{ $statuses[$handover->status] ?? $handover->status }}</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<a href="{{ route('care.care-units.handovers.show', [$unit, $handover]) }}" class="text-sky-600">Open</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4" class="px-4 py-8 text-center text-slate-500">No handovers yet.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,99 @@
|
||||
@php
|
||||
$stateClass = [
|
||||
'due' => 'bg-amber-50 text-amber-800',
|
||||
'overdue' => 'bg-red-50 text-red-800',
|
||||
'given' => 'bg-emerald-50 text-emerald-800',
|
||||
'held' => 'bg-slate-100 text-slate-700',
|
||||
'refused' => 'bg-orange-50 text-orange-800',
|
||||
'missed' => 'bg-red-50 text-red-700',
|
||||
'prn_due' => 'bg-sky-50 text-sky-800',
|
||||
'prn_given' => 'bg-emerald-50 text-emerald-700',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<x-app-layout title="MAR · {{ $unit->name }}">
|
||||
<div class="space-y-6">
|
||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div>
|
||||
<p class="text-sm text-slate-500">
|
||||
<a href="{{ route('care.care-units.show', $unit) }}" class="text-indigo-600 hover:text-indigo-800">{{ $unit->name }}</a>
|
||||
<span class="text-slate-300">/</span>
|
||||
Medication round
|
||||
</p>
|
||||
<h1 class="mt-1 text-2xl font-semibold text-slate-900">MAR board</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">Due doses for patients placed on this unit.</p>
|
||||
</div>
|
||||
<form method="GET" class="flex items-end gap-2">
|
||||
<div>
|
||||
<label class="block text-xs font-medium uppercase text-slate-500">Date</label>
|
||||
<input type="date" name="date" value="{{ $day->toDateString() }}" class="mt-1 rounded-lg border-slate-300 text-sm">
|
||||
</div>
|
||||
<button type="submit" class="btn-secondary">Go</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
||||
<table class="min-w-full text-sm">
|
||||
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
|
||||
<tr>
|
||||
<th class="px-4 py-3">Time</th>
|
||||
<th class="px-4 py-3">Patient / bed</th>
|
||||
<th class="px-4 py-3">Drug</th>
|
||||
<th class="px-4 py-3">Dose / route</th>
|
||||
<th class="px-4 py-3">Status</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-50">
|
||||
@forelse ($rows as $row)
|
||||
@php
|
||||
$order = $row['order'];
|
||||
$state = $row['state'];
|
||||
$scheduled = $row['scheduled_for'];
|
||||
$done = in_array($state, ['given', 'held', 'refused', 'missed', 'prn_given'], true);
|
||||
@endphp
|
||||
<tr>
|
||||
<td class="px-4 py-3 whitespace-nowrap font-medium">
|
||||
{{ $scheduled?->format('H:i') ?? 'PRN' }}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{ $row['patient']?->fullName() }}
|
||||
<div class="text-xs text-slate-400">{{ $row['bed']?->label ?? 'No bed' }}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{ $order->drug_name }}
|
||||
<div class="text-xs text-slate-400">{{ strtoupper($order->frequency_code) }}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{ $order->dosage ?: '—' }}
|
||||
<div class="text-xs text-slate-400">{{ $order->route ?: '—' }}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="inline-flex rounded-full px-2 py-0.5 text-xs font-medium {{ $stateClass[$state] ?? 'bg-slate-100 text-slate-700' }}">
|
||||
{{ $stateLabels[$state] ?? $state }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right whitespace-nowrap">
|
||||
<a href="{{ route('care.visits.mar', $row['visit']) }}" class="text-sky-600 hover:text-sky-800">Chart</a>
|
||||
@if ($canAdminister && ! $done)
|
||||
<form method="POST" action="{{ route('care.mar.administer', $order) }}" class="mt-2 inline-flex flex-wrap items-center justify-end gap-1">
|
||||
@csrf
|
||||
<input type="hidden" name="redirect_to" value="{{ url()->full() }}">
|
||||
@if ($scheduled)
|
||||
<input type="hidden" name="scheduled_for" value="{{ $scheduled->toDateTimeString() }}">
|
||||
@endif
|
||||
<button name="status" value="given" class="rounded border border-emerald-200 px-2 py-1 text-xs text-emerald-700 hover:bg-emerald-50">Given</button>
|
||||
<button name="status" value="held" class="rounded border border-slate-200 px-2 py-1 text-xs text-slate-600 hover:bg-slate-50" onclick="this.form.reason.value=prompt('Reason for hold')||''; return !!this.form.reason.value;">Hold</button>
|
||||
<input type="hidden" name="reason" value="">
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="6" class="px-4 py-8 text-center text-slate-500">No MAR doses for this date. Place patients and ensure active prescriptions exist.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,110 @@
|
||||
@php
|
||||
$stateClass = [
|
||||
'due' => 'bg-amber-50 text-amber-800',
|
||||
'overdue' => 'bg-red-50 text-red-800',
|
||||
'given' => 'bg-emerald-50 text-emerald-800',
|
||||
'held' => 'bg-slate-100 text-slate-700',
|
||||
'refused' => 'bg-orange-50 text-orange-800',
|
||||
'missed' => 'bg-red-50 text-red-700',
|
||||
'prn_due' => 'bg-sky-50 text-sky-800',
|
||||
'prn_given' => 'bg-emerald-50 text-emerald-700',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<x-app-layout title="MAR · {{ $visit->patient?->fullName() }}">
|
||||
<div class="space-y-6">
|
||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div>
|
||||
<p class="text-sm text-slate-500">
|
||||
@if ($visit->careUnit)
|
||||
<a href="{{ route('care.care-units.mar', $visit->careUnit) }}" class="text-indigo-600 hover:text-indigo-800">{{ $visit->careUnit->name }} MAR</a>
|
||||
<span class="text-slate-300">/</span>
|
||||
@endif
|
||||
Patient chart
|
||||
</p>
|
||||
<h1 class="mt-1 text-2xl font-semibold text-slate-900">{{ $visit->patient?->fullName() }}</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">
|
||||
{{ $visit->careUnit?->name ?? 'Not placed' }}
|
||||
@if ($visit->bed) · Bed {{ $visit->bed->label }} @endif
|
||||
</p>
|
||||
</div>
|
||||
<form method="GET" class="flex items-end gap-2">
|
||||
<div>
|
||||
<label class="block text-xs font-medium uppercase text-slate-500">Date</label>
|
||||
<input type="date" name="date" value="{{ $day->toDateString() }}" class="mt-1 rounded-lg border-slate-300 text-sm">
|
||||
</div>
|
||||
<button type="submit" class="btn-secondary">Go</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
@forelse ($chart as $block)
|
||||
@php $order = $block['order']; @endphp
|
||||
<div class="rounded-2xl border border-slate-200 bg-white p-5">
|
||||
<div class="flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h2 class="text-base font-semibold text-slate-900">{{ $order->drug_name }}</h2>
|
||||
<p class="text-sm text-slate-500">
|
||||
{{ $order->dosage ?: 'Dose not set' }}
|
||||
· {{ $order->route ?: 'Route n/a' }}
|
||||
· {{ $frequencies[$order->frequency_code] ?? strtoupper($order->frequency_code) }}
|
||||
</p>
|
||||
@if ($order->instructions)
|
||||
<p class="mt-1 text-sm text-slate-600">{{ $order->instructions }}</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 overflow-x-auto">
|
||||
<table class="min-w-full text-sm">
|
||||
<thead class="text-left text-xs uppercase text-slate-500">
|
||||
<tr>
|
||||
<th class="pb-2 pr-4">Scheduled</th>
|
||||
<th class="pb-2 pr-4">State</th>
|
||||
<th class="pb-2"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100">
|
||||
@foreach ($block['slots'] as $slot)
|
||||
@php
|
||||
$state = $slot['state'];
|
||||
$done = in_array($state, ['given', 'held', 'refused', 'missed', 'prn_given'], true);
|
||||
@endphp
|
||||
<tr>
|
||||
<td class="py-3 pr-4">{{ $slot['scheduled_for']?->format('d M Y H:i') ?? 'PRN' }}</td>
|
||||
<td class="py-3 pr-4">
|
||||
<span class="inline-flex rounded-full px-2 py-0.5 text-xs font-medium {{ $stateClass[$state] ?? 'bg-slate-100' }}">
|
||||
{{ $stateLabels[$state] ?? $state }}
|
||||
</span>
|
||||
@if ($slot['administration']?->reason)
|
||||
<div class="mt-1 text-xs text-slate-500">{{ $slot['administration']->reason }}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="py-3 text-right">
|
||||
@if ($canAdminister && ! $done)
|
||||
<form method="POST" action="{{ route('care.mar.administer', $order) }}" class="inline-flex flex-wrap justify-end gap-1">
|
||||
@csrf
|
||||
@if ($slot['scheduled_for'])
|
||||
<input type="hidden" name="scheduled_for" value="{{ $slot['scheduled_for']->toDateTimeString() }}">
|
||||
@endif
|
||||
<button name="status" value="given" class="rounded border border-emerald-200 px-2 py-1 text-xs text-emerald-700">Given</button>
|
||||
<button name="status" value="held" class="rounded border border-slate-200 px-2 py-1 text-xs" onclick="const r=prompt('Reason'); if(!r) return false; this.form.reason.value=r;">Held</button>
|
||||
<button name="status" value="refused" class="rounded border border-orange-200 px-2 py-1 text-xs text-orange-700" onclick="const r=prompt('Reason'); if(!r) return false; this.form.reason.value=r;">Refused</button>
|
||||
<input type="hidden" name="reason" value="">
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="rounded-2xl border border-dashed border-slate-200 bg-slate-50 px-6 py-8 text-center text-sm text-slate-500">
|
||||
No active medication orders on this visit. Prescribe and activate medications first; dispensed Rxs also sync to MAR.
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
@@ -0,0 +1,82 @@
|
||||
<x-app-layout title="Nursing notes · {{ $unit->name }}">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<p class="text-sm text-slate-500">
|
||||
<a href="{{ route('care.care-units.show', $unit) }}" class="text-indigo-600 hover:text-indigo-800">{{ $unit->name }}</a>
|
||||
<span class="text-slate-300">/</span>
|
||||
Nursing notes
|
||||
</p>
|
||||
<h1 class="mt-1 text-2xl font-semibold text-slate-900">Nursing notes</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">Chronologic unit documentation — not overwritten like specialty forms.</p>
|
||||
</div>
|
||||
|
||||
@if ($canWrite)
|
||||
<form method="POST" action="{{ route('care.care-units.notes.store', $unit) }}" class="space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
|
||||
@csrf
|
||||
<div class="grid gap-4 sm:grid-cols-3">
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-sm font-medium">Patient visit</label>
|
||||
<select name="visit_id" required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
<option value="">Select…</option>
|
||||
@foreach ($placedVisits as $visit)
|
||||
<option value="{{ $visit->id }}">
|
||||
{{ $visit->patient?->fullName() }}
|
||||
@if ($visit->bed) · {{ $visit->bed->label }} @endif
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Type</label>
|
||||
<select name="note_type" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
@foreach ($noteTypes as $value => $label)
|
||||
<option value="{{ $value }}" @selected(old('note_type', 'progress') === $value)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid gap-4 sm:grid-cols-3">
|
||||
<div>
|
||||
<label class="block text-sm font-medium">Shift</label>
|
||||
<select name="shift_code" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
|
||||
<option value="">—</option>
|
||||
@foreach ($shiftCodes as $value => $label)
|
||||
<option value="{{ $value }}">{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="sm:col-span-2">
|
||||
<label class="block text-sm font-medium">Note</label>
|
||||
<textarea name="body" rows="3" required class="mt-1 w-full rounded-lg border-slate-300 text-sm" placeholder="Observations, interventions, response…">{{ old('body') }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn-primary">Save note</button>
|
||||
</form>
|
||||
@endif
|
||||
|
||||
<div class="overflow-hidden rounded-2xl border border-slate-200 bg-white">
|
||||
<table class="min-w-full text-sm">
|
||||
<thead class="bg-slate-50 text-left text-xs uppercase text-slate-500">
|
||||
<tr>
|
||||
<th class="px-4 py-3">When</th>
|
||||
<th class="px-4 py-3">Patient</th>
|
||||
<th class="px-4 py-3">Type</th>
|
||||
<th class="px-4 py-3">Note</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-50">
|
||||
@forelse ($notes as $note)
|
||||
<tr>
|
||||
<td class="px-4 py-3 whitespace-nowrap">{{ $note->recorded_at?->format('d M H:i') }}</td>
|
||||
<td class="px-4 py-3 font-medium">{{ $note->patient?->fullName() }}</td>
|
||||
<td class="px-4 py-3">{{ $noteTypes[$note->note_type] ?? $note->note_type }}</td>
|
||||
<td class="px-4 py-3 text-slate-700">{{ $note->body }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td colspan="4" class="px-4 py-8 text-center text-slate-500">No nursing notes yet.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</x-app-layout>
|
||||
Reference in New Issue
Block a user