diff --git a/app/DAL/Studies/WorklistBase.php b/app/DAL/Studies/WorklistBase.php index a321a71..969f15d 100644 --- a/app/DAL/Studies/WorklistBase.php +++ b/app/DAL/Studies/WorklistBase.php @@ -164,7 +164,7 @@ public function setSearchTerm(string $search): self private function getPageSize(?int $user_id = null): int { - return $this->perPage ?? $this->getPageSize($user_id); + return $this->perPage ?? user_per_page($user_id); } private function applySearch(Builder $query): Builder diff --git a/app/DAL/Studies/WorklistFactory.php b/app/DAL/Studies/WorklistFactory.php index 394e10a..42aa29e 100644 --- a/app/DAL/Studies/WorklistFactory.php +++ b/app/DAL/Studies/WorklistFactory.php @@ -14,7 +14,8 @@ public static function getLister(): IUserStudyLister { // $role = auth()->user()->roles()->first()->name; - $role = Cache::remember('user_role:'.auth()->id(), now()->addMinutes(5), fn () => auth()->user()->roles()->first()->name); + $key = sprintf('user_role:%d', auth()->id()); + $role = Cache::remember($key, now()->addMinutes(5), fn (): string => auth()->user()->roles()->first()->name); return match (UserRole::from($role)) { UserRole::Admin => new AdminWorklist, diff --git a/app/Http/Controllers/Staff/StudyViewerController.php b/app/Http/Controllers/Staff/StudyViewerController.php new file mode 100644 index 0000000..4032141 --- /dev/null +++ b/app/Http/Controllers/Staff/StudyViewerController.php @@ -0,0 +1,19 @@ +decodeKeys(); + $study = Study::findOrFail($this->key); + $url = $study->getStoneLink(); + abort_if(blank($url), 404); + + return view('staff.studies.viewer', compact('url')); + } +} diff --git a/app/Http/Controllers/Staff/WorklistController.php b/app/Http/Controllers/Staff/WorklistController.php index c5196b8..176d110 100644 --- a/app/Http/Controllers/Staff/WorklistController.php +++ b/app/Http/Controllers/Staff/WorklistController.php @@ -4,13 +4,12 @@ use App\DAL\Studies\WorklistFactory; use App\Http\Controllers\HashidControllerBase; -use App\Presenters\StudyPresenter; class WorklistController extends HashidControllerBase { public function index() { - $studies = StudyPresenter::pagination(WorklistFactory::getLister()->get()); + $studies = WorklistFactory::getLister()->get(); return view('staff.worklist.index', compact('studies')); } diff --git a/resources/views/staff/studies/viewer.blade.php b/resources/views/staff/studies/viewer.blade.php new file mode 100644 index 0000000..243413c --- /dev/null +++ b/resources/views/staff/studies/viewer.blade.php @@ -0,0 +1,7 @@ +@extends('layouts/layoutMaster') + +@section('title', 'Viewer') + +@section('content') + +@endsection diff --git a/resources/views/staff/worklist/index.blade.php b/resources/views/staff/worklist/index.blade.php new file mode 100644 index 0000000..5670deb --- /dev/null +++ b/resources/views/staff/worklist/index.blade.php @@ -0,0 +1,162 @@ +@extends('layouts/layoutMaster') + +@section('title', 'Studies List') + +@section('vendor-style') + @vite([ + 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', + 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', + 'resources/assets/vendor/libs/datatables-checkboxes-jquery/datatables.checkboxes.scss', + 'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss' + ]) +@endsection + +@section('vendor-script') + @vite([ + 'resources/assets/vendor/libs/moment/moment.js', + 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js' + ]) +@endsection + +@section('content') + + +
+
+
+
+
+
+
+

24

+

Clients

+
+
+ + + +
+
+
+
+
+
+
+

165

+

Invoices

+
+
+ + + +
+
+
+
+
+
+
+

$2.46k

+

Paid

+
+
+ + + +
+
+
+
+
+
+

$876

+

Unpaid

+
+
+ + + +
+
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + + + + + + + @foreach($studies as $study) + + + + + + + + + + + + + @endforeach + +
Accession NumberPatient IDPatient NamePatient SexModalityStudy DateReceive DateSeriesInstitute Name 
{{ $study->accession_number }} + + {{ $study->patient_id }} + + + + {{ $study->patient_name }} + + {{ $study->sexAge() }}{{ $study->study_modality }}{{ $study->study_date }}{{ $study->received_at }}{{ $study->numInstances() }}{{ $study->institution_name }} + @if ($study->allowed()['stone']) + St | + @endif + @if ($study->allowed()['ohif']) + O | + @endif + @if ($study->allowed()['ohif.mpr']) + OM | + @endif + @if ($study->allowed()['ohif.seg']) + OS | + @endif + @if ($study->allowed()['zip']) + Z | + @endif + + Reported + + @can(\App\Models\Enums\Permission::ReportCreate) + TXT + @endcan +
+
+ {!! $studies->links() !!} +
+ +
+
+@endsection diff --git a/routes/web.php b/routes/web.php index 242dca3..c20c215 100644 --- a/routes/web.php +++ b/routes/web.php @@ -3,8 +3,9 @@ use App\Http\Controllers\Guest\ViewSharedStudyController; use App\Http\Controllers\Radiologist\ReportWriteController; use App\Http\Controllers\SocialLoginController; -use App\Http\Controllers\Staff\StudiesController; use App\Http\Controllers\Staff\StudyHistoryController; +use App\Http\Controllers\Staff\StudyViewerController; +use App\Http\Controllers\Staff\WorklistController; use App\Http\Controllers\StudyMetadataController; use App\Http\Controllers\System\SyncOrthancController; use Illuminate\Support\Facades\Route; @@ -32,9 +33,13 @@ Route::get('/report-write/{id}', ReportWriteController::class)->name('report-write'); }); - Route::group(['prefix' => '/studies', 'as' => 'studies.'], function () { - Route::get('/', [StudiesController::class, 'index'])->name('index'); - Route::get('{hashid}/details', [StudiesController::class, 'details'])->name('details'); + Route::group(['prefix' => 'worklist', 'as' => 'worklist.'], function () { + Route::get('/', [WorklistController::class, 'index'])->name('index'); + Route::get('{hashid}/details', [WorklistController::class, 'details'])->name('details'); + }); + + Route::group(['prefix' => 'viewer', 'as' => 'viewer.'], function () { + Route::get('stone/{hashid}', [StudyViewerController::class, 'stone'])->name('stone'); }); Route::group(['as' => 'staff.'], function () {