Need different types of ECG patterns with interpretation in medicine point of view for learning as a final year mbbs in India make as a PDF
ECG patterns normal sinus rhythm atrial fibrillation ventricular tachycardia

A composite clinical diagnostic image featuring ten labeled electrocardiogram (ECG) strips (A–J) demonstrating various cardiac rhythms and conduction patterns for educational assessment. Panel A shows a standard sinus rhythm with clearly defined P waves, QRS complexes, and T waves. Panel B displays a chaotic, high-frequency, disorganized waveform characteristic of ventricular fibrillation. Panel C exhibits sinus rhythm with occasional premature beats. Panel D and E illustrate bradycardic rhythms with wide QRS complexes and irregular R-R intervals, suggestive of bundle branch blocks or junctional rhythms. Panel F shows a rapid, regular wide-complex tachycardia indicative of ventricular tachycardia. Panel G demonstrates an irregular rhythm with saw-tooth baseline patterns typical of atrial flutter with variable conduction. Panels H, I, and J show variations in ST-segment elevation, pathological Q waves, and narrow-complex tachyarrhythmias. This visual comparison serves as a diagnostic tool for identifying life-threatening arrhythmias, myocardial infarction, and heart blocks in emergency medical services training.

This diagnostic image is a standard 12-lead electrocardiogram (ECG) displayed on a red grid background. The tracing demonstrates a tachyarrhythmia characterized by a rapid ventricular response rate of approximately 160-165 beats per minute. Key diagnostic features include the absence of discernible P waves and an 'irregularly irregular' R-R interval, hallmark findings of atrial fibrillation. The QRS complexes are narrow (short duration), suggesting a supraventricular origin of the rhythm. Leads V1 through V3 show prominent S waves, while leads V5 and V6 demonstrate tall R waves, representing normal precordial progression but with high voltage. Minimal ST-segment fluctuations and T-wave abnormalities are present, likely secondary to the rapid rate. This ECG illustrates a common cardiac manifestation of severe thyrotoxicosis (hyperthyroidism), where high metabolic states trigger atrial fibrillation and sinus tachycardia. It serves as a classic educational example of tachyarrhythmia management in the context of endocrine emergencies.

This diagnostic image consists of five sequential electrocardiogram (ECG) rhythm strips (Lead II) demonstrating perioperative rhythm changes and life-threatening arrhythmias. Panel A shows atrial fibrillation characterized by an irregular R-R interval and absent P waves (HR 122 bpm, QTc 396 ms). Panel B illustrates a conversion to normal sinus rhythm with visible P waves but significant QT interval prolongation (QTc 546 ms). Panel C depicts the onset of ectopy with multifocal premature ventricular contractions (PVCs) appearing as wide, bizarre QRS complexes. Panel D captures a 15-second episode of Torsades de Pointes (TdP), a polymorphic ventricular tachycardia where the QRS complexes appear to twist around the isoelectric baseline. Panel E shows the resolution of ventricular arrhythmias following pharmacological intervention with isoproterenol, returning to a stable sinus rhythm with a heart rate of 75 bpm. This comparison serves as an educational tool for identifying drug-induced QT prolongation and its progression into TdP during anesthesia induction.

A comparison chart of five electrocardiogram (ECG) waveforms illustrating common cardiac rhythms and arrhythmias. (a) Atrial Premature Complex (APC) shows a standard sinus rhythm interrupted by an early beat with a visible but differently shaped P wave. (b) Atrial Fibrillation (AFib) is characterized by an irregularly irregular R-R interval and an oscillating baseline with absent P waves. (c) Ventricular Premature Complex (VPC) demonstrates a premature, wide, and bizarre QRS complex followed by a compensatory pause. (d) Ventricular Tachycardia (VT) displays a rapid, regular sequence of wide, monomorphic QRS complexes with a saw-tooth appearance and no discernible P waves. (e) Normal Sinus Rhythm (NSR) serves as a baseline, showing regular R-R intervals, consistent P waves, and narrow QRS complexes. The diagnostic images are displayed on a standard red grid for temporal and voltage measurement, utilized for medical education on cardiac electrophysiology and rhythm interpretation.

A comparative clinical diagnostic image featuring three single-lead ECG rhythm strips (A, B, and C) recorded by a wearable patch device, demonstrating different cardiac arrhythmias. Each strip includes automated annotations: 'N' (gray) for normal beats, 'V' (red) for ventricular beats, and 'S' (blue) for supraventricular/atrial events. (A) Displays Atrial Fibrillation, characterized by an irregularly irregular rhythm, absent P waves, and a fluctuating baseline with variable QRS amplitudes. (B) Shows Nonsustained Ventricular Tachycardia (NSVT), evidenced by a sudden burst of rapid, wide QRS complexes (annotated with 'V') transitioning from and back to a normal sinus rhythm. (C) Illustrates Atrial Tachycardia, depicting a rapid, regular narrow-complex tachycardia with a series of blue 'S' annotations indicating a sustained atrial ectopic rhythm before returning to normal beats. The image serves as an educational tool for identifying common arrhythmias and understanding the application of automated rhythm classification in mobile health monitoring.

This diagnostic image displays a 6-lead electrocardiogram (ECG) featuring leads II, V1, V2, V4, V5, and V6, presented on a standard grid with a paper speed of 25 mm/s and voltage of 10 mm/mV. The tracing demonstrates an irregularly irregular rhythm that may be misinterpreted by automated software as atrial fibrillation. However, meticulous visual inspection, particularly in lead V1, reveals the presence of small, low-amplitude P waves preceding most narrow QRS complexes, which confirms an underlying sinus-based rhythm. The irregular interval between beats is attributed to premature supraventricular complexes and premature atrial contractions (PACs). Lead morphology shows a predominant R wave in the lateral precordial leads (V4–V6) and a deeper S wave in the right precordial leads (V1–V2), consistent with normal ventricular depolarization patterns. This ECG is an educational example used to highlight the importance of manual rhythm analysis in distinguishing sinus rhythm with ectopy from atrial fibrillation to avoid inappropriate clinical management such as unnecessary anticoagulation.

This diagnostic image is a standard 12-lead electrocardiogram (ECG) demonstrating focal atrial tachycardia with variable atrioventricular (AV) conduction. The tracing shows a rapid, regular atrial rate characterized by distinctive P-wave morphologies: notably negative P waves in lead V1 and prominent, positive, 'towering' P waves in the inferior leads (II, III, and aVF). This specific P-wave axis suggests an ectopic atrial origin, such as the right atrial appendage. The ventricular response is irregular, appearing as 2:1 and 1:1 conduction patterns at various intervals. The QRS complexes maintain a narrow morphology (normal duration) with preserved R-wave progression across the precordial leads (V1-V6), indicating that ventricular depolarization follows the normal specialized conduction system once activated. No periods of normal sinus rhythm are observed. The tracing is typical for pediatric or adult patients presenting with supraventricular tachycardia-induced cardiomyopathy or persistent palpitations, serving as a key diagnostic tool for identifying the site of origin prior to electrophysiological mapping and ablation.

This diagnostic image is a 12-lead electrocardiogram (ECG) demonstrating a tachycardia-bradycardia event. The tracing begins with an incessant, regular, narrow QRS complex tachycardia at a rate of approximately 140-150 beats/min. No clear P-waves are visible preceding the QRS complexes, which is consistent with the patient's history of persistent atrial fibrillation. Following the rapid rhythm, there is a sudden spontaneous termination leading to a significant ventricular pause (asystolic period) lasting approximately 3.7 seconds before a single escape beat occurs. The morphology of the QRS during the tachycardia is narrow, suggesting a supraventricular origin or an atrioventricular junctional rhythm. This ECG is a classic representation of tachycardia-induced suppression of the conduction system, often seen in the context of sick sinus syndrome or advanced atrioventricular conduction disturbances associated with long-standing atrial fibrillation. It illustrates the clinical phenomenon where a rapid rhythm is followed by prolonged electrical silence, potentially leading to symptoms of palpitations and syncope.

This composite figure presents 12-lead electrocardiograms (ECGs) from members of a family, illustrating various cardiac arrhythmias. Panels A through F display findings from a single patient (proband II:1) with cardiomyopathic changes. Panels A and B show intermittent premature ventricular complexes (PVCs). Panels C and D demonstrate paired PVCs (couplets), while panels E and F capture episodes of non-sustained and sustained ventricular tachycardia (VT), characterized by wide QRS complexes and rapid rates. The background rhythm in these panels shows signs of atrial fibrillation with long RR intervals and low voltage in the limb leads. In contrast, panels G and H represent familial members II:2 and II:3, respectively. Panel G shows a largely normal sinus rhythm with standard R-wave progression in the precordial leads. Panel H shows a regular rhythm with mild T-wave flattening across multiple leads. The figure serves as a clinical comparison between severe arrhythmic manifestations (VT, PVCs) in a proband and the relatively normal ECG findings in first-degree relatives within the context of inherited cardiomyopathy.

A standard 12-lead electrocardiogram (ECG) tracing on pink grid paper depicting atrial fibrillation (AFib) with a rapid ventricular rate (RVR). Key diagnostic features include the total absence of discernible P waves and an 'irregularly irregular' rhythm, characterized by varying R-R intervals between narrow QRS complexes. Fine fibrillatory (f) waves are visible along the baseline, most notably in lead V1. The heart rate is tachycardic, with QRS complexes occurring in rapid succession, particularly prominent in the precordial leads V4 through V6. Morphology of the QRS complexes and T waves shows minor beat-to-beat variability secondary to the irregular rhythm. The tracing serves as a classic clinical example of supraventricular tachyarrhythmia, highlighting the hallmark electrical characteristics used to differentiate AFib from sinus tachycardia or atrial flutter in a cardiovascular or emergency medicine context.

This diagnostic image is a 12-lead electrocardiogram (ECG) displaying a patient in normal sinus rhythm with a heart rate of approximately 110 beats per minute (sinus tachycardia). The tracing demonstrates a clear right axis deviation, characterized by a predominantly negative QRS complex in lead I and a positive QRS complex in leads II, III, and aVF. Notable repolarization abnormalities are present, specifically prominent T-wave inversions in lead III and across the precordial leads V1 through V4. The QRS complexes are relatively narrow with consistent morphology, and R-R intervals remain regular. These visual findings, including the right axis deviation and right-sided precordial T-wave inversions, are clinically significant as they often indicate right ventricular strain or pressure overload. In the provided clinical context of an atrial mass, these features suggest secondary cardiac hemodynamic changes. This ECG serves as an educational example of how systemic or structural heart disease, such as cardiac myxoma, can manifest with specific conduction and repolarization patterns on a surface electrocardiogram.

