This glossary defines MedTracker's core domain language so model names, UI copy, and business rules stay consistent.
UI components and presenters must use these domain terms and consume server-side domain objects rather than inventing parallel terminology.
The number of dispensable units left right now.
- Decrements by 1 each time a dose is recorded.
- Drives low/out-of-stock logic.
- Should be shown in patient/carer-facing quantity displays.
- Prefer Remaining Supply or units remaining in new UI copy over generic Stock where the meaning is "what is left now".
The value of current_supply immediately after the most recent restock.
- Set automatically by
Medication#restock!. - Used as the denominator for progress bars so the bar drains proportionally from 100% → 0%.
- Falls back to
reorder_thresholdwhen nil (e.g. legacy data before this column existed).
The level at or below which a medication is considered low stock.
low_stock?is true whenremaining_supply <= reorder_threshold.
The aggregate root for dosage options, supply attributes, and administration sources.
Medicationremains the canonical term in code for this aggregate.- Do not introduce parallel model names for the same concept in this pass.
A time-based medication regimen tied to a person.
- Schedules remain distinct from ad-hoc medications.
- A
Scheduleis one source of medication administration.
An ad-hoc medication assignment outside the scheduled regimen flow.
PersonMedicationremains distinct fromSchedule.- It is the second source of medication administration.
The persisted dose record for a single administration event.
MedicationTakeremains the canonical persistence term in this pass.- UI copy may use "dose" or "administration" where clearer for users, but code should not introduce a second model name.
- Use Remaining Supply in UI copy where users need "what is left now".
- Use Reorder Threshold to indicate the danger zone for re-ordering.
- Progress bars use
current_supply / supply_at_last_restockfor a proportional drain.