Entry and Flow
Split entry points, modal sequence, and response handling in the frontend workflow.
👤 Sachin Sharma, Nilesh Bhusari📅 Updated: Mar 24, 2026🏷️ feature🏷️ frontend🏷️ modal🏷️ flow
Where split starts
Order Split is launched from BillUpdateFooter:
- Footer action button:
Split Billis displayed when theisBillSplitEnabledlab setting is enabled. - Button click sets local modal state (
setSplitBill(true)). - Split modal is rendered as
<SplitOrderModal ... />.
Split modal flow
- Read current bill context from Redux (
userId,labBillId, bill id, test rows). - Show optional source selector (
ORG_SOURCE_OPTIONS). - Render selectable test grid with row-level checkboxes:
- Dynamic columns (Price, Copay, Deductible, Concession, ICD Code) based on lab settings, source insurance, and MOH limits.
- Test names display layout features like "Profile" tags.
- Render optional "Patient Consents" card in the Data Transfer step (if
consentDetails.labForm.idexists). - Validate before API call:
- at least one test selected,
- not all tests selected.
- Call split API:
splitBill(Id, selectedTestIds, selectedSource?.value).
- Handle response:
- success: show alert, refresh bill data, close modal and Order Update panel.
- failure: show error alert and re-enable submit action.
User feedback behavior
- Success notification confirms split completion.
- Failure notification shows backend message when available, otherwise a generic message.
- Submit action remains disabled during in-flight request to avoid duplicate submissions.