Deploy Ladill Care / deploy (push) Successful in 31s
Add plan lifecycle, visit stages with chair/recovery points, primary dentition charting, imaging void, revenue reports, perio exams, lab cases, and recalls. Co-authored-by: Cursor <cursoragent@cursor.com>
60 lines
1.3 KiB
PHP
60 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\BelongsToOwner;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Support\Str;
|
|
|
|
class DentalRecall extends Model
|
|
{
|
|
use BelongsToOwner;
|
|
|
|
public const STATUS_SCHEDULED = 'scheduled';
|
|
|
|
public const STATUS_DUE = 'due';
|
|
|
|
public const STATUS_COMPLETED = 'completed';
|
|
|
|
public const STATUS_CANCELLED = 'cancelled';
|
|
|
|
protected $table = 'care_dental_recalls';
|
|
|
|
protected $fillable = [
|
|
'uuid', 'owner_ref', 'organization_id', 'patient_id',
|
|
'due_on', 'reason', 'status', 'linked_visit_id', 'notes', 'created_by',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'due_on' => 'date',
|
|
];
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::creating(function (DentalRecall $recall) {
|
|
if (! $recall->uuid) {
|
|
$recall->uuid = (string) Str::uuid();
|
|
}
|
|
});
|
|
}
|
|
|
|
public function getRouteKeyName(): string
|
|
{
|
|
return 'uuid';
|
|
}
|
|
|
|
public function patient(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Patient::class, 'patient_id');
|
|
}
|
|
|
|
public function linkedVisit(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Visit::class, 'linked_visit_id');
|
|
}
|
|
}
|