From e7c52419f7a44020c98ff6503c6a7e6e9c356476 Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Sat, 11 Jan 2025 11:49:31 +0600 Subject: [PATCH] minor UI --- app/DataTables/WorklistDataTable.php | 7 +++++++ app/Models/Study.php | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/app/DataTables/WorklistDataTable.php b/app/DataTables/WorklistDataTable.php index 62e0c87..1c2ba6f 100644 --- a/app/DataTables/WorklistDataTable.php +++ b/app/DataTables/WorklistDataTable.php @@ -279,6 +279,13 @@ private function renderCustomColumns(): array 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 ''; + } + } + return $this->renderButton($study->hash, 'fa-eye', 'show-reports btn-outline', 'R'); } diff --git a/app/Models/Study.php b/app/Models/Study.php index 6db6545..ce8da6c 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -413,6 +413,11 @@ public function canEditReport(): bool $this->report_status <= ReportStatus::Finalized; } + public function hasReports(): bool + { + return $this->reports->isNotEmpty(); + } + protected function casts(): array { return [