From d343d105fcd1d1a0b965f76a1b4b0eeaf81e3b11 Mon Sep 17 00:00:00 2001 From: Masroor Ehsan Date: Wed, 29 Jan 2025 15:56:33 +0600 Subject: [PATCH] filament - dicom server --- .../Resources/DicomServerResource.php | 132 ++++++++++++++++++ .../Pages/CreateDicomServer.php | 11 ++ .../Pages/EditDicomServer.php | 20 +++ .../Pages/ListDicomServers.php | 19 +++ .../Pages/ViewDicomServer.php | 19 +++ 5 files changed, 201 insertions(+) create mode 100644 app/Filament/Resources/DicomServerResource.php create mode 100644 app/Filament/Resources/DicomServerResource/Pages/CreateDicomServer.php create mode 100644 app/Filament/Resources/DicomServerResource/Pages/EditDicomServer.php create mode 100644 app/Filament/Resources/DicomServerResource/Pages/ListDicomServers.php create mode 100644 app/Filament/Resources/DicomServerResource/Pages/ViewDicomServer.php diff --git a/app/Filament/Resources/DicomServerResource.php b/app/Filament/Resources/DicomServerResource.php new file mode 100644 index 0000000..7769437 --- /dev/null +++ b/app/Filament/Resources/DicomServerResource.php @@ -0,0 +1,132 @@ +schema([ + Toggle::make('is_active') + ->required(), + TextInput::make('server_name') + ->required() + ->maxLength(255), + TextInput::make('geo_code') + ->required() + ->maxLength(2), + TextInput::make('host') + ->required() + ->maxLength(255), + TextInput::make('http_port') + ->required() + ->numeric(), + TextInput::make('dicom_port') + ->required() + ->numeric(), + TextInput::make('rest_api_endpoint') + ->required() + ->maxLength(255), + TextInput::make('ae_title') + ->maxLength(255), + TextInput::make('username') + ->maxLength(255), + TextInput::make('password') + ->password() + ->maxLength(255), + TextInput::make('wado_path') + ->maxLength(255), + TextInput::make('stone_viewer_path') + ->maxLength(255), + TextInput::make('ohif_viewer_path') + ->maxLength(255), + TextInput::make('meddream_viewer_path') + ->maxLength(255), + TextInput::make('organization_id') + ->numeric(), + TextInput::make('department_id') + ->numeric(), + ]); + } + + public static function table(Table $table): Table + { + return $table + ->columns([ + IconColumn::make('is_active') + ->label('') + ->boolean(), + TextColumn::make('server_name') + ->label('Name') + ->searchable(), + TextColumn::make('geo_code') + ->label('GEO') + ->searchable(), + TextColumn::make('host') + ->searchable(), + TextColumn::make('http_port') + ->label('WADO'), + TextColumn::make('dicom_port') + ->label('DICOM'), + TextColumn::make('rest_api_endpoint') + ->label('REST') + ->searchable(), + TextColumn::make('ae_title') + ->label('AET') + ->searchable(), + TextColumn::make('created_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + TextColumn::make('updated_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + ]) + ->filters([ + // + ]) + ->actions([ + Tables\Actions\ViewAction::make(), + Tables\Actions\EditAction::make(), + ]) + ->bulkActions([ + Tables\Actions\BulkActionGroup::make([ + Tables\Actions\DeleteBulkAction::make(), + ]), + ]); + } + + public static function getRelations(): array + { + return [ + // + ]; + } + + public static function getPages(): array + { + return [ + 'index' => Pages\ListDicomServers::route('/'), + 'create' => Pages\CreateDicomServer::route('/create'), + 'view' => Pages\ViewDicomServer::route('/{record}'), + 'edit' => Pages\EditDicomServer::route('/{record}/edit'), + ]; + } +} diff --git a/app/Filament/Resources/DicomServerResource/Pages/CreateDicomServer.php b/app/Filament/Resources/DicomServerResource/Pages/CreateDicomServer.php new file mode 100644 index 0000000..2674c65 --- /dev/null +++ b/app/Filament/Resources/DicomServerResource/Pages/CreateDicomServer.php @@ -0,0 +1,11 @@ +