I want to understand ECG completely. So give me all basic and advance ecg knowledge with full detail it mbbs level, also explain with ecg paper with diagram then goes for abnormally and change in ecg patten with that abnormalities, then goes as for all condition from simpler to complex one with diagram. Use otentic source and explain such a why that i become the expert of ecg interpretation.

Reading File
Now let me search the library for comprehensive ECG content across multiple topics in parallel.
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Excellent! Now let me fetch the key ECG diagram images and read more on abnormalities.
Loading Image
Loading Image
Reading File
Reading File
Loading Image
Reading File
Loading Image
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Loading Image
Reading File
Finding Sources
Reading File
Loading Image
Loading Image
Loading Image
Now I have all the material needed. Let me compile the comprehensive ECG guide.

Complete ECG Mastery Guide - MBBS Level

Sources: Harrison's Principles of Internal Medicine 22E, Goldman-Cecil Medicine, Costanzo Physiology 7th Ed, Medical Physiology (Boron & Boulpaep), Gray's Anatomy for Students, Miller's Anesthesia 10E

PART 1 - THE FOUNDATION: CARDIAC ELECTROPHYSIOLOGY

Why does the heart generate electricity?

Every cardiac muscle cell maintains a resting membrane potential of about -90 mV (inside negative). When stimulated, sodium rushes in, depolarizing the cell - this is the action potential. The moving wave of depolarization creates an electrical dipole. The ECG records these dipoles from the body surface.
The conduction system (Gray's Anatomy for Students):
  • SA Node - located at junction of superior vena cava and right atrium at the top of the crista terminalis. This is the primary pacemaker (60-100 bpm intrinsic rate). It fires spontaneously due to "funny current" (If channel).
  • AV Node - located near the opening of the coronary sinus, close to the septal leaflet of the tricuspid valve. Intrinsic rate 40-60 bpm. This is the electrical gatekeeper - it deliberately slows conduction (0.08-0.12 sec delay) to allow atria to finish filling ventricles before they contract.
  • Bundle of His - direct continuation of AV node, runs along lower border of membranous interventricular septum.
  • Right Bundle Branch - travels on right side of interventricular septum, enters the septomarginal trabecula to reach the anterior papillary muscle.
  • Left Bundle Branch - divides into left anterior fascicle (LAF) and left posterior fascicle (LPF).
  • Purkinje Fibers - the terminal network. Fastest conducting tissue (2-4 m/s). Ensures simultaneous activation of all ventricular muscle from apex upward.
Key insight: Depolarization moves from endocardium to epicardium. Repolarization (T wave) moves in the OPPOSITE direction - from epicardium to endocardium. That is why the T wave is normally upright even though it represents recovery.

PART 2 - THE ECG PAPER (Reading the Grid)

This is the most important foundation. Everything in ECG interpretation depends on understanding the paper.
ECG paper with labeled waves, intervals, and grid measurements showing P, Q, R, S, T, U waves with PR, QRS, QT intervals marked
Fig 42-2, Goldman-Cecil Medicine - The ECG grid with all waves and intervals labeled

The Grid - Memorize This Forever

DimensionSmall Box (1 mm)Large Box (5 mm)
Time (horizontal)0.04 sec (40 ms)0.20 sec (200 ms)
Voltage (vertical)0.1 mV0.5 mV
Standard settings: Paper speed = 25 mm/sec, Gain = 10 mm/mV (1 cm = 1 mV)

Calculating Heart Rate (3 methods)

Method 1 - Large box method (for regular rhythms): HR = 300 ÷ number of large boxes between R-R
  • 1 large box = 300 bpm
  • 2 large boxes = 150 bpm
  • 3 large boxes = 100 bpm
  • 4 large boxes = 75 bpm
  • 5 large boxes = 60 bpm
  • 6 large boxes = 50 bpm
Method 2 - Small box method: HR = 1500 ÷ number of small boxes between R-R
Method 3 - 10-second strip method (for irregular rhythms): Count all QRS complexes in the 10-second strip × 6

PART 3 - THE ECG WAVES AND INTERVALS

The Cardiac Cycle Correlated with ECG

Cardiac cycle diagram showing ventricular pressure, aortic flow, ventricular volume, heart sounds, venous pulse, and ECG waveform all synchronized in time
Miller's Anesthesia - Electrical and mechanical events during a single cardiac cycle

Wave-by-Wave Breakdown

P Wave
  • Represents: Atrial depolarization (SA node fires → both atria depolarize)
  • Normal: Duration < 0.12 sec (3 small boxes), Amplitude < 2.5 mm
  • Shape: Smooth, rounded, upright in leads I, II, aVF
  • Biphasic in V1 (initial positive = RA depolarization; terminal negative = LA depolarization)
  • Axis: 0° to +75° (normally upright in I and II)
PR Interval
  • Measured: From onset of P to onset of QRS
  • Represents: Time for impulse to travel from SA node through atria → AV node → His bundle → bundle branches (includes the AV nodal delay)
  • Normal: 0.12-0.20 sec (3-5 small boxes)
  • Short PR (<0.12 s): Pre-excitation (WPW), junctional rhythm
  • Long PR (>0.20 s): First-degree AV block
QRS Complex
  • Represents: Ventricular depolarization
  • Naming convention (Medical Physiology, Boron & Boulpaep):
    • Q = first negative deflection before any positive deflection
    • R = first positive deflection
    • S = negative deflection after R
    • R' = second positive deflection (if present)
    • Capital letters = large amplitude; lowercase = small amplitude
    • So "rSR'" = small r, large S, small R'... "qR" = small q, large R
  • Normal duration: 0.07-0.11 sec (<3 small boxes)
  • QRS > 0.12 sec = wide QRS = bundle branch block OR ventricular origin OR hyperkalemia
ST Segment
  • Measured: From J-point to onset of T wave
  • The J-point is where QRS ends and ST segment begins
  • Normally isoelectric (on the baseline)
  • Deviation: Elevation or depression - the most clinically critical finding
T Wave
  • Represents: Ventricular repolarization
  • Normally: Asymmetric (slow upstroke, rapid downstroke), upright in I, II, V3-V6
  • Normally inverted in: aVR (always), V1 (always), sometimes V2, III
  • Peaked T waves → hyperkalemia
  • Inverted T waves → ischemia, strain, RBBB/LBBB
QT Interval
  • Measured: From onset of QRS to end of T wave
  • Represents: Total duration of ventricular action potential (depolarization + repolarization)
  • Rate-dependent! Use Bazett's formula: QTc = QT / √(R-R interval in seconds)
  • Normal QTc: ≤450 ms (men), ≤460 ms (women) - Goldman-Cecil Table 42-1
  • Prolonged QT: Drugs (quinidine, sotalol, amiodarone, TCAs), hypokalemia, hypomagnesemia, hypocalcemia, congenital LQTS
U Wave
  • Small deflection after T wave, same polarity as T
  • Best seen in V2-V3
  • Prominent U waves → hypokalemia, bradycardia

PART 4 - THE 12-LEAD ECG: THE ELECTRICAL VIEWPOINTS

Normal 12-Lead ECG

Normal 12-lead ECG showing all leads: I, II, III, aVR, aVL, aVF, V1-V6 with typical normal complexes
Medical Physiology (Boron & Boulpaep) - Normal 12-lead ECG recording
The 12 leads view the heart from 12 different angles - like 12 cameras around the heart.

Limb Leads (Frontal Plane - look at the heart from front)

Einthoven's Triangle:
  • Lead I = Left arm (+) vs Right arm (-) → looks at heart from 0°
  • Lead II = Left leg (+) vs Right arm (-) → looks at heart from +60°
  • Lead III = Left leg (+) vs Left arm (-) → looks at heart from +120°
Augmented leads (unipolar):
  • aVR = Right arm → looks from -150° (points AWAY from the heart - always mostly negative)
  • aVL = Left arm → looks from -30°
  • aVF = Left foot → looks from +90°

Precordial Leads (Horizontal Plane - look at the heart in cross-section)

Placed across the chest:
LeadPositionWhat it sees
V14th intercostal space, right sternal borderRight ventricle, septum
V24th intercostal space, left sternal borderSeptum, anterior LV
V3Between V2 and V4Anterior wall
V45th intercostal space, midclavicular lineAnterior-lateral wall
V5Anterior axillary line, same level as V4Lateral wall
V6Midaxillary line, same level as V4Lateral wall

Anatomical Groupings (Critical for locating infarcts!)

TerritoryLeadsCoronary Artery
InferiorII, III, aVFRCA (80%) or LCx (20%)
AnteriorV1-V4LAD
LateralI, aVL, V5-V6LCx
SeptalV1-V2LAD (septal branches)
PosteriorReciprocal changes in V1-V3RCA or LCx
Right ventricleV3R, V4RRCA (proximal)

Normal QRS Appearance Across Leads

Precordial R-wave progression - a key feature:
  • V1: rS pattern (small r, big S) - septum depolarizes left-to-right, moving away from V1
  • V1-V4: R wave progressively increases ("R-wave progression")
  • V3-V4: Transition zone (R = S)
  • V5-V6: qR or qRs pattern - large R, small q (normal septal q)
Loss of normal R-wave progression suggests anterior myocardial infarction (old or acute).

PART 5 - QRS AXIS

The mean QRS axis represents the average direction of ventricular depolarization in the frontal plane.
Quick method: Look at leads I and aVF:
Lead IaVFAxisMeaning
PositivePositiveNormal (0° to +90°)Normal
PositiveNegativeLeft axis deviation (LAD)LAFB, inferior MI, LVH
NegativePositiveRight axis deviation (RAD)RVH, LPFB, lateral MI, PE
NegativeNegativeExtreme/Northwest axisVT, severe hyperkalemia
Normal axis: -30° to +90° Left axis deviation (LAD): more negative than -30° Right axis deviation (RAD): more positive than +90°

PART 6 - SYSTEMATIC APPROACH TO ECG READING

Use this every single time. Never skip a step.
The PRISCE Method:
  1. P - Rate and rhythm (P waves present? Regular? Rate?)
  2. R - Rhythm analysis (P-R relationship, regular vs irregular)
  3. I - Intervals (PR, QRS duration, QTc)
  4. S - ST segments and T waves (elevation? depression? inversion?)
  5. C - Conduction (axis, bundle branch blocks)
  6. E - Everything else (chamber enlargement, Q waves, U waves)

PART 7 - ABNORMALITIES: SIMPLE TO COMPLEX


7.1 SINUS NODE ABNORMALITIES

Sinus Bradycardia
  • Rate < 60 bpm
  • Normal P waves, normal PR, normal QRS - just slow
  • Cause: Vagal tone, beta-blockers, hypothyroidism, athletes, sick sinus syndrome
  • ECG: Everything normal, just rate <60
Sinus Tachycardia
  • Rate > 100 bpm
  • Normal P waves, normal PR, normal QRS - just fast
  • Cause: Fever, pain, anxiety, anemia, PE, thyrotoxicosis, hypovolemia
  • Key: ALWAYS find the cause - sinus tachycardia is a symptom, not a diagnosis
Sinus Arrhythmia
  • Rate varies with respiration (increases with inspiration, decreases with expiration)
  • Rate varies > 10% between fastest and slowest
  • Normal finding - physiologic, especially in young people

7.2 ATRIAL ARRHYTHMIAS

Atrial Premature Contractions (APCs/PACs)
  • An early P wave with different morphology than sinus P
  • Followed by normal or slightly aberrant QRS
  • Usually followed by incomplete compensatory pause
  • Benign in most cases
Atrial Flutter
  • Rate: Atrial rate 250-350 bpm (classically 300 bpm)
  • Sawtooth flutter waves (F waves) best seen in II, III, aVF and V1
  • Regular or regularly irregular ventricular rate (2:1, 3:1, or 4:1 block)
  • Classic: 2:1 block with ventricular rate 150 bpm - always suspect flutter when rate is exactly 150!
  • Mechanism: Macroreentrant circuit in right atrium around tricuspid valve
Atrial Fibrillation (AF)
  • Most common sustained arrhythmia
  • ECG findings:
    • No distinct P waves - replaced by irregular fibrillatory baseline (chaotic, fine or coarse)
    • Irregularly irregular RR intervals - the hallmark
    • Normal (usually narrow) QRS unless aberrant conduction
  • Ventricular rate: 100-170 bpm if uncontrolled
  • Atrial rate: 350-600 bpm (too fast and chaotic to produce coordinated P waves)

7.3 AV CONDUCTION BLOCKS (HEART BLOCKS)

First-Degree AV Block
  • PR interval > 0.20 sec (>5 small boxes)
  • Every P is followed by a QRS
  • Not a "block" per se - just slowed conduction
  • Usually benign; causes: AV nodal disease, high vagal tone, digoxin, inferior MI
Second-Degree AV Block - Mobitz Type I (Wenckebach)
  • Progressive lengthening of PR interval with each beat until a P wave fails to conduct (a QRS is dropped)
  • The cycle then resets
  • Usually benign - AV nodal level block
  • Often seen in inferior MI (RCA supplies AV node)
  • The grouped beating pattern is characteristic
Second-Degree AV Block - Mobitz Type II
  • PR interval is CONSTANT
  • Sudden, unexpected non-conducted P wave (a QRS drops without warning)
  • Often in bundle of His or below - more dangerous
  • Higher risk of progressing to complete block
  • Often needs pacemaker
Third-Degree (Complete) AV Block
  • Complete dissociation between P waves and QRS complexes
  • P waves and QRS march at completely independent rates
  • P rate: ~60-80 bpm (sinus)
  • QRS rate: 20-40 bpm if ventricular escape, 40-60 bpm if junctional escape
  • Wide QRS if ventricular escape pacemaker; narrow if junctional
  • Emergent pacemaker needed in symptomatic patients

7.4 BUNDLE BRANCH BLOCKS

RBBB and LBBB compared to normal in V1 and V6
Harrison's 22E Fig 247-10 - RBBB and LBBB compared to normal in leads V1 and V6
The key rule: T waves are discordant to last QRS deflection in bundle branch blocks (they point opposite). This is a secondary repolarization change - NOT ischemia.
Right Bundle Branch Block (RBBB)
  • QRS ≥ 0.12 sec
  • rSR' pattern in V1 ("M" shape or rabbit ears) - hallmark
  • Wide, slurred S wave in I, aVL, V5-V6
  • T wave inverted in V1-V2 (secondary repolarization change - NORMAL for RBBB)
  • Mechanism: RV depolarizes late via slow muscle-to-muscle conduction (the septal depolarization is normal, then LV depolarizes normally, but RV depolarizes last and slowly - this creates the late R' in V1)
  • Causes: Right heart strain (PE, RVH), ischemia, myocarditis, idiopathic, congenital
Left Bundle Branch Block (LBBB)
  • QRS ≥ 0.12 sec
  • Broad, monophasic R wave in V5-V6 (no septal q waves - they're abolished)
  • rS or QS pattern in V1 - deep, wide S or QS
  • T wave inverted in I, V5-V6 (secondary repolarization change - NORMAL for LBBB)
  • Mechanism: Septum and LV depolarize abnormally (right-to-left instead of left-to-right) - this is why septal Q waves disappear
  • Causes: Hypertensive heart disease, ischemia, aortic stenosis, cardiomyopathy
  • IMPORTANT: New LBBB with chest pain = treat as STEMI equivalent (Sgarbossa criteria apply)
Left Anterior Fascicular Block (LAFB)
  • Left axis deviation (more negative than -45°)
  • Small q in I and aVL, small r in II, III, aVF (qR in I/aVL; rS in II/III/aVF)
  • QRS slightly prolonged (but < 0.12 sec)
  • Most common cause of marked LAD in adults
Left Posterior Fascicular Block (LPFB)
  • Right axis deviation (more positive than +110-120°)
  • Diagnosis of exclusion (must rule out RVH, PE, lateral MI)
  • Rare as isolated finding

7.5 CHAMBER HYPERTROPHY AND ENLARGEMENT

Atrial Abnormalities:
P wave changes in right and left atrial overload - normal vs right vs left patterns in leads II and V1
Harrison's 22E Fig 247-8 - P wave changes with right and left atrial overload
  • Right Atrial Overload (P-pulmonale): Tall, peaked P waves ≥2.5 mm in II, III, aVF ("P-pulmonale"). Seen in COPD, PE, pulmonary hypertension.
  • Left Atrial Abnormality (P-mitrale): Broad, notched P wave ≥0.12 sec in limb leads ("M-shaped P"); biphasic P in V1 with deep, wide terminal negative component. Seen in mitral stenosis, LV failure, hypertension.
Left Ventricular Hypertrophy (LVH):
  • Large, tall QRS voltages (but poor sensitivity ~30-50%; specificity ~85-95%)
  • Sokolow-Lyon criteria: S in V1 + R in V5 or V6 > 35 mm
  • Cornell criteria: R in aVL + S in V3 > 28 mm (men) or > 20 mm (women)
  • ST depression and T-wave inversion in lateral leads (LV "strain" pattern)
  • Left axis deviation, left atrial abnormality often accompany
Right Ventricular Hypertrophy (RVH):
  • Tall R wave in V1 (R ≥ S in V1)
  • Right axis deviation (QRS axis > +90°)
  • ST depression and T-wave inversion V1-V3 (RV "strain")
  • Deep S waves in V5-V6

7.6 MYOCARDIAL ISCHEMIA AND INFARCTION

This is the most clinically critical section.

Mechanism of ST Changes

Subendocardial vs transmural ischemia - current of injury causing ST depression vs elevation
Harrison's 22E Fig 247-11 - Currents of injury in ischemia
Ischemia lowers resting membrane potential and shortens action potential duration, creating a voltage gradient (current of injury) between normal and ischemic zones:
  • Transmural (epicardial) ischemia: ST vector points toward the outer layers → ST elevation in the leads overlying the ischemia
  • Subendocardial ischemia: ST vector points toward the cavity → ST depression in overlying leads + ST elevation in aVR

Evolution of STEMI (the classic sequence)

TimeECG ChangeMechanism
MinutesHyperacute T waves (tall, peaked, broad)Early ischemia, membrane potential changes
HoursST elevation (convex upward, "tombstone")Transmural injury current
Hours-DaysT-wave inversion developsRepolarization changes
Hours-DaysQ waves developElectrically silent necrotic myocardium
WeeksST returns to baselineInfarct healed
PermanentQ waves remain (usually)Scar

Anterior Ischemia with Deep T-wave Inversions

Anterior wall ischemia with deep T-wave inversions in V1-V6
Harrison's 22E Fig 247-12 - Severe anterior wall ischemia with prominent T-wave inversions in precordial leads

Localization of Infarction by Lead Territory

Location of MIST Changes inCulprit Artery
InferiorII, III, aVF elevation; I, aVL depression (reciprocal)RCA (80%) or LCx
AnteriorV1-V4 elevationLAD
LateralI, aVL, V5-V6 elevationLCx or diagonal branch
AnterolateralV1-V6, I, aVLProximal LAD
PosteriorV1-V3 ST depression + tall R in V1 (mirror image)RCA or LCx
RV infarctV3R-V4R elevationProximal RCA

Pathological Q Waves

  • Width ≥ 0.04 sec (1 small box) OR
  • Depth ≥ 25% of the R wave height in that lead
  • Significance: Electrically silent (dead) myocardium - represents necrosis
  • Septal Q waves in V5-V6 are NORMAL (small, narrow septal depolarization waves)
  • Q waves in III alone are normal (right axis deviation can cause this)

Non-ST Elevation MI (NSTEMI) / Unstable Angina

  • ST depression (horizontal or downsloping > 1 mm) in ≥2 contiguous leads
  • T-wave inversions
  • New LBBB
  • Or even a normal ECG (ECG changes absent in ~40% of NSTEMIs)

7.7 VENTRICULAR ARRHYTHMIAS

Premature Ventricular Contractions (PVCs)
  • Early wide QRS (≥0.12 sec) with bizarre morphology
  • No preceding P wave
  • T wave opposite to QRS (discordant)
  • Full compensatory pause (sinus P march through undisturbed)
  • If every other beat = bigeminy; every third = trigeminy
  • Unifocal = all identical; multifocal = different morphologies
Ventricular Tachycardia (VT)
  • Wide QRS tachycardia at rate > 100 bpm (usually 140-200 bpm)
  • AV dissociation (P waves march at own rate, independent of QRS) - pathognomonic
  • Fusion beats - a QRS halfway between normal and VT morphology (proves AV dissociation)
  • Capture beats - a normal narrow QRS in the middle of a wide complex tachycardia (the sinus impulse briefly captures the ventricle)
  • ALWAYS assume wide-complex tachycardia = VT until proven otherwise
Distinguishing VT from SVT with aberrancy (Brugada criteria):
  1. No RS complex in any precordial lead? → VT
  2. RS interval > 100 ms in any precordial lead? → VT
  3. AV dissociation present? → VT
  4. Morphology criteria for VT met? → VT If none → SVT with aberrancy
Ventricular Fibrillation (VF)
  • Completely chaotic, irregular, high-frequency undulations
  • No recognizable QRS, ST, or T waves
  • Cardiac arrest - immediate defibrillation required
Torsades de Pointes (TdP)
  • Polymorphic VT where QRS complexes twist around the isoelectric line
  • Occurs in setting of prolonged QT
  • ECG: Oscillating amplitude of QRS complexes - looks like it's "twisting"
  • Causes: Class IA/III antiarrhythmics, hypokalemia, hypomagnesemia, congenital long QT

7.8 SUPRAVENTRICULAR TACHYCARDIAS (SVT)

AVNRT (AV Nodal Reentrant Tachycardia) - most common SVT
  • Sudden onset narrow QRS tachycardia, rate 150-250 bpm
  • P waves buried IN or just after QRS (retrograde P, seen as pseudo-S wave in II, pseudo-R' in V1)
  • Regular rhythm
AVRT (AV Reentrant Tachycardia - WPW)
  • Wolff-Parkinson-White: Accessory pathway bypasses AV node
  • Resting ECG: Short PR (<0.12 sec) + Delta wave (slurred upstroke of QRS) + wide QRS
  • During SVT: Orthodromic (narrow QRS, retrograde P after QRS) or antidromic (wide QRS, looks like VT)
  • AF with WPW is dangerous: Very fast irregular wide complex rhythm → can degenerate to VF

7.9 ELECTROLYTE DISTURBANCES

(Sources: Harrison's 22E, Barash Clinical Anesthesia, Medical Physiology)

Hyperkalemia - Progressive ECG Changes

As serum K+ rises:
  1. K+ 5.5-6.5 mEq/L: Peaked (tall, narrow, symmetric "tent-shaped") T waves - earliest sign
  2. K+ 6.5-7.5 mEq/L: PR prolongation; P wave flattening/disappearance; QRS widening begins
  3. K+ 7.5-8.0 mEq/L: QRS markedly widened, ST changes
  4. K+ > 8.0 mEq/L: Sine wave pattern (QRS and T merge into undulating sine wave) → ventricular fibrillation → asystole
Clinical pearl: In hyperkalemia, if you see peaked T waves + wide QRS + no P waves = hyperkalemic emergency - give calcium gluconate immediately!

Hypokalemia

  • Flattening of T waves
  • Prominent U waves (U wave > T wave amplitude, especially V2-V3) - hallmark
  • Prolonged QT (actually prolonged QU interval)
  • ST depression
  • Predisposes to torsades de pointes

Hypercalcemia

  • Shortened QT interval (specifically shortened ST segment)
  • Osborn waves (J waves) may appear

Hypocalcemia

  • Prolonged QT interval (prolonged ST segment; T wave itself normal)
  • Distinguishing feature: The QT lengthens but T-wave shape remains normal (vs drug-induced where T wave itself is abnormal)

7.10 PERICARDITIS

  • Diffuse ST elevation in almost ALL leads (except aVR and V1 which show ST depression) - this is what distinguishes it from MI (which is territorial/regional)
  • PR depression (often with PR elevation in aVR) - specific for pericarditis
  • ST elevation is saddle-shaped (concave upward) vs MI (convex upward "tombstone")
  • No reciprocal ST depression (unlike MI)
  • No Q waves
  • Four stages:
    1. Diffuse ST elevation + PR depression
    2. ST normalizes, T waves flatten
    3. T-wave inversions (diffuse)
    4. Normalization

7.11 PULMONARY EMBOLISM

The classic ECG finding of PE is sinus tachycardia (most common, but non-specific).
S1Q3T3 pattern (specific but insensitive):
  • S wave in lead I
  • Q wave in lead III
  • T-wave inversion in lead III
  • Represents acute right heart strain/RV overload
Other PE ECG findings:
  • New RBBB (acute RV strain)
  • Right axis deviation
  • T-wave inversions V1-V4 (RV strain)
  • Sinus tachycardia
  • Atrial arrhythmias (AF, flutter)

7.12 HYPOTHERMIA

  • Osborn waves (J waves): Positive deflection at the J-point (junction of QRS and ST segment) - pathognomonic for hypothermia
  • Sinus bradycardia
  • Prolonged all intervals (PR, QRS, QT)
  • J waves are most prominent in left precordial leads and inferior leads
  • Core temp correlates with J-wave size (bigger J waves = colder patient)

7.13 DRUG EFFECTS

DrugECG Effect
Digoxin"Scooping" ST-T (reverse tick); shortened QT; PR prolongation; can cause virtually any arrhythmia in toxicity
Class IA (quinidine)QT prolongation; QRS widening; torsades de pointes
Class IC (flecainide)QRS widening; PR prolongation
Class III (amiodarone)QT prolongation; bradycardia; T-wave widening
Tricyclic antidepressantsQRS widening; QT prolongation; right axis deviation; tall R in aVR
Beta-blockersSinus bradycardia; PR prolongation

7.14 BRUGADA SYNDROME

  • Coved-type ST elevation (≥2 mm, concave-down then down-sloping to an inverted T) in V1-V2 with RBBB pattern
  • Two patterns: Type 1 (coved, diagnostic) and Type 2 (saddle-back, not diagnostic without provocation)
  • Autosomal dominant Na+ channel mutation (SCN5A)
  • Risk of sudden cardiac death - ventricular fibrillation
  • Unmasked by fever, sodium channel blockers

7.15 LONG QT SYNDROME

  • QTc ≥ 450 ms (males), ≥ 460 ms (females)
  • Congenital (LQT1-15, mutations in K+ and Na+ channels) or acquired (drugs, electrolytes)
  • LQT1: Wide-based T waves; events during exercise/swimming
  • LQT2: Bifid (notched) T waves; events during emotion or sudden sounds
  • LQT3: Late-onset narrow T waves; events during sleep/rest
  • Risk: Torsades de pointes → VF → sudden death

PART 8 - ADVANCED: COMPLETE NORMAL ECG READ-THROUGH

Here is a normal 12-lead ECG read systematically:
Normal 12-lead ECG from Harrison's showing sinus rhythm at 75 bpm
Harrison's 22E Fig 247-7 - Normal ECG: sinus rhythm 75 bpm, PR 160 ms, QRS 80 ms, QTc ~390 ms, axis ~+70°
Step-by-step interpretation:
  1. Rate: Count R-R intervals → 75 bpm
  2. Rhythm: P waves present? Regular? P before every QRS? Yes → sinus rhythm
  3. PR interval: ~160 ms (4 small boxes) - normal
  4. QRS: ~80 ms (2 small boxes) - narrow, normal
  5. QTc: ~390 ms - normal
  6. Axis: Positive in I and II → normal axis (+60-70°)
  7. P wave: Upright in I, II, aVF - normal morphology
  8. QRS progression: R grows from V1-V5, transition at V3-V4 - normal
  9. ST segment: Isoelectric in all leads - normal
  10. T waves: Upright in I, II, V3-V6; inverted in aVR - normal
  11. Conclusion: Normal sinus rhythm, no acute changes

PART 9 - QUICK REFERENCE SUMMARY TABLE

FindingKey ECG FeaturesThink Of
Short PR + delta wavePR <0.12 s, slurred QRS upstrokeWPW syndrome
Long PR, normal QRSPR >0.20 s, every P→QRS1st degree AV block
Prolonging PR then dropped beatWenckebach grouping2nd degree Mobitz I
Fixed PR, sudden dropped QRSConstant PR, sudden no QRS2nd degree Mobitz II
P and QRS march independentlyComplete AV dissociation3rd degree block
rSR' in V1, S in V5-V6Wide QRS, RBBB patternRBBB
Broad R in V5-V6, QS in V1Wide QRS, no septal qLBBB
Diffuse ST elevation (saddle) + PR depressionAll leads except aVRPericarditis
Regional ST elevation (convex)Territorial leads + reciprocalSTEMI
Peaked narrow T waves + wide QRSProgressive QRS wideningHyperkalemia
Prominent U wavesU wave > T waveHypokalemia
Short QTShortened ST segmentHypercalcemia
Long QTProlonged QT, bifid THypocalcemia, drugs, LQTS
J (Osborn) wavesHump at J-pointHypothermia
S1Q3T3 + tachycardiaSinus tach + right heart strainPulmonary embolism
Coupe-type V1-V2 ST elevationCoved ST in V1-V2Brugada syndrome
Twisting QRS around baselinePolymorphic VT, long QTTorsades de pointes
Irregularly irregular, no P wavesFibrillatory baselineAtrial fibrillation
Sawtooth waves 300/minRegular flutter wavesAtrial flutter
AV dissociation + wide QRSFusion/capture beatsVentricular tachycardia

PART 10 - HOW TO BECOME AN EXPERT: THE EXPERT MINDSET

  1. Every ECG tells a story - ask "what is the heart doing electrically, and why?"
  2. Leads are just viewpoints - ST elevation in III but not II alone ≠ inferior MI. Changes must be in ≥2 contiguous leads.
  3. Context is everything - a rate of 50 in a sleeping athlete is normal; the same rate in a septic patient with chest pain is alarming.
  4. Compare with old ECGs - a new LBBB or a new Q wave is far more significant than a chronic finding.
  5. The big five life threats on ECG:
    • STEMI (coronary artery occlusion)
    • Ventricular tachycardia / fibrillation
    • Complete heart block
    • Severe hyperkalemia
    • Torsades de pointes / prolonged QT with instability
  6. Practice protocol: Read 5-10 ECGs daily using the systematic approach. Use resources like ECGpedia, Litfl (Life in the Fast Lane), or Dr. Smith's ECG Blog for pathologic examples.

Key References:
  • Goldman-Cecil Medicine 26E, Chapter 42 - Electrocardiography
  • Harrison's Principles of Internal Medicine 22E, Chapter 247 - Electrocardiography
  • Costanzo Physiology 7th Ed, Chapter 4 - Electrocardiogram
  • Medical Physiology (Boron & Boulpaep), Chapter 21 - ECG
  • Gray's Anatomy for Students - Cardiac Conduction System
  • Miller's Anesthesia 10E, Chapter 13 - Cardiac Cycle and ECG
---This is a complete, MBBS-level ECG mastery guide sourced from the best medical textbooks. Here's a summary of what's covered:

What This Guide Covers:
SectionContent
Part 1Cardiac electrophysiology - why the heart generates electricity, action potentials, conduction system (SA node → AV node → His-Purkinje)
Part 2ECG paper - the grid, time/voltage calibration, 3 methods to calculate heart rate
Part 3All waves explained: P, PR, QRS, ST, T, QT, U - with normal values, what each represents, when they go abnormal
Part 412-lead ECG - Einthoven's triangle, all 6 limb leads, all 6 precordial leads, anatomical territories
Part 5QRS axis - quick determination using leads I and aVF
Part 6Systematic reading approach (PRISCE method)
Part 7All abnormalities simple to complex: sinus arrhythmias, AF/flutter, all 3 degrees of AV block, LBBB/RBBB, fascicular blocks, LVH/RVH, STEMI/NSTEMI evolution with lead localization, VT/VF, SVT/WPW, hyperkalemia, hypokalemia, calcium disorders, pericarditis, PE, hypothermia, drugs, Brugada, Long QT
Part 8Expert ECG read-through demonstrated step-by-step
Part 9Quick reference table of 20+ diagnoses
Part 10Expert mindset and study strategy
All diagrams are from authentic textbook sources (Goldman-Cecil, Harrison's, Medical Physiology, Miller's Anesthesia).

I want to understand ECG completely. So give me all basic and advance ecg knowledge with full detail it mbbs level, also explain with ecg paper with diagram then goes for abnormally and change in ecg patten with that abnormalities, then goes as for all condition from simpler to complex one with diagram. Use otentic source and explain such a why that i become the expert of ecg interpretation.

I want to understand ECG completely. So give me all basic and advance ecg knowledge with full detail it mbbs level, also explain with ecg paper with diagram then goes for abnormally and change in ecg patten with that abnormalities, then goes as for all condition from simpler to complex one with diagram. Use otentic source and explain such a why that i become the expert of ecg interpretation. Give diagram with each abnormally of ecg

Reading File
This is a Visual + Broad query. I'll run parallel searches and fetch all relevant ECG diagrams from the library simultaneously.
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Excellent - I found the key image URLs and content. Now let me fetch all critical ECG diagrams in parallel.
Loading Image
Loading Image
Loading Image
Reading File
Loading Image
Loading Image
Reading File
Loading Image
Loading Image
Reading File
Loading Image
Loading Image
Reading File
Loading Image
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
I now have all the content and images needed. Let me compile the complete, deeply detailed guide with every diagram.---

🫀 Complete ECG Mastery - MBBS Expert Guide

Sources: Harrison's 22E | Goldman-Cecil Medicine | Medical Physiology (Boron & Boulpaep) | Washington Manual | Costanzo Physiology | Gray's Anatomy for Students

PART 1 - THE FOUNDATION: WHY THE HEART MAKES ELECTRICITY

Before you can read an ECG, you must understand what you are actually recording.

1.1 The Cardiac Action Potential

Every cardiomyocyte is an electrically excitable cell. At rest, the inside is negative (-90 mV) relative to outside. When stimulated:
  • Phase 0: Fast Na⁺ channels open → rapid depolarization (upstroke)
  • Phase 1: Early rapid repolarization (K⁺ out)
  • Phase 2: Plateau (Ca²⁺ in balances K⁺ out) - this is the long cardiac plateau
  • Phase 3: Rapid repolarization (K⁺ channels open fully)
  • Phase 4: Resting potential (stable in working muscle; slowly drifts in pacemaker cells)
SA node and AV node cells are different: they have no phase 0 fast Na⁺ current - their upstroke is slow (via L-type Ca²⁺ channels). This is why AV nodal conduction is SLOW and why it can be blocked by Ca²⁺ channel blockers and adenosine.
The ECG records the sum of all these electrical events from the body surface.

1.2 The Cardiac Conduction System

(Gray's Anatomy for Students; Goldman-Cecil Medicine)
The conduction system initiates and coordinates contraction through four basic components:
StructureLocationIntrinsic RateFunction
SA NodeJunction of SVC and right atrium (top of crista terminalis)60-100 bpmPrimary pacemaker - fires first, sets heart rate
AV NodeNear coronary sinus opening, septal cusp of tricuspid valve40-60 bpmGatekeeper - introduces deliberate delay (0.08-0.12 sec) to let atria empty before ventricles contract
Bundle of HisLower border of membranous interventricular septum20-40 bpmContinues from AV node; carries impulse to bundle branches
Right Bundle BranchRight side of interventricular septum → septomarginal trabecula → anterior papillary muscle-Depolarizes right ventricle
Left Bundle BranchSplits into Left Anterior Fascicle (LAF) + Left Posterior Fascicle (LPF)-Depolarizes left ventricle
Purkinje FibersSubendocardial network throughout both ventricles20-40 bpmTerminal network - ensures rapid, near-simultaneous ventricular activation from apex upward
Critical concept: Depolarization travels endocardium → epicardium. But repolarization travels epicardium → endocardium (the opposite direction). This is why the T wave is normally upright - it is the OPPOSITE of what you would naively expect.
Blood supply to the conduction system:
  • SA node: RCA (55%) or LCx (45%)
  • AV node: RCA (90%)
  • Bundle of His: LAD (anterior descending)
  • Left anterior fascicle: LAD
  • Left posterior fascicle: dual supply (LAD + RCA) - most resistant to ischemic block

PART 2 - THE ECG PAPER: YOUR COORDINATE SYSTEM

Understand this section perfectly. Everything else depends on it.

2.1 The ECG Grid

ECG paper grid showing all waves, intervals, J-point, and grid measurements with 1 mm = 0.04 sec and 5 mm = 0.2 sec on horizontal axis, 1 mm = 0.1 mV on vertical axis
Goldman-Cecil Medicine Fig 42-2 - The standard ECG grid showing P, Q, R, S, T, U waves with all labeled intervals
ECG PAPER CALIBRATION (Standard Settings)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HORIZONTAL AXIS = TIME
  • 1 small box (1 mm)  = 0.04 second (40 ms)
  • 1 large box (5 mm)  = 0.20 second (200 ms)
  • Paper speed = 25 mm/second

VERTICAL AXIS = VOLTAGE (AMPLITUDE)
  • 1 small box (1 mm)  = 0.1 mV
  • 1 large box (5 mm)  = 0.5 mV
  • 2 large boxes (10mm) = 1 mV (standard calibration pulse)
Why this matters: When you see a deflection, the HEIGHT tells you voltage, and the WIDTH tells you duration.

2.2 Calculating Heart Rate

Method 1 - The 300 Rule (for regular rhythms): Count large boxes between two R waves, then divide 300 by that number.
R-R = 1 large box  → 300 bpm
R-R = 2 large boxes → 150 bpm
R-R = 3 large boxes → 100 bpm
R-R = 4 large boxes → 75 bpm
R-R = 5 large boxes → 60 bpm
R-R = 6 large boxes → 50 bpm
Method 2 - The 1500 Rule (for precise measurement): HR = 1500 ÷ (number of small boxes in R-R interval)
Method 3 - Irregular rhythms (AF, etc.): Count all QRS complexes in the 10-second strip × 6

2.3 The 12-Lead ECG Format

A standard ECG records 10 seconds total:
  • 4 rows of simultaneous leads
  • Each row = 2.5 seconds
  • Bottom rhythm strip = full 10 seconds (usually lead II)

PART 3 - THE ECG WAVES IN DETAIL

3.1 Genesis of QRS: Ventricular Depolarization

Ventricular depolarization in two phases - Phase 1 septal activation left to right (small r in V1, septal q in V6), Phase 2 LV dominance pointing leftward and posteriorly (big S in V1, tall R in V6)
Harrison's 22E Fig 247-6 - Ventricular depolarization shown as two sequential vectors explaining normal QRS patterns
Two-phase ventricular depolarization (Harrison's 22E):
Phase 1: Septum depolarizes LEFT → RIGHT (Vector 1 pointing right and anteriorly)
  • V1 sees this vector coming toward it → small positive deflection = septal r wave
  • V6 sees this vector going away from it → small negative deflection = septal q wave
Phase 2: Simultaneous LV + RV depolarization (LV dominates because its mass is greater → Vector 2 pointing LEFT and POSTERIORLY)
  • V1 sees vector going AWAY → large negative deflection = S wave
  • V6 sees vector coming TOWARD it → large positive deflection = R wave
Result: Normal V1 shows rS; normal V6 shows qR

3.2 Wave-by-Wave Reference

Wave/IntervalRepresentsNormal DurationNormal Amplitude
P waveAtrial depolarization (SA node → both atria)< 120 ms (< 3 small boxes)< 2.5 mm
PR intervalSA node → AV node → His bundle (includes AV nodal delay)120-200 ms (3-5 small boxes)-
QRS complexVentricular depolarization70-110 ms (< 3 small boxes)Variable by lead
ST segmentPlateau of ventricular action potential (no net current)IsoelectricAt baseline
T waveVentricular repolarization (epicardium to endocardium)-Upright in I, II, V3-V6; inverted in aVR
QT intervalTotal ventricular action potential (depolarization + repolarization)Rate-dependent; use QTc-
QTc (Bazett)Corrected QT = QT ÷ √(RR in seconds)≤ 450 ms (men), ≤ 460 ms (women)-
U waveSlow repolarization of Purkinje fibers or M cells-< T wave; same direction
QRS wave nomenclature (Medical Physiology, Boron & Boulpaep):
  • Q = first negative deflection before any R
  • R = any positive deflection
  • S = negative deflection after R
  • R' = second positive deflection
  • Capital letters = large amplitude (> 5 mm); lowercase = small amplitude
  • So: rS = small r + big S; qR = small q + big R; QS = entirely negative with no R at all

PART 4 - THE 12 LEADS: 12 CAMERAS AROUND THE HEART

4.1 Lead Placement

Precordial lead positions on the chest - V1 through V6 plus right-sided leads V3R and V4R
Harrison's 22E Fig 247-5 - Chest electrode placement for precordial leads including right-sided leads
Frontal plane limb leads (A) and horizontal plane precordial leads (B) showing how they view the heart in 3D
Harrison's 22E Fig 247-3 - Three-dimensional representation of how 12 leads view the heart
Precordial Lead Positions:
LeadPositionViews
V14th ICS, right sternal borderRV, interventricular septum
V24th ICS, left sternal borderSeptum, anterior LV
V3Between V2 and V4Anterior wall
V45th ICS, midclavicular lineAnterior-apical LV
V5Anterior axillary line (same level)Lateral LV
V6Midaxillary line (same level)Lateral LV
Limb Lead Positions (Einthoven's Triangle):
  • Lead I = Left arm (+) vs Right arm (-) → 0°
  • Lead II = Left foot (+) vs Right arm (-) → +60°
  • Lead III = Left foot (+) vs Left arm (-) → +120°
  • aVR = Right arm → -150° (always mostly negative in normal hearts)
  • aVL = Left arm → -30°
  • aVF = Left foot → +90°

4.2 QRS Axis - The Hexaxial Reference System

Hexaxial reference system showing normal axis (yellow), left axis deviation (green), right axis deviation (pink), and extreme axis (blue) zones
Harrison's 22E Fig 247-4 - The frontal plane hexaxial diagram showing all 6 limb lead orientations and axis zones
Quick Axis Determination (use leads I and aVF):
Lead IaVFAxisZone
Positive (+)Positive (+)0° to +90°NORMAL
Positive (+)Negative (-)-1° to -90°LEFT AXIS DEVIATION (LAD)
Negative (-)Positive (+)+91° to +180°RIGHT AXIS DEVIATION (RAD)
Negative (-)Negative (-)±180° to -90°EXTREME AXIS (no man's land)
Normal axis range: -30° to +90° LAD causes: LAFB, inferior MI, LVH, LBBB, WPW RAD causes: RVH, LPFB, lateral MI, PE, RBBB, normal variant in young/tall people Extreme axis: VT, severe hyperkalemia, artificial pacemaker

4.3 The Normal 12-Lead ECG

Normal 12-lead ECG from a healthy male at 75 bpm - PR 160ms, QRS 80ms, QTc 390ms, axis +70°
Harrison's 22E Fig 247-7 - Normal 12-lead ECG: sinus rhythm 75 bpm, PR 160 ms, QRS 80 ms, QTc 390 ms, axis +70°
Features of a normal ECG to confirm:
  1. P wave positive in I, II, aVF; negative in aVR; biphasic in V1
  2. PR 120-200 ms
  3. QRS < 120 ms, narrow
  4. Normal R-wave progression: r grows V1→V5, transition at V3-V4
  5. Small septal q waves in V5, V6 (narrow, < 40 ms, < 25% R height) - NORMAL
  6. ST segment isoelectric
  7. T waves upright in I, II, V3-V6; inverted in aVR
  8. QTc within normal limits

PART 5 - SYSTEMATIC APPROACH TO EVERY ECG

Use this every single time. Never skip steps.
The Harrison's 22E 14-parameter systematic analysis:
  1. Calibration and technical quality (is it 25 mm/sec? 10 mm/mV? Lead placement correct?)
  2. Rhythm (regular? irregular? what is the P wave doing?)
  3. Heart rate
  4. PR interval / AV conduction
  5. QRS duration
  6. QT / QTc
  7. Mean QRS electrical axis
  8. P wave morphology and axis
  9. QRS voltages
  10. R-wave progression in precordial leads
  11. Abnormal Q waves
  12. ST segments (elevation? depression? in which leads?)
  13. T waves
  14. U waves
"Comparison with any previous ECGs is invaluable." - Harrison's 22E

PART 6 - ECG ABNORMALITIES: SIMPLE TO COMPLEX, EACH WITH DIAGRAM


6.1 SINUS RHYTHMS

Normal Sinus Rhythm (NSR)
  • Rate 60-100 bpm
  • P before every QRS, every QRS after a P
  • PR 120-200 ms, QRS < 120 ms
  • P upright in I, II, aVF; negative in aVR
ASCII ECG - Normal Sinus Rhythm:
   P         P         P
  /\        /\        /\
 /  \  R   /  \  R   /  \  R
|    \/|\ |    \/|\ |    \/|\
|   Q S T |   Q S T |   Q S T
-----|----+----|----|----|----|---
    PR        PR        PR
   interval
Regular R-R intervals, identical beats
Sinus Bradycardia
  • Rate < 60 bpm (but otherwise everything is NORMAL)
  • Causes: High vagal tone, athletes, beta-blockers, hypothyroidism, inferior MI, sick sinus syndrome
  • All intervals normal, just slow rate
Sinus Tachycardia
  • Rate > 100 bpm (but otherwise everything NORMAL)
  • Causes: Pain, fever, anxiety, hypovolemia, anemia, PE, thyrotoxicosis, sepsis
  • Key rule: Sinus tachycardia is a symptom, not a diagnosis - always find the cause
Sinus Arrhythmia
  • Rate varies with breathing (increases on inspiration, decreases on expiration)
  • All morphologies normal, just R-R varying > 10%
  • Normal finding (especially children/young adults)

6.2 ATRIAL ABNORMALITIES: P WAVE CHANGES

P wave changes in normal, right atrial overload (peaked tall), and left atrial abnormality (broad notched) in leads II and V1
Harrison's 22E Fig 247-8 - P wave patterns: Normal vs Right atrial overload ("P-pulmonale") vs Left atrial abnormality ("P-mitrale")
Right Atrial Overload (P-pulmonale):
  • Tall, peaked, narrow P waves ≥ 2.5 mm in leads II, III, aVF
  • In V1: Large initial positive component
  • Causes: COPD, pulmonary hypertension, PE, tricuspid stenosis, pulmonary stenosis
Left Atrial Abnormality (P-mitrale):
  • Broad, notched "M-shaped" P wave ≥ 120 ms in lead II
  • In V1: Biphasic P with prominent DEEP negative terminal component (> 1 mm deep AND > 1 mm wide)
  • Causes: Mitral stenosis, LV failure, hypertension, aortic stenosis

6.3 CHAMBER HYPERTROPHY

LVH vs RVH compared to normal - showing QRS vector differences, voltage changes in V1 and V6, and ST-T changes
Harrison's 22E Fig 247-9 - Ventricular hypertrophy patterns: LVH (tall R in V6, deep S in V1, lateral strain) vs RVH (tall R in V1, right axis deviation)
Left Ventricular Hypertrophy (LVH):
  • Voltage criteria (all suffer from low sensitivity ~30-50%):
    • Sokolow-Lyon: S in V1 + R in V5 or V6 > 35 mm
    • Cornell: R in aVL + S in V3 > 28 mm (men) or > 20 mm (women)
    • R in aVL alone > 11 mm (simple, reliable)
  • LV "strain" pattern: ST depression + asymmetric T-wave inversion in lateral leads (I, aVL, V5-V6) - indicates severe LVH
  • Left axis deviation common
  • Left atrial abnormality often accompanies
  • Causes: Hypertension (#1), aortic stenosis, HCM, aortic regurgitation
Right Ventricular Hypertrophy (RVH):
  • Tall R wave in V1 (R ≥ S in V1) - hallmark
  • Right axis deviation (> +90°)
  • ST depression + T-wave inversion in V1-V3 ("RV strain")
  • Deep S waves in I, V5, V6
  • Causes: Pulmonary hypertension, pulmonary stenosis, COPD, ASD, tetralogy of Fallot

6.4 AV CONDUCTION BLOCKS (HEART BLOCKS)

(Washington Manual; Harrison's 22E)
ASCII - Normal P-QRS Relationship:
P—QRS—T   P—QRS—T   P—QRS—T
Each P followed by QRS, PR constant and normal (120-200 ms)
First-Degree AV Block
ECG features:
  • PR interval > 200 ms (> 5 small boxes)
  • Every P is followed by a QRS (nothing dropped)
  • PR is prolonged but CONSTANT
ASCII - 1st Degree AV Block:
P——————QRS—T   P——————QRS—T   P——————QRS—T
   LONG PR         LONG PR         LONG PR
   (>200ms)
Causes: AV nodal disease, inferior MI, digoxin, beta-blockers, high vagal tone, myocarditis Clinical significance: Usually benign, no treatment needed

Second-Degree AV Block - Mobitz Type I (Wenckebach)
ECG features:
  • Progressive lengthening of PR with each beat
  • Until one P wave fails to conduct (QRS DROPPED)
  • After dropped beat, cycle resets (shortest PR)
  • Grouped beating pattern (characteristic)
  • RR intervals progressively SHORTEN before the pause
ASCII - Mobitz I (Wenckebach) 4:3 pattern:
P  Q  P   QRS  P    QRS P         P  Q  P   QRS
   PR→ PR longer→ PR longest → DROP!  PR shortest → PR longer...
Location: AV node (proximal) Causes: Inferior MI (RCA supplies AV node), high vagal tone, myocarditis, digoxin Clinical: Generally benign; does not usually require pacemaker unless symptomatic

Second-Degree AV Block - Mobitz Type II
ECG features:
  • PR interval is CONSTANT (does not prolong)
  • Sudden, unexpected non-conducted P wave (QRS dropped without warning)
  • Often: Wide QRS complex (block is infranodal)
  • May have 2:1, 3:1, 4:1 ratio
ASCII - Mobitz II (2:1 pattern):
P—QRS—T   P         P—QRS—T   P
 Normal PR  No QRS!   Normal PR  No QRS!
              ↑ dropped              ↑ dropped
Location: His bundle or bundle branches (infranodal) Clinical: DANGEROUS - high risk of progression to complete block; pacemaker needed

Third-Degree (Complete) AV Block
ECG features:
  • Complete AV dissociation - P waves and QRS complexes are INDEPENDENT
  • P waves: Regular at sinus rate (60-80 bpm)
  • QRS complexes: Regular at escape rate (SLOWER than P rate)
  • No relationship between P waves and QRS complexes
  • Escape QRS morphology:
    • Narrow QRS (junctional escape, 40-60 bpm) = block in AV node or proximal His
    • Wide QRS (ventricular escape, 20-40 bpm) = block in bundle branches
ASCII - Complete Heart Block:
P  P  P  P  P  P  P  P  P   (regular, faster - sinus P waves)
      QRS         QRS         (regular, slower - escape rhythm)
      ↑ No fixed relationship between P and QRS
Causes: Inferior MI (often reversible), anterior MI (usually permanent), Lenegre's disease, sarcoidosis, endocarditis Clinical: Emergency - can cause syncope (Stokes-Adams attack), requires urgent pacemaker

The AV Block Comparison:
(Washington Manual Fig 7-5 content - Five types side by side)
A) 1st degree: P——————QRS every beat, long PR
B) 2nd degree Mobitz I: PR lengthens → drop → resets
C) 2nd degree Mobitz II: Fixed PR → sudden drop
D) 2:1 block: P-QRS-P (no QRS)-P-QRS...
E) Complete block: P P P independent from QRS QRS QRS

6.5 BUNDLE BRANCH BLOCKS

The Golden Rule of Bundle Branch Blocks:
T wave polarity is opposite to the last deflection of QRS (discordant T waves). This is a SECONDARY repolarization change - it is normal for BBB, NOT a sign of ischemia.
RBBB vs LBBB vs Normal compared in V1 and V6 - RBBB shows rSR' (rabbit ears) in V1 and qRS in V6; LBBB shows broad monophasic R in V6 and QS in V1
Harrison's 22E Fig 247-10 - RBBB and LBBB compared to normal in V1 and V6, with secondary T-wave inversions (arrows)

Right Bundle Branch Block (RBBB)
ECG Features:
  • QRS ≥ 120 ms (wide)
  • rSR' in V1 ("rabbit ears" / "M" shape) - hallmark
  • Wide, deep, slurred S wave in I, aVL, V5-V6
  • T-wave INVERSION in V1-V2 (secondary change - NORMAL for RBBB, not ischemia)
  • QRS axis usually normal or mildly right-deviated
ASCII - RBBB:
V1:          V6:
  R'           R
 / \          /|
r   \    q   / |
     S       |  S
  rSR' = M  qRS with wide S
Mechanism: Right bundle blocked → LV depolarizes first (normal), then RV depolarizes LATE via slow cell-to-cell conduction (muscle to muscle) → creates the late R' in V1 and late S in V6.
Causes: Congenital, right heart strain (PE, cor pulmonale), RVH, RBBB is often idiopathic and benign. Also seen in ASD.
Clinical note: New RBBB with right heart strain pattern (right axis + RVH features) in a patient with sudden dyspnea → think pulmonary embolism!

Left Bundle Branch Block (LBBB)
ECG Features:
  • QRS ≥ 120 ms (wide)
  • Broad, tall, monophasic R wave in I, aVL, V5-V6 (no septal q - they disappear!)
  • rS or QS pattern in V1 (deep broad S or entirely negative QS)
  • T-wave INVERSION in I, aVL, V5-V6 (secondary - normal for LBBB)
  • Left axis deviation common
ASCII - LBBB:
V1:          V6:
|            R
|           /|\
|          / | \
QS        /  |  T↓
(deep neg)  broad M shape or tall R
Mechanism: Left bundle blocked → septum depolarizes right-to-left (REVERSED - this is why septal q waves disappear!). LV depolarizes slowly via muscle-to-muscle conduction.
Causes: Hypertensive heart disease (#1), ischemia, aortic stenosis, dilated cardiomyopathy
⚠️ Critical LBBB rule: New LBBB in a patient with chest pain = treat as STEMI equivalent until proven otherwise. The normal LBBB ST-T changes can mask an acute MI - use Sgarbossa criteria (concordant ST elevation ≥ 1 mm in leads with predominantly positive QRS; concordant ST depression ≥ 1 mm in V1-V3; discordant ST elevation ≥ 5 mm) to detect MI within LBBB.

Left Anterior Fascicular Block (LAFB)
ECG Features:
  • Left axis deviation (more negative than -45°) - key finding
  • qR pattern in leads I and aVL
  • rS pattern in leads II, III, aVF
  • QRS slightly prolonged (< 120 ms)
  • Most common cause of marked LAD in adults
Causes: Ischemia (LAD territory), HCM, fibrosis, cardiomyopathy
Left Posterior Fascicular Block (LPFB)
ECG Features:
  • Right axis deviation (> +110°) - diagnosis of exclusion (must rule out RVH, PE)
  • rS in I and aVL; qR in II, III, aVF
  • Rare as isolated finding

6.6 MYOCARDIAL ISCHEMIA AND INFARCTION

The Mechanism of ST Changes

Current of injury diagram: A = subendocardial ischemia causing ST depression in overlying leads; B = transmural ischemia causing ST elevation toward epicardium
Harrison's 22E Fig 247-11 - Current of injury in ischemia: subendocardial → ST depression; transmural/epicardial → ST elevation
From Harrison's 22E (Goldberger): "Severe, acute ischemia lowers the resting membrane potential and shortens the duration of the action potential. Such changes cause a voltage gradient between normal and ischemic zones. As a consequence, current flows between those regions. These currents of injury are represented on the surface ECG by deviation of the ST segment."
  • Transmural (epicardial) ischemia: ST vector points outward (toward ischemic epicardium) → ST elevation in overlying leads + reciprocal ST depression in opposite leads
  • Subendocardial ischemia: ST vector points inward (toward cavity) → ST depression in overlying leads + ST elevation in aVR

Evolution of STEMI

ECG sequence with anterior STEMI showing acute (hyperacute T → ST elevation) and evolving (T inversion → Q waves) changes in all 12 leads
Harrison's 22E Fig 247-13A - Anterior STEMI ECG sequence: acute and evolving changes
ECG sequence with inferior STEMI showing ST elevation in II, III, aVF with reciprocal changes in I, aVL and anterior leads
Harrison's 22E Fig 247-13B - Inferior STEMI ECG sequence: ST elevation in II, III, aVF with reciprocal anterior depression
Sequential ECG Changes in STEMI:
TimeECG ChangeWhat It Means
MinutesHyperacute T waves - tall, broad, peakedEarly ischemia; K⁺ leaks out of ischemic cells
Minutes-HoursST elevation (convex upward "tombstone")Transmural injury current
HoursQ waves developElectrically silent dead muscle (no depolarization)
Hours-DaysT-wave inversionsRepolarization abnormality in ischemic zone
Days-WeeksST normalizes; Q waves + T inversions persistEvolving infarct
Weeks-MonthsQ waves may persist permanentlyScar tissue

Localization of Infarction

MI TerritoryST Elevation InCulprit Artery
AnteriorV1-V4LAD (left anterior descending)
SeptalV1-V2LAD septal branches
LateralI, aVL, V5-V6LCx (left circumflex) or diagonal
AnterolateralV1-V6, I, aVLProximal LAD
InferiorII, III, aVF (+ reciprocal depression in I, aVL)RCA (80%) or LCx (20%)
PosteriorTall R + ST depression in V1-V3 (mirror image)RCA or LCx
Right VentricleV3R, V4R elevation (check when inferior MI)Proximal RCA
Reciprocal changes are diagnostic: ST elevation in inferior leads (II, III, aVF) is almost always accompanied by ST depression in I and aVL (reciprocal). This reciprocal pattern confirms the diagnosis and distinguishes from pericarditis (which has no reciprocal changes).

Wellens Syndrome (Warning Lesion)

From Harrison's 22E: "Patients with ischemic chest pain who present with deep T-wave inversions in multiple precordial leads (V1-V4, sometimes I and aVL) with or without cardiac enzyme elevations typically have severe obstruction in the left anterior descending coronary artery."
Deep T-wave inversions in V1-V6 representing severe LAD stenosis - Wellens T-wave sign
Harrison's 22E Fig 247-12 - Severe anterior wall ischemia (Wellens pattern): prominent T-wave inversions V1-V6 indicating critical LAD stenosis

Pathological Q Waves

  • Width ≥ 0.04 sec (1 small box) AND/OR
  • Depth ≥ 25% of the R wave height
Q waves represent electrically DEAD myocardium - cells that cannot depolarize.
Normal Q waves (do not misinterpret):
  • Small narrow septal q in V5, V6 (normal septal depolarization)
  • Q in III alone (positional, disappears on deep inspiration)
  • Q in aVR (normal)

6.7 ATRIAL ARRHYTHMIAS

Atrial Premature Contractions (APCs / PACs)
  • Early P wave with DIFFERENT morphology than sinus P
  • Usually followed by normal QRS
  • Compensatory pause (usually incomplete)
  • Cause: Caffeine, stress, electrolyte disturbance, heart disease
Atrial Flutter
  • Atrial rate: 250-350 bpm (classically exactly 300 bpm)
  • Sawtooth flutter waves (F waves) - best seen in II, III, aVF and V1
  • Ventricular rate = atrial rate ÷ conduction ratio (2:1, 3:1, 4:1)
  • Classic: 2:1 flutter → ventricular rate exactly 150 bpm
  • Tip: Any narrow-complex tachycardia at exactly 150 bpm = atrial flutter with 2:1 block until proven otherwise
ASCII - Atrial Flutter (2:1 block):
F  F  F  F  F  F  F  F  F  F
/\/\/\QRS/\/\/\QRS/\/\/\QRS
  ↑sawtooth at 300 bpm  ↑QRS at 150 bpm
Atrial Fibrillation (AF)
  • Most common sustained cardiac arrhythmia
  • ECG features:
    1. No distinct P waves - replaced by chaotic fibrillatory baseline (fine or coarse, "bag of worms")
    2. Irregularly irregular RR intervals - the absolute hallmark (no pattern to irregularity)
    3. Narrow QRS (usually, unless aberrant conduction or accessory pathway)
  • Atrial rate: 350-600 bpm (so chaotic no coordinated P waves form)
  • Ventricular rate: Typically 100-170 bpm if uncontrolled
ASCII - Atrial Fibrillation:
~~~~~QRS~~~~~QRS~~~~~~~~QRS~~~~QRS~~~~~QRS
  ↑chaotic     ↑shorter    ↑longer   ↑shorter
  baseline     RR          RR         RR
  no P waves         IRREGULAR irregular intervals

6.8 VENTRICULAR ARRHYTHMIAS

Premature Ventricular Contractions (PVCs)
  • Wide QRS (≥ 120 ms) with bizarre, abnormal morphology
  • No preceding P wave (not initiated by SA node)
  • T wave is DISCORDANT (opposite direction to main QRS deflection)
  • Full compensatory pause (the sinus node is not reset; P-P interval marches through unchanged)
  • Unifocal = all PVCs look identical; Multifocal = different shapes = more ominous
  • Bigeminy = every other beat is a PVC; Trigeminy = every third beat is a PVC
Ventricular Tachycardia (VT)
  • Wide QRS tachycardia ≥ 120 ms, rate > 100 bpm (usually 140-220 bpm)
  • AV dissociation = independent P waves NOT related to QRS = pathognomonic for VT
  • Fusion beats = hybrid morphology between sinus and VT = confirms AV dissociation
  • Capture beats = a normal narrow QRS amidst wide complexes = confirms AV dissociation
The most important rule in ECG: Any wide-complex tachycardia = VT until proven otherwise. Do NOT diagnose SVT with aberrancy just because the patient is young or hemodynamically stable. VT can occur in hemodynamically stable patients. Treating VT as SVT (giving verapamil) can cause cardiovascular collapse.
Ventricular Fibrillation (VF)
  • Completely disorganized, irregular, chaotic undulations
  • No recognizable QRS, P, T, or ST segments
  • Cardiac arrest - immediate defibrillation
Torsades de Pointes (TdP)
  • Polymorphic VT: QRS complexes appear to "twist" around the isoelectric line
  • Rate: 150-250 bpm
  • Occurs in setting of PROLONGED QT interval
  • ECG: Oscillating amplitude - complexes spin around baseline in a characteristic sinusoidal pattern
  • Causes: Drug-induced QT prolongation (quinidine, sotalol, dofetilide, haloperidol, erythromycin), hypokalemia, hypomagnesemia, hereditary Long QT syndrome
  • Treatment: IV magnesium sulfate (even if Mg²⁺ level is normal), correct K⁺, remove offending drug

6.9 SUPRAVENTRICULAR TACHYCARDIA (SVT)

SVT = any tachycardia arising above the bundle of His → narrow QRS (unless aberrant conduction).
AVNRT (AV Nodal Reentrant Tachycardia) - Most Common SVT
  • Mechanism: Reentrant circuit within the AV node (fast and slow pathways)
  • Rate: 150-250 bpm
  • P waves buried within or just at the END of QRS (retrograde P)
  • Classic: Pseudo-S wave in inferior leads (retrograde P just after QRS)
  • Classic: Pseudo-R' in V1 (retrograde P just after QRS)
  • Regular rhythm
  • Abrupt onset and termination
AVRT (AV Reentrant Tachycardia) - Wolff-Parkinson-White
Resting ECG features (WPW triad):
  1. Short PR < 120 ms (impulse bypasses AV node via accessory pathway)
  2. Delta wave (slurred upstroke of QRS - due to ventricular pre-excitation)
  3. Wide QRS (> 120 ms) - due to fusion of normal + accessory pathway depolarization
From Washington Manual: "Most common SVT in patients with Wolff-Parkinson-White syndrome who have preexcitation defined by short PR and a delta wave on upstroke of QRS."
Types of WPW tachycardia:
  • Orthodromic AVRT (95%): Down AV node (normal), up accessory pathway → narrow QRS tachycardia with retrograde P after QRS
  • Antidromic AVRT (5%): Down accessory pathway, up AV node → wide bizarre QRS tachycardia (looks like VT)
⚠️ WPW + AF = life-threatening emergency: In AF with WPW, impulses bypass the AV node via accessory pathway (no rate protection) → extremely fast ventricular rates (>300 bpm) → can degenerate to VF. DO NOT give digoxin, verapamil, or adenosine (they block AV node but enhance accessory pathway conduction). Use procainamide or DC cardioversion.

6.10 VENTRICULAR HYPERTROPHY AND SPECIFIC PATTERNS

Both LVH and RVH are covered in Part 6.3 above with diagrams. Key additional points:
LVH Strain Pattern: The ST depression + asymmetric T-wave inversion in lateral leads is NOT ischemia - it is a repolarization abnormality from the hypertrophied muscle. However, LVH is a strong risk factor for actual ischemia, so correlation with symptoms and troponin is always needed.

6.11 PERICARDITIS

ECG features that distinguish pericarditis from STEMI:
FeatureAcute PericarditisSTEMI
ST elevation shapeSaddle-shaped (concave up)Convex upward (tombstone)
DistributionDiffuse (almost ALL leads except aVR, V1)Regional/territorial
Reciprocal ST depressionNone (except aVR/V1)Present in opposite leads
PR depressionYES - pathognomonicNo
Q wavesNoYes (evolve later)
aVR changesST depression + PR elevationST elevation in aVR = subendocardial ischemia
Four stages of pericarditis ECG evolution:
  1. Stage 1 (days): Diffuse concave ST elevation + PR depression
  2. Stage 2 (week 1): ST normalizes, T waves flatten
  3. Stage 3 (weeks): Diffuse T-wave inversions
  4. Stage 4 (months): Normalization (or T inversions may persist if constrictive)

6.12 ELECTROLYTE DISTURBANCES

Hyperkalemia - The Classic Sequence

Hyperkalemia ECG sequence from mild-moderate (peaked T) to moderate-severe (QRS widening, P disappearance) to very severe (sine wave pattern)
Harrison's 22E Fig 247-14 - Progressive ECG changes with hyperkalemia: peaked T → QRS widening → P disappears → sine wave → asystole
From Harrison's 22E: "The earliest ECG change with hyperkalemia is usually peaking (tenting) of the T waves. With further increases in the serum potassium concentration, the QRS complexes widen, the P waves decrease in amplitude and may disappear, and finally a sine-wave pattern leads to asystole."
Serum K⁺ECG Change
5.5-6.5 mEq/LTall, narrow, symmetric (tent-shaped) T waves - earliest sign
6.5-7.5PR prolongation, P wave flattening
7.0-7.5P waves disappear, QRS begins to widen
7.5-8.0Wide bizarre QRS, ST changes
> 8.0Sine wave pattern → VF → asystole
Emergency treatment: IV calcium gluconate (stabilizes membrane immediately), then insulin + dextrose, sodium bicarbonate, Kayexalate, dialysis

Hypokalemia

Hypokalemia showing flat T wave with prominent U wave in leads II and V3
Harrison's 22E Fig 247-15 - Hypokalemia: flat T wave + prominent U wave
  • Flat or inverted T waves
  • Prominent U waves (U > T wave amplitude, especially V2-V3) - hallmark
  • Apparent QT prolongation (actually QU prolongation)
  • ST depression
  • Predisposes to: Torsades de pointes, VT, VF (especially in setting of digoxin)

Hypothermia - Osborn (J) Wave

Osborn wave (J wave) in hypothermia - convex hump at J point in V5
Harrison's 22E Fig 247-15 - Hypothermia: Osborn (J) wave - the convex hump at the J point (arrow)
  • Osborn (J) wave: Positive deflection immediately after QRS at the J-point - hallmark of hypothermia
  • Sinus bradycardia
  • All intervals prolonged (PR, QRS, QT)
  • J waves largest in leads facing LV (V4-V6) and inferior leads
  • Size of J wave correlates with degree of hypothermia (bigger J = colder patient)
  • Also seen in: Hypercalcemia, Brugada syndrome, early repolarization

Calcium Disorders

Hypocalcemia showing prolonged QT (ST lengthening) vs hypercalcemia showing shortened QT
Harrison's 22E Fig 247-16 - Hypocalcemia (prolonged QT/ST) vs Hypercalcemia (short QT)
  • Hypocalcemia: Prolonged QT (the ST segment is specifically elongated; T wave shape itself is normal)
  • Hypercalcemia: Shortened QT (abbreviated ST segment) - short QTc < 360 ms

6.13 DRUG EFFECTS ON ECG

DrugECG EffectMechanism
Digoxin"Scooping" ST-T (reverse-tick sign); short QT; PR prolongation; can cause virtually any arrhythmia in toxicityInhibits Na/K ATPase; increases vagal tone
Class IA (quinidine, procainamide)QT prolongation; QRS widening; torsades de pointesBlock Na⁺ channels (wide QRS) + K⁺ channels (long QT)
Class IC (flecainide, propafenone)QRS widening; PR prolongation; Brugada-like patternPotent Na⁺ channel block
Class III (amiodarone, sotalol)QT prolongation; T-wave widening; bradycardiaK⁺ channel block
Tricyclic antidepressantsQRS widening; QT prolongation; right axis deviation; tall R in aVRNa⁺ + K⁺ channel block
Tricyclic antidepressant overdose - wide QRS, prolonged QT in V1 and V2
Harrison's 22E Fig 247-15 - Tricyclic antidepressant overdose: wide QRS + prolonged QT in V1-V2

6.14 PERICARDIAL EFFUSION / CARDIAC TAMPONADE

Cardiac tamponade ECG: sinus tachycardia + low voltage + electrical alternans in multiple leads
Harrison's 22E Fig 247-17 - Cardiac tamponade: sinus tachycardia + low QRS voltage + electrical alternans (arrows)
Classic triad of cardiac tamponade on ECG:
  1. Sinus tachycardia (compensatory to maintain output)
  2. Low QRS voltage (< 5 mm in all limb leads; < 10 mm in all precordial leads) - fluid dampens signal
  3. Electrical alternans (beat-to-beat alternation in QRS height/axis as heart swings inside effusion) - highly specific for tamponade

6.15 PULMONARY EMBOLISM

Most common: Sinus tachycardia (nonspecific but most frequent)
S1Q3T3 pattern (specific but insensitive, seen in ~20%):
  • S wave in lead I (RV dilation shifts axis right)
  • Q wave in lead III
  • T-wave inversion in lead III
Other findings:
  • New RBBB (acute right ventricular pressure overload)
  • Right axis deviation
  • T-wave inversions V1-V4 (RV strain pattern)
  • New AF or atrial flutter
  • P-pulmonale (right atrial overload)
S1Q3T3 Pattern (think of it as right heart being overloaded):
Lead I:  broad S wave (normally no S in I)
Lead III: Q wave + T-wave inversion

6.16 BRUGADA SYNDROME

  • Type 1 (diagnostic): ≥ 2 mm coved-type (convex upward dome then descending to inverted T) ST elevation in V1-V2 with RBBB morphology
  • Autosomal dominant SCN5A mutation (cardiac sodium channel)
  • Causes ventricular fibrillation, sudden cardiac death, often during sleep or fever
  • Unmasked by: Fever, Na⁺ channel blockers (flecainide - used in provocative test), cocaine
  • Type 2 (saddle-back pattern): Not diagnostic without provocative testing

6.17 LONG QT SYNDROME

  • QTc ≥ 450 ms (men), ≥ 460 ms (women)
  • Risk: Torsades de pointes → VF → sudden death
SubtypeT-wave MorphologyTrigger
LQT1Broad-based, wide T waveExercise/swimming
LQT2Bifid (notched) T waveEmotional stress, sudden loud sounds
LQT3Late-onset narrow peaked TSleep/rest
Acquired causes: Quinidine, sotalol, dofetilide, amiodarone, erythromycin, haloperidol, hypokalemia, hypomagnesemia, hypocalcemia

PART 7 - SUBARACHNOID HEMORRHAGE AND NEUROLOGICAL ECG CHANGES

Subarachnoid hemorrhage ECG: deeply inverted T waves in III and V3 - "CVA T waves"
Harrison's 22E Fig 247-15 - Subarachnoid hemorrhage: deeply inverted, wide T waves ("CVA T waves") - can mimic anterior ischemia
Intracranial bleeding, especially subarachnoid hemorrhage, can cause:
  • Deep, wide, symmetric T-wave inversions in multiple leads ("giant T-wave inversions")
  • Prolonged QT interval
  • ST changes
  • Sinus bradycardia or tachycardia
This is mediated by catecholamine surge and autonomic nervous system activation. Can mimic acute MI.

PART 8 - MASTER QUICK REFERENCE TABLE

FindingKey ECG FeaturesPrimary Diagnosis
Short PR + delta wave + wide QRSPre-excitation triadWPW syndrome
PR > 200 ms, every P→QRSProlonged PR, nothing dropped1st degree AV block
Lengthening PR → dropped QRSGrouped beating, Wenckebach2nd degree Mobitz I
Constant PR → sudden dropped QRSFixed PR, abrupt non-conducted P2nd degree Mobitz II
P and QRS completely independentAV dissociation, P faster3rd degree (complete) heart block
rSR' in V1, wide S in I/V6M-shaped V1, QRS ≥ 120 msRBBB
Broad R in V5-V6, QS in V1No septal q, QRS ≥ 120 msLBBB
Left axis < -45°, qR in I/aVLSmall q in I, aVL; rS in II,III,aVFLAFB
Tall R in V1, right axis deviationR ≥ S in V1, axis > +90°RVH
S in V1 + R in V5 > 35 mmHigh voltages, lateral strainLVH
Tall peaked P ≥ 2.5 mmP-pulmonale patternRight atrial overload
Broad notched P ≥ 120 msP-mitrale, biphasic V1Left atrial abnormality
Diffuse saddle ST elevation + PR depressionAlmost all leads, concave STAcute pericarditis
Regional convex ST elevation + reciprocalTerritorial leads, tombstoneSTEMI
Q waves ≥ 40 ms wide in territoryNecrotic silent myocardiumOld MI / evolving MI
Deep T inversions V1-V4 + no chest painWellens signCritical LAD stenosis
Peaked narrow symmetric T wavesEarliest hyperkalemia signHyperkalemia
Wide QRS + P wave disappears + sine waveProgressive QRS wideningSevere hyperkalemia
Flat T + prominent U waveU > T wave, QU prolongedHypokalemia
Short QTAbbreviated ST segmentHypercalcemia
Long QT, prolonged STST segment stretchedHypocalcemia / drug QT
J (Osborn) waves at J-pointConvex hump after QRSHypothermia
Irregularly irregular, no P wavesFibrillatory baselineAtrial fibrillation
Sawtooth F waves at 300 bpmRegular flutter wavesAtrial flutter
Wide bizarre QRS tachycardiaAV dissociation, fusion beatsVentricular tachycardia
Twisting QRS around baselinePolymorphic VT, long QT backgroundTorsades de pointes
Tachycardia + low voltage + alternansAlternating QRS heightCardiac tamponade
S1Q3T3 + sinus tachycardiaRight heart strain patternPulmonary embolism
Coved ST elevation V1-V2 + RBBB≥ 2 mm coved patternBrugada syndrome
Wide QRS + right axis + tall R in aVRQRS > 120 ms, QT longTCA toxicity
Scooping ST-T + short QT"Reverse tick" patternDigoxin effect

PART 9 - HOW TO BECOME AN EXPERT: THE MINDSET

From Harrison's 22E: "Accurate analysis of ECGs requires thoroughness and care. The patient's age, biologic sex, and clinical status should always be considered. Many mistakes in ECG interpretation are errors of omission. Therefore, a systematic approach is essential."
The 14 parameters Harrison's recommends checking on every ECG:
  1. Standardization and technical quality
  2. Rhythm
  3. Heart rate
  4. PR interval / AV conduction
  5. QRS interval
  6. QT / QTc
  7. Mean QRS electrical axis
  8. P waves
  9. QRS voltages
  10. R-wave progression (precordial)
  11. Abnormal Q waves
  12. ST segments
  13. T waves
  14. U waves
The Five Life-Threatening ECG Diagnoses You Must Never Miss:
  1. STEMI (regional ST elevation → call the cath lab)
  2. VF (chaotic → immediate defibrillation)
  3. VT (wide complex tachycardia → synchronized cardioversion or amiodarone)
  4. Complete heart block (AV dissociation → temporary pacing)
  5. Severe hyperkalemia (sine wave or peaked T + wide QRS → IV calcium immediately)
Practical study advice:
  • Read 10 ECGs daily using the systematic approach
  • Always check old ECGs for comparison - changes over time are more important than single readings
  • Use LITFL ECG Library and ECG Wave-Maven (Harvard) for practice with hundreds of annotated ECGs

Primary References:
  • Harrison's Principles of Internal Medicine 22E (2025) - Chapter 247: Electrocardiography (Goldberger)
  • Goldman-Cecil Medicine 26E - Chapter 42: Electrocardiography
  • Washington Manual of Medical Therapeutics - Cardiology chapter
  • Medical Physiology (Boron & Boulpaep) - Chapter 21
  • Costanzo Physiology 7th Ed - Chapter 4
  • Gray's Anatomy for Students - Cardiac Conduction SystemThis is the complete, expert-level ECG guide built from the most authoritative medical textbooks. Here is a summary of every section and what diagram is embedded within it:

What This Guide Contains

SectionContentDiagrams Included
Part 1Cardiac action potential, conduction system anatomy, blood supply-
Part 2ECG paper grid (time/voltage), all 3 HR calculation methods, 12-lead formatECG grid with all waves labeled (Goldman-Cecil)
Part 3All waves explained wave-by-wave with mechanism and normal values; QRS two-phase genesisVentricular depolarization vectors V1 vs V6 (Harrison's)
Part 4All 12 leads - positions, what they view, Einthoven's triangle, hexaxial axis diagramLead placement on chest (Harrison's); Frontal + horizontal plane leads; Hexaxial axis wheel; Normal 12-lead ECG
Part 514-parameter systematic reading approach-
Part 6.1Sinus rhythms - NSR, bradycardia, tachycardia, arrhythmia with ASCII ECGASCII diagrams
Part 6.2Atrial enlargement - P-pulmonale, P-mitraleP-wave comparison diagram (Harrison's)
Part 6.3LVH and RVH with voltage criteriaLVH/RVH QRS diagram (Harrison's)
Part 6.4All 4 degrees of AV block with ASCII ECGs and criteriaASCII ECG patterns
Part 6.5RBBB, LBBB, LAFB, LPFB - mechanism, criteria, clinical trapsRBBB/LBBB comparison V1 vs V6 (Harrison's)
Part 6.6Ischemia mechanism, STEMI evolution table, Wellens, Q waves, localization tableST depression vs elevation mechanism; anterior STEMI sequence; inferior STEMI sequence; Wellens T-waves
Part 6.7Atrial flutter (sawtooth), AF (irregularly irregular) with ASCII ECGsASCII ECG patterns
Part 6.8PVCs, VT (AV dissociation, fusion beats), VF, Torsades de Pointes-
Part 6.9AVNRT, WPW (orthodromic/antidromic), WPW+AF danger-
Part 6.11Pericarditis vs STEMI comparison table-
Part 6.12Hyperkalemia (all stages), hypokalemia, hypothermia Osborn waves, Ca²⁺ disordersHyperkalemia ECG sequence; Hypokalemia U-waves; Osborn wave; Ca²⁺ QT changes
Part 6.13Drug effects (digoxin, TCAs, antiarrhythmics)TCA overdose ECG
Part 6.14Cardiac tamponadeTamponade triad: tachycardia + low voltage + alternans
Part 6.15Pulmonary embolism S1Q3T3-
Part 6.16Brugada syndrome-
Part 6.17SAH and neurological ECG changesCVA T-waves (SAH)
Part 740+ condition quick reference table-
Part 8Expert mindset, 14-parameter approach, 5 life-threatening diagnoses-

Generate a PDF reference card summarizing all 40+ ECG abnormalities with their diagnostic criteria

Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace not found"

Good. I'll use reportlab to build a rich multi-page PDF reference card. Let me create the project directory and write the script.
Running Command

mkdir -p /home/daytona/workspace/ecg-reference && echo "created"

Writing File

~/ecg-reference/build_ecg_reference.py

#!/usr/bin/env python3
"""
ECG Reference Card - 40+ Abnormalities with Diagnostic Criteria
Builds a professional multi-page PDF reference card using ReportLab.
"""

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.lib.styles import ParagraphStyle, getSampleStyleSheet
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, PageBreak
)
from reportlab.platypus.flowables import BalancedColumns
from reportlab.lib.colors import HexColor, white, black
import os

OUTPUT = "/home/daytona/workspace/ecg-reference/ECG_Reference_Card.pdf"

# ── Colour palette ────────────────────────────────────────────────────────────
C_DARK_RED   = HexColor("#8B0000")
C_RED        = HexColor("#C0392B")
C_ORANGE     = HexColor("#E67E22")
C_AMBER      = HexColor("#F39C12")
C_BLUE_DARK  = HexColor("#1A3A5C")
C_BLUE       = HexColor("#2980B9")
C_BLUE_LIGHT = HexColor("#EBF5FB")
C_TEAL       = HexColor("#117A65")
C_TEAL_LIGHT = HexColor("#E8F8F5")
C_PURPLE     = HexColor("#6C3483")
C_PURPLE_LIGHT = HexColor("#F5EEF8")
C_GREEN      = HexColor("#1E8449")
C_GREEN_LIGHT = HexColor("#EAFAF1")
C_GREY_DARK  = HexColor("#2C3E50")
C_GREY       = HexColor("#566573")
C_GREY_LIGHT = HexColor("#F2F3F4")
C_GREY_MID   = HexColor("#BDC3C7")
C_YELLOW_LIGHT = HexColor("#FDFAE6")
C_PINK_LIGHT = HexColor("#FDEDEC")

# ── Page setup ────────────────────────────────────────────────────────────────
PAGE_W, PAGE_H = A4
MARGIN = 14 * mm
DOC_W  = PAGE_W - 2 * MARGIN

# ── Styles ────────────────────────────────────────────────────────────────────
def make_styles():
    base = getSampleStyleSheet()
    S = {}

    S['cover_title'] = ParagraphStyle(
        'cover_title', fontName='Helvetica-Bold',
        fontSize=32, textColor=white, alignment=TA_CENTER, leading=40,
        spaceAfter=6
    )
    S['cover_sub'] = ParagraphStyle(
        'cover_sub', fontName='Helvetica',
        fontSize=13, textColor=HexColor("#D6EAF8"), alignment=TA_CENTER, leading=18
    )
    S['cover_source'] = ParagraphStyle(
        'cover_source', fontName='Helvetica-Oblique',
        fontSize=9, textColor=HexColor("#AED6F1"), alignment=TA_CENTER, leading=12
    )
    S['section_head'] = ParagraphStyle(
        'section_head', fontName='Helvetica-Bold',
        fontSize=12, textColor=white, alignment=TA_LEFT, leading=15,
        leftIndent=4
    )
    S['card_title'] = ParagraphStyle(
        'card_title', fontName='Helvetica-Bold',
        fontSize=8.5, textColor=C_GREY_DARK, leading=11, spaceAfter=1
    )
    S['card_body'] = ParagraphStyle(
        'card_body', fontName='Helvetica',
        fontSize=7.5, textColor=C_GREY_DARK, leading=10.5, spaceAfter=0
    )
    S['card_crit'] = ParagraphStyle(
        'card_crit', fontName='Helvetica-Bold',
        fontSize=7.5, textColor=C_BLUE_DARK, leading=10.5
    )
    S['card_key'] = ParagraphStyle(
        'card_key', fontName='Helvetica-BoldOblique',
        fontSize=7.2, textColor=C_RED, leading=10
    )
    S['tag'] = ParagraphStyle(
        'tag', fontName='Helvetica-Bold',
        fontSize=6.5, textColor=white, leading=9, alignment=TA_CENTER
    )
    S['footer'] = ParagraphStyle(
        'footer', fontName='Helvetica',
        fontSize=7, textColor=C_GREY, alignment=TA_CENTER, leading=9
    )
    S['toc_head'] = ParagraphStyle(
        'toc_head', fontName='Helvetica-Bold',
        fontSize=10, textColor=C_BLUE_DARK, leading=13, spaceAfter=2
    )
    S['toc_item'] = ParagraphStyle(
        'toc_item', fontName='Helvetica',
        fontSize=8.5, textColor=C_GREY_DARK, leading=12, leftIndent=8
    )
    S['normal_head'] = ParagraphStyle(
        'normal_head', fontName='Helvetica-Bold',
        fontSize=9, textColor=C_BLUE_DARK, leading=12, spaceAfter=2, spaceBefore=4
    )
    S['normal_body'] = ParagraphStyle(
        'normal_body', fontName='Helvetica',
        fontSize=8, textColor=C_GREY_DARK, leading=11, spaceAfter=1
    )
    S['table_head'] = ParagraphStyle(
        'table_head', fontName='Helvetica-Bold',
        fontSize=7.5, textColor=white, leading=10, alignment=TA_CENTER
    )
    S['table_cell'] = ParagraphStyle(
        'table_cell', fontName='Helvetica',
        fontSize=7, textColor=C_GREY_DARK, leading=9.5
    )
    S['table_cell_bold'] = ParagraphStyle(
        'table_cell_bold', fontName='Helvetica-Bold',
        fontSize=7, textColor=C_GREY_DARK, leading=9.5
    )
    return S

S = make_styles()

# ── Helper: coloured section banner ──────────────────────────────────────────
def section_banner(title, color=C_BLUE_DARK, icon=""):
    label = f"{icon}  {title}" if icon else title
    t = Table([[Paragraph(label, S['section_head'])]],
              colWidths=[DOC_W])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, -1), color),
        ('ROWBACKGROUNDS', (0, 0), (-1, -1), [color]),
        ('TOPPADDING', (0, 0), (-1, -1), 5),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 5),
        ('LEFTPADDING', (0, 0), (-1, -1), 8),
        ('RIGHTPADDING', (0, 0), (-1, -1), 8),
        ('ROUNDEDCORNERS', [3, 3, 3, 3]),
    ]))
    return t

# ── Helper: single condition card ────────────────────────────────────────────
def condition_card(num, name, criteria_lines, key_pearl, bg=C_BLUE_LIGHT, tag_color=C_BLUE):
    """Returns a Table that looks like a card."""
    num_cell = Paragraph(f"<b>{num}</b>", ParagraphStyle(
        'num', fontName='Helvetica-Bold', fontSize=10,
        textColor=tag_color, alignment=TA_CENTER, leading=13
    ))
    title_cell = Paragraph(f"<b>{name}</b>", S['card_title'])
    criteria_text = "<br/>".join(
        f"<bullet>&bull;</bullet> {line}" for line in criteria_lines
    )
    crit_cell = Paragraph(criteria_text, S['card_body'])
    pearl_cell = Paragraph(f"<i>&#9733; {key_pearl}</i>", S['card_key'])

    inner = Table(
        [[title_cell], [crit_cell], [pearl_cell]],
        colWidths=[DOC_W * 0.87]
    )
    inner.setStyle(TableStyle([
        ('TOPPADDING', (0, 0), (-1, -1), 1),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 1),
        ('LEFTPADDING', (0, 0), (-1, -1), 0),
        ('RIGHTPADDING', (0, 0), (-1, -1), 0),
    ]))

    outer = Table(
        [[num_cell, inner]],
        colWidths=[DOC_W * 0.07, DOC_W * 0.93]
    )
    outer.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, -1), bg),
        ('TOPPADDING', (0, 0), (-1, -1), 5),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 5),
        ('LEFTPADDING', (0, 0), (0, 0), 4),
        ('LEFTPADDING', (1, 0), (1, 0), 4),
        ('RIGHTPADDING', (0, 0), (-1, -1), 6),
        ('VALIGN', (0, 0), (-1, -1), 'TOP'),
        ('BOX', (0, 0), (-1, -1), 0.5, C_GREY_MID),
        ('LINEBELOW', (0, 0), (-1, -1), 0.3, C_GREY_MID),
    ]))
    return outer

