update
This commit is contained in:
@@ -23,7 +23,10 @@ class Corporate extends Model
|
||||
'help_text',
|
||||
'active',
|
||||
'linking_rules',
|
||||
'automatic_linking'
|
||||
'automatic_linking',
|
||||
'phone',
|
||||
'phone_alarm_canter',
|
||||
'description_information',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
|
||||
@@ -28,6 +28,7 @@ class Drug extends Model
|
||||
'status',
|
||||
'price',
|
||||
'active',
|
||||
'unit'
|
||||
];
|
||||
|
||||
public function categories()
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,4 +50,10 @@ class PrescriptionItem extends Model
|
||||
];
|
||||
|
||||
protected $primaryKey = 'nID';
|
||||
|
||||
public function prescription()
|
||||
{
|
||||
return $this->belongsTo(Prescription::class, 'nIDPrescription', 'nID');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
59
app/Models/OLDLMS/PrescriptionOrder.php
Executable file
59
app/Models/OLDLMS/PrescriptionOrder.php
Executable 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');
|
||||
}
|
||||
|
||||
}
|
||||
25
app/Models/OLDLMS/Relationship.php
Executable file
25
app/Models/OLDLMS/Relationship.php
Executable 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'
|
||||
];
|
||||
}
|
||||
52
app/Models/OLDLMS/Rujukan.php
Normal file
52
app/Models/OLDLMS/Rujukan.php
Normal 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');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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');
|
||||
|
||||
@@ -19,6 +19,8 @@ class Organization extends Model
|
||||
'part_of',
|
||||
'main_address_id',
|
||||
'corporate_id_partner',
|
||||
'phone',
|
||||
'email',
|
||||
];
|
||||
|
||||
// public $with = [
|
||||
|
||||
11
app/Models/PrescriptionOrder.php
Normal file
11
app/Models/PrescriptionOrder.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PrescriptionOrder extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
}
|
||||
Reference in New Issue
Block a user