# Model: Vital

**Table**: `clinic_vitals` (new, Phase 6)

## Purpose

One structured measurement snapshot per encounter. The foundation every weight/BMI trend (Phase
7, bariatric), blood-pressure trend (internal medicine), and blood-glucose spot-check (diabetes)
report is built on — previously impossible since `clinic_medical_records` had no numeric fields
at all.

## Fields

| Column | Type | Constraints | Notes |
|---|---|---|---|
| `id` | bigint | PK | |
| `encounter_id` | bigint | `foreignId('encounter_id')->constrained('clinic_encounters')->cascadeOnDelete()` unique | 1:1 with the encounter |
| `weight_kg` | decimal(5,2) | nullable | |
| `height_cm` | decimal(5,2) | nullable | usually only re-entered occasionally, but stored per-encounter to compute BMI at that point in time |
| `bmi` | decimal(4,1) | nullable, computed on save (`weight_kg / (height_cm/100)^2`) | stored, not virtual, so it's directly indexable/queryable for trend charts and the Phase 13 "average weight loss" report |
| `waist_circumference_cm` | decimal(5,2) | nullable | relevant for obesity/bariatric assessment |
| `systolic_bp` | unsignedSmallInteger | nullable | |
| `diastolic_bp` | unsignedSmallInteger | nullable | |
| `pulse` | unsignedSmallInteger | nullable | |
| `temperature_c` | decimal(4,1) | nullable | |
| `blood_glucose_mgdl` | unsignedSmallInteger | nullable | spot-check reading; distinct from the lab-verified HbA1c/fasting-glucose values in `LabResult` (Phase 9) — this is the in-visit finger-stick reading |
| `recorded_at` | datetime | default `now()` | may differ from `created_at` if entered retroactively |
| `created_at` / `updated_at` | timestamp | | |

## Relationships

| Relation | Type | Target |
|---|---|---|
| `encounter()` | `belongsTo` | `Encounter` |

## Decisions

- `bmi` is computed and **stored** (not a virtual/accessor-only value) specifically so Phase 7's
  weight-trend view and Phase 13's bariatric-outcomes report can query it directly without
  recomputing per row on every request.
- `blood_glucose_mgdl` here is intentionally separate from lab-ordered glucose tests
  (`LabResult`, Phase 9) — this column is the quick in-clinic finger-stick reading a doctor takes
  during the visit, not a lab-verified value; both exist because they serve different clinical
  purposes and neither should be conflated with the other in reporting.