# ── Helper: two-column card row ───────────────────────────────────────────────
def two_col_cards(card_a, card_b):
    gap = 3 * mm
    col_w = (DOC_W - gap) / 2
    t = Table([[card_a, card_b]], colWidths=[col_w, col_w])
    t.setStyle(TableStyle([
        ('VALIGN', (0, 0), (-1, -1), 'TOP'),
        ('LEFTPADDING', (0, 0), (-1, -1), 0),
        ('RIGHTPADDING', (0, 0), (-1, -1), 0),
        ('TOPPADDING', (0, 0), (-1, -1), 0),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 2),
        ('INNERGRID', (0, 0), (-1, -1), 0, white),
        ('COLUMNPADDING', (1, 0), (1, 0), gap / 2),
    ]))
    return t

# ── Helper: mini single-column card (for 2-wide layout) ──────────────────────
def mini_card(num, name, criteria_lines, key_pearl, bg=C_BLUE_LIGHT, tag_color=C_BLUE):
    col_w = (DOC_W - 3 * mm) / 2
    num_cell = Paragraph(f"<b>{num}</b>", ParagraphStyle(
        'num2', fontName='Helvetica-Bold', fontSize=9,
        textColor=tag_color, alignment=TA_CENTER, leading=12
    ))
    title_cell = Paragraph(f"<b>{name}</b>", S['card_title'])
    criteria_text = "<br/>".join(
        f"<bullet>&bull;</bullet> {line}" for line in criteria_lines
    )
    crit_cell = Paragraph(criteria_text, S['card_body'])
    pearl_cell = Paragraph(f"<i>&#9733; {key_pearl}</i>", S['card_key'])

    inner = Table(
        [[title_cell], [crit_cell], [pearl_cell]],
        colWidths=[col_w * 0.86]
    )
    inner.setStyle(TableStyle([
        ('TOPPADDING', (0, 0), (-1, -1), 1),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 1),
        ('LEFTPADDING', (0, 0), (-1, -1), 0),
        ('RIGHTPADDING', (0, 0), (-1, -1), 0),
    ]))
    outer = Table(
        [[num_cell, inner]],
        colWidths=[col_w * 0.09, col_w * 0.91]
    )
    outer.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, -1), bg),
        ('TOPPADDING', (0, 0), (-1, -1), 5),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 5),
        ('LEFTPADDING', (0, 0), (0, 0), 3),
        ('LEFTPADDING', (1, 0), (1, 0), 3),
        ('RIGHTPADDING', (0, 0), (-1, -1), 4),
        ('VALIGN', (0, 0), (-1, -1), 'TOP'),
        ('BOX', (0, 0), (-1, -1), 0.5, C_GREY_MID),
    ]))
    return outer

