Merge branch 'feature/daily-monitoring' into staging

This commit is contained in:
korospace
2023-10-27 15:30:08 +07:00
20 changed files with 1542 additions and 10 deletions

View File

@@ -0,0 +1,59 @@
<?php
namespace App\Models;
use DB;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ClaimDailyMonitoring extends Model
{
use HasFactory;
protected $table = "claim_daily_monitoring";
protected $fillable = [
'claim_id',
'subject',
'body_temperature',
'respiration_rate',
'sistole',
'diastole',
'analysis',
'complaints'
];
protected $appends = ['medical_plan'];
public function getBodyTemperatureAttribute()
{
return round($this->attributes['body_temperature'], 0);
}
public function getSistoleAttribute()
{
return round($this->attributes['sistole'], 0);
}
public function getDiastoleAttribute()
{
return round($this->attributes['diastole'], 0);
}
public function getRespirationRateAttribute()
{
return round($this->attributes['respiration_rate'], 0);
}
public function getMedicalPlanAttribute()
{
$arr_medical_plan = [];
$medical_plan = DB::table('medical_plan')->where('claim_daily_monitoring_id','=',$this->attributes['id'])->get();
foreach ($medical_plan as $row) {
$arr_medical_plan[] = $row->plan;
}
return $arr_medical_plan;
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class MedicalPlan extends Model
{
use HasFactory;
protected $table = "medical_plan";
protected $fillable = [
'claim_daily_monitoring_id',
'plan'
];
}