enhancements
This commit is contained in:
parent
db4a6901a4
commit
0bed01ff68
@ -10,7 +10,6 @@
|
|||||||
use App\Http\Requests\AssignPhysicianRequest;
|
use App\Http\Requests\AssignPhysicianRequest;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Services\AuditTrail\Activity;
|
use App\Services\AuditTrail\Activity;
|
||||||
use Carbon\Carbon;
|
|
||||||
|
|
||||||
class AssignmentController extends HashedStudyControllerBase
|
class AssignmentController extends HashedStudyControllerBase
|
||||||
{
|
{
|
||||||
@ -18,13 +17,17 @@ public function show()
|
|||||||
{
|
{
|
||||||
abort_unless(me()->may(Permission::AssignRadiologist), 403);
|
abort_unless(me()->may(Permission::AssignRadiologist), 403);
|
||||||
$study = $this->getStudy('assignedPhysicians');
|
$study = $this->getStudy('assignedPhysicians');
|
||||||
$rads = User::active()->role(Role::Radiologist)->get(['id', 'display_name', 'profile_photo_path', 'first_name', 'last_name', 'created_at']);
|
$rads = User::active()
|
||||||
|
->role(Role::Radiologist)
|
||||||
|
->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, ReportStatus::Finalized->value);
|
||||||
foreach ($stats as $rad) {
|
foreach ($stats as $rad) {
|
||||||
$found = $rads->where('id', $rad->id)->first();
|
$found = $rads->where('id', $rad->id)->first();
|
||||||
if ($found) {
|
if ($found) {
|
||||||
$found->info['workload'] = $rad->workload;
|
$found->info['workload'] = $rad->workload;
|
||||||
$found->info['last_seen'] = ($rad->last_seen ?? Carbon::now()->addHours(-random_int(1, 36)))->diffForHumans();
|
$found->info['last_seen'] = $rad->last_seen?->diffForHumans() ?? '-';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user