From 2b3eed8f843a65d26e20a202b7a0f8516de9e92e Mon Sep 17 00:00:00 2001 From: isaacclad Date: Sat, 18 Jul 2026 14:38:09 +0000 Subject: [PATCH] Consolidate consultation and specialty actions into a sticky panel. Desktop uses a right sticky Actions column; mobile uses a FAB above the nav that opens a bottomsheet. Request investigations moves into a modal/sheet, and Call next is available on the consultation panel. Co-authored-by: Cursor --- .../Care/ConsultationController.php | 23 +++ resources/css/app.css | 21 +++ .../partials/actions-menu.blade.php | 60 ++++++++ .../views/care/consultations/show.blade.php | 136 +++++++++--------- .../clinical-actions-mobile.blade.php | 78 ++++++++++ .../partials/clinical-actions-panel.blade.php | 13 ++ .../specialty/partials/actions-menu.blade.php | 69 +++++++++ .../views/care/specialty/shell.blade.php | 82 ++--------- 8 files changed, 343 insertions(+), 139 deletions(-) create mode 100644 resources/views/care/consultations/partials/actions-menu.blade.php create mode 100644 resources/views/care/partials/clinical-actions-mobile.blade.php create mode 100644 resources/views/care/partials/clinical-actions-panel.blade.php create mode 100644 resources/views/care/specialty/partials/actions-menu.blade.php diff --git a/app/Http/Controllers/Care/ConsultationController.php b/app/Http/Controllers/Care/ConsultationController.php index a24837d..ee75cdc 100644 --- a/app/Http/Controllers/Care/ConsultationController.php +++ b/app/Http/Controllers/Care/ConsultationController.php @@ -10,8 +10,11 @@ use App\Models\Consultation; use App\Models\InvestigationType; use App\Models\Practitioner; use App\Services\Care\AssessmentService; +use App\Services\Care\BranchContext; use App\Services\Care\CareFeatures; use App\Services\Care\CarePermissions; +use App\Services\Care\CareQueueBridge; +use App\Services\Care\CareQueueContexts; use App\Services\Care\ConsultationReturnContext; use App\Services\Care\ConsultationService; use App\Services\Care\OrganizationResolver; @@ -170,6 +173,24 @@ class ConsultationController extends Controller ->orderBy('name') ->get(); + $queueIntegration = ['enabled' => false]; + $queueBranchId = null; + $queueBridge = app(CareQueueBridge::class); + if ($permissions->handlesFloorCare($member) && $queueBridge->isEnabled($organization)) { + $queueBranchId = app(BranchContext::class)->resolve($request, $organization, $member) + ?: (int) ($consultation->practitioner?->branch_id + ?: $consultation->visit?->branch_id + ?: $consultation->appointment?->branch_id + ?: 0); + if ($queueBranchId > 0) { + $queueIntegration = $queueBridge->listMeta( + $organization, + CareQueueContexts::CONSULTATION, + $queueBranchId, + ); + } + } + return view('care.consultations.show', [ 'consultation' => $consultation, 'practitioners' => $practitioners, @@ -193,6 +214,8 @@ class ConsultationController extends Controller 'pathwaySuggestions' => $pathwaySuggestions, 'activePathways' => $activePathways, 'pathwayInstruments' => $pathwayInstruments ?? collect(), + 'queueIntegration' => $queueIntegration, + 'queueBranchId' => $queueBranchId, ]); } diff --git a/resources/css/app.css b/resources/css/app.css index 56c8311..7accbdc 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -308,6 +308,27 @@ html.qr-mobile-page body { .btn-fab:hover { filter: brightness(0.92); } + + /* Consultation / specialty action FAB — sits above mobile bottom nav */ + .clinical-actions-fab { + position: fixed; + right: 1rem; + bottom: calc(4rem + env(safe-area-inset-bottom, 0px) + 0.75rem); + z-index: 45; + display: inline-flex; + height: 3.25rem; + width: 3.25rem; + align-items: center; + justify-content: center; + border-radius: 9999px; + background-image: linear-gradient(to right, rgb(79 70 229), rgb(124 58 237)); + color: #fff; + box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.15), 0 4px 6px -4px rgb(0 0 0 / 0.1); + } + + .clinical-actions-fab:hover { + filter: brightness(0.95); + } } diff --git a/resources/views/care/consultations/partials/actions-menu.blade.php b/resources/views/care/consultations/partials/actions-menu.blade.php new file mode 100644 index 0000000..bac418d --- /dev/null +++ b/resources/views/care/consultations/partials/actions-menu.blade.php @@ -0,0 +1,60 @@ +{{-- Action buttons for consultation show (desktop sticky + mobile sheet). --}} +@php + $canEdit = ! $isCompleted && ($canManage || $canVitals); + $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-sky-200 bg-sky-50 text-sky-900 hover:bg-sky-100'; +@endphp + +@include('care.partials.queue-ops', [ + 'queueIntegration' => $queueIntegration ?? null, + 'queueCallNextRoute' => 'care.queue.call-next', + 'queueCallNextParams' => [], + 'branchId' => $queueBranchId ?? null, +]) + +@if ($canManage && ! $isCompleted) + +@endif + +@if ($canEdit) + + @if ($canManage && ($canViewAssessments ?? false)) + + @endif +@endif + +@if ($canPrescribe) + + Prescribe + +@endif + +@if ($canRequestInvestigations && $investigationTypes->isNotEmpty() && ! $isCompleted) + +@endif + +@if ($canGenerateBill && $isCompleted && $consultation->visit) +
+ @csrf + + +
+@endif + +Back to queue diff --git a/resources/views/care/consultations/show.blade.php b/resources/views/care/consultations/show.blade.php index 3506a73..0e24190 100644 --- a/resources/views/care/consultations/show.blade.php +++ b/resources/views/care/consultations/show.blade.php @@ -1,4 +1,6 @@ +
+

@@ -10,65 +12,19 @@ @if ($consultation->practitioner) · {{ $consultation->practitioner->name }} @endif

- @if ($canManage && ! $isCompleted) - - - - - - @endif - @if ($canPrescribe) - Prescribe - @endif - @if ($canGenerateBill && $isCompleted && $consultation->visit) -
- @csrf - - -
- @endif
- @if ($canRequestInvestigations && $investigationTypes->isNotEmpty()) + @if ($canRequestInvestigations && $consultation->investigationRequests->isNotEmpty())
-

Request investigations

-
- @csrf -
- @foreach ($investigationTypes as $type) - - @endforeach -
-
- - -
- -
- @if ($consultation->investigationRequests->isNotEmpty()) -
-

Requested tests

- @foreach ($consultation->investigationRequests as $req) -

- {{ $req->investigationType->name }} - · {{ config('care.investigation_statuses')[$req->status] ?? $req->status }} -

- @endforeach -
- @endif +

Requested tests

+
+ @foreach ($consultation->investigationRequests as $req) +

+ {{ $req->investigationType->name }} + · {{ config('care.investigation_statuses')[$req->status] ?? $req->status }} +

+ @endforeach +
@endif @@ -284,7 +240,7 @@ @endif @if (! $isCompleted && ($canManage || $canVitals)) -
+ @csrf @method('PUT') @if ($canVitals) @@ -400,16 +356,6 @@ @endif - -
- - @if ($canManage && ($canViewAssessments ?? false)) - - @endif - Back to queue -
@else
@@ -484,4 +430,60 @@ @endif
@endif +
{{-- end main column --}} + + @include('care.partials.clinical-actions-panel', [ + 'actionsView' => 'care.consultations.partials.actions-menu', + 'title' => 'Actions', + ]) +
{{-- end grid --}} + + @include('care.partials.clinical-actions-mobile', [ + 'actionsView' => 'care.consultations.partials.actions-menu', + 'title' => 'Actions', + ]) + + @if ($canManage && ! $isCompleted) + + @endif + + @if ($canRequestInvestigations && $investigationTypes->isNotEmpty() && ! $isCompleted) + +
+

Request investigations

+

Select tests to send to the lab for this visit.

+
+ @csrf +
+ @foreach ($investigationTypes as $type) + + @endforeach +
+
+ + +
+
+ + +
+
+
+
+ @endif
diff --git a/resources/views/care/partials/clinical-actions-mobile.blade.php b/resources/views/care/partials/clinical-actions-mobile.blade.php new file mode 100644 index 0000000..2037921 --- /dev/null +++ b/resources/views/care/partials/clinical-actions-mobile.blade.php @@ -0,0 +1,78 @@ +{{-- Mobile FAB + bottomsheet Actions. Place outside the page grid. --}} +@php + $actionsView = $actionsView ?? null; + $title = $title ?? 'Actions'; +@endphp +@if ($actionsView) +
+ + + +
+@endif diff --git a/resources/views/care/partials/clinical-actions-panel.blade.php b/resources/views/care/partials/clinical-actions-panel.blade.php new file mode 100644 index 0000000..6e66585 --- /dev/null +++ b/resources/views/care/partials/clinical-actions-panel.blade.php @@ -0,0 +1,13 @@ +{{-- Desktop sticky Actions column. Pair with clinical-actions-mobile outside the grid. --}} +@php + $actionsView = $actionsView ?? null; + $title = $title ?? 'Actions'; +@endphp +@if ($actionsView) + +@endif diff --git a/resources/views/care/specialty/partials/actions-menu.blade.php b/resources/views/care/specialty/partials/actions-menu.blade.php new file mode 100644 index 0000000..e71764d --- /dev/null +++ b/resources/views/care/specialty/partials/actions-menu.blade.php @@ -0,0 +1,69 @@ +{{-- Specialty shell 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'; +@endphp + +@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) + ); + $chartTab = collect($workspaceTabs ?? []) + ->keys() + ->first(fn ($key) => ! in_array($key, ['overview', 'orders', 'billing', 'documents'], true)) + ?: 'clinical_notes'; + @endphp + @if ($consultationInProgress) + + Open specialty chart + + @elseif ($canStartConsultation) +
+ @csrf + +
+ @endif + + Specialty workspace + + @if ($workspaceVisit->patient) + + Patient chart + + @endif + @if ($workspaceVisit->appointment) + + Appointment + + @endif +@else + + Open workspace + +@endif + + + Register / book + diff --git a/resources/views/care/specialty/shell.blade.php b/resources/views/care/specialty/shell.blade.php index d289561..72903e8 100644 --- a/resources/views/care/specialty/shell.blade.php +++ b/resources/views/care/specialty/shell.blade.php @@ -9,7 +9,7 @@ Manage modules -
+
{{-- Left navigation --}}
- {{-- Action panel --}} - + @include('care.partials.clinical-actions-panel', [ + 'actionsView' => 'care.specialty.partials.actions-menu', + 'title' => 'Actions', + ])
+ + @include('care.partials.clinical-actions-mobile', [ + 'actionsView' => 'care.specialty.partials.actions-menu', + 'title' => 'Actions', + ])