/** * Patient-Facing Portal Interfaces * * Provides patient engagement features: * - Treatment plan viewing * - Side effect tracking * - Medication adherence monitoring * - Quality of life assessments * - Secure messaging with care team * - Educational content delivery * - Appointment management * * All interfaces designed for health literacy and accessibility. */ import { EventEmitter } from 'events'; export interface PatientAccount { id: string; mrn: string; email: string; phone?: string; preferredLanguage: string; preferredContactMethod: 'email' | 'sms' | 'phone' | 'portal'; accessLevel: 'full' | 'limited'; proxyAccess?: { proxyId: string; proxyName: string; relationship: string; permissions: ('view' | 'message' | 'schedule')[]; }[]; createdAt: Date; lastLoginAt?: Date; notificationPreferences: { appointments: boolean; labResults: boolean; messages: boolean; medications: boolean; educational: boolean; }; } export interface PatientTreatmentSummary { patientId: string; diagnosis: { condition: string; diagnosisDate: Date; stage?: string; simpleExplanation: string; }; currentTreatment: { regimen: string; medications: { name: string; purpose: string; dose: string; frequency: string; instructions: string; sideEffectsToWatch: string[]; }[]; startDate: Date; cycleInfo?: { currentCycle: number; totalPlannedCycles?: number; nextCycleDate?: Date; }; whatToExpect: string[]; whenToCallDoctor: string[]; }; upcomingAppointments: { date: Date; type: string; provider: string; location: string; preparation?: string; }[]; careTeam: { role: string; name: string; phone?: string; messageable: boolean; }[]; goals: { goal: string; progress?: number; lastUpdated?: Date; }[]; } export interface SymptomReport { id: string; patientId: string; reportedAt: Date; symptoms: { symptom: string; severity: 1 | 2 | 3 | 4 | 5; duration?: string; interference: 'none' | 'little' | 'somewhat' | 'quite-a-bit' | 'very-much'; notes?: string; }[]; overallFeeling: 1 | 2 | 3 | 4 | 5; concernsForDoctor?: string; requiresFollowUp: boolean; followUpReason?: string; } export interface MedicationAdherenceLog { patientId: string; medication: string; logs: { scheduledTime: Date; takenTime?: Date; taken: boolean; skippedReason?: string; sideEffects?: string[]; notes?: string; }[]; adherenceRate: number; missedDoses: number; streakDays: number; } export interface QualityOfLifeAssessment { id: string; patientId: string; assessmentType: 'FACT-G' | 'EORTC-QLQ-C30' | 'PRO-CTCAE' | 'custom'; completedAt: Date; responses: { question: string; category: 'physical' | 'emotional' | 'social' | 'functional' | 'symptoms'; response: number | string; score?: number; }[]; summaryScores: { domain: string; score: number; maxScore: number; interpretation: string; changeFromLast?: number; }[]; alerts: { domain: string; concern: string; severity: 'low' | 'moderate' | 'high'; recommendation: string; }[]; } export interface PatientMessage { id: string; threadId: string; patientId: string; direction: 'inbound' | 'outbound'; sender: { type: 'patient' | 'provider' | 'nurse' | 'system'; name: string; id?: string; }; recipient?: { type: 'patient' | 'provider' | 'nurse' | 'care-team'; name: string; id?: string; }; subject?: string; body: string; attachments?: { name: string; type: string; url: string; }[]; sentAt: Date; readAt?: Date; priority: 'routine' | 'urgent'; category: 'question' | 'symptoms' | 'medication' | 'appointment' | 'billing' | 'other'; requiresResponse: boolean; responseDeadline?: Date; status: 'unread' | 'read' | 'responded' | 'closed'; } export interface EducationalContent { id: string; title: string; description: string; contentType: 'article' | 'video' | 'infographic' | 'checklist' | 'faq'; targetAudience: string[]; cancerTypes?: string[]; treatmentTypes?: string[]; topics: string[]; readingLevel: 'basic' | 'intermediate' | 'advanced'; language: string; content: string; videoUrl?: string; duration?: number; author?: string; reviewedBy?: string; lastUpdated: Date; relatedContent?: string[]; } export interface AppointmentRequest { id: string; patientId: string; requestType: 'new' | 'reschedule' | 'cancel'; appointmentType: string; preferredDates: Date[]; preferredTimes: ('morning' | 'afternoon' | 'evening')[]; reason: string; urgency: 'routine' | 'soon' | 'urgent'; notes?: string; status: 'pending' | 'scheduled' | 'declined'; scheduledAppointment?: { date: Date; provider: string; location: string; }; submittedAt: Date; processedAt?: Date; processedBy?: string; } export declare class PatientPortalService extends EventEmitter { private accounts; private treatmentSummaries; private symptomReports; private adherenceLogs; private qolAssessments; private messages; private educationalContent; private appointmentRequests; constructor(); /** * Create a patient portal account */ createAccount(accountData: Omit): Promise; /** * Get patient account */ getAccount(patientId: string): PatientAccount | undefined; /** * Record patient login */ recordLogin(patientId: string): void; /** * Set patient treatment summary */ setTreatmentSummary(summary: PatientTreatmentSummary): void; /** * Get patient-friendly treatment summary */ getTreatmentSummary(patientId: string): PatientTreatmentSummary | undefined; /** * Generate simple language summary */ generateSimpleSummary(diagnosis: string, stage: string, treatment: string): { diagnosisExplanation: string; treatmentExplanation: string; whatItMeans: string[]; }; private simplifyDiagnosis; private simplifyTreatment; /** * Submit a symptom report */ submitSymptomReport(patientId: string, symptoms: SymptomReport['symptoms'], overallFeeling: SymptomReport['overallFeeling'], concerns?: string): Promise; /** * Get symptom history for patient */ getSymptomHistory(patientId: string, days?: number): SymptomReport[]; /** * Get symptom trends */ getSymptomTrends(patientId: string): { symptom: string; trend: 'improving' | 'stable' | 'worsening'; averageSeverity: number; occurrences: number; }[]; private analyzeSymptoms; private determineSeverity; /** * Log medication taken */ logMedicationTaken(patientId: string, medication: string, scheduledTime: Date, taken: boolean, takenTime?: Date, skippedReason?: string, sideEffects?: string[]): void; /** * Get adherence summary */ getAdherenceSummary(patientId: string): { medications: MedicationAdherenceLog[]; overallAdherence: number; concerns: string[]; encouragement: string; }; /** * Submit quality of life assessment */ submitQoLAssessment(patientId: string, assessmentType: QualityOfLifeAssessment['assessmentType'], responses: QualityOfLifeAssessment['responses']): Promise; /** * Get QoL assessment history */ getQoLHistory(patientId: string): QualityOfLifeAssessment[]; private scoreAssessment; private interpretScore; private identifyQoLAlerts; /** * Send a message */ sendMessage(patientId: string, body: string, category: PatientMessage['category'], priority?: PatientMessage['priority'], subject?: string): Promise; /** * Get messages for patient */ getMessages(patientId: string, unreadOnly?: boolean): PatientMessage[]; /** * Mark message as read */ markMessageRead(patientId: string, messageId: string): void; /** * Get recommended educational content */ getRecommendedContent(patientId: string): EducationalContent[]; /** * Search educational content */ searchContent(query: string): EducationalContent[]; private initializeEducationalContent; /** * Request an appointment */ requestAppointment(request: Omit): Promise; /** * Get appointment requests for patient */ getAppointmentRequests(patientId: string): AppointmentRequest[]; /** * Get dashboard data for patient */ getDashboard(patientId: string): { summary: PatientTreatmentSummary | undefined; recentSymptoms: SymptomReport[]; adherence: ReturnType; unreadMessages: number; upcomingAppointments: PatientTreatmentSummary['upcomingAppointments']; recommendedContent: EducationalContent[]; alerts: string[]; }; } export default PatientPortalService; //# sourceMappingURL=patientPortal.d.ts.map