wip
This commit is contained in:
parent
1b48d3d719
commit
7784f33fea
@ -70,9 +70,9 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
|
|||||||
return self::dtFormat($study->received_at);
|
return self::dtFormat($study->received_at);
|
||||||
})
|
})
|
||||||
->editColumn('show_study', function (Study $study) {
|
->editColumn('show_study', function (Study $study) {
|
||||||
$btn = '<a href="#" data-id="' . _h($study->id) . '" class="btn btn-outline-facebook btn-xs showStudy">Show</a>';
|
$btn = '<a href="#" data-id="' . _h($study->id) . '" class="btn btn-outline-facebook btn-xs showStudy"><i class="fa-light fa-circle-info me-1"></i>Show</a>';
|
||||||
$btn .= '<a href="' . route('staff.history.edit', $study->hash) . '" class="edit btn btn-primary btn-xs editStudy">Edit</a>';
|
$btn .= '<a href="' . route('staff.history.edit', $study->hash) . '" class="edit btn btn-outline-primary btn-xs"><i class="fa-light fa-pen-to-square me-1"></i>Edit</a>';
|
||||||
$btn .= ' <a href="#" data-id="' . _h($study->id) . '" class="btn btn-outline-dribbble btn-xs show-assign">Assign</a>';
|
$btn .= ' <a href="#" data-id="' . _h($study->id) . '" class="btn btn-outline-youtube fw-light btn-xs show-assign"><i class="fa-light fa-user-doctor me-1"></i>Assign</a>';
|
||||||
$btn .= ' <a href="#" data-id="' . _h($study->id) . '" class="btn btn-danger btn-xs deleteStudy">Delete</a>';
|
$btn .= ' <a href="#" data-id="' . _h($study->id) . '" class="btn btn-danger btn-xs deleteStudy">Delete</a>';
|
||||||
|
|
||||||
return $btn;
|
return $btn;
|
||||||
|
@ -5,17 +5,20 @@
|
|||||||
use App\DAL\Radiologists;
|
use App\DAL\Radiologists;
|
||||||
use App\Http\Controllers\HashidControllerBase;
|
use App\Http\Controllers\HashidControllerBase;
|
||||||
use App\Http\Requests\AssignPhysicianRequest;
|
use App\Http\Requests\AssignPhysicianRequest;
|
||||||
|
use App\Models\Enums\Permission;
|
||||||
use App\Models\Enums\ReportStatus;
|
use App\Models\Enums\ReportStatus;
|
||||||
use App\Models\Enums\UserRole;
|
use App\Models\Enums\UserRole;
|
||||||
use App\Models\Study;
|
use App\Models\Study;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Services\AuditTrail\Activity;
|
use App\Services\AuditTrail\Activity;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
class StudyAssignmentController extends HashidControllerBase
|
class StudyAssignmentController extends HashidControllerBase
|
||||||
{
|
{
|
||||||
public function show()
|
public function show()
|
||||||
{
|
{
|
||||||
|
abort_unless(auth()->user()->may(Permission::AssignPhysician), 403);
|
||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$study = Study::with('assignedPhysician')->findOrFail($this->key);
|
$study = Study::with('assignedPhysician')->findOrFail($this->key);
|
||||||
$rads = User::active()->role(UserRole::Radiologist)->get(['id', 'display_name', 'profile_photo_path', 'first_name', 'last_name', 'created_at']);
|
$rads = User::active()->role(UserRole::Radiologist)->get(['id', 'display_name', 'profile_photo_path', 'first_name', 'last_name', 'created_at']);
|
||||||
@ -33,6 +36,7 @@ public function show()
|
|||||||
|
|
||||||
public function remove()
|
public function remove()
|
||||||
{
|
{
|
||||||
|
abort_unless(auth()->user()->may(Permission::AssignPhysician), 403);
|
||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$study = Study::with('assignedPhysician')->findOrFail($this->key);
|
$study = Study::with('assignedPhysician')->findOrFail($this->key);
|
||||||
if ($study->assigned_physician_id !== null) {
|
if ($study->assigned_physician_id !== null) {
|
||||||
@ -49,6 +53,7 @@ public function remove()
|
|||||||
|
|
||||||
public function save(AssignPhysicianRequest $request)
|
public function save(AssignPhysicianRequest $request)
|
||||||
{
|
{
|
||||||
|
abort_unless(auth()->user()->may(Permission::AssignPhysician), 403);
|
||||||
$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'));
|
||||||
|
@ -17,4 +17,6 @@ enum Permission: string
|
|||||||
case StudyNotesView = 'study_notes_view';
|
case StudyNotesView = 'study_notes_view';
|
||||||
case AttachmentUpload = 'attachment_upload';
|
case AttachmentUpload = 'attachment_upload';
|
||||||
case AttachmentDownload = 'attachment_download';
|
case AttachmentDownload = 'attachment_download';
|
||||||
|
case AssignPhysician = 'assign_physician';
|
||||||
|
case UnassignPhysician = 'unassign_physician';
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('radiologists', static function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->foreignIdFor(User::class)->unique()->constrained()->cascadeOnDelete();
|
||||||
|
$table->text('signature_img_path')->nullable();
|
||||||
|
$table->text('signature_text')->nullable();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('radiologists');
|
||||||
|
}
|
||||||
|
};
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
@include('staff.history.partials._history', ['details' => $study->details])
|
@include('staff.history.partials._history', ['details' => $study->details])
|
||||||
|
|
||||||
@if( $study->hasMedia(\App\Models\Study::MEDIA_COLLECTION) )
|
@if ( $study->hasMedia(\App\Models\Study::MEDIA_COLLECTION) )
|
||||||
<div class="card shadow-none bg-transparent border">
|
<div class="card shadow-none bg-transparent border">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
Attachments
|
Attachments
|
||||||
|
Loading…
Reference in New Issue
Block a user