Communitygithub.com

医療EMR/EHR開発パターン

医療アプリケーション向けEMR/EHR開発パターン。患者安全、診療ワークフロー、処方生成、臨床判断支援統合、医療データ入力のためのアクセシビリティファーストUIを提供します。診療ワークフロー、処方生成、臨床データ入力UIなどのEMR/EHR機能を構築する際に使用します。

EHR開発パターン とは?

このスキルは、電子カルテ(EMR)および電子健康記録(EHR)システムを構築するための包括的な開発パターンを提供します。患者の安全を最優先し、すべての設計判断を「これは患者に害を及ぼすか?」という観点から評価することを徹底します。具体的には、薬物相互作用の警告を確実に表示し、異常な検査値を視覚的に強調表示し、重要なバイタルサインに対してエスカレーションワークフローをトリガーするパターンが含まれます。また、シングルページ診療フロー(垂直スクロール、タブ禁止)、スマートテンプレートシステム(ICD-10/SNOMED検索、レッドフラグ付き)、ロックされた診療記録(署名後は追記のみ許可)、処方のPDFワンクリック生成、NEWS2/qSOFAなどの臨床スコア自動計算などの実装例を提供します。さらに、医療向けアクセシビリティ(WCAG AA準拠、44x44pxのタッチターゲット、キーボードナビゲーション、色のみに依存しない表示、スクリーンリーダー対応)や、ブラウザlocalStorageへの臨床データ保存や重大アラートの自動消去トーストなどのアンチパターンも明示しています。Claude CodeやCursorなどのAIエージェントがEMR/EHR機能を実装する際、安全で正確かつ効率的なコードを生成するための設計ガイドラインとして機能します。

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

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

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

ドキュメント

医療EMR開発パターン

電子カルテ(EMR)および電子健康記録(EHR)システムを構築するためのパターンです。患者の安全、臨床的な正確性、実務者の効率性を最優先します。

使用するタイミング

  • 患者診療ワークフローの構築(主訴、診察、診断、処方)
  • 臨床記録作成の実装(構造化テキスト + 自由記述 + 音声テキスト変換)
  • 薬物相互作用チェックを含む処方/薬剤モジュールの設計
  • 臨床判断支援システム(CDSS)の統合
  • 基準範囲ハイライト機能付き検査結果表示の構築
  • 臨床データの監査証跡の実装
  • 医療アクセシビリティ対応UIによる臨床データ入力の設計

動作の仕組み

患者安全第一

すべての設計判断は、「これは患者に害を及ぼすか?」という基準で評価されなければなりません。

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

シングルページ診療ワークフロー

診療記録は1ページ内で垂直に流れるように設計する——タブ切り替えは禁止:

患者ヘッダー(固定——常に表示)
├── 人口統計情報、アレルギー、アクティブな薬剤
│
診療フロー(垂直スクロール)
├── 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は標準的なウェブアプリよりも厳しい要件を満たす必要があります:

  • 4.5:1以上の最小コントラスト比(WCAG AA)——臨床医は様々な照明下で作業する
  • 大きいタッチターゲット(最低44x44px)——手袋をした状態や慌てた操作に対応
  • キーボードナビゲーション——データを素早く入力するパワーユーザー向け
  • 色のみのインジケーターは禁止——常に色をテキスト/アイコンと組み合わせる(色覚異常の臨床医向け)
  • すべてのフォームフィールドにスクリーンリーダーラベルを付ける
  • 臨床アラートに自動消去トーストを使用しない——臨床医が能動的に確認する必要がある

アンチパターン

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

例

例1: 患者診療ワークフロー

医師が患者#4521の診療記録を開く
  → 固定ヘッダーに表示: "Rajesh M, 58M, アレルギー: ペニシリン, アクティブな薬剤: メトホルミン500mg"
  → 主訴: "胸痛"テンプレートを選択
    → チップをクリック: "胸骨後部", "左腕に放散", "圧迫感"
    → レッドフラグ "胸骨後部圧迫感のある胸痛" が非閉鎖可能なアラートをトリガー
  → 診察: CVS系——"S1 S2正常、雑音なし"
  → バイタル: HR 110, BP 90/60, SpO2 94%
    → NEWS2自動計算: スコア8, リスク高, エスカレーションアラート表示
  → 診断: "ACS"を検索→ ICD-10 I21.9を選択
  → 薬剤: アスピリン300mgを選択
    → CDSSがメトホルミンとの相互作用をチェック: 相互作用なし
  → 診療記録に署名→ ロック、この時点から追記のみ

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

医師が患者#4521にワルファリンを処方
  → CDSS検出: ワルファリン + アスピリン = CRITICAL相互作用
  → 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/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

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.

関連スキル