# ── Helper: comparison table ──────────────────────────────────────────────────
def comparison_table(headers, rows, col_colors=None):
    header_row = [Paragraph(h, S['table_head']) for h in headers]
    data = [header_row]
    for row in rows:
        data.append([Paragraph(str(cell), S['table_cell']) for cell in row])

    col_count = len(headers)
    col_w = DOC_W / col_count

    t = Table(data, colWidths=[col_w] * col_count, repeatRows=1)
    style_cmds = [
        ('BACKGROUND', (0, 0), (-1, 0), C_BLUE_DARK),
        ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
        ('FONTSIZE', (0, 0), (-1, 0), 7.5),
        ('TEXTCOLOR', (0, 0), (-1, 0), white),
        ('ALIGN', (0, 0), (-1, -1), 'LEFT'),
        ('VALIGN', (0, 0), (-1, -1), 'TOP'),
        ('TOPPADDING', (0, 0), (-1, -1), 3),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 3),
        ('LEFTPADDING', (0, 0), (-1, -1), 4),
        ('RIGHTPADDING', (0, 0), (-1, -1), 4),
        ('ROWBACKGROUNDS', (0, 1), (-1, -1), [white, C_GREY_LIGHT]),
        ('GRID', (0, 0), (-1, -1), 0.3, C_GREY_MID),
        ('FONTSIZE', (0, 1), (-1, -1), 7),
    ]
    if col_colors:
        for col_idx, col_color in col_colors.items():
            style_cmds.append(('BACKGROUND', (col_idx, 0), (col_idx, 0), col_color))
    t.setStyle(TableStyle(style_cmds))
    return t

