Complete Dentistry commercial suite with PMS depth.
Deploy Ladill Care / deploy (push) Successful in 31s
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>
This commit is contained in:
@@ -16,7 +16,7 @@ class DentalChart extends Model
|
||||
|
||||
protected $fillable = [
|
||||
'uuid', 'owner_ref', 'organization_id', 'patient_id',
|
||||
'notation', 'charted_at', 'charted_by',
|
||||
'notation', 'dentition', 'charted_at', 'charted_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
|
||||
@@ -5,11 +5,12 @@ namespace App\Models;
|
||||
use App\Models\Concerns\BelongsToOwner;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DentalImage extends Model
|
||||
{
|
||||
use BelongsToOwner;
|
||||
use BelongsToOwner, SoftDeletes;
|
||||
|
||||
public const MODALITY_PA = 'pa';
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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 DentalLabCase extends Model
|
||||
{
|
||||
use BelongsToOwner;
|
||||
|
||||
public const STATUS_DRAFT = 'draft';
|
||||
|
||||
public const STATUS_ORDERED = 'ordered';
|
||||
|
||||
public const STATUS_SENT = 'sent';
|
||||
|
||||
public const STATUS_RECEIVED = 'received';
|
||||
|
||||
public const STATUS_FITTED = 'fitted';
|
||||
|
||||
public const STATUS_CANCELLED = 'cancelled';
|
||||
|
||||
protected $table = 'care_dental_lab_cases';
|
||||
|
||||
protected $fillable = [
|
||||
'uuid', 'owner_ref', 'organization_id', 'patient_id', 'visit_id', 'plan_item_id',
|
||||
'tooth_codes', 'case_type', 'lab_name', 'status',
|
||||
'ordered_at', 'due_at', 'received_at', 'notes', 'created_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'tooth_codes' => 'array',
|
||||
'ordered_at' => 'datetime',
|
||||
'due_at' => 'date',
|
||||
'received_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::creating(function (DentalLabCase $case) {
|
||||
if (! $case->uuid) {
|
||||
$case->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 planItem(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DentalPlanItem::class, 'plan_item_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class DentalPerioSite extends Model
|
||||
{
|
||||
protected $table = 'care_dental_perio_sites';
|
||||
|
||||
protected $fillable = [
|
||||
'perio_exam_id', 'tooth_code', 'surface',
|
||||
'probing_mm', 'bleeding', 'plaque', 'recession_mm',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'bleeding' => 'boolean',
|
||||
'plaque' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function exam(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DentalPerioExam::class, 'perio_exam_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
@@ -21,11 +21,16 @@ class DentalTreatmentPlan extends Model
|
||||
|
||||
public const STATUS_COMPLETED = 'completed';
|
||||
|
||||
public const STATUS_REJECTED = 'rejected';
|
||||
|
||||
public const STATUS_CANCELLED = 'cancelled';
|
||||
|
||||
protected $table = 'care_dental_treatment_plans';
|
||||
|
||||
protected $fillable = [
|
||||
'uuid', 'owner_ref', 'organization_id', 'patient_id', 'visit_id',
|
||||
'status', 'title', 'estimate_minor', 'accepted_at', 'completed_at', 'created_by',
|
||||
'status', 'title', 'estimate_minor', 'accepted_at', 'completed_at',
|
||||
'rejected_at', 'rejection_reason', 'created_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
@@ -33,6 +38,7 @@ class DentalTreatmentPlan extends Model
|
||||
return [
|
||||
'accepted_at' => 'datetime',
|
||||
'completed_at' => 'datetime',
|
||||
'rejected_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class Visit extends Model
|
||||
|
||||
protected $fillable = [
|
||||
'uuid', 'owner_ref', 'organization_id', 'branch_id', 'patient_id',
|
||||
'status', 'checked_in_at', 'completed_at', 'checked_in_by',
|
||||
'status', 'specialty_stage', 'checked_in_at', 'completed_at', 'checked_in_by',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
|
||||
Reference in New Issue
Block a user