Keep consultation context on nested clinical pages and add Call again on patient queue cards.
Deploy Ladill Care / deploy (push) Successful in 1m7s
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:
@@ -5,10 +5,12 @@ namespace App\Http\Controllers\Care;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Care\Concerns\ScopesToAccount;
|
||||
use App\Models\Bill;
|
||||
use App\Models\Consultation;
|
||||
use App\Models\Visit;
|
||||
use App\Services\Care\BillService;
|
||||
use App\Services\Care\CareQueueBridge;
|
||||
use App\Services\Care\CareQueueContexts;
|
||||
use App\Services\Care\ConsultationReturnContext;
|
||||
use App\Services\Care\OrganizationResolver;
|
||||
use App\Services\Payments\MerchantGatewayService;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
@@ -100,8 +102,12 @@ class BillController extends Controller
|
||||
|
||||
$bill = $this->bills->generateFromVisit($visit, $this->ownerRef($request), $this->ownerRef($request));
|
||||
|
||||
return redirect()->route('care.bills.show', $bill)
|
||||
->with('success', 'Bill generated from visit.');
|
||||
$return = app(ConsultationReturnContext::class);
|
||||
|
||||
return redirect()->route('care.bills.show', array_filter([
|
||||
'bill' => $bill,
|
||||
...$return->routeQuery($request),
|
||||
]))->with('success', 'Bill generated from visit.');
|
||||
}
|
||||
|
||||
public function show(Request $request, Bill $bill): View
|
||||
@@ -124,6 +130,12 @@ class BillController extends Controller
|
||||
->except(['gateway'])
|
||||
->all();
|
||||
|
||||
$return = app(ConsultationReturnContext::class);
|
||||
$linked = Consultation::query()
|
||||
->where('visit_id', $bill->visit_id)
|
||||
->orderByDesc('id')
|
||||
->first();
|
||||
|
||||
return view('care.bills.show', [
|
||||
'bill' => $bill,
|
||||
'statuses' => config('care.bill_statuses'),
|
||||
@@ -135,6 +147,8 @@ class BillController extends Controller
|
||||
'gatewayConfigured' => $gatewayConfigured,
|
||||
'gatewayProvider' => $gateway?->provider,
|
||||
'gatewayLabels' => config('care.payment_gateways'),
|
||||
'returnConsultation' => $return->resolve($request, (int) $bill->patient_id)
|
||||
?? $return->resolveLinked($request, $linked),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user