Skip to main content

Get Doctor Test (v1)

Method & Path

GET /api/v1/doctors/tests/:testId

Actual backend path: /v1/doctors/tests/:testId

Description

Get detailed information about a specific lab test by ID. The test must be assigned to the authenticated doctor.

Authentication

Required: Bearer token in Authorization header

Required Permissions:

  • Doctor authentication

Headers

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token: Bearer <token>

Path Parameters

ParameterTypeRequiredDescription
testIdstringYesTest identifier

Query Parameters

None

Request Body

No request body required.

Response 200 OK

{
"test": {
"id": "507f1f77bcf86cd799439015",
"workspaceId": "507f1f77bcf86cd799439012",
"clientId": "507f1f77bcf86cd799439016",
"clientName": "John Doe",
"supervisorEmployeeId": "507f1f77bcf86cd799439017",
"supervisorName": "Dr. Smith",
"doctorId": "507f1f77bcf86cd799439018",
"doctorName": "Dr. Johnson",
"testDate": "2024-01-15T10:00:00Z",
"status": "pending",
"customFieldsJson": {
"sampleId": "SAMPLE-001"
},
"notes": "Follow-up required",
"invoiceId": null,
"incomeEntryId": null,
"postedAt": null,
"items": [
{
"id": "507f1f77bcf86cd799439020",
"testId": "507f1f77bcf86cd799439015",
"analysisId": "507f1f77bcf86cd799439011",
"analysisName": "Complete Blood Count",
"priceSnapshot": 150,
"unitSnapshot": "mg/dL",
"resultType": "numeric",
"resultValueNumeric": null,
"resultValueText": null,
"matchedRangeId": null,
"computedFlag": "unknown",
"resultNotes": [],
"aiInterpretation": null,
"aiInterpretedAt": null,
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
],
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
}

Common Errors

  • 401 Unauthorized: Missing or invalid authentication token
  • 403 Forbidden: Test is not assigned to the authenticated doctor
  • 404 Not Found: Test not found
  • 500 Internal Server Error: Server error