Stock Management Module Configuration Guide
Location Tags Setup
Required Location Tags
The stock management module requires three specific location tags:
- Main Store – Primary storage location
- Main Pharmacy – Main pharmacy location
- Dispensary – Dispensing location
Step-by-Step Location Tag Creation
1. Create Location Tags
- Access Admin Interface
- Go to
https://your-domain.com/openmrs - Login with admin credentials
- Navigate to Administration → Manage Location Tags
- Go to
- Create Main Store Tag
- Click Add Location Tag
- Name:
Main Store - Description:
Primary storage location for stock management - Save
- Create Main Pharmacy Tag
- Click Add Location Tag
- Name:
Main Pharmacy - Description:
Main pharmacy location for stock management - Save
- Create Dispensary Tag
- Click Add Location Tag
- Name:
Dispensary - Description:
Dispensing location for stock management - Save
2. Assign Tags to Locations
- Navigate to Locations
- Go to Administration → Manage Locations
- Tag Main Store Location
- Edit your primary storage location (e.g., “Laboratory” or “Main Store”)
- Add the Main Store tag
- Save
- Tag Main Pharmacy Location
- Edit your main pharmacy location
- Add the Main Pharmacy tag
- Save
- Tag Dispensary Location
- Edit your dispensing location (can be the same as Main Pharmacy)
- Add the Dispensary tag
- Save
Important: The same location can have multiple tags. For example, a pharmacy location can have both “Main Pharmacy” and “Dispensary” tags.
Concept Configuration
Required Concept Sets
The stock management module requires four concept sets for proper functionality:
- Stock Source Type – Types of stock sources
- Stock Item Category – Categories for stock items
- Stock Adjustment Reason – Reasons for stock adjustments
- Stock Take Reason – Reasons for stock takes
Step-by-Step Concept Creation
1. Create Stock Source Type Concept Set
- Create Main Concept
- Go to Administration → Manage Concepts
- Click Add Concept
- Name:
Stock Source Type - Description:
Types of sources for stock items - Concept Class:
Misc - Data Type:
N/A - Set:
Yes(check this box) - Retired: Leave unchecked
- Save
- Create Individual Answer Concepts Create these concepts first (as individual concepts, not sets):
- Purchase
- Name:
Purchase - Description:
Stock received through purchase - Concept Class:
Misc - Data Type:
N/A - Set:
No
- Name:
- Donation
- Name:
Donation - Description:
Stock received through donation - Concept Class:
Misc - Data Type:
N/A - Set:
No
- Name:
- Transfer In
- Name:
Transfer In - Description:
Stock received through transfer - Concept Class:
Misc - Data Type:
N/A - Set:
No
- Name:
- Return
- Name:
Return - Description:
Stock received through return - Concept Class:
Misc - Data Type:
N/A - Set:
No
- Name:
- Other
- Name:
Other - Description:
Other source types - Concept Class:
Misc - Data Type:
N/A - Set:
No
- Name:
- Purchase
- Add Answers to Concept Set
- Go back to the “Stock Source Type” concept
- Navigate to the Set Members tab
- Click Add Set Member
- Search for and select each answer concept you created
- Save after adding each member
2. Create Stock Item Category Concept Set
- Create Main Concept
- Name:
Stock Item Category - Description:
Categories for classifying stock items - Concept Class:
Misc - Data Type:
N/A - Set:
Yes - Retired: Leave unchecked
- Name:
- Create Answer Concepts
- Medications
- Medical Supplies
- Laboratory Supplies
- Surgical Instruments
- Other
- Add Set Members
- Add all answer concepts as set members
3. Create Stock Adjustment Reason Concept Set
- Create Main Concept
- Name:
Stock Adjustment Reason - Description:
Reasons for adjusting stock quantities - Concept Class:
Misc - Data Type:
N/A - Set:
Yes
- Name:
- Create Answer Concepts
- Expired Items
- Damaged Items
- Theft/Loss
- Counting Error
- Quality Control
- Other
- Add Set Members
- Add all answer concepts as set members
4. Create Stock Take Reason Concept Set
- Create Main Concept
- Name:
Stock Take Reason - Description:
Reasons for conducting stock takes - Concept Class:
Misc - Data Type:
N/A - Set:
Yes
- Name:
- Create Answer Concepts
- Routine Count
- Suspected Discrepancy
- End of Period
- Audit
- System Migration
- **Other`
- Add Set Members
- Add all answer concepts as set members
Stock Operation Types
Verification
Stock operation types should be automatically created by the stock management module. Verify they exist:
- Check Operation Types
- API call:
GET /openmrs/ws/rest/v1/stockmanagement/stockoperationtype?v=default - Should return: Adjustment, Disposal, Transfer Out, Receipt, Return, Stock Issue, Requisition, Stock Take, Opening Stock
- API call:
Required Operation Types
The following operation types should be present:
- Adjustment – Physical quantity adjustments
- Disposal – Item disposal
- Transfer Out – Items transferred to other locations
- Receipt – Items received from external sources
- Return – Items returned to main store
- Stock Issue – Items issued between locations
- Requisition – Stock requests
- Stock Take – Physical inventory counts
- Opening Stock – Initial stock quantities
User Role Configuration
Required Roles
The stock management module expects these specific role UUIDs:
d210eb66-2188-11ed-9dff-507b9dea1806– Inventory Clerkcca4be4b-2188-11ed-9dff-507b9dea1806– Inventory Manager84bdd876-4694-11ed-8109-00155dcc3fc0– Inventory Dispensinga49be648-6b0a-11ed-93a2-806d973f13a9– Inventory Reporting2083fd40-3391-11ed-a667-507b9dea1806– Inventory Administrator
Creating User Role Scopes
- Access Stock Management
- Go to Stock Management → User Role Scopes
- Create New User Role Scope
- Click Add User Role Scope
- Select User: Choose a user with appropriate roles
- Select Role: Choose from available stock management roles
- Enable/Disable: Set as needed
- Permanent: Set if the role is permanent
- Active Dates: Set if not permanent
- Stock Operations: Select allowed operation types
- Locations: Select allowed locations
- Save
Frontend Configuration
Configuration File
Update frontend/config/config-promedhis.json:
{
"@openmrs/esm-stock-management-app": {
"autoPopulateResponsiblePerson": true,
"dispensingUnitsUUID": "162402AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"enablePrintButton": true,
"logo": {
"src": "/openmrs/spa/promed_logo.svg",
"alt": "Promed MRS",
"name": "Promed MRS"
},
"packingUnitsUUID": "162402AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"printBalanceOnHand": false,
"printItemCost": false,
"stockAdjustmentReasonUUID": "YOUR_STOCK_ADJUSTMENT_REASON_UUID",
"stockItemCategoryUUID": "YOUR_STOCK_ITEM_CATEGORY_UUID",
"stockSourceTypeUUID": "YOUR_STOCK_SOURCE_TYPE_UUID",
"stockTakeReasonUUID": "YOUR_STOCK_TAKE_REASON_UUID",
"useItemCommonNameAsDisplay": true
}
}
Getting Concept UUIDs
- Find Concept UUIDs
- Go to Administration → Manage Concepts
- Search for each concept set you created
- Copy the UUID from the concept details page
- Update Configuration
- Replace the placeholder UUIDs in the config file
- Restart the frontend:
docker compose restart frontend
Troubleshooting
Common Issues
1. 404 Error for Concepts
Error: Server responded with 404 () for url /openmrs/ws/rest/v1/concept/[UUID]
Solution:
- Verify the concept exists in OpenMRS
- Check the UUID is correct
- Ensure the concept is not retired
2. 500 Error When Saving User Role Scopes
Error: Error Saving user role scope - Server responded with 500
Solution:
- Ensure all three location tags exist: Main Store, Main Pharmacy, Dispensary
- Verify at least one location has each required tag
- Check that stock operation types exist
3. Empty Dropdowns in Stock Management
Error: Dropdowns for source types, categories, etc. are empty
Solution:
- Verify concept sets have been created with answers
- Check that individual answer concepts exist
- Ensure answers are added as set members
4. No Locations Available for User Role Scopes
Error: No locations appear in the location selection
Solution:
- Verify locations are tagged with Main Store, Main Pharmacy, or Dispensary
- Check that the FHIR API is accessible:
/openmrs/fhir/Location?_tag=main store,main pharmacy,dispensary
Debugging Steps
- Check API Endpoints
# Check stock operation types curl -u "admin:password" "https://your-domain.com/openmrs/ws/rest/v1/stockmanagement/stockoperationtype?v=default" # Check locations with tags curl -u "admin:password" "https://your-domain.com/openmrs/fhir/Location?_tag=main store,main pharmacy,dispensary" # Check concepts curl -u "admin:password" "https://your-domain.com/openmrs/ws/rest/v1/concept/[UUID]" - Check Server Logs
docker logs openmrs-backend --tail 100 - Verify Database
# Connect to database docker exec -it openmrs-db mysql -u openmrs -p[password] openmrs # Check concepts SELECT c.uuid, cn.name FROM concept c JOIN concept_name cn ON c.concept_id = cn.concept_id WHERE cn.name LIKE '%stock%'; # Check location tags SELECT lt.name, l.name as location_name FROM location_tag lt JOIN location_tag_map ltm ON lt.location_tag_id = ltm.location_tag_id JOIN location l ON ltm.location_id = l.location_id;







