feat: add lab tests, patient file management, and prescription improvements
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Filament\Support\Enums\Width;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class EditPrescription extends EditRecord
|
||||
{
|
||||
@@ -16,13 +17,31 @@ class EditPrescription extends EditRecord
|
||||
|
||||
protected Width|string|null $maxContentWidth = Width::SevenExtraLarge;
|
||||
|
||||
protected function mutateFormDataBeforeFill(array $data): array
|
||||
{
|
||||
$data['medication_order'] = $data['medication_ids'] ?? [];
|
||||
$data['lab_test_order'] = $data['lab_test_ids'] ?? [];
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function mutateFormDataBeforeSave(array $data): array
|
||||
{
|
||||
$data['doctor'] = auth()->user()?->name;
|
||||
$data['issue_datetime'] = now();
|
||||
$data['medication_ids'] = $data['medication_order'] ?? $data['medication_ids'] ?? [];
|
||||
$data['lab_test_ids'] = $data['lab_test_order'] ?? $data['lab_test_ids'] ?? [];
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function getRedirectUrl(): string
|
||||
{
|
||||
$return = request()->query('return');
|
||||
if ($return && str_starts_with($return, url('/'))) {
|
||||
return $return;
|
||||
}
|
||||
return static::getResource()::getUrl('index');
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user