This diagnostic image displays a three-panel electrocardiogram (ECG) recording from a wearable cardioverter-defibrillator (WCD), capturing a critical cardiac event and its resolution. Panel A illustrates atrial fibrillation characterized by an irregularly irregular rhythm, absent P-waves, and significant ST-segment depression recorded four days prior to the event. Panel B shows a sequence of sustained ventricular tachycardia (VT) featuring wide, rapid QRS complexes, followed by a high-amplitude 150J shock artifact. Post-shock, there is a transient period of electrical inactivity (asystole/suppression) leading into the restoration of a more organized rhythm with visible ventricular ectopic beats. Panel C demonstrates the long-term follow-up seven days post-shock, showing a return to a stable sinus rhythm, though persistent ST-segment depression remains visible. The grids are scaled at 25 mm/s (x-axis) and 1 mV/20 mm (y-axis), providing a temporal and voltage-based progression of life-threatening arrhythmia management and successful defibrillation.
ST elevation myocardial infarction STEMI ECG heart block bundle branch block

This diagnostic image is a 12-lead electrocardiogram (ECG) demonstrating a severe acute ST-segment elevation myocardial infarction (STEMI) pattern. The tracing shows sinus tachycardia with a right bundle branch block (RBBB) morphology. Key pathological features include a prominent 'shark fin' pattern (monophasic QRS-ST-T complex) in the anterior leads V1 through V4, characterized by massive ST-segment elevation that merges directly with the T-wave. Significant ST-segment elevation is also visible in lead aVR and the inferior leads (III and aVF). These findings are highly specific for extensive myocardial ischemia, often associated with proximal left anterior descending (LAD) artery occlusion or multi-vessel disease. The educational focus of this image is the recognition of high-risk ECG signatures, such as the shark fin morphology and aVR elevation, which indicate critical hemodynamic instability and the need for immediate reperfusion therapy. The tracing also displays baseline artifact consistent with patient distress or clinical urgency.

A series of three 12-lead electrocardiograms (ECGs) labeled (a), (b), and (c) demonstrating the progression and resolution of an ST-elevation myocardial infarction (STEMI). Panel (a) shows the baseline ECG with a right bundle branch block (RBBB), characterized by an RSR' pattern in lead V1 and widened QRS complexes. Panel (b) illustrates acute changes with significant ST-segment elevation in the anterior precordial leads (V2–V5) and hyperacute, peaked T waves, indicating an acute anterior wall myocardial infarction, likely due to left anterior descending (LAD) artery occlusion. Panel (c) shows the post-intervention ECG following coronary revascularization, demonstrating the resolution of the ST-segment elevation and a return toward the baseline RBBB morphology. The images provide a comparison of ischemic evolution, highlighting the dynamic nature of ST-T segment changes in clinical cardiology.

Educational infographic and diagnostic ECG traces detailing electrocardiographic criteria for myocardial infarction in the presence of Left Bundle Branch Block (LBBB). Panel A illustrates the Sgarbossa criteria: concordant ST-elevation ≥ 1mm (5 points), concordant ST-depression ≥ 1mm in leads V1-V3 (3 points), and discordant ST-elevation ≥ 5mm (2 points). Panel B displays the Modified Sgarbossa (Smith) criterion, focusing on the ST/S ratio (ST-elevation amplitude relative to S-wave depth). Panel C presents the Cabrera-Friedland criterion on a 12-lead ECG, marked by red arrows indicating a notch ≥ 50ms in the ascending limb of the S-wave in precordial leads V3-V4. Panel D highlights the Chapman-Pearce criterion, with red arrows identifying a notch in the ascending limb of the R-wave in leads I, aVL, and V6. These visual aids serve as diagnostic tools for identifying ST-segment elevation myocardial infarction (STEMI) when traditional ECG interpretation is confounded by baseline conduction abnormalities like LBBB.

A 12-lead electrocardiogram (ECG) recorded on standard grid paper, demonstrating acute diagnostic findings consistent with an ST-elevation myocardial infarction (STEMI). The tracing shows normal sinus rhythm with a physiological heart rate. The primary pathology is significant ST-segment elevation (STE) visible in the precordial leads, most prominently in V2, V3, and V4, measuring approximately 2–3 mm above the isoelectric baseline. These anterior leads also display upright, peaked T waves associated with the acute ST elevation. The QRS complexes maintain relatively normal duration and morphology without evidence of bundle branch blocks. These findings are clinically diagnostic of acute myocardial injury in the territory of the left anterior descending (LAD) coronary artery, often indicating complications such as acute stent thrombosis or new-onset occlusion in the anteroseptal and apical regions. The limb leads (I, II, III, aVR, aVL, aVF) show relatively stable baselines compared to the precordial changes. This ECG serves as a critical educational tool for identifying hyperacute ischemic changes in a post-intervention clinical context.

A 12-lead diagnostic electrocardiogram (ECG) demonstrating signs of an acute ST-segment elevation myocardial infarction (STEMI) involving the inferior wall. The tracing shows marked convex ST-segment elevation in the inferior leads (II, III, and aVF), with the most prominent elevation in lead III. Reciprocal ST-segment depression is clearly visible in the lateral limb leads I and aVL. The precordial leads (V1-V6) show relatively normal R-wave progression and stable ST segments, though lead V2 displays a terminal R' wave indicative of an incomplete right bundle branch block (ICRBBB). Digital metadata indicates a QRS duration of 98 ms, a QTc of 435 ms, and a normal cardiac axis. This tracing is a classic educational example of inferior wall ischemia and injury, often associated with occlusion of the right coronary artery, and highlights the clinical importance of identifying reciprocal changes in the high lateral leads.

