> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://imo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://imo.ferndocs.com/_mcp/server.

# Quickstart

#### Install an SDK

**`npm`**

```bash title="npm"
npm install @imo-demo/precision-normalize
```

**`pip`**

```bash title="pip"
pip install imo-precision-normalize
```

**`Maven`**

```xml title="Maven"
<dependency>
  <groupId>com.imohealth</groupId>
  <artifactId>precision-normalize</artifactId>
  <version>0.1.0</version>
</dependency>
```

#### Set your credentials

Export the client credentials issued to you in the
[Developer Portal](https://developer.imohealth.com/):

```bash
export IMO_CLIENT_ID="your-client-id"
export IMO_CLIENT_SECRET="your-client-secret"
```

The SDK exchanges these for a JWT automatically and refreshes it before it
expires. See [Authentication](/documentation/getting-started/authentication) for
the underlying flow.

#### Normalize a term

**`TypeScript`**

```typescript title="TypeScript"
import { ImoHealthClient } from "@imo-demo/precision-normalize";

const client = new ImoHealthClient({
  clientId: process.env.IMO_CLIENT_ID!,
  clientSecret: process.env.IMO_CLIENT_SECRET!,
});

const result = await client.normalize.normalize({
  clientRequestId: "quickstart-001",
  preferences: { threshold: 0.5, size: 3 },
  requests: [
    { recordId: "1", domain: "Problem", inputTerm: "chest pain" },
    { recordId: "2", domain: "Problem", inputTerm: "type 2 diabetes" },
  ],
});

for (const record of result.requests ?? []) {
  const top = record.response?.items?.[0];
  console.log(record.recordId, "->", top?.lexicalTitle, top?.score);
}
```

**`Python`**

```python title="Python"
import os
from imo_precision_normalize import (
    ImoHealth,
    NormalizeRequestPreferences,
    NormalizeRequestRequestsItem,
)

client = ImoHealth(
    client_id=os.environ["IMO_CLIENT_ID"],
    client_secret=os.environ["IMO_CLIENT_SECRET"],
)

result = client.normalize.normalize(
    client_request_id="quickstart-001",
    preferences=NormalizeRequestPreferences(threshold=0.5, size=3),
    requests=[
        NormalizeRequestRequestsItem(
            record_id="1", domain="Problem", input_term="chest pain"
        ),
        NormalizeRequestRequestsItem(
            record_id="2", domain="Problem", input_term="type 2 diabetes"
        ),
    ],
)

for record in result.requests or []:
    items = (record.response.items if record.response else None) or []
    if items:
        print(record.record_id, "->", items[0].lexical_title, items[0].score)
```

**`Java`**

```java title="Java"
ImoHealth client = ImoHealth.builder()
    .clientId(System.getenv("IMO_CLIENT_ID"))
    .clientSecret(System.getenv("IMO_CLIENT_SECRET"))
    .build();

NormalizeResponse result = client.normalize().normalize(
    NormalizeRequest.builder()
        .clientRequestId("quickstart-001")
        .requests(List.of(
            NormalizeRequestRequestsItem.builder()
                .recordId("1")
                .domain(Domain.PROBLEM)
                .inputTerm("chest pain")
                .build()))
        .build());
```

**`cURL`**

```bash title="cURL"
curl -X POST https://api-sandbox.imohealth.com/precision/normalize/v1 \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "client_request_id": "quickstart-001",
    "preferences": { "threshold": 0.5, "size": 3 },
    "requests": [
      { "record_id": "1", "domain": "Problem", "input_term": "chest pain" }
    ]
  }'
```

#### Read the response

Each record echoes your `record_id` and carries a ranked `items` array. The
`score` is a confidence value from 0–1, with `1` an exact match.

```json
{
  "summary": { "count": 1, "error_count": 0 },
  "request_id": "7f3c1a90-5f2e-4d1b-9c8a-1b2c3d4e5f60",
  "client_request_id": "quickstart-001",
  "response_time": 42,
  "requests": [
    {
      "record_id": "1",
      "domain": "Problem",
      "input_term": "chest pain",
      "response": {
        "match_field": "input_term",
        "domain": "Problem",
        "explanation": "The input term 'chest pain' was matched to the IMO lexical 'Chest pain' with a score of 1.0.",
        "items": [
          {
            "lexical_code": "3763",
            "lexical_title": "Chest pain",
            "score": 1.0,
            "certainty": "High"
          }
        ]
      }
    }
  ]
}
```

> **Tip**
>
> Set `preferences.size` to cap how many candidate lexicals come back per record,
> and `preferences.threshold` to drop low-confidence matches entirely.

## Where to go next

#### [Matching preferences](/documentation/guides/normalize)

Thresholds, term-vs-code priority, transformations, and filters.

#### [Add clinical context](/documentation/guides/enrichment)

Improve Problem-domain matches with age, sex, and ICD-10 history.

#### [Close the loop](/documentation/guides/sessions-and-feedback)

Report which results your users picked.