export type LeadName = | "I" | "II" | "III" | "aVR" | "aVL" | "aVF" | "V1" | "V2" | "V3" | "V4" | "V5" | "V6" | "MLII" | "MLIII"; export interface EcgPatient { family?: string; given?: string[]; birthDate?: string; } export interface EcgSource { name: string; version?: string; } export interface EcgInterpretation { system?: string; code?: string; display?: string; text?: string; } export interface EcgLead { /** Standard lead name: "I"|"II"|"III"|"aVR"|"aVL"|"aVF"|"V1"|"V2"|"V3"|"V4"|"V5"|"V6"|"MLII"|"MLIII". */ lead: LeadName; /** Exact signed integer ADC samples (-32768..32767); 100% lossless round trip into Observation.valueSampledData.data. */ samples: number[]; } export interface EcgStrip { patient?: EcgPatient; source?: EcgSource; /** FHIR dateTime / instant (e.g. "2026-05-01T14:30:00Z"). */ recordedAt: string; /** Integer sampling frequency in Hz (50..1000, e.g. 250, 360, 500). */ sampleRateHz: number; /** Exact integer microvolts per ADC step (1..1000, e.g. 5 for 200 adu/mV -> FHIR factor 0.005 mV). */ microvoltsPerUnit: number; /** Optional clinical rhythm interpretation (SNOMED CT / LOINC / text). */ interpretation?: EcgInterpretation; /** Attribution / provenance note (e.g. "PhysioNet MIT-BIH 100 @ 00:10"). */ note?: string; /** 1..12 simultaneous ECG leads, each with the same sample count (1..12000; total <= 24000). */ leads: EcgLead[]; }