/** * Drug Interaction and Safety Checking System * * Provides comprehensive drug safety checks: * - Drug-drug interactions * - Contraindication checking * - Dosing validation * - Allergy cross-reactivity * - Organ function-based adjustments * - Pregnancy/lactation safety * - QT prolongation risk assessment * - CYP450 interaction analysis * * Data sources would include: * - FDA drug labels * - DrugBank * - PharmGKB * - Clinical Pharmacology databases */ import { EventEmitter } from 'events'; export interface Drug { name: string; genericName: string; brandNames?: string[]; drugClass: string; rxNormId?: string; ndc?: string; atcCode?: string; mechanism?: string; metabolism?: { cyp450?: CYP450Profile; renalExcretion?: number; hepaticMetabolism?: number; }; } export interface CYP450Profile { substrates?: string[]; inhibitors?: string[]; inducers?: string[]; } export interface DrugInteraction { drug1: string; drug2: string; severity: 'contraindicated' | 'major' | 'moderate' | 'minor'; type: 'pharmacokinetic' | 'pharmacodynamic' | 'additive' | 'synergistic' | 'antagonistic'; mechanism: string; clinicalEffect: string; management: string; documentation: 'established' | 'theoretical' | 'case-report'; references?: string[]; } export interface Contraindication { drug: string; condition: string; severity: 'absolute' | 'relative'; reason: string; alternatives?: string[]; } export interface DosingGuideline { drug: string; indication: string; standardDose: string; renalAdjustment?: { gfrThreshold: number; adjustment: string; }[]; hepaticAdjustment?: { childPughClass: 'A' | 'B' | 'C'; adjustment: string; }[]; ageAdjustment?: { ageThreshold: number; adjustment: string; }[]; weightBasedDosing?: { formula: string; maxDose?: string; }; } export interface AllergyCheck { reportedAllergy: string; drugToCheck: string; crossReactivity: boolean; riskLevel: 'high' | 'moderate' | 'low' | 'none'; relatedAllergens: string[]; recommendation: string; } export interface SafetyAlert { id: string; type: 'interaction' | 'contraindication' | 'allergy' | 'dosing' | 'organ-function' | 'pregnancy' | 'qt-prolongation' | 'black-box'; severity: 'critical' | 'high' | 'moderate' | 'low'; title: string; description: string; affectedDrugs: string[]; recommendation: string; overridable: boolean; requiresDocumentation: boolean; references?: string[]; } export interface PatientSafetyProfile { patientId: string; allergies: { allergen: string; reactionType: 'anaphylaxis' | 'rash' | 'angioedema' | 'gi' | 'other'; severity: 'severe' | 'moderate' | 'mild'; }[]; renalFunction: { gfr: number; creatinine: number; dialysis: boolean; }; hepaticFunction: { childPughClass?: 'A' | 'B' | 'C'; bilirubin?: number; albumin?: number; inr?: number; ascites?: 'none' | 'mild' | 'moderate-severe'; encephalopathy?: 'none' | 'grade-1-2' | 'grade-3-4'; }; cardiacStatus: { qtcInterval?: number; lvef?: number; arrhythmiaHistory?: boolean; pacemakerIcd?: boolean; }; currentMedications: { drug: string; dose: string; frequency: string; startDate?: Date; }[]; demographics: { age: number; weight: number; gender: 'male' | 'female'; pregnant?: boolean; breastfeeding?: boolean; }; geneticFactors?: { cyp2d6?: 'poor' | 'intermediate' | 'normal' | 'rapid' | 'ultra-rapid'; cyp2c19?: 'poor' | 'intermediate' | 'normal' | 'rapid' | 'ultra-rapid'; dpyd?: 'deficient' | 'intermediate' | 'normal'; ugt1a1?: '*28/*28' | '*28/*1' | '*1/*1'; tpmt?: 'poor' | 'intermediate' | 'normal'; }; } export declare class DrugSafetyService extends EventEmitter { private interactionDatabase; private contraindicationDatabase; private dosingGuidelines; private allergenCrossReactivity; private qtProlongingDrugs; private blackBoxWarnings; constructor(); /** * Perform comprehensive safety check */ performSafetyCheck(patient: PatientSafetyProfile, proposedDrugs: { drug: string; dose: string; route: string; }[]): Promise<{ safe: boolean; alerts: SafetyAlert[]; summary: { criticalAlerts: number; highAlerts: number; moderateAlerts: number; lowAlerts: number; overallRisk: 'critical' | 'high' | 'moderate' | 'low' | 'minimal'; }; recommendations: string[]; }>; /** * Check drug-drug interactions */ checkDrugInteractions(drugs: string[]): Promise; /** * Check contraindications */ checkContraindications(drugs: string[], patient: PatientSafetyProfile): Promise; /** * Check allergy cross-reactivity */ checkAllergies(drugs: string[], allergies: PatientSafetyProfile['allergies']): Promise; /** * Check dosing based on organ function */ checkDosing(drugs: { drug: string; dose: string; route: string; }[], patient: PatientSafetyProfile): Promise; /** * Check QT prolongation risk */ checkQTProlongation(drugs: string[], patient: PatientSafetyProfile): Promise; /** * Check pregnancy and lactation safety */ checkPregnancySafety(drugs: string[], patient: PatientSafetyProfile): Promise; /** * Check black box warnings */ checkBlackBoxWarnings(drugs: string[]): Promise; /** * Check pharmacogenomic considerations */ checkPharmacogenomics(drugs: string[], genetics: NonNullable): Promise; /** * Get recommended alternatives for a contraindicated drug */ getAlternatives(drug: string, reason: string, patientProfile: PatientSafetyProfile): string[]; private initializeDatabases; private addInteraction; private findInteraction; private mapInteractionSeverity; private checkCrossReactivity; /** * Generate a medication reconciliation report */ generateMedicationReconciliation(patient: PatientSafetyProfile): Promise<{ currentMedications: string[]; interactions: DrugInteraction[]; recommendations: string[]; summary: string; }>; } export default DrugSafetyService; //# sourceMappingURL=drugInteractions.d.ts.map