Add full Blood Bank specialty suite on shared shell.
Deploy Ladill Care / deploy (push) Successful in 37s

Mirror Emergency: stage workflow, issue/transfusion records, analytics,
print, and action-menu stage flow without a parallel EHR.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 21:36:57 +00:00
co-authored by Cursor
parent 847d63c1c2
commit f688a48c37
19 changed files with 1590 additions and 30 deletions
+13 -3
View File
@@ -270,7 +270,7 @@ class SpecialtyShellService
) {
$code = (string) ($stage['code'] ?? '');
if (in_array($moduleKey, ['dentistry', 'emergency'], true) && $visitIds->isNotEmpty()) {
if (in_array($moduleKey, ['dentistry', 'emergency', 'blood_bank'], true) && $visitIds->isNotEmpty()) {
$count = Visit::owned($ownerRef)
->where('organization_id', $organization->id)
->whereIn('id', $visitIds)
@@ -502,6 +502,7 @@ class SpecialtyShellService
string $serviceCode,
string $ownerRef,
?string $actorRef = null,
int $quantity = 1,
): Bill {
$service = collect($this->provisionedServices($organization, $moduleKey))
->first(fn ($s) => ($s['code'] ?? '') === $serviceCode);
@@ -510,12 +511,21 @@ class SpecialtyShellService
throw new \InvalidArgumentException("Unknown specialty service [{$serviceCode}].");
}
$bill = $this->bills->generateFromVisit($visit, $ownerRef, $actorRef);
// Reuse an open visit bill without syncLineItemsFromVisit — that sync deletes
// prior specialty_service lines and would wipe multi-item issue/billing batches.
$bill = Bill::owned($ownerRef)
->where('visit_id', $visit->id)
->whereNotIn('status', [Bill::STATUS_VOID])
->first();
if (! $bill) {
$bill = $this->bills->generateFromVisit($visit, $ownerRef, $actorRef);
}
return $this->bills->addManualLineItem($bill, $ownerRef, [
'type' => $service['type'] ?? 'misc',
'description' => $service['label'],
'quantity' => 1,
'quantity' => max(1, $quantity),
'unit_price_minor' => (int) ($service['amount_minor'] ?? 0),
'source_type' => 'specialty_service',
'source_id' => null,