# ── Page numbering callback ───────────────────────────────────────────────────
def on_page(canvas, doc):
    canvas.saveState()
    # Footer line
    canvas.setStrokeColor(C_BLUE_DARK)
    canvas.setLineWidth(0.5)
    canvas.line(MARGIN, 18 * mm, PAGE_W - MARGIN, 18 * mm)
    # Footer text
    canvas.setFont('Helvetica', 6.5)
    canvas.setFillColor(C_GREY)
    canvas.drawString(MARGIN, 13 * mm,
        "ECG Reference Card  |  Based on Harrison's 22E, Goldman-Cecil Medicine, Medical Physiology")
    canvas.drawRightString(PAGE_W - MARGIN, 13 * mm,
        f"Page {doc.page}")
    canvas.restoreState()

def on_first_page(canvas, doc):
    # Full cover background
    canvas.setFillColor(C_BLUE_DARK)
    canvas.rect(0, 0, PAGE_W, PAGE_H, fill=1, stroke=0)
    # ECG waveform decoration strip (simulated)
    canvas.setStrokeColor(HexColor("#1A5276"))
    canvas.setLineWidth(1)
    canvas.line(0, PAGE_H * 0.52, PAGE_W, PAGE_H * 0.52)

# ── All 40+ ECG conditions data ───────────────────────────────────────────────
CONDITIONS = {
    "SINUS RHYTHMS": [
        {
            "num": "01", "name": "Normal Sinus Rhythm",
            "criteria": [
                "Rate 60-100 bpm",
                "P wave before every QRS; every QRS after a P",
                "P upright in I, II, aVF; inverted in aVR",
                "PR 120-200 ms; QRS < 120 ms",
            ],
            "pearl": "The reference standard. Deviation from this = abnormal.",
            "bg": C_GREEN_LIGHT, "tag": C_GREEN
        },
        {
            "num": "02", "name": "Sinus Bradycardia",
            "criteria": [
                "Rate < 60 bpm",
                "All morphologies (P, PR, QRS) completely NORMAL",
                "Just slow",
            ],
            "pearl": "Athletes, beta-blockers, hypothyroidism, inferior MI, sick sinus.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
        {
            "num": "03", "name": "Sinus Tachycardia",
            "criteria": [
                "Rate > 100 bpm",
                "All morphologies (P, PR, QRS) completely NORMAL",
                "P wave always upright in II",
            ],
            "pearl": "Always find the CAUSE. It is a symptom, never a primary diagnosis.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
        {
            "num": "04", "name": "Sinus Arrhythmia",
            "criteria": [
                "Rate varies with respiration (increases inspiration, decreases expiration)",
                "R-R variation > 10% between fastest and slowest",
                "All P wave morphologies and PR intervals identical",
            ],
            "pearl": "Normal finding; common in young patients and athletes.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
    ],
    "ATRIAL ABNORMALITIES": [
        {
            "num": "05", "name": "Right Atrial Overload (P-pulmonale)",
            "criteria": [
                "P wave amplitude >= 2.5 mm in II, III, aVF (tall peaked P)",
                "P wave duration NORMAL (< 120 ms)",
                "Large initial positive component of P in V1",
            ],
            "pearl": "COPD, pulmonary HTN, PE, tricuspid stenosis.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
        {
            "num": "06", "name": "Left Atrial Abnormality (P-mitrale)",
            "criteria": [
                "P wave duration >= 120 ms with notched 'M-shape' in II",
                "Biphasic P in V1: prominent DEEP negative terminal component (> 1 mm deep AND > 1 mm wide)",
                "P wave amplitude usually normal",
            ],
            "pearl": "Mitral stenosis, LV failure, hypertension, aortic stenosis.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
    ],
    "CHAMBER HYPERTROPHY": [
        {
            "num": "07", "name": "Left Ventricular Hypertrophy (LVH)",
            "criteria": [
                "Sokolow-Lyon: S(V1) + R(V5 or V6) > 35 mm",
                "Cornell: R(aVL) + S(V3) > 28 mm (M) or > 20 mm (F)",
                "R in aVL alone > 11 mm",
                "LV strain: ST depression + asymmetric T inversion in I, aVL, V5-V6",
                "Often: LAD, left atrial abnormality",
            ],
            "pearl": "Sensitivity only 30-50%. Specificity 85-95%. Echocardiography is definitive.",
            "bg": C_PURPLE_LIGHT, "tag": C_PURPLE
        },
        {
            "num": "08", "name": "Right Ventricular Hypertrophy (RVH)",
            "criteria": [
                "R >= S wave in V1 (tall R in V1) - HALLMARK",
                "Right axis deviation (QRS axis > +90 degrees)",
                "ST depression + T-wave inversion V1-V3 (RV strain)",
                "Deep S waves in I, V5, V6",
                "Right atrial overload often accompanies",
            ],
            "pearl": "Pulmonary HTN, pulmonary stenosis, COPD, ASD, Tetralogy of Fallot.",
            "bg": C_PURPLE_LIGHT, "tag": C_PURPLE
        },
    ],
    "AV CONDUCTION BLOCKS": [
        {
            "num": "09", "name": "1st Degree AV Block",
            "criteria": [
                "PR interval > 200 ms (> 5 small boxes)",
                "Every P wave is followed by a QRS - NOTHING DROPPED",
                "PR interval prolonged but CONSTANT",
                "QRS usually narrow and normal",
            ],
            "pearl": "Usually benign. Digoxin, beta-blockers, inferior MI, high vagal tone.",
            "bg": C_YELLOW_LIGHT, "tag": C_AMBER
        },
        {
            "num": "10", "name": "2nd Degree AV Block - Mobitz I (Wenckebach)",
            "criteria": [
                "PR interval progressively LENGTHENS with each beat",
                "Until one P wave is not conducted (QRS dropped)",
                "After dropped beat, PR resets to shortest, cycle repeats",
                "RR intervals progressively SHORTEN before pause",
                "GROUPED BEATING pattern - characteristic",
            ],
            "pearl": "Benign; AV nodal level. Inferior MI (RCA). Usually no pacemaker.",
            "bg": C_YELLOW_LIGHT, "tag": C_AMBER
        },
        {
            "num": "11", "name": "2nd Degree AV Block - Mobitz II",
            "criteria": [
                "PR interval is CONSTANT (does NOT prolong)",
                "Sudden unexpected non-conducted P wave (QRS dropped without warning)",
                "Often associated with WIDE QRS complex",
                "May be 2:1, 3:1 pattern",
            ],
            "pearl": "DANGEROUS - infranodal. High risk progression to complete block. Pacemaker needed.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "12", "name": "3rd Degree (Complete) AV Block",
            "criteria": [
                "COMPLETE AV dissociation - P and QRS are INDEPENDENT",
                "P wave rate > QRS rate (P marches faster)",
                "Narrow QRS escape (junctional, 40-60 bpm) = proximal block",
                "Wide QRS escape (ventricular, 20-40 bpm) = distal block",
                "No fixed PR relationship anywhere on strip",
            ],
            "pearl": "EMERGENCY. Stokes-Adams attack (syncope). Urgent temporary pacemaker.",
            "bg": C_PINK_LIGHT, "tag": C_DARK_RED
        },
    ],
    "BUNDLE BRANCH BLOCKS": [
        {
            "num": "13", "name": "Right Bundle Branch Block (RBBB)",
            "criteria": [
                "QRS >= 120 ms (wide)",
                "rSR' pattern in V1 ('rabbit ears' / M-shape) - HALLMARK",
                "Wide slurred S wave in I, aVL, V5, V6",
                "T-wave inversion in V1-V2 (secondary change - NORMAL)",
            ],
            "pearl": "T-wave inversion in V1-V2 is NORMAL in RBBB - not ischemia. New RBBB = consider PE.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
        {
            "num": "14", "name": "Left Bundle Branch Block (LBBB)",
            "criteria": [
                "QRS >= 120 ms (wide)",
                "Broad, monophasic R in I, aVL, V5-V6 (no septal q waves!)",
                "rS or QS pattern in V1 (deep broad S or entirely negative)",
                "T-wave inversion in I, aVL, V5-V6 (secondary - NORMAL)",
                "Left axis deviation common",
            ],
            "pearl": "New LBBB + chest pain = STEMI equivalent. No septal Q waves is the key clue.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE_DARK
        },
        {
            "num": "15", "name": "Left Anterior Fascicular Block (LAFB)",
            "criteria": [
                "Left axis deviation (axis more negative than -45 degrees)",
                "qR pattern in leads I and aVL",
                "rS pattern in leads II, III, aVF",
                "QRS slightly prolonged but < 120 ms",
            ],
            "pearl": "Most common cause of marked LAD in adults.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
        {
            "num": "16", "name": "Left Posterior Fascicular Block (LPFB)",
            "criteria": [
                "Right axis deviation (axis > +110 degrees)",
                "rS pattern in I and aVL; qR in II, III, aVF",
                "QRS < 120 ms",
                "Diagnosis of EXCLUSION (rule out RVH, PE, lateral MI first)",
            ],
            "pearl": "Very rare as isolated finding. Dual blood supply makes it resistant to ischemia.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
    ],
    "ISCHEMIA AND INFARCTION": [
        {
            "num": "17", "name": "Hyperacute T Waves (Earliest STEMI)",
            "criteria": [
                "Tall, broad-based, symmetric peaked T waves in ischemic territory",
                "T wave taller than R wave in same lead",
                "Occur within MINUTES of coronary occlusion",
                "Regional distribution (not diffuse)",
            ],
            "pearl": "Earliest ECG sign of STEMI. Can revert to normal if reperfusion is rapid.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "18", "name": "STEMI - Anterior (LAD)",
            "criteria": [
                "ST elevation (convex/tombstone) in V1-V4 (+/- I, aVL)",
                "Reciprocal ST depression in II, III, aVF",
                "Evolves: hyperacute T -> ST elevation -> T inversion -> Q waves",
                "Pathological Q waves in V1-V4 (width >= 40 ms OR depth >= 25% R)",
            ],
            "pearl": "Proximal LAD occlusion = V1-V6 + I + aVL elevation (widowmaker).",
            "bg": C_PINK_LIGHT, "tag": C_DARK_RED
        },
        {
            "num": "19", "name": "STEMI - Inferior (RCA/LCx)",
            "criteria": [
                "ST elevation in II, III, aVF",
                "Reciprocal ST depression in I, aVL (often prominent)",
                "III elevation > II elevation suggests RCA",
                "Always check right-sided leads (V3R/V4R) for RV infarct",
            ],
            "pearl": "Do right-sided leads in ALL inferior MI. RV infarct changes management entirely.",
            "bg": C_PINK_LIGHT, "tag": C_DARK_RED
        },
        {
            "num": "20", "name": "STEMI - Lateral (LCx)",
            "criteria": [
                "ST elevation in I, aVL, V5, V6",
                "Reciprocal ST depression in V1-V3 (and sometimes II, III, aVF)",
            ],
            "pearl": "High lateral MI (I, aVL only) can have very subtle, easily missed changes.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "21", "name": "STEMI - Posterior",
            "criteria": [
                "NO direct ST elevation in standard leads",
                "Tall R wave in V1-V2 (posterior Q wave mirror image)",
                "ST depression in V1-V3 (posterior ST elevation, mirror image)",
                "Confirm with posterior leads V7-V9 (ST elevation >= 0.5 mm)",
            ],
            "pearl": "The 'hidden STEMI'. Always flip V1-V3 upside down to visualise posterior MI.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "22", "name": "Right Ventricular Infarction",
            "criteria": [
                "In context of inferior STEMI (proximal RCA)",
                "ST elevation >= 1 mm in V3R and/or V4R",
                "Clinical: hypotension + JVD + clear lungs (Bezold-Jarisch triad)",
                "Contra-indicated: Nitrates (preload-dependent ventricle)",
            ],
            "pearl": "Fluids, NOT nitrates. Give IV fluids to maintain RV preload.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "23", "name": "NSTEMI / Unstable Angina",
            "criteria": [
                "ST depression (horizontal or downsloping >= 1 mm) in >= 2 contiguous leads",
                "T-wave inversions in ischemic territory",
                "Troponin elevated (NSTEMI) or normal (unstable angina)",
                "No ST elevation, no Q waves",
            ],
            "pearl": "Up to 40% of NSTEMIs have a NORMAL ECG. Troponin is essential.",
            "bg": C_PINK_LIGHT, "tag": C_ORANGE
        },
        {
            "num": "24", "name": "Wellens Syndrome (LAD Warning)",
            "criteria": [
                "Biphasic T waves (Type A) or deep symmetric T inversions (Type B) in V2-V3",
                "Little or no chest pain at time of ECG",
                "No significant ST elevation; no Q waves",
                "Normal or slightly elevated troponin",
            ],
            "pearl": "Critical proximal LAD stenosis. High risk of anterior STEMI. URGENT cath.",
            "bg": C_PINK_LIGHT, "tag": C_ORANGE
        },
        {
            "num": "25", "name": "De Winter T Waves (LAD Occlusion Equivalent)",
            "criteria": [
                "Upsloping ST depression >= 1-3 mm at J-point in V1-V6",
                "Followed by tall, peaked, symmetric positive T waves",
                "ST elevation in aVR (1-2 mm)",
                "No classic ST elevation - but represents STEMI equivalent",
            ],
            "pearl": "Seen in ~2% of LAD occlusions. Treat as anterior STEMI. Activate cath lab.",
            "bg": C_PINK_LIGHT, "tag": C_ORANGE
        },
    ],
    "ATRIAL ARRHYTHMIAS": [
        {
            "num": "26", "name": "Atrial Premature Contractions (APCs)",
            "criteria": [
                "Early (premature) P wave with DIFFERENT morphology from sinus P",
                "Followed by normal QRS (usually narrow)",
                "Incomplete compensatory pause (sinus is reset)",
            ],
            "pearl": "Benign. Triggered by caffeine, alcohol, stress, electrolyte imbalance.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
        {
            "num": "27", "name": "Atrial Flutter",
            "criteria": [
                "Sawtooth flutter waves (F waves) at 250-350 bpm (classically 300 bpm)",
                "Best seen in II, III, aVF (negative sawtooth) and V1",
                "Regular or regularly irregular ventricular rate (2:1, 3:1, 4:1)",
                "Classic 2:1 flutter: ventricular rate exactly 150 bpm",
            ],
            "pearl": "Any narrow tachycardia at EXACTLY 150 bpm = flutter until proven otherwise.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
        {
            "num": "28", "name": "Atrial Fibrillation (AF)",
            "criteria": [
                "No distinct P waves - chaotic fibrillatory baseline (fine or coarse)",
                "IRREGULARLY IRREGULAR RR intervals - absolute hallmark",
                "Narrow QRS (usually) unless aberrant conduction",
                "Ventricular rate 100-170 bpm if uncontrolled",
            ],
            "pearl": "The only 'truly irregular' rhythm. If RR is irregular + wide QRS = AF with BBB or WPW.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
    ],
    "VENTRICULAR ARRHYTHMIAS": [
        {
            "num": "29", "name": "Premature Ventricular Contractions (PVCs)",
            "criteria": [
                "Wide QRS >= 120 ms with bizarre morphology",
                "No preceding P wave",
                "T wave DISCORDANT (opposite) to QRS main deflection",
                "Full compensatory pause (P-P marches through undisturbed)",
            ],
            "pearl": "Bigeminy = every other beat PVC; trigeminy = every third. Unifocal vs multifocal.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "30", "name": "Ventricular Tachycardia (VT)",
            "criteria": [
                "Wide QRS >= 120 ms tachycardia, rate > 100 bpm (usually 140-220 bpm)",
                "AV dissociation (P waves march independently, SLOWER than QRS) - pathognomonic",
                "Fusion beats (hybrid P+VT morphology) - confirms AV dissociation",
                "Capture beats (narrow QRS amidst wide) - confirms AV dissociation",
                "QRS concordance in precordial leads (all positive or all negative V1-V6)",
            ],
            "pearl": "ALWAYS assume wide-complex tachycardia = VT. NEVER give verapamil empirically.",
            "bg": C_PINK_LIGHT, "tag": C_DARK_RED
        },
        {
            "num": "31", "name": "Ventricular Fibrillation (VF)",
            "criteria": [
                "Completely chaotic, irregular, high-frequency undulations",
                "No recognisable QRS, ST, T waves",
                "Rate: indeterminate (truly chaotic)",
            ],
            "pearl": "Cardiac arrest. IMMEDIATE unsynchronised defibrillation. CPR concurrently.",
            "bg": C_PINK_LIGHT, "tag": C_DARK_RED
        },
        {
            "num": "32", "name": "Torsades de Pointes (TdP)",
            "criteria": [
                "Polymorphic VT with twisting QRS axis around isoelectric baseline",
                "QRS amplitude oscillates - 'twisting of the points'",
                "Occurs in context of PROLONGED QT interval",
                "Rate 150-250 bpm; may self-terminate or degenerate to VF",
            ],
            "pearl": "Treat with IV Magnesium FIRST, even if Mg level is normal. Correct K+ simultaneously.",
            "bg": C_PINK_LIGHT, "tag": C_DARK_RED
        },
    ],
    "SVT / ACCESSORY PATHWAYS": [
        {
            "num": "33", "name": "AVNRT (Most Common SVT)",
            "criteria": [
                "Narrow QRS tachycardia, rate 150-250 bpm",
                "P waves buried IN or immediately after QRS (retrograde P)",
                "Pseudo-S wave in inferior leads; pseudo-R' in V1",
                "Regular rhythm; abrupt onset and termination",
                "RP interval < 70 ms",
            ],
            "pearl": "Vagal manoeuvres or adenosine terminates it. Reentry within the AV node.",
            "bg": C_PURPLE_LIGHT, "tag": C_PURPLE
        },
        {
            "num": "34", "name": "WPW Syndrome (Resting ECG)",
            "criteria": [
                "Short PR < 120 ms (pre-excitation bypasses AV node)",
                "Delta wave (slurred upstroke of QRS) - direct ventricular pre-excitation",
                "Widened QRS > 120 ms (fusion: normal + accessory pathway activation)",
                "Secondary ST-T changes (discordant to delta/QRS)",
            ],
            "pearl": "WPW + AF = life-threatening (rate >300 bpm). NEVER give digoxin or verapamil.",
            "bg": C_PURPLE_LIGHT, "tag": C_PURPLE
        },
        {
            "num": "35", "name": "Orthodromic AVRT (WPW tachycardia)",
            "criteria": [
                "Narrow QRS tachycardia (down AV node, up accessory pathway)",
                "Retrograde P wave AFTER QRS (RP > 70 ms, separated from QRS)",
                "Regular rate 150-250 bpm",
                "Rate 95% of WPW tachycardias",
            ],
            "pearl": "Narrow QRS in WPW tachycardia. Adenosine often terminates it (terminates AV conduction).",
            "bg": C_PURPLE_LIGHT, "tag": C_PURPLE
        },
    ],
    "ELECTROLYTE DISTURBANCES": [
        {
            "num": "36", "name": "Hyperkalemia",
            "criteria": [
                "K+ 5.5-6.5: Tall narrow symmetric PEAKED (tented) T waves - FIRST sign",
                "K+ 6.5-7.5: PR prolongation, P wave flattening/disappearance",
                "K+ 7.0-7.5: QRS widening begins",
                "K+ 7.5-8.0: Markedly wide bizarre QRS",
                "K+ > 8.0: Sine wave pattern -> VF -> asystole",
            ],
            "pearl": "Peaked T + wide QRS + no P = emergency. IV calcium gluconate IMMEDIATELY.",
            "bg": C_YELLOW_LIGHT, "tag": C_ORANGE
        },
        {
            "num": "37", "name": "Hypokalemia",
            "criteria": [
                "Flat or inverted T waves",
                "Prominent U waves (U wave taller than T wave in V2-V3) - HALLMARK",
                "Apparent QT prolongation (actually QU prolongation)",
                "ST depression",
            ],
            "pearl": "Predisposes to Torsades de Pointes and digitalis toxicity. Replete K+ to > 4.0 mEq/L.",
            "bg": C_YELLOW_LIGHT, "tag": C_AMBER
        },
        {
            "num": "38", "name": "Hypercalcemia",
            "criteria": [
                "Shortened QT interval (abbreviated ST segment)",
                "QTc < 360 ms",
                "Osborn waves may appear in severe cases",
                "T wave shape relatively normal",
            ],
            "pearl": "Short QT = high calcium. Classic in hyperparathyroidism, malignancy.",
            "bg": C_YELLOW_LIGHT, "tag": C_AMBER
        },
        {
            "num": "39", "name": "Hypocalcemia",
            "criteria": [
                "Prolonged QT interval (specifically prolonged ST SEGMENT)",
                "T wave shape itself remains relatively normal",
                "QTc prolonged (> 450 ms men, > 460 ms women)",
            ],
            "pearl": "QT is long but T-wave shape is normal - unlike drug QT where T wave is deformed.",
            "bg": C_YELLOW_LIGHT, "tag": C_AMBER
        },
    ],
    "SPECIAL SYNDROMES": [
        {
            "num": "40", "name": "Acute Pericarditis",
            "criteria": [
                "Diffuse CONCAVE (saddle-shaped) ST elevation in ALMOST ALL leads",
                "ST depression only in aVR and V1 (+ PR elevation in aVR)",
                "PR DEPRESSION - pathognomonic sign",
                "NO reciprocal ST depression (unlike MI)",
                "NO Q waves",
            ],
            "pearl": "Saddle shape + PR depression + no reciprocal changes = pericarditis, NOT STEMI.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
        {
            "num": "41", "name": "Cardiac Tamponade",
            "criteria": [
                "Sinus tachycardia (compensatory)",
                "LOW QRS voltage (< 5 mm all limb leads; < 10 mm all precordial leads)",
                "ELECTRICAL ALTERNANS - beat-to-beat alternation in QRS height/axis",
                "All three together = highly specific for tamponade",
            ],
            "pearl": "Alternans is caused by the heart swinging inside the pericardial effusion.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
        {
            "num": "42", "name": "Pulmonary Embolism",
            "criteria": [
                "Sinus tachycardia - most common (nonspecific)",
                "S1Q3T3: S wave in I + Q wave in III + T inversion in III",
                "New RBBB (acute RV pressure overload)",
                "Right axis deviation; T inversions V1-V4",
                "Sinus tachycardia may be the ONLY finding",
            ],
            "pearl": "S1Q3T3 is specific but seen in only ~20%. Sinus tachycardia is the most common ECG sign.",
            "bg": C_TEAL_LIGHT, "tag": C_TEAL
        },
        {
            "num": "43", "name": "Brugada Syndrome",
            "criteria": [
                "Type 1 (diagnostic): >= 2 mm COVED (dome-shape) ST elevation in V1-V2",
                "RBBB-like pattern in V1",
                "Spontaneous or drug-provoked (flecainide challenge)",
                "Type 2: Saddle-back pattern - NOT diagnostic without provocation",
            ],
            "pearl": "SCN5A Na+ channel mutation. Causes VF during sleep/fever. ICD is treatment.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "44", "name": "Long QT Syndrome",
            "criteria": [
                "QTc >= 450 ms (men) or >= 460 ms (women)",
                "LQT1: Broad-based wide T waves; triggered by exercise/swimming",
                "LQT2: Bifid (notched) T waves; triggered by emotion/sudden sounds",
                "LQT3: Late-onset narrow T wave; events during sleep",
            ],
            "pearl": "Risk = Torsades de Pointes -> VF -> sudden death. Avoid QT-prolonging drugs.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
        {
            "num": "45", "name": "Hypothermia (Osborn Waves)",
            "criteria": [
                "Osborn (J) waves: positive convex hump at J-point (after QRS end)",
                "Sinus bradycardia",
                "All intervals prolonged (PR, QRS, QT)",
                "J wave size correlates with degree of hypothermia",
            ],
            "pearl": "Core temp < 35C. J wave amplitude increases as temperature drops.",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
        {
            "num": "46", "name": "Subarachnoid Hemorrhage (SAH)",
            "criteria": [
                "Deep, wide, symmetric T-wave inversions in multiple leads ('giant T waves')",
                "Prolonged QT interval",
                "May mimic anterior STEMI",
                "Sinus bradycardia common",
            ],
            "pearl": "CVA T-waves. Mediated by catecholamine surge. Check for headache ('thunderclap').",
            "bg": C_BLUE_LIGHT, "tag": C_BLUE
        },
        {
            "num": "47", "name": "Digoxin Effect/Toxicity",
            "criteria": [
                "Effect: Scooped ST-T ('reverse tick' sign); shortened QT; PR prolongation",
                "Toxicity: Virtually any arrhythmia possible",
                "Classic toxic rhythms: PVCs, AV block + junctional tachycardia, AF with regularised rhythm",
                "Bidirectional VT = pathognomonic for digoxin toxicity",
            ],
            "pearl": "Digoxin EFFECT (therapeutic) is not toxicity. Toxicity requires clinical correlation.",
            "bg": C_YELLOW_LIGHT, "tag": C_AMBER
        },
        {
            "num": "48", "name": "Tricyclic Antidepressant Toxicity",
            "criteria": [
                "QRS widening >= 100 ms (severe >= 160 ms)",
                "Right axis deviation of terminal QRS forces",
                "Tall R wave in aVR (> 3 mm); R:S in aVR > 0.7",
                "QT prolongation; sinus tachycardia",
            ],
            "pearl": "QRS > 100 ms = seizure risk. QRS > 160 ms = VT risk. Na bicarb is antidote.",
            "bg": C_PINK_LIGHT, "tag": C_RED
        },
    ]
}

# ── Build document ────────────────────────────────────────────────────────────
def build_pdf():
    doc = SimpleDocTemplate(
        OUTPUT,
        pagesize=A4,
        leftMargin=MARGIN,
        rightMargin=MARGIN,
        topMargin=22 * mm,
        bottomMargin=22 * mm,
        title="ECG Reference Card - 48 Abnormalities",
        author="Orris Medical AI",
        subject="ECG Diagnostic Criteria Reference",
    )

    story = []

    # ── COVER PAGE ────────────────────────────────────────────────────────────
    story.append(Spacer(1, 30 * mm))

    cover_title_t = Table(
        [[Paragraph("ECG Reference Card", S['cover_title'])]],
        colWidths=[DOC_W]
    )
    cover_title_t.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, -1), C_BLUE_DARK),
        ('TOPPADDING', (0, 0), (-1, -1), 12),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 8),
        ('LEFTPADDING', (0, 0), (-1, -1), 8),
        ('RIGHTPADDING', (0, 0), (-1, -1), 8),
    ]))
    story.append(cover_title_t)
    story.append(Spacer(1, 4 * mm))

    subtitle_t = Table(
        [[Paragraph("48 ECG Abnormalities with Diagnostic Criteria", S['cover_sub'])]],
        colWidths=[DOC_W]
    )
    subtitle_t.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, -1), C_BLUE),
        ('TOPPADDING', (0, 0), (-1, -1), 8),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 8),
    ]))
    story.append(subtitle_t)
    story.append(Spacer(1, 6 * mm))

    desc_t = Table([[Paragraph(
        "MBBS-Level Quick Reference  |  From Sinus Rhythms to Complex Arrhythmias<br/>"
        "Ischemia &amp; Infarction  |  Electrolyte Disorders  |  Special Syndromes<br/>"
        "<br/>Based on: Harrison's Principles 22E  |  Goldman-Cecil Medicine  |  Medical Physiology (Boron &amp; Boulpaep)",
        S['cover_source']
    )]], colWidths=[DOC_W])
    desc_t.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, -1), C_BLUE_DARK),
        ('TOPPADDING', (0, 0), (-1, -1), 10),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 10),
    ]))
    story.append(desc_t)

    story.append(Spacer(1, 20 * mm))

    # Colour legend on cover
    legend_data = [
        [
            Paragraph("<b>Sinus / Normal</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
            Paragraph("<b>Atrial Abnormalities</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
            Paragraph("<b>Hypertrophy</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
            Paragraph("<b>AV Blocks</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
        ],
        [
            Paragraph("<b>Bundle Branch</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
            Paragraph("<b>Ischemia / MI</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
            Paragraph("<b>Arrhythmias</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
            Paragraph("<b>Special Syndromes</b>", ParagraphStyle('lg', fontName='Helvetica-Bold', fontSize=8, textColor=white)),
        ]
    ]
    legend_t = Table(legend_data, colWidths=[DOC_W / 4] * 4)
    legend_t.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (0, 0), C_GREEN),
        ('BACKGROUND', (1, 0), (1, 0), C_TEAL),
        ('BACKGROUND', (2, 0), (2, 0), C_PURPLE),
        ('BACKGROUND', (3, 0), (3, 0), C_AMBER),
        ('BACKGROUND', (0, 1), (0, 1), C_BLUE),
        ('BACKGROUND', (1, 1), (1, 1), C_DARK_RED),
        ('BACKGROUND', (2, 1), (2, 1), C_RED),
        ('BACKGROUND', (3, 1), (3, 1), C_TEAL),
        ('ALIGN', (0, 0), (-1, -1), 'CENTER'),
        ('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
        ('TOPPADDING', (0, 0), (-1, -1), 7),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 7),
        ('INNERGRID', (0, 0), (-1, -1), 0.5, white),
        ('BOX', (0, 0), (-1, -1), 0.5, white),
    ]))
    story.append(legend_t)

    story.append(Spacer(1, 10 * mm))

    # Normal values box on cover
    nv_data = [
        [Paragraph("<b>NORMAL ECG VALUES QUICK REFERENCE</b>", ParagraphStyle(
            'nvh', fontName='Helvetica-Bold', fontSize=9, textColor=white, alignment=TA_CENTER
        ))],
        [Table([
            [
                Paragraph("<b>Heart Rate</b><br/>60-100 bpm", S['normal_body']),
                Paragraph("<b>PR Interval</b><br/>120-200 ms (3-5 small boxes)", S['normal_body']),
                Paragraph("<b>QRS Duration</b><br/>70-110 ms (&lt; 3 small boxes)", S['normal_body']),
            ],
            [
                Paragraph("<b>QTc (Bazett)</b><br/>Men: &lt;450 ms | Women: &lt;460 ms", S['normal_body']),
                Paragraph("<b>QRS Axis</b><br/>-30 to +90 degrees", S['normal_body']),
                Paragraph("<b>ECG Paper</b><br/>1 small box = 0.04 s / 0.1 mV", S['normal_body']),
            ],
        ], colWidths=[DOC_W / 3] * 3)]
    ]
    nv_outer = Table(nv_data, colWidths=[DOC_W])
    nv_outer.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, 0), C_BLUE_DARK),
        ('BACKGROUND', (0, 1), (-1, 1), HexColor("#EBF5FB")),
        ('TOPPADDING', (0, 0), (-1, 0), 6),
        ('BOTTOMPADDING', (0, 0), (-1, 0), 6),
        ('TOPPADDING', (0, 1), (-1, 1), 4),
        ('BOTTOMPADDING', (0, 1), (-1, 1), 4),
        ('BOX', (0, 0), (-1, -1), 0.8, C_BLUE_DARK),
    ]))
    story.append(nv_outer)

    story.append(PageBreak())

    # ── CONDITION PAGES ───────────────────────────────────────────────────────
    section_colors = {
        "SINUS RHYTHMS": C_GREEN,
        "ATRIAL ABNORMALITIES": C_TEAL,
        "CHAMBER HYPERTROPHY": C_PURPLE,
        "AV CONDUCTION BLOCKS": C_AMBER,
        "BUNDLE BRANCH BLOCKS": C_BLUE_DARK,
        "ISCHEMIA AND INFARCTION": C_DARK_RED,
        "ATRIAL ARRHYTHMIAS": C_TEAL,
        "VENTRICULAR ARRHYTHMIAS": C_RED,
        "SVT / ACCESSORY PATHWAYS": C_PURPLE,
        "ELECTROLYTE DISTURBANCES": C_ORANGE,
        "SPECIAL SYNDROMES": C_BLUE_DARK,
    }

    section_icons = {
        "SINUS RHYTHMS": "01",
        "ATRIAL ABNORMALITIES": "02",
        "CHAMBER HYPERTROPHY": "03",
        "AV CONDUCTION BLOCKS": "04",
        "BUNDLE BRANCH BLOCKS": "05",
        "ISCHEMIA AND INFARCTION": "06",
        "ATRIAL ARRHYTHMIAS": "07",
        "VENTRICULAR ARRHYTHMIAS": "08",
        "SVT / ACCESSORY PATHWAYS": "09",
        "ELECTROLYTE DISTURBANCES": "10",
        "SPECIAL SYNDROMES": "11",
    }

    for section_name, conditions in CONDITIONS.items():
        sec_color = section_colors.get(section_name, C_BLUE_DARK)
        story.append(section_banner(
            f"SECTION {section_icons.get(section_name, '')}  |  {section_name}",
            color=sec_color
        ))
        story.append(Spacer(1, 2 * mm))

        # Render cards in two-column pairs
        cards = []
        for cond in conditions:
            card = mini_card(
                num=cond["num"],
                name=cond["name"],
                criteria_lines=cond["criteria"],
                key_pearl=cond["pearl"],
                bg=cond.get("bg", C_BLUE_LIGHT),
                tag_color=cond.get("tag", C_BLUE)
            )
            cards.append(card)

        # Pair up cards into two-column rows
        i = 0
        while i < len(cards):
            if i + 1 < len(cards):
                row_t = Table(
                    [[cards[i], Spacer(3 * mm, 1), cards[i + 1]]],
                    colWidths=[(DOC_W - 3 * mm) / 2, 3 * mm, (DOC_W - 3 * mm) / 2]
                )
                row_t.setStyle(TableStyle([
                    ('VALIGN', (0, 0), (-1, -1), 'TOP'),
                    ('LEFTPADDING', (0, 0), (-1, -1), 0),
                    ('RIGHTPADDING', (0, 0), (-1, -1), 0),
                    ('TOPPADDING', (0, 0), (-1, -1), 0),
                    ('BOTTOMPADDING', (0, 0), (-1, -1), 2),
                ]))
                story.append(row_t)
                i += 2
            else:
                # Odd card - full width
                full_card = condition_card(
                    num=conditions[i]["num"],
                    name=conditions[i]["name"],
                    criteria_lines=conditions[i]["criteria"],
                    key_pearl=conditions[i]["pearl"],
                    bg=conditions[i].get("bg", C_BLUE_LIGHT),
                    tag_color=conditions[i].get("tag", C_BLUE)
                )
                story.append(full_card)
                story.append(Spacer(1, 1.5 * mm))
                i += 1

        story.append(Spacer(1, 4 * mm))

    # ── COMPARISON TABLES PAGE ────────────────────────────────────────────────
    story.append(PageBreak())
    story.append(section_banner("CRITICAL COMPARISON TABLES", color=C_BLUE_DARK))
    story.append(Spacer(1, 3 * mm))

    # Table 1: STEMI localisation
    story.append(Paragraph("STEMI Localisation by Lead Territory", S['normal_head']))
    t1 = comparison_table(
        headers=["MI Territory", "ST Elevation in", "Reciprocal Depression", "Culprit Artery"],
        rows=[
            ["Anterior", "V1-V4", "II, III, aVF", "LAD (mid-distal)"],
            ["Septal", "V1-V2", "None typically", "LAD (septal branches)"],
            ["Anterolateral", "V1-V6, I, aVL", "II, III, aVF", "Proximal LAD"],
            ["Lateral", "I, aVL, V5-V6", "V1-V3", "LCx or Diagonal"],
            ["Inferior", "II, III, aVF", "I, aVL", "RCA (80%) or LCx (20%)"],
            ["Posterior", "Tall R + ST depression V1-V3", "None (V1-V3 shows depression)", "RCA or LCx"],
            ["Right Ventricle", "V3R, V4R elevation", "—", "Proximal RCA"],
        ]
    )
    story.append(t1)
    story.append(Spacer(1, 4 * mm))

    # Table 2: AV blocks
    story.append(Paragraph("AV Block Differentiation", S['normal_head']))
    t2 = comparison_table(
        headers=["Block Type", "PR Interval", "Dropped QRS?", "Location", "Prognosis"],
        rows=[
            ["1st Degree", "Fixed, > 200 ms", "Never", "AV node", "Benign"],
            ["2nd Degree - Mobitz I", "Progressively lengthens", "Yes (after longest PR)", "AV node", "Usually benign"],
            ["2nd Degree - Mobitz II", "Fixed, constant", "Yes (sudden, no warning)", "His/Bundle branch", "Dangerous - pace"],
            ["3rd Degree (Complete)", "No relationship (AV dissociation)", "Essentially all", "Anywhere", "Emergency - pace"],
        ]
    )
    story.append(t2)
    story.append(Spacer(1, 4 * mm))

    # Table 3: Pericarditis vs STEMI
    story.append(Paragraph("Pericarditis vs STEMI - Key Differentiators", S['normal_head']))
    t3 = comparison_table(
        headers=["Feature", "Acute Pericarditis", "STEMI"],
        rows=[
            ["ST elevation shape", "Concave/saddle-shaped (upward concave)", "Convex/tombstone (upward dome)"],
            ["Distribution", "Diffuse (almost ALL leads)", "Regional/territorial (contiguous leads)"],
            ["Reciprocal ST depression", "ABSENT (only aVR/V1 show depression)", "PRESENT in opposite territory"],
            ["PR changes", "PR DEPRESSION (pathognomonic) + PR elevation in aVR", "None"],
            ["Q waves", "Absent", "Develop (mark necrosis)"],
            ["Evolution", "4 staged over days-weeks", "Hours-to-days"],
        ]
    )
    story.append(t3)
    story.append(Spacer(1, 4 * mm))

    # Table 4: Wide-complex tachycardia
    story.append(Paragraph("Wide-Complex Tachycardia: VT vs SVT with Aberrancy", S['normal_head']))
    t4 = comparison_table(
        headers=["Feature", "Favours VT", "Favours SVT + Aberrancy"],
        rows=[
            ["AV dissociation", "YES - pathognomonic for VT", "Absent"],
            ["Fusion/capture beats", "YES - confirm VT", "Absent"],
            ["QRS concordance (V1-V6)", "All positive or all negative = VT", "Mixed polarity"],
            ["QRS morphology", "Unusual/bizarre (does not fit RBBB or LBBB)", "Typical RBBB or LBBB pattern"],
            ["History", "Structural heart disease, prior MI, cardiomyopathy", "Young patient, prior SVT episodes"],
            ["Default rule", "ALWAYS assume VT first!", "Only after VT excluded"],
        ]
    )
    story.append(t4)
    story.append(Spacer(1, 4 * mm))

    # Table 5: Electrolytes and QT
    story.append(Paragraph("Electrolyte Effects on ECG", S['normal_head']))
    t5 = comparison_table(
        headers=["Electrolyte", "QT Effect", "T Wave", "P Wave/QRS", "Key Sign"],
        rows=[
            ["Hyperkalemia (mild)", "Short/normal", "Peaked, tented, narrow, symmetric", "Normal", "Tent-shaped T"],
            ["Hyperkalemia (severe)", "QRS widens/absorbs QT", "Disappears into QRS", "P flattens, disappears; QRS widens", "Sine wave pattern"],
            ["Hypokalemia", "Prolonged (QU)", "Flat/inverted", "Normal", "Prominent U wave > T wave"],
            ["Hypercalcemia", "SHORTENED", "Normal or early takeoff", "Normal", "Short QTc < 360 ms"],
            ["Hypocalcemia", "PROLONGED (ST lengthened)", "Normal shape, just delayed onset", "Normal", "Long QTc, normal T shape"],
            ["Hypomagnesemia", "Prolonged", "Flat, may invert", "Normal", "Predisposes to TdP like hypoK+"],
        ]
    )
    story.append(t5)

    # ── LIFE-THREATENING DIAGNOSES PAGE ──────────────────────────────────────
    story.append(PageBreak())
    story.append(section_banner(
        "THE 5 IMMEDIATELY LIFE-THREATENING ECG DIAGNOSES",
        color=C_DARK_RED
    ))
    story.append(Spacer(1, 3 * mm))

    life_data = [
        [
            Paragraph("<b>#</b>", S['table_head']),
            Paragraph("<b>Diagnosis</b>", S['table_head']),
            Paragraph("<b>ECG Key Finding</b>", S['table_head']),
            Paragraph("<b>Immediate Action</b>", S['table_head']),
        ],
        ["1", "STEMI",
         "Regional convex ST elevation in contiguous leads + reciprocal changes",
         "Activate cath lab NOW. Aspirin + heparin + P2Y12 inhibitor. PCI within 90 min."],
        ["2", "Ventricular Fibrillation",
         "Chaotic irregular undulations; no recognisable QRS/P/T",
         "CPR + immediate unsynchronised DEFIBRILLATION 200J biphasic. Adrenaline 1mg IV."],
        ["3", "Ventricular Tachycardia (haemodynamically unstable)",
         "Wide QRS > 120 ms tachycardia; AV dissociation; fusion/capture beats",
         "Synchronised DC cardioversion. If pulseless: defibrillate. Amiodarone 300mg IV."],
        ["4", "Complete Heart Block",
         "AV dissociation (P rate > QRS rate); wide slow escape rhythm",
         "Atropine 0.5-1mg IV (if narrow QRS escape). Transcutaneous/transvenous pacing urgently."],
        ["5", "Severe Hyperkalemia (> 7.5 mEq/L)",
         "Wide QRS + absent P waves + sine wave pattern",
         "IV Calcium gluconate 10 mL 10% IMMEDIATELY. Insulin-dextrose. Bicarbonate. Dialysis."],
    ]

    life_t = Table(life_data,
                   colWidths=[DOC_W * 0.04, DOC_W * 0.15, DOC_W * 0.40, DOC_W * 0.41],
                   repeatRows=1)
    life_style = [
        ('BACKGROUND', (0, 0), (-1, 0), C_DARK_RED),
        ('TEXTCOLOR', (0, 0), (-1, 0), white),
        ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
        ('FONTSIZE', (0, 0), (-1, 0), 8),
        ('FONTSIZE', (0, 1), (-1, -1), 7.5),
        ('ALIGN', (0, 0), (0, -1), 'CENTER'),
        ('VALIGN', (0, 0), (-1, -1), 'TOP'),
        ('TOPPADDING', (0, 0), (-1, -1), 5),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 5),
        ('LEFTPADDING', (0, 0), (-1, -1), 5),
        ('RIGHTPADDING', (0, 0), (-1, -1), 5),
        ('GRID', (0, 0), (-1, -1), 0.5, C_GREY_MID),
        ('BACKGROUND', (0, 1), (-1, 1), HexColor("#FDEDEC")),
        ('BACKGROUND', (0, 2), (-1, 2), HexColor("#FEF9E7")),
        ('BACKGROUND', (0, 3), (-1, 3), HexColor("#FDEDEC")),
        ('BACKGROUND', (0, 4), (-1, 4), HexColor("#FEF9E7")),
        ('BACKGROUND', (0, 5), (-1, 5), HexColor("#FDEDEC")),
        ('FONTNAME', (0, 1), (-1, -1), 'Helvetica'),
        ('FONTNAME', (1, 1), (1, -1), 'Helvetica-Bold'),
        ('TEXTCOLOR', (1, 1), (1, -1), C_DARK_RED),
    ]
    life_t.setStyle(TableStyle(life_style))
    story.append(life_t)

    story.append(Spacer(1, 5 * mm))
    story.append(section_banner("SYSTEMATIC ECG READING APPROACH (Harrison's 22E - 14 Parameters)", color=C_BLUE_DARK))
    story.append(Spacer(1, 3 * mm))

    steps = [
        ("1", "Calibration & Technical Quality", "Confirm 25 mm/sec speed, 10 mm/mV gain. Check lead placement. Look for artefacts."),
        ("2", "Rhythm", "Regular or irregular? Any pattern to irregularity? Identify all wave types."),
        ("3", "Heart Rate", "300 / large boxes between RRs (regular). Or count QRS in 10 sec x 6 (irregular)."),
        ("4", "PR Interval / AV Conduction", "120-200 ms. Fixed? Lengthening? Every P followed by QRS?"),
        ("5", "QRS Duration", "< 120 ms = narrow. >= 120 ms = wide (BBB, VT, paced, hyperK+, toxic)."),
        ("6", "QT / QTc", "QTc = QT / sqrt(RR in seconds). Men < 450 ms; Women < 460 ms."),
        ("7", "Mean QRS Axis", "Check leads I and aVF: +/+ = normal; +/- = LAD; -/+ = RAD; -/- = extreme."),
        ("8", "P Wave Morphology", "Upright I, II, aVF. Peaked? Broad/notched? Biphasic V1?"),
        ("9", "QRS Voltages", "LVH criteria? Low voltage (< 5 mm limb, < 10 mm precordial)?"),
        ("10", "R-Wave Progression", "R grows from V1 to V5. Transition at V3-V4. Absent = anterior pathology."),
        ("11", "Abnormal Q Waves", "Width >= 40 ms OR depth >= 25% R wave height = pathological."),
        ("12", "ST Segments", "Elevation? Depression? Shape? Regional or diffuse? Measure at J-point."),
        ("13", "T Waves", "Inverted (ischaemia, strain, BBB)? Peaked (hyperK+)? Bifid (LQT2)?"),
        ("14", "U Waves", "Prominent U > T wave = hypoK+. Inverted U wave = ischaemia."),
    ]

    step_data = [[
        Paragraph(f"<b>{s}</b>", ParagraphStyle('sn', fontName='Helvetica-Bold', fontSize=8, textColor=white, alignment=TA_CENTER)),
        Paragraph(f"<b>{n}</b>", ParagraphStyle('sc', fontName='Helvetica-Bold', fontSize=7.5, textColor=C_BLUE_DARK)),
        Paragraph(desc, S['table_cell'])
    ] for s, n, desc in steps]

    # Add header
    step_data.insert(0, [
        Paragraph("<b>#</b>", S['table_head']),
        Paragraph("<b>Parameter</b>", S['table_head']),
        Paragraph("<b>What to Look For</b>", S['table_head']),
    ])

    step_t = Table(step_data,
                   colWidths=[DOC_W * 0.05, DOC_W * 0.25, DOC_W * 0.70],
                   repeatRows=1)
    step_t.setStyle(TableStyle([
        ('BACKGROUND', (0, 0), (-1, 0), C_BLUE_DARK),
        ('TEXTCOLOR', (0, 0), (-1, 0), white),
        ('FONTNAME', (0, 0), (-1, 0), 'Helvetica-Bold'),
        ('FONTSIZE', (0, 0), (-1, 0), 8),
        ('FONTSIZE', (0, 1), (-1, -1), 7.5),
        ('BACKGROUND', (0, 1), (0, -1), C_BLUE),
        ('TEXTCOLOR', (0, 1), (0, -1), white),
        ('ALIGN', (0, 0), (0, -1), 'CENTER'),
        ('VALIGN', (0, 0), (-1, -1), 'MIDDLE'),
        ('TOPPADDING', (0, 0), (-1, -1), 4),
        ('BOTTOMPADDING', (0, 0), (-1, -1), 4),
        ('LEFTPADDING', (0, 0), (-1, -1), 4),
        ('RIGHTPADDING', (0, 0), (-1, -1), 4),
        ('ROWBACKGROUNDS', (1, 1), (-1, -1), [white, C_GREY_LIGHT]),
        ('GRID', (0, 0), (-1, -1), 0.3, C_GREY_MID),
    ]))
    story.append(step_t)

    # ── BUILD ─────────────────────────────────────────────────────────────────
    doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
    print(f"PDF saved to: {OUTPUT}")
    return OUTPUT


