Healthcare CDSS Development Patterns
Patterns for building Clinical Decision Support Systems that integrate into EMR workflows. CDSS modules are patient safety critical — zero tolerance for false negatives.
When to Use
- Implementing drug interaction checking
- Building dose validation engines
- Implementing clinical scoring systems (NEWS2, qSOFA, APACHE, GCS)
- Designing alert systems for abnormal clinical values
- Building medication order entry with safety checks
- Integrating lab result interpretation with clinical context
How It Works
The CDSS engine is a pure function library with zero side effects. Input clinical data, output alerts. This makes it fully testable.
Three primary modules:
checkInteractions(newDrug, currentMeds, allergies)— Checks a new drug against current medications and known allergies. Returns severity-sortedInteractionAlert[]. UsesDrugInteractionPairdata model.validateDose(drug, dose, route, weight, age, renalFunction)— Validates a prescribed dose against weight-based, age-adjusted, and renal-adjusted rules. ReturnsDoseValidationResult.calculateNEWS2(vitals)— National Early Warning Score 2 fromNEWS2Input. ReturnsNEWS2Resultwith total score, risk level, and escalation guidance.
Drug Interaction Checking
Interaction pairs must be bidirectional: if Drug A interacts with Drug B, then Drug B interacts with Drug A.
Dose Validation
Clinical Scoring: NEWS2
Scoring tables must match the Royal College of Physicians specification exactly.
Alert Severity and UI Behavior
Critical alerts must NEVER be auto-dismissed or implemented as toast notifications. Override reasons must be stored in the audit trail.
Testing CDSS (Zero Tolerance for False Negatives)
Pass criteria: 100%. A single missed interaction is a patient safety event.
Anti-Patterns
- Making CDSS checks optional or skippable without documented reason
- Implementing interaction checks as toast notifications
- Using
anytypes for drug or clinical data - Hardcoding interaction pairs instead of using a maintainable data structure
- Silently catching errors in CDSS engine (must surface failures loudly)
- Skipping weight-based validation when weight is not available (must block, not pass)


