From ef170b5357df54c6a16a4fb91af4c852dc1655ad Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Wed, 29 Jan 2025 21:20:42 +0600 Subject: [PATCH] workflow_level --- app/DAL/Radiologists.php | 6 +++--- app/Http/Controllers/Staff/AssignmentController.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/DAL/Radiologists.php b/app/DAL/Radiologists.php index 32d070e..9d938c0 100644 --- a/app/DAL/Radiologists.php +++ b/app/DAL/Radiologists.php @@ -8,7 +8,7 @@ final readonly class Radiologists { - public static function worklist_stats(int $days, int $report_status) + public static function worklist_stats(int $days, int $workflow_level) { $sql = <<<'SQL' SELECT @@ -29,7 +29,7 @@ public static function worklist_stats(int $days, int $report_status) WHERE --st.received_at :: DATE >= NOW() - INTERVAL '3 DAY' st.received_at::DATE >= NOW() - INTERVAL '%d DAY' - AND st.report_status < %d + AND st.workflow_level < %d AND st.read_at IS NULL GROUP BY sa.user_id) AS cte ON cte.user_id = users."id" @@ -43,7 +43,7 @@ public static function worklist_stats(int $days, int $report_status) users.display_name SQL; - $rows = DB::select(sprintf($sql, $days, $report_status, Role::Radiologist)); + $rows = DB::select(sprintf($sql, $days, $workflow_level, Role::Radiologist)); foreach ($rows as $row) { $row->last_seen = UserService::getLastSeen((int) $row->id); } diff --git a/app/Http/Controllers/Staff/AssignmentController.php b/app/Http/Controllers/Staff/AssignmentController.php index be9a424..478aef8 100644 --- a/app/Http/Controllers/Staff/AssignmentController.php +++ b/app/Http/Controllers/Staff/AssignmentController.php @@ -5,7 +5,7 @@ use App\DAL\Radiologists; use App\Domain\ACL\Permission; use App\Domain\ACL\Role; -use App\Domain\Report\ReportStatus; +use App\Domain\Study\WorkflowLevel; use App\Http\Controllers\HashedStudyControllerBase; use App\Http\Requests\AssignPhysicianRequest; use App\Models\User; @@ -22,7 +22,7 @@ public function show() ->get(['id', 'display_name', 'profile_photo_path', 'first_name', 'last_name', 'created_at']) ->each(fn ($rad) => $rad->info = ['workload' => '', 'last_seen' => '']); - $stats = Radiologists::worklist_stats(3, ReportStatus::Finalized->value); + $stats = Radiologists::worklist_stats(3, WorkflowLevel::Finalized->value); foreach ($stats as $rad) { $found = $rads->where('id', $rad->id)->first(); if ($found) {