Workflow Guide
Step-by-step guide covering how lab staff open, edit, and submit a bill update — including locked bill handling, payment management, and adding tests.
Workflow Guide
This page walks through the end-to-end workflow for Order Update — from opening the modal to submitting changes.
Opening Order Update
Order Update opens as a full-screen modal. It is triggered from various parts of the product — the same component is reused in all contexts.
| Where it appears | How it's triggered |
|---|---|
| Waiting List | Action menu on a patient/bill row |
| Accession (Sample-wise & Bill-wise grids) | Action menu or row click |
| Accession — Sample Info tab | Order Update button |
| Bill Settlements / Bill Approval | Row click or "View Bill Details" action |
| Registration / Missing Details | "Update Bill" or "Resolve missing fields" |
| Billing Confirmation Footer | After billing, update the just-created bill |
| Patient's Test List | Action menu on a specific bill |
| Doctor Login (Archives) | Action menu in the archive view |
| Organization Login | Patient-wise test list view |
| Insurance Management | Pending Submission / Submitted Claims grids |
| Device Results Validation | Results or Tox Results screens |
| Bill List (Finance) | Action menu in the general bill list grid |
[!NOTE] The component has a built-in
modeprop that supports"modal"(default) and"page"rendering. However,mode="page"is not yet used anywhere — all current call sites rely on the default modal mode.
- Loads all bills for the patient into the left sidebar (
BillDetailsSidebar) - Auto-selects the bill that was clicked (scrolls the sidebar to the active row)
- Fetches bill details from Redux (billing data, payment list, lab report list, ICD codes, modifiers)
Selecting a Bill
The Past Bills sidebar on the left shows all bills for the patient, grouped by date.
- Use the Search Bill input to filter by bill number
- Click any bill card to load it in the main editing area
- Keyboard navigation: use
Enterto select the highlighted bill - The active bill is highlighted with a distinct background
Viewing Bill Status Banners
When a bill is in a restricted state, a yellow alert banner appears at the top of the editing area with the reason and an action button:
| Condition | Banner Message | Action Button |
|---|---|---|
| Bill is locked | Bill is locked | Unlock Bill |
| Bill linked to an active insurance claim | Claim is active | — |
| Bill linked to an invoice | Bill is invoiced | View Invoice Details |
| Bill time restriction exceeded | Edit window expired | — |
| Bill is cancelled | Bill is cancelled | Reset Bill |
[!NOTE] Collection Center (CC) logins do not see the action buttons — they can view the banner but cannot unlock or reset bills.
Editing the Bill
The main edit area is divided into logical sections rendered in sequence:
1. Basic Bill Details
Fields available here:
| Field | Notes |
|---|---|
| Bill Source | Only shown if showBillSource setting is enabled or US layout |
| Bill Date | Editable date + time picker; requires allowBackDatedSettlement permission |
| Sample Date | Updates sample date across all tests; shows a warning if different sample dates exist |
| Critical / Emergency Report | Checkbox toggle; only shown if showEmergencyReportCheckbox is enabled |
| Bill ICD Code | Shown if enabledIcdCodeFlag is on; supports single or matrix selection mode |
| Billing Modifiers | Shown if showModifiers setting is enabled |
| Existing Tests | Read-only list of tests including amounts and concessions |
| Add New Test to Bill | Available when userAddTestBillFlag and registration permissions are set |
2. Additional Details
| Field | Notes |
|---|---|
| Organisation | Dropdown; triggers price-list check and org ledger reconciliation |
| Referral Doctor | Dropdown; triggers doctor revenue recalculation |
| Order Number | Text input; shown if orderNumberCompulsoryFlag is set or US layout |
| Additional Category | Dropdown of BILL_SERVICES options |
| Agent Name / Code / Reference No | Insurance agent fields; shown based on lab settings |
| Proposal Number | Insurance proposal; shown if proposalNumberFlag is enabled |
| Branch | Branch selector; disabled for Collection Centers |
| Report Collection Type | Shown if reportCollectionFlag is enabled |
| Order Comments | Multi-line text area; supports timestamps if showTimestamps is enabled; supports instant comment templates |
[!NOTE] Changing the Organisation checks whether the new org has a different price list. If it does, an Update Price List link appears below the org dropdown to apply the new pricing to existing tests.
[!NOTE] Changing the Referral Doctor checks if the doctor has an associated revenue price list. If yes, an Update Doctor Revenue link appears to apply the new revenue amounts.
3. Payment Details (Non-Insurance Bills)
Two cards are shown side by side:
Bill Summary — shows:
- Test Amount (total of all tests)
- Additional Amount (editable)
- Concession (editable; capped by the user's
allowedDiscountOnBillpercentage) - TDS Concession % (if
allowTDSDeductionEverytimeis enabled) - VAT Amount (if
vat_managementis enabled and not disabled for the org) - Payable Amount (calculated total)
Payment Status — shows:
- Payable Amount
- Total Paid Amount
- Due Amount (in red if > 0)
4. Payment Details (Insurance Bills)
For insurance-sourced bills, the payment section shows:
- Test Amount total
- Co-pay Amount
- Deductible Amount
- Patient Payable Amount
- Insurance Payable Amount
5. Payment History
A table showing all past payments for the bill:
| Column | Description |
|---|---|
| Payment Type | CASH, CARD, CHEQUE, REFUND, etc. |
| Payer | Org Payment or Patient Payment |
| Refund For | Test name (only for refund-type payments) |
| Amount | Payment amount |
| Date | Last update time |
| Staff | Lab user who recorded the payment |
The Add Payment button opens the Payment List modal to add or edit individual payments.
[!NOTE] The Add Payment button is disabled when:
- Bill is locked
- Bill has an active insurance claim
- Bill is cancelled
- User does not have
userBillSettelmentFlagpermission- User is on referral login
Submitting the Update
The footer at the bottom of the editing area contains all action buttons.
Standard Update (No New Tests)
Click Confirm & Update to:
- Validate all fields (duplicate order number, ICD code, concession errors, payment due error)
- Check bill time restriction
- Verify bill comments are filled if concession changed
- Open the Bill Update Confirmation modal — shows a summary of changed fields for review
- On confirm — calls the backend API and closes the modal on success
Update with New Tests Added
When new tests have been staged in the add-test area, the footer shows:
- Update & Add to Existing Bill — saves the update and attaches the new tests to the same bill
Cancel Bill
- Click Cancel Bill (red button) to open the cancellation modal
- This marks the bill as cancelled (
isCancel = 1) - Bill can be reset later via the Reset Bill banner action
Additional Footer Actions
| Button | Condition |
|---|---|
| View AOE | Always shown if AOE responses exist for the bill |
| Complete AOE | Shown when AOE is required for staged new tests |
| View Consent | Shown if consent_management is enabled and bill consent exists |
| Complete Consent | Shown when consent is required for staged new tests |
| Dropdown with print options (Receipt, TRF, Bill, etc.) | |
| Bill Attachments | Thumbnail strip + Add button (hidden for referral login) |
| Bill Approval Actions | Shown on the Bill Approval page — Hold, Reject, Approve |
Bill Lock & Unlock
If a bill is locked (billLocked = 1) and the user has the right permissions:
- Click Unlock Bill from the banner
- The Unlock Bill modal appears for confirmation
- On confirm — the bill is unlocked and all fields become editable
Unsaved Insurance Changes Guard
If the user is editing insurance details (editInsurance = true) and tries to:
- Close the modal
- Submit the bill update
- Cancel the bill
- Add a new test
…an Unsaved Message modal appears asking whether to discard the insurance changes or go back.
Error States
| Error | What happens |
|---|---|
| Due amount is negative | Red toast: "Due amount cannot be greater than test amount" |
| Concession exceeds user's allowed discount | Capped at max; toast shows the allowed % |
| Duplicate order number | "Confirm & Update" button is disabled |
| Bill ICD code required | Toast error; blocks submission |
| Test ICD code required (source-based) | Toast error; blocks submission |
| Insurance price error | "Confirm & Update" button is disabled |
| Org-wise duplicate MRN | Error text shown below org field |
| Bill time restriction exceeded | Toast via showBillUpdateRestrictionAlert() |
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.
Frontend
Component structure, state management, and interaction patterns for the Order Update UI in livehealth-frontend.