Files
isaaccladandCursor 0edd653187
Deploy Ladill Care / deploy (push) Failing after 36s
Ship commercial Dentistry suite with odontogram and treatment plans.
Replace placeholder clinical forms with patient-level FDI charting, multi-visit plans, procedure-to-bill linking, imaging, reports, and demo seed data.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 16:33:34 +00:00

68 lines
1.6 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 DentalProcedure extends Model
{
use BelongsToOwner;
public const STATUS_COMPLETED = 'completed';
public const STATUS_CANCELLED = 'cancelled';
protected $table = 'care_dental_procedures';
protected $fillable = [
'uuid', 'owner_ref', 'organization_id', 'patient_id', 'visit_id', 'plan_item_id',
'tooth_code', 'surfaces', 'procedure_code', 'label', 'anesthesia', 'status',
'amount_minor', 'bill_line_item_id', 'provider_ref', 'notes', 'performed_at',
];
protected function casts(): array
{
return [
'surfaces' => 'array',
'performed_at' => 'datetime',
];
}
protected static function booted(): void
{
static::creating(function (DentalProcedure $procedure) {
if (! $procedure->uuid) {
$procedure->uuid = (string) Str::uuid();
}
});
}
public function getRouteKeyName(): string
{
return 'uuid';
}
public function visit(): BelongsTo
{
return $this->belongsTo(Visit::class, 'visit_id');
}
public function patient(): BelongsTo
{
return $this->belongsTo(Patient::class, 'patient_id');
}
public function planItem(): BelongsTo
{
return $this->belongsTo(DentalPlanItem::class, 'plan_item_id');
}
public function billLineItem(): BelongsTo
{
return $this->belongsTo(BillLineItem::class, 'bill_line_item_id');
}
}