diff --git a/app/Http/Controllers/Staff/ReportController.php b/app/Http/Controllers/Staff/ReportController.php index 3d5065d..3707ed0 100644 --- a/app/Http/Controllers/Staff/ReportController.php +++ b/app/Http/Controllers/Staff/ReportController.php @@ -10,6 +10,7 @@ use App\Models\Study; use App\Models\StudyReport; use App\Services\ReportStorage; +use App\Services\Export\Exporters; class ReportController extends HashidControllerBase { @@ -73,8 +74,7 @@ public function view(string $uuid) public function download(string $uuid) { abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove, Permission::ReportDownload]), 403); - // $study = Study::with(['reports.radiologist', 'readingPhysician'])->where('accession_number', $uuid)->firstOrFail(); - $report = StudyReport::where('accession_number', $uuid)->firstOrFail(); + $report = StudyReport::with(['study', 'radiologist'])->where('accession_number', $uuid)->firstOrFail(); $path = Exporters::make($report->study, $report, ExportFormat::Word2007);