/*
 * File: patient.ts
 * Description: Patient-related type definitions for medical data
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

export interface Patient {
  id: string;
  mrn: string; // Medical Record Number
  firstName: string;
  lastName: string;
  dateOfBirth: Date;
  gender: 'MALE' | 'FEMALE' | 'OTHER';
  age: number;
  bedNumber: string;
  roomNumber: string;
  admissionDate: Date;
  status: PatientStatus;
  priority: AlertPriority;
  department: string;
  attendingPhysician: string;
  allergies: Allergy[];
  medications: Medication[];
  vitalSigns: VitalSigns;
  medicalHistory: MedicalHistory[];
  currentDiagnosis: string;
  lastUpdated: Date;
}

export type PatientStatus = 
  | 'ACTIVE'
  | 'PENDING'
  | 'DISCHARGED'
  | 'TRANSFERRED'
  | 'CRITICAL';

export type AlertPriority = 
  | 'CRITICAL'
  | 'HIGH'
  | 'MEDIUM'
  | 'LOW';

export interface VitalSigns {
  bloodPressure: {
    systolic: number;
    diastolic: number;
    timestamp: Date;
  };
  heartRate: {
    value: number;
    timestamp: Date;
  };
  temperature: {
    value: number;
    timestamp: Date;
  };
  respiratoryRate: {
    value: number;
    timestamp: Date;
  };
  oxygenSaturation: {
    value: number;
    timestamp: Date;
  };
}

export interface Allergy {
  id: string;
  name: string;
  severity: 'MILD' | 'MODERATE' | 'SEVERE';
  reaction: string;
  notes?: string;
}

export interface Medication {
  id: string;
  name: string;
  dosage: string;
  frequency: string;
  route: string;
  startDate: Date;
  endDate?: Date;
  status: 'ACTIVE' | 'DISCONTINUED' | 'COMPLETED';
  prescribedBy: string;
}

export interface MedicalHistory {
  id: string;
  condition: string;
  diagnosisDate: Date;
  status: 'ACTIVE' | 'RESOLVED' | 'CHRONIC';
  notes?: string;
  treatingPhysician: string;
}

export interface ScanResult {
  id: string;
  patientId: string;
  scanType: 'CT' | 'MRI' | 'XRAY' | 'ULTRASOUND';
  bodyPart: string;
  status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED' | 'REVIEWED';
  orderedBy: string;
  orderedDate: Date;
  completedDate?: Date;
  reviewedBy?: string;
  reviewedDate?: Date;
  findings: string;
  aiSummary?: string;
  images: string[];
  priority: AlertPriority;
}

/*
 * End of File: patient.ts
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */ 