HWC Facility Hierarchy — DB Changes for Van Removal

XMLWordPrintable

    • Type: Task
    • Resolution: Unresolved
    • Priority: High
    • 3.8.1
    • Affects Version/s: None
    • Sprint 55, Sprint 56
    • HWC Web App
    • All

      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:

      1. Grant SELECT permission on m_uom and m_item tables to app_user
      2. Add facilityID column to i_ben_flow_outreach table
      3. Add index on the new column
      4. Run pre-check to confirm all Vans have FacilityID
      5. Backfill facilityID in i_ben_flow_outreach from m_van table (batched, 50K rows per batch)
      6. 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

       

              Assignee:
              Paras Sahu
              Reporter:
              Vishwanath Balkur
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: