Medical Scribe Dictation
Convert unstructured physician dictation into professionally formatted SOAP (Subjective, Objective, Assessment, Plan) notes with medical terminology normalization and clinical quality assurance.
When to Use
- - Use this skill when the task is to Convert physician verbal dictation into structured SOAP notes. Trigger.
- Use this skill for academic writing tasks that require explicit assumptions, bounded scope, and a reproducible output format.
- Use this skill when you need a documented fallback path for missing inputs, execution errors, or partial evidence.
Key Features
See ## Features above for related details.
- - Scope-focused workflow aligned to: Convert physician verbal dictation into structured SOAP notes. Trigger.
- Packaged executable path(s):
scripts/main.py. - Reference material available in
references/ for task-specific guidance. - Structured execution path designed to keep outputs consistent and reviewable.
Dependencies
- -
openai or anthropic - LLM for structure extraction - INLINECODE5 +
scispacy - Medical NLP processing - INLINECODE7 (optional) - Local STT
- INLINECODE8 - Data validation
Example Usage
See ## Usage above for related details.
CODEBLOCK0
Example run plan:
- 1. Confirm the user input, output path, and any required config values.
- Edit the in-file
CONFIG block or documented parameters if the script uses fixed settings. - Run
python scripts/main.py with the validated inputs. - Review the generated output and return the final artifact with any assumptions called out.
Implementation Details
See ## Workflow above for related details.
- - Execution model: validate the request, choose the packaged workflow, and produce a bounded deliverable.
- Input controls: confirm the source files, scope limits, output format, and acceptance criteria before running any script.
- Primary implementation surface:
scripts/main.py. - Reference guidance:
references/ contains supporting rules, prompts, or checklists. - Parameters to clarify first: input path, output path, scope filters, thresholds, and any domain-specific constraints.
- Output discipline: keep results reproducible, identify assumptions explicitly, and avoid undocumented side effects.
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
CODEBLOCK1
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
CODEBLOCK2
Workflow
- 1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
- Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
- Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
- Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
- If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
Features
- - Speech-to-Text Processing: Transcribe audio or process pre-transcribed text
- SOAP Structure Generation: Auto-organize clinical content into standard sections
- Medical Terminology Handling: Normalize abbreviations, expand acronyms, verify drug names
- Clinical Quality Checks: Flag missing required elements, suggest clarifications
- Multi-Specialty Support: Adaptable templates for internal medicine, surgery, pediatrics, etc.
Usage
Processing Pre-Transcribed Text
CODEBLOCK3
Processing Audio File (requires whisper/faster-whisper)
CODEBLOCK4
Python API
CODEBLOCK5
Parameters
| Parameter | Type | Default | Description |
|---|
| INLINECODE15 | string | - | Raw transcribed text or path to text file |
| INLINECODE16 |
string | - | Path to audio file (wav/mp3/m4a) |
|
specialty | string | "general" | Medical specialty for context hints |
|
output-format | string | "soap" | Output format: soap, ehr, narrative |
|
language | string | "auto" | Language code (en/zh/es/...) |
|
confidence-threshold | float | 0.85 | Minimum confidence for auto-acceptance |
SOAP Output Structure
CODEBLOCK6
Technical Architecture
Components
- 1. Transcription Module (optional): Whisper-based STT with medical vocabulary fine-tuning
- Segmentation Engine: NLP-based section identification and content classification
- Terminology Processor: Medical NER (Named Entity Recognition) and normalization
- SOAP Assembler: Structured output generation with specialty-specific formatting
- Quality Validator: Completeness checks and clinical red-flag detection
Technical Difficulty
High - Requires medical domain expertise, complex NLP pipelines, and clinical validation.
Known Limitations
- - Medical terminology accuracy depends on speech clarity
- Ambiguous dictation may require human clarification
- Drug name verification recommended before finalizing
- Does not replace physician review for critical cases
References
See references/ for:
- -
soap-templates.md - Specialty-specific SOAP templates - INLINECODE23 - Common abbreviation mappings
- INLINECODE24 - Medical ontology references (SNOMED CT, ICD-10)
- INLINECODE25 - Sample dictations with expected outputs
Safety Notes
⚠️ Clinical Validation Required: All generated notes must be reviewed by the attending physician before entering the medical record.
⚠️ No Diagnostic Authority: This tool structures clinical information but does not provide diagnostic suggestions.
Risk Assessment
| Risk Indicator | Assessment | Level |
|---|
| Code Execution | Python/R scripts executed locally | Medium |
| Network Access |
No external API calls | Low |
| File System Access | Read input files, write output files | Medium |
| Instruction Tampering | Standard prompt guidelines | Low |
| Data Exposure | Output files saved to workspace | Low |
Security Checklist
- - [ ] No hardcoded credentials or API keys
- [ ] No unauthorized file system access (../)
- [ ] Output does not expose sensitive information
- [ ] Prompt injection protections in place
- [ ] Input file paths validated (no ../ traversal)
- [ ] Output directory restricted to workspace
- [ ] Script execution in sandboxed environment
- [ ] Error messages sanitized (no stack traces exposed)
- [ ] Dependencies audited
Prerequisites
CODEBLOCK7
Evaluation Criteria
Success Metrics
- - [ ] Successfully executes main functionality
- [ ] Output meets quality standards
- [ ] Handles edge cases gracefully
- [ ] Performance is acceptable
Test Cases
- 1. Basic Functionality: Standard input → Expected output
- Edge Case: Invalid input → Graceful error handling
- Performance: Large dataset → Acceptable processing time
Lifecycle Status
- - Current Stage: Draft
- Next Review Date: 2026-03-06
- Known Issues: None
- Planned Improvements:
- Performance optimization
- Additional feature support
Output Requirements
Every final response should make these items explicit when they are relevant:
- - Objective or requested deliverable
- Inputs used and assumptions introduced
- Workflow or decision path
- Core result, recommendation, or artifact
- Constraints, risks, caveats, or validation needs
- Unresolved items and next-step 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 files, citations, data, search results, or execution outcomes.
Input Validation
This skill accepts requests that match the documented purpose of medical-scribe-dictation and include enough context to complete the workflow safely.
Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
INLINECODE28 only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
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.
医疗听写转录
将非结构化的医生口述内容转换为专业格式化的SOAP(主观、客观、评估、计划)记录,并进行医学术语标准化和临床质量保证。
使用时机
- - 当任务需要将医生的口头听写转换为结构化的SOAP记录时使用此技能。触发条件。
- 用于需要明确假设、限定范围和可重复输出格式的学术写作任务。
- 当需要为缺失输入、执行错误或部分证据提供文档化的回退路径时使用此技能。
关键特性
相关详情请参见上方## 特性部分。
- - 以范围为导向的工作流程,专注于:将医生的口头听写转换为结构化的SOAP记录。触发条件。
- 打包的可执行路径:scripts/main.py。
- 参考资料位于references/目录中,提供任务特定的指导。
- 结构化的执行路径旨在保持输出的一致性和可审查性。
依赖项
- - openai 或 anthropic - 用于结构提取的大语言模型
- spacy + scispacy - 医学自然语言处理
- faster-whisper(可选)- 本地语音转文字
- pydantic - 数据验证
使用示例
相关详情请参见上方## 用法部分。
bash
cd 20260318/scientific-skills/Academic Writing/medical-scribe-dictation
python -m py_compile scripts/main.py
python scripts/main.py --help
示例运行计划:
- 1. 确认用户输入、输出路径以及任何必需的配置值。
- 如果脚本使用固定设置,编辑文件内的CONFIG块或文档化参数。
- 使用验证后的输入运行python scripts/main.py。
- 审查生成的输出,并返回最终产物,同时注明任何假设。
实现细节
相关详情请参见上方## 工作流程部分。
- - 执行模型:验证请求,选择打包的工作流程,并生成限定的可交付成果。
- 输入控制:在运行任何脚本之前,确认源文件、范围限制、输出格式和验收标准。
- 主要实现界面:scripts/main.py。
- 参考指南:references/包含支持规则、提示或检查清单。
- 需要首先明确的参数:输入路径、输出路径、范围过滤器、阈值以及任何领域特定的约束。
- 输出规范:保持结果可重复,明确标识假设,避免未记录的副作用。
快速检查
在深入执行之前,使用此命令验证打包脚本入口点是否可解析。
bash
python -m py_compile scripts/main.py
审计就绪命令
使用这些具体命令进行验证。它们特意设计为自包含,避免使用占位符路径。
bash
python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/main.py -h
python scripts/main.py --help
工作流程
- 1. 在进行详细工作之前,确认用户目标、所需输入和不可协商的约束条件。
- 验证请求是否与文档化的范围匹配,如果任务需要不支持的假设,则尽早停止。
- 仅使用实际可用的输入,使用打包的脚本路径或文档化的推理路径。
- 返回一个结构化的结果,将假设、可交付成果、风险和未解决事项分开。
- 如果执行失败或输入不完整,切换到回退路径,并明确指出阻止完整完成的原因。
特性
- - 语音转文字处理:转录音频或处理预转录的文本
- SOAP结构生成:自动将临床内容组织到标准部分
- 医学术语处理:标准化缩写,扩展首字母缩略词,验证药物名称
- 临床质量检查:标记缺失的必要元素,建议澄清
- 多专科支持:适用于内科、外科、儿科等的可适配模板
用法
处理预转录文本
text
python scripts/main.py --input 患者表现为... --output-format soap
处理音频文件(需要whisper/faster-whisper)
text
python scripts/main.py --audio consultation.wav --output note.md
Python API
python
from scripts.main import MedicalScribe
scribe = MedicalScribe(specialty=internal_medicine)
soapnote = scribe.processdictation(transcription_text)
print(soapnote.tomarkdown())
参数
| 参数 | 类型 | 默认值 | 描述 |
|---|
| input | 字符串 | - | 原始转录文本或文本文件路径 |
| audio |
字符串 | - | 音频文件路径(wav/mp3/m4a) |
| specialty | 字符串 | general | 用于上下文提示的医学专科 |
| output-format | 字符串 | soap | 输出格式:soap、ehr、narrative |
| language | 字符串 | auto | 语言代码(en/zh/es/...) |
| confidence-threshold | 浮点数 | 0.85 | 自动接受的最低置信度 |
SOAP输出结构
markdown
临床记录 - [日期]
主观
主诉:
现病史:
系统回顾:
既往史:
用药史:
过敏史:
社会史:
家族史:
客观
生命体征:
体格检查:
诊断性检查:
评估
主要诊断:
鉴别诊断:
临床推理:
计划
诊断性:
治疗性:
患者教育:
随访:
技术架构
组件
- 1. 转录模块(可选):基于Whisper的语音转文字,带有医学词汇微调
- 分段引擎:基于自然语言处理的部分识别和内容分类
- 术语处理器:医学命名实体识别和标准化
- SOAP组装器:结构化输出生成,带有专科特定格式化
- 质量验证器:完整性检查和临床危险信号检测
技术难度
高 - 需要医学领域专业知识、复杂的自然语言处理流程和临床验证。
已知限制
- - 医学术语准确性取决于语音清晰度
- 模糊的口述可能需要人工澄清
- 建议在最终确定前验证药物名称
- 对于关键病例,不能替代医生审查
参考资料
参见references/目录:
- - soap-templates.md - 专科特定的SOAP模板
- medical-abbreviations.json - 常见缩写映射
- terminology-sources.md - 医学本体参考(SNOMED CT、ICD-10)
- example-cases.md - 带有预期输出的示例口述
安全注意事项
⚠️ 需要临床验证:所有生成的记录在进入病历前必须由主治医生审查。
⚠️ 无诊断权限:此工具结构化临床信息,但不提供诊断建议。
风险评估
| 风险指标 | 评估 | 级别 |
|---|
| 代码执行 | 本地执行Python/R脚本 | 中 |
| 网络访问 |
无外部API调用 | 低 |
| 文件系统访问 | 读取输入文件,写入输出文件 | 中 |
| 指令篡改 | 标准提示指南 | 低 |
| 数据泄露 | 输出文件保存到工作区 | 低 |
安全检查清单
- - [ ] 无硬编码凭据或API密钥
- [ ] 无未经授权的文件系统访问(../)
- [ ] 输出不暴露敏感信息
- [ ] 已实施提示注入保护
- [ ] 输入文件路径已验证(无../遍历)
- [ ] 输出目录限制在工作区内
- [ ] 脚本在沙盒环境中执行
- [ ] 错误消息已清理(不暴露堆栈跟踪)
- [ ] 依赖项已审计
先决条件
text
Python依赖项
pip install -r requirements.txt
评估标准
成功指标
- - [ ] 成功执行主要功能
- [ ] 输出符合质量标准
- [ ] 优雅处理边缘情况
- [ ] 性能可接受
测试用例
- 1. 基本功能:标准输入 → 预期输出
- 边缘情况:无效输入 → 优雅的错误处理
- 性能:大数据集 → 可接受的处理时间
生命周期状态
- - 当前阶段:草稿
- 下次审查日期:2026-03-06
- 已知问题:无
- 计划改进:
- 性能优化
- 额外功能支持
输出要求
每个最终响应在相关时应明确以下事项:
- - 目标或请求的可交付成果
- 使用的输入和引入的假设
- 工作流程或决策路径
- 核心结果、建议或产物
- 约束条件、风险、注意事项或验证需求
- 未解决事项和下一步检查
错误处理
- - 如果缺少必需的输入,明确指出哪些字段缺失,并仅请求最少量的额外信息。
- 如果任务超出文档化范围,停止而不是