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

# Medications

> Manage medication definitions, ingredients, and batch information.

# Medications

Medications represent drug definitions — the medication itself, not a prescription. For medication orders, see [Prescriptions](/guides/prescriptions).

## Create a Medication

```ts theme={null}
// Simple — free-text name
const { data: med } = await clinik.medications.create({
  code: 'Amoxicillin 500mg Capsule',
  status: 'active',
  form: 'capsule',
  manufacturer: 'Teva Pharmaceuticals',
});

// Coded — RxNorm with full details
const { data: coded } = await clinik.medications.create({
  code: {
    system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
    code: '308182',
    display: 'Amoxicillin 500 MG Oral Capsule',
  },
  status: 'active',
  form: 'capsule',
  manufacturer: 'Teva Pharmaceuticals',
  amount: {
    numerator: { value: 500, unit: 'mg' },
    denominator: { value: 1, unit: 'capsule' },
  },
  ingredient: [
    {
      item: {
        system: 'http://www.nlm.nih.gov/research/umls/rxnorm',
        code: '723',
        display: 'Amoxicillin',
      },
      isActive: true,
      strength: {
        numerator: { value: 500, unit: 'mg' },
        denominator: { value: 1, unit: 'capsule' },
      },
    },
  ],
  batch: {
    lotNumber: 'LOT-2025-A001',
    expirationDate: '2026-12-31',
  },
});
```

## Manufacturer

Track the drug manufacturer:

```ts theme={null}
const { data } = await clinik.medications.create({
  code: 'Metformin 500mg Tablet',
  form: 'tablet',
  manufacturer: 'Merck & Co.',
});
```

The manufacturer is returned in read responses and can be updated:

```ts theme={null}
await clinik.medications.update('med_abc123', {
  manufacturer: 'Generic Pharma Inc.',
});
```

## Amount

Specify the total amount of drug in the package using a ratio:

```ts theme={null}
const { data } = await clinik.medications.create({
  code: 'Insulin Glargine',
  form: 'injection',
  manufacturer: 'Sanofi',
  amount: {
    numerator: { value: 100, unit: 'units' },
    denominator: { value: 1, unit: 'mL' },
  },
});
```

## Coding Systems

| System    | Use Case               | Example                    |
| --------- | ---------------------- | -------------------------- |
| RxNorm    | US drug codes          | `197361` (Lisinopril 10mg) |
| SNOMED CT | Clinical terms         | `387207008` (Ibuprofen)    |
| Free text | When no code available | `"Custom compound cream"`  |

## Update a Medication

```ts theme={null}
await clinik.medications.update('med_abc123', {
  status: 'inactive',
  manufacturer: 'Updated Pharma Corp.',
  batch: { expirationDate: '2025-06-30' },
});
```

## Search Medications

```ts theme={null}
const { data } = await clinik.medications.search({
  status: 'active',
  count: 50,
});

for (const med of data.data) {
  console.log(`${med.code} — ${med.form}`);
  console.log(`  Manufacturer: ${med.manufacturer}`);
  if (med.batch) {
    console.log(`  Lot: ${med.batch.lotNumber}, Expires: ${med.batch.expirationDate}`);
  }
}
```

## Medications vs Prescriptions

| Resource     | FHIR Type           | Purpose                                      |
| ------------ | ------------------- | -------------------------------------------- |
| Medication   | `Medication`        | Drug definition (what the drug is)           |
| Prescription | `MedicationRequest` | Medication order (prescribe it to a patient) |

A prescription references a medication. You can create prescriptions with inline medication codes without creating a separate Medication resource first.

## Complete Field Reference

| Field          | Type                              | Required | Description                                    |
| -------------- | --------------------------------- | -------- | ---------------------------------------------- |
| `code`         | `string \| CodeableConcept`       | Yes      | RxNorm, SNOMED CT, or free-text name           |
| `status`       | `string`                          | No       | active (default), inactive                     |
| `form`         | `string`                          | No       | Dosage form (tablet, capsule, injection, etc.) |
| `manufacturer` | `string`                          | No       | Manufacturer name                              |
| `amount`       | `{ numerator, denominator }`      | No       | Total amount of drug in package                |
| `ingredient`   | `Array`                           | No       | Active and inactive ingredients with strength  |
| `batch`        | `{ lotNumber?, expirationDate? }` | No       | Batch/lot tracking information                 |
