Communitygithub.com

医療EMR/EHR開発パターン

医療アプリケーション向けのEMR/EHR開発パターン。患者安全、診察ワークフロー、処方生成、診断支援システム統合、臨床データ入力のアクセシビリティ優先UIを提供します。

EHR開発パターン とは?

このスキルは、電子カルテ(EMR/EHR)システムを構築するための実践的な開発パターンを提供します。患者安全を最優先し、すべての設計判断を「これは患者に害を及ぼす可能性があるか?」という観点で評価します。主なユースケースとして、診察ワークフロー(主訴→診断→処方)、処方モジュール(薬物相互作用チェック、アレルギー確認、用量検証)、診断支援システム(CDSS)統合、検査結果表示(基準範囲ハイライト、トレンド矢印)、監査証跡の実装などが含まれます。また、臨床データ入力に特化したアクセシビリティUI(WCAG AAに準拠したコントラスト比、大きなタッチターゲット、キーボードナビゲーション)も提供します。具体的なパターンとして、シングルページ診察フロー(タブ切り替えなしの垂直スクロール)、スマートテンプレートシステム(赤旗アラートは非解除可能)、投薬安全パターン(重大な相互作用は処方をブロックし、上書き理由を監査証跡に記録)、診察終了後のロックパターン(編集不可、追記のみ許可)を含んでいます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/healthcare-emr-patterns

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

医療EMR開発パターン

電子カルテ(EMR)および電子健康記録(EHR)システムを構築するためのパターン。患者安全、臨床精度、医療従事者の効率を最優先します。

いつ使用するか

  • 患者診察ワークフローの構築(主訴、診察、診断、処方)
  • 臨床記録の実装(構造化+自由記述+音声テキスト変換)
  • 薬物相互作用チェックを含む処方/投薬モジュールの設計
  • 臨床意思決定支援システム(CDSS)の統合
  • 基準範囲強調表示を備えた検査結果表示の構築
  • 臨床データの監査証跡の実装
  • 医療アクセシブルな臨床データ入力UIの設計

仕組み

患者安全最優先

すべての設計判断は「これは患者に害を及ぼす可能性があるか?」という視点で評価する必要があります。

  • 薬物相互作用は警告する必要があり、無言で通過してはならない
  • 異常な検査値は視覚的にフラグする必要がある
  • 重大なバイタルはエスカレーションワークフローをトリガーしなければならない
  • 監査証跡なしに臨床データを変更してはならない

シングルページ診察フロー

臨床診察は単一ページで垂直に流れるべきです — タブ切り替えは不要:

患者ヘッダー(固定 — 常に表示)
├── 人口統計、アレルギー、アクティブな投薬
│
診察フロー(垂直スクロール)
├── 1. 主訴(構造化テンプレート+自由記述)
├── 2. 現病歴
├── 3. 身体診察(系統別)
├── 4. バイタル(自動的に臨床スコアリングをトリガー)
├── 5. 診断(ICD-10/SNOMED検索)
├── 6. 投薬(薬剤DB+相互作用チェック)
├── 7. 検査(臨床検査/放射線オーダー)
├── 8. 計画とフォローアップ
└── 9. 署名/ロック/印刷

スマートテンプレートシステム

interface ClinicalTemplate {
  id: string;
  name: string;             // 例:"胸痛"
  chips: string[];          // クリック可能な症状チップ
  requiredFields: string[]; // 必須データポイント
  redFlags: string[];       // 非解除可能な警告をトリガー
  icdSuggestions: string[]; // 事前マッピングされた診断コード
}

テンプレート内の赤旗は、トースト通知ではなく、表示されかつ非解除可能な警告をトリガーしなければなりません。

投薬安全パターン

ユーザーが薬剤を選択
  → 現在の投薬で相互作用をチェック
  → 診察内の投薬で相互作用をチェック
  → 患者のアレルギーをチェック
  → 体重/年齢/腎機能に対する用量を検証
  → CRITICAL(重大な)相互作用の場合:処方を完全にブロック
  → 医療従事者はブロックを通過するために上書き理由を文書化する必要がある
  → MAJOR(主要な)相互作用の場合:警告を表示、確認を要求
  → すべての警告と上書き理由を監査証跡に記録

