Billing
& Invoices
Settlement desk at /dashboard/billing: invoices, payments, advances, discounts, voids, refunds, A4/thermal prints, and patient-verifiable receipt QR. Institutional GL and day-close live in Finance.
Purpose
Capture and settle every chargeable clinical service without revenue leakage. Clinical modules auto-write line items; billing staff review, pay, print, and audit them. Mutations (create/pay/refund/void/advance) stay here — Finance hubs are read/ERP surfaces.
Who uses it
- → Cashiers & billing clerks (pay, advances, print)
- → Supervisors (void, refund, discount, SOD)
- → Reception / walk-in settlement
- → Insurance coordinators (apply-insurance reprice)
Typical Billing Lifecycle
Review Auto-Generated Lines
OPD, ER, IPD bed/visits, lab, radiology, cath, pharmacy, OT/anesthesia, and linked services create invoice lines with source-module metadata. Filter by patient, doctor, date, status, or source.
Create or Edit Invoice
Manual invoices pick Working-in campus services. Draft → posted → partially paid → paid. Line/metadata edits on unpaid or partial bills use billing:invoices:edit (not full create/pay).
Pay, Allocate Advance, Discount
Record cash/card/bank payments (partial OK). Allocate patient advances. Discounts need billing:discount (or manage). OPD/ER non-refundable holds come from campus BranchSetting.
Print, Verify QR, Void, Refund
A4/thermal print mints a non-PHI receipt verify QR (/verify/receipt#t=). Void incorrect unpaid bills; refund settled amounts with billing:refund. Optional bill-link SMS resend.
Features
Invoice List & Filters
Paginated invoices with status, patient/doctor search, date, totals, and source module.
Discharge rush and end-of-day need fast findability.
URL-synced filters; summary cards; record-scope notices when role-scoped.
Advances
Deposit → allocate → return lifecycle on Advances tab / patient context.
Surgical and IPD deposits must apply cleanly without over-return.
billing:advance-* grants; net-paid validation; printable advance receipt + verify QR.
Receipt Verify QR
Public /verify/receipt confirms amount/date/org/campus without PHI.
Patients and auditors validate slips without staff login.
JWT typ receipt_verify in URL hash; rate-limited public API; campus timezone on dates.
Campus Billing BranchSettings
Per-campus fallback rates, OPD/ER holds, admission transfer/discharge knobs, letterhead footer.
Campuses need different rates/holds without changing enterprise currency.
Settings → General overlays stamp Working-in BranchSetting; Viewing All writes enterprise defaults where applicable.
Discount / Void / Refund Controls
RBAC-separated write-offs and reversals.
Segregation of duties — cashiers pay; supervisors void/refund.
billing:discount, billing:invoices:void, billing:refund (or manage) + edit geography dual-gates.
Apply Insurance Reprice
Reprice billable lines from campus insurer tariffs.
TPA negotiated rates must hit the invoice without rewriting doctor-share cash base.
Invoice edit + insurance hub read; shareBase* stays cash; see Insurance handbook.
Technical Architecture
| Field | Type | Institutional Role |
|---|---|---|
| branchId | UUID | Clinical campus stamp (Working-in). |
| status | Enum | draft, posted/finalized, partially_paid, paid, voided/cancelled. |
| sourceModule | Varchar | Originating clinical module for auto-billed lines. |
| totalAmount | Decimal | Billable header total (post-discount / insurance reprice). |
| shareBase* | Decimal | Cash share base for doctor-share — not insurer tariff. |
Note: Sensitive fields use AES-256 field-level encryption where applicable.
Governance & Power
billing:viewbilling:createbilling:paymentbilling:invoices:editbilling:invoices:voidbilling:discountbilling:refundbilling:print-a4billing:print-thermalClinical trigger
Service completed in OPD, ER, IPD, lab, pharmacy, OT, etc.
Line creation
Auto-billing writes a campus-stamped invoice line.
Settlement
Cashier pays / allocates advance / discounts / prints QR slip.
Discharge gate
IPD cockpit blocks until finance clear or authorized override.