diff --git a/app/DataTables/WorklistDataTable.php b/app/DataTables/WorklistDataTable.php index 1724cff..a8f3a70 100644 --- a/app/DataTables/WorklistDataTable.php +++ b/app/DataTables/WorklistDataTable.php @@ -16,11 +16,11 @@ class WorklistDataTable extends DataTable { - const DATE_FORMAT = 'DD.MM.YYYY HH:mm'; + const DATE_FORMAT = 'd.m.Y H:i'; - private static function dtFormat(Carbon|CarbonImmutable|null $dt): string + private static function dtFormat(Carbon|CarbonImmutable|null $dt): ?string { - return $dt == null ? '' : $dt->isoFormat(self::DATE_FORMAT); + return $dt?->format(self::DATE_FORMAT); } public function dataTable(QueryBuilder $query): EloquentDataTable @@ -48,6 +48,13 @@ public function dataTable(QueryBuilder $query): EloquentDataTable ->editColumn('received_at', function (Study $study) { return self::dtFormat($study->received_at); }) + ->editColumn('show_study', function (Study $study) { + $btn = 'Show'; + $btn .= ' Edit'; + $btn .= ' Delete'; + + return $btn; + }) ->editColumn('history', function (Study $study) { return sprintf(' @@ -56,7 +63,7 @@ public function dataTable(QueryBuilder $query): EloquentDataTable ', blank($study->body_part_examined) ? 'text-muted' : 'text-primary'); }) ->orderColumn('patient_name', 'patient_name $1') - ->rawColumns(['priority_icon', 'report_status_led', 'images', 'reader', 'history']) + ->rawColumns(['priority_icon', 'report_status_led', 'images', 'reader', 'history', 'show_study']) ->setRowId('id'); } @@ -97,8 +104,8 @@ public function html(): HtmlBuilder [8, 'desc'], ], ]) - ->selectStyleSingle() - ->pageLength(25) + // ->selectStyleSingle() + ->pageLength(15) ->lengthMenu([15, 25, 50, 100, 250]); } @@ -142,6 +149,12 @@ public function getColumns(): array Column::make('study_description') ->title('Study'), + Column::make('show_study')->searchable(false) + ->orderable(false) + ->addClass('text-center') + ->width('20px') + ->title(''), + Column::make('study_date')->searchable(false)->title('Scan Dt'), Column::make('reader') ->searchable(false) diff --git a/app/Http/Controllers/Staff/StudiesController.php b/app/Http/Controllers/Staff/StudiesController.php index 03f1255..7ba121e 100644 --- a/app/Http/Controllers/Staff/StudiesController.php +++ b/app/Http/Controllers/Staff/StudiesController.php @@ -2,20 +2,12 @@ namespace App\Http\Controllers\Staff; -use App\DAL\Studies\WorklistFactory; use App\Http\Controllers\HashidControllerBase; use App\Models\Study; use App\Services\AuditTrail\Activity; class StudiesController extends HashidControllerBase { - public function index() - { - $studies = WorklistFactory::getLister()->get(); - - return view('staff.studies.index', compact('studies')); - } - public function details() { $this->decodeKeys(); @@ -28,4 +20,11 @@ public function details() // return view('staff.studies.details', compact('study')); return response()->json($study); } + + public function show(Request $request) + { + $study = Study::with(['details'])->findOrFail($request->id); + + return view('staff.studies.show-details', compact('study')); + } } diff --git a/app/Http/Controllers/Staff/WorklistController.php b/app/Http/Controllers/Staff/WorklistController.php index 0bbecfe..2000f13 100644 --- a/app/Http/Controllers/Staff/WorklistController.php +++ b/app/Http/Controllers/Staff/WorklistController.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers\Staff; -use App\DAL\Studies\WorklistFactory; use App\DataTables\WorklistDataTable; use App\Http\Controllers\HashidControllerBase; @@ -12,11 +11,4 @@ public function index(WorklistDataTable $dataTable) { return $dataTable->render('staff.worklist.table'); } - - public function details($hashid) - { - $study = WorklistFactory::getViewer($hashid)->get(); - - return view('staff.worklist.details', compact('study')); - } } diff --git a/resources/views/datatables/action-button.blade.php b/resources/views/datatables/action-button.blade.php new file mode 100644 index 0000000..79e08e3 --- /dev/null +++ b/resources/views/datatables/action-button.blade.php @@ -0,0 +1,3 @@ + + {!! $slot !!} + diff --git a/resources/views/staff/studies/show-details.blade.php b/resources/views/staff/studies/show-details.blade.php new file mode 100644 index 0000000..3452428 --- /dev/null +++ b/resources/views/staff/studies/show-details.blade.php @@ -0,0 +1,7 @@ +
Patient Name: {{ $study->patient_name }}
+Study Description: {{ $study->study_description }}
+Study Date: {{ $study->study_date }}
+ +Patient Name: {{ $study->patient_name }}
+Study Description: {{ $study->study_description }}
+Study Date: {{ $study->study_date }}
+ +