> ## Documentation Index
> Fetch the complete documentation index at: https://docs.byblend.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How do I record a patient's allergies, conditions, and medications?

> Send them as freeform text in the risk_factors object at patient creation, or POST to /api/v1/patients/{patient_id}/risk_factors/raw_text later. Blend parses and standardizes the text asynchronously.

Blend accepts risk factors as plain text. You don't need to look up codes or match to a controlled vocabulary — send `"peanuts, tree nuts, shellfish"` and Blend parses it, standardizes it, and attaches structured risk factors to the patient. Delimit with commas, semicolons, or slashes.

This matters clinically: risk factors drive the drug utilization review that every prescription passes through before it can be filled. A patient record with no allergies recorded is not the same as a patient with no allergies.

## At patient creation

```json theme={null}
{
  "first_name": "Willard",
  "last_name": "Donnelly",
  "email": "wdonnelly@example.com",
  "phone": "6417383445",
  "date_of_birth": "1990-01-01",
  "address": { "address_1": "140 Lindgren Street", "city": "Boston", "state": "MA", "zip_code": "02108" },
  "risk_factors": {
    "allergies": "peanuts, tree nuts, shellfish",
    "conditions": "asthma, hypertension",
    "medications": "albuterol, levothyroxine"
  }
}
```

## Adding them later

```bash theme={null}
curl -X POST https://api.byblend.com/api/v1/patients/clinic-pt-4471/risk_factors/raw_text \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "allergies": "Penicillin, latex",
    "conditions": "Asthma, hypertension",
    "medications": "vyvanse/metformin"
  }'
```

The path accepts your `external_id` as well as the Blend UUID.

<Warning>
  **Parsing is asynchronous.** The endpoint returns before the text has been processed into standardized risk factors. If you read the patient's risk factors back immediately, they may not be there yet. Don't build a synchronous write-then-verify loop around this.
</Warning>

## Reading them back

```bash theme={null}
curl https://api.byblend.com/api/v1/patients/clinic-pt-4471/risk_factors \
  -H "Authorization: Bearer {access_token}"
```

Risk factors come back separated into allergies, conditions, and medications, with the standardized match alongside the original text.

## Removing one

Risk factors are deactivated rather than deleted, so the clinical history stays intact:

```bash theme={null}
curl -X DELETE https://api.byblend.com/api/v1/patients/{patient_id}/risk_factors/{risk_factor_id} \
  -H "Authorization: Bearer {access_token}"
```

<Note>
  Pregnancy, smoking, and diabetes are separate boolean fields on the patient record — `is_pregnant`, `is_smoker`, `is_diabetic` — not risk-factor text. Set them with `POST /patients` or `PATCH /patients/{patient_id}`.
</Note>

<Tip>
  Send the patient's medication list even for drugs Blend doesn't dispense. The interaction check is only as good as the medication list it runs against, and your business is usually the only party that knows the full picture.
</Tip>

Risk factors are also visible and editable on the patient record in the Blend Dashboard, which is where clinical staff typically review them.

<CardGroup cols={2}>
  <Card title="Add freeform risk factor text" icon="notes-medical" href="/api-reference/patients/add-freeform-risk-factor-text">
    POST /patients/{'{'}patient\_id{'}'}/risk\_factors/raw\_text
  </Card>

  <Card title="Get a patient's risk factors" icon="list-check" href="/api-reference/patients/get-a-patients-risk-factors">
    Parsed and standardized
  </Card>

  <Card title="Deactivate a risk factor" icon="xmark" href="/api-reference/patients/deactivate-a-risk-factor">
    Soft-delete, history preserved
  </Card>

  <Card title="Create a patient" icon="user-plus" href="/api-reference/patients/create-a-patient">
    Accepts `risk_factors` inline
  </Card>
</CardGroup>
