-
Type:
Story
-
Resolution: Unresolved
-
Priority:
High
-
Affects Version/s: None
-
Sprint 54, Sprint 55, Sprint 56
-
Platform
-
All
As a Provider Admin I want to create and manage users, roles, facilities, and geographic assignments across multiple healthcare hierarchies (DH → CHC → PHC → SC), so that I can support clinical service delivery, field worker supervision, and ABDM-compliant reporting without breaking existing inventory, MMU, or van operations.
Technical Analysis Document:
Requirement Document (BRD):
https://pmp.piramalswasthya.org/confluence/x/GYAyBg
Description
The system must support multi-tenant, provider–state–service–scoped user management using a three-tier architecture while allowing healthcare facility hierarchy integration to coexist with the existing Main Store / Sub Store inventory model.
Users can have multiple roles, multiple facility assignments, and multi-village coverage, all governed through a central junction table (M_UserServiceRoleMapping2) and scoped via providerServiceMapID.
The healthcare hierarchy is introduced as an additive, nullable extension to the existing M_Facility entity, ensuring zero disruption to current MMU, inventory, and van workflows.
Acceptance Criteria
User Creation & Role Assignment
- Admin can create a user with basic profile details in M_User1
- Admin can assign multiple roles to the same user
- Each role assignment is scoped by providerServiceMapID
- A user can be mapped to multiple facilities via workingLocationID
- Soft deletion (deleted = true) is supported for users and mappings
- JWT-based authentication with Redis-backed session management is enforced
Facility & Healthcare Hierarchy
- Admin can create facilities using existing /createStore API
- Healthcare fields (stateID, districtID, blockID, healthcareLevel, hfrID) are optional
- Inventory logic continues using storeType
- Healthcare logic uses healthcareLevel (DH, CHC, PHC, SC)
- Existing Main Store / Sub Store mapping remains unchanged
- UI supports healthcare facility selection without affecting inventory UI
Field Worker & Village Coverage
- ASHA/ANM users can be assigned to multiple villages
- Village coverage stored in villageidDb (comma-separated)
- Field workers are linked to Subcenters via workingLocationID
- Block-level organization is supported
- Village assignments remain intact during role updates
Supervisor & Multi-Facility Coverage
- Supervisors can be assigned to multiple Subcenters or PHCs
- Supervisors may overlap across other supervisors’ facilities
- Supervision hierarchy is implicitly derived from workingLocationID
- No new hierarchy table is required for supervision logic
- Multiple mappings for the same user are supported and processed by mapRole()
Multi-Tenant & Isolation Rules
- All data access is scoped by providerServiceMapID
- Users cannot access data outside their provider–state–service boundary
- Supports multiple providers operating in the same geography
- Audit trails and soft deletion are preserved
- relates to
-
AMM-2194 HWC Login - implement as per new changes in API
-
- Todo/Open
-
-
AMM-2014 Facility Hierarchy and Health Worker Mapping Enhancements
-
- Closed
-
-
AMM-2172 UI: Healthcare Facility Creation & User Mapping Enhancements
-
- Closed
-
-
AMM-2215 HWC Facility Hierarchy — DB Changes for Van Removal
-
- Analysis
-
-
AMM-2186 AMRIT Admin – Facility & User Work Location Management
-
- Pending QA
-
-
AMM-2197 HWC Facilities and Inventory linking for Prescription and Pharmacy management
-
- Pending QA
-
-
AMM-2198 Medicines Item to HWC Facility Mapping
-
- Pending QA
-
-
AMM-2199 Changes in the Facility Type, Create Facility and work location mapping screens
-
- Pending QA
-
-
AMM-2200 Changes in the Create Facility and work location mapping screens
-
- Pending QA
-
-
AMM-2206 Removing VAN dependency in HWC Application
-
- Pending QA
-
-
AMM-2171 Multi-Tenant Healthcare Hierarchy & User–Role–Facility Mapping
-
- Pending QA
-
-
AMM-2253 New Service line for Stop TB project and set work location mapping State to Village
-
- In QA
-