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:
@@ -259,14 +259,35 @@ class SpecialtyShellService
|
||||
->whereNotIn('status', [Bill::STATUS_VOID])
|
||||
->sum('amount_paid_minor');
|
||||
|
||||
$stages = collect($this->stages($moduleKey))->map(function (array $stage) use ($waiting, $inProgress, $completedToday) {
|
||||
$stages = collect($this->stages($moduleKey))->map(function (array $stage) use (
|
||||
$waiting,
|
||||
$inProgress,
|
||||
$completedToday,
|
||||
$moduleKey,
|
||||
$organization,
|
||||
$ownerRef,
|
||||
$visitIds,
|
||||
) {
|
||||
$code = (string) ($stage['code'] ?? '');
|
||||
$count = match (true) {
|
||||
in_array($code, ['waiting', 'arrival', 'request'], true) => $waiting,
|
||||
in_array($code, ['in_care', 'chair', 'procedure', 'treatment', 'resus', 'crossmatch', 'issue', 'observation'], true) => $inProgress,
|
||||
in_array($code, ['completed', 'disposition', 'transfusion', 'recovery'], true) => $completedToday,
|
||||
default => 0,
|
||||
};
|
||||
|
||||
if ($moduleKey === 'dentistry' && $visitIds->isNotEmpty()) {
|
||||
$count = Visit::owned($ownerRef)
|
||||
->where('organization_id', $organization->id)
|
||||
->whereIn('id', $visitIds)
|
||||
->where('specialty_stage', $code)
|
||||
->when(
|
||||
$code !== 'completed',
|
||||
fn ($q) => $q->whereIn('status', [Visit::STATUS_OPEN, Visit::STATUS_IN_PROGRESS]),
|
||||
)
|
||||
->count();
|
||||
} else {
|
||||
$count = match (true) {
|
||||
in_array($code, ['waiting', 'arrival', 'request'], true) => $waiting,
|
||||
in_array($code, ['in_care', 'chair', 'procedure', 'treatment', 'resus', 'crossmatch', 'issue', 'observation'], true) => $inProgress,
|
||||
in_array($code, ['completed', 'disposition', 'transfusion', 'recovery'], true) => $completedToday,
|
||||
default => 0,
|
||||
};
|
||||
}
|
||||
|
||||
return [
|
||||
'code' => $code,
|
||||
|
||||
Reference in New Issue
Block a user