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);
|
||||
})
|
||||
->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="' . route('staff.history.edit', $study->hash) . '" class="edit btn btn-primary btn-xs editStudy">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-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-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-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>';
|
||||
|
||||
return $btn;
|
||||
|
@ -5,17 +5,20 @@
|
||||
use App\DAL\Radiologists;
|
||||
use App\Http\Controllers\HashidControllerBase;
|
||||
use App\Http\Requests\AssignPhysicianRequest;
|
||||
use App\Models\Enums\Permission;
|
||||
use App\Models\Enums\ReportStatus;
|
||||
use App\Models\Enums\UserRole;
|
||||
use App\Models\Study;
|
||||
use App\Models\User;
|
||||
use App\Services\AuditTrail\Activity;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class StudyAssignmentController extends HashidControllerBase
|
||||
{
|
||||
public function show()
|
||||
{
|
||||
abort_unless(auth()->user()->may(Permission::AssignPhysician), 403);
|
||||
$this->decodeKeys();
|
||||
$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']);
|
||||
@ -33,6 +36,7 @@ public function show()
|
||||
|
||||
public function remove()
|
||||
{
|
||||
abort_unless(auth()->user()->may(Permission::AssignPhysician), 403);
|
||||
$this->decodeKeys();
|
||||
$study = Study::with('assignedPhysician')->findOrFail($this->key);
|
||||
if ($study->assigned_physician_id !== null) {
|
||||
@ -49,6 +53,7 @@ public function remove()
|
||||
|
||||
public function save(AssignPhysicianRequest $request)
|
||||
{
|
||||
abort_unless(auth()->user()->may(Permission::AssignPhysician), 403);
|
||||
$this->decodeKeys();
|
||||
$study = Study::findOrFail($this->key);
|
||||
$rad = User::active()->findOrFail($request->input('rad_id'));
|
||||
|
@ -17,4 +17,6 @@ enum Permission: string
|
||||
case StudyNotesView = 'study_notes_view';
|
||||
case AttachmentUpload = 'attachment_upload';
|
||||
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');
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user