Skip to content

Turn any AI agent into an AI Scientist. The #1 Agent Skills library for science, used by 250,000+ scientists worldwide. 177 ready-to-use validated skills plus 100+ scientific databases covering biology, chemistry, medicine, and drug discovery. Compatible with Cursor, Claude Code, Codex, Pi, Antigravity, and the open Agent Skills standard.

Redesign treatment plan safety

Timothy Kassis818cb877c7a2
diff --git a/skills/treatment-plans/SKILL.md b/skills/treatment-plans/SKILL.md
index 33286f28..7d7a218b 100644
--- a/skills/treatment-plans/SKILL.md
+++ b/skills/treatment-plans/SKILL.md
@@ -1,1580 +1,174 @@
---
name: treatment-plans
-description: Generate concise (3-4 page), focused medical treatment plans in LaTeX/PDF format for all clinical specialties. Supports general medical treatment, rehabilitation therapy, mental health care, chronic disease management, perioperative care, and pain management. Includes SMART goal frameworks, evidence-based interventions with minimal text citations, regulatory compliance (HIPAA), and professional formatting. Prioritizes brevity and clinical actionability.
-allowed-tools: Read Write Edit Bash
-license: MIT license
-required_environment_variables: [{"name": "OPENROUTER_API_KEY", "prompt": "OpenRouter API key for the skill's LLM-powered steps.", "required_for": "optional features"}]
-metadata: {"version": "1.2", "skill-author": "K-Dense Inc.", "openclaw": {"primaryEnv": "OPENROUTER_API_KEY", "envVars": [{"name": "OPENROUTER_API_KEY", "required": false, "description": "OpenRouter API key for the skill's LLM-powered steps."}]}}
+description: Format and structurally validate local treatment-plan documentation after clinical decisions have already been supplied and verified by authorized licensed professionals. Use for source traceability, clinician-authored intervention records, goals and checkpoints, shared-decision records, reconciliation handoffs, and release gates—not for clinical decision-making.
+license: MIT
+compatibility: Python 3.11+ standard library; local JSON files only. Bundled CLIs require no network, external services, models, images, credentials, environment variables, or third-party packages.
+metadata:
+ version: "2.0"
+ skill-author: K-Dense Inc.
---
-# Treatment Plan Writing
+# Treatment-Plan Documentation
-## Overview
+## Hard safety boundary
-Treatment plan writing is the systematic documentation of clinical care strategies designed to address patient health conditions through evidence-based interventions, measurable goals, and structured follow-up. This skill provides comprehensive LaTeX templates and validation tools for creating **concise, focused** treatment plans (3-4 pages standard) across all medical specialties with full regulatory compliance.
+This skill only **formats and validates documentation of decisions already made, supplied, and verified by authorized licensed professionals**.
-**Critical Principles:**
-1. **CONCISE & ACTIONABLE**: Treatment plans default to 3-4 pages maximum, focusing only on clinically essential information that impacts care decisions
-2. **Patient-Centered**: Plans must be evidence-based, measurable, and compliant with healthcare regulations (HIPAA, documentation standards)
-3. **Minimal Citations**: Use brief in-text citations only when needed to support clinical recommendations; avoid extensive bibliographies
+Never use it to:
-Every treatment plan should include clear goals, specific interventions, defined timelines, monitoring parameters, and expected outcomes that align with patient preferences and current clinical guidelines - all presented as efficiently as possible.
+- diagnose, assess, classify, or screen a person;
+- select, rank, recommend, substitute, or compare therapies;
+- choose a medication, dose, route, frequency, duration, or monitoring threshold;
+- start, stop, hold, resume, titrate, taper, or deprescribe anything;
+- check interactions, allergies, contraindications, organ-function suitability, or treatment eligibility;
+- infer missing clinical content, intervals, dates, targets, escalation criteria, or instructions;
+- triage, determine urgency, provide emergency advice, or create a safety plan;
+- predict outcomes, prognosis, response, benefit, harm, or clinical appropriateness;
+- replace medication reconciliation, pharmacist review, informed consent, clinician review, or an authorized clinical system;
+- claim FDA approval, HIPAA compliance, legal compliance, completeness of care, clinical safety, or standard-of-care conformity.
-## When to Use This Skill
+If a request crosses a boundary, stop. Ask for a locally verified clinician-authored record or route the matter to the responsible licensed professional. Do not redirect to another skill to obtain a patient-specific recommendation.
-This skill should be used when:
-- Creating individualized treatment plans for patient care
-- Documenting therapeutic interventions for chronic disease management
-- Developing rehabilitation programs (physical therapy, occupational therapy, cardiac rehab)
-- Writing mental health and psychiatric treatment plans
-- Planning perioperative and surgical care pathways
-- Establishing pain management protocols
-- Setting patient-centered goals using SMART criteria
-- Coordinating multidisciplinary care across specialties
-- Ensuring regulatory compliance in treatment documentation
-- Generating professional treatment plans for medical records
+If a concern may be urgent or emergent, stop this workflow and route it through the institution's current clinical escalation or emergency process. This skill does not decide urgency and does not provide emergency instructions.
-## Visual Enhancement with Scientific Schematics
+## Required visible notice
-**⚠️ MANDATORY: Every treatment plan MUST include at least 1 AI-generated figure using the scientific-schematics skill.**
+Every component and derived schedule must display:
-This is not optional. Treatment plans benefit greatly from visual elements. Before finalizing any document:
-1. Generate at minimum ONE schematic or diagram (e.g., treatment pathway flowchart, care coordination diagram, or therapy timeline)
-2. For complex plans: include decision algorithm flowchart
-3. For rehabilitation plans: include milestone progression diagram
+> **DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED**
-**How to generate figures:**
-- Use the **scientific-schematics** skill to generate AI-powered publication-quality diagrams
-- Simply describe your desired diagram in natural language
-- Nano Banana Pro will automatically generate, review, and refine the schematic
+Structural success never removes this notice. Only the authorized local workflow may set the release gate.
-**How to generate schematics:**
-```bash
-python scripts/generate_schematic.py "your diagram description" -o figures/output.png
-```
-
-The AI will automatically:
-- Create publication-quality images with proper formatting
-- Review and refine through multiple iterations
-- Ensure accessibility (colorblind-friendly, high contrast)
-- Save outputs in the figures/ directory
-
-**When to add schematics:**
-- Treatment pathway flowcharts
-- Care coordination diagrams
-- Therapy progression timelines
-- Multidisciplinary team interaction diagrams
-- Medication management flowcharts
-- Rehabilitation protocol visualizations
-- Clinical decision algorithm diagrams
-- Any complex concept that benefits from visualization
-
-For detailed guidance on creating schematics, refer to the scientific-schematics skill documentation.
-
----
-
-## Document Format and Best Practices
-
-### Document Length Options
-
-Treatment plans come in three format options based on clinical complexity and use case:
-
-#### Option 1: One-Page Treatment Plan (PREFERRED for most cases)
-
-**When to use**: Straightforward clinical scenarios, standard protocols, busy clinical settings
-
-**Format**: Single page containing all essential treatment information in scannable sections
-- No table of contents needed
-- No extensive narratives
-- Focused on actionable items only
-- Similar to precision oncology reports or treatment recommendation cards
-
-**Required sections** (all on one page):
-1. **Header Box**: Patient info, diagnosis, date, molecular/risk profile if applicable
-2. **Treatment Regimen**: Numbered list of specific interventions
-3. **Supportive Care**: Brief bullet points
-4. **Rationale**: 1-2 sentence justification (optional for standard protocols)
-5. **Monitoring**: Key parameters and frequency
-6. **Evidence Level**: Guideline reference or evidence grade (e.g., "Level 1, FDA approved")
-7. **Expected Outcome**: Timeline and success metrics
-
-**Design principles**:
-- Use small boxes/tables for organization (like the clinical treatment recommendation card format)
-- Eliminate all non-essential text
-- Use abbreviations familiar to clinicians
-- Dense information layout - maximize information per square inch
-- Think "quick reference card" not "comprehensive documentation"
-
-**Example structure**:
-```latex
-[Patient ID/Diagnosis Box at top]
-
-TARGET PATIENT POPULATION
- Number of patients, demographics, key features
-
-PRIMARY TREATMENT REGIMEN
- • Medication 1: dose, frequency, duration
- • Procedure: specific details
- • Monitoring: what and when
-
-SUPPORTIVE CARE
- • Key supportive medications
-
-RATIONALE
- Brief clinical justification
-
-MOLECULAR TARGETS / RISK FACTORS
- Relevant biomarkers or risk stratification
-
-EVIDENCE LEVEL
- Guideline reference, trial data
-
-MONITORING REQUIREMENTS
- Key labs/vitals, frequency
-
-EXPECTED CLINICAL BENEFIT
- Primary endpoint, timeline
-```
-
-#### Option 2: Standard 3-4 Page Format
-
-**When to use**: Moderate complexity, need for patient education materials, multidisciplinary coordination
-
-Uses the Foundation Medicine first-page summary model with 2-3 additional pages of details.
-
-#### Option 3: Extended 5-6 Page Format
-
-**When to use**: Complex comorbidities, research protocols, extensive safety monitoring required
-
-### First Page Summary (Foundation Medicine Model)
-
-**CRITICAL REQUIREMENT: All treatment plans MUST have a complete executive summary on the first page ONLY, before any table of contents or detailed sections.**
-
-Following the Foundation Medicine model for precision medicine reporting and clinical summary documents, treatment plans begin with a one-page executive summary that provides immediate access to key actionable information. This entire summary must fit on the first page.
-
-**Required First Page Structure (in order):**
-
-1. **Title and Subtitle**
- - Main title: Treatment plan type (e.g., "Comprehensive Treatment Plan")
- - Subtitle: Specific condition or focus (e.g., "Type 2 Diabetes Mellitus - Young Adult Patient")
-
-2. **Report Information Box** (using `\begin{infobox}` or `\begin{patientinfo}`)
- - Report type/document purpose
- - Date of plan creation
- - Patient demographics (age, sex, de-identified)
- - Primary diagnosis with ICD-10 code
- - Report author/clinic (if applicable)
- - Analysis approach or framework used
-
-3. **Key Findings or Treatment Highlights** (2-4 colored boxes using appropriate box types)
- - **Primary Treatment Goals** (using `\begin{goalbox}`)
- - 2-3 SMART goals in bullet format
- - **Main Interventions** (using `\begin{keybox}` or `\begin{infobox}`)
- - 2-3 key interventions (pharmacological, non-pharmacological, monitoring)
- - **Critical Decision Points** (using `\begin{warningbox}` if urgent)
- - Important monitoring thresholds or safety considerations
- - **Timeline Overview** (using `\begin{infobox}`)
- - Brief treatment duration/phases
- - Key milestone dates
-
-**Visual Format Requirements:**
-- Use `\thispagestyle{empty}` to remove page numbers from first page
-- All content must fit on page 1 (before `\newpage`)
-- Use colored boxes (tcolorbox package) with different colors for different information types
-- Boxes should be visually prominent and easy to scan
-- Use concise, bullet-point format
-- Table of contents (if included) starts on page 2
-- Detailed sections start on page 3
-
-**Example First Page Structure:**
-```latex
-\maketitle
-\thispagestyle{empty}
-
-% Report Information Box
-\begin{patientinfo}
- Report Type, Date, Patient Info, Diagnosis, etc.
-\end{patientinfo}
-
-% Key Finding #1: Treatment Goals
-\begin{goalbox}[Primary Treatment Goals]
- • Goal 1
- • Goal 2
- • Goal 3
-\end{goalbox}
-
-% Key Finding #2: Main Interventions
-\begin{keybox}[Core Interventions]
- • Intervention 1
- • Intervention 2
- • Intervention 3
-\end{keybox}
-
-% Key Finding #3: Critical Monitoring (if applicable)
-\begin{warningbox}[Critical Decision Points]
- • Decision point 1
- • Decision point 2
-\end{warningbox}
-
-\newpage
-\tableofcontents % TOC on page 2
-\newpage % Detailed content starts page 3
-```
-
-### Concise Documentation
-
-**CRITICAL: Treatment plans MUST prioritize brevity and clinical relevance. Default to 3-4 pages maximum unless clinical complexity absolutely demands more detail.**
-
-Treatment plans should prioritize **clarity and actionability** over exhaustive detail:
-
-- **Focused**: Include only clinically essential information that impacts care decisions
-- **Actionable**: Emphasize what needs to be done, when, and why
-- **Efficient**: Facilitate quick decision-making without sacrificing clinical quality
-- **Target length options**:
- - **1-page format** (preferred for straightforward cases): Quick-reference card with all essential information
- - **3-4 pages standard**: Standard format with first-page summary + supporting details
- - **5-6 pages** (rare): Only for highly complex cases with multiple comorbidities or multidisciplinary interventions
-
-**Streamlining Guidelines:**
-- **First Page Summary**: Use individual colored boxes to consolidate key information (goals, interventions, decision points) - this alone can often convey the essential treatment plan
-- **Eliminate Redundancy**: If information is in the first-page summary, don't repeat it verbatim in detailed sections
-- **Patient Education section**: 3-5 key bullet points on critical topics and warning signs only
-- **Risk Mitigation section**: Highlight only critical medication safety concerns and emergency actions (not exhaustive lists)
-- **Expected Outcomes section**: 2-3 concise statements on anticipated responses and timelines
-- **Interventions**: Focus on primary interventions; secondary/supportive measures in brief bullet format
-- **Use tables and bullet points** extensively for efficient presentation
-- **Avoid narrative prose** where structured lists suffice
-- **Combine related sections** when appropriate to reduce page count
-
-### Quality Over Quantity
-
-The goal is professional, clinically complete documentation that respects clinicians' time while ensuring comprehensive patient care. Every section should add value; remove or condense sections that don't directly inform treatment decisions.
-
-### Citations and Evidence Support
-
-**Use minimal, targeted citations to support clinical recommendations:**
-
-- **Text Citations Preferred**: Use brief in-text citations (Author Year) or simple references rather than extensive bibliographies unless specifically requested
-- **When to Cite**:
- - Clinical practice guideline recommendations (e.g., "per ADA 2024 guidelines")
- - Specific medication dosing or protocols (e.g., "ACC/AHA recommendations")
- - Novel or controversial interventions requiring evidence support
- - Risk stratification tools or validated assessment scales
-- **When NOT to Cite**:
- - Standard-of-care interventions widely accepted in the field
- - Basic medical facts and routine clinical practices
- - General patient education content
-- **Citation Format**:
- - Inline: "Initiate metformin as first-line therapy (ADA Standards of Care 2024)"
- - Minimal: "Treatment follows ACC/AHA heart failure guidelines"
- - Avoid formal numbered references and extensive bibliography sections unless document is for academic/research purposes
-- **Keep it Brief**: A 3-4 page treatment plan should have 0-3 citations maximum, only where essential for clinical credibility or novel recommendations
-
-## Core Capabilities
-
-### 1. General Medical Treatment Plans
-
-General medical treatment plans address common chronic conditions and acute medical issues requiring structured therapeutic interventions.
-
-#### Standard Components
-
-**Patient Information (De-identified)**
-- Demographics (age, sex, relevant medical background)
-- Active medical conditions and comorbidities
-- Current medications and allergies
-- Relevant social and family history
-- Functional status and baseline assessments
-- **HIPAA Compliance**: Remove all 18 identifiers per Safe Harbor method
-
-**Diagnosis and Assessment Summary**
-- Primary diagnosis with ICD-10 code
-- Secondary diagnoses and comorbidities
-- Severity classification and staging
-- Functional limitations and quality of life impact
-- Risk stratification (e.g., cardiovascular risk, fall risk)
-- Prognostic indicators
-
-**Treatment Goals (SMART Format)**
-
-Short-term goals (1-3 months):
-- **Specific**: Clearly defined outcome (e.g., "Reduce HbA1c to <7%")
-- **Measurable**: Quantifiable metrics (e.g., "Decrease systolic BP by 10 mmHg")
-- **Achievable**: Realistic given patient capabilities
-- **Relevant**: Aligned with patient priorities and values
-- **Time-bound**: Specific timeframe (e.g., "within 8 weeks")
-
-Long-term goals (6-12 months):
-- Disease control or remission targets
-- Functional improvement objectives
-- Quality of life enhancement
-- Prevention of complications
-- Maintenance of independence
-
-**Interventions**
-
-*Pharmacological*:
-- Medications with specific dosages, routes, frequencies
-- Titration schedules and target doses
-- Drug-drug interaction considerations
-- Monitoring for adverse effects
-- Medication reconciliation
-
-*Non-pharmacological*:
-- Lifestyle modifications (diet, exercise, smoking cessation)
-- Behavioral interventions
-- Patient education and self-management
-- Monitoring and self-tracking (glucose, blood pressure, weight)
-- Assistive devices or adaptive equipment
-
-*Procedural*:
-- Planned procedures or interventions
-- Referrals to specialists
-- Diagnostic testing schedule
-- Preventive care (vaccinations, screenings)
-
-**Timeline and Schedule**
-- Treatment phases with specific timeframes
-- Appointment frequency (weekly, monthly, quarterly)
-- Milestone assessments and goal evaluations
-- Medication adjustments schedule
-- Expected duration of treatment
-
-**Monitoring Parameters**
-- Clinical outcomes to track (vital signs, lab values, symptoms)
-- Assessment tools and scales (e.g., PHQ-9, pain scales)
-- Frequency of monitoring
-- Thresholds for intervention or escalation
-- Patient-reported outcomes
-
-**Expected Outcomes**
-- Primary outcome measures
-- Success criteria and benchmarks
-- Expected timeline for improvement
-- Criteria for treatment modification
-- Long-term prognosis
-
-**Follow-up Plan**
-- Scheduled appointments and reassessments
-- Communication plan (phone calls, secure messaging)
-- Emergency contact procedures
-- Criteria for urgent evaluation
-- Transition or discharge planning
-
-**Patient Education**
-- Understanding of condition and treatment rationale
-- Self-management skills training
-- Medication administration and adherence
-- Warning signs and when to seek help
-- Resources and support services
-
-**Risk Mitigation**
-- Potential adverse effects and management
-- Drug interactions and contraindications
-- Fall prevention, infection prevention
-- Emergency action plans
-- Safety monitoring
-
-#### Common Applications
-
-- Diabetes mellitus management
-- Hypertension control
-- Heart failure treatment
-- COPD management
-- Asthma care plans
-- Hyperlipidemia treatment
-- Osteoarthritis management
-- Chronic kidney disease
-
-### 2. Rehabilitation Treatment Plans
-
-Rehabilitation plans focus on restoring function, improving mobility, and enhancing quality of life through structured therapeutic programs.
-
-#### Core Components
-
-**Functional Assessment**
-- Baseline functional status (ADLs, IADLs)
-- Range of motion, strength, balance, endurance
-- Gait analysis and mobility assessment
-- Standardized measures (FIM, Barthel Index, Berg Balance Scale)
-- Environmental assessment (home safety, accessibility)
-
-**Rehabilitation Goals**
-
-*Impairment-level goals*:
-- Improve shoulder flexion to 140 degrees
-- Increase quadriceps strength by 2/5 MMT grades
-- Enhance balance (Berg Score >45/56)
-
-*Activity-level goals*:
-- Independent ambulation 150 feet with assistive device
-- Climb 12 stairs with handrail supervision
-- Transfer bed-to-chair independently
-
-*Participation-level goals*:
-- Return to work with modifications
-- Resume recreational activities
-- Independent community mobility
-
-**Therapeutic Interventions**
-
-*Physical Therapy*:
-- Therapeutic exercises (strengthening, stretching, endurance)
-- Manual therapy techniques
-- Gait training and balance activities
-- Modalities (heat, ice, electrical stimulation, ultrasound)
-- Assistive device training
-
-*Occupational Therapy*:
-- ADL training (bathing, dressing, grooming, feeding)
-- Upper extremity strengthening and coordination
-- Adaptive equipment and modifications
-- Energy conservation techniques
-- Cognitive rehabilitation
-
-*Speech-Language Pathology*:
-- Swallowing therapy and dysphagia management
-- Communication strategies and augmentative devices
-- Cognitive-linguistic therapy
-- Voice therapy
-
-*Other Services*:
-- Recreational therapy
-- Aquatic therapy
-- Cardiac rehabilitation
-- Pulmonary rehabilitation
-- Vestibular rehabilitation
-
-**Treatment Schedule**
-- Frequency: 3x/week PT, 2x/week OT (example)
-- Session duration: 45-60 minutes
-- Treatment phase durations (acute, subacute, maintenance)
-- Expected total duration: 8-12 weeks
-- Reassessment intervals
-
-**Progress Monitoring**
-- Weekly functional assessments
-- Standardized outcome measures
-- Goal attainment scaling
-- Pain and symptom tracking
-- Patient satisfaction
-
-**Home Exercise Program**
-- Specific exercises with repetitions/sets/frequency
-- Precautions and safety instructions
-- Progression criteria
-- Self-monitoring strategies
-
-#### Specialty Rehabilitation
-
-- Post-stroke rehabilitation
-- Orthopedic rehabilitation (joint replacement, fracture)
-- Cardiac rehabilitation (post-MI, post-surgery)
-- Pulmonary rehabilitation
-- Vestibular rehabilitation
-- Neurological rehabilitation
-- Sports injury rehabilitation
-
-### 3. Mental Health Treatment Plans
-
-Mental health treatment plans address psychiatric conditions through integrated psychotherapeutic, pharmacological, and psychosocial interventions.
-
-#### Essential Components
-
-**Psychiatric Assessment**
-- Primary psychiatric diagnosis (DSM-5 criteria)
-- Symptom severity and functional impairment
-- Co-occurring mental health conditions
-- Substance use assessment
-- Suicide/homicide risk assessment
-- Trauma history and PTSD screening
-- Social determinants of mental health
-
-**Treatment Goals**
-
-*Symptom reduction*:
-- Decrease depression severity (PHQ-9 score from 18 to <10)
-- Reduce anxiety symptoms (GAD-7 score <5)
-- Improve sleep quality (Pittsburgh Sleep Quality Index)
-- Stabilize mood (reduced mood episodes)
-
-*Functional improvement*:
-- Return to work or school
-- Improve social relationships and support
-- Enhance coping skills and emotional regulation
-- Increase engagement in meaningful activities
-
-*Recovery-oriented goals*:
-- Build resilience and self-efficacy
-- Develop crisis management skills
-- Establish sustainable wellness routines
-- Achieve personal recovery goals
-
-**Therapeutic Interventions**
-
-*Psychotherapy*:
-- Evidence-based modality (CBT, DBT, ACT, psychodynamic, IPT)
-- Session frequency (weekly, biweekly)
-- Treatment duration (12-16 weeks, ongoing)
-- Specific techniques and targets
-- Group therapy participation
-
-*Psychopharmacology*:
-- Medication class and rationale
-- Starting dose and titration schedule
-- Target symptoms
-- Expected response timeline (2-4 weeks for antidepressants)
-- Side effect monitoring
-- Combination therapy considerations
-
-*Psychosocial Interventions*:
-- Case management services
-- Peer support programs
-- Family therapy or psychoeducation
-- Vocational rehabilitation
-- Supported housing or community integration
-- Substance abuse treatment
-
-**Safety Planning**
-- Crisis contacts and emergency services
-- Warning signs and triggers
-- Coping strategies and self-soothing techniques
-- Safe environment modifications
-- Means restriction (firearms, medications)
-- Support system activation
-
-**Monitoring and Assessment**
-- Symptom rating scales (weekly or biweekly)
-- Medication adherence and side effects
-- Suicidal ideation screening
-- Functional status assessments
-- Treatment engagement and therapeutic alliance
-
-**Patient and Family Education**
-- Psychoeducation about diagnosis
-- Treatment rationale and expectations
-- Medication information
-- Relapse prevention strategies
-- Community resources
-
-#### Mental Health Conditions
-
-- Major depressive disorder
-- Anxiety disorders (GAD, panic, social anxiety)
-- Bipolar disorder
-- Schizophrenia and psychotic disorders
-- PTSD and trauma-related disorders
-- Eating disorders
-- Substance use disorders
-- Personality disorders
-
-### 4. Chronic Disease Management Plans
-
-Comprehensive long-term care plans for chronic conditions requiring ongoing monitoring, treatment adjustments, and multidisciplinary coordination.
-
-#### Key Features
-
-**Disease-Specific Targets**
-- Evidence-based treatment goals per guidelines
-- Stage-appropriate interventions
-- Complication prevention strategies
-- Disease progression monitoring
-
-**Self-Management Support**
-- Patient activation and engagement
-- Shared decision-making
-- Action plans for symptom changes
-- Technology-enabled monitoring (apps, remote monitoring)
-
-**Care Coordination**
-- Primary care physician oversight
-- Specialist consultations and co-management
-- Care transitions (hospital to home)
-- Medication management across providers
-- Communication protocols
-
-**Population Health Integration**
-- Registry tracking and outreach
-- Preventive care and screening schedules
-- Quality measure reporting
-- Care gaps identification
-
-#### Applicable Conditions
-
-- Type 1 and Type 2 diabetes
-- Cardiovascular disease (CHF, CAD)
-- Chronic respiratory diseases (COPD, asthma)
-- Chronic kidney disease
-- Inflammatory bowel disease
-- Rheumatoid arthritis and autoimmune conditions
-- HIV/AIDS
-- Cancer survivorship care
-
-### 5. Perioperative Care Plans
-
-Structured plans for surgical and procedural patients covering preoperative preparation, intraoperative management, and postoperative recovery.
-
-#### Components
-
-**Preoperative Assessment**
-- Surgical indication and planned procedure
-- Preoperative risk stratification (ASA class, cardiac risk)
-- Optimization of medical conditions
-- Medication management (continuation, discontinuation)
-- Preoperative testing and clearances
-- Informed consent and patient education
-
-**Perioperative Interventions**
-- Enhanced recovery after surgery (ERAS) protocols
-- Venous thromboembolism prophylaxis
-- Antibiotic prophylaxis
-- Glycemic control strategies
-- Pain management plan (multimodal analgesia)
-
-**Postoperative Care**
-- Immediate recovery goals (24-48 hours)
-- Early mobilization protocols
-- Diet advancement
-- Wound care and drain management
-- Pain control regimen
-- Complication monitoring
-
-**Discharge Planning**
-- Activity restrictions and progression
-- Medication reconciliation
-- Follow-up appointments
-- Home health or rehabilitation services
-- Return-to-work timeline
-
-### 6. Pain Management Plans
-
-Multimodal approaches to acute and chronic pain using evidence-based interventions and opioid-sparing strategies.
-
-#### Comprehensive Components
-
-**Pain Assessment**
-- Pain location, quality, intensity (0-10 scale)
-- Temporal pattern (constant, intermittent, breakthrough)
-- Aggravating and alleviating factors
-- Functional impact (sleep, activities, mood)
-- Previous treatments and responses
-- Psychosocial contributors
-
-**Multimodal Interventions**
-
-*Pharmacological*:
-- Non-opioid analgesics (acetaminophen, NSAIDs)
-- Adjuvant medications (antidepressants, anticonvulsants, muscle relaxants)
-- Topical agents (lidocaine, capsaicin, diclofenac)
-- Opioid therapy (when appropriate, with risk mitigation)
-- Titration and rotation strategies
-
-*Interventional Procedures*:
-- Nerve blocks and injections
-- Radiofrequency ablation
-- Spinal cord stimulation
-- Intrathecal drug delivery
-
-*Non-pharmacological*:
-- Physical therapy and exercise
-- Cognitive-behavioral therapy for pain
-- Mindfulness and relaxation techniques
-- Acupuncture
-- TENS units
-
-**Opioid Safety (when prescribed)**
-- Indication and planned duration
-- Prescription drug monitoring program (PDMP) check
-- Opioid risk assessment tools
-- Naloxone prescription
-- Treatment agreements
-- Random urine drug screening
-- Frequent follow-up and reassessment
-
-**Functional Goals**
-- Specific activity improvements
-- Sleep quality enhancement
-- Reduced pain interference
-- Improved quality of life
-- Return to work or meaningful activities
-
-## Best Practices
-
-### Brevity and Focus (HIGHEST PRIORITY)
-
-**Treatment plans MUST be concise and focused on actionable clinical information:**
-
-- **1-page format is PREFERRED**: For most clinical scenarios, a single-page treatment plan (like precision oncology reports) provides all necessary information
-- **Default to shortest format possible**: Start with 1-page; only expand if clinical complexity genuinely requires it
-- **Every sentence must add value**: If a section doesn't change clinical decision-making, omit it entirely
-- **Think "quick reference card" not "comprehensive textbook"**: Busy clinicians need scannable, dense information
-- **Avoid academic verbosity**: This is clinical documentation, not a literature review or teaching document
-- **Maximum lengths by complexity**:
- - Simple/standard cases: 1 page
- - Moderate complexity: 3-4 pages (first-page summary + details)
- - High complexity (rare): 5-6 pages maximum
-
-### First Page Summary (Most Important)
-
-**ALWAYS create a one-page executive summary as the first page:**
-- The first page must contain ONLY: Title, Report Info Box, and Key Findings boxes
-- This provides an at-a-glance overview similar to precision medicine reports
-- Table of contents and detailed sections start on page 2 or later
-- Think of it as a "clinical highlights" page that a busy clinician can scan in 30 seconds
-- Use 2-4 colored boxes for different key findings (goals, interventions, decision points)
-- **A strong first page can often stand alone** - subsequent pages are for details, not repetition
-
-### SMART Goal Setting
-
-All treatment goals should meet SMART criteria:
-
-- **Specific**: "Improve HbA1c to <7%" not "Better diabetes control"
-- **Measurable**: Use quantifiable metrics, validated scales, objective measures
-- **Achievable**: Consider patient capabilities, resources, social support
-- **Relevant**: Align with patient values, priorities, and life circumstances
-- **Time-bound**: Define clear timeframes for goal achievement and reassessment
-
-### Patient-Centered Care
-
-✓ **Shared Decision-Making**: Involve patients in goal-setting and treatment choices
-✓ **Cultural Competence**: Respect cultural beliefs, language preferences, health literacy
-✓ **Patient Preferences**: Honor treatment preferences and personal values
-✓ **Individualization**: Tailor plans to patient's unique circumstances
-✓ **Empowerment**: Support patient activation and self-management
-
-### Evidence-Based Practice
-
-✓ **Clinical Guidelines**: Follow current specialty society recommendations
-✓ **Quality Measures**: Incorporate HEDIS, CMS quality measures
-✓ **Comparative Effectiveness**: Use treatments with proven efficacy
-✓ **Avoid Low-Value Care**: Eliminate unnecessary tests and interventions
-✓ **Stay Current**: Update plans based on emerging evidence
-
-### Documentation Standards
-
-✓ **Completeness**: Include all required elements
-✓ **Clarity**: Use clear, professional medical language
-✓ **Accuracy**: Ensure factual correctness and current information
-✓ **Timeliness**: Document plans promptly
-✓ **Legibility**: Professional formatting and organization
-✓ **Signature and Date**: Authenticate all treatment plans
-
-### Regulatory Compliance
-
-✓ **HIPAA Privacy**: De-identify all protected health information
-✓ **Informed Consent**: Document patient understanding and agreement
-✓ **Billing Support**: Include documentation to support medical necessity
-✓ **Quality Reporting**: Enable extraction of quality metrics
-✓ **Legal Protection**: Maintain defensible clinical documentation
-
-### Multidisciplinary Coordination
-
-✓ **Team Communication**: Share plans across care team
-✓ **Role Clarity**: Define responsibilities for each team member
-✓ **Care Transitions**: Ensure continuity across settings
-✓ **Specialist Integration**: Coordinate with subspecialty care
-✓ **Patient-Centered Medical Home**: Align with PCMH principles
-
-## LaTeX Template Usage
-
-### Template Selection
-
-Choose the appropriate template based on clinical context and desired length:
-
-#### Concise Templates (PREFERRED)
-
-1. **one_page_treatment_plan.tex** - **FIRST CHOICE** for most cases
- - All clinical specialties
- - Standard protocols and straightforward cases
- - Quick-reference format similar to precision oncology reports
- - Dense, scannable, clinician-focused
- - Use this unless complexity demands more detail
-
-#### Standard Templates (3-4 pages)
-
-Use only when one-page format is insufficient due to complexity:
-
-2. **general_medical_treatment_plan.tex** - Primary care, chronic disease, general medicine
-3. **rehabilitation_treatment_plan.tex** - PT/OT, post-surgery, injury recovery
-4. **mental_health_treatment_plan.tex** - Psychiatric conditions, behavioral health
-5. **chronic_disease_management_plan.tex** - Complex chronic diseases, multiple conditions
-6. **perioperative_care_plan.tex** - Surgical patients, procedural care
-7. **pain_management_plan.tex** - Acute or chronic pain conditions
-
-**Note**: Even when using standard templates, adapt them to be concise (3-4 pages max) by removing non-essential sections.
-
-### Template Structure
-
-All LaTeX templates include:
-- Professional formatting with appropriate margins and fonts
-- Structured sections for all required components
-- Tables for medications, interventions, timelines
-- Goal-tracking sections with SMART criteria
-- Space for provider signatures and dates
-- HIPAA-compliant de-identification guidance
-- Comments with detailed instructions
-
-### Generating PDFs
-
-```bash
-# Compile LaTeX template to PDF
-pdflatex general_medical_treatment_plan.tex
-
-# For templates with references
-pdflatex treatment_plan.tex
-bibtex treatment_plan
-pdflatex treatment_plan.tex
-pdflatex treatment_plan.tex
-```
-
-## Validation and Quality Assurance
-
-### Completeness Checking
-
-Use validation scripts to ensure all required sections are present:
-
-```bash
-python check_completeness.py my_treatment_plan.tex
-```
-
-The script checks for:
-- Patient information section
-- Diagnosis and assessment
-- SMART goals (short-term and long-term)
-- Interventions (pharmacological, non-pharmacological)
-- Timeline and schedule
-- Monitoring parameters
-- Expected outcomes
-- Follow-up plan
-- Patient education
-- Risk mitigation
+## Data gate
-### Treatment Plan Validation
+Prefer synthetic or qualified de-identified structured manifests. Do not place patient names, medical-record numbers, contact details, dates of birth, addresses, free-text notes, images, or other direct identifiers in examples.
-Comprehensive validation of treatment plan quality:
+For any real-patient or patient-derived data:
-```bash
-python validate_treatment_plan.py my_treatment_plan.tex
-```
-
-Validation includes:
-- SMART goal criteria assessment
-- Evidence-based intervention verification
-- Timeline feasibility check
-- Monitoring parameter adequacy
-- Safety and risk mitigation review
-- Regulatory compliance check
-
-### Quality Checklist
-
-Review treatment plans against the quality checklist (`quality_checklist.md`):
-
-**Clinical Quality**
-- [ ] Diagnosis is accurate and properly coded (ICD-10)
-- [ ] Goals are SMART and patient-centered
-- [ ] Interventions are evidence-based and guideline-concordant
-- [ ] Timeline is realistic and clearly defined
-- [ ] Monitoring plan is comprehensive
-- [ ] Safety considerations are addressed
-
-**Patient-Centered Care**
-- [ ] Patient preferences and values incorporated
-- [ ] Shared decision-making documented
-- [ ] Health literacy appropriate language
-- [ ] Cultural considerations addressed
-- [ ] Patient education plan included
-
-**Regulatory Compliance**
-- [ ] HIPAA-compliant de-identification
-- [ ] Medical necessity documented
-- [ ] Informed consent noted
-- [ ] Provider signature and credentials
-- [ ] Date of plan creation/revision
-
-**Coordination and Communication**
-- [ ] Specialist referrals documented
-- [ ] Care team roles defined
-- [ ] Follow-up schedule clear
-- [ ] Emergency contacts provided
-- [ ] Transition planning addressed
-
-## Integration with Other Skills
-
-### Clinical Reports Integration
-
-Treatment plans often accompany other clinical documentation:
-
-- **SOAP Notes** (`clinical-reports` skill): Document ongoing implementation
-- **H&P** (`clinical-reports` skill): Initial assessment informs treatment plan
-- **Discharge Summaries** (`clinical-reports` skill): Summarize treatment plan execution
-- **Progress Notes**: Track goal achievement and plan modifications
-
-### Scientific Writing Integration
-
-Evidence-based treatment planning requires literature support:
-
-- **Citation Management** (`citation-management` skill): Reference clinical guidelines
-- **Literature Review** (`literature-review` skill): Understand treatment evidence base
-- **Research Lookup** (`research-lookup` skill): Find current best practices
-
-### Research Integration
-
-Treatment plans may be developed for clinical trials or research studies:
-
-- **Research Grants** (`research-grants` skill): Treatment protocols for funded studies
-- **Clinical Trial Reports** (`clinical-reports` skill): Intervention documentation
-
-## Common Use Cases
-
-### Example 1: Type 2 Diabetes Management
-
-**Scenario**: 58-year-old patient with newly diagnosed Type 2 diabetes, HbA1c 8.5%, BMI 32
-
-**Template**: `general_medical_treatment_plan.tex`
-
-**Goals**:
-- Short-term: Reduce HbA1c to <7.5% in 3 months
-- Long-term: Achieve HbA1c <7%, lose 15 pounds in 6 months
-
-**Interventions**:
-- Pharmacological: Metformin 500mg BID, titrate to 1000mg BID
-- Lifestyle: Mediterranean diet, 150 min/week moderate exercise
-- Education: Diabetes self-management education, glucose monitoring
-
-### Example 2: Post-Stroke Rehabilitation
-
-**Scenario**: 70-year-old patient s/p left MCA stroke with right hemiparesis
-
-**Template**: `rehabilitation_treatment_plan.tex`
-
-**Goals**:
-- Short-term: Improve right arm strength 2/5 to 3/5 in 4 weeks
-- Long-term: Independent ambulation 150 feet with cane in 12 weeks
-
-**Interventions**:
-- PT 3x/week: Gait training, balance, strengthening
-- OT 3x/week: ADL training, upper extremity function
-- SLP 2x/week: Dysphagia therapy
-
-### Example 3: Major Depressive Disorder
-
-**Scenario**: 35-year-old with moderate depression, PHQ-9 score 16
-
-**Template**: `mental_health_treatment_plan.tex`
-
-**Goals**:
-- Short-term: Reduce PHQ-9 to <10 in 8 weeks
-- Long-term: Achieve remission (PHQ-9 <5), return to work
-
-**Interventions**:
-- Psychotherapy: CBT weekly sessions
-- Medication: Sertraline 50mg daily, titrate to 100mg
-- Lifestyle: Sleep hygiene, exercise 30 min 5x/week
-
-### Example 4: Total Knee Arthroplasty
-
-**Scenario**: 68-year-old scheduled for right TKA for osteoarthritis
-
-**Template**: `perioperative_care_plan.tex`
-
-**Preoperative Goals**:
-- Optimize diabetes control (glucose <180)
-- Discontinue anticoagulation per protocol
-- Complete medical clearance
-
-**Postoperative Goals**:
-- Ambulate 50 feet by POD 1
-- 90-degree knee flexion by POD 3
-- Discharge home with PT services by POD 2-3
-
-### Example 5: Chronic Low Back Pain
-
-**Scenario**: 45-year-old with chronic non-specific low back pain, pain 7/10
-
-**Template**: `pain_management_plan.tex`
-
-**Goals**:
-- Short-term: Reduce pain to 4/10 in 6 weeks
-- Long-term: Return to work full-time, pain 2-3/10
-
-**Interventions**:
-- Pharmacological: Gabapentin 300mg TID, duloxetine 60mg daily
-- PT: Core strengthening, McKenzie exercises 2x/week x 8 weeks
-- Behavioral: CBT for pain, mindfulness meditation
-- Interventional: Consider lumbar ESI if inadequate response
+1. Work only in a locally authorized environment under the institution's current privacy, security, retention, and access policies.
+2. Use the minimum information necessary for the documented purpose, even when a legal exception may apply.
+3. Do not send content to a model, search engine, API, image service, telemetry service, or any other external tool.
+4. Do not copy content into chat prompts, command history, logs, test fixtures, examples, screenshots, or reports.
+5. Run bundled scripts only against local paths. Their reports identify rule codes and field paths, not clinical values.
+6. Require qualified privacy review before treating patient-derived material as de-identified or releasing it.
-## Professional Standards and Guidelines
+If these conditions are not documented, do not read or process the content. Use synthetic templates only.
-Treatment plans should align with:
+## Allowed inputs
-### General Medicine
-- American Diabetes Association (ADA) Standards of Care
-- ACC/AHA Cardiovascular Guidelines
-- GOLD COPD Guidelines
-- JNC-8 Hypertension Guidelines
-- KDIGO Chronic Kidney Disease Guidelines
+Accept only bounded UTF-8 JSON objects built from these generic templates:
-### Rehabilitation
-- APTA Clinical Practice Guidelines
-- AOTA Practice Guidelines
-- Cardiac Rehabilitation Guidelines (AHA/AACVPR)
-- Stroke Rehabilitation Guidelines
+- `assets/source_fact_manifest_template.json`
+- `assets/clinician_authored_intervention_template.json`
+- `assets/goals_monitoring_checkpoint_template.json`
+- `assets/informed_preference_shared_decision_template.json`
+- `assets/transition_reconciliation_template.json`
+- `assets/intended_use_handoff_template.json`
-### Mental Health
-- APA Practice Guidelines
-- VA/DoD Clinical Practice Guidelines
-- NICE Guidelines (National Institute for Health and Care Excellence)
-- Cochrane Reviews for psychiatric interventions
+The templates contain no disease-specific recommendations, example patients, clinical intervals, doses, targets, thresholds, or inferred care pathways. Empty template arrays and pending attestations are intentional release blockers.
-### Pain Management
-- CDC Opioid Prescribing Guidelines
-- AAPM/APS Chronic Pain Guidelines
-- WHO Pain Ladder
-- Multimodal Analgesia Best Practices
+## Workflow
-## Timeline Generation
+### 1. Establish authority and intended use
-Use the timeline generator script to create visual treatment timelines:
+- Confirm the accountable clinical owner and authorized licensed signatory.
+- Confirm that every clinical decision already exists in a verified local source.
+- Record jurisdiction, institution, setting, document owner, local policies, retention rule, and intended recipients.
+- Record whether the package is synthetic, qualified de-identified, or real-patient minimum-necessary data.
+- Keep the release gate `blocked` until every required review is complete.
-```bash
-python timeline_generator.py --plan my_treatment_plan.tex --output timeline.pdf
-```
-
-Generates:
-- Gantt chart of treatment phases
-- Milestone markers for goal assessments
-- Medication titration schedules
-- Follow-up appointment calendar
-- Intervention intensity over time
+Read `references/safety_scope.md` and `references/privacy_governance.md` before processing patient-derived material.
-## Support and Resources
-
-### Template Generation
-
-Interactive template selection:
+### 2. Generate a generic package
```bash
-cd .claude/skills/treatment-plans/scripts
-python generate_template.py
-
-# Or specify type directly
-python generate_template.py --type mental_health --output depression_treatment_plan.tex
-```
-
-### Validation Workflow
-
-1. **Create treatment plan** using appropriate LaTeX template
-2. **Check completeness**: `python check_completeness.py plan.tex`
-3. **Validate quality**: `python validate_treatment_plan.py plan.tex`
-4. **Review checklist**: Compare against `quality_checklist.md`
-5. **Generate PDF**: `pdflatex plan.tex`
-6. **Review with patient**: Ensure understanding and agreement
-7. **Implement and document**: Track progress in clinical notes
-
-### Additional Resources
-
-- Clinical practice guidelines from specialty societies
-- AHRQ Effective Health Care Program
-- Cochrane Library for intervention evidence
-- UpToDate and DynaMed for treatment recommendations
-- CMS Quality Measures and HEDIS specifications
-
-## Professional Document Styling
-
-### Overview
-
-Treatment plans can be enhanced with professional medical document styling using the `medical_treatment_plan.sty` LaTeX package. This custom style transforms plain academic documents into visually appealing, color-coded clinical documents that maintain scientific rigor while improving readability and usability.
-
-### Medical Treatment Plan Style Package
-
-The `medical_treatment_plan.sty` package (located in `assets/medical_treatment_plan.sty`) provides:
-
-**Professional Color Scheme**
-- **Primary Blue** (RGB: 0, 102, 153): Headers, section titles, primary accents
-- **Secondary Blue** (RGB: 102, 178, 204): Light backgrounds, subtle accents
-- **Accent Blue** (RGB: 0, 153, 204): Hyperlinks, key highlights
-- **Success Green** (RGB: 0, 153, 76): Goals, positive outcomes
-- **Warning Red** (RGB: 204, 0, 0): Warnings, critical information
-- **Dark Gray** (RGB: 64, 64, 64): Body text
-- **Light Gray** (RGB: 245, 245, 245): Background fills
-
-**Styled Elements**
-- Custom colored headers and footers with professional rules
-- Blue section titles with underlines for clear hierarchy
-- Enhanced table formatting with colored headers and alternating rows
-- Optimized list spacing with colored bullets and numbering
-- Professional page layout with appropriate margins
-
-### Custom Information Boxes
-
-The style package includes five specialized box environments for organizing clinical information:
-
-#### 1. Info Box (Blue Border, Light Gray Background)
-
-For general information, clinical assessments, and testing schedules:
-
-```latex
-\begin{infobox}[Title]
- \textbf{Key Information:}
- \begin{itemize}
- \item Clinical assessment details
- \item Testing schedules
- \item General guidance
- \end{itemize}
-\end{infobox}
+python3 scripts/generate_template.py \
+ --output-dir ./local-plan-package \
+ --subject-ref SYNTHETIC-CASE-001 \
+ --classification synthetic
```
-**Use cases**: Metabolic status, baseline assessments, monitoring schedules, titration protocols
+The generator copies all six templates. It does not create clinical content and does not overwrite existing files.
-#### 2. Warning Box (Red Border, Yellow Background)
+### 3. Transcribe supplied decisions without inference
-For critical decision points, safety protocols, and alerts:
-
-```latex
-\begin{warningbox}[Alert Title]
- \textbf{Important Safety Information:}
- \begin{itemize}
- \item Critical drug interactions
- \item Safety monitoring requirements
- \item Red flag symptoms requiring immediate action
- \end{itemize}
-\end{warningbox}
-```
-
-**Use cases**: Medication safety, decision points, contraindications, emergency protocols
-
-#### 3. Goal Box (Green Border, Green-Tinted Background)
-
-For treatment goals, targets, and success criteria:
-
-```latex
-\begin{goalbox}[Treatment Goals]
- \textbf{Primary Objectives:}
- \begin{itemize}
- \item Reduce HbA1c to <7\% within 3 months
- \item Achieve 5-7\% weight loss in 12 weeks
- \item Complete diabetes education program
- \end{itemize}
-\end{goalbox}
-```
-
-**Use cases**: SMART goals, target outcomes, success metrics, CGM goals
-
-#### 4. Key Points Box (Blue Background)
-
-For executive summaries, key takeaways, and important recommendations:
-
-```latex
-\begin{keybox}[Key Highlights]
- \textbf{Essential Points:}
- \begin{itemize}
- \item Main therapeutic approach
- \item Critical patient instructions
- \item Priority interventions
- \end{itemize}
-\end{keybox}
-```
-
-**Use cases**: Plan overview, plate method instructions, important dietary guidelines
-
-#### 5. Emergency Box (Large Red Design)
-
-For emergency contacts and urgent protocols:
-
-```latex
-\begin{emergencybox}
- \begin{itemize}
- \item \textbf{Emergency Services:} 911
- \item \textbf{Endocrinology Office:} [Phone] (business hours)
- \item \textbf{After-Hours Hotline:} [Phone] (nights/weekends)
- \item \textbf{Pharmacy:} [Phone and location]
- \end{itemize}
-\end{emergencybox}
-```
-
-**Use cases**: Emergency contacts, critical hotlines, urgent resource information
-
-#### 6. Patient Info Box (White with Blue Border)
-
-For patient demographics and baseline information:
-
-```latex
-\begin{patientinfo}
- \begin{tabular}{ll}
- \textbf{Age:} & 23 years \\
- \textbf{Sex:} & Male \\
- \textbf{Diagnosis:} & Type 2 Diabetes Mellitus \\
- \textbf{Plan Start Date:} & \today \\
- \end{tabular}
-\end{patientinfo}
-```
+- Copy only clinician-authored facts and interventions from verified local sources.
+- Preserve source locators, versions/dates, author role, verification role, and verification time.
+- Record goals, monitoring items, checkpoint dates, and transition dates exactly as supplied.
+- Record options, benefits, harms, uncertainty, preferences, and the outcome only as documented by the responsible clinician.
+- Leave missing fields unresolved. Never fill them from general knowledge.
+- For medication content, record the clinician-authored text and current local source references; do not interpret or validate it.
-**Use cases**: Patient information sections, demographic data
+See `references/documentation_workflow.md`, `references/source_boundaries.md`, and `references/shared_decision_handoff.md`.
-### Professional Table Formatting
+### 4. Run deterministic local checks
-Enhanced table environment with medical styling:
-
-```latex
-\begin{medtable}{Caption Text}
-\begin{tabular}{|p{5cm}|p{4cm}|p{4.5cm}|}
-\hline
-\tableheadercolor % Blue header with white text
-\textcolor{white}{\textbf{Column 1}} &
-\textcolor{white}{\textbf{Column 2}} &
-\textcolor{white}{\textbf{Column 3}} \\
-\hline
-Data row 1 content & Value 1 & Details 1 \\
-\hline
-\tablerowcolor % Alternating light gray row
-Data row 2 content & Value 2 & Details 2 \\
-\hline
-Data row 3 content & Value 3 & Details 3 \\
-\hline
-\end{tabular}
-\caption{Table caption}
-\end{medtable}
-```
-
-**Features:**
-- Blue headers with white text for visual prominence
-- Alternating row colors (`\tablerowcolor`) for improved readability
-- Automatic centering and spacing
-- Professional borders and padding
-
-### Using the Style Package
-
-#### Basic Setup
-
-1. **Add to document preamble:**
-
-```latex
-% !TEX program = xelatex
-\documentclass[11pt,letterpaper]{article}
-
-% Use custom medical treatment plan style
-\usepackage{medical_treatment_plan}
-\usepackage{natbib}
-
-\begin{document}
-\maketitle
-% Your content here
-\end{document}
-```
-
-2. **Ensure style file is in same directory** as your `.tex` file, or install to LaTeX path
-
-3. **Compile with XeLaTeX** (recommended for best results):
+From the skill directory:
```bash
-xelatex treatment_plan.tex
-bibtex treatment_plan
-xelatex treatment_plan.tex
-xelatex treatment_plan.tex
+python3 scripts/validate_treatment_plan.py ./local-plan-package
+python3 scripts/validate_traceability.py ./local-plan-package
+python3 scripts/check_completeness.py ./local-plan-package
+python3 scripts/privacy_process_check.py ./local-plan-package
+python3 scripts/check_consistency.py ./local-plan-package
+python3 scripts/timeline_generator.py ./local-plan-package \
+ --output ./local-plan-package/explicit-date-schedule.json
```
-#### Custom Title Page
+The scripts:
-The package automatically formats the title with a professional blue header:
+- reject non-local paths, symlinks, duplicate JSON keys, unknown fields, oversized inputs, excessive nesting, and unbounded collections;
+- never use network access, environment variables, dynamic execution, pickle, subprocesses, images, or LLMs;
+- never assess diagnosis, medication safety, interactions, contraindications, clinical appropriateness, urgency, prognosis, or guideline concordance;
+- schedule only dates already supplied in the package and never derive recurrence or clinical intervals;
+- minimize reports to counts, rule codes, document types, and field paths.
-```latex
-\title{\textbf{Individualized Diabetes Treatment Plan}\\
-\large{23-Year-Old Male Patient with Type 2 Diabetes}}
-\author{Comprehensive Care Plan}
-\date{\today}
+### 5. Human review and release
-\begin{document}
-\maketitle
-```
-
-This creates an eye-catching blue box with white text and clear hierarchy.
-
-### Compilation Requirements
+Require the accountable authorized team to:
-**Required LaTeX Packages** (automatically loaded by the style):
-- `geometry` - Page layout and margins
-- `xcolor` - Color support
-- `tcolorbox` with `[most]` library - Custom colored boxes
-- `tikz` - Graphics and drawing
-- `fontspec` - Font management (XeLaTeX/LuaLaTeX)
-- `fancyhdr` - Custom headers and footers
-- `titlesec` - Section styling
-- `enumitem` - Enhanced list formatting
-- `booktabs` - Professional table rules
-- `longtable` - Multi-page tables
-- `array` - Enhanced table features
-- `colortbl` - Colored table cells
-- `hyperref` - Hyperlinks and PDF metadata
-- `natbib` - Bibliography management
+- compare every transcribed item with its signed source;
+- perform medication reconciliation and all clinical checks in approved systems;
+- verify current FDA labeling, Medication Guide, REMS materials, and local formulary/policy when applicable;
+- resolve every discrepancy and missing item;
+- review shared-decision and informed-preference documentation;
+- review transition recipients, ownership, pending results, and local escalation routing;
+- complete privacy, security, legal, regulatory, records, and institutional review as applicable;
+- sign, date, and release through the authorized record system.
-**Recommended Compilation:**
+The final handoff must retain provenance and unresolved-item routing. A script pass is not authorization to use the package for care.
-```bash
-# Using XeLaTeX (best font support)
-xelatex document.tex
-bibtex document
-xelatex document.tex
-xelatex document.tex
-
-# Using PDFLaTeX (alternative)
-pdflatex document.tex
-bibtex document
-pdflatex document.tex
-pdflatex document.tex
-```
+## Source boundaries
-### Customization Options
+- Use FDA labeling databases, current Medication Guides, and REMS materials as authoritative source records only when an authorized clinician or pharmacist verifies applicability. This skill does not interpret them.
+- Use WHO or Joint Commission transition guidance only for process structure such as information transfer, reconciliation documentation, ownership, and checklists.
+- Use AHRQ, NICE, or applicable professional guidance to document that shared decision-making occurred; do not generate options or risk estimates.
+- Apply CMS documentation requirements only when the exact program, provider type, jurisdiction, and current local policy are confirmed.
+- Route safety events, product reports, privacy incidents, and other reportable matters through current local governance. This skill records a route; it does not submit reports.
-#### Changing Colors
+See `references/source_ledger.md` for the dated official-source ledger.
-Edit the style file to modify the color scheme:
-
-```latex
-% In medical_treatment_plan.sty
-\definecolor{primaryblue}{RGB}{0, 102, 153} % Modify these
-\definecolor{secondaryblue}{RGB}{102, 178, 204}
-\definecolor{accentblue}{RGB}{0, 153, 204}
-\definecolor{successgreen}{RGB}{0, 153, 76}
-\definecolor{warningred}{RGB}{204, 0, 0}
-```
-
-#### Adjusting Page Layout
-
-Modify geometry settings in the style file:
-
-```latex
-\RequirePackage[margin=1in, top=1.2in, bottom=1.2in]{geometry}
-```
-
-#### Custom Fonts (XeLaTeX only)
-
-Uncomment and modify in the style file:
-
-```latex
-\setmainfont{Your Preferred Font}
-\setsansfont{Your Sans-Serif Font}
-```
-
-#### Header/Footer Customization
-
-Modify in the style file:
-
-```latex
-\fancyhead[L]{\color{primaryblue}\sffamily\small\textbf{Treatment Plan Title}}
-\fancyhead[R]{\color{darkgray}\sffamily\small Patient Info}
-```
-
-### Style Package Download and Installation
-
-#### Option 1: Copy to Project Directory
-
-Copy `assets/medical_treatment_plan.sty` to the same directory as your `.tex` file.
-
-#### Option 2: Install to User TeX Directory
+## Verification
```bash
-# Find your local texmf directory
-kpsewhich -var-value TEXMFHOME
-
-# Copy to appropriate location (usually ~/texmf/tex/latex/)
-mkdir -p ~/texmf/tex/latex/medical_treatment_plan
-cp assets/medical_treatment_plan.sty ~/texmf/tex/latex/medical_treatment_plan/
-
-# Update TeX file database
-texhash ~/texmf
+PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover \
+ -s tests -p 'test_*.py' -v
```
-#### Option 3: System-Wide Installation
+Run AST parsing without bytecode:
```bash
-# Copy to system texmf directory (requires sudo)
-sudo cp assets/medical_treatment_plan.sty /usr/local/texlive/texmf-local/tex/latex/
-sudo texhash
+PYTHONDONTWRITEBYTECODE=1 python3 -c \
+ "import ast,pathlib; [ast.parse(p.read_text()) for p in pathlib.Path('scripts').glob('*.py')]"
```
-### Additional Professional Styles (Optional)
-
-Other medical/clinical document styles available from CTAN:
-
-**Journal Styles:**
-```bash
-# Install via TeX Live Manager
-tlmgr install nejm # New England Journal of Medicine
-tlmgr install jama # JAMA style
-tlmgr install bmj # British Medical Journal
-```
-
-**General Professional Styles:**
-```bash
-tlmgr install apa7 # APA 7th edition (health sciences)
-tlmgr install IEEEtran # IEEE (medical devices/engineering)
-tlmgr install springer # Springer journals
-```
-
-**Download from CTAN:**
-- Visit: https://ctan.org/
-- Search for medical document classes
-- Download and install per package instructions
-
-### Troubleshooting
-
-**Issue: Package not found**
-```bash
-# Install missing packages via TeX Live Manager
-sudo tlmgr update --self
-sudo tlmgr install tcolorbox tikz pgf
-```
-
-**Issue: Missing characters (✓, ≥, etc.)**
-- Use XeLaTeX instead of PDFLaTeX
-- Or replace with LaTeX commands: `$\checkmark$`, `$\geq$`
-- Requires `amssymb` package for math symbols
-
-**Issue: Header height warnings**
-- Style file sets `\setlength{\headheight}{22pt}`
-- Adjust if needed for your content
-
-**Issue: Boxes not rendering**
-```bash
-# Ensure complete tcolorbox installation
-sudo tlmgr install tcolorbox tikz pgf
-```
-
-**Issue: Font not found (XeLaTeX)**
-- Comment out custom font lines in .sty file
-- Or install specified fonts on your system
-
-### Best Practices for Styled Documents
-
-1. **Appropriate Box Usage**
- - Match box type to content purpose (goals→green, warnings→yellow/red)
- - Don't overuse boxes; reserve for truly important information
- - Keep box content concise and focused
-
-2. **Visual Hierarchy**
- - Use section styling for structure
- - Boxes for emphasis and organization
- - Tables for comparative data
- - Lists for sequential or grouped items
-
-3. **Color Consistency**
- - Stick to defined color scheme
- - Use `\textcolor{primaryblue}{\textbf{Text}}` for emphasis
- - Maintain consistent meaning (red=warning, green=goals)
-
-4. **White Space**
- - Don't overcrowd pages with boxes
- - Use `\vspace{0.5cm}` between major sections
- - Allow breathing room around colored elements
-
-5. **Professional Appearance**
- - Maintain readability as top priority
- - Ensure sufficient contrast for accessibility
- - Test print output in grayscale
- - Keep styling consistent throughout document
-
-6. **Table Formatting**
- - Use `\tableheadercolor` for all header rows
- - Apply `\tablerowcolor` to alternating rows in tables >3 rows
- - Keep column widths balanced
- - Use `\small\sffamily` for large tables
-
-### Example: Styled Treatment Plan Structure
-
-```latex
-% !TEX program = xelatex
-\documentclass[11pt,letterpaper]{article}
-\usepackage{medical_treatment_plan}
-\usepackage{natbib}
-
-\title{\textbf{Comprehensive Treatment Plan}\\
-\large{Patient-Centered Care Strategy}}
-\author{Multidisciplinary Care Team}
-\date{\today}
-
-\begin{document}
-\maketitle
-
-\section*{Patient Information}
-\begin{patientinfo}
- % Demographics table
-\end{patientinfo}
-
-\section{Executive Summary}
-\begin{keybox}[Plan Overview]
- % Key highlights
-\end{keybox}
-
-\section{Treatment Goals}
-\begin{goalbox}[SMART Goals - 3 Months]
- \begin{medtable}{Primary Treatment Targets}
- % Goals table with colored headers
- \end{medtable}
-\end{goalbox}
-
-\section{Medication Plan}
-\begin{infobox}[Titration Schedule]
- % Medication instructions
-\end{infobox}
-
-\begin{warningbox}[Critical Decision Point]
- % Important safety information
-\end{warningbox}
-
-\section{Emergency Protocols}
-\begin{emergencybox}
- % Emergency contacts
-\end{emergencybox}
-
-\bibliographystyle{plainnat}
-\bibliography{references}
-\end{document}
-```
-
-### Benefits of Professional Styling
-
-**Clinical Practice:**
-- Faster information scanning during patient encounters
-- Clear visual hierarchy for critical vs. routine information
-- Professional appearance suitable for patient-facing documents
-- Color-coded sections reduce cognitive load
-
-**Educational Use:**
-- Enhanced readability for teaching materials
-- Visual differentiation of concept types (goals, warnings, procedures)
-- Professional presentation for case discussions
-- Print and digital-ready formats
-
-**Documentation Quality:**
-- Modern, polished appearance
-- Maintains clinical accuracy while improving aesthetics
-- Standardized formatting across treatment plans
-- Easy to customize for institutional branding
-
-**Patient Engagement:**
-- More approachable than dense text documents
-- Color coding helps patients identify key sections
-- Professional appearance builds trust
-- Clear organization facilitates understanding
-
-## Ethical Considerations
-
-### Informed Consent
-All treatment plans should involve patient understanding and voluntary agreement to proposed interventions.
-
-### Cultural Sensitivity
-Treatment plans must respect diverse cultural beliefs, health practices, and communication styles.
-
-### Health Equity
-Consider social determinants of health, access barriers, and health disparities when developing plans.
-
-### Privacy Protection
-Maintain strict HIPAA compliance; de-identify all protected health information in shared documents.
-
-### Autonomy and Beneficence
-Balance medical recommendations with patient autonomy and values while promoting patient welfare.
-
-## License
-
-Part of the Claude Scientific Writer project. See main LICENSE file.
-
+## Reference map
+- `references/README.md` — scope and navigation
+- `references/safety_scope.md` — refusal, routing, and release boundaries
+- `references/privacy_governance.md` — local handling and de-identification limits
+- `references/documentation_workflow.md` — package lifecycle and review gates
+- `references/source_boundaries.md` — FDA labeling, REMS, and governance boundaries
+- `references/shared_decision_handoff.md` — informed preferences, reconciliation, and transitions
+- `references/source_ledger.md` — dated authoritative sources
+- `references/security_validation.md` — baseline findings and validation record
diff --git a/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md b/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md
deleted file mode 100644
index c52583e8..00000000
--- a/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md
+++ /dev/null
@@ -1,185 +0,0 @@
-# Professional Treatment Plan Styling - Quick Reference
-
-## File Location
-`medical_treatment_plan.sty` - Available in the assets directory
-
-## Quick Start
-
-```latex
-% !TEX program = xelatex
-\documentclass[11pt,letterpaper]{article}
-\usepackage{medical_treatment_plan}
-\usepackage{natbib}
-
-\begin{document}
-\maketitle
-% Your content
-\end{document}
-```
-
-## Custom Box Environments
-
-### 1. Info Box (Blue) - General Information
-```latex
-\begin{infobox}[Title]
- Content
-\end{infobox}
-```
-**Use for:** Clinical assessments, monitoring schedules, titration protocols
-
-### 2. Warning Box (Yellow/Red) - Critical Alerts
-```latex
-\begin{warningbox}[Title]
- Critical information
-\end{warningbox}
-```
-**Use for:** Safety protocols, decision points, contraindications
-
-### 3. Goal Box (Green) - Treatment Goals
-```latex
-\begin{goalbox}[Title]
- Goals and targets
-\end{goalbox}
-```
-**Use for:** SMART goals, target outcomes, success metrics
-
-### 4. Key Points Box (Light Blue) - Highlights
-```latex
-\begin{keybox}[Title]
- Important highlights
-\end{keybox}
-```
-**Use for:** Executive summaries, key takeaways, essential recommendations
-
-### 5. Emergency Box (Red) - Emergency Info
-```latex
-\begin{emergencybox}
- Emergency contacts
-\end{emergencybox}
-```
-**Use for:** Emergency contacts, urgent protocols
-
-### 6. Patient Info Box (White/Blue) - Demographics
-```latex
-\begin{patientinfo}
- Patient information
-\end{patientinfo}
-```
-**Use for:** Patient demographics and baseline data
-
-## Professional Tables
-
-```latex
-\begin{medtable}{Caption}
-\begin{tabular}{|l|l|l|}
-\hline
-\tableheadercolor
-\textcolor{white}{\textbf{Header 1}} & \textcolor{white}{\textbf{Header 2}} \\
-\hline
-Data row 1 \\
-\hline
-\tablerowcolor % Alternating gray
-Data row 2 \\
-\hline
-\end{tabular}
-\caption{Table caption}
-\end{medtable}
-```
-
-## Color Scheme
-
-- **Primary Blue** (0, 102, 153): Headers, titles
-- **Secondary Blue** (102, 178, 204): Light backgrounds
-- **Accent Blue** (0, 153, 204): Links, highlights
-- **Success Green** (0, 153, 76): Goals
-- **Warning Red** (204, 0, 0): Warnings
-
-## Compilation
-
-```bash
-xelatex document.tex
-bibtex document
-xelatex document.tex
-xelatex document.tex
-```
-
-## Best Practices
-
-1. **Match box type to purpose:** Green for goals, red/yellow for warnings
-2. **Don't overuse boxes:** Reserve for important information only
-3. **Maintain color consistency:** Stick to the defined scheme
-4. **Use white space:** Add `\vspace{0.5cm}` between major sections
-5. **Table alternating rows:** Use `\tablerowcolor` for readability
-
-## Installation
-
-**Option 1:** Copy `assets/medical_treatment_plan.sty` to your document directory
-
-**Option 2:** Install to user TeX directory
-```bash
-mkdir -p ~/texmf/tex/latex/medical_treatment_plan
-cp assets/medical_treatment_plan.sty ~/texmf/tex/latex/medical_treatment_plan/
-texhash ~/texmf
-```
-
-## Required Packages
-All automatically loaded by the style:
-- tcolorbox, tikz, xcolor
-- fancyhdr, titlesec, enumitem
-- booktabs, longtable, array, colortbl
-- hyperref, natbib, fontspec
-
-## Example Structure
-
-```latex
-\maketitle
-
-\section*{Patient Information}
-\begin{patientinfo}
- Demographics
-\end{patientinfo}
-
-\section{Executive Summary}
-\begin{keybox}[Plan Overview]
- Key highlights
-\end{keybox}
-
-\section{Treatment Goals}
-\begin{goalbox}[SMART Goals]
- Goals list
-\end{goalbox}
-
-\section{Medication Plan}
-\begin{infobox}[Dosing]
- Instructions
-\end{infobox}
-
-\begin{warningbox}[Safety]
- Warnings
-\end{warningbox}
-
-\section{Emergency}
-\begin{emergencybox}
- Contacts
-\end{emergencybox}
-```
-
-## Troubleshooting
-
-**Missing packages:**
-```bash
-sudo tlmgr install tcolorbox tikz pgf
-```
-
-**Special characters not showing:**
-- Use XeLaTeX instead of PDFLaTeX
-- Or use LaTeX commands: `$\checkmark$`, `$\geq$`
-
-**Header warnings:**
-- Already set to 22pt in style file
-- Adjust if needed
-
----
-
-For complete documentation, see the "Professional Document Styling" section in SKILL.md
-
diff --git a/skills/treatment-plans/assets/chronic_disease_management_plan.tex b/skills/treatment-plans/assets/chronic_disease_management_plan.tex
deleted file mode 100644
index 73160af5..00000000
--- a/skills/treatment-plans/assets/chronic_disease_management_plan.tex
+++ /dev/null
@@ -1,665 +0,0 @@
-% Chronic Disease Management Plan Template
-% For long-term management of multiple chronic conditions
-% Last updated: 2025
-
-\documentclass[11pt,letterpaper]{article}
-
-% Packages
-\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
-\usepackage{amsmath,amssymb}
-\usepackage[utf8]{inputenc}
-\usepackage{graphicx}
-\usepackage{array}
-\usepackage{longtable}
-\usepackage{booktabs}
-\usepackage{enumitem}
-\usepackage{xcolor}
-\usepackage{fancyhdr}
-\usepackage{lastpage}
-\usepackage{tabularx}
-\usepackage[most]{tcolorbox}
-
-% Header and footer
-\pagestyle{fancy}
-\fancyhf{}
-\lhead{Chronic Disease Management Plan}
-\rhead{Page \thepage\ of \pageref{LastPage}}
-\lfoot{Date Created: \today}
-\rfoot{Confidential Patient Information}
-
-% Title formatting
-\usepackage{titlesec}
-\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
-\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{1em}{}
-
-\begin{document}
-
-% Title
-\begin{center}
-{\Large\bfseries CHRONIC DISEASE MANAGEMENT PLAN}\\[0.5em]
-{\large Comprehensive Long-Term Care Coordination}\\[0.5em]
-\rule{\textwidth}{1pt}
-\end{center}
-
-\vspace{1em}
-
-% ===== TREATMENT PLAN HIGHLIGHTS (Foundation Medicine Model) =====
-\begin{tcolorbox}[colback=orange!5!white,colframe=orange!75!black,title=\textbf{TREATMENT PLAN HIGHLIGHTS},fonttitle=\bfseries\large]
-
-\textbf{Key Diagnoses:} [Primary chronic conditions - e.g., Type 2 Diabetes, CHF (NYHA II), CKD Stage 3]
-
-\vspace{0.3em}
-\textbf{Primary Treatment Goals:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item [Goal 1 - e.g., Maintain HbA1c $<$7.5\% and prevent diabetic complications]
- \item [Goal 2 - e.g., Optimize heart failure management, prevent hospitalizations]
- \item [Goal 3 - e.g., Slow CKD progression, maintain eGFR $>$45 mL/min]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Main Interventions:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Medications:} [Core regimen - e.g., Metformin, Lisinopril, Furosemide, statin therapy]
- \item \textit{Lifestyle:} [Key modifications - e.g., Low-sodium diet, fluid restriction, regular exercise]
- \item \textit{Monitoring:} [Essential tracking - e.g., Daily weights, BP, glucose; quarterly labs]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Timeline:} [Care model - e.g., Monthly visits initially, then quarterly; annual comprehensive review]
-
-\end{tcolorbox}
-
-\vspace{1em}
-
-% ===== SECTION 1: PATIENT INFORMATION =====
-\section*{1. Patient Information and Problem List}
-
-\textbf{HIPAA Notice}: De-identify all protected health information before sharing.
-
-\vspace{0.5em}
-
-\begin{tabularx}{\textwidth}{|l|X|}
-\hline
-\textbf{Patient ID} & [De-identified code, e.g., CDM-001] \\ \hline
-\textbf{Age Range} & [e.g., 60-65 years] \\ \hline
-\textbf{Sex} & [Male/Female/Other] \\ \hline
-\textbf{Date of Plan} & [Month/Year only] \\ \hline
-\textbf{Primary Care Provider} & [Name, MD/DO, Credentials] \\ \hline
-\textbf{Care Coordinator} & [Name, RN/NP/PA, if applicable] \\ \hline
-\textbf{Facility/System} & [Healthcare organization] \\ \hline
-\end{tabularx}
-
-\vspace{1em}
-
-\subsection*{Active Problem List (Prioritized)}
-
-\begin{longtable}{|c|p{4cm}|c|p{3cm}|p{3.5cm}|}
-\hline
-\textbf{\#} & \textbf{Condition} & \textbf{ICD-10} & \textbf{Status} & \textbf{Specialists} \\ \hline
-\endfirsthead
-\hline
-\textbf{\#} & \textbf{Condition} & \textbf{ICD-10} & \textbf{Status} & \textbf{Specialists} \\ \hline
-\endhead
-1 & Type 2 Diabetes Mellitus & E11.65 & Suboptimal control (HbA1c 8.2\%) & Endocrinology \\ \hline
-2 & Chronic Heart Failure (HFrEF) & I50.22 & Stable, NYHA Class II & Cardiology \\ \hline
-3 & Chronic Kidney Disease Stage 3b & N18.31 & Stable, eGFR 38 & Nephrology (as needed) \\ \hline
-4 & Hypertension & I10 & Well-controlled on meds & PCP \\ \hline
-5 & Hyperlipidemia & E78.5 & On statin, LDL at goal & PCP \\ \hline
-6 & Obstructive Sleep Apnea & G47.33 & On CPAP, adherent & Sleep Medicine \\ \hline
-7 & Obesity & E66.9 & BMI 34, stable weight & PCP, Nutrition \\ \hline
-8 & Osteoarthritis, bilateral knees & M17.0 & Managed conservatively & Ortho (prn) \\ \hline
-[Add rows] & & & & \\ \hline
-\end{longtable}
-
-\subsection*{Current Medication List}
-
-\textit{Reconciled as of [Date]. Total: [X] medications}
-
-\begin{longtable}{|p{3cm}|p{2cm}|p{1.8cm}|p{3cm}|p{3.5cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Indication} & \textbf{Prescriber} \\ \hline
-\endfirsthead
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Indication} & \textbf{Prescriber} \\ \hline
-\endhead
-Metformin ER & 1000mg & BID & Diabetes & PCP \\ \hline
-Insulin glargine & 24 units & QHS & Diabetes & Endocrinology \\ \hline
-Carvedilol & 12.5mg & BID & Heart failure, HTN & Cardiology \\ \hline
-Lisinopril & 40mg & Daily & Heart failure, HTN, CKD protection & Cardiology \\ \hline
-Furosemide & 40mg & Daily & Heart failure (diuresis) & Cardiology \\ \hline
-Atorvastatin & 40mg & QHS & Hyperlipidemia, ASCVD prevention & PCP \\ \hline
-Aspirin & 81mg & Daily & ASCVD prevention & PCP \\ \hline
-[Continue list] & & & & \\ \hline
-\end{longtable}
-
-\subsection*{Care Team and Specialists}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Primary Care Provider}: [Name, practice] - Coordinates overall care
- \item \textbf{Cardiology}: [Name] - Heart failure management
- \item \textbf{Endocrinology}: [Name] - Diabetes optimization
- \item \textbf{Nephrology}: [Name if engaged] - CKD monitoring
- \item \textbf{Care Coordinator/Navigator}: [Name] - Appointment coordination, patient education
- \item \textbf{Pharmacist}: [Clinical pharmacist if available] - Medication reconciliation, optimization
- \item \textbf{Registered Dietitian}: [Name] - Medical nutrition therapy
- \item \textbf{Social Worker}: [Name if engaged] - Psychosocial support, resources
-\end{itemize}
-
-% ===== SECTION 2: DISEASE-SPECIFIC ASSESSMENTS =====
-\section*{2. Disease-Specific Assessments and Status}
-
-\subsection*{2.1 Type 2 Diabetes Mellitus}
-
-\textbf{Current Status}: Suboptimal control
-\begin{itemize}[leftmargin=*]
- \item \textbf{HbA1c}: 8.2\% (target $<$7\%)
- \item \textbf{Fasting Glucose}: Average 165 mg/dL (target 80-130)
- \item \textbf{Time in Range}: Approximately 55\% (target $>$70\%)
- \item \textbf{Hypoglycemia}: Infrequent, 1-2 episodes/month (BG 65-70)
- \item \textbf{Duration}: 12 years
- \item \textbf{Complications Screening}:
- \begin{itemize}
- \item Retinopathy: Mild NPDR, followed by ophthalmology
- \item Nephropathy: CKD stage 3b, urine ACR 180 mg/g (albuminuria)
- \item Neuropathy: Mild peripheral neuropathy, no foot ulcers
- \item Cardiovascular: History of heart failure
- \end{itemize}
-\end{itemize}
-
-\subsection*{2.2 Chronic Heart Failure (HFrEF)}
-
-\textbf{Current Status}: Stable, NYHA Class II
-\begin{itemize}[leftmargin=*]
- \item \textbf{Ejection Fraction}: 35\% (reduced, HFrEF)
- \item \textbf{Etiology}: Ischemic cardiomyopathy (prior MI 5 years ago)
- \item \textbf{NYHA Class}: II - Slight limitation, comfortable at rest, symptoms with ordinary activity
- \item \textbf{Symptoms}: Mild dyspnea on exertion, no orthopnea/PND, occasional LE edema
- \item \textbf{Weight}: Stable, patient monitors daily
- \item \textbf{GDMT Status}:
- \begin{itemize}
- \item ACE inhibitor: Lisinopril 40mg daily (at target dose)
- \item Beta-blocker: Carvedilol 12.5mg BID (target 25mg BID - limited by fatigue)
- \item Diuretic: Furosemide 40mg daily
- \item Need to consider: SGLT2 inhibitor (also beneficial for diabetes), ARNI
- \end{itemize}
- \item \textbf{Device Therapy}: No ICD/CRT currently, discussed with cardiology
-\end{itemize}
-
-\subsection*{2.3 Chronic Kidney Disease Stage 3b}
-
-\textbf{Current Status}: Stable
-\begin{itemize}[leftmargin=*]
- \item \textbf{eGFR}: 38 mL/min/1.73m² (Stage 3b, moderate-severe decrease)
- \item \textbf{Creatinine}: 1.8 mg/dL (stable)
- \item \textbf{Urine Albumin}: ACR 180 mg/g (albuminuria, from diabetes)
- \item \textbf{Etiology}: Diabetic nephropathy, hypertensive nephropathy
- \item \textbf{Progression Risk}: Moderate-high (diabetes, albuminuria)
- \item \textbf{Complications}: Anemia (Hgb 11.2), managed with iron supplementation
- \item \textbf{Renal Protection}: ACE inhibitor, BP control, glucose control, limit nephrotoxins
-\end{itemize}
-
-\subsection*{2.4 Additional Conditions Summary}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Hypertension}: Well-controlled, average home BP 128/78 mmHg
- \item \textbf{Hyperlipidemia}: LDL 65 mg/dL (at goal $<$70 for ASCVD), on statin
- \item \textbf{Obstructive Sleep Apnea}: On CPAP nightly, AHI reduced from 32 to 4, good adherence
- \item \textbf{Obesity}: BMI 34, weight stable, difficulty with weight loss due to HF exercise limitations
- \item \textbf{Osteoarthritis}: Bilateral knee pain, managed with acetaminophen, PT, avoid NSAIDs (CKD)
-\end{itemize}
-
-% ===== SECTION 3: INTEGRATED GOALS =====
-\section*{3. Integrated Treatment Goals (SMART Format)}
-
-\subsection*{3.1 Short-Term Goals (3-6 months)}
-
-\textbf{Diabetes Goals}:
-\begin{enumerate}[leftmargin=*]
- \item Reduce HbA1c from 8.2\% to $<$7.5\% within 3 months by optimizing insulin dosing and medication adherence.
- \item Improve fasting glucose to 100-140 mg/dL range through medication adjustment and dietary changes within 3 months.
- \item Complete annual diabetic eye exam and foot exam within 1 month.
-\end{enumerate}
-
-\textbf{Heart Failure Goals}:
-\begin{enumerate}[leftmargin=*]
- \item Maintain NYHA Class II status (no worsening) with daily weight monitoring and adherence to fluid/sodium restrictions.
- \item Add SGLT2 inhibitor for dual diabetes and heart failure benefit within 1 month.
- \item Improve exercise tolerance: Walk 15 minutes daily without dyspnea within 3 months.
-\end{enumerate}
-
-\textbf{CKD Goals}:
-\begin{enumerate}[leftmargin=*]
- \item Maintain eGFR stability ($\pm$5 mL/min from baseline 38) over 6 months.
- \item Reduce urine albumin-to-creatinine ratio from 180 to $<$100 mg/g with BP and glucose control.
- \item Avoid nephrotoxic agents (NSAIDs, contrast without prophylaxis).
-\end{enumerate}
-
-\textbf{Cross-Cutting Goals}:
-\begin{enumerate}[leftmargin=*]
- \item Medication adherence $>$90\% measured by refill rates and pill counts within 3 months.
- \item Weight loss of 5\% body weight (10 lbs) through diet modification within 6 months.
- \item Blood pressure maintenance at $<$130/80 mmHg (home average).
-\end{enumerate}
-
-\subsection*{3.2 Long-Term Goals (6-12 months)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Diabetes}: Achieve HbA1c $<$7\% and prevent progression of microvascular complications.
- \item \textbf{Heart Failure}: Optimize GDMT, prevent hospitalizations, maintain functional status.
- \item \textbf{CKD}: Slow progression (goal: $<$2 mL/min/year eGFR decline), delay need for dialysis.
- \item \textbf{Quality of Life}: Maintain independence in ADLs, engage in meaningful activities (gardening, grandchildren visits).
- \item \textbf{Prevention}: Up-to-date with all preventive care (vaccinations, cancer screenings).
- \item \textbf{Coordination}: Seamless care transitions, all providers aware of care plan, no conflicting treatments.
-\end{enumerate}
-
-\subsection*{3.3 Patient-Centered Priorities}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Priority 1}: "I don't want to end up on dialysis like my brother"
- \item \textbf{Priority 2}: "I want to keep up with my grandkids"
- \item \textbf{Priority 3}: "I want to reduce my medications if possible" (pill burden concern)
- \item \textbf{Priority 4}: "I want to avoid being hospitalized again"
-\end{itemize}
-
-% ===== SECTION 4: COMPREHENSIVE INTERVENTIONS =====
-\section*{4. Comprehensive Interventions}
-
-\subsection*{4.1 Medication Management and Optimization}
-
-\textbf{Current Regimen Optimization}:
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{ADD: Empagliflozin (Jardiance) 10mg daily}
- \begin{itemize}
- \item \textit{Rationale}: SGLT2 inhibitor provides dual benefit - improves diabetes control AND reduces HF hospitalizations/mortality (EMPEROR-Reduced trial). Also slows CKD progression.
- \item \textit{Monitoring}: eGFR (hold if $<$20), volume status, UTI symptoms, DKA risk (low in T2DM)
- \item \textit{Expected benefit}: HbA1c reduction 0.5-0.8\%, reduced HF events 25-30\%
- \end{itemize}
-
- \item \textbf{TITRATE: Insulin glargine}
- \begin{itemize}
- \item \textit{Current}: 24 units QHS, fasting BG averaging 165
- \item \textit{Plan}: Increase by 2 units every 3 days until fasting BG 100-130, patient to self-titrate with daily phone/portal check-ins
- \item \textit{Expected dose}: Likely 30-36 units
- \end{itemize}
-
- \item \textbf{OPTIMIZE: Beta-blocker (carvedilol)}
- \begin{itemize}
- \item \textit{Current}: 12.5mg BID (patient reports fatigue at higher doses)
- \item \textit{Plan}: Trial slow up-titration to 18.75mg BID, monitor for tolerance
- \item \textit{Goal}: Target dose 25mg BID for HFrEF mortality benefit
- \item \textit{Alternative}: Consider switching to different beta-blocker if intolerable
- \end{itemize}
-
- \item \textbf{CONTINUE}: ACE inhibitor (lisinopril 40mg) - at target dose
-
- \item \textbf{CONSIDER FUTURE}: Sacubitril/valsartan (Entresto) to replace lisinopril if HF symptoms progress
-\end{enumerate}
-
-\textbf{Medication Safety}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Polypharmacy Review}: Current medication count [X], review quarterly for deprescribing opportunities
- \item \textbf{Renal Dosing}: All medications reviewed for CKD Stage 3b, adjust as needed
- \item \textbf{Drug Interactions}: Monitor K+ with ACE + diuretic, avoid NSAIDs (CKD, HF)
- \item \textbf{Adherence Support}: Pill organizer, medication list wallet card, automatic refills, pharmacy synchronization
-\end{itemize}
-
-\subsection*{4.2 Lifestyle and Self-Management Interventions}
-
-\textbf{Dietary Management}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Diabetes}:
- \begin{itemize}
- \item Carbohydrate consistency: 45-60g per meal
- \item Mediterranean diet pattern
- \item Limit refined sugars and processed carbohydrates
- \end{itemize}
- \item \textbf{Heart Failure}:
- \begin{itemize}
- \item Sodium restriction: $<$2000mg daily (low-sodium products, avoid processed foods)
- \item Fluid restriction: 1.5-2L daily if needed for volume management
- \end{itemize}
- \item \textbf{CKD}:
- \begin{itemize}
- \item Moderate protein intake: 0.8-1.0 g/kg/day
- \item Phosphorus and potassium awareness (but not severely restricted at Stage 3b)
- \end{itemize}
- \item \textbf{Weight Loss}: 500 kcal/day deficit for gradual weight loss
- \item \textbf{Referral}: Registered dietitian for medical nutrition therapy
-\end{itemize}
-
-\textbf{Physical Activity}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Goal}: 150 min/week moderate activity (walking, swimming)
- \item \textbf{Heart Failure Considerations}: Start with 10-15 min sessions, gradually increase, monitor symptoms
- \item \textbf{Diabetes Benefits}: Improves insulin sensitivity, glucose control
- \item \textbf{Cardiac Rehabilitation}: Consider referral if not previously completed
- \item \textbf{Progression}: Track with pedometer/activity tracker, goal 7000-10,000 steps daily
-\end{itemize}
-
-\textbf{Self-Monitoring}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Daily}:
- \begin{itemize}
- \item Weight (same time, same scale) - report gain $>$2-3 lbs in 2 days
- \item Blood glucose: Fasting and pre-dinner
- \item Blood pressure: Morning and evening
- \end{itemize}
- \item \textbf{Weekly}:
- \begin{itemize}
- \item Symptom check (dyspnea, edema, chest pain, hypoglycemia frequency)
- \item Medication adherence review
- \end{itemize}
- \item \textbf{Recording}: Use logbook or smartphone app (MyChart, Apple Health)
-\end{itemize}
-
-\textbf{Other Lifestyle Factors}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{CPAP Adherence}: Continue nightly use, download compliance data quarterly
- \item \textbf{Smoking}: [If applicable - cessation interventions]
- \item \textbf{Alcohol}: Limit to $\leq$1 drink/day (heart failure, diabetes management)
- \item \textbf{Stress Management}: Mindfulness, adequate sleep, social engagement
-\end{itemize}
-
-\subsection*{4.3 Disease-Specific Monitoring and Screening}
-
-\textbf{Diabetes Monitoring}:
-\begin{itemize}[leftmargin=*]
- \item HbA1c every 3 months until at goal, then every 6 months
- \item Lipid panel annually
- \item Urine albumin-to-creatinine ratio annually
- \item Comprehensive foot exam every visit, monofilament testing annually
- \item Dilated eye exam annually (ophthalmology)
- \item Dental exam every 6 months (periodontal disease link)
-\end{itemize}
-
-\textbf{Heart Failure Monitoring}:
-\begin{itemize}[leftmargin=*]
- \item Daily weights, report significant changes
- \item BNP or NT-proBNP when symptoms change
- \item Echocardiogram annually or if clinical change
- \item EKG annually
- \item Functional assessment (6-minute walk test) periodically
-\end{itemize}
-
-\textbf{CKD Monitoring}:
-\begin{itemize}[leftmargin=*]
- \item eGFR and creatinine every 3-6 months
- \item Urine ACR annually
- \item CBC (anemia), CMP (electrolytes, calcium, phosphorus) every 6 months
- \item Vitamin D, PTH if indicated
- \item Bone density scan (increased fracture risk)
-\end{itemize}
-
-\textbf{Preventive Care}:
-\begin{itemize}[leftmargin=*]
- \item Influenza vaccine annually
- \item Pneumococcal vaccines (PCV20 or PCV15+PPSV23) per ACIP guidelines
- \item COVID-19 vaccination per current recommendations
- \item Zoster vaccine (Shingrix)
- \item Colorectal cancer screening per age guidelines
- \item [Other age/sex-appropriate screenings]
-\end{itemize}
-
-% ===== SECTION 5: CARE COORDINATION =====
-\section*{5. Care Coordination and Communication}
-
-\subsection*{Provider Communication Plan}
-
-\begin{tabularx}{\textwidth}{|l|X|X|}
-\hline
-\textbf{Provider} & \textbf{Visit Frequency} & \textbf{Communication/Coordination} \\ \hline
-Primary Care & Every 3 months & Care plan coordinator, medication reconciliation, preventive care \\ \hline
-Cardiology & Every 4-6 months & HF medication optimization, EF monitoring, device consideration \\ \hline
-Endocrinology & Every 3-4 months & Diabetes management, insulin titration, complications screening \\ \hline
-Nephrology & As needed (if eGFR $<$30 or rapid decline) & CKD management, dialysis planning if needed \\ \hline
-Dietitian & Monthly x3, then quarterly & Nutrition counseling, meal planning \\ \hline
-Pharmacist & Quarterly & Medication review, adherence counseling, cost optimization \\ \hline
-Care Coordinator & Monthly phone check-in & Appointment scheduling, barrier identification, education \\ \hline
-\end{tabularx}
-
-\subsection*{Information Sharing}
-
-\begin{itemize}[leftmargin=*]
- \item Shared EHR access for all providers in health system
- \item Medication reconciliation after each specialist visit
- \item Lab results shared via patient portal and provider notifications
- \item Care plan accessible to all team members
- \item Patient carries medication list and problem list
-\end{itemize}
-
-\subsection*{Care Transitions Management}
-
-\textbf{Hospital Discharge Protocol}:
-\begin{itemize}[leftmargin=*]
- \item PCP notified within 24 hours of admission and discharge
- \item Follow-up appointment within 7 days of discharge
- \item Medication reconciliation at discharge and first follow-up
- \item Red flags review: HF exacerbation signs, hyperglycemia, AKI
-\end{itemize}
-
-\textbf{Specialty Referral Coordination}:
-\begin{itemize}[leftmargin=*]
- \item Care coordinator ensures specialist appointments scheduled
- \item Specialist notes reviewed by PCP within 1 week
- \item Treatment recommendations integrated into care plan
- \item Conflicting recommendations discussed among providers
-\end{itemize}
-
-% ===== SECTION 6: MONITORING AND OUTCOMES =====
-\section*{6. Monitoring Parameters and Quality Measures}
-
-\subsection*{Clinical Outcomes Dashboard}
-
-\begin{longtable}{|p{3.5cm}|p{2.5cm}|p{2cm}|p{2cm}|p{3cm}|}
-\hline
-\textbf{Parameter} & \textbf{Baseline} & \textbf{Target} & \textbf{Current} & \textbf{Frequency} \\ \hline
-\endfirsthead
-\hline
-\textbf{Parameter} & \textbf{Baseline} & \textbf{Target} & \textbf{Current} & \textbf{Frequency} \\ \hline
-\endhead
-HbA1c & 8.2\% & $<$7\% & [update] & Q3-6 months \\ \hline
-Fasting Glucose & 165 mg/dL & 100-130 & [update] & Daily (patient), labs Q3mo \\ \hline
-Blood Pressure & 142/86 & $<$130/80 & [update] & Daily (patient), each visit \\ \hline
-LDL Cholesterol & 65 mg/dL & $<$70 & At goal & Annually \\ \hline
-eGFR & 38 mL/min & Stable ($\pm$5) & [update] & Every 3-6 months \\ \hline
-Urine ACR & 180 mg/g & $<$100 & [update] & Annually \\ \hline
-Weight & [baseline] lbs & -10 lbs (5\%) & [update] & Daily (patient), each visit \\ \hline
-BNP/NT-proBNP & [if available] & Stable & [update] & When symptomatic \\ \hline
-Ejection Fraction & 35\% & Monitor & [date of last echo] & Annually or if change \\ \hline
-\end{longtable}
-
-\subsection*{Quality Measure Tracking (HEDIS/CMS)}
-
-\begin{itemize}[leftmargin=*]
- \item ✓ Diabetes HbA1c testing (every 6 months)
- \item ☐ Diabetes HbA1c control ($<$8\%) - \textit{Target: achieve}
- \item ✓ Diabetes eye exam (annual dilated)
- \item ☐ Diabetes medical attention for nephropathy (urine ACR) - \textit{Due [month]}
- \item ✓ Blood pressure control ($<$140/90 for diabetes)
- \item ✓ Statin therapy for ASCVD
- \item ✓ ACE/ARB therapy for diabetes with hypertension
- \item ✓ Beta-blocker for HFrEF
- \item ☐ Flu vaccine current year - \textit{Due [month]}
- \item ✓ Pneumococcal vaccine
-\end{itemize}
-
-% ===== SECTION 7: PATIENT EDUCATION AND ACTIVATION =====
-\section*{7. Patient Education and Self-Management Support}
-
-\subsection*{Disease Education Completed}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Diabetes}: Pathophysiology, complications, importance of glucose control, hypoglycemia recognition
- \item \textbf{Heart Failure}: How heart failure affects body, medication importance, fluid/sodium restrictions, warning signs
- \item \textbf{CKD}: Kidney function, progression risk, renal protection strategies, medication precautions
- \item \textbf{Medication Purposes}: Why each medication is prescribed, expected benefits
- \item \textbf{Lifestyle Impact}: How diet, exercise, weight loss benefit all conditions
-\end{itemize}
-
-\subsection*{Self-Management Skills Training}
-
-\begin{itemize}[leftmargin=*]
- \item ✓ Blood glucose monitoring technique
- \item ✓ Insulin injection technique and storage
- \item ✓ Home blood pressure monitoring
- \item ✓ Daily weight tracking and interpretation
- \item ✓ Symptom recognition (HF exacerbation, hypoglycemia, hyperglycemia)
- \item ✓ Medication organization (pill box use)
- \item ☐ Dietary skills: Carb counting, label reading, low-sodium food selection
- \item ☐ Sick day management (when to call, medication adjustments)
-\end{itemize}
-
-\subsection*{Warning Signs - When to Call Provider}
-
-\textbf{Call office same day or go to ED if}:
-\begin{itemize}[leftmargin=*]
- \item Weight gain $>$2-3 lbs in 2 days or 5 lbs in 1 week (heart failure)
- \item Increased shortness of breath, cannot lie flat, new leg swelling
- \item Chest pain or pressure
- \item Blood glucose consistently $>$300 or $<$60 mg/dL
- \item Decreased urine output, dark urine, swelling
- \item Dizziness, lightheadedness, syncope
-\end{itemize}
-
-\subsection*{Resources and Support}
-
-\begin{itemize}[leftmargin=*]
- \item Diabetes self-management education program (DSMES)
- \item Cardiac rehabilitation program
- \item Patient portal for lab results, messaging, educational materials
- \item American Diabetes Association (diabetes.org) resources
- \item American Heart Association (heart.org) HF information
- \item National Kidney Foundation (kidney.org) CKD education
- \item Local support groups [if available]
-\end{itemize}
-
-% ===== SECTION 8: CONTINGENCY PLANNING =====
-\section*{8. Contingency Planning and Risk Mitigation}
-
-\subsection*{Hospital Readmission Prevention}
-
-\textbf{High-Risk Period}: 30 days post-discharge
-
-\textbf{Prevention Strategies}:
-\begin{itemize}[leftmargin=*]
- \item Early follow-up appointment (within 7 days)
- \item Medication reconciliation and adherence check
- \item Symptom monitoring escalation
- \item Care coordinator phone call within 48 hours of discharge
- \item Access to nurse advice line 24/7
-\end{itemize}
-
-\subsection*{Disease Progression Planning}
-
-\textbf{If CKD progresses to Stage 4-5}:
-\begin{itemize}[leftmargin=*]
- \item Nephrology referral for CKD education and dialysis planning
- \item Vascular access planning if eGFR $<$20
- \item Medication adjustments for reduced renal clearance
- \item Anemia management optimization (ESA if needed)
- \item Advance care planning discussions
-\end{itemize}
-
-\textbf{If HF worsens to NYHA Class III-IV}:
-\begin{itemize}[leftmargin=*]
- \item Consider ICD/CRT device evaluation
- \item Advanced therapies discussion (LVAD, transplant evaluation if appropriate)
- \item Palliative care consultation for symptom management
- \item Home health nursing for weight/symptom monitoring
-\end{itemize}
-
-\subsection*{Advance Care Planning}
-
-\begin{itemize}[leftmargin=*]
- \item Goals of care discussion: [Patient preferences documented]
- \item Healthcare proxy: [Name, relationship] designated
- \item Advance directive: ☐ Completed / ☐ To complete
- \item CPR preferences: [Discussed, documented in chart]
- \item Dialysis preferences: Patient expresses desire to avoid if possible
-\end{itemize}
-
-% ===== SECTION 9: FOLLOW-UP SCHEDULE =====
-\section*{9. Follow-Up and Reassessment Schedule}
-
-\subsection*{Appointment Calendar}
-
-\begin{longtable}{|l|l|p{7cm}|}
-\hline
-\textbf{Timeframe} & \textbf{Provider} & \textbf{Purpose} \\ \hline
-\endfirsthead
-\hline
-\textbf{Timeframe} & \textbf{Provider} & \textbf{Purpose} \\ \hline
-\endhead
-Week 2 & Care Coordinator (phone) & Check medication tolerability, answer questions, reinforce education \\ \hline
-Month 1 & PCP & Add empagliflozin, assess insulin titration, review home monitoring logs \\ \hline
-Month 2 & Dietitian & Nutrition counseling, meal planning, sodium/carb education \\ \hline
-Month 3 & PCP & HbA1c check, labs (CMP, lipids), medication review, preventive care update \\ \hline
-Month 3-4 & Cardiology & HF assessment, beta-blocker titration, consider ARNI \\ \hline
-Month 3-4 & Endocrinology & Diabetes management review, complications screening \\ \hline
-Month 6 & PCP & Comprehensive reassessment, all labs, update care plan, goal review \\ \hline
-Ongoing & Quarterly PCP & Chronic disease management visits \\ \hline
-\end{longtable}
-
-\subsection*{Plan Reassessment}
-
-This care plan will be formally reassessed and updated:
-\begin{itemize}[leftmargin=*]
- \item Every 6 months (routine)
- \item After hospitalization or ED visit
- \item With significant change in clinical status
- \item When new diagnoses are added
- \item When treatment goals are achieved or modified
- \item At patient or provider request
-\end{itemize}
-
-% ===== SECTION 10: SIGNATURES =====
-\vspace{2em}
-
-\section*{10. Provider Signature and Attestation}
-
-This comprehensive chronic disease management plan has been reviewed with the patient. The patient demonstrates understanding of all chronic conditions, treatment goals, medications, lifestyle recommendations, self-monitoring requirements, warning signs, and when to seek care. Patient's values and preferences have been incorporated through shared decision-making.
-
-\vspace{1em}
-
-\begin{tabular}{ll}
-Provider Signature: & \rule{7cm}{0.5pt} \\[1em]
-Provider Name/Credentials: & \rule{7cm}{0.5pt} \\[1em]
-Date: & \rule{4cm}{0.5pt} \\[2em]
-\end{tabular}
-
-\subsection*{Care Team Acknowledgment (Optional)}
-
-Care team members have reviewed this integrated care plan and will coordinate care accordingly.
-
-\vspace{0.5em}
-
-\textit{[Additional signature lines for cardiologist, endocrinologist, care coordinator as appropriate]}
-
-\vspace{2em}
-\begin{center}
-\rule{\textwidth}{1pt}\\
-\textbf{End of Chronic Disease Management Plan}\\
-This document contains confidential patient information protected by HIPAA.
-\end{center}
-
-\end{document}
-
-% ========== NOTES FOR USERS ==========
-%
-% KEY FEATURES:
-% - Integrates multiple chronic conditions into unified plan
-% - Addresses medication interactions and contraindications across conditions
-% - Coordinates care across multiple specialistsUtilizes shared goals when conditions overlap (e.g., SGLT2i for DM + HF + CKD)
-% - Emphasizes patient self-management and activation
-% - Tracks quality measures and outcomes
-%
-% CUSTOMIZATION:
-% - Adjust problem list based on patient's specific conditions
-% - Modify goals for disease severity and patient capabilities
-% - Adapt medication regimen to formulary and patient tolerance
-% - Coordinate specialist involvement based on availability and need
-%
-% COMPILATION:
-% pdflatex chronic_disease_management_plan.tex
-
diff --git a/skills/treatment-plans/assets/clinician_authored_intervention_template.json b/skills/treatment-plans/assets/clinician_authored_intervention_template.json
new file mode 100644
index 00000000..2ba2e048
--- /dev/null
+++ b/skills/treatment-plans/assets/clinician_authored_intervention_template.json
@@ -0,0 +1,11 @@
+{
+ "schema_version": "2.0",
+ "document_type": "clinician_authored_intervention_record",
+ "document_id": "INTERVENTIONS-TEMPLATE",
+ "subject_ref": "SYNTHETIC-CASE-001",
+ "data_classification": "synthetic",
+ "status": "DRAFT_NOT_FOR_CLINICAL_USE",
+ "notice": "DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED",
+ "created_at": null,
+ "interventions": []
+}
diff --git a/skills/treatment-plans/assets/general_medical_treatment_plan.tex b/skills/treatment-plans/assets/general_medical_treatment_plan.tex
deleted file mode 100644
index dc4d0cee..00000000
--- a/skills/treatment-plans/assets/general_medical_treatment_plan.tex
+++ /dev/null
@@ -1,547 +0,0 @@
-% General Medical Treatment Plan Template
-% For primary care and chronic disease management
-% Last updated: 2025
-
-\documentclass[11pt,letterpaper]{article}
-
-% Packages
-\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
-\usepackage{amsmath,amssymb}
-\usepackage[utf8]{inputenc}
-\usepackage{graphicx}
-\usepackage{array}
-\usepackage{longtable}
-\usepackage{booktabs}
-\usepackage{enumitem}
-\usepackage{xcolor}
-\usepackage{fancyhdr}
-\usepackage{lastpage}
-\usepackage{tabularx}
-\usepackage[most]{tcolorbox}
-
-% Header and footer
-\pagestyle{fancy}
-\fancyhf{}
-\lhead{General Medical Treatment Plan}
-\rhead{Page \thepage\ of \pageref{LastPage}}
-\lfoot{Date Created: \today}
-\rfoot{Confidential Patient Information}
-
-% Title formatting
-\usepackage{titlesec}
-\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
-\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{1em}{}
-
-\begin{document}
-
-% Title
-\begin{center}
-{\Large\bfseries MEDICAL TREATMENT PLAN}\\[0.5em]
-{\large General Medicine \& Chronic Disease Management}\\[0.5em]
-\rule{\textwidth}{1pt}
-\end{center}
-
-\vspace{1em}
-
-% ===== TREATMENT PLAN HIGHLIGHTS (Foundation Medicine Model) =====
-\begin{tcolorbox}[colback=blue!5!white,colframe=blue!75!black,title=\textbf{TREATMENT PLAN HIGHLIGHTS},fonttitle=\bfseries\large]
-
-\textbf{Key Diagnosis:} [Primary diagnosis with ICD-10 code, severity/stage]
-
-\vspace{0.3em}
-\textbf{Primary Treatment Goals:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item [Goal 1 - e.g., Reduce HbA1c from 8.5\% to $<$7\% within 3 months]
- \item [Goal 2 - e.g., Achieve blood pressure $<$130/80 mmHg within 8 weeks]
- \item [Goal 3 - e.g., Weight loss of 7-10\% body weight over 6 months]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Main Interventions:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Pharmacological:} [Key medications - e.g., Metformin 1000mg BID, Lisinopril 10mg daily]
- \item \textit{Non-pharmacological:} [Lifestyle modifications - e.g., Mediterranean diet, 150 min/week exercise]
- \item \textit{Monitoring:} [Key parameters - e.g., HbA1c every 3 months, home BP daily]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Timeline:} [Duration - e.g., Intensive initiation (4 weeks), Adjustment phase (8 weeks), Maintenance (ongoing)]
-
-\end{tcolorbox}
-
-\vspace{1em}
-
-% ===== SECTION 1: PATIENT INFORMATION =====
-\section*{1. Patient Information}
-
-\textbf{HIPAA Notice}: All identifiable information must be removed or de-identified per Safe Harbor method before sharing this document. Remove: name, dates (except year), addresses, phone/fax, email, SSN, medical record numbers, account numbers, photos, and other unique identifiers.
-
-\vspace{0.5em}
-
-\begin{tabularx}{\textwidth}{|l|X|}
-\hline
-\textbf{Patient ID} & [De-identified code, e.g., PT-001] \\ \hline
-\textbf{Age Range} & [e.g., 55-60 years] \\ \hline
-\textbf{Sex} & [Male/Female/Other] \\ \hline
-\textbf{Race/Ethnicity} & [If relevant to treatment] \\ \hline
-\textbf{Date of Plan} & [Month/Year only] \\ \hline
-\textbf{Provider} & [Name, MD/DO/NP/PA, Credentials] \\ \hline
-\textbf{Facility} & [Healthcare facility name] \\ \hline
-\end{tabularx}
-
-\vspace{1em}
-
-\subsection*{Active Medical Conditions}
-\begin{itemize}[leftmargin=*]
- \item \textbf{Primary Diagnosis}: [Condition with ICD-10 code]
- \item \textbf{Secondary Diagnoses}:
- \begin{itemize}
- \item [Comorbidity 1 with ICD-10 code]
- \item [Comorbidity 2 with ICD-10 code]
- \item [Additional conditions as needed]
- \end{itemize}
-\end{itemize}
-
-\subsection*{Current Medications}
-\begin{longtable}{|p{3.5cm}|p{2cm}|p{2cm}|p{5cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Indication} \\ \hline
-\endfirsthead
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Indication} \\ \hline
-\endhead
-Medication 1 & [e.g., 10mg] & [e.g., daily] & [Indication] \\ \hline
-Medication 2 & [e.g., 50mg] & [e.g., BID] & [Indication] \\ \hline
-[Add rows as needed] & & & \\ \hline
-\end{longtable}
-
-\subsection*{Allergies}
-\begin{itemize}[leftmargin=*]
- \item \textbf{Drug Allergies}: [List medications and reactions, or NKDA]
- \item \textbf{Food/Environmental}: [If relevant to treatment]
-\end{itemize}
-
-\subsection*{Baseline Assessment}
-\begin{itemize}[leftmargin=*]
- \item \textbf{Functional Status}: [Independent/requires assistance/dependent for ADLs]
- \item \textbf{Cognitive Status}: [Alert and oriented/impairment if present]
- \item \textbf{Social Support}: [Lives alone/with family, support system]
- \item \textbf{Key Baseline Values}: [e.g., HbA1c 8.5\%, BP 145/90, BMI 32, eGFR 55]
-\end{itemize}
-
-% ===== SECTION 2: DIAGNOSIS AND ASSESSMENT =====
-\section*{2. Diagnosis and Assessment Summary}
-
-\subsection*{Primary Diagnosis}
-\textbf{Diagnosis}: [Full diagnosis name]\\
-\textbf{ICD-10 Code}: [e.g., E11.9 for Type 2 Diabetes Mellitus without complications]\\
-\textbf{Severity}: [Mild/Moderate/Severe or stage classification]\\
-\textbf{Duration}: [Time since diagnosis]
-
-\subsection*{Clinical Presentation}
-[Describe current symptoms, functional limitations, and impact on quality of life. Include relevant exam findings and diagnostic test results.]
-
-\subsection*{Risk Stratification}
-\begin{itemize}[leftmargin=*]
- \item \textbf{Cardiovascular Risk}: [e.g., ASCVD 10-year risk 15\%]
- \item \textbf{Complications Risk}: [e.g., high risk for diabetic nephropathy]
- \item \textbf{Other Risk Factors}: [e.g., fall risk, frailty, polypharmacy]
-\end{itemize}
-
-\subsection*{Prognostic Considerations}
-[Discuss expected disease course, factors affecting prognosis, and rationale for treatment intensity.]
-
-% ===== SECTION 3: TREATMENT GOALS =====
-\section*{3. Treatment Goals (SMART Format)}
-
-\textbf{SMART Criteria}: All goals should be \textbf{S}pecific, \textbf{M}easurable, \textbf{A}chievable, \textbf{R}elevant, and \textbf{T}ime-bound.
-
-\subsection*{Short-Term Goals (1-3 months)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Goal 1}: [e.g., Reduce HbA1c from 8.5\% to $<$7.5\%]
- \begin{itemize}
- \item \textit{Specific}: Reduce HbA1c by at least 1 percentage point
- \item \textit{Measurable}: HbA1c lab value
- \item \textit{Achievable}: With medication initiation and lifestyle changes
- \item \textit{Relevant}: Reduce microvascular complication risk
- \item \textit{Time-bound}: Achieve within 3 months (next follow-up)
- \end{itemize}
-
- \item \textbf{Goal 2}: [e.g., Decrease systolic blood pressure to $<$130 mmHg]
- \begin{itemize}
- \item \textit{Specific}: Achieve BP $<$130/80 mmHg
- \item \textit{Measurable}: Office and home BP measurements
- \item \textit{Achievable}: With medication optimization
- \item \textit{Relevant}: Reduce cardiovascular event risk
- \item \textit{Time-bound}: Within 8 weeks
- \end{itemize}
-
- \item \textbf{Goal 3}: [Additional short-term goal]
-\end{enumerate}
-
-\subsection*{Long-Term Goals (6-12 months)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Goal 1}: [e.g., Maintain HbA1c $<$7\% and prevent diabetic complications]
- \begin{itemize}
- \item \textit{Success criteria}: HbA1c $<$7\%, no new retinopathy/nephropathy/neuropathy
- \item \textit{Timeline}: Ongoing, assessed every 3-6 months
- \end{itemize}
-
- \item \textbf{Goal 2}: [e.g., Weight loss of 15 pounds (7\% body weight)]
- \begin{itemize}
- \item \textit{Success criteria}: BMI reduction from 32 to $<$30
- \item \textit{Timeline}: 6-12 months at 1-2 lbs/week
- \end{itemize}
-
- \item \textbf{Goal 3}: [e.g., Achieve LDL cholesterol $<$70 mg/dL]
-
- \item \textbf{Goal 4}: [Additional long-term goal as needed]
-\end{enumerate}
-
-\subsection*{Patient-Centered Goals}
-\begin{itemize}[leftmargin=*]
- \item \textbf{Patient Priority 1}: [e.g., "Feel more energetic throughout the day"]
- \item \textbf{Patient Priority 2}: [e.g., "Avoid insulin injections if possible"]
- \item \textbf{Patient Priority 3}: [e.g., "Continue working full-time"]
-\end{itemize}
-
-% ===== SECTION 4: INTERVENTIONS =====
-\section*{4. Interventions}
-
-\subsection*{4.1 Pharmacological Interventions}
-
-\begin{longtable}{|p{3cm}|p{2cm}|p{2cm}|p{6.5cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Instructions \& Rationale} \\ \hline
-\endfirsthead
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Instructions \& Rationale} \\ \hline
-\endhead
-
-[e.g., Metformin] & 500mg & BID & \textbf{Start:} Take with meals to reduce GI upset. \textbf{Titration:} Increase to 1000mg BID after 2 weeks if tolerated. \textbf{Target:} 2000mg daily. \textbf{Rationale:} First-line for T2DM, reduces hepatic glucose production. \\ \hline
-
-[e.g., Lisinopril] & 10mg & Daily & \textbf{Instructions:} Take in morning. Monitor BP at home. \textbf{Titration:} May increase to 20mg if BP not at goal in 4 weeks. \textbf{Rationale:} ACE inhibitor for HTN and renal protection in diabetes. \\ \hline
-
-[Additional medications] & & & \\ \hline
-\end{longtable}
-
-\textbf{Medication Safety Considerations}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Drug Interactions}: [List relevant interactions to monitor]
- \item \textbf{Adverse Effects to Monitor}: [e.g., metformin - GI upset, lactic acidosis; lisinopril - cough, hyperkalemia, angioedema]
- \item \textbf{Contraindications}: [e.g., metformin if eGFR $<$30]
- \item \textbf{Pregnancy Category}: [If relevant to patient]
-\end{itemize}
-
-\subsection*{4.2 Non-Pharmacological Interventions}
-
-\textbf{Lifestyle Modifications}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Diet}:
- \begin{itemize}
- \item Mediterranean or DASH diet pattern
- \item Carbohydrate counting: 45-60g per meal
- \item Reduce saturated fat $<$7\% of calories
- \item Sodium restriction $<$2300mg daily
- \item Referral to registered dietitian
- \end{itemize}
-
- \item \textbf{Exercise}:
- \begin{itemize}
- \item Aerobic exercise: 150 minutes/week moderate intensity (e.g., brisk walking 30 min 5x/week)
- \item Resistance training: 2-3 sessions/week
- \item Reduce sedentary time, stand/move every 30 minutes
- \end{itemize}
-
- \item \textbf{Smoking Cessation}: [If applicable]
- \begin{itemize}
- \item Nicotine replacement therapy (patch, gum, lozenge)
- \item Consider varenicline or bupropion
- \item Behavioral counseling: 1-800-QUIT-NOW
- \item Target quit date: [specific date within 1 month]
- \end{itemize}
-
- \item \textbf{Weight Management}:
- \begin{itemize}
- \item Target: 7-10\% body weight loss over 6 months
- \item Caloric deficit: 500-750 kcal/day
- \item Weekly self-weighing and food diary
- \item Consider weight loss program or app
- \end{itemize}
-
- \item \textbf{Sleep Hygiene}:
- \begin{itemize}
- \item Target 7-9 hours nightly
- \item Consistent sleep schedule
- \item Screen for sleep apnea if indicated
- \end{itemize}
-
- \item \textbf{Stress Management}:
- \begin{itemize}
- \item Mindfulness or meditation practice
- \item Stress reduction techniques
- \item Adequate social support
- \end{itemize}
-\end{itemize}
-
-\textbf{Self-Management and Monitoring}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Blood Glucose Monitoring}: [Frequency, e.g., fasting and 2hr post-prandial 3x/week]
- \item \textbf{Home Blood Pressure}: [Frequency, e.g., daily in AM, record in log]
- \item \textbf{Weight Tracking}: [e.g., weekly on same day/time]
- \item \textbf{Symptom Diary}: [Track relevant symptoms]
- \item \textbf{Medication Adherence}: [Pill box, reminder app]
-\end{itemize}
-
-\subsection*{4.3 Procedural and Referral Interventions}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Specialist Referrals}:
- \begin{itemize}
- \item [e.g., Endocrinology consultation for diabetes management]
- \item [e.g., Ophthalmology for annual dilated eye exam]
- \item [e.g., Podiatry for diabetic foot exam]
- \item [e.g., Nephrology if eGFR $<$30 or proteinuria]
- \end{itemize}
-
- \item \textbf{Diagnostic Testing Schedule}:
- \begin{itemize}
- \item [e.g., HbA1c every 3 months until at goal, then every 6 months]
- \item [e.g., Lipid panel annually]
- \item [e.g., Urine albumin-to-creatinine ratio annually]
- \item [e.g., Comprehensive metabolic panel every 6 months]
- \end{itemize}
-
- \item \textbf{Preventive Care}:
- \begin{itemize}
- \item Influenza vaccine annually
- \item Pneumococcal vaccines (PCV20 or PCV15+PPSV23)
- \item COVID-19 vaccination per current guidelines
- \item Age-appropriate cancer screenings
- \item [Other preventive measures as indicated]
- \end{itemize}
-\end{itemize}
-
-% ===== SECTION 5: TIMELINE AND SCHEDULE =====
-\section*{5. Timeline and Schedule}
-
-\subsection*{Treatment Phases}
-
-\begin{tabularx}{\textwidth}{|l|X|X|}
-\hline
-\textbf{Phase} & \textbf{Timeframe} & \textbf{Focus} \\ \hline
-Intensive Initiation & Weeks 1-4 & Medication titration, lifestyle education, baseline monitoring \\ \hline
-Adjustment & Weeks 5-12 & Optimize medications, reinforce lifestyle changes, assess goal progress \\ \hline
-Maintenance & Months 4-12 & Sustain improvements, prevent complications, long-term adherence \\ \hline
-Ongoing & $>$12 months & Chronic disease management, annual assessments, update goals \\ \hline
-\end{tabularx}
-
-\subsection*{Appointment Schedule}
-
-\begin{tabularx}{\textwidth}{|l|X|X|}
-\hline
-\textbf{Timepoint} & \textbf{Visit Type} & \textbf{Key Activities} \\ \hline
-Week 2 & Phone/telehealth & Check medication tolerance, answer questions \\ \hline
-Week 4 & Office visit & Medication adjustment, BP check, labs, review monitoring \\ \hline
-Week 8 & Office visit & Assess progress toward goals, reinforce lifestyle \\ \hline
-Month 3 & Office visit & HbA1c, comprehensive assessment, goal evaluation \\ \hline
-Month 6 & Office visit & Reassess all goals, update plan, labs \\ \hline
-Month 12 & Annual exam & Comprehensive evaluation, preventive care, specialty referrals \\ \hline
-Ongoing & Every 3-6 months & Per chronic disease management protocol \\ \hline
-\end{tabularx}
-
-\subsection*{Milestone Assessments}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Month 1}: Medication tolerance, lifestyle initiation, home monitoring established
- \item \textbf{Month 3}: HbA1c $<$7.5\%, BP $<$130/80, 3-5 lb weight loss
- \item \textbf{Month 6}: HbA1c $<$7\%, sustained BP control, 8-10 lb weight loss
- \item \textbf{Month 12}: All long-term goals achieved or revised, complication screening complete
-\end{itemize}
-
-% ===== SECTION 6: MONITORING PARAMETERS =====
-\section*{6. Monitoring Parameters}
-
-\subsection*{Clinical Outcomes to Track}
-
-\begin{longtable}{|p{4cm}|p{3cm}|p{3cm}|p{4cm}|}
-\hline
-\textbf{Parameter} & \textbf{Baseline} & \textbf{Target} & \textbf{Frequency} \\ \hline
-\endfirsthead
-\hline
-\textbf{Parameter} & \textbf{Baseline} & \textbf{Target} & \textbf{Frequency} \\ \hline
-\endhead
-
-HbA1c & [e.g., 8.5\%] & $<$7\% & Every 3 months until stable, then every 6 months \\ \hline
-Fasting Glucose & [e.g., 165 mg/dL] & 80-130 mg/dL & Home monitoring per schedule \\ \hline
-Blood Pressure & [e.g., 145/90] & $<$130/80 mmHg & Daily home, every office visit \\ \hline
-Weight/BMI & [e.g., 210 lb, BMI 32] & 195 lb, BMI $<$30 & Weekly at home, every visit \\ \hline
-LDL Cholesterol & [e.g., 135 mg/dL] & $<$70 mg/dL & Every 6-12 months \\ \hline
-eGFR & [e.g., 55 mL/min] & Stable, $>$45 & Every 6 months \\ \hline
-Urine ACR & [e.g., normal] & $<$30 mg/g & Annually \\ \hline
-[Add additional parameters] & & & \\ \hline
-\end{longtable}
-
-\subsection*{Assessment Tools and Scales}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Diabetes Distress Scale}: [Assess emotional burden of diabetes management]
- \item \textbf{SF-12 or PROMIS}: [Quality of life assessment]
- \item \textbf{Medication Adherence}: [Morisky scale or refill tracking]
- \item \textbf{[Other relevant scales]}: [e.g., PHQ-2 for depression screening]
-\end{itemize}
-
-\subsection*{Safety Monitoring}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Hypoglycemia}: Frequency of blood glucose $<$70 mg/dL, symptoms
- \item \textbf{Medication Adverse Effects}: GI upset, cough, dizziness, other symptoms
- \item \textbf{Hyperkalemia}: Potassium level if on ACE inhibitor/ARB
- \item \textbf{Renal Function}: Monitor eGFR for metformin safety, ACE/ARB effects
-\end{itemize}
-
-\subsection*{Thresholds for Intervention}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Urgent}: Blood glucose $>$300 or $<$50, BP $>$180/110, chest pain, severe symptoms
- \item \textbf{Escalate Treatment}: No improvement in HbA1c after 3 months, BP above goal after 8 weeks
- \item \textbf{Modify Plan}: Intolerable side effects, patient preference change, new comorbidities
-\end{itemize}
-
-% ===== SECTION 7: EXPECTED OUTCOMES =====
-\section*{7. Expected Outcomes and Prognosis}
-
-\textbf{Anticipated Treatment Response}: With adherence, expect HbA1c reduction of 1-1.5\%, BP reduction of 10-15 mmHg, and 5-10\% weight loss over 6 months. Improvements visible at 4-8 weeks (BP, glucose), with HbA1c changes by 3 months.
-
-\vspace{0.5em}
-\textbf{Long-Term Benefits}: Reduced complication risk (cardiovascular events, retinopathy, nephropathy), improved quality of life, maintained independence and functional status.
-
-% ===== SECTION 8: FOLLOW-UP PLAN =====
-\section*{8. Follow-Up Plan}
-
-\subsection*{Scheduled Appointments}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Next Visit}: [Date/timeframe - e.g., 4 weeks from today]
- \item \textbf{Visit Purpose}: [Medication adjustment, lab review, goal assessment]
- \item \textbf{Ongoing Schedule}: See Appointment Schedule in Section 5
-\end{itemize}
-
-\subsection*{Communication Plan}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Between-Visit Contact}: Phone call at 2 weeks to assess medication tolerance
- \item \textbf{Lab Results}: Will call with results within 3-5 business days
- \item \textbf{Questions}: Call office at [phone], patient portal messaging
- \item \textbf{Prescription Refills}: Via patient portal or pharmacy automated refill
-\end{itemize}
-
-\subsection*{Emergency Procedures}
-
-\textbf{Call 911 immediately for}:
-\begin{itemize}[leftmargin=*]
- \item Chest pain, shortness of breath, or stroke symptoms
- \item Severe hypoglycemia with confusion or loss of consciousness
- \item Severe allergic reaction (angioedema, anaphylaxis)
-\end{itemize}
-
-\textbf{Call office same day for}:
-\begin{itemize}[leftmargin=*]
- \item Blood glucose consistently $>$300 or $<$60 mg/dL
- \item Blood pressure $>$180/110 mmHg
- \item Persistent severe medication side effects
- \item Fever, infection, or acute illness (may need medication adjustment)
-\end{itemize}
-
-\subsection*{Transition Planning}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{If Hospitalized}: Provide this treatment plan to hospital team, resume medications on discharge
- \item \textbf{Specialist Co-Management}: Share plan with all specialists, coordinate medication changes
- \item \textbf{Future Considerations}: [e.g., may need insulin if oral medications insufficient]
-\end{itemize}
-
-% ===== SECTION 9: PATIENT EDUCATION =====
-\section*{9. Patient Education and Self-Management}
-
-\textbf{Key Education Topics}: Disease understanding, complication risks, treatment rationale, self-monitoring techniques (glucose, BP), medication administration, diet/nutrition basics, exercise safety, sick day management.
-
-\vspace{0.5em}
-\textbf{Critical Warning Signs}:
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Emergency (call 911)}: Chest pain, severe hypoglycemia with confusion, stroke symptoms
- \item \textit{Call office same day}: Glucose $>$300 or $<$60 mg/dL, BP $>$180/110, severe medication side effects
- \item \textit{Urgent evaluation}: Diabetic foot wounds, severe hyperglycemia with symptoms
-\end{itemize}
-
-\vspace{0.5em}
-\textbf{Support Resources}: DSMES referral, registered dietitian, educational materials, support groups, tracking technology, financial assistance programs as needed.
-
-% ===== SECTION 10: RISK MITIGATION AND SAFETY =====
-\section*{10. Risk Mitigation and Safety}
-
-\textbf{Key Medication Safety Concerns}:
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Metformin}: Monitor eGFR every 6 months; hold if eGFR $<$30, during acute illness, or 48 hours before contrast
- \item \textit{ACE inhibitor}: Check K+ and creatinine at 1-2 weeks, then every 6 months; hold during dehydration/AKI
- \item \textit{Hypoglycemia}: Low risk without insulin/sulfonylureas; educate on recognition and 15-15 rule
-\end{itemize}
-
-\vspace{0.5em}
-\textbf{Complication Prevention}: Annual eye exam, foot exam, and urine ACR; aspirin if ASCVD risk $>$10\%; BP and glucose control reduces cardiovascular, retinopathy, nephropathy, and neuropathy risks.
-
-\vspace{0.5em}
-\textbf{Emergency Actions}: Severe hypoglycemia ($<$50, confusion) - glucagon then 911; chest pain/stroke - call 911; hyperglycemia $>$300 with symptoms - hydrate and call office; severe medication side effects - stop medication, call same day.
-
-% ===== SECTION 11: PROVIDER SIGNATURE =====
-\vspace{2em}
-
-\section*{11. Provider Signature and Attestation}
-
-I have reviewed this treatment plan with the patient. The patient demonstrates understanding of the diagnosis, treatment rationale, goals, interventions, self-management requirements, warning signs, and when to seek emergency care. The patient agrees to this treatment plan and has had the opportunity to ask questions. Shared decision-making was employed, and patient preferences were incorporated.
-
-\vspace{1em}
-
-\begin{tabular}{ll}
-Provider Signature: & \rule{7cm}{0.5pt} \\[1em]
-Provider Name/Credentials: & \rule{7cm}{0.5pt} \\[1em]
-Date: & \rule{4cm}{0.5pt} \\[2em]
-\end{tabular}
-
-\subsection*{Patient Acknowledgment (Optional)}
-
-I have reviewed this treatment plan with my healthcare provider. I understand my diagnosis, treatment goals, medications, lifestyle recommendations, self-monitoring requirements, and when to seek medical attention. I agree to follow this plan and contact my provider with questions or concerns.
-
-\vspace{1em}
-
-\begin{tabular}{ll}
-Patient/Representative Signature: & \rule{7cm}{0.5pt} \\[1em]
-Date: & \rule{4cm}{0.5pt} \\
-\end{tabular}
-
-\vspace{2em}
-\begin{center}
-\rule{\textwidth}{1pt}\\
-\textbf{End of Treatment Plan}\\
-This document contains confidential patient information protected by HIPAA.
-\end{center}
-
-\end{document}
-
-% ========== NOTES FOR USERS ==========
-%
-% CUSTOMIZATION INSTRUCTIONS:
-% 1. Replace all bracketed placeholders [like this] with patient-specific information
-% 2. Remove or add sections as appropriate for the clinical condition
-% 3. Ensure all SMART goals meet criteria (Specific, Measurable, Achievable, Relevant, Time-bound)
-% 4. Include evidence-based interventions per current clinical guidelines
-% 5. De-identify all protected health information before sharing
-%
-% COMPILATION:
-% pdflatex general_medical_treatment_plan.tex
-%
-% VALIDATION:
-% Run check_completeness.py and validate_treatment_plan.py before finalizing
-
diff --git a/skills/treatment-plans/assets/goals_monitoring_checkpoint_template.json b/skills/treatment-plans/assets/goals_monitoring_checkpoint_template.json
new file mode 100644
index 00000000..d3721ca7
--- /dev/null
+++ b/skills/treatment-plans/assets/goals_monitoring_checkpoint_template.json
@@ -0,0 +1,13 @@
+{
+ "schema_version": "2.0",
+ "document_type": "goals_monitoring_checkpoint_record",
+ "document_id": "GOALS-MONITORING-TEMPLATE",
+ "subject_ref": "SYNTHETIC-CASE-001",
+ "data_classification": "synthetic",
+ "status": "DRAFT_NOT_FOR_CLINICAL_USE",
+ "notice": "DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED",
+ "created_at": null,
+ "goals": [],
+ "monitoring_items": [],
+ "checkpoints": []
+}
diff --git a/skills/treatment-plans/assets/informed_preference_shared_decision_template.json b/skills/treatment-plans/assets/informed_preference_shared_decision_template.json
new file mode 100644
index 00000000..00978ed9
--- /dev/null
+++ b/skills/treatment-plans/assets/informed_preference_shared_decision_template.json
@@ -0,0 +1,11 @@
+{
+ "schema_version": "2.0",
+ "document_type": "informed_preference_shared_decision_record",
+ "document_id": "SHARED-DECISION-TEMPLATE",
+ "subject_ref": "SYNTHETIC-CASE-001",
+ "data_classification": "synthetic",
+ "status": "DRAFT_NOT_FOR_CLINICAL_USE",
+ "notice": "DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED",
+ "created_at": null,
+ "entries": []
+}
diff --git a/skills/treatment-plans/assets/intended_use_handoff_template.json b/skills/treatment-plans/assets/intended_use_handoff_template.json
new file mode 100644
index 00000000..ee218e12
--- /dev/null
+++ b/skills/treatment-plans/assets/intended_use_handoff_template.json
@@ -0,0 +1,83 @@
+{
+ "schema_version": "2.0",
+ "document_type": "intended_use_handoff_record",
+ "document_id": "INTENDED-USE-HANDOFF-TEMPLATE",
+ "subject_ref": "SYNTHETIC-CASE-001",
+ "data_classification": "synthetic",
+ "status": "DRAFT_NOT_FOR_CLINICAL_USE",
+ "notice": "DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED",
+ "created_at": null,
+ "intended_use": {
+ "purpose": "format_and_validate_clinician_supplied_plan_documentation",
+ "intended_users": [],
+ "intended_setting": "",
+ "output_role": "documentation_only",
+ "prohibited_uses": [
+ "diagnosis_or_assessment",
+ "therapy_selection_or_recommendation",
+ "medication_or_dose_decision",
+ "start_stop_hold_resume_titrate_or_taper_decision",
+ "interaction_allergy_or_contraindication_check",
+ "triage_or_urgency_determination",
+ "emergency_advice_or_safety_plan",
+ "prognosis_or_outcome_prediction",
+ "patient_specific_recommendation",
+ "replacement_of_authorized_professional_review"
+ ]
+ },
+ "privacy_process": {
+ "data_classification": "synthetic",
+ "local_authorization_confirmed": false,
+ "authorized_environment_reference": "",
+ "minimum_necessary_confirmed": false,
+ "no_external_tools_confirmed": false,
+ "no_prompt_log_example_copy_confirmed": false,
+ "privacy_review_status": "pending",
+ "privacy_reviewer_role": "",
+ "reviewed_at": null,
+ "retention_policy_reference": "",
+ "data_disposition_status": "pending"
+ },
+ "local_governance": {
+ "institution_or_organization_reference": "",
+ "clinical_owner_role": "",
+ "policy_references": [],
+ "records_owner_role": "",
+ "change_control_owner_role": ""
+ },
+ "emergency_routing": {
+ "statement": "If a concern may be urgent or emergent, stop this documentation workflow and use the institution's current clinical escalation or emergency process; this package does not determine urgency or provide emergency instructions.",
+ "local_process_reference": "",
+ "verified_by_role": ""
+ },
+ "reporting_routes": {
+ "local_patient_safety_route": "",
+ "product_event_route": "",
+ "privacy_incident_route": "",
+ "responsible_role": ""
+ },
+ "handoff": {
+ "sender_role": "",
+ "recipient_role": "",
+ "sent_at": null,
+ "acknowledgment_status": "pending",
+ "unresolved_items_routed": false
+ },
+ "clinician_signoff": {
+ "status": "pending",
+ "signer_role": "",
+ "credential_authority_reference": "",
+ "signed_at": null,
+ "attestation": "The signer attests only that this package accurately transcribes clinician-supplied and verified decisions for authorized documentation handoff; it is not stand-alone medical advice."
+ },
+ "release_gate": {
+ "status": "blocked",
+ "released_by_role": "",
+ "released_at": null,
+ "blocker_codes": [
+ "CLINICIAN_SIGNOFF_PENDING",
+ "PRIVACY_PROCESS_PENDING",
+ "LOCAL_GOVERNANCE_PENDING"
+ ]
+ }
+}
diff --git a/skills/treatment-plans/assets/medical_treatment_plan.sty b/skills/treatment-plans/assets/medical_treatment_plan.sty
deleted file mode 100644
index 8cb1ca62..00000000
--- a/skills/treatment-plans/assets/medical_treatment_plan.sty
+++ /dev/null
@@ -1,222 +0,0 @@
-% medical_treatment_plan.sty
-% Professional Medical Treatment Plan Style
-% Provides modern, clean styling for clinical treatment plans
-
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{medical_treatment_plan}[2025/11/05 Medical Treatment Plan Style]
-
-% Required packages
-\RequirePackage[margin=1in, top=1.2in, bottom=1.2in]{geometry}
-\RequirePackage{graphicx}
-\RequirePackage{xcolor}
-\RequirePackage[most]{tcolorbox}
-\RequirePackage{tikz}
-\RequirePackage{fontspec}
-\RequirePackage{fancyhdr}
-\RequirePackage{titlesec}
-\RequirePackage{enumitem}
-\RequirePackage{booktabs}
-\RequirePackage{longtable}
-\RequirePackage{array}
-\RequirePackage{colortbl}
-\RequirePackage{hyperref}
-\RequirePackage{natbib}
-
-% Color scheme - Professional medical blues and grays
-\definecolor{primaryblue}{RGB}{0, 102, 153} % Deep medical blue
-\definecolor{secondaryblue}{RGB}{102, 178, 204} % Light blue
-\definecolor{accentblue}{RGB}{0, 153, 204} % Bright accent
-\definecolor{darkgray}{RGB}{64, 64, 64} % Dark gray for text
-\definecolor{lightgray}{RGB}{245, 245, 245} % Light background
-\definecolor{medgray}{RGB}{200, 200, 200} % Medium gray
-\definecolor{warningred}{RGB}{204, 0, 0} % For warnings
-\definecolor{successgreen}{RGB}{0, 153, 76} % For success/goals
-
-% Fonts (if using XeLaTeX/LuaLaTeX) - use default fonts if custom fonts not available
-% \IfFileExists{lato}{\setmainfont{Lato}}{}
-% \IfFileExists{roboto}{\setsansfont{Roboto}}{}
-
-% Hyperlink setup
-\hypersetup{
- colorlinks=true,
- linkcolor=primaryblue,
- citecolor=primaryblue,
- urlcolor=accentblue,
- pdfborder={0 0 0}
-}
-
-% Header and footer styling
-\setlength{\headheight}{22pt}
-\pagestyle{fancy}
-\fancyhf{}
-\fancyhead[L]{\color{primaryblue}\sffamily\small\textbf{Diabetes Treatment Plan}}
-\fancyhead[R]{\color{darkgray}\sffamily\small Patient Age: 23}
-\fancyfoot[C]{\color{darkgray}\small\thepage}
-\renewcommand{\headrulewidth}{2pt}
-\renewcommand{\headrule}{\hbox to\headwidth{\color{primaryblue}\leaders\hrule height \headrulewidth\hfill}}
-\renewcommand{\footrulewidth}{0.5pt}
-\renewcommand{\footrule}{\hbox to\headwidth{\color{medgray}\leaders\hrule height \footrulewidth\hfill}}
-
-% Section styling
-\titleformat{\section}
- {\color{primaryblue}\Large\sffamily\bfseries}
- {\thesection}{1em}{}
- [\color{primaryblue}\titlerule]
-
-\titleformat{\subsection}
- {\color{accentblue}\large\sffamily\bfseries}
- {\thesubsection}{1em}{}
-
-\titleformat{\subsubsection}
- {\color{darkgray}\normalsize\sffamily\bfseries}
- {\thesubsubsection}{1em}{}
-
-% Title page styling
-\renewcommand{\maketitle}{
- \begin{tcolorbox}[
- enhanced,
- colback=primaryblue,
- colframe=primaryblue,
- arc=0mm,
- boxrule=0pt,
- left=20pt,
- right=20pt,
- top=30pt,
- bottom=30pt,
- width=\textwidth
- ]
- \color{white}
- \begin{center}
- {\Huge\sffamily\bfseries Individualized Diabetes\\Treatment Plan}\\[10pt]
- {\Large\sffamily 23-Year-Old Male Patient with Type 2 Diabetes}\\[15pt]
- {\large\sffamily Comprehensive Evidence-Based Care Plan}\\[8pt]
- {\normalsize\sffamily\color{secondaryblue}\today}
- \end{center}
- \end{tcolorbox}
- \vspace{1cm}
-}
-
-% Custom boxes for different content types
-% Info box
-\newtcolorbox{infobox}[1][]{
- enhanced,
- colback=lightgray,
- colframe=primaryblue,
- arc=3mm,
- boxrule=1.5pt,
- left=10pt,
- right=10pt,
- top=10pt,
- bottom=10pt,
- title=#1,
- fonttitle=\sffamily\bfseries,
- coltitle=white,
- colbacktitle=primaryblue
-}
-
-% Warning box
-\newtcolorbox{warningbox}[1][Warning]{
- enhanced,
- colback=yellow!10,
- colframe=warningred,
- arc=3mm,
- boxrule=1.5pt,
- left=10pt,
- right=10pt,
- top=10pt,
- bottom=10pt,
- title=#1,
- fonttitle=\sffamily\bfseries,
- coltitle=white,
- colbacktitle=warningred
-}
-
-% Goal box
-\newtcolorbox{goalbox}[1][Treatment Goals]{
- enhanced,
- colback=green!5,
- colframe=successgreen,
- arc=3mm,
- boxrule=1.5pt,
- left=10pt,
- right=10pt,
- top=10pt,
- bottom=10pt,
- title=#1,
- fonttitle=\sffamily\bfseries,
- coltitle=white,
- colbacktitle=successgreen
-}
-
-% Key points box
-\newtcolorbox{keybox}[1][Key Points]{
- enhanced,
- colback=secondaryblue!10,
- colframe=accentblue,
- arc=3mm,
- boxrule=1.5pt,
- left=10pt,
- right=10pt,
- top=10pt,
- bottom=10pt,
- title=#1,
- fonttitle=\sffamily\bfseries,
- coltitle=white,
- colbacktitle=accentblue
-}
-
-% Table styling
-\newcommand{\tableheadercolor}{\rowcolor{primaryblue}}
-\newcommand{\tablerowcolor}{\rowcolor{lightgray}}
-
-% Custom table environment
-\newenvironment{medtable}[1]{
- \begin{table}[h]
- \centering
- \small\sffamily
- \renewcommand{\arraystretch}{1.3}
-}{
- \end{table}
-}
-
-% Patient info section style
-\newenvironment{patientinfo}{
- \begin{tcolorbox}[
- enhanced,
- colback=white,
- colframe=secondaryblue,
- arc=2mm,
- boxrule=1pt,
- left=15pt,
- right=15pt,
- top=12pt,
- bottom=12pt
- ]
- \sffamily
-}{
- \end{tcolorbox}
-}
-
-% Custom list styling
-\setlist[itemize,1]{label=\textcolor{primaryblue}{\textbullet}, leftmargin=*, itemsep=3pt}
-\setlist[enumerate,1]{label=\textcolor{primaryblue}{\arabic*.}, leftmargin=*, itemsep=3pt}
-
-% Emergency contact box
-\newtcolorbox{emergencybox}{
- enhanced,
- colback=warningred!5,
- colframe=warningred,
- arc=3mm,
- boxrule=2pt,
- left=15pt,
- right=15pt,
- top=15pt,
- bottom=15pt,
- title=EMERGENCY CONTACTS,
- fonttitle=\sffamily\bfseries\Large,
- coltitle=white,
- colbacktitle=warningred
-}
-
-\endinput
-
diff --git a/skills/treatment-plans/assets/mental_health_treatment_plan.tex b/skills/treatment-plans/assets/mental_health_treatment_plan.tex
deleted file mode 100644
index 60a582cf..00000000
--- a/skills/treatment-plans/assets/mental_health_treatment_plan.tex
+++ /dev/null
@@ -1,774 +0,0 @@
-% Mental Health Treatment Plan Template
-% For psychiatric and behavioral health treatment
-% Last updated: 2025
-
-\documentclass[11pt,letterpaper]{article}
-
-% Packages
-\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
-\usepackage{amsmath,amssymb}
-\usepackage[utf8]{inputenc}
-\usepackage{graphicx}
-\usepackage{array}
-\usepackage{longtable}
-\usepackage{booktabs}
-\usepackage{enumitem}
-\usepackage{xcolor}
-\usepackage{fancyhdr}
-\usepackage{lastpage}
-\usepackage{tabularx}
-\usepackage[most]{tcolorbox}
-
-% Header and footer
-\pagestyle{fancy}
-\fancyhf{}
-\lhead{Mental Health Treatment Plan}
-\rhead{Page \thepage\ of \pageref{LastPage}}
-\lfoot{Date Created: \today}
-\rfoot{Confidential Patient Information}
-
-% Title formatting
-\usepackage{titlesec}
-\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
-\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{1em}{}
-
-\begin{document}
-
-% Title
-\begin{center}
-{\Large\bfseries MENTAL HEALTH TREATMENT PLAN}\\[0.5em]
-{\large Psychiatric \& Behavioral Health Services}\\[0.5em]
-\rule{\textwidth}{1pt}
-\end{center}
-
-\vspace{1em}
-
-% ===== TREATMENT PLAN HIGHLIGHTS (Foundation Medicine Model) =====
-\begin{tcolorbox}[colback=purple!5!white,colframe=purple!75!black,title=\textbf{TREATMENT PLAN HIGHLIGHTS},fonttitle=\bfseries\large]
-
-\textbf{Key Diagnosis:} [Primary psychiatric diagnosis - e.g., Major Depressive Disorder, moderate (DSM-5 296.32)]
-
-\vspace{0.3em}
-\textbf{Primary Treatment Goals:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item [Goal 1 - e.g., Reduce PHQ-9 score from 18 to $<$10 within 12 weeks]
- \item [Goal 2 - e.g., Return to work full-time within 3 months]
- \item [Goal 3 - e.g., Develop 3 effective coping strategies for stress management]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Main Interventions:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Psychotherapy:} [Modality - e.g., Cognitive Behavioral Therapy (CBT) weekly for 16 sessions]
- \item \textit{Medication:} [Key medications - e.g., Sertraline 50mg daily, titrate to 100mg]
- \item \textit{Safety:} [Crisis plan in place, emergency contacts established]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Timeline:} [Duration - e.g., Acute treatment (12 weeks), Continuation (4-6 months), Maintenance (ongoing)]
-
-\end{tcolorbox}
-
-\vspace{1em}
-
-% ===== SECTION 1: PATIENT INFORMATION =====
-\section*{1. Patient Information}
-
-\textbf{HIPAA Notice}: De-identify all protected health information per Safe Harbor method before sharing.
-
-\vspace{0.5em}
-
-\begin{tabularx}{\textwidth}{|l|X|}
-\hline
-\textbf{Patient ID} & [De-identified code, e.g., MH-001] \\ \hline
-\textbf{Age Range} & [e.g., 30-35 years] \\ \hline
-\textbf{Sex} & [Male/Female/Other] \\ \hline
-\textbf{Gender Identity} & [If relevant and disclosed] \\ \hline
-\textbf{Pronouns} & [Patient's preferred pronouns] \\ \hline
-\textbf{Date of Plan} & [Month/Year only] \\ \hline
-\textbf{Treating Provider} & [Psychiatrist/Psychologist/LCSW/NP Name, Credentials] \\ \hline
-\textbf{Treatment Setting} & [Outpatient/IOP/PHP/Inpatient] \\ \hline
-\textbf{Facility} & [Mental health center/clinic name] \\ \hline
-\end{tabularx}
-
-\vspace{1em}
-
-\subsection*{Presenting Problem}
-
-\textbf{Chief Complaint}: [Patient's own words, e.g., "I've been feeling really down and can't get motivated to do anything"]
-
-\textbf{History of Present Illness}:
-[Detailed description of current symptoms, onset, duration, severity, precipitating factors, impact on functioning. Example: Patient reports depressed mood, anhedonia, fatigue, and difficulty concentrating for past 3 months, following job loss. Symptoms have progressively worsened, now affecting ability to complete daily tasks and maintain social relationships.]
-
-\subsection*{Psychiatric History}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Previous Psychiatric Diagnoses}: [e.g., Major Depressive Disorder, diagnosed 5 years ago]
- \item \textbf{Previous Treatment}:
- \begin{itemize}
- \item Psychotherapy: [e.g., CBT for 6 months in 2020, helpful]
- \item Medications: [e.g., Sertraline 100mg 2020-2021, discontinued due to side effects]
- \item Hospitalizations: [e.g., One psychiatric hospitalization in 2019 for suicidal ideation]
- \end{itemize}
- \item \textbf{Family Psychiatric History}: [e.g., Mother with depression, paternal uncle with bipolar disorder]
-\end{itemize}
-
-\subsection*{Substance Use History}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Alcohol}: [e.g., Social use, 2-3 drinks per week, denies binge drinking]
- \item \textbf{Tobacco}: [e.g., Non-smoker]
- \item \textbf{Cannabis}: [e.g., Previously daily use, quit 6 months ago]
- \item \textbf{Other Substances}: [e.g., Denies other illicit drug use]
- \item \textbf{Substance Use Disorder}: [e.g., Cannabis use disorder, in remission]
-\end{itemize}
-
-\subsection*{Medical History}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Chronic Medical Conditions}: [e.g., Hypothyroidism, well-controlled on levothyroxine]
- \item \textbf{Current Medications}: [e.g., Levothyroxine 100mcg daily]
- \item \textbf{Allergies}: [NKDA or list medication allergies and reactions]
-\end{itemize}
-
-\subsection*{Social History and Support}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Living Situation}: [e.g., Lives alone in apartment, safe housing]
- \item \textbf{Employment}: [e.g., Recently unemployed (3 months), previously worked as accountant]
- \item \textbf{Education}: [e.g., Bachelor's degree in accounting]
- \item \textbf{Marital/Relationship Status}: [e.g., Single, not in relationship]
- \item \textbf{Social Support}: [e.g., Close relationship with sister, few friends, isolated recently]
- \item \textbf{Financial Stressors}: [e.g., Unemployment causing financial strain]
- \item \textbf{Legal Issues}: [e.g., None]
- \item \textbf{Trauma History}: [e.g., Reports childhood emotional abuse, no recent trauma]
-\end{itemize}
-
-% ===== SECTION 2: PSYCHIATRIC ASSESSMENT =====
-\section*{2. Psychiatric Assessment and Diagnosis}
-
-\subsection*{Mental Status Examination}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Appearance}: [e.g., Casually dressed, fair grooming, appropriate for season]
- \item \textbf{Behavior}: [e.g., Cooperative, fair eye contact, psychomotor retardation noted]
- \item \textbf{Speech}: [e.g., Soft volume, slow rate, decreased spontaneity]
- \item \textbf{Mood}: [e.g., "Depressed and hopeless" - patient's own words]
- \item \textbf{Affect}: [e.g., Constricted, dysphoric, congruent with mood]
- \item \textbf{Thought Process}: [e.g., Linear, goal-directed, no tangentiality or loose associations]
- \item \textbf{Thought Content}:
- \begin{itemize}
- \item Suicidal ideation: [e.g., Passive SI present ("wish I wouldn't wake up"), denies active SI/plan/intent]
- \item Homicidal ideation: [e.g., Denied]
- \item Delusions: [e.g., None identified]
- \item Obsessions/compulsions: [e.g., None]
- \end{itemize}
- \item \textbf{Perceptions}: [e.g., No hallucinations (auditory, visual, tactile) reported or observed]
- \item \textbf{Cognition}:
- \begin{itemize}
- \item Orientation: [e.g., Oriented to person, place, time, situation]
- \item Memory: [e.g., Intact for recent and remote events]
- \item Concentration: [e.g., Impaired, difficulty with serial 7s]
- \item Insight: [e.g., Fair - recognizes need for treatment]
- \item Judgment: [e.g., Fair to good - makes reasonable decisions]
- \end{itemize}
-\end{itemize}
-
-\subsection*{Diagnostic Assessment}
-
-\textbf{Primary Diagnosis}: [e.g., Major Depressive Disorder, Recurrent Episode, Moderate]\\
-\textbf{DSM-5 Code}: [e.g., F33.1]
-
-\textbf{DSM-5 Criteria Met}:
-\begin{itemize}[leftmargin=*]
- \item Depressed mood most of the day, nearly every day (patient report, observed affect)
- \item Markedly diminished interest or pleasure in activities (anhedonia)
- \item Significant weight loss (10 lbs in 2 months)
- \item Insomnia nearly every night (difficulty falling and staying asleep)
- \item Fatigue and loss of energy nearly every day
- \item Feelings of worthlessness and guilt
- \item Diminished ability to think and concentrate
- \item Duration: 3 months
- \item Significant distress and impairment in occupational and social functioning
-\end{itemize}
-
-\textbf{Secondary Diagnoses}:
-\begin{itemize}[leftmargin=*]
- \item [e.g., Cannabis Use Disorder, Mild, In Sustained Remission] (DSM-5: F12.11)
- \item [e.g., Unspecified Anxiety Disorder] (DSM-5: F41.9)
-\end{itemize}
-
-\subsection*{Symptom Severity Assessment}
-
-\begin{tabularx}{\textwidth}{|l|c|c|X|}
-\hline
-\textbf{Assessment Tool} & \textbf{Score} & \textbf{Interpretation} & \textbf{Notes} \\ \hline
-PHQ-9 (Depression) & 18/27 & Moderately severe depression & Target $<$10 for remission \\ \hline
-GAD-7 (Anxiety) & 12/21 & Moderate anxiety & Target $<$5 \\ \hline
-PCL-5 (PTSD) & N/A & Not administered & Consider if trauma symptoms emerge \\ \hline
-C-SSRS (Suicide Risk) & Level 3 & Passive SI, no intent/plan & Requires safety planning \\ \hline
-AUDIT (Alcohol) & 3/40 & Low risk & No current concern \\ \hline
-\end{tabularx}
-
-\subsection*{Functional Impairment}
-
-\textbf{Impact on Daily Functioning}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Occupational}: Unable to work currently, difficulty with job search due to lack of motivation
- \item \textbf{Social}: Withdrawn from friends, decreased social activities, isolating at home
- \item \textbf{Self-Care}: Difficulty maintaining hygiene, skipping meals, irregular sleep
- \item \textbf{Relationships}: Strained relationships due to irritability and withdrawal
- \item \textbf{Physical Health}: Decreased exercise, poor nutrition
-\end{itemize}
-
-\subsection*{Risk Assessment}
-
-\textbf{Suicide Risk}: [e.g., Low to Moderate]
-\begin{itemize}[leftmargin=*]
- \item \textit{Risk Factors}: Depression, unemployment, social isolation, passive SI, previous suicide attempt (2019)
- \item \textit{Protective Factors}: Engaged in treatment, close relationship with sister, denies current intent/plan, future-oriented (wants to get better)
- \item \textit{Current Status}: Passive SI only, no active ideation, plan, or intent. Contracts for safety.
-\end{itemize}
-
-\textbf{Homicide/Violence Risk}: [e.g., Low] - No homicidal ideation, no history of violence
-
-% ===== SECTION 3: TREATMENT GOALS =====
-\section*{3. Treatment Goals (SMART Format)}
-
-\subsection*{3.1 Short-Term Goals (4-8 weeks)}
-
-\textbf{Symptom Reduction Goals}:
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Depression}: Reduce PHQ-9 score from 18 to $<$10 (minimal depression) within 8 weeks through medication and psychotherapy.
- \begin{itemize}
- \item \textit{Measurable}: PHQ-9 assessment every 2 weeks
- \item \textit{Achievable}: With SSRI and weekly CBT
- \item \textit{Time-bound}: 8 weeks
- \end{itemize}
-
- \item \textbf{Sleep}: Improve sleep to 6-7 hours nightly with no more than 1 awakening within 4 weeks through sleep hygiene and possible medication adjustment.
-
- \item \textbf{Anxiety}: Reduce GAD-7 score from 12 to $<$8 within 6 weeks using CBT anxiety management techniques.
-
- \item \textbf{Suicide Risk}: Eliminate passive suicidal ideation, maintain safety contract, implement crisis plan within 2 weeks.
-\end{enumerate}
-
-\textbf{Functional Goals}:
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Self-Care}: Establish daily self-care routine (shower, meals, sleep schedule) with 80\% compliance within 3 weeks.
-
- \item \textbf{Social Engagement}: Re-engage in 1-2 social activities per week (phone calls with friends, sister visits) within 4 weeks.
-
- \item \textbf{Coping Skills}: Learn and practice 3 new coping skills for managing depressive symptoms within 4 weeks.
-\end{enumerate}
-
-\subsection*{3.2 Long-Term Goals (3-6 months)}
-
-\textbf{Recovery-Oriented Goals}:
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Remission}: Achieve depression remission with PHQ-9 score $<$5 and sustained improved mood within 12-16 weeks.
-
- \item \textbf{Return to Work}: Develop job search plan, practice interview skills, secure employment or engage in meaningful volunteer work within 3-4 months.
-
- \item \textbf{Relationship Building}: Rebuild and strengthen social connections, increase social support network by adding 2-3 regular social contacts within 3 months.
-
- \item \textbf{Quality of Life}: Re-engage in previously enjoyed activities (hobbies, exercise, leisure) at least 3x per week within 3 months.
-
- \item \textbf{Resilience}: Develop sustainable wellness routine including regular sleep, exercise, healthy diet, and stress management practices within 4 months.
-
- \item \textbf{Relapse Prevention}: Identify early warning signs of depression, develop relapse prevention plan, maintain treatment gains within 6 months.
-\end{enumerate}
-
-\subsection*{3.3 Patient-Identified Goals}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Priority 1}: "I want to feel like myself again and have energy to do things"
- \item \textbf{Priority 2}: "I want to find a new job and feel confident in interviews"
- \item \textbf{Priority 3}: "I want to stop feeling guilty all the time"
- \item \textbf{Priority 4}: "I want to enjoy spending time with my friends and family again"
-\end{itemize}
-
-% ===== SECTION 4: TREATMENT INTERVENTIONS =====
-\section*{4. Treatment Interventions}
-
-\subsection*{4.1 Psychopharmacology}
-
-\textbf{Medication Plan}:
-
-\begin{longtable}{|p{3cm}|p{2cm}|p{2cm}|p{6.5cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Rationale \& Instructions} \\ \hline
-\endfirsthead
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Rationale \& Instructions} \\ \hline
-\endhead
-
-Escitalopram (Lexapro) & 10mg & Daily (morning) & \textbf{Rationale}: First-line SSRI for major depression. \textbf{Start}: 10mg daily. \textbf{Titration}: May increase to 20mg after 4 weeks if partial response. \textbf{Expected}: 2-4 weeks for initial response, 6-8 weeks for full effect. \textbf{Monitor}: Mood, anxiety, suicidal ideation, side effects. \\ \hline
-
-Trazodone & 50mg & QHS PRN & \textbf{Rationale}: For insomnia, sedating antidepressant. \textbf{Start}: 50mg at bedtime as needed. \textbf{Titration}: May increase to 100mg if ineffective. \textbf{Instructions}: Take 30 min before bed. May cause morning grogginess - reduce dose if bothersome. \\ \hline
-
-[Continue current medications] & & & \\ \hline
-Levothyroxine & 100mcg & Daily & \textbf{Continue}: Hypothyroidism management. Monitor TSH every 6-12 months. \\ \hline
-\end{longtable}
-
-\textbf{Medication Safety and Monitoring}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Common Side Effects}: Nausea (take with food), headache, insomnia or drowsiness, sexual dysfunction (discuss if bothersome)
- \item \textbf{Serious Side Effects} (rare): Serotonin syndrome (agitation, confusion, rapid heart rate, high fever - seek emergency care), increased suicidal thoughts (especially first 1-2 weeks - monitor closely)
- \item \textbf{Drug Interactions}: Avoid other serotonergic agents, NSAIDs (increased bleeding risk)
- \item \textbf{Adherence Plan}: Set daily reminder alarm, use pill box, refill prescriptions on time
- \item \textbf{Follow-up}: Psychiatry visit week 2 (phone), week 4 (in-person), week 8, then monthly
-\end{itemize}
-
-\textbf{Response Timeline}:
-\begin{itemize}[leftmargin=*]
- \item Week 1-2: May notice side effects before benefits, monitor suicide risk closely
- \item Week 2-4: Early improvement in sleep, appetite, energy possible
- \item Week 4-6: Mood improvement, decreased anxiety expected
- \item Week 6-8: Full therapeutic effect, reassess dose if partial response
- \item Week 12+: Continued improvement, consider maintenance therapy
-\end{itemize}
-
-\subsection*{4.2 Psychotherapy}
-
-\textbf{Therapy Modality}: Cognitive Behavioral Therapy (CBT) for Depression
-
-\textbf{Frequency}: Weekly 50-minute sessions for 12-16 weeks, then biweekly as symptoms improve
-
-\textbf{Treatment Framework}:
-
-\textbf{Weeks 1-4: Assessment and Behavioral Activation}
-\begin{itemize}[leftmargin=*]
- \item Establish therapeutic alliance and treatment goals
- \item Psychoeducation: Depression, treatment options, CBT model
- \item Activity monitoring and identifying mood-behavior connections
- \item Behavioral activation: Schedule pleasant and meaningful activities
- \item Develop daily structure and routine
- \item Suicide risk assessment and safety planning
-\end{itemize}
-
-\textbf{Weeks 5-8: Cognitive Restructuring}
-\begin{itemize}[leftmargin=*]
- \item Identify automatic negative thoughts
- \item Challenge cognitive distortions (all-or-nothing thinking, overgeneralization, catastrophizing)
- \item Develop balanced, realistic thoughts
- \item Address guilt and worthlessness cognitions
- \item Problem-solving skills training
-\end{itemize}
-
-\textbf{Weeks 9-12: Skill Building and Application}
-\begin{itemize}[leftmargin=*]
- \item Assertiveness and communication skills
- \item Interpersonal effectiveness
- \item Stress management and relaxation techniques
- \item Values clarification and goal-setting (career, relationships)
- \item Address employment/job search anxiety
-\end{itemize}
-
-\textbf{Weeks 13-16: Relapse Prevention and Maintenance}
-\begin{itemize}[leftmargin=*]
- \item Identify early warning signs of depression
- \item Develop personalized relapse prevention plan
- \item Review and consolidate skills learned
- \item Plan for ongoing self-care and wellness
- \item Discuss transition to maintenance phase or termination
-\end{itemize}
-
-\textbf{Specific CBT Techniques}:
-\begin{itemize}[leftmargin=*]
- \item Thought records (identify situations, thoughts, emotions, behaviors)
- \item Behavioral experiments (test negative predictions)
- \item Activity scheduling (increase rewarding activities)
- \item Graded task assignment (break large tasks into manageable steps)
- \item Cognitive continuum (evaluate black-and-white thinking)
- \item Core belief work (address underlying schemas)
-\end{itemize}
-
-\textbf{Homework Assignments}:
-\begin{itemize}[leftmargin=*]
- \item Weekly mood and activity logs
- \item Thought records (3-column or 7-column)
- \item Behavioral activation: Complete 2-3 scheduled activities
- \item Reading: CBT self-help materials (e.g., "Feeling Good" by David Burns)
- \item Skills practice between sessions
-\end{itemize}
-
-\subsection*{4.3 Adjunctive Interventions}
-
-\textbf{Case Management}:
-\begin{itemize}[leftmargin=*]
- \item Assist with unemployment benefits and financial resources
- \item Connect with vocational rehabilitation services
- \item Coordinate care with primary care provider
- \item Insurance and medication assistance navigation
-\end{itemize}
-
-\textbf{Lifestyle Interventions}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Exercise}: Goal of 30 minutes moderate exercise 5x/week (walking, yoga, biking)
- \item \textbf{Sleep Hygiene}: Consistent sleep schedule (11 PM - 7 AM), limit screen time 1 hour before bed, avoid caffeine after 2 PM, bedroom for sleep only
- \item \textbf{Nutrition}: Regular balanced meals, minimize processed foods, stay hydrated
- \item \textbf{Substance Use}: Continue cannabis abstinence, limit alcohol to 1-2 drinks/week max
- \item \textbf{Light Exposure}: Morning sunlight or light box 30 min daily (if seasonal pattern)
-\end{itemize}
-
-\textbf{Social Support Enhancement}:
-\begin{itemize}[leftmargin=*]
- \item Increase contact with sister (supportive relationship)
- \item Consider depression support group (online or in-person)
- \item Re-engage with friend group gradually
- \item Volunteer opportunities for meaningful engagement
-\end{itemize}
-
-\textbf{Family/Collateral Sessions}:
-\begin{itemize}[leftmargin=*]
- \item Offer to include sister in 1-2 sessions (with patient consent) for psychoeducation and support
- \item Educate family on depression, how to help, what to avoid (enabling, criticism)
-\end{itemize}
-
-% ===== SECTION 5: TREATMENT SCHEDULE =====
-\section*{5. Treatment Schedule and Timeline}
-
-\subsection*{Treatment Phases}
-
-\begin{tabularx}{\textwidth}{|l|l|X|}
-\hline
-\textbf{Phase} & \textbf{Duration} & \textbf{Focus} \\ \hline
-Acute Treatment & Weeks 1-8 & Symptom reduction, medication titration, behavioral activation, safety \\ \hline
-Continuation & Weeks 9-16 & Cognitive restructuring, skill building, functional recovery \\ \hline
-Maintenance & Months 4-12 & Relapse prevention, sustained wellness, reduce visit frequency \\ \hline
-\end{tabularx}
-
-\subsection*{Appointment Schedule}
-
-\begin{tabularx}{\textwidth}{|l|l|X|}
-\hline
-\textbf{Provider} & \textbf{Frequency} & \textbf{Notes} \\ \hline
-Psychiatry & Week 2 (phone), 4, 8, then monthly & Medication management, side effect monitoring \\ \hline
-Psychotherapy (CBT) & Weekly weeks 1-12, biweekly weeks 13-16 & 50-minute sessions \\ \hline
-PHQ-9/GAD-7 Assessment & Every 2 weeks & Track symptom severity \\ \hline
-Case Management & As needed & Resources, benefits, vocational support \\ \hline
-\end{tabularx}
-
-\subsection*{Milestones and Reassessment}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Week 2}: Medication tolerance check, safety assessment, initial behavioral activation
- \item \textbf{Week 4}: PHQ-9 reassessment, medication dose adjustment if needed, CBT engagement
- \item \textbf{Week 8}: Comprehensive reassessment, PHQ-9 target $<$10, functional improvement expected
- \item \textbf{Week 12}: PHQ-9 target $<$5, relapse prevention planning initiated
- \item \textbf{Week 16}: Treatment goal review, transition to maintenance or taper frequency
-\end{itemize}
-
-% ===== SECTION 6: MONITORING AND OUTCOMES =====
-\section*{6. Monitoring Parameters and Outcomes}
-
-\subsection*{Symptom Tracking}
-
-\begin{longtable}{|p{4cm}|p{2.5cm}|p{2.5cm}|p{4.5cm}|}
-\hline
-\textbf{Measure} & \textbf{Baseline} & \textbf{Target} & \textbf{Frequency} \\ \hline
-\endfirsthead
-\hline
-\textbf{Measure} & \textbf{Baseline} & \textbf{Target} & \textbf{Frequency} \\ \hline
-\endhead
-PHQ-9 (Depression) & 18/27 & $<$5 (remission) & Every 2 weeks \\ \hline
-GAD-7 (Anxiety) & 12/21 & $<$5 & Every 2 weeks \\ \hline
-C-SSRS (Suicide Risk) & Level 3 (passive SI) & Level 0 (no SI) & Each session initially, then monthly \\ \hline
-Sleep Quality & 4-5 hrs, fragmented & 6-7 hrs, consolidated & Weekly self-report \\ \hline
-Social Activities & 0-1/week & 3-4/week & Weekly log \\ \hline
-Exercise & 0 days/week & 5 days/week & Weekly log \\ \hline
-Therapy Homework & -- & 80\% completion & Each session \\ \hline
-Medication Adherence & -- & $>$90\% & Each psychiatry visit \\ \hline
-\end{longtable}
-
-\subsection*{Functional Outcome Tracking}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Self-Care}: Daily routine checklist (shower, meals, sleep, medications)
- \item \textbf{Social Functioning}: Number of social interactions per week
- \item \textbf{Occupational}: Job applications submitted, interviews attended, volunteer hours
- \item \textbf{Quality of Life}: Engagement in hobbies, pleasurable activities
- \item \textbf{Overall Functioning}: GAF or WHODAS score at baseline, 8 weeks, discharge
-\end{itemize}
-
-\subsection*{Safety Monitoring}
-
-\begin{itemize}[leftmargin=*]
- \item Suicidal ideation assessment at every contact (especially weeks 1-4)
- \item Medication side effects and tolerability
- \item Substance use (alcohol, cannabis) - weekly check-ins
- \item Worsening symptoms or breakthrough depression
- \item Medication adherence
-\end{itemize}
-
-% ===== SECTION 7: CRISIS AND SAFETY PLANNING =====
-\section*{7. Crisis Management and Safety Planning}
-
-\subsection*{Safety Plan (Based on Stanley-Brown Model)}
-
-\textbf{Step 1: Warning Signs}
-\begin{itemize}[leftmargin=*]
- \item Thoughts: "I'm worthless," "Things will never get better," "I'm a burden"
- \item Feelings: Hopelessness, overwhelming sadness, numbness
- \item Behaviors: Isolating for days, not eating, excessive sleeping
- \item Situations: Financial stress, rejection, conflict with family
-\end{itemize}
-
-\textbf{Step 2: Internal Coping Strategies} (things I can do on my own)
-\begin{itemize}[leftmargin=*]
- \item Go for a walk outside
- \item Listen to favorite music playlist
- \item Take a warm shower
- \item Deep breathing exercises (5-10 minutes)
- \item Read CBT thought records
- \item Write in journal
-\end{itemize}
-
-\textbf{Step 3: Social Contacts for Distraction}
-\begin{itemize}[leftmargin=*]
- \item Sister: [phone number]
- \item Close friend: [phone number]
- \item Former coworker: [phone number]
-\end{itemize}
-
-\textbf{Step 4: People I Can Ask for Help}
-\begin{itemize}[leftmargin=*]
- \item Sister: [phone number] - can talk about feelings, will listen without judgment
- \item Therapist: [phone number] - call for emergency appointment
- \item Psychiatrist: [phone number] - after-hours answering service
-\end{itemize}
-
-\textbf{Step 5: Professionals and Agencies to Contact}
-\begin{itemize}[leftmargin=*]
- \item Therapist: [clinic phone]
- \item Psychiatrist on-call: [after-hours number]
- \item Crisis Line: 988 Suicide \& Crisis Lifeline (call or text 988)
- \item Crisis Text Line: Text HOME to 741741
- \item Local crisis center: [local crisis services phone]
-\end{itemize}
-
-\textbf{Step 6: Reduce Access to Lethal Means}
-\begin{itemize}[leftmargin=*]
- \item No firearms in home
- \item Medications: Sister holds extra medication supply, patient has only 1-week supply at home
- \item Remove other potential means from immediate environment
-\end{itemize}
-
-\textbf{One Thing That Is Most Important to Me}:
-\begin{itemize}[leftmargin=*]
- \item [e.g., "My relationship with my sister - I don't want to hurt her"]
-\end{itemize}
-
-\subsection*{Emergency Procedures}
-
-\textbf{Patient to seek immediate care (Emergency Department or call 911) if}:
-\begin{itemize}[leftmargin=*]
- \item Active suicidal ideation with plan and intent
- \item Unable to maintain safety despite using crisis plan
- \item Acute psychosis (hallucinations, delusions, disorganized behavior)
- \item Severe agitation or aggression toward others
- \item Substance intoxication/overdose
-\end{itemize}
-
-\textbf{Provider to intervene if}:
-\begin{itemize}[leftmargin=*]
- \item Increased suicide risk (passive → active SI, plan development)
- \item Significant worsening of depression or emergence of psychotic symptoms
- \item Non-adherence with safety plan
- \item Relapse in substance use
- \item Actions: Increase visit frequency, consider higher level of care (IOP/PHP/inpatient), medication adjustment, collateral contact with family
-\end{itemize}
-
-% ===== SECTION 8: PATIENT EDUCATION =====
-\section*{8. Patient Education and Psychoeducation}
-
-\subsection*{Understanding Depression}
-
-Education provided on:
-\begin{itemize}[leftmargin=*]
- \item \textbf{What is Depression}: Biological illness, not weakness or character flaw
- \item \textbf{Neurobiology}: Serotonin, norepinephrine, brain circuits involved
- \item \textbf{Course}: Episodic illness, high recurrence rate, importance of treatment adherence
- \item \textbf{Treatment}: Evidence for medication + therapy combination
-\end{itemize}
-
-\subsection*{Medication Education}
-
-\begin{itemize}[leftmargin=*]
- \item How SSRIs work (increase serotonin availability)
- \item Timeline for response (2-4 weeks initial, 6-8 weeks full effect)
- \item Common side effects and management
- \item Importance of daily adherence (not "as needed")
- \item Not addictive, but need to taper when discontinuing
- \item Maintenance treatment (continue 6-12 months after remission)
-\end{itemize}
-
-\subsection*{Therapy Skills and Homework}
-
-\begin{itemize}[leftmargin=*]
- \item CBT model: Thoughts → Feelings → Behaviors (interconnected)
- \item Behavioral activation: Activity improves mood (not the reverse)
- \item Cognitive distortions: Common thinking errors in depression
- \item Thought challenging: Evidence for/against, alternative perspectives
- \item Skills practice between sessions is essential
-\end{itemize}
-
-\subsection*{Self-Management Strategies}
-
-\begin{itemize}[leftmargin=*]
- \item Recognize early warning signs of depression
- \item When to call provider (worsening symptoms, suicidal thoughts)
- \item Lifestyle factors: sleep, exercise, nutrition, substance use
- \item Stress management and self-care
- \item Building and maintaining social connections
-\end{itemize}
-
-\subsection*{Resources Provided}
-
-\begin{itemize}[leftmargin=*]
- \item Crisis hotline numbers (988, Crisis Text Line)
- \item CBT self-help books: "Feeling Good" by David Burns, "Mind Over Mood"
- \item Meditation apps: Headspace, Calm, Insight Timer
- \item Exercise resources: Local trails, gyms, online yoga
- \item NAMI (National Alliance on Mental Illness) support groups
- \item Depression and Bipolar Support Alliance (DBSA)
-\end{itemize}
-
-% ===== SECTION 9: FOLLOW-UP AND DISCHARGE =====
-\section*{9. Follow-Up and Discharge Planning}
-
-\subsection*{Continuation and Maintenance Treatment}
-
-\textbf{After Acute Treatment (if goals achieved)}:
-\begin{itemize}[leftmargin=*]
- \item Continue medication for 6-12 months minimum after remission
- \item Taper therapy to biweekly, then monthly "booster" sessions
- \item Regular symptom monitoring (monthly PHQ-9)
- \item Psychiatry visits every 2-3 months for medication management
-\end{itemize}
-
-\subsection*{Relapse Prevention}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Early Warning Signs}: [Patient-specific list from treatment]
- \item \textbf{Action Plan}: If warning signs emerge, resume weekly therapy, contact psychiatrist
- \item \textbf{Protective Factors}: Maintain exercise, sleep, social connections, continue medication
- \item \textbf{Ongoing Skills Practice}: Continue thought records, behavioral activation as needed
-\end{itemize}
-
-\subsection*{Discharge Criteria}
-
-Ready for discharge when:
-\begin{itemize}[leftmargin=*]
- \item PHQ-9 $<$5 sustained for 4+ weeks
- \item No suicidal ideation
- \item Functional recovery (working or engaged in meaningful activities, social connections restored)
- \item Mastery of CBT skills and relapse prevention plan
- \item Stable on medication regimen
- \item Patient and provider agree discharge is appropriate
-\end{itemize}
-
-\subsection*{Discharge Recommendations}
-
-\begin{itemize}[leftmargin=*]
- \item Continue antidepressant for 6-12 months, then discuss tapering with psychiatrist
- \item Monthly "check-in" sessions available if needed
- \item Return to treatment if early warning signs emerge
- \item Continue healthy lifestyle practices
- \item Stay connected with support system
- \item Annual depression screening with primary care provider
-\end{itemize}
-
-% ===== SECTION 10: INFORMED CONSENT =====
-\section*{10. Informed Consent and Collaboration}
-
-\subsection*{Treatment Consent}
-
-The following have been discussed with the patient:
-\begin{itemize}[leftmargin=*]
- \item Diagnosis, symptoms, and prognosis
- \item Treatment options (medication, therapy, combination, no treatment)
- \item Risks and benefits of recommended treatment
- \item Expected timeline for improvement
- \item Potential side effects of medication
- \item Alternatives to proposed treatment
- \item Importance of adherence and therapy homework
- \item Right to refuse or discontinue treatment
- \item Limits of confidentiality (harm to self/others, abuse)
-\end{itemize}
-
-Patient demonstrates understanding and agrees to treatment plan. Questions answered satisfactorily. Patient has opportunity for shared decision-making and treatment preferences incorporated.
-
-\subsection*{Collaborative Treatment Agreement}
-
-\textbf{Provider Responsibilities}:
-\begin{itemize}[leftmargin=*]
- \item Provide evidence-based treatment
- \item Monitor progress and adjust treatment as needed
- \item Maintain availability for emergencies (or provide backup coverage)
- \item Respect patient autonomy and preferences
-\end{itemize}
-
-\textbf{Patient Responsibilities}:
-\begin{itemize}[leftmargin=*]
- \item Attend scheduled appointments
- \item Take medications as prescribed
- \item Complete therapy homework
- \item Communicate openly about symptoms and concerns
- \item Contact provider if symptoms worsen or suicidal thoughts emerge
- \item Follow safety plan
-\end{itemize}
-
-% ===== SECTION 11: SIGNATURES =====
-\vspace{2em}
-
-\section*{11. Provider Signature and Attestation}
-
-I have reviewed this treatment plan with the patient. The patient demonstrates understanding of the diagnosis, treatment recommendations, risks and benefits, and alternatives. The patient has been involved in shared decision-making. Safety planning has been completed. The patient agrees to this treatment plan.
-
-\vspace{1em}
-
-\begin{tabular}{ll}
-Provider Signature: & \rule{7cm}{0.5pt} \\[1em]
-Provider Name/Credentials: & \rule{7cm}{0.5pt} \\[1em]
-Date: & \rule{4cm}{0.5pt} \\[2em]
-\end{tabular}
-
-\subsection*{Patient Acknowledgment}
-
-I have reviewed this treatment plan with my mental health provider. I understand my diagnosis, treatment goals, and the recommended interventions. My questions have been answered. I agree to participate in this treatment plan and will contact my provider if I have concerns or my symptoms worsen.
-
-\vspace{1em}
-
-\begin{tabular}{ll}
-Patient Signature: & \rule{7cm}{0.5pt} \\[1em]
-Date: & \rule{4cm}{0.5pt} \\
-\end{tabular}
-
-\vspace{2em}
-\begin{center}
-\rule{\textwidth}{1pt}\\
-\textbf{End of Mental Health Treatment Plan}\\
-This document contains confidential patient information protected by HIPAA and 42 CFR Part 2.
-\end{center}
-
-\end{document}
-
-% ========== NOTES FOR USERS ==========
-%
-% CUSTOMIZATION:
-% - Replace all bracketed placeholders with patient-specific information
-% - Adjust CBT framework based on presenting problem (can use DBT, ACT, IPT instead)
-% - Modify safety plan collaboratively with patient
-% - Select appropriate medications based on diagnosis and patient factors
-%
-% IMPORTANT:
-% - Complete thorough suicide risk assessment
-% - Document safety planning
-% - Ensure crisis resources are accurate and accessible
-% - Maintain 42 CFR Part 2 confidentiality for substance use information
-%
-% COMPILATION:
-% pdflatex mental_health_treatment_plan.tex
-
diff --git a/skills/treatment-plans/assets/one_page_treatment_plan.tex b/skills/treatment-plans/assets/one_page_treatment_plan.tex
deleted file mode 100644
index 2897b6e0..00000000
--- a/skills/treatment-plans/assets/one_page_treatment_plan.tex
+++ /dev/null
@@ -1,193 +0,0 @@
-% One-Page Treatment Plan Template
-% Concise, clinician-focused treatment recommendation
-% Modeled after precision oncology reports and clinical decision support cards
-% Last updated: 2025
-
-\documentclass[10pt,letterpaper]{article}
-
-% Minimal packages for clean, dense layout
-\usepackage[top=0.5in,bottom=0.5in,left=0.6in,right=0.6in]{geometry}
-\usepackage{amsmath,amssymb}
-\usepackage[utf8]{inputenc}
-\usepackage{graphicx}
-\usepackage{array}
-\usepackage{booktabs}
-\usepackage{enumitem}
-\usepackage{xcolor}
-\usepackage{fancyhdr}
-\usepackage{tabularx}
-\usepackage[most]{tcolorbox}
-\usepackage{multicol}
-
-% Compact spacing
-\setlist{nosep,leftmargin=*,itemsep=0pt,topsep=2pt}
-\setlength{\parindent}{0pt}
-\setlength{\parskip}{4pt}
-
-% No page numbers for single page
-\pagestyle{empty}
-
-% Section formatting - compact
-\usepackage{titlesec}
-\titlespacing*{\section}{0pt}{8pt}{4pt}
-\titlespacing*{\subsection}{0pt}{6pt}{3pt}
-\titleformat{\section}{\normalsize\bfseries\sffamily}{\thesection}{0em}{}
-\titleformat{\subsection}{\small\bfseries\sffamily}{\thesubsection}{0em}{}
-
-% Color scheme
-\definecolor{headerblue}{RGB}{0,102,153}
-\definecolor{lightgray}{RGB}{240,240,240}
-\definecolor{darkgray}{RGB}{80,80,80}
-
-\begin{document}
-
-% ========== TITLE ==========
-\begin{center}
-{\small\textit{PRECISION MEDICINE / CLINICAL RECOMMENDATION}}\\[2pt]
-{\Large\bfseries\sffamily [Treatment Type]}\\[1pt]
-{\normalsize\textit{[Condition/Disease Name]}}
-\end{center}
-
-\vspace{-8pt}
-
-% ========== PATIENT/CASE INFO BOX ==========
-\begin{tcolorbox}[
- colback=lightgray,
- colframe=headerblue,
- boxrule=0.5pt,
- arc=2pt,
- left=4pt,right=4pt,top=3pt,bottom=3pt,
- fontupper=\small
-]
-\textbf{Patient ID:} [De-identified ID] \hfill \textbf{Date:} \today\\
-\textbf{Diagnosis:} [Primary diagnosis + ICD-10] \hfill \textbf{Stage/Grade:} [If applicable]\\
-\textbf{Age/Sex:} [Age range, sex] \hfill \textbf{Molecular Profile:} [Key biomarkers or cluster, if applicable]
-\end{tcolorbox}
-
-\vspace{4pt}
-
-% ========== TWO-COLUMN LAYOUT FOR EFFICIENCY ==========
-\begin{multicols}{2}
-
-% ========== LEFT COLUMN ==========
-
-\section*{TARGET PATIENT POPULATION}
-{\small
-\textbf{Number of Patients:} [N (\% of cohort)]\\
-\textbf{Key Features:} [Brief demographic or clinical features]\\
-\textbf{Inclusion Criteria:} [1-2 key criteria]
-}
-
-\section*{PRIMARY TREATMENT REGIMEN}
-{\small
-\begin{enumerate}[leftmargin=12pt]
- \item \textbf{[Intervention 1]:} [Specific details]
- \begin{itemize}
- \item Dose: [specific dosing]
- \item Frequency: [schedule]
- \item Duration: [timeframe]
- \end{itemize}
-
- \item \textbf{[Intervention 2]:} [Specific details]
- \begin{itemize}
- \item [Key parameters]
- \end{itemize}
-
- \item \textbf{[Intervention 3]:} [Optional, if needed]
- \begin{itemize}
- \item [Key parameters]
- \end{itemize}
-\end{enumerate}
-}
-
-\section*{SUPPORTIVE CARE}
-{\small
-\begin{itemize}
- \item \textbf{[Supportive Med 1]:} [dose/frequency]
- \item \textbf{[Supportive Med 2]:} [dose/frequency]
- \item \textbf{[Other support]:} [brief description]
-\end{itemize}
-}
-
-\section*{RATIONALE}
-{\small
-[1-3 sentences explaining why this regimen is appropriate for this patient. Include key pathophysiology, guideline alignment, or molecular rationale if applicable.]
-}
-
-\columnbreak
-
-% ========== RIGHT COLUMN ==========
-
-\section*{MOLECULAR TARGETS / RISK FACTORS}
-{\small
-\begin{itemize}
- \item \textbf{[Target/Factor 1]:} [Value/status]
- \item \textbf{[Target/Factor 2]:} [Value/status]
- \item \textbf{[Target/Factor 3]:} [Value/status]
-\end{itemize}
-}
-
-\section*{EVIDENCE LEVEL}
-{\small
-\textbf{[Level designation - e.g., Level 1, FDA approved]}\\
-\textbf{Supporting Evidence:} [Guideline name/year or key trial]\\
-\textbf{References:} [1-2 key citations in abbreviated format]
-}
-
-\section*{MONITORING REQUIREMENTS}
-{\small
-\begin{tabular}{@{}ll@{}}
-\textbf{Parameter} & \textbf{Frequency} \\
-\hline
-[Lab/vital 1] & [e.g., Weekly x 4 weeks] \\
-[Lab/vital 2] & [e.g., Monthly x 3 months] \\
-[Lab/vital 3] & [e.g., Every 3 months] \\
-[Assessment tool] & [e.g., Baseline, 3 mo, 6 mo] \\
-\end{tabular}
-}
-
-\section*{EXPECTED CLINICAL BENEFIT}
-{\small
-\textbf{Primary Outcome:} [e.g., Median OS 20.9 months]\\
-\textbf{Timeline:} [e.g., Response assessment at 12 weeks]\\
-\textbf{Success Criteria:} [Specific metrics for goal achievement]
-}
-
-\section*{CRITICAL DECISION POINTS}
-{\small
-\begin{itemize}
- \item \textbf{Hold treatment if:} [Specific criteria]
- \item \textbf{Dose modify for:} [Specific criteria]
- \item \textbf{Discontinue if:} [Specific criteria]
-\end{itemize}
-}
-
-\end{multicols}
-
-\vspace{4pt}
-
-% ========== BOTTOM SECTION - FULL WIDTH ==========
-\begin{tcolorbox}[
- colback=yellow!10,
- colframe=red!60!black,
- boxrule=0.8pt,
- arc=2pt,
- left=4pt,right=4pt,top=3pt,bottom=3pt,
- fontupper=\small\bfseries
-]
-\textbf{EMERGENCY CONTACTS / URGENT CONCERNS:} \\
-{\small\normalfont
-Call [clinic/provider] immediately for: [List 2-3 red flag symptoms]. \\
-Emergency: 911 | Clinic: [phone] | After-hours: [phone] | Pharmacy: [phone]
-}
-\end{tcolorbox}
-
-\vspace{6pt}
-
-{\footnotesize\textit{
-Prepared by: [Provider name, credentials] | Plan created: \today | Next review: [date] \\
-HIPAA Notice: This document contains de-identified patient information per Safe Harbor standards.
-}}
-
-\end{document}
-
diff --git a/skills/treatment-plans/assets/pain_management_plan.tex b/skills/treatment-plans/assets/pain_management_plan.tex
deleted file mode 100644
index cf7678f4..00000000
--- a/skills/treatment-plans/assets/pain_management_plan.tex
+++ /dev/null
@@ -1,799 +0,0 @@
-% Pain Management Plan Template
-% For acute and chronic pain treatment
-% Last updated: 2025
-
-\documentclass[11pt,letterpaper]{article}
-
-% Packages
-\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
-\usepackage[utf8]{inputenc}
-\usepackage{array}
-\usepackage{longtable}
-\usepackage{booktabs}
-\usepackage{enumitem}
-\usepackage{xcolor}
-\usepackage{fancyhdr}
-\usepackage{lastpage}
-\usepackage{tabularx}
-\usepackage[most]{tcolorbox}
-
-% Header and footer
-\pagestyle{fancy}
-\fancyhf{}
-\lhead{Pain Management Plan}
-\rhead{Page \thepage\ of \pageref{LastPage}}
-\lfoot{Date Created: \today}
-\rfoot{Confidential Patient Information}
-
-% Title formatting
-\usepackage{titlesec}
-\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
-\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{1em}{}
-
-\begin{document}
-
-% Title
-\begin{center}
-{\Large\bfseries PAIN MANAGEMENT PLAN}\\[0.5em]
-{\large Comprehensive Multimodal Pain Treatment}\\[0.5em]
-\rule{\textwidth}{1pt}
-\end{center}
-
-\vspace{1em}
-
-% ===== TREATMENT PLAN HIGHLIGHTS (Foundation Medicine Model) =====
-\begin{tcolorbox}[colback=yellow!10!white,colframe=yellow!75!black,title=\textbf{TREATMENT PLAN HIGHLIGHTS},fonttitle=\bfseries\large]
-
-\textbf{Pain Diagnosis:} [Primary pain condition - e.g., Chronic low back pain, nociceptive/neuropathic mixed]
-
-\vspace{0.3em}
-\textbf{Primary Treatment Goals:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item [Goal 1 - e.g., Reduce pain from 8/10 to $<$5/10 within 8 weeks]
- \item [Goal 2 - e.g., Return to work with accommodations within 12 weeks]
- \item [Goal 3 - e.g., Improve physical function - walk 30 minutes without significant pain]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Main Interventions:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Multimodal Pharmacotherapy:} [Medications - e.g., Acetaminophen, duloxetine, topical lidocaine]
- \item \textit{Physical Interventions:} [Therapies - e.g., PT 2x/week, core strengthening, heat/ice]
- \item \textit{Behavioral:} [Approaches - e.g., CBT for pain, relaxation techniques, activity pacing]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Timeline:} [Phases - e.g., Intensive treatment (8 weeks), Optimization (12 weeks), Long-term management]
-
-\end{tcolorbox}
-
-\vspace{1em}
-
-% ===== SECTION 1: PATIENT AND PAIN INFORMATION =====
-\section*{1. Patient Information and Pain Assessment}
-
-\textbf{HIPAA Notice}: De-identify all protected health information before sharing.
-
-\vspace{0.5em}
-
-\begin{tabularx}{\textwidth}{|l|X|}
-\hline
-\textbf{Patient ID} & [De-identified code, e.g., PM-001] \\ \hline
-\textbf{Age Range} & [e.g., 45-50 years] \\ \hline
-\textbf{Sex} & [Male/Female/Other] \\ \hline
-\textbf{Date of Plan} & [Month/Year only] \\ \hline
-\textbf{Pain Specialist} & [Name, MD, Credentials] \\ \hline
-\textbf{Referring Provider} & [Name, MD/NP/PA] \\ \hline
-\textbf{Facility} & [Pain clinic/hospital name] \\ \hline
-\end{tabularx}
-
-\vspace{1em}
-
-\subsection*{Pain Characteristics}
-
-\textbf{Pain Type}: [e.g., Chronic low back pain] ☐ Acute ☑ Chronic
-
-\textbf{Primary Pain Diagnosis}: [e.g., Chronic lumbar radiculopathy] (ICD-10: [M54.16])
-
-\textbf{Secondary Pain Diagnoses}:
-\begin{itemize}[leftmargin=*]
- \item [e.g., Lumbar spinal stenosis] (ICD-10: [M48.06])
- \item [e.g., Degenerative disc disease L4-L5] (ICD-10: [M51.36])
-\end{itemize}
-
-\textbf{Duration}: [e.g., 3 years of chronic pain, worsening past 6 months]
-
-\textbf{Pain Location}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Primary}: Lower back (lumbar region L4-L5)
- \item \textbf{Radiation}: Right leg, posterior thigh to calf (sciatic distribution)
- \item \textbf{Secondary}: [Other pain sites if applicable]
-\end{itemize}
-
-\textbf{Pain Quality}: [e.g., Sharp, shooting pain in leg; dull ache in back]
-
-\textbf{Pain Intensity}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Current}: [e.g., 7/10 numeric rating scale (NRS)]
- \item \textbf{Average (past week)}: [e.g., 6/10]
- \item \textbf{Worst}: [e.g., 9/10]
- \item \textbf{Best}: [e.g., 4/10 with rest]
- \item \textbf{At night}: [e.g., 6/10, disrupts sleep]
-\end{itemize}
-
-\textbf{Temporal Pattern}:
-\begin{itemize}[leftmargin=*]
- \item ☐ Constant ☑ Intermittent ☐ Episodic
- \item \textbf{Frequency}: Daily, worse with activity
- \item \textbf{Duration of episodes}: Varies, 2-6 hours of severe pain
- \item \textbf{Breakthrough pain}: [e.g., Yes, with bending, lifting, prolonged sitting]
-\end{itemize}
-
-\textbf{Aggravating Factors}:
-\begin{itemize}[leftmargin=*]
- \item Prolonged sitting ($>$30 minutes)
- \item Bending forward
- \item Lifting objects $>$10 lbs
- \item Prolonged standing
- \item Coughing, sneezing (increases radicular pain)
-\end{itemize}
-
-\textbf{Alleviating Factors}:
-\begin{itemize}[leftmargin=*]
- \item Lying supine with knees elevated
- \item Heat application to lower back
- \item Walking short distances (5-10 minutes)
- \item Current pain medications (partial relief)
-\end{itemize}
-
-\subsection*{Pain Impact Assessment}
-
-\textbf{Functional Interference} (Brief Pain Inventory - BPI):
-
-\begin{tabularx}{\textwidth}{|l|c|X|}
-\hline
-\textbf{Domain} & \textbf{Score (0-10)} & \textbf{Description} \\ \hline
-General Activity & 7/10 & Significantly limited household tasks \\ \hline
-Mood & 6/10 & Frustration, irritability, mild depression \\ \hline
-Walking Ability & 8/10 & Can walk only 5-10 minutes before pain \\ \hline
-Work & 9/10 & Unable to work (construction job), on disability \\ \hline
-Relationships & 5/10 & Decreased social engagement \\ \hline
-Sleep & 7/10 & Difficulty falling asleep, awakens with pain \\ \hline
-Enjoyment of Life & 8/10 & Cannot participate in hobbies (fishing, gardening) \\ \hline
-\end{tabularx}
-
-\textbf{Quality of Life Impact}:
-\begin{itemize}[leftmargin=*]
- \item Unable to work for 1 year
- \item Difficulty with ADLs (bathing, dressing due to bending limitations)
- \item Social isolation, stopped attending family events
- \item Stopped recreational activities (fishing, yard work)
- \item Relationship strain with spouse
-\end{itemize}
-
-\textbf{Psychological Impact}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Depression Screening} (PHQ-9): [e.g., 12/27 - Moderate depression]
- \item \textbf{Anxiety Screening} (GAD-7): [e.g., 10/21 - Moderate anxiety]
- \item \textbf{Pain Catastrophizing}: [e.g., Moderate - frequent thoughts that pain won't improve]
- \item \textbf{Sleep Disturbance}: [e.g., 5-6 hours/night, poor quality]
-\end{itemize}
-
-\subsection*{Previous Pain Treatments}
-
-\textbf{Medications Tried}:
-\begin{longtable}{|p{3cm}|p{2.5cm}|p{7.5cm}|}
-\hline
-\textbf{Medication} & \textbf{Duration} & \textbf{Response} \\ \hline
-NSAIDs (ibuprofen) & 2 years & Partial relief initially, GI upset, ineffective now \\ \hline
-Acetaminophen & 1 year & Minimal benefit \\ \hline
-Cyclobenzaprine & 6 months & Sedation, minimal pain relief, discontinued \\ \hline
-Gabapentin & 3 months & Tried up to 1800mg/day, minimal benefit, dizziness \\ \hline
-Tramadol & 1 year & Partial relief, nausea, stopped working \\ \hline
-[List others] & & \\ \hline
-\end{longtable}
-
-\textbf{Interventional Procedures}:
-\begin{itemize}[leftmargin=*]
- \item Lumbar epidural steroid injection (ESI) x2 - Last [6 months ago], temporary relief (3-4 weeks)
- \item Physical therapy: 3 months, minimal sustained benefit
- \item Chiropractic care: 6 months, temporary relief only
-\end{itemize}
-
-\textbf{Non-pharmacological}:
-\begin{itemize}[leftmargin=*]
- \item Physical therapy, home exercise program (partial compliance)
- \item Heat/ice application
- \item TENS unit (limited benefit)
-\end{itemize}
-
-\subsection*{Medical and Surgical History}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Relevant Comorbidities}: Hypertension, GERD, obesity (BMI 33)
- \item \textbf{Previous Surgeries}: None on spine
- \item \textbf{Imaging}:
- \begin{itemize}
- \item Lumbar MRI [6 months ago]: L4-L5 disc herniation, moderate central stenosis, right foraminal narrowing
- \item No surgical candidacy per neurosurgery consultation
- \end{itemize}
- \item \textbf{Current Medications}: Lisinopril 20mg daily, omeprazole 20mg daily
- \item \textbf{Allergies}: NKDA
-\end{itemize}
-
-\subsection*{Substance Use and Risk Assessment}
-
-\textbf{Alcohol}: [e.g., Social use, 2-3 drinks/week]
-
-\textbf{Tobacco}: [e.g., 10 pack-year history, quit 2 years ago]
-
-\textbf{Illicit Drugs}: [e.g., Denies current or past use]
-
-\textbf{Opioid Risk Tool (ORT) Score}: [e.g., 3 points - Moderate risk]
-\begin{itemize}[leftmargin=*]
- \item Family history of substance abuse: Yes (1 point)
- \item Personal history of substance abuse: No
- \item Age 16-45: No (patient is 45-50)
- \item History of preadolescent sexual abuse: No
- \item Psychological disease: Depression (2 points)
-\end{itemize}
-
-\textbf{Urine Drug Screen (UDS)}: [e.g., Negative - Baseline before starting controlled substances]
-
-\textbf{Prescription Drug Monitoring Program (PDMP)}: [e.g., Checked - No other controlled substance prescriptions]
-
-% ===== SECTION 2: PAIN MANAGEMENT GOALS =====
-\section*{2. Pain Management Goals (SMART Format)}
-
-\textbf{Realistic Expectations Discussed}: Complete pain elimination unlikely; goal is meaningful pain reduction and improved function.
-
-\subsection*{2.1 Short-Term Goals (4-8 weeks)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Pain Intensity}: Reduce average pain from 6-7/10 to 4-5/10 using multimodal analgesia within 6 weeks.
-
- \item \textbf{Functional Improvement}: Increase walking tolerance from 5-10 minutes to 20-30 minutes within 8 weeks.
-
- \item \textbf{Sleep}: Improve sleep quality from 5-6 hours to 7 hours per night with fewer pain-related awakenings within 4 weeks.
-
- \item \textbf{Medication Optimization}: Establish effective multimodal regimen with minimal side effects within 4 weeks.
-\end{enumerate}
-
-\subsection*{2.2 Long-Term Goals (3-6 months)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Pain Reduction}: Achieve average pain level of 3-4/10, allowing engagement in daily activities within 3 months.
-
- \item \textbf{Return to Work}: Explore modified duty or vocational rehabilitation with goal of returning to some form of employment within 6 months.
-
- \item \textbf{Functional Activities}: Resume light recreational activities (fishing, light gardening with modifications) within 4 months.
-
- \item \textbf{Psychological Well-being}: Reduce depression (PHQ-9 $<$10) and anxiety (GAD-7 $<$8) through pain relief and CBT within 3 months.
-
- \item \textbf{Reduced Pain Interference}: Improve BPI interference scores by 30-40\% across all domains within 6 months.
-
- \item \textbf{Opioid Reduction}: If opioids initiated, taper to lowest effective dose or discontinue if alternative strategies successful.
-\end{enumerate}
-
-\subsection*{2.3 Patient-Identified Goals}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Priority 1}: "I want to be able to play with my grandkids without being in agony"
- \item \textbf{Priority 2}: "I want to sleep through the night"
- \item \textbf{Priority 3}: "I want to do some kind of work, even if not my old job"
- \item \textbf{Priority 4}: "I don't want to be on pain pills forever"
-\end{itemize}
-
-% ===== SECTION 3: MULTIMODAL TREATMENT PLAN =====
-\section*{3. Comprehensive Multimodal Treatment Plan}
-
-\textbf{Approach}: Opioid-sparing multimodal analgesia with combination pharmacologic, interventional, physical, and psychological therapies.
-
-\subsection*{3.1 Pharmacological Management}
-
-\textbf{First-Line Non-Opioid Analgesics}:
-
-\begin{longtable}{|p{3cm}|p{2cm}|p{2cm}|p{6.5cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Rationale \& Instructions} \\ \hline
-\endfirsthead
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Rationale \& Instructions} \\ \hline
-\endhead
-
-Duloxetine (Cymbalta) & 30mg, titrate to 60mg & Daily & \textbf{Rationale}: SNRI approved for chronic MSK pain, also treats comorbid depression. \textbf{Start}: 30mg daily x 1 week, then 60mg daily. \textbf{Benefit}: Pain reduction + mood improvement. \textbf{Monitor}: Nausea (take with food), BP, suicidal ideation first weeks. \\ \hline
-
-Meloxicam & 15mg & Daily & \textbf{Rationale}: NSAID for inflammatory component. \textbf{Instructions}: Take with food. \textbf{Monitor}: GI symptoms (on PPI already), renal function, BP. \textbf{Duration}: Trial 4-8 weeks, reassess if benefit vs. risk. \\ \hline
-
-Acetaminophen ER & 1300mg & TID (scheduled) & \textbf{Rationale}: Baseline analgesic, opioid-sparing. \textbf{Max}: 4000mg/day. Safe with liver function normal. Scheduled, not PRN for chronic pain. \\ \hline
-
-Tizanidine & 2-4mg & QHS & \textbf{Rationale}: Muscle relaxant for muscle spasm component. \textbf{Start}: 2mg QHS, may increase to 4mg. \textbf{SE}: Sedation (beneficial for sleep), dry mouth. \textbf{Monitor}: BP (can lower), LFTs. \\ \hline
-
-[Add as needed] & & & \\ \hline
-\end{longtable}
-
-\textbf{Adjuvant Analgesics} (If first-line insufficient):
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Pregabalin (Lyrica)}: If neuropathic component predominates
- \begin{itemize}
- \item Start 75mg BID, titrate to 150mg BID over 1-2 weeks
- \item Monitor: Dizziness, sedation, weight gain, peripheral edema
- \item More effective than gabapentin, better tolerability for many patients
- \end{itemize}
-\end{itemize}
-
-\textbf{Topical Therapies}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Diclofenac gel 1\%}: Apply to lower back QID (NSAID, local effect)
- \item \textbf{Lidocaine patches 5\%}: Apply to painful area up to 12 hours daily
- \item \textbf{Compounded creams}: [If appropriate - ketoprofen/baclofen/cyclobenzaprine cream]
-\end{itemize}
-
-\textbf{Opioid Therapy} (If conservative measures inadequate):
-
-\textit{Note: Opioids considered only after multimodal non-opioid therapies trialed. CDC guidelines followed.}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Indication}: Severe functional impairment despite aggressive non-opioid multimodal therapy
- \item \textbf{Risk-Benefit Discussion}: Documented - risks (dependence, tolerance, side effects, overdose) vs. benefits (functional improvement)
- \item \textbf{Informed Consent}: Opioid treatment agreement signed
- \item \textbf{Starting Opioid}: [e.g., Oxycodone 5mg Q6H PRN] - Lowest effective dose, short-acting initially
- \item \textbf{Morphine Milligram Equivalent (MME)}: Start $<$50 MME/day, avoid $>$90 MME/day if possible
- \item \textbf{Monitoring Plan}:
- \begin{itemize}
- \item UDS every 3-6 months
- \item PDMP check every prescription
- \item Reassess pain and function every 1-3 months
- \item Naloxone co-prescribed for overdose reversal
- \item Pain contract/opioid agreement
- \end{itemize}
- \item \textbf{Taper Plan}: If goals not met or risks outweigh benefits, slow taper (10-25\% per week to month)
-\end{itemize}
-
-\subsection*{3.2 Interventional Pain Procedures}
-
-\textbf{Recommended Procedures}:
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Lumbar Epidural Steroid Injection (ESI)} - Repeat series
- \begin{itemize}
- \item \textbf{Indication}: Radicular pain from disc herniation/stenosis
- \item \textbf{Approach}: Transforaminal at L4-L5 right (fluoroscopy-guided)
- \item \textbf{Timing}: Can repeat if previous 3-4 week relief, up to 3-4 injections/year
- \item \textbf{Expected Benefit}: 50-70\% experience significant short-term relief
- \end{itemize}
-
- \item \textbf{Medial Branch Blocks (MBB)} - Diagnostic
- \begin{itemize}
- \item \textbf{Indication}: Assess facet joint contribution to pain
- \item \textbf{Target}: L3-L4, L4-L5 facets bilaterally
- \item \textbf{Next Step}: If $>$50\% relief x2 blocks, proceed to radiofrequency ablation (RFA)
- \end{itemize}
-
- \item \textbf{Radiofrequency Ablation (RFA)} - If MBB positive
- \begin{itemize}
- \item \textbf{Indication}: Facet-mediated pain confirmed by diagnostic blocks
- \item \textbf{Expected Duration}: 6-12 months of relief
- \item \textbf{Repeatable}: Can repeat when pain returns
- \end{itemize}
-
- \item \textbf{Spinal Cord Stimulation (SCS)} - If refractory
- \begin{itemize}
- \item \textbf{Indication}: Failed conservative management, not surgical candidate
- \item \textbf{Trial First}: Percutaneous trial x 5-7 days
- \item \textbf{Permanent Implant}: If trial successful ($>$50\% pain relief, functional improvement)
- \item \textbf{Success Rate}: 50-60\% achieve sustained benefit
- \end{itemize}
-\end{enumerate}
-
-\textbf{Procedure Timeline}:
-\begin{itemize}[leftmargin=*]
- \item Month 1: ESI series (up to 3 injections, 2 weeks apart)
- \item Month 2: Evaluate ESI response, if inadequate → MBB diagnostic blocks
- \item Month 3: If MBB positive ($>$50\% relief) → RFA
- \item Month 4-6: Reassess, if still refractory → consider SCS trial
-\end{itemize}
-
-\subsection*{3.3 Physical and Rehabilitation Therapies}
-
-\textbf{Physical Therapy} (Comprehensive program):
-\begin{itemize}[leftmargin=*]
- \item \textbf{Frequency}: 2-3x/week x 8-12 weeks
- \item \textbf{Focus Areas}:
- \begin{itemize}
- \item Core strengthening (abdominals, paraspinals)
- \item Hip and leg strengthening (reduce spinal load)
- \item Flexibility and stretching (hamstrings, hip flexors)
- \item Posture and body mechanics training
- \item Aerobic conditioning (aquatic therapy, stationary bike)
- \end{itemize}
- \item \textbf{Manual Therapy}: Soft tissue mobilization, joint mobilization
- \item \textbf{Modalities}: Heat, ice, TENS as adjuncts
- \item \textbf{Functional Training}: Sit-to-stand, lifting mechanics, ADL adaptations
-\end{itemize}
-
-\textbf{Home Exercise Program}:
-\begin{itemize}[leftmargin=*]
- \item Daily core exercises (planks, bird-dogs, bridges)
- \item Stretching routine (30 min daily)
- \item Walking program: Start 10 min 2x/day, gradually increase to 30 min continuous
- \item Aquatic exercise if accessible (lower impact)
-\end{itemize}
-
-\textbf{Activity Modifications}:
-\begin{itemize}[leftmargin=*]
- \item Avoid prolonged sitting ($>$30 min without breaks)
- \item Lifting restrictions: No lifting $>$20 lbs, use proper mechanics
- \item Ergonomic adjustments: Lumbar support, standing desk option
- \item Pacing strategies: Alternate activity with rest
-\end{itemize}
-
-\textbf{Weight Management}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Current BMI}: 33 (obese)
- \item \textbf{Goal}: 10\% weight loss (reduce spinal loading)
- \item \textbf{Referral}: Registered dietitian for nutrition counseling
- \item \textbf{Exercise}: Low-impact aerobic activity as tolerated
-\end{itemize}
-
-\subsection*{3.4 Psychological and Behavioral Interventions}
-
-\textbf{Cognitive Behavioral Therapy for Chronic Pain (CBT-CP)}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Frequency}: Weekly 50-min sessions x 8-12 weeks
- \item \textbf{Therapist}: Pain psychologist or licensed therapist trained in CBT-CP
- \item \textbf{Components}:
- \begin{itemize}
- \item Pain education and reconceptualization
- \item Cognitive restructuring (address catastrophizing, all-or-nothing thinking)
- \item Activity pacing and graded exposure
- \item Relaxation techniques (progressive muscle relaxation, diaphragmatic breathing)
- \item Sleep hygiene
- \item Stress management
- \item Goal-setting and problem-solving
- \end{itemize}
-\end{itemize}
-
-\textbf{Mindfulness-Based Stress Reduction (MBSR)}:
-\begin{itemize}[leftmargin=*]
- \item 8-week program, group format
- \item Meditation, body scanning, mindful movement
- \item Reduce pain catastrophizing and improve pain acceptance
-\end{itemize}
-
-\textbf{Acceptance and Commitment Therapy (ACT)}:
-\begin{itemize}[leftmargin=*]
- \item Alternative to CBT if patient prefers
- \item Focus on acceptance, values-based living despite pain
-\end{itemize}
-
-\textbf{Sleep Hygiene and Sleep Optimization}:
-\begin{itemize}[leftmargin=*]
- \item Regular sleep schedule (11 PM - 6 AM)
- \item Sleep environment optimization
- \item Avoid screens 1 hour before bed
- \item Consider trazodone 50mg QHS if sleep remains impaired (dual benefit: antidepressant + sleep aid)
-\end{itemize}
-
-\textbf{Depression and Anxiety Management}:
-\begin{itemize}[leftmargin=*]
- \item Duloxetine addresses both pain and depression
- \item Consider additional therapy if PHQ-9/GAD-7 not improving
- \item Psychiatry referral if severe or refractory
-\end{itemize}
-
-\subsection*{3.5 Complementary and Alternative Therapies}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Acupuncture}: Trial 8-10 sessions (evidence for chronic low back pain)
- \item \textbf{Massage Therapy}: 1-2x/week for muscle tension, relaxation
- \item \textbf{Yoga or Tai Chi}: Gentle movement, mind-body connection
- \item \textbf{Chiropractic Care}: Patient had some benefit previously, can continue if helpful
-\end{itemize}
-
-% ===== SECTION 4: MONITORING AND REASSESSMENT =====
-\section*{4. Monitoring Plan and Outcome Tracking}
-
-\subsection*{4.1 Regular Monitoring}
-
-\begin{tabularx}{\textwidth}{|l|c|X|}
-\hline
-\textbf{Parameter} & \textbf{Frequency} & \textbf{Method} \\ \hline
-Pain Intensity (NRS) & Daily (patient log) & 0-10 scale: average, worst, least daily \\ \hline
-Functional Interference (BPI) & Monthly & Brief Pain Inventory - 7 interference items \\ \hline
-Opioid Adherence (if prescribed) & Every visit & Pill counts, PDMP, UDS \\ \hline
-Medication Side Effects & Every visit & Systematic review \\ \hline
-Depression (PHQ-9) & Monthly & 9-item questionnaire \\ \hline
-Anxiety (GAD-7) & Monthly & 7-item questionnaire \\ \hline
-Sleep Quality & Weekly (patient log) & Hours slept, quality rating \\ \hline
-Physical Activity & Weekly (patient log) & Minutes walked, exercise completed \\ \hline
-Work Status & Monthly & Hours worked, restrictions \\ \hline
-\end{tabularx}
-
-\subsection*{4.2 Follow-Up Schedule}
-
-\begin{longtable}{|l|l|X|}
-\hline
-\textbf{Timeframe} & \textbf{Provider} & \textbf{Purpose} \\ \hline
-Week 2 & Pain clinic (phone) & Medication tolerance check, early side effects \\ \hline
-Week 4 & Pain specialist & Medication adjustment, assess early response, plan interventions \\ \hline
-Week 8 & Pain specialist & Comprehensive reassessment, BPI, goal progress review \\ \hline
-Month 3 & Pain specialist & Evaluate treatment response, modify plan if needed \\ \hline
-Month 6 & Pain specialist & Long-term goal assessment, maintenance planning \\ \hline
-Ongoing & Every 1-3 months & Chronic pain management, medication refills (if opioids: monthly) \\ \hline
-Physical Therapy & 2-3x/week x 8-12 weeks & See PT plan \\ \hline
-Psychology (CBT) & Weekly x 8-12 weeks & See psychological interventions \\ \hline
-\end{longtable}
-
-\subsection*{4.3 Treatment Response Criteria}
-
-\textbf{Success Criteria} (Re-evaluate at 3 months):
-\begin{itemize}[leftmargin=*]
- \item Pain reduction $\geq$30\% (clinically meaningful)
- \item Functional improvement: BPI interference reduced $\geq$30\%
- \item Improved quality of life: Return to valued activities
- \item Acceptable side effect profile
-\end{itemize}
-
-\textbf{If Goals Not Met}: Modify treatment plan
-\begin{itemize}[leftmargin=*]
- \item Adjust medications (change dose, switch agents, add adjuvants)
- \item Add or modify interventional procedures
- \item Intensify physical therapy or psychological therapy
- \item Consider multidisciplinary pain rehabilitation program
- \item Reassess diagnosis (imaging, specialist consultation)
-\end{itemize}
-
-% ===== SECTION 5: SAFETY AND RISK MITIGATION =====
-\section*{5. Safety Planning and Risk Mitigation}
-
-\subsection*{Opioid Safety (If Opioids Prescribed)}
-
-\textbf{Opioid Treatment Agreement}: Patient signed agreement outlining:
-\begin{itemize}[leftmargin=*]
- \item Single prescriber and pharmacy
- \item No early refills
- \item Lost/stolen medications not replaced
- \item UDS and PDMP monitoring compliance
- \item Consequences of aberrant behavior
-\end{itemize}
-
-\textbf{Naloxone Prescription}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Naloxone (Narcan) nasal spray}: Prescribed to all patients on opioids
- \item \textbf{Education}: Family member trained on use for overdose reversal
- \item \textbf{Keep at Home}: Readily accessible
-\end{itemize}
-
-\textbf{Monitoring for Aberrant Behaviors}:
-\begin{itemize}[leftmargin=*]
- \item Early refill requests
- \item Multiple lost prescriptions
- \item Obtaining opioids from other sources (PDMP)
- \item Positive UDS for non-prescribed substances
- \item Diversion suspected
- \item \textit{Action}: If concerning behaviors → reassess, taper, refer to addiction specialist
-\end{itemize}
-
-\subsection*{Medication Safety}
-
-\textbf{Drug Interactions}:
-\begin{itemize}[leftmargin=*]
- \item Duloxetine + NSAIDs: Increased bleeding risk (monitor)
- \item Tizanidine + alcohol: Enhanced sedation (educate patient to avoid)
- \item Multiple CNS depressants: Additive sedation (avoid benzodiazepines with opioids)
-\end{itemize}
-
-\textbf{Renal and Hepatic Function}:
-\begin{itemize}[leftmargin=*]
- \item Baseline labs: BMP, LFTs
- \item Monitor every 6-12 months (NSAIDs nephrotoxic, duloxetine hepatotoxic rare)
-\end{itemize}
-
-\textbf{GI Protection}:
-\begin{itemize}[leftmargin=*]
- \item Already on omeprazole (PPI) for GERD
- \item Adequate protection for NSAID use
-\end{itemize}
-
-\subsection*{Emergency Procedures}
-
-\textbf{Patient to call office or seek care if}:
-\begin{itemize}[leftmargin=*]
- \item New or worsening neurologic symptoms (weakness, numbness, bowel/bladder dysfunction - cauda equina)
- \item Severe uncontrolled pain despite medications
- \item Signs of medication overdose (excessive sedation, confusion, slow breathing)
- \item Allergic reaction to medications
- \item Severe side effects (GI bleeding, liver problems)
-\end{itemize}
-
-\textbf{Call 911 for}:
-\begin{itemize}[leftmargin=*]
- \item Suspected opioid overdose (unresponsive, slow/no breathing)
- \item Sudden onset severe back pain with leg weakness/paralysis
- \item Loss of bowel or bladder control (possible cauda equina syndrome)
-\end{itemize}
-
-% ===== SECTION 6: PATIENT EDUCATION =====
-\section*{6. Patient Education}
-
-\subsection*{Understanding Chronic Pain}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Pain Neurobiology}: Central sensitization, pain pathways, why pain persists
- \item \textbf{Biopsychosocial Model}: Pain influenced by physical, psychological, and social factors
- \item \textbf{Realistic Expectations}: Complete pain elimination unlikely, but significant improvement possible
- \item \textbf{Active Participation}: Patient role in treatment (exercise, pacing, therapy homework) essential
-\end{itemize}
-
-\subsection*{Medication Education}
-
-\begin{itemize}[leftmargin=*]
- \item How each medication works
- \item Expected timeline for benefit (SNRIs take 4-6 weeks)
- \item Common side effects and management
- \item Importance of adherence (scheduled medications work better than PRN for chronic pain)
- \item Risks of opioids if prescribed (dependence, tolerance, side effects)
-\end{itemize}
-
-\subsection*{Self-Management Skills}
-
-\begin{itemize}[leftmargin=*]
- \item Activity pacing (alternate activity with rest, avoid overexertion)
- \item Proper body mechanics (lifting, bending)
- \item Home exercise program compliance
- \item Pain flare management (rest, ice/heat, medication adjustment)
- \item Stress reduction techniques
- \item Sleep hygiene practices
-\end{itemize}
-
-\subsection*{Red Flags - When to Seek Immediate Care}
-
-\begin{itemize}[leftmargin=*]
- \item New leg weakness or foot drop
- \item Loss of bowel or bladder control
- \item Numbness in saddle/groin area
- \item Severe pain not responsive to usual medications
- \item Fever with back pain (infection concern)
-\end{itemize}
-
-% ===== SECTION 7: MULTIDISCIPLINARY COORDINATION =====
-\section*{7. Care Coordination}
-
-\textbf{Care Team}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Pain Specialist}: Medication management, interventional procedures
- \item \textbf{Primary Care Provider}: Overall health, comorbidity management, coordinate referrals
- \item \textbf{Physical Therapist}: Functional restoration, exercise program
- \item \textbf{Pain Psychologist}: CBT-CP, coping skills
- \item \textbf{Interventional Radiologist}: Perform injections (ESI, MBB, RFA)
- \item \textbf{Vocational Rehabilitation}: Return-to-work planning
- \item [Neurosurgery/Spine Surgeon: Consult if surgical candidacy changes]
-\end{itemize}
-
-\textbf{Communication Plan}:
-\begin{itemize}[leftmargin=*]
- \item All providers share treatment plan
- \item Pain specialist sends notes to PCP after each visit
- \item PT and psychologist provide progress reports monthly
- \item Patient carries medication list and pain diary
-\end{itemize}
-
-% ===== SECTION 8: DISCHARGE/TRANSITION PLANNING =====
-\section*{8. Long-Term Management and Transition}
-
-\subsection*{If Goals Achieved}
-
-\begin{itemize}[leftmargin=*]
- \item Transition to maintenance phase
- \item Reduce visit frequency (every 3-6 months)
- \item Continue home exercise program indefinitely
- \item Taper medications if possible (especially opioids)
- \item Relapse prevention plan
-\end{itemize}
-
-\subsection*{If Refractory to Treatment}
-
-\begin{itemize}[leftmargin=*]
- \item Consider multidisciplinary pain rehabilitation program (intensive 3-4 week program)
- \item Re-evaluate for surgical candidacy
- \item Advanced interventions (SCS, intrathecal pump if appropriate)
- \item Palliative care consultation for severe refractory pain
- \item Vocational rehabilitation for permanent disability if unable to return to work
-\end{itemize}
-
-% ===== SECTION 9: INFORMED CONSENT =====
-\section*{9. Informed Consent and Agreement}
-
-\textbf{Risks and Benefits Discussed}:
-
-\textbf{Benefits of Treatment Plan}:
-\begin{itemize}[leftmargin=*]
- \item Pain reduction (goal 30-50\% reduction)
- \item Improved function and quality of life
- \item Better sleep
- \item Reduced depression and anxiety
- \item Potential return to work
-\end{itemize}
-
-\textbf{Risks}:
-\begin{itemize}[leftmargin=*]
- \item Medication side effects (GI upset, sedation, others)
- \item Opioid risks if prescribed (dependence, tolerance, overdose)
- \item Injection risks (infection, bleeding, nerve injury - rare)
- \item Treatment may not be fully effective
-\end{itemize}
-
-\textbf{Patient Responsibilities}:
-\begin{itemize}[leftmargin=*]
- \item Take medications as prescribed
- \item Attend all therapy appointments (PT, psychology)
- \item Complete home exercise program
- \item Keep pain diary
- \item Communicate openly about pain and side effects
- \item If on opioids: Comply with opioid agreement, UDS, PDMP
-\end{itemize}
-
-Patient demonstrates understanding, questions answered, agrees to proceed with comprehensive pain management plan.
-
-% ===== SECTION 10: SIGNATURES =====
-\vspace{2em}
-
-\section*{10. Provider Signature and Attestation}
-
-This comprehensive pain management plan has been reviewed with the patient. The patient understands the multimodal approach, realistic expectations, risks and benefits of treatments, and their responsibilities in pain management. If opioid therapy is included, an opioid treatment agreement has been signed separately.
-
-\vspace{1em}
-
-\begin{tabular}{ll}
-Provider Signature: & \rule{7cm}{0.5pt} \\[1em]
-Provider Name/Credentials: & \rule{7cm}{0.5pt} \\[1em]
-Date: & \rule{4cm}{0.5pt} \\[2em]
-\end{tabular}
-
-\subsection*{Patient Acknowledgment}
-
-I have reviewed this pain management plan with my provider. I understand the treatments recommended, realistic expectations for pain relief, and my role in managing my pain. I agree to participate actively in this plan.
-
-\vspace{1em}
-
-\begin{tabular}{ll}
-Patient Signature: & \rule{7cm}{0.5pt} \\[1em]
-Date: & \rule{4cm}{0.5pt} \\
-\end{tabular}
-
-\vspace{2em}
-\begin{center}
-\rule{\textwidth}{1pt}\\
-\textbf{End of Pain Management Plan}\\
-This document contains confidential patient information protected by HIPAA.
-\end{center}
-
-\end{document}
-
-% ========== NOTES FOR USERS ==========
-%
-% KEY PRINCIPLES:
-% - Multimodal opioid-sparing approach
-% - CDC opioid prescribing guidelines compliance
-% - Functional improvement as primary goal (not just pain scores)
-% - Biopsychosocial model of pain
-% - Patient education and self-management emphasis
-%
-% CUSTOMIZATION:
-% - Adjust medications based on pain type (nociceptive vs. neuropathic)
-% - Select interventions appropriate for pain generator
-% - Modify based on patient comorbidities and contraindications
-% - Adapt psychological interventions to patient preference
-%
-% OPIOID CONSIDERATIONS:
-% - Use only after non-opioid therapies inadequate
-% - Lowest effective dose, short-acting preferred initially
-% - Close monitoring, UDS, PDMP
-% - Naloxone co-prescription
-% - Reassess regularly, taper if not meeting goals
-%
-% COMPILATION:
-% pdflatex pain_management_plan.tex
-
diff --git a/skills/treatment-plans/assets/perioperative_care_plan.tex b/skills/treatment-plans/assets/perioperative_care_plan.tex
deleted file mode 100644
index 3b47a099..00000000
--- a/skills/treatment-plans/assets/perioperative_care_plan.tex
+++ /dev/null
@@ -1,753 +0,0 @@
-% Perioperative Care Plan Template
-% For surgical and procedural patient management
-% Last updated: 2025
-
-\documentclass[11pt,letterpaper]{article}
-
-% Packages
-\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
-\usepackage[utf8]{inputenc}
-\usepackage{array}
-\usepackage{longtable}
-\usepackage{booktabs}
-\usepackage{enumitem}
-\usepackage{xcolor}
-\usepackage{fancyhdr}
-\usepackage{lastpage}
-\usepackage{tabularx}
-\usepackage[most]{tcolorbox}
-
-% Header and footer
-\pagestyle{fancy}
-\fancyhf{}
-\lhead{Perioperative Care Plan}
-\rhead{Page \thepage\ of \pageref{LastPage}}
-\lfoot{Date Created: \today}
-\rfoot{Confidential Patient Information}
-
-% Title formatting
-\usepackage{titlesec}
-\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
-\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{1em}{}
-
-\begin{document}
-
-% Title
-\begin{center}
-{\Large\bfseries PERIOPERATIVE CARE PLAN}\\[0.5em]
-{\large Surgical \& Procedural Patient Management}\\[0.5em]
-\rule{\textwidth}{1pt}
-\end{center}
-
-\vspace{1em}
-
-% ===== TREATMENT PLAN HIGHLIGHTS (Foundation Medicine Model) =====
-\begin{tcolorbox}[colback=red!5!white,colframe=red!75!black,title=\textbf{TREATMENT PLAN HIGHLIGHTS},fonttitle=\bfseries\large]
-
-\textbf{Procedure:} [Planned surgery/procedure - e.g., Laparoscopic cholecystectomy for symptomatic cholelithiasis]
-
-\vspace{0.3em}
-\textbf{Primary Perioperative Goals:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item [Goal 1 - e.g., Safe completion of procedure with minimal complications]
- \item [Goal 2 - e.g., Discharge within 24 hours (outpatient procedure)]
- \item [Goal 3 - e.g., Return to normal activities within 2 weeks]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Key Perioperative Elements:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Preoperative:} [Optimization - e.g., ASA class II, medical clearance obtained, NPO after midnight]
- \item \textit{Intraoperative:} [Approach - e.g., General anesthesia, standard laparoscopic technique]
- \item \textit{Postoperative:} [Recovery - e.g., Early mobilization, multimodal analgesia, same-day discharge]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Timeline:} [Schedule - e.g., Surgery date [XX/XX], follow-up at 2 weeks, full recovery 4-6 weeks]
-
-\end{tcolorbox}
-
-\vspace{1em}
-
-% ===== SECTION 1: PATIENT AND PROCEDURE INFORMATION =====
-\section*{1. Patient and Procedure Information}
-
-\textbf{HIPAA Notice}: De-identify all protected health information before sharing.
-
-\vspace{0.5em}
-
-\begin{tabularx}{\textwidth}{|l|X|}
-\hline
-\textbf{Patient ID} & [De-identified code, e.g., SURG-001] \\ \hline
-\textbf{Age Range} & [e.g., 65-70 years] \\ \hline
-\textbf{Sex} & [Male/Female/Other] \\ \hline
-\textbf{Date of Plan} & [Month/Year only] \\ \hline
-\textbf{Surgeon} & [Name, MD, Specialty] \\ \hline
-\textbf{Anesthesiologist} & [Name, MD or assigned team] \\ \hline
-\textbf{Planned Procedure} & [e.g., Elective total knee arthroplasty, right] \\ \hline
-\textbf{CPT Code} & [e.g., 27447] \\ \hline
-\textbf{Scheduled Date} & [Month/Year or "Within 2-4 weeks"] \\ \hline
-\textbf{Facility} & [Hospital/Surgery center name] \\ \hline
-\textbf{Expected LOS} & [e.g., 2-3 days] \\ \hline
-\end{tabularx}
-
-\vspace{1em}
-
-\subsection*{Surgical Indication}
-
-\textbf{Primary Diagnosis}: [e.g., Severe osteoarthritis, right knee] (ICD-10: [M17.11])
-
-\textbf{Indication for Surgery}:
-[e.g., Patient has severe right knee pain (8/10) limiting mobility and function despite conservative management including physical therapy, weight loss, and analgesics. Radiographs demonstrate bone-on-bone contact, osteophytes, and joint space narrowing. Failed conservative treatment for 12+ months. Patient desires surgical intervention to improve quality of life and function.]
-
-\textbf{Previous Treatments}:
-\begin{itemize}[leftmargin=*]
- \item Physical therapy (6 months, minimal benefit)
- \item Weight loss (15 lbs, ongoing)
- \item NSAIDs, acetaminophen (limited efficacy)
- \item Intra-articular corticosteroid injections (3 injections, temporary relief only)
-\end{itemize}
-
-\subsection*{Medical History and Comorbidities}
-
-\textbf{Active Medical Conditions}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Hypertension}: Well-controlled on lisinopril 20mg daily
- \item \textbf{Type 2 Diabetes}: HbA1c 6.8\%, well-controlled on metformin
- \item \textbf{Hyperlipidemia}: On atorvastatin 40mg
- \item \textbf{Obesity}: BMI 32 (down from 35 with weight loss efforts)
- \item [List additional conditions]
-\end{itemize}
-
-\textbf{Current Medications}:
-\begin{longtable}{|p{3cm}|p{2cm}|p{2cm}|p{6cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Perioperative Plan} \\ \hline
-Lisinopril & 20mg & Daily & Hold day of surgery, resume POD 1 if BP stable \\ \hline
-Metformin & 1000mg & BID & Hold 24 hours before surgery, resume when eating \\ \hline
-Atorvastatin & 40mg & QHS & Continue through surgery \\ \hline
-Aspirin & 81mg & Daily & Discuss with surgeon - likely continue \\ \hline
-Ibuprofen & 600mg & PRN & Discontinue 5-7 days before surgery \\ \hline
-[Add medications] & & & \\ \hline
-\end{longtable}
-
-\textbf{Allergies}: [NKDA or list medication allergies and reactions]
-
-\subsection*{Preoperative Risk Assessment}
-
-\textbf{ASA Physical Status Classification}: [e.g., ASA Class II - Mild systemic disease (HTN, DM)]
-
-\textbf{Cardiac Risk} (Revised Cardiac Risk Index - RCRI):
-\begin{itemize}[leftmargin=*]
- \item High-risk surgery: ☐ Yes ☑ No (orthopedic is intermediate-risk)
- \item Ischemic heart disease: ☐ Yes ☑ No
- \item Heart failure: ☐ Yes ☑ No
- \item Cerebrovascular disease: ☐ Yes ☑ No
- \item Diabetes on insulin: ☐ Yes ☑ No
- \item Creatinine $>$2 mg/dL: ☐ Yes ☑ No
- \item \textbf{RCRI Score}: 0 (Low risk $<$1\% cardiac event)
-\end{itemize}
-
-\textbf{Pulmonary Risk}:
-\begin{itemize}[leftmargin=*]
- \item No active pulmonary disease
- \item No smoking history
- \item Room air oxygen saturation 98\%
- \item Low risk for postoperative pulmonary complications
-\end{itemize}
-
-\textbf{VTE Risk} (Caprini Score):
-\begin{itemize}[leftmargin=*]
- \item Age 65-70: 2 points
- \item Major surgery ($>$45 min): 2 points
- \item BMI $>$30: 1 point
- \item \textbf{Total Score}: 5 (Moderate-high risk)
- \item \textbf{Prophylaxis Plan}: Pharmacologic (enoxaparin) + mechanical (SCDs)
-\end{itemize}
-
-\textbf{Bleeding Risk}: Low (no anticoagulation, normal coagulation studies)
-
-% ===== SECTION 2: PREOPERATIVE OPTIMIZATION =====
-\section*{2. Preoperative Optimization and Preparation}
-
-\subsection*{2.1 Medical Optimization}
-
-\textbf{Diabetes Management}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Goal}: HbA1c $<$7-8\% for elective surgery (current 6.8\% - optimized)
- \item \textbf{Preop Day}: Hold metformin 24 hours before surgery
- \item \textbf{Morning of Surgery}: NPO, no oral hypoglycemics
- \item \textbf{Glucose Monitoring}: Check fasting glucose morning of surgery, target 100-180 mg/dL
- \item \textbf{Perioperative Protocol}: Insulin sliding scale if glucose $>$180 mg/dL
-\end{itemize}
-
-\textbf{Hypertension Management}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Goal}: BP $<$140/90 preoperatively (current 128/76 - controlled)
- \item \textbf{Medication Plan}: Hold lisinopril morning of surgery (avoid intraop hypotension)
- \item \textbf{Beta-blockers}: [If on beta-blocker, continue through surgery]
- \item \textbf{Postop}: Resume home BP medications when tolerating oral intake
-\end{itemize}
-
-\textbf{Cardiac Clearance}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Assessment}: Low cardiac risk (RCRI 0), intermediate-risk surgery
- \item \textbf{Functional Capacity}: $>$4 METs (can climb 1 flight of stairs)
- \item \textbf{EKG}: Normal sinus rhythm, no acute changes
- \item \textbf{Additional Testing}: Not needed (low risk, good functional capacity)
- \item \textbf{Cardiology Consultation}: Not indicated
- \item \textbf{Cleared for Surgery}: Yes
-\end{itemize}
-
-\textbf{Pulmonary Optimization}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Smoking Cessation}: N/A (non-smoker)
- \item \textbf{Incentive Spirometry}: Education provided, will use postoperatively
- \item \textbf{Pulmonary Function Tests}: Not indicated (no pulmonary disease)
-\end{itemize}
-
-\textbf{Nutritional Status}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Albumin}: [e.g., 4.0 g/dL - normal]
- \item \textbf{BMI}: 32 (obese, but weight loss of 15 lbs achieved)
- \item \textbf{Nutritional Optimization}: Adequate, no protein supplementation needed
-\end{itemize}
-
-\textbf{Anemia Screening and Management}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Preop Hemoglobin}: [e.g., 13.2 g/dL - normal]
- \item \textbf{Iron Studies}: [If low Hgb - check iron, ferritin, TIBC]
- \item \textbf{Optimization}: No anemia present, no intervention needed
- \item \textbf{Transfusion Threshold}: Hgb $<$7-8 g/dL postoperatively (restrictive strategy)
-\end{itemize}
-
-\subsection*{2.2 Medication Management}
-
-\textbf{Medications to Continue}:
-\begin{itemize}[leftmargin=*]
- \item Statin (atorvastatin)
- \item Aspirin 81mg (after surgeon confirmation - typically continued for orthopedic)
- \item [Other chronic medications per anesthesia recommendations]
-\end{itemize}
-
-\textbf{Medications to Hold}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{NSAIDs}: Discontinue 5-7 days before surgery (ibuprofen)
- \item \textbf{ACE Inhibitors}: Hold day of surgery (lisinopril)
- \item \textbf{Metformin}: Hold 24 hours before, resume when eating normally
- \item \textbf{[Other medications]}: [Specific instructions]
-\end{itemize}
-
-\textbf{Anticoagulation Management}:
-\begin{itemize}[leftmargin=*]
- \item Not applicable (patient not on anticoagulation)
- \item [If on warfarin: bridge with LMWH, target INR $<$1.5]
- \item [If on DOAC: hold 24-48 hours based on renal function]
-\end{itemize}
-
-\subsection*{2.3 Preoperative Testing and Clearance}
-
-\textbf{Laboratory Tests}:
-\begin{itemize}[leftmargin=*]
- \item CBC: [Results - Hgb, platelets]
- \item BMP: [Results - creatinine, glucose, electrolytes]
- \item HbA1c: 6.8\% (within 3 months)
- \item Coagulation studies (PT/INR, PTT): [If indicated]
- \item Type and screen: [Completed, blood available if needed]
-\end{itemize}
-
-\textbf{Imaging}:
-\begin{itemize}[leftmargin=*]
- \item Chest X-ray: [If indicated - age $>$50 with cardiac/pulmonary disease]
- \item Preop knee X-rays: Confirm diagnosis, surgical planning
-\end{itemize}
-
-\textbf{Medical Clearance}: ☑ Cleared for surgery by PCP [Date]
-
-\subsection*{2.4 Enhanced Recovery After Surgery (ERAS) Protocol}
-
-\textbf{Preoperative ERAS Elements}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Patient Education}: Provided ERAS booklet, reviewed expectations
- \item \textbf{Nutritional Optimization}: Carbohydrate loading (clear carb drink 2 hours before surgery)
- \item \textbf{Fasting Guidelines}: NPO solid food 6 hours, clear liquids until 2 hours before
- \item \textbf{Preoperative Bathing}: Chlorhexidine shower night before and morning of surgery
- \item \textbf{No Premedication}: Avoid long-acting sedatives (faster recovery)
-\end{itemize}
-
-% ===== SECTION 3: PERIOPERATIVE GOALS =====
-\section*{3. Perioperative Goals}
-
-\subsection*{3.1 Immediate Perioperative Goals (Day 0-1)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Pain Control}: Achieve pain $\leq$4/10 at rest, $\leq$6/10 with movement using multimodal analgesia by POD 0.
-
- \item \textbf{Early Mobilization}: Out of bed to chair within 4-6 hours post-surgery (day of surgery if morning case).
-
- \item \textbf{Nausea/Vomiting Prevention}: No or minimal PONV with multimodal antiemetic prophylaxis.
-
- \item \textbf{Glucose Control}: Maintain blood glucose 100-180 mg/dL perioperatively.
-
- \item \textbf{Hemodynamic Stability}: Maintain BP within 20\% of baseline, avoid hypo/hypertension.
-\end{enumerate}
-
-\subsection*{3.2 Early Postoperative Goals (POD 1-3)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Mobilization}: Ambulate with physical therapy 50+ feet with walker by POD 1, progress to 150 feet by POD 2.
-
- \item \textbf{ROM}: Achieve knee flexion $>$70 degrees and full extension by POD 2.
-
- \item \textbf{Pain Management}: Transition to oral multimodal analgesia, pain $\leq$5/10, minimize opioid use.
-
- \item \textbf{Diet Advancement}: Resume regular diet POD 1, adequate oral intake.
-
- \item \textbf{Bowel Function}: Return of bowel sounds, pass flatus by POD 2.
-
- \item \textbf{Urinary Function}: Foley catheter removed POD 0-1, spontaneous void within 6-8 hours.
-
- \item \textbf{Prevent Complications}: No surgical site infection, DVT, PE, or other major complications.
-\end{enumerate}
-
-\subsection*{3.3 Discharge Goals (POD 2-3)}
-
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Functional Mobility}: Independent transfers, ambulate 150+ feet with assistive device, negotiate stairs if needed for home.
-
- \item \textbf{Pain Control}: Adequate pain control on oral medications, pain $<$5/10.
-
- \item \textbf{Safety}: Patient/family demonstrate understanding of precautions, medications, wound care.
-
- \item \textbf{Discharge Readiness}: Stable vital signs, no complications, safe for discharge home (with home health if needed).
-\end{enumerate}
-
-% ===== SECTION 4: INTRAOPERATIVE MANAGEMENT =====
-\section*{4. Intraoperative Management Plan}
-
-\subsection*{Anesthesia Plan}
-
-\textbf{Anesthesia Type}: [e.g., Spinal anesthesia + sedation] (surgeon/anesthesia preference)
-
-\textbf{Alternatives Discussed}:
-\begin{itemize}[leftmargin=*]
- \item General anesthesia
- \item Regional anesthesia (spinal/epidural)
- \item Peripheral nerve block (femoral, adductor canal block)
-\end{itemize}
-
-\textbf{Multimodal Analgesia - Intraoperative}:
-\begin{itemize}[leftmargin=*]
- \item Regional anesthesia (spinal/block) as primary analgesic
- \item IV acetaminophen 1g intraoperatively
- \item Ketorolac 15-30mg IV (if no contraindication)
- \item Local anesthetic infiltration at surgical site (surgeon)
- \item Minimize intraop opioids (opioid-sparing approach)
-\end{itemize}
-
-\textbf{PONV Prophylaxis}:
-\begin{itemize}[leftmargin=*]
- \item Ondansetron 4mg IV
- \item Dexamethasone 4-8mg IV
- \item Scopolamine patch (if high PONV risk)
- \item Avoid volatile anesthetics if possible (TIVA preferred)
-\end{itemize}
-
-\subsection*{Surgical Approach}
-
-\textbf{Procedure}: Total knee arthroplasty, cemented components
-
-\textbf{Antibiotic Prophylaxis}:
-\begin{itemize}[leftmargin=*]
- \item Cefazolin 2g IV within 60 minutes of incision (3g if weight $>$120 kg)
- \item Redose if surgery $>$4 hours or blood loss $>$1500 mL
- \item Discontinue within 24 hours post-surgery
-\end{itemize}
-
-\textbf{VTE Prophylaxis - Intraoperative}:
-\begin{itemize}[leftmargin=*]
- \item Sequential compression devices (SCDs) applied before induction
- \item Continue SCDs throughout hospitalization and at rest at home
-\end{itemize}
-
-\textbf{Surgical Site Infection Prevention}:
-\begin{itemize}[leftmargin=*]
- \item Chlorhexidine-alcohol skin prep
- \item Maintain normothermia (goal temp $>$36°C)
- \item Glucose control (intraop glucose $<$180 mg/dL)
- \item Surgical time minimize (planned $<$2 hours)
-\end{itemize}
-
-\textbf{Blood Management}:
-\begin{itemize}[leftmargin=*]
- \item Tranexamic acid 1-2g IV (reduce blood loss)
- \item Cell saver if appropriate
- \item Restrictive transfusion strategy (Hgb $<$7-8 g/dL)
-\end{itemize}
-
-% ===== SECTION 5: POSTOPERATIVE MANAGEMENT =====
-\section*{5. Postoperative Management Plan}
-
-\subsection*{5.1 Pain Management (Multimodal Analgesia)}
-
-\textbf{ERAS Pain Protocol} (opioid-minimizing):
-
-\begin{longtable}{|p{3.5cm}|p{2.5cm}|p{7cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose/Frequency} & \textbf{Instructions} \\ \hline
-\textbf{Acetaminophen} & 1000mg Q6H & Scheduled (not PRN), around-the-clock for 48 hours \\ \hline
-\textbf{Celecoxib} or \textbf{Meloxicam} & 200mg BID or 15mg daily & NSAID (if no contraindication), scheduled x 7-14 days \\ \hline
-\textbf{Gabapentin} & 300mg TID & Neuropathic pain adjuvant, start preop or POD 0 \\ \hline
-\textbf{Ice therapy} & Q2H while awake & Local cooling, reduces swelling and pain \\ \hline
-\textbf{Oxycodone} & 5mg Q4H PRN & Breakthrough pain only, goal minimize use \\ \hline
-\end{longtable}
-
-\textbf{Pain Assessment}: Numeric rating scale (0-10) every 4 hours, before and after ambulation
-
-\textbf{Pain Goals}: $\leq$4/10 at rest, $\leq$6/10 with PT/activity
-
-\subsection*{5.2 Early Mobilization and Physical Therapy}
-
-\textbf{ERAS Mobility Protocol}:
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{POD 0 (Day of Surgery)}: Out of bed to chair 4-6 hours post-op, stand at bedside
- \item \textbf{POD 1}:
- \begin{itemize}
- \item PT evaluation and gait training
- \item Ambulate 50+ feet with walker x2
- \item Begin ROM exercises (CPM machine or therapist-assisted)
- \item Stair practice if needed for home
- \end{itemize}
- \item \textbf{POD 2}:
- \begin{itemize}
- \item Ambulate 150+ feet with walker x2-3
- \item ROM: Goal flexion $>$90 degrees
- \item Independent bed mobility and transfers
- \item Stairs if required
- \end{itemize}
- \item \textbf{Discharge Criteria}: Ambulate 150 feet, transfers independently, stairs if applicable
-\end{itemize}
-
-\textbf{Fall Precautions}: High risk post-surgery - bed alarm, non-slip socks, walker, call for assist
-
-\subsection*{5.3 Nausea and Vomiting Management}
-
-\textbf{Multimodal Antiemetic Protocol}:
-\begin{itemize}[leftmargin=*]
- \item Ondansetron 4mg IV/PO Q6H PRN
- \item Metoclopramide 10mg IV Q6H PRN (if ondansetron insufficient)
- \item Scopolamine patch (continue 72 hours if applied)
- \item Non-pharmacologic: Ginger ale, acupressure bands, avoid rapid position changes
-\end{itemize}
-
-\subsection*{5.4 Nutrition and Diet Advancement}
-
-\textbf{ERAS Nutrition}:
-\begin{itemize}[leftmargin=*]
- \item Resume diet as tolerated POD 0-1 (no prolonged NPO)
- \item Protein-rich diet (wound healing)
- \item Adequate hydration
- \item No routine NG tube
-\end{itemize}
-
-\subsection*{5.5 VTE Prophylaxis}
-
-\textbf{Pharmacologic} (High-risk orthopedic surgery):
-\begin{itemize}[leftmargin=*]
- \item \textbf{Enoxaparin 40mg SC daily} starting POD 1, continue 10-14 days
- \item \textit{Alternative}: Apixaban 2.5mg BID x 12 days (extended prophylaxis)
- \item Hold first dose if neuraxial anesthesia (spinal/epidural) until catheter removal + 12 hours
-\end{itemize}
-
-\textbf{Mechanical}:
-\begin{itemize}[leftmargin=*]
- \item SCDs while in bed throughout hospitalization
- \item Early mobilization (most important)
-\end{itemize}
-
-\textbf{Duration}: Minimum 10-14 days, consider up to 35 days for high-risk patients
-
-\subsection*{5.6 Urinary Catheter Management}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Foley Catheter}: Typically placed intraoperatively
- \item \textbf{Removal}: POD 0 or POD 1 morning (early removal to prevent CAUTI)
- \item \textbf{Voiding Trial}: Must void within 6-8 hours of catheter removal
- \item \textbf{Retention Protocol}: If unable to void or bladder scan $>$400 mL, straight cath or replace Foley temporarily
-\end{itemize}
-
-\subsection*{5.7 Wound Care and Drain Management}
-
-\textbf{Surgical Drain}:
-\begin{itemize}[leftmargin=*]
- \item Hemovac or JP drain typically placed
- \item Monitor output, remove when $<$30 mL/8 hours (usually POD 1-2)
-\end{itemize}
-
-\textbf{Dressing}:
-\begin{itemize}[leftmargin=*]
- \item Keep clean and dry
- \item First dressing change POD 2 or per surgeon
- \item Assess for signs of infection daily
-\end{itemize}
-
-\subsection*{5.8 Glycemic Control}
-
-\textbf{Postoperative Glucose Management}:
-\begin{itemize}[leftmargin=*]
- \item Target glucose 100-180 mg/dL
- \item Check glucose Q6H while NPO or on IV fluids
- \item Insulin sliding scale (SSI) if glucose $>$180 mg/dL
- \item Resume metformin when tolerating regular diet and creatinine stable
-\end{itemize}
-
-\subsection*{5.9 Complication Surveillance}
-
-\textbf{Monitor for}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Surgical site infection}: Fever, wound erythema, purulent drainage, increased pain
- \item \textbf{DVT/PE}: Unilateral leg swelling, chest pain, dyspnea, hypoxia
- \item \textbf{Acute kidney injury}: Decreased UOP, rising creatinine
- \item \textbf{Cardiovascular events}: Chest pain, EKG changes, troponin elevation
- \item \textbf{Delirium}: Especially in elderly, multimodal prevention
-\end{itemize}
-
-% ===== SECTION 6: DISCHARGE PLANNING =====
-\section*{6. Discharge Planning and Criteria}
-
-\subsection*{Discharge Criteria (Typically POD 2-3)}
-
-Patient ready for discharge when ALL met:
-\begin{itemize}[leftmargin=*]
- \item ☐ Adequate pain control on oral medications (pain $<$5/10)
- \item ☐ Functional mobility: Ambulate 150+ feet, transfers, stairs if needed
- \item ☐ Tolerating regular diet, adequate oral intake
- \item ☐ Voiding spontaneously without catheter
- \item ☐ Stable vital signs, no fever $>$38.5°C x 24 hours
- \item ☐ No complications requiring continued hospitalization
- \item ☐ Adequate home support and DME arranged
- \item ☐ Patient/family education completed, demonstrate understanding
-\end{itemize}
-
-\subsection*{Discharge Medications}
-
-\begin{longtable}{|p{3cm}|p{2cm}|p{2cm}|p{6cm}|}
-\hline
-\textbf{Medication} & \textbf{Dose} & \textbf{Frequency} & \textbf{Duration/Instructions} \\ \hline
-Oxycodone & 5mg & Q4-6H PRN & Pain, 20 tablets (minimize use) \\ \hline
-Acetaminophen & 1000mg & Q6H & Scheduled x 2 weeks \\ \hline
-Meloxicam & 15mg & Daily & x 2 weeks (NSAID) \\ \hline
-Enoxaparin & 40mg SC & Daily & x 10-14 days (VTE prophylaxis) \\ \hline
-Colace & 100mg & BID & Constipation prevention while on opioids \\ \hline
-[Resume home meds] & & & Resume lisinopril, metformin, atorvastatin \\ \hline
-\end{longtable}
-
-\subsection*{Durable Medical Equipment (DME)}
-
-\begin{itemize}[leftmargin=*]
- \item Walker (front-wheeled, standard adult)
- \item Raised toilet seat with arms
- \item Shower chair or bath bench
- \item Reacher (32-inch)
- \item Ice machine or ice packs (for knee)
- \item Long-handled shoe horn (hip precautions if applicable)
-\end{itemize}
-
-\subsection*{Home Services}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Home Health Physical Therapy}: 2-3x/week x 2-3 weeks, then transition to outpatient PT
- \item \textbf{Home Health Nursing}: PRN for wound check, drain removal if not removed before discharge, medication teaching (enoxaparin injections)
- \item [If high needs: Home health aide for ADL assistance]
-\end{itemize}
-
-\subsection*{Patient Education Completed}
-
-\begin{itemize}[leftmargin=*]
- \item ✓ Wound care and dressing changes
- \item ✓ Signs of infection (fever, redness, drainage, increased pain)
- \item ✓ Pain medication use and weaning plan
- \item ✓ Enoxaparin self-injection technique (or family member trained)
- \item ✓ DVT/PE warning signs (leg swelling, chest pain, shortness of breath)
- \item ✓ Activity restrictions and precautions
- \item ✓ Home exercise program
- \item ✓ Use of DME (walker, raised toilet seat, etc.)
- \item ✓ When to call surgeon (fever $>$101.5°F, severe pain, wound concerns)
- \item ✓ Follow-up appointments scheduled
-\end{itemize}
-
-\subsection*{Activity Restrictions}
-
-\begin{itemize}[leftmargin=*]
- \item Use walker for ambulation x 2-4 weeks (per PT recommendation)
- \item No driving until off opioid pain medications and cleared by surgeon (typically 2-4 weeks)
- \item No prolonged sitting $>$30-45 min without getting up and moving
- \item Avoid kneeling on operative knee
- \item Gradual return to activities as tolerated
-\end{itemize}
-
-\subsection*{Follow-Up Appointments}
-
-\begin{tabularx}{\textwidth}{|l|l|X|}
-\hline
-\textbf{Provider} & \textbf{Timing} & \textbf{Purpose} \\ \hline
-Surgeon & 10-14 days & Wound check, staple/suture removal, assess progress \\ \hline
-Surgeon & 6 weeks & X-ray, functional assessment, advance activities \\ \hline
-Surgeon & 3 months, 6 months, 1 year & Long-term follow-up, outcomes \\ \hline
-PCP & 1-2 weeks & Resume chronic disease management, BP/DM check \\ \hline
-PT (outpatient) & After home health complete & Continue strengthening, ROM, return to function \\ \hline
-\end{tabularx}
-
-% ===== SECTION 7: EMERGENCY PROCEDURES =====
-\section*{7. Postoperative Emergency Procedures}
-
-\textbf{Call surgeon immediately or go to ED if}:
-\begin{itemize}[leftmargin=*]
- \item Fever $>$101.5°F (38.6°C)
- \item Severe uncontrolled pain ($>$7/10 despite medications)
- \item Wound: Excessive drainage, purulent discharge, wound dehiscence, foul odor
- \item Increased redness, warmth, or swelling at surgical site
- \item DVT symptoms: Unilateral leg swelling, pain, warmth, redness
- \item PE symptoms: Sudden chest pain, shortness of breath, rapid heart rate
- \item Numbness, tingling, or weakness in leg (nerve injury concern)
- \item Inability to urinate
- \item Excessive bleeding from surgical site
-\end{itemize}
-
-\textbf{Call 911 for}:
-\begin{itemize}[leftmargin=*]
- \item Chest pain or pressure
- \item Severe shortness of breath
- \item Loss of consciousness
- \item Signs of stroke (facial droop, arm weakness, speech difficulty)
-\end{itemize}
-
-\textbf{Surgeon Contact Information}:
-\begin{itemize}[leftmargin=*]
- \item Office: [Phone number]
- \item After-hours/Emergency: [On-call service number]
-\end{itemize}
-
-% ===== SECTION 8: REHABILITATION AND RECOVERY =====
-\section*{8. Rehabilitation Plan and Expected Recovery}
-
-\subsection*{Recovery Timeline}
-
-\begin{tabularx}{\textwidth}{|l|X|}
-\hline
-\textbf{Timeframe} & \textbf{Expected Progress} \\ \hline
-Week 1-2 & Wound healing, pain decreasing, ambulation with walker improving, ROM exercises \\ \hline
-Week 3-6 & Transition from walker to cane, ROM improving (goal flexion $>$100°), less pain \\ \hline
-Week 6-12 & Progress to independent ambulation (no assistive device), ROM 110-120° flexion, strengthening phase \\ \hline
-3-6 months & Return to most activities, continued strengthening, ROM optimization, minimal pain \\ \hline
-6-12 months & Full recovery, return to all desired activities, final ROM achieved \\ \hline
-\end{tabularx}
-
-\subsection*{Physical Therapy Goals}
-
-\textbf{Short-term} (0-6 weeks):
-\begin{itemize}[leftmargin=*]
- \item ROM: Flexion $>$90° by week 2, $>$110° by week 6, full extension
- \item Strength: Quadriceps, hamstrings, hip abductors
- \item Ambulation: Progress from walker to cane to independent
- \item Stairs: Negotiate safely
-\end{itemize}
-
-\textbf{Long-term} (6 weeks - 3 months):
-\begin{itemize}[leftmargin=*]
- \item ROM: Maximum flexion (goal 120-125°)
- \item Strength: Near-normal lower extremity strength
- \item Function: Return to ADLs, hobbies, light sports
- \item Gait: Normal gait pattern without assistive device
-\end{itemize}
-
-\subsection*{Home Exercise Program}
-
-\textit{Provided by PT, to be performed 2-3x daily}:
-\begin{itemize}[leftmargin=*]
- \item Ankle pumps
- \item Quad sets
- \item Straight leg raises
- \item Hamstring curls
- \item Hip abduction
- \item Knee flexion/extension ROM exercises
- \item Heel slides
- \item Stationary bike (when cleared)
-\end{itemize}
-
-% ===== SECTION 9: INFORMED CONSENT =====
-\section*{9. Informed Consent Documentation}
-
-\textbf{Risks and Benefits Discussed}:
-
-\textbf{Benefits}:
-\begin{itemize}[leftmargin=*]
- \item Pain relief (90\% significant improvement)
- \item Improved function and mobility
- \item Enhanced quality of life
- \item Return to desired activities
-\end{itemize}
-
-\textbf{Risks}:
-\begin{itemize}[leftmargin=*]
- \item Infection ($<$2\%)
- \item DVT/PE (2-3\% despite prophylaxis)
- \item Bleeding, hematoma
- \item Nerve or blood vessel injury (rare)
- \item Stiffness, limited ROM
- \item Implant loosening, wear (long-term)
- \item Need for revision surgery (10-15\% lifetime risk)
- \item Anesthesia risks
-\end{itemize}
-
-\textbf{Alternatives Discussed}:
-\begin{itemize}[leftmargin=*]
- \item Continued conservative management (PT, medications, injections)
- \item Partial knee replacement (if eligible)
- \item No treatment
-\end{itemize}
-
-Patient demonstrates understanding, all questions answered, consents to proceed with surgery.
-
-% ===== SECTION 10: SIGNATURES =====
-\vspace{2em}
-
-\section*{10. Provider Signatures}
-
-\textbf{Surgeon}:\\[0.5em]
-Signature: \rule{6cm}{0.5pt} \quad Date: \rule{3cm}{0.5pt}\\
-Name/Credentials: \rule{6cm}{0.5pt}\\[1em]
-
-\textbf{Anesthesiologist}:\\[0.5em]
-Signature: \rule{6cm}{0.5pt} \quad Date: \rule{3cm}{0.5pt}\\
-Name/Credentials: \rule{6cm}{0.5pt}\\[1em]
-
-\textbf{Patient Consent}:\\[0.5em]
-I have reviewed this perioperative care plan. I understand the procedure, risks, benefits, and alternatives. My questions have been answered. I consent to the planned surgery.\\[0.5em]
-Signature: \rule{6cm}{0.5pt} \quad Date: \rule{3cm}{0.5pt}\\
-
-\vspace{2em}
-\begin{center}
-\rule{\textwidth}{1pt}\\
-\textbf{End of Perioperative Care Plan}\\
-This document contains confidential patient information protected by HIPAA.
-\end{center}
-
-\end{document}
-
-% ========== NOTES FOR USERS ==========
-%
-% This template emphasizes Enhanced Recovery After Surgery (ERAS) principles
-% Key ERAS elements: preop carbohydrate loading, minimal fasting, multimodal analgesia,
-% early mobilization, early feeding, minimizing tubes/drains, VTE prophylaxis
-%
-% CUSTOMIZATION:
-% - Adjust for specific surgical procedure
-% - Modify based on patient comorbidities
-% - Update medication protocols per institutional guidelines
-% - Adapt ERAS elements based on evidence and surgeon preference
-%
-% COMPILATION:
-% pdflatex perioperative_care_plan.tex
-
diff --git a/skills/treatment-plans/assets/quality_checklist.md b/skills/treatment-plans/assets/quality_checklist.md
deleted file mode 100644
index c9bcbda4..00000000
--- a/skills/treatment-plans/assets/quality_checklist.md
+++ /dev/null
@@ -1,471 +0,0 @@
-# Treatment Plan Quality Assurance Checklist
-
-## Overview
-
-Use this checklist to ensure treatment plans meet professional standards for completeness, quality, safety, and regulatory compliance. Review each section before finalizing the plan.
-
----
-
-## Section 1: Completeness - Required Components
-
-### ☐ Patient Information
-- [ ] Patient identifier (de-identified if sharing)
-- [ ] Age range (not exact date of birth)
-- [ ] Sex and relevant demographics
-- [ ] Date of plan creation
-- [ ] Provider name and credentials
-- [ ] Facility/practice name
-- [ ] HIPAA de-identification notice included
-
-### ☐ Diagnosis and Assessment
-- [ ] Primary diagnosis clearly stated
-- [ ] ICD-10 code(s) included
-- [ ] Secondary diagnoses and comorbidities listed
-- [ ] Disease severity/staging documented
-- [ ] Baseline functional status assessed
-- [ ] Risk stratification performed (if applicable)
-
-### ☐ Treatment Goals
-- [ ] Short-term goals present (1-3 months)
-- [ ] Long-term goals present (6-12 months)
-- [ ] Goals meet SMART criteria (see Section 2)
-- [ ] Patient-centered goals included
-- [ ] Goals are prioritized or organized
-
-### ☐ Interventions
-- [ ] Pharmacological interventions specified
-- [ ] Non-pharmacological interventions included
-- [ ] Procedural interventions or referrals noted
-- [ ] Each intervention has clear rationale
-- [ ] Evidence-based or guideline-concordant
-
-### ☐ Timeline and Schedule
-- [ ] Treatment phases with durations defined
-- [ ] Appointment frequency specified
-- [ ] Milestone assessments scheduled
-- [ ] Expected total treatment duration stated
-
-### ☐ Monitoring Parameters
-- [ ] Clinical outcomes to track identified
-- [ ] Baseline values documented
-- [ ] Target values specified
-- [ ] Monitoring frequency defined
-- [ ] Assessment tools/scales named
-
-### ☐ Expected Outcomes
-- [ ] Primary outcome measures stated
-- [ ] Success criteria defined
-- [ ] Timeline for improvement indicated
-- [ ] Criteria for treatment modification noted
-
-### ☐ Follow-up Plan
-- [ ] Next appointment scheduled
-- [ ] Follow-up frequency specified
-- [ ] Communication plan outlined
-- [ ] Emergency contact procedures included
-
-### ☐ Patient Education
-- [ ] Condition education documented
-- [ ] Self-management skills training noted
-- [ ] Warning signs communicated
-- [ ] Resources and support listed
-
-### ☐ Risk Mitigation and Safety
-- [ ] Potential adverse effects identified
-- [ ] Safety monitoring plan included
-- [ ] Emergency procedures outlined
-- [ ] Complication prevention addressed
-
-### ☐ Signature and Date
-- [ ] Provider signature line
-- [ ] Provider name and credentials
-- [ ] Date of plan
-- [ ] Patient acknowledgment (if applicable)
-
----
-
-## Section 2: SMART Goals Quality
-
-For each treatment goal, verify it meets SMART criteria:
-
-### ☐ Specific
-- [ ] Goal clearly defines what will be accomplished
-- [ ] No vague language (e.g., "improve", "better")
-- [ ] Specific outcome stated
-
-**Example**: "Reduce HbA1c from 8.5% to <7%" ✓
-**Not**: "Improve diabetes control" ✗
-
-### ☐ Measurable
-- [ ] Quantifiable metric or observable criterion included
-- [ ] Baseline value documented
-- [ ] Target value specified
-
-**Example**: "Walk 300 feet with walker independently" ✓
-**Not**: "Walk further" ✗
-
-### ☐ Achievable
-- [ ] Realistic given patient's condition and capabilities
-- [ ] Resources available to support goal
-- [ ] Timeframe is reasonable
-- [ ] Treatment efficacy supports goal
-
-**Example**: "Reduce pain from 7/10 to 4/10 in 6 weeks" ✓
-**Not**: "Eliminate all pain in 1 week" ✗
-
-### ☐ Relevant
-- [ ] Aligned with patient values and priorities
-- [ ] Clinically meaningful
-- [ ] Addresses patient's functional limitations
-- [ ] Integrated with overall treatment objectives
-
-**Example**: "Return to work with modifications within 3 months" ✓
-**Not**: "Lab value improvement" (if patient doesn't care about it) ✗
-
-### ☐ Time-bound
-- [ ] Specific deadline or timeframe stated
-- [ ] Reassessment interval defined
-- [ ] Action frequency specified (if applicable)
-
-**Example**: "Within 8 weeks" or "By month 3" ✓
-**Not**: "Eventually" or "Soon" ✗
-
----
-
-## Section 3: Clinical Quality
-
-### ☐ Evidence-Based Practice
-- [ ] Interventions based on current evidence
-- [ ] Clinical practice guidelines followed
-- [ ] Guideline deviations explained and justified
-- [ ] Literature or evidence cited (if formal plan)
-
-### ☐ Medication Documentation (if applicable)
-- [ ] Generic drug names used
-- [ ] Specific dose, route, frequency documented
-- [ ] Indication/rationale provided for each medication
-- [ ] Adverse effects to monitor noted
-- [ ] Drug interactions considered
-- [ ] Titration plan included if applicable
-
-### ☐ Assessment Tools
-- [ ] Validated assessment tools used when available
-- [ ] Tools appropriate for condition (PHQ-9, FIM, Berg, etc.)
-- [ ] Baseline scores documented
-- [ ] Target scores specified
-- [ ] Reassessment schedule defined
-
-### ☐ Multidisciplinary Coordination (if applicable)
-- [ ] Roles of team members defined
-- [ ] Communication plan among providers specified
-- [ ] Care transitions addressed
-- [ ] Specialist recommendations integrated
-
-### ☐ Preventive Care Integration
-- [ ] Age-appropriate screening included
-- [ ] Vaccination schedule noted
-- [ ] Lifestyle counseling documented
-- [ ] Health maintenance addressed
-
----
-
-## Section 4: Patient-Centered Care
-
-### ☐ Shared Decision-Making
-- [ ] Patient preferences documented
-- [ ] Treatment options discussed
-- [ ] Risks and benefits explained
-- [ ] Patient values incorporated into goals
-- [ ] Alternative treatments considered
-
-### ☐ Health Literacy
-- [ ] Language appropriate for patient understanding
-- [ ] Medical jargon explained or avoided
-- [ ] Teach-back method used or planned
-- [ ] Written materials at appropriate reading level
-
-### ☐ Cultural Competence
-- [ ] Cultural beliefs and practices considered
-- [ ] Language barriers addressed (interpreter if needed)
-- [ ] Cultural adaptations made when appropriate
-- [ ] Religious/spiritual preferences respected
-
-### ☐ Social Determinants of Health
-- [ ] Social needs screened (food, housing, transportation)
-- [ ] Barriers to care identified
-- [ ] Community resources provided
-- [ ] Financial concerns addressed (medication costs, etc.)
-
-### ☐ Patient Engagement
-- [ ] Patient actively involved in goal-setting
-- [ ] Self-management support provided
-- [ ] Patient education tailored to individual
-- [ ] Follow-up preferences considered
-
----
-
-## Section 5: Safety and Risk Management
-
-### ☐ Medication Safety
-- [ ] Allergy history documented
-- [ ] Polypharmacy reviewed (deprescribing considered)
-- [ ] High-risk medications monitored appropriately
-- [ ] Drug-drug interactions checked
-- [ ] Renal/hepatic dosing adjustments made if needed
-
-### ☐ Fall Prevention (if relevant)
-- [ ] Fall risk assessed
-- [ ] Fall prevention strategies included
-- [ ] Environmental modifications recommended
-- [ ] Assistive devices prescribed
-
-### ☐ Infection Prevention (if relevant)
-- [ ] Immunizations up to date
-- [ ] Prophylactic antibiotics if indicated
-- [ ] Infection signs and symptoms patient education
-
-### ☐ Emergency Preparedness
-- [ ] Emergency warning signs clearly listed
-- [ ] When to call 911 specified
-- [ ] When to call provider defined
-- [ ] Emergency contact numbers provided
-
-### ☐ Suicide/Violence Risk (mental health plans)
-- [ ] Risk assessment documented
-- [ ] Safety plan created if ideation present
-- [ ] Means restriction addressed
-- [ ] Crisis resources provided (988 lifeline)
-- [ ] Follow-up frequency appropriate for risk level
-
-### ☐ Opioid Safety (pain management plans)
-- [ ] Opioid risk assessment completed (ORT, SOAPP)
-- [ ] Informed consent discussion documented
-- [ ] Treatment agreement signed
-- [ ] PDMP checked
-- [ ] Naloxone co-prescribed
-- [ ] UDS plan included
-
----
-
-## Section 6: Regulatory Compliance
-
-### ☐ HIPAA Compliance
-- [ ] Protected health information (PHI) safeguarded
-- [ ] De-identification per Safe Harbor method (if sharing)
-- [ ] All 18 HIPAA identifiers removed (if de-identified)
-- [ ] Minimum necessary principle followed
-
-### ☐ Informed Consent
-- [ ] Consent discussion documented
-- [ ] Patient understanding verified
-- [ ] Risks and benefits explained
-- [ ] Alternative treatments discussed
-- [ ] Patient agreement documented
-
-### ☐ Medical Necessity
-- [ ] Treatment medically necessary for diagnosis
-- [ ] Interventions appropriate for severity
-- [ ] Evidence supports treatment choices
-- [ ] Frequency and duration justified
-
-### ☐ Billing and Coding
-- [ ] ICD-10 diagnosis codes included
-- [ ] CPT procedure codes (if procedures planned)
-- [ ] Documentation supports billing level
-- [ ] Medical necessity for services demonstrated
-
-### ☐ Quality Measure Support
-- [ ] Elements support quality reporting (HEDIS, MIPS)
-- [ ] Chronic disease management protocols followed
-- [ ] Preventive care documented
-- [ ] Patient safety indicators addressed
-
-### ☐ Specialty-Specific Regulations
-- [ ] 42 CFR Part 2 compliance (if substance use disorder treatment)
-- [ ] CDC opioid guidelines followed (if opioid prescription)
-- [ ] Joint Commission standards met (if applicable)
-- [ ] State-specific requirements addressed
-
----
-
-## Section 7: Documentation Standards
-
-### ☐ Clarity and Precision
-- [ ] Professional medical terminology used appropriately
-- [ ] Abbreviations defined on first use
-- [ ] No ambiguous language
-- [ ] Specific rather than vague descriptions
-
-### ☐ Accuracy
-- [ ] Factually correct information
-- [ ] Current evidence-based recommendations
-- [ ] Correct medication dosing and frequencies
-- [ ] Proper ICD-10 and CPT coding
-
-### ☐ Organization
-- [ ] Logical flow and structure
-- [ ] Consistent formatting
-- [ ] Easy to locate key information
-- [ ] Headings and sections clearly labeled
-
-### ☐ Legibility (if handwritten or hybrid)
-- [ ] Handwriting legible
-- [ ] No unclear abbreviations
-- [ ] Typed portions clear
-- [ ] Signatures legible with printed name
-
-### ☐ Authentication
-- [ ] Provider name clearly stated
-- [ ] Credentials included
-- [ ] Date of plan present
-- [ ] Signature obtained (electronic or handwritten)
-
----
-
-## Section 8: Special Considerations by Plan Type
-
-### For General Medical Plans:
-- [ ] Chronic disease management protocols followed
-- [ ] Guideline-based targets used (HbA1c, BP, lipids)
-- [ ] Medication regimen optimized
-- [ ] Comorbidities addressed
-- [ ] Preventive care integrated
-
-### For Rehabilitation Plans:
-- [ ] Functional assessments with validated tools (FIM, Berg)
-- [ ] Impairment, activity, and participation goals included
-- [ ] Therapy frequency and duration specified
-- [ ] Home exercise program documented
-- [ ] DME and environmental modifications listed
-- [ ] Discharge criteria defined
-
-### For Mental Health Plans:
-- [ ] DSM-5 diagnostic criteria met
-- [ ] Symptom severity assessed (PHQ-9, GAD-7, etc.)
-- [ ] Suicide/violence risk assessed
-- [ ] Safety plan created (if indicated)
-- [ ] Evidence-based psychotherapy specified
-- [ ] Medication trials and responses documented
-- [ ] Functional and recovery-oriented goals included
-
-### For Chronic Disease Management Plans:
-- [ ] All active conditions prioritized
-- [ ] Medication synergies identified
-- [ ] Polypharmacy addressed
-- [ ] Care coordination plan clear
-- [ ] Registry/population health integration noted
-- [ ] Transition management included
-
-### For Perioperative Plans:
-- [ ] Preoperative risk assessment (RCRI, ASA, Caprini)
-- [ ] Medical optimization documented
-- [ ] ERAS elements included (if applicable)
-- [ ] Postoperative milestones defined
-- [ ] Discharge criteria specified
-- [ ] VTE prophylaxis plan included
-
-### For Pain Management Plans:
-- [ ] Comprehensive pain assessment (location, quality, intensity, impact)
-- [ ] Pain type classified (nociceptive, neuropathic, nociplastic)
-- [ ] Multimodal analgesia approach
-- [ ] Opioid risk assessment (if opioids considered)
-- [ ] Functional goals emphasized (not just pain scores)
-- [ ] Psychological screening and intervention included
-- [ ] CDC opioid guidelines followed (if prescribing)
-
----
-
-## Section 9: Final Review
-
-### ☐ Proofreading
-- [ ] Spelling and grammar checked
-- [ ] No typos or errors
-- [ ] Consistent terminology throughout
-- [ ] Patient name correct throughout (if not de-identified)
-
-### ☐ Completeness Verification
-- [ ] All placeholder text replaced with patient-specific information
-- [ ] All bracketed [fields] customized
-- [ ] No "TBD" or "to be completed" items remaining
-- [ ] All required sections complete
-
-### ☐ Quality Assurance
-- [ ] Plan reviewed by provider
-- [ ] Peer review completed (if applicable)
-- [ ] Compliance verification done
-- [ ] Automated checks run (if available scripts used)
-
-### ☐ Patient Review Preparation
-- [ ] Patient-friendly summary prepared (if needed)
-- [ ] Patient education materials gathered
-- [ ] Consent forms ready for signature
-- [ ] Questions anticipated and prepared to address
-
----
-
-## Scoring and Interpretation
-
-**Total Items**: ~150 (varies by plan type)
-
-### Scoring:
-- Count number of checked items
-- Calculate percentage: (Checked / Total) × 100
-
-### Interpretation:
-- **95-100%**: Excellent - Plan meets highest quality standards
-- **85-94%**: Good - Plan is high quality with minor gaps
-- **70-84%**: Acceptable - Plan is adequate but has areas needing improvement
-- **<70%**: Needs Improvement - Significant gaps in quality or compliance
-
-### Critical Items (Must Have):
-The following items are critical and must be present:
-- ✓ Patient identifier and de-identification notice
-- ✓ Primary diagnosis with ICD-10 code
-- ✓ At least 3 SMART goals
-- ✓ Interventions with rationales
-- ✓ Monitoring plan
-- ✓ Follow-up plan
-- ✓ Patient education
-- ✓ Safety/risk mitigation
-- ✓ Emergency procedures
-- ✓ Provider signature
-
-If any critical item is missing, plan should not be finalized until corrected.
-
----
-
-## Usage Instructions
-
-1. **Review each section** systematically
-2. **Check boxes** as criteria are met
-3. **Note deficiencies** for correction
-4. **Calculate score** to assess overall quality
-5. **Address gaps** before finalizing
-6. **Document review** with reviewer name and date
-
-**Reviewer**: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
-**Date Reviewed**: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
-**Score**: \_\_\_\_\_% (\_\_\_\_ items checked / \_\_\_\_ total items)
-
-**Status**:
-- [ ] Approved for use
-- [ ] Approved with minor revisions
-- [ ] Requires significant revision
-- [ ] Not approved
-
-**Comments/Recommendations**:
-
-\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
-\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
-\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-
----
-
-**Document Version**: 1.0
-**Last Updated**: January 2025
-**Next Review**: Annually or with guideline updates
-
diff --git a/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex b/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex
deleted file mode 100644
index 9115c5f5..00000000
--- a/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex
+++ /dev/null
@@ -1,756 +0,0 @@
-% Rehabilitation Treatment Plan Template
-% For physical therapy, occupational therapy, and rehabilitation services
-% Last updated: 2025
-
-\documentclass[11pt,letterpaper]{article}
-
-% Packages
-\usepackage[top=1in,bottom=1in,left=1in,right=1in]{geometry}
-\usepackage{amsmath,amssymb}
-\usepackage[utf8]{inputenc}
-\usepackage{graphicx}
-\usepackage{array}
-\usepackage{longtable}
-\usepackage{booktabs}
-\usepackage{enumitem}
-\usepackage{xcolor}
-\usepackage{fancyhdr}
-\usepackage{lastpage}
-\usepackage{tabularx}
-\usepackage{multirow}
-\usepackage[most]{tcolorbox}
-
-% Header and footer
-\pagestyle{fancy}
-\fancyhf{}
-\lhead{Rehabilitation Treatment Plan}
-\rhead{Page \thepage\ of \pageref{LastPage}}
-\lfoot{Date Created: \today}
-\rfoot{Confidential Patient Information}
-
-% Title formatting
-\usepackage{titlesec}
-\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}
-\titleformat{\subsection}{\normalsize\bfseries}{\thesubsection}{1em}{}
-
-\begin{document}
-
-% Title
-\begin{center}
-{\Large\bfseries REHABILITATION TREATMENT PLAN}\\[0.5em]
-{\large Physical Therapy | Occupational Therapy | Speech-Language Pathology}\\[0.5em]
-\rule{\textwidth}{1pt}
-\end{center}
-
-\vspace{1em}
-
-% ===== TREATMENT PLAN HIGHLIGHTS (Foundation Medicine Model) =====
-\begin{tcolorbox}[colback=green!5!white,colframe=green!75!black,title=\textbf{TREATMENT PLAN HIGHLIGHTS},fonttitle=\bfseries\large]
-
-\textbf{Key Diagnosis:} [Primary condition requiring rehabilitation - e.g., Post-stroke hemiparesis, Total knee replacement]
-
-\vspace{0.3em}
-\textbf{Primary Functional Goals:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item [Goal 1 - e.g., Independent ambulation with assistive device within 8 weeks]
- \item [Goal 2 - e.g., Return to independent ADLs (bathing, dressing) within 12 weeks]
- \item [Goal 3 - e.g., Improve upper extremity strength to 4/5 for functional tasks]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Main Interventions:}
-\begin{itemize}[leftmargin=*,itemsep=0pt]
- \item \textit{Physical Therapy:} [Focus - e.g., Gait training, strengthening, balance exercises 3x/week]
- \item \textit{Occupational Therapy:} [Focus - e.g., ADL training, adaptive equipment, 2x/week]
- \item \textit{Home Exercise Program:} [Key exercises - e.g., Daily strengthening and ROM exercises]
-\end{itemize}
-
-\vspace{0.3em}
-\textbf{Timeline:} [Duration - e.g., Acute phase (4 weeks), Active rehab (8 weeks), Maintenance (ongoing)]
-
-\end{tcolorbox}
-
-\vspace{1em}
-
-% ===== SECTION 1: PATIENT INFORMATION =====
-\section*{1. Patient Information}
-
-\textbf{HIPAA Notice}: De-identify per Safe Harbor method. Remove all 18 HIPAA identifiers before sharing.
-
-\vspace{0.5em}
-
-\begin{tabularx}{\textwidth}{|l|X|}
-\hline
-\textbf{Patient ID} & [De-identified code, e.g., PT-RH-001] \\ \hline
-\textbf{Age Range} & [e.g., 65-70 years] \\ \hline
-\textbf{Sex} & [Male/Female/Other] \\ \hline
-\textbf{Date of Plan} & [Month/Year only] \\ \hline
-\textbf{Referring Provider} & [Name, Credentials] \\ \hline
-\textbf{Primary Therapist} & [PT/OT/SLP Name, Credentials] \\ \hline
-\textbf{Facility} & [Rehabilitation center/Clinic name] \\ \hline
-\end{tabularx}
-
-\vspace{1em}
-
-\subsection*{Diagnosis and Medical History}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Primary Diagnosis}: [e.g., Right hip fracture status post ORIF] (ICD-10: [code])
- \item \textbf{Secondary Diagnoses}:
- \begin{itemize}
- \item [e.g., Osteoporosis] (ICD-10: [code])
- \item [e.g., Hypertension] (ICD-10: [code])
- \item [Additional relevant conditions]
- \end{itemize}
- \item \textbf{Date of Injury/Surgery}: [Month/Year]
- \item \textbf{Surgical Procedure}: [e.g., Open reduction internal fixation right hip]
- \item \textbf{Precautions/Restrictions}: [e.g., Weight-bearing as tolerated, hip flexion $<$90 degrees]
-\end{itemize}
-
-\subsection*{Current Medications}
-
-Medications affecting rehabilitation:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Pain Management}: [e.g., Oxycodone 5mg Q6H PRN - may affect alertness]
- \item \textbf{Anticoagulation}: [e.g., Enoxaparin 40mg daily - fall precautions]
- \item \textbf{Other Relevant Medications}: [e.g., Beta-blocker - monitor HR during exercise]
-\end{itemize}
-
-\subsection*{Living Situation and Support}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Living Environment}: [e.g., Two-story home, bedroom upstairs, 4 steps to entry]
- \item \textbf{Social Support}: [e.g., Lives with spouse, adult children nearby]
- \item \textbf{Prior Functional Level}: [e.g., Independent in all ADLs, community ambulation]
- \item \textbf{Occupation/Activities}: [e.g., Retired teacher, enjoys gardening and walking]
-\end{itemize}
-
-% ===== SECTION 2: FUNCTIONAL ASSESSMENT =====
-\section*{2. Initial Functional Assessment}
-
-\subsection*{2.1 Functional Independence Measure (FIM) or Similar}
-
-\textbf{Date of Assessment}: [Date]
-
-\begin{tabularx}{\textwidth}{|l|c|c|X|}
-\hline
-\textbf{Domain} & \textbf{Score} & \textbf{Goal} & \textbf{Notes} \\ \hline
-Self-Care & [e.g., 28/42] & [35/42] & Requires assist with lower body dressing, bathing \\ \hline
-Sphincter Control & [42/42] & [42/42] & Independent \\ \hline
-Transfers & [e.g., 12/21] & [18/21] & Moderate assist bed/chair, toilet \\ \hline
-Locomotion & [e.g., 8/14] & [12/14] & Contact guard ambulation 50ft with walker \\ \hline
-Communication & [14/14] & [14/14] & Independent \\ \hline
-Social Cognition & [21/21] & [21/21] & Independent \\ \hline
-\textbf{TOTAL FIM} & \textbf{[125/126]} & \textbf{[142/126]} & \\ \hline
-\end{tabularx}
-
-\vspace{0.5em}
-\textit{FIM Scoring: 7=Complete Independence, 6=Modified Independence, 5=Supervision, 4=Minimal Assist, 3=Moderate Assist, 2=Maximal Assist, 1=Total Assist}
-
-\subsection*{2.2 Physical Therapy Assessment}
-
-\textbf{Range of Motion}:
-\begin{longtable}{|l|c|c|c|}
-\hline
-\textbf{Joint/Motion} & \textbf{Baseline} & \textbf{Goal} & \textbf{Normal Range} \\ \hline
-\endfirsthead
-\hline
-\textbf{Joint/Motion} & \textbf{Baseline} & \textbf{Goal} & \textbf{Normal Range} \\ \hline
-\endhead
-Right hip flexion & 70° (pain at end range) & 110° pain-free & 120° \\ \hline
-Right hip extension & 5° & 15° & 20° \\ \hline
-Right hip abduction & 20° & 35° & 45° \\ \hline
-Right knee flexion & 100° & 125° & 130° \\ \hline
-Right ankle DF/PF & 5°/35° & 10°/40° & 15°/50° \\ \hline
-[Additional joints] & & & \\ \hline
-\end{longtable}
-
-\textbf{Muscle Strength (Manual Muscle Testing - MMT)}:
-\begin{longtable}{|l|c|c|}
-\hline
-\textbf{Muscle Group} & \textbf{Baseline} & \textbf{Goal} \\ \hline
-\endfirsthead
-\hline
-\textbf{Muscle Group} & \textbf{Baseline} & \textbf{Goal} \\ \hline
-\endhead
-Right hip flexors & 3/5 (fair) & 4+/5 (good+) \\ \hline
-Right hip extensors & 3/5 (fair) & 4+/5 (good+) \\ \hline
-Right hip abductors & 2+/5 (poor+) & 4/5 (good) \\ \hline
-Right quadriceps & 4-/5 (good-) & 5/5 (normal) \\ \hline
-Right ankle DF/PF & 4/5 / 4/5 & 5/5 / 5/5 \\ \hline
-Core stability & Fair & Good \\ \hline
-[Additional muscles] & & \\ \hline
-\end{longtable}
-
-\textit{MMT Scale: 5=Normal, 4=Good, 3=Fair, 2=Poor, 1=Trace, 0=Zero}
-
-\textbf{Balance Assessment}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Berg Balance Scale}: [e.g., 38/56 - Moderate fall risk]
- \item \textbf{Goal Berg Score}: [e.g., $>$45/56 - Low fall risk]
- \item \textbf{Static Standing Balance}: [e.g., Able to stand 30 sec with walker, not independent]
- \item \textbf{Dynamic Balance}: [e.g., Unable to step over obstacles safely]
- \item \textbf{Single Leg Stance}: [e.g., Unable, requires support]
-\end{itemize}
-
-\textbf{Gait Assessment}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Assistive Device}: [e.g., Front-wheeled walker]
- \item \textbf{Weight-Bearing Status}: [e.g., WBAT (weight-bearing as tolerated)]
- \item \textbf{Gait Distance}: [e.g., 50 feet with contact guard, requires 1 rest break]
- \item \textbf{Gait Speed}: [e.g., 0.4 m/s (severely impaired, normal $>$1.0 m/s)]
- \item \textbf{Gait Deviations}: [e.g., Shortened stance phase right, Trendelenburg gait, decreased step length]
- \item \textbf{Stairs}: [e.g., Unable to attempt, 4 steps required for home access]
-\end{itemize}
-
-\textbf{Endurance}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{6-Minute Walk Test}: [e.g., 150 feet - severely impaired]
- \item \textbf{Goal Distance}: [e.g., 300+ feet]
- \item \textbf{Perceived Exertion}: [e.g., 5/10 after 50 feet]
- \item \textbf{Vital Signs Response}: [e.g., HR increases 85→105, appropriate response]
-\end{itemize}
-
-\textbf{Pain Assessment}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Pain Location}: [e.g., Right hip, groin region]
- \item \textbf{Pain at Rest}: [e.g., 2/10]
- \item \textbf{Pain with Activity}: [e.g., 6/10 with weight-bearing, 4/10 with ROM]
- \item \textbf{Pain Impact}: [e.g., Limits therapy participation, improves with rest]
-\end{itemize}
-
-\subsection*{2.3 Occupational Therapy Assessment}
-
-\textbf{Activities of Daily Living (ADLs)}:
-\begin{longtable}{|l|c|X|}
-\hline
-\textbf{Activity} & \textbf{Level} & \textbf{Description} \\ \hline
-\endfirsthead
-\hline
-\textbf{Activity} & \textbf{Level} & \textbf{Description} \\ \hline
-\endhead
-Bathing & Mod A & Requires assist entering/exiting shower, reaching lower extremities \\ \hline
-Dressing - Upper Body & I & Independent \\ \hline
-Dressing - Lower Body & Mod A & Requires assist donning socks, shoes, pants due to hip precautions \\ \hline
-Toileting & Min A & Requires assist with clothing management \\ \hline
-Grooming & I & Independent \\ \hline
-Feeding & I & Independent \\ \hline
-Functional Mobility & CG & Contact guard for bed mobility, transfers \\ \hline
-\end{longtable}
-
-\textit{I=Independent, SV=Supervision, CG=Contact Guard, Min A=Minimal Assist, Mod A=Moderate Assist, Max A=Maximal Assist}
-
-\textbf{Instrumental Activities of Daily Living (IADLs)}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Meal Preparation}: Not assessed, not safe for standing tasks currently
- \item \textbf{Housekeeping}: Dependent, unable to perform
- \item \textbf{Laundry}: Dependent
- \item \textbf{Shopping}: Dependent
- \item \textbf{Home Management}: Requires complete assistance
-\end{itemize}
-
-\textbf{Upper Extremity Function}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Grip Strength}: Right [kg], Left [kg] (compared to normative data)
- \item \textbf{Coordination}: [e.g., Within normal limits bilaterally]
- \item \textbf{Sensation}: [e.g., Intact to light touch, proprioception]
-\end{itemize}
-
-\subsection*{2.4 Cognitive and Perceptual Assessment}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Alertness/Orientation}: [e.g., Alert, oriented x3]
- \item \textbf{Memory}: [e.g., Intact for short and long-term]
- \item \textbf{Safety Awareness}: [e.g., Good insight into limitations, follows precautions]
- \item \textbf{Executive Function}: [e.g., Able to problem-solve, sequence tasks appropriately]
- \item \textbf{Visual-Perceptual Skills}: [e.g., Within normal limits]
-\end{itemize}
-
-\subsection*{2.5 Environmental Assessment}
-
-\textbf{Home Safety Concerns}:
-\begin{itemize}[leftmargin=*]
- \item 4 steps to enter home - needs stair training
- \item Bedroom/bathroom upstairs - may need temporary bedroom on main floor
- \item Shower stall (no tub) - needs shower chair, grab bars
- \item Scatter rugs - fall hazard, recommend removal
- \item Adequate lighting - satisfactory
-\end{itemize}
-
-% ===== SECTION 3: REHABILITATION GOALS =====
-\section*{3. Rehabilitation Goals (SMART Format)}
-
-\subsection*{3.1 Short-Term Goals (2-4 weeks)}
-
-\textbf{Impairment-Level Goals}:
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Range of Motion}: Increase right hip flexion from 70° to 90° pain-free within 2 weeks to improve functional mobility.
-
- \item \textbf{Strength}: Improve right hip abductor strength from 2+/5 to 3+/5 within 3 weeks to reduce Trendelenburg gait.
-
- \item \textbf{Balance}: Increase Berg Balance Scale from 38/56 to 42/56 within 4 weeks to reduce fall risk.
-\end{enumerate}
-
-\textbf{Activity-Level Goals}:
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Ambulation}: Ambulate 150 feet with front-wheeled walker, supervision level, within 3 weeks.
-
- \item \textbf{Transfers}: Perform bed-to-chair and toilet transfers with supervision (no physical assist) within 2 weeks.
-
- \item \textbf{Stairs}: Ascend/descend 4 stairs with handrail and supervision within 4 weeks for home access.
-
- \item \textbf{Lower Body Dressing}: Don socks and shoes with adaptive equipment (reacher, sock aid) with minimal assist within 3 weeks.
-
- \item \textbf{Bathing}: Shower independently using shower chair and grab bars with setup assistance within 4 weeks.
-\end{enumerate}
-
-\subsection*{3.2 Long-Term Goals (6-12 weeks)}
-
-\textbf{Participation-Level Goals}:
-\begin{enumerate}[leftmargin=*]
- \item \textbf{Community Ambulation}: Walk independently 300+ feet with assistive device on varied terrain within 8 weeks to enable community outings.
-
- \item \textbf{ADL Independence}: Achieve independence in all basic ADLs (bathing, dressing, toileting, transfers) within 8 weeks for safe home discharge.
-
- \item \textbf{Home Management}: Return to light homemaking tasks (meal prep, laundry) with modified techniques within 12 weeks.
-
- \item \textbf{Recreational Activities}: Resume gardening with adaptive techniques and equipment within 12 weeks.
-
- \item \textbf{Fall Prevention}: Demonstrate safety awareness and fall prevention strategies for independent home functioning within 8 weeks.
-\end{enumerate}
-
-\textbf{Discharge Goals}:
-\begin{itemize}[leftmargin=*]
- \item Safe discharge home with appropriate DME (durable medical equipment)
- \item Independent or supervision level for all ADLs
- \item Community ambulation with assistive device
- \item Patient and family educated on home exercise program
- \item Fall risk minimized with environmental modifications
-\end{itemize}
-
-\subsection*{3.3 Patient-Centered Goals}
-
-Patient's top priorities:
-\begin{enumerate}[leftmargin=*]
- \item "I want to go home and not need help from my family"
- \item "I want to be able to go to the grocery store again"
- \item "I want to get back to my garden this spring"
-\end{enumerate}
-
-% ===== SECTION 4: TREATMENT INTERVENTIONS =====
-\section*{4. Treatment Interventions}
-
-\subsection*{4.1 Physical Therapy Interventions}
-
-\textbf{Frequency}: 3 sessions per week, 45-60 minutes per session, for 8-12 weeks
-
-\textbf{Therapeutic Exercise}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Strengthening}:
- \begin{itemize}
- \item Hip abduction in sidelying with resistance band: 3 sets x 10 reps
- \item Hip extension prone: 3 sets x 10 reps
- \item Quadriceps sets and straight leg raises: 3 sets x 10 reps
- \item Standing hip abduction at parallel bars: 2 sets x 10 reps
- \item Step-ups (2-inch platform progressing to 6-inch): 2 sets x 10 reps
- \item Squats (partial, with walker for support): 2 sets x 10 reps
- \end{itemize}
-
- \item \textbf{Range of Motion}:
- \begin{itemize}
- \item Active-assisted hip flexion supine: 3 sets x 10 reps
- \item Hip flexor stretching (modified, respecting precautions): 3 x 30 sec holds
- \item Ankle pumps and circles: 3 sets x 10 reps
- \end{itemize}
-
- \item \textbf{Core Stabilization}:
- \begin{itemize}
- \item Abdominal bracing: 10 x 10 sec holds
- \item Pelvic tilts: 2 sets x 10 reps
- \item Dead bug progression (modified): 2 sets x 8 reps
- \end{itemize}
-\end{itemize}
-
-\textbf{Balance Training}:
-\begin{itemize}[leftmargin=*]
- \item Static standing balance exercises at parallel bars
- \item Weight shifting activities (anterior-posterior, medial-lateral)
- \item Tandem stance progression
- \item Single-leg stance (holding support as needed)
- \item Reaching activities outside base of support
- \item Step-over obstacles
-\end{itemize}
-
-\textbf{Gait Training}:
-\begin{itemize}[leftmargin=*]
- \item Gait training with front-wheeled walker on level surfaces
- \item Focus on step length symmetry, heel strike, push-off
- \item Progress from contact guard to supervision to modified independence
- \item Advance distance as tolerated (goal 300+ feet)
- \item Outdoor gait training on varied terrain (grass, gravel, curbs)
- \item Reduce assistive device as appropriate (walker → cane → no device)
-\end{itemize}
-
-\textbf{Stair Training}:
-\begin{itemize}[leftmargin=*]
- \item Stair negotiation with handrail (step-to pattern initially)
- \item 4 steps ascending/descending to match home environment
- \item Progress to step-over-step pattern
- \item Practice with carrying objects
-\end{itemize}
-
-\textbf{Modalities (as indicated)}:
-\begin{itemize}[leftmargin=*]
- \item Ice after therapy sessions for pain management
- \item Electrical stimulation for hip abductor muscle re-education (if indicated)
- \item Ultrasound for soft tissue mobility (if indicated)
-\end{itemize}
-
-\textbf{Patient Education}:
-\begin{itemize}[leftmargin=*]
- \item Hip precautions education and review
- \item Fall prevention strategies
- \item Proper use of assistive device
- \item Pain management techniques
- \item Activity pacing and energy conservation
-\end{itemize}
-
-\subsection*{4.2 Occupational Therapy Interventions}
-
-\textbf{Frequency}: 3 sessions per week, 45 minutes per session, for 6-8 weeks
-
-\textbf{ADL Training}:
-\begin{itemize}[leftmargin=*]
- \item \textbf{Bathing}: Practice shower transfers with grab bars and shower chair, long-handled sponge technique
- \item \textbf{Lower Body Dressing}: Training with reacher, sock aid, elastic shoelaces, dressing stick
- \item \textbf{Toileting}: Practice with raised toilet seat and grab bars
- \item \textbf{Bed Mobility}: Log-roll technique, use of bed rail if needed
- \item \textbf{Kitchen Tasks}: Safe standing tolerance, use of walker basket to carry items
-\end{itemize}
-
-\textbf{Adaptive Equipment Training}:
-\begin{itemize}[leftmargin=*]
- \item Reacher (32-inch) for dressing, picking up objects
- \item Sock aid and dressing stick for lower extremity dressing
- \item Long-handled shoe horn
- \item Long-handled sponge/bath brush
- \item Shower chair with back
- \item Raised toilet seat with arms
- \item Bedside commode (if bedroom upstairs initially)
-\end{itemize}
-
-\textbf{Home Management Training}:
-\begin{itemize}[leftmargin=*]
- \item Light meal preparation (seated when possible)
- \item Laundry (modified techniques, avoid lifting heavy baskets)
- \item Safe reaching and bending techniques
- \item Organization strategies to minimize unnecessary walking
-\end{itemize}
-
-\textbf{Upper Extremity Strengthening}:
-\begin{itemize}[leftmargin=*]
- \item Therapeutic putty for grip strength
- \item Weighted exercises for shoulder stability (needed for walker use)
- \item Fine motor coordination activities
-\end{itemize}
-
-\textbf{Energy Conservation and Work Simplification}:
-\begin{itemize}[leftmargin=*]
- \item Activity pacing strategies
- \item Prioritization of daily tasks
- \item Use of rest breaks
- \item Organization to reduce unnecessary steps
-\end{itemize}
-
-\subsection*{4.3 Home Exercise Program (HEP)}
-
-Patient provided with illustrated HEP to perform daily at home:
-
-\begin{longtable}{|p{4cm}|p{4cm}|p{5cm}|}
-\hline
-\textbf{Exercise} & \textbf{Dosage} & \textbf{Instructions} \\ \hline
-\endfirsthead
-\hline
-\textbf{Exercise} & \textbf{Dosage} & \textbf{Instructions} \\ \hline
-\endhead
-Ankle pumps & 3 x 10, 3x daily & Seated or lying, point toes up/down \\ \hline
-Quadriceps sets & 3 x 10, 2x daily & Tighten thigh muscle, hold 5 sec \\ \hline
-Hip abduction sidelying & 2 x 10, 1x daily & Lift top leg, hold 2 sec, lower slowly \\ \hline
-Sit-to-stand & 2 x 10, 2x daily & Use walker, stand fully, sit slowly \\ \hline
-Standing hip flexion & 2 x 10, 1x daily & Lift knee (respect 90° precaution) \\ \hline
-Balance - standing & 3 x 30 sec, 2x daily & Stand at counter, reduce hand support as able \\ \hline
-Walking & 10 min, 2-3x daily & With walker, gradually increase distance \\ \hline
-\end{longtable}
-
-\textbf{HEP Instructions}:
-\begin{itemize}[leftmargin=*]
- \item Perform exercises on non-therapy days
- \item Stop if pain exceeds 4/10
- \item Maintain hip precautions at all times
- \item Progress per therapist instruction only
- \item Record completion in exercise log
-\end{itemize}
-
-\subsection*{4.4 Durable Medical Equipment (DME)}
-
-\textbf{Recommended Equipment}:
-\begin{itemize}[leftmargin=*]
- \item Front-wheeled walker (standard adult)
- \item Shower chair with back (adjustable height)
- \item Grab bars for shower (2 bars - vertical and horizontal)
- \item Raised toilet seat with arms
- \item Reacher (32-inch)
- \item Sock aid
- \item Long-handled shoe horn
- \item Long-handled sponge
- \item Bedside commode (if needed initially)
- \item Non-slip bath mat
-\end{itemize}
-
-% ===== SECTION 5: TREATMENT SCHEDULE =====
-\section*{5. Treatment Schedule and Timeline}
-
-\subsection*{Treatment Phases}
-
-\begin{tabularx}{\textwidth}{|l|l|X|}
-\hline
-\textbf{Phase} & \textbf{Duration} & \textbf{Focus} \\ \hline
-Acute/Early & Weeks 1-2 & Pain management, basic mobility, ADL training with equipment, safety \\ \hline
-Intermediate & Weeks 3-6 & Strength/ROM progression, advanced balance, stair training, ADL refinement \\ \hline
-Advanced & Weeks 7-10 & Community ambulation, IADL training, HEP independence, discharge prep \\ \hline
-Transition & Weeks 11-12 & Reduce frequency, monitor independence, finalize home setup \\ \hline
-\end{tabularx}
-
-\subsection*{Session Frequency and Duration}
-
-\begin{tabularx}{\textwidth}{|l|X|X|}
-\hline
-\textbf{Discipline} & \textbf{Frequency} & \textbf{Duration} \\ \hline
-Physical Therapy & 3x/week & 45-60 min/session, 8-12 weeks total \\ \hline
-Occupational Therapy & 3x/week & 45 min/session, 6-8 weeks total \\ \hline
-Home Exercise Program & Daily (non-therapy days) & 30 min/day \\ \hline
-\end{tabularx}
-
-\subsection*{Progress Assessments}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Weekly}: Informal progress monitoring, pain levels, exercise tolerance
- \item \textbf{Biweekly}: Reassess key impairments (ROM, strength, balance measures)
- \item \textbf{Week 4}: Formal reassessment, FIM score, goal progress review, plan modification if needed
- \item \textbf{Week 8}: Comprehensive reassessment, discharge planning, final goal review
- \item \textbf{Discharge}: Final outcomes documentation, HEP review, follow-up recommendations
-\end{itemize}
-
-% ===== SECTION 6: OUTCOME MEASURES =====
-\section*{6. Outcome Measures and Monitoring}
-
-\subsection*{Standardized Assessments}
-
-\begin{longtable}{|p{4.5cm}|p{3cm}|p{3cm}|p{3cm}|}
-\hline
-\textbf{Measure} & \textbf{Baseline} & \textbf{Goal} & \textbf{Frequency} \\ \hline
-\endfirsthead
-\hline
-\textbf{Measure} & \textbf{Baseline} & \textbf{Goal} & \textbf{Frequency} \\ \hline
-\endhead
-FIM Score & [125/126] & [142/126] & Week 0, 4, 8, discharge \\ \hline
-Berg Balance Scale & [38/56] & [$>$45/56] & Week 0, 4, 8, discharge \\ \hline
-6-Minute Walk Test & [150 feet] & [$>$300 feet] & Week 0, 4, 8, discharge \\ \hline
-Gait Speed & [0.4 m/s] & [$>$0.8 m/s] & Week 0, 4, 8, discharge \\ \hline
-Pain (NRS 0-10) & [6/10 with activity] & [$<$3/10] & Each session \\ \hline
-ROM - Hip Flexion & [70°] & [110°] & Biweekly \\ \hline
-Strength - Hip Abductors & [2+/5] & [4/5] & Biweekly \\ \hline
-\end{longtable}
-
-\subsection*{Progress Indicators}
-
-\textbf{Positive Progress}:
-\begin{itemize}[leftmargin=*]
- \item Increasing ambulation distance
- \item Reduced level of assistance for ADLs
- \item Improved balance scores
- \item Decreased pain with activity
- \item Increased strength/ROM measurements
- \item Patient confidence and self-efficacy improving
-\end{itemize}
-
-\textbf{Barriers to Progress}:
-\begin{itemize}[leftmargin=*]
- \item Inadequate pain control
- \item Poor therapy attendance or compliance
- \item Medical complications or setbacks
- \item Psychosocial factors (depression, anxiety, lack of support)
- \item Cognitive impairment affecting learning
-\end{itemize}
-
-% ===== SECTION 7: EXPECTED OUTCOMES =====
-\section*{7. Expected Outcomes and Prognosis}
-
-\subsection*{Rehabilitation Potential}
-
-\textbf{Overall Prognosis}: [e.g., Good] - Patient is motivated, has good social support, no significant cognitive impairment, and appropriate medical management.
-
-\textbf{Expected Functional Outcome}:
-\begin{itemize}[leftmargin=*]
- \item Independent or supervision level for all basic ADLs
- \item Community ambulation with assistive device (walker or cane)
- \item Ability to negotiate stairs for home access
- \item Safe discharge home with DME and environmental modifications
- \item Return to modified IADL participation
-\end{itemize}
-
-\subsection*{Timeline for Key Milestones}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Week 2}: Transfers with supervision, basic ADLs with minimal assist
- \item \textbf{Week 4}: Ambulation 150 feet with walker/supervision, improved pain control
- \item \textbf{Week 6}: Stairs with handrail/supervision, ADLs mostly independent with equipment
- \item \textbf{Week 8}: Community ambulation 300+ feet, all ADLs independent, ready for discharge
-\end{itemize}
-
-% ===== SECTION 8: FOLLOW-UP AND DISCHARGE PLANNING =====
-\section*{8. Follow-Up and Discharge Planning}
-
-\subsection*{Discharge Criteria}
-
-Patient ready for discharge when:
-\begin{itemize}[leftmargin=*]
- \item Safe for home environment (with or without DME)
- \item Independent or supervision level for ADLs
- \item Patient/caregiver educated on HEP and safety
- \item DME obtained and home modifications completed
- \item Functional goals achieved or plateau reached
-\end{itemize}
-
-\subsection*{Discharge Recommendations}
-
-\begin{itemize}[leftmargin=*]
- \item Continue HEP as prescribed, progress as tolerated
- \item Follow up with orthopedic surgeon at [timeframe]
- \item Consider outpatient therapy if continued progress expected
- \item Home health PT/OT if unable to access outpatient services
- \item Transition to community exercise program (e.g., senior center, aquatics)
-\end{itemize}
-
-\subsection*{Home Modifications and Safety}
-
-\begin{itemize}[leftmargin=*]
- \item Install grab bars in shower (vertical and horizontal)
- \item Ensure adequate lighting, especially on stairs
- \item Remove scatter rugs and clutter
- \item Consider temporary bedroom on main floor if stairs difficult
- \item Rearrange furniture to create clear pathways
- \item Store frequently used items at accessible heights
-\end{itemize}
-
-\subsection*{Follow-Up Communication}
-
-\begin{itemize}[leftmargin=*]
- \item Progress reports sent to referring physician biweekly
- \item Final discharge summary to all providers
- \item Home safety assessment completed
- \item DME delivered and training completed
- \item Emergency contact: Therapy department [phone]
-\end{itemize}
-
-% ===== SECTION 9: SAFETY AND PRECAUTIONS =====
-\section*{9. Safety Considerations and Precautions}
-
-\subsection*{Medical Precautions}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Hip Precautions} (post-ORIF):
- \begin{itemize}
- \item No hip flexion $>$90 degrees for 6-8 weeks
- \item No hip adduction past midline
- \item No internal rotation
- \item Sleep with abduction pillow
- \item Use elevated toilet seat and shower chair
- \end{itemize}
-
- \item \textbf{Weight-Bearing Status}: [e.g., WBAT - Weight-bearing as tolerated]
-
- \item \textbf{Anticoagulation}: On enoxaparin - use fall precautions, report bruising/bleeding
-
- \item \textbf{Pain Management}: Opioid use may cause drowsiness - schedule therapy before pain medication if possible
-\end{itemize}
-
-\subsection*{Fall Risk Management}
-
-\textbf{Fall Risk Factors}:
-\begin{itemize}[leftmargin=*]
- \item Recent surgery/hospitalization
- \item Impaired balance (Berg 38/56)
- \item Use of walker
- \item Pain medication (opioids)
- \item Environmental hazards at home
-\end{itemize}
-
-\textbf{Fall Prevention Strategies}:
-\begin{itemize}[leftmargin=*]
- \item Consistent use of walker
- \item Non-slip footwear with closed heel
- \item Call for assistance for transfers initially
- \item Adequate lighting
- \item Avoid carrying items while walking (use walker basket)
- \item Balance training in therapy
- \item Home safety modifications
-\end{itemize}
-
-\subsection*{Contraindications to Treatment}
-
-Hold or modify therapy if:
-\begin{itemize}[leftmargin=*]
- \item Fever $>$101°F or signs of infection
- \item Uncontrolled pain ($>$7/10)
- \item Excessive swelling, warmth, redness at surgical site
- \item Chest pain, severe shortness of breath
- \item Dizziness, lightheadedness, abnormal vital signs
- \item Patient refusal or excessive fatigue
-\end{itemize}
-
-\subsection*{Emergency Procedures}
-
-\begin{itemize}[leftmargin=*]
- \item \textbf{Fall During Therapy}: Assess for injury, vital signs, notify physician, incident report
- \item \textbf{Chest Pain/SOB}: Stop activity, call 911, notify physician
- \item \textbf{Excessive Pain}: Stop activity, apply ice, notify physician, reassess treatment plan
-\end{itemize}
-
-% ===== SECTION 10: PROVIDER SIGNATURE =====
-\vspace{2em}
-
-\section*{10. Rehabilitation Team Signatures}
-
-\textbf{Physical Therapist}:\\[0.5em]
-Signature: \rule{6cm}{0.5pt} \quad Date: \rule{3cm}{0.5pt}\\
-Name/Credentials: \rule{6cm}{0.5pt}\\[1em]
-
-\textbf{Occupational Therapist}:\\[0.5em]
-Signature: \rule{6cm}{0.5pt} \quad Date: \rule{3cm}{0.5pt}\\
-Name/Credentials: \rule{6cm}{0.5pt}\\[1em]
-
-\textbf{Referring Physician Approval}:\\[0.5em]
-Signature: \rule{6cm}{0.5pt} \quad Date: \rule{3cm}{0.5pt}\\
-Name/Credentials: \rule{6cm}{0.5pt}\\
-
-\vspace{2em}
-\begin{center}
-\rule{\textwidth}{1pt}\\
-\textbf{End of Rehabilitation Treatment Plan}\\
-This document contains confidential patient information protected by HIPAA.
-\end{center}
-
-\end{document}
-
-% ========== NOTES FOR USERS ==========
-%
-% CUSTOMIZATION:
-% - Replace all bracketed placeholders with patient-specific information
-% - Adjust goals based on baseline assessment
-% - Modify exercises based on patient tolerance and precautions
-% - Update DME recommendations as needed
-%
-% COMPILATION:
-% pdflatex rehabilitation_treatment_plan.tex
-
diff --git a/skills/treatment-plans/assets/source_fact_manifest_template.json b/skills/treatment-plans/assets/source_fact_manifest_template.json
new file mode 100644
index 00000000..c49e39f3
--- /dev/null
+++ b/skills/treatment-plans/assets/source_fact_manifest_template.json
@@ -0,0 +1,11 @@
+{
+ "schema_version": "2.0",
+ "document_type": "source_fact_manifest",
+ "document_id": "SOURCE-FACTS-TEMPLATE",
+ "subject_ref": "SYNTHETIC-CASE-001",
+ "data_classification": "synthetic",
+ "status": "DRAFT_NOT_FOR_CLINICAL_USE",
+ "notice": "DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED",
+ "created_at": null,
+ "facts": []
+}
diff --git a/skills/treatment-plans/assets/transition_reconciliation_template.json b/skills/treatment-plans/assets/transition_reconciliation_template.json
new file mode 100644
index 00000000..9e781d61
--- /dev/null
+++ b/skills/treatment-plans/assets/transition_reconciliation_template.json
@@ -0,0 +1,27 @@
+{
+ "schema_version": "2.0",
+ "document_type": "transition_reconciliation_record",
+ "document_id": "TRANSITION-RECONCILIATION-TEMPLATE",
+ "subject_ref": "SYNTHETIC-CASE-001",
+ "data_classification": "synthetic",
+ "status": "DRAFT_NOT_FOR_CLINICAL_USE",
+ "notice": "DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED",
+ "created_at": null,
+ "transition": {
+ "from_setting_as_documented": "",
+ "to_setting_as_documented": "",
+ "handoff_date": null,
+ "responsible_sender_role": "",
+ "responsible_receiver_role": ""
+ },
+ "medication_reconciliation": {
+ "status": "pending_authorized_review",
+ "source_list_fact_ids": [],
+ "destination_list_fact_ids": [],
+ "discrepancy_status": "not_assessed",
+ "completed_by_role": "",
+ "completed_at": null
+ },
+ "handoff_items": [],
+ "unresolved_items": []
+}
diff --git a/skills/treatment-plans/references/README.md b/skills/treatment-plans/references/README.md
index 9cf0ff53..c60c555f 100644
--- a/skills/treatment-plans/references/README.md
+++ b/skills/treatment-plans/references/README.md
@@ -1,488 +1,19 @@
-# Treatment Plans Skill
+# Treatment-Plan Documentation References
-## Overview
+These references support a documentation-only workflow. They do not contain disease-specific treatment guidance and do not authorize clinical use.
-Skill for generating **concise, clinician-focused** medical treatment plans across all clinical specialties. Provides LaTeX/PDF templates with SMART goal frameworks, evidence-based interventions, regulatory compliance, and validation tools for patient-centered care planning.
+Read in this order:
-**Default to 1-page format** for most cases - think "quick reference card" not "comprehensive textbook".
+1. `safety_scope.md` — hard boundary, refusal rules, emergency routing, and accountable roles.
+2. `privacy_governance.md` — local-only handling, minimum-necessary practice, de-identification limits, and report minimization.
+3. `documentation_workflow.md` — package lifecycle, deterministic checks, sign-off, and release gates.
+4. `source_boundaries.md` — FDA labeling, Medication Guide, REMS, CMS, and official reporting boundaries.
+5. `shared_decision_handoff.md` — shared-decision records, transitions, reconciliation, and ownership.
+6. `source_ledger.md` — authoritative sources reviewed on 2026-07-23.
+7. `security_validation.md` — baseline security findings and post-redesign validation.
-## What's Included
+## Governing rule
-### 📋 Seven Treatment Plan Types
-
-1. **One-Page Treatment Plan** (PREFERRED) - Concise, quick-reference format for most clinical scenarios
-2. **General Medical Treatment Plans** - Primary care, chronic diseases (diabetes, hypertension, heart failure)
-3. **Rehabilitation Treatment Plans** - Physical therapy, occupational therapy, cardiac/pulmonary rehab
-4. **Mental Health Treatment Plans** - Psychiatric care, depression, anxiety, PTSD, substance use
-5. **Chronic Disease Management Plans** - Complex multimorbidity, long-term care coordination
-6. **Perioperative Care Plans** - Preoperative optimization, ERAS protocols, postoperative recovery
-7. **Pain Management Plans** - Acute and chronic pain, multimodal analgesia, opioid-sparing strategies
-
-### 📚 Reference Files (5 comprehensive guides)
-
-- `treatment_plan_standards.md` - Professional standards, documentation requirements, legal considerations
-- `goal_setting_frameworks.md` - SMART goals, patient-centered outcomes, shared decision-making
-- `intervention_guidelines.md` - Evidence-based treatments, pharmacological and non-pharmacological
-- `regulatory_compliance.md` - HIPAA compliance, billing documentation, quality measures
-- `specialty_specific_guidelines.md` - Detailed guidelines for each treatment plan type
-
-### 📄 LaTeX Templates (7 professional templates)
-
-- `one_page_treatment_plan.tex` - **FIRST CHOICE** - Dense, scannable 1-page format (like precision oncology reports)
-- `general_medical_treatment_plan.tex` - Comprehensive medical care planning
-- `rehabilitation_treatment_plan.tex` - Functional restoration and therapy
-- `mental_health_treatment_plan.tex` - Psychiatric and behavioral health
-- `chronic_disease_management_plan.tex` - Long-term disease management
-- `perioperative_care_plan.tex` - Surgical and procedural care
-- `pain_management_plan.tex` - Multimodal pain treatment
-
-### 🔧 Validation Scripts (4 automation tools)
-
-- `generate_template.py` - Interactive template selection and generation
-- `validate_treatment_plan.py` - Comprehensive quality and compliance checking
-- `check_completeness.py` - Verify all required sections present
-- `timeline_generator.py` - Create visual treatment timelines and schedules
-
-## Quick Start
-
-### Generate a Treatment Plan Template
-
-```bash
-cd .claude/skills/treatment-plans/scripts
-python generate_template.py
-
-# Or specify type directly
-python generate_template.py --type general_medical --output diabetes_plan.tex
-```
-
-Available template types:
-- `one_page` (PREFERRED - use for most cases)
-- `general_medical`
-- `rehabilitation`
-- `mental_health`
-- `chronic_disease`
-- `perioperative`
-- `pain_management`
-
-### Compile to PDF
-
-```bash
-cd /path/to/your/treatment/plan
-pdflatex my_treatment_plan.tex
-```
-
-### Validate Your Treatment Plan
-
-```bash
-# Check for completeness
-python check_completeness.py my_treatment_plan.tex
-
-# Comprehensive validation
-python validate_treatment_plan.py my_treatment_plan.tex
-```
-
-### Generate Treatment Timeline
-
-```bash
-python timeline_generator.py --plan my_treatment_plan.tex --output timeline.pdf
-```
-
-## Standard Treatment Plan Components
-
-All templates include these essential sections:
-
-### 1. Patient Information (De-identified)
-- Demographics and relevant medical background
-- Active conditions and comorbidities
-- Current medications and allergies
-- Functional status baseline
-- HIPAA-compliant de-identification
-
-### 2. Diagnosis and Assessment Summary
-- Primary diagnosis (ICD-10 coded)
-- Secondary diagnoses
-- Severity classification
-- Functional limitations
-- Risk stratification
-
-### 3. Treatment Goals (SMART Format)
-
-**Short-term goals** (1-3 months):
-- Specific, measurable outcomes
-- Realistic targets with defined timeframes
-- Patient-centered priorities
-
-**Long-term goals** (6-12 months):
-- Disease control targets
-- Functional improvement objectives
-- Quality of life enhancement
-- Complication prevention
-
-### 4. Interventions
-
-- **Pharmacological**: Medications with dosages, frequencies, monitoring
-- **Non-pharmacological**: Lifestyle modifications, behavioral interventions, education
-- **Procedural**: Planned procedures, specialist referrals, diagnostic testing
-
-### 5. Timeline and Schedule
-- Treatment phases with timeframes
-- Appointment frequency
-- Milestone assessments
-- Expected treatment duration
-
-### 6. Monitoring Parameters
-- Clinical outcomes to track
-- Assessment tools and scales
-- Monitoring frequency
-- Intervention thresholds
-
-### 7. Expected Outcomes
-- Primary outcome measures
-- Success criteria
-- Timeline for improvement
-- Long-term prognosis
-
-### 8. Follow-up Plan
-- Scheduled appointments
-- Communication protocols
-- Emergency procedures
-- Transition planning
-
-### 9. Patient Education
-- Condition understanding
-- Self-management skills
-- Warning signs
-- Resources and support
-
-### 10. Risk Mitigation
-- Adverse effect management
-- Safety monitoring
-- Emergency action plans
-- Fall/infection prevention
-
-## Common Use Cases
-
-### 1. Type 2 Diabetes Management
-
-```
-Goal: Create comprehensive treatment plan for newly diagnosed diabetes
-
-Template: general_medical_treatment_plan.tex
-
-Key Components:
-- SMART goals: HbA1c <7% in 3 months, weight loss 10 lbs in 6 months
-- Medications: Metformin titration schedule
-- Lifestyle: Diet, exercise, glucose monitoring
-- Monitoring: HbA1c every 3 months, quarterly visits
-- Education: Diabetes self-management education
-```
-
-### 2. Post-Stroke Rehabilitation
-
-```
-Goal: Develop rehab plan for stroke patient with hemiparesis
-
-Template: rehabilitation_treatment_plan.tex
-
-Key Components:
-- Functional assessment: FIM scores, ROM, strength testing
-- PT goals: Ambulation 150 feet with cane in 12 weeks
-- OT goals: Independent ADLs, upper extremity function
-- Treatment schedule: PT/OT/SLP 3x week each
-- Home exercise program
-```
-
-### 3. Major Depressive Disorder
-
-```
-Goal: Create integrated treatment plan for depression
-
-Template: mental_health_treatment_plan.tex
-
-Key Components:
-- Assessment: PHQ-9 score 16 (moderate depression)
-- Goals: Reduce PHQ-9 to <5, return to work in 12 weeks
-- Psychotherapy: CBT weekly sessions
-- Medication: SSRI with titration schedule
-- Safety planning: Crisis contacts, warning signs
-```
-
-### 4. Total Knee Replacement
-
-```
-Goal: Perioperative care plan for elective TKA
-
-Template: perioperative_care_plan.tex
-
-Key Components:
-- Preop optimization: Medical clearance, medication management
-- ERAS protocol implementation
-- Postop milestones: Ambulation POD 1, discharge POD 2-3
-- Pain management: Multimodal analgesia
-- Rehab plan: PT starting POD 0
-```
-
-### 5. Chronic Low Back Pain
-
-```
-Goal: Multimodal pain management plan
-
-Template: pain_management_plan.tex
-
-Key Components:
-- Pain assessment: Location, intensity, functional impact
-- Goals: Reduce pain 7/10 to 3/10, return to work
-- Medications: Non-opioid analgesics, adjuvants
-- PT: Core strengthening, McKenzie exercises
-- Behavioral: CBT for pain, mindfulness
-- Interventional: Consider ESI if inadequate response
-```
-
-## SMART Goals Framework
-
-All treatment plans use SMART criteria for goal-setting:
-
-- **Specific**: Clear, well-defined outcome (not vague)
-- **Measurable**: Quantifiable metrics or observable behaviors
-- **Achievable**: Realistic given patient capabilities and resources
-- **Relevant**: Aligned with patient priorities and values
-- **Time-bound**: Specific timeframe for achievement
-
-### Examples
-
-**Good SMART Goals**:
-- Reduce HbA1c from 8.5% to <7% within 3 months
-- Walk independently 150 feet with assistive device by 8 weeks
-- Decrease PHQ-9 depression score from 18 to <10 in 8 weeks
-- Achieve knee flexion >90 degrees by postoperative day 14
-- Reduce pain from 7/10 to ≤4/10 within 6 weeks
-
-**Poor Goals** (not SMART):
-- "Feel better" (not specific or measurable)
-- "Improve diabetes" (not specific or time-bound)
-- "Get stronger" (not measurable)
-- "Return to normal" (vague, not specific)
-
-## Workflow Examples
-
-### Standard Treatment Plan Workflow
-
-1. **Assess patient** - Complete history, physical, diagnostic testing
-2. **Select template** - Choose appropriate template for clinical context
-3. **Generate template** - `python generate_template.py --type [type]`
-4. **Customize plan** - Fill in patient-specific information (de-identified)
-5. **Set SMART goals** - Define measurable short and long-term goals
-6. **Specify interventions** - Evidence-based pharmacological and non-pharmacological
-7. **Create timeline** - Schedule appointments, milestones, reassessments
-8. **Define monitoring** - Outcome measures, assessment frequency
-9. **Validate completeness** - `python check_completeness.py plan.tex`
-10. **Quality check** - `python validate_treatment_plan.py plan.tex`
-11. **Review quality checklist** - Compare to `quality_checklist.md`
-12. **Generate PDF** - `pdflatex plan.tex`
-13. **Review with patient** - Shared decision-making, confirm understanding
-14. **Implement and document** - Execute plan, track progress in clinical notes
-15. **Reassess and modify** - Adjust plan based on outcomes
-
-### Multidisciplinary Care Plan Workflow
-
-1. **Identify team members** - PCP, specialists, therapists, case manager
-2. **Create base plan** - Generate template for primary condition
-3. **Add specialty sections** - Integrate consultant recommendations
-4. **Coordinate goals** - Ensure alignment across disciplines
-5. **Define communication** - Team meeting schedule, documentation sharing
-6. **Assign responsibilities** - Clarify who manages each intervention
-7. **Create care timeline** - Coordinate appointments across providers
-8. **Share plan** - Distribute to all team members and patient
-9. **Track collectively** - Shared monitoring and outcome tracking
-10. **Regular team review** - Adjust plan collaboratively
-
-## Best Practices
-
-### Patient-Centered Care
-✓ Involve patients in goal-setting and decision-making
-✓ Respect cultural beliefs and language preferences
-✓ Address health literacy with appropriate language
-✓ Align plan with patient values and life circumstances
-✓ Support patient activation and self-management
-
-### Evidence-Based Practice
-✓ Follow current clinical practice guidelines
-✓ Use interventions with proven efficacy
-✓ Incorporate quality measures (HEDIS, CMS)
-✓ Avoid low-value or ineffective interventions
-✓ Update plans based on emerging evidence
-
-### Regulatory Compliance
-✓ De-identify per HIPAA Safe Harbor method (18 identifiers)
-✓ Document medical necessity for billing support
-✓ Include informed consent documentation
-✓ Sign and date all treatment plans
-✓ Maintain professional documentation standards
-
-### Quality Documentation
-✓ Complete all required sections
-✓ Use clear, professional medical language
-✓ Include specific, measurable goals
-✓ Specify exact medications (dose, route, frequency)
-✓ Define monitoring parameters and frequency
-✓ Address safety and risk mitigation
-
-### Care Coordination
-✓ Communicate plan to entire care team
-✓ Define roles and responsibilities
-✓ Coordinate across care settings
-✓ Integrate specialist recommendations
-✓ Plan for care transitions
-
-## Integration with Other Skills
-
-### Clinical Reports
-- **SOAP Notes**: Document treatment plan implementation and progress
-- **H&P Documents**: Initial assessment informs treatment planning
-- **Discharge Summaries**: Summarize treatment plan execution
-- **Progress Notes**: Track goal achievement and plan modifications
-
-### Scientific Writing
-- **Citation Management**: Reference clinical practice guidelines
-- **Literature Review**: Understand evidence base for interventions
-- **Research Lookup**: Find current treatment recommendations
-
-### Research
-- **Research Grants**: Treatment protocols for clinical trials
-- **Clinical Trial Reports**: Document trial interventions
-
-## Clinical Practice Guidelines
-
-Treatment plans should align with evidence-based guidelines:
-
-### General Medicine
-- American Diabetes Association (ADA) Standards of Care
-- ACC/AHA Cardiovascular Guidelines
-- GOLD COPD Guidelines
-- JNC-8 Hypertension Guidelines
-- KDIGO Chronic Kidney Disease Guidelines
-
-### Rehabilitation
-- APTA Physical Therapy Clinical Practice Guidelines
-- AOTA Occupational Therapy Practice Guidelines
-- AHA/AACVPR Cardiac Rehabilitation Guidelines
-- Stroke Rehabilitation Best Practices
-
-### Mental Health
-- APA (American Psychiatric Association) Practice Guidelines
-- VA/DoD Clinical Practice Guidelines for Mental Health
-- NICE Guidelines (UK)
-- Evidence-based psychotherapy protocols (CBT, DBT, ACT)
-
-### Pain Management
-- CDC Opioid Prescribing Guidelines
-- AAPM (American Academy of Pain Medicine) Guidelines
-- WHO Analgesic Ladder
-- Multimodal Analgesia Best Practices
-
-### Perioperative Care
-- ERAS (Enhanced Recovery After Surgery) Society Guidelines
-- ASA Perioperative Guidelines
-- SCIP (Surgical Care Improvement Project) Measures
-
-## Professional Standards
-
-### Documentation Requirements
-- Complete and accurate patient information
-- Clear diagnosis with appropriate ICD-10 coding
-- Evidence-based interventions
-- Measurable goals and outcomes
-- Defined monitoring and follow-up
-- Provider signature, credentials, and date
-
-### Medical Necessity
-Treatment plans must demonstrate:
-- Medical appropriateness of interventions
-- Alignment with diagnosis and severity
-- Evidence supporting treatment choices
-- Expected outcomes and benefit
-- Frequency and duration justification
-
-### Legal Considerations
-- Informed consent documentation
-- Patient understanding and agreement
-- Risk disclosure and mitigation
-- Professional liability protection
-- Compliance with state/federal regulations
-
-## Support and Resources
-
-### Getting Help
-
-1. **Check reference files** - Comprehensive guidance in `references/` directory
-2. **Review templates** - See example structures in `assets/` directory
-3. **Run validation scripts** - Identify issues with automated tools
-4. **Consult SKILL.md** - Detailed documentation and best practices
-5. **Review quality checklist** - Ensure all quality criteria met
-
-### External Resources
-
-- Clinical practice guidelines from specialty societies
-- UpToDate and DynaMed for treatment recommendations
-- AHRQ Effective Health Care Program
-- Cochrane Library for intervention evidence
-- CMS Quality Measures and HEDIS specifications
-- HEDIS (Healthcare Effectiveness Data and Information Set)
-
-### Professional Organizations
-
-- American Medical Association (AMA)
-- American Academy of Family Physicians (AAFP)
-- Specialty society guidelines (ADA, ACC, AHA, APA, etc.)
-- Joint Commission standards
-- Centers for Medicare & Medicaid Services (CMS)
-
-## Frequently Asked Questions
-
-### How do I choose the right template?
-
-Match the template to your primary clinical focus:
-- **Chronic medical conditions** → general_medical or chronic_disease
-- **Post-surgery or injury** → rehabilitation or perioperative
-- **Psychiatric conditions** → mental_health
-- **Pain as primary issue** → pain_management
-
-### What if my patient has multiple conditions?
-
-Use the `chronic_disease_management_plan.tex` template for complex multimorbidity, or choose the template for the primary condition and add sections for comorbidities.
-
-### How often should treatment plans be updated?
-
-- **Initial creation**: At diagnosis or treatment initiation
-- **Regular updates**: Every 3-6 months for chronic conditions
-- **Significant changes**: When goals are met or treatment is modified
-- **Annual review**: Minimum for all chronic disease plans
-
-### Can I modify the LaTeX templates?
-
-Yes! Templates are designed to be customized. Modify sections, add specialty-specific content, or adjust formatting to meet your needs.
-
-### How do I ensure HIPAA compliance?
-
-- Remove all 18 HIPAA identifiers (see Safe Harbor method)
-- Use age ranges instead of exact ages (e.g., "60-65" not "63")
-- Remove specific dates, use relative timelines
-- Omit geographic identifiers smaller than state
-- Use `check_deidentification.py` script from clinical-reports skill
-
-### What if validation scripts find issues?
-
-Review the specific issues identified, consult reference files for guidance, and revise the plan accordingly. Common issues include:
-- Missing required sections
-- Goals not meeting SMART criteria
-- Insufficient monitoring parameters
-- Incomplete medication information
-
-## License
-
-Part of the Claude Scientific Writer project. See main LICENSE file.
-
----
-
-For detailed documentation, see `SKILL.md`. For issues or questions, consult the comprehensive reference files in the `references/` directory.
+Only format information already supplied and verified by authorized licensed professionals. Missing or conflicting clinical content remains unresolved and is routed back to the responsible professional.
+The bundled scripts perform structural, traceability, completeness, privacy-process, date, and consistency checks. They do not establish clinical correctness, medical necessity, safety, effectiveness, regulatory status, legal compliance, privacy compliance, or fitness for care.
diff --git a/skills/treatment-plans/references/documentation_workflow.md b/skills/treatment-plans/references/documentation_workflow.md
new file mode 100644
index 00000000..f4159075
--- /dev/null
+++ b/skills/treatment-plans/references/documentation_workflow.md
@@ -0,0 +1,165 @@
+# Documentation Package Workflow
+
+Last reviewed: **2026-07-23**
+
+## Package contract
+
+A complete package contains exactly one JSON object for each document type:
+
+- `source_fact_manifest`
+- `clinician_authored_intervention_record`
+- `goals_monitoring_checkpoint_record`
+- `informed_preference_shared_decision_record`
+- `transition_reconciliation_record`
+- `intended_use_handoff_record`
+
+All six must use schema version `2.0` and the same `subject_ref`, `data_classification`, draft status, and notice.
+
+## 1. Intended-use gate
+
+Complete the intended-use/handoff record first:
+
+- purpose and authorized users;
+- local setting and accountable roles;
+- prohibited-use list;
+- privacy and processing attestations;
+- local policy, retention, change-control, and reporting routes;
+- local emergency-process reference;
+- handoff sender, recipient, and acknowledgment;
+- clinician sign-off and documentation-handoff release gate.
+
+Do not remove prohibited uses. The generator restores the complete list in every new package.
+
+## 2. Source-fact manifest
+
+Every clinical or process statement used elsewhere must have a source fact. A fact records:
+
+- a stable fact ID;
+- fact kind;
+- the exact bounded statement supplied;
+- source type, title, local locator, and version/date;
+- verification status, verifier role, and time;
+- applicability status when an official source or policy is involved.
+
+Allowed source categories distinguish signed local records, authorized EHR records, current FDA labeling, current REMS materials, current official guidance, and local policy.
+
+The manifest does not decide which source applies. An authorized professional must confirm applicability.
+
+## 3. Clinician-authored interventions
+
+Each intervention record must:
+
+- state that the decision was supplied and verified by an authorized licensed professional;
+- preserve the clinician-authored action without rewriting it into a recommendation;
+- link to at least one verified source fact;
+- record parameters only as supplied;
+- identify the responsible role;
+- preserve explicit start/end dates when supplied;
+- include verifier role and time.
+
+The validator checks structure and provenance only. It does not parse or judge a medication, procedure, therapy, device, referral, or instruction.
+
+## 4. Goals, monitoring, and checkpoints
+
+Separate:
+
+- goals — statement, measurement, target, target date, and source facts;
+- monitoring items — item, method, supplied frequency text, explicit next due date, owner, and source facts;
+- checkpoints — exact supplied date, purpose, owner, linked records, and source facts.
+
+Do not convert a narrative frequency into dates. Do not infer a checkpoint from a target, medication, intervention type, standard interval, or prior appointment.
+
+## 5. Informed preferences and shared decisions
+
+Record only what the authorized clinician documented:
+
+- decision topic;
+- options actually presented;
+- whether benefits, harms, and uncertainty were documented;
+- the person's stated preference;
+- the clinician-documented outcome;
+- participant and author roles;
+- source facts, time, and acknowledgment status.
+
+Do not generate missing options, risk estimates, benefit claims, alternatives, or consent language.
+
+## 6. Transition and reconciliation
+
+Record:
+
+- sending and receiving settings and roles;
+- exact handoff date;
+- medication-reconciliation status;
+- source and destination list fact references;
+- discrepancy status and authorized reviewer;
+- handoff items, owners, recipients, and acknowledgment;
+- unresolved items and their local route.
+
+`completed_by_authorized_clinician` is a declaration to be verified against the local record. The script does not perform reconciliation.
+
+## 7. Deterministic checks
+
+Run in this order:
+
+```bash
+python3 scripts/validate_treatment_plan.py PACKAGE_DIRECTORY
+python3 scripts/validate_traceability.py PACKAGE_DIRECTORY
+python3 scripts/check_completeness.py PACKAGE_DIRECTORY
+python3 scripts/privacy_process_check.py PACKAGE_DIRECTORY
+python3 scripts/check_consistency.py PACKAGE_DIRECTORY
+python3 scripts/timeline_generator.py PACKAGE_DIRECTORY --output SCHEDULE.json
+```
+
+The checks answer different questions:
+
+- structural validator — are document types, fields, types, enums, bounds, and dates valid?
+- traceability validator — do all clinical/process records point to existing verified facts?
+- completeness checker — are required records, reviews, routes, acknowledgments, sign-off, and release declarations complete?
+- privacy/process checker — are local authorization, minimization, external-tool prohibition, qualified review, retention, and direct-identifier safeguards documented?
+- consistency checker — do package IDs, statuses, classifications, references, and explicit date order agree?
+- timeline generator — what events occur on dates already supplied?
+
+Run every check again after any change.
+
+## 8. Minimized issue handling
+
+Reports use field paths, not values. For example, a report may identify `interventions[0].verification.status` without printing the action text.
+
+Resolve each issue in the authoritative local record:
+
+1. Locate the field path.
+2. Compare with the signed source.
+3. Ask the responsible authorized role to supply or verify the missing value.
+4. Update provenance.
+5. Re-run all checks.
+
+Never correct clinical content from memory or general guidance.
+
+## 9. Sign-off and handoff
+
+Before releasing for authorized documentation handoff:
+
+- all source facts are verified;
+- source applicability is confirmed where required;
+- interventions are verified;
+- reconciliation is completed or explicitly not applicable by an authorized reviewer;
+- unresolved items are routed and acknowledged;
+- privacy/process review is complete;
+- local policy and reporting routes are populated;
+- the recipient is identified;
+- the authorized licensed signer completes the attestation;
+- the release gate is set to `released_for_authorized_documentation_handoff`;
+- blocker codes are empty.
+
+The visible draft/not-medical-advice notice remains. Release does not authorize implementation by an agent.
+
+## 10. Change control
+
+For every revision:
+
+- preserve the prior authorized version according to local records policy;
+- update source versions and verification times;
+- re-run every check;
+- obtain new sign-off when clinical content, recipient, classification, purpose, or governing source changes;
+- record disposition of superseded local copies;
+- never overwrite a source record or silently reuse an old approval.
diff --git a/skills/treatment-plans/references/goal_setting_frameworks.md b/skills/treatment-plans/references/goal_setting_frameworks.md
deleted file mode 100644
index c57763e0..00000000
--- a/skills/treatment-plans/references/goal_setting_frameworks.md
+++ /dev/null
@@ -1,411 +0,0 @@
-# Goal Setting Frameworks for Treatment Plans
-
-## Overview
-
-Effective treatment goals are the cornerstone of successful patient care. This reference provides comprehensive guidance on creating SMART goals, patient-centered outcome selection, and shared decision-making processes for treatment planning across all medical specialties.
-
-## SMART Goals Framework
-
-### Definition
-
-**SMART** is a mnemonic for goal criteria that ensure objectives are well-defined and achievable:
-- **S**pecific
-- **M**easurable
-- **A**chievable
-- **R**elevant
-- **T**ime-bound
-
-### 1. Specific
-
-Goals must be clear, well-defined, and unambiguous.
-
-**Components of Specificity**:
-- **What**: Exactly what will be accomplished
-- **Who**: Who is responsible (patient, provider, both)
-- **Where**: Context or setting if relevant
-- **Which**: Specific aspect of health/function addressed
-
-**Examples**:
-
-| Poor (Vague) | Good (Specific) |
-|--------------|-----------------|
-| "Feel better" | "Reduce depressive symptoms as measured by PHQ-9 score" |
-| "Improve diabetes" | "Reduce HbA1c from current 8.5% to less than 7%" |
-| "Get stronger" | "Increase right quadriceps strength from 3/5 to 4/5 on manual muscle testing" |
-| "Lose weight" | "Reduce body weight by 10 pounds (from 210 to 200 lbs)" |
-| "Exercise more" | "Walk 30 minutes, 5 days per week" |
-
-### 2. Measurable
-
-Goals must include quantifiable metrics or observable criteria to track progress.
-
-**Types of Measurement**:
-- **Quantitative**: Numbers, percentages, scores, scales
- - Lab values: HbA1c, LDL cholesterol, eGFR
- - Vital signs: BP, heart rate, weight
- - Scales: Pain (0-10 NRS), PHQ-9, GAD-7, FIM
- - Functional: Distance walked, ROM degrees, strength grades
-
-- **Qualitative Observable**: Behaviors that can be observed and verified
- - "Patient demonstrates proper insulin injection technique"
- - "Patient ambulates 150 feet with walker independently"
- - "Patient follows 2-step commands"
-
-**Examples**:
-
-| Not Measurable | Measurable |
-|----------------|------------|
-| "Better blood pressure" | "Systolic BP <130 mmHg and diastolic BP <80 mmHg" |
-| "Less pain" | "Pain intensity reduced from 7/10 to ≤4/10 on numeric rating scale" |
-| "Improved mobility" | "Ambulate 300 feet with front-wheeled walker, supervision level" |
-| "Take medications regularly" | "Medication adherence >90% as measured by refill rates" |
-| "Sleep better" | "Sleep 7-8 hours nightly with <2 awakenings per night" |
-
-### 3. Achievable
-
-Goals must be realistic given patient's capabilities, resources, and circumstances.
-
-**Factors to Consider**:
-- **Patient capabilities**: Physical, cognitive, psychological capacity
-- **Severity of condition**: Advanced disease may have limited improvement potential
-- **Treatment efficacy**: What can realistically be achieved with available treatments
-- **Resources**: Access to care, medications, equipment, support
-- **Time available**: Adequate time to achieve the goal
-- **Motivation**: Patient's readiness to change and engagement
-
-**Setting Achievable Goals**:
-- Start with baseline assessment
-- Know expected treatment effects (e.g., metformin reduces HbA1c by 1-1.5%)
-- Set incremental goals for large changes (lose 5 lbs, then 10 lbs, rather than jump to 50 lbs)
-- Challenge but don't overwhelm patient
-- Adjust goals based on progress
-
-**Examples**:
-
-| Not Achievable | Achievable |
-|----------------|------------|
-| "Marathon ready in 1 month" (sedentary 70-year-old post-MI) | "Walk 1 mile continuously in 3 months" |
-| "HbA1c from 12% to <6% in 6 weeks" | "HbA1c from 12% to <9% in 3 months, <7% in 6 months" |
-| "Full knee ROM 0-140° by POD 3" (post-TKA) | "Knee ROM 0-90° by week 2, 0-110° by week 6" |
-| "Cure chronic pain" | "Reduce pain from 7/10 to 4/10 and improve function by 30%" |
-
-### 4. Relevant
-
-Goals must align with patient values, priorities, and overall treatment objectives.
-
-**Relevance Criteria**:
-- **Patient-centered**: Matters to the patient, reflects their priorities
-- **Clinically meaningful**: Achieving goal improves health or quality of life
-- **Aligned with diagnosis**: Goal addresses the condition being treated
-- **Appropriate timing**: Right goal for current phase of treatment
-- **Integrated**: Fits with other treatment goals
-
-**Assessing Relevance**:
-- Ask patient: "What's most important to you?" "What do you want to be able to do?"
-- Ensure goals address functional limitations that matter to patient
-- Connect clinical metrics to patient-meaningful outcomes (e.g., "HbA1c <7% reduces risk of vision loss")
-- Avoid provider-driven goals that don't resonate with patient
-
-**Examples**:
-
-| Less Relevant | More Relevant |
-|---------------|---------------|
-| "Reduce medication count" (when medications controlling symptoms well) | "Simplify regimen to improve adherence" (if missing doses due to complexity) |
-| "Perfect blood sugars" (patient's priority is energy) | "Improve energy levels through better glucose control" |
-| "Walk 5 miles" (patient just wants to shop independently) | "Walk through grocery store without assistance" |
-
-### 5. Time-Bound
-
-Goals must have specific deadlines or timeframes for achievement.
-
-**Timeframe Considerations**:
-- **Short-term goals**: Days to 3 months
-- **Intermediate goals**: 3-6 months
-- **Long-term goals**: 6-12 months or longer for chronic conditions
-- **Reassessment intervals**: Check progress at defined intervals
-
-**Time Elements to Include**:
-- Target date or timeframe
-- Checkpoint dates for progress review
-- Frequency of actions (e.g., "exercise 30 min, 5x/week")
-
-**Examples**:
-
-| Not Time-Bound | Time-Bound |
-|----------------|------------|
-| "Eventually lose weight" | "Lose 15 pounds within 6 months (approximately 1-2 lbs/week)" |
-| "Attend physical therapy" | "Complete 12 physical therapy sessions over 8 weeks, 1-2x weekly" |
-| "When ready, return to work" | "Return to modified duty work within 12 weeks post-surgery" |
-| "Improve depression symptoms" | "Reduce PHQ-9 score from 18 to <10 within 8 weeks of starting SSRI and CBT" |
-
-## Creating SMART Goals: Step-by-Step Process
-
-### Step 1: Assess Baseline
-- Identify current status: symptoms, lab values, functional level
-- Use standardized assessments when available
-- Document quantitative baseline
-
-### Step 2: Identify Desired Outcome
-- What needs to improve?
-- Engage patient: "What would you like to be different?"
-- Consider clinical needs and patient priorities
-
-### Step 3: Make It Specific
-- Define exact outcome
-- Eliminate vague language
-- Include all relevant details
-
-### Step 4: Add Measurement
-- How will progress be tracked?
-- What metric or observable behavior?
-- Baseline → Target value
-
-### Step 5: Reality Check (Achievable?)
-- Is this possible given patient's condition, resources, treatment effects?
-- May need to adjust expectations
-- Set incremental goals if needed
-
-### Step 6: Ensure Relevance
-- Does patient care about this goal?
-- Is it clinically meaningful?
-- Does it align with overall treatment plan?
-
-### Step 7: Set Timeline
-- When will goal be achieved?
-- When will progress be reviewed?
-- Break into short-term and long-term if needed
-
-### Step 8: Document and Communicate
-- Write goal in clear SMART format
-- Share with patient and care team
-- Ensure patient understanding
-
-## Goal Hierarchies and Levels
-
-### ICF Framework (International Classification of Functioning, Disability and Health)
-
-Useful for rehabilitation and functional goals:
-
-1. **Impairment-Level Goals**: Body structure/function
- - Example: "Increase shoulder flexion ROM from 90° to 140°"
-
-2. **Activity-Level Goals**: Task performance
- - Example: "Dress upper body independently"
-
-3. **Participation-Level Goals**: Life role engagement
- - Example: "Return to work as teacher"
-
-### Medical Outcome Levels
-
-1. **Biological/Clinical Goals**: Lab values, vital signs, disease markers
- - Example: "HbA1c <7%, BP <130/80, LDL <70 mg/dL"
-
-2. **Symptom Goals**: Patient-reported symptoms
- - Example: "Pain ≤4/10, no dyspnea with ADLs"
-
-3. **Functional Goals**: What patient can do
- - Example: "Walk 1 mile, climb 2 flights of stairs"
-
-4. **Quality of Life Goals**: Overall well-being
- - Example: "Return to hobbies, improve sleep quality"
-
-## Patient-Centered Outcome Measures (PCOMs)
-
-### Definition
-Outcomes that matter most to patients, beyond traditional clinical metrics.
-
-### Common PCOMs
-
-**Patient-Reported Outcome Measures (PROMs)**:
-- SF-36 or SF-12 (general health-related quality of life)
-- PROMIS (Patient-Reported Outcomes Measurement Information System)
-- Disease-specific QoL scales (e.g., Kansas City Cardiomyopathy Questionnaire for HF)
-
-**Functional Outcomes**:
-- Activities of Daily Living (ADLs): Bathing, dressing, toileting, transferring, feeding, continence
-- Instrumental ADLs (IADLs): Shopping, cooking, housekeeping, managing finances, transportation
-- Occupational/educational functioning
-- Social functioning and relationships
-- Recreation and leisure participation
-
-**Patient Priorities**:
-- What matters most to individual patient
-- May differ from clinician priorities
-- Examples: "Play with grandchildren," "Travel to daughter's wedding," "Avoid nursing home"
-
-### Integrating PCOMs into Goals
-
-**Approach**:
-1. Ask patient about priorities early in assessment
-2. Link clinical goals to patient-meaningful outcomes
-3. Include at least some goals directly addressing patient priorities
-4. Use patient's language in documenting goals when possible
-
-**Example Integration**:
-- **Clinical goal**: "Reduce HbA1c from 8.5% to <7% in 3 months"
-- **Linked patient-centered goal**: "Improve energy levels to play with grandchildren without fatigue"
-- Both goals documented, progress on both tracked
-
-## Shared Decision-Making in Goal Setting
-
-### What is Shared Decision-Making (SDM)?
-
-Collaborative process where clinicians and patients jointly:
-- Discuss treatment options
-- Weigh risks and benefits
-- Consider patient values and preferences
-- Make decisions together
-
-### SDM in Treatment Goal Setting
-
-**Steps**:
-
-1. **Choice Awareness**: Acknowledge multiple possible goals/approaches
- - "We could focus on aggressive HbA1c lowering vs. minimizing hypoglycemia risk. What's more important to you?"
-
-2. **Option Presentation**: Present goal options with pros/cons
- - "Option A: Intensive BP control (<120/80) reduces stroke risk but requires more medications. Option B: Standard control (<140/90) is easier but slightly higher stroke risk."
-
-3. **Values Clarification**: Understand patient priorities
- - "How do you feel about taking multiple medications?" "How much does avoiding injections matter to you?"
-
-4. **Preference Integration**: Incorporate preferences into goals
- - If patient prioritizes avoiding medications → "Control BP with lifestyle changes and one medication if possible"
-
-5. **Decision**: Agree on goals together
- - "It sounds like you'd like to try intensive lifestyle changes for 3 months before adding another medication. Let's plan for that."
-
-6. **Document**: Record shared decision-making process
- - "Goals established through shared decision-making. Patient expressed preference for..."
-
-### Decision Aids
-
-Tools to facilitate SDM:
-- Option grids comparing approaches
-- Numerical risk/benefit data
-- Patient stories/testimonials
-- Visual aids (pictures, diagrams)
-- "What matters to you" worksheets
-
-## Special Considerations for Different Populations
-
-### Older Adults
-- Functional independence often priority over disease-specific metrics
-- Balance aggressive treatment vs. treatment burden
-- Consider life expectancy and time to benefit
-- Fall prevention, polypharmacy reduction may be key goals
-- Quality over quantity of life
-
-### Pediatric
-- Developmental stage-appropriate goals
-- Family-centered (involve parents/caregivers)
-- Growth and development milestones
-- School/social functioning
-- Transition planning (pediatric to adult care)
-
-### Chronic Disease
-- Long-term sustainable goals
-- Balance ambition with realistic expectations
-- Complication prevention
-- Quality of life maintenance
-- Adaptation and acceptance alongside improvement
-
-### Palliative/End-of-Life
-- Comfort and symptom management primary
-- Functional goals focused on valued activities
-- Psychosocial and spiritual needs
-- Caregiver support
-- Dignity and autonomy
-
-### Complex Multi-Morbidity
-- Prioritize most impactful goals
-- Coordinate goals across conditions (when treatments overlap, even better)
-- Avoid conflicting treatments
-- Minimize treatment burden
-- Realistic expectations with multiple conditions
-
-## Common Goal-Setting Pitfalls
-
-### Pitfall 1: Provider-Centric Goals
-**Problem**: Goals reflect what provider thinks is important, not patient priorities
-**Solution**: Ask patient early in visit what they hope to achieve, incorporate their language
-
-### Pitfall 2: Too Many Goals
-**Problem**: Overwhelming patient with 10+ goals
-**Solution**: Prioritize 3-5 key goals, build on success
-
-### Pitfall 3: All-or-Nothing Thinking
-**Problem**: Goal is "cure" or "perfection"
-**Solution**: Incremental goals, meaningful improvement valued
-
-### Pitfall 4: Ignoring Barriers
-**Problem**: Goals set without assessing feasibility (resources, support, access)
-**Solution**: Identify barriers during assessment, problem-solve or adjust goals
-
-### Pitfall 5: Static Goals
-**Problem**: Set goals and never revisit
-**Solution**: Regular reassessment, modify as patient progresses or circumstances change
-
-### Pitfall 6: Purely Clinical Metrics
-**Problem**: All goals are lab values, no functional or QoL goals
-**Solution**: Balance clinical markers with functional, symptom, and QoL outcomes
-
-### Pitfall 7: No Patient Buy-In
-**Problem**: Patient doesn't believe goal is achievable or important
-**Solution**: Shared decision-making, motivational interviewing to explore ambivalence
-
-## Examples of SMART Goals by Condition
-
-### Diabetes
-**Short-term**: "Reduce HbA1c from 8.5% to <7.5% within 3 months by initiating metformin 1000mg BID and reducing carbohydrate intake to 45-60g per meal."
-
-**Long-term**: "Maintain HbA1c <7% for 6+ months, prevent microvascular complications, and improve energy levels to engage in daily walking for 30 minutes."
-
-### Heart Failure
-**Short-term**: "Achieve euvolemia (no edema, stable weight within 2 lbs) within 2 weeks through furosemide dose optimization and sodium restriction <2000mg/day."
-
-**Long-term**: "Maintain NYHA Class II functional status, prevent HF hospitalizations, and walk 1/4 mile without dyspnea within 3 months."
-
-### Depression
-**Short-term**: "Reduce PHQ-9 score from 18 to <10 within 8 weeks by starting escitalopram 10mg daily and attending weekly CBT sessions."
-
-**Long-term**: "Achieve depression remission (PHQ-9 <5), return to work full-time, and re-engage in social activities with friends 2-3x/week within 4 months."
-
-### Post-Stroke Rehabilitation
-**Short-term**: "Increase right arm strength from 2/5 to 3+/5 and improve Functional Independence Measure (FIM) score from 85 to 100 within 4 weeks through PT/OT 5x/week."
-
-**Long-term**: "Achieve independence in all ADLs, ambulate 500 feet with cane on level surfaces, and return home (not nursing facility) within 3 months."
-
-### Chronic Low Back Pain
-**Short-term**: "Reduce pain intensity from 7/10 to 4/10 and increase walking tolerance from 10 minutes to 30 minutes within 6 weeks using multimodal analgesia (SNRI, NSAID, PT)."
-
-**Long-term**: "Return to modified duty work within 3 months, engage in hobbies (fishing, gardening with adaptations), and reduce pain interference on daily life by 50% (Brief Pain Inventory)."
-
-### Hypertension
-**Short-term**: "Reduce blood pressure from 152/94 to <140/90 mmHg within 4 weeks by initiating lisinopril 10mg daily and reducing sodium intake to <2300mg/day."
-
-**Long-term**: "Achieve and maintain BP <130/80 mmHg, reduce ASCVD 10-year risk from 15% to <10%, and prevent cardiovascular events."
-
-## Tools and Resources
-
-### Goal-Setting Templates
-- SMART goal worksheet (fill-in-the-blank format)
-- Goal-tracking sheets for patients
-- Motivational interviewing "change talk" to elicit goals
-
-### Assessment Tools
-- Goal Attainment Scaling (GAS): Personalized outcome measure
-- Canadian Occupational Performance Measure (COPM): Patient-identified functional goals
-- Patient-Reported Outcomes Measurement Information System (PROMIS)
-
-### Patient Education
-- "Setting Health Goals" handouts
-- Goal visualization exercises
-- Tracking apps and logs
-
----
-
-**Document Version**: 1.0
-**Last Updated**: January 2025
-**Next Review**: January 2026
-
diff --git a/skills/treatment-plans/references/intervention_guidelines.md b/skills/treatment-plans/references/intervention_guidelines.md
deleted file mode 100644
index 2c29a7dc..00000000
--- a/skills/treatment-plans/references/intervention_guidelines.md
+++ /dev/null
@@ -1,507 +0,0 @@
-# Evidence-Based Intervention Guidelines
-
-## Overview
-
-This reference provides comprehensive guidance on selecting, implementing, and documenting evidence-based interventions across pharmacological, non-pharmacological, and procedural treatment modalities. These guidelines support treatment plan development with current best practices and clinical recommendations.
-
-## Evidence Hierarchy
-
-### Levels of Evidence
-
-**Level I: Highest Quality**
-- Systematic reviews and meta-analyses of randomized controlled trials (RCTs)
-- Large multi-center RCTs
-
-**Level II: High Quality**
-- Individual RCTs
-- Systematic reviews of observational studies
-
-**Level III: Moderate Quality**
-- Cohort studies
-- Case-control studies
-- Well-designed observational studies
-
-**Level IV: Lower Quality**
-- Case series
-- Case reports
-- Expert opinion
-
-**Recommendation Strength**:
-- **Grade A**: Strong recommendation, high-quality evidence
-- **Grade B**: Moderate recommendation, moderate-quality evidence
-- **Grade C**: Weak recommendation, low-quality evidence
-- **Grade D**: Recommendation against (evidence of harm or no benefit)
-
-## Pharmacological Interventions
-
-### Medication Selection Principles
-
-#### 1. Evidence-Based Prescribing
-- Use medications with proven efficacy for indication
-- Follow clinical practice guidelines
-- Consider comparative effectiveness data
-- Prefer medications with better safety profiles when equivalent efficacy
-
-#### 2. Patient-Specific Factors
-- Comorbidities and contraindications
-- Organ function (renal, hepatic)
-- Drug allergies and intolerances
-- Concurrent medications (drug interactions)
-- Age, pregnancy status
-- Genetic factors (pharmacogenomics when available)
-- Cost and insurance coverage
-
-#### 3. Medication Safety
-- Start low, go slow (especially in elderly, multiple comorbidities)
-- Titrate to target dose based on response and tolerance
-- Monitor for adverse effects
-- Avoid potentially inappropriate medications (Beers Criteria for elderly)
-- Polypharmacy reduction when possible
-
-### Common Medication Classes by Indication
-
-#### Hypertension
-
-**First-Line Agents** (per JNC-8, ACC/AHA guidelines):
-- **ACE Inhibitors** (lisinopril, enalapril): Preferred if diabetes, CKD, or heart failure
-- **ARBs** (losartan, valsartan): Alternative to ACE if intolerant
-- **Calcium Channel Blockers** (amlodipine): Particularly effective in elderly, Black patients
-- **Thiazide Diuretics** (chlorthalidone, HCTZ): Cost-effective, good CV outcomes
-
-**Dosing Strategy**:
-- Start single agent at low dose
-- Titrate to maximum tolerated dose before adding second agent
-- Combination therapy often needed (2-3 agents)
-- Monitor BP response, adjust every 2-4 weeks
-
-#### Type 2 Diabetes Mellitus
-
-**First-Line** (ADA Standards of Care):
-- **Metformin**: First-line for all patients unless contraindicated (eGFR <30)
- - Start 500-850mg daily or BID, titrate to 2000mg total daily
-
-**Second-Line** (individualize based on comorbidities):
-- **SGLT2 Inhibitors** (empagliflozin, dapagliflozin): If heart failure or CKD (strong cardio-renal benefits)
-- **GLP-1 Receptor Agonists** (semaglutide, dulaglutide): If ASCVD or high risk, weight loss needed
-- **DPP-4 Inhibitors** (sitagliptin): If low hypoglycemia risk desired
-- **Sulfonylureas** (glipizide): Cost-effective but hypoglycemia risk
-- **Insulin**: If HbA1c very elevated ($>$10%) or symptoms of hyperglycemia
-
-#### Depression
-
-**First-Line SSRIs** (APA guidelines):
-- Sertraline, escitalopram, fluoxetine, citalopram, paroxetine
-- Start low (e.g., sertraline 50mg, escitalopram 10mg)
-- Titrate after 2-4 weeks if partial response
-- Full trial: 6-8 weeks at therapeutic dose
-- Continue 6-12 months after remission (longer if recurrent)
-
-**Second-Line**:
-- **SNRIs** (venlafaxine, duloxetine): Especially if chronic pain comorbidity
-- **Bupropion**: If sexual dysfunction concern, smoking cessation
-- **Mirtazapine**: If insomnia/appetite stimulation needed
-
-**Augmentation** (if partial response):
-- Second antidepressant from different class
-- Atypical antipsychotic (aripiprazole, quetiapine) - FDA-approved augmentation
-- Lithium, thyroid hormone (triiodothyronine)
-
-#### Chronic Pain
-
-**Multimodal Analgesia** (WHO Pain Ladder, CDC Opioid Guidelines):
-
-**Non-Opioid Analgesics**:
-- **Acetaminophen**: 3-4g/day divided, safe if liver function normal
-- **NSAIDs**: Ibuprofen, naproxen, meloxicam - short-term or chronic with GI protection
- - Monitor: Renal function, BP, GI bleeding risk
-
-**Adjuvant Analgesics for Neuropathic Pain**:
-- **Gabapentin**: 300mg titrated to 1800-3600mg/day divided TID
-- **Pregabalin**: 75mg BID titrated to 150-300mg BID (better bioavailability than gabapentin)
-- **SNRIs** (duloxetine): 60mg daily for diabetic neuropathy, chronic MSK pain
-- **TCAs** (amitriptyline, nortriptyline): Low-dose (10-75mg QHS) - second-line due to side effects
-
-**Topical Agents**:
-- Lidocaine patches 5%, diclofenac gel, capsaicin cream
-- Local effect, minimal systemic absorption
-
-**Opioids** (CDC guidelines - use cautiously):
-- Only after non-opioid multimodal therapies inadequate
-- Lowest effective dose, short-acting preferred initially
-- Avoid $>$90 MME/day if possible
-- UDS, PDMP monitoring, naloxone co-prescription
-- Reassess frequently, taper if not meeting functional goals
-
-#### Heart Failure with Reduced Ejection Fraction (HFrEF)
-
-**Guideline-Directed Medical Therapy (GDMT)** - "Foundational Four":
-
-1. **ACE Inhibitor or ARB or ARNI**
- - ACE: Lisinopril 20-40mg daily, enalapril 10-20mg BID
- - ARNI (Sacubitril/Valsartan): 24/26mg BID → 97/103mg BID (superior to ACE/ARB)
- - Monitor: BP, renal function, potassium
-
-2. **Beta-Blocker**
- - Carvedilol 3.125-6.25mg BID → 25mg BID (target)
- - Metoprolol succinate 12.5-25mg daily → 200mg daily
- - Bisoprolol 1.25mg → 10mg daily
- - Titrate slowly, monitor HR, BP
-
-3. **Mineralocorticoid Receptor Antagonist (MRA)**
- - Spironolactone 12.5-25mg daily (up to 50mg)
- - Eplerenone 25mg daily → 50mg daily
- - Monitor: Potassium, renal function (risk hyperkalemia)
-
-4. **SGLT2 Inhibitor**
- - Dapagliflozin 10mg daily or empagliflozin 10mg daily
- - Reduces HF hospitalizations and mortality
- - Also beneficial for diabetes and CKD
-
-**Additional Therapies**:
-- Loop diuretic (furosemide) for volume management (not mortality benefit)
-- Hydralazine-isosorbide dinitrate (if African American or intolerant to ACE/ARB)
-- Ivabradine (if EF $\leq$35%, HR $>$70 on max beta-blocker)
-- Digoxin (symptomatic benefit, reduce hospitalizations)
-
-### Medication Documentation Best Practices
-
-**Include in Treatment Plan**:
-- Generic name (brand name optional)
-- Dose, route, frequency
-- Indication/rationale
-- Titration plan if applicable
-- Expected timeline for benefit
-- Key side effects to monitor
-- Drug interactions
-- When to adjust or discontinue
-
-**Example**: "Lisinopril 10mg PO daily - ACE inhibitor for hypertension and renal protection in diabetes. Titrate to 20mg in 2-4 weeks if BP not at goal and tolerating (monitor for cough, hyperkalemia). Target BP <130/80."
-
-## Non-Pharmacological Interventions
-
-### Lifestyle Modifications
-
-#### Diet and Nutrition
-
-**Mediterranean Diet** (Evidence: multiple RCTs, PREDIMED trial):
-- **Indications**: Cardiovascular disease prevention, diabetes management
-- **Components**:
- - High intake: Fruits, vegetables, whole grains, legumes, nuts, olive oil
- - Moderate: Fish, poultry
- - Low: Red meat, sweets
-- **Evidence**: Reduces cardiovascular events by 30%, improves glucose control
-- **Implementation**: Dietitian referral for medical nutrition therapy
-
-**DASH Diet** (Dietary Approaches to Stop Hypertension):
-- **Indication**: Hypertension
-- **Components**: High fruits/vegetables, low-fat dairy, reduced sodium (<2300mg, ideally <1500mg)
-- **Evidence**: Reduces SBP by 8-14 mmHg
-- **Implementation**: DASH eating plan education, sodium tracking
-
-**Carbohydrate Counting** (for Diabetes):
-- Consistent carbohydrate intake: 45-60g per meal
-- Enables insulin dosing adjustment
-- Prevents glycemic variability
-- Dietitian teaches carb counting skills
-
-**Weight Management**:
-- Caloric deficit: 500-750 kcal/day for 1-2 lb/week weight loss
-- Behavior change strategies: Self-monitoring, stimulus control, goal-setting
-- Structured programs (Weight Watchers, MOVE!, etc.) more effective than self-directed
-- Pharmacotherapy (GLP-1 agonists, orlistat) or bariatric surgery for BMI $\geq$30-35 with comorbidities
-
-#### Physical Activity and Exercise
-
-**Aerobic Exercise**:
-- **Recommendation**: 150 min/week moderate intensity OR 75 min/week vigorous
-- **Moderate**: Brisk walking, cycling, swimming - can talk but not sing
-- **Vigorous**: Running, fast cycling - can say few words before pause
-- **Benefits**: Cardiovascular health, glucose control, weight management, mood
-- **Implementation**: Start with 10 min sessions, gradually increase
-
-**Resistance Training**:
-- **Recommendation**: 2-3 sessions/week, all major muscle groups
-- **Benefits**: Muscle strength, bone density, metabolic rate, glucose control
-- **Implementation**: Bodyweight exercises, resistance bands, free weights, machines
-
-**Balance and Flexibility**:
-- Important for fall prevention in elderly
-- Yoga, tai chi
-- Stretching routines
-
-**Exercise Prescription**:
-- FITT principle: **F**requency, **I**ntensity, **T**ime, **T**ype
-- Individualize based on fitness level, comorbidities, goals
-- Cardiac clearance if indicated (using ACSM or ACC/AHA guidelines)
-
-**Example**: "Aerobic exercise: Walk 30 minutes, 5 days/week at moderate intensity (target HR 50-70% max). Resistance training: Upper and lower body exercises 2x/week, 2 sets of 10-12 reps."
-
-#### Smoking Cessation
-
-**Evidence**: Strongest intervention for COPD, cardiovascular disease, cancer prevention
-
-**5 A's Approach**:
-1. **Ask**: Screen all patients for tobacco use
-2. **Advise**: Urge all tobacco users to quit
-3. **Assess**: Willingness to make quit attempt
-4. **Assist**: Aid in quitting (counseling + medication)
-5. **Arrange**: Follow-up contact
-
-**Pharmacotherapy** (doubles quit rates):
-- **Nicotine Replacement**: Patch, gum, lozenge - OTC, safe
-- **Varenicline**: Most effective (Chantix), start 1 week before quit date
-- **Bupropion**: Alternative, also treats depression
-- **Combination**: NRT + varenicline/bupropion more effective
-
-**Counseling**:
-- Quitline: 1-800-QUIT-NOW
-- Individual or group counseling
-- Cognitive-behavioral techniques
-
-**Implementation**: Set quit date within 30 days, prescribe pharmacotherapy + counseling referral, follow up within 1 week of quit date.
-
-#### Sleep Hygiene
-
-**Indications**: Insomnia, poor sleep quality
-
-**Components**:
-- Consistent sleep-wake schedule (same bedtime/wake time)
-- Bedroom: Dark, quiet, cool (60-67°F)
-- Avoid: Caffeine after 2 PM, alcohol, large meals before bed
-- Screen time: Stop 1 hour before bed
-- Wind-down routine: Reading, bath, relaxation
-- Use bed only for sleep (not TV, work)
-- If can't sleep after 20 min, get up and do quiet activity
-
-**Evidence**: Effective for chronic insomnia, often combined with CBT for insomnia (CBT-I)
-
-#### Stress Management
-
-**Techniques**:
-- **Mindfulness meditation**: 10-20 min daily, reduces anxiety, depression
-- **Progressive muscle relaxation**: Systematic tensing and relaxing muscle groups
-- **Deep breathing**: Diaphragmatic breathing, 4-7-8 technique
-- **Yoga, tai chi**: Mind-body practices
-- **Cognitive restructuring**: Challenge stress-inducing thoughts
-
-**Evidence**: Reduces stress hormones, improves mood, pain perception
-
-### Behavioral Interventions
-
-#### Cognitive Behavioral Therapy (CBT)
-
-**Indications**: Depression, anxiety, insomnia, chronic pain, substance use
-
-**Core Components**:
-- Psychoeducation
-- Cognitive restructuring (identify and challenge distorted thoughts)
-- Behavioral activation (increase rewarding activities)
-- Problem-solving skills
-- Relapse prevention
-
-**Evidence**: Equivalent to antidepressants for mild-moderate depression, first-line for anxiety, insomnia
-
-**Implementation**: 12-16 weekly 50-min sessions with trained therapist, homework between sessions
-
-**Variants**:
-- **CBT-I** (insomnia): Sleep restriction, stimulus control, cognitive therapy for sleep
-- **CBT-CP** (chronic pain): Pain education, activity pacing, cognitive restructuring of pain catastrophizing
-
-#### Motivational Interviewing (MI)
-
-**Indication**: Ambivalence about behavior change (diet, exercise, substance use, medication adherence)
-
-**Principles**:
-- Express empathy
-- Develop discrepancy (between current behavior and goals/values)
-- Roll with resistance (don't argue)
-- Support self-efficacy
-
-**Techniques**:
-- Open-ended questions
-- Affirmations
-- Reflective listening
-- Summarizing
-- Elicit "change talk"
-
-**Evidence**: Effective for initiating behavior change in multiple domains
-
-### Patient Education and Self-Management
-
-**Components**:
-- Disease education (pathophysiology, natural history, treatment)
-- Self-monitoring skills (blood glucose, BP, weight, symptoms)
-- Medication management (purpose, dosing, side effects)
-- Symptom recognition and action plans
-- Lifestyle modification skills
-- Problem-solving
-- When to seek care
-
-**Evidence**: Self-management education improves outcomes in diabetes, asthma, heart failure, chronic pain
-
-**Delivery**:
-- Individual education by clinician or educator
-- Structured programs (DSMES for diabetes, cardiac rehab for heart disease)
-- Group classes
-- Written materials, videos, apps
-
-## Procedural and Interventional Therapies
-
-### Rehabilitation Therapies
-
-#### Physical Therapy
-
-**Indications**: Musculoskeletal injuries, post-surgical rehabilitation, balance/gait disorders, chronic pain
-
-**Interventions**:
-- Therapeutic exercise: Strengthening, stretching, endurance
-- Manual therapy: Soft tissue mobilization, joint mobilization
-- Gait and balance training
-- Modalities: Heat, ice, ultrasound, electrical stimulation, TENS
-- Functional training: ADL retraining, body mechanics
-
-**Evidence**: Strong evidence for specific conditions (e.g., PT for knee OA reduces pain and improves function equivalent to NSAIDs)
-
-**Prescription**: Frequency (e.g., 2-3x/week), duration (e.g., 4-8 weeks), specific interventions/goals
-
-#### Occupational Therapy
-
-**Indications**: ADL limitations, upper extremity dysfunction, cognitive-perceptual deficits, work-related injuries
-
-**Interventions**:
-- ADL/IADL training
-- Adaptive equipment and environmental modifications
-- Upper extremity strengthening and coordination
-- Energy conservation techniques
-- Cognitive rehabilitation
-- Work hardening/conditioning
-
-**Evidence**: Improves independence post-stroke, post-injury, with chronic conditions
-
-#### Speech-Language Pathology
-
-**Indications**: Dysphagia, aphasia, dysarthria, cognitive-communication disorders
-
-**Interventions**:
-- Swallow therapy and diet modifications
-- Language therapy (aphasia)
-- Articulation therapy
-- Cognitive-linguistic therapy
-- Augmentative and alternative communication (AAC)
-
-### Interventional Pain Procedures
-
-#### Epidural Steroid Injections (ESI)
-
-**Indication**: Radicular pain from disc herniation or spinal stenosis
-
-**Evidence**: Moderate-quality evidence for short-term pain relief (3-6 weeks to 3 months), variable long-term benefit
-
-**Approach**: Fluoroscopy-guided, transforaminal, interlaminar, or caudal
-
-**Frequency**: Up to 3-4 injections per year
-
-**Risks**: Infection, bleeding, nerve injury (rare), dural puncture
-
-#### Radiofrequency Ablation (RFA)
-
-**Indication**: Facet joint-mediated pain (after positive diagnostic medial branch blocks)
-
-**Evidence**: Good evidence for lumbar facet pain relief for 6-12 months
-
-**Procedure**: Thermal lesioning of medial branch nerves supplying facet joints
-
-**Repeatable**: Can repeat when pain returns
-
-#### Spinal Cord Stimulation (SCS)
-
-**Indication**: Refractory chronic neuropathic pain (failed back surgery syndrome, CRPS, diabetic neuropathy)
-
-**Evidence**: 50-60% achieve $\geq$50% pain relief, improves function
-
-**Procedure**: Trial lead placement (5-7 days), if successful → permanent implant
-
-**Technologies**: Traditional, high-frequency, burst stimulation, dorsal root ganglion (DRG)
-
-### Surgical Interventions
-
-**When to Refer for Surgery**:
-- Failed conservative management (adequate trial - typically 6-12 weeks minimum)
-- Progressive neurologic deficit
-- Cauda equina syndrome (emergency)
-- Severe functional limitation affecting quality of life
-- Structural pathology amenable to surgical correction
-- Patient preference after risks/benefits discussion
-
-**Shared Decision-Making**: Discuss operative vs. non-operative management, risks, benefits, expected outcomes, recovery
-
-## Integrative and Complementary Therapies
-
-### Acupuncture
-
-**Evidence**:
-- **Moderate evidence** for chronic low back pain, osteoarthritis knee pain, tension headaches, migraine
-- **Mechanism**: Unclear (endorphin release, gate control theory, placebo)
-
-**Implementation**: 8-12 sessions by licensed acupuncturist
-
-### Massage Therapy
-
-**Evidence**: Modest benefit for chronic low back pain, anxiety, cancer-related symptoms
-
-**Types**: Swedish, deep tissue, myofascial release
-
-**Implementation**: 1-2x/week, 30-60 min sessions
-
-### Yoga
-
-**Evidence**: Improves back pain, balance, flexibility, reduces stress and anxiety
-
-**Types**: Hatha (gentle), Vinyasa (flowing), Iyengar (alignment-focused)
-
-**Implementation**: Group classes or home practice, 2-3x/week
-
-### Mindfulness-Based Stress Reduction (MBSR)
-
-**Evidence**: Reduces stress, anxiety, depression, chronic pain
-
-**Program**: 8-week structured program, weekly 2.5-hour sessions, daily home practice
-
-**Components**: Meditation, body scan, mindful movement (yoga)
-
-### Chiropractic Care
-
-**Evidence**: Effective for acute and chronic low back pain, neck pain
-
-**Techniques**: Spinal manipulation, mobilization, soft tissue therapy
-
-**Safety**: Generally safe, avoid high-velocity manipulation if osteoporosis, spinal instability
-
-## Intervention Selection and Documentation
-
-### Treatment Algorithm Approach
-
-1. **Diagnosis-Specific**: Follow evidence-based guidelines for condition
-2. **Severity-Appropriate**: Mild → conservative; severe → aggressive
-3. **Stepwise Intensification**: Start with first-line, add or switch if inadequate response
-4. **Multimodal**: Combine complementary interventions (pharmacologic + non-pharmacologic)
-5. **Individualized**: Adjust for patient factors (comorbidities, preferences, resources)
-
-### Documentation Template
-
-For each intervention, document:
-- **Intervention**: Specific name/type
-- **Indication**: Why this intervention for this patient
-- **Evidence**: Guideline-based, RCT data supporting use
-- **Dose/Frequency/Duration**: Specific parameters
-- **Expected Benefit**: What should improve, by how much, when
-- **Monitoring**: How will response be assessed
-- **Risks/Side Effects**: Key concerns to monitor
-- **Alternatives Considered**: What else was considered, why not chosen
-
----
-
-**Document Version**: 1.0
-**Last Updated**: January 2025
-**Next Review**: January 2026
-
diff --git a/skills/treatment-plans/references/privacy_governance.md b/skills/treatment-plans/references/privacy_governance.md
new file mode 100644
index 00000000..219e2326
--- /dev/null
+++ b/skills/treatment-plans/references/privacy_governance.md
@@ -0,0 +1,119 @@
+# Privacy and Data Governance
+
+Last reviewed: **2026-07-23**
+
+## No compliance claim
+
+Passing a template or script does not establish de-identification, HIPAA compliance, authorization, lawful disclosure, security, or appropriate retention. Those determinations belong to qualified local privacy, security, legal, and records personnel.
+
+## Data classes
+
+Use exactly one package-wide classification:
+
+- `synthetic` — invented records with no relationship to a real person.
+- `deidentified_qualified_review` — patient-derived information that a qualified reviewer has approved under the applicable method and context.
+- `real_patient_minimum_necessary` — identifiable or potentially identifiable data handled only in an authorized local environment.
+
+Never relabel real data as synthetic. Hashing, pseudonymization, redaction of obvious fields, using a patient code, or removing direct identifiers does not by itself make data de-identified.
+
+## HHS de-identification boundary
+
+HHS describes two HIPAA Privacy Rule methods:
+
+1. **Expert Determination** — a qualified expert determines that re-identification risk is very small and documents methods and results.
+2. **Safe Harbor** — specified identifiers are removed and the covered entity lacks actual knowledge that remaining information could identify an individual.
+
+This skill performs neither method. Free text, dates, geography, rare combinations, longitudinal patterns, and other contextual information can retain identification risk. HHS specifically notes that clinical narratives are information-rich and may allow identification.
+
+For patient-derived material:
+
+- document which method and policy were applied;
+- record the qualified reviewer's role, review date, scope, assumptions, and expiration or re-review condition;
+- keep the determination and supporting analysis in the authorized local system;
+- re-review after material data, recipient, linkage, technology, or purpose changes;
+- treat uncertainty as a release blocker.
+
+Do not place a de-identification analysis or patient-derived examples in this repository.
+
+## Minimum-necessary handling
+
+HHS states that the HIPAA minimum necessary standard generally requires reasonable steps to limit uses, disclosures, and requests for protected health information, while identifying exceptions including disclosures to or requests by a healthcare provider for treatment.
+
+This skill does not decide whether an exception applies. As a conservative process safeguard, always minimize what enters the package and follow the institution's current role-based access and disclosure policies.
+
+Record:
+
+- the specific documentation purpose;
+- authorized users and recipient;
+- required data categories;
+- excluded data categories;
+- local authorization and environment references;
+- retention and disposition requirements;
+- who approved any exception or broader access.
+
+## Real-patient gate
+
+Before any real-patient package is opened:
+
+1. Confirm local authorization and an approved environment.
+2. Confirm the accountable clinical and privacy owners.
+3. Confirm the minimum-necessary field set and intended recipient.
+4. Confirm no external service, model, API, search, telemetry, image, or cloud-processing step will receive content.
+5. Confirm content will not be copied into prompts, logs, examples, tests, screenshots, issue reports, or commit messages.
+6. Confirm retention, deletion, access, and incident-response rules.
+7. Run only local standard-library scripts against file paths.
+
+If any confirmation is absent, use synthetic templates and stop before reading values.
+
+## Structured-data preference
+
+Prefer discrete identifiers, enums, dates, booleans, role labels, and source references. Use bounded clinician-authored text only where exact transcription is necessary.
+
+Avoid:
+
+- copied progress notes, discharge narratives, portal messages, or full record exports;
+- names, addresses, contact information, dates of birth, medical-record numbers, account numbers, images, biometrics, or device identifiers;
+- exact free-text descriptions when a structured status or local record locator is sufficient;
+- patient details in filenames or directory names.
+
+The generic `subject_ref` must be a locally controlled pseudonymous reference. It is not proof of de-identification.
+
+## Report minimization
+
+Bundled scripts must not echo clinical values. Reports are limited to:
+
+- rule codes;
+- pass/fail status;
+- document types;
+- field paths;
+- counts;
+- nonclinical dates already needed for a schedule;
+- local filenames without parent-directory expansion.
+
+Do not run scripts with shell tracing. Do not redirect reports to shared logs. Review local command history policies before working with sensitive paths.
+
+## Local path controls
+
+The scripts:
+
+- reject URL-like input paths and network-share syntax;
+- reject symlink inputs and outputs;
+- accept only bounded regular UTF-8 JSON files;
+- reject duplicate keys, excessive nesting, oversized text, excessive records, and unknown fields;
+- create private outputs without implicit overwrite;
+- do not inspect environment variables or credential files.
+
+These are defense-in-depth controls, not privacy determinations.
+
+## Incident routing
+
+If accidental disclosure, unauthorized access, or suspected mishandling occurs:
+
+- stop processing;
+- preserve only what local policy requires;
+- use the institution's current privacy/security incident route;
+- do not investigate by copying content into another tool;
+- do not decide whether an event is reportable;
+- record the responsible role and local case/reference number only after authorization.
+
+HHS OCR breach reporting sources are listed in `source_ledger.md`. The skill does not file reports.
diff --git a/skills/treatment-plans/references/regulatory_compliance.md b/skills/treatment-plans/references/regulatory_compliance.md
deleted file mode 100644
index 95a21725..00000000
--- a/skills/treatment-plans/references/regulatory_compliance.md
+++ /dev/null
@@ -1,476 +0,0 @@
-# Regulatory Compliance for Treatment Plans
-
-## Overview
-
-Treatment plans must comply with multiple federal and state regulations governing healthcare documentation, patient privacy, billing practices, and quality standards. This reference provides comprehensive guidance on regulatory requirements affecting treatment plan development and implementation.
-
-## HIPAA Privacy and Security
-
-### Health Insurance Portability and Accountability Act (HIPAA)
-
-**Applicable Rules**:
-- Privacy Rule (45 CFR Part 164, Subpart E)
-- Security Rule (45 CFR Part 164, Subparts A and C)
-- Breach Notification Rule (45 CFR Part 164, Subpart D)
-
-### Protected Health Information (PHI)
-
-**Definition**: Any information about health status, provision of healthcare, or payment for healthcare that can be linked to a specific individual.
-
-**18 HIPAA Identifiers** (Safe Harbor Method):
-1. Names
-2. Geographic subdivisions smaller than state (street address, city, county, ZIP code if <20,000 people)
-3. Dates (birth, admission, discharge, death) - except year
-4. Telephone numbers
-5. Fax numbers
-6. Email addresses
-7. Social Security numbers
-8. Medical record numbers
-9. Health plan beneficiary numbers
-10. Account numbers
-11. Certificate/license numbers
-12. Vehicle identifiers and serial numbers (license plate)
-13. Device identifiers and serial numbers
-14. Web URLs
-15. IP addresses
-16. Biometric identifiers (fingerprints, voice prints)
-17. Full-face photographs
-18. Any other unique identifying number, characteristic, or code
-
-### De-identification for Sharing Treatment Plans
-
-**Safe Harbor Method**: Remove all 18 identifiers listed above
-
-**Practical De-identification**:
-- **Name**: Use "Patient" or de-identified code (e.g., "PT-001")
-- **Age**: Use age range (e.g., "60-65 years") instead of exact age
-- **Dates**: Use relative timelines (e.g., "3 months ago") or month/year only
-- **Location**: State only, remove city, address, specific facility names
-- **Identifiers**: Remove MRN, account numbers, SSN
-- **Dates of Service**: Refer to "Month/Year" or "recent visit"
-
-**Example**:
-- **Before**: "John Smith, DOB 3/15/1965 (58 years old), MRN 123456, address 123 Main St, Anytown, CA 12345, seen 1/15/2025"
-- **After**: "Patient, age range 55-60 years, seen Month/Year 2025, California"
-
-### Permitted Uses and Disclosures
-
-**Without Patient Authorization**:
-- **Treatment**: Sharing PHI among healthcare providers for patient care
-- **Payment**: Disclosing PHI to obtain payment for services
-- **Healthcare Operations**: Quality improvement, training, accreditation
-
-**With Patient Authorization**:
-- Marketing
-- Research (unless IRB waiver granted)
-- Sharing with non-covered entities (e.g., patient's employer)
-- Psychotherapy notes (special protection)
-
-### Minimum Necessary Standard
-
-Use, disclose, or request only the minimum amount of PHI necessary to accomplish the purpose.
-
-**Exception**: Does NOT apply to treatment - providers may share all relevant information for patient care.
-
-### Patient Rights Under HIPAA
-
-- Right to access own medical records (within 30 days)
-- Right to request amendments to records
-- Right to accounting of disclosures
-- Right to request restrictions on uses/disclosures (provider may deny)
-- Right to confidential communications
-- Right to be notified of privacy practices (Notice of Privacy Practices)
-
-### Breach Notification
-
-**Breach**: Unauthorized acquisition, access, use, or disclosure of PHI that compromises security or privacy.
-
-**Notification Requirements**:
-- **Individual**: Notify affected individuals within 60 days
-- **HHS**: If $\geq$500 individuals affected, notify HHS and media
-- **Business Associates**: Must notify covered entity of breaches
-
-### HIPAA Violations and Penalties
-
-**Civil Penalties**: $100 to $50,000 per violation (up to $1.5 million per year for identical violations)
-
-**Criminal Penalties**: Up to $250,000 fine and 10 years imprisonment for knowing misuse with intent to sell/transfer PHI
-
-## 42 CFR Part 2 (Substance Use Disorder Records)
-
-### Applicability
-
-**Scope**: Federally assisted substance use disorder (SUD) treatment programs
-
-**More Restrictive than HIPAA**: Provides additional confidentiality protections for SUD treatment records.
-
-### Key Requirements
-
-**Patient Consent Required** for most disclosures (even for treatment, payment, operations - differs from HIPAA).
-
-**Prohibition on Re-disclosure**: Recipients of 42 CFR Part 2-protected information cannot re-disclose without patient consent.
-
-**Documentation**: Patient consent must be written, specific to the information disclosed, and include expiration date.
-
-**Exceptions** (Disclosure without consent allowed):
-- Medical emergency
-- Court order (not subpoena alone)
-- Suspected child abuse/neglect (per state law)
-- Crime on premises or against personnel
-
-### Integration with HIPAA
-
-**HIPAA Compliance**: Covered entities must comply with both HIPAA and 42 CFR Part 2 (whichever is more protective applies).
-
-**Note in Treatment Plans**: If patient has SUD and received treatment at 42 CFR Part 2 program, annotate: "Substance use information subject to 42 CFR Part 2 confidentiality protections."
-
-## 21 CFR Part 11 (Electronic Records - FDA)
-
-### Applicability
-
-**Scope**: Clinical trials, research involving FDA-regulated products, drug/device manufacturers.
-
-**Requirements for Electronic Records and Signatures**:
-- Validation of systems
-- Audit trails (who accessed, when, what changed)
-- Electronic signatures equivalent to handwritten
-- Controls to prevent unauthorized access
-
-### Treatment Plan Implications
-
-**If part of clinical trial**: Treatment plans must meet 21 CFR Part 11 requirements for electronic documentation.
-
-**Non-Research Clinical Care**: Typically NOT subject to 21 CFR Part 11 (HIPAA Security Rule applies instead).
-
-## Medicare and Medicaid (CMS) Requirements
-
-### Conditions of Participation (CoPs)
-
-**Hospitals, Skilled Nursing Facilities, Home Health Agencies** must meet CoPs to receive Medicare/Medicaid reimbursement.
-
-**Documentation Requirements**:
-- Physician orders for treatments
-- Comprehensive care plans
-- Periodic reassessment and revision
-- Interdisciplinary team involvement
-- Patient/family involvement
-
-### Meaningful Use / Promoting Interoperability
-
-**EHR Requirements** (for eligible providers to receive incentive payments):
-- Use of certified EHR technology
-- Electronic prescribing
-- Clinical decision support
-- Patient portal access to health information
-- Care plan documentation with patient goals
-
-### Documentation for Billing
-
-**Medical Necessity**: Documentation must support the medical necessity of services billed.
-
-**Elements to Document**:
-- Diagnosis (ICD-10 codes)
-- Treatments provided (CPT codes)
-- Rationale for treatments
-- Patient response to treatment
-- Plans for ongoing care
-
-**E/M Coding Support**: Treatment plans support Evaluation and Management (E/M) coding levels:
-- Low complexity: Stable chronic conditions, limited treatment options
-- Moderate complexity: Multiple conditions, moderate-risk medications/procedures
-- High complexity: Severe conditions, high-risk treatments, poor response to therapy
-
-## Quality Measure Reporting
-
-### HEDIS (Healthcare Effectiveness Data and Information Set)
-
-**Used by**: Health plans to measure quality
-
-**Treatment Plan Elements Supporting HEDIS**:
-
-**Diabetes**:
-- HbA1c testing (at least annually, quarterly if not controlled)
-- Eye exam (annual dilated retinal exam)
-- Kidney disease monitoring (urine albumin-to-creatinine ratio annually)
-- BP control (<140/90)
-
-**Cardiovascular**:
-- Statin therapy for patients with diabetes or ASCVD
-- ACE/ARB for patients with diabetes and hypertension
-- Beta-blocker for patients with prior MI or HFrEF
-
-**Preventive Care**:
-- Flu vaccine annually
-- Colorectal cancer screening
-- Breast cancer screening
-- Cervical cancer screening
-
-### MIPS (Merit-Based Incentive Payment System)
-
-**Eligible Clinicians**: Medicare Part B providers
-
-**Performance Categories**:
-1. **Quality**: Reporting on quality measures relevant to specialty
-2. **Improvement Activities**: Participation in improvement activities
-3. **Promoting Interoperability**: EHR meaningful use
-4. **Cost**: Resource use/cost of care
-
-**Treatment Plan Documentation**: Supports quality measure reporting (e.g., diabetes HbA1c control, depression screening and follow-up).
-
-### Accountable Care Organizations (ACOs)
-
-**Quality Measures**: 33+ measures across patient experience, care coordination, preventive health, at-risk populations.
-
-**Treatment Plans**: Facilitate care coordination, chronic disease management to meet ACO quality benchmarks.
-
-## Opioid Prescribing Regulations
-
-### CDC Opioid Prescribing Guidelines (2022)
-
-**Recommendations**:
-- Non-opioid therapies preferred for chronic pain
-- If opioids used: Lowest effective dose, shortest duration
-- Assess risk before starting opioids (ORT, SOAPP)
-- Prescribe naloxone for patients at increased overdose risk
-- Urine drug testing before and during opioid therapy
-- Check PDMP (Prescription Drug Monitoring Program) before prescribing
-- Avoid concurrent benzodiazepines and opioids
-- Reassess risk/benefit at each increase in dose (especially if approaching $\geq$50 MME/day)
-
-**Treatment Plan Requirements**:
-- Document indication for opioid therapy
-- Informed consent discussion (risks, benefits, alternatives)
-- Treatment agreement/opioid contract
-- Plan for monitoring (UDS frequency, PDMP checks)
-- Functional goals (not just pain scores)
-- Exit strategy/tapering plan
-
-### State Opioid Regulations
-
-**Vary by State**, common elements:
-- MME limits (e.g., 90 MME/day max without exemption)
-- Prescription limits for acute pain (e.g., 7-day supply)
-- Mandatory PDMP checks before prescribing
-- Continuing medical education (CME) requirements for prescribers
-- Co-prescription of naloxone required in some states
-
-**Prescribers must know state-specific laws**.
-
-### PDMP (Prescription Drug Monitoring Program)
-
-**Purpose**: State databases tracking controlled substance prescriptions to identify doctor shopping, overprescribing.
-
-**Requirements**: Most states require PDMP check before initial opioid prescription and periodically during treatment (e.g., every 3-6 months).
-
-**Documentation**: Note in treatment plan that PDMP was checked and findings (e.g., "PDMP reviewed, no other controlled substances from other prescribers").
-
-## State Medical Board Requirements
-
-### Scope of Practice
-
-**Prescribers**: Must operate within scope of practice defined by state law.
-- Physicians (MD/DO): Full prescriptive authority
-- Nurse Practitioners (NP): Varies by state (full practice, reduced practice, or restricted practice authority)
-- Physician Assistants (PA): Supervision requirements vary
-
-**Controlled Substances**: DEA registration required, state regulations apply.
-
-### Standard of Care
-
-**Definition**: Degree of care and skill ordinarily employed by similar practitioners under similar circumstances.
-
-**Deviations from Standard**: Must be documented with rationale (e.g., patient-specific factors, shared decision-making, evidence supporting alternative approach).
-
-### Informed Consent Documentation
-
-**Required for**: Procedures, surgeries, medications with significant risks, research.
-
-**Elements to Document**:
-- Nature of condition and proposed treatment
-- Risks and benefits
-- Alternatives
-- Likely outcome if no treatment
-- Patient questions answered
-- Patient capacity to consent
-- Voluntary consent
-
-**In Treatment Plans**: Note informed consent discussion occurred, especially for high-risk treatments (e.g., opioids, chemotherapy, surgery).
-
-### Documentation Retention
-
-**Medical Records**: State laws vary (typically 7-10 years from last encounter; longer for minors - often until age of majority + statute of limitations).
-
-**Electronic Records**: Same retention requirements as paper.
-
-## Accreditation Standards
-
-### The Joint Commission
-
-**Applicable to**: Hospitals, ambulatory care, behavioral health, long-term care, laboratories.
-
-**Standards Relevant to Treatment Plans**:
-
-**Patient-Centered Care (PC)**:
-- Individualized care planning
-- Patient and family involvement
-- Cultural and language needs addressed
-- Patient preferences incorporated
-
-**Care Coordination (CC)**:
-- Comprehensive assessment
-- Care plan addresses all identified needs
-- Interdisciplinary coordination
-- Transitions of care managed
-
-**Medication Management (MM)**:
-- Medication reconciliation at transitions
-- High-risk medication monitoring (anticoagulants, opioids, insulin)
-- Patient education on medications
-
-**National Patient Safety Goals (NPSG)**:
-- Accurate patient identification
-- Effective communication among caregivers
-- Safe medication use
-- Reduce healthcare-associated infections
-- Prevent falls
-
-### CARF (Commission on Accreditation of Rehabilitation Facilities)
-
-**Applicable to**: Rehabilitation, behavioral health, employment services.
-
-**Standards for Treatment Plans**:
-- Comprehensive assessment drives plan
-- Individualized goals
-- Measurable, time-specific objectives
-- Regular team review and updates
-- Person-centered (patient directs goals)
-- Transition and discharge planning
-- Outcomes measurement
-
-## Billing and Reimbursement Compliance
-
-### Coding Accuracy
-
-**ICD-10-CM Diagnosis Codes**:
-- Code to highest level of specificity
-- Code all documented conditions affecting care during encounter
-- Primary diagnosis is reason for visit
-- Uncertain diagnoses coded as symptoms (outpatient); can code "probable" if inpatient
-
-**CPT Procedure Codes**:
-- Specific codes for services provided
-- Modifiers when appropriate
-- Unbundling prohibited (billing separately for bundled services)
-
-### Documentation Supports Billing
-
-**Medical Necessity**: Treatment must be medically appropriate for diagnosis, meet standard of care, expected to improve condition.
-
-**Treatment Plan Link**: Plan documents rationale for tests, treatments, referrals → supports medical necessity.
-
-**Avoid**:
-- Upcoding (billing higher level service than provided)
-- Duplicate billing
-- Billing for services not rendered
-
-**Anti-Kickback Statute**: Prohibits offering, paying, soliciting, or receiving remuneration for patient referrals for services reimbursed by federal healthcare programs.
-
-**Stark Law**: Prohibits physician self-referral for designated health services (DHS) covered by Medicare/Medicaid.
-
-## Clinical Research and Trials
-
-### Informed Consent (21 CFR Part 50)
-
-**Required Elements**:
-- Research procedures described
-- Risks and discomforts
-- Potential benefits
-- Alternative treatments
-- Confidentiality protections
-- Voluntary participation, can withdraw
-- Contact information for questions/problems
-
-**Documentation**: Signed consent form, copy given to participant.
-
-### IRB Review (21 CFR Part 56)
-
-**Institutional Review Board** reviews and approves research involving human subjects.
-
-**Treatment Plans in Research**: If part of clinical trial protocol, must be approved by IRB, follow protocol exactly, documented per 21 CFR Part 11.
-
-### Good Clinical Practice (ICH-GCP)
-
-**International Standard** for ethical and scientific quality in clinical trials.
-
-**Relevant to Treatment Plans**: Detailed protocol adherence, documentation of interventions, adverse event reporting.
-
-## Mental Health Specific Regulations
-
-### Duty to Warn/Protect
-
-**Tarasoff Rule** (varies by state): If patient poses credible threat to identifiable person, provider must:
-- Warn intended victim
-- Notify police
-- Take steps to protect
-
-**Documentation**: Document threat assessment, steps taken to protect.
-
-### Involuntary Commitment
-
-**Criteria** (vary by state): Typically requires patient to be:
-- Mentally ill, AND
-- Danger to self or others OR gravely disabled
-
-**Due Process**: Emergency hold (24-72 hours), followed by court hearing for longer commitment.
-
-**Documentation**: Clear documentation of dangerousness, efforts at least restrictive intervention.
-
-### Parity Laws
-
-**Mental Health Parity and Addiction Equity Act (MHPAEA)**: Health plans must provide mental health/substance use disorder benefits comparable to medical/surgical benefits.
-
-**Implications**: Cannot limit therapy visits or impose higher copays for mental health vs. medical care.
-
-## Compliance Best Practices
-
-### 1. Know Applicable Regulations
-- Federal (HIPAA, 42 CFR Part 2, CDC guidelines, CMS CoPs)
-- State (medical practice act, opioid laws, consent requirements)
-- Accreditation (Joint Commission, CARF if applicable)
-
-### 2. Document Thoroughly
-- Complete all required elements
-- Clear rationale for clinical decisions
-- Informed consent discussions
-- Regulatory compliance (PDMP checks, etc.)
-
-### 3. Privacy Protection
-- De-identify before sharing outside treatment team
-- Minimum necessary principle
-- Secure storage and transmission of records
-
-### 4. Quality Measure Integration
-- Include elements that support quality reporting (preventive care, chronic disease metrics)
-- Structured data enables measure extraction
-
-### 5. Regular Training
-- HIPAA training annually for all staff
-- Updates on regulation changes
-- Specialty-specific compliance (opioid prescribing, mental health)
-
-### 6. Audit and Monitor
-- Internal audits for documentation compliance
-- Billing compliance reviews
-- Privacy breach monitoring
-
-### 7. Policies and Procedures
-- Written policies on treatment planning, consent, privacy
-- Regularly reviewed and updated
-
----
-
-**Document Version**: 1.0
-**Last Updated**: January 2025
-**Next Review**: January 2026
-**Note**: Regulations subject to change; verify current requirements.
-
diff --git a/skills/treatment-plans/references/safety_scope.md b/skills/treatment-plans/references/safety_scope.md
new file mode 100644
index 00000000..a7f1b129
--- /dev/null
+++ b/skills/treatment-plans/references/safety_scope.md
@@ -0,0 +1,101 @@
+# Safety, Scope, and Routing
+
+Last reviewed: **2026-07-23**
+
+## Purpose
+
+This skill is a transcription, formatting, provenance, and process-validation aid. It accepts clinical decisions only after an authorized licensed professional has made and verified them in a current local source.
+
+The skill is not a clinical decision-support system, medical device, prescribing tool, medication checker, triage service, or patient education service.
+
+## Prohibited functions
+
+Do not:
+
+- identify or infer a diagnosis, differential, severity, stage, risk class, or eligibility;
+- propose, compare, rank, select, substitute, or optimize a treatment;
+- generate medication names, doses, routes, frequencies, durations, start dates, stop dates, hold criteria, titration steps, or taper schedules;
+- judge an interaction, allergy, contraindication, precaution, organ-function issue, pregnancy issue, or formulary suitability;
+- generate a monitoring parameter, target, threshold, interval, follow-up frequency, or escalation criterion;
+- interpret a symptom, test, image, score, trend, medication list, adverse event, or patient preference;
+- determine urgency, triage disposition, emergency status, prognosis, expected response, or likely outcome;
+- create patient-specific instructions, education, warning signs, crisis plans, or emergency actions;
+- recommend a specialist, setting, service level, procedure, device, or referral;
+- certify compliance, clinical completeness, standard of care, informed consent, capacity, or professional scope.
+
+Formatting a supplied decision does not validate it. A citation does not make a decision current or applicable.
+
+## Request handling
+
+Proceed only when the request is equivalent to:
+
+- "Place these already signed clinician decisions into the generic records."
+- "Check whether this local JSON package has the required fields."
+- "Verify that every record points to a verified source fact."
+- "List checkpoints on the exact dates already provided."
+- "Identify missing acknowledgments or sign-off fields without suggesting clinical content."
+
+Stop and route when the request asks:
+
+- "What should the plan be?"
+- "What treatment, medication, dose, or schedule is best?"
+- "Should this be started, stopped, held, resumed, increased, reduced, or tapered?"
+- "Are these medicines safe together or contraindicated?"
+- "Is this urgent, an emergency, or likely to worsen?"
+- "What should the patient do now?"
+
+Do not soften a prohibited request into a recommendation-shaped template. Do not ask another skill, model, search tool, or API to make the decision.
+
+## Missing or conflicting content
+
+When a required clinical field is missing:
+
+1. Leave it empty or mark the record pending.
+2. Record a nonclinical blocker code and field path.
+3. Route it to the responsible authorized professional.
+4. Do not infer a value from neighboring records, standard practice, prior examples, a product label, or a guideline.
+
+When sources conflict, record the conflict without deciding which source controls. The authorized local team must reconcile it in an approved system.
+
+## Emergency and escalation boundary
+
+Use this exact process statement:
+
+> If a concern may be urgent or emergent, stop this documentation workflow and use the institution's current clinical escalation or emergency process; this package does not determine urgency or provide emergency instructions.
+
+The package records only the local process reference and responsible role. It must not include generated symptom thresholds, emergency numbers, destinations, or action steps. Current institution-approved material may be linked by a local reference after authorized review.
+
+## Accountable roles
+
+At minimum, identify:
+
+- clinical owner — owns clinical decisions and conflict resolution;
+- authorized licensed verifier — compares transcribed content with current sources;
+- medication-reconciliation owner — performs reconciliation in approved systems;
+- privacy reviewer — reviews patient-derived data handling and de-identification claims;
+- records/governance owner — controls retention, access, versioning, and release;
+- handoff sender and recipient — own transfer and acknowledgment;
+- local reporting owner — determines whether and where an event must be reported.
+
+One person may hold multiple roles only if local policy permits it. A script can verify that roles are named; it cannot verify competence, licensure, authority, independence, or completion.
+
+## Release boundary
+
+The documentation package remains visibly marked:
+
+> **DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — AUTHORIZED CLINICIAN SIGN-OFF REQUIRED**
+
+Release means only that the package may enter the authorized documentation handoff named in the manifest. It does not turn the package into stand-alone medical advice or authorize an agent to implement care.
+
+Block release when any of these remain:
+
+- unverified facts or interventions;
+- missing source links;
+- unresolved discrepancies not routed to an owner;
+- absent shared-decision documentation when required by the local workflow;
+- incomplete reconciliation;
+- missing privacy/process attestations;
+- missing current local policy or labeling verification;
+- missing handoff recipient or acknowledgment;
+- unsigned clinician attestation;
+- inconsistent subject reference, classification, status, or dates.
diff --git a/skills/treatment-plans/references/security_validation.md b/skills/treatment-plans/references/security_validation.md
new file mode 100644
index 00000000..d802788b
--- /dev/null
+++ b/skills/treatment-plans/references/security_validation.md
@@ -0,0 +1,68 @@
+# Security Validation Record
+
+Validation date: **2026-07-23**
+
+## Baseline
+
+The repository `SECURITY.md` entry recorded **11 findings** with maximum severity **CRITICAL**:
+
+- three CRITICAL cross-file/environment/network exfiltration findings;
+- one HIGH API-key transmission finding;
+- five MEDIUM findings involving environment harvesting, command chaining, and mandatory external-tool behavior;
+- two LOW findings involving unsafe template content and unpinned dependencies.
+
+The affected files included the former `generate_schematic.py`, `generate_schematic_ai.py`, `SKILL.md`, and `medical_treatment_plan.sty`.
+
+## Remediation
+
+- Deleted both schematic-generation scripts.
+- Removed network requests, API keys, environment access, `.env` loading, subprocesses, external models, image generation, and cross-skill calls.
+- Deleted the hardcoded LaTeX style and all specialty templates containing clinical treatment content.
+- Replaced them with generic, fail-closed JSON records.
+- Rebuilt every remaining script as a dependency-free, bounded, deterministic local JSON helper.
+- Added strict duplicate-key, schema, unknown-field, collection, depth, path, symlink, and output controls.
+- Added minimized reports that do not echo clinician-authored content.
+- Added AST tests prohibiting network libraries, dynamic execution, executable serialization, subprocesses, and environment access.
+
+## Validation results
+
+- Agent Skills reference validator: **PASS**
+- Dependency-free CLI help checks: **PASS**
+- Synthetic standard-library tests: **21 passed**
+- Explicit AST parse with bytecode disabled: **8 scripts parsed**
+- Bytecode artifacts after cleanup: **0**
+- IDE lints: **0**
+- Documented local-path check: **PASS**
+- External source links: **PASS** (HTTP 403 from HHS/AHRQ is access control; REMS@FDA returned HTTP 200 with a browser user agent)
+- Direct behavioral security scan: **SAFE, 0 findings**
+- Pull-request gate with `--fail-on HIGH`: **PASS**
+ - CRITICAL: 0
+ - HIGH: 0
+ - LOW: 2
+
+The first direct scan reported a CRITICAL test-only false positive because the synthetic AST test contained literal names for dynamic-execution functions and used a subprocess to exercise `--help`. The help test was changed to call each parser directly and the prohibited names were constructed without executable references. The final direct scan is clean.
+
+## Residual LOW findings
+
+The LLM-assisted pull-request scan reported:
+
+1. **Missing `allowed-tools` declaration** — informational. The field is optional. The compatibility statement and body explicitly limit bundled tools to local standard-library JSON processing, and the direct behavioral scan confirms no network, credential, process, model, or image behavior.
+2. **Invented missing-file variants** — scanner false positive. It claimed files under `templates/` and swapped `assets/` and `references/` paths that do not appear in the skill. The deterministic documented-local-path test resolves every actual local path and passes.
+
+Neither LOW finding permits data transmission or clinical decision-making. No actual CRITICAL or HIGH finding remains. The repository-level `SECURITY.md` is intentionally not edited in this scoped refresh; its generated snapshot will update through the repository's normal process.
+
+## Reproduction
+
+```bash
+PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover \
+ -s skills/treatment-plans/tests -p 'test_*.py' -v
+
+uv run skills-ref validate skills/treatment-plans
+
+uv run skill-scanner scan skills/treatment-plans --use-behavioral
+
+uv run python scan_pr_skills.py \
+ --fail-on HIGH \
+ --output /tmp/treatment-plans-pr-scan.md \
+ skills/treatment-plans
+```
diff --git a/skills/treatment-plans/references/shared_decision_handoff.md b/skills/treatment-plans/references/shared_decision_handoff.md
new file mode 100644
index 00000000..1f1017f1
--- /dev/null
+++ b/skills/treatment-plans/references/shared_decision_handoff.md
@@ -0,0 +1,138 @@
+# Shared Decisions, Informed Preferences, and Handoffs
+
+Last reviewed: **2026-07-23**
+
+## Documentation-only role
+
+AHRQ describes shared decision-making as a clinician-led process that explores options, benefits, harms, risks, and what matters to the person. NICE similarly describes healthcare professionals and people working together on treatment and care decisions and communicating risks, benefits, and consequences.
+
+This skill records that process after it occurred. It does not conduct the conversation, generate options, quantify risks, assess capacity, obtain consent, or decide the outcome.
+
+## Shared-decision record
+
+For each decision, the authorized clinician supplies:
+
+- the decision topic;
+- options actually presented;
+- source facts for each option;
+- whether benefits, harms, and uncertainty were discussed;
+- the preference as documented;
+- the agreed or clinician-recorded outcome;
+- participant roles;
+- author role and time;
+- acknowledgment status.
+
+Use the person's words only when necessary and permitted. Prefer a bounded structured summary over copied narrative.
+
+Do not:
+
+- add an option the clinician did not document;
+- characterize an option as preferred, safer, better, first-line, standard, or equivalent;
+- calculate or restate probabilities;
+- infer preference from adherence, demographics, prior care, or silence;
+- treat a checked box as proof of understanding, voluntariness, capacity, or informed consent;
+- create a consent form or legal attestation.
+
+## Informed preference versus informed consent
+
+The template documents an informed preference and shared-decision process. It does not replace:
+
+- jurisdiction-specific informed-consent requirements;
+- procedure- or product-specific consent;
+- capacity evaluation;
+- surrogate or guardian authority review;
+- language-access or accessibility requirements;
+- research consent;
+- local refusal or declination documentation.
+
+The authorized local team decides which separate records are required.
+
+## Communication quality
+
+The record may note whether the clinician documented:
+
+- benefits, harms, and material uncertainty;
+- alternatives, including no action, when actually discussed;
+- questions and responses;
+- language, interpreter, communication, or accessibility support;
+- decision aid identity and version;
+- need for revisiting the decision.
+
+Do not infer quality from presence alone. Do not score the conversation.
+
+## Transition handoff
+
+WHO transition guidance supports timely, accurate information transfer, medication reconciliation, patient/carer involvement, clear ownership, standardized processes, checklists, and tracking.
+
+A handoff record should identify:
+
+- sending and receiving settings and responsible roles;
+- exact handoff date supplied by the clinical team;
+- source records and their versions;
+- interventions, goals, monitoring, checkpoints, and pending results that were actually supplied;
+- ownership of each item;
+- reconciliation status;
+- unresolved items and route;
+- sender and recipient acknowledgment;
+- local follow-up and escalation references.
+
+The skill does not decide which clinical items are important enough to hand off. The responsible clinicians do.
+
+## Medication reconciliation boundary
+
+Medication reconciliation is a clinical process, not a list-diff script. The authorized team must obtain and compare the relevant lists, make clinical decisions about discrepancies, communicate the result, and document completion in approved systems.
+
+This package may record:
+
+- source-list fact IDs;
+- destination-list fact IDs;
+- `pending_authorized_review`, `completed_by_authorized_clinician`, or `not_applicable`;
+- discrepancy status;
+- reviewer role and completion time.
+
+It must not:
+
+- parse medication text to normalize products;
+- identify duplicates, interactions, contraindications, omissions, or dose differences;
+- decide which list is correct;
+- propose changes;
+- mark reconciliation complete automatically.
+
+If a discrepancy is detected outside the authorized clinical workflow, leave it unresolved and route it to the named medication-reconciliation owner.
+
+## Pending and unresolved items
+
+Every unresolved item needs:
+
+- a stable item ID;
+- a bounded description supplied by the local team;
+- source-fact references;
+- responsible local role;
+- route status.
+
+An item may be `open_routed`, `acknowledged_by_owner`, or `resolved_by_authorized_professional`. The skill never selects the owner or resolution.
+
+## Emergency routing
+
+Do not include generated warning signs, thresholds, destinations, emergency numbers, or instructions.
+
+Record only:
+
+> If a concern may be urgent or emergent, stop this documentation workflow and use the institution's current clinical escalation or emergency process; this package does not determine urgency or provide emergency instructions.
+
+The authorized institution supplies and verifies the local process reference.
+
+## Handoff release
+
+Before authorized documentation handoff:
+
+- source and destination roles are named;
+- all included items link to verified facts;
+- reconciliation status is verified;
+- unresolved items are routed;
+- the recipient acknowledgment is complete;
+- privacy and local governance checks pass;
+- the clinician sign-off is complete;
+- the release gate has no blocker codes.
+
+These gates document process completion. They do not prove safe care, successful communication, or recipient action.
diff --git a/skills/treatment-plans/references/source_boundaries.md b/skills/treatment-plans/references/source_boundaries.md
new file mode 100644
index 00000000..7c697ff4
--- /dev/null
+++ b/skills/treatment-plans/references/source_boundaries.md
@@ -0,0 +1,127 @@
+# Source, Labeling, and Governance Boundaries
+
+Last reviewed: **2026-07-23**
+
+## General source rule
+
+Sources support provenance; they do not authorize the agent to make a clinical decision. A current source may still be inapplicable to a specific person, setting, product, formulation, route, indication, jurisdiction, or institution.
+
+Only an authorized licensed professional may:
+
+- decide whether a source applies;
+- interpret a label, Medication Guide, REMS requirement, guideline, policy, or standard;
+- resolve conflicts among sources;
+- convert source content into a patient-specific decision;
+- determine whether a requirement was satisfied.
+
+The package stores the professional's verified decision and source locator. It does not reproduce a recommendation from the source.
+
+## FDA prescribing information
+
+FDA's human prescription-drug labeling resources distinguish FDA-approved labeling from other "current" or "in use" labeling. FDA states that Drugs@FDA contains the most recent CDER-approved Prescribing Information and patient labeling for covered products, while other databases may include company-submitted changes under review.
+
+For an already selected medication, the authorized clinician or pharmacist must verify, as applicable:
+
+- exact product, application, formulation, route, and strength;
+- current FDA-approved Prescribing Information;
+- current FDA-approved patient labeling;
+- current safety-related labeling changes;
+- local formulary and institutional policy;
+- whether a product is outside the scope of Drugs@FDA and requires another authoritative FDA source.
+
+This skill records fact IDs and verification. It must not search for a product while processing real-patient content, interpret sections, compare alternatives, or decide dosing, contraindications, interactions, monitoring, or eligibility.
+
+## Medication Guides and patient labeling
+
+FDA-approved patient labeling includes Medication Guides, Patient Package Inserts, and Instructions for Use. FDA notes that not every prescription drug has FDA-approved patient labeling and that consumer medication information developed outside the applicant is not reviewed or approved by FDA.
+
+Do not:
+
+- invent or paraphrase a Medication Guide as patient instructions;
+- assume a generic consumer handout is FDA-approved;
+- omit a required current document based on a template;
+- decide whether a risk changes treatment.
+
+Record only which current material the authorized clinician or pharmacist verified and where it is held in the local system.
+
+## REMS
+
+REMS are product-specific safety programs. FDA explains that participant roles, communications, required activities, certifications, enrollment, monitoring, and safe-use conditions vary by medication. Current requirements and materials are maintained in REMS@FDA.
+
+The package may document:
+
+- whether an authorized reviewer checked REMS@FDA;
+- the REMS material version/date and local locator;
+- the participant role and requirement as already verified;
+- completion status recorded by the authorized local process.
+
+The skill must not decide whether a REMS applies, enroll anyone, certify a prescriber or site, interpret a safe-use condition, or determine whether prescribing or dispensing may proceed.
+
+## WHO and Joint Commission process guidance
+
+WHO transition guidance supports process concepts such as:
+
+- timely and accurate transfer of information;
+- medication reconciliation at transitions;
+- patient and carer involvement;
+- explicit ownership and follow-up;
+- standardized terminology, checklists, and tracking.
+
+Joint Commission materials similarly emphasize reliable identification, handoff communication, and continuity. Use these sources only to structure documentation and local governance.
+
+Do not copy proprietary standards, claim accreditation compliance, or convert process guidance into patient-specific content. The current institution policy controls.
+
+## CMS boundary
+
+CMS publishes person-centered care concepts and program-specific documentation requirements. Requirements vary by program, provider type, setting, state, contract, and date.
+
+Do not treat a CMS innovation concept, job aid, measure, billing rule, or conditions-of-participation excerpt as a universal treatment-plan requirement.
+
+Before recording a CMS requirement, the authorized compliance owner must identify:
+
+- exact program and authority;
+- current effective version;
+- provider and setting applicability;
+- state or contractor variation;
+- local policy implementation.
+
+The skill does not support coding, billing-level selection, medical-necessity decisions, or reimbursement claims.
+
+## Local and professional guidance
+
+The responsible clinician must use:
+
+- current institution-approved clinical guidance;
+- current specialty guidance appropriate to the case;
+- current product-specific information;
+- current jurisdictional and scope-of-practice rules;
+- current professional judgment and approved systems.
+
+This repository intentionally contains no disease-specific treatment recommendations or specialty schedules. Do not add them to templates, tests, examples, or references.
+
+## Reporting and governance
+
+The package records local routes; it does not submit reports.
+
+Potential routes may include:
+
+- local patient-safety or quality reporting;
+- local pharmacy/medication-safety review;
+- FDA MedWatch for medical-product events when the responsible reporter determines it applies;
+- privacy/security incident response and HHS OCR breach reporting when qualified personnel determine it applies;
+- AHRQ Common Formats within an authorized Patient Safety Organization workflow.
+
+Never decide reportability, causality, seriousness, legal duty, deadline, recipient, or content. Never transmit patient data from a bundled script.
+
+## Currency control
+
+At each authorized revision:
+
+1. Verify source currency in an approved workflow.
+2. Record source version or content date.
+3. Record who verified applicability and when.
+4. Preserve the prior local record as policy requires.
+5. Re-run structural and traceability checks.
+6. Obtain new sign-off if a governing source changed.
+
+The dated ledger in `source_ledger.md` documents the process sources used to design this skill. It is not a substitute for current case-specific review.
diff --git a/skills/treatment-plans/references/source_ledger.md b/skills/treatment-plans/references/source_ledger.md
new file mode 100644
index 00000000..4add35e9
--- /dev/null
+++ b/skills/treatment-plans/references/source_ledger.md
@@ -0,0 +1,131 @@
+# Authoritative Source Ledger
+
+Research and access date: **2026-07-23**
+
+Method: targeted `parallel-cli search` restricted to official domains, followed by `parallel-cli extract` for canonical pages and documents. No research output files were retained in the repository.
+
+This ledger supports the skill's documentation and governance design. It is not a clinical evidence review and must not be used to select treatment.
+
+## Privacy and data governance
+
+### HHS OCR — HIPAA de-identification guidance
+
+- URL: https://www.hhs.gov/hipaa/for-professionals/special-topics/de-identification/index.html
+- Page date observed: **2026-03-20**
+- Used for: the distinction between Expert Determination and Safe Harbor; required documentation for Expert Determination; Safe Harbor's actual-knowledge condition; risks in free text and clinical narratives.
+- Boundary: the bundled checklist performs neither method and never claims de-identification or HIPAA compliance.
+
+### HHS OCR — Minimum Necessary Requirement
+
+- URL: https://www.hhs.gov/hipaa/for-professionals/privacy/guidance/minimum-necessary-requirement/index.html
+- Page date observed: **2026-03-18**
+- Used for: reasonable limitation of uses, disclosures, and requests; role-based policies; routine/non-routine procedures; listed exceptions including treatment-purpose disclosures and requests.
+- Boundary: the skill does not decide whether an exception applies and adopts data minimization as a conservative process safeguard.
+
+### HHS OCR — Breach Notification
+
+- URL: https://www.hhs.gov/hipaa/for-professionals/breach-notification/index.html
+- Portal: https://ocrportal.hhs.gov/ocr/breach/breach_report.jsf
+- Accessed: **2026-07-23**
+- Used for: identifying the official privacy-incident reporting authority and preserving a local reporting route.
+- Boundary: the skill does not determine breach status, legal duty, deadline, or report content and does not submit reports.
+
+## FDA labeling and medication-risk programs
+
+### FDA — Human prescription-drug labeling resources
+
+- URL: https://www.fda.gov/drugs/laws-acts-and-rules/fdas-labeling-resources-human-prescription-drugs
+- Content-current date observed: **2026-03-15**
+- Used for: distinguishing FDA-approved labeling in Drugs@FDA from other current/in-use labeling; identifying official labeling and safety-change databases.
+- Boundary: an authorized clinician or pharmacist verifies exact product applicability. The skill never interprets labeling or derives a patient-specific action.
+
+### FDA — Patient labeling resources
+
+- URL: https://www.fda.gov/drugs/fdas-labeling-resources-human-prescription-drugs/patient-labeling-resources
+- Content-current date observed: **2024-08-19**
+- Used for: distinctions among Medication Guides, Patient Package Inserts, Instructions for Use, and non-FDA-reviewed consumer medication information.
+- Boundary: the skill does not create or paraphrase product instructions.
+
+### FDA — What's in a REMS?
+
+- URL: https://www.fda.gov/drugs/risk-evaluation-and-mitigation-strategies-rems/whats-rems
+- Content-current date shown by FDA: **2018-01-26**
+- Used for: product-specific participant roles, communications, required activities, certifications, enrollment, monitoring, and safe-use conditions.
+- Currency control: current programs and materials must be checked in REMS@FDA.
+- Boundary: the skill does not decide applicability or whether prescribing, dispensing, or administration may proceed.
+
+### FDA — REMS@FDA
+
+- URL: https://www.accessdata.fda.gov/scripts/cder/rems/index.cfm
+- Accessed: **2026-07-23**
+- Used for: authoritative current REMS program and material locators.
+- Boundary: no automated lookup occurs while processing patient data.
+
+## Medication safety and care transitions
+
+### WHO — Transitions of Care
+
+- URL: https://www.who.int/docs/default-source/patient-safety/9789241511599-eng.pdf?sfvrsn=a577528_2
+- Publication date observed: **2016-09-19**
+- Used for: process-level structure for accurate information transfer, medication reconciliation, patient/carer engagement, ownership, checklists, tracking, and local systems.
+- Boundary: older global process guidance is not a current specialty treatment guideline; local institution policy and authorized clinicians control.
+
+### Joint Commission — Right Patient, Right Care / handoff process
+
+- URL: https://digitalassets.jointcommission.org/api/public/content/2361b813982a420cb9590bd363d9c3f1?v=994360b5
+- Material reviewed: **2025 National Performance Goal content**
+- Used for: high-level identification, handoff communication, critical-result communication, and continuity concepts.
+- Boundary: no proprietary standard text is reproduced; the skill does not claim accreditation compliance.
+
+## Shared decision-making and person-centered planning
+
+### AHRQ — The SHARE Approach
+
+- URL: https://www.ahrq.gov/health-literacy/professional-training/shared-decision/index.html
+- Page review date observed: **2026**
+- Used for: clinician-led dialogue about options, benefits, harms, risks, and what matters to the person.
+- Boundary: the skill records a completed process; it does not conduct the conversation or generate options and risk estimates.
+
+### AHRQ — Shared Decisionmaking strategy
+
+- URL: https://www.ahrq.gov/cahps/quality-improvement/improvement-guide/6-strategies-for-improving/communication/strategy6i-shared-decisionmaking.html
+- Accessed: **2026-07-23**
+- Used for: balanced decision-aid principles and avoiding tools that steer toward one treatment.
+- Boundary: no decision aid or patient-specific choice is generated.
+
+### NICE NG197 — Shared decision making
+
+- URL: https://www.nice.org.uk/guidance/ng197
+- Published and last reviewed: **2021-06-17**
+- Used for: documenting collaboration, risks, benefits, consequences, uncertainty, and organizational support.
+- Boundary: NICE states the guideline excludes unexpected emergencies and does not replace professional judgment; local jurisdiction and policy control.
+
+### CMS — Person-Centered Care
+
+- URL: https://www.cms.gov/priorities/innovation/key-concepts/person-centered-care
+- Page date observed: **2023-08-14**
+- Used for: high-level goals, values, preferences, communication, coordination, and patient-reported outcomes concepts.
+- Boundary: this is not treated as a universal documentation mandate. Program-specific CMS requirements are used only after applicability review.
+
+## Reporting and safety governance
+
+### FDA — Reporting Serious Problems to FDA / MedWatch
+
+- URL: https://www.fda.gov/safety/medwatch-fda-safety-information-and-adverse-event-reporting-program/reporting-serious-problems-fda
+- Page date observed: **2026-06-05**
+- Used for: identifying MedWatch as an official route for specified medical-product problems and distinguishing voluntary and mandatory reporting contexts.
+- Boundary: local qualified personnel determine applicability and reporting obligations. The skill does not file a report.
+
+### AHRQ PSO — Common Formats and NPSD
+
+- URL: https://pso.ahrq.gov/common-formats
+- Page last reviewed: **2026-01**
+- Used for: identifying standardized patient-safety event formats and non-identifiable NPSD data within authorized PSO workflows.
+- Boundary: the skill does not create a PSO submission or confer Patient Safety and Quality Improvement Act privilege/confidentiality.
+
+## Deliberate exclusions
+
+- No disease-specific, specialty-specific, dosing, treatment-sequencing, interaction, contraindication, tapering, prognosis, triage, or emergency-treatment source was embedded.
+- No commercial point-of-care reference was treated as authoritative regulatory guidance.
+- No CMS billing or care-plan rule was generalized beyond its exact program.
+- No source in this ledger replaces current local institution policy or case-specific review by authorized licensed professionals.
diff --git a/skills/treatment-plans/references/specialty_specific_guidelines.md b/skills/treatment-plans/references/specialty_specific_guidelines.md
deleted file mode 100644
index f13f6d1d..00000000
--- a/skills/treatment-plans/references/specialty_specific_guidelines.md
+++ /dev/null
@@ -1,655 +0,0 @@
-# Specialty-Specific Treatment Plan Guidelines
-
-## Overview
-
-This reference provides detailed guidelines for developing treatment plans specific to each of the six template types: general medical, rehabilitation, mental health, chronic disease management, perioperative, and pain management. Each section includes specialty-specific considerations, clinical pearls, and best practices.
-
-## Concise Documentation Examples by Specialty
-
-### Foundation Medicine Model: Concise vs. Verbose
-
-**PRINCIPLE**: Focus on actionable information; eliminate redundancy; use bullet points and short paragraphs.
-
-### General Medical - Diabetes Example
-
-**VERBOSE (Avoid)**:
-> "Patient education was provided on the pathophysiology of Type 2 Diabetes Mellitus, including detailed explanation of insulin resistance, pancreatic beta-cell dysfunction, and the progressive nature of the disease. The patient was educated about the various potential complications of diabetes including microvascular complications such as diabetic retinopathy which can lead to blindness, diabetic nephropathy which can progress to end-stage renal disease requiring dialysis, and diabetic neuropathy which can cause pain and sensory loss. Additionally, macrovascular complications were discussed including increased risk of myocardial infarction, stroke, and peripheral arterial disease."
-
-**CONCISE (Preferred - 75% shorter)**:
-> "Key Education: Disease understanding, micro/macrovascular complication risks, self-monitoring techniques (glucose, BP), medication timing, diet basics, exercise safety, sick day management. Critical warnings: Hypoglycemia (shakiness, confusion - treat with 15g carbs), severe hyperglycemia >300 (call office), chest pain/stroke symptoms (911)."
-
-### Mental Health - Depression Example
-
-**VERBOSE (Avoid)**:
-> "The patient will participate in individual psychotherapy sessions utilizing Cognitive Behavioral Therapy techniques. Sessions will be scheduled on a weekly basis for a duration of 50 minutes each. The therapist will work with the patient to identify negative thought patterns, challenge cognitive distortions, develop behavioral activation strategies, and build coping skills for managing depressive symptoms."
-
-**CONCISE (Preferred - 60% shorter)**:
-> "CBT weekly × 16 sessions (50 min) focusing on: identifying/challenging negative thoughts, behavioral activation, coping skills development. Goals: PHQ-9 <10, return to work, 3 effective stress management strategies."
-
-### Rehabilitation - Post-Stroke Example
-
-**VERBOSE (Avoid)**:
-> "Expected outcomes include improvement in upper extremity function with anticipated achievement of the ability to perform self-care activities including bathing, dressing, and grooming with minimal assistance or independently. The patient is expected to demonstrate improved ambulation capabilities with progression from wheelchair mobility to ambulation with a rolling walker under supervision, with eventual goal of independent ambulation with a straight cane for distances up to 300 feet."
-
-**CONCISE (Preferred - 70% shorter)**:
-> "Expected outcomes (8 weeks): Independent ADLs with adaptive equipment, ambulation 300+ feet with walker/supervision, stair negotiation with handrail, safe home discharge. Timeline: Week 2 - transfers with supervision; Week 4 - ambulate 150 feet; Week 8 - community ambulation, discharge ready."
-
-### Perioperative - Laparoscopic Surgery Example
-
-**VERBOSE (Avoid)**:
-> "Postoperative pain management will utilize a multimodal approach to analgesia in order to minimize opioid consumption and reduce the risk of opioid-related adverse effects including nausea, vomiting, constipation, and respiratory depression. The multimodal regimen will include scheduled acetaminophen administered at a dose of 1000 milligrams every 6 hours, ibuprofen 600 milligrams every 6 hours as needed, and opioid analgesics reserved for breakthrough pain only."
-
-**CONCISE (Preferred - 65% shorter)**:
-> "Multimodal analgesia: Acetaminophen 1000mg Q6H scheduled, ibuprofen 600mg Q6H PRN, opioids for breakthrough only. Goal: Pain <4/10, minimize opioid use, early mobilization."
-
-### Key Principles for Concise Documentation
-
-1. **Use abbreviations appropriately**: Q6H, PRN, ADLs, BP (define on first use if uncommon)
-2. **Bullet points over paragraphs**: Easier to scan, more actionable
-3. **Combine related information**: Group similar items together
-4. **Eliminate filler words**: "The patient will...", "It is anticipated that..."
-5. **Focus on "what, when, why"**: Action, timing, rationale in minimal words
-6. **Use tables for complex data**: Medication lists, monitoring schedules
-7. **Prioritize critical information**: Safety warnings, emergency actions
-
-## 1. General Medical Treatment Plans
-
-### Applicable Conditions
-- Chronic diseases: Diabetes, hypertension, heart failure, COPD, asthma
-- Common acute conditions requiring structured follow-up
-- Primary care management of stable chronic conditions
-
-### Key Assessment Components
-
-**Baseline Status**:
-- Vital signs, BMI, functional status
-- Disease-specific metrics (HbA1c, BP, lipids, PFTs)
-- Comorbidity assessment
-- Medication reconciliation
-- Social determinants of health screening
-
-**Disease Severity Staging**:
-- Use validated staging systems when available
-- Examples: CKD stages 1-5, GOLD COPD stages I-IV, NYHA heart failure classes I-IV, ADA diabetes complications
-- Document severity to guide treatment intensity
-
-### Treatment Goal Specifics
-
-**Guideline-Based Targets**:
-- HbA1c <7% for most diabetics (<8% if elderly, limited life expectancy)
-- BP <130/80 for most; <140/90 if elderly or low cardiovascular risk
-- LDL <70 mg/dL if ASCVD, <100 mg/dL moderate risk
-- Use individualized targets based on patient factors
-
-**Functional Goals**:
-- Maintain independence in ADLs
-- Return to work if applicable
-- Engage in valued activities
-- Quality of life improvement
-
-### Pharmacotherapy Considerations
-
-**Polypharmacy Management**:
-- Consider deprescribing when possible (Beers Criteria for elderly)
-- Medication reconciliation at each visit
-- Simplify regimens (once-daily dosing, combination pills)
-- Address adherence barriers (cost, side effects, complexity)
-
-**Drug-Disease Interactions**:
-- Avoid NSAIDs if CKD, heart failure
-- Caution with metformin if eGFR <30
-- Beta-blockers contraindicated in severe COPD/asthma (use cardioselective if needed)
-
-### Monitoring Schedules by Condition
-
-**Diabetes**:
-- HbA1c every 3 months if not at goal, every 6 months if stable
-- Annual: dilated eye exam, foot exam, urine ACR, lipids
-- Each visit: BP, weight, medication adherence
-
-**Hypertension**:
-- Home BP monitoring (HBPM) - most accurate, average of multiple readings
-- Office BP at each visit
-- Labs (BMP for K+, creatinine) 1-2 weeks after ACE/ARB initiation, then annually
-
-**Heart Failure**:
-- Daily weights (report gain >2-3 lbs in 2 days)
-- BNP/NT-proBNP when clinically changing
-- Echo annually or if EF change suspected
-- Medication titration every 2 weeks during optimization phase
-
-### Primary Care Integration
-
-**Preventive Care**:
-- Include age-appropriate cancer screenings
-- Vaccination schedule (flu, pneumococcal, zoster, COVID)
-- Lifestyle counseling (tobacco, alcohol, diet, exercise)
-
-**Chronic Disease Management Models**:
-- Chronic Care Model components: Self-management support, delivery system redesign, clinical information systems, decision support
-- Team-based care: Involvement of nurses, pharmacists, dietitians, care coordinators
-
----
-
-## 2. Rehabilitation Treatment Plans
-
-### Applicable Settings
-- Post-acute inpatient rehabilitation
-- Outpatient PT/OT/SLP
-- Home health therapy
-- Skilled nursing facility rehabilitation
-
-### Key Assessment Components
-
-**Functional Assessments (use validated tools)**:
-- **FIM** (Functional Independence Measure): 18 items, 7-point scale, 126 total - most widely used
-- **Barthel Index**: 10 ADLs, 100-point scale - simpler than FIM
-- **Berg Balance Scale**: 14 tasks, 56 points - fall risk (score <45 = high risk)
-- **6-Minute Walk Test**: Distance walked in 6 minutes - cardiopulmonary endurance
-- **Timed Up and Go (TUG)**: Time to stand, walk 3 meters, turn, return, sit - fall risk (>12 sec = high risk)
-- **9-Hole Peg Test**: Upper extremity fine motor speed
-- **ROM**: Goniometric measurement for each joint
-- **Manual Muscle Testing**: 0-5 scale (0=no contraction, 5=normal strength)
-
-**ICF Framework Goals**:
-- **Body Functions/Structures**: Impairments (ROM, strength, balance)
-- **Activity**: Task performance (walk 150 feet, dress independently)
-- **Participation**: Life roles (return to work, community engagement)
-
-### Rehabilitation Goals Specifics
-
-**Goal Levels**:
-1. **Impairment Goals**: Increase knee ROM 90→110°, improve MMT 3/5→4/5
-2. **Activity Goals**: Ambulate 300 feet with walker, transfer bed-chair independently
-3. **Participation Goals**: Return to work, resume hobbies, live independently
-
-**Assistance Levels** (document current and goal):
-- I = Independent
-- SV = Supervision (cues, no physical assist)
-- CG = Contact Guard (hands close, no assist)
-- Min A = Minimal Assist (patient does 75%+)
-- Mod A = Moderate Assist (patient does 50-74%)
-- Max A = Maximal Assist (patient does 25-49%)
-- Total A = Total Assist (patient does <25%)
-
-### Therapy Interventions
-
-**Physical Therapy**:
-- Therapeutic exercise dose: Specify sets, reps, resistance, frequency
-- Gait training: Distance, assistive device, supervision level
-- Balance training: Static, dynamic, perturbation-based
-- Modalities: Heat, ice, TENS, E-stim - adjuncts only, not primary intervention
-
-**Occupational Therapy**:
-- ADL training: Use of adaptive equipment (reacher, sock aid, built-up utensils)
-- Upper extremity strengthening: Functional tasks, fine motor activities
-- Cognitive retraining: Memory strategies, attention training, executive function
-
-**Speech-Language Pathology**:
-- Dysphagia: Diet texture modifications (IDDSI levels), swallow strategies (chin tuck, multiple swallows)
-- Aphasia therapy: Constraint-induced language therapy, semantic feature analysis
-- Dysarthria: Articulation drills, rate control, augmentative communication
-
-### Home Exercise Program (HEP)
-
-**Essentials**:
-- Illustrated handout with pictures/descriptions
-- Specific dosage (e.g., "2 sets x 10 reps, daily")
-- Progression criteria
-- Safety precautions
-- Patient/caregiver demonstrates understanding
-
-### DME and Environmental Modifications
-
-**Common DME**:
-- Ambulation: Walker, cane, crutches (specify type, e.g., front-wheeled walker)
-- Bathroom: Raised toilet seat, shower chair, grab bars
-- Dressing: Reacher, sock aid, long shoe horn, button hook, elastic laces
-- Mobility: Hospital bed, wheelchair (if needed)
-
-**Home Modifications**:
-- Ramp for stairs
-- Stair lift if multiple levels
-- Remove scatter rugs (fall hazard)
-- Improve lighting
-- Rearrange for accessibility
-
-### Discharge Planning
-
-**Discharge Criteria**:
-- Functional plateau reached or goals met
-- Safe for discharge setting
-- Patient/caregiver educated
-- DME obtained and home modifications complete
-- Follow-up arranged
-
-**Discharge Destination**:
-- Home with outpatient therapy
-- Home with home health
-- Skilled nursing facility
-- Long-term acute care hospital (if medically complex)
-
----
-
-## 3. Mental Health Treatment Plans
-
-### Applicable Conditions
-- Major depressive disorder, dysthymia
-- Anxiety disorders (GAD, panic, social anxiety, specific phobias)
-- Bipolar disorder
-- Schizophrenia and psychotic disorders
-- PTSD and trauma-related disorders
-- Eating disorders
-- Substance use disorders
-- Personality disorders
-
-### Key Assessment Components
-
-**Diagnostic Assessment**:
-- Meet DSM-5 criteria for diagnosis
-- Symptom severity assessment (use validated scales)
-- Functional impairment (work, relationships, self-care)
-- Psychiatric history (prior episodes, treatments, hospitalizations)
-- Substance use assessment (AUDIT, DAST)
-- Trauma history
-- Family psychiatric history
-
-**Validated Assessment Tools**:
-- **PHQ-9**: Depression severity (0-27, scores ≥10 indicate moderate-severe depression)
-- **GAD-7**: Anxiety severity (0-21, scores ≥10 indicate moderate-severe anxiety)
-- **MDQ** (Mood Disorder Questionnaire): Bipolar screening
-- **PC-PTSD-5**: PTSD screening, then full PCL-5 if positive
-- **AUDIT**: Alcohol use (0-40, ≥8 indicates hazardous drinking)
-- **PHQ-15**: Somatic symptoms
-- **WHODAS 2.0**: Functional disability
-
-**Risk Assessment**:
-- **Suicide Risk**: Use Columbia Suicide Severity Rating Scale (C-SSRS)
- - Ideation (passive, active, plan, intent)
- - Protective factors (reasons for living, social support)
- - Risk factors (prior attempts, impulsivity, access to means)
-- **Violence/Homicide Risk**: History of violence, current ideation, access to weapons
-
-### Treatment Goals Specifics
-
-**Symptom Goals**:
-- Reduction in standardized scale scores (e.g., PHQ-9 from 18→<10→<5 for remission)
-- Specific symptom targets (sleep 7 hours, reduce panic attacks from 3/week→0)
-
-**Functional Goals**:
-- Return to work/school
-- Resume social activities
-- Improve relationships
-- Self-care independence
-
-**Recovery-Oriented Goals**:
-- Personal meaning and purpose
-- Hope and empowerment
-- Social connections and community integration
-- Independent living
-
-### Evidence-Based Psychotherapies
-
-**Depression**:
-- **CBT**: 12-16 sessions, homework between sessions
-- **Behavioral Activation**: Focus on increasing rewarding activities
-- **Interpersonal Therapy (IPT)**: 12-16 sessions, focus on relationships
-- **Problem-Solving Therapy**: Brief (6-8 sessions), structured approach
-
-**Anxiety**:
-- **CBT with exposure**: Gold standard for anxiety disorders
-- **Panic Control Therapy**: Interoceptive exposure, cognitive restructuring
-- **Social skills training**: For social anxiety
-
-**PTSD**:
-- **Prolonged Exposure (PE)**: 8-15 sessions, imaginal and in vivo exposure
-- **Cognitive Processing Therapy (CPT)**: 12 sessions, challenge trauma-related cognitions
-- **EMDR** (Eye Movement Desensitization and Reprocessing): Alternative, less evidence than PE/CPT
-
-**Bipolar**:
-- **Family-Focused Therapy**: Psychoeducation, communication, problem-solving
-- **Interpersonal and Social Rhythm Therapy**: Stabilize daily routines, sleep
-
-**Borderline Personality Disorder**:
-- **DBT** (Dialectical Behavior Therapy): 1 year program, individual + group + phone coaching
-- Skills: Mindfulness, distress tolerance, emotion regulation, interpersonal effectiveness
-
-### Psychopharmacology Specifics
-
-**Antidepressants**:
-- First-line: SSRIs (sertraline, escitalopram, fluoxetine)
-- 2-4 weeks for initial response, 6-8 weeks for full effect
-- Titrate after 2-4 weeks if partial response
-- Switch if no response after full trial
-- Augmentation strategies if partial response (second antidepressant, atypical antipsychotic, lithium)
-- Continue 6-12 months after remission (longer if recurrent)
-
-**Antipsychotics**:
-- First-generation (typical): Haloperidol - high EPS risk, use second-generation preferred
-- Second-generation (atypical): Risperidone, olanzapine, quetiapine, aripiprazole, lurasidone
-- Monitoring: Metabolic syndrome (weight, glucose, lipids), EPS, prolactin, QTc
-
-**Mood Stabilizers**:
-- Lithium: Narrow therapeutic window, monitor levels (0.6-1.2 mEq/L), TSH, renal function
-- Valproic acid: Monitor levels, LFTs, CBC (thrombocytopenia)
-- Lamotrigine: Titrate slowly (risk of Stevens-Johnson syndrome if too fast)
-
-### Safety Planning
-
-**Essential for All Mental Health Plans**:
-- Warning signs (thoughts, feelings, behaviors)
-- Internal coping strategies
-- Social support contacts
-- Professional contacts (therapist, psychiatrist, crisis line)
-- Means restriction (firearms removed, medications limited)
-- Reason for living
-
-**Crisis Resources**:
-- 988 Suicide & Crisis Lifeline
-- Crisis Text Line (text HOME to 741741)
-- Local mobile crisis team
-- Emergency department
-
----
-
-## 4. Chronic Disease Management Plans
-
-### Multiple Comorbidities Management
-
-**Common Clusters**:
-- Cardiometabolic: Diabetes + hypertension + hyperlipidemia + obesity
-- Cardiopulmonary: Heart failure + COPD
-- Renal-cardiovascular: CKD + hypertension + diabetes
-- Mental-physical: Depression + chronic pain + chronic disease
-
-### Prioritization Strategies
-
-**When Multiple Goals Compete**:
-1. **Life-threatening issues first**: Unstable angina, uncontrolled heart failure
-2. **High-impact, modifiable conditions**: Diabetes with HbA1c 10% (significant reduction possible)
-3. **Synergistic treatments**: Medications that help multiple conditions (SGLT2i for diabetes + heart failure + CKD)
-4. **Patient priorities**: What matters most to patient
-
-### Medication Optimization for Multimorbidity
-
-**Synergistic Medications** (dual/triple benefit):
-- **SGLT2 inhibitors**: Diabetes + heart failure + CKD
-- **ACE inhibitors/ARBs**: Hypertension + diabetes (renal protection) + heart failure
-- **Beta-blockers**: Hypertension + heart failure + CAD
-- **Statins**: Hyperlipidemia + ASCVD prevention + diabetes
-- **GLP-1 agonists**: Diabetes + weight loss + cardiovascular benefit
-
-**Deprescribing**:
-- Identify medications with limited benefit (e.g., strict glycemic control in limited life expectancy)
-- Discontinue medications with more harm than benefit
-- Simplify regimens (reduce pill burden)
-
-### Care Coordination
-
-**Team-Based Care**:
-- Primary care coordinates
-- Specialists co-manage (cardiologist for HF, endocrinologist for diabetes)
-- Care coordinator facilitates (schedules, education, barrier identification)
-- Pharmacist reviews medications, optimizes therapy
-- Dietitian provides medical nutrition therapy
-- Social worker addresses social needs
-
-**Communication**:
-- Shared EHR when possible
-- Care plan accessible to all team members
-- Medication reconciliation after specialist visits
-- Regular team meetings or e-consultations
-
-### Population Health Integration
-
-**Registry Management**:
-- Identify patients due for care (HbA1c testing, diabetic eye exam)
-- Outreach for overdue preventive care
-- Risk stratification (high-utilizers, complex patients)
-
-**Transition Management**:
-- Hospital discharge follow-up within 7 days
-- Medication reconciliation post-discharge
-- Red flags review
-- Escalation plan if decompensating
-
----
-
-## 5. Perioperative Care Plans
-
-### Preoperative Risk Assessment
-
-**Cardiac Risk** (Revised Cardiac Risk Index - RCRI):
-- High-risk surgery, ischemic heart disease, heart failure, CVD, diabetes on insulin, creatinine >2
-- 0 points = <1% risk, 1 point = 1%, 2 points = 2.4%, ≥3 points = 5.4% risk of cardiac event
-
-**If High Risk**: Consider further testing (stress test, echo), cardiology consultation, perioperative beta-blockade.
-
-**Pulmonary Risk** (ARISCAT score):
-- Age, SpO2, respiratory infection recent, preop anemia, surgical incision, duration, emergency
-- Higher risk: Smoking cessation, incentive spirometry, early mobilization
-
-**VTE Risk** (Caprini Score):
-- Age, surgery type, mobility, prior VTE, obesity, cancer
-- Stratify to guide prophylaxis (none, mechanical, pharmacologic, or both)
-
-### Preoperative Optimization
-
-**Diabetes**:
-- Target HbA1c <8% for elective surgery (delay if >9%)
-- Hold metformin 24-48 hours before (risk of lactic acidosis)
-- Hold SGLT2i 3-4 days before (DKA risk)
-- Insulin: Reduce long-acting by 20-25% day of surgery, hold short-acting
-
-**Hypertension**:
-- Continue most medications through surgery
-- Hold ACE/ARB morning of surgery (avoid intraop hypotension)
-- Continue beta-blocker (avoid withdrawal)
-
-**Anticoagulation**:
-- Warfarin: Hold 5 days before, bridge with LMWH if high VTE risk
-- DOACs: Hold 24-48 hours (based on renal function and bleeding risk)
-- Antiplatelet: Continue aspirin for most surgeries, hold P2Y12 inhibitors (clopidogrel) 5-7 days if high bleeding risk
-
-**Anemia**:
-- Optimize iron stores preop (IV iron if time limited)
-- Avoid transfusion triggers if possible (restrictive strategy)
-
-### Enhanced Recovery After Surgery (ERAS)
-
-**Preoperative**:
-- Patient education, expectation setting
-- No prolonged fasting (clear liquids 2 hours before)
-- Carbohydrate loading (reduces insulin resistance)
-- No routine premedication
-
-**Intraoperative**:
-- Multimodal analgesia (minimize opioids)
-- Goal-directed fluid therapy (avoid overhydration)
-- Normothermia (prevent hypothermia)
-- Antiemetic prophylaxis
-
-**Postoperative**:
-- Early mobilization (out of bed day of surgery)
-- Early oral nutrition (resume diet POD 0-1)
-- Multimodal analgesia (acetaminophen, NSAIDs, regional blocks)
-- Remove tubes/drains early (Foley, NG tube, surgical drains)
-- DVT prophylaxis
-
-### Postoperative Milestones
-
-**Day of Surgery (POD 0)**:
-- Out of bed to chair 4-6 hours post-op
-- Sips of clear liquids if appropriate
-- Pain controlled on multimodal regimen
-
-**POD 1**:
-- Ambulate in hallway
-- Regular diet
-- Foley catheter removed
-- Transition to oral pain medications
-
-**POD 2-3** (typical discharge for many surgeries):
-- Ambulate 150+ feet
-- Adequate oral intake
-- Pain controlled on oral meds
-- No complications requiring hospitalization
-
-### Discharge Readiness
-
-**Criteria**:
-- Adequate pain control on oral medications
-- Tolerating regular diet
-- Mobile (ambulate, transfers)
-- Voiding spontaneously
-- Stable vital signs
-- No active complications
-- Safe discharge plan (home support, DME arranged)
-
----
-
-## 6. Pain Management Plans
-
-### Pain Assessment
-
-**Comprehensive Pain Evaluation**:
-- Location, radiation
-- Quality (sharp, dull, burning, aching, shooting)
-- Intensity (0-10 NRS)
-- Temporal pattern (constant, intermittent, episodic)
-- Aggravating/alleviating factors
-- Functional impact (Brief Pain Inventory - BPI interference items)
-- Prior treatments and responses
-
-**Pain Classification**:
-- **Nociceptive**: Somatic (MSK) or visceral (organ)
-- **Neuropathic**: Nerve injury/dysfunction (burning, shooting, electric, numbness/tingling)
-- **Nociplastic**: Central sensitization, fibromyalgia
-- **Mixed**: Combination
-
-### Multimodal Analgesia Principles
-
-**Goal**: Additive/synergistic pain relief from multiple mechanisms, opioid-sparing.
-
-**Components**:
-1. Non-opioid analgesics (acetaminophen, NSAIDs)
-2. Adjuvant analgesics (gabapentinoids, SNRIs, TCAs for neuropathic)
-3. Topical agents (lidocaine patches, diclofenac gel, capsaicin)
-4. Interventional procedures (injections, nerve blocks, RFA, SCS)
-5. Physical therapies (PT, exercise, TENS)
-6. Psychological therapies (CBT-CP, mindfulness, biofeedback)
-7. Complementary therapies (acupuncture, massage, yoga)
-8. Opioids (if other modalities insufficient) - lowest dose, reassess frequently
-
-### Neuropathic Pain Specific Treatments
-
-**First-Line**:
-- Gabapentin 300mg titrate to 1800-3600mg/day divided TID
-- Pregabalin 75mg BID titrate to 150-300mg BID
-- Duloxetine 60mg daily (also for fibromyalgia, chronic MSK pain)
-- TCAs (amitriptyline, nortriptyline) 10-75mg QHS - second-line due to side effects
-
-**Topical**:
-- Lidocaine patches 5% (localized neuropathic pain)
-- Capsaicin 8% patch (high-concentration, applied by provider)
-
-**Refractory**:
-- Tramadol (dual mechanism - opioid + SNRI)
-- Opioids (if severe and function-limiting despite above)
-
-### Opioid Prescribing (CDC Guidelines)
-
-**Before Initiating**:
-- Non-opioid multimodal therapies tried and inadequate
-- Functional goals established (not just pain scores)
-- Risks vs. benefits discussed and documented
-- Opioid risk assessment (ORT, SOAPP)
-- Informed consent discussion
-- Treatment agreement signed
-- PDMP checked
-- Baseline UDS
-
-**During Opioid Therapy**:
-- Start low dose (<50 MME/day), short-acting
-- Reassess frequently (every 1-3 months)
-- Functional improvement expected (not just pain scores)
-- UDS every 3-6 months (check for adherence and illicit substances)
-- PDMP check each prescription or at least every 3 months
-- Naloxone co-prescribed
-- Avoid concurrent benzodiazepines
-- If dose approaching 50 MME, reassess; avoid >90 MME if possible
-
-**Tapering**:
-- If not meeting functional goals
-- Serious adverse effects
-- Aberrant behaviors
-- Patient request
-- Slow taper: 10-25% dose reduction per week to month (faster if safety concern)
-
-### Interventional Pain Procedures
-
-**Indications and Evidence**:
-- **Epidural Steroid Injection**: Radicular pain from disc herniation/stenosis - short-term benefit
-- **Facet Joint Injections**: Diagnostic (if >50% relief, proceed to RFA)
-- **Radiofrequency Ablation**: 6-12 months relief for facet-mediated pain
-- **Spinal Cord Stimulation**: Refractory neuropathic pain (FBSS, CRPS) - 50-60% success
-- **Intrathecal Pump**: Severe refractory pain, cancer pain - delivers medication to CSF
-
-**Documentation for Procedures**:
-- Indication, prior conservative treatments tried
-- Expected benefit and duration
-- Risks discussed
-- Number of injections/procedures allowed per year
-
-### Functional Goals Emphasis
-
-**Shift from Pain Scores to Function**:
-- "Reduce pain to 3/10" is less meaningful than "Walk 1 mile, return to work, play with grandchildren"
-- BPI interference scores track functional impact
-- SMART functional goals (see Goal Setting reference)
-
-### Psychological Integration
-
-**CBT for Chronic Pain (CBT-CP)**:
-- Pain education and reconceptualization (pain ≠ harm)
-- Cognitive restructuring (challenge catastrophizing, all-or-nothing thinking)
-- Activity pacing and graded exposure (increase activity without flares)
-- Relaxation techniques
-- Acceptance and mindfulness
-
-**Essential for Chronic Pain**: Psychological factors (depression, anxiety, catastrophizing) perpetuate pain; must be addressed.
-
----
-
-## Cross-Cutting Considerations for All Treatment Plans
-
-### Cultural Competence
-- Ask about cultural health beliefs, practices
-- Use interpreter services when language barriers exist
-- Respect religious/spiritual practices in treatment
-- Adapt interventions to cultural context when possible
-
-### Health Literacy
-- Assess understanding (teach-back method)
-- Use plain language, avoid jargon
-- Visual aids, written materials at 5th-6th grade reading level
-- Confirm patient can execute plan (demonstrate inhaler use, insulin injection, etc.)
-
-### Social Determinants of Health (SDOH)
-- Screen for food insecurity, housing instability, transportation barriers
-- Connect to community resources (SNAP, Medicaid, patient assistance programs)
-- Address barriers in treatment plan (e.g., medication cost → generic alternatives, patient assistance)
-
-### Advance Care Planning
-- Appropriate for serious illness, elderly, declining function
-- Goals of care discussion
-- Healthcare proxy designation
-- Advance directive completion
-- Preferences for resuscitation, intubation, dialysis, etc.
-
----
-
-**Document Version**: 1.0
-**Last Updated**: January 2025
-**Next Review**: January 2026
-
diff --git a/skills/treatment-plans/references/treatment_plan_standards.md b/skills/treatment-plans/references/treatment_plan_standards.md
deleted file mode 100644
index 21126d40..00000000
--- a/skills/treatment-plans/references/treatment_plan_standards.md
+++ /dev/null
@@ -1,485 +0,0 @@
-% Treatment Plan Standards and Best Practices
-% Professional guidelines for treatment plan documentation
-% Last updated: 2025
-
-# Treatment Plan Standards
-
-## Overview
-
-Treatment plans are comprehensive documents that outline systematic approaches to addressing patient health conditions through evidence-based interventions, measurable goals, and structured follow-up. This reference provides professional standards, documentation requirements, and legal considerations for creating high-quality treatment plans across all medical specialties.
-
-## Core Documentation Standards
-
-### 1. Executive Summary Best Practices (Foundation Medicine Model)
-
-**CRITICAL: All treatment plans MUST include a prominent "Treatment Plan Highlights" summary box on the first page.**
-
-Following the Foundation Medicine model for genomic profiling reports, treatment plans should begin with a concise, bulletin-style summary that provides immediate access to key actionable information:
-
-**Components of Treatment Plan Highlights Box:**
-- **Key Diagnosis**: Primary condition with ICD-10 code, severity/stage (1 line)
-- **Primary Treatment Goals**: 2-3 SMART goals in bullet format
-- **Main Interventions**: 2-3 key interventions (pharmacological, non-pharmacological, monitoring)
-- **Timeline Overview**: Brief treatment duration/phases (1 line)
-
-**Format Requirements:**
-- Use colored box (tcolorbox in LaTeX) to make it visually prominent
-- Place immediately after title, before Patient Information section
-- Summary must fit on first page with patient demographics
-- Use concise, actionable language
-- Focus on what clinicians need to know immediately
-
-**Optimal Document Length:**
-- **Preferred**: 1 page for most treatment plans (quick-reference format)
-- **Standard**: 3-4 pages for moderate complexity cases
-- **Extended**: 5-6 pages maximum for highly complex cases only
-- Prioritize brevity, clarity, and actionability over comprehensive detail
-- Think "clinical decision support card" not "comprehensive textbook"
-
-**Design Philosophy:**
-The highlights box enables efficient clinical decision-making by providing critical information upfront, following evidence-based practices from precision medicine reporting. This approach improves care coordination, reduces time to treatment initiation, and ensures key information is never overlooked.
-
-### 2. Essential Components
-
-All treatment plans must include:
-
-#### Patient Information (De-identified for Sharing)
-- Unique patient identifier (not name or MRN)
-- Age range (not exact birth date)
-- Relevant demographics
-- Date of plan creation
-- Provider name and credentials
-- HIPAA compliance statement
-
-#### Diagnosis and Assessment
-- Primary diagnosis with ICD-10 code
-- Secondary diagnoses and comorbidities
-- Severity classification or staging
-- Functional assessment and baseline status
-- Risk stratification
-- Prognostic considerations
-
-#### Treatment Goals (SMART Format)
-- **Specific**: Clearly defined outcomes
-- **Measurable**: Quantifiable metrics or observable criteria
-- **Achievable**: Realistic given patient circumstances
-- **Relevant**: Aligned with patient values and priorities
-- **Time-bound**: Defined timeframe for achievement
-
-Short-term goals (weeks to 3 months) and long-term goals (3-12+ months) should be distinguished.
-
-#### Interventions
-- **Pharmacological**: Specific medications, doses, frequencies, rationales
-- **Non-pharmacological**: Lifestyle modifications, behavioral interventions, education
-- **Procedural**: Planned procedures, specialist referrals, diagnostic testing
-
-#### Timeline and Schedule
-- Treatment phases with durations
-- Appointment frequency
-- Milestone assessments
-- Expected treatment duration
-
-#### Monitoring Parameters
-- Clinical outcomes to track
-- Assessment tools and scales
-- Monitoring frequency
-- Intervention thresholds
-
-#### Expected Outcomes
-- Primary outcome measures
-- Success criteria
-- Timeline for improvement
-- Criteria for treatment modification
-
-#### Follow-up Plan
-- Scheduled appointments
-- Communication protocols
-- Emergency procedures
-- Transition planning
-
-#### Patient Education
-- Condition understanding
-- Self-management skills
-- Warning signs
-- Resources and support
-
-#### Risk Mitigation
-- Potential adverse effects
-- Safety monitoring
-- Emergency action plans
-- Complication prevention
-
-### 2. Professional Documentation Standards
-
-#### Clarity and Precision
-- Use professional medical terminology appropriately
-- Define abbreviations on first use
-- Avoid ambiguous language
-- Specific rather than vague descriptions
-
-**Good Example**: "Reduce HbA1c from 8.5% to <7% within 3 months"
-**Poor Example**: "Improve diabetes control"
-
-#### Completeness
-- Address all relevant aspects of condition
-- Include rationale for treatment choices
-- Document shared decision-making
-- Address patient preferences and concerns
-
-#### Accuracy
-- Factually correct information
-- Current evidence-based recommendations
-- Appropriate dosing and frequencies
-- Correct ICD-10 and CPT codes
-
-#### Timeliness
-- Plans created at diagnosis or treatment initiation
-- Updated after significant clinical changes
-- Regular scheduled updates (quarterly to annually)
-- Dated and signed promptly
-
-#### Legibility and Organization
-- Professional formatting
-- Logical flow and structure
-- Consistent use of headings and sections
-- Easy to locate key information
-
-### 3. Legal and Regulatory Requirements
-
-#### Medical Necessity Documentation
-Treatment plans must demonstrate:
-- Appropriateness of interventions for diagnosis
-- Evidence supporting treatment choices
-- Expected outcomes justify costs and risks
-- Frequency and duration are reasonable
-- Less invasive options considered
-
-#### Informed Consent Documentation
-Record that patient:
-- Understands diagnosis and prognosis
-- Aware of treatment options, risks, and benefits
-- Knows alternatives to proposed treatment
-- Had opportunity to ask questions
-- Voluntarily agrees to treatment plan
-
-#### Privacy and Confidentiality (HIPAA)
-- Protected Health Information (PHI) safeguarded
-- De-identification for sharing:
- - Remove 18 HIPAA identifiers per Safe Harbor method
- - Names, dates (except year), geographic subdivisions smaller than state
- - Contact information (phone, fax, email, addresses)
- - Social Security numbers, medical record numbers, account numbers
- - Biometric identifiers, photos, other unique identifiers
-- Access limited to those with treatment, payment, or operations need
-- Patient authorization for non-routine disclosures
-
-#### Billing and Reimbursement Support
-- ICD-10 diagnosis codes for all conditions
-- CPT codes for procedures
-- Documentation of medical necessity
-- Justification for level of service
-- Compliance with payer-specific requirements
-
-#### Quality Measure Reporting
-Enable extraction of quality metrics:
-- HEDIS measures (diabetes HbA1c testing, BP control, etc.)
-- CMS quality reporting (MIPS, ACO measures)
-- Disease-specific quality indicators
-- Patient safety indicators
-
-#### Liability Protection
-Defensible documentation includes:
-- Rationale for clinical decisions
-- Consideration of differential diagnosis
-- Risk-benefit analysis
-- Patient education and warnings
-- Follow-up plan for abnormal findings
-- Addressing non-adherence or patient refusal
-
-## Professional Practice Standards
-
-### Joint Commission Standards
-
-#### Patient-Centered Care
-- Treatment plans developed with patient participation
-- Goals reflect patient values and preferences
-- Cultural and linguistic needs addressed
-- Health literacy appropriate communication
-
-#### Multidisciplinary Coordination
-- Input from relevant disciplines
-- Clear role delineation
-- Communication among team members
-- Coordinated interventions
-
-#### Evidence-Based Practice
-- Interventions based on current evidence
-- Clinical practice guidelines followed
-- Variation from guidelines documented and justified
-- Literature supports treatment choices
-
-### Commission on Accreditation of Rehabilitation Facilities (CARF)
-
-For rehabilitation treatment plans:
-- Individualized based on comprehensive assessment
-- Measurable, achievable, time-specific goals
-- Regular team review and modification
-- Patient and family involvement
-- Transition and discharge planning
-
-### Centers for Medicare & Medicaid Services (CMS)
-
-#### Conditions of Participation
-- Physician orders for treatment
-- Periodic review and revision
-- Progress toward goals documented
-- Care plan accessible to all team members
-
-#### Documentation Requirements
-- Legible (typed or clear handwriting)
-- Dated and authenticated (signed)
-- Amendments/corrections properly marked
-- Retention per state law (typically 7-10 years, longer for minors)
-
-## Medical Specialty Standards
-
-### Primary Care
-- Annual comprehensive assessment and plan update
-- Chronic disease management protocols
-- Preventive care integration
-- Medication reconciliation
-- Care coordination with specialists
-
-### Behavioral Health
-- Mental status examination
-- Psychiatric diagnoses per DSM-5 criteria
-- Suicide/homicide risk assessment and safety planning
-- Measurable behavioral outcomes
-- Crisis intervention plan
-- Substance use assessment
-- 42 CFR Part 2 compliance for substance use treatment
-
-### Rehabilitation
-- Functional assessments (FIM, Barthel Index, etc.)
-- Activity limitations and participation restrictions
-- Short-term and long-term functional goals
-- Therapy frequency, intensity, duration
-- Home exercise program
-- Assistive devices and DME
-- Discharge criteria
-
-### Surgical/Perioperative
-- Indication for surgery documented
-- Preoperative risk assessment (ASA, RCRI)
-- Medical optimization plan
-- Enhanced Recovery After Surgery (ERAS) protocols when applicable
-- Postoperative milestones
-- Discharge criteria and planning
-
-### Pain Management
-- Comprehensive pain assessment (location, intensity, quality, temporal pattern, impact)
-- Pain type (nociceptive, neuropathic, mixed)
-- Multimodal analgesia approach
-- Opioid risk assessment (ORT, SOAPP)
-- If opioids: CDC guidelines compliance, treatment agreement, UDS, PDMP
-- Functional goals (not just pain scores)
-- Psychological screening and intervention
-
-## Quality Indicators for Treatment Plans
-
-### Completeness Metrics
-- All required sections present (100%)
-- Goals meet SMART criteria ($\geq$90%)
-- Interventions have clear rationales ($\geq$95%)
-- Monitoring plan includes frequency ($\geq$95%)
-- Patient education documented (100%)
-
-### Clinical Quality Metrics
-- Evidence-based interventions ($\geq$90%)
-- Guideline-concordant care ($\geq$85%)
-- Avoidance of low-value care (100%)
-- Appropriate preventive care included ($\geq$95%)
-
-### Patient-Centered Metrics
-- Patient preferences documented ($\geq$90%)
-- Shared decision-making noted ($\geq$85%)
-- Culturally appropriate care (100%)
-- Health literacy addressed ($\geq$90%)
-
-### Safety Metrics
-- Risk mitigation strategies present (100%)
-- Medication safety addressed (100%)
-- Emergency procedures documented (100%)
-- Red flags/warning signs communicated (100%)
-
-## Common Documentation Deficiencies and Solutions
-
-### Problem: Vague Goals
-**Deficiency**: "Improve diabetes"
-**Solution**: "Reduce HbA1c from 8.5% to <7% within 3 months through medication intensification and lifestyle modification"
-
-### Problem: Missing Rationales
-**Deficiency**: Lists medications without explanation
-**Solution**: "Metformin 1000mg BID - first-line therapy for T2DM, reduces hepatic glucose production, target dose for HbA1c reduction"
-
-### Problem: No Timeline
-**Deficiency**: Goals without timeframes
-**Solution**: "Short-term (3 months): HbA1c <7.5%; Long-term (6 months): HbA1c <7%"
-
-### Problem: Incomplete Monitoring
-**Deficiency**: "Monitor labs"
-**Solution**: "HbA1c every 3 months until at goal, then every 6 months; CMP every 6 months to monitor renal function on metformin and ACE inhibitor"
-
-### Problem: Absent Patient Education
-**Deficiency**: No documentation of education provided
-**Solution**: Dedicated section documenting: condition education, self-management skills taught, warning signs communicated, resources provided
-
-### Problem: Missing Safety Planning
-**Deficiency**: No risk mitigation
-**Solution**: Specific safety concerns addressed (e.g., hypoglycemia risk with insulin, monitoring plan, patient taught recognition and treatment)
-
-## Electronic Health Record (EHR) Integration
-
-### Structured Data Entry
-- Use templates for consistency
-- Coded diagnoses (ICD-10), procedures (CPT)
-- Structured goals enable outcome tracking
-- Discrete medication fields (name, dose, route, frequency)
-
-### Clinical Decision Support
-- Evidence-based order sets
-- Drug-drug interaction alerts
-- Guideline reminders
-- Quality measure tracking
-
-### Care Plan Sharing
-- Patient portal access (patient-friendly version)
-- Interoperability standards (C-CDA)
-- Shared with care team
-- Transitions of care summary
-
-## Audit and Peer Review
-
-### Internal Quality Review
-- Random sample chart audits (e.g., 5% quarterly)
-- Checklist-based review (completeness, quality)
-- Feedback to providers
-- Continuous quality improvement
-
-### External Review
-- Payer audits (documentation supports billing)
-- Regulatory surveys (Joint Commission, CMS)
-- Malpractice case review
-- Peer review for privileging/credentialing
-
-### Audit Criteria
-- Documentation completeness
-- Clinical appropriateness
-- Regulatory compliance
-- Billing integrity
-- Patient safety
-
-## Treatment Plan Revision and Updates
-
-### When to Update Treatment Plans
-
-**Scheduled Updates**:
-- Chronic disease management: Every 3-6 months minimum
-- Behavioral health: Every 30-90 days depending on acuity
-- Rehabilitation: Weekly to biweekly during active therapy
-- Annual comprehensive update for all chronic conditions
-
-**Triggered Updates**:
-- Significant change in clinical status
-- New diagnosis
-- Treatment goals achieved or not progressing
-- Patient request or preference change
-- Hospitalization or emergency department visit
-- Medication changes or adverse events
-
-### Documentation of Changes
-- Date of revision
-- Reason for update
-- What changed (goals, interventions, timeline)
-- Provider signature
-- Maintain prior versions for record
-
-## Specialty-Specific Requirements
-
-### Diabetes Management Plans
-- HbA1c targets individualized
-- Complication screening schedule (eyes, feet, kidneys)
-- Self-monitoring blood glucose frequency
-- Hypoglycemia recognition and treatment
-- Sick day management
-
-### Heart Failure Plans
-- GDMT (guideline-directed medical therapy) checklist
-- Volume management (daily weights, fluid/sodium restriction)
-- NYHA functional class documentation
-- Device therapy consideration
-- Hospitalization triggers
-
-### Mental Health Treatment Plans
-- DSM-5 diagnostic criteria met
-- Suicide/violence risk assessment
-- Safety planning
-- Psychotherapy modality and frequency
-- Medication trials and responses
-- Functional goals (return to work, relationships)
-
-### Chronic Pain Plans
-- Comprehensive pain assessment
-- Functional goals (not just pain scores)
-- Multimodal analgesia
-- Opioid risk assessment if prescribing
-- Physical and psychological interventions
-- Activity modification and pacing
-
-## Cultural Competence and Health Equity
-
-### Culturally Appropriate Care
-- Recognize cultural health beliefs and practices
-- Address language barriers (interpreter services)
-- Respect religious and cultural preferences in treatment
-- Consider social determinants of health (housing, food security, transportation)
-- Avoid assumptions based on stereotypes
-
-### Health Literacy
-- Assess patient understanding (teach-back method)
-- Use plain language, avoid medical jargon
-- Visual aids and written materials at appropriate reading level
-- Tailor education to patient's learning style
-
-### Addressing Disparities
-- Screen for social needs and barriers
-- Connect to community resources
-- Culturally tailored interventions when evidence supports
-- Track outcomes by demographic groups, address disparities
-
-## References and Guidelines
-
-### General Standards
-- Joint Commission Standards Manual
-- CMS Conditions of Participation
-- State medical board documentation requirements
-
-### Specialty Guidelines
-- American College of Physicians (ACP)
-- American Academy of Family Physicians (AAFP)
-- American Psychiatric Association (APA)
-- American Physical Therapy Association (APTA)
-- Disease-specific societies (ADA, AHA, ACC, etc.)
-
-### Regulatory
-- HIPAA Privacy Rule (45 CFR Part 160, 164)
-- 42 CFR Part 2 (Substance Use Disorder Confidentiality)
-- 21 CFR Part 11 (Electronic Records, applicable for research/trials)
-- State scope of practice laws
-
----
-
-**Document Version**: 1.0
-**Last Updated**: January 2025
-**Next Review**: January 2026
-
diff --git a/skills/treatment-plans/scripts/_common.py b/skills/treatment-plans/scripts/_common.py
new file mode 100644
index 00000000..f1c899a3
--- /dev/null
+++ b/skills/treatment-plans/scripts/_common.py
@@ -0,0 +1,1160 @@
+#!/usr/bin/env python3
+"""Bounded, dependency-free helpers for local treatment-plan JSON records."""
+
+from __future__ import annotations
+
+import json
+import os
+import re
+import tempfile
+from dataclasses import dataclass
+from datetime import date, datetime
+from pathlib import Path
+from typing import Any, Iterable
+
+SCHEMA_VERSION = "2.0"
+STATUS = "DRAFT_NOT_FOR_CLINICAL_USE"
+NOTICE = (
+ "DRAFT — NOT MEDICAL ADVICE — DOCUMENTATION-ONLY — "
+ "AUTHORIZED CLINICIAN SIGN-OFF REQUIRED"
+)
+EMERGENCY_STATEMENT = (
+ "If a concern may be urgent or emergent, stop this documentation workflow "
+ "and use the institution's current clinical escalation or emergency process; "
+ "this package does not determine urgency or provide emergency instructions."
+)
+SIGNOFF_ATTESTATION = (
+ "The signer attests only that this package accurately transcribes "
+ "clinician-supplied and verified decisions for authorized documentation "
+ "handoff; it is not stand-alone medical advice."
+)
+
+MAX_INPUT_BYTES = 2 * 1024 * 1024
+MAX_TEXT_CHARS = 8_000
+MAX_LIST_ITEMS = 500
+MAX_OBJECT_FIELDS = 100
+MAX_DEPTH = 20
+MAX_TOTAL_NODES = 20_000
+
+IDENTIFIER_RE = re.compile(r"^[A-Za-z][A-Za-z0-9._:-]{1,95}$")
+BLOCKER_RE = re.compile(r"^[A-Z][A-Z0-9_]{2,95}$")
+DIRECT_IDENTIFIER_KEYS = {
+ "address",
+ "date_of_birth",
+ "dob",
+ "email",
+ "fax",
+ "full_name",
+ "medical_record_number",
+ "mrn",
+ "name",
+ "patient_id",
+ "phone",
+ "social_security_number",
+ "ssn",
+}
+PROHIBITED_USES = {
+ "diagnosis_or_assessment",
+ "therapy_selection_or_recommendation",
+ "medication_or_dose_decision",
+ "start_stop_hold_resume_titrate_or_taper_decision",
+ "interaction_allergy_or_contraindication_check",
+ "triage_or_urgency_determination",
+ "emergency_advice_or_safety_plan",
+ "prognosis_or_outcome_prediction",
+ "patient_specific_recommendation",
+ "replacement_of_authorized_professional_review",
+}
+
+TEMPLATE_FILES = {
+ "source_fact_manifest": (
+ "source_fact_manifest_template.json",
+ "source_fact_manifest.json",
+ ),
+ "clinician_authored_intervention_record": (
+ "clinician_authored_intervention_template.json",
+ "clinician_authored_intervention.json",
+ ),
+ "goals_monitoring_checkpoint_record": (
+ "goals_monitoring_checkpoint_template.json",
+ "goals_monitoring_checkpoint.json",
+ ),
+ "informed_preference_shared_decision_record": (
+ "informed_preference_shared_decision_template.json",
+ "informed_preference_shared_decision.json",
+ ),
+ "transition_reconciliation_record": (
+ "transition_reconciliation_template.json",
+ "transition_reconciliation.json",
+ ),
+ "intended_use_handoff_record": (
+ "intended_use_handoff_template.json",
+ "intended_use_handoff.json",
+ ),
+}
+
+
+class ValidationError(ValueError):
+ """A deterministic failure that never includes a clinical value."""
+
+ def __init__(self, code: str, path: str = "$") -> None:
+ super().__init__(code)
+ self.code = code
+ self.path = path
+
+
+@dataclass(frozen=True)
+class Issue:
+ """A minimized validation issue."""
+
+ code: str
+ path: str
+ level: str = "error"
+
+ def as_dict(self) -> dict[str, str]:
+ return {"code": self.code, "path": self.path, "level": self.level}
+
+
+def _text(
+ *,
+ minimum: int = 0,
+ maximum: int = MAX_TEXT_CHARS,
+ enum: Iterable[str] | None = None,
+ const: str | None = None,
+ pattern: str | None = None,
+ format_name: str | None = None,
+) -> dict[str, Any]:
+ return {
+ "kind": "string",
+ "minimum": minimum,
+ "maximum": maximum,
+ "enum": set(enum) if enum is not None else None,
+ "const": const,
+ "pattern": re.compile(pattern) if pattern else None,
+ "format": format_name,
+ }
+
+
+def _boolean() -> dict[str, str]:
+ return {"kind": "boolean"}
+
+
+def _nullable(schema: dict[str, Any]) -> dict[str, Any]:
+ return {"kind": "nullable", "schema": schema}
+
+
+def _array(
+ item: dict[str, Any], *, minimum: int = 0, maximum: int = MAX_LIST_ITEMS
+) -> dict[str, Any]:
+ return {
+ "kind": "array",
+ "item": item,
+ "minimum": minimum,
+ "maximum": maximum,
+ }
+
+
+def _object(properties: dict[str, dict[str, Any]]) -> dict[str, Any]:
+ return {"kind": "object", "properties": properties}
+
+
+IDENTIFIER = _text(minimum=2, maximum=96, pattern=IDENTIFIER_RE.pattern)
+ROLE = _text(maximum=200)
+NONEMPTY_ROLE = _text(minimum=1, maximum=200)
+DATE = _text(minimum=10, maximum=10, format_name="date")
+DATETIME = _text(minimum=20, maximum=40, format_name="datetime")
+FACT_IDS = _array(IDENTIFIER, minimum=1, maximum=100)
+
+HEADER = {
+ "schema_version": _text(const=SCHEMA_VERSION),
+ "document_type": _text(minimum=1, maximum=96),
+ "document_id": IDENTIFIER,
+ "subject_ref": IDENTIFIER,
+ "data_classification": _text(
+ enum={
+ "synthetic",
+ "deidentified_qualified_review",
+ "real_patient_minimum_necessary",
+ }
+ ),
+ "status": _text(const=STATUS),
+ "notice": _text(const=NOTICE),
+ "created_at": _nullable(DATETIME),
+}
+
+VERIFICATION = _object(
+ {
+ "status": _text(enum={"pending", "verified"}),
+ "verified_by_role": ROLE,
+ "verified_at": _nullable(DATETIME),
+ }
+)
+
+SOURCE_FACT_SCHEMA = _object(
+ {
+ "fact_id": IDENTIFIER,
+ "fact_kind": _text(
+ enum={
+ "clinician_authored_decision",
+ "verified_local_record",
+ "current_official_source",
+ "local_policy",
+ }
+ ),
+ "statement_as_supplied": _text(minimum=1, maximum=4_000),
+ "source": _object(
+ {
+ "source_type": _text(
+ enum={
+ "signed_clinician_record",
+ "authorized_ehr_record",
+ "current_fda_labeling",
+ "current_rems_material",
+ "current_official_guidance",
+ "local_policy",
+ }
+ ),
+ "title": _text(minimum=1, maximum=500),
+ "locator": _text(minimum=1, maximum=1_000),
+ "version_or_date": _text(minimum=1, maximum=200),
+ }
+ ),
+ "verification": VERIFICATION,
+ "applicability": _object(
+ {
+ "status": _text(
+ enum={
+ "not_assessed",
+ "confirmed_by_authorized_clinician",
+ "not_applicable_local_record",
+ }
+ ),
+ "confirmed_by_role": ROLE,
+ "confirmed_at": _nullable(DATETIME),
+ }
+ ),
+ }
+)
+
+PARAMETER_SCHEMA = _object(
+ {
+ "parameter_id": IDENTIFIER,
+ "label": _text(minimum=1, maximum=200),
+ "value_as_supplied": _text(minimum=1, maximum=1_000),
+ "source_fact_ids": FACT_IDS,
+ }
+)
+
+INTERVENTION_SCHEMA = _object(
+ {
+ "intervention_id": IDENTIFIER,
+ "intervention_kind": _text(
+ enum={
+ "medication",
+ "procedure",
+ "therapy",
+ "diagnostic",
+ "education",
+ "care_coordination",
+ "equipment_or_service",
+ "other_clinician_authored",
+ }
+ ),
+ "clinical_decision_status": _text(
+ enum={
+ "pending_authorized_verification",
+ "supplied_and_verified_by_authorized_clinician",
+ }
+ ),
+ "clinician_authored_action": _text(minimum=1, maximum=4_000),
+ "parameters_as_supplied": _array(PARAMETER_SCHEMA, maximum=100),
+ "source_fact_ids": FACT_IDS,
+ "owner_role": NONEMPTY_ROLE,
+ "start_date": _nullable(DATE),
+ "end_date": _nullable(DATE),
+ "verification": VERIFICATION,
+ }
+)
+
+GOAL_SCHEMA = _object(
+ {
+ "goal_id": IDENTIFIER,
+ "statement_as_supplied": _text(minimum=1, maximum=2_000),
+ "measurement_as_supplied": _text(maximum=1_000),
+ "target_as_supplied": _text(maximum=1_000),
+ "target_date": _nullable(DATE),
+ "source_fact_ids": FACT_IDS,
+ "verified_by_role": NONEMPTY_ROLE,
+ }
+)
+
+MONITORING_SCHEMA = _object(
+ {
+ "monitoring_id": IDENTIFIER,
+ "item_as_supplied": _text(minimum=1, maximum=2_000),
+ "method_as_supplied": _text(maximum=1_000),
+ "frequency_as_supplied": _text(maximum=1_000),
+ "next_due_date": _nullable(DATE),
+ "owner_role": NONEMPTY_ROLE,
+ "source_fact_ids": FACT_IDS,
+ }
+)
+
+CHECKPOINT_SCHEMA = _object(
+ {
+ "checkpoint_id": IDENTIFIER,
+ "checkpoint_date": DATE,
+ "purpose_as_supplied": _text(minimum=1, maximum=2_000),
+ "owner_role": NONEMPTY_ROLE,
+ "linked_goal_ids": _array(IDENTIFIER, maximum=100),
+ "linked_intervention_ids": _array(IDENTIFIER, maximum=100),
+ "source_fact_ids": FACT_IDS,
+ }
+)
+
+OPTION_SCHEMA = _object(
+ {
+ "option_id": IDENTIFIER,
+ "option_as_documented": _text(minimum=1, maximum=2_000),
+ "source_fact_ids": FACT_IDS,
+ }
+)
+
+SHARED_DECISION_SCHEMA = _object(
+ {
+ "decision_id": IDENTIFIER,
+ "decision_topic_as_documented": _text(minimum=1, maximum=2_000),
+ "options_as_documented": _array(OPTION_SCHEMA, minimum=1, maximum=50),
+ "benefits_harms_uncertainty_documented": _boolean(),
+ "preference_as_documented": _text(maximum=2_000),
+ "outcome_as_documented": _text(maximum=2_000),
+ "outcome_source_fact_ids": FACT_IDS,
+ "decision_status": _text(
+ enum={
+ "pending_clinician_documentation",
+ "documented_by_authorized_clinician",
+ }
+ ),
+ "participant_roles": _array(
+ _text(minimum=1, maximum=200), minimum=1, maximum=20
+ ),
+ "documented_by_role": ROLE,
+ "documented_at": _nullable(DATETIME),
+ "acknowledgment_status": _text(
+ enum={
+ "pending",
+ "acknowledged",
+ "not_applicable_by_authorized_clinician",
+ }
+ ),
+ }
+)
+
+HANDOFF_ITEM_SCHEMA = _object(
+ {
+ "item_id": IDENTIFIER,
+ "category": _text(
+ enum={
+ "medications",
+ "interventions",
+ "goals",
+ "monitoring",
+ "pending_results",
+ "appointments",
+ "equipment_or_services",
+ "preferences_or_access_needs",
+ "local_process_reference",
+ "other_clinician_supplied",
+ }
+ ),
+ "summary_as_supplied": _text(minimum=1, maximum=2_000),
+ "source_fact_ids": FACT_IDS,
+ "owner_role": NONEMPTY_ROLE,
+ "recipient_role": NONEMPTY_ROLE,
+ "acknowledgment_status": _text(
+ enum={
+ "pending",
+ "acknowledged",
+ "not_applicable_by_authorized_role",
+ }
+ ),
+ }
+)
+
+UNRESOLVED_ITEM_SCHEMA = _object(
+ {
+ "item_id": IDENTIFIER,
+ "issue_as_documented": _text(minimum=1, maximum=2_000),
+ "source_fact_ids": FACT_IDS,
+ "routed_to_local_role": ROLE,
+ "status": _text(
+ enum={
+ "open_unrouted",
+ "open_routed",
+ "acknowledged_by_owner",
+ "resolved_by_authorized_professional",
+ }
+ ),
+ }
+)
+
+DOCUMENT_SCHEMAS = {
+ "source_fact_manifest": _object(
+ {
+ **HEADER,
+ "document_type": _text(const="source_fact_manifest"),
+ "facts": _array(SOURCE_FACT_SCHEMA, maximum=500),
+ }
+ ),
+ "clinician_authored_intervention_record": _object(
+ {
+ **HEADER,
+ "document_type": _text(
+ const="clinician_authored_intervention_record"
+ ),
+ "interventions": _array(INTERVENTION_SCHEMA, maximum=200),
+ }
+ ),
+ "goals_monitoring_checkpoint_record": _object(
+ {
+ **HEADER,
+ "document_type": _text(
+ const="goals_monitoring_checkpoint_record"
+ ),
+ "goals": _array(GOAL_SCHEMA, maximum=200),
+ "monitoring_items": _array(MONITORING_SCHEMA, maximum=300),
+ "checkpoints": _array(CHECKPOINT_SCHEMA, maximum=500),
+ }
+ ),
+ "informed_preference_shared_decision_record": _object(
+ {
+ **HEADER,
+ "document_type": _text(
+ const="informed_preference_shared_decision_record"
+ ),
+ "entries": _array(SHARED_DECISION_SCHEMA, maximum=100),
+ }
+ ),
+ "transition_reconciliation_record": _object(
+ {
+ **HEADER,
+ "document_type": _text(const="transition_reconciliation_record"),
+ "transition": _object(
+ {
+ "from_setting_as_documented": _text(maximum=500),
+ "to_setting_as_documented": _text(maximum=500),
+ "handoff_date": _nullable(DATE),
+ "responsible_sender_role": ROLE,
+ "responsible_receiver_role": ROLE,
+ }
+ ),
+ "medication_reconciliation": _object(
+ {
+ "status": _text(
+ enum={
+ "pending_authorized_review",
+ "completed_by_authorized_clinician",
+ "not_applicable_by_authorized_clinician",
+ }
+ ),
+ "source_list_fact_ids": _array(
+ IDENTIFIER, maximum=200
+ ),
+ "destination_list_fact_ids": _array(
+ IDENTIFIER, maximum=200
+ ),
+ "discrepancy_status": _text(
+ enum={
+ "not_assessed",
+ "none_documented",
+ "routed_to_authorized_clinician",
+ "resolved_by_authorized_clinician",
+ }
+ ),
+ "completed_by_role": ROLE,
+ "completed_at": _nullable(DATETIME),
+ }
+ ),
+ "handoff_items": _array(HANDOFF_ITEM_SCHEMA, maximum=300),
+ "unresolved_items": _array(
+ UNRESOLVED_ITEM_SCHEMA, maximum=200
+ ),
+ }
+ ),
+ "intended_use_handoff_record": _object(
+ {
+ **HEADER,
+ "document_type": _text(const="intended_use_handoff_record"),
+ "intended_use": _object(
+ {
+ "purpose": _text(
+ const=(
+ "format_and_validate_clinician_supplied_plan_"
+ "documentation"
+ )
+ ),
+ "intended_users": _array(
+ _text(minimum=1, maximum=200), maximum=50
+ ),
+ "intended_setting": _text(maximum=500),
+ "output_role": _text(const="documentation_only"),
+ "prohibited_uses": _array(
+ _text(enum=PROHIBITED_USES),
+ minimum=len(PROHIBITED_USES),
+ maximum=len(PROHIBITED_USES),
+ ),
+ }
+ ),
+ "privacy_process": _object(
+ {
+ "data_classification": _text(
+ enum={
+ "synthetic",
+ "deidentified_qualified_review",
+ "real_patient_minimum_necessary",
+ }
+ ),
+ "local_authorization_confirmed": _boolean(),
+ "authorized_environment_reference": _text(
+ maximum=1_000
+ ),
+ "minimum_necessary_confirmed": _boolean(),
+ "no_external_tools_confirmed": _boolean(),
+ "no_prompt_log_example_copy_confirmed": _boolean(),
+ "privacy_review_status": _text(
+ enum={
+ "pending",
+ "not_applicable_synthetic",
+ "completed_by_qualified_reviewer",
+ }
+ ),
+ "privacy_reviewer_role": ROLE,
+ "reviewed_at": _nullable(DATETIME),
+ "retention_policy_reference": _text(maximum=1_000),
+ "data_disposition_status": _text(
+ enum={
+ "pending",
+ "retain_under_local_policy",
+ "delete_under_local_policy",
+ "completed_under_local_policy",
+ }
+ ),
+ }
+ ),
+ "local_governance": _object(
+ {
+ "institution_or_organization_reference": _text(
+ maximum=1_000
+ ),
+ "clinical_owner_role": ROLE,
+ "policy_references": _array(
+ _text(minimum=1, maximum=1_000), maximum=100
+ ),
+ "records_owner_role": ROLE,
+ "change_control_owner_role": ROLE,
+ }
+ ),
+ "emergency_routing": _object(
+ {
+ "statement": _text(const=EMERGENCY_STATEMENT),
+ "local_process_reference": _text(maximum=1_000),
+ "verified_by_role": ROLE,
+ }
+ ),
+ "reporting_routes": _object(
+ {
+ "local_patient_safety_route": _text(maximum=1_000),
+ "product_event_route": _text(maximum=1_000),
+ "privacy_incident_route": _text(maximum=1_000),
+ "responsible_role": ROLE,
+ }
+ ),
+ "handoff": _object(
+ {
+ "sender_role": ROLE,
+ "recipient_role": ROLE,
+ "sent_at": _nullable(DATETIME),
+ "acknowledgment_status": _text(
+ enum={"pending", "acknowledged"}
+ ),
+ "unresolved_items_routed": _boolean(),
+ }
+ ),
+ "clinician_signoff": _object(
+ {
+ "status": _text(enum={"pending", "signed"}),
+ "signer_role": ROLE,
+ "credential_authority_reference": _text(
+ maximum=1_000
+ ),
+ "signed_at": _nullable(DATETIME),
+ "attestation": _text(const=SIGNOFF_ATTESTATION),
+ }
+ ),
+ "release_gate": _object(
+ {
+ "status": _text(
+ enum={
+ "blocked",
+ "released_for_authorized_documentation_handoff",
+ }
+ ),
+ "released_by_role": ROLE,
+ "released_at": _nullable(DATETIME),
+ "blocker_codes": _array(
+ _text(
+ minimum=3,
+ maximum=96,
+ pattern=BLOCKER_RE.pattern,
+ ),
+ maximum=100,
+ ),
+ }
+ ),
+ }
+ ),
+}
+
+
+def _reject_nonlocal_path(raw_path: str | Path) -> Path:
+ text = str(raw_path)
+ lowered = text.strip().lower()
+ if not lowered or "\x00" in text or "://" in lowered:
+ raise ValidationError("NONLOCAL_OR_EMPTY_PATH")
+ if lowered.startswith("\\\\"):
+ raise ValidationError("NETWORK_SHARE_PATH_REJECTED")
+ return Path(text).expanduser()
+
+
+def safe_input_file(raw_path: str | Path) -> Path:
+ """Resolve one bounded, regular, non-symlink local JSON file."""
+
+ path = _reject_nonlocal_path(raw_path)
+ if path.is_symlink():
+ raise ValidationError("SYMLINK_INPUT_REJECTED")
+ try:
+ resolved = path.resolve(strict=True)
+ except FileNotFoundError as exc:
+ raise ValidationError("INPUT_FILE_MISSING", path.name) from exc
+ if not resolved.is_file() or resolved.suffix.lower() != ".json":
+ raise ValidationError("INPUT_MUST_BE_JSON_FILE", path.name)
+ if resolved.stat().st_size > MAX_INPUT_BYTES:
+ raise ValidationError("INPUT_FILE_TOO_LARGE", path.name)
+ return resolved
+
+
+def safe_input_directory(raw_path: str | Path) -> Path:
+ """Resolve one local, non-symlink directory."""
+
+ path = _reject_nonlocal_path(raw_path)
+ if path.is_symlink():
+ raise ValidationError("SYMLINK_DIRECTORY_REJECTED")
+ try:
+ resolved = path.resolve(strict=True)
+ except FileNotFoundError as exc:
+ raise ValidationError("INPUT_DIRECTORY_MISSING") from exc
+ if not resolved.is_dir():
+ raise ValidationError("INPUT_MUST_BE_DIRECTORY")
+ return resolved
+
+
+def safe_new_directory(raw_path: str | Path) -> Path:
+ """Create a private directory without reusing an existing path."""
+
+ path = _reject_nonlocal_path(raw_path)
+ if path.exists() or path.is_symlink():
+ raise ValidationError("OUTPUT_DIRECTORY_EXISTS")
+ try:
+ parent = path.parent.resolve(strict=True)
+ except FileNotFoundError as exc:
+ raise ValidationError("OUTPUT_PARENT_MISSING") from exc
+ if not parent.is_dir():
+ raise ValidationError("OUTPUT_PARENT_NOT_DIRECTORY")
+ resolved = parent / path.name
+ resolved.mkdir(mode=0o700)
+ return resolved
+
+
+def safe_output_file(raw_path: str | Path) -> Path:
+ """Resolve a new local JSON output without implicit overwrite."""
+
+ path = _reject_nonlocal_path(raw_path)
+ if path.suffix.lower() != ".json":
+ raise ValidationError("OUTPUT_MUST_BE_JSON")
+ try:
+ parent = path.parent.resolve(strict=True)
+ except FileNotFoundError as exc:
+ raise ValidationError("OUTPUT_PARENT_MISSING") from exc
+ if not parent.is_dir():
+ raise ValidationError("OUTPUT_PARENT_NOT_DIRECTORY")
+ resolved = parent / path.name
+ if resolved.exists() or resolved.is_symlink():
+ raise ValidationError("OUTPUT_ALREADY_EXISTS", resolved.name)
+ return resolved
+
+
+def _duplicate_safe_object(
+ pairs: list[tuple[str, Any]],
+) -> dict[str, Any]:
+ result: dict[str, Any] = {}
+ for key, value in pairs:
+ if key in result:
+ raise ValidationError("JSON_DUPLICATE_KEY")
+ result[key] = value
+ return result
+
+
+def _reject_constant(_: str) -> None:
+ raise ValidationError("JSON_NONFINITE_NUMBER")
+
+
+def _check_bounds(value: Any, *, depth: int = 0, counter: list[int]) -> None:
+ if depth > MAX_DEPTH:
+ raise ValidationError("JSON_MAX_DEPTH_EXCEEDED")
+ counter[0] += 1
+ if counter[0] > MAX_TOTAL_NODES:
+ raise ValidationError("JSON_NODE_LIMIT_EXCEEDED")
+ if isinstance(value, dict):
+ if len(value) > MAX_OBJECT_FIELDS:
+ raise ValidationError("JSON_OBJECT_FIELD_LIMIT_EXCEEDED")
+ for key, nested in value.items():
+ if not isinstance(key, str) or len(key) > 128:
+ raise ValidationError("JSON_KEY_INVALID")
+ _check_bounds(nested, depth=depth + 1, counter=counter)
+ elif isinstance(value, list):
+ if len(value) > MAX_LIST_ITEMS:
+ raise ValidationError("JSON_LIST_LIMIT_EXCEEDED")
+ for nested in value:
+ _check_bounds(nested, depth=depth + 1, counter=counter)
+ elif isinstance(value, str):
+ if len(value) > MAX_TEXT_CHARS:
+ raise ValidationError("JSON_TEXT_LIMIT_EXCEEDED")
+
+
+def read_json(raw_path: str | Path) -> dict[str, Any]:
+ """Read strict UTF-8 JSON without exposing values in failures."""
+
+ path = safe_input_file(raw_path)
+ try:
+ text = path.read_text(encoding="utf-8")
+ except UnicodeDecodeError as exc:
+ raise ValidationError("JSON_NOT_UTF8", path.name) from exc
+ if "\x00" in text:
+ raise ValidationError("JSON_CONTAINS_NUL", path.name)
+ try:
+ value = json.loads(
+ text,
+ object_pairs_hook=_duplicate_safe_object,
+ parse_constant=_reject_constant,
+ )
+ except json.JSONDecodeError as exc:
+ raise ValidationError(
+ "JSON_PARSE_ERROR", f"{path.name}:{exc.lineno}:{exc.colno}"
+ ) from exc
+ if not isinstance(value, dict):
+ raise ValidationError("JSON_ROOT_NOT_OBJECT", path.name)
+ _check_bounds(value, counter=[0])
+ return value
+
+
+def load_package(
+ raw_directory: str | Path,
+) -> tuple[dict[str, dict[str, Any]], dict[str, Path]]:
+ """Load the six required package records by fixed local filename."""
+
+ root = safe_input_directory(raw_directory)
+ documents: dict[str, dict[str, Any]] = {}
+ paths: dict[str, Path] = {}
+ for expected_type, (_, filename) in TEMPLATE_FILES.items():
+ path = root / filename
+ if not path.exists():
+ raise ValidationError("PACKAGE_FILE_MISSING", filename)
+ document = read_json(path)
+ documents[expected_type] = document
+ paths[expected_type] = path
+ return documents, paths
+
+
+def load_target(
+ raw_path: str | Path, *, require_package: bool = False
+) -> tuple[dict[str, dict[str, Any]], dict[str, Path]]:
+ """Load one record or a complete package."""
+
+ path = _reject_nonlocal_path(raw_path)
+ if path.is_dir() and not path.is_symlink():
+ return load_package(path)
+ if require_package:
+ raise ValidationError("PACKAGE_DIRECTORY_REQUIRED")
+ document = read_json(path)
+ document_type = document.get("document_type")
+ if not isinstance(document_type, str):
+ raise ValidationError("DOCUMENT_TYPE_MISSING")
+ return {document_type: document}, {document_type: safe_input_file(path)}
+
+
+def _valid_iso_date(value: str) -> bool:
+ try:
+ return date.fromisoformat(value).isoformat() == value
+ except ValueError:
+ return False
+
+
+def parse_iso_datetime(value: str) -> datetime | None:
+ """Parse a timezone-aware ISO datetime, accepting a trailing Z."""
+
+ try:
+ parsed = datetime.fromisoformat(value.replace("Z", "+00:00"))
+ except ValueError:
+ return None
+ return parsed if parsed.tzinfo is not None else None
+
+
+def _validate_schema(
+ value: Any,
+ schema: dict[str, Any],
+ path: str,
+ issues: list[Issue],
+) -> None:
+ kind = schema["kind"]
+ if kind == "nullable":
+ if value is None:
+ return
+ _validate_schema(value, schema["schema"], path, issues)
+ return
+ if kind == "object":
+ if not isinstance(value, dict):
+ issues.append(Issue("SCHEMA_TYPE_OBJECT", path))
+ return
+ properties = schema["properties"]
+ for key in sorted(set(properties) - set(value)):
+ issues.append(Issue("SCHEMA_REQUIRED_FIELD", f"{path}.{key}"))
+ for key in sorted(set(value) - set(properties)):
+ issues.append(Issue("SCHEMA_UNKNOWN_FIELD", f"{path}.{key}"))
+ for key in properties.keys() & value.keys():
+ _validate_schema(
+ value[key], properties[key], f"{path}.{key}", issues
+ )
+ return
+ if kind == "array":
+ if not isinstance(value, list):
+ issues.append(Issue("SCHEMA_TYPE_ARRAY", path))
+ return
+ if not schema["minimum"] <= len(value) <= schema["maximum"]:
+ issues.append(Issue("SCHEMA_ARRAY_BOUNDS", path))
+ for index, nested in enumerate(value):
+ _validate_schema(
+ nested, schema["item"], f"{path}[{index}]", issues
+ )
+ return
+ if kind == "boolean":
+ if type(value) is not bool:
+ issues.append(Issue("SCHEMA_TYPE_BOOLEAN", path))
+ return
+ if kind == "string":
+ if not isinstance(value, str):
+ issues.append(Issue("SCHEMA_TYPE_STRING", path))
+ return
+ if not schema["minimum"] <= len(value) <= schema["maximum"]:
+ issues.append(Issue("SCHEMA_STRING_BOUNDS", path))
+ if schema["const"] is not None and value != schema["const"]:
+ issues.append(Issue("SCHEMA_CONST", path))
+ if schema["enum"] is not None and value not in schema["enum"]:
+ issues.append(Issue("SCHEMA_ENUM", path))
+ if schema["pattern"] is not None and not schema["pattern"].fullmatch(
+ value
+ ):
+ issues.append(Issue("SCHEMA_PATTERN", path))
+ if schema["format"] == "date" and not _valid_iso_date(value):
+ issues.append(Issue("SCHEMA_ISO_DATE", path))
+ if schema["format"] == "datetime" and parse_iso_datetime(value) is None:
+ issues.append(Issue("SCHEMA_ISO_DATETIME", path))
+ return
+ issues.append(Issue("SCHEMA_INTERNAL_KIND", path))
+
+
+def _duplicate_field_issues(
+ records: Any, field: str, path: str
+) -> list[Issue]:
+ if not isinstance(records, list):
+ return []
+ seen: set[str] = set()
+ issues: list[Issue] = []
+ for index, record in enumerate(records):
+ if not isinstance(record, dict):
+ continue
+ value = record.get(field)
+ if isinstance(value, str):
+ if value in seen:
+ issues.append(
+ Issue("DUPLICATE_RECORD_ID", f"{path}[{index}].{field}")
+ )
+ seen.add(value)
+ return issues
+
+
+def validate_document(
+ document: dict[str, Any], expected_type: str | None = None
+) -> list[Issue]:
+ """Validate strict structure without evaluating clinical content."""
+
+ document_type = document.get("document_type")
+ if not isinstance(document_type, str):
+ return [Issue("DOCUMENT_TYPE_MISSING", "$.document_type")]
+ if expected_type is not None and document_type != expected_type:
+ return [Issue("DOCUMENT_TYPE_FILENAME_MISMATCH", "$.document_type")]
+ schema = DOCUMENT_SCHEMAS.get(document_type)
+ if schema is None:
+ return [Issue("DOCUMENT_TYPE_UNKNOWN", "$.document_type")]
+ issues: list[Issue] = []
+ _validate_schema(document, schema, "$", issues)
+
+ if document_type == "source_fact_manifest":
+ issues.extend(
+ _duplicate_field_issues(document.get("facts"), "fact_id", "$.facts")
+ )
+ elif document_type == "clinician_authored_intervention_record":
+ interventions = document.get("interventions")
+ issues.extend(
+ _duplicate_field_issues(
+ interventions, "intervention_id", "$.interventions"
+ )
+ )
+ if isinstance(interventions, list):
+ for index, record in enumerate(interventions):
+ if isinstance(record, dict):
+ issues.extend(
+ _duplicate_field_issues(
+ record.get("parameters_as_supplied"),
+ "parameter_id",
+ f"$.interventions[{index}].parameters_as_supplied",
+ )
+ )
+ elif document_type == "goals_monitoring_checkpoint_record":
+ for field, identifier_field in (
+ ("goals", "goal_id"),
+ ("monitoring_items", "monitoring_id"),
+ ("checkpoints", "checkpoint_id"),
+ ):
+ issues.extend(
+ _duplicate_field_issues(
+ document.get(field), identifier_field, f"$.{field}"
+ )
+ )
+ elif document_type == "informed_preference_shared_decision_record":
+ entries = document.get("entries")
+ issues.extend(
+ _duplicate_field_issues(entries, "decision_id", "$.entries")
+ )
+ if isinstance(entries, list):
+ for index, record in enumerate(entries):
+ if isinstance(record, dict):
+ issues.extend(
+ _duplicate_field_issues(
+ record.get("options_as_documented"),
+ "option_id",
+ f"$.entries[{index}].options_as_documented",
+ )
+ )
+ elif document_type == "transition_reconciliation_record":
+ for field in ("handoff_items", "unresolved_items"):
+ issues.extend(
+ _duplicate_field_issues(
+ document.get(field), "item_id", f"$.{field}"
+ )
+ )
+ elif document_type == "intended_use_handoff_record":
+ intended = document.get("intended_use")
+ if isinstance(intended, dict):
+ uses = intended.get("prohibited_uses")
+ if isinstance(uses, list) and set(uses) != PROHIBITED_USES:
+ issues.append(
+ Issue(
+ "PROHIBITED_USE_SET_CHANGED",
+ "$.intended_use.prohibited_uses",
+ )
+ )
+ return sorted(issues, key=lambda item: (item.path, item.code))
+
+
+def validate_package_structure(
+ documents: dict[str, dict[str, Any]]
+) -> list[Issue]:
+ """Validate all package documents and prefix paths with document types."""
+
+ issues: list[Issue] = []
+ for expected_type in TEMPLATE_FILES:
+ document = documents.get(expected_type)
+ if document is None:
+ issues.append(Issue("PACKAGE_DOCUMENT_MISSING", expected_type))
+ continue
+ for issue in validate_document(document, expected_type):
+ issues.append(
+ Issue(
+ issue.code,
+ f"{expected_type}:{issue.path}",
+ issue.level,
+ )
+ )
+ return sorted(issues, key=lambda item: (item.path, item.code))
+
+
+def has_errors(issues: Iterable[Issue]) -> bool:
+ return any(issue.level == "error" for issue in issues)
+
+
+def report_payload(
+ check: str,
+ issues: Iterable[Issue],
+ *,
+ counts: dict[str, int] | None = None,
+ extra: dict[str, Any] | None = None,
+) -> dict[str, Any]:
+ issue_list = list(issues)
+ payload: dict[str, Any] = {
+ "check": check,
+ "status": "fail" if has_errors(issue_list) else "pass",
+ "issues": [item.as_dict() for item in issue_list],
+ "counts": counts or {},
+ "notice": NOTICE,
+ "determinations_not_made": [
+ "clinical_correctness",
+ "clinical_safety",
+ "diagnosis",
+ "therapy_or_medication_selection",
+ "dose_or_schedule",
+ "interaction_or_contraindication",
+ "triage_or_emergency_status",
+ "prognosis",
+ "privacy_or_legal_compliance",
+ ],
+ }
+ if extra:
+ payload.update(extra)
+ return payload
+
+
+def error_report(check: str, error: ValidationError) -> dict[str, Any]:
+ return report_payload(check, [Issue(error.code, error.path)])
+
+
+def print_report(report: dict[str, Any]) -> None:
+ print(json.dumps(report, indent=2, sort_keys=True, ensure_ascii=False))
+
+
+def atomic_write_json(destination: Path, payload: dict[str, Any]) -> Path:
+ """Write private JSON atomically without implicit overwrite."""
+
+ if destination.exists() or destination.is_symlink():
+ raise ValidationError("OUTPUT_ALREADY_EXISTS", destination.name)
+ temporary_name: str | None = None
+ try:
+ with tempfile.NamedTemporaryFile(
+ "w",
+ encoding="utf-8",
+ dir=destination.parent,
+ prefix=f".{destination.name}.",
+ suffix=".tmp",
+ delete=False,
+ ) as handle:
+ temporary_name = handle.name
+ json.dump(
+ payload,
+ handle,
+ indent=2,
+ sort_keys=True,
+ ensure_ascii=False,
+ )
+ handle.write("\n")
+ handle.flush()
+ os.fsync(handle.fileno())
+ os.chmod(temporary_name, 0o600)
+ os.replace(temporary_name, destination)
+ return destination
+ except OSError as exc:
+ if temporary_name:
+ try:
+ Path(temporary_name).unlink(missing_ok=True)
+ except OSError:
+ pass
+ raise ValidationError("OUTPUT_WRITE_FAILED", destination.name) from exc
+
+
+def copy_template_document(
+ template_path: Path,
+ *,
+ subject_ref: str,
+ classification: str,
+) -> dict[str, Any]:
+ document = read_json(template_path)
+ document["subject_ref"] = subject_ref
+ document["data_classification"] = classification
+ if document.get("document_type") == "intended_use_handoff_record":
+ privacy = document.get("privacy_process")
+ if isinstance(privacy, dict):
+ privacy["data_classification"] = classification
+ return document
+
+
+def direct_identifier_key_paths(
+ value: Any, path: str = "$"
+) -> list[str]:
+ """Return paths for obvious direct-identifier field names, not values."""
+
+ matches: list[str] = []
+ if isinstance(value, dict):
+ for key, nested in value.items():
+ normalized = str(key).strip().lower()
+ nested_path = f"{path}.{key}"
+ if normalized in DIRECT_IDENTIFIER_KEYS:
+ matches.append(nested_path)
+ matches.extend(direct_identifier_key_paths(nested, nested_path))
+ elif isinstance(value, list):
+ for index, nested in enumerate(value):
+ matches.extend(
+ direct_identifier_key_paths(nested, f"{path}[{index}]")
+ )
+ return matches
+
+
+def all_fact_references(
+ documents: dict[str, dict[str, Any]]
+) -> list[tuple[str, str]]:
+ """Collect every source-fact reference with a nonclinical field path."""
+
+ references: list[tuple[str, str]] = []
+
+ def collect(value: Any, path: str) -> None:
+ if isinstance(value, dict):
+ for key, nested in value.items():
+ nested_path = f"{path}.{key}"
+ if key.endswith("fact_ids") and isinstance(nested, list):
+ for index, identifier in enumerate(nested):
+ if isinstance(identifier, str):
+ references.append(
+ (f"{nested_path}[{index}]", identifier)
+ )
+ else:
+ collect(nested, nested_path)
+ elif isinstance(value, list):
+ for index, nested in enumerate(value):
+ collect(nested, f"{path}[{index}]")
+
+ for document_type, document in documents.items():
+ if document_type != "source_fact_manifest":
+ collect(document, document_type)
+ return references
+
+
+def record_ids(
+ document: dict[str, Any],
+ list_field: str,
+ id_field: str,
+) -> set[str]:
+ records = document.get(list_field)
+ if not isinstance(records, list):
+ return set()
+ return {
+ record[id_field]
+ for record in records
+ if isinstance(record, dict) and isinstance(record.get(id_field), str)
+ }
diff --git a/skills/treatment-plans/scripts/check_completeness.py b/skills/treatment-plans/scripts/check_completeness.py
index 05852786..e57bcc2d 100644
--- a/skills/treatment-plans/scripts/check_completeness.py
+++ b/skills/treatment-plans/scripts/check_completeness.py
@@ -1,318 +1,572 @@
#!/usr/bin/env python3
-"""
-Check Treatment Plan Completeness
-Validates that all required sections are present in a treatment plan.
-"""
+"""Check documentation gates without assessing clinical adequacy."""
+
+from __future__ import annotations
-import sys
-import re
import argparse
-from pathlib import Path
-from typing import List, Tuple
-
-# Required sections for all treatment plans
-REQUIRED_SECTIONS = [
- r'\\section\*\{.*Patient Information',
- r'\\section\*\{.*Diagnosis.*Assessment',
- r'\\section\*\{.*Goals',
- r'\\section\*\{.*Interventions',
- r'\\section\*\{.*Timeline.*Schedule',
- r'\\section\*\{.*Monitoring',
- r'\\section\*\{.*Outcomes',
- r'\\section\*\{.*Follow[- ]?up',
- r'\\section\*\{.*Education',
- r'\\section\*\{.*Risk.*Safety',
-]
-
-# Section descriptions for user-friendly output
-SECTION_DESCRIPTIONS = {
- 0: 'Patient Information (de-identified)',
- 1: 'Diagnosis and Assessment',
- 2: 'Treatment Goals (SMART format)',
- 3: 'Interventions (pharmacological, non-pharmacological, procedural)',
- 4: 'Timeline and Schedule',
- 5: 'Monitoring Parameters',
- 6: 'Expected Outcomes',
- 7: 'Follow-up Plan',
- 8: 'Patient Education',
- 9: 'Risk Mitigation and Safety'
-}
-
-
-def read_file(filepath: Path) -> str:
- """Read and return file contents."""
- try:
- with open(filepath, 'r', encoding='utf-8') as f:
- return f.read()
- except FileNotFoundError:
- print(f"Error: File not found: {filepath}", file=sys.stderr)
- sys.exit(1)
- except Exception as e:
- print(f"Error reading file: {e}", file=sys.stderr)
- sys.exit(1)
-
-
-def check_sections(content: str) -> Tuple[List[bool], List[str]]:
- """
- Check which required sections are present.
- Returns tuple of (checklist, missing_sections).
- """
- checklist = []
- missing = []
-
- for i, pattern in enumerate(REQUIRED_SECTIONS):
- if re.search(pattern, content, re.IGNORECASE):
- checklist.append(True)
- else:
- checklist.append(False)
- missing.append(SECTION_DESCRIPTIONS[i])
-
- return checklist, missing
-
-
-def check_smart_goals(content: str) -> Tuple[bool, List[str]]:
- """
- Check if SMART goal criteria are mentioned.
- Returns (has_smart, missing_criteria).
- """
- smart_criteria = {
- 'Specific': r'\bspecific\b',
- 'Measurable': r'\bmeasurable\b',
- 'Achievable': r'\bachievable\b',
- 'Relevant': r'\brelevant\b',
- 'Time-bound': r'\btime[- ]?bound\b'
- }
-
- missing = []
- for criterion, pattern in smart_criteria.items():
- if not re.search(pattern, content, re.IGNORECASE):
- missing.append(criterion)
-
- has_smart = len(missing) == 0
- return has_smart, missing
-
-
-def check_hipaa_notice(content: str) -> bool:
- """Check if HIPAA de-identification notice is present."""
- pattern = r'HIPAA|de-identif|protected health information|PHI'
- return bool(re.search(pattern, content, re.IGNORECASE))
-
-
-def check_provider_signature(content: str) -> bool:
- """Check if provider signature section is present."""
- pattern = r'\\section\*\{.*Signature|Provider Signature|Signature'
- return bool(re.search(pattern, content, re.IGNORECASE))
-
-
-def check_placeholders_remaining(content: str) -> Tuple[int, List[str]]:
- """
- Check for uncustomized placeholders [like this].
- Returns (count, sample_placeholders).
- """
- placeholders = re.findall(r'\[([^\]]+)\]', content)
-
- # Filter out LaTeX commands and references
- filtered = []
- for p in placeholders:
- # Skip if it's a LaTeX command, number, or citation
- if not (p.startswith('\\') or p.isdigit() or 'cite' in p.lower() or 'ref' in p.lower()):
- filtered.append(p)
-
- count = len(filtered)
- samples = filtered[:5] # Return up to 5 examples
-
- return count, samples
-
-
-def display_results(filepath: Path, checklist: List[bool], missing: List[str],
- smart_complete: bool, smart_missing: List[str],
- has_hipaa: bool, has_signature: bool,
- placeholder_count: int, placeholder_samples: List[str]):
- """Display completeness check results."""
-
- total_sections = len(REQUIRED_SECTIONS)
- present_count = sum(checklist)
- completeness_pct = (present_count / total_sections) * 100
-
- print("\n" + "="*70)
- print("TREATMENT PLAN COMPLETENESS CHECK")
- print("="*70)
- print(f"\nFile: {filepath}")
- print(f"File size: {filepath.stat().st_size:,} bytes")
-
- # Overall completeness
- print("\n" + "-"*70)
- print("OVERALL COMPLETENESS")
- print("-"*70)
- print(f"Required sections present: {present_count}/{total_sections} ({completeness_pct:.0f}%)")
-
- if completeness_pct == 100:
- print("✓ All required sections present")
- else:
- print(f"✗ {len(missing)} section(s) missing")
-
- # Section details
- print("\n" + "-"*70)
- print("SECTION CHECKLIST")
- print("-"*70)
-
- for i, (present, desc) in enumerate(zip(checklist, SECTION_DESCRIPTIONS.values())):
- status = "✓" if present else "✗"
- print(f"{status} {desc}")
-
- # Missing sections
- if missing:
- print("\n" + "-"*70)
- print("MISSING SECTIONS")
- print("-"*70)
- for section in missing:
- print(f" • {section}")
-
- # SMART goals
- print("\n" + "-"*70)
- print("SMART GOALS CHECK")
- print("-"*70)
-
- if smart_complete:
- print("✓ All SMART criteria mentioned in document")
- else:
- print(f"✗ {len(smart_missing)} SMART criterion/criteria not found:")
- for criterion in smart_missing:
- print(f" • {criterion}")
- print("\nNote: Goals should be Specific, Measurable, Achievable, Relevant, Time-bound")
-
- # HIPAA notice
- print("\n" + "-"*70)
- print("PRIVACY AND COMPLIANCE")
- print("-"*70)
-
- if has_hipaa:
- print("✓ HIPAA/de-identification notice present")
- else:
- print("✗ HIPAA de-identification notice not found")
- print(" Recommendation: Include HIPAA Safe Harbor de-identification guidance")
-
- if has_signature:
- print("✓ Provider signature section present")
- else:
- print("✗ Provider signature section not found")
-
- # Placeholders
- print("\n" + "-"*70)
- print("CUSTOMIZATION STATUS")
- print("-"*70)
-
- if placeholder_count == 0:
- print("✓ No uncustomized placeholders detected")
- else:
- print(f"⚠ {placeholder_count} placeholder(s) may need customization")
- print("\nExamples:")
- for sample in placeholder_samples:
- print(f" • [{sample}]")
- print("\nRecommendation: Replace all [bracketed placeholders] with patient-specific information")
-
- # Summary
- print("\n" + "="*70)
- print("SUMMARY")
- print("="*70)
-
- # Calculate overall score
- score_components = [
- completeness_pct / 100, # Section completeness (0-1)
- 1.0 if smart_complete else 0.6, # SMART goals (full or partial credit)
- 1.0 if has_hipaa else 0.0, # HIPAA notice (binary)
- 1.0 if has_signature else 0.0, # Signature (binary)
- 1.0 if placeholder_count == 0 else 0.5 # Customization (full or partial)
- ]
-
- overall_score = (sum(score_components) / len(score_components)) * 100
-
- print(f"\nOverall completeness score: {overall_score:.0f}%")
-
- if overall_score >= 90:
- print("Status: ✓ EXCELLENT - Treatment plan is comprehensive")
- elif overall_score >= 75:
- print("Status: ✓ GOOD - Minor improvements needed")
- elif overall_score >= 60:
- print("Status: ⚠ FAIR - Several sections need attention")
- else:
- print("Status: ✗ INCOMPLETE - Significant work needed")
-
- print("\n" + "="*70)
-
- # Return exit code based on completeness
- return 0 if completeness_pct >= 80 else 1
-
-
-def main():
- parser = argparse.ArgumentParser(
- description='Check treatment plan completeness',
- formatter_class=argparse.RawDescriptionHelpFormatter,
- epilog="""
-Examples:
- # Check a treatment plan file
- python check_completeness.py my_treatment_plan.tex
-
- # Check and exit with error code if incomplete (for CI/CD)
- python check_completeness.py plan.tex && echo "Complete"
-
-This script checks for:
- - All required sections (10 core sections)
- - SMART goal criteria
- - HIPAA de-identification notice
- - Provider signature section
- - Uncustomized placeholders
-
-Exit codes:
- 0 - All required sections present (≥80% complete)
- 1 - Missing required sections (<80% complete)
- 2 - File error or invalid arguments
- """
+import sys
+
+from _common import (
+ Issue,
+ ValidationError,
+ error_report,
+ load_package,
+ print_report,
+ report_payload,
+ validate_package_structure,
+)
+
+
+def _required_text(value: object, path: str, issues: list[Issue]) -> None:
+ if not isinstance(value, str) or not value.strip():
+ issues.append(Issue("REQUIRED_VALUE_MISSING", path))
+
+
+def _required_time(value: object, path: str, issues: list[Issue]) -> None:
+ if value is None:
+ issues.append(Issue("REQUIRED_TIME_MISSING", path))
+
+
+def check_completeness(documents: dict[str, dict]) -> dict:
+ issues = validate_package_structure(documents)
+ if issues:
+ return report_payload(
+ "documentation_completeness",
+ issues,
+ counts={"structural_issues": len(issues)},
+ )
+
+ for document_type, document in documents.items():
+ if "TEMPLATE" in document["document_id"]:
+ issues.append(
+ Issue(
+ "TEMPLATE_DOCUMENT_ID_UNRESOLVED",
+ f"{document_type}:$.document_id",
+ )
+ )
+ _required_time(
+ document["created_at"], f"{document_type}:$.created_at", issues
+ )
+
+ facts = documents["source_fact_manifest"]["facts"]
+ if not facts:
+ issues.append(Issue("SOURCE_FACTS_REQUIRED", "source_fact_manifest:$.facts"))
+ for index, fact in enumerate(facts):
+ base = f"source_fact_manifest:$.facts[{index}]"
+ verification = fact["verification"]
+ if verification["status"] != "verified":
+ issues.append(
+ Issue(
+ "SOURCE_FACT_VERIFICATION_PENDING",
+ f"{base}.verification.status",
+ )
+ )
+ _required_text(
+ verification["verified_by_role"],
+ f"{base}.verification.verified_by_role",
+ issues,
+ )
+ _required_time(
+ verification["verified_at"],
+ f"{base}.verification.verified_at",
+ issues,
+ )
+
+ interventions = documents[
+ "clinician_authored_intervention_record"
+ ]["interventions"]
+ if not interventions:
+ issues.append(
+ Issue(
+ "CLINICIAN_AUTHORED_INTERVENTION_REQUIRED",
+ "clinician_authored_intervention_record:$.interventions",
+ )
+ )
+ for index, intervention in enumerate(interventions):
+ base = (
+ "clinician_authored_intervention_record:"
+ f"$.interventions[{index}]"
+ )
+ if (
+ intervention["clinical_decision_status"]
+ != "supplied_and_verified_by_authorized_clinician"
+ ):
+ issues.append(
+ Issue(
+ "INTERVENTION_AUTHORIZED_VERIFICATION_PENDING",
+ f"{base}.clinical_decision_status",
+ )
+ )
+ verification = intervention["verification"]
+ if verification["status"] != "verified":
+ issues.append(
+ Issue(
+ "INTERVENTION_VERIFICATION_PENDING",
+ f"{base}.verification.status",
+ )
+ )
+ _required_text(
+ verification["verified_by_role"],
+ f"{base}.verification.verified_by_role",
+ issues,
+ )
+ _required_time(
+ verification["verified_at"],
+ f"{base}.verification.verified_at",
+ issues,
+ )
+
+ planning = documents["goals_monitoring_checkpoint_record"]
+ for field, code in (
+ ("goals", "GOAL_RECORD_REQUIRED"),
+ ("monitoring_items", "MONITORING_RECORD_REQUIRED"),
+ ("checkpoints", "CHECKPOINT_RECORD_REQUIRED"),
+ ):
+ if not planning[field]:
+ issues.append(
+ Issue(
+ code,
+ f"goals_monitoring_checkpoint_record:$.{field}",
+ )
+ )
+
+ decisions = documents[
+ "informed_preference_shared_decision_record"
+ ]["entries"]
+ if not decisions:
+ issues.append(
+ Issue(
+ "SHARED_DECISION_RECORD_REQUIRED",
+ "informed_preference_shared_decision_record:$.entries",
+ )
+ )
+ for index, decision in enumerate(decisions):
+ base = (
+ "informed_preference_shared_decision_record:"
+ f"$.entries[{index}]"
+ )
+ if decision["decision_status"] != "documented_by_authorized_clinician":
+ issues.append(
+ Issue(
+ "SHARED_DECISION_DOCUMENTATION_PENDING",
+ f"{base}.decision_status",
+ )
+ )
+ if not decision["benefits_harms_uncertainty_documented"]:
+ issues.append(
+ Issue(
+ "SHARED_DECISION_ELEMENTS_NOT_DOCUMENTED",
+ f"{base}.benefits_harms_uncertainty_documented",
+ )
+ )
+ _required_text(
+ decision["preference_as_documented"],
+ f"{base}.preference_as_documented",
+ issues,
+ )
+ _required_text(
+ decision["outcome_as_documented"],
+ f"{base}.outcome_as_documented",
+ issues,
+ )
+ _required_text(
+ decision["documented_by_role"],
+ f"{base}.documented_by_role",
+ issues,
+ )
+ _required_time(
+ decision["documented_at"],
+ f"{base}.documented_at",
+ issues,
+ )
+ if decision["acknowledgment_status"] == "pending":
+ issues.append(
+ Issue(
+ "SHARED_DECISION_ACKNOWLEDGMENT_PENDING",
+ f"{base}.acknowledgment_status",
+ )
+ )
+
+ transition_document = documents["transition_reconciliation_record"]
+ transition = transition_document["transition"]
+ for field in (
+ "from_setting_as_documented",
+ "to_setting_as_documented",
+ "responsible_sender_role",
+ "responsible_receiver_role",
+ ):
+ _required_text(
+ transition[field],
+ f"transition_reconciliation_record:$.transition.{field}",
+ issues,
+ )
+ _required_time(
+ transition["handoff_date"],
+ "transition_reconciliation_record:$.transition.handoff_date",
+ issues,
)
-
- parser.add_argument(
- 'file',
- type=Path,
- help='Treatment plan file to check (.tex format)'
+
+ reconciliation = transition_document["medication_reconciliation"]
+ if reconciliation["status"] == "pending_authorized_review":
+ issues.append(
+ Issue(
+ "MEDICATION_RECONCILIATION_PENDING",
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation.status"
+ ),
+ )
+ )
+ if reconciliation["status"] == "completed_by_authorized_clinician":
+ if not reconciliation["source_list_fact_ids"]:
+ issues.append(
+ Issue(
+ "RECONCILIATION_SOURCE_LIST_FACTS_REQUIRED",
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation.source_list_fact_ids"
+ ),
+ )
+ )
+ if not reconciliation["destination_list_fact_ids"]:
+ issues.append(
+ Issue(
+ "RECONCILIATION_DESTINATION_LIST_FACTS_REQUIRED",
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation.destination_list_fact_ids"
+ ),
+ )
+ )
+ if reconciliation["discrepancy_status"] == "not_assessed":
+ issues.append(
+ Issue(
+ "RECONCILIATION_DISCREPANCY_STATUS_PENDING",
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation.discrepancy_status"
+ ),
+ )
+ )
+ if reconciliation["status"] != "pending_authorized_review":
+ _required_text(
+ reconciliation["completed_by_role"],
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation.completed_by_role"
+ ),
+ issues,
+ )
+ _required_time(
+ reconciliation["completed_at"],
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation.completed_at"
+ ),
+ issues,
+ )
+
+ if not transition_document["handoff_items"]:
+ issues.append(
+ Issue(
+ "HANDOFF_ITEM_REQUIRED",
+ "transition_reconciliation_record:$.handoff_items",
+ )
+ )
+ for index, item in enumerate(transition_document["handoff_items"]):
+ if item["acknowledgment_status"] == "pending":
+ issues.append(
+ Issue(
+ "HANDOFF_ITEM_ACKNOWLEDGMENT_PENDING",
+ (
+ "transition_reconciliation_record:"
+ f"$.handoff_items[{index}].acknowledgment_status"
+ ),
+ )
+ )
+ for index, item in enumerate(transition_document["unresolved_items"]):
+ if item["status"] == "open_unrouted":
+ issues.append(
+ Issue(
+ "UNRESOLVED_ITEM_NOT_ROUTED",
+ (
+ "transition_reconciliation_record:"
+ f"$.unresolved_items[{index}].status"
+ ),
+ )
+ )
+ if item["status"] != "resolved_by_authorized_professional":
+ _required_text(
+ item["routed_to_local_role"],
+ (
+ "transition_reconciliation_record:"
+ f"$.unresolved_items[{index}].routed_to_local_role"
+ ),
+ issues,
+ )
+
+ handoff_document = documents["intended_use_handoff_record"]
+ intended = handoff_document["intended_use"]
+ if not intended["intended_users"]:
+ issues.append(
+ Issue(
+ "INTENDED_USER_REQUIRED",
+ "intended_use_handoff_record:$.intended_use.intended_users",
+ )
+ )
+ _required_text(
+ intended["intended_setting"],
+ "intended_use_handoff_record:$.intended_use.intended_setting",
+ issues,
)
-
- parser.add_argument(
- '-v', '--verbose',
- action='store_true',
- help='Show detailed output'
+
+ privacy = handoff_document["privacy_process"]
+ for field in (
+ "local_authorization_confirmed",
+ "minimum_necessary_confirmed",
+ "no_external_tools_confirmed",
+ "no_prompt_log_example_copy_confirmed",
+ ):
+ if not privacy[field]:
+ issues.append(
+ Issue(
+ "PRIVACY_PROCESS_ATTESTATION_PENDING",
+ f"intended_use_handoff_record:$.privacy_process.{field}",
+ )
+ )
+ _required_text(
+ privacy["authorized_environment_reference"],
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.authorized_environment_reference"
+ ),
+ issues,
)
-
- args = parser.parse_args()
-
- # Check file exists and is .tex
- if not args.file.exists():
- print(f"Error: File not found: {args.file}", file=sys.stderr)
- sys.exit(2)
-
- if args.file.suffix.lower() not in ['.tex', '.txt']:
- print(f"Warning: Expected .tex file, got {args.file.suffix}", file=sys.stderr)
-
- # Read file
- content = read_file(args.file)
-
- # Perform checks
- checklist, missing = check_sections(content)
- smart_complete, smart_missing = check_smart_goals(content)
- has_hipaa = check_hipaa_notice(content)
- has_signature = check_provider_signature(content)
- placeholder_count, placeholder_samples = check_placeholders_remaining(content)
-
- # Display results
- exit_code = display_results(
- args.file, checklist, missing,
- smart_complete, smart_missing,
- has_hipaa, has_signature,
- placeholder_count, placeholder_samples
+ _required_text(
+ privacy["retention_policy_reference"],
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.retention_policy_reference"
+ ),
+ issues,
)
-
- sys.exit(exit_code)
+ classification = handoff_document["data_classification"]
+ expected_review = (
+ {"not_applicable_synthetic", "completed_by_qualified_reviewer"}
+ if classification == "synthetic"
+ else {"completed_by_qualified_reviewer"}
+ )
+ if privacy["privacy_review_status"] not in expected_review:
+ issues.append(
+ Issue(
+ "QUALIFIED_PRIVACY_REVIEW_PENDING",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.privacy_review_status"
+ ),
+ )
+ )
+ if privacy["privacy_review_status"] == "completed_by_qualified_reviewer":
+ _required_text(
+ privacy["privacy_reviewer_role"],
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.privacy_reviewer_role"
+ ),
+ issues,
+ )
+ _required_time(
+ privacy["reviewed_at"],
+ "intended_use_handoff_record:$.privacy_process.reviewed_at",
+ issues,
+ )
+ if privacy["data_disposition_status"] == "pending":
+ issues.append(
+ Issue(
+ "DATA_DISPOSITION_PENDING",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.data_disposition_status"
+ ),
+ )
+ )
+
+ governance = handoff_document["local_governance"]
+ for field in (
+ "institution_or_organization_reference",
+ "clinical_owner_role",
+ "records_owner_role",
+ "change_control_owner_role",
+ ):
+ _required_text(
+ governance[field],
+ f"intended_use_handoff_record:$.local_governance.{field}",
+ issues,
+ )
+ if not governance["policy_references"]:
+ issues.append(
+ Issue(
+ "LOCAL_POLICY_REFERENCE_REQUIRED",
+ (
+ "intended_use_handoff_record:"
+ "$.local_governance.policy_references"
+ ),
+ )
+ )
+
+ emergency = handoff_document["emergency_routing"]
+ _required_text(
+ emergency["local_process_reference"],
+ (
+ "intended_use_handoff_record:"
+ "$.emergency_routing.local_process_reference"
+ ),
+ issues,
+ )
+ _required_text(
+ emergency["verified_by_role"],
+ (
+ "intended_use_handoff_record:"
+ "$.emergency_routing.verified_by_role"
+ ),
+ issues,
+ )
+
+ routes = handoff_document["reporting_routes"]
+ for field in (
+ "local_patient_safety_route",
+ "product_event_route",
+ "privacy_incident_route",
+ "responsible_role",
+ ):
+ _required_text(
+ routes[field],
+ f"intended_use_handoff_record:$.reporting_routes.{field}",
+ issues,
+ )
+ handoff = handoff_document["handoff"]
+ for field in ("sender_role", "recipient_role"):
+ _required_text(
+ handoff[field],
+ f"intended_use_handoff_record:$.handoff.{field}",
+ issues,
+ )
+ _required_time(
+ handoff["sent_at"],
+ "intended_use_handoff_record:$.handoff.sent_at",
+ issues,
+ )
+ if handoff["acknowledgment_status"] != "acknowledged":
+ issues.append(
+ Issue(
+ "PACKAGE_HANDOFF_ACKNOWLEDGMENT_PENDING",
+ "intended_use_handoff_record:$.handoff.acknowledgment_status",
+ )
+ )
+ if transition_document["unresolved_items"] and not handoff[
+ "unresolved_items_routed"
+ ]:
+ issues.append(
+ Issue(
+ "UNRESOLVED_ITEM_ROUTING_ATTESTATION_PENDING",
+ (
+ "intended_use_handoff_record:"
+ "$.handoff.unresolved_items_routed"
+ ),
+ )
+ )
+
+ signoff = handoff_document["clinician_signoff"]
+ if signoff["status"] != "signed":
+ issues.append(
+ Issue(
+ "CLINICIAN_SIGNOFF_PENDING",
+ "intended_use_handoff_record:$.clinician_signoff.status",
+ )
+ )
+ for field in ("signer_role", "credential_authority_reference"):
+ _required_text(
+ signoff[field],
+ f"intended_use_handoff_record:$.clinician_signoff.{field}",
+ issues,
+ )
+ _required_time(
+ signoff["signed_at"],
+ "intended_use_handoff_record:$.clinician_signoff.signed_at",
+ issues,
+ )
+
+ release = handoff_document["release_gate"]
+ if release["status"] != "released_for_authorized_documentation_handoff":
+ issues.append(
+ Issue(
+ "DOCUMENTATION_HANDOFF_RELEASE_BLOCKED",
+ "intended_use_handoff_record:$.release_gate.status",
+ )
+ )
+ _required_text(
+ release["released_by_role"],
+ "intended_use_handoff_record:$.release_gate.released_by_role",
+ issues,
+ )
+ _required_time(
+ release["released_at"],
+ "intended_use_handoff_record:$.release_gate.released_at",
+ issues,
+ )
+ if release["blocker_codes"]:
+ issues.append(
+ Issue(
+ "RELEASE_BLOCKER_CODES_REMAIN",
+ "intended_use_handoff_record:$.release_gate.blocker_codes",
+ )
+ )
+
+ issues.sort(key=lambda item: (item.path, item.code))
+ return report_payload(
+ "documentation_completeness",
+ issues,
+ counts={
+ "source_facts": len(facts),
+ "interventions": len(interventions),
+ "goals": len(planning["goals"]),
+ "monitoring_items": len(planning["monitoring_items"]),
+ "checkpoints": len(planning["checkpoints"]),
+ "shared_decision_entries": len(decisions),
+ "handoff_items": len(transition_document["handoff_items"]),
+ "unresolved_items": len(
+ transition_document["unresolved_items"]
+ ),
+ },
+ extra={
+ "ready_for_authorized_documentation_handoff": not issues,
+ "clinical_completeness_determined": False,
+ },
+ )
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(
+ description=(
+ "Check required documentation, review, routing, sign-off, and "
+ "handoff declarations. No clinical adequacy is assessed."
+ )
+ )
+ parser.add_argument("package", help="Complete local package directory")
+ return parser
+
+
+def main() -> int:
+ args = build_parser().parse_args()
+ try:
+ documents, _ = load_package(args.package)
+ report = check_completeness(documents)
+ except ValidationError as exc:
+ report = error_report("documentation_completeness", exc)
+ print_report(report)
+ return 1 if report["status"] == "fail" else 0
-if __name__ == '__main__':
- main()
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/treatment-plans/scripts/check_consistency.py b/skills/treatment-plans/scripts/check_consistency.py
new file mode 100644
index 00000000..50da83e8
--- /dev/null
+++ b/skills/treatment-plans/scripts/check_consistency.py
@@ -0,0 +1,386 @@
+#!/usr/bin/env python3
+"""Check cross-record consistency without clinical interpretation."""
+
+from __future__ import annotations
+
+import argparse
+import sys
+from datetime import date
+from typing import Any
+
+from _common import (
+ Issue,
+ ValidationError,
+ load_package,
+ parse_iso_datetime,
+ print_report,
+ record_ids,
+ report_payload,
+ validate_package_structure,
+ error_report,
+)
+
+
+def _collect_ids(documents: dict[str, dict]) -> list[tuple[str, str]]:
+ values: list[tuple[str, str]] = []
+
+ def collect(records: list, field: str, path: str) -> None:
+ for index, record in enumerate(records):
+ if isinstance(record, dict) and isinstance(record.get(field), str):
+ values.append((f"{path}[{index}].{field}", record[field]))
+
+ facts = documents["source_fact_manifest"]["facts"]
+ collect(facts, "fact_id", "source_fact_manifest:$.facts")
+
+ interventions = documents[
+ "clinician_authored_intervention_record"
+ ]["interventions"]
+ collect(
+ interventions,
+ "intervention_id",
+ "clinician_authored_intervention_record:$.interventions",
+ )
+ for index, record in enumerate(interventions):
+ collect(
+ record["parameters_as_supplied"],
+ "parameter_id",
+ (
+ "clinician_authored_intervention_record:"
+ f"$.interventions[{index}].parameters_as_supplied"
+ ),
+ )
+
+ planning = documents["goals_monitoring_checkpoint_record"]
+ collect(
+ planning["goals"],
+ "goal_id",
+ "goals_monitoring_checkpoint_record:$.goals",
+ )
+ collect(
+ planning["monitoring_items"],
+ "monitoring_id",
+ "goals_monitoring_checkpoint_record:$.monitoring_items",
+ )
+ collect(
+ planning["checkpoints"],
+ "checkpoint_id",
+ "goals_monitoring_checkpoint_record:$.checkpoints",
+ )
+
+ entries = documents[
+ "informed_preference_shared_decision_record"
+ ]["entries"]
+ collect(
+ entries,
+ "decision_id",
+ "informed_preference_shared_decision_record:$.entries",
+ )
+ for index, record in enumerate(entries):
+ collect(
+ record["options_as_documented"],
+ "option_id",
+ (
+ "informed_preference_shared_decision_record:"
+ f"$.entries[{index}].options_as_documented"
+ ),
+ )
+
+ transition = documents["transition_reconciliation_record"]
+ collect(
+ transition["handoff_items"],
+ "item_id",
+ "transition_reconciliation_record:$.handoff_items",
+ )
+ collect(
+ transition["unresolved_items"],
+ "item_id",
+ "transition_reconciliation_record:$.unresolved_items",
+ )
+ return values
+
+
+def _duplicate_reference_issues(
+ value: Any, path: str = "$"
+) -> list[Issue]:
+ issues: list[Issue] = []
+ if isinstance(value, dict):
+ for key, nested in value.items():
+ nested_path = f"{path}.{key}"
+ if key.endswith("_ids") and isinstance(nested, list):
+ if len(nested) != len(set(nested)):
+ issues.append(
+ Issue("DUPLICATE_REFERENCE_IN_LIST", nested_path)
+ )
+ issues.extend(_duplicate_reference_issues(nested, nested_path))
+ elif isinstance(value, list):
+ for index, nested in enumerate(value):
+ issues.extend(
+ _duplicate_reference_issues(nested, f"{path}[{index}]")
+ )
+ return issues
+
+
+def check_consistency(documents: dict[str, dict]) -> dict:
+ issues = validate_package_structure(documents)
+ if issues:
+ return report_payload(
+ "cross_record_consistency",
+ issues,
+ counts={"structural_issues": len(issues)},
+ )
+
+ handoff_document = documents["intended_use_handoff_record"]
+ subject_ref = handoff_document["subject_ref"]
+ classification = handoff_document["data_classification"]
+ for document_type, document in documents.items():
+ if document["subject_ref"] != subject_ref:
+ issues.append(
+ Issue(
+ "SUBJECT_REFERENCE_MISMATCH",
+ f"{document_type}:$.subject_ref",
+ )
+ )
+ if document["data_classification"] != classification:
+ issues.append(
+ Issue(
+ "DATA_CLASSIFICATION_MISMATCH",
+ f"{document_type}:$.data_classification",
+ )
+ )
+ issues.extend(
+ Issue(issue.code, f"{document_type}:{issue.path}", issue.level)
+ for issue in _duplicate_reference_issues(document)
+ )
+
+ seen: set[str] = set()
+ for path, identifier in _collect_ids(documents):
+ if identifier in seen:
+ issues.append(Issue("GLOBAL_RECORD_ID_COLLISION", path))
+ seen.add(identifier)
+
+ interventions = documents[
+ "clinician_authored_intervention_record"
+ ]["interventions"]
+ for index, record in enumerate(interventions):
+ start = record["start_date"]
+ end = record["end_date"]
+ if start is not None and end is not None:
+ if date.fromisoformat(start) > date.fromisoformat(end):
+ issues.append(
+ Issue(
+ "INTERVENTION_DATE_ORDER_INVALID",
+ (
+ "clinician_authored_intervention_record:"
+ f"$.interventions[{index}]"
+ ),
+ )
+ )
+
+ planning = documents["goals_monitoring_checkpoint_record"]
+ goal_ids = record_ids(planning, "goals", "goal_id")
+ intervention_ids = record_ids(
+ documents["clinician_authored_intervention_record"],
+ "interventions",
+ "intervention_id",
+ )
+ for index, checkpoint in enumerate(planning["checkpoints"]):
+ base = (
+ "goals_monitoring_checkpoint_record:"
+ f"$.checkpoints[{index}]"
+ )
+ for reference_index, goal_id in enumerate(
+ checkpoint["linked_goal_ids"]
+ ):
+ if goal_id not in goal_ids:
+ issues.append(
+ Issue(
+ "CHECKPOINT_UNKNOWN_GOAL",
+ f"{base}.linked_goal_ids[{reference_index}]",
+ )
+ )
+ for reference_index, intervention_id in enumerate(
+ checkpoint["linked_intervention_ids"]
+ ):
+ if intervention_id not in intervention_ids:
+ issues.append(
+ Issue(
+ "CHECKPOINT_UNKNOWN_INTERVENTION",
+ (
+ f"{base}.linked_intervention_ids"
+ f"[{reference_index}]"
+ ),
+ )
+ )
+
+ transition = documents["transition_reconciliation_record"]
+ reconciliation = transition["medication_reconciliation"]
+ if reconciliation["status"] == "pending_authorized_review":
+ if reconciliation["completed_by_role"] or reconciliation[
+ "completed_at"
+ ] is not None:
+ issues.append(
+ Issue(
+ "PENDING_RECONCILIATION_HAS_COMPLETION_DATA",
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation"
+ ),
+ )
+ )
+ elif reconciliation["status"] == "not_applicable_by_authorized_clinician":
+ if (
+ reconciliation["source_list_fact_ids"]
+ or reconciliation["destination_list_fact_ids"]
+ ):
+ issues.append(
+ Issue(
+ "NOT_APPLICABLE_RECONCILIATION_HAS_LIST_REFERENCES",
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation"
+ ),
+ )
+ )
+ elif reconciliation["status"] == "completed_by_authorized_clinician":
+ if (
+ not reconciliation["completed_by_role"]
+ or reconciliation["completed_at"] is None
+ ):
+ issues.append(
+ Issue(
+ "COMPLETED_RECONCILIATION_MISSING_REVIEW",
+ (
+ "transition_reconciliation_record:"
+ "$.medication_reconciliation"
+ ),
+ )
+ )
+
+ privacy = handoff_document["privacy_process"]
+ signoff = handoff_document["clinician_signoff"]
+ release = handoff_document["release_gate"]
+ handoff = handoff_document["handoff"]
+
+ if privacy["data_classification"] != classification:
+ issues.append(
+ Issue(
+ "PRIVACY_CLASSIFICATION_MISMATCH",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.data_classification"
+ ),
+ )
+ )
+
+ if release["status"] == "released_for_authorized_documentation_handoff":
+ if signoff["status"] != "signed":
+ issues.append(
+ Issue(
+ "RELEASE_WITHOUT_CLINICIAN_SIGNOFF",
+ "intended_use_handoff_record:$.release_gate.status",
+ )
+ )
+ if release["blocker_codes"]:
+ issues.append(
+ Issue(
+ "RELEASE_WITH_BLOCKERS",
+ (
+ "intended_use_handoff_record:"
+ "$.release_gate.blocker_codes"
+ ),
+ )
+ )
+ if handoff["acknowledgment_status"] != "acknowledged":
+ issues.append(
+ Issue(
+ "RELEASE_WITHOUT_HANDOFF_ACKNOWLEDGMENT",
+ (
+ "intended_use_handoff_record:"
+ "$.handoff.acknowledgment_status"
+ ),
+ )
+ )
+
+ signed_at = (
+ parse_iso_datetime(signoff["signed_at"])
+ if signoff["signed_at"] is not None
+ else None
+ )
+ released_at = (
+ parse_iso_datetime(release["released_at"])
+ if release["released_at"] is not None
+ else None
+ )
+ sent_at = (
+ parse_iso_datetime(handoff["sent_at"])
+ if handoff["sent_at"] is not None
+ else None
+ )
+ reviewed_at = (
+ parse_iso_datetime(privacy["reviewed_at"])
+ if privacy["reviewed_at"] is not None
+ else None
+ )
+
+ if signed_at and released_at and signed_at > released_at:
+ issues.append(
+ Issue(
+ "SIGNOFF_AFTER_RELEASE",
+ "intended_use_handoff_record:$.release_gate.released_at",
+ )
+ )
+ if released_at and sent_at and released_at > sent_at:
+ issues.append(
+ Issue(
+ "RELEASE_AFTER_HANDOFF_SENT",
+ "intended_use_handoff_record:$.handoff.sent_at",
+ )
+ )
+ if reviewed_at and released_at and reviewed_at > released_at:
+ issues.append(
+ Issue(
+ "PRIVACY_REVIEW_AFTER_RELEASE",
+ "intended_use_handoff_record:$.privacy_process.reviewed_at",
+ )
+ )
+
+ issues.sort(key=lambda item: (item.path, item.code))
+ return report_payload(
+ "cross_record_consistency",
+ issues,
+ counts={
+ "global_record_ids": len(seen),
+ "checkpoints": len(planning["checkpoints"]),
+ "interventions": len(interventions),
+ },
+ extra={
+ "clinical_semantics_compared": False,
+ "date_intervals_inferred": False,
+ },
+ )
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(
+ description=(
+ "Check identifiers, links, classifications, status coherence, and "
+ "explicit date order. Clinical text is not compared or interpreted."
+ )
+ )
+ parser.add_argument("package", help="Complete local package directory")
+ return parser
+
+
+def main() -> int:
+ args = build_parser().parse_args()
+ try:
+ documents, _ = load_package(args.package)
+ report = check_consistency(documents)
+ except ValidationError as exc:
+ report = error_report("cross_record_consistency", exc)
+ print_report(report)
+ return 1 if report["status"] == "fail" else 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/treatment-plans/scripts/generate_schematic.py b/skills/treatment-plans/scripts/generate_schematic.py
deleted file mode 100644
index 43331870..00000000
--- a/skills/treatment-plans/scripts/generate_schematic.py
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/usr/bin/env python3
-"""
-Scientific schematic generation using Nano Banana 2.
-
-Generate any scientific diagram by describing it in natural language.
-Nano Banana 2 handles everything automatically with smart iterative refinement.
-
-Smart iteration: Only regenerates if quality is below threshold for your document type.
-Quality review: Uses Gemini 3.6 Flash for professional scientific evaluation.
-
-Usage:
- # Generate for journal paper (highest quality threshold)
- python generate_schematic.py "CONSORT flowchart" -o flowchart.png --doc-type journal
-
- # Generate for presentation (lower threshold, faster)
- python generate_schematic.py "Transformer architecture" -o transformer.png --doc-type presentation
-
- # Generate for poster
- python generate_schematic.py "MAPK signaling pathway" -o pathway.png --doc-type poster
-"""
-
-import argparse
-import os
-import subprocess
-import sys
-from pathlib import Path
-
-
-def main():
- """Command-line interface."""
- parser = argparse.ArgumentParser(
- description="Generate scientific schematics using AI with smart iterative refinement",
- formatter_class=argparse.RawDescriptionHelpFormatter,
- epilog="""
-How it works:
- Simply describe your diagram in natural language
- Nano Banana 2 generates it automatically with:
- - Smart iteration (only regenerates if quality is below threshold)
- - Quality review by Gemini 3.6 Flash
- - Document-type aware quality thresholds
- - Publication-ready output
-
-Document Types (quality thresholds):
- journal 8.5/10 - Nature, Science, peer-reviewed journals
- conference 8.0/10 - Conference papers
- thesis 8.0/10 - Dissertations, theses
- grant 8.0/10 - Grant proposals
- preprint 7.5/10 - arXiv, bioRxiv, etc.
- report 7.5/10 - Technical reports
- poster 7.0/10 - Academic posters
- presentation 6.5/10 - Slides, talks
- default 7.5/10 - General purpose
-
-Examples:
- # Generate for journal paper (strict quality)
- python generate_schematic.py "CONSORT participant flow" -o flowchart.png --doc-type journal
-
- # Generate for poster (moderate quality)
- python generate_schematic.py "Transformer architecture" -o arch.png --doc-type poster
-
- # Generate for slides (faster, lower threshold)
- python generate_schematic.py "System diagram" -o system.png --doc-type presentation
-
- # Custom max iterations
- python generate_schematic.py "Complex pathway" -o pathway.png --iterations 2
-
- # Verbose output
- python generate_schematic.py "Circuit diagram" -o circuit.png -v
-
-Environment Variables:
- OPENROUTER_API_KEY Required for AI generation
- """
- )
-
- parser.add_argument("prompt",
- help="Description of the diagram to generate")
- parser.add_argument("-o", "--output", required=True,
- help="Output file path")
- parser.add_argument("--doc-type", default="default",
- choices=["journal", "conference", "poster", "presentation",
- "report", "grant", "thesis", "preprint", "default"],
- help="Document type for quality threshold (default: default)")
- parser.add_argument("--iterations", type=int, default=2,
- help="Maximum refinement iterations (default: 2, max: 2)")
- parser.add_argument("--api-key",
- help="OpenRouter API key (or use OPENROUTER_API_KEY env var)")
- parser.add_argument("-v", "--verbose", action="store_true",
- help="Verbose output")
-
- args = parser.parse_args()
-
- # Check for API key
- api_key = args.api_key or os.getenv("OPENROUTER_API_KEY")
- if not api_key:
- print("Error: OPENROUTER_API_KEY environment variable not set")
- print("\nFor AI generation, you need an OpenRouter API key.")
- print("Get one at: https://openrouter.ai/keys")
- print("\nSet it with:")
- print(" export OPENROUTER_API_KEY='your_api_key'")
- print("\nOr use --api-key flag")
- sys.exit(1)
-
- # Find AI generation script
- script_dir = Path(__file__).parent
- ai_script = script_dir / "generate_schematic_ai.py"
-
- if not ai_script.exists():
- print(f"Error: AI generation script not found: {ai_script}")
- sys.exit(1)
-
- # Build command
- cmd = [sys.executable, str(ai_script), args.prompt, "-o", args.output]
-
- if args.doc_type != "default":
- cmd.extend(["--doc-type", args.doc_type])
-
- # Enforce max 2 iterations
- iterations = min(args.iterations, 2)
- if iterations != 2:
- cmd.extend(["--iterations", str(iterations)])
-
- if args.verbose:
- cmd.append("-v")
-
- # Execute — pass API key via environment to avoid exposure in process listings
- try:
- env = os.environ.copy()
- if api_key:
- env["OPENROUTER_API_KEY"] = api_key
- result = subprocess.run(cmd, check=False, env=env)
- sys.exit(result.returncode)
- except Exception as e:
- print(f"Error executing AI generation: {e}")
- sys.exit(1)
-
-
-if __name__ == "__main__":
- main()
-
diff --git a/skills/treatment-plans/scripts/generate_schematic_ai.py b/skills/treatment-plans/scripts/generate_schematic_ai.py
deleted file mode 100644
index 651b6c76..00000000
--- a/skills/treatment-plans/scripts/generate_schematic_ai.py
+++ /dev/null
@@ -1,817 +0,0 @@
-#!/usr/bin/env python3
-"""
-AI-powered scientific schematic generation using Nano Banana 2.
-
-This script uses a smart iterative refinement approach:
-1. Generate initial image with Nano Banana 2
-2. AI quality review using Gemini 3.6 Flash for scientific critique
-3. Only regenerate if quality is below threshold for document type
-4. Repeat until quality meets standards (max iterations)
-
-Requirements:
- - OPENROUTER_API_KEY environment variable
- - requests library
-
-Usage:
- python generate_schematic_ai.py "Create a flowchart showing CONSORT participant flow" -o flowchart.png
- python generate_schematic_ai.py "Neural network architecture diagram" -o architecture.png --iterations 2
- python generate_schematic_ai.py "Simple block diagram" -o diagram.png --doc-type poster
-"""
-
-import argparse
-import base64
-import json
-import os
-import sys
-import time
-from pathlib import Path
-from typing import Optional, Dict, Any, List, Tuple
-
-try:
- import requests
-except ImportError:
- print("Error: requests library not found. Install with: pip install requests")
- sys.exit(1)
-
-# Try to load .env file from multiple potential locations
-def _load_env_file():
- """Load .env file from current directory or script directory only."""
- try:
- from dotenv import load_dotenv
- except ImportError:
- return False
-
- for candidate in [Path.cwd() / ".env", Path(__file__).resolve().parent / ".env"]:
- if candidate.exists():
- load_dotenv(dotenv_path=candidate, override=False)
- return True
-
- return False
-
-
-class ScientificSchematicGenerator:
- """Generate scientific schematics using AI with smart iterative refinement.
-
- Uses Gemini 3.6 Flash for quality review to determine if regeneration is needed.
- Multiple passes only occur if the generated schematic doesn't meet the
- quality threshold for the target document type.
- """
-
- # Quality thresholds by document type (score out of 10)
- # Higher thresholds for more formal publications
- QUALITY_THRESHOLDS = {
- "journal": 8.5, # Nature, Science, etc. - highest standards
- "conference": 8.0, # Conference papers - high standards
- "poster": 7.0, # Academic posters - good quality
- "presentation": 6.5, # Slides/talks - clear but less formal
- "report": 7.5, # Technical reports - professional
- "grant": 8.0, # Grant proposals - must be compelling
- "thesis": 8.0, # Dissertations - formal academic
- "preprint": 7.5, # arXiv, etc. - good quality
- "default": 7.5, # Default threshold
- }
-
- # Scientific diagram best practices prompt template
- SCIENTIFIC_DIAGRAM_GUIDELINES = """
-Create a high-quality scientific diagram with these requirements:
-
-VISUAL QUALITY:
-- Clean white or light background (no textures or gradients)
-- High contrast for readability and printing
-- Professional, publication-ready appearance
-- Sharp, clear lines and text
-- Adequate spacing between elements to prevent crowding
-
-TYPOGRAPHY:
-- Clear, readable sans-serif fonts (Arial, Helvetica style)
-- Minimum 10pt font size for all labels
-- Consistent font sizes throughout
-- All text horizontal or clearly readable
-- No overlapping text
-
-SCIENTIFIC STANDARDS:
-- Accurate representation of concepts
-- Clear labels for all components
-- Include scale bars, legends, or axes where appropriate
-- Use standard scientific notation and symbols
-- Include units where applicable
-
-ACCESSIBILITY:
-- Colorblind-friendly color palette (use Okabe-Ito colors if using color)
-- High contrast between elements
-- Redundant encoding (shapes + colors, not just colors)
-- Works well in grayscale
-
-LAYOUT:
-- Logical flow (left-to-right or top-to-bottom)
-- Clear visual hierarchy
-- Balanced composition
-- Appropriate use of whitespace
-- No clutter or unnecessary decorative elements
-
-IMPORTANT - NO FIGURE NUMBERS:
-- Do NOT include "Figure 1:", "Fig. 1", or any figure numbering in the image
-- Do NOT add captions or titles like "Figure: ..." at the top or bottom
-- Figure numbers and captions are added separately in the document/LaTeX
-- The diagram should contain only the visual content itself
-"""
-
- def __init__(self, api_key: Optional[str] = None, verbose: bool = False):
- """
- Initialize the generator.
-
- Args:
- api_key: OpenRouter API key (or use OPENROUTER_API_KEY env var)
- verbose: Print detailed progress information
- """
- # Priority: 1) explicit api_key param, 2) environment variable, 3) .env file
- self.api_key = api_key or os.getenv("OPENROUTER_API_KEY")
-
- # If not found in environment, try loading from .env file
- if not self.api_key:
- _load_env_file()
- self.api_key = os.getenv("OPENROUTER_API_KEY")
-
- if not self.api_key:
- raise ValueError(
- "OPENROUTER_API_KEY not found. Please either:\n"
- " 1. Set the OPENROUTER_API_KEY environment variable\n"
- " 2. Add OPENROUTER_API_KEY to your .env file\n"
- " 3. Pass api_key parameter to the constructor\n"
- "Get your API key from: https://openrouter.ai/keys"
- )
-
- self.verbose = verbose
- self._last_error = None # Track last error for better reporting
- self.base_url = "https://openrouter.ai/api/v1"
- # Nano Banana 2 - Google's advanced image generation model
- # https://openrouter.ai/google/gemini-3.6-flash
- self.image_model = "google/gemini-3.1-flash-image-preview"
- # Gemini 3.6 Flash for quality review - excellent vision and reasoning
- self.review_model = "google/gemini-3.6-flash"
-
- def _log(self, message: str):
- """Log message if verbose mode is enabled."""
- if self.verbose:
- print(f"[{time.strftime('%H:%M:%S')}] {message}")
-
- def _make_request(self, model: str, messages: List[Dict[str, Any]],
- modalities: Optional[List[str]] = None) -> Dict[str, Any]:
- """
- Make a request to OpenRouter API.
-
- Args:
- model: Model identifier
- messages: List of message dictionaries
- modalities: Optional list of modalities (e.g., ["image", "text"])
-
- Returns:
- API response as dictionary
- """
- headers = {
- "Authorization": f"Bearer {self.api_key}",
- "Content-Type": "application/json",
- "HTTP-Referer": "https://github.com/scientific-writer",
- "X-Title": "Scientific Schematic Generator"
- }
-
- payload = {
- "model": model,
- "messages": messages
- }
-
- if modalities:
- payload["modalities"] = modalities
-
- self._log(f"Making request to {model}...")
-
- try:
- response = requests.post(
- f"{self.base_url}/chat/completions",
- headers=headers,
- json=payload,
- timeout=120
- )
-
- # Try to get response body even on error
- try:
- response_json = response.json()
- except json.JSONDecodeError:
- response_json = {"raw_text": response.text[:500]}
-
- # Check for HTTP errors but include response body in error message
- if response.status_code != 200:
- error_detail = response_json.get("error", response_json)
- self._log(f"HTTP {response.status_code}: {error_detail}")
- raise RuntimeError(f"API request failed (HTTP {response.status_code}): {error_detail}")
-
- return response_json
- except requests.exceptions.Timeout:
- raise RuntimeError("API request timed out after 120 seconds")
- except requests.exceptions.RequestException as e:
- raise RuntimeError(f"API request failed: {str(e)}")
-
- def _extract_image_from_response(self, response: Dict[str, Any]) -> Optional[bytes]:
- """
- Extract base64-encoded image from API response.
-
- For Nano Banana 2, images are returned in the 'images' field of the message,
- not in the 'content' field.
-
- Args:
- response: API response dictionary
-
- Returns:
- Image bytes or None if not found
- """
- try:
- choices = response.get("choices", [])
- if not choices:
- self._log("No choices in response")
- return None
-
- message = choices[0].get("message", {})
-
- # IMPORTANT: Nano Banana 2 returns images in the 'images' field
- images = message.get("images", [])
- if images and len(images) > 0:
- self._log(f"Found {len(images)} image(s) in 'images' field")
-
- # Get first image
- first_image = images[0]
- if isinstance(first_image, dict):
- # Extract image_url
- if first_image.get("type") == "image_url":
- url = first_image.get("image_url", {})
- if isinstance(url, dict):
- url = url.get("url", "")
-
- if url and url.startswith("data:image"):
- # Extract base64 data after comma
- if "," in url:
- base64_str = url.split(",", 1)[1]
- # Clean whitespace
- base64_str = base64_str.replace('\n', '').replace('\r', '').replace(' ', '')
- self._log(f"Extracted base64 data (length: {len(base64_str)})")
- return base64.b64decode(base64_str)
-
- # Fallback: check content field (for other models or future changes)
- content = message.get("content", "")
-
- if self.verbose:
- self._log(f"Content type: {type(content)}, length: {len(str(content))}")
-
- # Handle string content
- if isinstance(content, str) and "data:image" in content:
- import re
- match = re.search(r'data:image/[^;]+;base64,([A-Za-z0-9+/=\n\r]+)', content, re.DOTALL)
- if match:
- base64_str = match.group(1).replace('\n', '').replace('\r', '').replace(' ', '')
- self._log(f"Found image in content field (length: {len(base64_str)})")
- return base64.b64decode(base64_str)
-
- # Handle list content
- if isinstance(content, list):
- for i, block in enumerate(content):
- if isinstance(block, dict) and block.get("type") == "image_url":
- url = block.get("image_url", {})
- if isinstance(url, dict):
- url = url.get("url", "")
- if url and url.startswith("data:image") and "," in url:
- base64_str = url.split(",", 1)[1].replace('\n', '').replace('\r', '').replace(' ', '')
- self._log(f"Found image in content block {i}")
- return base64.b64decode(base64_str)
-
- self._log("No image data found in response")
- return None
-
- except Exception as e:
- self._log(f"Error extracting image: {str(e)}")
- import traceback
- if self.verbose:
- traceback.print_exc()
- return None
-
- def _image_to_base64(self, image_path: str) -> str:
- """
- Convert image file to base64 data URL.
-
- Args:
- image_path: Path to image file
-
- Returns:
- Base64 data URL string
- """
- with open(image_path, "rb") as f:
- image_data = f.read()
-
- # Determine image type from extension
- ext = Path(image_path).suffix.lower()
- mime_type = {
- ".png": "image/png",
- ".jpg": "image/jpeg",
- ".jpeg": "image/jpeg",
- ".gif": "image/gif",
- ".webp": "image/webp"
- }.get(ext, "image/png")
-
- base64_data = base64.b64encode(image_data).decode("utf-8")
- return f"data:{mime_type};base64,{base64_data}"
-
- def generate_image(self, prompt: str) -> Optional[bytes]:
- """
- Generate an image using Nano Banana 2.
-
- Args:
- prompt: Description of the diagram to generate
-
- Returns:
- Image bytes or None if generation failed
- """
- self._last_error = None # Reset error
-
- messages = [
- {
- "role": "user",
- "content": prompt
- }
- ]
-
- try:
- response = self._make_request(
- model=self.image_model,
- messages=messages,
- modalities=["image", "text"]
- )
-
- # Debug: print response structure if verbose
- if self.verbose:
- self._log(f"Response keys: {response.keys()}")
- if "error" in response:
- self._log(f"API Error: {response['error']}")
- if "choices" in response and response["choices"]:
- msg = response["choices"][0].get("message", {})
- self._log(f"Message keys: {msg.keys()}")
- # Show content preview without printing huge base64 data
- content = msg.get("content", "")
- if isinstance(content, str):
- preview = content[:200] + "..." if len(content) > 200 else content
- self._log(f"Content preview: {preview}")
- elif isinstance(content, list):
- self._log(f"Content is list with {len(content)} items")
- for i, item in enumerate(content[:3]):
- if isinstance(item, dict):
- self._log(f" Item {i}: type={item.get('type')}")
-
- # Check for API errors in response
- if "error" in response:
- error_msg = response["error"]
- if isinstance(error_msg, dict):
- error_msg = error_msg.get("message", str(error_msg))
- self._last_error = f"API Error: {error_msg}"
- print(f"✗ {self._last_error}")
- return None
-
- image_data = self._extract_image_from_response(response)
- if image_data:
- self._log(f"✓ Generated image ({len(image_data)} bytes)")
- else:
- self._last_error = "No image data in API response - model may not support image generation"
- self._log(f"✗ {self._last_error}")
- # Additional debug info when image extraction fails
- if self.verbose and "choices" in response:
- msg = response["choices"][0].get("message", {})
- self._log(f"Full message structure: {json.dumps({k: type(v).__name__ for k, v in msg.items()})}")
-
- return image_data
- except RuntimeError as e:
- self._last_error = str(e)
- self._log(f"✗ Generation failed: {self._last_error}")
- return None
- except Exception as e:
- self._last_error = f"Unexpected error: {str(e)}"
- self._log(f"✗ Generation failed: {self._last_error}")
- import traceback
- if self.verbose:
- traceback.print_exc()
- return None
-
- def review_image(self, image_path: str, original_prompt: str,
- iteration: int, doc_type: str = "default",
- max_iterations: int = 2) -> Tuple[str, float, bool]:
- """
- Review generated image using Gemini 3.6 Flash for quality analysis.
-
- Uses Gemini 3.6 Flash's superior vision and reasoning capabilities to
- evaluate the schematic quality and determine if regeneration is needed.
-
- Args:
- image_path: Path to the generated image
- original_prompt: Original user prompt
- iteration: Current iteration number
- doc_type: Document type (journal, poster, presentation, etc.)
- max_iterations: Maximum iterations allowed
-
- Returns:
- Tuple of (critique text, quality score 0-10, needs_improvement bool)
- """
- # Use Gemini 3.6 Flash for review - excellent vision and analysis
- image_data_url = self._image_to_base64(image_path)
-
- # Get quality threshold for this document type
- threshold = self.QUALITY_THRESHOLDS.get(doc_type.lower(),
- self.QUALITY_THRESHOLDS["default"])
-
- review_prompt = f"""You are an expert reviewer evaluating a scientific diagram for publication quality.
-
-ORIGINAL REQUEST: {original_prompt}
-
-DOCUMENT TYPE: {doc_type} (quality threshold: {threshold}/10)
-ITERATION: {iteration}/{max_iterations}
-
-Carefully evaluate this diagram on these criteria:
-
-1. **Scientific Accuracy** (0-2 points)
- - Correct representation of concepts
- - Proper notation and symbols
- - Accurate relationships shown
-
-2. **Clarity and Readability** (0-2 points)
- - Easy to understand at a glance
- - Clear visual hierarchy
- - No ambiguous elements
-
-3. **Label Quality** (0-2 points)
- - All important elements labeled
- - Labels are readable (appropriate font size)
- - Consistent labeling style
-
-4. **Layout and Composition** (0-2 points)
- - Logical flow (top-to-bottom or left-to-right)
- - Balanced use of space
- - No overlapping elements
-
-5. **Professional Appearance** (0-2 points)
- - Publication-ready quality
- - Clean, crisp lines and shapes
- - Appropriate colors/contrast
-
-RESPOND IN THIS EXACT FORMAT:
-SCORE: [total score 0-10]
-
-STRENGTHS:
-- [strength 1]
-- [strength 2]
-
-ISSUES:
-- [issue 1 if any]
-- [issue 2 if any]
-
-VERDICT: [ACCEPTABLE or NEEDS_IMPROVEMENT]
-
-If score >= {threshold}, the diagram is ACCEPTABLE for {doc_type} publication.
-If score < {threshold}, mark as NEEDS_IMPROVEMENT with specific suggestions."""
-
- messages = [
- {
- "role": "user",
- "content": [
- {
- "type": "text",
- "text": review_prompt
- },
- {
- "type": "image_url",
- "image_url": {
- "url": image_data_url
- }
- }
- ]
- }
- ]
-
- try:
- # Use Gemini 3.6 Flash for high-quality review
- response = self._make_request(
- model=self.review_model,
- messages=messages
- )
-
- # Extract text response
- choices = response.get("choices", [])
- if not choices:
- return "Image generated successfully", 8.0
-
- message = choices[0].get("message", {})
- content = message.get("content", "")
-
- # Check reasoning field (Nano Banana 2 puts analysis here)
- reasoning = message.get("reasoning", "")
- if reasoning and not content:
- content = reasoning
-
- if isinstance(content, list):
- # Extract text from content blocks
- text_parts = []
- for block in content:
- if isinstance(block, dict) and block.get("type") == "text":
- text_parts.append(block.get("text", ""))
- content = "\n".join(text_parts)
-
- # Try to extract score
- score = 7.5 # Default score if extraction fails
- import re
-
- # Look for SCORE: X or SCORE: X/10 format
- score_match = re.search(r'SCORE:\s*(\d+(?:\.\d+)?)', content, re.IGNORECASE)
- if score_match:
- score = float(score_match.group(1))
- else:
- # Fallback: look for any score pattern
- score_match = re.search(r'(?:score|rating|quality)[:\s]+(\d+(?:\.\d+)?)\s*(?:/\s*10)?', content, re.IGNORECASE)
- if score_match:
- score = float(score_match.group(1))
-
- # Determine if improvement is needed based on verdict or score
- needs_improvement = False
- if "NEEDS_IMPROVEMENT" in content.upper():
- needs_improvement = True
- elif score < threshold:
- needs_improvement = True
-
- self._log(f"✓ Review complete (Score: {score}/10, Threshold: {threshold}/10)")
- self._log(f" Verdict: {'Needs improvement' if needs_improvement else 'Acceptable'}")
-
- return (content if content else "Image generated successfully",
- score,
- needs_improvement)
- except Exception as e:
- self._log(f"Review skipped: {str(e)}")
- # Don't fail the whole process if review fails - assume acceptable
- return "Image generated successfully (review skipped)", 7.5, False
-
- def improve_prompt(self, original_prompt: str, critique: str,
- iteration: int) -> str:
- """
- Improve the generation prompt based on critique.
-
- Args:
- original_prompt: Original user prompt
- critique: Review critique from previous iteration
- iteration: Current iteration number
-
- Returns:
- Improved prompt for next generation
- """
- improved_prompt = f"""{self.SCIENTIFIC_DIAGRAM_GUIDELINES}
-
-USER REQUEST: {original_prompt}
-
-ITERATION {iteration}: Based on previous feedback, address these specific improvements:
-{critique}
-
-Generate an improved version that addresses all the critique points while maintaining scientific accuracy and professional quality."""
-
- return improved_prompt
-
- def generate_iterative(self, user_prompt: str, output_path: str,
- iterations: int = 2,
- doc_type: str = "default") -> Dict[str, Any]:
- """
- Generate scientific schematic with smart iterative refinement.
-
- Only regenerates if the quality score is below the threshold for the
- specified document type. This saves API calls and time when the first
- generation is already good enough.
-
- Args:
- user_prompt: User's description of desired diagram
- output_path: Path to save final image
- iterations: Maximum refinement iterations (default: 2, max: 2)
- doc_type: Document type for quality threshold (journal, poster, etc.)
-
- Returns:
- Dictionary with generation results and metadata
- """
- output_path = Path(output_path)
- output_dir = output_path.parent
- output_dir.mkdir(parents=True, exist_ok=True)
-
- base_name = output_path.stem
- extension = output_path.suffix or ".png"
-
- # Get quality threshold for this document type
- threshold = self.QUALITY_THRESHOLDS.get(doc_type.lower(),
- self.QUALITY_THRESHOLDS["default"])
-
- results = {
- "user_prompt": user_prompt,
- "doc_type": doc_type,
- "quality_threshold": threshold,
- "iterations": [],
- "final_image": None,
- "final_score": 0.0,
- "success": False,
- "early_stop": False,
- "early_stop_reason": None
- }
-
- current_prompt = f"""{self.SCIENTIFIC_DIAGRAM_GUIDELINES}
-
-USER REQUEST: {user_prompt}
-
-Generate a publication-quality scientific diagram that meets all the guidelines above."""
-
- print(f"\n{'='*60}")
- print(f"Generating Scientific Schematic")
- print(f"{'='*60}")
- print(f"Description: {user_prompt}")
- print(f"Document Type: {doc_type}")
- print(f"Quality Threshold: {threshold}/10")
- print(f"Max Iterations: {iterations}")
- print(f"Output: {output_path}")
- print(f"{'='*60}\n")
-
- for i in range(1, iterations + 1):
- print(f"\n[Iteration {i}/{iterations}]")
- print("-" * 40)
-
- # Generate image
- print(f"Generating image...")
- image_data = self.generate_image(current_prompt)
-
- if not image_data:
- error_msg = getattr(self, '_last_error', 'Image generation failed - no image data returned')
- print(f"✗ Generation failed: {error_msg}")
- results["iterations"].append({
- "iteration": i,
- "success": False,
- "error": error_msg
- })
- continue
-
- # Save iteration image
- iter_path = output_dir / f"{base_name}_v{i}{extension}"
- with open(iter_path, "wb") as f:
- f.write(image_data)
- print(f"✓ Saved: {iter_path}")
-
- # Review image using Gemini 3.6 Flash
- print(f"Reviewing image with Gemini 3.6 Flash...")
- critique, score, needs_improvement = self.review_image(
- str(iter_path), user_prompt, i, doc_type, iterations
- )
- print(f"✓ Score: {score}/10 (threshold: {threshold}/10)")
-
- # Save iteration results
- iteration_result = {
- "iteration": i,
- "image_path": str(iter_path),
- "prompt": current_prompt,
- "critique": critique,
- "score": score,
- "needs_improvement": needs_improvement,
- "success": True
- }
- results["iterations"].append(iteration_result)
-
- # Check if quality is acceptable - STOP EARLY if so
- if not needs_improvement:
- print(f"\n✓ Quality meets {doc_type} threshold ({score} >= {threshold})")
- print(f" No further iterations needed!")
- results["final_image"] = str(iter_path)
- results["final_score"] = score
- results["success"] = True
- results["early_stop"] = True
- results["early_stop_reason"] = f"Quality score {score} meets threshold {threshold} for {doc_type}"
- break
-
- # If this is the last iteration, we're done regardless
- if i == iterations:
- print(f"\n⚠ Maximum iterations reached")
- results["final_image"] = str(iter_path)
- results["final_score"] = score
- results["success"] = True
- break
-
- # Quality below threshold - improve prompt for next iteration
- print(f"\n⚠ Quality below threshold ({score} < {threshold})")
- print(f"Improving prompt based on feedback...")
- current_prompt = self.improve_prompt(user_prompt, critique, i + 1)
-
- # Copy final version to output path
- if results["success"] and results["final_image"]:
- final_iter_path = Path(results["final_image"])
- if final_iter_path != output_path:
- import shutil
- shutil.copy(final_iter_path, output_path)
- print(f"\n✓ Final image: {output_path}")
-
- # Save review log
- log_path = output_dir / f"{base_name}_review_log.json"
- with open(log_path, "w") as f:
- json.dump(results, f, indent=2)
- print(f"✓ Review log: {log_path}")
-
- print(f"\n{'='*60}")
- print(f"Generation Complete!")
- print(f"Final Score: {results['final_score']}/10")
- if results["early_stop"]:
- print(f"Iterations Used: {len([r for r in results['iterations'] if r.get('success')])}/{iterations} (early stop)")
- print(f"{'='*60}\n")
-
- return results
-
-
-def main():
- """Command-line interface."""
- parser = argparse.ArgumentParser(
- description="Generate scientific schematics using AI with smart iterative refinement",
- formatter_class=argparse.RawDescriptionHelpFormatter,
- epilog="""
-Examples:
- # Generate a flowchart for a journal paper
- python generate_schematic_ai.py "CONSORT participant flow diagram" -o flowchart.png --doc-type journal
-
- # Generate neural network architecture for presentation (lower threshold)
- python generate_schematic_ai.py "Transformer encoder-decoder architecture" -o transformer.png --doc-type presentation
-
- # Generate with custom max iterations for poster
- python generate_schematic_ai.py "Biological signaling pathway" -o pathway.png --iterations 2 --doc-type poster
-
- # Verbose output
- python generate_schematic_ai.py "Circuit diagram" -o circuit.png -v
-
-Document Types (quality thresholds):
- journal 8.5/10 - Nature, Science, peer-reviewed journals
- conference 8.0/10 - Conference papers
- thesis 8.0/10 - Dissertations, theses
- grant 8.0/10 - Grant proposals
- preprint 7.5/10 - arXiv, bioRxiv, etc.
- report 7.5/10 - Technical reports
- poster 7.0/10 - Academic posters
- presentation 6.5/10 - Slides, talks
- default 7.5/10 - General purpose
-
-Note: Multiple iterations only occur if quality is BELOW the threshold.
- If the first generation meets the threshold, no extra API calls are made.
-
-Environment:
- OPENROUTER_API_KEY OpenRouter API key (required)
- """
- )
-
- parser.add_argument("prompt", help="Description of the diagram to generate")
- parser.add_argument("-o", "--output", required=True,
- help="Output image path (e.g., diagram.png)")
- parser.add_argument("--iterations", type=int, default=2,
- help="Maximum refinement iterations (default: 2, max: 2)")
- parser.add_argument("--doc-type", default="default",
- choices=["journal", "conference", "poster", "presentation",
- "report", "grant", "thesis", "preprint", "default"],
- help="Document type for quality threshold (default: default)")
- parser.add_argument("--api-key", help="OpenRouter API key (or set OPENROUTER_API_KEY)")
- parser.add_argument("-v", "--verbose", action="store_true",
- help="Verbose output")
-
- args = parser.parse_args()
-
- # Check for API key
- api_key = args.api_key or os.getenv("OPENROUTER_API_KEY")
- if not api_key:
- print("Error: OPENROUTER_API_KEY environment variable not set")
- print("\nSet it with:")
- print(" export OPENROUTER_API_KEY='your_api_key'")
- print("\nOr provide via --api-key flag")
- sys.exit(1)
-
- # Validate iterations - enforce max of 2
- if args.iterations < 1 or args.iterations > 2:
- print("Error: Iterations must be between 1 and 2")
- sys.exit(1)
-
- try:
- generator = ScientificSchematicGenerator(api_key=api_key, verbose=args.verbose)
- results = generator.generate_iterative(
- user_prompt=args.prompt,
- output_path=args.output,
- iterations=args.iterations,
- doc_type=args.doc_type
- )
-
- if results["success"]:
- print(f"\n✓ Success! Image saved to: {args.output}")
- if results.get("early_stop"):
- print(f" (Completed in {len([r for r in results['iterations'] if r.get('success')])} iteration(s) - quality threshold met)")
- sys.exit(0)
- else:
- print(f"\n✗ Generation failed. Check review log for details.")
- sys.exit(1)
- except Exception as e:
- print(f"\n✗ Error: {str(e)}")
- sys.exit(1)
-
-
-if __name__ == "__main__":
- main()
-
diff --git a/skills/treatment-plans/scripts/generate_template.py b/skills/treatment-plans/scripts/generate_template.py
index a5860c56..31fb096b 100644
--- a/skills/treatment-plans/scripts/generate_template.py
+++ b/skills/treatment-plans/scripts/generate_template.py
@@ -1,244 +1,133 @@
#!/usr/bin/env python3
-"""
-Generate Treatment Plan Template
-Interactive script to select and generate treatment plan templates.
-"""
+"""Generate a fail-closed local JSON documentation package."""
+
+from __future__ import annotations
-import os
-import sys
-import shutil
import argparse
+import sys
from pathlib import Path
-from datetime import datetime
-# Template types and descriptions
-TEMPLATES = {
- 'general_medical': {
- 'name': 'General Medical Treatment Plan',
- 'file': 'general_medical_treatment_plan.tex',
- 'description': 'For primary care and chronic disease management (diabetes, hypertension, etc.)'
- },
- 'rehabilitation': {
- 'name': 'Rehabilitation Treatment Plan',
- 'file': 'rehabilitation_treatment_plan.tex',
- 'description': 'For physical therapy, occupational therapy, and rehabilitation services'
- },
- 'mental_health': {
- 'name': 'Mental Health Treatment Plan',
- 'file': 'mental_health_treatment_plan.tex',
- 'description': 'For psychiatric and behavioral health treatment'
- },
- 'chronic_disease': {
- 'name': 'Chronic Disease Management Plan',
- 'file': 'chronic_disease_management_plan.tex',
- 'description': 'For complex multimorbidity and long-term care coordination'
- },
- 'perioperative': {
- 'name': 'Perioperative Care Plan',
- 'file': 'perioperative_care_plan.tex',
- 'description': 'For surgical and procedural patient management'
- },
- 'pain_management': {
- 'name': 'Pain Management Plan',
- 'file': 'pain_management_plan.tex',
- 'description': 'For acute and chronic pain treatment (multimodal approach)'
+from _common import (
+ IDENTIFIER_RE,
+ TEMPLATE_FILES,
+ ValidationError,
+ atomic_write_json,
+ copy_template_document,
+ error_report,
+ print_report,
+ report_payload,
+ safe_new_directory,
+)
+
+
+def generate_package(
+ output_directory: str,
+ *,
+ subject_ref: str,
+ classification: str,
+ acknowledge_real_patient_local_processing: bool = False,
+) -> dict:
+ """Copy all templates without generating any clinical content."""
+
+ if not IDENTIFIER_RE.fullmatch(subject_ref):
+ raise ValidationError("SUBJECT_REFERENCE_FORMAT")
+ allowed = {
+ "synthetic",
+ "deidentified_qualified_review",
+ "real_patient_minimum_necessary",
}
-}
-
-
-def get_templates_dir():
- """Get the path to the templates directory."""
- # Assume script is in .claude/skills/treatment-plans/scripts/
- script_dir = Path(__file__).parent
- templates_dir = script_dir.parent / 'assets'
- return templates_dir
-
-
-def list_templates():
- """Display available templates."""
- print("\n" + "="*70)
- print("AVAILABLE TREATMENT PLAN TEMPLATES")
- print("="*70)
-
- for i, (key, info) in enumerate(TEMPLATES.items(), 1):
- print(f"\n{i}. {info['name']}")
- print(f" Type: {key}")
- print(f" File: {info['file']}")
- print(f" Description: {info['description']}")
-
- print("\n" + "="*70)
-
-
-def interactive_selection():
- """Interactive template selection."""
- list_templates()
-
- while True:
- try:
- choice = input("\nSelect template number (1-6) or 'q' to quit: ").strip().lower()
-
- if choice == 'q':
- print("Exiting...")
- sys.exit(0)
-
- choice_num = int(choice)
-
- if 1 <= choice_num <= len(TEMPLATES):
- template_key = list(TEMPLATES.keys())[choice_num - 1]
- return template_key
- else:
- print(f"Please enter a number between 1 and {len(TEMPLATES)}.")
- except ValueError:
- print("Invalid input. Please enter a number or 'q' to quit.")
-
-
-def get_output_filename(template_key, custom_name=None):
- """Generate output filename."""
- if custom_name:
- # Ensure .tex extension
- if not custom_name.endswith('.tex'):
- custom_name += '.tex'
- return custom_name
-
- # Default: template_key_YYYYMMDD.tex
- timestamp = datetime.now().strftime('%Y%m%d')
- return f"{template_key}_plan_{timestamp}.tex"
-
-
-def copy_template(template_key, output_path):
- """Copy template to output location."""
- templates_dir = get_templates_dir()
- template_file = TEMPLATES[template_key]['file']
- source_path = templates_dir / template_file
-
- if not source_path.exists():
- raise FileNotFoundError(f"Template not found: {source_path}")
-
- # Create output directory if it doesn't exist
- output_path = Path(output_path)
- output_path.parent.mkdir(parents=True, exist_ok=True)
-
- # Copy template
- shutil.copy2(source_path, output_path)
-
- return output_path
-
-
-def display_success(output_path, template_key):
- """Display success message with next steps."""
- template_info = TEMPLATES[template_key]
-
- print("\n" + "="*70)
- print("✓ TEMPLATE GENERATED SUCCESSFULLY")
- print("="*70)
- print(f"\nTemplate: {template_info['name']}")
- print(f"Output file: {output_path}")
- print(f"File size: {os.path.getsize(output_path):,} bytes")
-
- print("\n" + "-"*70)
- print("NEXT STEPS:")
- print("-"*70)
-
- print("\n1. CUSTOMIZE THE TEMPLATE:")
- print(" - Open the .tex file in your LaTeX editor")
- print(" - Replace all [bracketed placeholders] with patient-specific information")
- print(" - Remove or modify sections as appropriate for your patient")
-
- print("\n2. COMPILE TO PDF:")
- print(f" $ pdflatex {output_path.name}")
-
- print("\n3. VALIDATE (optional):")
- print(f" $ python check_completeness.py {output_path.name}")
- print(f" $ python validate_treatment_plan.py {output_path.name}")
-
- print("\n4. DE-IDENTIFY BEFORE SHARING:")
- print(" - Remove all HIPAA identifiers (18 identifiers)")
- print(" - See regulatory_compliance.md reference for details")
-
- print("\n" + "="*70)
+ if classification not in allowed:
+ raise ValidationError("DATA_CLASSIFICATION_INVALID")
+ if (
+ classification == "real_patient_minimum_necessary"
+ and not acknowledge_real_patient_local_processing
+ ):
+ raise ValidationError("REAL_PATIENT_LOCAL_ACK_REQUIRED")
+
+ assets = Path(__file__).resolve().parents[1] / "assets"
+ prepared: list[tuple[str, dict]] = []
+ for _, (template_name, output_name) in TEMPLATE_FILES.items():
+ document = copy_template_document(
+ assets / template_name,
+ subject_ref=subject_ref,
+ classification=classification,
+ )
+ prepared.append((output_name, document))
+
+ destination = safe_new_directory(output_directory)
+ for output_name, document in prepared:
+ atomic_write_json(destination / output_name, document)
+
+ return report_payload(
+ "generate_template",
+ [],
+ counts={"documents_generated": len(prepared)},
+ extra={
+ "generated_filenames": sorted(name for name, _ in prepared),
+ "release_status": "blocked",
+ "clinical_content_generated": False,
+ "external_processing_authorized": False,
+ },
+ )
-def main():
+def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
- description='Generate treatment plan template',
- formatter_class=argparse.RawDescriptionHelpFormatter,
- epilog="""
-Examples:
- # Interactive mode (recommended for first-time users)
- python generate_template.py
-
- # Direct generation with type specification
- python generate_template.py --type general_medical --output diabetes_plan.tex
-
- # Generate with default filename
- python generate_template.py --type mental_health
-
- # List available templates
- python generate_template.py --list
-
-Available template types:
- general_medical, rehabilitation, mental_health, chronic_disease,
- perioperative, pain_management
- """
+ description=(
+ "Create six local, generic JSON treatment-plan documentation "
+ "templates. No clinical content is generated."
+ )
)
-
parser.add_argument(
- '--type',
- choices=list(TEMPLATES.keys()),
- help='Template type to generate'
+ "--output-dir",
+ required=True,
+ help="New local directory; existing paths are rejected",
)
-
parser.add_argument(
- '--output',
- help='Output filename (default: auto-generated with timestamp)'
+ "--subject-ref",
+ default="SYNTHETIC-CASE-001",
+ help=(
+ "Local pseudonymous identifier; never use a name, MRN, or other "
+ "direct identifier"
+ ),
)
-
parser.add_argument(
- '--list',
- action='store_true',
- help='List available templates and exit'
+ "--classification",
+ choices=[
+ "synthetic",
+ "deidentified_qualified_review",
+ "real_patient_minimum_necessary",
+ ],
+ default="synthetic",
)
-
- args = parser.parse_args()
-
- # List templates and exit
- if args.list:
- list_templates()
- return
-
- # Determine template type
- if args.type:
- template_key = args.type
- print(f"\nGenerating template: {TEMPLATES[template_key]['name']}")
- else:
- # Interactive mode
- template_key = interactive_selection()
-
- # Determine output filename
- if args.output:
- output_filename = args.output
- else:
- output_filename = get_output_filename(template_key)
-
- # Default output to current directory
- output_path = Path.cwd() / output_filename
-
- # Confirm overwrite if file exists
- if output_path.exists():
- response = input(f"\nFile {output_filename} already exists. Overwrite? (y/n): ").strip().lower()
- if response != 'y':
- print("Cancelled.")
- return
-
- # Copy template
- try:
- output_path = copy_template(template_key, output_path)
- display_success(output_path, template_key)
- except Exception as e:
- print(f"\n✗ ERROR: {e}", file=sys.stderr)
- sys.exit(1)
-
+ parser.add_argument(
+ "--acknowledge-real-patient-local-processing",
+ action="store_true",
+ help=(
+ "Required only for real_patient_minimum_necessary; confirms that "
+ "the user will apply the documented local-only data gate"
+ ),
+ )
+ return parser
-if __name__ == '__main__':
- main()
+def main() -> int:
+ args = build_parser().parse_args()
+ try:
+ report = generate_package(
+ args.output_dir,
+ subject_ref=args.subject_ref,
+ classification=args.classification,
+ acknowledge_real_patient_local_processing=(
+ args.acknowledge_real_patient_local_processing
+ ),
+ )
+ except ValidationError as exc:
+ print_report(error_report("generate_template", exc))
+ return 1
+ print_report(report)
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/treatment-plans/scripts/privacy_process_check.py b/skills/treatment-plans/scripts/privacy_process_check.py
new file mode 100644
index 00000000..ea48a587
--- /dev/null
+++ b/skills/treatment-plans/scripts/privacy_process_check.py
@@ -0,0 +1,213 @@
+#!/usr/bin/env python3
+"""Check documented privacy process without determining compliance."""
+
+from __future__ import annotations
+
+import argparse
+import sys
+
+from _common import (
+ Issue,
+ ValidationError,
+ direct_identifier_key_paths,
+ error_report,
+ load_package,
+ print_report,
+ report_payload,
+ validate_package_structure,
+)
+
+
+def check_privacy_process(documents: dict[str, dict]) -> dict:
+ issues = validate_package_structure(documents)
+ if issues:
+ return report_payload(
+ "privacy_process",
+ issues,
+ counts={"structural_issues": len(issues)},
+ )
+
+ handoff = documents["intended_use_handoff_record"]
+ classification = handoff["data_classification"]
+ privacy = handoff["privacy_process"]
+
+ for document_type, document in documents.items():
+ if document["data_classification"] != classification:
+ issues.append(
+ Issue(
+ "DATA_CLASSIFICATION_MISMATCH",
+ f"{document_type}:$.data_classification",
+ )
+ )
+ if document["subject_ref"] != handoff["subject_ref"]:
+ issues.append(
+ Issue(
+ "SUBJECT_REFERENCE_MISMATCH",
+ f"{document_type}:$.subject_ref",
+ )
+ )
+ for path in direct_identifier_key_paths(document):
+ issues.append(
+ Issue(
+ "DIRECT_IDENTIFIER_FIELD_NAME_PROHIBITED",
+ f"{document_type}:{path}",
+ )
+ )
+
+ if privacy["data_classification"] != classification:
+ issues.append(
+ Issue(
+ "PRIVACY_CLASSIFICATION_MISMATCH",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.data_classification"
+ ),
+ )
+ )
+
+ required_true = (
+ "local_authorization_confirmed",
+ "minimum_necessary_confirmed",
+ "no_external_tools_confirmed",
+ "no_prompt_log_example_copy_confirmed",
+ )
+ for field in required_true:
+ if privacy[field] is not True:
+ issues.append(
+ Issue(
+ "PRIVACY_ATTESTATION_REQUIRED",
+ f"intended_use_handoff_record:$.privacy_process.{field}",
+ )
+ )
+
+ for field in (
+ "authorized_environment_reference",
+ "retention_policy_reference",
+ ):
+ if not privacy[field].strip():
+ issues.append(
+ Issue(
+ "PRIVACY_REFERENCE_REQUIRED",
+ f"intended_use_handoff_record:$.privacy_process.{field}",
+ )
+ )
+
+ if privacy["data_disposition_status"] == "pending":
+ issues.append(
+ Issue(
+ "DATA_DISPOSITION_NOT_DOCUMENTED",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.data_disposition_status"
+ ),
+ )
+ )
+
+ if classification == "synthetic":
+ if not handoff["subject_ref"].startswith("SYNTHETIC-"):
+ issues.append(
+ Issue(
+ "SYNTHETIC_REFERENCE_NOT_MARKED",
+ "intended_use_handoff_record:$.subject_ref",
+ )
+ )
+ if privacy["privacy_review_status"] not in {
+ "not_applicable_synthetic",
+ "completed_by_qualified_reviewer",
+ }:
+ issues.append(
+ Issue(
+ "SYNTHETIC_PRIVACY_STATUS_PENDING",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.privacy_review_status"
+ ),
+ )
+ )
+ else:
+ if (
+ privacy["privacy_review_status"]
+ != "completed_by_qualified_reviewer"
+ ):
+ issues.append(
+ Issue(
+ "QUALIFIED_PRIVACY_REVIEW_REQUIRED",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.privacy_review_status"
+ ),
+ )
+ )
+ if not privacy["privacy_reviewer_role"].strip():
+ issues.append(
+ Issue(
+ "PRIVACY_REVIEWER_ROLE_REQUIRED",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.privacy_reviewer_role"
+ ),
+ )
+ )
+ if privacy["reviewed_at"] is None:
+ issues.append(
+ Issue(
+ "PRIVACY_REVIEW_TIME_REQUIRED",
+ (
+ "intended_use_handoff_record:"
+ "$.privacy_process.reviewed_at"
+ ),
+ )
+ )
+ issues.append(
+ Issue(
+ "PATIENT_DERIVED_FREE_TEXT_REQUIRES_LOCAL_REVIEW",
+ "$",
+ "warning",
+ )
+ )
+
+ issues.sort(key=lambda item: (item.path, item.code))
+ return report_payload(
+ "privacy_process",
+ issues,
+ counts={
+ "documents_checked": len(documents),
+ "direct_identifier_field_paths": sum(
+ len(direct_identifier_key_paths(document))
+ for document in documents.values()
+ ),
+ },
+ extra={
+ "deidentification_determined": False,
+ "hipaa_compliance_determined": False,
+ "external_processing_authorized": False,
+ "values_scanned_or_echoed": False,
+ },
+ )
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(
+ description=(
+ "Check local authorization, minimization, no-external-tool, "
+ "qualified-review, retention, and direct-field declarations. "
+ "This is not a de-identification or compliance determination."
+ )
+ )
+ parser.add_argument("package", help="Complete local package directory")
+ return parser
+
+
+def main() -> int:
+ args = build_parser().parse_args()
+ try:
+ documents, _ = load_package(args.package)
+ report = check_privacy_process(documents)
+ except ValidationError as exc:
+ report = error_report("privacy_process", exc)
+ print_report(report)
+ return 1 if report["status"] == "fail" else 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/treatment-plans/scripts/timeline_generator.py b/skills/treatment-plans/scripts/timeline_generator.py
index b3118048..21ab13cd 100644
--- a/skills/treatment-plans/scripts/timeline_generator.py
+++ b/skills/treatment-plans/scripts/timeline_generator.py
@@ -1,369 +1,260 @@
#!/usr/bin/env python3
-"""
-Treatment Timeline Generator
-Generates visual treatment timelines from treatment plan files.
-"""
+"""Create a schedule from explicitly supplied dates only."""
+
+from __future__ import annotations
-import sys
-import re
import argparse
-from pathlib import Path
-from datetime import datetime, timedelta
-from typing import List, Dict, Tuple
+import sys
+from datetime import date
-# Try to import matplotlib, but make it optional
-try:
- import matplotlib.pyplot as plt
- import matplotlib.dates as mdates
- from matplotlib.patches import Rectangle
- HAS_MATPLOTLIB = True
-except ImportError:
- HAS_MATPLOTLIB = False
+from _common import (
+ NOTICE,
+ SCHEMA_VERSION,
+ Issue,
+ ValidationError,
+ atomic_write_json,
+ error_report,
+ load_package,
+ parse_iso_datetime,
+ print_report,
+ report_payload,
+ safe_output_file,
+ validate_package_structure,
+)
-def extract_timeline_info(content: str) -> Dict[str, List[Tuple[str, str]]]:
- """
- Extract timeline and schedule information from treatment plan.
- Returns dict with phases, appointments, milestones.
- """
- timeline_data = {
- 'phases': [],
- 'appointments': [],
- 'milestones': []
- }
-
- # Extract treatment phases
- # Look for patterns like "Week 1-4: Description" or "Months 1-3: Description"
- phase_patterns = [
- r'(Week[s]?\s*\d+[-–]\d+|Month[s]?\s*\d+[-–]\d+)[:\s]+([^\n]+)',
- r'(POD\s*\d+[-–]\d+)[:\s]+([^\n]+)',
- r'(\d+[-–]\d+\s*week[s]?)[:\s]+([^\n]+)'
- ]
-
- for pattern in phase_patterns:
- matches = re.findall(pattern, content, re.IGNORECASE)
- for timeframe, description in matches:
- timeline_data['phases'].append((timeframe.strip(), description.strip()))
-
- # Extract appointments
- # Look for patterns like "Week 2: Visit" or "Month 3: Follow-up"
- apt_patterns = [
- r'(Week\s*\d+|Month\s*\d+|POD\s*\d+)[:\s]+(Visit|Appointment|Follow-up|Check-up|Consultation)([^\n]*)',
- r'(Every\s+\d+\s+\w+)[:\s]+(Visit|Appointment|therapy|session)([^\n]*)'
- ]
-
- for pattern in apt_patterns:
- matches = re.findall(pattern, content, re.IGNORECASE)
- for timeframe, visit_type, details in matches:
- timeline_data['appointments'].append((timeframe.strip(), f"{visit_type}{details}".strip()))
-
- # Extract milestones/assessments
- # Look for "reassessment", "goal evaluation", "milestone" mentions
- milestone_patterns = [
- r'(Week\s*\d+|Month\s*\d+)[:\s]+(reassess|evaluation|assessment|milestone)([^\n]*)',
- r'(\w+\s*\d+)[:\s]+(HbA1c|labs?|imaging|test)([^\n]*)'
- ]
-
- for pattern in milestone_patterns:
- matches = re.findall(pattern, content, re.IGNORECASE)
- for timeframe, event_type, details in matches:
- timeline_data['milestones'].append((timeframe.strip(), f"{event_type}{details}".strip()))
-
- return timeline_data
+def _date_bound(value: str | None, code: str) -> date | None:
+ if value is None:
+ return None
+ try:
+ return date.fromisoformat(value)
+ except ValueError as exc:
+ raise ValidationError(code) from exc
-def parse_timeframe_to_days(timeframe: str) -> Tuple[int, int]:
- """
- Parse timeframe string to start and end days.
- Examples: "Week 1-4" -> (0, 28), "Month 3" -> (60, 90)
- """
- timeframe = timeframe.lower()
-
- # Week patterns
- if 'week' in timeframe:
- weeks = re.findall(r'\d+', timeframe)
- if len(weeks) == 2:
- start_week = int(weeks[0])
- end_week = int(weeks[1])
- return ((start_week - 1) * 7, end_week * 7)
- elif len(weeks) == 1:
- week = int(weeks[0])
- return ((week - 1) * 7, week * 7)
-
- # Month patterns
- if 'month' in timeframe:
- months = re.findall(r'\d+', timeframe)
- if len(months) == 2:
- start_month = int(months[0])
- end_month = int(months[1])
- return ((start_month - 1) * 30, end_month * 30)
- elif len(months) == 1:
- month = int(months[0])
- return ((month - 1) * 30, month * 30)
-
- # POD (post-operative day) patterns
- if 'pod' in timeframe:
- days = re.findall(r'\d+', timeframe)
- if len(days) == 2:
- return (int(days[0]), int(days[1]))
- elif len(days) == 1:
- day = int(days[0])
- return (day, day + 1)
-
- # Default fallback
- return (0, 7)
+def build_schedule(
+ documents: dict[str, dict],
+ *,
+ from_date: str | None = None,
+ through_date: str | None = None,
+) -> tuple[dict, dict]:
+ issues = validate_package_structure(documents)
+ if issues:
+ return (
+ report_payload(
+ "explicit_date_schedule",
+ issues,
+ counts={"structural_issues": len(issues)},
+ ),
+ {},
+ )
+ lower = _date_bound(from_date, "FROM_DATE_INVALID")
+ upper = _date_bound(through_date, "THROUGH_DATE_INVALID")
+ if lower and upper and lower > upper:
+ raise ValidationError("DATE_FILTER_ORDER_INVALID")
-def create_text_timeline(timeline_data: Dict, output_file: Path = None):
- """Create a text-based timeline representation."""
-
- lines = []
- lines.append("="*70)
- lines.append("TREATMENT TIMELINE")
- lines.append("="*70)
-
- # Treatment phases
- if timeline_data['phases']:
- lines.append("\nTREATMENT PHASES:")
- lines.append("-"*70)
- for timeframe, description in timeline_data['phases']:
- lines.append(f"{timeframe:20s} | {description}")
-
- # Appointments
- if timeline_data['appointments']:
- lines.append("\nSCHEDULED APPOINTMENTS:")
- lines.append("-"*70)
- for timeframe, details in timeline_data['appointments']:
- lines.append(f"{timeframe:20s} | {details}")
-
- # Milestones
- if timeline_data['milestones']:
- lines.append("\nMILESTONES & ASSESSMENTS:")
- lines.append("-"*70)
- for timeframe, event in timeline_data['milestones']:
- lines.append(f"{timeframe:20s} | {event}")
-
- lines.append("\n" + "="*70)
-
- # Output
- output_text = "\n".join(lines)
-
- if output_file:
- with open(output_file, 'w') as f:
- f.write(output_text)
- print(f"\nText timeline saved to: {output_file}")
- else:
- print(output_text)
-
- return output_text
+ events: list[dict] = []
+ def add_event(
+ value: str | None,
+ *,
+ event_type: str,
+ document_type: str,
+ record_index: int | None,
+ date_field: str,
+ ) -> None:
+ if value is None:
+ return
+ event_date = value[:10]
+ parsed = date.fromisoformat(event_date)
+ if lower and parsed < lower:
+ return
+ if upper and parsed > upper:
+ return
+ events.append(
+ {
+ "date": event_date,
+ "event_type": event_type,
+ "source_document_type": document_type,
+ "record_index": record_index,
+ "date_field": date_field,
+ }
+ )
-def create_visual_timeline(timeline_data: Dict, output_file: Path, start_date: str = None):
- """Create a visual Gantt-chart style timeline (requires matplotlib)."""
-
- if not HAS_MATPLOTLIB:
- print("Error: matplotlib not installed. Install with: pip install matplotlib", file=sys.stderr)
- print("Generating text timeline instead...", file=sys.stderr)
- text_output = output_file.with_suffix('.txt')
- create_text_timeline(timeline_data, text_output)
- return
-
- # Parse start date
- if start_date:
- try:
- start = datetime.strptime(start_date, '%Y-%m-%d')
- except ValueError:
- print(f"Invalid date format: {start_date}. Using today.", file=sys.stderr)
- start = datetime.now()
- else:
- start = datetime.now()
-
- # Prepare data for plotting
- phases = []
- for timeframe, description in timeline_data['phases']:
- start_day, end_day = parse_timeframe_to_days(timeframe)
- phases.append({
- 'name': f"{timeframe}: {description[:40]}",
- 'start': start + timedelta(days=start_day),
- 'end': start + timedelta(days=end_day),
- 'type': 'phase'
- })
-
- # Add appointments as events
- events = []
- for timeframe, details in timeline_data['appointments']:
- start_day, _ = parse_timeframe_to_days(timeframe)
- events.append({
- 'name': f"{timeframe}: {details[:40]}",
- 'date': start + timedelta(days=start_day),
- 'type': 'appointment'
- })
-
- # Add milestones
- for timeframe, event in timeline_data['milestones']:
- start_day, _ = parse_timeframe_to_days(timeframe)
- events.append({
- 'name': f"{timeframe}: {event[:40]}",
- 'date': start + timedelta(days=start_day),
- 'type': 'milestone'
- })
-
- # Create figure
- fig, ax = plt.subplots(figsize=(12, 8))
-
- # Plot phases as horizontal bars
- y_position = len(phases) + len(events)
-
- for i, phase in enumerate(phases):
- duration = (phase['end'] - phase['start']).days
- ax.barh(y_position - i, duration, left=mdates.date2num(phase['start']),
- height=0.6, color='steelblue', alpha=0.7, edgecolor='black')
- ax.text(mdates.date2num(phase['start']) + duration/2, y_position - i,
- phase['name'], va='center', ha='center', fontsize=9, color='white', weight='bold')
-
- # Plot events as markers
- event_y = y_position - len(phases) - 1
-
- for i, event in enumerate(events):
- marker = 'o' if event['type'] == 'appointment' else 's'
- color = 'green' if event['type'] == 'appointment' else 'orange'
- ax.plot(mdates.date2num(event['date']), event_y - i, marker=marker,
- markersize=10, color=color, markeredgecolor='black')
- ax.text(mdates.date2num(event['date']) + 2, event_y - i, event['name'],
- va='center', ha='left', fontsize=8)
-
- # Format x-axis as dates
- ax.xaxis.set_major_formatter(mdates.DateFormatter('%b %Y'))
- ax.xaxis.set_major_locator(mdates.MonthLocator())
- plt.xticks(rotation=45, ha='right')
-
- # Labels and title
- ax.set_xlabel('Date', fontsize=12, weight='bold')
- ax.set_title('Treatment Plan Timeline', fontsize=14, weight='bold', pad=20)
- ax.set_yticks([])
- ax.grid(axis='x', alpha=0.3, linestyle='--')
-
- # Legend
- from matplotlib.lines import Line2D
- legend_elements = [
- Rectangle((0, 0), 1, 1, fc='steelblue', alpha=0.7, edgecolor='black', label='Treatment Phase'),
- Line2D([0], [0], marker='o', color='w', markerfacecolor='green', markersize=10,
- markeredgecolor='black', label='Appointment'),
- Line2D([0], [0], marker='s', color='w', markerfacecolor='orange', markersize=10,
- markeredgecolor='black', label='Milestone/Assessment')
- ]
- ax.legend(handles=legend_elements, loc='upper right', framealpha=0.9)
-
- plt.tight_layout()
-
- # Save
- plt.savefig(output_file, dpi=300, bbox_inches='tight')
- print(f"\nVisual timeline saved to: {output_file}")
-
- # Close plot
- plt.close()
+ interventions = documents[
+ "clinician_authored_intervention_record"
+ ]["interventions"]
+ for index, record in enumerate(interventions):
+ add_event(
+ record["start_date"],
+ event_type="intervention_start_as_supplied",
+ document_type="clinician_authored_intervention_record",
+ record_index=index,
+ date_field="start_date",
+ )
+ add_event(
+ record["end_date"],
+ event_type="intervention_end_as_supplied",
+ document_type="clinician_authored_intervention_record",
+ record_index=index,
+ date_field="end_date",
+ )
+ planning = documents["goals_monitoring_checkpoint_record"]
+ for index, record in enumerate(planning["goals"]):
+ add_event(
+ record["target_date"],
+ event_type="goal_target_date_as_supplied",
+ document_type="goals_monitoring_checkpoint_record",
+ record_index=index,
+ date_field="goals.target_date",
+ )
+ if record["target_date"] is None:
+ issues.append(
+ Issue(
+ "GOAL_HAS_NO_EXPLICIT_TARGET_DATE",
+ (
+ "goals_monitoring_checkpoint_record:"
+ f"$.goals[{index}].target_date"
+ ),
+ "warning",
+ )
+ )
+ for index, record in enumerate(planning["monitoring_items"]):
+ add_event(
+ record["next_due_date"],
+ event_type="monitoring_due_date_as_supplied",
+ document_type="goals_monitoring_checkpoint_record",
+ record_index=index,
+ date_field="monitoring_items.next_due_date",
+ )
+ if record["frequency_as_supplied"] and record["next_due_date"] is None:
+ issues.append(
+ Issue(
+ "FREQUENCY_TEXT_NOT_EXPANDED_WITHOUT_EXPLICIT_DATE",
+ (
+ "goals_monitoring_checkpoint_record:"
+ f"$.monitoring_items[{index}].next_due_date"
+ ),
+ "warning",
+ )
+ )
+ for index, record in enumerate(planning["checkpoints"]):
+ add_event(
+ record["checkpoint_date"],
+ event_type="checkpoint_date_as_supplied",
+ document_type="goals_monitoring_checkpoint_record",
+ record_index=index,
+ date_field="checkpoints.checkpoint_date",
+ )
-def main():
- parser = argparse.ArgumentParser(
- description='Generate treatment timeline visualization',
- formatter_class=argparse.RawDescriptionHelpFormatter,
- epilog="""
-Examples:
- # Generate text timeline
- python timeline_generator.py --plan my_plan.tex
+ transition = documents["transition_reconciliation_record"][
+ "transition"
+ ]
+ add_event(
+ transition["handoff_date"],
+ event_type="transition_handoff_date_as_supplied",
+ document_type="transition_reconciliation_record",
+ record_index=None,
+ date_field="transition.handoff_date",
+ )
+
+ intended = documents["intended_use_handoff_record"]
+ for field, event_type in (
+ ("sent_at", "documentation_handoff_sent_as_supplied"),
+ ):
+ timestamp = intended["handoff"][field]
+ if timestamp is not None and parse_iso_datetime(timestamp) is not None:
+ add_event(
+ timestamp,
+ event_type=event_type,
+ document_type="intended_use_handoff_record",
+ record_index=None,
+ date_field=f"handoff.{field}",
+ )
- # Generate visual timeline (requires matplotlib)
- python timeline_generator.py --plan my_plan.tex --output timeline.png --visual
+ events.sort(
+ key=lambda item: (
+ item["date"],
+ item["event_type"],
+ item["source_document_type"],
+ -1 if item["record_index"] is None else item["record_index"],
+ )
+ )
+ if not events:
+ issues.append(Issue("NO_EXPLICIT_DATES_IN_FILTER", "$"))
- # Specify start date for visual timeline
- python timeline_generator.py --plan my_plan.tex --output timeline.pdf --visual --start 2025-02-01
+ schedule = {
+ "schema_version": SCHEMA_VERSION,
+ "document_type": "explicit_date_schedule",
+ "status": "DRAFT_NOT_FOR_CLINICAL_USE",
+ "notice": NOTICE,
+ "dates_inferred": False,
+ "recurrences_generated": False,
+ "clinical_intervals_generated": False,
+ "filters": {
+ "from_date": from_date,
+ "through_date": through_date,
+ },
+ "events": events,
+ }
+ issues.sort(key=lambda item: (item.path, item.code))
+ report = report_payload(
+ "explicit_date_schedule",
+ issues,
+ counts={"events": len(events)},
+ extra={
+ "dates_inferred": False,
+ "recurrences_generated": False,
+ "clinical_content_interpreted": False,
+ },
+ )
+ return report, schedule
-Output formats:
- Text: .txt
- Visual: .png, .pdf, .svg (requires matplotlib)
-Note: Visual timeline generation requires matplotlib.
- Install with: pip install matplotlib
- """
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(
+ description=(
+ "Write a local JSON schedule containing only dates explicitly "
+ "supplied by authorized clinicians. Frequencies are never expanded."
+ )
)
-
+ parser.add_argument("package", help="Complete local package directory")
parser.add_argument(
- '--plan',
- type=Path,
+ "--output",
required=True,
- help='Treatment plan file to analyze (.tex format)'
+ help="New local .json output; existing files are rejected",
)
-
parser.add_argument(
- '--output',
- type=Path,
- help='Output file (default: timeline.txt or timeline.png if --visual)'
+ "--from-date",
+ help="Optional inclusive YYYY-MM-DD filter; no default is inferred",
)
-
parser.add_argument(
- '--visual',
- action='store_true',
- help='Generate visual timeline (requires matplotlib)'
+ "--through-date",
+ help="Optional inclusive YYYY-MM-DD filter; no default is inferred",
)
-
- parser.add_argument(
- '--start',
- help='Start date for timeline (YYYY-MM-DD format, default: today)'
- )
-
- args = parser.parse_args()
-
- # Check plan file exists
- if not args.plan.exists():
- print(f"Error: File not found: {args.plan}", file=sys.stderr)
- sys.exit(1)
-
- # Read plan
- try:
- with open(args.plan, 'r', encoding='utf-8') as f:
- content = f.read()
- except Exception as e:
- print(f"Error reading file: {e}", file=sys.stderr)
- sys.exit(1)
-
- # Extract timeline information
- print("Extracting timeline information from treatment plan...")
- timeline_data = extract_timeline_info(content)
-
- # Check if any timeline info found
- total_items = (len(timeline_data['phases']) +
- len(timeline_data['appointments']) +
- len(timeline_data['milestones']))
-
- if total_items == 0:
- print("\nWarning: No timeline information detected in treatment plan.", file=sys.stderr)
- print("The plan may not contain structured timeline/schedule sections.", file=sys.stderr)
- print("\nTip: Include sections with timeframes like:", file=sys.stderr)
- print(" - Week 1-4: Initial phase", file=sys.stderr)
- print(" - Month 3: Follow-up visit", file=sys.stderr)
- sys.exit(1)
-
- print(f"Found {len(timeline_data['phases'])} phase(s), "
- f"{len(timeline_data['appointments'])} appointment(s), "
- f"{len(timeline_data['milestones'])} milestone(s)")
-
- # Determine output file
- if not args.output:
- if args.visual:
- args.output = Path('timeline.png')
- else:
- args.output = Path('timeline.txt')
-
- # Generate timeline
- if args.visual:
- create_visual_timeline(timeline_data, args.output, args.start)
- else:
- create_text_timeline(timeline_data, args.output)
-
- print(f"\nTimeline generation complete!")
+ return parser
-if __name__ == '__main__':
- main()
+def main() -> int:
+ args = build_parser().parse_args()
+ try:
+ documents, _ = load_package(args.package)
+ report, schedule = build_schedule(
+ documents,
+ from_date=args.from_date,
+ through_date=args.through_date,
+ )
+ if report["status"] == "pass":
+ output = safe_output_file(args.output)
+ atomic_write_json(output, schedule)
+ report["output_filename"] = output.name
+ except ValidationError as exc:
+ report = error_report("explicit_date_schedule", exc)
+ print_report(report)
+ return 1 if report["status"] == "fail" else 0
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/treatment-plans/scripts/validate_traceability.py b/skills/treatment-plans/scripts/validate_traceability.py
new file mode 100644
index 00000000..a2f485cb
--- /dev/null
+++ b/skills/treatment-plans/scripts/validate_traceability.py
@@ -0,0 +1,147 @@
+#!/usr/bin/env python3
+"""Validate source-fact traceability without interpreting source content."""
+
+from __future__ import annotations
+
+import argparse
+import sys
+
+from _common import (
+ Issue,
+ ValidationError,
+ all_fact_references,
+ error_report,
+ load_package,
+ print_report,
+ report_payload,
+ validate_package_structure,
+)
+
+
+def validate_traceability(documents: dict[str, dict]) -> dict:
+ issues = validate_package_structure(documents)
+ if issues:
+ return report_payload(
+ "source_fact_traceability",
+ issues,
+ counts={"structural_issues": len(issues)},
+ )
+
+ manifest = documents["source_fact_manifest"]
+ facts = manifest["facts"]
+ fact_index = {
+ fact["fact_id"]: (index, fact) for index, fact in enumerate(facts)
+ }
+ references = all_fact_references(documents)
+ referenced_ids: set[str] = set()
+
+ for path, fact_id in references:
+ record = fact_index.get(fact_id)
+ if record is None:
+ issues.append(Issue("UNKNOWN_SOURCE_FACT_REFERENCE", path))
+ continue
+ referenced_ids.add(fact_id)
+ index, fact = record
+ verification = fact["verification"]
+ if verification["status"] != "verified":
+ issues.append(
+ Issue(
+ "REFERENCED_FACT_NOT_VERIFIED",
+ f"source_fact_manifest:$.facts[{index}].verification.status",
+ )
+ )
+
+ official_types = {
+ "current_fda_labeling",
+ "current_rems_material",
+ "current_official_guidance",
+ "local_policy",
+ }
+ for index, fact in enumerate(facts):
+ base = f"source_fact_manifest:$.facts[{index}]"
+ verification = fact["verification"]
+ if verification["status"] == "verified":
+ if not verification["verified_by_role"]:
+ issues.append(
+ Issue(
+ "VERIFIED_FACT_REVIEWER_ROLE_MISSING",
+ f"{base}.verification.verified_by_role",
+ )
+ )
+ if verification["verified_at"] is None:
+ issues.append(
+ Issue(
+ "VERIFIED_FACT_TIME_MISSING",
+ f"{base}.verification.verified_at",
+ )
+ )
+ source_type = fact["source"]["source_type"]
+ applicability = fact["applicability"]
+ if (
+ source_type in official_types
+ and applicability["status"]
+ != "confirmed_by_authorized_clinician"
+ ):
+ issues.append(
+ Issue(
+ "SOURCE_APPLICABILITY_NOT_CONFIRMED",
+ f"{base}.applicability.status",
+ )
+ )
+ if (
+ applicability["status"]
+ == "confirmed_by_authorized_clinician"
+ and (
+ not applicability["confirmed_by_role"]
+ or applicability["confirmed_at"] is None
+ )
+ ):
+ issues.append(
+ Issue(
+ "SOURCE_APPLICABILITY_CONFIRMATION_INCOMPLETE",
+ f"{base}.applicability",
+ )
+ )
+ if fact["fact_id"] not in referenced_ids:
+ issues.append(Issue("ORPHAN_SOURCE_FACT", base, "warning"))
+
+ issues.sort(key=lambda item: (item.path, item.code))
+ return report_payload(
+ "source_fact_traceability",
+ issues,
+ counts={
+ "facts": len(facts),
+ "fact_references": len(references),
+ "referenced_facts": len(referenced_ids),
+ },
+ extra={
+ "source_content_interpreted": False,
+ "source_applicability_determined_by_script": False,
+ },
+ )
+
+
+def build_parser() -> argparse.ArgumentParser:
+ parser = argparse.ArgumentParser(
+ description=(
+ "Check that every package fact reference exists and points to a "
+ "human-verified source fact. Source content is not interpreted."
+ )
+ )
+ parser.add_argument("package", help="Complete local package directory")
+ return parser
+
+
+def main() -> int:
+ args = build_parser().parse_args()
+ try:
+ documents, _ = load_package(args.package)
+ report = validate_traceability(documents)
+ except ValidationError as exc:
+ report = error_report("source_fact_traceability", exc)
+ print_report(report)
+ return 1 if report["status"] == "fail" else 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/treatment-plans/scripts/validate_treatment_plan.py b/skills/treatment-plans/scripts/validate_treatment_plan.py
index 742f9c49..896731d4 100644
--- a/skills/treatment-plans/scripts/validate_treatment_plan.py
+++ b/skills/treatment-plans/scripts/validate_treatment_plan.py
@@ -1,367 +1,95 @@
#!/usr/bin/env python3
-"""
-Validate Treatment Plan Quality
-Comprehensive validation of treatment plan content quality and compliance.
-"""
-
-import sys
-import re
-import argparse
-from pathlib import Path
-from typing import Dict, List, Tuple
-
-# Validation criteria and patterns
-VALIDATION_CHECKS = {
- 'smart_goals': {
- 'name': 'SMART Goals Criteria',
- 'patterns': [
- (r'\bspecific\b', 'Specific criterion'),
- (r'\bmeasurable\b', 'Measurable criterion'),
- (r'\bachievable\b', 'Achievable criterion'),
- (r'\brelevant\b', 'Relevant criterion'),
- (r'\btime[- ]?bound\b', 'Time-bound criterion')
- ]
- },
- 'evidence_based': {
- 'name': 'Evidence-Based Practice',
- 'patterns': [
- (r'guideline|evidence|study|trial|research', 'Evidence/guideline references'),
- (r'\\cite\{|\\bibitem\{|\\bibliography\{', 'Citations present')
- ]
- },
- 'patient_centered': {
- 'name': 'Patient-Centered Care',
- 'patterns': [
- (r'patient.*preference|shared decision|patient.*value|patient.*priority', 'Patient preferences'),
- (r'quality of life|functional.*goal|patient.*goal', 'Functional/QoL goals')
- ]
- },
- 'safety': {
- 'name': 'Safety and Risk Mitigation',
- 'patterns': [
- (r'adverse.*effect|side effect|risk|complication', 'Adverse effects mentioned'),
- (r'monitoring|warning sign|emergency|when to call', 'Safety monitoring plan')
- ]
- },
- 'medication': {
- 'name': 'Medication Documentation',
- 'patterns': [
- (r'\\d+\s*mg|\\d+\s*mcg|dose|dosage', 'Specific doses'),
- (r'daily|BID|TID|QID|once|twice', 'Frequency specified'),
- (r'rationale|indication|because|for', 'Rationale provided')
- ]
- }
-}
-
-
-def read_file(filepath: Path) -> str:
- """Read and return file contents."""
- try:
- with open(filepath, 'r', encoding='utf-8') as f:
- return f.read()
- except Exception as e:
- print(f"Error reading file: {e}", file=sys.stderr)
- sys.exit(2)
-
-
-def validate_content(content: str) -> Dict[str, Tuple[int, int, List[str]]]:
- """
- Validate content against criteria.
- Returns dict with results: {category: (passed, total, missing_items)}
- """
- results = {}
-
- for category, checks in VALIDATION_CHECKS.items():
- patterns = checks['patterns']
- passed = 0
- missing = []
-
- for pattern, description in patterns:
- if re.search(pattern, content, re.IGNORECASE):
- passed += 1
- else:
- missing.append(description)
-
- total = len(patterns)
- results[category] = (passed, total, missing)
-
- return results
-
-
-def check_icd10_codes(content: str) -> Tuple[bool, int]:
- """Check for ICD-10 code presence."""
- # ICD-10 format: Letter followed by 2 digits, optionally more digits/letters
- pattern = r'\b[A-TV-Z]\d{2}\.?[\dA-TV-Z]*\b'
- matches = re.findall(pattern, content)
-
- has_codes = len(matches) > 0
- count = len(matches)
-
- return has_codes, count
-
-
-def check_timeframes(content: str) -> Tuple[bool, List[str]]:
- """Check for specific timeframes in goals."""
- timeframe_patterns = [
- r'\d+\s*week',
- r'\d+\s*month',
- r'\d+\s*day',
- r'within\s+\d+',
- r'by\s+\w+\s+\d+'
- ]
-
- found_timeframes = []
- for pattern in timeframe_patterns:
- matches = re.findall(pattern, content, re.IGNORECASE)
- found_timeframes.extend(matches[:3]) # Limit to avoid too many
-
- has_timeframes = len(found_timeframes) > 0
-
- return has_timeframes, found_timeframes[:5]
-
-
-def check_quantitative_goals(content: str) -> Tuple[bool, List[str]]:
- """Check for quantitative/measurable goals."""
- # Look for numbers with units in goal context
- patterns = [
- r'\d+\s*%', # Percentages (HbA1c 7%)
- r'\d+/\d+', # Ratios (BP 130/80)
- r'\d+\s*mg/dL', # Lab values
- r'\d+\s*mmHg', # Blood pressure
- r'\d+\s*feet|meters', # Distance
- r'\d+\s*pounds|lbs|kg', # Weight
- r'\d+/10', # Pain scales
- r'\d+\s*minutes|hours' # Time
- ]
-
- found_metrics = []
- for pattern in patterns:
- matches = re.findall(pattern, content, re.IGNORECASE)
- found_metrics.extend(matches[:2])
-
- has_metrics = len(found_metrics) > 0
-
- return has_metrics, found_metrics[:5]
+"""Validate strict JSON structure without evaluating clinical content."""
+from __future__ import annotations
-def assess_readability(content: str) -> str:
- """Basic readability assessment (very simplified)."""
- # Remove LaTeX commands for word count
- text_content = re.sub(r'\\[a-zA-Z]+(\{[^}]*\})?', '', content)
- text_content = re.sub(r'[{}%\\]', '', text_content)
-
- words = text_content.split()
- word_count = len(words)
-
- # Very rough sentences (periods followed by space/newline)
- sentences = re.split(r'[.!?]+\s+', text_content)
- sentence_count = len([s for s in sentences if s.strip()])
-
- if sentence_count > 0:
- avg_words_per_sentence = word_count / sentence_count
-
- if avg_words_per_sentence < 15:
- return "Simple (good for patient materials)"
- elif avg_words_per_sentence < 25:
- return "Moderate (appropriate for professional documentation)"
- else:
- return "Complex (may be difficult for some readers)"
-
- return "Unable to assess"
-
+import argparse
+import sys
-def display_validation_results(filepath: Path, results: Dict,
- has_icd10: bool, icd10_count: int,
- has_timeframes: bool, timeframe_examples: List[str],
- has_metrics: bool, metric_examples: List[str],
- readability: str):
- """Display comprehensive validation results."""
-
- print("\n" + "="*70)
- print("TREATMENT PLAN QUALITY VALIDATION")
- print("="*70)
- print(f"\nFile: {filepath}")
- print(f"File size: {filepath.stat().st_size:,} bytes")
-
- # Overall quality score
- total_passed = sum(r[0] for r in results.values())
- total_checks = sum(r[1] for r in results.values())
- quality_pct = (total_passed / total_checks) * 100 if total_checks > 0 else 0
-
- print("\n" + "-"*70)
- print("OVERALL QUALITY SCORE")
- print("-"*70)
- print(f"Validation checks passed: {total_passed}/{total_checks} ({quality_pct:.0f}%)")
-
- # Detailed category results
- print("\n" + "-"*70)
- print("QUALITY CRITERIA ASSESSMENT")
- print("-"*70)
-
- for category, (passed, total, missing) in results.items():
- category_name = VALIDATION_CHECKS[category]['name']
- pct = (passed / total) * 100 if total > 0 else 0
- status = "✓" if passed == total else "⚠" if passed > 0 else "✗"
-
- print(f"\n{status} {category_name}: {passed}/{total} ({pct:.0f}%)")
-
- if missing:
- print(" Missing:")
- for item in missing:
- print(f" • {item}")
-
- # Specific checks
- print("\n" + "-"*70)
- print("SPECIFIC VALIDATION CHECKS")
- print("-"*70)
-
- # ICD-10 codes
- if has_icd10:
- print(f"✓ ICD-10 diagnosis codes present ({icd10_count} found)")
- else:
- print("✗ No ICD-10 diagnosis codes detected")
- print(" Recommendation: Include ICD-10 codes for all diagnoses")
-
- # Timeframes
- if has_timeframes:
- print(f"✓ Time-bound goals present")
- if timeframe_examples:
- print(" Examples:", ", ".join(timeframe_examples[:3]))
- else:
- print("✗ No specific timeframes found in goals")
- print(" Recommendation: Add specific timeframes (e.g., 'within 3 months', '8 weeks')")
-
- # Measurable metrics
- if has_metrics:
- print(f"✓ Quantitative/measurable goals present")
- if metric_examples:
- print(" Examples:", ", ".join(metric_examples[:3]))
- else:
- print("⚠ Limited quantitative metrics found")
- print(" Recommendation: Include specific measurable targets (HbA1c <7%, BP <130/80)")
-
- # Readability
- print(f"\nReadability assessment: {readability}")
-
- # Summary and recommendations
- print("\n" + "="*70)
- print("SUMMARY AND RECOMMENDATIONS")
- print("="*70)
-
- if quality_pct >= 90:
- print("\n✓ EXCELLENT quality - Treatment plan meets high standards")
- elif quality_pct >= 75:
- print("\n✓ GOOD quality - Treatment plan is well-developed with minor areas for improvement")
- elif quality_pct >= 60:
- print("\n⚠ FAIR quality - Several important elements need strengthening")
- else:
- print("\n✗ NEEDS IMPROVEMENT - Significant quality issues to address")
-
- # Specific recommendations
- print("\nKey Recommendations:")
-
- recommendations = []
-
- # SMART goals
- if results['smart_goals'][0] < results['smart_goals'][1]:
- recommendations.append("Ensure all goals meet SMART criteria (Specific, Measurable, Achievable, Relevant, Time-bound)")
-
- # Evidence-based
- if results['evidence_based'][0] == 0:
- recommendations.append("Add evidence-based rationale and cite clinical practice guidelines")
-
- # Patient-centered
- if results['patient_centered'][0] < results['patient_centered'][1]:
- recommendations.append("Incorporate patient preferences and functional quality-of-life goals")
-
- # Safety
- if results['safety'][0] < results['safety'][1]:
- recommendations.append("Include comprehensive safety monitoring and risk mitigation strategies")
-
- # Medication documentation
- if results['medication'][0] < results['medication'][1]:
- recommendations.append("Document medications with specific doses, frequencies, and rationales")
-
- if not has_icd10:
- recommendations.append("Add ICD-10 diagnosis codes for billing and documentation support")
-
- if not has_timeframes:
- recommendations.append("Add specific timeframes to all treatment goals")
-
- if recommendations:
- for i, rec in enumerate(recommendations, 1):
- print(f"{i}. {rec}")
+from _common import (
+ TEMPLATE_FILES,
+ Issue,
+ ValidationError,
+ error_report,
+ load_target,
+ print_report,
+ report_payload,
+ validate_document,
+ validate_package_structure,
+)
+
+
+def validate_target(raw_path: str) -> dict:
+ documents, _ = load_target(raw_path)
+ if set(documents) == set(TEMPLATE_FILES):
+ issues = validate_package_structure(documents)
else:
- print("None - Treatment plan demonstrates excellent quality across all criteria!")
-
- print("\n" + "="*70)
-
- # Return exit code
- return 0 if quality_pct >= 70 else 1
+ issues: list[Issue] = []
+ for document_type, document in documents.items():
+ for issue in validate_document(document):
+ issues.append(
+ Issue(
+ issue.code,
+ f"{document_type}:{issue.path}",
+ issue.level,
+ )
+ )
+ issues.sort(key=lambda item: (item.path, item.code))
+
+ record_count = 0
+ for document in documents.values():
+ for field in (
+ "facts",
+ "interventions",
+ "goals",
+ "monitoring_items",
+ "checkpoints",
+ "entries",
+ "handoff_items",
+ "unresolved_items",
+ ):
+ value = document.get(field)
+ if isinstance(value, list):
+ record_count += len(value)
+
+ return report_payload(
+ "structural_validation",
+ issues,
+ counts={
+ "documents_checked": len(documents),
+ "records_checked": record_count,
+ "structural_issues": len(issues),
+ },
+ extra={
+ "clinical_content_evaluated": False,
+ "unknown_fields_allowed": False,
+ },
+ )
-def main():
+def build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
- description='Validate treatment plan quality and compliance',
- formatter_class=argparse.RawDescriptionHelpFormatter,
- epilog="""
-Examples:
- # Validate a treatment plan
- python validate_treatment_plan.py my_plan.tex
-
- # Use in automated workflows (exits with error if quality <70%)
- python validate_treatment_plan.py plan.tex && echo "Quality check passed"
-
-Validation Categories:
- - SMART goals criteria (Specific, Measurable, Achievable, Relevant, Time-bound)
- - Evidence-based practice (guidelines, citations)
- - Patient-centered care (preferences, functional goals)
- - Safety and risk mitigation (adverse effects, monitoring)
- - Medication documentation (doses, frequencies, rationales)
- - ICD-10 coding, timeframes, measurable metrics
-
-Exit Codes:
- 0 - Quality ≥70% (acceptable)
- 1 - Quality <70% (needs improvement)
- 2 - File error or invalid arguments
- """
+ description=(
+ "Validate one local JSON record or a complete six-file package. "
+ "Checks only schema, types, enums, bounds, and ISO dates."
+ )
)
-
parser.add_argument(
- 'file',
- type=Path,
- help='Treatment plan file to validate (.tex format)'
+ "path",
+ help="Local .json file or complete package directory",
)
-
- args = parser.parse_args()
-
- # Check file exists
- if not args.file.exists():
- print(f"Error: File not found: {args.file}", file=sys.stderr)
- sys.exit(2)
-
- # Read and validate
- content = read_file(args.file)
-
- # Run validation checks
- results = validate_content(content)
- has_icd10, icd10_count = check_icd10_codes(content)
- has_timeframes, timeframe_examples = check_timeframes(content)
- has_metrics, metric_examples = check_quantitative_goals(content)
- readability = assess_readability(content)
-
- # Display results
- exit_code = display_validation_results(
- args.file, results,
- has_icd10, icd10_count,
- has_timeframes, timeframe_examples,
- has_metrics, metric_examples,
- readability
- )
-
- sys.exit(exit_code)
+ return parser
+
+def main() -> int:
+ args = build_parser().parse_args()
+ try:
+ report = validate_target(args.path)
+ except ValidationError as exc:
+ report = error_report("structural_validation", exc)
+ print_report(report)
+ return 1 if report["status"] == "fail" else 0
-if __name__ == '__main__':
- main()
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/skills/treatment-plans/tests/test_scripts.py b/skills/treatment-plans/tests/test_scripts.py
new file mode 100644
index 00000000..dc3c40d5
--- /dev/null
+++ b/skills/treatment-plans/tests/test_scripts.py
@@ -0,0 +1,550 @@
+"""Synthetic, dependency-free tests for treatment-plan documentation CLIs."""
+
+from __future__ import annotations
+
+import ast
+import copy
+import json
+import re
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+sys.dont_write_bytecode = True
+
+SKILL_ROOT = Path(__file__).resolve().parents[1]
+SCRIPTS = SKILL_ROOT / "scripts"
+ASSETS = SKILL_ROOT / "assets"
+sys.path.insert(0, str(SCRIPTS))
+
+import _common # noqa: E402
+import check_completeness # noqa: E402
+import check_consistency # noqa: E402
+import generate_template # noqa: E402
+import privacy_process_check # noqa: E402
+import timeline_generator # noqa: E402
+import validate_treatment_plan # noqa: E402
+import validate_traceability # noqa: E402
+
+
+def load_asset(name: str) -> dict:
+ return json.loads((ASSETS / name).read_text(encoding="utf-8"))
+
+
+def complete_synthetic_documents() -> dict[str, dict]:
+ documents: dict[str, dict] = {}
+ document_ids = {
+ "source_fact_manifest": "DOC-SOURCE-001",
+ "clinician_authored_intervention_record": "DOC-INTERVENTION-001",
+ "goals_monitoring_checkpoint_record": "DOC-PLANNING-001",
+ "informed_preference_shared_decision_record": "DOC-DECISION-001",
+ "transition_reconciliation_record": "DOC-TRANSITION-001",
+ "intended_use_handoff_record": "DOC-HANDOFF-001",
+ }
+ for document_type, (template_name, _) in _common.TEMPLATE_FILES.items():
+ document = copy.deepcopy(load_asset(template_name))
+ document["document_id"] = document_ids[document_type]
+ document["created_at"] = "2026-07-23T12:00:00+00:00"
+ documents[document_type] = document
+
+ documents["source_fact_manifest"]["facts"] = [
+ {
+ "fact_id": "FACT-SYNTHETIC-001",
+ "fact_kind": "clinician_authored_decision",
+ "statement_as_supplied": (
+ "Synthetic clinician-authored documentation statement."
+ ),
+ "source": {
+ "source_type": "signed_clinician_record",
+ "title": "Synthetic signed source record",
+ "locator": "LOCAL-SYNTHETIC-SOURCE-001",
+ "version_or_date": "2026-07-23",
+ },
+ "verification": {
+ "status": "verified",
+ "verified_by_role": "authorized licensed clinician",
+ "verified_at": "2026-07-23T13:00:00+00:00",
+ },
+ "applicability": {
+ "status": "not_applicable_local_record",
+ "confirmed_by_role": "",
+ "confirmed_at": None,
+ },
+ }
+ ]
+
+ documents["clinician_authored_intervention_record"]["interventions"] = [
+ {
+ "intervention_id": "INTERVENTION-SYNTHETIC-001",
+ "intervention_kind": "care_coordination",
+ "clinical_decision_status": (
+ "supplied_and_verified_by_authorized_clinician"
+ ),
+ "clinician_authored_action": (
+ "Synthetic clinician-authored coordination action."
+ ),
+ "parameters_as_supplied": [],
+ "source_fact_ids": ["FACT-SYNTHETIC-001"],
+ "owner_role": "authorized licensed clinician",
+ "start_date": "2026-07-24",
+ "end_date": "2026-07-25",
+ "verification": {
+ "status": "verified",
+ "verified_by_role": "authorized licensed clinician",
+ "verified_at": "2026-07-23T14:00:00+00:00",
+ },
+ }
+ ]
+
+ planning = documents["goals_monitoring_checkpoint_record"]
+ planning["goals"] = [
+ {
+ "goal_id": "GOAL-SYNTHETIC-001",
+ "statement_as_supplied": "Synthetic clinician-supplied goal.",
+ "measurement_as_supplied": "Synthetic documented measure.",
+ "target_as_supplied": "Synthetic documented target.",
+ "target_date": "2026-08-01",
+ "source_fact_ids": ["FACT-SYNTHETIC-001"],
+ "verified_by_role": "authorized licensed clinician",
+ }
+ ]
+ planning["monitoring_items"] = [
+ {
+ "monitoring_id": "MONITORING-SYNTHETIC-001",
+ "item_as_supplied": "Synthetic clinician-supplied monitoring item.",
+ "method_as_supplied": "Synthetic documented method.",
+ "frequency_as_supplied": "Synthetic supplied frequency text.",
+ "next_due_date": "2026-07-26",
+ "owner_role": "authorized licensed clinician",
+ "source_fact_ids": ["FACT-SYNTHETIC-001"],
+ }
+ ]
+ planning["checkpoints"] = [
+ {
+ "checkpoint_id": "CHECKPOINT-SYNTHETIC-001",
+ "checkpoint_date": "2026-07-27",
+ "purpose_as_supplied": "Synthetic supplied checkpoint purpose.",
+ "owner_role": "authorized licensed clinician",
+ "linked_goal_ids": ["GOAL-SYNTHETIC-001"],
+ "linked_intervention_ids": ["INTERVENTION-SYNTHETIC-001"],
+ "source_fact_ids": ["FACT-SYNTHETIC-001"],
+ }
+ ]
+
+ documents["informed_preference_shared_decision_record"]["entries"] = [
+ {
+ "decision_id": "DECISION-SYNTHETIC-001",
+ "decision_topic_as_documented": "Synthetic documented topic.",
+ "options_as_documented": [
+ {
+ "option_id": "OPTION-SYNTHETIC-001",
+ "option_as_documented": "Synthetic documented option.",
+ "source_fact_ids": ["FACT-SYNTHETIC-001"],
+ }
+ ],
+ "benefits_harms_uncertainty_documented": True,
+ "preference_as_documented": "Synthetic documented preference.",
+ "outcome_as_documented": "Synthetic clinician-documented outcome.",
+ "outcome_source_fact_ids": ["FACT-SYNTHETIC-001"],
+ "decision_status": "documented_by_authorized_clinician",
+ "participant_roles": [
+ "synthetic participant",
+ "authorized licensed clinician",
+ ],
+ "documented_by_role": "authorized licensed clinician",
+ "documented_at": "2026-07-24T10:00:00+00:00",
+ "acknowledgment_status": "acknowledged",
+ }
+ ]
+
+ transition = documents["transition_reconciliation_record"]
+ transition["transition"] = {
+ "from_setting_as_documented": "synthetic sending setting",
+ "to_setting_as_documented": "synthetic receiving setting",
+ "handoff_date": "2026-07-28",
+ "responsible_sender_role": "authorized sender",
+ "responsible_receiver_role": "authorized receiver",
+ }
+ transition["medication_reconciliation"] = {
+ "status": "completed_by_authorized_clinician",
+ "source_list_fact_ids": ["FACT-SYNTHETIC-001"],
+ "destination_list_fact_ids": ["FACT-SYNTHETIC-001"],
+ "discrepancy_status": "none_documented",
+ "completed_by_role": "authorized medication reviewer",
+ "completed_at": "2026-07-27T12:00:00+00:00",
+ }
+ transition["handoff_items"] = [
+ {
+ "item_id": "HANDOFF-SYNTHETIC-001",
+ "category": "other_clinician_supplied",
+ "summary_as_supplied": "Synthetic clinician-supplied handoff item.",
+ "source_fact_ids": ["FACT-SYNTHETIC-001"],
+ "owner_role": "authorized sender",
+ "recipient_role": "authorized receiver",
+ "acknowledgment_status": "acknowledged",
+ }
+ ]
+ transition["unresolved_items"] = []
+
+ handoff = documents["intended_use_handoff_record"]
+ handoff["intended_use"]["intended_users"] = ["authorized clinician"]
+ handoff["intended_use"]["intended_setting"] = "synthetic test setting"
+ handoff["privacy_process"].update(
+ {
+ "local_authorization_confirmed": True,
+ "authorized_environment_reference": "LOCAL-SYNTHETIC-ENV",
+ "minimum_necessary_confirmed": True,
+ "no_external_tools_confirmed": True,
+ "no_prompt_log_example_copy_confirmed": True,
+ "privacy_review_status": "not_applicable_synthetic",
+ "retention_policy_reference": "LOCAL-SYNTHETIC-RETENTION",
+ "data_disposition_status": "completed_under_local_policy",
+ }
+ )
+ handoff["local_governance"] = {
+ "institution_or_organization_reference": "LOCAL-SYNTHETIC-ORG",
+ "clinical_owner_role": "authorized clinical owner",
+ "policy_references": ["LOCAL-SYNTHETIC-POLICY"],
+ "records_owner_role": "authorized records owner",
+ "change_control_owner_role": "authorized change owner",
+ }
+ handoff["emergency_routing"].update(
+ {
+ "local_process_reference": "LOCAL-SYNTHETIC-ESCALATION",
+ "verified_by_role": "authorized clinical owner",
+ }
+ )
+ handoff["reporting_routes"] = {
+ "local_patient_safety_route": "not_applicable_synthetic",
+ "product_event_route": "not_applicable_synthetic",
+ "privacy_incident_route": "LOCAL-SYNTHETIC-INCIDENT-ROUTE",
+ "responsible_role": "authorized governance owner",
+ }
+ handoff["handoff"] = {
+ "sender_role": "authorized sender",
+ "recipient_role": "authorized receiver",
+ "sent_at": "2026-07-29T12:00:00+00:00",
+ "acknowledgment_status": "acknowledged",
+ "unresolved_items_routed": True,
+ }
+ handoff["clinician_signoff"].update(
+ {
+ "status": "signed",
+ "signer_role": "authorized licensed clinician",
+ "credential_authority_reference": "LOCAL-SYNTHETIC-CREDENTIAL",
+ "signed_at": "2026-07-28T10:00:00+00:00",
+ }
+ )
+ handoff["release_gate"] = {
+ "status": "released_for_authorized_documentation_handoff",
+ "released_by_role": "authorized licensed clinician",
+ "released_at": "2026-07-28T11:00:00+00:00",
+ "blocker_codes": [],
+ }
+ return documents
+
+
+def write_package(root: Path, documents: dict[str, dict]) -> None:
+ for document_type, (_, filename) in _common.TEMPLATE_FILES.items():
+ (root / filename).write_text(
+ json.dumps(documents[document_type], indent=2) + "\n",
+ encoding="utf-8",
+ )
+
+
+class StaticSafetyTests(unittest.TestCase):
+ def test_scripts_have_no_network_dynamic_or_process_features(self) -> None:
+ banned_import_roots = {
+ "aiohttp",
+ "httpx",
+ "openai",
+ "pickle",
+ "requests",
+ "socket",
+ "".join(("sub", "process")),
+ "urllib",
+ }
+ banned_calls = {
+ "".join(("e", "val")),
+ "".join(("e", "xec")),
+ "".join(("com", "pile")),
+ }
+ for path in sorted(SCRIPTS.glob("*.py")):
+ source = path.read_text(encoding="utf-8")
+ tree = ast.parse(source, filename=str(path))
+ for node in ast.walk(tree):
+ if isinstance(node, ast.Import):
+ roots = {alias.name.split(".")[0] for alias in node.names}
+ self.assertFalse(roots & banned_import_roots, path.name)
+ if isinstance(node, ast.ImportFrom) and node.module:
+ self.assertNotIn(
+ node.module.split(".")[0],
+ banned_import_roots,
+ path.name,
+ )
+ if isinstance(node, ast.Call) and isinstance(node.func, ast.Name):
+ self.assertNotIn(node.func.id, banned_calls, path.name)
+ self.assertNotIn("os.environ", source)
+ self.assertNotIn("getenv(", source)
+ self.assertNotIn("API_KEY", source)
+ self.assertNotIn(".env", source)
+
+ def test_old_specialty_and_schematic_files_are_absent(self) -> None:
+ self.assertEqual(list(ASSETS.glob("*.tex")), [])
+ self.assertEqual(list(ASSETS.glob("*.sty")), [])
+ self.assertFalse((SCRIPTS / "generate_schematic.py").exists())
+ self.assertFalse((SCRIPTS / "generate_schematic_ai.py").exists())
+
+ def test_assets_are_generic_json_only(self) -> None:
+ names = {path.name for path in ASSETS.iterdir() if path.is_file()}
+ expected = {value[0] for value in _common.TEMPLATE_FILES.values()}
+ self.assertEqual(names, expected)
+ prohibited = {
+ "diabetes",
+ "depression",
+ "hypertension",
+ "metformin",
+ "sertraline",
+ "gabapentin",
+ }
+ for path in ASSETS.glob("*.json"):
+ text = path.read_text(encoding="utf-8").lower()
+ self.assertFalse(prohibited & set(re.findall(r"[a-z]+", text)))
+ self.assertIn(_common.NOTICE.lower(), text)
+
+ def test_skill_is_versioned_and_under_500_lines(self) -> None:
+ text = (SKILL_ROOT / "SKILL.md").read_text(encoding="utf-8")
+ self.assertLess(len(text.splitlines()), 500)
+ self.assertIn("metadata:\n version: \"2.0\"", text)
+ self.assertIn("license: MIT", text)
+ self.assertNotIn("OPENROUTER", text)
+
+ def test_documented_local_paths_exist(self) -> None:
+ pattern = re.compile(
+ r"`((?:assets|references|scripts)/[A-Za-z0-9_.-]+)`"
+ )
+ documents = [
+ SKILL_ROOT / "SKILL.md",
+ *sorted((SKILL_ROOT / "references").glob("*.md")),
+ ]
+ missing = []
+ for document in documents:
+ for relative in pattern.findall(document.read_text(encoding="utf-8")):
+ if not (SKILL_ROOT / relative).is_file():
+ missing.append(f"{document.name}:{relative}")
+ self.assertEqual(missing, [])
+
+ def test_no_bytecode_artifacts(self) -> None:
+ artifacts = [
+ path
+ for path in SKILL_ROOT.rglob("*")
+ if path.suffix in {".pyc", ".pyo"}
+ or path.name == "__pycache__"
+ ]
+ self.assertEqual(artifacts, [])
+
+ def test_all_script_help_commands_are_dependency_free(self) -> None:
+ modules = (
+ check_completeness,
+ check_consistency,
+ generate_template,
+ privacy_process_check,
+ timeline_generator,
+ validate_treatment_plan,
+ validate_traceability,
+ )
+ for module in modules:
+ help_text = module.build_parser().format_help()
+ self.assertIn("usage:", help_text.lower(), module.__name__)
+
+
+class StructureAndBoundsTests(unittest.TestCase):
+ def test_template_is_structurally_valid_but_incomplete(self) -> None:
+ document = load_asset("source_fact_manifest_template.json")
+ self.assertEqual(_common.validate_document(document), [])
+ documents = {
+ document_type: load_asset(template_name)
+ for document_type, (template_name, _) in _common.TEMPLATE_FILES.items()
+ }
+ report = check_completeness.check_completeness(documents)
+ self.assertEqual(report["status"], "fail")
+ codes = {issue["code"] for issue in report["issues"]}
+ self.assertIn("SOURCE_FACTS_REQUIRED", codes)
+ self.assertIn("CLINICIAN_SIGNOFF_PENDING", codes)
+
+ def test_complete_synthetic_package_passes_all_checks(self) -> None:
+ documents = complete_synthetic_documents()
+ with tempfile.TemporaryDirectory() as directory:
+ write_package(Path(directory), documents)
+ structure = validate_treatment_plan.validate_target(directory)
+ self.assertEqual(structure["status"], "pass", structure["issues"])
+ for report in (
+ validate_traceability.validate_traceability(documents),
+ check_completeness.check_completeness(documents),
+ privacy_process_check.check_privacy_process(documents),
+ check_consistency.check_consistency(documents),
+ ):
+ self.assertEqual(report["status"], "pass", report["issues"])
+
+ def test_unknown_field_fails_closed(self) -> None:
+ document = load_asset("source_fact_manifest_template.json")
+ document["unexpected"] = True
+ codes = {issue.code for issue in _common.validate_document(document)}
+ self.assertIn("SCHEMA_UNKNOWN_FIELD", codes)
+
+ def test_duplicate_json_key_is_rejected(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ path = Path(directory) / "duplicate.json"
+ path.write_text(
+ '{"document_type":"source_fact_manifest",'
+ '"document_type":"source_fact_manifest"}',
+ encoding="utf-8",
+ )
+ with self.assertRaisesRegex(
+ _common.ValidationError, "JSON_DUPLICATE_KEY"
+ ):
+ _common.read_json(path)
+
+ def test_excessive_json_depth_is_rejected(self) -> None:
+ nested: dict = {}
+ cursor = nested
+ for _ in range(_common.MAX_DEPTH + 2):
+ cursor["nested"] = {}
+ cursor = cursor["nested"]
+ with tempfile.TemporaryDirectory() as directory:
+ path = Path(directory) / "deep.json"
+ path.write_text(json.dumps(nested), encoding="utf-8")
+ with self.assertRaisesRegex(
+ _common.ValidationError, "JSON_MAX_DEPTH_EXCEEDED"
+ ):
+ _common.read_json(path)
+
+ def test_url_input_path_is_rejected(self) -> None:
+ with self.assertRaisesRegex(
+ _common.ValidationError, "NONLOCAL_OR_EMPTY_PATH"
+ ):
+ _common.read_json("https://example.invalid/record.json")
+
+ def test_symlink_input_is_rejected(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ target = root / "target.json"
+ link = root / "link.json"
+ target.write_text("{}", encoding="utf-8")
+ link.symlink_to(target)
+ with self.assertRaisesRegex(
+ _common.ValidationError, "SYMLINK_INPUT_REJECTED"
+ ):
+ _common.read_json(link)
+
+
+class WorkflowTests(unittest.TestCase):
+ def test_generator_creates_six_blocked_templates(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ destination = Path(directory) / "package"
+ report = generate_template.generate_package(
+ str(destination),
+ subject_ref="SYNTHETIC-CASE-XYZ",
+ classification="synthetic",
+ )
+ self.assertEqual(report["status"], "pass")
+ self.assertEqual(
+ {path.name for path in destination.glob("*.json")},
+ {value[1] for value in _common.TEMPLATE_FILES.values()},
+ )
+ loaded, _ = _common.load_package(destination)
+ self.assertEqual(
+ loaded["intended_use_handoff_record"]["release_gate"]["status"],
+ "blocked",
+ )
+
+ def test_generator_requires_explicit_real_patient_acknowledgment(self) -> None:
+ with tempfile.TemporaryDirectory() as directory:
+ destination = Path(directory) / "package"
+ with self.assertRaisesRegex(
+ _common.ValidationError, "REAL_PATIENT_LOCAL_ACK_REQUIRED"
+ ):
+ generate_template.generate_package(
+ str(destination),
+ subject_ref="LOCAL-CASE-001",
+ classification="real_patient_minimum_necessary",
+ )
+
+ def test_traceability_fails_unknown_fact_without_echoing_content(self) -> None:
+ documents = complete_synthetic_documents()
+ secret_text = "SYNTHETIC-CONFIDENTIAL-CONTENT"
+ documents["clinician_authored_intervention_record"]["interventions"][0][
+ "clinician_authored_action"
+ ] = secret_text
+ documents["clinician_authored_intervention_record"]["interventions"][0][
+ "source_fact_ids"
+ ] = ["UNKNOWN-SYNTHETIC-FACT"]
+ report = validate_traceability.validate_traceability(documents)
+ self.assertEqual(report["status"], "fail")
+ self.assertNotIn(secret_text, json.dumps(report))
+ self.assertIn(
+ "UNKNOWN_SOURCE_FACT_REFERENCE",
+ {issue["code"] for issue in report["issues"]},
+ )
+
+ def test_timeline_uses_only_explicit_dates(self) -> None:
+ documents = complete_synthetic_documents()
+ report, schedule = timeline_generator.build_schedule(documents)
+ self.assertEqual(report["status"], "pass", report["issues"])
+ self.assertEqual(len(schedule["events"]), 7)
+ self.assertFalse(schedule["dates_inferred"])
+ self.assertFalse(schedule["recurrences_generated"])
+ serialized = json.dumps(schedule)
+ self.assertNotIn(
+ documents["clinician_authored_intervention_record"][
+ "interventions"
+ ][0]["clinician_authored_action"],
+ serialized,
+ )
+
+ def test_timeline_does_not_expand_frequency_text(self) -> None:
+ documents = complete_synthetic_documents()
+ monitoring = documents["goals_monitoring_checkpoint_record"][
+ "monitoring_items"
+ ][0]
+ monitoring["next_due_date"] = None
+ report, schedule = timeline_generator.build_schedule(documents)
+ codes = {issue["code"] for issue in report["issues"]}
+ self.assertIn(
+ "FREQUENCY_TEXT_NOT_EXPANDED_WITHOUT_EXPLICIT_DATE", codes
+ )
+ event_types = {event["event_type"] for event in schedule["events"]}
+ self.assertNotIn("monitoring_due_date_as_supplied", event_types)
+
+ def test_consistency_rejects_reversed_supplied_dates(self) -> None:
+ documents = complete_synthetic_documents()
+ intervention = documents["clinician_authored_intervention_record"][
+ "interventions"
+ ][0]
+ intervention["start_date"] = "2026-07-26"
+ intervention["end_date"] = "2026-07-25"
+ report = check_consistency.check_consistency(documents)
+ self.assertIn(
+ "INTERVENTION_DATE_ORDER_INVALID",
+ {issue["code"] for issue in report["issues"]},
+ )
+
+ def test_patient_derived_package_requires_qualified_privacy_review(self) -> None:
+ documents = complete_synthetic_documents()
+ for document in documents.values():
+ document["data_classification"] = "deidentified_qualified_review"
+ document["subject_ref"] = "LOCAL-CASE-001"
+ privacy = documents["intended_use_handoff_record"]["privacy_process"]
+ privacy["data_classification"] = "deidentified_qualified_review"
+ privacy["privacy_review_status"] = "pending"
+ report = privacy_process_check.check_privacy_process(documents)
+ self.assertIn(
+ "QUALIFIED_PRIVACY_REVIEW_REQUIRED",
+ {issue["code"] for issue in report["issues"]},
+ )
+ self.assertFalse(report["deidentification_determined"])
+
+
+if __name__ == "__main__":
+ unittest.main()