Source: https://github.com/aipoch/medical-research-skills
Automated SOAP Note Generator
Quick Check
Use this command to verify that the packaged script entry point can be parsed before deeper execution.
python -m py_compile scripts/main.py
Audit-Ready Commands
Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
python -m py_compile scripts/main.py
python scripts/main.py --help
python scripts/main.py --input "Audit validation sample with explicit symptoms, history, assessment, and next-step plan." --patient-id P12345 --provider "Dr. Smith" --format json
Workflow
- 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.
Overview
AI-powered clinical documentation tool that converts unstructured clinical input into professionally formatted SOAP notes compliant with medical documentation standards.
Key Capabilities:
- Intelligent Parsing: Extracts structured information from free-text clinical narratives
- SOAP Classification: Automatically categorizes content into Subjective, Objective, Assessment, Plan sections
- Medical Entity Recognition: Identifies symptoms, diagnoses, medications, procedures, and anatomical locations
- Temporal Analysis: Extracts timeline information (onset, duration, progression)
- Template Generation: Produces standardized SOAP format suitable for EHR integration
- Multi-modal Input: Accepts text dictation, transcripts, or clinical notes
When to Use
- Use this skill when the user provides de-identified clinical narratives, dictation, or transcripts and needs a structured SOAP note.
- Use this skill when the output must clearly separate Subjective, Objective, Assessment, and Plan sections for clinical review.
- Use this skill when you need a reproducible script-backed workflow with explicit assumptions, unresolved items, and fallback handling.
Core Capabilities
1. Input Processing and Preprocessing
Handle various input formats and prepare for NLP analysis:
from scripts.soap_generator import SOAPNoteGenerator
generator = SOAPNoteGenerator()
# Process text input
soap_note = generator.generate(
input_text="Patient presents with 2-day history of chest pain, radiating to left arm...",
patient_id="P12345",
encounter_date="2026-01-15",
provider="Dr. Smith"
)
# Process from audio transcript
soap_note = generator.generate_from_transcript(
transcript_path="consultation_transcript.txt",
patient_id="P12345"
)
Input Preprocessing Steps:
- Text Cleaning: Remove filler words ("um", "uh"), timestamps, speaker labels
- Sentence Segmentation: Split into clinically meaningful segments
- Normalization: Standardize abbreviations and medical shorthand
- Encoding Detection: Handle various file formats (UTF-8, ASCII, etc.)
Parameters:
| Parameter |
Type |
Required |
Description |
Default |
input_text |
str |
Yes* |
Raw clinical text or dictation |
None |
transcript_path |
str |
Yes* |
Path to transcript file |
None |
patient_id |
str |
No |
Patient identifier (MUST be de-identified for testing) |
None |
encounter_date |
str |
No |
Date in ISO 8601 format (YYYY-MM-DD) |
Current date |
provider |
str |
No |
Healthcare provider name |
None |
specialty |
str |
No |
Medical specialty context |
"general" |
verbose |
bool |
No |
Include confidence scores |
False |
*Either input_text or transcript_path required
Best Practices:
- Always verify input text quality (clear audio → better transcription → better SOAP)
- Remove patient identifiers before processing unless in secure environment
- Split long encounters (>30 minutes) into logical segments
- Flag ambiguous abbreviations for manual review
2. Medical Named Entity Recognition (NER)
Identify and extract medical concepts from unstructured text:
# Extract entities with context
entities = generator.extract_medical_entities(
"Patient has history of hypertension and diabetes,
currently taking lisinopril 10mg daily and metformin 500mg BID"
)
# Returns structured entities:
# {
# "diagnoses": ["hypertension", "diabetes mellitus"],
# "medications": [
# {"name": "lisinopril", "dose": "10mg", "frequency": "daily"},
# {"name": "metformin", "dose": "500mg", "frequency": "BID"}
# ]
# }
Entity Types Recognized:
| Category |
Examples |
Notes |
| Diagnoses |
diabetes, hypertension, pneumonia |
ICD-10 compatible where possible |
| Symptoms |
chest pain, headache, nausea |
Includes severity modifiers |
| Medications |
metformin, lisinopril, aspirin |
Extracts dose, route, frequency |
| Procedures |
ECG, CT scan, blood draw |
Includes body site |
| Anatomy |
left arm, chest, abdomen |
Laterality and location |
| Lab Values |
glucose 120, BP 140/90 |
Units and reference ranges |
| Temporal |
yesterday, 3 days ago, chronic |
Normalized to relative dates |
Common Issues and Solutions:
Issue: Missed medications
- Symptom: Generic names not recognized (e.g., "water pill" for diuretic)
- Solution: Manual review required; tool flags colloquial terms for verification
Issue: Ambiguous abbreviations
- Symptom: "SOB" could be shortness of breath or something else
- Solution: Context-aware disambiguation; flag uncertain cases
Issue: Misspelled drug names
- Symptom: "metfomin" instead of "metformin"
- Solution: Fuzzy matching with confidence threshold; flag low-confidence matches
3. SOAP Section Classification
Automatically categorize sentences into appropriate SOAP sections:
# Classify content into SOAP sections
classified = generator.classify_soap_sections(
"Patient reports chest pain for 2 days. Physical exam shows BP 140/90.
Likely angina. Schedule stress test and start aspirin 81mg daily."
)
# Output structure:
# {
# "Subjective": ["Patient reports chest pain for 2 days"],
# "Objective": ["Physical exam shows BP 140/90"],
# "Assessment": ["Likely angina"],
# "Plan": ["Schedule stress test", "start aspirin 81mg daily"]
# }
Classification Rules:
| Section |
Content Type |
Examples |
| S - Subjective |
Patient-reported information |
"Patient states...", "Patient reports...", "Complains of..." |
| O - Objective |
Observable/measurable findings |
Vital signs, physical exam, lab results, imaging |
| A - Assessment |
Clinical interpretation |
Diagnosis, differential, clinical impression |
| P - Plan |
Actions to be taken |
Medications, procedures, follow-up, patient education |
Multi-label Handling:
Some sentences span multiple sections (e.g., "Patient reports chest pain [S], which was sharp and 8/10 [S], with ECG showing ST elevation [O]")
- Tool splits compound sentences at conjunctions
- Assigns primary and secondary labels with confidence scores
Best Practices:
- Review classification accuracy, especially for complex multi-part statements
- Manually verify Assessment section (most critical for patient care)
- Ensure temporal context preserved (recent vs. chronic symptoms)
4. Temporal Information Extraction
Parse and normalize timeline information:
# Extract temporal relationships
timeline = generator.extract_temporal_info(
"Patient had chest pain starting 3 days ago, worsening since yesterday.
Had similar episode 2 months ago that resolved with rest."
)
# Returns:
# {
# "onset": "3 days ago",
# "progression": "worsening",
# "previous_episodes": [
# {"time": "2 months ago", "resolution": "with rest"}
# ]
# }
Temporal Elements Extracted:
- Onset: When symptoms started ("2 days ago", "this morning")
- Duration: How long symptoms lasted ("for 3 hours", "ongoing")
- Frequency: How often symptoms occur ("daily", "intermittently")
- Progression: Getting better/worse/stable
- Prior Episodes: Previous similar events
- Context: "before meals", "with exertion", "at night"
Normalization:
Converts relative dates to standardized format:
- "yesterday" → Encounter date minus 1 day
- "3 days ago" → Specific date calculated
- "chronic" → Flagged for chronic condition tracking
5. Negation and Uncertainty Detection
Critical for accurate medical documentation:
# Detect negations and uncertainties
analysis = generator.analyze_certainty(
"Patient denies chest pain. No shortness of breath.
Possibly had fever yesterday but not sure."
)
# Identifies:
# - "denies chest pain" → Negative finding (important!)
# - "No shortness of breath" → Negative finding
# - "Possibly had fever" → Uncertain finding (flag for verification)
Detection Categories:
| Type |
Cues |
Action |
| Negation |
denies, no, without, absent |
Mark as negative finding |
| Uncertainty |
possibly, maybe, uncertain, ? |
Flag for physician review |
| Hypothetical |
if, would, could |
Note as conditional |
| Family History |
family history of, mother had |
Separate from patient findings |
⚠️ Critical:
Negation errors are high-risk (e.g., missing "denies" → documenting symptom they don't have)
- Always verify negative findings in Subjective section
- Uncertain findings must be explicitly marked for review
6. Structured SOAP Generation
Produce final formatted output:
# Generate complete SOAP note
soap_output = generator.generate_soap_document(
structured_data=classified,
format="markdown", # Options: markdown, json, hl7, text
include_metadata=True
)
Output Format:
# SOAP Note
**Patient ID:** P12345
**Date:** 2026-01-15
**Provider:** Dr. Smith
## Subjective
Patient reports [extracted symptoms with duration]. History of [chronic conditions].
Currently taking [medications]. Patient denies [negative findings].
## Objective
**Vital Signs:** [BP, HR, RR, Temp, O2Sat]
**Physical Examination:** [Exam findings by system]
**Laboratory/Data:** [Relevant results]
## Assessment
[Primary diagnosis/differential]
[Clinical reasoning summary]
## Plan
1. [Action item 1]
2. [Action item 2]
3. [Follow-up instructions]
---
*Generated by AI. REQUIRES PHYSICIAN REVIEW before entry into patient record.*
Export Formats:
| Format |
Use Case |
Notes |
| Markdown |
Human review, documentation |
Default, readable |
| JSON |
System integration, research |
Structured data |
| HL7 FHIR |
EHR integration |
Healthcare standard |
| Plain Text |
Simple documentation |
Minimal formatting |
| CSV |
Data analysis, research |
Tabular data export |
Limitations
- Not a diagnostic tool: Cannot make medical decisions or diagnoses
- Specialty coverage: Best performance in internal medicine, family practice; variable in highly specialized fields
- Language: Optimized for English; limited support for other languages
- Context window: May lose context in very long, complex encounters
- Ambiguity: Struggles with highly ambiguous or contradictory input
- Rare conditions: May not recognize very rare diseases or new medications
- Non-verbal cues: Cannot interpret tone, emphasis, or non-verbal information from audio
Parameters
| Parameter |
Type |
Default |
Required |
Description |
--input, -i |
string |
- |
No |
Input clinical text directly |
--input-file, -f |
string |
- |
No |
Path to input text file |
--output, -o |
string |
- |
No |
Output file path |
--patient-id, -p |
string |
- |
No |
Patient identifier |
--provider |
string |
- |
No |
Healthcare provider name |
--format |
string |
markdown |
No |
Output format (markdown, json) |
Usage
Basic Usage
# Generate SOAP from text
python scripts/main.py --input "Patient reports chest pain..." --output note.md
# From file
python scripts/main.py --input-file consultation.txt --patient-id P12345 --provider "Dr. Smith"
# JSON output
python scripts/main.py --input-file notes.txt --format json --output note.json
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 automated-soap-note-generator 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:
automated-soap-note-generator 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:
- 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.
When Not to Use
- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.
Required Inputs
| Field |
Required |
Format/Source |
Example |
If Missing |
| User task description |
Yes |
Text |
Research question, writing goal, analysis objective |
Stop and ask user to provide |
| Primary input material |
Depends on task |
Text, file path, ID, table, or literature |
PMID, PDF, CSV, DOCX, keywords, etc. |
Specify which material type is missing |
| Output preference |
No |
Text |
Language, format, target journal, template |
Use skill default format |
Output Contract
- Primary output: Structured result or target file aligned with this skill's objective.
- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.
Failure Handling
- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.
User Checkpoints
- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.
Quick Validation
- Check that key scripts, templates, or reference file paths this skill depends on exist.
- Check that the final output contains the core fields, sections, or files specified for this task.
- Check that results clearly mark assumptions, limitations, and incomplete items.
1---2name: automated-soap-note-generator3description: Generate structured SOAP notes from clinical narratives, transcripts, or existing notes; use when the user needs de-identified clinical documentation organized into Subjective, Objective, Assessment, and Plan sections, with clear assumptions and review points.4license: MIT5---6> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
7
8# Automated SOAP Note Generator
9
10## Quick Check
11
12Use this command to verify that the packaged script entry point can be parsed before deeper execution.
13
14```bash
15python -m py_compile scripts/main.py
16```
17
18## Audit-Ready Commands
19
20Use these concrete commands for validation. They are intentionally self-contained and avoid placeholder paths.
21
22```bash
23python -m py_compile scripts/main.py
24python scripts/main.py --help
25python scripts/main.py --input "Audit validation sample with explicit symptoms, history, assessment, and next-step plan." --patient-id P12345 --provider "Dr. Smith" --format json
26```
27
28## Workflow
29
301. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
312. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
323. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
334. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
345. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.
35
36## Overview
37
38AI-powered clinical documentation tool that converts unstructured clinical input into professionally formatted SOAP notes compliant with medical documentation standards.
39
40**Key Capabilities:**
41- **Intelligent Parsing**: Extracts structured information from free-text clinical narratives
42- **SOAP Classification**: Automatically categorizes content into Subjective, Objective, Assessment, Plan sections
43- **Medical Entity Recognition**: Identifies symptoms, diagnoses, medications, procedures, and anatomical locations
44- **Temporal Analysis**: Extracts timeline information (onset, duration, progression)
45- **Template Generation**: Produces standardized SOAP format suitable for EHR integration
46- **Multi-modal Input**: Accepts text dictation, transcripts, or clinical notes
47
48## When to Use
49
50- Use this skill when the user provides de-identified clinical narratives, dictation, or transcripts and needs a structured SOAP note.
51- Use this skill when the output must clearly separate Subjective, Objective, Assessment, and Plan sections for clinical review.
52- Use this skill when you need a reproducible script-backed workflow with explicit assumptions, unresolved items, and fallback handling.
53
54## Core Capabilities
55
56### 1. Input Processing and Preprocessing
57
58Handle various input formats and prepare for NLP analysis:
59
60```python
61from scripts.soap_generator import SOAPNoteGenerator
62
63generator = SOAPNoteGenerator()
64
65# Process text input
66soap_note = generator.generate(
67 input_text="Patient presents with 2-day history of chest pain, radiating to left arm...",
68 patient_id="P12345",
69 encounter_date="2026-01-15",
70 provider="Dr. Smith"
71)
72
73# Process from audio transcript
74soap_note = generator.generate_from_transcript(
75 transcript_path="consultation_transcript.txt",
76 patient_id="P12345"
77)
78```
79
80**Input Preprocessing Steps:**
811. **Text Cleaning**: Remove filler words ("um", "uh"), timestamps, speaker labels
822. **Sentence Segmentation**: Split into clinically meaningful segments
833. **Normalization**: Standardize abbreviations and medical shorthand
844. **Encoding Detection**: Handle various file formats (UTF-8, ASCII, etc.)
85
86**Parameters:**
87| Parameter | Type | Required | Description | Default |
88|-----------|------|----------|-------------|---------|
89| `input_text` | str | Yes* | Raw clinical text or dictation | None |
90| `transcript_path` | str | Yes* | Path to transcript file | None |
91| `patient_id` | str | No | Patient identifier (MUST be de-identified for testing) | None |
92| `encounter_date` | str | No | Date in ISO 8601 format (YYYY-MM-DD) | Current date |
93| `provider` | str | No | Healthcare provider name | None |
94| `specialty` | str | No | Medical specialty context | "general" |
95| `verbose` | bool | No | Include confidence scores | False |
96
97*Either `input_text` or `transcript_path` required
98
99**Best Practices:**
100- Always verify input text quality (clear audio → better transcription → better SOAP)
101- Remove patient identifiers before processing unless in secure environment
102- Split long encounters (>30 minutes) into logical segments
103- Flag ambiguous abbreviations for manual review
104
105### 2. Medical Named Entity Recognition (NER)
106
107Identify and extract medical concepts from unstructured text:
108
109```python
110# Extract entities with context
111entities = generator.extract_medical_entities(
112 "Patient has history of hypertension and diabetes,
113 currently taking lisinopril 10mg daily and metformin 500mg BID"
114)
115
116# Returns structured entities:
117# {
118# "diagnoses": ["hypertension", "diabetes mellitus"],
119# "medications": [
120# {"name": "lisinopril", "dose": "10mg", "frequency": "daily"},
121# {"name": "metformin", "dose": "500mg", "frequency": "BID"}
122# ]
123# }
124```
125
126**Entity Types Recognized:**
127| Category | Examples | Notes |
128|----------|----------|-------|
129| **Diagnoses** | diabetes, hypertension, pneumonia | ICD-10 compatible where possible |
130| **Symptoms** | chest pain, headache, nausea | Includes severity modifiers |
131| **Medications** | metformin, lisinopril, aspirin | Extracts dose, route, frequency |
132| **Procedures** | ECG, CT scan, blood draw | Includes body site |
133| **Anatomy** | left arm, chest, abdomen | Laterality and location |
134| **Lab Values** | glucose 120, BP 140/90 | Units and reference ranges |
135| **Temporal** | yesterday, 3 days ago, chronic | Normalized to relative dates |
136
137**Common Issues and Solutions:**
138
139**Issue: Missed medications**
140- Symptom: Generic names not recognized (e.g., "water pill" for diuretic)
141- Solution: Manual review required; tool flags colloquial terms for verification
142
143**Issue: Ambiguous abbreviations**
144- Symptom: "SOB" could be shortness of breath or something else
145- Solution: Context-aware disambiguation; flag uncertain cases
146
147**Issue: Misspelled drug names**
148- Symptom: "metfomin" instead of "metformin"
149- Solution: Fuzzy matching with confidence threshold; flag low-confidence matches
150
151### 3. SOAP Section Classification
152
153Automatically categorize sentences into appropriate SOAP sections:
154
155```python
156# Classify content into SOAP sections
157classified = generator.classify_soap_sections(
158 "Patient reports chest pain for 2 days. Physical exam shows BP 140/90.
159 Likely angina. Schedule stress test and start aspirin 81mg daily."
160)
161
162# Output structure:
163# {
164# "Subjective": ["Patient reports chest pain for 2 days"],
165# "Objective": ["Physical exam shows BP 140/90"],
166# "Assessment": ["Likely angina"],
167# "Plan": ["Schedule stress test", "start aspirin 81mg daily"]
168# }
169```
170
171**Classification Rules:**
172| Section | Content Type | Examples |
173|---------|--------------|----------|
174| **S** - Subjective | Patient-reported information | "Patient states...", "Patient reports...", "Complains of..." |
175| **O** - Objective | Observable/measurable findings | Vital signs, physical exam, lab results, imaging |
176| **A** - Assessment | Clinical interpretation | Diagnosis, differential, clinical impression |
177| **P** - Plan | Actions to be taken | Medications, procedures, follow-up, patient education |
178
179**Multi-label Handling:**
180Some sentences span multiple sections (e.g., "Patient reports chest pain [S], which was sharp and 8/10 [S], with ECG showing ST elevation [O]")
181- Tool splits compound sentences at conjunctions
182- Assigns primary and secondary labels with confidence scores
183
184**Best Practices:**
185- Review classification accuracy, especially for complex multi-part statements
186- Manually verify Assessment section (most critical for patient care)
187- Ensure temporal context preserved (recent vs. chronic symptoms)
188
189### 4. Temporal Information Extraction
190
191Parse and normalize timeline information:
192
193```python
194# Extract temporal relationships
195timeline = generator.extract_temporal_info(
196 "Patient had chest pain starting 3 days ago, worsening since yesterday.
197 Had similar episode 2 months ago that resolved with rest."
198)
199
200# Returns:
201# {
202# "onset": "3 days ago",
203# "progression": "worsening",
204# "previous_episodes": [
205# {"time": "2 months ago", "resolution": "with rest"}
206# ]
207# }
208```
209
210**Temporal Elements Extracted:**
211- **Onset**: When symptoms started ("2 days ago", "this morning")
212- **Duration**: How long symptoms lasted ("for 3 hours", "ongoing")
213- **Frequency**: How often symptoms occur ("daily", "intermittently")
214- **Progression**: Getting better/worse/stable
215- **Prior Episodes**: Previous similar events
216- **Context**: "before meals", "with exertion", "at night"
217
218**Normalization:**
219Converts relative dates to standardized format:
220- "yesterday" → Encounter date minus 1 day
221- "3 days ago" → Specific date calculated
222- "chronic" → Flagged for chronic condition tracking
223
224### 5. Negation and Uncertainty Detection
225
226Critical for accurate medical documentation:
227
228```python
229# Detect negations and uncertainties
230analysis = generator.analyze_certainty(
231 "Patient denies chest pain. No shortness of breath.
232 Possibly had fever yesterday but not sure."
233)
234
235# Identifies:
236# - "denies chest pain" → Negative finding (important!)
237# - "No shortness of breath" → Negative finding
238# - "Possibly had fever" → Uncertain finding (flag for verification)
239```
240
241**Detection Categories:**
242| Type | Cues | Action |
243|------|------|--------|
244| **Negation** | denies, no, without, absent | Mark as negative finding |
245| **Uncertainty** | possibly, maybe, uncertain, ? | Flag for physician review |
246| **Hypothetical** | if, would, could | Note as conditional |
247| **Family History** | family history of, mother had | Separate from patient findings |
248
249**⚠️ Critical:**
250Negation errors are high-risk (e.g., missing "denies" → documenting symptom they don't have)
251- Always verify negative findings in Subjective section
252- Uncertain findings must be explicitly marked for review
253
254### 6. Structured SOAP Generation
255
256Produce final formatted output:
257
258```python
259# Generate complete SOAP note
260soap_output = generator.generate_soap_document(
261 structured_data=classified,
262 format="markdown", # Options: markdown, json, hl7, text
263 include_metadata=True
264)
265```
266
267**Output Format:**
268```markdown
269# SOAP Note
270
271**Patient ID:** P12345
272**Date:** 2026-01-15
273**Provider:** Dr. Smith
274
275## Subjective
276Patient reports [extracted symptoms with duration]. History of [chronic conditions].
277Currently taking [medications]. Patient denies [negative findings].
278
279## Objective
280**Vital Signs:** [BP, HR, RR, Temp, O2Sat]
281**Physical Examination:** [Exam findings by system]
282**Laboratory/Data:** [Relevant results]
283
284## Assessment
285[Primary diagnosis/differential]
286[Clinical reasoning summary]
287
288## Plan
2891. [Action item 1]
2902. [Action item 2]
2913. [Follow-up instructions]
292
293---
294*Generated by AI. REQUIRES PHYSICIAN REVIEW before entry into patient record.*
295```
296
297**Export Formats:**
298| Format | Use Case | Notes |
299|--------|----------|-------|
300| **Markdown** | Human review, documentation | Default, readable |
301| **JSON** | System integration, research | Structured data |
302| **HL7 FHIR** | EHR integration | Healthcare standard |
303| **Plain Text** | Simple documentation | Minimal formatting |
304| **CSV** | Data analysis, research | Tabular data export |
305
306## Limitations
307
308- **Not a diagnostic tool**: Cannot make medical decisions or diagnoses
309- **Specialty coverage**: Best performance in internal medicine, family practice; variable in highly specialized fields
310- **Language**: Optimized for English; limited support for other languages
311- **Context window**: May lose context in very long, complex encounters
312- **Ambiguity**: Struggles with highly ambiguous or contradictory input
313- **Rare conditions**: May not recognize very rare diseases or new medications
314- **Non-verbal cues**: Cannot interpret tone, emphasis, or non-verbal information from audio
315
316## Parameters
317
318| Parameter | Type | Default | Required | Description |
319|-----------|------|---------|----------|-------------|
320| `--input`, `-i` | string | - | No | Input clinical text directly |
321| `--input-file`, `-f` | string | - | No | Path to input text file |
322| `--output`, `-o` | string | - | No | Output file path |
323| `--patient-id`, `-p` | string | - | No | Patient identifier |
324| `--provider` | string | - | No | Healthcare provider name |
325| `--format` | string | markdown | No | Output format (markdown, json) |
326
327## Usage
328
329### Basic Usage
330
331```text
332# Generate SOAP from text
333python scripts/main.py --input "Patient reports chest pain..." --output note.md
334
335# From file
336python scripts/main.py --input-file consultation.txt --patient-id P12345 --provider "Dr. Smith"
337
338# JSON output
339python scripts/main.py --input-file notes.txt --format json --output note.json
340```
341
342## Output Requirements
343
344Every final response should make these items explicit when they are relevant:
345
346- Objective or requested deliverable
347- Inputs used and assumptions introduced
348- Workflow or decision path
349- Core result, recommendation, or artifact
350- Constraints, risks, caveats, or validation needs
351- Unresolved items and next-step checks
352
353## Error Handling
354
355- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
356- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
357- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
358- Do not fabricate files, citations, data, search results, or execution outcomes.
359
360## Input Validation
361
362This skill accepts requests that match the documented purpose of `automated-soap-note-generator` and include enough context to complete the workflow safely.
363
364Do not continue the workflow when the request is out of scope, missing a critical input, or would require unsupported assumptions. Instead respond:
365
366> `automated-soap-note-generator` only handles its documented workflow. Please provide the missing required inputs or switch to a more suitable skill.
367
368## Response Template
369
370Use the following fixed structure for non-trivial requests:
371
3721. Objective
3732. Inputs Received
3743. Assumptions
3754. Workflow
3765. Deliverable
3776. Risks and Limits
3787. Next Checks
379
380If the request is simple, you may compress the structure, but still keep assumptions and limits explicit when they affect correctness.
381
382## When Not to Use
383
384- Do not proceed when required input files, identifiers, parameters, or context are missing — ask the user to provide them first.
385- Do not assume capabilities beyond this skill's declared scope when the user requests external operations or inferences.
386- Do not proceed without user confirmation when overwriting existing results, executing high-cost batch operations, or expanding task scope.
387
388## Required Inputs
389
390| Field | Required | Format/Source | Example | If Missing |
391|---|---|---|---|---|
392| User task description | Yes | Text | Research question, writing goal, analysis objective | Stop and ask user to provide |
393| Primary input material | Depends on task | Text, file path, ID, table, or literature | PMID, PDF, CSV, DOCX, keywords, etc. | Specify which material type is missing |
394| Output preference | No | Text | Language, format, target journal, template | Use skill default format |
395
396## Output Contract
397
398- Primary output: Structured result or target file aligned with this skill's objective.
399- Optional output: Intermediate check notes, issue list, supplementary suggestions, or generated file paths.
400- Format requirement: Unless the user specifies otherwise, prefer stable, reviewable Markdown or JSON; if the skill's bundled script requires a fixed format, use that format.
401- If partially complete: Must explicitly mark as PARTIAL and state which steps are completed and which remain.
402
403## Failure Handling
404
405- Missing critical input: Explicitly state which fields, files, or identifiers are missing and pause.
406- Script, template, or resource execution failure: Report the failing step, likely cause, and recovery suggestions — do not silently degrade.
407- Partial completion only: Return the verified portion first, then list remaining blockers and suggested next steps.
408
409## User Checkpoints
410
411- Before executing batch processing, overwriting files, long-running searches, or multi-stage generation, confirm scope and output format with the user.
412- Before proceeding when a key judgment is ambiguous, evidence is insufficient, or the workflow is entering the next stage, confirm with the user.
413
414## Quick Validation
415
416- Check that key scripts, templates, or reference file paths this skill depends on exist.
417- Check that the final output contains the core fields, sections, or files specified for this task.
418- Check that results clearly mark assumptions, limitations, and incomplete items.