UI
This commit is contained in:
parent
278f285e4b
commit
18981e8cf1
@ -52,6 +52,14 @@ public function save(AssignPhysicianRequest $request)
|
|||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$study = Study::findOrFail($this->key);
|
$study = Study::findOrFail($this->key);
|
||||||
$rad = User::active()->findOrFail($request->input('rad_id'));
|
$rad = User::active()->findOrFail($request->input('rad_id'));
|
||||||
|
if ($study->assigned_physician_id !== null) {
|
||||||
|
audit()
|
||||||
|
->did(Activity::Unassign_Physician)
|
||||||
|
->notes("Unassigned: {$study->assignedPhysician?->display_name}")
|
||||||
|
->on($study)
|
||||||
|
->log();
|
||||||
|
}
|
||||||
|
|
||||||
$study->update(['assigned_physician_id' => $rad->id, 'assigned_at' => now()]);
|
$study->update(['assigned_physician_id' => $rad->id, 'assigned_at' => now()]);
|
||||||
audit()
|
audit()
|
||||||
->did(Activity::Assign_Physician)
|
->did(Activity::Assign_Physician)
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
use App\Models\Enums\Permission;
|
use App\Models\Enums\Permission;
|
||||||
use App\Models\Study;
|
use App\Models\Study;
|
||||||
use App\Models\StudyDetails;
|
use App\Models\StudyDetails;
|
||||||
|
use App\Services\AuditTrail\Activity;
|
||||||
|
use App\Services\SessionHelper;
|
||||||
|
|
||||||
class StudyHistoryController extends HashidControllerBase
|
class StudyHistoryController extends HashidControllerBase
|
||||||
{
|
{
|
||||||
@ -22,6 +24,7 @@ public function view()
|
|||||||
|
|
||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
|
// SessionHelper::setIntendedUrl();
|
||||||
abort_unless(auth()->user()->may(Permission::StudyHistoryEdit), 403);
|
abort_unless(auth()->user()->may(Permission::StudyHistoryEdit), 403);
|
||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$details = StudyDetails::historyOnly($this->key);
|
$details = StudyDetails::historyOnly($this->key);
|
||||||
@ -39,7 +42,12 @@ public function save(StudyHistoryRequest $request)
|
|||||||
unset($payload['study_id']);
|
unset($payload['study_id']);
|
||||||
$details->update($payload);
|
$details->update($payload);
|
||||||
|
|
||||||
|
audit()
|
||||||
|
->did(Activity::Study_History_Update)
|
||||||
|
->on($this->key)
|
||||||
|
->log();
|
||||||
|
|
||||||
// return redirect()->route('staff.history.view', _h($this->key));
|
// return redirect()->route('staff.history.view', _h($this->key));
|
||||||
return redirect()->route('staff.history.view', $details->hash);
|
return SessionHelper::redirectIntended();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,14 @@
|
|||||||
|
|
||||||
use App\DataTables\WorklistDataTable;
|
use App\DataTables\WorklistDataTable;
|
||||||
use App\Http\Controllers\HashidControllerBase;
|
use App\Http\Controllers\HashidControllerBase;
|
||||||
|
use App\Services\SessionHelper;
|
||||||
|
|
||||||
class WorklistController extends HashidControllerBase
|
class WorklistController extends HashidControllerBase
|
||||||
{
|
{
|
||||||
public function index(WorklistDataTable $dataTable)
|
public function index(WorklistDataTable $dataTable)
|
||||||
{
|
{
|
||||||
|
SessionHelper::setIntendedUrl();
|
||||||
|
|
||||||
return $dataTable->render('staff.worklist.index');
|
return $dataTable->render('staff.worklist.index');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
25
app/Services/SessionHelper.php
Normal file
25
app/Services/SessionHelper.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services;
|
||||||
|
|
||||||
|
final readonly class SessionHelper
|
||||||
|
{
|
||||||
|
public static function setIntendedUrl()
|
||||||
|
{
|
||||||
|
// if (! session()->has('url.intended'))
|
||||||
|
session(['url.intended' => url()->current()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function redirectIntended()
|
||||||
|
{
|
||||||
|
$url = session('url.intended');
|
||||||
|
if (! blank($url)) {
|
||||||
|
session()->forget('url.intended');
|
||||||
|
|
||||||
|
return redirect($url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// return redirect()->route('staff.worklist.index');
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
}
|
@ -18,13 +18,15 @@
|
|||||||
|
|
||||||
@include('staff.history.partials._history', ['details' => $study->details])
|
@include('staff.history.partials._history', ['details' => $study->details])
|
||||||
|
|
||||||
<div class="card shadow-none bg-transparent border">
|
@if( $study->hasMedia(\App\Models\Study::MEDIA_COLLECTION) )
|
||||||
<div class="card-header">
|
<div class="card shadow-none bg-transparent border">
|
||||||
Attachments
|
<div class="card-header">
|
||||||
|
Attachments
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
@include('staff.history.partials._uploaded-studies-list', ['study' => $study, 'allow_delete' => false, 'table_header' => false])
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
@endif
|
||||||
@include('staff.history.partials._uploaded-studies-list', ['study' => $study, 'allow_delete' => false, 'table_header' => false])
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user