Skip to content

Instantly share code, notes, and snippets.

@darronj
Last active February 10, 2026 21:21
Show Gist options
  • Select an option

  • Save darronj/65f395400c4a25957262337a51b52cb5 to your computer and use it in GitHub Desktop.

Select an option

Save darronj/65f395400c4a25957262337a51b52cb5 to your computer and use it in GitHub Desktop.
RAG Test Document Suite - FND Treatment Focus
const fs = require('fs');
const { exec } = require('child_process');
const path = require('path');
// Check if pandoc can convert to docx
exec('pandoc --version', (error) => {
if (error) {
console.log('Pandoc not available, creating markdown for manual conversion');
return;
}
// Create a new markdown document for the third test case
const markdownContent = `# Progress Note - Test Document
**Visit Type**: Follow-up Consultation
**Date**: May 10, 2024
**Provider**: Dr. Sarah Chen, MD, FACP
**Patient ID**: TEST-PATIENT-089
**Document Status**: FOR TESTING PURPOSES ONLY - NOT REAL MEDICAL CONTENT
---
## Subjective
Patient returns for 6-week follow-up regarding fictional Neurological Rhythm Disorder (NRD-505). Patient reports significant improvement in symptoms since initiating treatment protocol. States, "The episodes have decreased from daily occurrences to just 2-3 times per week, and they're much less intense."
Patient describes current symptoms as mild rhythmic sensations in bilateral lower extremities, occurring primarily in evening hours between 8:00 PM and 11:00 PM. Duration of episodes has decreased from 2 hours to approximately 30-45 minutes. No longer experiencing daytime symptoms that previously interfered with work activities.
Medication adherence reported as excellent. Patient taking Rhythmozine 225mg twice daily as prescribed, with no missed doses. Reports mild initial nausea during first week of treatment that has since resolved. No other adverse effects noted.
## Objective
**Vital Signs:**
- Blood Pressure: 118/76 mmHg
- Heart Rate: 72 bpm
- Temperature: 98.4°F
- Weight: 165 lbs (stable from baseline)
**Neurological Rhythm Assessment (NRA):**
- Baseline rhythm score: 8.2/10 (improved from 3.1/10 at initial visit)
- Bilateral symmetry index: 94% (normal range: 90-100%)
- Episode frequency index: 18 (normal range: <20)
- Rhythm amplitude: 2.3 units (normal range: <3.0 units)
**Physical Examination:**
- Alert, oriented x3, in no acute distress
- Cranial nerves II-XII intact
- Motor strength 5/5 throughout all extremities
- Sensation intact to light touch and proprioception
- Deep tendon reflexes 2+ and symmetric
- Gait: Normal, no ataxia or imbalance noted
## Assessment
1. **Neurological Rhythm Disorder (NRD-505)** - Responding well to treatment
- Significant improvement in symptom frequency (70% reduction)
- Episode duration reduced by 60-75%
- NRA scores approaching normal range
- No adverse medication effects at current dose
2. **Treatment efficacy** - Excellent response to Rhythmozine 225mg BID
- Target dose achieved without titration complications
- Therapeutic levels confirmed by symptom improvement
- Patient tolerating medication well
## Plan
### Medication Management
Continue Rhythmozine 225mg twice daily (morning and evening with meals). Current dosing appears optimal given excellent response and absence of side effects. Will maintain this dose for next 12 weeks to ensure sustained improvement.
### Monitoring Protocol
Patient will continue daily symptom diary documenting:
1. Episode timing and duration
2. Symptom intensity (scale 0-10)
3. Potential triggers or patterns
4. Medication timing and any missed doses
5. Any new or unusual symptoms
### Laboratory Studies
Order comprehensive metabolic panel and Rhythmozine serum level for next visit to ensure:
- Therapeutic drug levels (target range: 85-120 mcg/mL)
- Normal hepatic and renal function
- No electrolyte imbalances
### Follow-up Schedule
- Next appointment: 12 weeks (August 2, 2024)
- Patient instructed to contact office sooner if:
- Episode frequency increases to more than 5 per week
- Episode duration exceeds 2 hours
- New neurological symptoms develop
- Concerning side effects emerge
### Patient Education
Reviewed importance of:
- Consistent medication timing to maintain steady therapeutic levels
- Adequate sleep hygiene (episodes more likely with sleep deprivation)
- Avoiding known triggers: caffeine after 2:00 PM, extreme temperature changes
- Gradual return to exercise program (currently approved for low-impact activities)
### Additional Recommendations
Patient may gradually resume normal daily activities including return to full-time work schedule. Continue to avoid high-risk activities (driving long distances alone, operating heavy machinery) until symptoms have been completely stable for additional 6 weeks.
Consider referral to physical therapy if patient wishes to return to competitive athletics - specialized rhythm stabilization exercises may be beneficial for high-intensity activity tolerance.
## Prognosis
Excellent short-term prognosis given robust treatment response. Based on current trajectory and typical NRD-505 course, anticipate potential medication taper discussions at 6-month mark if symptoms remain controlled. Studies indicate 85% of patients with similar response profiles achieve sustained remission after 9-12 months of treatment.
---
## Test Validation Data
**Key Searchable Information:**
- Condition: Neurological Rhythm Disorder (NRD-505)
- Medication: Rhythmozine 225mg twice daily
- Patient: TEST-PATIENT-089
- Provider: Dr. Sarah Chen, MD, FACP
- Symptom improvement: 70% reduction in frequency
- Episode duration: Decreased from 2 hours to 30-45 minutes
- Target drug level: 85-120 mcg/mL
- Follow-up interval: 12 weeks
- Next visit: August 2, 2024
**RAG Test Queries:**
- What is the dosing for Rhythmozine in NRD-505?
- What are the follow-up intervals for NRD-505 patients?
- What is the target therapeutic range for Rhythmozine?
- What symptom improvements indicate treatment success?
- What activities should NRD-505 patients avoid?
- When can medication taper be considered?
`;
// Write the markdown file
fs.writeFileSync('rag-test-progress-note.md', markdownContent);
console.log('✓ Markdown file created: rag-test-progress-note.md');
// Convert to DOCX using pandoc
exec('cd /Users/darronj/code/work/intermark/ReACT.ReactApp/test-data && pandoc rag-test-progress-note.md -o rag-test-progress-note.docx', (error, stdout, stderr) => {
if (error) {
console.error('Error converting to DOCX:', error);
console.log('\nYou can manually convert the markdown file to DOCX using:');
console.log(' pandoc rag-test-progress-note.md -o rag-test-progress-note.docx');
return;
}
console.log('✓ DOCX file created: rag-test-progress-note.docx');
// Verify file was created
exec('ls -lh rag-test-progress-note.*', (error, stdout) => {
if (!error) {
console.log('\nFiles created:');
console.log(stdout);
}
});
});
});
const fs = require('fs');
// Read the markdown content
const markdownContent = fs.readFileSync('fnd-session-notes.md', 'utf8');
// Convert markdown headings and basic formatting to HTML
const htmlBody = markdownContent
.replace(/^# (.+)$/gm, '<h1>$1</h1>')
.replace(/^## (.+)$/gm, '<h2>$1</h2>')
.replace(/^### (.+)$/gm, '<h3>$1</h3>')
.replace(/^\*\*(.+?)\*\*:/gm, '<strong>$1:</strong>')
.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
.replace(/^---$/gm, '<hr>')
.replace(/^- (.+)$/gm, '<li>$1</li>')
.replace(/(<li>.*<\/li>)/gs, '<ul>$1</ul>')
.replace(/<\/ul>\s*<ul>/g, '')
.replace(/\n\n/g, '</p><p>')
.replace(/^(?!<[h|u|l|p|d|hr])(.*?)$/gm, '<p>$1</p>')
.replace(/<p><\/p>/g, '')
.replace(/<p>(<h[123]>)/g, '$1')
.replace(/(<\/h[123]>)<\/p>/g, '$1')
.replace(/<p>(<hr>)<\/p>/g, '$1')
.replace(/<p>(<ul>)/g, '$1')
.replace(/(<\/ul>)<\/p>/g, '$1');
const htmlContent = `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
font-family: 'Georgia', serif;
margin: 40px;
line-height: 1.6;
color: #333;
}
h1 {
color: #1a365d;
border-bottom: 3px solid #2c5282;
padding-bottom: 10px;
font-size: 28px;
}
h2 {
color: #2c5282;
margin-top: 25px;
border-bottom: 2px solid #e2e8f0;
padding-bottom: 5px;
font-size: 22px;
}
h3 {
color: #2d3748;
margin-top: 18px;
font-size: 18px;
}
hr {
border: none;
border-top: 2px solid #cbd5e0;
margin: 25px 0;
}
p {
margin: 10px 0;
}
ul {
margin: 10px 0 10px 25px;
}
li {
margin: 5px 0;
}
strong {
color: #1a202c;
font-weight: 600;
}
</style>
</head>
<body>
${htmlBody}
</body>
</html>
`;
// Write HTML file
fs.writeFileSync('fnd-session-notes.html', htmlContent);
console.log('✓ HTML file created: fnd-session-notes.html');
console.log('\\nTo convert to PDF, run:');
console.log('/Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --headless --disable-gpu --print-to-pdf=fnd-session-notes.pdf fnd-session-notes.html');
const fs = require('fs');
const { exec } = require('child_process');
// HTML content that can be converted to PDF
const htmlContent = `
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
font-family: Arial, sans-serif;
margin: 40px;
line-height: 1.6;
}
h1 {
text-align: center;
color: #333;
border-bottom: 2px solid #333;
padding-bottom: 10px;
}
h2 {
color: #555;
margin-top: 20px;
border-bottom: 1px solid #ccc;
padding-bottom: 5px;
}
.metadata {
background-color: #f5f5f5;
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
}
.metadata p {
margin: 5px 0;
}
.warning {
background-color: #fff3cd;
border: 1px solid #ffc107;
padding: 10px;
border-radius: 5px;
font-style: italic;
margin-bottom: 20px;
}
ul {
margin: 10px 0;
}
.keywords {
background-color: #e7f3ff;
padding: 10px;
border-radius: 5px;
margin-top: 30px;
font-size: 0.9em;
}
</style>
</head>
<body>
<h1>Clinical Session Notes - Test Document</h1>
<div class="metadata">
<p><strong>Session Type:</strong> Initial Assessment</p>
<p><strong>Date:</strong> April 22, 2024</p>
<p><strong>Clinician:</strong> Dr. Benjamin Hayes, PsyD</p>
<p><strong>Patient ID:</strong> TEST-PATIENT-042</p>
</div>
<div class="warning">
<strong>Document Status:</strong> FOR TESTING PURPOSES ONLY - NOT REAL MEDICAL CONTENT
</div>
<h2>Chief Complaint</h2>
<p>Patient presents with symptoms of fictional Temporal Perception Syndrome (TPS-303), reporting episodes where time appears to move at varying speeds. Patient states, "Sometimes five minutes feels like an hour, and other times an hour passes in what seems like seconds."</p>
<h2>History of Present Illness</h2>
<p>Symptoms began approximately 14 weeks ago following exposure to high-altitude conditions during a mountain climbing expedition. Initial episode lasted 3.5 hours and occurred at 12,000 feet elevation. Since then, patient reports 2-3 episodes per week, each lasting between 45-90 minutes.</p>
<h2>Assessment Findings</h2>
<p><strong>Temporal Perception Assessment Score (TPAS):</strong> 67/100</p>
<ul>
<li>Time estimation accuracy: 43% (normal range: 85-95%)</li>
<li>Temporal consistency index: 2.8 (normal: 8-10)</li>
<li>Chronometric awareness: Moderate impairment</li>
</ul>
<p>Physical examination within normal limits. No evidence of vestibular dysfunction or other neurological deficits. Patient demonstrates normal cognitive function on Mini-Mental State Examination (MMSE score: 29/30).</p>
<h2>Treatment Plan</h2>
<p>Based on current evidence for TPS-303 management, recommend the following interventions:</p>
<h3>1. Medication</h3>
<p>Initiate Temporazine 150mg once daily, to be taken in the morning with food. Expected therapeutic effect within 4-6 weeks.</p>
<h3>2. Behavioral Therapy</h3>
<p>Weekly sessions focusing on temporal grounding techniques, including:</p>
<ul>
<li>Clock-checking exercises (every 30 minutes during waking hours)</li>
<li>Structured daily routines with fixed time markers</li>
<li>Mindfulness-based temporal awareness training</li>
</ul>
<h3>3. Environmental Modifications</h3>
<p>Avoid high-altitude environments (above 8,000 feet) for the next 90 days while treatment stabilizes.</p>
<h3>4. Monitoring</h3>
<p>Patient will maintain a daily symptom log recording:</p>
<ul>
<li>Episode frequency and duration</li>
<li>Temporal distortion severity (scale 1-10)</li>
<li>Medication adherence</li>
<li>Associated symptoms or triggers</li>
</ul>
<h2>Follow-up Schedule</h2>
<ul>
<li><strong>Week 2:</strong> Telephone check-in to assess medication tolerance</li>
<li><strong>Week 4:</strong> In-person visit for TPAS reassessment and treatment adjustment</li>
<li><strong>Week 8:</strong> Comprehensive evaluation including repeat testing battery</li>
<li><strong>Monthly visits thereafter</strong> until symptom resolution</li>
</ul>
<h2>Special Notes for RAG Testing</h2>
<p>This case demonstrates moderate TPS-303 with clear temporal distortion episodes. The 150mg Temporazine dosage is standard for adult patients weighing 140-200 pounds. Patients should be counseled that improvement typically requires 4-6 weeks of consistent treatment.</p>
<p><strong>Red flag symptoms requiring immediate contact:</strong> episodes lasting more than 4 hours, severe disorientation, or complete temporal dissociation.</p>
<div class="keywords">
<strong>Test Validation Keywords:</strong> Temporal Perception Syndrome, TPS-303, Temporazine, Dr. Benjamin Hayes, TEST-PATIENT-042, 150mg, TPAS score 67, 14 weeks, high-altitude, 4-6 weeks
<br><br>
<strong>RAG System Test Queries:</strong>
<ul>
<li>Medication dosing information</li>
<li>Treatment timeline expectations</li>
<li>Follow-up scheduling protocols</li>
<li>Assessment scoring interpretation</li>
</ul>
</div>
</body>
</html>
`;
// Write HTML file
fs.writeFileSync('rag-test-session-notes.html', htmlContent);
console.log('✓ HTML file created: rag-test-session-notes.html');
// Try to convert to PDF using various methods
console.log('\\nAttempting PDF conversion...');
console.log('Note: If you have Chrome/Chromium installed, you can run:');
console.log(' /Applications/Google\\ Chrome.app/Contents/MacOS/Google\\ Chrome --headless --disable-gpu --print-to-pdf=rag-test-session-notes.pdf rag-test-session-notes.html');
console.log('\\nOr open the HTML file in your browser and use Print to PDF.');

Progress Note: Functional Weakness Follow-Up

FOR TESTING PURPOSES ONLY - FICTITIOUS CLINICAL CONTENT


Patient Demographics

Patient ID: TEST-PATIENT-167 Date of Visit: December 8, 2025 Provider: Dr. Lisa Rodriguez, OTR/L, PhD Visit Type: Follow-up Consultation (Week 6 of Treatment) Session Duration: 60 minutes Setting: ReACT Outpatient Rehabilitation Center


Treatment Program

ReACT Module: Module 4 - Upper Extremity Weakness Retraining Treatment Start Date: October 27, 2025 (6 weeks ago) Initial Presentation: Functional weakness in right dominant upper extremity Treatment Phase: Currently in Phase 3 of 4-phase protocol


Subjective Report

Patient reports significant improvement in right arm function since starting the ReACT program. States, "I can use my arm much more than I could six weeks ago. It's not perfect, but it's so much better."

Patient-reported changes:

  • Able to lift grocery bags with right arm (up to 10 lbs)
  • Can prepare simple meals independently
  • Returned to part-time work (3 days/week, previously on leave)
  • Using right hand for computer mouse and keyboard
  • Still experiences fatigue with prolonged use

Symptom patterns:

  • Weakness less pronounced in the morning
  • Increases with stress or after poor sleep
  • Minimal weakness noted when engaged in enjoyable activities
  • Patient recognizes attention-related variability

Current concerns:

  • Worried about sustainability of gains
  • Anxious about returning to full-time work
  • Some lingering fatigue in arm after 30+ minutes of continuous use

Objective Findings

Strength Assessment

Manual Muscle Testing (Right Upper Extremity):

Muscle Group Week 0 Week 3 Week 6 (Today)
Shoulder flexion 3-/5 4/5 4+/5
Shoulder abduction 3/5 4-/5 4+/5
Elbow flexion 3+/5 4/5 5-/5
Elbow extension 3/5 4-/5 4+/5
Wrist extension 3-/5 4-/5 4/5
Grip strength 8 kg 16 kg 22 kg

Normal expected grip strength for age/gender: 28-32 kg Current percentage of expected: 70% (compared to 25% at baseline)

Functional Performance

Activities of Daily Living Assessment:

  • Dressing: Independent for all garments (was requiring assistance for buttons, overhead items)
  • Grooming: Independent (was requiring assistance for hair care)
  • Meal preparation: Independent for simple meals (was dependent)
  • Computer use: 45 minutes without significant fatigue (was 10-15 minutes)

Timed functional tests:

  • Box and Block Test: 38 blocks/minute (normal range: 60-75, baseline: 12 blocks/minute)
  • Nine Hole Peg Test: 42 seconds (normal: 18-20 seconds, baseline: >120 seconds)
  • Jebsen-Taylor Hand Function Test: 85 seconds (normal: 40-50 seconds, baseline: 210 seconds)

Movement Quality

Observed improvement in:

  • Coordination during reaching activities
  • Smoothness of movement
  • Confidence in arm use
  • Consistency across repeated trials

Key observation: Patient demonstrates "give-way" weakness on manual muscle testing but able to sustain resistance when attention redirected to conversation or cognitive task.

Attention-Dependent Testing

Dual-task performance (arm position holding while serial subtraction):

  • Single task (holding only): arm begins to drift after 8 seconds
  • Dual task (holding + counting backward from 100 by 7s): maintained position for full 30 seconds

This paradoxical improvement with cognitive loading continues to confirm functional etiology.


Assessment

Primary diagnosis: Functional Weakness (right upper extremity), ongoing recovery

Progress summary:

  • Excellent response to Module 4 retraining protocol
  • 70% improvement in objective strength measurements
  • Significant functional gains in ADLs and work-related activities
  • Patient demonstrating good understanding of attention-dependent symptom patterns
  • Appropriate use of movement strategies learned in therapy

Contributing factors to success:

  1. High patient engagement with home program (compliance >85%)
  2. Supportive work environment with phased return accommodations
  3. Recognition and management of symptom triggers (stress, fatigue)
  4. Integration of movement strategies into daily routines
  5. Gradual, progressive challenge as per protocol guidelines

Remaining challenges:

  1. Sustained endurance for full work day
  2. Performance anxiety about symptom recurrence
  3. Fine motor precision (grip strength at 70% of expected)
  4. Need for continued reinforcement of attention redirection strategies

Treatment Progress by Phase

Phase 1: Education and Baseline (Weeks 1-2) - COMPLETED

✓ Patient educated on functional weakness neuroscience ✓ Video baseline established ✓ Symptom diary initiated ✓ Patient demonstrated understanding of reversibility concept

Phase 2: Movement Awareness (Weeks 3-4) - COMPLETED

✓ Attention redirection exercises practiced daily ✓ Dual-task training incorporated (cognitive tasks + arm movements) ✓ Progress video comparison showed clear improvement ✓ Patient identified personal symptom triggers

Phase 3: Progressive Strengthening (Weeks 5-7) - IN PROGRESS

✓ Graded resistance exercises introduced (starting at 1 lb, now at 5 lbs) ✓ Functional task practice (meal prep, work simulation) ✓ Endurance building activities (15 minutes → 30 minutes) ⚬ Continue to progress resistance and duration over next 2 weeks

Phase 4: Functional Integration (Weeks 8-10) - UPCOMING

  • Return to full work schedule
  • Community activity reintegration
  • Sport/recreational activity resumption (patient enjoys tennis)
  • Maintenance program development
  • Relapse prevention strategies

Plan

Immediate Next Steps (Weeks 7-8)

In-clinic sessions (2x weekly, 45 minutes each):

  1. Progress resistance training to 8-10 lbs for upper extremity exercises
  2. Increase sustained activity duration to 45-60 minutes
  3. Introduce work-specific task simulation (computer work, lifting, reaching)
  4. Practice tennis forehand motion (patient goal)
  5. Video progress documentation for patient review

Home program (daily, 30-40 minutes):

  1. Resistance band exercises (5 exercises, 3 sets of 12 reps each)
  2. Functional reach and carry activities (simulating work/home tasks)
  3. Fine motor coordination practice (coin sorting, bead threading)
  4. Dual-task walking while carrying objects
  5. Symptom diary maintenance (focus on endurance patterns)

Progression to Phase 4 (Weeks 8-10)

Criteria to advance:

  • Grip strength ≥80% of expected (currently at 70%)
  • Sustained computer work for 60 minutes without significant fatigue
  • Consistent performance across morning and afternoon sessions
  • Patient confidence rating ≥7/10 for work tasks

Phase 4 focus areas:

  1. Work reintegration: Coordinate with employer for full-time return
  2. Recreational activities: Graded return to tennis (start with ball toss practice)
  3. Community participation: Resume social activities requiring bilateral arm use
  4. Self-management: Patient-led symptom tracking and strategy adjustment

Long-Term Management

Discharge planning (target: Week 10):

  • Transition to maintenance home program (3x weekly)
  • Establish plan for managing symptom fluctuations
  • Provide written resources for ongoing self-management
  • Schedule 1-month post-discharge follow-up check

Relapse prevention strategies:

  • Recognize early warning signs of symptom recurrence
  • Immediate implementation of attention redirection techniques
  • Stress management and sleep hygiene maintenance
  • Contact clinic if symptoms persist >48 hours despite home strategies

Patient Education Today

Discussed with patient:

  1. Progress recognition: Reviewed objective data showing 70% strength improvement and functional gains
  2. Symptom variability: Normalized day-to-day fluctuations as part of recovery process
  3. Attention strategies: Reinforced use of dual-task approaches during difficult movements
  4. Fatigue management: Pacing strategies for sustained activities
  5. Return to work: Realistic timeline and graduated approach to full-time schedule

Patient demonstrated:

  • Clear understanding of concepts discussed
  • Ability to apply attention redirection strategies
  • Appropriate expectations for timeline
  • Motivation to continue treatment program

Coordination of Care

Communication with other providers:

  • Updated primary care physician on functional improvement and work return plan
  • Coordinated with patient's employer regarding phased return schedule
  • Consulted with ReACT program director regarding typical Module 4 outcomes (this patient tracking above average for recovery trajectory)

Integration with other modules:

  • Module 9 (Cognitive Behavioral Strategies): Patient using anxiety management techniques learned in parallel sessions
  • Module 11 (Workplace Reintegration): Beginning coordination for full return to work

Clinical Impression

Patient is demonstrating excellent progress through Module 4 of the ReACT protocol for functional upper extremity weakness. Objective strength measurements show 70% improvement from baseline, and functional performance has improved substantially in both ADL and work-related tasks.

The key to this patient's success has been:

  1. Strong engagement with treatment rationale and home program
  2. Effective use of attention redirection strategies
  3. Supportive work environment enabling graded return
  4. Recognition and management of symptom triggers

Prognosis: Excellent for continued recovery. Based on current trajectory, anticipate patient will achieve:

  • 85-90% of expected strength by Week 10
  • Full work capacity with minimal accommodations
  • Return to recreational activities including tennis
  • Self-management skills for long-term symptom control

Expected discharge from active treatment at Week 10 with transition to self-directed maintenance program. Patient is on track to meet or exceed typical Module 4 outcomes.


Follow-Up

Next appointment: December 15, 2025 (one week)

Focus for next session:

  • Progress resistance exercises
  • Introduce tennis-specific movements
  • Work simulation tasks
  • Review symptom diary patterns

Patient instructions:

  • Continue home program as prescribed
  • Gradually increase activity duration at work
  • Track any new symptoms or concerns in diary
  • Contact clinic with questions or if symptoms worsen

Documentation

Video recordings: Today's session documenting functional activities and strength testing (for Week 6 comparison point)

Outcomes tracked:

  • Manual muscle testing scores
  • Grip strength measurements
  • Timed functional assessments
  • Patient-reported functional scales
  • Work hour progression

Test Validation Keywords: functional weakness, Module 4, ReACT protocol, upper extremity, strength recovery, dual-task, attention redirection, FND, occupational therapy, grip strength, progressive strengthening, work reintegration

Document ID: PROGRESS-FND-WEAKNESS-001 Module Reference: Module 4 Provider: Dr. Lisa Rodriguez, OTR/L, PhD Treatment Week: 6 of 10 Version: 1.0

const { marked } = require('marked');
const fs = require('fs');
const path = require('path');
// Read the markdown file
const mdPath = path.join(__dirname, 'fnd-session-notes.md');
const htmlPath = path.join(__dirname, 'fnd-session-notes.html');
const markdown = fs.readFileSync(mdPath, 'utf8');
// Convert to HTML
const htmlContent = marked.parse(markdown);
// Create a complete HTML document with styling
const fullHtml = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FND Session Notes</title>
<style>
body {
font-family: 'Georgia', serif;
line-height: 1.6;
max-width: 800px;
margin: 40px auto;
padding: 20px;
color: #333;
}
h1 {
color: #1a365d;
border-bottom: 3px solid #2c5282;
padding-bottom: 10px;
}
h2 {
color: #2c5282;
margin-top: 30px;
border-bottom: 2px solid #e2e8f0;
padding-bottom: 5px;
}
h3 {
color: #2d3748;
margin-top: 20px;
}
hr {
border: none;
border-top: 2px solid #cbd5e0;
margin: 30px 0;
}
ul, ol {
margin-left: 20px;
}
strong {
color: #1a202c;
}
code {
background-color: #f7fafc;
padding: 2px 6px;
border-radius: 3px;
font-family: 'Courier New', monospace;
}
</style>
</head>
<body>
${htmlContent}
</body>
</html>`;
// Write HTML file
fs.writeFileSync(htmlPath, fullHtml);
console.log('HTML file created successfully');
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
body {
font-family: 'Georgia', serif;
margin: 40px;
line-height: 1.6;
color: #333;
}
h1 {
color: #1a365d;
border-bottom: 3px solid #2c5282;
padding-bottom: 10px;
font-size: 28px;
}
h2 {
color: #2c5282;
margin-top: 25px;
border-bottom: 2px solid #e2e8f0;
padding-bottom: 5px;
font-size: 22px;
}
h3 {
color: #2d3748;
margin-top: 18px;
font-size: 18px;
}
hr {
border: none;
border-top: 2px solid #cbd5e0;
margin: 25px 0;
}
p {
margin: 10px 0;
}
ul {
margin: 10px 0 10px 25px;
}
li {
margin: 5px 0;
}
strong {
color: #1a202c;
font-weight: 600;
}
</style>
</head>
<body>
<h1>Initial Assessment Session Notes: Functional Gait Disorder</h1><p><strong>FOR TESTING PURPOSES ONLY - FICTITIOUS CLINICAL CONTENT</strong></p><hr><h2>Patient Information</h2><p><strong>Patient ID:</strong> TEST-PATIENT-203
<p><strong>Date of Assessment:</strong> November 12, 2025</p>
<p><strong>Provider:</strong> Dr. Marcus Williams, PT, PhD</p>
<p><strong>Session Type:</strong> Initial Evaluation</p>
<p><strong>Duration:</strong> 75 minutes</p>
<p><strong>Setting:</strong> ReACT Outpatient Clinic</p><hr><h2>Chief Complaint</h2><p>Patient reports difficulty walking for the past 9 months, describing the gait as "jerky and uncoordinated." Reports multiple near-falls but no actual falls. States that walking feels effortful and unpredictable, with variable severity from day to day.</p><h2>History of Present Illness</h2><p>Patient is a 42-year-old administrative assistant who developed gait difficulties approximately 9 months ago. Onset was gradual over 2-3 weeks, with no identifiable precipitating injury. Patient reports the symptoms began during a period of high work stress. Has seen three specialists (neurology, orthopedics, rheumatology) with extensive imaging and testing showing no structural abnormalities.</p><p><strong>Previous interventions:</strong></p>
<ul><li>Standard physical therapy (6 weeks) - minimal improvement</li>
<li>Assistive device trial (walker) - symptoms worsened with device use</li>
<li>Pain management consultation - no significant pain identified</li></p><p><strong>Current functional limitations:</strong>
<li>Requires 30-40 minutes to walk distances that previously took 10 minutes</li>
<li>Avoids shopping due to fear of falling in public</li>
<li>Has reduced work hours from full-time to part-time</li>
<li>Stopped recreational activities (hiking, social dancing)</li></p><h2>Past Medical History</h2><p><li>Hypothyroidism (well-controlled on levothyroxine 75mcg daily)</li>
<li>Anxiety disorder (treated with sertraline 100mg daily)</li>
<li>No history of stroke, seizures, or neurological conditions</li>
<li>No significant trauma history</li></p><h2>Assessment Findings</h2><h3>Gait Analysis</h3><p>Observed gait pattern consistent with functional gait disorder:</p><p><strong>Characteristics noted:</strong>
<li><strong>Buckling</strong>: Intermittent knee buckling without falls, with excessive hip flexion as compensation</li>
<li><strong>Variable base</strong>: Walking base width alternates between narrow and wide, inconsistent pattern</li>
<li><strong>Hesitation</strong>: Prolonged double-support phase, hesitation before weight transfer</li>
<li><strong>Improvement with distraction</strong>: When engaged in conversation about unrelated topics, gait pattern becomes more fluid</li>
<li><strong>Chair test positive</strong>: Slow, effortful standing from chair, but able to perform 5x sit-to-stand quickly when counting aloud</li></p><p><strong>Walking speed:</strong>
<li>Self-selected pace: 0.65 m/s (significantly below normal for age)</li>
<li>Fast pace with verbal cueing: 0.92 m/s (approaching normal range)</li></p><p><strong>Notable observations:</strong>
<li>No consistent motor weakness on manual muscle testing (5/5 all major groups)</li>
<li>Normal range of motion in all joints</li>
<li>Gait pattern changes significantly with attention and cognitive loading</li>
<li>Patient able to demonstrate normal stride when asked to "walk like a soldier" or "march in place"</li></p><h3>Functional Testing</h3><p><strong>Balance assessment:</strong>
<li>Berg Balance Scale: 48/56 (moderate fall risk by score)</li>
<li>However, able to maintain tandem stance for 30 seconds when distracted with conversation</li>
<li>Single-leg stance: 3 seconds (reported), 18 seconds (during cognitive task)</li></p><p><strong>Timed Up and Go:</strong> 24 seconds (abnormal for age)
<p><strong>Timed Up and Go with dual task</strong> (counting backward from 100 by 3s): 18 seconds (paradoxical improvement)</p><p><strong>Functional reach:</strong> 25 cm (normal >30 cm for age), improved to 32 cm when attention redirected</p><h3>Postural Analysis</h3><p><li>No evidence of dystonia or sustained abnormal postures</li></p>
<li>Able to maintain upright posture without assistance</li>
<li>Occasional truncal sway noted, but corrects immediately with verbal cue</li>
<li>No ataxia observed in seated position during upper extremity tasks</li></p><h2>Clinical Impression</h2><p><strong>Primary diagnosis:</strong> Functional Gait Disorder (FND)</p><p><strong>Supporting evidence:</strong>
<p>1. Gait pattern inconsistency and variability</p>
<p>2. Improvement with distraction and cognitive tasks</p>
<p>3. Paradoxical performance (better with dual-task than single-task)</p>
<p>4. Positive chair test</p>
<p>5. Discordance between subjective difficulty and objective capability</p>
<p>6. Extensive negative workup for structural causes</p><p><strong>Functional severity:</strong> Moderate - impacting work and social participation</p><hr><h2>Treatment Plan</h2><h3>ReACT Protocol: Module 7 - Gait and Balance Retraining</h3><p>Patient appropriate for 10-week structured retraining program focusing on:</p><p><strong>Phase 1: Education and Awareness</strong> (Weeks 1-2)</p>
<li>Explain neuroscientific basis of functional gait disorder</li>
<li>Introduce concept of attention-dependent motor control</li>
<li>Establish baseline video recordings for patient self-observation</li>
<li>Daily symptom diary to identify patterns and triggers</li></p><p><strong>Phase 2: Attention Redirection</strong> (Weeks 3-4)
<li>Walking with cognitive dual-tasks (counting, word games, conversation)</li>
<li>Rhythmic cueing exercises (walking to metronome at 90-100 bpm)</li>
<li>Task-specific training without conscious focus on gait mechanics</li>
<li>Target: 15 minutes daily practice</li></p><p><strong>Phase 3: Progressive Challenge</strong> (Weeks 5-7)
<li>Graded walking distances (start at 5 minutes, increase by 2 minutes weekly)</li>
<li>Environmental complexity progression (hallway → outdoors → crowded areas)</li>
<li>Speed variation exercises</li>
<li>Obstacle navigation</li>
<li>Target: 20-25 minutes daily, 5 days per week</li></p><p><strong>Phase 4: Functional Integration</strong> (Weeks 8-10)
<li>Return to valued activities (shopping, workplace navigation, social events)</li>
<li>Strategies for managing setbacks</li>
<li>Relapse prevention planning</li>
<li>Maintenance exercise program</li></p><h3>Specific Interventions</h3><p><strong>Dual-task walking protocols:</strong>
<li>Walking while holding conversation</li>
<li>Walking while performing serial 3s subtraction</li>
<li>Walking while carrying objects</li>
<li>Walking while scanning environment for specific items</li></p><p><strong>Attentional focus strategies:</strong>
<li>External focus cues ("walk toward the door" vs. "move your legs normally")</li>
<li>Rhythm and music-based gait training</li>
<li>Goal-directed walking (functional tasks, not gait mechanics)</li></p><p><strong>Movement variability exercises:</strong>
<li>Walking at varied speeds on command</li>
<li>Walking with eyes closed for short distances (with safety support)</li>
<li>Tandem walking</li>
<li>Backward walking</li>
<li>Side-stepping</li></p><h3>Expected Outcomes</h3><p><strong>Short-term goals</strong> (4 weeks):
<li>Increase walking speed to >0.80 m/s</li>
<li>Reduce Timed Up and Go to <15 seconds</li>
<li>Patient reports 30% improvement in confidence with community ambulation</li></p><p><strong>Long-term goals</strong> (10 weeks):
<li>Walking speed approaching normal for age (>1.0 m/s)</li>
<li>Berg Balance Scale >52/56</li>
<li>Return to full-time work</li>
<li>Resume at least 2 recreational activities</li></p><h3>Coordination with Other Providers</h3><p><li>Communication with primary care provider regarding diagnosis and treatment plan</li>
<li>Liaison with occupational therapy for workplace accommodation recommendations if needed</li>
<li>Psychology referral for anxiety management strategies (Module 9 integration)</li></p><h2>Patient Education Provided</h2><p>Explained to patient:
<p>1. Functional gait disorder is a genuine neurological condition</p>
<p>2. The brain's motor control system has adopted an inefficient pattern</p>
<p>3. The good news: functional symptoms are reversible with specific retraining</p>
<p>4. Focus will be on re-learning efficient movement, not on "trying to walk normally"</p>
<p>5. Variability in symptoms is expected and doesn't indicate setbacks</p><p>Patient expressed:</p>
<li>Initial skepticism about diagnosis</li>
<li>Relief that symptoms are "real" and have a name</li>
<li>Motivated to engage in treatment</li>
<li>Concerns about prognosis and timeline</li></p><p><strong>Patient understanding:</strong> Good. Demonstrated comprehension of key concepts and asked relevant clarifying questions.</p><h2>Treatment Frequency</h2><p><strong>Weeks 1-4:</strong> Twice weekly in-clinic sessions (45 minutes) + daily home program (15-20 minutes)
<p><strong>Weeks 5-10:</strong> Once weekly in-clinic sessions (30-45 minutes) + daily home program (20-30 minutes)</p><p><strong>Reassessment points:</strong> Week 4 and Week 10</p><h2>Prognosis</h2><p>Good for significant functional improvement based on:</p>
<li>Clear functional gait pattern</li>
<li>Demonstrated ability to improve with attention redirection</li>
<li>Patient motivation and insight</li>
<li>No significant comorbid conditions limiting participation</li>
<li>Strong support system (lives with partner who is supportive)</li></p><p>Expected recovery trajectory: 60-70% improvement in functional mobility by 10 weeks, with continued gains through maintenance program.</p><h2>Follow-Up</h2><p>Next appointment scheduled for November 19, 2025 (one week). Patient provided with:
<li>Written home exercise program</li>
<li>Symptom diary template</li>
<li>Educational handout on functional gait disorder</li>
<li>Video recordings of today's assessment for review</li></p><p>Patient instructed to contact clinic if:
<li>Symptoms worsen significantly</li>
<li>New symptoms develop</li>
<li>Questions about home program</li>
<li>Need to reschedule appointment</li></p><hr><p><strong>Assessment Tools Used:</strong>
<li>Berg Balance Scale</li>
<li>Timed Up and Go Test</li>
<li>Gait speed measurement (10-meter walk test)</li>
<li>Functional reach test</li>
<li>Clinical observation with distraction paradigms</li></ul><p><strong>Video Documentation:</strong> Yes, baseline gait patterns recorded for comparison</p><p><strong>Next Session Focus:</strong> Review symptom diary, begin Phase 1 education module, introduce first dual-task walking exercises</p><hr><p><strong>Test Validation Keywords:</strong> functional gait disorder, Module 7, gait retraining, FND, dual-task walking, attention redirection, ReACT protocol, Berg Balance Scale, 10-week program, prognosis</p><p><strong>Document ID:</strong> SESSION-FND-GAIT-001
<p><strong>Module Reference:</strong> Module 7</p>
<p><strong>Provider:</strong> Dr. Marcus Williams, PT, PhD</p>
<p><strong>Version:</strong> 1.0</p>
</body>
</html>

Initial Assessment Session Notes: Functional Gait Disorder

FOR TESTING PURPOSES ONLY - FICTITIOUS CLINICAL CONTENT


Patient Information

Patient ID: TEST-PATIENT-203 Date of Assessment: November 12, 2025 Provider: Dr. Marcus Williams, PT, PhD Session Type: Initial Evaluation Duration: 75 minutes Setting: ReACT Outpatient Clinic


Chief Complaint

Patient reports difficulty walking for the past 9 months, describing the gait as "jerky and uncoordinated." Reports multiple near-falls but no actual falls. States that walking feels effortful and unpredictable, with variable severity from day to day.

History of Present Illness

Patient is a 42-year-old administrative assistant who developed gait difficulties approximately 9 months ago. Onset was gradual over 2-3 weeks, with no identifiable precipitating injury. Patient reports the symptoms began during a period of high work stress. Has seen three specialists (neurology, orthopedics, rheumatology) with extensive imaging and testing showing no structural abnormalities.

Previous interventions:

  • Standard physical therapy (6 weeks) - minimal improvement
  • Assistive device trial (walker) - symptoms worsened with device use
  • Pain management consultation - no significant pain identified

Current functional limitations:

  • Requires 30-40 minutes to walk distances that previously took 10 minutes
  • Avoids shopping due to fear of falling in public
  • Has reduced work hours from full-time to part-time
  • Stopped recreational activities (hiking, social dancing)

Past Medical History

  • Hypothyroidism (well-controlled on levothyroxine 75mcg daily)
  • Anxiety disorder (treated with sertraline 100mg daily)
  • No history of stroke, seizures, or neurological conditions
  • No significant trauma history

Assessment Findings

Gait Analysis

Observed gait pattern consistent with functional gait disorder:

Characteristics noted:

  • Buckling: Intermittent knee buckling without falls, with excessive hip flexion as compensation
  • Variable base: Walking base width alternates between narrow and wide, inconsistent pattern
  • Hesitation: Prolonged double-support phase, hesitation before weight transfer
  • Improvement with distraction: When engaged in conversation about unrelated topics, gait pattern becomes more fluid
  • Chair test positive: Slow, effortful standing from chair, but able to perform 5x sit-to-stand quickly when counting aloud

Walking speed:

  • Self-selected pace: 0.65 m/s (significantly below normal for age)
  • Fast pace with verbal cueing: 0.92 m/s (approaching normal range)

Notable observations:

  • No consistent motor weakness on manual muscle testing (5/5 all major groups)
  • Normal range of motion in all joints
  • Gait pattern changes significantly with attention and cognitive loading
  • Patient able to demonstrate normal stride when asked to "walk like a soldier" or "march in place"

Functional Testing

Balance assessment:

  • Berg Balance Scale: 48/56 (moderate fall risk by score)
  • However, able to maintain tandem stance for 30 seconds when distracted with conversation
  • Single-leg stance: 3 seconds (reported), 18 seconds (during cognitive task)

Timed Up and Go: 24 seconds (abnormal for age) Timed Up and Go with dual task (counting backward from 100 by 3s): 18 seconds (paradoxical improvement)

Functional reach: 25 cm (normal >30 cm for age), improved to 32 cm when attention redirected

Postural Analysis

  • No evidence of dystonia or sustained abnormal postures
  • Able to maintain upright posture without assistance
  • Occasional truncal sway noted, but corrects immediately with verbal cue
  • No ataxia observed in seated position during upper extremity tasks

Clinical Impression

Primary diagnosis: Functional Gait Disorder (FND)

Supporting evidence:

  1. Gait pattern inconsistency and variability
  2. Improvement with distraction and cognitive tasks
  3. Paradoxical performance (better with dual-task than single-task)
  4. Positive chair test
  5. Discordance between subjective difficulty and objective capability
  6. Extensive negative workup for structural causes

Functional severity: Moderate - impacting work and social participation


Treatment Plan

ReACT Protocol: Module 7 - Gait and Balance Retraining

Patient appropriate for 10-week structured retraining program focusing on:

Phase 1: Education and Awareness (Weeks 1-2)

  • Explain neuroscientific basis of functional gait disorder
  • Introduce concept of attention-dependent motor control
  • Establish baseline video recordings for patient self-observation
  • Daily symptom diary to identify patterns and triggers

Phase 2: Attention Redirection (Weeks 3-4)

  • Walking with cognitive dual-tasks (counting, word games, conversation)
  • Rhythmic cueing exercises (walking to metronome at 90-100 bpm)
  • Task-specific training without conscious focus on gait mechanics
  • Target: 15 minutes daily practice

Phase 3: Progressive Challenge (Weeks 5-7)

  • Graded walking distances (start at 5 minutes, increase by 2 minutes weekly)
  • Environmental complexity progression (hallway → outdoors → crowded areas)
  • Speed variation exercises
  • Obstacle navigation
  • Target: 20-25 minutes daily, 5 days per week

Phase 4: Functional Integration (Weeks 8-10)

  • Return to valued activities (shopping, workplace navigation, social events)
  • Strategies for managing setbacks
  • Relapse prevention planning
  • Maintenance exercise program

Specific Interventions

Dual-task walking protocols:

  • Walking while holding conversation
  • Walking while performing serial 3s subtraction
  • Walking while carrying objects
  • Walking while scanning environment for specific items

Attentional focus strategies:

  • External focus cues ("walk toward the door" vs. "move your legs normally")
  • Rhythm and music-based gait training
  • Goal-directed walking (functional tasks, not gait mechanics)

Movement variability exercises:

  • Walking at varied speeds on command
  • Walking with eyes closed for short distances (with safety support)
  • Tandem walking
  • Backward walking
  • Side-stepping

Expected Outcomes

Short-term goals (4 weeks):

  • Increase walking speed to >0.80 m/s
  • Reduce Timed Up and Go to <15 seconds
  • Patient reports 30% improvement in confidence with community ambulation

Long-term goals (10 weeks):

  • Walking speed approaching normal for age (>1.0 m/s)
  • Berg Balance Scale >52/56
  • Return to full-time work
  • Resume at least 2 recreational activities

Coordination with Other Providers

  • Communication with primary care provider regarding diagnosis and treatment plan
  • Liaison with occupational therapy for workplace accommodation recommendations if needed
  • Psychology referral for anxiety management strategies (Module 9 integration)

Patient Education Provided

Explained to patient:

  1. Functional gait disorder is a genuine neurological condition
  2. The brain's motor control system has adopted an inefficient pattern
  3. The good news: functional symptoms are reversible with specific retraining
  4. Focus will be on re-learning efficient movement, not on "trying to walk normally"
  5. Variability in symptoms is expected and doesn't indicate setbacks

Patient expressed:

  • Initial skepticism about diagnosis
  • Relief that symptoms are "real" and have a name
  • Motivated to engage in treatment
  • Concerns about prognosis and timeline

Patient understanding: Good. Demonstrated comprehension of key concepts and asked relevant clarifying questions.

Treatment Frequency

Weeks 1-4: Twice weekly in-clinic sessions (45 minutes) + daily home program (15-20 minutes) Weeks 5-10: Once weekly in-clinic sessions (30-45 minutes) + daily home program (20-30 minutes)

Reassessment points: Week 4 and Week 10

Prognosis

Good for significant functional improvement based on:

  • Clear functional gait pattern
  • Demonstrated ability to improve with attention redirection
  • Patient motivation and insight
  • No significant comorbid conditions limiting participation
  • Strong support system (lives with partner who is supportive)

Expected recovery trajectory: 60-70% improvement in functional mobility by 10 weeks, with continued gains through maintenance program.

Follow-Up

Next appointment scheduled for November 19, 2025 (one week). Patient provided with:

  • Written home exercise program
  • Symptom diary template
  • Educational handout on functional gait disorder
  • Video recordings of today's assessment for review

Patient instructed to contact clinic if:

  • Symptoms worsen significantly
  • New symptoms develop
  • Questions about home program
  • Need to reschedule appointment

Assessment Tools Used:

  • Berg Balance Scale
  • Timed Up and Go Test
  • Gait speed measurement (10-meter walk test)
  • Functional reach test
  • Clinical observation with distraction paradigms

Video Documentation: Yes, baseline gait patterns recorded for comparison

Next Session Focus: Review symptom diary, begin Phase 1 education module, introduce first dual-task walking exercises


Test Validation Keywords: functional gait disorder, Module 7, gait retraining, FND, dual-task walking, attention redirection, ReACT protocol, Berg Balance Scale, 10-week program, prognosis

Document ID: SESSION-FND-GAIT-001 Module Reference: Module 7 Provider: Dr. Marcus Williams, PT, PhD Version: 1.0

ReACT Clinician Training Session: Functional Tremor Assessment

FOR TESTING PURPOSES ONLY - FICTITIOUS TRAINING CONTENT

Date: October 15, 2025 Presenter: Dr. Jennifer Mitchell, PT, DPT Audience: ReACT Clinical Team, Physical Therapists, Occupational Therapists Module Focus: Module 5 - Tremor Assessment and Retraining Session Duration: 90 minutes Location: Virtual Training Session


Session Overview

Good morning, everyone. Today we're going to dive deep into functional tremor assessment and the specific retraining techniques that form the foundation of Module 5 in the ReACT protocol. This is one of the most common presentations we see in functional neurological disorder, and having a systematic approach makes all the difference.

Understanding Functional Tremor

Let me start with the key principle: functional tremor is a type of FND where patients experience involuntary shaking that, while genuine and distressing, can be influenced through specific therapeutic techniques. The tremor feels completely involuntary to the patient, but it responds to attentional mechanisms in ways that structural tremors do not.

The distinguishing features we look for are:

  1. Variability with distraction - The tremor changes or stops when attention is redirected
  2. Entrainability - The tremor can be entrained to match an external rhythm
  3. Suggestibility - The tremor responds to verbal cues and therapeutic suggestion
  4. Fatigability - Unlike essential tremor, functional tremor often decreases with sustained posture

Assessment Protocol

Our assessment follows a structured three-phase approach:

Phase 1: Baseline Observation (5-10 minutes)

Observe the tremor in multiple positions:

  • Resting position: Arms relaxed on lap
  • Postural position: Arms extended forward, parallel to ground
  • Action position: Finger-to-nose movements, writing, pouring water

Document the tremor frequency, amplitude, and body distribution. The typical functional tremor frequency ranges from 4-8 Hz, but this can vary significantly.

Phase 2: Distraction Testing (10-15 minutes)

This is where we see the diagnostic signature. While maintaining the tremor-affected limb in a sustained position, engage the patient in a cognitive task:

  • Serial 7s subtraction from 100
  • Spelling words backward (5-7 letters)
  • Tapping rhythms with the unaffected hand

Key observation: With functional tremor, you'll typically see one of three responses:

  1. Tremor decreases or stops (most common)
  2. Tremor changes frequency or pattern
  3. Patient has difficulty performing the cognitive task (suggesting attentional competition)

Phase 3: Entrainment Testing (5-10 minutes)

Ask the patient to tap their unaffected hand at a specific rhythm - start with 2 Hz (120 beats per minute). Observe whether the tremor in the affected limb:

  • Matches the tapping frequency
  • Stops entirely as attention shifts
  • Becomes irregular or inconsistent

If the tremor entrains to match the tapping rhythm, this is strongly suggestive of functional tremor.

Retraining Techniques

Once we've established the functional nature of the tremor, we move to retraining. The ReACT protocol emphasizes a graduated approach:

Week 1-2: Education and Awareness

Start with education about the neurological basis of functional symptoms. Patients need to understand:

  • Their symptoms are real and not "in their head"
  • The brain-body communication system is reversible
  • Small improvements demonstrate the brain's capacity for change

Homework assignment: Track tremor patterns 3 times daily, noting triggers and contexts where it improves.

Week 3-4: Distraction and Redirection

Teach patients the same distraction techniques we used in assessment:

  • Mental math while maintaining arm position (3-5 minutes, twice daily)
  • Cognitive games on smartphone with affected hand visible
  • Dual-task activities (conversation while pouring water)

Goal: Help patients recognize their capacity to influence the tremor, even briefly.

Week 5-6: Progressive Motor Retraining

Now we layer in coordinated movements:

  1. Controlled reach activities: 10 repetitions, 3 sets daily

    • Start with large, slow movements
    • Progress to smaller, faster movements
    • Incorporate functional tasks (reaching for cup, opening door)
  2. Weight-bearing exercises: 15-20 minutes daily

    • Plank position (modified as needed)
    • Wall push-ups
    • Quadruped position with weight shifts
  3. Fine motor tasks: 10 minutes, twice daily

    • Coin stacking
    • Bead threading
    • Writing practice with tremor-focused attention redirection

Week 7-8: Functional Integration

The final phase focuses on real-world application:

  • Meal preparation tasks
  • Dressing and grooming activities
  • Workplace or school-specific movements
  • Social situations that previously triggered tremor

Success criteria: 50% reduction in tremor severity (measured by subjective rating scale) and improved functional independence in at least 2 daily activities.

Common Challenges and Solutions

Challenge 1: Patient resistance to diagnosis

Some patients feel dismissed when told their tremor is functional. Our response:

  • Validate the symptom reality: "Your tremor is absolutely real"
  • Reframe as brain-based: "This is how your nervous system has learned to respond"
  • Emphasize reversibility: "The good news is that functional symptoms respond to retraining"

Challenge 2: Inconsistent home practice

When patients struggle with daily exercises:

  • Reduce frequency but maintain consistency (once daily vs. twice daily)
  • Link exercises to existing routines (morning coffee, evening TV)
  • Use habit-stacking strategies
  • Provide video demonstrations for reference

Challenge 3: Symptom variability causing discouragement

Tremor severity will fluctuate day to day:

  • Normalize the variability as part of the recovery process
  • Focus on overall trend rather than daily changes
  • Celebrate small wins and moments of control
  • Keep a symptom journal to track patterns

Integration with Other Modules

Module 5 doesn't exist in isolation. We coordinate with:

  • Module 3: Core motor retraining principles provide the theoretical foundation
  • Module 7: Gait and balance retraining for patients with lower limb tremor
  • Module 9: Cognitive behavioral strategies for anxiety-related tremor exacerbation
  • Module 12: Graded return to activities for functional restoration

Patient Case Example

Let me share a deidentified case that illustrates these principles:

Patient: 34-year-old teacher, TEST-PATIENT-156 Presentation: Right hand tremor for 6 months, significantly impacting writing and computer work Assessment findings: 6 Hz tremor, completely entrained to tapping rhythm, stopped during serial 7s task Treatment course: 8-week Module 5 protocol Outcome: 70% subjective improvement, return to full-time teaching with accommodations only in high-stress situations

The key turning point came in Week 4 when the patient first experienced tremor cessation during a distraction task and realized their brain could still control the movement. That moment of recognition changed everything.

Documentation Requirements

For each patient working through Module 5, document:

  1. Baseline measures (Week 0):

    • Video recording of tremor in 3 positions
    • Tremor rating scale (0-10 severity)
    • Functional impact assessment (ADL limitations)
  2. Mid-treatment check (Week 4):

    • Tremor rating scale reassessment
    • Patient-reported confidence in tremor control (0-10)
    • Review of home practice adherence
  3. End-of-treatment (Week 8):

    • Complete reassessment with video
    • Functional outcomes (ADL restoration)
    • Plan for maintenance and relapse prevention

Questions and Discussion

That covers the core content for Module 5. Before we wrap up, I want to address some common questions:

Q: What if the tremor doesn't respond to distraction? A: Not all functional tremors show complete cessation with distraction. Look for any change - amplitude reduction, frequency shift, or irregularity all suggest functional origin.

Q: How do we differentiate from essential tremor? A: Essential tremor is consistent, worsens with sustained posture, doesn't entrain, and has a characteristic frequency (usually 8-12 Hz in hands). Family history and alcohol responsiveness are also distinguishing features.

Q: Can patients have both functional and organic tremor? A: Yes, this is possible but uncommon. When suspected, collaborate with neurology for comprehensive evaluation.

Key Takeaways

Let me summarize the five critical points:

  1. Functional tremor responds to attention and demonstrates entrainment
  2. Assessment uses structured distraction and rhythm-matching tasks
  3. Retraining follows a graduated 8-week protocol
  4. Patient education about brain-body reversibility is essential
  5. Integration with other ReACT modules enhances outcomes

Resources for Reference

  • Module 5 detailed protocol manual (available in clinician portal)
  • Video demonstration library for patient education
  • Assessment templates and documentation forms
  • Tremor rating scales and outcome measures

Thank you all for your attention and engagement. Please reach out with questions as you start implementing these techniques with your patients.


Test Validation Keywords: functional tremor, entrainment, distraction testing, Module 5, ReACT protocol, motor retraining, FND, assessment phases, 8-week protocol, tremor frequency

Document ID: TRAIN-FND-TREMOR-001 Module Reference: Module 5 Version: 1.0

PHI Redaction Preview: Dry-Run Protocol

This document describes the dry-run redaction preview feature on the /api/faq-ingest endpoint. Clients use this to preview PHI (Protected Health Information) redactions before content is committed to MongoDB and Azure AI Search.


Table of Contents

  1. Overview
  2. Protocol Interface
  3. Response Schema
  4. Expected Flow
  5. Type Reference
  6. Examples
  7. Error Handling
  8. Design Decisions

Overview

Admin uploaders need to inspect how PHI redaction will transform their documents before committing them to the search index. The dry-run feature adds a ?dryRun=true query parameter to the existing ingest endpoint. When set, the pipeline runs extraction and chunking as normal, performs a two-pass PHI entity scan, and returns full before/after text per chunk — but skips embedding generation, MongoDB writes, and Azure AI Search indexing.

Key Characteristics

  • Stateless: No data is persisted during a dry run. The same content can be re-uploaded repeatedly.
  • Same endpoint: POST /api/faq-ingest?dryRun=true — no new routes required.
  • Same authentication: Requires admin JWT, same as normal ingest.
  • Same request format: File uploads and text uploads are both supported.
  • Two-pass redaction: Pass 1 discovers PHI entities across the full document using an LLM; Pass 2 applies deterministic find-and-replace per chunk.

Protocol Interface

Request

Endpoint: POST /api/faq-ingest?dryRun=true

Authentication: Authorization: Bearer <admin-jwt>

Content-Type: multipart/form-data

File Upload

Field Type Required Description
file File Yes PDF, DOCX, or TXT file (max 25 MB)
metadata JSON string No { "title": string, "isPublic": boolean, "moduleId?": string }

Text Upload

Field Type Required Description
content string Yes Raw text content to scan
metadata JSON string No { "id?": string, "title?": string, "isPublic?": boolean, "moduleId?": string }

Query Parameters

Parameter Type Default Description
dryRun "true" When "true", returns redaction preview without indexing

Response Schema

Dry-Run Response (200 OK)

Both file and text uploads return the same top-level shape when dryRun=true:

{
  message: string;              // "Redaction preview generated (dry run - not indexed)"
  documentId: string;           // UUID — source document ID (not persisted)
  filename?: string;            // Original filename (file uploads only)
  chunksCreated?: number;       // Number of chunks (file uploads only)
  totalTokens?: number;         // Total token count (file uploads only)
  processingTimeMs?: number;    // End-to-end processing time in ms (file uploads only)
  preview: RedactionPreviewResponse;
}

RedactionPreviewResponse

The preview object contains the full redaction analysis:

interface RedactionPreviewResponse {
  sourceId: string;              // Same as documentId above
  filename: string;              // Original filename or "text-upload"
  entityScan: EntityScanResult;  // Pass 1 results: discovered PHI entities
  chunks: RedactedChunkPreview[]; // Pass 2 results: per-chunk before/after
  stats: {
    chunkCount: number;              // Total chunks in document
    totalTokens: number;             // Total tokens across all chunks
    totalEntitiesDiscovered: number;  // Unique PHI entities found in Pass 1
    totalRedactionsApplied: number;   // Total replacements made across all chunks
    processingTimeMs: number;         // Full pipeline processing time (ms)
  };
}

EntityScanResult

Global entity discovery from Pass 1 (LLM scan):

interface EntityScanResult {
  entities: PHIEntity[];          // All unique PHI entities found
  confidence_score: number;       // 0-100 overall confidence
  confidence_level: ConfidenceLevel;
  human_review_required: boolean; // Whether manual review is recommended
  human_review_reason: string | null;
  processing_notes: string;       // LLM notes about the content
}

PHIEntity

A single PHI entity discovered by the LLM:

interface PHIEntity {
  original: string;           // The original PHI text (e.g., "Sarah Martinez")
  identifier_type: string;    // HIPAA category (e.g., "Name", "Date", "MRN")
  placeholder: string;        // Replacement token (e.g., "[PATIENT_NAME]")
}

RedactedChunkPreview

Per-chunk before/after comparison from Pass 2 (deterministic replacement):

interface RedactedChunkPreview {
  chunkIndex: number;           // 0-based position in document
  originalContent: string;      // Full chunk text before redaction
  redactedContent: string;      // Full chunk text after redaction
  tokenCount: number;           // Token count of original chunk
  redactionsApplied: number;    // Number of replacements in this chunk
  percentageRedacted: number;   // Approximate % of content redacted (by character count)
  sectionHeading: string | null; // Section heading if extracted from document structure
}

ConfidenceLevel

type ConfidenceLevel =
  | "DEFINITE_PHI"        // Definite PHI identified — must redact
  | "HIGHLY_LIKELY_PHI"   // Very likely PHI — should redact
  | "PROBABLE_PHI"        // Probable PHI — review recommended
  | "AMBIGUOUS"           // Unclear — human review required
  | "SAFE_EDUCATIONAL"    // No PHI detected — safe educational content

Expected Flow

Client Workflow

┌─────────────────────────────────────────────────────────────────────────┐
│                     ADMIN REDACTION PREVIEW FLOW                        │
└─────────────────────────────────────────────────────────────────────────┘

  Step 1: Preview          Step 2: Review            Step 3: Commit
       │                        │                         │
       ▼                        ▼                         ▼
┌──────────────┐       ┌──────────────────┐       ┌──────────────────┐
│ POST         │       │ Admin reviews    │       │ POST             │
│ /faq-ingest  │──────▶│ before/after     │──────▶│ /faq-ingest      │
│ ?dryRun=true │       │ per chunk        │       │ (no dryRun)      │
│              │       │                  │       │                  │
│ Returns      │       │ Checks:          │       │ Indexes to       │
│ preview      │       │ • Over-redaction │       │ MongoDB +        │
│ response     │       │ • Under-redaction│       │ Azure Search     │
└──────────────┘       │ • Confidence     │       └──────────────────┘
                       └────────┬─────────┘
                                │
                         If errors found:
                                │
                                ▼
                       ┌──────────────────┐
                       │ Admin fixes      │
                       │ source document  │
                       │ and re-uploads   │
                       │ with ?dryRun=true│
                       └──────────────────┘

Step-by-Step

  1. Admin uploads with ?dryRun=true

    • Same multipart form as normal ingest
    • Append ?dryRun=true to the URL
    • File is extracted, chunked, and scanned for PHI — but not indexed
  2. Client receives preview response

    • preview.entityScan.entities — list of all PHI found across the document
    • preview.chunks[] — per-chunk before/after comparison
    • preview.stats — aggregate counts and timing
  3. Client renders review UI

    • Display each chunk's originalContent alongside redactedContent
    • Highlight differences (entities replaced)
    • Show confidence_level and human_review_required prominently
    • Show per-chunk percentageRedacted for quick triage
  4. Admin makes a decision

    • Approve: Re-upload the same file/content without ?dryRun=true to commit
    • Reject: Edit the source document to fix issues, then re-upload with ?dryRun=true again
    • Override: Not supported — corrections must be made in the source document
  5. Normal ingest proceeds

    • Same POST /api/faq-ingest without the ?dryRun flag
    • Full pipeline: extract → chunk → embed → store in MongoDB → index to Azure Search
    • Response does not include preview field

Text Upload Differences

For text content (no file), the dry-run path:

  • Does not use the two-pass chunking-based approach
  • Sends the full text directly to the LLM in a single call
  • Returns a single chunk in preview.chunks[] with chunkIndex: 0
  • preview.filename is set to "text-upload"

Type Reference

Source file: libs/phi-redaction/types.ts

All preview types are exported from libs/phi-redaction/types and re-exported through the IngestResponse type in libs/chat/types/index.ts:

export interface IngestResponse {
  message: string;
  documentId: string;
  filename?: string;
  chunksCreated?: number;
  totalTokens?: number;
  processingTimeMs?: number;
  indexes?: { index: string; status: string; documentsIndexed?: number }[];
  /** Present when dryRun=true — redaction preview without indexing */
  preview?: RedactionPreviewResponse;
}

Key files

File Purpose
libs/phi-redaction/types.ts All preview type definitions
libs/phi-redaction/redactionService.ts Two-pass redaction logic
libs/ingest/fileProcessor.ts File processing with dry-run branch
faq-ingest/index.ts Endpoint handler with dry-run routing

Examples

File Upload — Dry Run

Request:

curl -X POST "https://react-api.azurewebsites.net/api/faq-ingest?dryRun=true" \
  -H "Authorization: Bearer <ADMIN_JWT>" \
  -F "file=@patient-intake-guide.pdf" \
  -F 'metadata={"title":"Patient Intake Guide","isPublic":false}'

Response (200):

{
  "message": "Redaction preview generated (dry run - not indexed)",
  "documentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "filename": "patient-intake-guide.pdf",
  "chunksCreated": 3,
  "totalTokens": 1850,
  "processingTimeMs": 2340,
  "preview": {
    "sourceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "filename": "patient-intake-guide.pdf",
    "entityScan": {
      "entities": [
        {
          "original": "Sarah Martinez",
          "identifier_type": "Name",
          "placeholder": "[PATIENT_NAME]"
        },
        {
          "original": "03/15/1985",
          "identifier_type": "Date",
          "placeholder": "[DATE_OF_BIRTH]"
        },
        {
          "original": "MRN-2024-0847",
          "identifier_type": "MRN",
          "placeholder": "[MEDICAL_RECORD_NUMBER]"
        }
      ],
      "confidence_score": 92,
      "confidence_level": "HIGHLY_LIKELY_PHI",
      "human_review_required": true,
      "human_review_reason": "Multiple HIPAA identifiers detected including patient name and MRN",
      "processing_notes": "Document contains patient-specific intake information mixed with educational content about FND assessment."
    },
    "chunks": [
      {
        "chunkIndex": 0,
        "originalContent": "Patient Intake Assessment\n\nPatient: Sarah Martinez\nDOB: 03/15/1985\nMRN: MRN-2024-0847\n\nPresenting symptoms include functional gait disorder...",
        "redactedContent": "Patient Intake Assessment\n\nPatient: [PATIENT_NAME]\nDOB: [DATE_OF_BIRTH]\nMRN: [MEDICAL_RECORD_NUMBER]\n\nPresenting symptoms include functional gait disorder...",
        "tokenCount": 580,
        "redactionsApplied": 3,
        "percentageRedacted": 8.2,
        "sectionHeading": "Patient Intake Assessment"
      },
      {
        "chunkIndex": 1,
        "originalContent": "FND Assessment Protocol\n\nThe following standardized assessment tools are used for all patients presenting with functional neurological symptoms...",
        "redactedContent": "FND Assessment Protocol\n\nThe following standardized assessment tools are used for all patients presenting with functional neurological symptoms...",
        "tokenCount": 620,
        "redactionsApplied": 0,
        "percentageRedacted": 0,
        "sectionHeading": "FND Assessment Protocol"
      },
      {
        "chunkIndex": 2,
        "originalContent": "Treatment notes for Sarah Martinez indicate improvement in gait patterns after 4 sessions...",
        "redactedContent": "Treatment notes for [PATIENT_NAME] indicate improvement in gait patterns after 4 sessions...",
        "tokenCount": 650,
        "redactionsApplied": 1,
        "percentageRedacted": 2.1,
        "sectionHeading": "Treatment Notes"
      }
    ],
    "stats": {
      "chunkCount": 3,
      "totalTokens": 1850,
      "totalEntitiesDiscovered": 3,
      "totalRedactionsApplied": 4,
      "processingTimeMs": 2340
    }
  }
}

Text Upload — Dry Run

Request:

curl -X POST "https://react-api.azurewebsites.net/api/faq-ingest?dryRun=true" \
  -H "Authorization: Bearer <ADMIN_JWT>" \
  -H "Content-Type: multipart/form-data" \
  -F "content=Dr. Emily Chen treated patient John Doe (DOB: 01/22/1990) for functional tremor at Memorial Hospital on 12/05/2024." \
  -F 'metadata={"title":"Treatment Note","isPublic":false}'

Response (200):

{
  "message": "Redaction preview generated (dry run - not indexed)",
  "documentId": "f7e6d5c4-b3a2-1098-fedc-ba9876543210",
  "preview": {
    "sourceId": "f7e6d5c4-b3a2-1098-fedc-ba9876543210",
    "filename": "text-upload",
    "entityScan": {
      "entities": [
        {
          "original": "Dr. Emily Chen",
          "identifier_type": "Name",
          "placeholder": "[PROVIDER_NAME]"
        },
        {
          "original": "John Doe",
          "identifier_type": "Name",
          "placeholder": "[PATIENT_NAME]"
        },
        {
          "original": "01/22/1990",
          "identifier_type": "Date",
          "placeholder": "[DATE_OF_BIRTH]"
        },
        {
          "original": "Memorial Hospital",
          "identifier_type": "Facility",
          "placeholder": "[FACILITY_NAME]"
        },
        {
          "original": "12/05/2024",
          "identifier_type": "Date",
          "placeholder": "[DATE]"
        }
      ],
      "confidence_score": 95,
      "confidence_level": "DEFINITE_PHI",
      "human_review_required": true,
      "human_review_reason": "Patient name, provider name, dates, and facility name detected",
      "processing_notes": "Clinical treatment note with multiple HIPAA identifiers."
    },
    "chunks": [
      {
        "chunkIndex": 0,
        "originalContent": "Dr. Emily Chen treated patient John Doe (DOB: 01/22/1990) for functional tremor at Memorial Hospital on 12/05/2024.",
        "redactedContent": "[PROVIDER_NAME] treated patient [PATIENT_NAME] (DOB: [DATE_OF_BIRTH]) for functional tremor at [FACILITY_NAME] on [DATE].",
        "tokenCount": 32,
        "redactionsApplied": 5,
        "percentageRedacted": 42.5,
        "sectionHeading": null
      }
    ],
    "stats": {
      "chunkCount": 1,
      "totalTokens": 32,
      "totalEntitiesDiscovered": 5,
      "totalRedactionsApplied": 5,
      "processingTimeMs": 890
    }
  }
}

No PHI Detected (Safe Content)

{
  "message": "Redaction preview generated (dry run - not indexed)",
  "documentId": "...",
  "filename": "fnd-overview.pdf",
  "chunksCreated": 2,
  "totalTokens": 980,
  "processingTimeMs": 1100,
  "preview": {
    "sourceId": "...",
    "filename": "fnd-overview.pdf",
    "entityScan": {
      "entities": [],
      "confidence_score": 15,
      "confidence_level": "SAFE_EDUCATIONAL",
      "human_review_required": false,
      "human_review_reason": null,
      "processing_notes": "Content is educational material about FND with no patient-specific information."
    },
    "chunks": [
      {
        "chunkIndex": 0,
        "originalContent": "Functional Neurological Disorder (FND) is characterized by...",
        "redactedContent": "Functional Neurological Disorder (FND) is characterized by...",
        "tokenCount": 490,
        "redactionsApplied": 0,
        "percentageRedacted": 0,
        "sectionHeading": "Overview"
      },
      {
        "chunkIndex": 1,
        "originalContent": "Treatment approaches for FND include physical therapy...",
        "redactedContent": "Treatment approaches for FND include physical therapy...",
        "tokenCount": 490,
        "redactionsApplied": 0,
        "percentageRedacted": 0,
        "sectionHeading": "Treatment"
      }
    ],
    "stats": {
      "chunkCount": 2,
      "totalTokens": 980,
      "totalEntitiesDiscovered": 0,
      "totalRedactionsApplied": 0,
      "processingTimeMs": 1100
    }
  }
}

Error Handling

Dry-run requests share the same error responses as normal ingest:

Status Condition Body
400 Missing content (text upload) { "message": "Content required" }
400 File too large (>25 MB) { "message": "File size exceeds maximum..." }
400 Unsupported MIME type { "message": "Unsupported file type..." }
400 Extraction or chunking failure { "message": "<error detail>" }
401 Missing or invalid JWT { "message": "Unauthorized" }
403 Non-admin user { "message": "Forbidden" }
500 LLM not available (Foundry Local down) { "message": "File processing failed", "errorId": "...", "detail": "connect ECONNREFUSED..." }
500 LLM returns malformed response { "message": "File processing failed", "errorId": "...", "detail": "..." }

Notes on 500 Errors

  • errorId references a ChunkingFailure record in MongoDB for debugging
  • The LLM (Foundry Local) must be running for dry-run requests to work
  • If the LLM is unreachable, the error propagates immediately — there is no fallback

Design Decisions

Why Two-Pass?

The chunking pipeline splits documents into ~500-token chunks. A naive approach (scan each chunk independently) misses PHI that spans chunk boundaries or appears in full only in document context. The two-pass design solves this:

  • Pass 1 (LLM): Scans the full extracted text to discover all PHI entities globally
  • Pass 2 (Deterministic): Applies String.split().join() replacement per chunk using the global entity list

Why Stateless?

The preview is not persisted. If an admin wants to fix over-redaction or under-redaction, they edit the source document and re-upload with ?dryRun=true. This avoids:

  • Complex state management for pending reviews
  • Manual override logic and approval workflows
  • Stale preview data diverging from actual content

Why Longest-First Replacement?

Entities are sorted by original.length descending before replacement. This prevents "Smith" from replacing part of "Dr. Smith" — the longer match is applied first, consuming the full text.

Large Document Handling

Documents exceeding ~3500 tokens are split into overlapping sections (500-token overlap) for Pass 1. Entity lists from each section are merged and deduplicated. The highest confidence score and worst confidence level across sections are used in the aggregate result.


Related Documentation: FAQ Ingest Pipeline

Source Files:

Last Updated: 2026-02-10

RAG Test Document Suite - FND Treatment Focus

This document describes the test documents created for testing the RAG (Retrieval-Augmented Generation) system in the ReACT application's FAQ chat assistant.

Overview

Three realistic FND (Functional Neurological Disorder) treatment documents have been created in multiple formats to enable comprehensive testing of document retrieval, parsing, and question-answering capabilities. All documents are aligned with the ReACT protocol's focus on FND treatment techniques and therapeutic approaches for healthcare providers.

Test Documents

1. Training Transcript: Functional Tremor Assessment (Markdown)

File: test-data/fnd-training-transcript.md (8.8K)

Content Summary:

  • Document Type: ReACT clinician training session transcript
  • Topic: Functional Tremor Assessment and Retraining (Module 5)
  • Presenter: Dr. Jennifer Mitchell, PT, DPT
  • Audience: ReACT Clinical Team, Physical Therapists, Occupational Therapists
  • Key Topics:
    • Assessment protocol (3-phase approach)
    • Distraction testing techniques
    • Entrainment testing procedures
    • 8-week retraining protocol
    • Progressive motor retraining phases

Key Data Points:

  • Tremor frequency: 4-8 Hz (typical functional tremor)
  • Assessment phases: Baseline (5-10 min), Distraction (10-15 min), Entrainment (5-10 min)
  • Treatment duration: 8-week graduated protocol
  • Success criteria: 50% reduction in tremor severity
  • Module integration: Modules 3, 7, 9, 12

Test Queries:

  • "What is the ReACT protocol for functional tremor?"
  • "How do you assess functional tremor?"
  • "What is entrainment testing?"
  • "What is the treatment timeline for functional tremor in Module 5?"
  • "How does distraction testing work for tremor?"

2. Session Notes: Functional Gait Disorder (Markdown + PDF)

Files:

  • test-data/fnd-session-notes.md (8.2K)
  • test-data/fnd-session-notes.pdf (187K)

Content Summary:

  • Document Type: Initial assessment session notes
  • Condition: Functional Gait Disorder (FND)
  • Provider: Dr. Marcus Williams, PT, PhD
  • Patient: TEST-PATIENT-203
  • Key Assessment Findings:
    • Walking speed: 0.65 m/s (self-selected), 0.92 m/s (with cueing)
    • Berg Balance Scale: 48/56
    • Timed Up and Go: 24 seconds (normal), 18 seconds (with dual-task)
    • Gait pattern: Variable, improves with distraction
  • Treatment Protocol: Module 7 - Gait and Balance Retraining (10 weeks)

Key Data Points:

  • Symptom duration: 9 months
  • Assessment duration: 75 minutes
  • Treatment phases: Education (weeks 1-2), Attention redirection (3-4), Progressive challenge (5-7), Functional integration (8-10)
  • Walking practice: 15 minutes daily (progressing to 20-25 minutes)
  • Expected improvement: 60-70% functional mobility by 10 weeks
  • Reassessment points: Week 4 and Week 10

Test Queries:

  • "What is the ReACT approach for functional gait disorder?"
  • "How long is the gait retraining program?"
  • "What assessment tools are used for functional gait?"
  • "What are dual-task walking exercises?"
  • "What is the prognosis for functional gait disorder?"

3. Progress Note: Functional Weakness (Markdown + DOCX)

Files:

  • test-data/fnd-progress-note.md (9.5K)
  • test-data/fnd-progress-note.docx (17K)

Content Summary:

  • Document Type: Week 6 follow-up consultation progress note
  • Condition: Functional Upper Extremity Weakness (FND)
  • Provider: Dr. Lisa Rodriguez, OTR/L, PhD
  • Patient: TEST-PATIENT-167
  • Treatment Module: Module 4 - Upper Extremity Weakness Retraining
  • Current Status: Week 6 of 10-week protocol, Phase 3

Key Data Points:

  • Grip strength: Improved from 8 kg to 22 kg (70% of expected)
  • Manual muscle testing: Improvements across all muscle groups (3-/5 to 4+/5 range)
  • Box and Block Test: 38 blocks/minute (baseline: 12, normal: 60-75)
  • Treatment phases: 4 phases over 10 weeks
  • Home program: 30-40 minutes daily
  • Clinic sessions: 2x weekly, 45 minutes each
  • Expected discharge: Week 10 with self-directed maintenance program
  • Prognosis: Excellent, 85-90% expected strength by Week 10

Test Queries:

  • "What is Module 4 of the ReACT protocol?"
  • "How is functional weakness treated?"
  • "What are typical outcomes for functional weakness treatment?"
  • "How long does upper extremity weakness retraining take?"
  • "What is the home program for functional weakness?"
  • "What assessment tools measure functional weakness improvement?"

Testing Capabilities

This document suite enables testing of:

Format Support

  • Markdown: Plain text with formatting for all three documents
  • PDF: Binary document format with embedded text (Session Notes)
  • DOCX: Microsoft Word format with structured content (Progress Note)

Document Types Aligned with ReACT Protocol

  • Training transcripts: Clinician education content (Module-referenced)
  • Session notes: Clinical assessment documentation
  • Progress notes: Follow-up treatment documentation

Content Scope Aligned with Prompt

  • FND focus: All documents center on functional neurological disorder
  • Treatment techniques: Specific therapeutic approaches described
  • Module-based structure: References to ReACT Modules 4, 5, 7, 9, 11, 12
  • Healthcare provider audience: Content designed for therapists and clinicians
  • Educational tone: Explanations of rationale and clinical reasoning

Query Types

  • Treatment protocols: Module-specific approaches and timelines
  • Assessment techniques: Specific evaluation methods (distraction testing, entrainment, dual-task)
  • Outcome expectations: Prognosis, success criteria, recovery timelines
  • Clinical measurements: Strength scores, functional assessments, objective data
  • Module integration: How different ReACT modules coordinate
  • Phase-based progression: Week-by-week treatment phases

Confidence Tiers (Aligned with Prompt)

Documents designed to test the three confidence tiers:

Tier 1 (High Confidence 85-100%):

  • Direct questions about module content: "What is Module 5?"
  • Specific protocols: "How long is the gait retraining program?"
  • Clear data points: "What is the expected grip strength improvement?"

Tier 2 (Medium Confidence 60-84%):

  • Synthesis across documents: "How do FND treatment approaches differ by symptom type?"
  • Questions requiring clinical interpretation
  • Protocol adaptations for specific situations

Tier 3 (Low Confidence <60%):

  • Topics not covered in documents (to test "I don't have information" responses)
  • Emergency scenarios (should trigger emergency redirect)
  • Patient-specific treatment decisions (should defer to clinical judgment)

Citation Testing

  • Module-specific citations: "Module 4: Upper Extremity Weakness Retraining"
  • Training session citations: "Clinician Training Session: Functional Tremor Assessment"
  • Multiple source synthesis: Questions requiring information from 2+ documents

Document Structure

Each test document includes:

  1. Clear testing disclaimer: "FOR TESTING PURPOSES ONLY - FICTITIOUS CLINICAL CONTENT"
  2. Structured metadata: Date, provider, patient ID, document type
  3. Module references: Explicit ReACT Module numbers and titles
  4. Clinical sections: Standard medical documentation format
  5. Specific data points: Numerical values for precise retrieval
  6. Test validation keywords: Listed at document end

Realistic vs. Fictional Elements

Realistic Elements

  • FND condition: Real neurological disorder
  • Treatment approaches: Based on actual FND rehabilitation principles
  • Assessment tools: Real clinical instruments (Berg Balance Scale, manual muscle testing, etc.)
  • Module structure: Reflects typical therapy program organization
  • Clinical documentation format: Standard medical note structure

Fictional Elements

  • Patient IDs: TEST-PATIENT-XXX format for clear testing indication
  • Specific practitioners: Named providers are fictional
  • Exact protocols: Specific week-by-week timelines are illustrative
  • ReACT module details: Module numbers and content represent typical programs but aren't from real ReACT system

Usage Guidelines

For RAG System Testing

  1. Ingest all documents into the FAQ knowledge base
  2. Test retrieval accuracy using provided test queries
  3. Verify confidence tiers - system should correctly assess query confidence
  4. Validate citations - responses should cite appropriate modules/sources
  5. Test cross-format retrieval - same query should work across MD, PDF, DOCX versions

Query Testing Strategy

High Confidence Expected:

- "What is the assessment protocol for functional tremor?"
- "How long is Module 7 for gait retraining?"
- "What grip strength improvement is expected in Module 4?"

Medium Confidence Expected:

- "How do you decide between Module 4 and Module 5?"
- "What if a patient has both tremor and weakness?"
- "When should dual-task exercises be introduced?"

Low Confidence Expected (Should acknowledge limitations):

- "What about functional vision loss?" (not in documents)
- "How do I treat this specific patient?" (out of scope)
- "Patient is having a seizure, what do I do?" (emergency - should redirect)

Citation Verification

Responses should include footer citations like:

Sources:
• Module 5: Tremor Assessment and Retraining
• Module 4: Upper Extremity Weakness Retraining
• Clinician Training Session: Functional Tremor Assessment

Integration with ReACT FAQ Chat Prompt

These documents are specifically designed to work with the system prompt located at test-data/prompt.md, which defines:

  • Role: ReACT FAQ Assistant for healthcare providers
  • Knowledge scope: FND treatment techniques and ReACT modules
  • Confidence tiers: Three-tier response system
  • Citation requirements: Module-based source attribution
  • Safety guardrails: Emergency detection, clinical judgment deference

Prompt Alignment Checklist

✅ Documents focus on FND (functional neurological disorder) ✅ Content appropriate for healthcare provider audience ✅ Module-based structure with clear references ✅ Treatment protocols with rationale explained ✅ Educational tone with clinical terminology ✅ Clear citations to modules and training content ✅ No emergency medical scenarios in content ✅ Defers to clinical judgment appropriately ✅ Contains specific, retrievable data points ✅ Testing markers for validation


File Locations

All test documents are located in:

test-data/
├── fnd-training-transcript.md       # Training session on tremor assessment
├── fnd-session-notes.md            # Initial gait disorder assessment
├── fnd-session-notes.pdf           # PDF version of session notes
├── fnd-progress-note.md            # Week 6 weakness treatment progress
└── fnd-progress-note.docx          # DOCX version of progress note

Supporting files:

test-data/
├── create-fnd-pdf.js               # Script to generate PDF from markdown
├── fnd-session-notes.html          # Intermediate HTML for PDF generation
└── prompt.md                       # System prompt defining assistant behavior

Maintenance

When updating test documents:

  1. Maintain FND focus: All content should relate to functional neurological disorder
  2. Keep module references: Ensure clear ReACT module citations
  3. Update test queries: Add new queries to this documentation
  4. Regenerate binary formats: When markdown changes, recreate PDF/DOCX
  5. Verify prompt alignment: Ensure content works with confidence tier system
  6. Test citation format: Confirm sources are cited in footer format

Regenerating Documents

To create PDF from markdown:

cd test-data
node create-fnd-pdf.js

To create DOCX from markdown:

cd test-data
pandoc fnd-progress-note.md -o fnd-progress-note.docx

Example Test Scenarios

Scenario 1: Direct Module Query

User: "What is the recommended approach for functional tremor?"

Expected Response:

  • High confidence (Tier 1)
  • Direct answer citing Module 5 protocol
  • 3-phase assessment explanation
  • 8-week retraining timeline
  • Footer citation to Module 5 and training transcript

Scenario 2: Cross-Document Synthesis

User: "How do treatment timelines compare across different FND symptoms?"

Expected Response:

  • Medium confidence (Tier 2)
  • Synthesis of 8-week (tremor), 10-week (gait and weakness) protocols
  • Acknowledgment of variation based on symptom type
  • Citations to Modules 4, 5, and 7

Scenario 3: Out-of-Scope Query

User: "What about treating functional seizures?"

Expected Response:

  • Low confidence (Tier 3)
  • Acknowledgment: "I don't have information about functional seizures in my current knowledge base"
  • Mention available topics (tremor, gait, weakness)
  • No fabricated information

Last Updated: January 21, 2026 Version: 2.0 Previous Version: Fictional conditions (CS-404, TPS-303, NRD-505) - replaced with FND-focused content

Version History

v2.0 (January 21, 2026):

  • Complete redesign focused on FND treatment
  • Alignment with ReACT FAQ chat assistant prompt
  • Module-based structure (Modules 4, 5, 7)
  • Healthcare provider audience focus
  • Confidence tier testing support

v1.0 (Previous):

  • Fictional medical conditions for general RAG testing
  • Not aligned with production prompt requirements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment