Admin Default Service Departments - hmislk/hmis GitHub Wiki
Default Service Departments
Overview
The Default Service Department feature defines which service department handles a given item when a specific ordering department requests it. For example, when an OPD General Counter orders a blood test, the system can automatically route the request to the Main Laboratory department. This drives automated referral routing and ensures work orders land in the correct department without manual selection.
When to Use
- Setting up automatic routing of ordered investigations to the correct lab or radiology department
- Configuring which service department is pre-selected when a specific item is added to a bill from a specific ordering department
- Reviewing or auditing routing rules
Navigating to Default Service Departments
- Click Administration → Manage Items
- In the item management index, navigate to Default Service Departments (or Add Default Service Department)
Required privilege: AdminItems
Adding a New Default Service Department Rule
- Navigate to Add Default Service Department
- Fill in:
| Field | Description |
|---|---|
| Ordering Department | The department that places the order (e.g. OPD Counter, Ward 3) — type to search. Shows institution + department in the dropdown. |
| Service Department | The department that will fulfil the service (e.g. Main Lab, Radiology) — type to search |
| Category | The item category this rule applies to (optional — restricts the rule to a category) |
| Item | The specific item this rule applies to (optional — restricts to one item; type to search) |
- Click Add
Viewing and Managing Existing Rules
Navigate to List Default Service Departments to see all existing routing rules. From there you can:
- View the current list of rules
- Edit an existing rule via Edit Default Service Department
- Delete rules that are no longer needed
How This Rule Is Applied
When a billing clerk in the Ordering Department adds the specified Item (or any item in the specified Category) to a bill, the Service Department is automatically pre-selected as the department that will deliver the service. This saves the clerk from having to manually choose the fulfilling department each time.
Technical Notes (Admin/Developer)
Default service department rules are stored as DefaultServiceDepartment entities managed by defaultServiceDepartmentController. The saveNewDefaultServiceDepartment() method creates the record. During billing, the engine checks for a matching DefaultServiceDepartment for the ordering department + item combination and uses the serviceDepartment as the default.