Overview

Order Split enables labs to separate tests from an insurance bill into a new bill, supporting claim workflows without breaking report continuity or financial integrity.

๐Ÿ‘ค Sachin Sharma๐Ÿ“… Updated: May 2, 2026๐Ÿท๏ธ feature๐Ÿท๏ธ billing

Order Split

Order Split allows lab staff to move selected tests or profiles from an existing insurance bill into a newly created bill. The split preserves all report relationships, recomputes financials proportionally for both bills, and keeps downstream systems in sync.


Why this exists

In insurance billing, a single bill can contain a mix of tests โ€” some claimable by the payer, others not. When a claim is filed, non-claimable tests block or complicate the process. Labs need a way to cleanly separate those tests into a standalone bill so each bill follows the correct payment path independently.

Real-world scenarios

Claim rejection for specific tests A patient has 5 tests billed to insurance. The payer denies 2 as non-covered. Rather than holding up the entire bill, staff split those 2 into a self-pay bill and process the remaining 3 through the claim workflow uninterrupted.

Mixed payment responsibility Some tests are covered by the patient's primary insurance; others are paid out-of-pocket or by a secondary payer. Splitting separates the financial obligations without touching the underlying reports or sample data.

Org-pay vs self-pay separation A referral organisation covers certain tests but not others. The lab needs separate bills to correctly apply org-level discounts, ledger entries, and billing terms.


What it does

CapabilityDetail
Move testsShifts selected BillingInfo rows and their LabReportRelation entries to a new bill
Recompute financialsDistributes VAT, TDS, and additional charges proportionally based on the split base amount
Migrate test dataShifts ICD codes, modifiers, AOE responses, and consent records for moved tests
Clone bill dataCopies bill-level approval status, missing details, attachments, and consents to the new bill
Preserve reportsLabReportRelation IDs are kept intact โ€” no report recreation, no attachment loss
Audit trailWrites activity logs for both the parent and split bill
Stay in syncSyncs moved reports to Elasticsearch and invalidates affected Redis cache keys post-commit

Bill split โ€” before and after

Both bills get independently recalculated financials. Reports, attachments, and sample data remain intact on their respective bills.


Architecture

The feature is a two-layer backend exposed through a single API endpoint, consumed by a guided 3-step frontend modal. The same endpoint runs in different modes so the frontend can check eligibility and preview financials before committing any writes.


How it works

No data is written until the user confirms on Step 3. Each stepper step calls the same API endpoint with a different mode flag.

Execution phases

PhaseAPI modeWhat happens
Validateis_validate=trueAll bill and test eligibility checks run. Errors shown to user on Step 1 โ€” no writes, always HTTP 200.
Calculateis_calculate=trueFinancials computed in memory. Proportion = split_base_amount รท original_base_total applied to VAT, TDS, and additional charges. No writes.
Execute(no flags)Single transaction.atomic() โ€” creates the new bill, shifts and clones all related rows, updates parent. Full rollback on any failure.
Sync(post-commit)Elasticsearch re-indexed, Redis keys cleared, ledger entries posted, activity logs written. A sync failure does not reverse the split.

Prerequisites

The enable_bill_split flag must be enabled on the lab's settings.

  • Configurable in the Support Dashboard > Configurations under Workflow Configurations โ†’ Enable Bill Splitting.
  • Only lab-user logins can access the feature (not collection centre, referral, or doctor logins).

Scope (V1)

In scopeOut of scope
Unpaid insurance bills onlyPaid or partially paid bills
One bill โ†’ one new billSplitting into more than two bills
Org Pay or Self Pay as destination sourceNon-insurance source bills
AOE and consent migrationHome collection and appointment workflows
SmartReport and Image attachmentsClaims-linked or invoiced bills

Document map

On this page