Medication Reconciliation
Compare patient pre-admission medication lists with inpatient orders to automatically identify omitted or duplicated medications and improve medication safety.
Medical Disclaimer: This tool is for reference only. Final medication decisions must be confirmed by qualified medical staff. All patient data must comply with applicable data protection regulations (e.g., HIPAA).
Quick Check
CODEBLOCK0
When to Use
- - Use this skill when comparing pre-admission medication lists against inpatient orders to detect omissions or duplicates.
- Use this skill when generating structured reconciliation reports for clinical handover or pharmacy review.
- Do not use this skill as a substitute for pharmacist or physician review of medication orders.
Workflow
- 1. PHI Check: Before processing, prompt the user to confirm data has been de-identified: "Please confirm that the input files have been de-identified or that you have authorization to process this patient data under applicable regulations (e.g., HIPAA) before proceeding."
- Confirm patient ID, pre-admission medication list, and inpatient orders are available.
- Validate that both input files are well-formed and patient IDs match.
- Run the reconciliation script or apply the manual comparison path.
- Return a structured report separating continued, discontinued, new, and duplicate medications.
- Dose-change detection: When a drug appears in both lists with different dose strings, flag it as
dose_changed with a warning: "Dose change detected — verify with prescribing physician before proceeding." - Flag warnings for critical drug classes (anticoagulants, hypoglycemics, antihypertensives, antiepileptics).
- If inputs are incomplete, state exactly which fields are missing and request only the minimum additional information.
Usage
CODEBLOCK1
Parameters
| Parameter | Type | Required | Description |
|---|
| INLINECODE1 | file path | Yes | JSON file of pre-admission medications |
| INLINECODE2 |
file path | Yes | JSON file of inpatient orders |
|
--output | file path | No | Output report path (default: stdout) |
|
--example | flag | No | Run with built-in example data |
|
--verbose | flag | No | Include detailed matching rationale |
Output Format
The reconciliation report separates results into:
- -
continued — medications present in both lists (same drug, same dose) - INLINECODE7 — same drug present in both lists but with different dose strings (⚠️ requires physician verification)
- INLINECODE8 — pre-admission medications absent from inpatient orders
- INLINECODE9 — inpatient orders not in pre-admission list
- INLINECODE10 — same drug appearing multiple times
- INLINECODE11 — critical drug class alerts
Dose-change example:
CODEBLOCK2
Scope Boundaries
- - This skill compares structured medication data; it does not interpret clinical appropriateness.
- This skill does not access live pharmacy systems or EHR databases.
- This skill does not replace pharmacist verification or physician sign-off.
Stress-Case Rules
For complex multi-constraint requests, always include these explicit blocks:
- 1. Assumptions
- Inputs Used
- Reconciliation Result
- Warnings and Critical Flags
- Risks and Manual Checks
Error Handling
- - If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If
scripts/main.py fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback. - Do not fabricate medication data, citations, or execution outcomes.
Input Validation
This skill accepts: pre-admission medication lists and inpatient order files (JSON format) for a single patient encounter.
If the request does not involve medication list comparison — for example, asking to prescribe medications, interpret drug interactions clinically, or access live EHR systems — do not proceed with the workflow. Instead respond:
"medication-reconciliation is designed to compare pre-admission and inpatient medication lists to flag omissions and duplicates. Your request appears to be outside this scope. Please provide structured medication input files, or use a more appropriate clinical tool."
Response Template
Use the following fixed structure for non-trivial requests:
- 1. Objective
- Inputs Received
- Assumptions
- Workflow
- Deliverable
- Risks and Limits
- Next Checks
If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
用药核对
将患者入院前用药清单与住院医嘱进行比对,自动识别遗漏或重复用药,提升用药安全。
医疗免责声明: 本工具仅供参考。最终用药决策须由合格医务人员确认。所有患者数据必须符合适用的数据保护法规(如HIPAA)。
快速检查
bash
python -m py_compile scripts/main.py
python scripts/main.py --help
使用场景
- - 在比对入院前用药清单与住院医嘱以检测遗漏或重复用药时使用本技能。
- 在生成结构化核对报告用于临床交接或药学审核时使用本技能。
- 请勿将本技能作为药剂师或医师审核用药医嘱的替代方案。
工作流程
- 1. PHI检查: 处理前,提示用户确认数据已去标识化:“请确认输入文件已去标识化,或您已获得根据适用法规(如HIPAA)处理该患者数据的授权后再继续操作。”
- 确认患者ID、入院前用药清单和住院医嘱均可用。
- 验证两个输入文件格式正确且患者ID匹配。
- 运行核对脚本或应用手动比对路径。
- 返回结构化报告,区分继续用药、停用药物、新增药物和重复用药。
- 剂量变更检测: 当同一药物在两个列表中出现但剂量字符串不同时,标记为dose_changed并发出警告:“检测到剂量变更——请与处方医师确认后再继续操作。”
- 对关键药物类别(抗凝药、降糖药、降压药、抗癫痫药)标记警告。
- 若输入不完整,明确指出缺失字段,仅请求最少的补充信息。
使用方法
text
基本用法
python scripts/main.py --pre-admission pre_meds.json --inpatient orders.json --output report.json
使用示例数据
python scripts/main.py --example
详细输出
python scripts/main.py --pre-admission pre_meds.json --inpatient orders.json --verbose
参数
| 参数 | 类型 | 必需 | 描述 |
|---|
| --pre-admission | 文件路径 | 是 | 入院前用药的JSON文件 |
| --inpatient |
文件路径 | 是 | 住院医嘱的JSON文件 |
| --output | 文件路径 | 否 | 输出报告路径(默认:标准输出) |
| --example | 标志 | 否 | 使用内置示例数据运行 |
| --verbose | 标志 | 否 | 包含详细匹配说明 |
输出格式
核对报告将结果分为:
- - continued — 两个列表中均存在的药物(相同药物、相同剂量)
- dosechanged — 两个列表中均存在相同药物但剂量字符串不同(⚠️ 需医师确认)
- discontinued — 入院前用药清单中存在但住院医嘱中缺失的药物
- newmedications — 住院医嘱中存在但入院前用药清单中没有的药物
- duplicates — 同一药物出现多次
- warnings — 关键药物类别警报
剂量变更示例:
json
{
dose_changed: [
{
drug: 二甲双胍,
preadmissiondose: 500mg,
inpatient_dose: 1000mg,
warning: 检测到剂量变更——请与处方医师确认后再继续操作。
}
]
}
范围边界
- - 本技能比对结构化用药数据,不解读临床适宜性。
- 本技能不访问实时药房系统或电子健康记录数据库。
- 本技能不替代药剂师审核或医师签字确认。
压力测试规则
对于复杂的多约束请求,始终包含以下明确模块:
- 1. 假设条件
- 使用的输入
- 核对结果
- 警告和关键标志
- 风险与人工检查
错误处理
- - 若缺少必需输入,明确指出缺失字段,仅请求最少的补充信息。
- 若任务超出文档范围,停止操作,而非猜测或悄然扩大任务范围。
- 若scripts/main.py执行失败,报告失败点,总结仍可安全完成的内容,并提供手动回退方案。
- 不得编造用药数据、引用或执行结果。
输入验证
本技能接受:单次患者就诊的入院前用药清单和住院医嘱文件(JSON格式)。
若请求不涉及用药清单比对——例如要求开具处方、临床解读药物相互作用或访问实时电子健康记录系统——请勿执行工作流程。应回复:
“用药核对旨在比对入院前和住院用药清单以标记遗漏和重复用药。您的请求似乎超出此范围。请提供结构化用药输入文件,或使用更合适的临床工具。”
响应模板
对于非简单请求,使用以下固定结构:
- 1. 目标
- 收到的输入
- 假设条件
- 工作流程
- 交付物
- 风险与限制
- 后续检查
若请求简单,可压缩结构,但当假设条件和限制影响正确性时,仍需明确说明。