# Search diagnostic tests

Operation ID: `graph.searchDiagnosticTests`

Faceted search over the Algolia diagnostic_tests index (FDA CLIA catalog). Default grain is per-analyte — a hit represents an analyte, not a concrete test; drill into concrete tests via graph.listDiagnosticTests filtered by analyte_id.

## Public method

`searchDiagnosticTests`

Signature: `graph.searchDiagnosticTests(query)`

Return type: `Promise<DiagnosticTestSearchResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /diagnostic-tests/search`

## Path parameters

None.

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `analyte_id` | `string` | No |  |  |  | No |  |
| `complexity` | `string` | No |  | WAIVED, MODERATE, HIGH |  | No |  |
| `hits_per_page` | `integer` | No |  |  | `20` | No |  |
| `page` | `integer` | No |  |  | `0` | No |  |
| `q` | `string` | No |  |  | `""` | No |  |
| `specialty` | `string` | No |  |  |  | No |  |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`SearchDiagnosticTestsResponse`](../models/SearchDiagnosticTestsResponse.md) | application/json | Diagnostic-test search results |

## Success response examples

### 200

```json
{
  "facets": {},
  "hits": [],
  "nbHits": 0,
  "nbPages": 0,
  "page": 0
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `401` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `500` | [`graph.ErrorResponse`](../models/graph.ErrorResponse.md) | application/json | Internal server error |

## Error examples

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

### 500 — Unexpected service failure (sanitized example)

```json
{
  "error": "Internal server error"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
```

```ts
const query = {
  "analyte_id": "<ANALYTE_ID>",
  "complexity": "WAIVED",
  "hits_per_page": 20,
  "page": 0,
  "q": "",
  "specialty": "<SPECIALTY>"
};

const result = await graph.searchDiagnosticTests(query);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-graph.health.cloud/diagnostic-tests/search?analyte_id=%3CANALYTE_ID%3E&complexity=WAIVED&hits_per_page=20&page=0&q=&specialty=%3CSPECIALTY%3E'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
