Changes between Version 1 and Version 2 of UseCase18


Ignore:
Timestamp:
09/19/26 17:13:20 (4 days ago)
Author:
236021
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase18

    v1 v2  
    3939}}}
    4040
    41 3. Admin clicks "Create User" and enters the new user's details.
     413. Admin enters the new doctor's professional details, and the system creates the doctor profile first.
    4242
    4343{{{
    4444#!sql
    45 INSERT INTO users (username, password, role, first_name, last_name, is_active)
     45INSERT INTO doctors (specialization_id, department_id, first_name, last_name, email_address, level_id)
     46VALUES (
     47  (SELECT specialization_id FROM doctor_specialization WHERE specialization_name = 'Cardiology'),
     48  (SELECT department_id FROM departments WHERE department_name = 'Cardiology'),
     49  'Nikola',
     50  'Trajkov',
     51  'nikola.trajkov@cardio.com',
     52  (SELECT level_id FROM doctor_level WHERE level = 'RESIDENT')
     53)
     54RETURNING doctor_id;
     55}}}
     56
     574. Admin enters the new login credentials, and the system creates the user account linked to that doctor profile.
     58
     59{{{
     60#!sql
     61INSERT INTO users (username, password, role, first_name, last_name, is_active, doctor_id)
    4662VALUES (
    4763  'nikola.trajkov',
     
    5066  'Nikola',
    5167  'Trajkov',
    52   TRUE
     68  TRUE,
     69  (SELECT MAX(doctor_id) FROM doctors)
    5370)
    5471RETURNING user_id;
    55 }}}
    56 
    57 4. System creates the role-specific profile linked to the new user.
    58 
    59 {{{
    60 #!sql
    61 INSERT INTO doctors (user_id, specialization_id, department_id, first_name, last_name, email_address, level_id)
    62 VALUES (
    63   (SELECT user_id FROM users WHERE username = 'nikola.trajkov'),
    64   (SELECT specialization_id FROM doctor_specialization WHERE specialization_name = 'Cardiology'),
    65   (SELECT department_id FROM departments WHERE department_name = 'Cardiology'),
    66   'Nikola',
    67   'Trajkov',
    68   'nikola.trajkov@cardio.com',
    69   (SELECT level_id FROM doctor_level WHERE level = 'RESIDENT')
    70 );
    7172}}}
    7273