Files
ladill-care/resources/views/care/specialty/partials/actions-menu.blade.php
T
isaaccladandCursor 0edd653187
Deploy Ladill Care / deploy (push) Failing after 36s
Ship commercial Dentistry suite with odontogram and treatment plans.
Replace placeholder clinical forms with patient-level FDI charting, multi-visit plans, procedure-to-bill linking, imaging, reports, and demo seed data.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 16:33:34 +00:00

89 lines
3.7 KiB
PHP

{{-- Specialty action buttons (desktop sticky + mobile sheet). --}}
@php
$btn = 'flex w-full items-center justify-center rounded-xl px-3 py-2.5 text-sm font-semibold transition';
$btnPrimary = $btn.' bg-indigo-600 text-white hover:bg-indigo-700';
$btnSecondary = $btn.' border border-slate-200 bg-white text-slate-800 hover:bg-slate-50';
$btnAccent = $btn.' border border-indigo-200 bg-indigo-50 text-indigo-900 hover:bg-indigo-100';
$onWorkspace = ($section ?? '') === 'workspace';
$appointment = $workspaceVisit?->appointment;
$openConsultation = $appointment?->consultation;
$ticketCalled = $appointment && $appointment->queue_ticket_status === 'called';
$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)
);
$canCompleteConsultation = $consultationInProgress
&& $openConsultation
&& $openConsultation->status !== \App\Models\Consultation::STATUS_COMPLETED;
$chartTab = collect($workspaceTabs ?? [])
->keys()
->first(fn ($key) => ! in_array($key, ['overview', 'timeline', 'plan', 'treat', 'notes', 'imaging', 'orders', 'billing', 'documents'], true))
?: 'odontogram';
@endphp
@if ($onWorkspace)
@include('care.partials.queue-ops', [
'queueIntegration' => $queueIntegration ?? null,
'queueCallNextRoute' => 'care.specialty.call-next',
'queueCallNextParams' => ['module' => $moduleKey],
'branchId' => $branchId ?? null,
'currentAppointmentId' => $appointment?->id,
])
@endif
@if ($ticketCalled && $appointment)
<form method="POST" action="{{ route('care.queue.recall', $appointment) }}" class="w-full" @click.stop>
@csrf
<button type="submit" class="{{ $btnAccent }}">Call again</button>
</form>
@endif
@if ($workspaceVisit)
@if ($canCompleteConsultation)
<button
type="button"
class="{{ $btnPrimary }}"
@click.stop="$dispatch('open-modal', {{ \Illuminate\Support\Js::from('complete-consultation-'.$openConsultation->id) }})"
>
Complete consultation
</button>
@endif
@if ($consultationInProgress)
<a href="{{ route('care.specialty.workspace', ['module' => $moduleKey, 'visit' => $workspaceVisit, 'tab' => $chartTab]) }}"
class="{{ $btnSecondary }}">
Open chart
</a>
@elseif ($canStartConsultation)
<form method="POST" action="{{ route('care.specialty.consultation.start', ['module' => $moduleKey, 'visit' => $workspaceVisit]) }}" class="w-full" @click.stop>
@csrf
<button type="submit" class="{{ $btnPrimary }}">
{{ $actions['start'] ?? 'Start' }}
</button>
</form>
@endif
@if ($workspaceVisit->patient)
<a href="{{ route('care.patients.show', $workspaceVisit->patient) }}" class="{{ $btnSecondary }}">
Patient chart
</a>
@endif
@if ($workspaceVisit->appointment)
<a href="{{ route('care.appointments.show', $workspaceVisit->appointment) }}" class="{{ $btnSecondary }}">
Appointment
</a>
@endif
@endif
<a href="{{ route('care.queue.index') }}" class="{{ $btnSecondary }}">
Back to queue
</a>
<a href="{{ route('care.appointments.create') }}" class="{{ $btnAccent }}">
Register / book
</a>