State and Keys
Local state, Redux dependencies, and API payload mapping used by the Order Split UI flow.
👤 Sachin Sharma, Nilesh Bhusari📅 Updated: Mar 24, 2026🏷️ feature🏷️ frontend🏷️ redux🏷️ state
Component-local state
| State key | Component | Purpose |
|---|---|---|
splitBill | BillUpdateFooter | Controls split modal visibility |
selectedTestIds | SplitOrderModal | Stores selected test row ids for split |
selectedSource | SplitOrderModal | Stores optional destination source |
disabled | SplitOrderModal | Prevents duplicate submit during API request |
Redux keys used
| Redux key | Usage |
|---|---|
userId | Patient context for reading and writing bill data |
labBillId | Active bill identifier in Order Update context |
existingTests | Candidate rows shown for split selection |
GENERIC | Access to orgSourceInfo, and source billing flags, driving dynamic display of columns. |
FORMS | Access to billSettingInput config, used to calculate allowed columns in the grid. |
billingData[userId][labBillId].billingData.Id | Bill id used in API path parameter |
allBillsData | Refreshed after successful split |
API payload mapping from frontend
bill_idpath parameter comes from activebillingData.Id.test_idscomes from selected checkbox rows (selectedTestIds).new_sourcecomes fromselectedSource.valuewhen selected.
State transition summary
- Footer state controls modal open and close.
- Modal state tracks selection and request lifecycle.
- Success path refreshes Redux with latest billed-user data.