Files
ladill-care/resources/views/care/specialty/sections/workspace.blade.php
T
isaaccladandCursor 0181221fe8
Deploy Ladill Care / deploy (push) Successful in 52s
Add shared specialty module shell (Phase 2).
Overview/Visits/History/Billing/Workspace layout with stage maps, KPIs,
patient header/timeline, and service catalogs seeded into Billing on activate.
Emergency, Blood Bank, and Dentistry ship first-class shell configs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 10:01:17 +00:00

129 lines
7.9 KiB
PHP

@if ($patientHeader)
@include('care.partials.patient-header', [
'patient' => $patientHeader['patient'],
'visit' => $patientHeader['visit'] ?? null,
'appointment' => $patientHeader['appointment'] ?? null,
'outstandingMinor' => $patientHeader['outstanding_minor'] ?? 0,
'allergies' => $patientHeader['allergies'] ?? [],
'insuranceSummary' => $patientHeader['insurance_summary'] ?? null,
'emergency' => $patientHeader['emergency'] ?? false,
'currency' => $currency ?? 'GHS',
])
@endif
@if (! $workspaceVisit)
<section class="rounded-2xl border border-dashed border-slate-200 bg-white px-4 py-12 text-center">
<h2 class="text-sm font-semibold text-slate-900">No open visit selected</h2>
<p class="mt-1 text-sm text-slate-500">Open a visit from the Visits list, or call next from the waiting queue.</p>
<a href="{{ route('care.specialty.visits', $moduleKey) }}" class="mt-4 inline-flex text-sm font-medium text-indigo-600">Go to visits</a>
</section>
@else
{{-- Module tabs --}}
<div class="flex flex-wrap gap-1 border-b border-slate-200 pb-2">
@foreach ($workspaceTabs as $tabKey => $tabLabel)
<a href="{{ route('care.specialty.workspace', ['module' => $moduleKey, 'visit' => $workspaceVisit, 'tab' => $tabKey]) }}"
@class([
'rounded-lg px-3 py-1.5 text-sm font-medium',
'bg-indigo-50 text-indigo-800' => $activeTab === $tabKey,
'text-slate-600 hover:bg-slate-50' => $activeTab !== $tabKey,
])>
{{ $tabLabel }}
</a>
@endforeach
</div>
<div class="grid gap-4 lg:grid-cols-5">
<div class="space-y-4 lg:col-span-3">
@if ($activeTab === 'billing')
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h3 class="text-sm font-semibold text-slate-900">Add specialty service</h3>
<form method="POST" action="{{ route('care.specialty.services.add', ['module' => $moduleKey, 'visit' => $workspaceVisit]) }}" class="mt-3 space-y-3">
@csrf
<select name="service_code" required class="w-full rounded-xl border border-slate-200 px-3 py-2 text-sm">
<option value="">Select service…</option>
@foreach ($services as $service)
<option value="{{ $service['code'] }}">
{{ $service['label'] }} {{ $currency ?? 'GHS' }} {{ number_format(((int) $service['amount_minor']) / 100, 2) }}
</option>
@endforeach
</select>
<button type="submit" class="btn-primary">{{ $actions['invoice'] ?? 'Add to invoice' }}</button>
</form>
@if ($workspaceVisit->bill)
<div class="mt-6 border-t border-slate-100 pt-4">
<p class="text-xs font-semibold uppercase tracking-wide text-slate-500">Current invoice {{ $workspaceVisit->bill->invoice_number }}</p>
<ul class="mt-2 space-y-1 text-sm">
@forelse ($workspaceVisit->bill->lineItems as $line)
<li class="flex justify-between gap-3">
<span>{{ $line->description }}</span>
<span class="tabular-nums">{{ number_format($line->total_minor / 100, 2) }}</span>
</li>
@empty
<li class="text-slate-500">No line items yet.</li>
@endforelse
</ul>
<a href="{{ route('care.bills.show', $workspaceVisit->bill) }}" class="mt-3 inline-flex text-sm font-medium text-indigo-600">Open bill</a>
</div>
@endif
</section>
@elseif (in_array($activeTab, ['clinical_notes', 'triage', 'odontogram', 'requests', 'inventory'], true))
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h3 class="text-sm font-semibold text-slate-900">{{ $workspaceTabs[$activeTab] ?? 'Clinical' }}</h3>
<p class="mt-2 text-sm text-slate-500">
Structured clinical forms for this tab ship in Phase 3. Use the patient chart and appointment for notes today.
</p>
@if ($workspaceVisit->appointment)
<a href="{{ route('care.appointments.show', $workspaceVisit->appointment) }}" class="mt-3 inline-flex text-sm font-medium text-indigo-600">Open appointment</a>
@endif
</section>
@elseif ($activeTab === 'orders')
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h3 class="text-sm font-semibold text-slate-900">Orders</h3>
<p class="mt-2 text-sm text-slate-500">Order lab / imaging from the consultation flow. Specialty-specific order sets arrive in Phase 3.</p>
<a href="{{ route('care.lab.requests.index') }}" class="mt-3 inline-flex text-sm font-medium text-indigo-600">Lab requests</a>
</section>
@elseif ($activeTab === 'documents')
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h3 class="text-sm font-semibold text-slate-900">Documents</h3>
<p class="mt-2 text-sm text-slate-500">Consent forms and specialty documents will attach here. Patient attachments remain on the chart.</p>
@if ($workspaceVisit->patient)
<a href="{{ route('care.patients.show', $workspaceVisit->patient) }}" class="mt-3 inline-flex text-sm font-medium text-indigo-600">Patient attachments</a>
@endif
</section>
@else
<section class="rounded-2xl border border-slate-200 bg-white p-5">
<h3 class="text-sm font-semibold text-slate-900">Overview</h3>
<dl class="mt-3 grid gap-3 text-sm sm:grid-cols-2">
<div>
<dt class="text-slate-500">Visit status</dt>
<dd class="font-medium text-slate-900">{{ ucfirst(str_replace('_', ' ', $workspaceVisit->status)) }}</dd>
</div>
<div>
<dt class="text-slate-500">Checked in</dt>
<dd class="font-medium text-slate-900">{{ $workspaceVisit->checked_in_at?->format('d M Y H:i') ?? '—' }}</dd>
</div>
<div>
<dt class="text-slate-500">Department</dt>
<dd class="font-medium text-slate-900">{{ $workspaceVisit->appointment?->department?->name ?? '—' }}</dd>
</div>
<div>
<dt class="text-slate-500">Queue</dt>
<dd class="font-medium text-slate-900">
{{ $workspaceVisit->appointment?->queue_ticket_number ?? '—' }}
@if ($workspaceVisit->appointment?->queue_ticket_status)
<span class="text-slate-500">({{ $workspaceVisit->appointment->queue_ticket_status }})</span>
@endif
</dd>
</div>
</dl>
</section>
@endif
</div>
<div class="lg:col-span-2">
@include('care.partials.patient-timeline', ['events' => $timeline ?? []])
</div>
</div>
@endif