Changes between Version 2 and Version 3 of UseCase18
- Timestamp:
- 09/22/26 16:03:16 (21 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UseCase18
v2 v3 39 39 }}} 40 40 41 3. Admin enters the new doctor's professional details, and the system creates the doctor profile first.41 3. Admin enters the new login credentials, and the system creates the user account first, since the doctor profile will need to reference it. 42 42 43 43 {{{ 44 44 #!sql 45 INSERT INTO doctors (specialization_id, department_id, first_name, last_name, email_address, level_id)45 INSERT INTO users (username, password, role, first_name, last_name, is_active) 46 46 VALUES ( 47 (SELECT specialization_id FROM doctor_specialization WHERE specialization_name = 'Cardiology'), 48 (SELECT department_id FROM departments WHERE department_name = 'Cardiology'), 47 'nikola.trajkov2@medora.com', 48 '$2b$12$slaz0XboBErLVSsQBaQSQOkl2uOd8/RiEzyovbImHAS95rtMvKDiO', 49 'DOCTOR', 49 50 'Nikola', 50 51 'Trajkov', 51 'nikola.trajkov@cardio.com', 52 (SELECT level_id FROM doctor_level WHERE level = 'RESIDENT') 52 TRUE 53 53 ) 54 RETURNING doctor_id;54 RETURNING user_id; 55 55 }}} 56 56 57 4. Admin enters the new login credentials, and the system creates the user account linked to that doctor profile.57 4. Admin enters the new doctor's professional details, and the system creates the doctor profile linked to that user account. 58 58 59 59 {{{ 60 60 #!sql 61 INSERT INTO users (username, password, role, first_name, last_name, is_active, doctor_id)61 INSERT INTO doctors (doctor_id, first_name, last_name, email_address, level_id, specialization_id, department_id, user_id) 62 62 VALUES ( 63 'nikola.trajkov', 64 'password123', 65 'DOCTOR', 63 (SELECT COALESCE(MAX(doctor_id), 0) + 1 FROM doctors), 66 64 'Nikola', 67 65 'Trajkov', 68 TRUE, 69 (SELECT MAX(doctor_id) FROM doctors) 66 'nikola.trajkov2@medora.com', 67 (SELECT level_id FROM doctor_level WHERE level = 'RESIDENT'), 68 (SELECT specialization_id FROM doctor_specialization WHERE specialization_name = 'CARDIOLOGY'), 69 (SELECT department_id FROM departments WHERE department_name = 'CARDIOLOGY_DEPT'), 70 (SELECT MAX(user_id) FROM users) 70 71 ) 71 RETURNING user_id;72 RETURNING doctor_id; 72 73 }}} 73 74
