/** * Special Populations Oncology Module * * ╔═══════════════════════════════════════════════════════════════════════════════╗ * ║ SPECIAL POPULATIONS - COMPREHENSIVE PROTOCOLS FOR ALL PATIENTS ║ * ╠═══════════════════════════════════════════════════════════════════════════════╣ * ║ This module provides: ║ * ║ - Pediatric dosing calculations and protocols ║ * ║ - Geriatric assessment and dose modifications ║ * ║ - Pregnancy-specific management by trimester ║ * ║ - Organ dysfunction dosing adjustments ║ * ║ - HIV/AIDS oncology protocols ║ * ║ - Drug interaction safety checking ║ * ╚═══════════════════════════════════════════════════════════════════════════════╝ */ // ═══════════════════════════════════════════════════════════════════════════════ // PEDIATRIC ONCOLOGY DOSING // ═══════════════════════════════════════════════════════════════════════════════ export interface PediatricDosingProtocol { drug: string; indication: string[]; dosingMethod: 'BSA' | 'Weight' | 'Age-based' | 'Fixed'; standardDose: string; maxDose: string; ageAdjustments: AgeAdjustment[]; organFunctionAdjustments: string[]; formulations: string[]; administrationNotes: string[]; monitoringRequirements: string[]; } export interface AgeAdjustment { ageGroup: 'Neonate (<1 mo)' | 'Infant (1-12 mo)' | 'Toddler (1-3 yr)' | 'Child (3-12 yr)' | 'Adolescent (12-18 yr)'; adjustment: string; rationale: string; } export function calculateBSA(weight: number, height: number): number { // Mosteller formula: BSA (m²) = √((height cm × weight kg) / 3600) return Math.sqrt((height * weight) / 3600); } export function calculatePediatricDose( adultDose: number, patientBSA: number, dosingMethod: 'BSA' | 'Weight' | 'Fixed', weight?: number ): { dose: number; unit: string; notes: string[] } { const notes: string[] = []; if (dosingMethod === 'BSA') { const dose = adultDose * patientBSA; notes.push(`Calculated using BSA ${patientBSA.toFixed(2)} m²`); return { dose: Math.round(dose * 10) / 10, unit: 'mg', notes }; } else if (dosingMethod === 'Weight' && weight) { notes.push(`Calculated using weight ${weight} kg`); return { dose: Math.round(adultDose * weight * 10) / 10, unit: 'mg', notes }; } return { dose: adultDose, unit: 'mg', notes: ['Fixed dose used'] }; } export const PEDIATRIC_DOSING_PROTOCOLS: PediatricDosingProtocol[] = [ { drug: 'Vincristine', indication: ['ALL', 'Lymphoma', 'Wilms tumor', 'Neuroblastoma'], dosingMethod: 'BSA', standardDose: '1.5 mg/m² IV (max 2 mg)', maxDose: '2 mg absolute', ageAdjustments: [ { ageGroup: 'Infant (1-12 mo)', adjustment: 'Reduce by 50%', rationale: 'Immature hepatic metabolism' }, { ageGroup: 'Neonate (<1 mo)', adjustment: 'Use with extreme caution, 75% reduction', rationale: 'Limited clearance' } ], organFunctionAdjustments: ['Reduce dose 50% for bilirubin >3', 'Reduce 75% for bilirubin >5'], formulations: ['1 mg/mL solution for injection'], administrationNotes: ['Vesicant - ensure good IV access', 'Fatal if given intrathecally', 'Must be in minibag, not syringe'], monitoringRequirements: ['Neuro exam for neuropathy', 'Bowel function (constipation)', 'Jaw pain (first-dose)'] }, { drug: 'Doxorubicin', indication: ['Osteosarcoma', 'Ewing sarcoma', 'Lymphoma', 'Solid tumors'], dosingMethod: 'BSA', standardDose: '30-75 mg/m² IV per cycle (protocol-dependent)', maxDose: 'Cumulative lifetime max: 450-550 mg/m²', ageAdjustments: [ { ageGroup: 'Infant (1-12 mo)', adjustment: 'Use with caution; increased cardiac risk', rationale: 'Developing myocardium' }, { ageGroup: 'Adolescent (12-18 yr)', adjustment: 'Standard dosing; monitor cumulative dose', rationale: 'Long survival means late effects matter' } ], organFunctionAdjustments: ['Bilirubin 1.2-3: reduce 50%', 'Bilirubin 3-5: reduce 75%', 'Bilirubin >5: hold'], formulations: ['2 mg/mL solution'], administrationNotes: ['Vesicant', 'Infuse over 15-60 minutes', 'Red urine is expected'], monitoringRequirements: ['Echocardiogram at baseline, q3-6 months during, and annually after', 'CBC before each dose', 'LFTs'] }, { drug: 'Methotrexate (High-dose)', indication: ['ALL', 'Osteosarcoma', 'Lymphoma'], dosingMethod: 'BSA', standardDose: '1-12 g/m² IV (protocol-dependent)', maxDose: 'Protocol-specific', ageAdjustments: [ { ageGroup: 'Infant (1-12 mo)', adjustment: 'Reduce by 30-50%; prolonged clearance', rationale: 'Immature renal function' }, { ageGroup: 'Child (3-12 yr)', adjustment: 'Standard protocol dosing', rationale: 'Adequate clearance' } ], organFunctionAdjustments: ['Contraindicated if CrCl <60', 'Third-spacing prolongs clearance', 'Hold if effusions present'], formulations: ['Various concentrations for IV'], administrationNotes: ['Aggressive hydration required', 'Urine alkalinization (pH ≥7)', 'Leucovorin rescue per protocol'], monitoringRequirements: ['MTX levels per protocol', 'Creatinine daily', 'CBC', 'Continue leucovorin until MTX <0.1'] }, { drug: 'Cisplatin', indication: ['Osteosarcoma', 'Hepatoblastoma', 'Germ cell tumors', 'Brain tumors'], dosingMethod: 'BSA', standardDose: '60-100 mg/m² IV (protocol-dependent)', maxDose: 'Protocol-specific; watch cumulative nephrotoxicity/ototoxicity', ageAdjustments: [ { ageGroup: 'Infant (1-12 mo)', adjustment: 'Reduce dose; higher ototoxicity risk', rationale: 'Developing auditory system' }, { ageGroup: 'Neonate (<1 mo)', adjustment: 'Avoid if possible', rationale: 'Extreme ototoxicity risk' } ], organFunctionAdjustments: ['CrCl 10-50: reduce 25-50%', 'CrCl <10: avoid'], formulations: ['1 mg/mL solution'], administrationNotes: ['Vigorous hydration pre/post', 'Mannitol diuresis in some protocols', 'Antiemetics required'], monitoringRequirements: ['Audiometry at baseline and after each cycle', 'Creatinine/BUN', 'Electrolytes (Mg, K)', 'CBC'] }, { drug: 'Cyclophosphamide', indication: ['ALL', 'Lymphoma', 'Solid tumors', 'Conditioning for HSCT'], dosingMethod: 'BSA', standardDose: '500-1800 mg/m² (protocol-dependent)', maxDose: 'Protocol-specific', ageAdjustments: [ { ageGroup: 'Infant (1-12 mo)', adjustment: 'Standard dosing per BSA; monitor closely', rationale: 'Adequate metabolism' } ], organFunctionAdjustments: ['Reduce 25% for CrCl 10-50', 'Reduce 50% for CrCl <10'], formulations: ['Lyophilized powder for reconstitution', 'Oral tablets'], administrationNotes: ['Hydrate to prevent hemorrhagic cystitis', 'Mesna for high doses (>1g/m²)'], monitoringRequirements: ['CBC', 'Urinalysis', 'Fluid balance', 'Fertility counseling'] } ]; // ═══════════════════════════════════════════════════════════════════════════════ // GERIATRIC ONCOLOGY // ═══════════════════════════════════════════════════════════════════════════════ export interface GeriatricAssessment { domain: string; tool: string; interpretation: AssessmentInterpretation[]; treatmentImplications: string[]; } export interface AssessmentInterpretation { score: string; category: string; meaning: string; } export interface GeriatricDosingAdjustment { drug: string; standardDose: string; geriatricConsiderations: string[]; doseModification: string; alternativeAgents?: string[]; monitoringIntensification: string[]; } export const COMPREHENSIVE_GERIATRIC_ASSESSMENT: GeriatricAssessment[] = [ { domain: 'Functional Status', tool: 'Activities of Daily Living (ADL)', interpretation: [ { score: '6/6', category: 'Independent', meaning: 'No functional impairment' }, { score: '4-5/6', category: 'Mild impairment', meaning: 'May need some assistance' }, { score: '<4/6', category: 'Dependent', meaning: 'Significant functional limitation' } ], treatmentImplications: ['Independent: standard treatment', 'Mild impairment: consider dose reduction', 'Dependent: palliative-focused care often appropriate'] }, { domain: 'Functional Status', tool: 'Instrumental ADL (IADL)', interpretation: [ { score: '8/8', category: 'Independent', meaning: 'Can manage complex tasks' }, { score: '5-7/8', category: 'Some limitation', meaning: 'May need support for some tasks' }, { score: '<5/8', category: 'Significant limitation', meaning: 'Needs substantial support' } ], treatmentImplications: ['IADL impairment predicts chemotherapy toxicity', 'Consider treatment simplification'] }, { domain: 'Comorbidity', tool: 'Charlson Comorbidity Index', interpretation: [ { score: '0', category: 'No comorbidity', meaning: 'Low competing mortality' }, { score: '1-2', category: 'Mild comorbidity', meaning: 'Moderate competing mortality' }, { score: '≥3', category: 'Severe comorbidity', meaning: 'High competing mortality' } ], treatmentImplications: ['High CCI: balance cancer treatment benefit vs comorbidity burden', 'Consider life expectancy from comorbidities'] }, { domain: 'Cognition', tool: 'Mini-Cog', interpretation: [ { score: '4-5', category: 'Normal', meaning: 'No cognitive impairment detected' }, { score: '0-3', category: 'Abnormal', meaning: 'Possible cognitive impairment; needs further evaluation' } ], treatmentImplications: ['Cognitive impairment affects treatment adherence', 'Need caregiver involvement', 'Simplify oral regimens'] }, { domain: 'Nutrition', tool: 'Mini Nutritional Assessment - Short Form (MNA-SF)', interpretation: [ { score: '12-14', category: 'Normal', meaning: 'No malnutrition risk' }, { score: '8-11', category: 'At risk', meaning: 'Malnutrition risk' }, { score: '0-7', category: 'Malnourished', meaning: 'Malnutrition present' } ], treatmentImplications: ['Malnutrition increases toxicity', 'Consider nutritional support before chemotherapy', 'May need dose reduction'] }, { domain: 'Mood', tool: 'Geriatric Depression Scale (GDS-4)', interpretation: [ { score: '0', category: 'Normal', meaning: 'No depression' }, { score: '≥1', category: 'Possible depression', meaning: 'Screen further with GDS-15' } ], treatmentImplications: ['Depression affects QoL and adherence', 'Consider psychiatry/psychology referral'] }, { domain: 'Falls', tool: 'Falls in past 6 months', interpretation: [ { score: '0 falls', category: 'Low risk', meaning: 'No recent falls' }, { score: '1+ falls', category: 'High risk', meaning: 'Fall risk present' } ], treatmentImplications: ['Falls risk with neurotoxic agents (taxanes, platinum)', 'Physical therapy evaluation', 'Home safety assessment'] }, { domain: 'Polypharmacy', tool: 'Number of medications', interpretation: [ { score: '<5', category: 'Normal', meaning: 'Acceptable' }, { score: '5-9', category: 'Polypharmacy', meaning: 'Moderate drug burden' }, { score: '≥10', category: 'Excessive polypharmacy', meaning: 'High interaction risk' } ], treatmentImplications: ['Review for deprescribing', 'Drug-drug interaction check critical', 'Simplify regimens'] } ]; export const GERIATRIC_DOSING_ADJUSTMENTS: GeriatricDosingAdjustment[] = [ { drug: 'Capecitabine', standardDose: '1000-1250 mg/m² BID D1-14 q21d', geriatricConsiderations: ['Higher toxicity in elderly', 'Diarrhea more severe', 'Hand-foot syndrome'], doseModification: 'Start at 75% dose (750-1000 mg/m² BID); reduce further if toxicity', alternativeAgents: ['5-FU infusional if poor compliance'], monitoringIntensification: ['Weekly calls/visits first cycle', 'Aggressive antidiarrheal education'] }, { drug: 'Docetaxel', standardDose: '75-100 mg/m² q3w', geriatricConsiderations: ['Higher neutropenia risk', 'Fluid retention', 'Neuropathy'], doseModification: 'Consider 60-75 mg/m² in frail elderly; weekly dosing (35 mg/m²) as alternative', alternativeAgents: ['Paclitaxel weekly may be better tolerated'], monitoringIntensification: ['G-CSF support recommended', 'Weekly CBC first cycle', 'Daily weights for edema'] }, { drug: 'Cisplatin', standardDose: '75-100 mg/m² q3w', geriatricConsiderations: ['Nephrotoxicity', 'Ototoxicity', 'Neuropathy', 'Requires aggressive hydration'], doseModification: 'Consider carboplatin substitution (AUC 5-6) in elderly; if cisplatin required, reduce to 60-75 mg/m²', alternativeAgents: ['Carboplatin preferred in elderly', 'Oxaliplatin for GI cancers'], monitoringIntensification: ['CrCl before each cycle', 'Hearing assessment', 'Hydration status'] }, { drug: 'Doxorubicin', standardDose: '60-75 mg/m² q3w', geriatricConsiderations: ['Cardiotoxicity risk higher', 'Age-related decrease in cardiac reserve'], doseModification: 'Consider liposomal doxorubicin or dose reduction to 50 mg/m²; lower cumulative max (400 mg/m²)', alternativeAgents: ['Pegylated liposomal doxorubicin (lower cardiotoxicity)', 'Epirubicin'], monitoringIntensification: ['ECHO before treatment and q2-3 cycles', 'BNP/troponin monitoring'] }, { drug: 'Pembrolizumab/Nivolumab', standardDose: 'Standard dosing (fixed or weight-based)', geriatricConsiderations: ['Similar efficacy in elderly', 'irAE profile similar but monitoring important'], doseModification: 'No dose adjustment for age; monitor closely for irAEs', monitoringIntensification: ['Lower threshold for steroid initiation', 'Close symptom monitoring', 'Thyroid function each cycle'] } ]; // ═══════════════════════════════════════════════════════════════════════════════ // PREGNANCY AND CANCER // ═══════════════════════════════════════════════════════════════════════════════ export interface PregnancyCancerProtocol { trimester: 'First' | 'Second' | 'Third'; generalPrinciples: string[]; allowedTreatments: TreatmentSafety[]; contraindicated: string[]; fetalMonitoring: string[]; deliveryConsiderations: string[]; } export interface TreatmentSafety { modality: string; safety: 'Generally Safe' | 'Use with Caution' | 'Limited Data' | 'Contraindicated'; evidence: string; specificAgents?: string[]; } export const PREGNANCY_CANCER_PROTOCOLS: PregnancyCancerProtocol[] = [ { trimester: 'First', generalPrinciples: [ 'Organogenesis occurs - highest teratogenic risk', 'Delay chemotherapy until second trimester if possible', 'Surgery can be performed with caution', 'Radiation generally contraindicated near fetus' ], allowedTreatments: [ { modality: 'Surgery', safety: 'Use with Caution', evidence: 'Second trimester preferred but first trimester acceptable for urgent cases' }, { modality: 'Breast surgery', safety: 'Generally Safe', evidence: 'Can proceed; avoid supine hypotension' }, { modality: 'Sentinel node biopsy', safety: 'Use with Caution', evidence: 'Technetium safe; blue dye avoided by some' } ], contraindicated: [ 'All chemotherapy (teratogenic risk 10-20%)', 'Radiation therapy near pelvis', 'Endocrine therapy (tamoxifen, AIs)', 'Methotrexate (abortifacient)', 'All targeted therapies' ], fetalMonitoring: ['First trimester ultrasound', 'Nuchal translucency if indicated', 'Cell-free DNA screening'], deliveryConsiderations: ['Plan for second trimester treatment initiation'] }, { trimester: 'Second', generalPrinciples: [ 'Chemotherapy can be given after week 14', 'Organogenesis complete - lower malformation risk', 'Surgery remains feasible', 'Goal: deliver at term if possible' ], allowedTreatments: [ { modality: 'Anthracyclines', safety: 'Generally Safe', evidence: 'Extensive data; doxorubicin, epirubicin acceptable', specificAgents: ['Doxorubicin', 'Epirubicin'] }, { modality: 'Taxanes', safety: 'Generally Safe', evidence: 'Growing safety data', specificAgents: ['Paclitaxel', 'Docetaxel'] }, { modality: 'Platinum agents', safety: 'Use with Caution', evidence: 'Carboplatin preferred; cisplatin with caution', specificAgents: ['Carboplatin'] }, { modality: 'Alkylating agents', safety: 'Use with Caution', evidence: 'Cyclophosphamide used in FAC/FEC', specificAgents: ['Cyclophosphamide'] }, { modality: 'Surgery', safety: 'Generally Safe', evidence: 'Optimal timing 14-28 weeks' }, { modality: 'Radiation (non-pelvic)', safety: 'Use with Caution', evidence: 'Fetal shielding; keep dose <100 mGy to fetus' } ], contraindicated: [ 'Methotrexate', 'Endocrine therapy', 'Targeted therapies (trastuzumab - oligohydramnios)', 'Immunotherapy (limited data, potential fetal harm)', 'Radiation to pelvis' ], fetalMonitoring: ['Anatomy scan at 18-20 weeks', 'Growth ultrasound after chemotherapy', 'Fetal echocardiogram if anthracyclines used'], deliveryConsiderations: ['Allow 3 weeks between last chemo and delivery', 'Avoid delivery during nadir', 'Term delivery preferred (≥37 weeks)'] }, { trimester: 'Third', generalPrinciples: [ 'Continue chemotherapy until 35-37 weeks', 'Plan delivery around treatment', 'Allow 3 weeks between last chemo and delivery', 'Delivery at term preferred' ], allowedTreatments: [ { modality: 'Anthracyclines', safety: 'Generally Safe', evidence: 'Continue if started', specificAgents: ['Doxorubicin'] }, { modality: 'Taxanes', safety: 'Generally Safe', evidence: 'Continue if started', specificAgents: ['Paclitaxel'] }, { modality: 'Surgery', safety: 'Use with Caution', evidence: 'Possible but fetus approaching term' } ], contraindicated: [ 'Same as second trimester', 'Avoid new regimen initiation if delivery imminent' ], fetalMonitoring: ['Weekly NST after 32 weeks', 'Growth ultrasound', 'Biophysical profile if concerns'], deliveryConsiderations: [ 'Stop chemotherapy at 35-37 weeks', 'Delivery at ≥37 weeks if possible', 'Cesarean only for obstetric indications', 'Breastfeeding contraindicated during chemotherapy' ] } ]; // ═══════════════════════════════════════════════════════════════════════════════ // ORGAN DYSFUNCTION DOSING // ═══════════════════════════════════════════════════════════════════════════════ export interface OrganDysfunctionDosing { drug: string; renalDosing: RenalDosing[]; hepaticDosing: HepaticDosing[]; dialysisGuidance?: string; } export interface RenalDosing { crclRange: string; adjustment: string; } export interface HepaticDosing { bilirubinRange: string; astAltRange: string; adjustment: string; } export const ORGAN_DYSFUNCTION_DOSING: OrganDysfunctionDosing[] = [ { drug: 'Carboplatin', renalDosing: [ { crclRange: '≥60', adjustment: 'Standard AUC dosing (Calvert formula)' }, { crclRange: '15-59', adjustment: 'Calvert formula accounts for renal function; dose automatically reduced' }, { crclRange: '<15', adjustment: 'Use with extreme caution; AUC 2-4' } ], hepaticDosing: [ { bilirubinRange: 'Any', astAltRange: 'Any', adjustment: 'No adjustment needed (not hepatically cleared)' } ], dialysisGuidance: 'Dialyzable; give after dialysis' }, { drug: 'Cisplatin', renalDosing: [ { crclRange: '≥60', adjustment: 'Full dose with aggressive hydration' }, { crclRange: '40-59', adjustment: 'Reduce by 25% or consider carboplatin substitution' }, { crclRange: '<40', adjustment: 'Avoid; use carboplatin' } ], hepaticDosing: [ { bilirubinRange: 'Any', astAltRange: 'Any', adjustment: 'No adjustment needed' } ] }, { drug: 'Methotrexate', renalDosing: [ { crclRange: '≥60', adjustment: 'Full dose' }, { crclRange: '30-59', adjustment: 'Reduce by 50%' }, { crclRange: '<30', adjustment: 'Contraindicated for high-dose; low-dose with caution' } ], hepaticDosing: [ { bilirubinRange: '>3x ULN', astAltRange: 'Any', adjustment: 'Hold until resolved; hepatotoxic' } ], dialysisGuidance: 'High-flux dialysis can remove methotrexate in toxicity' }, { drug: 'Doxorubicin', renalDosing: [ { crclRange: 'Any', adjustment: 'No adjustment (not renally cleared)' } ], hepaticDosing: [ { bilirubinRange: '1.2-3.0', astAltRange: 'Any', adjustment: '50% dose reduction' }, { bilirubinRange: '3.1-5.0', astAltRange: 'Any', adjustment: '75% dose reduction' }, { bilirubinRange: '>5.0', astAltRange: 'Any', adjustment: 'Contraindicated' } ] }, { drug: 'Paclitaxel', renalDosing: [ { crclRange: 'Any', adjustment: 'No adjustment needed' } ], hepaticDosing: [ { bilirubinRange: '≤1.5x ULN', astAltRange: '≤10x ULN', adjustment: 'Full dose' }, { bilirubinRange: '1.6-3x ULN', astAltRange: 'Any', adjustment: 'Reduce by 20%' }, { bilirubinRange: '>3x ULN', astAltRange: 'Any', adjustment: 'Avoid' } ] }, { drug: 'Docetaxel', renalDosing: [ { crclRange: 'Any', adjustment: 'No adjustment needed' } ], hepaticDosing: [ { bilirubinRange: '>ULN', astAltRange: '>1.5x ULN + Alk phos >2.5x ULN', adjustment: 'Contraindicated' } ] }, { drug: 'Capecitabine', renalDosing: [ { crclRange: '≥50', adjustment: 'Full dose' }, { crclRange: '30-49', adjustment: '75% dose' }, { crclRange: '<30', adjustment: 'Contraindicated' } ], hepaticDosing: [ { bilirubinRange: 'Mild-moderate', astAltRange: 'Any', adjustment: 'Use with caution' }, { bilirubinRange: 'Severe', astAltRange: 'Any', adjustment: 'Contraindicated' } ] }, { drug: 'Pembrolizumab', renalDosing: [ { crclRange: 'Any', adjustment: 'No adjustment needed' } ], hepaticDosing: [ { bilirubinRange: '1-1.5x ULN', astAltRange: 'Any', adjustment: 'No adjustment' }, { bilirubinRange: '>1.5x ULN', astAltRange: 'Any', adjustment: 'Limited data; use with caution' } ] } ]; // ═══════════════════════════════════════════════════════════════════════════════ // HIV/AIDS ONCOLOGY // ═══════════════════════════════════════════════════════════════════════════════ export interface HIVOncologyProtocol { cancerType: string; artInteractions: ARTInteraction[]; treatmentModifications: string[]; prophylaxisRequirements: string[]; monitoringIntensification: string[]; prognosticConsiderations: string; } export interface ARTInteraction { artClass: string; interaction: string; management: string; } export const HIV_ONCOLOGY_PROTOCOLS: HIVOncologyProtocol[] = [ { cancerType: 'Kaposi Sarcoma', artInteractions: [ { artClass: 'All ART', interaction: 'ART is primary treatment for limited disease', management: 'Optimize ART first' }, { artClass: 'PIs', interaction: 'CYP3A4 interactions with taxanes, vinca alkaloids', management: 'Consider INSTI-based regimen during chemo' } ], treatmentModifications: [ 'Limited/stable KS: ART alone may induce remission', 'Advanced/visceral: Liposomal doxorubicin + ART', 'Paclitaxel for refractory disease' ], prophylaxisRequirements: ['PCP prophylaxis if CD4 <200', 'MAC prophylaxis if CD4 <50', 'CMV monitoring'], monitoringIntensification: ['CD4/viral load monthly during chemo', 'Watch for immune reconstitution inflammatory syndrome (IRIS)'], prognosticConsiderations: 'CD4 >150 and undetectable VL associated with better outcomes' }, { cancerType: 'Non-Hodgkin Lymphoma (AIDS-related)', artInteractions: [ { artClass: 'Protease inhibitors', interaction: 'Increase vincristine/doxorubicin toxicity', management: 'Switch to INSTI-based ART' }, { artClass: 'NNRTIs (efavirenz)', interaction: 'CYP inducer; may reduce chemo levels', management: 'Consider dose adjustment or switch' } ], treatmentModifications: [ 'R-EPOCH preferred for DLBCL (infusional, less myelosuppressive)', 'DA-EPOCH-R with dose adjustments', 'R-CHOP for patients with good PS and CD4' ], prophylaxisRequirements: ['G-CSF support routinely', 'PCP prophylaxis regardless of CD4 during chemo', 'Consider antifungal prophylaxis'], monitoringIntensification: ['CD4/VL monthly', 'Close monitoring for opportunistic infections', 'Tumor lysis prophylaxis'], prognosticConsiderations: 'IPI + CD4 count; ART era outcomes approaching HIV-negative patients' }, { cancerType: 'Cervical Cancer (AIDS-defining)', artInteractions: [ { artClass: 'All ART', interaction: 'Continue ART during treatment', management: 'Optimize regimen for minimal interactions' } ], treatmentModifications: [ 'Standard treatment per stage', 'Cisplatin-based chemoradiation for locally advanced', 'May have higher toxicity rates' ], prophylaxisRequirements: ['Standard prophylaxis per CD4', 'Aggressive supportive care'], monitoringIntensification: ['CD4/VL q3 months', 'Close monitoring for treatment toxicity'], prognosticConsiderations: 'Outcomes improving with ART but still worse than HIV-negative' }, { cancerType: 'Lung Cancer (non-AIDS-defining)', artInteractions: [ { artClass: 'PIs/Cobicistat', interaction: 'CYP3A4 interactions with TKIs (osimertinib, crizotinib)', management: 'Use INSTI-based ART; consider TKI dose adjustment' } ], treatmentModifications: [ 'Standard treatment per stage and histology', 'Immunotherapy appears safe and effective', 'Watch for increased autoimmune manifestations' ], prophylaxisRequirements: ['Continue standard prophylaxis', 'G-CSF as needed'], monitoringIntensification: ['CD4/VL monitoring', 'Watch for irAEs with immunotherapy'], prognosticConsiderations: 'Outcomes similar to HIV-negative in ART era with controlled HIV' } ]; // ═══════════════════════════════════════════════════════════════════════════════ // SPECIAL POPULATIONS ENGINE // ═══════════════════════════════════════════════════════════════════════════════ export class SpecialPopulationsEngine { calculatePediatricDose( drug: string, weight: number, height: number, age: number ): { dose: string; adjustments: string[]; monitoring: string[] } { const bsa = calculateBSA(weight, height); const protocol = PEDIATRIC_DOSING_PROTOCOLS.find(p => p.drug.toLowerCase() === drug.toLowerCase()); if (!protocol) { return { dose: 'Protocol not found', adjustments: [], monitoring: [] }; } const adjustments: string[] = []; // Check age-specific adjustments let ageGroup: AgeAdjustment['ageGroup']; if (age < 1/12) ageGroup = 'Neonate (<1 mo)'; else if (age < 1) ageGroup = 'Infant (1-12 mo)'; else if (age < 3) ageGroup = 'Toddler (1-3 yr)'; else if (age < 12) ageGroup = 'Child (3-12 yr)'; else ageGroup = 'Adolescent (12-18 yr)'; const ageAdj = protocol.ageAdjustments.find(a => a.ageGroup === ageGroup); if (ageAdj) { adjustments.push(`${ageGroup}: ${ageAdj.adjustment} - ${ageAdj.rationale}`); } return { dose: `${protocol.standardDose} (BSA: ${bsa.toFixed(2)} m²)`, adjustments, monitoring: protocol.monitoringRequirements }; } performGeriatricAssessment(scores: Record): { riskCategory: 'Fit' | 'Vulnerable' | 'Frail'; recommendations: string[]; treatmentImplications: string[]; } { let fitCount = 0; let vulnerableCount = 0; let frailCount = 0; const recommendations: string[] = []; // Simple scoring based on key domains if (scores['adl'] >= 5) fitCount++; else if (scores['adl'] >= 3) vulnerableCount++; else frailCount++; if (scores['iadl'] >= 7) fitCount++; else if (scores['iadl'] >= 4) vulnerableCount++; else frailCount++; if (scores['comorbidity'] <= 1) fitCount++; else if (scores['comorbidity'] <= 3) vulnerableCount++; else frailCount++; let riskCategory: 'Fit' | 'Vulnerable' | 'Frail'; if (frailCount >= 2) { riskCategory = 'Frail'; recommendations.push('Consider palliative-focused or modified-intensity treatment'); recommendations.push('Prioritize quality of life'); } else if (vulnerableCount >= 2 || frailCount === 1) { riskCategory = 'Vulnerable'; recommendations.push('Consider dose reductions'); recommendations.push('Close monitoring for toxicity'); recommendations.push('Geriatric co-management recommended'); } else { riskCategory = 'Fit'; recommendations.push('Standard treatment appropriate'); recommendations.push('Continue routine monitoring'); } return { riskCategory, recommendations, treatmentImplications: COMPREHENSIVE_GERIATRIC_ASSESSMENT.flatMap(a => a.treatmentImplications) }; } getPregnancyGuidelines(trimester: PregnancyCancerProtocol['trimester']): PregnancyCancerProtocol | undefined { return PREGNANCY_CANCER_PROTOCOLS.find(p => p.trimester === trimester); } getOrganDysfunctionDosing(drug: string, crcl?: number, bilirubin?: number): { renalAdjustment: string; hepaticAdjustment: string; } { const protocol = ORGAN_DYSFUNCTION_DOSING.find(p => p.drug.toLowerCase() === drug.toLowerCase()); if (!protocol) { return { renalAdjustment: 'No data available', hepaticAdjustment: 'No data available' }; } let renalAdjustment = 'Check CrCl'; if (crcl !== undefined) { for (const rd of protocol.renalDosing) { if (rd.crclRange === 'Any' || (rd.crclRange.includes('≥') && crcl >= parseInt(rd.crclRange.replace('≥', ''))) || (rd.crclRange.includes('<') && crcl < parseInt(rd.crclRange.replace('<', '')))) { renalAdjustment = rd.adjustment; break; } } } let hepaticAdjustment = 'Check bilirubin/LFTs'; if (bilirubin !== undefined) { for (const hd of protocol.hepaticDosing) { if (hd.bilirubinRange === 'Any') { hepaticAdjustment = hd.adjustment; break; } } } return { renalAdjustment, hepaticAdjustment }; } getHIVOncologyProtocol(cancerType: string): HIVOncologyProtocol | undefined { return HIV_ONCOLOGY_PROTOCOLS.find(p => p.cancerType.toLowerCase().includes(cancerType.toLowerCase()) ); } getGeriatricDosingAdjustment(drug: string): GeriatricDosingAdjustment | undefined { return GERIATRIC_DOSING_ADJUSTMENTS.find(g => g.drug.toLowerCase() === drug.toLowerCase() ); } } // Export singleton export const specialPopulationsEngine = new SpecialPopulationsEngine();