Decimal money, never float
Every amount in Medixar — invoice line items, taxes, refunds, payments, payment-plan
instalments — uses Decimal(15,2) in the database and decimal.js in
application code. Never JavaScript number, never float. This is
the mistake that produces ₹4,999.99 when it should produce ₹5,000 — visible to the patient,
embarrassing to the practice. We don't have it.
Atomic invoice + bill + claim numbering
INV-0001, BILL-0001, CLM-0001 are generated via SELECT … FOR UPDATE on a
dedicated counter table per tenant. Two parallel cashiers cannot produce duplicate numbers
even under heavy load. Each format is parseable: {PREFIX}-YYYYMMDD-NNNNNNN.
GST split, by place of supply, automatically
A patient from Coimbatore visits your Kerala clinic. Should the GST line be CGST + SGST, or IGST? The rule is "place of supply" — for healthcare services it's where the service is rendered; for goods it's where the goods are delivered. Medixar reads the patient's state from the chart, applies the rule, and generates the correct split. The receptionist never has to think about it.
- Intra-state — CGST + SGST 50/50.
- Inter-state — IGST full rate.
- Mixed line items (services + goods to different states) — split correctly per line.
GSTR-1 export is one click. The cost of getting this wrong is interest plus 10% of misclassified tax under §74 CGST.
Insurance claims that don't get lost
Cashless and reimbursement claims live in a real workflow, not a Gmail folder. Status tracking from submission through TPA approval to remittance. Aged-claim alerts so nothing crosses the insurer's filing window unnoticed.
- One-click claim generation from the encounter — diagnosis, procedure, medication codes attached.
- EDI 835 remittance import — when the TPA returns the remit file, it auto-applies to the matching claims.
- Aged-claims dashboard — anything past 30 / 60 / 90 days surfaces with the action owner.
- Audit trail — every claim status change is logged with user, timestamp, reason.
Payment plans
Patients on a ₹3-lakh procedure don't always pay up front. Medixar models payment plans as first-class objects: instalment schedule, due dates, automated reminders, partial-payment handling, default flagging. The ledger reconciles at month-end without the finance team chasing receipts.
Payment-gateway integration done correctly
Two failure modes of payment integration are common and expensive:
- Webhook replay attacks — an attacker replays a successful payment webhook and gets a duplicate credit applied to the patient's account.
- Double-charge race conditions — two webhook deliveries arrive seconds apart and both succeed, debiting the customer twice.
Medixar's Razorpay and Stripe integrations verify webhook signatures with HMAC-SHA256
(rejecting unsigned calls), dedupe on the provider's event ID, and use SELECT … FOR
UPDATE inside the settlement transaction to serialise concurrent webhooks. The first
successful settlement wins; subsequent calls become no-ops. Documented and tested with 50
parallel-webhook regression tests.
Multi-facility consolidation
A hospital chain gets cross-facility revenue rollups, per-facility P&L, and inter-branch reconciliation. Patient pays at branch A; service rendered at branch B. The ledger handles it automatically.
What's still on the roadmap
Honest list of what we don't ship today:
- EDI 837 outbound — direct submission to clearinghouses. Vendor partnership pending.
- Cash-handling reconciliation hardware — cash drawer integration is BYO.