Skip to content

Latest commit

 

History

History
88 lines (71 loc) · 3.64 KB

UC23.md

File metadata and controls

88 lines (71 loc) · 3.64 KB

API Documentation for UC23 Laboratory Test Results Management

Summary Table

Function Endpoint Method Request Payload Success Response Error Responses
Order Laboratory Tests /api/lab_tests/order POST patientMID (String), testName (String), labName (String), instructions (String) 200 OK - Success Message 400 Bad Request - Missing or incorrect information
401 Unauthorized - User not authenticated
Process and Record Test Results /api/lab_tests/record_results POST patientMID (String), testName (String), labName (String), results (String), notes (String) 200 OK - Success Message 400 Bad Request - Missing or incorrect information
401 Unauthorized - User not authenticated
View Laboratory Test Results /api/lab_tests/view_results/{patientMID} GET patientMID (String) 200 OK - Test Results 404 Not Found - No results found
401 Unauthorized - User not authenticated

API Documentation Details

Authentication

Before making any requests, users (Patients, HCPs, Lab Techs, Personal Representatives, or Administrators) need to authenticate themselves in iTrust2.

1. Order Laboratory Tests (S1)

  • Endpoint: /api/lab_tests/order

  • Method: POST

  • Request Payload:

    • Parameters:
      • patientMID (String): MID (username) of the patient.
      • testName (String): Name of the laboratory test (Up to 250 alphanumeric characters).
      • labName (String): Name of the lab (Up to 250 alphanumeric characters).
      • instructions (String): Special instructions for the test (Up to 500 characters).
  • Success Response:

    • Status: 200 OK
    • Content: { "message": "Laboratory tests ordered successfully." }
  • Error Responses:

    • Status: 400 Bad Request
      • Content: { "error": "Missing or incorrect information. Please check your request." }
    • Status: 401 Unauthorized
      • Content: { "error": "User not authenticated." }

2. Process and Record Test Results (S2)

  • Endpoint: /api/lab_tests/record_results

  • Method: POST

  • Request Payload:

    • Parameters:
      • patientMID (String): MID (username) of the patient.
      • testName (String): Name of the laboratory test (Up to 250 alphanumeric characters).
      • labName (String): Name of the lab (Up to 250 alphanumeric characters).
      • results (String): Test results (Alphanumeric, up to 500 characters).
      • notes (String): Additional notes or observations (Up to 500 characters).
  • Success Response:

    • Status: 200 OK
    • Content: { "message": "Laboratory test results recorded successfully." }
  • Error Responses:

    • Status: 400 Bad Request
      • Content: { "error": "Missing or incorrect information. Please check your request." }
    • Status: 401 Unauthorized
      • Content: { "error": "User not authenticated." }

3. View Laboratory Test Results (S3)

  • Endpoint: /api/lab_tests/view_results/{patientMID}

  • Method: GET

  • Request Parameters:

    • patientMID (String): MID (username) of the patient.
  • Success Response:

    • Status: 200 OK
    • Content:
      {
        "testResults": [
          {
            "testName": "Blood Test",
            "labName": "Central Lab",
            "results": "Normal",
            "notes": "No abnormalities detected."
          },
          // ... other test results
        ]
      }
  • Error Responses:

    • Status: 404 Not Found
      • Content: { "error": "No laboratory test results found for the specified patient." }
    • Status: 401 Unauthorized
      • Content: { "error": "User not authenticated." }