wip
This commit is contained in:
parent
60ba494319
commit
5ec37cd58e
@ -164,7 +164,7 @@ protected function getStudiesQuery(): Builder
|
||||
$q = Study::query();
|
||||
}
|
||||
|
||||
return $q->with(['readingPhysician', 'assignedPhysician', 'dicomServer']);
|
||||
return $q->with(['readingPhysician', 'dicomServer']);
|
||||
}
|
||||
|
||||
protected function applySort(Builder $query): Builder
|
||||
@ -281,7 +281,7 @@ private function applyDateFilters(Builder $query): Builder
|
||||
}
|
||||
|
||||
if (filled($this->reportDateFrom)) {
|
||||
$query = $this->applyDateFilter($query, 'reported_at', $this->reportDateFrom, $this->reportDateTo);
|
||||
$query = $this->applyDateFilter($query, 'read_at', $this->reportDateFrom, $this->reportDateTo);
|
||||
}
|
||||
|
||||
return $query;
|
||||
|
@ -231,10 +231,10 @@ private function renderCustomColumns(): array
|
||||
$columns[$col->value] = fn (Study $study) => $study->sanitizedStudyDescription();
|
||||
break;
|
||||
case WorklistColumn::AssignedPhysician:
|
||||
$columns[$col->value] = fn (Study $study) => $this->physicianColumn($study->assignedPhysician, $study->assigned_at);
|
||||
$columns[$col->value] = fn (Study $study) => $this->physicianColumn(null, $study->assigned_at);
|
||||
break;
|
||||
case WorklistColumn::ReadingPhysician:
|
||||
$columns[$col->value] = fn (Study $study) => $this->physicianColumn($study->readingPhysician, $study->reported_at);
|
||||
$columns[$col->value] = fn (Study $study) => $this->physicianColumn($study->readingPhysician, $study->read_at);
|
||||
break;
|
||||
case WorklistColumn::Series:
|
||||
$columns[$col->value] = fn (Study $study) => Blade::render(
|
||||
|
@ -130,9 +130,9 @@ public function dicomServer(): BelongsTo
|
||||
return $this->belongsTo(DicomServer::class);
|
||||
}
|
||||
|
||||
public function isAssigned(int $rad_id): bool
|
||||
public function isAssigned(User|int|null $user = null): bool
|
||||
{
|
||||
return $this->assigned_physician_id === $rad_id;
|
||||
return $this->assignedPhysicians->contains(me($user)->id);
|
||||
}
|
||||
|
||||
public function isActive(): bool
|
||||
@ -272,7 +272,7 @@ public function toArray(): array
|
||||
return array_merge(parent::toArray(), [
|
||||
'disk_size_human' => human_filesize($this->disk_size),
|
||||
'reader_name' => $this->readingPhysician?->display_name,
|
||||
'assigned_physician_name' => $this->assignedPhysician?->display_name,
|
||||
// 'assigned_physician_name' => $this->assignedPhysician?->display_name,
|
||||
'reader_photo' => $this->readingPhysician?->profile_photo_url,
|
||||
'report_status_led' => $this->getReportStatusLedAttribute(),
|
||||
'priority_icon' => $this->getPriorityIcon(),
|
||||
@ -384,11 +384,6 @@ public function isLockedBy(User|int|null $user = null): bool
|
||||
return $this->locking_physician_id === me($user)->id;
|
||||
}
|
||||
|
||||
public function isAssignedTo(User|int|null $user = null): bool
|
||||
{
|
||||
return $this->assigned_physician_id === me($user)->id;
|
||||
}
|
||||
|
||||
public function setReportStatus(ReportStatus $status, User|int|null $user = null): void
|
||||
{
|
||||
$user_id = me($user)->id;
|
||||
|
@ -13,7 +13,7 @@ enum WorklistColumn: string
|
||||
case History = 'history';
|
||||
case StudyDate = 'study_date';
|
||||
case ReceiveDate = 'received_at';
|
||||
case ReportDate = 'reported_at';
|
||||
case ReportDate = 'read_at';
|
||||
case AssignDate = 'assigned_at';
|
||||
case AuthorizeDate = 'authorized_at';
|
||||
case ArchiveDate = 'archived_at';
|
||||
|
Loading…
Reference in New Issue
Block a user