Changes between Initial Version and Version 1 of UseCase12


Ignore:
Timestamp:
06/12/26 18:28:50 (3 days ago)
Author:
236021
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase12

    v1 v1  
     1= UseCase12 - Create Medical Report =
     2
     3== Initiating Actor - `Doctor` ==
     4
     5== Description ==
     6A doctor creates a medical report for a patient documenting consultation findings. The system records the report with the doctor, date, and description entered by the doctor.
     7
     8== Scenario ==
     9
     101. Doctor opens a patient's medical record.
     11
     12{{{
     13#!sql
     14SELECT
     15  mr.record_id,
     16  mr.patient_id
     17FROM medical_records mr
     18WHERE mr.patient_id = (
     19  SELECT patient_id FROM users WHERE username = 'maja.veljanova'
     20);
     21}}}
     22
     232. Doctor navigates to "Add new report" and enters the report description and date.
     24
     25{{{
     26#!sql
     27INSERT INTO medical_report (record_id, doctor_id, description, report_date)
     28VALUES (
     29  (SELECT record_id FROM medical_records WHERE patient_id = (SELECT patient_id FROM users WHERE username = 'maja.veljanova')),
     30  (SELECT doctor_id FROM users WHERE username = 'elena.kirova'),
     31  'Patient presents with hypertension. Recent ECG shows normal sinus rhythm.',
     32  '2026-05-30'
     33)
     34RETURNING report_id;
     35}}}
     36
     373. System displays the completed report with all entered information.
     38
     39{{{
     40#!sql
     41SELECT
     42  mr.report_id,
     43  mr.description,
     44  mr.report_date,
     45  u_d.first_name AS doctor_first_name,
     46  u_d.last_name AS doctor_last_name
     47FROM medical_report mr
     48JOIN doctors d ON mr.doctor_id = d.doctor_id
     49JOIN users u_d ON d.doctor_id = u_d.doctor_id
     50WHERE mr.report_id = (
     51SELECT MAX(report_id)
     52FROM medical_report);
     53}}}