SuperAPI AI Directory

interaction

General & other

View repository

Updated 10-15 22:15

About this skill

Drug Interaction Checking Skill

Detect and manage drug interactions, including four types of interactions: drug-drug, drug-disease, drug-dosage, and drug-food.

Core Process

用户输入 -> 解析操作类型 -> [check] 加载用药 -> 执行检测 -> 汇总排序 -> 输出报告
                              -> [list] 读取规则库 -> 格式化显示
                              -> [add] 解析规则 -> 保存
                              -> [update] 查找规则 -> 更新
                              -> [delete] 确认删除
                              -> [history] 显示历史

Step 1: Parse operation type

Input Keywords Operation
check check
list list
add add
update update
delete delete
history history

Step 2: Check interactions (check)

Four detection types

  1. Drug-drug interactions: Detect interactions between current medications
  2. Drug-disease conflicts: Detect conflicts between drugs and the user's disease history
  3. Drug dosage conflicts: Detect whether the dosage exceeds the safe range
  4. Drug-food interactions: Detect interactions between drugs and diet

Five-level severity grading

Level Name Code Handling recommendation
A Safe 1 No special measures needed
B Use with caution 2 Observe carefully
C Relative contraindication 3 Weigh benefits and risks
D Contraindicated 4 Avoid concomitant use
X Absolute contraindication 5 Strictly prohibited

Detection process

1. 从 data/medications/medications.json 读取当前用药
2. 从 data/profile.json 读取疾病史
3. 从 data/interactions/interaction-db.json 读取相互作用规则
4. 执行四种检测逻辑
5. 按严重程度排序
6. 生成报告

Step 3: Save the check record

File path:data/interactions/interaction-logs/YYYY-MM/YYYY-MM-DD.json

{
  "date": "2025-12-31",
  "interactions_detected": {
    "total": 3,
    "by_severity": {
      "X": 1,
      "D": 1,
      "C": 1
    }
  }
}

Step 4: List interaction rules (list)

From data/interactions/interaction-db.json read and display.

Execution instructions

1. 解析操作类型
2. [check] 执行四种检测 -> 汇总排序 -> 输出报告 -> 保存
3. [list] 读取规则库 -> 统计显示
4. [add] 解析规则 -> 验证 -> 保存
5. [update] 查找规则 -> 更新字段 -> 保存
6. [delete] 查找规则 -> 确认 -> 删除
7. [history] 读取历史 -> 格式化显示

Example interaction

Check interactions

用户: 检查药物相互作用

输出:
🔍 药物相互作用检查
检测到 3 个相互作用:
🆘 绝对禁忌:华法林 + 阿司匹林
🔴 禁忌:辛伐他汀 + 氨氯地平
🟠 相对禁忌:华法林 + 富含维生素K的食物

View rule base

用户: 列出相互作用规则

输出:
📚 药物相互作用规则库
总规则数:80 条
🆘 绝对禁忌:5 条
...

Add rule

用户: 添加相互作用 阿司匹林 华法林 X 显著增加出血风险

保存新规则