Preface¶
When building clinical-related agents in DSH, a common practice is to have the model “polish medical orders” or “complete medication instructions from a knowledge base.” This introduces medical phrasing generated by the model and can easily overstep boundaries by offering suggestions before the doctor has made a final decision. The last minute of a clinic visit is often the moment where the doctor has already made a decision in their mind, but the patient only walks away with a few sentences, forgetting them by the time they reach the exit stairs.
liuhange789/dsh-patient-education (npm package name @liuhange/dsh-patient-education) takes a different path: it does not diagnose, recommend medication, or perform triage; it simply fills the fields already provided by the doctor into a fixed Markdown template to produce a readable one-page “Post-visit Instructions.” Maintainer: liuhange789; categorized as Model Inference in the SkillHub Plugin Directory; current GitHub stars: 0. License: MIT, version 0.1.0.
What is it¶
The plugin registers a host tool generate_patient_guide in DSH with no browser-side capabilities: the output is pure Markdown, rendered as text by the shell.
It solves the problem of “decisions are made but communication is unclear”: input includes diagnosis sentences, medication lines, dietary and activity restrictions, follow-up arrangements, and warning signs written by the doctor; output is a structured guide accompanied by a heuristic reading_level (Simple / Moderate / Difficult), used for a rough check of readability at the template level, rather than a validated reading difficulty scale.
Three Boundaries (Read before use)¶
- Only format decisions already made by the doctor. Every sentence aimed at the patient comes from hardcoded template slots; the text inside slots is input by the caller and written as-is (blank collapsing, table vertical bar escaping). It does not explain diagnoses, expand abbreviations, or infer “what the doctor might mean.”
- No medical advice provided. It does not add or delete drugs, dosages, dietary rules, warning signs, or follow-up intervals. Fields left blank by the doctor will be printed with an explicit missing note (e.g., “Doctor did not fill in medication for this visit.”), without default values replacing them.
- Must be reviewed by the doctor before giving to the patient. The output is a layout layer, not a second medical opinion. Giving it directly to the patient without review is a usage outside the plugin’s design scope.
If the decision is wrong, incomplete, or not yet made, the plugin reflects this truthfully—at this point, this tool should not be used.
Core Functionality¶
| Tool | Purpose |
|---|---|
generate_patient_guide |
Fills the post-visit template based on doctor input, returns guide_markdown and reading_level |
Input Fields (Selected):
| Field | Type | Required | Description |
|---|---|---|---|
diagnosis |
string | Yes | One sentence, ≤200 chars; rendered as “Current Diagnosis: …”. |
medications |
array | No | ≤20 items; empty means no medication prescribed this visit. |
medications[].name |
string | Yes | Drug name, ≤80 chars. |
medications[].dosage / frequency / duration / note |
string | No | Dosage, frequency, duration, notes, etc. |
restrictions |
string[] | No | Diet and activity, ≤200 chars each, ≤20 items. |
followup |
string | No | Follow-up schedule, ≤300 chars. |
warning_signs |
string[] | No | Situations requiring immediate medical attention, ≤200 chars each, ≤20 items. |
Output:
guide_markdown: Fixed section order—# Your Post-Visit Instructions→ Diagnosis → Medication Table (Name / How to take / How long / Notes) → Diet & Activity → Follow-up → When to seek immediate care.reading_level: Heuristic grading of rendered text (e.g., average sentence length); drops a level if the full text exceeds 1200 characters.
Validation (Before rendering): Unknown top-level or medication sub-fields are directly rejected; empty strings, non-strings, or fields/lists exceeding limits will throw an error including the field name; newlines are collapsed to spaces; | inside table cells is escaped to avoid breaking the table or embedding extra paragraphs.
Installation & Enablement¶
First, install the npm package in your environment:
npm install @liuhange/dsh-patient-education
Then, write the bundle into the package.json of the DSH profile (side-by-side with the base bundle), and execute npm install in the profile directory:
{
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-headless",
"@liuhange/dsh-patient-education"
]
}
},
"dependencies": {
"@liuhange/dsh-patient-education": "0.1.0"
}
}
Peer dependencies include @deepseek-ai/dsh-tools (>=0.1.0-rc.7 <0.2.0) and @deepseek-ai/schemastery (>=3.18.0 <4), consistent with common DSH engineering practices.
Typical Usage¶
The following example is from the repository README. It calls the tool and displays the generated Markdown structure (each line corresponds to a template or doctor input):
generate_patient_guide({
diagnosis: '上呼吸道感染(普通感冒)',
medications: [
{ name: '布洛芬缓释胶囊', dosage: '每次 1 粒', frequency: '一日两次', duration: '3 天', note: '饭后服用' },
{ name: '氯雷他定片', dosage: '每次 1 片', frequency: '每晚一次', duration: '5 天' },
],
restrictions: ['多喝温水', '避免饮酒', '保证睡眠'],
followup: '症状超过 5 天未缓解,请到门诊复查。',
warning_signs: ['持续高热超过 3 天', '呼吸急促或胸闷', '意识模糊'],
})
The core fragment of the generated instructions is as follows:
# 您的就诊须知
## 诊断
本次诊断:上呼吸道感染(普通感冒)。
## 用药
| 药名 | 怎么吃 | 吃多久 | 注意事项 |
| --- | --- | --- | --- |
| 布洛芬缓释胶囊 | 每次 1 粒,一日两次 | 3 天 | 饭后服用 |
| 氯雷他定片 | 每次 1 片,每晚一次 | 5 天 | — |
In the agent workflow, upstream steps usually collect or confirm doctor fields, then call generate_patient_guide; downstream steps only handle display or archiving, reserving a review step for the doctor.
Suitable Scenarios & Considerations¶
Suitable: Teams that need to convert “confirmed clinical decisions” into a fixed-format patient guide within a DSH workflow and emphasize traceability (output does not mix in model-generated medical phrasing); works well when connecting to EHR or form fields, provided validation rules match the README.
Not Suitable: Scenarios where a diagnosis or medication has not yet been issued, requires the model to complete medical content, or expects the plugin to perform triage on behalf of the doctor.
Permissions & Safety: The plugin runs with the permissions of the current DSH process; it is recommended to read the GitHub source code and the MIT license before installation to ensure compliance with institutional requirements. The community directory SkillHub is an independent site with no official affiliation with DeepSeek / Huanfang.
The DSH ecosystem advocates “everything is a plugin”; this plugin is a formatting bundle within it, does not replace clinical information systems, and does not undertake functions beyond the boundaries of medical liability.
Conclusion¶
If your pain point is “the doctor has decided, but the patient won’t remember,” rather than “letting AI help the doctor make decisions,” @liuhange/dsh-patient-education provides an auditable template filling path: one tool, one Markdown, three clear boundaries. For further details and development/testing instructions, see the GitHub repository; the index page is on the SkillHub directory.