status follows FHIR’s MedicationRequest.status vocabulary. Five
possible values, each with deterministic triggers.
The table
| Status | Triggered by | Base confidence |
|---|---|---|
active | recent_dispense (within 90d) OR active_order (MedicationRequest status=active, within 180d) OR self_reported_active | 0.75 – 0.95 depending on signals |
completed | course_completed — explicit completed status OR effectivePeriod.end in the past | 0.85 – 0.95 |
stopped | order_stopped — MedicationRequest.status = stopped | 0.85 |
cancelled | order_cancelled — MedicationRequest.status = cancelled | 0.85 |
unknown | No classifiable signal, or all data is >365 days stale | 0.30 – 0.50 |
Precedence (when multiple rules fire)
active_order and order_stopped fire on resources that resolve to
the same medication (via RxNorm grouping), active wins — the current state
trumps historical state.
Confidence adjustments
Base confidence values are modified by:- Corroboration — multiple active-leaning signals firing for the same
medication (e.g.,
active_order+recent_dispense) can push confidence to ~0.95. - Missing date — −0.20 penalty
- Missing RxNorm code — −0.05 penalty
- Staleness decay — continuous curve past 90 days. A 6-month-old signal is worth more than a 2-year-old one.
Filtering by status
Passstatuses in the request body to filter the response post-inference:
Special cases
Medications with only self-reported data
Medications with only self-reported data
If a
MedicationStatement has reported=true (patient-reported, not
clinician-recorded), the self_reported_active rule fires with a lower
base confidence. Clinician-recorded statements carry more weight.Medications with no RxNorm code
Medications with no RxNorm code
Grouping still works on normalized display names, but
confidence takes
a −0.05 penalty since we can’t confirm we’re looking at the right drug
across sources.Prescriptions that expired without a dispense
Prescriptions that expired without a dispense
If a
MedicationRequest is status=active but authored >365 days ago
and no MedicationDispense exists, prescription_expired fires and
status becomes completed. The order was never actually used.