diff --git a/app/Models/Study.php b/app/Models/Study.php index ab1c49d..a50a9eb 100644 --- a/app/Models/Study.php +++ b/app/Models/Study.php @@ -371,21 +371,6 @@ public function isAssignedTo(User|int|null $user = null): bool return $this->assigned_physician_id === me($user)->id; } - protected function casts(): array - { - return [ - 'is_archived' => 'boolean', - 'study_status' => StudyLevelStatus::class, - 'report_status' => ReportStatus::class, - 'priority' => Priority::class, - 'received_at' => 'immutable_datetime', - 'reported_at' => 'immutable_datetime', - 'assigned_at' => 'immutable_datetime', - 'study_date' => 'immutable_datetime', - 'patient_birthdate' => 'immutable_date', - ]; - } - public function setReportStatus(ReportStatus $status, User|int|null $user = null): void { $user_id = me($user)->id; @@ -409,4 +394,19 @@ public function setReportStatus(ReportStatus $status, User|int|null $user = null $this->update($params); } + + protected function casts(): array + { + return [ + 'is_archived' => 'boolean', + 'study_status' => StudyLevelStatus::class, + 'report_status' => ReportStatus::class, + 'priority' => Priority::class, + 'received_at' => 'immutable_datetime', + 'reported_at' => 'immutable_datetime', + 'assigned_at' => 'immutable_datetime', + 'study_date' => 'immutable_datetime', + 'patient_birthdate' => 'immutable_date', + ]; + } } diff --git a/app/Models/StudyReport.php b/app/Models/StudyReport.php index 6c99d2c..44eeb68 100644 --- a/app/Models/StudyReport.php +++ b/app/Models/StudyReport.php @@ -46,6 +46,16 @@ public function setStatus(ReportStatus $status, User|int|null $user = null): voi $this->update($params); } + public function downloadUrl(): string + { + return route('staff.report.download', $this->accession_number); + } + + public function viewUrl(): string + { + return route('staff.report.view', $this->accession_number); + } + /** * @return array */ @@ -56,14 +66,4 @@ protected function casts(): array 'content' => Compressed::class, ]; } - - public function downloadUrl(): string - { - return route('staff.report.download', $this->accession_number); - } - - public function viewUrl(): string - { - return route('staff.report.view', $this->accession_number); - } } diff --git a/resources/views/staff/reports/popup.blade.php b/resources/views/staff/reports/popup.blade.php index 5f329de..be93f31 100644 --- a/resources/views/staff/reports/popup.blade.php +++ b/resources/views/staff/reports/popup.blade.php @@ -1,5 +1,5 @@ - @foreach($reports as $report) + @foreach ($reports as $report)
{{ $report->created_at }} {{ $report->report_status->name }}