wiki:UseCase07PrototypeImplementation

Version 2 (modified by 236021, 17 hours ago) ( diff )

--

UseCase07PrototypeImplementation - Lab Technician Submits Lab Results

Initiating Actor - Lab Technician

Description

A lab technician views pending lab tests, performs the test, and submits the results. The system records the results, links them to the patient's medical record, and makes them available to the doctor.

Scenario

  1. Lab technician logs in and navigates to "Pending Lab Tests" and selects for a certain patient for a certain date.

SELECT
    lt.test_id,
    lt.test_name,
    lt.description,
    lt.cost
FROM lab_tests lt
WHERE lt.test_id IN (
    SELECT test_id FROM performed_lab_tests
    WHERE patient_id = 4 AND test_date = '2026-06-16'
);
  1. Technician selects the pending Complete Blood Count test for the patient and views its details.
SELECT
    lt.test_id,
    lt.test_name,
    lt.description,
    lt.cost
FROM lab_tests lt
WHERE lt.test_id = (
    SELECT test_id FROM performed_lab_tests
    WHERE patient_id = 4 AND test_date = '2026-06-05'
);
  1. Technician performs the test and submits the results.

INSERT INTO lab_results (test_id, results, result_date)
VALUES (
    (SELECT test_id FROM performed_lab_tests
     WHERE patient_id = 4 AND test_date = '2026-06-05'),
    'Blood pressure: 145/90, Glucose: 105 mg/dL',
    '2026-06-05'
)
RETURNING result_id;
  1. System links the lab result to the patient's medical record.

INSERT INTO medical_record_lab_results (record_id, result_id)
VALUES (
    4,(SELECT MAX(result_id) FROM lab_results)
);
  1. System confirms submission and displays the submitted results.
SELECT
    lt.test_name,
    lr.results,
    lr.result_date
FROM medical_record_lab_results mrlr
         JOIN medical_records mr ON mrlr.record_id = mr.record_id
         JOIN lab_results lr ON mrlr.result_id = lr.result_id
         JOIN lab_tests lt ON lr.test_id = lt.test_id
WHERE mr.patient_id = 4
  AND lr.result_date = '2026-06-16';

Attachments (5)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.