/** * Real-World Oncology Orchestration Service * * ██████╗ ███████╗ █████╗ ██╗ ██╗ ██╗ ██████╗ ██████╗ ██╗ ██████╗ * ██╔══██╗██╔════╝██╔══██╗██║ ██║ ██║██╔═══██╗██╔══██╗██║ ██╔══██╗ * ██████╔╝█████╗ ███████║██║ ██║ █╗ ██║██║ ██║██████╔╝██║ ██║ ██║ * ██╔══██╗██╔══╝ ██╔══██║██║ ██║███╗██║██║ ██║██╔══██╗██║ ██║ ██║ * ██║ ██║███████╗██║ ██║███████╗ ╚███╔███╔╝╚██████╔╝██║ ██║███████╗██████╔╝ * ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝ * ██████╗ ███╗ ██╗ ██████╗ ██████╗ ██╗ ██████╗ ██████╗██╗ ██╗ * ██╔═══██╗████╗ ██║██╔════╝██╔═══██╗██║ ██╔═══██╗██╔════╝╚██╗ ██╔╝ * ██║ ██║██╔██╗ ██║██║ ██║ ██║██║ ██║ ██║██║ ███╗╚████╔╝ * ██║ ██║██║╚██╗██║██║ ██║ ██║██║ ██║ ██║██║ ██║ ╚██╔╝ * ╚██████╔╝██║ ╚████║╚██████╗╚██████╔╝███████╗╚██████╔╝╚██████╔╝ ██║ * ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ * * This service orchestrates all components of the real-world precision oncology system: * - EHR Integration (Epic, Cerner via HL7 FHIR) * - Genomic Platforms (Foundation Medicine, Guardant Health, Tempus) * - Clinical Trials (ClinicalTrials.gov) * - HIPAA Compliance (Audit, Consent, Encryption, Access Control) * - ML Outcome Prediction (Response, Survival, Toxicity, Resistance) * - Drug Safety (Interactions, Contraindications, Pharmacogenomics) * - Validation Framework (Retrospective validation, Concordance analysis) * - Clinician Decision Support (Recommendations, Overrides, Tumor Board) * - Patient Portal (Symptoms, Adherence, QoL, Messaging) */ import { CancerCureResult } from '../capabilities/cancerTreatmentCapability.js'; export interface RealWorldConfig { ehr: { enabled: boolean; vendor: 'epic' | 'cerner' | 'other'; baseUrl: string; clientId: string; clientSecret?: string; }; genomics: { enabled: boolean; platforms: ('foundation' | 'guardant' | 'tempus')[]; }; clinicalTrials: { enabled: boolean; maxDistance?: number; }; compliance: { enabled: boolean; encryptionKey?: string; auditRetentionDays: number; }; ml: { enabled: boolean; modelVersion: string; }; safety: { enabled: boolean; strictMode: boolean; }; } export interface RealWorldPatient { id: string; mrn?: string; demographics: { firstName: string; lastName: string; dateOfBirth: Date; gender: 'male' | 'female' | 'other'; ethnicity?: string; address?: { city: string; state: string; zipCode: string; country: string; }; }; diagnosis: { cancerType: string; stage: string; diagnosisDate: Date; histology?: string; grade?: string; primarySite?: string; metastaticSites?: string[]; }; genomics?: { testDate?: Date; platform?: string; mutations: string[]; biomarkers: Record; msiStatus?: 'MSI-H' | 'MSS'; tmbLevel?: 'High' | 'Low'; tmbValue?: number; pdl1Expression?: number; hrdStatus?: boolean; hrdScore?: number; }; treatments?: { treatmentId: string; regimen: string; startDate: Date; endDate?: Date; response?: 'CR' | 'PR' | 'SD' | 'PD'; discontinuationReason?: string; }[]; medications?: { name: string; dose: string; frequency: string; startDate: Date; }[]; comorbidities?: string[]; allergies?: string[]; performanceStatus?: 0 | 1 | 2 | 3 | 4; labValues?: { testName: string; value: number; unit: string; date: Date; isAbnormal: boolean; }[]; } export interface ComprehensiveTreatmentPlan { patientId: string; planId: string; createdAt: Date; createdBy: string; coreRecommendation: CancerCureResult; ehrData?: { source: string; lastSync: Date; patientSummary: any; }; genomicData?: { platforms: string[]; lastUpdated: Date; unifiedReport: any; therapyMatches: any[]; }; clinicalTrials?: { matchingTrials: { nctId: string; title: string; phase: string; eligibilityScore: number; distance?: number; }[]; searchDate: Date; }; predictions?: { responseProb: { CR: number; PR: number; SD: number; PD: number; }; survivalEstimates: { pfs: { median: number; ci95: [number, number]; }; os: { median: number; ci95: [number, number]; }; }; toxicityRisks: { toxicity: string; grade34Risk: number; mitigationStrategy: string; }[]; resistancePrediction: { mechanism: string; probability: number; timeToResistance?: number; }[]; }; safetyAssessment?: { interactions: { drug1: string; drug2: string; severity: 'major' | 'moderate' | 'minor'; description: string; }[]; contraindications: { drug: string; reason: string; severity: 'absolute' | 'relative'; }[]; pharmacogenomics: { gene: string; variant: string; implication: string; recommendation: string; }[]; overallSafetyScore: number; }; decisionSupport?: { evidenceLevel: 'Category 1' | 'Category 2A' | 'Category 2B' | 'Category 3'; guidelines: string[]; alternativeOptions: { regimen: string; rationale: string; tradeoffs: string; }[]; tumorBoardRequired: boolean; }; patientSummary?: { treatmentGoal: string; whatToExpect: string; sideEffectsToWatch: string[]; questionsForDoctor: string[]; supportResources: string[]; }; compliance?: { consentStatus: 'obtained' | 'pending' | 'declined'; consentDate?: Date; auditLogId: string; accessLog: { userId: string; action: string; timestamp: Date; }[]; }; status: 'draft' | 'pending_review' | 'approved' | 'active' | 'completed' | 'discontinued'; approvedBy?: string; approvedAt?: Date; } export interface TreatmentOutcome { patientId: string; planId: string; response: { assessmentDate: Date; recistResponse: 'CR' | 'PR' | 'SD' | 'PD'; targetLesions: { lesionId: string; baselineSize: number; currentSize: number; percentChange: number; }[]; newLesions: boolean; }; survival: { progressionDate?: Date; deathDate?: Date; lastFollowUpDate: Date; pfsMonths?: number; osMonths?: number; }; toxicities: { toxicityType: string; grade: 1 | 2 | 3 | 4 | 5; onsetDate: Date; resolvedDate?: Date; interventionRequired: boolean; doseModification: 'none' | 'reduction' | 'delay' | 'discontinuation'; }[]; qualityOfLife: { assessmentDate: Date; instrument: 'FACT-G' | 'EORTC-QLQ-C30' | 'PRO-CTCAE' | 'other'; totalScore: number; domainScores: Record; }[]; adherence: { overallAdherence: number; missedDoses: number; reasonsForMissing: string[]; }; } export declare class RealWorldOncologyService { private config; private cancerCapability; private ehrService; private genomicsService; private trialsService; private complianceService; private mlService; private safetyService; private validationService; private decisionSupportService; private patientPortalService; constructor(config?: Partial); private mergeDefaultConfig; /** * Initialize all enabled services */ initialize(): Promise; private initializeEHR; private initializeGenomics; private initializeClinicalTrials; private initializeCompliance; private initializeML; private initializeSafety; /** * Generate a comprehensive treatment plan for a patient */ generateComprehensivePlan(patient: RealWorldPatient, clinicianId: string, options?: { includeTrials?: boolean; includePredictions?: boolean; includeSafetyCheck?: boolean; requireTumorBoard?: boolean; }): Promise; /** * Record treatment outcome for validation */ recordOutcome(outcome: TreatmentOutcome): Promise; /** * Validate system predictions against actual outcomes */ runValidation(cohortCriteria: { cancerTypes?: string[]; stages?: string[]; dateRange?: { start: Date; end: Date; }; minPatients?: number; }): Promise<{ cohortSize: number; concordanceRate: number; responseAUC: number; survivalCIndex: number; calibrationError: number; subgroupResults: Record; }>; private logAccess; private fetchEHRData; private aggregateGenomicData; private findMatchingTrials; private generatePredictions; private performSafetyAssessment; private generateDecisionSupport; private createPatientSummary; /** * Convert internal patient type to CancerPatient for the capability module */ private toCancerPatient; private calculateAge; /** * Get system status and health check */ getSystemStatus(): Promise<{ status: 'healthy' | 'degraded' | 'unhealthy'; services: Record; lastValidation?: Date; modelVersion: string; }>; } export declare function createRealWorldOncologyService(config?: Partial): RealWorldOncologyService; //# sourceMappingURL=realWorldOncology.d.ts.map