# Model: Medication

**Table**: `clinic_medications` (new, Phase 8)

## Purpose

A lightweight drug master for prescription autocomplete and reporting — explicitly **not** an
inventory item (per the user's confirmed decision: e-prescription + print only, no stock
deduction). No FK to any `Inventory\*` model anywhere in this design.

## Fields

| Column | Type | Constraints | Notes |
|---|---|---|---|
| `id` | bigint | PK | |
| `name` | string | | brand or common name |
| `generic_name` | string | nullable | |
| `form` | string | nullable | tablet / capsule / injection / syrup / etc. |
| `strength` | string | nullable | e.g. "500mg" — free text, not parsed |
| `is_active` | boolean | default `true` | soft "retire from picker" flag, not a delete |
| `created_at` / `updated_at` | timestamp | | |

## Relationships

| Relation | Type | Target |
|---|---|---|
| `prescriptionItems()` | `hasMany` | `PrescriptionItem` |

## Decisions

- Deliberately minimal — no stock/unit-cost/supplier columns, since this table exists purely to
  make prescription entry faster and consistent (autocomplete + reporting "top prescribed drugs"),
  not to manage pharmacy stock. If stock tracking is ever wanted, that's an explicit future
  decision to integrate with the existing `Inventory` module's item model, not an extension of
  this table.
- `PrescriptionItem.medication_id` is nullable (see `Prescription.md`) precisely so a doctor can
  still prescribe a drug not yet in this catalog via free text, rather than blocking prescription
  entry on catalog completeness.
