/** * Comprehensive Palliative Care and Pain Management Module * * ╔═══════════════════════════════════════════════════════════════════════════════╗ * ║ PALLIATIVE CARE - COMFORT AND QUALITY OF LIFE FOR ALL PATIENTS ║ * ╠═══════════════════════════════════════════════════════════════════════════════╣ * ║ This module provides: ║ * ║ - Comprehensive pain management (nociceptive, neuropathic, visceral) ║ * ║ - Symptom cluster management by cancer type ║ * ║ - Refractory symptom escalation protocols ║ * ║ - End-of-life care and hospice transition ║ * ║ - Goals of care communication frameworks ║ * ║ - Advance care planning integration ║ * ╚═══════════════════════════════════════════════════════════════════════════════╝ */ // ═══════════════════════════════════════════════════════════════════════════════ // PAIN MANAGEMENT DEFINITIONS // ═══════════════════════════════════════════════════════════════════════════════ export interface PainAssessment { location: string[]; intensity: number; // 0-10 NRS quality: PainQuality[]; temporalPattern: 'Constant' | 'Intermittent' | 'Breakthrough' | 'Incident'; aggravatingFactors: string[]; relievingFactors: string[]; functionalImpact: FunctionalImpact; psychologicalImpact: string[]; painType: PainType[]; } export type PainQuality = | 'Sharp' | 'Dull' | 'Aching' | 'Burning' | 'Shooting' | 'Stabbing' | 'Throbbing' | 'Cramping' | 'Pressure' | 'Tingling' | 'Numbness'; export type PainType = | 'Nociceptive-Somatic' | 'Nociceptive-Visceral' | 'Neuropathic-Peripheral' | 'Neuropathic-Central' | 'Mixed' | 'Bone' | 'Inflammatory'; export interface FunctionalImpact { sleepDisturbance: 0 | 1 | 2 | 3; // None, Mild, Moderate, Severe mobilityImpairment: 0 | 1 | 2 | 3; selfCareImpairment: 0 | 1 | 2 | 3; socialImpairment: 0 | 1 | 2 | 3; overallQoL: number; // 0-10 } export interface PainManagementProtocol { painType: PainType; severity: 'Mild' | 'Moderate' | 'Severe'; firstLine: PainIntervention[]; secondLine: PainIntervention[]; thirdLine: PainIntervention[]; adjuvants: AdjuvantTherapy[]; interventional: InterventionalProcedure[]; monitoring: PainMonitoring; } export interface PainIntervention { medication: string; class: string; startingDose: string; titrationSchedule: string; maxDose: string; routeOptions: string[]; precautions: string[]; contraindications: string[]; monitoringRequired: string[]; } export interface AdjuvantTherapy { medication: string; indication: string; dose: string; mechanism: string; evidence: string; } export interface InterventionalProcedure { procedure: string; indication: string; technique: string; expectedBenefit: string; duration: string; risks: string[]; contraindications: string[]; } export interface PainMonitoring { assessmentFrequency: string; tools: string[]; escalationCriteria: string[]; deescalationCriteria: string[]; } // ═══════════════════════════════════════════════════════════════════════════════ // WHO PAIN LADDER - ENHANCED // ═══════════════════════════════════════════════════════════════════════════════ export const WHO_PAIN_LADDER: PainManagementProtocol[] = [ { painType: 'Nociceptive-Somatic', severity: 'Mild', firstLine: [ { medication: 'Acetaminophen', class: 'Non-opioid analgesic', startingDose: '650-1000mg PO q6h', titrationSchedule: 'Fixed dosing', maxDose: '3000mg/day (2000mg if hepatic impairment)', routeOptions: ['PO', 'IV', 'PR'], precautions: ['Hepatic impairment', 'Alcohol use'], contraindications: ['Severe hepatic failure'], monitoringRequired: ['LFTs if prolonged use'] }, { medication: 'Ibuprofen', class: 'NSAID', startingDose: '400mg PO q6-8h', titrationSchedule: 'Fixed dosing', maxDose: '2400mg/day', routeOptions: ['PO'], precautions: ['GI bleeding risk', 'Renal impairment', 'Cardiovascular disease'], contraindications: ['Active GI bleed', 'CKD stage 4-5', 'Aspirin-sensitive asthma'], monitoringRequired: ['Creatinine', 'GI symptoms'] } ], secondLine: [ { medication: 'Tramadol', class: 'Weak opioid', startingDose: '50mg PO q6h', titrationSchedule: 'Increase by 50mg q3d as needed', maxDose: '400mg/day', routeOptions: ['PO'], precautions: ['Seizure risk', 'Serotonin syndrome with SSRIs'], contraindications: ['Seizure disorder', 'MAO inhibitor use'], monitoringRequired: ['Pain relief', 'Side effects'] } ], thirdLine: [], adjuvants: [], interventional: [], monitoring: { assessmentFrequency: 'Weekly until stable', tools: ['NRS', 'BPI-SF'], escalationCriteria: ['NRS >3 despite max non-opioid', 'Functional impairment'], deescalationCriteria: ['NRS ≤3 sustained', 'Improved function'] } }, { painType: 'Nociceptive-Somatic', severity: 'Moderate', firstLine: [ { medication: 'Morphine IR', class: 'Strong opioid', startingDose: '5-10mg PO q4h (opioid-naive)', titrationSchedule: 'Increase by 25-50% q24-48h', maxDose: 'No ceiling (titrate to effect)', routeOptions: ['PO', 'IV', 'SC', 'PR'], precautions: ['Respiratory depression', 'Constipation', 'Sedation'], contraindications: ['Severe respiratory depression', 'Paralytic ileus'], monitoringRequired: ['Pain relief', 'RR', 'Sedation', 'Bowel function'] }, { medication: 'Oxycodone IR', class: 'Strong opioid', startingDose: '5mg PO q4-6h (opioid-naive)', titrationSchedule: 'Increase by 25-50% q24-48h', maxDose: 'No ceiling', routeOptions: ['PO'], precautions: ['Same as morphine'], contraindications: ['Same as morphine'], monitoringRequired: ['Same as morphine'] } ], secondLine: [ { medication: 'Hydromorphone', class: 'Strong opioid', startingDose: '2mg PO q4-6h', titrationSchedule: 'Increase by 25-50% q24-48h', maxDose: 'No ceiling', routeOptions: ['PO', 'IV', 'SC'], precautions: ['More potent than morphine (5:1)'], contraindications: ['Same as morphine'], monitoringRequired: ['Same as morphine'] } ], thirdLine: [ { medication: 'Fentanyl Transdermal', class: 'Strong opioid', startingDose: '25mcg/hr patch (only if opioid-tolerant)', titrationSchedule: 'Increase by 25mcg/hr q72h', maxDose: 'No ceiling', routeOptions: ['Transdermal'], precautions: ['Only for opioid-tolerant patients', 'Takes 12-24h to reach steady state'], contraindications: ['Opioid-naive patients', 'Acute pain'], monitoringRequired: ['Pain relief', 'Patch adherence', 'Fever (increases absorption)'] } ], adjuvants: [ { medication: 'Acetaminophen', indication: 'Opioid-sparing', dose: '650mg q6h', mechanism: 'Central COX inhibition', evidence: 'Reduces opioid requirement 20-30%' }, { medication: 'NSAID (if not contraindicated)', indication: 'Inflammatory component', dose: 'Variable', mechanism: 'COX-1/2 inhibition', evidence: 'Synergistic with opioids' } ], interventional: [], monitoring: { assessmentFrequency: 'Daily during titration, then weekly', tools: ['NRS', 'BPI-SF', 'Opioid Risk Tool'], escalationCriteria: ['Inadequate relief at current dose', 'Dose escalation >50% in 1 week'], deescalationCriteria: ['Stable pain control', 'Disease response to treatment'] } }, { painType: 'Nociceptive-Somatic', severity: 'Severe', firstLine: [ { medication: 'Morphine IV/SC', class: 'Strong opioid', startingDose: '2-4mg IV q2-4h or PCA', titrationSchedule: 'Rapid titration: redose at 50% q15-30min until controlled', maxDose: 'No ceiling', routeOptions: ['IV', 'SC'], precautions: ['Rapid titration requires monitoring'], contraindications: ['Severe respiratory compromise'], monitoringRequired: ['Continuous pulse ox initially', 'RR q1h', 'Sedation scale'] } ], secondLine: [ { medication: 'Hydromorphone IV', class: 'Strong opioid', startingDose: '0.5-1mg IV q2-4h', titrationSchedule: 'Rapid titration as above', maxDose: 'No ceiling', routeOptions: ['IV', 'SC'], precautions: ['5x more potent than morphine'], contraindications: ['Same'], monitoringRequired: ['Same'] }, { medication: 'Fentanyl IV', class: 'Strong opioid', startingDose: '25-50mcg IV q30min-1h', titrationSchedule: 'Rapid onset, short duration - good for titration', maxDose: 'No ceiling', routeOptions: ['IV'], precautions: ['Short duration requires frequent dosing or infusion'], contraindications: ['Same'], monitoringRequired: ['Same'] } ], thirdLine: [ { medication: 'Methadone', class: 'Strong opioid + NMDA antagonist', startingDose: 'Complex conversion - specialist required', titrationSchedule: 'Slow titration due to long half-life (specialist only)', maxDose: 'Variable', routeOptions: ['PO', 'IV'], precautions: ['QTc prolongation', 'Complex pharmacokinetics', 'Drug interactions'], contraindications: ['QTc >500ms', 'Concurrent QTc-prolonging drugs'], monitoringRequired: ['ECG at baseline and during titration', 'QTc monitoring'] } ], adjuvants: [ { medication: 'Dexamethasone', indication: 'Inflammatory pain, nerve compression, bone pain', dose: '4-8mg daily', mechanism: 'Anti-inflammatory, reduces edema', evidence: 'Effective for bone mets, liver capsule pain' }, { medication: 'Ketamine', indication: 'Opioid-refractory pain, central sensitization', dose: '0.1-0.5mg/kg/hr IV', mechanism: 'NMDA antagonist', evidence: 'Reduces opioid tolerance, effective for refractory pain' } ], interventional: [ { procedure: 'Intrathecal Drug Delivery System (IDDS)', indication: 'Refractory pain despite high-dose systemic opioids', technique: 'Implanted pump with intrathecal catheter', expectedBenefit: '50-70% pain reduction', duration: 'Permanent (pump refills q1-3 months)', risks: ['Infection', 'Catheter malfunction', 'CSF leak'], contraindications: ['Active infection', 'Coagulopathy', 'Limited life expectancy <3 months'] }, { procedure: 'Neurolytic Celiac Plexus Block', indication: 'Pancreatic cancer pain, upper abdominal malignancy', technique: 'Alcohol or phenol injection to celiac plexus', expectedBenefit: '70-90% pain reduction', duration: '3-6 months', risks: ['Hypotension', 'Diarrhea', 'Paraplegia (rare)'], contraindications: ['Coagulopathy', 'Bowel obstruction'] } ], monitoring: { assessmentFrequency: 'Q4h during titration', tools: ['NRS', 'RASS for sedation', 'CPOT if non-verbal'], escalationCriteria: ['Pain crisis', 'Respiratory compromise'], deescalationCriteria: ['Stable control', 'Can convert to oral'] } } ]; // ═══════════════════════════════════════════════════════════════════════════════ // NEUROPATHIC PAIN PROTOCOLS // ═══════════════════════════════════════════════════════════════════════════════ export const NEUROPATHIC_PAIN_PROTOCOLS: PainManagementProtocol[] = [ { painType: 'Neuropathic-Peripheral', severity: 'Moderate', firstLine: [ { medication: 'Gabapentin', class: 'Anticonvulsant', startingDose: '100-300mg PO TID', titrationSchedule: 'Increase by 300mg q3-7d', maxDose: '3600mg/day (in divided doses)', routeOptions: ['PO'], precautions: ['Sedation', 'Dizziness', 'Peripheral edema', 'Renal dosing required'], contraindications: ['Severe renal impairment without dose adjustment'], monitoringRequired: ['Sedation', 'Renal function', 'Suicidal ideation'] }, { medication: 'Pregabalin', class: 'Anticonvulsant', startingDose: '75mg PO BID', titrationSchedule: 'Increase to 150mg BID after 3-7d, then 300mg BID', maxDose: '600mg/day', routeOptions: ['PO'], precautions: ['Same as gabapentin', 'Controlled substance'], contraindications: ['Same'], monitoringRequired: ['Same'] } ], secondLine: [ { medication: 'Duloxetine', class: 'SNRI', startingDose: '30mg PO daily', titrationSchedule: 'Increase to 60mg after 1-2 weeks', maxDose: '120mg/day', routeOptions: ['PO'], precautions: ['Nausea initially', 'Hepatic metabolism', 'Hypertension', 'Bleeding risk with anticoagulants'], contraindications: ['MAO inhibitors', 'Uncontrolled glaucoma', 'Severe hepatic impairment'], monitoringRequired: ['BP', 'Mood', 'LFTs'] }, { medication: 'Amitriptyline', class: 'TCA', startingDose: '10-25mg PO qhs', titrationSchedule: 'Increase by 10-25mg q1-2 weeks', maxDose: '150mg/day', routeOptions: ['PO'], precautions: ['Anticholinergic effects', 'Sedation', 'Cardiac conduction', 'Falls risk in elderly'], contraindications: ['Recent MI', 'Arrhythmia', 'Glaucoma', 'Urinary retention'], monitoringRequired: ['ECG if cardiac risk', 'Anticholinergic burden'] } ], thirdLine: [ { medication: 'Lidocaine 5% Patch', class: 'Local anesthetic', startingDose: '1-3 patches to affected area 12h on/12h off', titrationSchedule: 'Fixed', maxDose: '3 patches simultaneously', routeOptions: ['Topical'], precautions: ['Local skin reaction'], contraindications: ['Severe hepatic impairment'], monitoringRequired: ['Skin integrity'] }, { medication: 'Capsaicin 8% Patch', class: 'TRPV1 agonist', startingDose: 'Applied for 60 min (healthcare setting)', titrationSchedule: 'Repeat q3 months if effective', maxDose: '4 patches per application', routeOptions: ['Topical'], precautions: ['Intense burning during application', 'Requires pretreatment analgesia'], contraindications: ['Broken skin'], monitoringRequired: ['BP during application'] } ], adjuvants: [ { medication: 'Opioids', indication: 'Add if neuropathic-specific agents insufficient', dose: 'Per WHO ladder', mechanism: 'Mu-opioid agonism', evidence: 'Less effective for neuropathic than nociceptive but still helpful' }, { medication: 'Dexamethasone', indication: 'Nerve compression', dose: '4-8mg daily', mechanism: 'Reduces perineural edema', evidence: 'Effective for tumor-related nerve compression' } ], interventional: [ { procedure: 'Spinal Cord Stimulation', indication: 'Refractory neuropathic pain', technique: 'Epidural electrode placement with implanted pulse generator', expectedBenefit: '50% pain reduction in 60-70% of patients', duration: 'Permanent', risks: ['Infection', 'Lead migration', 'Hardware failure'], contraindications: ['Active infection', 'Coagulopathy', 'Pacemaker (relative)'] } ], monitoring: { assessmentFrequency: 'Weekly during titration', tools: ['NRS', 'DN4', 'painDETECT'], escalationCriteria: ['Inadequate relief', 'Intolerable side effects'], deescalationCriteria: ['Stable control', 'Resolved neuropathy'] } } ]; // ═══════════════════════════════════════════════════════════════════════════════ // CHEMOTHERAPY-INDUCED PERIPHERAL NEUROPATHY (CIPN) // ═══════════════════════════════════════════════════════════════════════════════ export interface CIPNProtocol { causingAgent: string; riskFactors: string[]; prevention: PreventionStrategy[]; treatment: PainIntervention[]; doseModification: DoseModificationGuideline[]; prognosis: string; } export interface PreventionStrategy { intervention: string; evidence: string; recommendation: 'Recommended' | 'May Consider' | 'Not Recommended'; } export interface DoseModificationGuideline { grade: number; description: string; action: string; } export const CIPN_PROTOCOLS: CIPNProtocol[] = [ { causingAgent: 'Taxanes (Paclitaxel, Docetaxel)', riskFactors: ['Cumulative dose', 'Pre-existing neuropathy', 'Diabetes', 'Alcohol use'], prevention: [ { intervention: 'Cryotherapy (frozen gloves/socks during infusion)', evidence: 'Moderate evidence for reduction', recommendation: 'May Consider' }, { intervention: 'Compression therapy', evidence: 'Limited evidence', recommendation: 'May Consider' }, { intervention: 'Vitamin E, glutamine, acetyl-L-carnitine', evidence: 'Insufficient evidence', recommendation: 'Not Recommended' } ], treatment: [ { medication: 'Duloxetine', class: 'SNRI', startingDose: '30mg PO daily x1 week, then 60mg', titrationSchedule: 'Increase after 1 week', maxDose: '60mg/day (studied dose)', routeOptions: ['PO'], precautions: ['Nausea', 'Hepatic metabolism'], contraindications: ['MAO inhibitors'], monitoringRequired: ['Mood', 'BP'] } ], doseModification: [ { grade: 1, description: 'Mild paresthesias, no functional impairment', action: 'Continue at current dose with monitoring' }, { grade: 2, description: 'Moderate symptoms limiting instrumental ADLs', action: 'Consider dose reduction 20-25%' }, { grade: 3, description: 'Severe symptoms limiting self-care ADLs', action: 'Hold until grade ≤1, resume at reduced dose or discontinue' } ], prognosis: 'Often improves after treatment cessation but may persist in 30-40%' }, { causingAgent: 'Platinum agents (Oxaliplatin, Cisplatin)', riskFactors: ['Cumulative dose', 'Cold sensitivity', 'Pre-existing neuropathy'], prevention: [ { intervention: 'Calcium/Magnesium infusions', evidence: 'Conflicting evidence', recommendation: 'May Consider' }, { intervention: 'Avoid cold exposure during and 3 days after infusion', evidence: 'Standard practice', recommendation: 'Recommended' }, { intervention: 'Stop-and-go strategy (oxaliplatin holiday)', evidence: 'OPTIMOX studies', recommendation: 'Recommended' } ], treatment: [ { medication: 'Duloxetine', class: 'SNRI', startingDose: '30mg PO daily', titrationSchedule: 'Increase to 60mg after 1 week', maxDose: '60mg/day', routeOptions: ['PO'], precautions: ['Same as above'], contraindications: ['Same'], monitoringRequired: ['Same'] }, { medication: 'Gabapentin/Pregabalin', class: 'Anticonvulsant', startingDose: 'Per neuropathic protocol', titrationSchedule: 'Per protocol', maxDose: 'Per protocol', routeOptions: ['PO'], precautions: ['Sedation'], contraindications: ['Renal impairment without adjustment'], monitoringRequired: ['Sedation'] } ], doseModification: [ { grade: 1, description: 'Cold-induced dysesthesias resolving', action: 'Continue with precautions' }, { grade: 2, description: 'Persistent paresthesias between cycles', action: 'Consider dose reduction or stop-and-go' }, { grade: 3, description: 'Functional impairment', action: 'Discontinue oxaliplatin' } ], prognosis: 'Acute cold sensitivity resolves; chronic sensory neuropathy may persist' }, { causingAgent: 'Vinca alkaloids (Vincristine, Vinblastine)', riskFactors: ['Cumulative dose', 'Hepatic impairment', 'Pre-existing neuropathy'], prevention: [ { intervention: 'Dose capping (vincristine 2mg max)', evidence: 'Standard practice', recommendation: 'Recommended' } ], treatment: [ { medication: 'Gabapentin/Pregabalin', class: 'Anticonvulsant', startingDose: 'Per neuropathic protocol', titrationSchedule: 'Per protocol', maxDose: 'Per protocol', routeOptions: ['PO'], precautions: ['Sedation'], contraindications: [], monitoringRequired: ['Neuropathy assessment'] } ], doseModification: [ { grade: 1, description: 'Mild sensory changes', action: 'Continue with monitoring' }, { grade: 2, description: 'Motor weakness, constipation', action: 'Reduce dose 25-50%' }, { grade: 3, description: 'Significant motor impairment', action: 'Hold or discontinue' } ], prognosis: 'Often reversible after cessation but may take months' }, { causingAgent: 'Bortezomib', riskFactors: ['Pre-existing neuropathy', 'Cumulative dose', 'IV route (vs SC)'], prevention: [ { intervention: 'Subcutaneous administration (vs IV)', evidence: 'Reduced neuropathy incidence', recommendation: 'Recommended' }, { intervention: 'Weekly dosing (vs twice weekly)', evidence: 'Reduced toxicity with similar efficacy', recommendation: 'Recommended' } ], treatment: [ { medication: 'Per neuropathic pain protocols', class: 'Various', startingDose: 'Per protocol', titrationSchedule: 'Per protocol', maxDose: 'Per protocol', routeOptions: ['PO'], precautions: [], contraindications: [], monitoringRequired: [] } ], doseModification: [ { grade: 1, description: 'Pain or paresthesias without functional loss', action: 'Continue or reduce to 1.0mg/m²' }, { grade: 2, description: 'Functional impairment', action: 'Hold until ≤G1, resume at 0.7mg/m²' }, { grade: 3, description: 'Severe symptoms', action: 'Discontinue' } ], prognosis: 'Often improves after dose modification or cessation' } ]; // ═══════════════════════════════════════════════════════════════════════════════ // BONE PAIN MANAGEMENT // ═══════════════════════════════════════════════════════════════════════════════ export interface BonePainProtocol { indication: string; pharmacological: PainIntervention[]; boneTargeted: BoneTargetedTherapy[]; radiation: RadiationForPain[]; interventional: InterventionalProcedure[]; surgical: string[]; } export interface BoneTargetedTherapy { agent: string; class: string; dose: string; frequency: string; painBenefit: string; skeletalEventReduction: string; precautions: string[]; } export interface RadiationForPain { technique: string; dose: string; fractionation: string; responseRate: string; timeToResponse: string; retreatmentOption: boolean; } export const BONE_PAIN_PROTOCOL: BonePainProtocol = { indication: 'Painful bone metastases from solid tumors or multiple myeloma', pharmacological: [ { medication: 'NSAIDs (if not contraindicated)', class: 'Anti-inflammatory', startingDose: 'Ibuprofen 400-600mg TID or Naproxen 500mg BID', titrationSchedule: 'Fixed', maxDose: 'Standard NSAID limits', routeOptions: ['PO'], precautions: ['GI, renal, CV risk'], contraindications: ['Active bleeding', 'CKD', 'High CV risk'], monitoringRequired: ['Creatinine', 'GI symptoms'] }, { medication: 'Dexamethasone', class: 'Corticosteroid', startingDose: '4-8mg PO daily', titrationSchedule: 'Taper if possible after 1-2 weeks', maxDose: '16mg/day', routeOptions: ['PO', 'IV'], precautions: ['Hyperglycemia', 'Insomnia', 'Immunosuppression'], contraindications: ['Active infection (relative)'], monitoringRequired: ['Blood glucose', 'Mood'] }, { medication: 'Opioids per WHO ladder', class: 'Strong opioid', startingDose: 'Per severity', titrationSchedule: 'Per protocol', maxDose: 'No ceiling', routeOptions: ['Various'], precautions: ['Standard opioid precautions'], contraindications: ['Standard'], monitoringRequired: ['Standard'] } ], boneTargeted: [ { agent: 'Zoledronic acid', class: 'Bisphosphonate', dose: '4mg IV', frequency: 'Every 3-4 weeks (may extend to q12 weeks after 1 year)', painBenefit: 'Reduces bone pain in 30-50% of patients', skeletalEventReduction: '40% reduction in SREs', precautions: ['Renal dosing required', 'ONJ risk', 'Hypocalcemia'] }, { agent: 'Denosumab', class: 'RANK-L inhibitor', dose: '120mg SC', frequency: 'Every 4 weeks', painBenefit: 'Similar to zoledronic acid', skeletalEventReduction: 'Superior to zoledronic acid', precautions: ['Hypocalcemia (severe)', 'ONJ risk', 'No renal adjustment needed'] } ], radiation: [ { technique: 'Single fraction EBRT', dose: '8 Gy', fractionation: 'Single fraction', responseRate: '60-70% (complete response 25-30%)', timeToResponse: '2-4 weeks', retreatmentOption: true }, { technique: 'Multi-fraction EBRT', dose: '30 Gy', fractionation: '10 fractions', responseRate: '60-70% (similar to single)', timeToResponse: '2-4 weeks', retreatmentOption: true }, { technique: 'SBRT', dose: '24-27 Gy', fractionation: '3 fractions', responseRate: '80-90%', timeToResponse: '1-3 months', retreatmentOption: false } ], interventional: [ { procedure: 'Vertebroplasty/Kyphoplasty', indication: 'Painful vertebral compression fracture', technique: 'Cement injection into vertebral body', expectedBenefit: '70-90% pain relief', duration: 'Immediate and lasting', risks: ['Cement leak', 'Adjacent fracture'], contraindications: ['Posterior wall destruction', 'Active infection'] }, { procedure: 'Radiofrequency Ablation (RFA)', indication: 'Painful bone metastasis not amenable to RT', technique: 'CT-guided thermal ablation', expectedBenefit: '70-95% pain reduction', duration: 'Weeks to months', risks: ['Nerve injury', 'Fracture'], contraindications: ['Near critical structures'] }, { procedure: 'Cryoablation', indication: 'Same as RFA', technique: 'CT-guided freezing', expectedBenefit: 'Similar to RFA', duration: 'Weeks to months', risks: ['Similar to RFA'], contraindications: ['Similar'] } ], surgical: [ 'Prophylactic fixation for impending fracture (Mirels score ≥9)', 'Surgical stabilization for pathologic fracture', 'Decompression for spinal cord compression' ] }; // ═══════════════════════════════════════════════════════════════════════════════ // CANCER-SPECIFIC SYMPTOM CLUSTERS // ═══════════════════════════════════════════════════════════════════════════════ export interface SymptomCluster { cancerType: string; commonSymptoms: SymptomManagement[]; psychologicalSymptoms: string[]; interventions: ClusterIntervention[]; } export interface SymptomManagement { symptom: string; prevalence: string; firstLineManagement: string[]; secondLineManagement: string[]; refractory: string[]; } export interface ClusterIntervention { type: string; intervention: string; evidence: string; } export const CANCER_SYMPTOM_CLUSTERS: SymptomCluster[] = [ { cancerType: 'Pancreatic Cancer', commonSymptoms: [ { symptom: 'Pain (epigastric/back)', prevalence: '80-85%', firstLineManagement: ['Opioids', 'NSAIDs', 'Dexamethasone'], secondLineManagement: ['Celiac plexus block', 'Intrathecal pump'], refractory: ['Ketamine infusion', 'Palliative sedation'] }, { symptom: 'Cachexia/Anorexia', prevalence: '80%', firstLineManagement: ['Nutritional counseling', 'Oral supplements', 'Megestrol acetate'], secondLineManagement: ['Dronabinol', 'Mirtazapine', 'Olanzapine'], refractory: ['Accept as disease trajectory', 'Comfort-focused care'] }, { symptom: 'Nausea/Vomiting', prevalence: '50-60%', firstLineManagement: ['Ondansetron', 'Metoclopramide (if no obstruction)'], secondLineManagement: ['Dexamethasone', 'Haloperidol', 'Olanzapine'], refractory: ['Octreotide (if obstruction)', 'Continuous antiemetic infusion'] }, { symptom: 'Jaundice/Pruritus', prevalence: '50%', firstLineManagement: ['Biliary stenting (ERCP/PTC)', 'Cholestyramine'], secondLineManagement: ['Rifampin', 'Naltrexone', 'Sertraline'], refractory: ['Biliary drainage', 'Plasmapheresis (rare)'] } ], psychologicalSymptoms: ['Depression (50%)', 'Anxiety (40%)', 'Existential distress'], interventions: [ { type: 'Early palliative care integration', intervention: 'Concurrent palliative care from diagnosis', evidence: 'Improves QoL and may improve survival (Temel NEJM 2010 model)' }, { type: 'Celiac plexus neurolysis', intervention: 'Early consideration for pain', evidence: '70-90% pain relief, may reduce opioid requirement' } ] }, { cancerType: 'Lung Cancer', commonSymptoms: [ { symptom: 'Dyspnea', prevalence: '65-75%', firstLineManagement: ['Opioids (morphine 2.5-5mg q4h)', 'Oxygen if hypoxic', 'Fan therapy'], secondLineManagement: ['Benzodiazepines (for anxiety component)', 'Bronchodilators if obstruction'], refractory: ['Continuous opioid infusion', 'Palliative sedation'] }, { symptom: 'Cough', prevalence: '50-70%', firstLineManagement: ['Dextromethorphan', 'Codeine', 'Benzonatate'], secondLineManagement: ['Gabapentin', 'Nebulized lidocaine'], refractory: ['Opioids', 'Endobronchial intervention if obstruction'] }, { symptom: 'Hemoptysis', prevalence: '20-30%', firstLineManagement: ['Tranexamic acid', 'Radiation therapy'], secondLineManagement: ['Bronchial artery embolization'], refractory: ['Endobronchial laser/electrocautery', 'Palliative sedation if massive'] }, { symptom: 'Pain', prevalence: '50-70%', firstLineManagement: ['Per WHO ladder'], secondLineManagement: ['Chest wall blocks', 'Radiation'], refractory: ['Intrathecal pump', 'Ketamine'] } ], psychologicalSymptoms: ['Anxiety (35-45%)', 'Depression (25-35%)', 'Panic with dyspnea'], interventions: [ { type: 'Breathlessness clinic', intervention: 'Multicomponent intervention (breathing techniques, fan, positioning)', evidence: 'Improves dyspnea and reduces anxiety' }, { type: 'Palliative thoracentesis/pleurodesis', intervention: 'For malignant pleural effusion', evidence: 'Relieves dyspnea in 70-90%' } ] }, { cancerType: 'Brain Tumors', commonSymptoms: [ { symptom: 'Headache', prevalence: '50-60%', firstLineManagement: ['Dexamethasone (4-16mg daily)', 'Acetaminophen', 'NSAIDs'], secondLineManagement: ['Opioids if needed'], refractory: ['Increase steroids', 'Consider decompressive surgery'] }, { symptom: 'Seizures', prevalence: '40-60%', firstLineManagement: ['Levetiracetam', 'Lacosamide', 'Valproate'], secondLineManagement: ['Add second AED', 'Clobazam'], refractory: ['Phenobarbital', 'Midazolam infusion'] }, { symptom: 'Cognitive Decline', prevalence: '40-80%', firstLineManagement: ['Treat reversible causes (steroids, seizures)', 'Cognitive rehabilitation'], secondLineManagement: ['Methylphenidate', 'Modafinil', 'Memantine (radiation-induced)'], refractory: ['Supportive care', 'Caregiver support'] }, { symptom: 'Fatigue', prevalence: '60-90%', firstLineManagement: ['Treat underlying causes', 'Energy conservation', 'Exercise'], secondLineManagement: ['Methylphenidate', 'Modafinil'], refractory: ['Accept and adapt'] } ], psychologicalSymptoms: ['Depression (15-40%)', 'Anxiety', 'Personality changes', 'Caregiver burden'], interventions: [ { type: 'Steroid management', intervention: 'Use lowest effective dose, taper when possible', evidence: 'Reduces steroid myopathy, hyperglycemia, insomnia' }, { type: 'Seizure prophylaxis', intervention: 'Continue AED for life if seizure history', evidence: 'Prevents breakthrough seizures, ensures safety' } ] }, { cancerType: 'Gastrointestinal Cancers (Gastric, Esophageal)', commonSymptoms: [ { symptom: 'Dysphagia', prevalence: '60-80%', firstLineManagement: ['Esophageal stenting', 'Dietary modification'], secondLineManagement: ['Radiation therapy', 'Dilation'], refractory: ['Feeding tube (G-tube, J-tube)', 'TPN'] }, { symptom: 'Nausea/Vomiting', prevalence: '40-70%', firstLineManagement: ['Metoclopramide (if no obstruction)', 'Ondansetron'], secondLineManagement: ['Dexamethasone', 'Haloperidol'], refractory: ['Octreotide', 'Venting gastrostomy'] }, { symptom: 'Bowel Obstruction', prevalence: 'Variable', firstLineManagement: ['NPO, NG tube', 'IV fluids', 'Dexamethasone'], secondLineManagement: ['Octreotide', 'Hyoscine butylbromide'], refractory: ['Venting gastrostomy', 'Surgical bypass if appropriate'] }, { symptom: 'Ascites', prevalence: '30-50% in advanced disease', firstLineManagement: ['Diuretics (spironolactone ± furosemide)', 'Sodium restriction'], secondLineManagement: ['Therapeutic paracentesis'], refractory: ['Indwelling drain', 'Peritoneovenous shunt (rare)'] } ], psychologicalSymptoms: ['Depression', 'Anxiety', 'Loss of eating enjoyment'], interventions: [ { type: 'Nutritional support', intervention: 'Early dietitian involvement, consider enteral feeding', evidence: 'Maintains nutrition, improves tolerance of treatment' } ] } ]; // ═══════════════════════════════════════════════════════════════════════════════ // END-OF-LIFE CARE PROTOCOLS // ═══════════════════════════════════════════════════════════════════════════════ export interface EndOfLifeProtocol { phase: 'Last weeks' | 'Last days' | 'Actively dying'; clinicalIndicators: string[]; symptomPriorities: string[]; medicationChanges: MedicationTransition; familySupport: string[]; practicalConsiderations: string[]; } export interface MedicationTransition { currentRoute: string; alternativeRoutes: string[]; essentialMedications: string[]; medicationsToDiscontinue: string[]; prnProtocols: PRNProtocol[]; } export interface PRNProtocol { symptom: string; medication: string; dose: string; route: string; frequency: string; maxDose24h: string; } export const END_OF_LIFE_PROTOCOLS: EndOfLifeProtocol[] = [ { phase: 'Last weeks', clinicalIndicators: [ 'PPS ≤50%', 'Declining oral intake', 'Increasing weakness', 'Spending >50% of day in bed', 'Progressive weight loss' ], symptomPriorities: ['Pain control', 'Nausea/vomiting', 'Dyspnea', 'Anxiety/depression'], medicationChanges: { currentRoute: 'Oral preferred if tolerated', alternativeRoutes: ['Sublingual', 'Transdermal', 'Subcutaneous'], essentialMedications: ['Pain medications', 'Anti-anxiety', 'Antiemetics'], medicationsToDiscontinue: [ 'Vitamins/supplements', 'Preventive medications (statins, antihypertensives - with caution)', 'Medications for long-term benefit' ], prnProtocols: [] }, familySupport: [ 'Goals of care discussion', 'Advance directive review', 'Hospice referral discussion', 'Anticipatory grief support' ], practicalConsiderations: [ 'Ensure medications available at home', 'Equipment needs (hospital bed, oxygen)', 'Emergency contact plan', '24/7 support availability' ] }, { phase: 'Last days', clinicalIndicators: [ 'PPS ≤30%', 'Bedbound', 'Minimal oral intake (sips only)', 'Altered consciousness', 'Mottled extremities', 'Changes in breathing pattern' ], symptomPriorities: ['Comfort', 'Minimize distressing symptoms', 'Family support'], medicationChanges: { currentRoute: 'Non-oral routes', alternativeRoutes: ['Subcutaneous', 'Sublingual', 'Rectal'], essentialMedications: [ 'Morphine/hydromorphone SC (pain, dyspnea)', 'Midazolam/lorazepam SC (anxiety, agitation)', 'Haloperidol SC (nausea, agitation)', 'Glycopyrrolate/hyoscine SC (secretions)' ], medicationsToDiscontinue: [ 'All non-essential medications', 'Anticoagulants (if not for symptom control)', 'Most oral medications' ], prnProtocols: [ { symptom: 'Pain/Dyspnea', medication: 'Morphine', dose: '2.5-5mg', route: 'SC', frequency: 'Q1h PRN', maxDose24h: 'No ceiling' }, { symptom: 'Anxiety/Agitation', medication: 'Midazolam', dose: '2.5-5mg', route: 'SC', frequency: 'Q1h PRN', maxDose24h: 'No ceiling' }, { symptom: 'Nausea', medication: 'Haloperidol', dose: '0.5-1mg', route: 'SC', frequency: 'Q4-6h PRN', maxDose24h: '10mg' }, { symptom: 'Secretions (death rattle)', medication: 'Glycopyrrolate', dose: '0.2mg', route: 'SC', frequency: 'Q4h PRN', maxDose24h: '1.2mg' } ] }, familySupport: [ 'Prepare family for what to expect', 'Signs of imminent death education', 'Permission to be present or take breaks', 'Chaplain/spiritual care' ], practicalConsiderations: [ 'Continuous care if available (hospice)', 'Mouth care supplies', 'Positioning aids', 'Quiet, peaceful environment' ] }, { phase: 'Actively dying', clinicalIndicators: [ 'Unresponsive or minimal response', 'No oral intake', 'Cheyne-Stokes or irregular breathing', 'Peripheral cyanosis', 'Mottling extending centrally', 'Mandibular breathing' ], symptomPriorities: ['Comfort only', 'Minimize interventions', 'Family presence'], medicationChanges: { currentRoute: 'SC only', alternativeRoutes: ['Continuous SC infusion if needed'], essentialMedications: ['Comfort medications only'], medicationsToDiscontinue: ['All except comfort medications'], prnProtocols: [ { symptom: 'Any distress', medication: 'Morphine + Midazolam', dose: '2.5mg each', route: 'SC', frequency: 'Q15-30min PRN', maxDose24h: 'As needed for comfort' } ] }, familySupport: [ 'Continuous presence of support', 'What to do when death occurs', 'After-death care planning', 'Bereavement resources' ], practicalConsiderations: [ 'Notify funeral home of expected death', 'DNR confirmed and visible', 'After-hours contact numbers', 'Expected vs unexpected death documentation' ] } ]; // ═══════════════════════════════════════════════════════════════════════════════ // PALLIATIVE SEDATION PROTOCOL // ═══════════════════════════════════════════════════════════════════════════════ export interface PalliativeSedationProtocol { indications: string[]; prerequisites: string[]; sedationTypes: SedationType[]; medications: SedationMedication[]; monitoring: string[]; documentation: string[]; ethicalConsiderations: string[]; } export interface SedationType { type: string; description: string; indication: string; } export interface SedationMedication { medication: string; startingDose: string; titration: string; maxDose: string; notes: string; } export const PALLIATIVE_SEDATION_PROTOCOL: PalliativeSedationProtocol = { indications: [ 'Refractory symptoms unresponsive to all other interventions', 'Intolerable suffering despite optimal palliative care', 'Imminent death (hours to days expected)', 'Patient/surrogate consent obtained' ], prerequisites: [ 'Palliative care specialist consultation', 'Ethics consultation if any uncertainty', 'Documentation of all attempted interventions', 'Clear goals of care discussion', 'Informed consent or surrogate decision', 'DNR status confirmed' ], sedationTypes: [ { type: 'Proportionate Palliative Sedation', description: 'Sedation titrated to relieve suffering, consciousness reduced only as needed', indication: 'Refractory symptoms with awareness causing distress' }, { type: 'Continuous Deep Sedation', description: 'Continuous sedation to unconsciousness until death', indication: 'Refractory suffering in imminently dying patient (hours to days)' }, { type: 'Respite Sedation', description: 'Temporary sedation (24-48h) with planned re-emergence', indication: 'Severe symptom crisis, patient/family need respite' } ], medications: [ { medication: 'Midazolam', startingDose: '0.5-1mg/hr SC/IV infusion', titration: 'Increase by 0.5-1mg/hr q1h until comfortable', maxDose: 'No ceiling (typical range 1-20mg/hr)', notes: 'First-line agent, rapid onset, easily titratable' }, { medication: 'Propofol', startingDose: '10-20mg/hr IV', titration: 'Increase by 10mg/hr as needed', maxDose: 'Variable', notes: 'Requires IV access, rapid onset, ICU or specialized setting' }, { medication: 'Phenobarbital', startingDose: '100-200mg SC/IV load, then 50-100mg q6-8h', titration: 'Increase maintenance by 50mg/dose as needed', maxDose: 'Variable', notes: 'Long half-life, useful when midazolam tolerance develops' } ], monitoring: [ 'Comfort assessment (RASS, sedation scale)', 'Respiratory status', 'Facial expression for distress', 'Family presence and coping', 'Documentation of sedation level and comfort' ], documentation: [ 'Indication and refractory nature of symptoms', 'All alternative treatments attempted', 'Consent process and participants', 'Sedation level and titration rationale', 'Ongoing assessment of comfort' ], ethicalConsiderations: [ 'Intent is comfort, not hastening death (doctrine of double effect)', 'Proportionality - sedation level matched to symptom severity', 'Patient autonomy respected', 'Distinction from euthanasia (sedation does not cause death)', 'Availability of nutrition/hydration discussed separately' ] }; // ═══════════════════════════════════════════════════════════════════════════════ // OPIOID CONVERSION AND ROTATION // ═══════════════════════════════════════════════════════════════════════════════ export interface OpioidEquivalence { opioid: string; oralMorphineEquivalent: number; // mg morphine equivalent per mg of drug routes: RouteConversion[]; specialConsiderations: string[]; } export interface RouteConversion { from: string; to: string; ratio: number; } export const OPIOID_EQUIVALENCE_TABLE: OpioidEquivalence[] = [ { opioid: 'Morphine', oralMorphineEquivalent: 1, routes: [ { from: 'PO', to: 'IV/SC', ratio: 3 }, // 30mg PO = 10mg IV { from: 'PO', to: 'PR', ratio: 1 } ], specialConsiderations: ['Renally cleared (avoid in severe renal impairment)', 'Active metabolites (M6G, M3G)'] }, { opioid: 'Oxycodone', oralMorphineEquivalent: 1.5, // 20mg oxycodone = 30mg morphine routes: [ { from: 'PO', to: 'IV', ratio: 2 } ], specialConsiderations: ['No active metabolites', 'OK in mild-moderate renal impairment'] }, { opioid: 'Hydromorphone', oralMorphineEquivalent: 4, // 7.5mg PO HM = 30mg PO morphine routes: [ { from: 'PO', to: 'IV/SC', ratio: 5 } // 7.5mg PO = 1.5mg IV ], specialConsiderations: ['Preferred in renal impairment', 'Less histamine release', 'Available in high-potency formulations'] }, { opioid: 'Fentanyl Transdermal', oralMorphineEquivalent: 2.4, // 25mcg/hr patch ≈ 60-90mg oral morphine/24h routes: [ { from: 'Transdermal', to: 'IV', ratio: 1 } // mcg/hr patch ≈ mcg/hr IV ], specialConsiderations: ['For stable pain only', 'Not for opioid-naive', '12-24h to steady state', 'Avoid in cachexia (absorption issues)'] }, { opioid: 'Methadone', oralMorphineEquivalent: -1, // Variable - see conversion table routes: [ { from: 'PO', to: 'IV', ratio: 2 } ], specialConsiderations: [ 'Complex conversion - specialist required', 'Conversion ratio changes with total daily morphine dose:', '≤30mg morphine: 3:1', '31-99mg: 5:1', '100-299mg: 10:1', '300-499mg: 12:1', '500-999mg: 15:1', '≥1000mg: 20:1', 'Long half-life (15-60h), accumulation risk', 'QTc monitoring required' ] } ]; // ═══════════════════════════════════════════════════════════════════════════════ // PALLIATIVE CARE ENGINE // ═══════════════════════════════════════════════════════════════════════════════ export class PalliativeCareEngine { assessPain(assessment: PainAssessment): PainManagementProtocol | undefined { // Find matching protocol based on pain type and severity const severity = assessment.intensity <= 3 ? 'Mild' : assessment.intensity <= 6 ? 'Moderate' : 'Severe'; // Check for neuropathic pain if (assessment.painType.some(t => t.includes('Neuropathic'))) { return NEUROPATHIC_PAIN_PROTOCOLS.find(p => p.severity === severity); } // Default to WHO ladder for nociceptive return WHO_PAIN_LADDER.find(p => p.severity === severity); } getCIPNProtocol(agent: string): CIPNProtocol | undefined { return CIPN_PROTOCOLS.find(p => p.causingAgent.toLowerCase().includes(agent.toLowerCase()) ); } getBonePainProtocol(): BonePainProtocol { return BONE_PAIN_PROTOCOL; } getSymptomCluster(cancerType: string): SymptomCluster | undefined { return CANCER_SYMPTOM_CLUSTERS.find(c => cancerType.toLowerCase().includes(c.cancerType.toLowerCase()) || c.cancerType.toLowerCase().includes(cancerType.toLowerCase()) ); } getEndOfLifeProtocol(phase: EndOfLifeProtocol['phase']): EndOfLifeProtocol | undefined { return END_OF_LIFE_PROTOCOLS.find(p => p.phase === phase); } calculateOpioidConversion( fromOpioid: string, fromDose: number, fromRoute: string, toOpioid: string, toRoute: string ): { dose: number; notes: string[] } { const fromEquiv = OPIOID_EQUIVALENCE_TABLE.find(o => o.opioid.toLowerCase() === fromOpioid.toLowerCase() ); const toEquiv = OPIOID_EQUIVALENCE_TABLE.find(o => o.opioid.toLowerCase() === toOpioid.toLowerCase() ); if (!fromEquiv || !toEquiv) { return { dose: 0, notes: ['Opioid not found in conversion table'] }; } // Convert to oral morphine equivalent let morphineEquiv = fromDose * fromEquiv.oralMorphineEquivalent; // Adjust for route if parenteral const fromRouteConv = fromEquiv.routes.find(r => r.to === fromRoute || r.from === fromRoute); if (fromRouteConv && fromRoute !== 'PO') { morphineEquiv *= fromRouteConv.ratio; } // Convert to new opioid let newDose = morphineEquiv / toEquiv.oralMorphineEquivalent; // Adjust for target route const toRouteConv = toEquiv.routes.find(r => r.to === toRoute || r.from === toRoute); if (toRouteConv && toRoute !== 'PO') { newDose /= toRouteConv.ratio; } // Apply cross-tolerance reduction (25-50%) const reducedDose = newDose * 0.75; // 25% reduction return { dose: Math.round(reducedDose * 10) / 10, notes: [ `Calculated from ${fromDose}${fromRoute} ${fromOpioid} to ${toRoute} ${toOpioid}`, '25% reduction applied for cross-tolerance', 'Titrate based on response', ...toEquiv.specialConsiderations ] }; } getPalliativeSedationProtocol(): PalliativeSedationProtocol { return PALLIATIVE_SEDATION_PROTOCOL; } } // Export singleton export const palliativeCareEngine = new PalliativeCareEngine();