This commit is contained in:
Dr Masroor Ehsan 2025-01-10 13:11:16 +06:00
parent 6d8ac941dd
commit bed8dbf12a

View File

@ -10,6 +10,7 @@
use App\Models\Study; use App\Models\Study;
use App\Models\StudyReport; use App\Models\StudyReport;
use App\Services\ReportStorage; use App\Services\ReportStorage;
use App\Services\Export\Exporters;
class ReportController extends HashidControllerBase class ReportController extends HashidControllerBase
{ {
@ -73,8 +74,7 @@ public function view(string $uuid)
public function download(string $uuid) public function download(string $uuid)
{ {
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove, Permission::ReportDownload]), 403); 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::with(['study', 'radiologist'])->where('accession_number', $uuid)->firstOrFail();
$report = StudyReport::where('accession_number', $uuid)->firstOrFail();
$path = Exporters::make($report->study, $report, ExportFormat::Word2007); $path = Exporters::make($report->study, $report, ExportFormat::Word2007);