Files
ladill-care/resources/views/care/specialty/shell.blade.php
T
isaaccladandCursor 4c4dfc7dbf
Deploy Ladill Care / deploy (push) Successful in 58s
Wire specialty Start consultation to the real consultation page.
Doctors leave the specialty shell into Care consultations instead of a no-op workspace link.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 11:36:57 +00:00

136 lines
8.1 KiB
PHP

<x-app-layout title="{{ $definition['label'] ?? $moduleKey }}">
<div class="space-y-4">
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<p class="text-xs font-semibold uppercase tracking-wider text-indigo-600">Specialty module</p>
<h1 class="mt-1 text-xl font-semibold text-slate-900">{{ $definition['label'] ?? $moduleKey }}</h1>
<p class="mt-1 max-w-2xl text-sm text-slate-500">{{ $definition['description'] ?? '' }}</p>
</div>
<a href="{{ route('care.settings.modules') }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">Manage modules</a>
</div>
<div class="grid gap-4 lg:grid-cols-[220px_minmax(0,1fr)_240px]">
{{-- Left navigation --}}
<nav class="rounded-2xl border border-slate-200 bg-white p-3 lg:sticky lg:top-4 lg:self-start">
<p class="px-2 pb-2 text-[10px] font-semibold uppercase tracking-wider text-slate-400">Navigate</p>
<ul class="space-y-0.5">
@foreach ($navItems as $key => $item)
@php
$active = $section === $key;
$params = ['module' => $moduleKey];
if ($key === 'workspace' && $workspaceVisit) {
$params['visit'] = $workspaceVisit;
}
@endphp
<li>
<a href="{{ route($item['route'], $params) }}"
@class([
'block rounded-xl px-3 py-2 text-sm font-medium',
'bg-indigo-50 text-indigo-800' => $active,
'text-slate-600 hover:bg-slate-50 hover:text-slate-900' => ! $active,
])>
{{ $item['label'] }}
</a>
</li>
@endforeach
</ul>
@if (! empty($stages))
<p class="mt-4 px-2 pb-2 text-[10px] font-semibold uppercase tracking-wider text-slate-400">Stage map</p>
<ol class="space-y-1 px-1">
@foreach ($stages as $stage)
<li class="flex items-center gap-2 rounded-lg px-2 py-1.5 text-xs text-slate-600">
<span class="flex h-5 w-5 items-center justify-center rounded-full bg-slate-100 text-[10px] font-semibold text-slate-500">{{ $loop->iteration }}</span>
{{ $stage['label'] ?? $stage['code'] }}
</li>
@endforeach
</ol>
@endif
</nav>
{{-- Main workspace --}}
<div class="min-w-0 space-y-4">
@if ($section === 'overview')
@include('care.specialty.sections.overview')
@elseif ($section === 'visits')
@include('care.specialty.sections.visits')
@elseif ($section === 'history')
@include('care.specialty.sections.history')
@elseif ($section === 'billing')
@include('care.specialty.sections.billing')
@elseif ($section === 'workspace')
@include('care.specialty.sections.workspace')
@endif
</div>
{{-- Action panel --}}
<aside class="rounded-2xl border border-slate-200 bg-white p-4 lg:sticky lg:top-4 lg:self-start">
<h2 class="text-sm font-semibold text-slate-900">Actions</h2>
<div class="mt-3 space-y-2">
@include('care.partials.queue-ops', [
'queueIntegration' => $queueIntegration ?? null,
'queueCallNextRoute' => 'care.specialty.call-next',
'queueCallNextParams' => ['module' => $moduleKey],
'branchId' => $branchId ?? null,
])
@if ($workspaceVisit)
@php
$appointment = $workspaceVisit->appointment;
$openConsultation = $appointment?->consultation;
$canStartConsultation = $appointment && in_array($appointment->status, [
\App\Models\Appointment::STATUS_WAITING,
\App\Models\Appointment::STATUS_CHECKED_IN,
], true);
$consultationInProgress = $appointment
&& (
$appointment->status === \App\Models\Appointment::STATUS_IN_CONSULTATION
|| ($openConsultation && $openConsultation->status !== \App\Models\Consultation::STATUS_COMPLETED)
);
@endphp
@if ($consultationInProgress && $openConsultation)
<a href="{{ route('care.consultations.show', $openConsultation) }}"
class="flex w-full items-center justify-center rounded-xl bg-indigo-600 px-3 py-2 text-sm font-semibold text-white hover:bg-indigo-700">
Open consultation
</a>
@elseif ($canStartConsultation)
<form method="POST" action="{{ route('care.specialty.consultation.start', ['module' => $moduleKey, 'visit' => $workspaceVisit]) }}">
@csrf
<button type="submit" class="flex w-full items-center justify-center rounded-xl bg-indigo-600 px-3 py-2 text-sm font-semibold text-white hover:bg-indigo-700">
{{ $actions['start'] ?? 'Start consultation' }}
</button>
</form>
@endif
<a href="{{ route('care.specialty.workspace', ['module' => $moduleKey, 'visit' => $workspaceVisit]) }}"
class="flex w-full items-center justify-center rounded-xl border border-slate-200 bg-slate-50 px-3 py-2 text-sm font-medium text-slate-800 hover:bg-slate-100">
Specialty workspace
</a>
@if ($workspaceVisit->patient)
<a href="{{ route('care.patients.show', $workspaceVisit->patient) }}"
class="flex w-full items-center justify-center rounded-xl border border-slate-200 px-3 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">
Patient chart
</a>
@endif
@if ($workspaceVisit->appointment)
<a href="{{ route('care.appointments.show', $workspaceVisit->appointment) }}"
class="flex w-full items-center justify-center rounded-xl border border-slate-200 px-3 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">
Appointment
</a>
@endif
@else
<a href="{{ route('care.specialty.workspace', ['module' => $moduleKey]) }}"
class="flex w-full items-center justify-center rounded-xl bg-indigo-600 px-3 py-2 text-sm font-semibold text-white hover:bg-indigo-700">
Open workspace
</a>
@endif
<a href="{{ route('care.appointments.create') }}"
class="flex w-full items-center justify-center rounded-xl border border-indigo-200 bg-indigo-50 px-3 py-2 text-sm font-medium text-indigo-800 hover:bg-indigo-100">
Register / book
</a>
</div>
</aside>
</div>
</div>
</x-app-layout>