List Doctor Tests (v1)
Method & Path
GET /api/v1/doctors/tests
Actual backend path: /v1/doctors/tests
Description
List all lab tests assigned to the authenticated doctor across all workspaces. Doctors are global entities and can view tests from any workspace where they are assigned.
Authentication
Required: Bearer token in Authorization header
Required Permissions:
- Doctor authentication
Headers
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Bearer token: Bearer <token> |
Path Parameters
None
Query Parameters
None (all tests for the doctor are returned; client-side filtering may be applied)
Request Body
No request body required.
Response 200 OK
{
"tests": [
{
"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
- 500 Internal Server Error: Server error