This diagnostic image is a 12-lead electrocardiogram (ECG) demonstrating an acute ST-elevation myocardial infarction (STEMI) involving the anterior and lateral walls. The tracing shows sinus rhythm with significant concave-downwards ST-segment elevation (indicated by red arrows) most prominent in leads V2 through V5, and aVL, consistent with an acute occlusion of the left anterior descending (LAD) artery. Notable reciprocal ST-segment depression (indicated by blue arrows) is observed in the inferior leads (II, III, and aVF). The QRS morphology in lead V1 shows a secondary R wave (R') and widened QRS complex, suggestive of an associated right bundle branch block (RBBB). T-waves are hyperacute and upright in the leads with ST elevation, while T-wave inversion is seen in the inferior leads accompanying the reciprocal ST depression. This ECG provides a classic clinical demonstration of extensive anterior wall injury and the importance of recognizing reciprocal changes in identifying focal ischemia.

This diagnostic image is a 12-lead electrocardiogram (ECG) demonstrating an acute inferior ST-elevation myocardial infarction (STEMI). The tracing reveals a wide QRS rhythm with occasional premature ventricular complexes (PVCs). Significant ST-segment elevation is evident in the inferior leads (II, III, and aVF), characterized by a convex upward morphology merging into the T waves. Simultaneously, reciprocal ST-segment depression is visible in the anteroseptal leads (V1-V3) and lead aVL. The QRS complexes exhibit increased duration, suggesting a significant intraventricular conduction delay or bundle branch block pattern. There is poor R-wave progression across the precordial leads, and T-wave abnormalities, including flattening and inversions, are present. This ECG is representative of acute myocardial ischemia following cardiac arrest, localized to the territory of the right coronary artery (RCA) or left circumflex artery, and serves as a critical educational example of primary ST-elevation with corresponding reciprocal changes.

A 12-lead electrocardiogram (ECG) showing signs of an acute anterolateral myocardial infarction in a patient with a baseline right bundle branch block (RBBB). The tracing demonstrates a sinus rhythm with a normal PR interval of approximately 176 ms. Significant findings include ST-segment elevation across the precordial leads V1 through V6, with the most pronounced elevation observed in the lateral leads V4-V6. The QRS complexes in the anterior leads V1-V3 are widened with an RSR' pattern characteristic of RBBB, accompanied by secondary T-wave inversions. Additional ST elevation is noted in leads I and aVL, suggesting lateral wall involvement. The visual findings are consistent with acute transmural ischemia in the distribution of the left anterior descending artery, complicated by significant ventricular dysfunction as indicated by clinical context. This diagnostic image serves as a high-yield educational example of recognizing ST-elevation myocardial infarction (STEMI) in the presence of pre-existing conduction abnormalities.

A standard 12-lead electrocardiogram (ECG) with rhythm strips (V1, II, V5) showing an acute inferior ST-elevation myocardial infarction (STEMI) complicated by high-grade atrioventricular (AV) block. Significant ST-segment elevation is present in the inferior leads (II, III, and aVF), with the magnitude of elevation in lead III exceeding that in lead II, suggesting a right coronary artery (RCA) occlusion. Reciprocal ST-segment depression and T-wave inversion are visible in the high lateral leads (I, aVL) and anterior lead V2. The rhythm analysis reveals complete heart block (third-degree AV block) characterized by atrioventricular dissociation, with an atrial rate significantly faster than the ventricular escape rate (approximately 37 bpm). The QRS complexes are wide, and P waves do not maintain a fixed relationship with the ventricular activity. This visual findings are pathognomonic for an inferior wall MI with ischemia to the AV node, commonly associated with a proximal RCA lesion.

This diagnostic image is a 12-lead electrocardiogram (ECG) demonstrating an acute inferior wall ST-segment elevation myocardial infarction (STEMI). The tracing exhibits significant ST-segment elevation in the inferior leads (II, III, and aVF). Reciprocal ST-segment depression is visible in the high lateral leads (I and aVL). The QRS complexes demonstrate a primarily upright morphology with visible R and S waves, and the overall rhythm is consistent with a sinus origin at a normal rate. These findings are clinically pathognomonic for an acute coronary syndrome, specifically involving the occlusion of the right coronary artery (RCA) or the left circumflex artery. The image serves as a critical educational tool for recognizing primary ischemic changes and reciprocal electrical patterns in cardiology. Additional features include a normal axis and morphological signs that may suggest an incomplete right bundle branch block (IRBBB) as noted in the machine interpretation.
Wolff-Parkinson-White WPW syndrome delta wave ECG hypertrophy pericarditis

This diagnostic image is a 12-lead electrocardiogram (ECG) recorded at standard paper speed and gain, demonstrating the classic findings of Wolff-Parkinson-White (WPW) syndrome. The tracing reveals a sinus rhythm with a pathologically shortened PR interval (less than 120 ms). A defining feature is the presence of delta waves, characterized by a visible slurring or slow upstroke at the beginning of the QRS complex, most notably prominent in leads II, III, aVF, and the precordial leads V2-V6. This pre-excitation pattern results in a secondary widening of the QRS complex. The QRS morphology in lead V1 shows a predominantly positive deflection (R wave), which may suggest the location of the accessory pathway. The ECG illustrates the classic triad of WPW: a short PR interval, a delta wave, and QRS widening, which are critical for the diagnosis of ventricular pre-excitation in a clinical setting involving supraventricular tachycardia.

A 12-lead electrocardiogram (ECG) tracing on standard grid paper demonstrating classic features of Wolff-Parkinson-White (WPW) syndrome. The tracing shows a normal sinus rhythm with three primary diagnostic abnormalities: a shortened PR interval (< 120 ms), a wide QRS complex (> 120 ms), and a slurred initial upstroke of the QRS complex, known as a delta wave. The delta wave is most prominent in the precordial leads V3–V6 and the inferior leads (II, III, and aVF). Lead V1 shows a predominantly negative QRS complex, and a QS complex is visible in lead aVL, suggesting the presence of a left anterolateral accessory pathway (ventricular preexcitation). Additionally, secondary repolarization abnormalities are present, characterized by ST-segment depression and prominent, slightly peaked T waves in the inferior and lateral precordial leads. This image is an educational example of ventricular preexcitation and its secondary effects on cardiac electrical morphology.

This diagnostic image shows a standard 12-lead electrocardiogram (ECG) labeled as Panel A, demonstrating features of manifest ventricular preexcitation characteristic of Wolff-Parkinson-White (WPW) syndrome. Key visual findings include a shortened PR interval and the presence of a delta wave, visible as a slurred upstroke at the beginning of the QRS complex. The delta wave is notably positive in lead I and negative in lead aVF, suggesting a specific bypass tract orientation. In the precordial leads, lead V1 displays a predominant S wave (S > R), which is a characteristic morphology often associated with a right-sided or posteroseptal accessory pathway location. The QRS complex is slightly widened due to the preexcitation. The rhythm is sinus, and the image serves as an educational example for identifying the ECG signature of accessory conduction pathways before therapeutic intervention.

This diagnostic image is a 12-lead electrocardiogram (ECG) demonstrating the classic pre-excitation pattern of Wolff-Parkinson-White (WPW) syndrome associated with a posteroseptal accessory pathway. Key features include a shortened PR interval and the presence of delta waves—slurred upstrokes at the start of the QRS complexes. In the precordial leads, the delta wave is positive in V1, becomes less prominent in V2, and disappears by V3. Crucially, the delta waves are negative in the inferior leads (II, III, and aVF), mimicking a pseudo-infarct Q-wave pattern. This negative polarity in the inferior leads is highly suggestive of an accessory pathway originating in the posteroseptal region, potentially localized near the coronary sinus or middle cardiac vein. The tracing serves as an educational tool for medical students and electrophysiologists to practice electrocardiographic localization of bypass tracts prior to catheter ablation.

This diagnostic image is a 12-lead electrocardiogram (ECG) tracing demonstrating classic features of Wolff-Parkinson-White (WPW) syndrome. The primary finding is ventricular pre-excitation, characterized by a shortened PR interval (typically less than 120 ms) and a slurred upstroke of the QRS complex, known as a delta wave. Red arrows in leads II and III highlight these delta waves, which indicate early ventricular activation via an accessory pathway (Bundle of Kent). The QRS complexes are widened across multiple leads, particularly evident in the precordial leads V1-V3, and the rhythm is regular but appears tachycardic. The morphology of the QRS complexes in the limb leads and the prominent R waves in V1 are suggestive of an anteroseptal accessory pathway. This visual serves as a key educational resource for identifying pre-excitation patterns in cardiology and understanding the electrophysiological manifestations of accessory conduction pathways in pediatric and adult patients presenting with palpitations or syncope.

A standard 12-lead electrocardiogram (ECG) tracing demonstrating classic features of manifest ventricular pre-excitation, characteristic of Wolff-Parkinson-White (WPW) syndrome. The primary diagnostic findings include a shortened PR interval (<120 ms) and a widened QRS complex with a distinctive 'delta wave,' visible as initial slurring or notching of the QRS upstroke. These features are most prominent in the precordial leads (V1-V6) and lateral limb leads. The polarity of the delta waves—specifically the negative delta wave in lead III and a predominantly positive QRS in leads V4-V6—is consistent with a mid-septal accessory pathway location. The rhythm is a regular sinus rhythm, and secondary ST-T wave changes are visible, which are common in pre-excitation due to altered ventricular depolarization. This diagnostic image is essential for medical students and clinicians studying cardiac electrophysiology and the interpretation of tachyarrhythmia substrates.

This diagnostic image is a 12-lead electrocardiogram (ECG) demonstrating ventricular preexcitation characteristic of Wolff-Parkinson-White (WPW) syndrome. The tracing shows a short PR interval and prominent delta waves at the onset of the QRS complexes. Specifically, positive delta waves are visible in the precordial leads (V1 through V6), resulting in a dominant R-wave pattern in V1, which suggests an accessory pathway (AP) located on the left side of the heart. In the inferior leads (II, III, and aVF), the delta waves are negative (downward deflections), resembling pathological Q waves; this 'pseudoinfarction' pattern indicates the vector of initial ventricular activation is moving away from the inferior wall, highly suggestive of a left posteroseptal accessory pathway. The highest negative delta wave amplitudes are seen in leads II and III. This ECG is a classic educational example for identifying and localizing bypass tracts based on delta wave polarity and QRS morphology in patients with symptomatic or asymptomatic preexcitation.

A 12-lead baseline electrocardiogram (ECG) demonstrating classic features of ventricular pre-excitation, characteristic of Wolff-Parkinson-White (WPW) syndrome. The tracing shows a short PR interval and widened QRS complexes across multiple leads. A prominent delta wave (slurring of the initial QRS portion) is visible, most notably in leads I, aVL, and the precordial leads V2-V6. The QRS morphology, specifically the negative delta waves in the inferior leads (II, III, and aVF), suggests a posteroseptal location for the accessory pathway. Secondary repolarization abnormalities are present, including ST-segment depression in the lateral precordial leads (V3-V6), which can occur as a result of altered ventricular activation rather than primary ischemia. The rhythm is sinus, and the overall tracing serves as an educational example of how accessory pathways modify cardiac conduction and QRS morphology.
mkdir -p /tmp/workspace/ecg-pdf && ls /tmp/workspace/
~/ecg-pdf/generate_ecg_pdf.py
"""
ECG Patterns for Final Year MBBS - Comprehensive PDF Generator
Uses ReportLab to create a professional study guide
"""
import urllib.request
import os
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, KeepTogether, HRFlowable, Image as RLImage
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus.flowables import BalancedColumns
from io import BytesIO
# ── Colour palette ──────────────────────────────────────────────────────────
NAVY = colors.HexColor("#1a2a4a")
TEAL = colors.HexColor("#0e7490")
LIGHT_TEAL = colors.HexColor("#e0f2fe")
RED = colors.HexColor("#dc2626")
AMBER = colors.HexColor("#d97706")
GREEN = colors.HexColor("#16a34a")
GREY = colors.HexColor("#f1f5f9")
MID_GREY = colors.HexColor("#94a3b8")
WHITE = colors.white
BLACK = colors.black
# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def make_style(name, parent='Normal', **kw):
s = ParagraphStyle(name, parent=styles[parent], **kw)
return s
cover_title = make_style('CoverTitle', fontSize=32, textColor=WHITE,
alignment=TA_CENTER, leading=40, spaceAfter=6,
fontName='Helvetica-Bold')
cover_sub = make_style('CoverSub', fontSize=16, textColor=LIGHT_TEAL,
alignment=TA_CENTER, leading=22,
fontName='Helvetica')
cover_note = make_style('CoverNote', fontSize=11, textColor=WHITE,
alignment=TA_CENTER, fontName='Helvetica-Oblique')
h1 = make_style('H1', fontSize=18, textColor=WHITE,
fontName='Helvetica-Bold', alignment=TA_LEFT,
leading=24, spaceAfter=4)
h2 = make_style('H2', fontSize=13, textColor=NAVY,
fontName='Helvetica-Bold', leading=18,
spaceBefore=10, spaceAfter=4)
h3 = make_style('H3', fontSize=11, textColor=TEAL,
fontName='Helvetica-Bold', leading=15,
spaceBefore=6, spaceAfter=3)
body = make_style('Body', fontSize=9.5, textColor=BLACK,
fontName='Helvetica', leading=14,
spaceAfter=4, alignment=TA_JUSTIFY)
bullet_style = make_style('Bullet', fontSize=9.5, textColor=BLACK,
fontName='Helvetica', leading=13,
leftIndent=12, spaceAfter=2,
bulletIndent=0)
key_box = make_style('KeyBox', fontSize=9.5, textColor=NAVY,
fontName='Helvetica-Bold', leading=13,
leftIndent=8)
caption = make_style('Caption', fontSize=8, textColor=MID_GREY,
fontName='Helvetica-Oblique',
alignment=TA_CENTER, spaceAfter=6)
mnemonic = make_style('Mnemonic', fontSize=10, textColor=colors.HexColor("#7c3aed"),
fontName='Helvetica-Bold', leading=14,
leftIndent=8, spaceAfter=4)
def bullet(text):
return Paragraph(f"• {text}", bullet_style)
def kv(key, val):
return Paragraph(f"<b>{key}:</b> {val}", body)
# ── Image helper ─────────────────────────────────────────────────────────────
IMG_DIR = "/tmp/workspace/ecg-pdf/imgs"
os.makedirs(IMG_DIR, exist_ok=True)
def fetch_img(url, fname, width=14*cm, height=6*cm):
"""Download image and return ReportLab Image flowable, or None on failure."""
path = os.path.join(IMG_DIR, fname)
if not os.path.exists(path):
try:
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
with urllib.request.urlopen(req, timeout=15) as r:
data = r.read()
with open(path, 'wb') as f:
f.write(data)
except Exception as e:
print(f" [WARN] Could not fetch {fname}: {e}")
return None
try:
img = RLImage(path, width=width, height=height)
return img
except Exception as e:
print(f" [WARN] Could not load {fname}: {e}")
return None
# ── Section header band ───────────────────────────────────────────────────────
def section_header(title, color=NAVY):
data = [[Paragraph(title, h1)]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 12),
('RIGHTPADDING', (0,0), (-1,-1), 12),
('ROUNDEDCORNERS', [6]),
]))
return t
def info_box(title, items, bg=LIGHT_TEAL, border_color=TEAL):
content = [Paragraph(title, h3)]
for item in items:
content.append(Paragraph(f"• {item}", bullet_style))
data = [[content]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), bg),
('BOX', (0,0), (-1,-1), 1.5, border_color),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
]))
return t
def red_flag_box(items):
content = [Paragraph("🚨 Red Flags / Exam Points", make_style('rf_h', fontSize=10,
textColor=RED, fontName='Helvetica-Bold', leading=14))]
for item in items:
content.append(Paragraph(f"⚠ {item}", make_style('rf_b', fontSize=9,
textColor=colors.HexColor("#7f1d1d"), fontName='Helvetica', leading=13,
leftIndent=8)))
data = [[content]]
t = Table(data, colWidths=[17*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#fef2f2")),
('BOX', (0,0), (-1,-1), 1.5, RED),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
]))
return t
# ────────────────────────────────────────────────────────────────────────────
# ECG DATA
# ────────────────────────────────────────────────────────────────────────────
ECG_DATA = [
{
"number": "01",
"title": "Normal Sinus Rhythm",
"color": GREEN,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_32fdae200aa9c5c21a5afd9ded4fe08bfc856b8b617b75198eeb7e81aa4c78b3.jpg",
"img_fname": "nsr.jpg",
"overview": "Normal Sinus Rhythm (NSR) is the reference standard for all ECG interpretation. The SA node initiates every impulse at 60-100 bpm with organised spread through the conduction system.",
"criteria": [
"Rate: 60-100 bpm",
"Rhythm: Regular (R-R intervals constant)",
"P wave: Upright in I, II, aVF; present before every QRS",
"PR interval: 0.12-0.20 sec (3-5 small squares)",
"QRS duration: < 0.12 sec (< 3 small squares)",
"QT interval: < 0.44 sec (corrected)",
"T wave: Upright in most leads; inverted in aVR",
],
"interpretation": "All intervals within normal limits. Every P wave is followed by a QRS. Isoelectric baseline between complexes.",
"clinical": "Baseline for comparison. Any deviation from NSR criteria indicates a pathological rhythm.",
"mnemonics": "STRIPE: Sinus origin, T wave normal, Rate 60-100, Intervals normal, P before every QRS, Every beat regular",
"exam_points": [
"NSR does NOT mean the heart is normal - structural disease can coexist",
"Paper speed 25 mm/s: 1 big square = 0.2 sec; 1 small square = 0.04 sec",
"Rate formula: 300 / number of big squares between R-R peaks",
],
},
{
"number": "02",
"title": "Atrial Fibrillation (AF)",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_bfe46805b92ff7fbef3f1556bd8b9367cac59bacb1b1d8c9c7b26463dc71fe79.jpg",
"img_fname": "af.jpg",
"overview": "AF is the most common sustained cardiac arrhythmia. Chaotic atrial electrical activity (>350/min) results in absent organised P waves and an irregularly irregular ventricular response.",
"criteria": [
"No distinct P waves - replaced by fibrillatory (f) waves",
"Irregularly irregular R-R intervals (hallmark)",
"Ventricular rate variable (uncontrolled: >100; controlled: 60-100; bradycardic: <60)",
"QRS usually narrow (<0.12 sec) unless aberrant conduction/BBB",
"Fibrillatory baseline best seen in V1, II",
],
"interpretation": "Absent P waves + irregularly irregular rhythm = AF until proven otherwise.",
"clinical": "Causes: PIRATES (Pulmonary embolism, Ischaemia, Rheumatic heart disease/Atrial disease, Anaemia/Alcohol, Thyrotoxicosis, Endocarditis/Electrolytes, Surgery/Sepsis). Risk: stroke (CHA2DS2-VASc score). Rx: Rate control (beta-blockers, digoxin) or rhythm control + anticoagulation.",
"mnemonics": "AF = Absent P + Fibrillatory baseline + Grossly irregular",
"exam_points": [
"Most common sustained arrhythmia worldwide",
"AF + rapid ventricular response in hyperthyroidism is a classic exam vignette",
"AF with wide QRS - think WPW or aberrant conduction (do NOT give AV nodal blockers in WPW-AF)",
"CHA2DS2-VASc: score ≥2 in males, ≥3 in females = anticoagulate",
],
},
{
"number": "03",
"title": "Atrial Flutter",
"color": colors.HexColor("#7c3aed"),
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_44e9177aec15cd67fb59f52a15e2f61160ece6aa32e04f95863439a2c1567e1a.jpg",
"img_fname": "aflutter.jpg",
"overview": "Organised macro-reentrant circuit (typically right atrium) at ~300 bpm producing the classic saw-tooth flutter waves. Usually conducts 2:1, 3:1 or 4:1 to ventricles.",
"criteria": [
"Flutter (F) waves: saw-tooth pattern, rate ~300/min",
"Best seen in inferior leads (II, III, aVF) and V1",
"Regular or regularly irregular ventricular response",
"Most common: 2:1 block → ventricular rate ~150 bpm",
"No isoelectric baseline between flutter waves",
"QRS usually narrow",
],
"interpretation": "Ventricular rate of ~150 bpm with regular rhythm = always suspect 2:1 atrial flutter. Use carotid sinus massage or adenosine to unmask flutter waves.",
"clinical": "Causes similar to AF. Rx: Same principles - rate/rhythm control + anticoagulation. Cavotricuspid isthmus ablation curative in typical flutter.",
"mnemonics": "150 bpm Regular Tachycardia = Flutter until proven otherwise",
"exam_points": [
"Atrial flutter rate ~300/min; ventricular ~150 (2:1) or ~100 (3:1) or ~75 (4:1)",
"Saw-tooth pattern in inferior leads is pathognomonic",
"AV nodal blockers slow ventricular rate but won't terminate flutter",
"Slowing flutter with drugs can paradoxically increase ventricular rate (4:1→2:1)",
],
},
{
"number": "04",
"title": "Supraventricular Tachycardia (SVT)",
"color": TEAL,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_a94ca83b5d7b4182413ee4ea8696e9c76e7c8f7c69084e3597d77adced393852.jpg",
"img_fname": "svt.jpg",
"overview": "SVT (AVNRT/AVRT) is a rapid narrow-complex tachycardia arising above the bundle of His. AVNRT is most common; re-entrant circuit within AV node.",
"criteria": [
"Rate: 150-250 bpm",
"Regular rhythm",
"Narrow QRS (<0.12 sec) in most cases",
"P waves hidden within or just after QRS (retrograde/pseudo-S in II or pseudo-R' in V1)",
"Abrupt onset and termination",
],
"interpretation": "Regular narrow-complex tachycardia 150-250 bpm without visible P waves before QRS. Look for RP' relationship.",
"clinical": "Vagal manoeuvres (Valsalva, carotid sinus massage) first. Adenosine 6mg IV (bolus) is drug of choice. Verapamil if adenosine fails. DC cardioversion if haemodynamically unstable.",
"mnemonics": "PSVT: P hidden, Sudden onset, Very fast, Terminates with adenosine",
"exam_points": [
"Adenosine half-life ~10 seconds - must be given as rapid IV bolus",
"AVNRT: pseudo-R' in V1 and pseudo-S in inferior leads",
"AVRT (orthodromic): narrow QRS + retrograde P after QRS (RP' < PR)",
"Do NOT give verapamil + beta-blocker together (complete heart block risk)",
"WPW-SVT: adenosine safe; WPW-AF: adenosine/verapamil CONTRAINDICATED",
],
},
{
"number": "05",
"title": "Ventricular Tachycardia (VT)",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_32fdae200aa9c5c21a5afd9ded4fe08bfc856b8b617b75198eeb7e81aa4c78b3.jpg",
"img_fname": "vt.jpg",
"overview": "VT is a potentially life-threatening wide-complex tachycardia (>3 beats) originating in the ventricular myocardium. Monomorphic VT has uniform QRS morphology; polymorphic VT (including Torsades) is variable.",
"criteria": [
"Rate: 100-250 bpm",
"Wide QRS: ≥0.12 sec (usually >0.14 sec)",
"Regular or slightly irregular rhythm",
"AV dissociation (P waves independent of QRS) - diagnostic when seen",
"Fusion beats and capture beats (pathognomonic)",
"Concordance: all precordial QRS same direction",
"Brugada criteria / Vereckei algorithm for WCT differentiation",
],
"interpretation": "Wide complex tachycardia = VT until proven otherwise (80% of wide complex tachycardias are VT).",
"clinical": "Haemodynamically unstable: immediate DC cardioversion. Stable: Amiodarone 300mg IV. Underlying causes: ischaemia, cardiomyopathy, electrolyte imbalance. ICD for secondary prevention.",
"mnemonics": "VT CLUES: Very wide (>0.14s), Taller in V1 (RBBB-like), Concordance precordial, Left axis deviation, Unmarked P waves, Extreme axis, Slower response to adenosine",
"exam_points": [
"Rule: All wide-complex tachycardias are VT until proven otherwise",
"Cannon A waves in JVP = AV dissociation = VT",
"Torsades de Pointes: QRS twisting around isoelectric line; cause: QT prolongation",
"QT-prolonging drugs: sotalol, amiodarone, erythromycin, haloperidol, cisapride",
"VT with LBBB morphology + inferior axis = RVOT tachycardia (idiopathic, benign)",
],
},
{
"number": "06",
"title": "Ventricular Fibrillation (VF)",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_44e9177aec15cd67fb59f52a15e2f61160ece6aa32e04f95863439a2c1567e1a.jpg",
"img_fname": "vf.jpg",
"overview": "VF is a chaotic, disorganised ventricular electrical activity resulting in no effective cardiac output. It is the most common cause of sudden cardiac death and a shockable rhythm in ACLS.",
"criteria": [
"Chaotic, irregular waveforms with no identifiable P, QRS, or T waves",
"Variable amplitude and frequency",
"No organised rhythm whatsoever",
"Coarse VF: high amplitude (early/reversible)",
"Fine VF: low amplitude (late, prolonged ischaemia)",
],
"interpretation": "Disorganised electrical chaos with no recognisable complexes = VF. Immediately life-threatening.",
"clinical": "BLS + ACLS immediately. Defibrillation (200J biphasic) as soon as possible. Adrenaline 1mg IV every 3-5 min (after 3rd shock). Amiodarone 300mg after 3rd shock. Treat reversible causes: 4H4T.",
"mnemonics": "4H4T: Hypoxia, Hypovolaemia, Hypo/Hyperkalaemia, Hypothermia | Tension pneumothorax, Tamponade, Toxins, Thrombosis (PE/MI)",
"exam_points": [
"VF is a SHOCKABLE rhythm (with pulseless VT)",
"Non-shockable rhythms: PEA and Asystole",
"Defibrillation delivers unsynchronised shock (synchronised = cardioversion)",
"CPR ratio: 30 compressions : 2 breaths",
"After ROSC: targeted temperature management 32-36°C for 24 hours",
],
},
{
"number": "07",
"title": "First-Degree AV Block",
"color": AMBER,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_32fdae200aa9c5c21a5afd9ded4fe08bfc856b8b617b75198eeb7e81aa4c78b3.jpg",
"img_fname": "1avb.jpg",
"overview": "Prolonged but constant conduction through the AV node. Every impulse eventually conducts to the ventricles, just with delay.",
"criteria": [
"PR interval > 0.20 sec (>1 big square) - constant",
"Every P wave followed by QRS (1:1 conduction)",
"Normal P wave morphology and axis",
"Normal QRS (unless associated BBB)",
"Regular rhythm",
],
"interpretation": "Prolonged fixed PR interval with 1:1 P:QRS relationship.",
"clinical": "Usually benign, no treatment needed. Causes: inferior MI, digoxin toxicity, electrolyte imbalance, myocarditis. Monitor for progression to higher-degree block.",
"mnemonics": "1st degree = PR prolonged (>0.20s) + ALL Ps conduct",
"exam_points": [
"Commonest cause in young athletes: increased vagal tone (benign)",
"Digoxin toxicity classically causes 1st degree AV block progressing to 2nd/3rd",
"Does NOT require pacing",
"Associated with inferior wall MI (RCA supplies AV node)",
],
},
{
"number": "08",
"title": "Second-Degree AV Block (Mobitz I - Wenckebach)",
"color": AMBER,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c8af7235147e5e8edc6e4e669c141a282c9d25ee85c10bb09a0316014979a678.jpg",
"img_fname": "mobitz1.jpg",
"overview": "Progressive AV nodal fatigue causing incrementally lengthening PR interval until a P wave fails to conduct (dropped QRS). The cycle then repeats.",
"criteria": [
"Progressively increasing PR interval",
"Until one P wave is NOT followed by a QRS (dropped beat)",
"RR intervals progressively shorten before the drop",
"The PR interval after the dropped beat is shortest",
"Grouped beating pattern on rhythm strip",
],
"interpretation": "Grouped beatings with progressive PR lengthening and then a dropped QRS = Wenckebach.",
"clinical": "Usually due to AV nodal ischaemia (inferior MI, RCA). Generally benign; rarely requires pacing. Atropine if symptomatic.",
"mnemonics": "WENCKEBACH: Widening PR, Eventual dropped beat, Next PR is shortest, Cyclic pattern, K+ disturbance/Ischaemia, etc.",
"exam_points": [
"Most common type of Mobitz II in clinical practice",
"Block is IN the AV node (above bundle of His)",
"Prognosis generally good - rarely progresses to complete block",
"Treat underlying cause; pacing rarely needed",
],
},
{
"number": "09",
"title": "Second-Degree AV Block (Mobitz II)",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c8af7235147e5e8edc6e4e669c141a282c9d25ee85c10bb09a0316014979a678.jpg",
"img_fname": "mobitz2.jpg",
"overview": "Fixed PR interval with sudden unexpected non-conduction of a P wave. Block is below the AV node (bundle of His / bundle branches). More dangerous than Mobitz I.",
"criteria": [
"Constant PR interval (normal or prolonged)",
"Sudden non-conducted P wave (dropped QRS) without preceding PR prolongation",
"2:1, 3:1 or variable conduction ratios",
"Wide QRS often present (due to infra-Hisian block)",
],
"interpretation": "Constant PR interval with sudden dropped QRS = Mobitz II. More ominous than Wenckebach.",
"clinical": "High risk of progression to complete heart block. Permanent pacemaker indicated. Causes: anterior MI (LAD territory), degenerative conduction disease (Lenegre disease), cardiac surgery.",
"mnemonics": "Mobitz II = More dangerous, Marches (constant PR), Missing QRS suddenly",
"exam_points": [
"Mobitz II requires PERMANENT pacemaker (unlike Mobitz I)",
"2:1 block: cannot differentiate Mobitz I vs II from ECG alone (need longer strip)",
"Associated with anterior MI (LAD occlusion damages His-Purkinje system)",
"Wide QRS with Mobitz II = very high-risk: expect progression to complete block",
],
},
{
"number": "10",
"title": "Third-Degree (Complete) AV Block",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_c8af7235147e5e8edc6e4e669c141a282c9d25ee85c10bb09a0316014979a678.jpg",
"img_fname": "chb.jpg",
"overview": "Complete failure of AV conduction. Atria and ventricles beat independently (AV dissociation). Ventricular rate maintained by escape rhythm - junctional (narrow, faster) or ventricular (wide, slower).",
"criteria": [
"P waves and QRS complexes completely independent (AV dissociation)",
"Atrial rate > ventricular rate",
"Regular PP intervals; regular RR intervals (but different rates)",
"Junctional escape: QRS narrow, rate 40-60 bpm (AV nodal block)",
"Ventricular escape: QRS wide, rate 20-40 bpm (infra-Hisian block)",
],
"interpretation": "PP and RR intervals both regular but bear NO relationship to each other. More P waves than QRS complexes.",
"clinical": "Emergency: temporary pacing if symptomatic (syncope, haemodynamic compromise). Then permanent pacemaker. Causes: inferior MI (temporary), anterior MI (permanent), digoxin toxicity, Lyme disease, congenital.",
"mnemonics": "CHB = Complete dissociation: P and QRS mind their own business",
"exam_points": [
"Complete AV block with inferior MI = often reversible (nodal, responds to atropine)",
"Complete AV block with anterior MI = infra-Hisian, wide QRS, needs urgent pacing",
"Cannon A waves in JVP when atria contract against closed tricuspid valve",
"Congenital CHB: associated with maternal anti-Ro/La antibodies (SLE)",
"Stokes-Adams attacks = syncopal episodes due to CHB",
],
},
{
"number": "11",
"title": "Left Bundle Branch Block (LBBB)",
"color": TEAL,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_327576dce927fd64f9aa72d5c765668cbf4cac55ba94831a9e09ef7cd84d7afa.jpg",
"img_fname": "lbbb.jpg",
"overview": "Failure of left bundle branch conduction. Right ventricle activates first via right bundle branch, then slowly activates left ventricle via septum. Results in wide QRS with characteristic morphology.",
"criteria": [
"QRS duration ≥ 0.12 sec (≥ 3 small squares)",
"Broad monophasic R wave in I, aVL, V5, V6 (no septal q waves)",
"Deep S wave or QS pattern in V1 ('W' pattern)",
"Broad R wave in V6 ('M' pattern)",
"Secondary ST-T changes (discordant: ST opposite to QRS direction)",
"Left axis deviation",
],
"interpretation": "WiLLiaM pattern: W in V1, M in V6 = LBBB. William for Left.",
"clinical": "New LBBB = treat as STEMI equivalent (Sgarbossa criteria for MI diagnosis). Causes: IHD, hypertension, cardiomyopathy, aortic stenosis. LBBB + haemodynamic compromise: consider CRT (cardiac resynchronisation therapy).",
"mnemonics": "WiLLiaM: W in V1, M in V6 = LBBB (Left). MaRRoW: M in V1, W in V6 = RBBB (Right)",
"exam_points": [
"New LBBB with chest pain = STEMI equivalent → activate cath lab",
"Sgarbossa criteria: concordant ST elevation ≥1mm (5pts), concordant ST depression V1-V3 ≥1mm (3pts), discordant ST elevation ≥5mm (2pts). Score ≥3 = MI",
"LBBB renders routine ECG interpretation for ischaemia unreliable",
"Most common cause: hypertension and ischaemic heart disease in India",
],
},
{
"number": "12",
"title": "Right Bundle Branch Block (RBBB)",
"color": TEAL,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_9f5a30436758a5c7a4795ed1d235043ce637b4b039f05380025585170f66b145.jpg",
"img_fname": "rbbb.jpg",
"overview": "Failure of right bundle branch conduction. Left ventricle activates normally, then right ventricle activates slowly through myocardium. Results in wide QRS with characteristic rsR' or RSR' in V1.",
"criteria": [
"QRS duration ≥ 0.12 sec",
"RSR' pattern ('rabbit ears') in V1, V2 (M pattern)",
"Broad slurred S wave in I, V5, V6 (W pattern)",
"T wave inversion in V1-V3 (secondary)",
"Right axis deviation (in complete RBBB)",
],
"interpretation": "MaRRoW: M in V1, W in V6 = RBBB (Right). Morrow for Right.",
"clinical": "Isolated RBBB often benign (can be normal variant). New RBBB in anterior MI = poor prognosis. Causes: RV pressure overload (PE, pulmonary hypertension), congenital heart disease (ASD), ischaemia, normal variant.",
"mnemonics": "MaRRoW: M in V1, W in V6 = RBBB. RSR' = Rabbit ears in V1",
"exam_points": [
"RBBB is NOT a contraindication to reading ECG for ischaemia (unlike LBBB)",
"New RBBB after acute MI suggests large anterior MI with poor prognosis",
"RBBB + right axis deviation = bifascicular block (right bundle + left anterior fascicle)",
"Brugada syndrome: RBBB-like pattern + ST elevation V1-V3 (coved type) → risk of sudden death",
"PE: RBBB + S1Q3T3 (McGinn-White sign)",
],
},
{
"number": "13",
"title": "Acute Anterior STEMI",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_68c8ce08b3a29ff7dfcc7757fa8ed4af3d7162bbb164d273745c458c90daeeb9.jpg",
"img_fname": "anterior_stemi.jpg",
"overview": "ST elevation in anterior leads (V1-V4/V5) due to occlusion of left anterior descending (LAD) artery. Largest territory MI with highest mortality.",
"criteria": [
"ST elevation ≥ 2mm in V1-V3 (≥ 2 consecutive precordial leads)",
"Hyperacute T waves (earliest sign - tall, broad, symmetrical)",
"Evolving Q waves (pathological: >0.04 sec wide, >25% of R wave amplitude)",
"Reciprocal ST depression in inferior leads (II, III, aVF)",
"Loss of R wave progression",
],
"interpretation": "ST elevation V1-V4 + reciprocal inferior changes = anterior STEMI (LAD occlusion).",
"clinical": "Primary PCI within 90 minutes (door-to-balloon time). Thrombolysis if PCI unavailable within 120 min. Anti-platelets: aspirin + clopidogrel/ticagrelor. Anticoagulation. Beta-blockers, ACE inhibitors, statins (ABCS).",
"mnemonics": "STEMI ABCS: Aspirin+Anticoagulation, Beta-blocker, Cath lab/Clopidogrel, Statin",
"exam_points": [
"Earliest ECG change in MI: hyperacute (tall, peaked) T waves",
"ECG evolution: Hyperacute T → ST elevation → Q waves → T inversion → Q waves persist",
"Wellens syndrome: Type A (biphasic T V2-V3) or Type B (deep symmetric T V2-V3) = critical LAD stenosis",
"ST elevation in aVR with anterior ST depression = left main/proximal LAD occlusion",
],
},
{
"number": "14",
"title": "Acute Inferior STEMI",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_98481c8dc3d117cb136597f6628e704c89f53899f354ce841b67d7dc784d8f83.jpg",
"img_fname": "inferior_stemi.jpg",
"overview": "ST elevation in inferior leads (II, III, aVF) due to right coronary artery (RCA) or left circumflex (LCx) occlusion. Must always assess for right ventricular MI (posterior leads).",
"criteria": [
"ST elevation ≥ 1mm in ≥ 2 of: II, III, aVF",
"ST elevation greater in III than II suggests RCA occlusion",
"Reciprocal ST depression in I, aVL (lateral leads)",
"Often associated with AV block (RCA supplies AV node in 90%)",
"Consider posterior MI: ST depression V1-V3 + upright T waves",
],
"interpretation": "ST elevation II, III, aVF + reciprocal changes in I and aVL = Inferior STEMI.",
"clinical": "Always do right-sided leads (V4R) for RV infarction. If RV MI: preload dependent - avoid nitrates (cause hypotension), give IV fluids. Inferior MI + CHB = temporary pacing may be needed.",
"mnemonics": "Inferior STEMI = II, III, aVF elevated + I, aVL depressed (reciprocal)",
"exam_points": [
"RV MI: hypotension + clear lung fields + raised JVP after inferior MI - do V4R",
"V4R: ST elevation ≥ 1mm = RV infarction (most sensitive: ST elevation in V4R)",
"Avoid nitrates in RV MI (cause severe hypotension)",
"ST III > ST II = RCA; ST II > ST III = LCx more likely",
"Posterior MI: tall R, ST depression, upright T in V1-V3 (mirror image)",
],
},
{
"number": "15",
"title": "Wolff-Parkinson-White (WPW) Syndrome",
"color": colors.HexColor("#7c3aed"),
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_fd0d58cc1913acd56cbc62cbf42657e4a465f052a9bb2ea0d3893584ef6f70e6.jpg",
"img_fname": "wpw.jpg",
"overview": "Ventricular pre-excitation via an accessory pathway (Bundle of Kent) bypassing the AV node. The ventricle is depolarised early (delta wave) before normal His-Purkinje activation completes depolarisation.",
"criteria": [
"Short PR interval < 0.12 sec",
"Delta wave: slurred upstroke at start of QRS",
"Wide QRS > 0.12 sec (due to fusion of pre-excited + normal conduction)",
"Secondary ST-T changes (discordant)",
"Associated tachyarrhythmias: orthodromic SVT (most common), AF",
],
"interpretation": "Short PR + delta wave + wide QRS = WPW pre-excitation pattern.",
"clinical": "Localise pathway by delta wave polarity. Risk of sudden death if AF develops (rapid conduction to ventricle → VF). High-risk features: shortest pre-excited RR <250ms in AF, multiple pathways, symptomatic. Definitive treatment: catheter ablation.",
"mnemonics": "WPW triad: Wolf-PR short, Pathway=delta wave, Wide QRS",
"exam_points": [
"WPW + AF: NEVER give AV nodal blockers (digoxin, verapamil, beta-blockers, adenosine) - can cause VF!",
"WPW + AF treatment: Procainamide, DC cardioversion, or Flecainide",
"Type A WPW: positive delta in V1 (left-sided pathway)",
"Type B WPW: negative delta in V1 (right-sided pathway)",
"Ebstein anomaly most commonly associated congenital heart disease with WPW",
],
},
{
"number": "16",
"title": "Left Ventricular Hypertrophy (LVH)",
"color": NAVY,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_83220a85852689b2edcb5093c26cb2f38493a82e397407140f806ba0ce26a82a.jpg",
"img_fname": "lvh.jpg",
"overview": "Increased muscle mass of the left ventricle leads to increased voltage on ECG. Most commonly due to hypertension or aortic stenosis in India.",
"criteria": [
"Sokolow-Lyon: S in V1 + R in V5 or V6 ≥ 35mm",
"Cornell voltage: R in aVL + S in V3 ≥ 28mm (men) / ≥ 20mm (women)",
"Lewis index: R in I + S in III minus (S in I + R in III) ≥ 17mm",
"Left axis deviation",
"ST depression and T wave inversion in lateral leads (I, aVL, V5, V6) - strain pattern",
"Widening of QRS (not beyond 0.12s in pure LVH)",
],
"interpretation": "Tall R waves in lateral leads + deep S waves in right precordial leads + lateral strain = LVH.",
"clinical": "Causes: hypertension (most common), aortic stenosis, hypertrophic cardiomyopathy, aortic regurgitation, coarctation of aorta. Treat underlying cause. LVH is an independent risk factor for cardiovascular events.",
"mnemonics": "LVH voltage criteria: S(V1) + R(V5/V6) ≥ 35mm = Sokolow-Lyon",
"exam_points": [
"Strain pattern (ST depression + T inversion in I, aVL, V5, V6) = increased LV mass",
"Echocardiography is gold standard for LVH diagnosis",
"LVH on ECG has low sensitivity (40-50%) but high specificity (>90%)",
"Hypertension is #1 cause of LVH in India",
"HOCM: asymmetric hypertrophy - may show deep narrow Q waves in lateral leads",
],
},
{
"number": "17",
"title": "Torsades de Pointes (TdP)",
"color": RED,
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_4706458156599e70460312b39e23fcb205b8948cdf04be6ddf8aed809e4e5535.jpg",
"img_fname": "tdp.jpg",
"overview": "Polymorphic VT with QRS complexes that appear to twist around the isoelectric baseline. Associated with prolonged QT interval. Can degenerate into VF.",
"criteria": [
"Polymorphic wide QRS tachycardia",
"QRS complexes that rotate/twist around the isoelectric baseline",
"Rate: 200-250 bpm",
"Usually preceded by prolonged QT interval",
"Often preceded by 'short-long-short' coupling interval",
"May be self-terminating or degenerate into VF",
],
"interpretation": "Twisting wide QRS tachycardia on background of prolonged QT = Torsades.",
"clinical": "Stop QT-prolonging drugs. Correct electrolytes (K+ ≥ 4.5 mmol/L; Mg2+ ≥ 1 mmol/L). IV Magnesium sulphate 2g (first-line). Overdrive pacing or isoprenaline to shorten QT. DC shock if unstable.",
"mnemonics": "TdP treatment: Magnesium Sulphate 2g IV STAT + correct electrolytes",
"exam_points": [
"QT-prolonging drugs: Quinidine, Sotalol, Amiodarone, Erythromycin, Haloperidol, TCA, Chloroquine",
"Congenital long QT: Romano-Ward (AD), Jervell-Lange-Nielsen (AR + deafness)",
"Magnesium sulphate works even if Mg2+ level is normal",
"Acquired long QT: hypokalaemia, hypomagnesaemia, hypothyroidism",
"QTc > 500 ms = high risk of TdP",
],
},
{
"number": "18",
"title": "Pulmonary Embolism (PE) ECG Changes",
"color": colors.HexColor("#0369a1"),
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_83220a85852689b2edcb5093c26cb2f38493a82e397407140f806ba0ce26a82a.jpg",
"img_fname": "pe_ecg.jpg",
"overview": "ECG in PE reflects acute right heart strain. Most common finding is sinus tachycardia. Classic S1Q3T3 (McGinn-White) pattern is seen in massive PE.",
"criteria": [
"Sinus tachycardia (most common finding)",
"S1Q3T3: S wave in I, Q wave in III, inverted T in III",
"New RBBB (complete or incomplete)",
"Right axis deviation",
"T wave inversions V1-V4 (RV strain)",
"P pulmonale (tall peaked P in II)",
"Atrial arrhythmias (AF, flutter)",
],
"interpretation": "Sinus tachycardia + S1Q3T3 + RBBB + RV strain = suspect PE. ECG is non-specific but guides clinical suspicion.",
"clinical": "Diagnosis: CT pulmonary angiography (gold standard). D-dimer for low-medium probability. Rx: LMWH/UFH anticoagulation. Massive PE: systemic thrombolysis or catheter-directed therapy.",
"mnemonics": "PE ECG: Sinus Tachycardia + S1Q3T3 + Right-sided changes",
"exam_points": [
"Most common ECG finding in PE: sinus tachycardia (not S1Q3T3)",
"S1Q3T3 has low sensitivity (20%) but when present in right clinical context is highly suggestive",
"Normal ECG does NOT rule out PE",
"Right axis deviation + RBBB = acute cor pulmonale pattern",
"Wells score: Clinical probability; PERC rule: if all 8 criteria negative, no imaging needed",
],
},
{
"number": "19",
"title": "Hyperkalaemia",
"color": colors.HexColor("#b45309"),
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_44e9177aec15cd67fb59f52a15e2f61160ece6aa32e04f95863439a2c1567e1a.jpg",
"img_fname": "hyperk.jpg",
"overview": "Raised serum potassium causes progressive ECG changes due to altered resting membrane potential. Potentially fatal if untreated. ECG is a faster indicator than serum K+ in emergency.",
"criteria": [
"Mild (5.5-6.5): Tall, narrow, peaked T waves (tent-shaped) in V2-V5",
"Moderate (6.5-7.5): PR prolongation, QRS widening, P wave flattening/absent",
"Severe (>7.5): Sine-wave pattern, bundle branch block patterns",
"Terminal: VF or asystole",
"T wave taller than R wave in precordial leads is significant",
],
"interpretation": "Progressive ECG changes with rising K+: Peaked T → PR prolonged → Wide QRS → Sine wave → VF.",
"clinical": "Emergency treatment: Calcium gluconate 10ml 10% IV (membrane stabilisation, first-line). Insulin + dextrose (shifts K+ into cells). Sodium bicarbonate (if acidosis). Salbutamol nebulisation. Dialysis for refractory cases. Remove K+ with Resonium/patiromer.",
"mnemonics": "C-BIG-K: Calcium gluconate, Bicarbonate, Insulin+Glucose, K+ removal (dialysis/resonium)",
"exam_points": [
"Hyperkalaemia is a true emergency - can be silent until cardiac arrest",
"Most common cause in India: CKD, ACE inhibitors, K+ sparing diuretics",
"Calcium gluconate does NOT lower K+ - it stabilises the myocardium",
"Insulin + dextrose lowers K+ by 0.5-1 mmol/L in 15-30 min",
"ECG changes correlate poorly with exact K+ level - treat ECG not the number",
],
},
{
"number": "20",
"title": "Pericarditis ECG Changes",
"color": colors.HexColor("#0f766e"),
"img_url": "https://cdn.orris.care/cdss_images/pmc_clinical_VQA_68c8ce08b3a29ff7dfcc7757fa8ed4af3d7162bbb164d273745c458c90daeeb9.jpg",
"img_fname": "pericarditis.jpg",
"overview": "Pericardial inflammation causes diffuse ST elevation due to superficial myocardial irritation and PR depression. Classic concave (saddle-shaped) ST elevation in almost all leads.",
"criteria": [
"Diffuse concave (saddle-shaped) ST elevation in multiple leads (I, II, aVF, V2-V6)",
"PR segment depression (most specific finding) in same leads",
"Reciprocal ST depression ONLY in aVR and V1",
"No pathological Q waves",
"No reciprocal ST changes in multiple territories (unlike STEMI)",
"4 stages: ST elevation → ST normalises → T wave inversion → T wave normalises",
],
"interpretation": "Diffuse concave ST elevation + PR depression in multiple leads, ST depression only in aVR/V1 = pericarditis.",
"clinical": "Causes: viral (most common - Coxsackie A/B, echovirus), TB (most common cause in India), uraemia, post-MI (Dressler syndrome), autoimmune (SLE, RA). Rx: NSAIDs (aspirin preferred in post-MI) + Colchicine for 3 months to prevent recurrence.",
"mnemonics": "Pericarditis: Saddle-shaped ST elevation + PR depression = PERICARDITIS (not STEMI)",
"exam_points": [
"Key difference from STEMI: concave (saddle-shaped) vs convex ST elevation; PR depression; no reciprocal changes",
"TB pericarditis most common cause in India - always consider in young patient with pericarditis",
"Spodick's sign: downsloping TP segment (early PR depression indicator)",
"Colchicine reduces recurrence rate (COPE and ICAP trials)",
"Avoid NSAIDs in first 4 weeks post-MI (Dressler syndrome) - risk of scar thinning",
],
},
]
# ────────────────────────────────────────────────────────────────────────────
# BUILD THE PDF
# ────────────────────────────────────────────────────────────────────────────
OUTPUT = "/tmp/workspace/ecg-pdf/ECG_Patterns_MBBS_Guide.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="ECG Patterns - Final Year MBBS Guide",
author="Orris Medical Education",
subject="ECG Interpretation for Final Year MBBS Students - India"
)
story = []
# ── COVER PAGE ───────────────────────────────────────────────────────────────
cover_bg = Table([['']], colWidths=[17*cm], rowHeights=[26*cm])
cover_bg.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), NAVY),
]))
story.append(cover_bg)
story.pop() # Remove placeholder
# Cover using a table with coloured background
cover_data = [[
Spacer(1, 3*cm),
Paragraph("ECG PATTERNS", cover_title),
Paragraph("A Complete Interpretation Guide for<br/>Final Year MBBS Students", cover_sub),
Spacer(1, 0.5*cm),
Paragraph("20 Essential ECG Patterns | Clinical Correlations | Exam High-Yield Points", cover_note),
Spacer(1, 0.5*cm),
HRFlowable(width='100%', thickness=2, color=TEAL),
Spacer(1, 0.5*cm),
Paragraph("Aligned with University of Health Sciences Syllabus - India", cover_note),
Paragraph("Medicine | Cardiology | Emergency Medicine", cover_note),
Spacer(1, 2*cm),
Paragraph("Orris Medical Education | 2026", cover_note),
]]
# Flatten cover_data to a list of flowables
for item in cover_data[0]:
story.append(item)
story.append(PageBreak())
# ── TABLE OF CONTENTS ─────────────────────────────────────────────────────────
story.append(section_header("TABLE OF CONTENTS", NAVY))
story.append(Spacer(1, 0.4*cm))
toc_items = []
categories = [
("NORMAL RHYTHMS", ["01. Normal Sinus Rhythm"]),
("SUPRAVENTRICULAR ARRHYTHMIAS", ["02. Atrial Fibrillation", "03. Atrial Flutter", "04. Supraventricular Tachycardia (SVT)"]),
("VENTRICULAR ARRHYTHMIAS", ["05. Ventricular Tachycardia", "06. Ventricular Fibrillation", "17. Torsades de Pointes"]),
("CONDUCTION DEFECTS - AV BLOCKS", ["07. First-Degree AV Block", "08. Second-Degree Block (Mobitz I)", "09. Second-Degree Block (Mobitz II)", "10. Complete Heart Block"]),
("BUNDLE BRANCH BLOCKS", ["11. Left Bundle Branch Block (LBBB)", "12. Right Bundle Branch Block (RBBB)"]),
("ISCHAEMIA & INFARCTION", ["13. Anterior STEMI (LAD)", "14. Inferior STEMI (RCA)"]),
("PRE-EXCITATION", ["15. Wolff-Parkinson-White (WPW)"]),
("HYPERTROPHY", ["16. Left Ventricular Hypertrophy"]),
("SYSTEMIC CONDITIONS", ["18. Pulmonary Embolism ECG", "19. Hyperkalaemia ECG", "20. Pericarditis ECG"]),
]
for cat, items in toc_items if False else []:
pass
for cat, items in categories:
story.append(Paragraph(f"<b>{cat}</b>", h3))
for item in items:
story.append(Paragraph(f" {item}", body))
story.append(PageBreak())
# ── HOW TO READ AN ECG - Quick Reference ─────────────────────────────────────
story.append(section_header("HOW TO READ AN ECG - SYSTEMATIC APPROACH", TEAL))
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph("Use the acronym <b>RRAQQST</b> for a structured approach:", h2))
approach_data = [
["Step", "Parameter", "Normal Values", "Key Points"],
["R", "RATE", "60-100 bpm", "300/large squares between R-R; 1500/small squares"],
["R", "RHYTHM", "Regular", "Regular vs Irregular; If irregular: regularly irregular or irregularly irregular?"],
["A", "AXIS", "0° to +90°", "Normal: +ve in I & II. LAD: -ve in I... wait, +ve in I, -ve in aVF. RAD: -ve in I, +ve in aVF"],
["Q", "QRS COMPLEX", "<0.12 sec", "Pathological Q: >0.04s or >25% R amplitude. Look for BBB."],
["Q", "QT INTERVAL", "<0.44 sec (QTc)", "Long QT → TdP risk. Bazett formula: QTc = QT/√RR"],
["S", "ST SEGMENT", "Isoelectric", "Elevation: STEMI/Pericarditis. Depression: NSTEMI/digoxin/strain"],
["T", "T WAVES", "Upright in I,II,V3-V6", "Inversion: ischaemia, strain, BBB (secondary). Peaked: hyperkalaemia"],
]
approach_table = Table(approach_data, colWidths=[1.2*cm, 3.5*cm, 4*cm, 8.3*cm])
approach_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), NAVY),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 9),
('BACKGROUND', (0,1), (-1,-1), WHITE),
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, GREY]),
('FONTSIZE', (0,1), (-1,-1), 8.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('TEXTCOLOR', (0,1), (-1,-1), BLACK),
('BOX', (0,0), (-1,-1), 1, NAVY),
('INNERGRID', (0,0), (-1,-1), 0.5, MID_GREY),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(approach_table)
story.append(Spacer(1, 0.4*cm))
# ECG Paper info box
paper_data = [
[Paragraph("<b>ECG Paper Speed and Calibration (Exam Essential)</b>", h3)],
[Paragraph("""<b>Standard Settings:</b> Paper speed = 25 mm/s | Voltage = 10 mm/mV<br/>
<b>1 small square</b> = 1 mm = 0.04 sec (40 ms) | <b>1 big square</b> = 5 mm = 0.20 sec (200 ms)<br/>
<b>Rate estimation:</b> 300/big squares (300, 150, 100, 75, 60, 50) | Multiply small squares: 1500/small squares<br/>
<b>Normal intervals:</b> PR: 0.12-0.20s | QRS: 0.06-0.10s | QT: depends on rate (use QTc)<br/>
<b>Calibration mark:</b> Standard 1 mV calibration = 10 mm tall (2 big squares)""", body)],
]
paper_table = Table(paper_data, colWidths=[17*cm])
paper_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), NAVY),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('BACKGROUND', (0,1), (-1,-1), LIGHT_TEAL),
('BOX', (0,0), (-1,-1), 1.5, TEAL),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
]))
story.append(paper_table)
story.append(PageBreak())
# ── ECG PATTERN PAGES ────────────────────────────────────────────────────────
print("Building ECG pattern pages and downloading images...")
for ecg in ECG_DATA:
# Section header
hdr_color = ecg.get("color", NAVY)
story.append(section_header(f"PATTERN {ecg['number']}: {ecg['title'].upper()}", hdr_color))
story.append(Spacer(1, 0.3*cm))
# Try to download and insert image
img = fetch_img(ecg["img_url"], ecg["img_fname"], width=16*cm, height=5.5*cm)
if img:
story.append(img)
story.append(Paragraph(f"ECG Example: {ecg['title']}", caption))
else:
story.append(Paragraph(f"[ECG Image: {ecg['title']}]", caption))
story.append(Spacer(1, 0.2*cm))
# Overview
story.append(Paragraph("Overview", h2))
story.append(Paragraph(ecg["overview"], body))
# Two-column layout: Criteria + Interpretation
left_col = []
left_col.append(Paragraph("Diagnostic Criteria", h3))
for c in ecg["criteria"]:
left_col.append(bullet(c))
right_col = []
right_col.append(Paragraph("Interpretation", h3))
right_col.append(Paragraph(ecg["interpretation"], body))
right_col.append(Spacer(1, 0.3*cm))
right_col.append(Paragraph("Clinical Relevance", h3))
right_col.append(Paragraph(ecg["clinical"], body))
two_col = Table(
[[left_col, right_col]],
colWidths=[8.3*cm, 8.7*cm],
splitByRow=True
)
two_col.setStyle(TableStyle([
('VALIGN', (0,0), (-1,-1), 'TOP'),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 0),
('BOTTOMPADDING', (0,0), (-1,-1), 0),
]))
story.append(two_col)
story.append(Spacer(1, 0.3*cm))
# Mnemonic
mnem_data = [[Paragraph(f"Memory Aid: {ecg['mnemonics']}", mnemonic)]]
mnem_table = Table(mnem_data, colWidths=[17*cm])
mnem_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), colors.HexColor("#f5f3ff")),
('BOX', (0,0), (-1,-1), 1.5, colors.HexColor("#7c3aed")),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
]))
story.append(mnem_table)
story.append(Spacer(1, 0.25*cm))
# Exam points
story.append(red_flag_box(ecg["exam_points"]))
story.append(PageBreak())
# ── QUICK REFERENCE SUMMARY TABLE ───────────────────────────────────────────
story.append(section_header("QUICK REFERENCE COMPARISON TABLE", NAVY))
story.append(Spacer(1, 0.4*cm))
quick_ref_data = [
["ECG Pattern", "Rate (bpm)", "Rhythm", "P Waves", "QRS", "Key Feature"],
["Normal Sinus", "60-100", "Regular", "Normal, upright", "Narrow", "All intervals normal"],
["Atrial Fibrillation", "Variable", "Irreg. Irreg.", "Absent (f-waves)", "Narrow", "No P waves, irregular"],
["Atrial Flutter", "~150 (2:1)", "Regular", "Saw-tooth ~300/min", "Narrow", "Flutter waves, saw-tooth"],
["SVT (AVNRT)", "150-250", "Regular", "Hidden in QRS", "Narrow", "Sudden onset/offset"],
["Ventricular Tach.", "100-250", "Regular", "Dissociated", "Wide >0.12s", "AV dissociation, fusion"],
["Vent. Fibrillation", "Chaotic", "Absent", "Absent", "No QRS", "Chaotic - no complexes"],
["1° AV Block", "Normal", "Regular", "Normal", "Narrow", "PR >0.20s, constant"],
["Mobitz I", "Normal", "Grouped", "More P than QRS", "Narrow", "Progressive PR till drop"],
["Mobitz II", "Normal", "Grouped", "More P than QRS", "Wide often", "Constant PR, sudden drop"],
["Complete AV Block", "30-60", "2 rates", "Dissociated", "Narrow/Wide", "PP & RR independent"],
["LBBB", "Normal", "Normal", "Normal", "Wide, M in V6", "W in V1, M in V6"],
["RBBB", "Normal", "Normal", "Normal", "Wide, M in V1", "M in V1 (RSR'), W in V6"],
["Anterior STEMI", "Tachycardia", "Regular", "Normal", "Evolving Q", "ST up V1-V4, recip inf"],
["Inferior STEMI", "Variable", "Regular", "Normal", "Evolving Q", "ST up II,III,aVF; recip I,aVL"],
["WPW Syndrome", "Normal/fast", "Regular", "Normal", "Wide+delta", "Short PR, delta wave"],
["LVH", "Normal", "Normal", "Normal", "Tall voltage", "Sokolow-Lyon ≥35mm"],
["Torsades de Pointes", "200-250", "Irregular", "Not visible", "Wide, twisting", "Twisting around baseline"],
["PE (acute)", "Tachycardia", "Regular", "P pulmonale", "Wide RBBB", "S1Q3T3, RV strain"],
["Hyperkalaemia", "Bradycardia", "Variable", "Flat/absent", "Wide (severe)", "Peaked T waves first"],
["Pericarditis", "Tachycardia", "Regular", "Normal", "Narrow", "Diffuse concave ST up"],
]
qr_table = Table(quick_ref_data, colWidths=[3.2*cm, 1.8*cm, 1.8*cm, 2.8*cm, 2.5*cm, 4.9*cm])
qr_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), NAVY),
('TEXTCOLOR', (0,0), (-1,0), WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 8),
('ROWBACKGROUNDS', (0,1), (-1,-1), [WHITE, GREY]),
('FONTSIZE', (0,1), (-1,-1), 7.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('TEXTCOLOR', (0,1), (-1,-1), BLACK),
('BOX', (0,0), (-1,-1), 1, NAVY),
('INNERGRID', (0,0), (-1,-1), 0.5, MID_GREY),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 4),
('RIGHTPADDING', (0,0), (-1,-1), 4),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(qr_table)
story.append(PageBreak())
# ── EXAM MNEMONICS CHEAT SHEET ───────────────────────────────────────────────
story.append(section_header("EXAM MNEMONICS CHEAT SHEET", colors.HexColor("#7c3aed")))
story.append(Spacer(1, 0.4*cm))
mnemonics_list = [
("Bundle Branch Blocks", [
"WiLLiaM = W in V1, M in V6 = LBBB (Left = William)",
"MaRRoW = M in V1, W in V6 = RBBB (Right = Marrow)",
]),
("STEMI Localisation", [
"Anterior: V1-V4 (LAD) | Lateral: I, aVL, V5-V6 (LCx) | Inferior: II, III, aVF (RCA/LCx)",
"High lateral: I, aVL (LCx diagonal) | Posterior: tall R + ST depression V1-V3",
"Septal: V1-V2 | Extensive anterior: V1-V6 (proximal LAD)",
]),
("Hyperkalaemia Treatment: C-BIG-K+", [
"C - Calcium gluconate (membrane stabilisation)",
"B - Bicarbonate (if acidotic)",
"I - Insulin (with G - glucose/dextrose)",
"K+ - remove: Kayexalate/Resonium, dialysis",
]),
("Reversible Causes of Cardiac Arrest: 4H 4T", [
"Hypoxia | Hypovolaemia | Hypo/Hyperkalaemia | Hypothermia",
"Tension pneumothorax | Tamponade | Toxins | Thrombosis (PE/MI)",
]),
("ECG Systematic Reading: RRAQQST", [
"Rate | Rhythm | Axis | QRS | QT interval | ST segment | T waves",
]),
("AF CHA2DS2-VASc Score", [
"C-Congestive HF (1) | H-Hypertension (1) | A-Age ≥75 (2)",
"D-Diabetes (1) | S-Stroke/TIA (2) | V-Vascular disease (1)",
"A-Age 65-74 (1) | Sc-Sex category female (1)",
"Score ≥2 (men) or ≥3 (women): Anticoagulate",
]),
("MI Prognostic ECG Markers", [
"Wellens Type A: biphasic T V2-V3 = critical LAD stenosis",
"Wellens Type B: deep symmetric T inversion V2-V3 = critical LAD stenosis",
"de Winter T waves: ST depression + peaked T V1-V6 = LAD occlusion equivalent (STEMI variant)",
"aVR ST elevation: left main or proximal LAD occlusion",
]),
]
for title, items in mnemonics_list:
story.append(Paragraph(title, h2))
mbox_data = [[item] for item in items]
for item in items:
story.append(Paragraph(f"★ {item}", make_style('m_item', fontSize=9.5,
textColor=colors.HexColor("#4c1d95"), fontName='Helvetica',
leading=14, leftIndent=12)))
story.append(Spacer(1, 0.3*cm))
story.append(PageBreak())
# ── BACK PAGE DISCLAIMER ─────────────────────────────────────────────────────
story.append(section_header("IMPORTANT NOTES FOR MBBS STUDENTS", RED))
story.append(Spacer(1, 0.5*cm))
notes = [
"This guide covers 20 high-yield ECG patterns for Final Year MBBS examinations in India, aligned with the NMC (National Medical Commission) syllabus.",
"Always interpret ECGs in clinical context. No ECG finding is 100% sensitive or specific in isolation.",
"For patient care, always confirm interpretation with a senior clinician and the clinical picture.",
"This material is for educational purposes. Treatment protocols may vary by institution and patient condition.",
"Regularly practice with real ECG strips - reading ECGs is a skill that improves only with practice.",
"Recommended resources: Hampton's 'The ECG Made Easy', Dubin's 'Rapid Interpretation of ECGs', Dr. K. Bhagat's ECG notes (common in India).",
]
for note in notes:
story.append(Paragraph(f"• {note}", body))
story.append(Spacer(1, 1*cm))
story.append(Paragraph("Best of luck in your examinations! — Orris Medical Education",
make_style('final', fontSize=12, textColor=NAVY, alignment=TA_CENTER,
fontName='Helvetica-Bold')))
# ── BUILD ─────────────────────────────────────────────────────────────────────
print("Building PDF...")
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
print("Done!")
cd /tmp/workspace/ecg-pdf && python generate_ecg_pdf.py 2>&1
ls -lh /tmp/workspace/ecg-pdf/ECG_Patterns_MBBS_Guide.pdf && ls /tmp/workspace/ecg-pdf/imgs/ | wc -l
ECG Patterns MBBS Guide
PDF Document · PDF
| Category | Patterns |
|---|---|
| Normal | Normal Sinus Rhythm |
| Supraventricular | AF, Atrial Flutter, SVT/AVNRT |
| Ventricular | VT, VF, Torsades de Pointes |
| AV Blocks | 1st degree, Mobitz I, Mobitz II, Complete Heart Block |
| Bundle Branch Blocks | LBBB, RBBB |
| Ischaemia/Infarction | Anterior STEMI, Inferior STEMI |
| Pre-excitation | WPW Syndrome |
| Hypertrophy | LVH |
| Systemic Conditions | PE, Hyperkalaemia, Pericarditis |