Admin Link Staff to System User - hmislk/hmis GitHub Wiki
Admin — Link Staff to System User
A practitioner record (Staff, Doctor, or Consultant) is clinical identity — the person the system bills against and prints on reports. A WebUser is system identity — the login an operator uses to sign in. The two are separate entities, joined by an optional link. The link matters because several behaviours expect them to be paired:
- The cashier signing a bill should be linked to their staff profile so the bill prints the cashier's name correctly.
- Doctors who use the system to view their own bookings need a
WebUserlogin that points at theirDoctorrecord. - Some reports filter by the staff of the logged-in user — without a link, those reports return empty.
This article covers how to make, change, and audit the link.
Navigation
Top menu → Administration → Manage Staff → (Setup tab) → Connect staff to user.
Path: /admin/staff/admin_user_staff.xhtml.
Privilege required: AdminManagingUsers.
What the screen does
The screen is two side-by-side panels:
- Left. User — autocomplete for the
WebUseryou want to configure. - Right. Staff of this user — a listbox of all staff records, with a Save button below.
The currently linked staff member (if any) is highlighted in the listbox when you pick a user.
Linking a user to a staff record
- Type a few letters of the user name in the User autocomplete and pick the user.
- The right-hand listbox refreshes; the current link (if any) is already selected.
- Pick the staff member who should be linked to this user.
- Click Save.
The user is now bound to the chosen staff record. From the next login of that user, any feature that asks which staff is logged in? resolves to the new staff member.
Changing a link
Repeat the steps above and pick a different staff member. The previous link is overwritten — a WebUser is linked to at most one Staff.
Removing a link
Pick the user, scroll to the top of the listbox where you see "Staff" as the placeholder, click it, then Save. The link is cleared.
Limitations
- One-to-one only. A user has at most one staff record, and one staff record can be linked to multiple users only by also linking those users to it separately — there is no built-in multi-user-per-staff enforcement.
- No automatic creation. Creating a user does not auto-create a staff record, and vice versa. They are administered independently.
- No audit history of past links. The current link is stored on the
WebUser; previous values are overwritten. If you need to know who used to be linked to a given staff record, recover it from database backups.
Practical scenarios
| Scenario | What to do |
|---|---|
| A new cashier joins. | Register them as Staff (with EPF, etc.), create a WebUser login for them, link the two on this screen. |
| A doctor will start using HMIS to view their own bookings. | Make sure they already have a Doctor record. Create a WebUser for them. Link the user to the Doctor record. |
| A doctor leaves; you have retired the staff record. | Open this screen for that doctor's user and clear the link (or disable the user in Manage Users so they cannot log in at all). |
| Someone is signed in but bill prints show a different name. | Check the user-to-staff link on this screen and update it. The bill name comes from the linked staff, not the user's own profile name. |
Side-effects of linking
| Feature | Effect of having a link |
|---|---|
| OPD billing | The cashier's staff name appears on the printed bill. |
| Channel billing | Same. |
| Working time / shift screens | The system can default the staff field to the logged-in user's staff. |
| Self-service doctor portal screens | A doctor user sees only their own bookings if the link points at their Doctor record. |
| Reports filtered by "my staff" | Return data; otherwise empty. |