Compare commits
No commits in common. "0da8e2bc3415d73b88cffb2b33e13cabf2db32b5" and "ef908dd4bd3f1b781f28f696db4ea2234a4e30c4" have entirely different histories.
0da8e2bc34
...
ef908dd4bd
@ -18,18 +18,18 @@ enum WorkflowLevel: int
|
|||||||
case Archived = 200;
|
case Archived = 200;
|
||||||
case Cancelled = 240;
|
case Cancelled = 240;
|
||||||
|
|
||||||
public function describe(): string
|
public function description(): string
|
||||||
{
|
{
|
||||||
return match ($this) {
|
return match ($this) {
|
||||||
self::Received => 'Study Received',
|
self::Received => 'Study Received',
|
||||||
self::Unassigned => 'Unassigned study',
|
self::Unassigned => 'Unassigned',
|
||||||
self::Assigned => 'Pending read',
|
self::Assigned => 'Assigned',
|
||||||
self::Dictated => 'Dictated',
|
self::Dictated => 'Dictated',
|
||||||
self::Transcribed => 'Transcribed',
|
self::Transcribed => 'Transcribed',
|
||||||
self::Repetition => 'Repeat interpretation',
|
self::Repetition => 'Repetition',
|
||||||
self::ReadInProgress => 'Read In Progress',
|
self::ReadInProgress => 'Read In Progress',
|
||||||
self::DraftAvailable => 'Draft available',
|
self::DraftAvailable => 'Draft interpretation available',
|
||||||
self::Finalized => 'Report finalized',
|
self::Finalized => 'Repoort finalized',
|
||||||
self::UnderReview => 'Under Review',
|
self::UnderReview => 'Under Review',
|
||||||
self::Published => 'Report published',
|
self::Published => 'Report published',
|
||||||
self::Archived => 'Study archived',
|
self::Archived => 'Study archived',
|
||||||
|
@ -44,10 +44,7 @@ public function remove(AssignPhysicianRequest $request)
|
|||||||
$study->assignedPhysicians()->detach($rad->id);
|
$study->assignedPhysicians()->detach($rad->id);
|
||||||
|
|
||||||
if ($study->assignedPhysicians()->count() === 0) {
|
if ($study->assignedPhysicians()->count() === 0) {
|
||||||
$study->update([
|
$study->update(['assigned_at' => null]);
|
||||||
'workflow_level' => WorkflowLevel::Unassigned->value,
|
|
||||||
'assigned_at' => null,
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
audit()
|
audit()
|
||||||
@ -67,10 +64,7 @@ public function save(AssignPhysicianRequest $request)
|
|||||||
$rad = User::active()->findOrFail($request->input('rad_id'));
|
$rad = User::active()->findOrFail($request->input('rad_id'));
|
||||||
|
|
||||||
$study->assignedPhysicians()->attach($rad->id);
|
$study->assignedPhysicians()->attach($rad->id);
|
||||||
$study->update([
|
$study->update(['assigned_at' => now()]);
|
||||||
'workflow_level' => WorkflowLevel::Assigned->value,
|
|
||||||
'assigned_at' => now(),
|
|
||||||
]);
|
|
||||||
audit()
|
audit()
|
||||||
->did(Activity::Assign_Physician)
|
->did(Activity::Assign_Physician)
|
||||||
->on($study)
|
->on($study)
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Staff;
|
namespace App\Http\Controllers\Staff;
|
||||||
|
|
||||||
use App\Http\Controllers\HashedStudyControllerBase;
|
use App\Http\Controllers\HashidControllerBase;
|
||||||
use App\Models\Study;
|
use App\Models\Study;
|
||||||
use App\Services\AuditTrail\Activity;
|
use App\Services\AuditTrail\Activity;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class DicomViewerController extends HashedStudyControllerBase
|
class DicomViewerController extends HashidControllerBase
|
||||||
{
|
{
|
||||||
public function stone()
|
public function stone()
|
||||||
{
|
{
|
||||||
@ -22,7 +22,8 @@ public function ohif()
|
|||||||
|
|
||||||
private function loadViewer(Closure $callback)
|
private function loadViewer(Closure $callback)
|
||||||
{
|
{
|
||||||
$study = $this->getStudy();
|
$this->decodeKeys();
|
||||||
|
$study = Study::findOrFail($this->key);
|
||||||
$url = $callback($study);
|
$url = $callback($study);
|
||||||
abort_if(blank($url), 404);
|
abort_if(blank($url), 404);
|
||||||
$title = Str::limit($study->getPatientDemographic(), 40);
|
$title = Str::limit($study->getPatientDemographic(), 40);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Domain\ACL\Permission;
|
use App\Domain\ACL\Permission;
|
||||||
|
use App\Domain\Report\ReportStatus;
|
||||||
use App\Domain\Study\Priority;
|
use App\Domain\Study\Priority;
|
||||||
use App\Domain\Study\WorkflowLevel;
|
use App\Domain\Study\WorkflowLevel;
|
||||||
use App\Models\Traits\HasDepartment;
|
use App\Models\Traits\HasDepartment;
|
||||||
@ -176,26 +177,25 @@ public function isArchived(): bool
|
|||||||
|
|
||||||
public function getWorkflowLevelLedAttribute(): string
|
public function getWorkflowLevelLedAttribute(): string
|
||||||
{
|
{
|
||||||
|
// todo: implement
|
||||||
|
$color = match ($this->workflow_level) {
|
||||||
|
WorkflowLevel::Unassigned => 'bg-white',
|
||||||
|
// ReportStatus::Opened => 'bg-secondary',
|
||||||
|
WorkflowLevel::DraftAvailable => 'bg-info',
|
||||||
|
WorkflowLevel::Finalized => 'bg-primary',
|
||||||
|
WorkflowLevel::Published => 'bg-success',
|
||||||
|
default => 'bg-light',
|
||||||
|
};
|
||||||
|
// <i class="fa-solid fa-spinner"></i>
|
||||||
$icon = match ($this->workflow_level) {
|
$icon = match ($this->workflow_level) {
|
||||||
WorkflowLevel::Received => 'download-2-line',
|
WorkflowLevel::Unassigned => 'spinner text-muted',
|
||||||
WorkflowLevel::Unassigned => 'checkbox-indeterminate-line',
|
WorkflowLevel::DraftAvailable => 'pen-to-square',
|
||||||
WorkflowLevel::Assigned => 'hourglass-2-line',
|
WorkflowLevel::Finalized => 'badge-check',
|
||||||
WorkflowLevel::Dictated => 'speak-line',
|
WorkflowLevel::Published => 'shield-check',
|
||||||
WorkflowLevel::Transcribed => 'message-2-line',
|
default => 'spinner text-muted',
|
||||||
WorkflowLevel::Repetition => 'repeat-line',
|
|
||||||
WorkflowLevel::ReadInProgress => 'battery-charge-line',
|
|
||||||
WorkflowLevel::DraftAvailable => 'draft-line',
|
|
||||||
WorkflowLevel::Finalized => 'folder-chart-line',
|
|
||||||
WorkflowLevel::UnderReview => 'eye-line',
|
|
||||||
WorkflowLevel::Published => 'graduation-cap-line',
|
|
||||||
WorkflowLevel::Archived => 'archive-line',
|
|
||||||
WorkflowLevel::Cancelled => 'close-circle-line',
|
|
||||||
default => 'cog-6-tooth',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$descr = $this->workflow_level->describe();
|
return sprintf('<span class="badge badge-center rounded-pill %s"><i class="fa-solid fa-%s"></i></span>', $color, $icon);
|
||||||
|
|
||||||
return sprintf('<span class="text-gray" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="%s" title="%s"><i class="ri-%s"></i></span>', $descr, $descr, $icon);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getArchiveLink(): ?string
|
public function getArchiveLink(): ?string
|
||||||
@ -370,14 +370,14 @@ public function isUnlocked(): bool
|
|||||||
return $this->locked_at === null;
|
return $this->locked_at === null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function lockStudy(User|int|null $user = null, ?WorkflowLevel $level = null): void
|
public function lockStudy(User|int|null $user = null, ?WorkflowLevel $status = null): void
|
||||||
{
|
{
|
||||||
$params = [
|
$params = [
|
||||||
'locking_physician_id' => me($user)->id,
|
'locking_physician_id' => me($user)->id,
|
||||||
'locked_at' => now(),
|
'locked_at' => now(),
|
||||||
];
|
];
|
||||||
if ($level !== null) {
|
if ($status) {
|
||||||
$params['workflow_level'] = $level->value;
|
$params['workflow_level'] = $status->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->update($params);
|
$this->update($params);
|
||||||
|
@ -112,7 +112,7 @@ public function check(): ?View
|
|||||||
public function lockStudyIfRequired(): void
|
public function lockStudyIfRequired(): void
|
||||||
{
|
{
|
||||||
if ($this->study->isUnlocked()) {
|
if ($this->study->isUnlocked()) {
|
||||||
$this->study->lockStudy(level: WorkflowLevel::ReadInProgress);
|
$this->study->lockStudy();
|
||||||
audit()
|
audit()
|
||||||
->on($this->study)
|
->on($this->study)
|
||||||
->did(Activity::Study_Lock)
|
->did(Activity::Study_Lock)
|
||||||
|
@ -88,7 +88,7 @@
|
|||||||
|
|
||||||
<label class="form-check form-check-danger mt-4">
|
<label class="form-check form-check-danger mt-4">
|
||||||
<input name="cancel_read" type="checkbox" class="form-check-input"/>
|
<input name="cancel_read" type="checkbox" class="form-check-input"/>
|
||||||
<span class="form-check-label">No interpretation required</span>
|
<span class="form-check-label">Cancel interpretation by radiologist</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user