Activate Care workflows across check-in and financial clearance.
Deploy Ladill Care / deploy (push) Failing after 1m9s
Deploy Ladill Care / deploy (push) Failing after 1m9s
Enforce service-queue gates, cashier settlements, and clinical stage progression so patient journeys cannot bypass configured payment or authorization rules. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -101,7 +101,7 @@ class Appointment extends Model
|
||||
|
||||
public function consultation(): HasOne
|
||||
{
|
||||
return $this->hasOne(Consultation::class, 'appointment_id');
|
||||
return $this->hasOne(Consultation::class, 'appointment_id')->latestOfMany();
|
||||
}
|
||||
|
||||
/** @return list<string> */
|
||||
|
||||
@@ -69,6 +69,16 @@ class FinancialObligation extends Model
|
||||
return $this->belongsTo(Visit::class, 'visit_id');
|
||||
}
|
||||
|
||||
public function organization(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Organization::class, 'organization_id');
|
||||
}
|
||||
|
||||
public function branch(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Branch::class, 'branch_id');
|
||||
}
|
||||
|
||||
public function patient(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Patient::class, 'patient_id');
|
||||
|
||||
@@ -31,4 +31,14 @@ class Organization extends Model
|
||||
{
|
||||
return $this->hasMany(Member::class, 'organization_id');
|
||||
}
|
||||
|
||||
public function facilityWorkflows(): HasMany
|
||||
{
|
||||
return $this->hasMany(FacilityWorkflow::class, 'organization_id');
|
||||
}
|
||||
|
||||
public function financialObligations(): HasMany
|
||||
{
|
||||
return $this->hasMany(FinancialObligation::class, 'organization_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,4 +88,14 @@ class Visit extends Model
|
||||
{
|
||||
return $this->hasMany(Bill::class, 'visit_id');
|
||||
}
|
||||
|
||||
public function stageAdvances(): HasMany
|
||||
{
|
||||
return $this->hasMany(VisitStageAdvance::class, 'visit_id');
|
||||
}
|
||||
|
||||
public function financialObligations(): HasMany
|
||||
{
|
||||
return $this->hasMany(FinancialObligation::class, 'visit_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ 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 WorkflowStage extends Model
|
||||
@@ -60,6 +61,16 @@ class WorkflowStage extends Model
|
||||
return $this->belongsTo(FacilityWorkflow::class, 'workflow_id');
|
||||
}
|
||||
|
||||
public function advances(): HasMany
|
||||
{
|
||||
return $this->hasMany(VisitStageAdvance::class, 'workflow_stage_id');
|
||||
}
|
||||
|
||||
public function financialObligations(): HasMany
|
||||
{
|
||||
return $this->hasMany(FinancialObligation::class, 'workflow_stage_id');
|
||||
}
|
||||
|
||||
/** Whether entering this stage's service queue is gated on a cleared obligation. */
|
||||
public function gatesBeforeService(): bool
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user