37 lines
839 B
PHP
37 lines
839 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class DepartmentPatientOperation extends Model
|
|
{
|
|
protected $primaryKey = 'department_patient_operation_id';
|
|
|
|
protected $fillable = [
|
|
'rf_department_patient_id',
|
|
'rf_kl_service_medical_id',
|
|
'service_code',
|
|
'service_name',
|
|
'urgency',
|
|
'started_at',
|
|
'ended_at',
|
|
'created_by',
|
|
];
|
|
|
|
protected $casts = [
|
|
'started_at' => 'datetime',
|
|
'ended_at' => 'datetime',
|
|
];
|
|
|
|
public function patient()
|
|
{
|
|
return $this->belongsTo(DepartmentPatient::class, 'rf_department_patient_id', 'department_patient_id');
|
|
}
|
|
|
|
public function serviceMedical()
|
|
{
|
|
return $this->belongsTo(MisServiceMedical::class, 'rf_kl_service_medical_id', 'ServiceMedicalID');
|
|
}
|
|
}
|