Changes between Version 1 and Version 2 of UseCase09


Ignore:
Timestamp:
09/19/26 17:07:01 (3 days ago)
Author:
236021
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase09

    v1 v2  
    44
    55== Description ==
    6 After performing a procedure, a doctor records the outcome. The system stores the procedure result, links it to the patient's medical record, and updates the performed procedure notes.
     6After performing a procedure, a doctor records the outcome. The system stores the procedure result and updates the performed procedure notes. The result becomes visible on the patient's medical record through the procedure's existing link to that record.
    77
    88== Scenario ==
     
    7878}}}
    7979
    80 5. System links the procedure result to the patient's medical record.
    81 
    82 {{{
    83 #!sql
    84 INSERT INTO medical_record_procedure_results (record_id, result_id)
    85 VALUES (
    86   (SELECT record_id FROM medical_records WHERE patient_id = (
    87 SELECT patient_id
    88 FROM users
    89 WHERE username = 'maja.veljanova')),
    90   (SELECT MAX(result_id)
    91 FROM procedure_results)
    92 );
    93 }}}
    94 
    95 6. System confirms and displays all procedure results on the patient's medical record.
     805. System confirms and displays all procedure results on the patient's medical record, using the existing link between the medical record and the procedure catalog entry.
    9681
    9782{{{
     
    9984SELECT
    10085  p.procedure_type,
    101   pr.result_description,
    102   pr.result_date
    103 FROM medical_record_procedure_results mpr
    104 JOIN procedure_results pr ON mpr.result_id = pr.result_id
    105 JOIN procedures p ON pr.procedure_id = p.procedure_id
    106 WHERE mpr.record_id = (
    107 SELECT record_id
    108 FROM medical_records
    109 WHERE patient_id = (
    110 SELECT patient_id
    111 FROM users
    112 WHERE username = 'maja.veljanova'));
     86  pres.result_description,
     87  pres.result_date
     88FROM medical_record_procedures mrp
     89JOIN procedures p ON mrp.procedure_id = p.procedure_id
     90JOIN procedure_results pres ON pres.procedure_id = p.procedure_id
     91WHERE mrp.record_id = (
     92  SELECT record_id
     93  FROM medical_records
     94  WHERE patient_id = (
     95    SELECT patient_id
     96    FROM users
     97    WHERE username = 'maja.veljanova'
     98  )
     99);
    113100}}}