| <article class="doc" id="doc-modules-medication" aria-hidden="true"><div class="strip"><span class="path">modules/medication.md</span><span class="tag">Engineering, modules</span><span class="meta">~1 min read</span></div> |
| <h1>Module: <code>medication</code></h1> |
| <blockquote> |
| <p>Part of the Travi AI Agent monolith (<code>app/modules/medication/</code>). Read <code>00-overview.md</code> §3 (hard rules) before changing anything here.</p> |
| </blockquote> |
| <div class="tbl-wrap"><table class="plain col-table compact"><colgroup><col class="col-auto"/><col class="col-lg"/></colgroup> |
| <thead> |
| <tr> |
| <th></th> |
| <th></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr> |
| <td data-label=""><strong>Purpose</strong></td> |
| <td data-label="">The four separate truths about a medication, instruction, transmission, access, use, kept physically separate so they can never be conflated.</td> |
| </tr> |
| <tr> |
| <td data-label=""><strong>Owns (data)</strong></td> |
| <td data-label="">medication_plan_item, medication_status_event</td> |
| </tr> |
| <tr> |
| <td data-label=""><strong>Public surface</strong></td> |
| <td data-label=""><code>/medications</code>, <code>/medications/{id}/status</code></td> |
| </tr> |
| <tr> |
| <td data-label=""><strong>Depends on</strong></td> |
| <td data-label="">compiler (plan-item publication), episode (med tasks), agents (med-access evidence)</td> |
| </tr> |
| <tr> |
| <td data-label=""><strong>Requirements owned</strong></td> |
| <td data-label="">MED-003/005/006/010</td> |
| </tr> |
| <tr> |
| <td data-label=""><strong>Constraining ADRs</strong></td> |
| <td data-label="">ADR-009</td> |
| </tr> |
| <tr> |
| <td data-label=""><strong>Key references</strong></td> |
| <td data-label="">reference/data-model.md §6.3</td> |
| </tr> |
| </tbody> |
| </table></div> |
| <hr/> |
| <h2 id="doc-modules-medication--h1">Rules that must never break</h2> |
| <ol> |
| <li><strong>Dimension separation (MED-003/006).</strong> A status event can never mutate a plan item. <code>evidence_class=patient_report</code> serializes <code>verified:false</code> and the UI badge binds to that flag, a self-report must never look like a pharmacy-confirmed dispense.</li> |
| <li><strong>No autonomous change (MED-010).</strong> Plan-item mutations require either a published fact from a source at hierarchy level ≤7, or clinician confirmation with step-up. There is no third path; agents and prompts have no code route to these writers.</li> |
| <li><strong>Barriers are first-class (MED-005).</strong> <code>cannot_do</code> requires a <code>barrier_code</code> (cost, stock, transport, confusion, side_effect, other) and opens the matching automation flow, never free text, never silence.</li> |
| <li><strong>Evidence states (8):</strong> ordered → sent → available → obtained → started → taking | stopped | barrier, each timestamped with evidence class; full history visible to the clinician brief.</li> |
| </ol> |
| <div class="pn"><a class="pn-prev" href="#"></a><a class="pn-next" href="#"></a></div></article> |
|
|