Overview

Order Update allows authorized lab staff to modify an existing patient order across billing, payments, ledger, doctor revenue, appointments, and search — all within a single atomic transaction.

👤 Mohammad Ashfaque Alam📅 Updated: Mar 16, 2026🏷️ feature🏷️ finance🏷️ billing

Order Update

Order Update (internally called Bill Update) allows authorised lab staff to modify a patient order after it has been created. It is one of the most complex flows in the Finance module — a single update cascades into multiple downstream systems simultaneously, all wrapped in a single atomic database transaction.

Order Update opens as a full-screen modal on top of the current page.

What is it?

Order Update is a full-screen editing interface accessible from various contexts across the application. Whether a staff member is in the Waiting List, Accessioning, Registration, or Finance modules, they can quickly trigger the Order Update modal to modify bill details. Staff can open any of the patient's past bills from the sidebar, modify the relevant details, and submit the update — all from one place.

A successful update touches:

  • Billing record — core fields (amounts, dates, source, referral, comments)
  • Payments — add, update, or delete individual payments
  • Organisation ledger — B2B client dues are reconciled automatically
  • Doctor revenue — referral revenue is recalculated per test
  • Appointments & home collections — linked EMR records are kept in sync
  • Lab report metadata — sample and report records are refreshed
  • Elasticsearch — search index reflects the changes within seconds
  • Fusion webhooks — connected integrations (HMIS, LIS) are notified asynchronously

[!NOTE] The Elasticsearch sync and the Fusion integration webhook run outside the main DB transaction. Everything else is atomic — if any step fails, all changes are rolled back automatically.

Who uses it?

RoleAccess
Lab StaffView and modify bill fields, comments, dates, payments
Finance UsersCan change organisation and financial amounts
Lab AdminFull access including locking/unlocking bills
Collection Center (CC) StaffLimited access based on CC-specific flags
Referral LoginRead-only — cannot submit updates

What can be updated?

CategoryWhat Changes
Basic InfoBill time, source, order number, comments
FinancialTotal amount, concession, advance, VAT, TDS, additional amount
Doctor / ReferralReferring doctor; doctor revenue recalculated automatically
OrganisationLinked B2B org; ledger reconciled for old and new org
Sample DateSample collection date across all tests
Emergency FlagMark/unmark as Critical / Emergency Report
TestsTest amounts and concessions per test; add new tests
PaymentsAdd, edit, or delete payment entries
ICD CodesReplace the full ICD code set on the bill
ModifiersReplace billing modifiers
Lock StateLock or unlock the bill
InsurancePre-auth ID/amount, agent details, proposal number
BranchReassign to a different branch

What cannot be changed?

  • Tests cannot be directly removed from the order (cancellation is a separate flow via Cancel Bill)
  • Cancelled bills (isCancel = 1) cannot be updated — they must be reset first
  • Locked bills cannot be edited without unlocking
  • Bills tied to an active insurance claim cannot be edited while the claim is active
  • Bills linked to an invoice require invoice-level access to unlock

Key Constraints

[!WARNING] A bill update is blocked (returns status 6) if the payment detail fields are fully populated, the total amount changed, and the organisation has a prepaid or postpaid payment type. This conflict must be resolved before the update can proceed.

[!NOTE] If a bill has unsaved insurance changes and the user tries to close or submit, an Unsaved Changes modal is shown before discarding or proceeding.

On this page