healthcare-emr-patterns
affaan-m/everything-claude-code
EMR/EHR development patterns with clinical safety, encounter workflows, and accessibility-first design for healthcare applications.
What is healthcare-emr-patterns?
Patterns for building Electronic Medical Record systems that prioritize patient safety, clinical accuracy, and practitioner efficiency. Use this when designing patient encounter workflows, prescription modules with drug interaction checking, clinical decision support integration, and accessible healthcare UIs.
- Single-page vertical encounter flow (complaint → exam → diagnosis → prescription → plan)
- Medication safety with drug interaction checking, critical interaction blocking, and documented override audit trails
- Clinical templates with red-flag alerts, ICD-10/SNOMED code suggestions, and required field validation
- Locked encounter pattern: signed encounters are immutable, addenda create linked records with full audit trail
- Vitals display with auto-calculated clinical scoring (NEWS2, qSOFA), trend arrows, and escalation guidance
- Lab results display with normal range highlighting, critical value alerts, and previous value comparison
How to install healthcare-emr-patterns
npx skills add https://github.com/affaan-m/everything-claude-code --skill healthcare-emr-patternsHow to use healthcare-emr-patterns
- 1.Review the single-page encounter flow structure and implement vertically-stacked sections (chief complaint → vitals → diagnosis → medications → plan)
- 2.Implement the medication safety pattern: check interactions against current medications, encounter medications, and allergies; block critical interactions with documented override requirement
- 3.Create clinical templates with required fields, red-flag triggers (non-dismissable alerts), and ICD-10/SNOMED code suggestions
- 4.Build the locked encounter pattern: once signed, disable all edit buttons and provide addendum-only workflow with linked records
- 5.Design vitals and lab displays with normal range highlighting, trend indicators, and auto-calculated clinical scores
- 6.Ensure accessibility: 4.5:1 contrast minimum, 44x44px touch targets, keyboard navigation, screen reader labels, no color-only indicators, non-dismissable alerts for clinical data
Use cases
- Building a patient encounter module where doctors document chief complaint, exam findings, diagnosis, and prescriptions in a single scrollable workflow
- Implementing medication prescribing with real-time drug interaction checking that blocks critical interactions unless clinician documents override reason
- Designing a clinical template system for common presentations (chest pain, fever, etc.) with pre-mapped diagnoses and required data points
- Creating an audit-compliant encounter system where signed records cannot be edited, only supplemented with addenda
- Displaying lab results and vitals with clinical scoring and escalation alerts for abnormal values
- Healthcare software engineers building EMR/EHR systems
- Clinical informaticists designing encounter workflows and data entry interfaces
- Product managers designing medication safety and clinical decision support features
- Healthcare compliance and quality teams implementing audit trails and patient safety controls
healthcare-emr-patterns FAQ
The system displays a red non-dismissable modal that blocks prescribing entirely. The clinician must click 'Override with reason', document their clinical justification, and the override reason is stored in the audit trail. The system never silently allows a critical interaction.
No. Once an encounter is signed and locked, no edits are allowed. The clinician can only add an addendum, which creates a separate linked record. Both the original encounter and addendum appear in the patient timeline with timestamps and audit trail.
The skill mentions NEWS2 (National Early Warning Score 2) and qSOFA (quick Sequential Organ Failure Assessment) as examples. Auto-calculate these from vitals and display escalation guidance inline.
Dismissable toasts can be missed or ignored, creating patient safety risks. Non-dismissable alerts (modals) force clinician acknowledgment of critical information like abnormal lab values, red-flag symptoms, or drug interactions.
Minimum 4.5:1 contrast (WCAG AA), 44x44px touch targets for gloved interaction, full keyboard navigation, screen reader labels on all fields, and never use color alone to convey clinical information (pair with text/icon for colorblind users).
Full instructions (SKILL.md)
Source of truth, from affaan-m/everything-claude-code.
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"
Healthcare EMR Development Patterns
Patterns for building Electronic Medical Record (EMR) and Electronic Health Record (EHR) systems. Prioritizes patient safety, clinical accuracy, and practitioner efficiency.
When to Use
- Building patient encounter workflows (complaint, exam, diagnosis, prescription)
- Implementing clinical note-taking (structured + free text + voice-to-text)
- Designing prescription/medication modules with drug interaction checking
- Integrating Clinical Decision Support Systems (CDSS)
- Building lab result displays with reference range highlighting
- Implementing audit trails for clinical data
- Designing healthcare-accessible UIs for clinical data entry
How It Works
Patient Safety First
Every design decision must be evaluated against: "Could this harm a patient?"
- Drug interactions MUST alert, not silently pass
- Abnormal lab values MUST be visually flagged
- Critical vitals MUST trigger escalation workflows
- No clinical data modification without audit trail
Single-Page Encounter Flow
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
Smart Template System
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.
Medication Safety Pattern
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.
Locked Encounter Pattern
Once a clinical encounter is signed:
- No edits allowed — only an addendum (a separate linked record)
- Both original and addendum appear in the patient timeline
- Audit trail captures who signed, when, and any addendum records
UI Patterns for Clinical Data
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.
Accessibility for Healthcare
Healthcare UIs have stricter requirements than typical web apps:
- 4.5:1 minimum contrast (WCAG AA) — clinicians work in varied lighting
- Large touch targets (44x44px minimum) — for gloved/rushed interaction
- Keyboard navigation — for power users entering data rapidly
- No color-only indicators — always pair color with text/icon (colorblind clinicians)
- Screen reader labels on all form fields
- No auto-dismissing toasts for clinical alerts — clinician must actively acknowledge
Anti-Patterns
- Storing clinical data in browser localStorage
- Silent failures in drug interaction checking
- Dismissable toasts for critical clinical alerts
- Tab-based encounter UIs that fragment the clinical workflow
- Allowing edits to signed/locked encounters
- Displaying clinical data without audit trail
- Using
anytype for clinical data structures
Examples
Example 1: Patient Encounter Flow
Doctor 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
Example 2: Medication Safety Workflow
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
Example 3: Locked Encounter + Addendum
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
Related skills
More from affaan-m/everything-claude-code and the wider catalog.

security-review
Security checklist and patterns for authentication, input validation, secrets, and sensitive features.

golang-patterns
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable applications.

coding-standards
Baseline coding conventions for naming, readability, immutability, and quality across projects.

frontend-patterns
React and Next.js patterns for components, state management, performance, and modern frontend practices.

backend-patterns
REST/GraphQL API design, database optimization, and server-side patterns for Node.js, Express, and Next.js.

golang-testing
Go testing patterns: table-driven tests, subtests, benchmarks, fuzzing, and TDD methodology.