discharge

A command for saving and organizing hospital discharge summaries, either from an image or from text supplied by the user. A discharge summary is the medical document that describes a hospital stay, diagnoses, treatment, condition at discharge, and follow-up instructions.

In plain words
What is it for?
Reading discharge-summary images or text, recording admission and discharge dates, structuring diagnoses and treatments, and saving medication, care, and follow-up instructions.
Why use it?
It extracts the important details into a consistent record instead of leaving them in an image or unstructured note. Missing key information can be identified for follow-up.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/huifer/wellally-health/discharge
Clone the repo
git clone --depth 1 https://github.com/huifer/WellAlly-health

Made for: Claude Code.

Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00006 $0.03113
Opus 5 $0.00003 $0.01556
Sonnet 5 $0.00001 $0.00623
Haiku 4.5 $0.00001 $0.00311

Measured yesterday against content hash ed3445fe09fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

discharge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/discharge.md · 401 lines

How it starts

The opening of the file, as written. The whole thing — 401 lines — stays where its author put it; the contents beside it link to each section on GitHub.

出院小结管理

用于保存和结构化出院小结信息,支持从图片提取或直接从文字描述处理。

参数说明

  • source(必填):出院小结来源,可以是:

    • 图片路径:@医疗报告/出院小结.jpg
    • 文字描述:直接粘贴出院小结的文本内容或摘要
  • admission_date(可选):入院日期,格式 YYYY-MM-DD

  • discharge_date(可选):出院日期,格式 YYYY-MM-DD

执行步骤

情况1:从图片提取

如果用户提供了图片路径:

  1. 读取并分析图片

    • 使用 Read 工具读取出院小结图片
    • 使用 mcp__4_5v_mcp__analyze_image 工具分析图片内容

    图片分析提示词模板:

    请详细识别这张出院小结的所有内容,包括:
    
    1. **基础信息:**
       - 患者姓名
       - 性别、年龄
       - 入院日期、出院日期
       - 住院天数
       - 住院科室、床号
       - 医保类型
    
    2. **诊断信息:**
       - 入院诊断(主要诊断和其他诊断)
       - 出院诊断(主要诊断和其他诊断)
       - 诊断编码(ICD-10,如有)
    
    3. **治疗经过:**
       - 主要治疗措施
       - 手术记录(如有)
       - 药物治疗方案
       - 检查结果摘要
    
    4. **出院情况:**
       - 出院时病情状态
       - 症状改善情况
       - 生命体征
    
    5. **出院医嘱:**
       - 用药指导(药品名称、剂量、用法、疗程)
       - 饮食指导
       - 活动指导
       - 伤口护理(如有)
       - 复查计划和时间
       - 注意事项
    
    6. **其他信息:**
       - 主治医生
       - 医院名称
       - 住院费用(如有)
       - 随诊电话
    
    请以结构化的方式列出所有信息,保持原文准确性。
    
  2. 提取并结构化数据

    • 从图片识别结果中提取所有关键字段
    • 组织成结构化 JSON 格式

情况2:从文字描述处理

如果用户直接提供文字内容:

  1. 分析文本内容

    • 从用户提供的文字中提取信息
    • 按照下方数据结构进行分类
  2. 询问缺失信息

    • 如果关键信息缺失,询问用户补充

2. 生成数据文件

文件路径格式: data/出院小结/YYYY-MM/YYYY-MM-DD_主要诊断.json

JSON 数据结构:

{
  "id": "{{生成唯一ID,使用日期+时间戳}}",
  "basic_info": {
    "hospital": "某某医院",
    "department": "消化内科",
    "admission_date": "2024-08-10",
    "discharge_date": "2024-08-15",
    "hospitalization_days": 5,
    "bed_number": "23床",
    "insurance_type": "职工医保"
  },
  "diagnosis": {
    "admission_diagnosis": {
      "main": "急性胆囊炎",
      "secondary": [
        "胆囊结石",
        "高血压病(2级,中危组)"
      ],
      "icd_codes": {
        "main": "K80.0",
        "secondary": ["I10"]
      }
    },
    "discharge_diagnosis": {
      "main": "急性胆囊炎",
      "secondary": [
        "胆囊结石",
        "高血压病(2级,中危组)",
        "2型糖尿病"
      ],
      "icd_codes": {
        "main": "K80.0",
        "secondary": ["I10", "E11.9"]
      }
    }
  },
  "treatment_summary": {
    "main_treatments": [
      "禁食水、胃肠减压",
      "抗感染治疗(头孢哌酮钠舒巴坦钠)",
      "解痉止痛治疗",
      "补液支持治疗"
    ],
    "medications": [
      {
        "drug_name": "头孢哌酮钠舒巴坦钠",
        "dosage": "2.0g",
        "frequency": "每12小时一次",
        "route": "静脉滴注",
        "duration": "5天"
      },
      {
        "drug_name": "阿托品",
        "dosage": "0.5mg",
        "frequency": "必要时",
        "route": "肌肉注射"
      }
    ],
    "procedures": [],
    "surgeries": [
      {
        "surgery_name": "腹腔镜下胆囊切除术",
        "surgery_date": "2024-08-12",
        "anesthesia": "全身麻醉",
        "surgeon": "张医生"
      }
    ],
    "examination_results": "血常规:WBC 12.5×10^9/L,N% 85%;腹部B超:胆囊壁增厚,胆囊结石"
  },
  "discharge_status": {
    "condition": "好转",
    "symptoms": "腹痛缓解,无发热,饮食恢复",
    "vital_signs": {
      "blood_pressure": "130/80 mmHg",
      "heart_rate": "78 次/分",
      "temperature": "36.5℃",
      "respiration": "18 次/分"
    },
    "activity_level": "可下床活动"
  },
  "discharge_orders": {
    "medication_instructions": [
      {
        "drug_name": "阿莫西林胶囊",
        "dosage": "0.5g",
        "frequency": "每日3次",
        "route": "口服",
        "duration": "7天",
        "notes": "餐后服用"
      }
    ],
    "dietary_guidance": "低脂饮食,少食多餐,避免油腻食物",
    "activity_guidance": "适度活动,避免剧烈运动和重体力劳动",
    "wound_care": "保持伤口干燥清洁,每3天换药一次,如发现红肿热痛及时就诊",
    "follow_up_plan": [
      {
        "item": "术后复查",
        "timing": "术后2周",
        "location": "普通外科门诊",
        "purpose": "伤口拆线、评估恢复情况"
      },
      {
        "item": "腹部B超",
        "timing": "术后1个月",
        "purpose": "评估腹腔情况"
      }
    ],
    "warnings": [
      "如出现发热、腹痛、黄疸等症状,请及时就医",
      "避免暴饮暴食和高脂饮食",
      "规律服药,不可自行停药"
    ]
  },
  "attending_physician": {
    "name": "张医生",
    "title": "主治医师"
  },
  "financial_info": {
    "total_cost": 18500.50,
    "insurance_coverage": 12000.00,
    "self_payment": 6500.50
  },
  "original_source": {
    "type": "image/text",
    "file_path": "images/出院小结.jpg",
    "created_at": "2024-08-15"
  },
  "notes": "其他补充信息或特殊说明"
}

Read the full file on GitHub · 401 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 401 lines · 6 tokens per session scan A ed3445fe09fc

Subscribe to this mod's changes

discharge is a command published in the GitHub repository huifer/WellAlly-health (935 stars, last pushed 1mo ago), licensed MIT. It adds 6 tokens to every session and 3,113 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.