This commit is contained in:
Server D3 Linksehat
2024-10-14 10:35:21 +07:00
parent 611689235b
commit 013c57d00a
86 changed files with 9199 additions and 729 deletions

View File

@@ -55,6 +55,12 @@ class Livechat extends Model
return $this->belongsTo(User::class, 'nIDUser', 'nID');
}
public function userInsurance()
{
return $this->belongsTo(UserInsurance::class, 'nIDUser', 'nIDUser');
}
public function doctor()
{
return $this->belongsTo(Dokter::class, 'nIDDokter', 'nIDUser');
@@ -74,4 +80,12 @@ class Livechat extends Model
public function summary(){
return $this->belongsTo(LivechatSummary::class, 'nID', 'nIDLivechat');
}
public function prescription(){
return $this->belongsTo(Prescription::class, 'nID', 'nIDLivechat');
}
public function rujukan(){
return $this->belongsTo(Rujukan::class, 'nID', 'nIDLivechat');
}
}

View File

@@ -52,4 +52,28 @@ class Prescription extends Model
'dTanggalResep' => 'datetime',
];
public function user()
{
return $this->belongsTo(User::class, 'nIDUser', 'nID');
}
public function items()
{
return $this->hasMany(PrescriptionItem::class, 'nIDPrescription', 'nID');
}
public function livechat(){
return $this->belongsTo(Livechat::class, 'nIDLivechat', 'nID');
}
public function order()
{
return $this->hasMany(PrescriptionItem::class, 'nIDPrescription', 'nID');
}
public function payment()
{
return $this->hasOne(PrescriptionOrder::class, 'nIDPrescription', 'nID');
}
}

View File

@@ -50,4 +50,10 @@ class PrescriptionItem extends Model
];
protected $primaryKey = 'nID';
public function prescription()
{
return $this->belongsTo(Prescription::class, 'nIDPrescription', 'nID');
}
}

View File

@@ -0,0 +1,59 @@
<?php
namespace App\Models\OLDLMS;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
class PrescriptionOrder extends Model
{
use HasFactory;
protected $fillable = [
'nIDPrescription',
'sItemCode',
'sOriginCode',
'sItemName',
'nQty',
'sSatuan',
'sSigna',
'sNote',
'nHarga',
'isRacikan',
'ParentCode',
];
// public $sStatusNames = [
// 0 => 'Menunggu Konfirmasi',
// 1 => 'Diterima',
// 2 => 'Ditolak',
// 3 => 'Selesai',
// 4 => 'Expired',
// ];
const CREATED_AT = 'dCreateOn';
const UPDATED_AT = 'dUpdateOn';
const DELETED_AT = 'dDeleteOn';
protected $connection = 'oldlms';
protected $table = 'tx_prescription_orders';
// protected $appends = [
// 'status_name',
// ];
protected $casts = [
'dTanggalResep' => 'datetime',
];
protected $primaryKey = 'nID';
public function order()
{
return $this->belongsTo(Prescription::class, 'nIDPrescription', 'nIDPrescription');
}
}

View File

@@ -0,0 +1,25 @@
<?php
namespace App\Models\OLDLMS;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Relationship extends Model
{
use HasFactory;
const CREATED_AT = 'dCreateOn';
const UPDATED_AT = 'dUpdateOn';
const DELETED_AT = 'dDeleteOn';
protected $connection = 'oldlms';
protected $primaryKey = 'nID';
protected $table = 'tm_hubungan_keluarga';
protected $fillable = [
'nID',
'sHubunganKeluarga'
];
}

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Models\OLDLMS;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
class Rujukan extends Model
{
use HasFactory;
protected $fillable = [
'nIDLivechat',
'sNoRujukan',
'nIDHealthcare',
'sDepartement',
];
// public $sStatusNames = [
// 0 => 'Menunggu Konfirmasi',
// 1 => 'Diterima',
// 2 => 'Ditolak',
// 3 => 'Selesai',
// 4 => 'Expired',
// ];
const CREATED_AT = 'dCreateOn';
const UPDATED_AT = 'dUpdateOn';
const DELETED_AT = 'dDeleteOn';
protected $connection = 'oldlms';
protected $table = 'tx_rujukan';
protected $primaryKey = 'nID';
// protected $appends = [
// 'status_name',
// ];
public function livechat(){
return $this->belongsTo(Livechat::class, 'nIDLivechat', 'nID');
}
public function healthcare(){
return $this->belongsTo(Healthcare::class, 'nIDHealthcare', 'nID');
}
}

View File

@@ -64,6 +64,11 @@ class User extends Authenticatable
return $this->hasOne(UserDetail::class, 'nIDUser', 'nID');
}
public function relation()
{
return $this->hasOne(Relationship::class, 'nID', 'nIDHubunganKeluarga');
}
public function insurances()
{
return $this->hasMany(UserInsurance::class, 'nIDUser', 'nID');