HWC is removing Van dependency. Doctors and pharmacists will be mapped directly to facilities instead of through Vans. This requires adding a new column to the worklist table and backfilling existing records with facility IDs from their Van mappings.
What to do:
- Grant SELECT permission on m_uom and m_item tables to app_user
- Add facilityID column to i_ben_flow_outreach table
- Add index on the new column
- Run pre-check to confirm all Vans have FacilityID
- Backfill facilityID in i_ben_flow_outreach from m_van table (batched, 50K rows per batch)
- Backfill FacilityID in m_UserServiceRoleMapping for HWC users from Van mappings
| Table | Action | Details |
|---|---|---|
| i_ben_flow_outreach | ADD column | facilityID INT DEFAULT NULL |
| i_ben_flow_outreach | ADD index | On facilityID column |
| i_ben_flow_outreach | BACKFILL | Copy FacilityID from m_van using vanID join |
| m_UserServiceRoleMapping | BACKFILL | Fill FacilityID for HWC users from Van→FacilityID |
No table created. No table deleted. No column removed. No structure change except one new column.
**
Backfill Steps
Backfill 1: Worklist Table (i_ben_flow_outreach)
- Add facilityID column
- Add index on facilityID
- Fill facilityID from m_van table by joining on vanID
Backfill 2: User Mapping Table (m_UserServiceRoleMapping)
- Fill FacilityID for HWC users from their Van → FacilityID mapping
- Join through m_uservanmapping → m_van to get FacilityID
- Only for HWC service line users where FacilityID is NULL
- Verify no HWC users left without FacilityID