wip -assign
This commit is contained in:
parent
1a2c67d852
commit
6e33729c67
@ -36,6 +36,13 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
|
|||||||
|
|
||||||
return '<img class="rounded-circle me-2" height="24px" width="24px" src="' . $study->readingPhysician->avatar() . '"></img>' . $study->readingPhysician->display_name;
|
return '<img class="rounded-circle me-2" height="24px" width="24px" src="' . $study->readingPhysician->avatar() . '"></img>' . $study->readingPhysician->display_name;
|
||||||
})
|
})
|
||||||
|
->editColumn('assigned_to', function (Study $study) {
|
||||||
|
if ($study->assignedPhysician == null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '<img class="rounded-circle me-2" height="24px" width="24px" src="' . $study->assignedPhysician->avatar() . '"></img>' . $study->assignedPhysician->display_name;
|
||||||
|
})
|
||||||
->editColumn('images', function (Study $study) {
|
->editColumn('images', function (Study $study) {
|
||||||
return $study->numInstances() . '<small class="text-muted ms-2 fw-lighter fs-xsmall">' . human_filesize($study->disk_size) . '</small>';
|
return $study->numInstances() . '<small class="text-muted ms-2 fw-lighter fs-xsmall">' . human_filesize($study->disk_size) . '</small>';
|
||||||
})
|
})
|
||||||
@ -64,7 +71,7 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
|
|||||||
', blank($study->body_part_examined) ? 'text-muted' : 'text-primary');
|
', blank($study->body_part_examined) ? 'text-muted' : 'text-primary');
|
||||||
})
|
})
|
||||||
->orderColumn('patient_name', 'patient_name $1')
|
->orderColumn('patient_name', 'patient_name $1')
|
||||||
->rawColumns(['priority_icon', 'report_status_led', 'images', 'reader', 'history', 'show_study'])
|
->rawColumns(['priority_icon', 'report_status_led', 'images', 'reader', 'assigned_to', 'history', 'show_study'])
|
||||||
->setRowId('id');
|
->setRowId('id');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,9 +164,15 @@ public function getColumns(): array
|
|||||||
->title(''),
|
->title(''),
|
||||||
|
|
||||||
Column::make('study_date')->searchable(false)->title('Scan Dt'),
|
Column::make('study_date')->searchable(false)->title('Scan Dt'),
|
||||||
|
|
||||||
|
Column::make('assigned_to')
|
||||||
|
->searchable(false)
|
||||||
|
->title('Assigned'),
|
||||||
|
|
||||||
Column::make('reader')
|
Column::make('reader')
|
||||||
->searchable(false)
|
->searchable(false)
|
||||||
->title('Read by'),
|
->title('Read by'),
|
||||||
|
|
||||||
Column::make('reported_at')->searchable(false)->title('Read At'),
|
Column::make('reported_at')->searchable(false)->title('Read At'),
|
||||||
// Column::make('body_part_examined'),
|
// Column::make('body_part_examined'),
|
||||||
Column::make('images')
|
Column::make('images')
|
||||||
|
@ -15,7 +15,7 @@ public function show()
|
|||||||
{
|
{
|
||||||
$this->decodeKeys();
|
$this->decodeKeys();
|
||||||
$study = Study::with('assignedPhysician')->findOrFail($this->key);
|
$study = Study::with('assignedPhysician')->findOrFail($this->key);
|
||||||
$rads = User::active()->role(UserRole::Radiologist)->get();
|
$rads = User::active()->role(UserRole::Radiologist)->get(['id', 'display_name', 'profile_photo_path', 'first_name', 'last_name']);
|
||||||
|
|
||||||
return view('staff.studies.assign-form', compact('study', 'rads'));
|
return view('staff.studies.assign-form', compact('study', 'rads'));
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@ public function remove()
|
|||||||
$study->update(['assigned_physician_id' => null]);
|
$study->update(['assigned_physician_id' => null]);
|
||||||
audit()
|
audit()
|
||||||
->did(Activity::Unassign_Physician)
|
->did(Activity::Unassign_Physician)
|
||||||
->notes("Previous assignment: {$study->assignedPhysician?->display_name}")
|
->notes("Unassigned: {$study->assignedPhysician?->display_name}")
|
||||||
->on($study)
|
->on($study)
|
||||||
->log();
|
->log();
|
||||||
}
|
}
|
||||||
@ -42,7 +42,11 @@ public function save(AssignPhysicianRequest $request)
|
|||||||
$study = Study::findOrFail($this->key);
|
$study = Study::findOrFail($this->key);
|
||||||
$rad = User::active()->findOrFail($request->input('rad_id'));
|
$rad = User::active()->findOrFail($request->input('rad_id'));
|
||||||
$study->update(['assigned_physician_id' => $rad->id]);
|
$study->update(['assigned_physician_id' => $rad->id]);
|
||||||
audit()->did(Activity::Assign_Physician)->on($study)->log();
|
audit()
|
||||||
|
->did(Activity::Assign_Physician)
|
||||||
|
->on($study)
|
||||||
|
->notes("Assigned: {$rad->display_name}")
|
||||||
|
->log();
|
||||||
|
|
||||||
return redirect()->route('staff.worklist.index')->with('success', "Assigned study to {$rad->display_name}");
|
return redirect()->route('staff.worklist.index')->with('success', "Assigned study to {$rad->display_name}");
|
||||||
}
|
}
|
||||||
|
@ -9,10 +9,34 @@
|
|||||||
@endisset
|
@endisset
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table table-sm">
|
<table class="table table-sm table-borderless">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Physician</th>
|
||||||
|
<th>Workload</th>
|
||||||
|
<th> </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
@foreach ($rads as $doc)
|
@foreach ($rads as $doc)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $doc->display_name }}</td>
|
<td>
|
||||||
|
<div class="d-flex justify-content-start">
|
||||||
|
<div class="avatar-wrapper">
|
||||||
|
<div class="avatar avatar-sm me-2">
|
||||||
|
<img src="{{ $doc->avatar() }}" class="rounded-circle">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex flex-column">
|
||||||
|
<span class="text-truncate fw-semibold mb-0">{{ $doc->display_name }}</span>
|
||||||
|
<small class="text-truncate">last seen</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
0 / 0
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<form action="{{ route('staff.assign.save', $study->hash) }}" class="inline" method="post">
|
<form action="{{ route('staff.assign.save', $study->hash) }}" class="inline" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
@ -22,4 +46,5 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user