Activate Care workflows across check-in and financial clearance.
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:
isaacclad
2026-07-17 21:13:06 +00:00
co-authored by Cursor
parent 86bfce1e17
commit 3ee59a0956
38 changed files with 1953 additions and 107 deletions
+13 -3
View File
@@ -9,17 +9,18 @@ use App\Models\InvestigationResult;
use App\Models\InvestigationResultValue;
use App\Models\InvestigationType;
use App\Models\Organization;
use App\Services\Care\Workflow\WorkflowStageCompletionService;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use InvalidArgumentException;
class InvestigationService
{
public function __construct(
protected CareQueueBridge $queueBridge,
protected WorkflowStageCompletionService $workflowCompletion,
) {}
public function queryForOrganization(string $ownerRef, int $organizationId): Builder
@@ -83,7 +84,7 @@ class InvestigationService
?string $actorRef = null,
): Collection {
$consultation->loadMissing('visit');
$created = new Collection();
$created = new Collection;
foreach ($typeIds as $typeId) {
$type = InvestigationType::owned($ownerRef)->findOrFail($typeId);
@@ -277,10 +278,19 @@ class InvestigationService
AuditLogger::record($ownerRef, 'investigation.approved', $request->organization_id, $actorRef, InvestigationRequest::class, $request->id);
$request = $request->fresh(['patient', 'investigationType', 'result.values']);
$request = $request->fresh(['patient', 'investigationType', 'result.values', 'visit']);
$organization = Organization::query()->find($request->organization_id);
if ($organization) {
$this->queueBridge->complete($organization, $request);
if ($request->visit) {
$this->workflowCompletion->complete(
$organization,
$request->visit,
$this->queueBridge->contextForInvestigation($request),
$ownerRef,
$actorRef,
);
}
}
return $request;