57 lines
1.3 KiB
PHP
57 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class Registrasi extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'registrasi';
|
|
|
|
protected $fillable = [
|
|
'created_at',
|
|
'created_by',
|
|
'updated_at',
|
|
'updated_by',
|
|
|
|
'code',
|
|
'tgl_registrasi',
|
|
'id_pasien',
|
|
'id_asuransi',
|
|
'no_asuransi',
|
|
'id_pegawai',
|
|
'id_ruang_pelayanan',
|
|
'status_tindakan',
|
|
];
|
|
|
|
public function pasien() : BelongsTo
|
|
{
|
|
return $this->belongsTo(Pasien::class, 'id_pasien', 'id');
|
|
}
|
|
|
|
public function asuransi() : BelongsTo
|
|
{
|
|
return $this->belongsTo(Asuransi::class, 'id_asuransi', 'id');
|
|
}
|
|
|
|
public function pegawai() : BelongsTo
|
|
{
|
|
return $this->belongsTo(Pegawai::class, 'id_pegawai', 'id');
|
|
}
|
|
|
|
public function ruangPelayanan() : BelongsTo
|
|
{
|
|
return $this->belongsTo(RuangPelayanan::class, 'id_ruang_pelayanan', 'id');
|
|
}
|
|
|
|
public function transaksi() : HasMany
|
|
{
|
|
return $this->hasMany(Transaksi::class, 'id_registrasi', 'id');
|
|
}
|
|
}
|