Keep consultation context on nested clinical pages and add Call again on patient queue cards.
Deploy Ladill Care / deploy (push) Successful in 1m7s

Doctors can return to the active consultation from forms, lab, prescriptions, pathways, and bills; queue cards can re-announce called/serving tickets via the existing Queue recall bridge.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 17:48:34 +00:00
co-authored by Cursor
parent e73b39b678
commit 94e53d05bf
21 changed files with 615 additions and 30 deletions
@@ -9,6 +9,7 @@ use App\Models\Prescription;
use App\Models\Practitioner;
use App\Services\Care\CareQueueBridge;
use App\Services\Care\CareQueueContexts;
use App\Services\Care\ConsultationReturnContext;
use App\Services\Care\OrganizationResolver;
use App\Services\Care\PharmacyService;
use App\Services\Care\PrescriptionService;
@@ -126,6 +127,8 @@ class PrescriptionController extends Controller
$consultation->load(['patient', 'practitioner']);
app(ConsultationReturnContext::class)->remember($consultation);
$practitioners = Practitioner::owned($this->ownerRef($request))
->where('organization_id', $this->organization($request)->id)
->where('is_active', true)
@@ -151,8 +154,13 @@ class PrescriptionController extends Controller
$this->ownerRef($request),
);
return redirect()->route('care.prescriptions.show', $prescription)
->with('success', 'Prescription created.');
$return = app(ConsultationReturnContext::class);
$return->remember($consultation);
return redirect()->route('care.prescriptions.show', array_filter([
'prescription' => $prescription,
...$return->query($consultation),
]))->with('success', 'Prescription created.');
}
public function show(Request $request, Prescription $prescription): View
@@ -167,12 +175,16 @@ class PrescriptionController extends Controller
$canDispense = app(\App\Services\Care\CarePermissions::class)
->can($this->member($request), 'prescriptions.dispense');
$return = app(ConsultationReturnContext::class);
return view('care.prescriptions.show', [
'prescription' => $prescription,
'statuses' => config('care.prescription_statuses'),
'routes' => config('care.medication_routes'),
'canManage' => $canManage,
'canDispense' => $canDispense,
'returnConsultation' => $return->resolve($request, (int) $prescription->patient_id)
?? $return->resolveLinked($request, $prescription->consultation),
]);
}