71 lines
1.9 KiB
PHP
71 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\HasOne;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class MsHealthcareService extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
"name",
|
|
"code",
|
|
"icon",
|
|
"active",
|
|
];
|
|
|
|
/**
|
|
* Get the user associated with the healthcare_service
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
*/
|
|
public function msHealthcareType(): HasOne
|
|
{
|
|
return $this->hasOne(healthcare_type::class, 'foreign_key', 'local_key');
|
|
}
|
|
|
|
/**
|
|
* Get the user associated with the healthcare_service
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
|
*/
|
|
public function refServiceType(): HasOne
|
|
{
|
|
return $this->hasOne(RefServiceType::class, 'foreign_key', 'local_key');
|
|
}
|
|
|
|
/**
|
|
* Get the user that owns the HealthcareService
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function doctorHealthcareService(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DoctorHealthcareService::class, 'foreign_key', 'other_key');
|
|
}
|
|
|
|
public function healthcareServiceSchedule(): BelongsTo
|
|
{
|
|
return $this->belongsTo(HealthcareServiceSchedule::class, 'foreign_key', 'other_key');
|
|
}
|
|
|
|
public function healthcareServiceShift(): BelongsTo
|
|
{
|
|
return $this->belongsTo(HealthcareServiceShift::class, 'foreign_key', 'other_key');
|
|
}
|
|
|
|
public function healthcareServiceVisitType(): BelongsTo
|
|
{
|
|
return $this->belongsTo(HealthcareServiceVisitType::class, 'foreign_key', 'other_key');
|
|
}
|
|
|
|
public function healthcareServicePaymentType(): BelongsTo
|
|
{
|
|
return $this->belongsTo(HealthcareServicePaymentType::class, 'foreign_key', 'other_key');
|
|
}
|
|
}
|