54 lines
1.8 KiB
PHP
54 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\PatientResource\Pages;
|
|
|
|
use App\Filament\Resources\PatientResource;
|
|
use Filament\Actions\Action;
|
|
use Filament\Actions\DeleteAction;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
use Filament\Support\Enums\Width;
|
|
|
|
class EditPatient extends EditRecord
|
|
{
|
|
protected static string $resource = PatientResource::class;
|
|
|
|
protected Width|string|null $maxContentWidth = Width::SevenExtraLarge;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Action::make('printPrescription')
|
|
->label(__('prescriptions.actions.print_prescription'))
|
|
->icon('heroicon-o-printer')
|
|
->color('info')
|
|
->visible(fn () => $this->getRecord()->prescriptions()->exists())
|
|
->url(fn () => route('prescription.print', $this->getRecord()->prescriptions()->latest()->first()))
|
|
->openUrlInNewTab(),
|
|
|
|
Action::make('printAdmission')
|
|
->label(__('prescriptions.actions.print_admission'))
|
|
->icon('heroicon-o-printer')
|
|
->color('warning')
|
|
->visible(fn () => $this->getRecord()->surgeryAppointment !== null)
|
|
->url(fn () => route('surgery-appointment.print.admission', $this->getRecord()))
|
|
->openUrlInNewTab(),
|
|
|
|
Action::make('printLab')
|
|
->label(__('prescriptions.actions.print_lab'))
|
|
->icon('heroicon-o-beaker')
|
|
->color('gray')
|
|
->url(fn () => route('patient.print.lab', $this->getRecord()))
|
|
->openUrlInNewTab(),
|
|
|
|
DeleteAction::make(),
|
|
];
|
|
}
|
|
|
|
protected function getFormActions(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|