UseCase18PrototypeImplementation - System Administrator Manages Users
Initiating Actor - System Administrator
Description
A system administrator creates new user accounts. The admin can register doctors, patients, and other users by entering their data directly into a form.
Scenario
1.System Admin navigates to the user management section and clicks "Add New Doctor".
- System Admin fills in the doctor's information and submits the form.
INSERT INTO doctors (first_name, last_name, email_address, level_id, specialization_id, department_id)
VALUES (
'Maja',
'Ivanova',
'maja.ivanova@hospital.com',
2,
2,
2
)
RETURNING doctor_id;
- System creates the linked user account using the newly created doctor's ID.
INSERT INTO users (username, password, role, first_name, last_name, is_active, doctor_id)
VALUES (
'maja.ivanova@medora.com',
'password123',
'DOCTOR',
'Maja',
'Ivanova',
TRUE,
(SELECT doctor_id FROM doctors WHERE email_address = 'maja.ivanova@hospital.com')
)
RETURNING user_id;
- System displays the updated doctor list confirming the new account.
SELECT
u.user_id,
u.username,
u.role,
d.first_name,
d.last_name,
u.is_active,
ds.specialization_name,
dep.department_name,
dl.level
FROM doctors d
JOIN users u ON d.doctor_id = u.doctor_id
LEFT JOIN doctor_specialization ds ON d.specialization_id = ds.specialization_id
LEFT JOIN departments dep ON d.department_id = dep.department_id
LEFT JOIN doctor_level dl ON d.level_id = dl.level_id
ORDER BY u.username;
Last modified
16 hours ago
Last modified on 06/26/26 08:28:25
Attachments (3)
- uc018-1.png (93.3 KB ) - added by 16 hours ago.
- uc-018-2.png (31.7 KB ) - added by 16 hours ago.
- uc018-3.png (60.3 KB ) - added by 16 hours ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.



