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>
58 lines
1.3 KiB
PHP
58 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\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Support\Str;
|
|
|
|
class DentalPerioExam extends Model
|
|
{
|
|
use BelongsToOwner;
|
|
|
|
protected $table = 'care_dental_perio_exams';
|
|
|
|
protected $fillable = [
|
|
'uuid', 'owner_ref', 'organization_id', 'patient_id', 'visit_id',
|
|
'exam_date', 'examiner', 'notes',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'exam_date' => 'date',
|
|
];
|
|
}
|
|
|
|
protected static function booted(): void
|
|
{
|
|
static::creating(function (DentalPerioExam $exam) {
|
|
if (! $exam->uuid) {
|
|
$exam->uuid = (string) Str::uuid();
|
|
}
|
|
});
|
|
}
|
|
|
|
public function getRouteKeyName(): string
|
|
{
|
|
return 'uuid';
|
|
}
|
|
|
|
public function patient(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Patient::class, 'patient_id');
|
|
}
|
|
|
|
public function visit(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Visit::class, 'visit_id');
|
|
}
|
|
|
|
public function sites(): HasMany
|
|
{
|
|
return $this->hasMany(DentalPerioSite::class, 'perio_exam_id');
|
|
}
|
|
}
|