重大な相互作用はデフォルトで処方をブロックします。医療従事者は、監査証跡に保存された文書化された理由で明示的に上書きする必要があります。システムが重大な相互作用を無言で許可することは決してありません。

ロックされた診察パターン

臨床診察が署名された後:

  • 編集は不可能 — 追記(別のリンクされた記録)のみ許可
  • 原本と追記の両方が患者のタイムラインに表示される
  • 監査証跡は誰がいつ署名したか、およびすべての追記記録を捕捉する

臨床データのUIパターン

バイタル表示: 基準範囲強調表示(緑/黄/赤)付きの現在値、前回値とのトレンド矢印、臨床スコア自動計算(NEWS2、qSOFA)、エスカレーションガイダンスをインライン表示。

検査結果表示: 基準範囲強調表示、前回値比較、非解除可能な警告付きの異常値、採取/分析タイムスタンプ、予想到着時間付きの保留オーダー。

処方PDF: ワンクリック生成、患者人口統計、アレルギー、診断、薬剤詳細(一般名+ブランド名、用量、投与経路、頻度、期間)、医療従事者署名欄を含む。

医療アクセシビリティ

医療用UIは一般的なWebアプリよりも厳しい要件があります:

  • 4.5:1以上のコントラスト比(WCAG AA) — 医療従事者はさまざまな照明環境で作業する
  • 大きなタッチターゲット(44x44px以上) — 手袋を着用した/急いだ操作に対応
  • キーボードナビゲーション — データを迅速に入力するパワーユーザー向け
  • 色のみのインジケーター禁止 — 常に色にテキスト/アイコンを組み合わせる(色覚異常の医療従事者向け)
  • すべてのフォームフィールドにスクリーンリーダー用ラベル
  • 臨床アラートに自動消去するトーストは禁止 — 医療従事者が積極的に確認する必要がある

アンチパターン

  • 臨床データをブラウザの localStorage に保存する
  • 薬物相互作用チェックのサイレント失敗
  • 重大な臨床アラートに消去可能なトーストを使用する
  • 臨床ワークフローを断片化するタブベースの診察UI
  • 署名/ロックされた診察の編集を許可する
  • 監査証跡なしで臨床データを表示する
  • 臨床データ構造に any 型を使用する

例

例1:患者診察フロー

医師が患者#4521の診察を開く
  → 固定ヘッダーに表示:"Rajesh M, 58歳男性, アレルギー: ペニシリン, アクティブな投薬: メトホルミン 500mg"
  → 主訴:「胸痛」テンプレートを選択
    → チップをクリック:"胸骨下", "左腕に放散", "圧迫感"
    → 赤旗「胸骨下の圧迫感のある胸痛」が非解除可能な警告をトリガー
  → 診察:循環器系 — 「S1 S2正常、雑音なし」
  → バイタル:心拍数 110, 血圧 90/60, SpO2 94%
    → NEWS2自動計算:スコア 8, リスク 高, エスカレーション警告表示
  → 診断:「ACS」を検索 → ICD-10 I21.9を選択
  → 投薬:アスピリン 300mgを選択
    → CDSSがメトホルミンとの相互作用をチェック:相互作用なし
  → 診察に署名 → ロックされ、以降は追記のみ

例2:投薬安全ワークフロー

医師が患者#4521にワルファリンを処方
  → CDSSが検出:ワルファリン + アスピリン = 重大な相互作用
  → UI:赤い非解除可能なモーダルが処方をブロック
  → 医師が「理由を記入して上書き」をクリック
  → 入力:「リスクを上回る利益 — 監視下INRプロトコル」
  → 上書き理由と警告が監査証跡に保存される
  → 文書化された上書きとともに処方が進行

例3:ロックされた診察+追記

診察#E-2024-0891、Dr. Shahが14:30に署名
  → すべてのフィールドがロック — 編集ボタンは非表示
  → 「追記を追加」ボタンが利用可能
  → Dr. Shahが追記をクリック、追加:「検査結果受領 — トロポニン上昇」
  → 新しい記録E-2024-0891-A1が原本にリンク
  → タイムラインに両方表示:原本の診察+タイムスタンプ付きの追記

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

関連スキル