with one click
healthcare-emr-patterns
EMR/EHR development patterns for healthcare applications. Clinical safety, encounter workflows, prescription generation, clinical decision support integration, and accessibility-first UI for medical data entry.
Menu
EMR/EHR development patterns for healthcare applications. Clinical safety, encounter workflows, prescription generation, clinical decision support integration, and accessibility-first UI for medical data entry.
Based on SOC occupation classification
| name | healthcare-emr-patterns |
| description | EMR/EHR development patterns for healthcare applications. Clinical safety, encounter workflows, prescription generation, clinical decision support integration, and accessibility-first UI for medical data entry. |
| metadata | {"origin":"Health1 Super Speciality Hospitals โ contributed by Dr. Keyur Patel"} |
| version | 1.0.0 |
Patterns for building Electronic Medical Record (EMR) and Electronic Health Record (EHR) systems. Prioritizes patient safety, clinical accuracy, and practitioner efficiency.
Every design decision must be evaluated against: "Could this harm a patient?"
Clinical encounters should flow vertically on a single page โ no tab switching:
Patient Header (sticky โ always visible)
โโโ Demographics, allergies, active medications
โ
Encounter Flow (vertical scroll)
โโโ 1. Chief Complaint (structured templates + free text)
โโโ 2. History of Present Illness
โโโ 3. Physical Examination (system-wise)
โโโ 4. Vitals (auto-trigger clinical scoring)
โโโ 5. Diagnosis (ICD-10/SNOMED search)
โโโ 6. Medications (drug DB + interaction check)
โโโ 7. Investigations (lab/radiology orders)
โโโ 8. Plan & Follow-up
โโโ 9. Sign / Lock / Print
interface ClinicalTemplate {
id: string;
name: string; // e.g., "Chest Pain"
chips: string[]; // clickable symptom chips
requiredFields: string[]; // mandatory data points
redFlags: string[]; // triggers non-dismissable alert
icdSuggestions: string[]; // pre-mapped diagnosis codes
}
Red flags in any template must trigger a visible, non-dismissable alert โ NOT a toast notification.
User selects drug
โ Check current medications for interactions
โ Check encounter medications for interactions
โ Check patient allergies
โ Validate dose against weight/age/renal function
โ If CRITICAL interaction: BLOCK prescribing entirely
โ Clinician must document override reason to proceed past a block
โ If MAJOR interaction: display warning, require acknowledgment
โ Log all alerts and override reasons in audit trail
Critical interactions block prescribing by default. The clinician must explicitly override with a documented reason stored in the audit trail. The system never silently allows a critical interaction.
Once a clinical encounter is signed:
Vitals Display: Current values with normal range highlighting (green/yellow/red), trend arrows vs previous, clinical scoring auto-calculated (NEWS2, qSOFA), escalation guidance inline.
Lab Results Display: Normal range highlighting, previous value comparison, critical values with non-dismissable alert, collection/analysis timestamps, pending orders with expected turnaround.
Prescription PDF: One-click generation with patient demographics, allergies, diagnosis, drug details (generic + brand, dose, route, frequency, duration), clinician signature block.
Healthcare UIs have stricter requirements than typical web apps:
any type for clinical data structuresDoctor opens encounter for Patient #4521
โ Sticky header shows: "Rajesh M, 58M, Allergies: Penicillin, Active Meds: Metformin 500mg"
โ Chief Complaint: selects "Chest Pain" template
โ Clicks chips: "substernal", "radiating to left arm", "crushing"
โ Red flag "crushing substernal chest pain" triggers non-dismissable alert
โ Examination: CVS system โ "S1 S2 normal, no murmur"
โ Vitals: HR 110, BP 90/60, SpO2 94%
โ NEWS2 auto-calculates: score 8, risk HIGH, escalation alert shown
โ Diagnosis: searches "ACS" โ selects ICD-10 I21.9
โ Medications: selects Aspirin 300mg
โ CDSS checks against Metformin: no interaction
โ Signs encounter โ locked, addendum-only from this point
Doctor prescribes Warfarin for Patient #4521
โ CDSS detects: Warfarin + Aspirin = CRITICAL interaction
โ UI: red non-dismissable modal blocks prescribing
โ Doctor clicks "Override with reason"
โ Types: "Benefits outweigh risks โ monitored INR protocol"
โ Override reason + alert stored in audit trail
โ Prescription proceeds with documented override
Encounter #E-2024-0891 signed by Dr. Shah at 14:30
โ All fields locked โ no edit buttons visible
โ "Add Addendum" button available
โ Dr. Shah clicks addendum, adds: "Lab results received โ Troponin elevated"
โ New record E-2024-0891-A1 linked to original
โ Timeline shows both: original encounter + addendum with timestamps
Track and report Claude Code token usage, spending, and budgets from the local ECC cost-tracker metrics log. Use when the user asks about costs, spending, usage, tokens, budgets, or cost breakdowns by model, session, or date.
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.
Create reproducible, cross-platform (macOS/Linux) development environments with Flox, a declarative Nix-based environment manager. Use when setting up project toolchains for any language, installing system-level dependencies (compilers, databases, native libs like openssl/BLAS), pinning exact package versions for a team, running local services (PostgreSQL, Redis, Kafka), onboarding developers with one command, or solving 'works on my machine' problems โ including agent/vibe-coding setups that need project-scoped tools without sudo. Also use when the user mentions .flox/, manifest.toml, flox activate, or FloxHub.
Commercial-grade Python installer expert for Windows: Nuitka extreme compilation, dist slimming, DLL footprint analysis, and Inno Setup packaging to ship the smallest, fastest installers. Use only for advanced packaging/optimization (minimal size, fast startup), not basic script-to-exe conversion. ไธญๆ่งฆๅ๏ผNuitka ๆ้ไผๅใPython ๅไธๆๅ ใๆ้็ผ่ฏ Pythonใdist ็ฆ่บซใDLL ๅๆใๆๅฐๅฎ่ฃ ๅ ใๆๅฟซๅฏๅจใๅไธ็บงๆๅ ้ฃๆ ผ
Use when a brand needs to discover or articulate its identity through structured multi-session interviews. Covers purpose, positioning, audience, personality, voice, narrative, and founder-brand tension across 8 modules using laddering, 5 Whys, and projective techniques. Produces a resumable session with disk-persisted state and a master brandbook (90_SYNTHESIS.md).
Use when a brand needs to discover or articulate its identity through structured multi-session interviews. Covers purpose, positioning, audience, personality, voice, narrative, and founder-brand tension across 8 modules using laddering, 5 Whys, and projective techniques. Produces a resumable session with disk-persisted state and a master brandbook (90_SYNTHESIS.md).