feat: tr registration
This commit is contained in:
parent
db4c0b86de
commit
786ccc8254
@ -32,16 +32,16 @@ class TrRegistrasiResource extends Resource
|
|||||||
Forms\Components\TextInput::make('nomor_kartu_asuransi')
|
Forms\Components\TextInput::make('nomor_kartu_asuransi')
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\Select::make('mr_pasien')
|
Forms\Components\Select::make('mr_pasien')
|
||||||
->relationship('mr_pasien', 'nama_pasien')
|
->relationship('pasien', 'nama')
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\Select::make('id_asuransi')
|
Forms\Components\Select::make('id_asuransi')
|
||||||
->relationship('id_asuransi', 'nama_asuransi')
|
->relationship('asuransi', 'nama_asuransi')
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\Select::make('id_pegawai')
|
Forms\Components\Select::make('id_pegawai')
|
||||||
->relationship('id_pegawai', 'nama_pegawai')
|
->relationship('pegawai', 'nama_pegawai')
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\Select::make('id_ruang_pelayanan')
|
Forms\Components\Select::make('id_ruang_pelayanan')
|
||||||
->relationship('id_ruang_pelayanan', 'nama_ruang_pelayanan')
|
->relationship('ruangPelayanan', 'nama_ruang_pelayanan')
|
||||||
->required(),
|
->required(),
|
||||||
|
|
||||||
]);
|
]);
|
||||||
@ -55,10 +55,10 @@ class TrRegistrasiResource extends Resource
|
|||||||
->columns([
|
->columns([
|
||||||
TextColumn::make('id_registrasi')->label('ID Registrasi'),
|
TextColumn::make('id_registrasi')->label('ID Registrasi'),
|
||||||
TextColumn::make('tgl_registrasi')->label('Tanggal Registrasi'),
|
TextColumn::make('tgl_registrasi')->label('Tanggal Registrasi'),
|
||||||
TextColumn::make('mr_pasien')->label('Pasien'),
|
TextColumn::make('pasien.nama')->label('Pasien'),
|
||||||
TextColumn::make('id_asuransi')->label('Asuransi'),
|
TextColumn::make('asuransi.nama_asuransi')->label('Asuransi'),
|
||||||
TextColumn::make('id_pegawai')->label('Pegawai'),
|
TextColumn::make('pegawai.nama_pegawai')->label('Pegawai'),
|
||||||
TextColumn::make('id_ruang_pelayanan')->label('Ruang Pelayanan'),
|
TextColumn::make('ruangPelayanan.nama_ruang_pelayanan')->label('Ruang Pelayanan'),
|
||||||
TextColumn::make('created_at')->label('Tanggal Dibuat'),
|
TextColumn::make('created_at')->label('Tanggal Dibuat'),
|
||||||
// TextColumn::make('updated_at')->label('Tanggal Diubah'),
|
// TextColumn::make('updated_at')->label('Tanggal Diubah'),
|
||||||
])
|
])
|
||||||
|
|||||||
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\TrRegistrasiResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\TrRegistrasiResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateTrRegistrasi extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = TrRegistrasiResource::class;
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\TrRegistrasiResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\TrRegistrasiResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditTrRegistrasi extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = TrRegistrasiResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\ViewAction::make(),
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\TrRegistrasiResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\TrRegistrasiResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListTrRegistrasis extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = TrRegistrasiResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make()
|
||||||
|
->label('Tambah Registrasi')
|
||||||
|
->icon('heroicon-o-plus'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\TrRegistrasiResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Resources\TrRegistrasiResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ViewRecord;
|
||||||
|
|
||||||
|
class ViewTrRegistrasi extends ViewRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = TrRegistrasiResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\EditAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -9,4 +9,29 @@ class TrRegistrasi extends Model
|
|||||||
protected $table = 'tr_registrasi';
|
protected $table = 'tr_registrasi';
|
||||||
protected $primaryKey = 'id_registrasi';
|
protected $primaryKey = 'id_registrasi';
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
|
public function pasien()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(MsPasien::class, 'mr_pasien', 'mr_pasien');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function asuransi()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(MsAsuransi::class, 'id_asuransi', 'id_asuransi');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function pegawai()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(MsPegawai::class, 'id_pegawai', 'id_pegawai');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function ruangPelayanan()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(MsRuangPelayanan::class, 'id_ruang_pelayanan', 'id_ruang_pelayanan');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function tindakan()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(MsTindakan::class, 'id_tindakan', 'id_tindakan');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,6 +28,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
PegawaiSeeder::class,
|
PegawaiSeeder::class,
|
||||||
RuangPelayananSeeder::class,
|
RuangPelayananSeeder::class,
|
||||||
TindakanSeeder::class,
|
TindakanSeeder::class,
|
||||||
|
RegisterSeeder::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
33
database/seeders/RegisterSeeder.php
Normal file
33
database/seeders/RegisterSeeder.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use App\Models\MsPasien;
|
||||||
|
use App\Models\MsAsuransi;
|
||||||
|
use App\Models\MsPegawai;
|
||||||
|
use App\Models\MsRuangPelayanan;
|
||||||
|
use App\Models\TrRegistrasi;
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class RegisterSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$faker = \Faker\Factory::create();
|
||||||
|
|
||||||
|
for ($i = 0; $i < 10; $i++) {
|
||||||
|
TrRegistrasi::create([
|
||||||
|
'tgl_registrasi' => $faker->date(),
|
||||||
|
'mr_pasien' => MsPasien::all()->random()->mr_pasien,
|
||||||
|
'id_asuransi' => MsAsuransi::all()->random()->id_asuransi,
|
||||||
|
'id_pegawai' => MsPegawai::all()->random()->id_pegawai,
|
||||||
|
'id_ruang_pelayanan' => MsRuangPelayanan::all()->random()->id_ruang_pelayanan,
|
||||||
|
'nomor_kartu_asuransi' => $faker->randomNumber(5),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user