if __name__ == "__main__":
    build_pdf()
Running Command

cd /home/daytona/workspace/ecg-reference && python3 build_ecg_reference.py 2>&1

ReportLab only allows one <bullet> per paragraph. I'll fix the criteria rendering to use Unicode bullets instead.
Editing File

~/ecg-reference/build_ecg_reference.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ecg-reference/build_ecg_reference.py'
Editing File

~/ecg-reference/build_ecg_reference.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ecg-reference/build_ecg_reference.py'
Also fix the &#9733; star in the cover and &amp; issues:
Running Command

cd /home/daytona/workspace/ecg-reference && python3 build_ecg_reference.py 2>&1

PDF generated successfully. Let me verify the file size and page count:
Running Command

ls -lh /home/daytona/workspace/ecg-reference/ECG_Reference_Card.pdf && python3 -c " from pypdf import PdfReader r = PdfReader('/home/daytona/workspace/ecg-reference/ECG_Reference_Card.pdf') print(f'Pages: {len(r.pages)}') for i, p in enumerate(r.pages): print(f' Page {i+1}: {len(p.extract_text())} chars') "

9 pages, all populated. Your PDF reference card is ready:

✅ ECG Reference Card - Generated

ECG Reference Card

PDF Document · PDF


What's inside (9 pages, A4):

