This commit is contained in:
Dr Masroor Ehsan 2025-01-11 16:20:30 +06:00
parent 47ffa9303b
commit 92545ac719
3 changed files with 17 additions and 2 deletions

View File

@ -60,6 +60,16 @@ public function create()
return view('staff.reports.create', compact('study', 'report'));
}
public function edit(string $uuid)
{
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove]), 403);
$report = StudyReport::with(['study', 'radiologist'])->where('accession_number', $uuid)->firstOrFail();
$study = $report->study;
$title = 'View Report';
return view('staff.reports.create', compact('study', 'report'));
}
public function view(string $uuid)
{
abort_unless(me()->may([Permission::ReportEdit, Permission::ReportDictate, Permission::ReportApprove, Permission::ReportDownload]), 403);

View File

@ -19,13 +19,17 @@
href="{{ $report->pdfDownloadUrl() }}">
<img class="me-1" src="{{ asset('imgs/pdf.png') }}" alt="PDF download">pdf
</a>
<a class="btn btn-reddit btn-xs me-1 fs-xsmall fw-ligth" target="_blank"
<a class="btn btn-reddit btn-xs me-1 fs-xsmall fw-light" target="_blank"
href="{{ $report->htmlDownloadUrl() }}">
<img class="me-1" src="{{ asset('imgs/html.png') }}" alt="HTML download">htm
</a>
@else
@if ($report->canEdit())
edit_button
<a class="btn btn-reddit btn-xs me-1 fs-xsmall fw-light" target="_blank"
href="{{ route('staff.report.edit', $report->accession_number) }}">
Edit
</a>
@endif
@if ($report->canRemove())
remove_button

View File

@ -87,6 +87,7 @@
Route::group(['prefix' => 'report', 'as' => 'report.'], function () {
Route::get('popup', [ReportController::class, 'popup'])->name('popup');
Route::get('view/{uuid}', [ReportController::class, 'view'])->name('view');
Route::get('edit/{uuid}', [ReportController::class, 'edit'])->name('edit');
Route::get('create/{hashid}', [ReportController::class, 'create'])->name('create');
Route::post('save', [ReportController::class, 'save'])->name('save');
Route::get('download/{uuid}/{format}', ReportDownloadController::class)->name('download');