Medication Service — AI Integration
Status: populated Owner: TBD Last updated: 2026-04-17 Companion: Service Template · ai-gateway-service
1. Policy
No direct vendor AI SDKs in medication-service. Every AI call is routed via ai-gateway-service (/api/v1/ai/*) per platform standard. No model keys in this service.
2. AI Use Cases (current + planned)
| Feature | Purpose | Prompt template | Moderation | HITL | Phase |
|---|---|---|---|---|---|
sigParseAssist | Convert free-text sig ("take 1 tab bid x7d") into structured dose/route/freq | medication.sig.parse.v1 | PHI redaction on input | Required — prescriber confirms parsed structure before save | M2 |
medReconciliationSummary | Summarize home-med vs facility-med diff for reconciliation | medication.reconciliation.summary.v1 | Moderation on output; no clinical recommendations | Advisory only; prescriber signs off | M3 |
allergyAlertExplainer | Explain why a drug-allergy alert fired in plain language to patient-portal export | medication.allergy.explain.v1 | Moderation; WHO/FDA factual grounding only | Required — clinician approves before patient-facing export | M3 |
refillReminderCopy | Draft patient-friendly refill reminder text | medication.refill.copy.v1 | Moderation; locale-aware | Optional — staff review | M3 |
cdsPassthrough | Passthrough to CDS Hooks / AI for optional enhanced checks | medication.cds.advisory.v1 | Full PHI isolation; no retention | Blocking alerts still rule-based; AI only advisory | M4 |
3. Safety Rules
- AI cannot decide on clinical safety — blocking alerts remain deterministic (drug-drug, drug-allergy, dose-range rules).
- AI output stored as
DetectedIssueadvisory-category, never as new blocking alert. - Every AI output linked to
AIProvenancerecord (prompt id, model id, version hash, moderation verdict). - AI is off by default per tenant; opt-in via tenant config.
4. Audit
| Event | Retained |
|---|---|
medication.ai.invocation.v1 | 7y — prompt hash, response hash, model, actor |
medication.ai.moderation.blocked.v1 | 7y |
medication.ai.hitl.decision.v1 | 7y |
5. Open Questions
- Should
sigParseAssistbe gated to specific prescriber roles or available to all? (Pending clinical governance.) - Vendor choice for structured-output model (OpenAI gpt-4o vs Azure OpenAI).