PageContent
1 - CoverTitle, colour-coded legend, Normal ECG Values quick box (heart rate, PR, QRS, QTc, axis, paper calibration)
2 - Sinus + AtrialCards 01-06: Normal sinus rhythm, sinus brady/tachy, sinus arrhythmia, P-pulmonale, P-mitrale
3 - Hypertrophy + AV BlocksCards 07-12: LVH, RVH, all 4 degrees of AV block (1st, Mobitz I, Mobitz II, complete)
4 - Bundle Branch BlocksCards 13-16: RBBB, LBBB, LAFB, LPFB with criteria
5 - Ischemia Part 1Cards 17-21: Hyperacute T, Anterior STEMI, Inferior STEMI, Lateral STEMI, Posterior STEMI
6 - Ischemia Part 2 + ArrhythmiasCards 22-28: RV infarct, NSTEMI, Wellens, De Winter; Atrial arrhythmias (APCs, flutter, AF)
7 - Ventricular + SVT + ElectrolytesCards 29-39: PVCs, VT, VF, TdP, AVNRT, WPW, hyperkalemia, hypokalemia, Ca disorders
8 - Special SyndromesCards 40-48: Pericarditis, tamponade, PE, Brugada, Long QT, hypothermia, SAH, digoxin, TCA toxicity
9 - Critical Tables + Systematic ApproachSTEMI localisation table; AV block comparison; Pericarditis vs STEMI; VT vs SVT; Electrolyte effects; Top 5 life-threatening diagnoses; Harrison's 14-parameter systematic reading guide
Each condition card uses colour coding by category and includes bullet-point diagnostic criteria + a gold clinical pearl in red italic text.
This is a shared conversation. Sign in to Orris to start your own chat.