This commit is contained in:
Dr Masroor Ehsan 2025-01-11 11:49:31 +06:00
parent fed18bd6fa
commit e7c52419f7
2 changed files with 12 additions and 0 deletions

View File

@ -279,6 +279,13 @@ private function renderCustomColumns(): array
private function generateReportingButtons(Study $study): string private function generateReportingButtons(Study $study): string
{ {
if (me()->isRadiologist()) {
if (! $study->hasReports() && $study->canEditReport()) {
// fresh untouched study, can edit report: take the rad directly to the edit page
return '<a href="' . route('staff.report.create', $study->hash) . '" target="_blank" class="btn btn-sm btn-outline-light"><i class="fa-light fa-edit"></i></a>';
}
}
return $this->renderButton($study->hash, 'fa-eye', 'show-reports btn-outline', 'R'); return $this->renderButton($study->hash, 'fa-eye', 'show-reports btn-outline', 'R');
} }

View File

@ -413,6 +413,11 @@ public function canEditReport(): bool
$this->report_status <= ReportStatus::Finalized; $this->report_status <= ReportStatus::Finalized;
} }
public function hasReports(): bool
{
return $this->reports->isNotEmpty();
}
protected function casts(): array protected function casts(): array
{ {
return [ return [