Deploy Ladill Care / deploy (push) Successful in 1m39s
Branch-scoped Care devices with hashed agent tokens, patient barcode lookup/labels, and provenance-aware vitals from a minimal device agent (Pro for agent hardware; wedge free). Co-authored-by: Cursor <cursoragent@cursor.com>
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\BelongsToOwner;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class VitalSign extends Model
|
|
{
|
|
use BelongsToOwner;
|
|
|
|
protected $table = 'care_vital_signs';
|
|
|
|
public const SOURCE_MANUAL = 'manual';
|
|
|
|
public const SOURCE_DEVICE = 'device';
|
|
|
|
public const SOURCE_IMPORT = 'import';
|
|
|
|
protected $fillable = [
|
|
'owner_ref', 'consultation_id', 'bp_systolic', 'bp_diastolic', 'pulse',
|
|
'temperature', 'weight_kg', 'height_cm', 'spo2', 'respiratory_rate',
|
|
'recorded_by', 'recorded_at', 'source', 'device_id', 'raw_payload',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'temperature' => 'decimal:1',
|
|
'weight_kg' => 'decimal:2',
|
|
'height_cm' => 'decimal:1',
|
|
'recorded_at' => 'datetime',
|
|
'raw_payload' => 'array',
|
|
];
|
|
}
|
|
|
|
public function consultation(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Consultation::class, 'consultation_id');
|
|
}
|
|
|
|
public function device(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Device::class, 'device_id');
|
|
}
|
|
}
|