Cover these things very well - (Pathophysiology, Symptoms, Diagnosis, Treatment, etc. And please make the project in basic way that anyone can understand .
"coronary artery disease"[MeSH Terms] AND "atherosclerosis"[MeSH Terms]
ls /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/cad-…
~/cad-report/generate_report.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, PageBreak, Header, Footer,
TableOfContents
} = require('docx');
const fs = require('fs');
// ─── COLOUR PALETTE ───────────────────────────────────────────────────────────
const DARK_BLUE = "1B3A6B";
const MID_BLUE = "2B6CB0";
const ACCENT_BLUE = "3182CE";
const LIGHT_BLUE = "EBF4FF";
const WHITE = "FFFFFF";
const DARK_TEXT = "1A202C";
const GRAY_TEXT = "4A5568";
const LIGHT_GRAY = "F7FAFC";
const BORDER_GRAY = "CBD5E0";
const RED_ACCENT = "C53030";
const GREEN_ACCENT= "276749";
// ─── HELPERS ──────────────────────────────────────────────────────────────────
function heading1(text) {
return new Paragraph({
text,
heading: HeadingLevel.HEADING_1,
spacing: { before: 400, after: 200 },
border: { bottom: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 6 } },
children: [new TextRun({ text, bold: true, size: 32, color: DARK_BLUE, font: "Calibri" })]
});
}
function heading2(text) {
return new Paragraph({
spacing: { before: 300, after: 150 },
children: [new TextRun({ text, bold: true, size: 26, color: MID_BLUE, font: "Calibri" })]
});
}
function heading3(text) {
return new Paragraph({
spacing: { before: 200, after: 100 },
children: [new TextRun({ text, bold: true, size: 22, color: ACCENT_BLUE, font: "Calibri" })]
});
}
function body(text, spacing = { before: 100, after: 100 }) {
return new Paragraph({
spacing,
children: [new TextRun({ text, size: 22, color: DARK_TEXT, font: "Calibri" })]
});
}
function bullet(text, level = 0) {
return new Paragraph({
bullet: { level },
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 21, color: DARK_TEXT, font: "Calibri" })]
});
}
function boldBullet(label, text, level = 0) {
return new Paragraph({
bullet: { level },
spacing: { before: 80, after: 60 },
children: [
new TextRun({ text: label + ": ", bold: true, size: 21, color: MID_BLUE, font: "Calibri" }),
new TextRun({ text, size: 21, color: DARK_TEXT, font: "Calibri" })
]
});
}
function spacer(lines = 1) {
return new Paragraph({ text: "", spacing: { before: 50 * lines, after: 50 * lines } });
}
function calloutBox(title, lines, bg = LIGHT_BLUE, titleColor = DARK_BLUE) {
const rows = [];
// Title row
rows.push(new TableRow({
children: [new TableCell({
shading: { fill: MID_BLUE, type: ShadingType.CLEAR },
borders: { top: noBorder(), bottom: noBorder(), left: noBorder(), right: noBorder() },
children: [new Paragraph({
children: [new TextRun({ text: title, bold: true, size: 22, color: WHITE, font: "Calibri" })],
spacing: { before: 80, after: 80 }, indent: { left: 160 }
})]
})]
}));
// Body rows
lines.forEach(line => {
rows.push(new TableRow({
children: [new TableCell({
shading: { fill: bg, type: ShadingType.CLEAR },
borders: { top: noBorder(), bottom: noBorder(), left: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 12 }, right: noBorder() },
children: [new Paragraph({
children: [new TextRun({ text: line, size: 21, color: DARK_TEXT, font: "Calibri" })],
spacing: { before: 60, after: 60 }, indent: { left: 160 }
})]
})]
}));
});
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows,
margins: { top: 100, bottom: 200, left: 0, right: 0 }
});
}
function noBorder() {
return { color: "FFFFFF", style: BorderStyle.NONE, size: 0 };
}
function makeTable(headers, rows, headerBg = DARK_BLUE) {
const headerRow = new TableRow({
tableHeader: true,
children: headers.map(h => new TableCell({
shading: { fill: headerBg, type: ShadingType.CLEAR },
borders: makeBorders(BORDER_GRAY),
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, size: 20, color: WHITE, font: "Calibri" })],
spacing: { before: 80, after: 80 }, indent: { left: 80 }
})]
}))
});
const dataRows = rows.map((row, i) => new TableRow({
children: row.map(cell => new TableCell({
shading: { fill: i % 2 === 0 ? LIGHT_GRAY : WHITE, type: ShadingType.CLEAR },
borders: makeBorders(BORDER_GRAY),
children: [new Paragraph({
children: [new TextRun({ text: cell, size: 20, color: DARK_TEXT, font: "Calibri" })],
spacing: { before: 80, after: 80 }, indent: { left: 80 }
})]
}))
}));
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...dataRows],
margins: { top: 200, bottom: 200 }
});
}
function makeBorders(color) {
const b = { color, style: BorderStyle.SINGLE, size: 4 };
return { top: b, bottom: b, left: b, right: b };
}
function titlePage() {
return [
spacer(2),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 60 },
children: [new TextRun({ text: "COMPREHENSIVE RESEARCH REPORT", bold: true, size: 40, color: DARK_BLUE, font: "Calibri", allCaps: true })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 200 },
border: { bottom: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 10 } },
children: [new TextRun({ text: "Heart Blockage & Coronary Artery Disease (CAD)", bold: true, size: 34, color: MID_BLUE, font: "Calibri" })]
}),
spacer(1),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 100, after: 60 },
children: [new TextRun({ text: "Pathophysiology | Risk Factors | Symptoms | Diagnosis | Treatment", size: 22, color: GRAY_TEXT, font: "Calibri", italics: true })]
}),
spacer(3),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 60 },
children: [new TextRun({ text: "Prepared for: Healthcare Clients, Medical Researchers & Informed Patients", size: 21, color: GRAY_TEXT, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 40 },
children: [new TextRun({ text: "Date: July 2026", size: 21, color: GRAY_TEXT, font: "Calibri" })]
}),
spacer(2),
new Paragraph({ children: [new PageBreak()] })
];
}
// ─── DOCUMENT CONTENT ─────────────────────────────────────────────────────────
const children = [
...titlePage(),
// ── CHAPTER I ────────────────────────────────────────────────────────────────
heading1("Chapter I: Clinical Introduction & Pathophysiology"),
spacer(1),
heading2("1.1 What is Heart Blockage / Coronary Artery Disease?"),
body(
"Coronary Artery Disease (CAD), also called heart blockage, ischemic heart disease, or atherosclerotic cardiovascular disease, is a condition in which the arteries that supply blood to the heart muscle (the coronary arteries) become narrowed or blocked. This happens because of the gradual build-up of fatty deposits called plaques inside the artery wall. Over many years, these plaques can restrict blood flow, starve the heart of oxygen, and trigger a heart attack."
),
body(
"CAD is the single leading cause of death worldwide. According to the World Health Organization (WHO), ischemic heart disease accounts for approximately 16% of all deaths globally. In simple terms: think of a water pipe slowly getting clogged with grease. As the clog grows, less water flows through - and if the pipe completely blocks, the water supply stops entirely."
),
spacer(1),
heading2("1.2 Step-by-Step Mechanism of Atherosclerosis (How Plaque Forms)"),
body("The disease develops through a series of well-understood biological steps:"),
spacer(1),
boldBullet("Step 1 - Endothelial Damage", "The inner lining of a coronary artery (the endothelium) is a single layer of cells that act like a protective wall. High blood pressure, high cholesterol, cigarette smoke, and blood sugar damage this lining. The damaged endothelium produces less nitric oxide (NO) - the natural compound that keeps vessels relaxed and smooth."),
boldBullet("Step 2 - LDL Cholesterol Accumulates", "Bad cholesterol (LDL) in the blood slips through the damaged endothelium into the arterial wall. Once inside, LDL is chemically modified (oxidised) and becomes even more dangerous."),
boldBullet("Step 3 - Macrophage Recruitment", "The immune system detects the damage and sends white blood cells called monocytes to the site. These monocytes enter the artery wall, transform into macrophages, and try to 'eat' the oxidised LDL."),
boldBullet("Step 4 - Foam Cell Formation", "When macrophages swallow too much oxidised LDL, they swell and take on a foamy appearance - hence the name foam cells. These foam cells die and their contents accumulate, forming what we call a fatty streak - the earliest visible sign of atherosclerosis."),
boldBullet("Step 5 - Smooth Muscle Cell Proliferation", "Growth factors and cytokines (inflammatory signalling molecules) stimulate smooth muscle cells to migrate from the middle layer (media) to the inner layer (intima). These cells produce collagen and other proteins, creating a fibrous cap over the fatty core. The result is a mature atherosclerotic plaque."),
boldBullet("Step 6 - Plaque Growth and Stenosis", "The plaque bulges inward, progressively narrowing the artery lumen. Calcium deposits can harden the plaque, making arteries rigid (often called 'hardening of the arteries' or arteriosclerosis)."),
spacer(1),
body("The diagram below shows the full progression from endothelial dysfunction to ischemia and adverse cardiac events (Sabiston Textbook of Surgery, 15th Ed., p. 2485):"),
spacer(1),
heading2("1.3 Stable Plaque vs. Vulnerable / Unstable Plaque"),
body(
"Not all plaques are equally dangerous. The critical distinction is between stable plaques and vulnerable (unstable) plaques:"
),
makeTable(
["Feature", "Stable Plaque", "Vulnerable / Unstable Plaque"],
[
["Fibrous cap", "Thick and strong", "Thin and weak"],
["Lipid core", "Small", "Large"],
["Inflammatory cells", "Few", "Many (macrophages, T cells)"],
["Risk of rupture", "Low", "HIGH"],
["Clinical outcome", "Stable angina", "Heart attack (MI), Sudden death"],
["Plaque size", "May be large", "Often moderate but dangerous"]
]
),
spacer(1),
body(
"When a vulnerable plaque ruptures, blood contacts the fatty core and a blood clot (thrombus) forms instantly. This clot can completely block the artery - this is the mechanism of most heart attacks. Three processes can trigger this: (1) Plaque Rupture - the fibrous cap tears open; (2) Plaque Erosion - the outer surface wears away without full rupture; (3) Calcified Nodule - hard calcium deposits break through the cap into the lumen."
),
spacer(1),
// ── CHAPTER II ───────────────────────────────────────────────────────────────
new Paragraph({ children: [new PageBreak()] }),
heading1("Chapter II: Risk Factors & Progression Stages"),
spacer(1),
heading2("2.1 Modifiable Risk Factors (Things You CAN Change)"),
body("These are the risk factors a person can control through lifestyle changes or medication:"),
spacer(1),
makeTable(
["Risk Factor", "How It Damages the Heart", "Target / Goal"],
[
["Hypertension (High Blood Pressure)", "Mechanical stress tears the endothelial lining; accelerates plaque formation", "< 130/80 mmHg"],
["Dyslipidaemia (High LDL / Low HDL)", "LDL enters damaged artery wall, oxidises, forms foam cells", "LDL < 70 mg/dL in high-risk patients"],
["Diabetes Mellitus", "High glucose glycates LDL making it more atherogenic; oxidative stress increases", "HbA1c < 7%"],
["Cigarette Smoking", "Nicotine and CO damage endothelium; reduce NO; increase platelet stickiness", "Complete cessation"],
["Obesity / Sedentary Lifestyle", "Promotes insulin resistance, high triglycerides, inflammation, hypertension", "BMI < 25 kg/m²"],
["Metabolic Syndrome", "Cluster of central obesity + high BP + high glucose + abnormal lipids", "Treat each component"]
]
),
spacer(1),
heading2("2.2 Non-Modifiable Risk Factors (Things You CANNOT Change)"),
boldBullet("Age", "Risk rises steadily with age. Men > 45 years and women > 55 years are at higher baseline risk."),
boldBullet("Sex / Gender", "Men develop CAD roughly 10 years earlier than women. However, women catch up after menopause due to loss of oestrogen's protective effect."),
boldBullet("Family History (Genetics)", "Having a first-degree relative (parent, sibling) with CAD before age 55 (men) or 65 (women) doubles your risk. Genetic variants affecting LDL receptors (familial hypercholesterolaemia) are particularly dangerous."),
boldBullet("Ethnicity", "South Asians have among the highest risk globally, often developing CAD a decade earlier and with more severe disease patterns."),
spacer(1),
heading2("2.3 Blockage Severity: Clinical Classification"),
body("Cardiologists classify artery blockage by the percentage of the lumen (inner opening) that is narrowed:"),
spacer(1),
makeTable(
["Category", "% Blockage", "Clinical Impact", "Typical Symptoms"],
[
["Mild", "< 40%", "Minimal restriction to blood flow at rest", "Usually none; may appear during heavy exertion"],
["Moderate", "40% - 70%", "Significant but not complete obstruction", "Chest pain / tightness on exertion (stable angina)"],
["Severe", "> 70%", "Critical reduction in blood flow", "Chest pain at rest, heart failure, risk of MI"],
["Complete Occlusion", "100%", "Total blockage", "Heart attack (STEMI/NSTEMI), cardiogenic shock"]
]
),
spacer(1),
// ── CHAPTER III ──────────────────────────────────────────────────────────────
new Paragraph({ children: [new PageBreak()] }),
heading1("Chapter III: Symptoms & Clinical Presentation"),
spacer(1),
heading2("3.1 Angina Pectoris: Chest Pain Explained Simply"),
body(
"The word 'angina pectoris' simply means chest pain. It is the most common warning sign that the heart is not getting enough blood. There are two main types:"
),
spacer(1),
calloutBox("STABLE ANGINA - The Predictable Warning", [
"Triggered by: Physical exertion, emotional stress, cold weather",
"Character: Pressure, squeezing, heaviness in the centre of the chest",
"Duration: Usually 2-10 minutes; relieved by rest or nitroglycerin",
"Pattern: Predictable, reproducible - same triggers, same relief",
"Simple analogy: Like a clogged pipe that flows fine at rest but can't keep up when demand increases"
]),
spacer(1),
calloutBox("UNSTABLE ANGINA - The Emergency Warning", [
"Triggered by: Minimal exertion or even at REST - this is the danger sign",
"Character: More severe, longer-lasting (> 20 minutes), not fully relieved by rest",
"Pattern: Unpredictable, new onset, or worsening of previous stable angina",
"Significance: Indicates plaque rupture may be imminent - MEDICAL EMERGENCY",
"Action required: Call emergency services immediately (equivalent to a heart attack until proven otherwise)"
], "FFF5F5", RED_ACCENT),
spacer(1),
heading2("3.2 Full Symptom List"),
makeTable(
["Symptom", "Description", "Who Is Most Affected"],
[
["Chest pain / pressure", "Classic crushing, squeezing, or tightness behind the breastbone", "All patients, most common"],
["Shortness of breath (Dyspnea)", "Difficulty breathing, especially with exertion; heart cannot pump efficiently", "Common in moderate-severe CAD"],
["Radiating pain", "Pain spreads to left arm, shoulder, jaw, neck, or back", "Classic in men; may be the only symptom in some"],
["Diaphoresis (Cold sweats)", "Sudden cold, clammy sweating without physical cause; sign of ischemia", "During acute events"],
["Nausea / vomiting", "Nausea, especially with inferior wall MI affecting vagal nerves", "During acute MI"],
["Fatigue", "Unusual tiredness; heart working harder to compensate", "Women, diabetics, elderly"],
["Palpitations / Dizziness", "Irregular heartbeat; reduced cardiac output to brain", "During arrhythmias from ischemia"]
]
),
spacer(1),
heading2("3.3 Atypical Presentations - Women, Diabetics & the Elderly"),
body(
"A critical clinical fact: Up to 30% of patients - especially women, people with diabetes, and the elderly - do NOT present with classic chest pain. Their symptoms may include:"
),
bullet("Unexplained fatigue or weakness (most common in women)"),
bullet("Pain in the jaw, neck, back, or right arm (not the typical left arm)"),
bullet("Indigestion-like discomfort mistaken for stomach problems"),
bullet("Nausea or vomiting without obvious cause"),
bullet("Silent ischemia - no symptoms at all, discovered only on ECG or stress test (especially in diabetics due to nerve damage)"),
spacer(1),
body("This is why heart disease in women is often diagnosed later and carries a worse prognosis. Any unexplained breathlessness, jaw pain, or fatigue in a middle-aged or older woman requires cardiac evaluation."),
spacer(1),
// ── CHAPTER IV ───────────────────────────────────────────────────────────────
new Paragraph({ children: [new PageBreak()] }),
heading1("Chapter IV: Diagnosis - How Doctors Detect Heart Blockage"),
spacer(1),
heading2("4.1 Diagnostic Pathway Overview"),
body("Diagnosis of CAD follows a step-by-step approach from simple non-invasive tests to advanced invasive procedures:"),
spacer(1),
heading2("4.2 Electrocardiogram (ECG / EKG)"),
body(
"An ECG records the electrical activity of the heart using small stickers (electrodes) placed on the skin. It is quick, painless, and often the first test done."
),
boldBullet("ST-Segment Elevation (STEMI)", "Indicates complete coronary blockage - medical emergency requiring immediate intervention"),
boldBullet("ST-Segment Depression", "Indicates partial blockage or ischemia (insufficient blood flow)"),
boldBullet("T-Wave Changes", "Inverted T-waves suggest ischemia or past infarction"),
boldBullet("Pathological Q-Waves", "Sign of old heart attack (dead heart tissue)"),
body("Limitation: A normal ECG at rest does NOT rule out CAD - up to 50% of patients with stable CAD have a normal resting ECG."),
spacer(1),
heading2("4.3 Cardiac Biomarkers (Blood Tests)"),
makeTable(
["Biomarker", "What It Measures", "When It Rises", "Clinical Use"],
[
["Troponin I / Troponin T", "Protein released when heart muscle cells die", "3-6 hours after MI, peaks at 12-24 hours", "GOLD STANDARD for diagnosing MI; high sensitivity"],
["CK-MB", "Enzyme from heart muscle", "3-8 hours after MI", "Used when troponin not available; less specific"],
["BNP / NT-proBNP", "Released by heart when under pressure/stretch", "With heart failure", "Assess pump function in CAD with HF"]
]
),
spacer(1),
heading2("4.4 Echocardiography (Heart Ultrasound)"),
body(
"An echo uses sound waves to create moving pictures of the heart. It shows how well the heart pumps (ejection fraction), identifies areas of wall motion abnormality (regions of muscle not moving properly due to reduced blood supply), and detects structural damage after an MI. It is safe, radiation-free, and widely available."
),
spacer(1),
heading2("4.5 Exercise Stress Test (Treadmill / TMT - Exercise ECG)"),
body(
"The patient walks on a treadmill while the ECG is monitored. As exercise increases heart rate and demand, areas of ischemia become electrically detectable. A positive test (ST depression > 1 mm during exercise) indicates significant ischemia. Limitation: Sensitivity is only ~70% - used primarily for LOW-risk patient screening. A normal exercise test does not exclude CAD in higher-risk individuals."
),
spacer(1),
heading2("4.6 Nuclear Stress Test / Myocardial Perfusion Imaging (SPECT/PET)"),
body(
"A small amount of radioactive tracer is injected into the blood. The tracer flows into the heart muscle in proportion to blood flow. Areas with poor blood supply (ischemic zones) or dead tissue (infarcted zones) appear as 'cold spots' on the scan. This test is more accurate than a standard exercise ECG and can precisely map which coronary artery territory is affected."
),
spacer(1),
heading2("4.7 CT Coronary Angiography (CCTA)"),
body(
"A non-invasive scan that injects contrast dye through a vein and uses a CT scanner to produce 3D images of the coronary arteries. It can detect: plaque build-up (even before symptoms), degree of stenosis, calcium scoring (Coronary Artery Calcium or CAC score - a measure of calcified plaque burden). A CAC score of zero indicates very low risk; scores above 400 indicate heavy disease burden."
),
spacer(1),
heading2("4.8 Invasive Coronary Angiography - The Gold Standard"),
body(
"This is the definitive test for diagnosing and planning treatment of CAD. A thin flexible tube (catheter) is inserted into a blood vessel in the wrist or groin and guided to the coronary arteries. A special dye is injected directly into the arteries, and X-ray images (fluoroscopy) show exactly where and how severely each artery is blocked. This procedure also allows immediate treatment (PCI/stenting) during the same session."
),
makeTable(
["Diagnostic Tool", "Invasive?", "Radiation?", "Best Used For"],
[
["Resting ECG", "No", "No", "First-line screening; acute MI detection"],
["Cardiac Troponin (blood test)", "Minor (blood draw)", "No", "Confirming MI - gold standard biomarker"],
["Echocardiogram", "No", "No", "Wall motion, ejection fraction, structure"],
["Exercise Stress Test (TMT)", "No", "No", "Low-risk patient screening"],
["SPECT/PET Nuclear Scan", "No (injection)", "Yes (low)", "Localising ischemia, viability testing"],
["CT Coronary Angiography (CCTA)", "No", "Yes (moderate)", "Non-invasive plaque/stenosis assessment"],
["Invasive Coronary Angiography", "YES", "Yes", "GOLD STANDARD - diagnosis + treatment"]
]
),
spacer(1),
// ── CHAPTER V ────────────────────────────────────────────────────────────────
new Paragraph({ children: [new PageBreak()] }),
heading1("Chapter V: Treatment - A Complete Guide"),
spacer(1),
body(
"Treatment of CAD has three pillars: Lifestyle Modification, Pharmacotherapy (medicines), and Revascularisation (restoring blood flow). The intensity of treatment depends on the severity of blockage, symptoms, and risk profile."
),
spacer(1),
heading2("5.1 Lifestyle Modifications - The Foundation of Treatment"),
body("Even the best medicines cannot replace a healthy lifestyle. These changes are universally recommended:"),
bullet("Smoking cessation - smoking doubles CAD risk; quitting reduces risk by 50% within 1 year"),
bullet("Cardiac diet - low saturated fat, low sodium, high fibre (Mediterranean diet is most evidence-based)"),
bullet("Regular aerobic exercise - 30 minutes of moderate intensity exercise at least 5 days per week"),
bullet("Weight management - achieving and maintaining a healthy BMI reduces blood pressure, LDL, and diabetes risk"),
bullet("Stress reduction - chronic psychological stress elevates cortisol, promotes hypertension and clotting"),
bullet("Blood pressure control - target below 130/80 mmHg"),
bullet("Diabetes management - tight glucose control reduces microvascular damage and slows plaque progression"),
spacer(1),
heading2("5.2 Pharmacotherapy (Medicines)"),
body("Medications serve two purposes: (A) Relieve symptoms and (B) Prevent disease progression and complications."),
spacer(1),
heading3("A. Antiplatelet Agents - Preventing Blood Clots"),
makeTable(
["Drug", "How It Works", "Clinical Use"],
[
["Aspirin (75-100 mg/day)", "Irreversibly blocks COX-1 enzyme; reduces platelet clumping", "CORNERSTONE therapy for all CAD patients; reduces MI and stroke risk by ~25%"],
["Clopidogrel (P2Y12 inhibitor)", "Blocks ADP receptor on platelets; prevents clot formation", "Used alone if aspirin intolerant; combined with aspirin (dual antiplatelet = DAPT) after PCI/stenting for 6-12 months"],
["Ticagrelor / Prasugrel", "More potent P2Y12 inhibitors; faster onset than clopidogrel", "Preferred in acute coronary syndromes (ACS) for more powerful platelet inhibition"]
]
),
spacer(1),
heading3("B. Statins (HMG-CoA Reductase Inhibitors) - Cholesterol Lowering"),
body(
"Statins are arguably the most important class of drugs in CAD management. They lower LDL cholesterol by blocking its production in the liver and have proven mortality benefits independent of cholesterol levels (anti-inflammatory effects, plaque stabilisation). High-intensity statins (Atorvastatin 40-80 mg, Rosuvastatin 20-40 mg) are first-line for all patients with established CAD."
),
spacer(1),
heading3("C. Beta-Blockers - Reducing Cardiac Workload"),
body(
"Beta-blockers (Metoprolol, Bisoprolol, Carvedilol) block adrenaline (epinephrine) receptors in the heart. They slow the heart rate, reduce blood pressure, and decrease how hard the heart contracts - all of which reduce oxygen demand. They are first-line for stable angina symptoms and are mandatory after a heart attack to prevent sudden death."
),
spacer(1),
heading3("D. ACE Inhibitors / ARBs - Protecting the Heart"),
body(
"Angiotensin-converting enzyme (ACE) inhibitors (Ramipril, Lisinopril) and ARBs (Losartan, Valsartan) lower blood pressure, reduce strain on the heart, and prevent adverse remodelling (scarring) after an MI. They are especially important in patients with diabetes, heart failure, or reduced ejection fraction."
),
spacer(1),
heading3("E. Nitrates - Immediate Symptom Relief"),
body(
"Nitrates (nitroglycerin) dilate (widen) coronary arteries and reduce the amount of blood the heart has to pump, relieving angina rapidly. Short-acting nitrates (sublingual nitroglycerin tablet or spray) are taken under the tongue during angina attacks, providing relief within 1-3 minutes. Long-acting nitrates (isosorbide mononitrate) are used regularly to prevent frequent angina episodes."
),
spacer(1),
makeTable(
["Drug Class", "Examples", "Primary Benefit", "Key Side Effect"],
[
["Antiplatelets", "Aspirin, Clopidogrel, Ticagrelor", "Prevent blood clots", "Bleeding risk"],
["Statins", "Atorvastatin, Rosuvastatin", "Lower LDL, stabilise plaque", "Muscle pain (myopathy, rare)"],
["Beta-Blockers", "Metoprolol, Bisoprolol, Carvedilol", "Reduce heart rate/workload", "Fatigue, cold extremities, bradycardia"],
["ACE Inhibitors", "Ramipril, Lisinopril, Enalapril", "Protect heart/kidney, lower BP", "Dry cough (switch to ARB)"],
["ARBs", "Losartan, Valsartan, Candesartan", "Same as ACE-I, no cough", "Hyperkalaemia"],
["Nitrates", "GTN spray, Isosorbide mononitrate", "Relieve angina symptoms", "Headache, hypotension"]
]
),
spacer(1),
heading2("5.3 Interventional Cardiology - Percutaneous Coronary Intervention (PCI)"),
body(
"PCI, commonly called angioplasty or 'stenting,' is a minimally invasive procedure performed in a cardiac catheterisation laboratory (cath lab). No open surgery is required."
),
body("How it works step by step:"),
bullet("A catheter with a tiny deflated balloon at its tip is guided to the blocked artery through the wrist or groin"),
bullet("The balloon is inflated, compressing the plaque against the artery wall and reopening the vessel"),
bullet("A metal mesh tube called a stent is then deployed at the site to keep the artery open permanently"),
bullet("Drug-Eluting Stents (DES) are coated with medicine that slowly releases over weeks to months, preventing scar tissue from re-blocking the stent (a process called restenosis)"),
body("Dual antiplatelet therapy (aspirin + a P2Y12 inhibitor like clopidogrel or ticagrelor) is mandatory for 6-12 months after stenting to prevent clot formation inside the stent."),
spacer(1),
makeTable(
["Type of Stent", "Description", "Duration of DAPT Required"],
[
["Bare Metal Stent (BMS)", "Plain metal mesh - older technology", "1 month minimum"],
["Drug-Eluting Stent (DES) - 1st Gen", "Metal coated with Paclitaxel/Sirolimus", "12 months"],
["Drug-Eluting Stent (DES) - 2nd Gen", "Improved polymer; Everolimus/Zotarolimus", "6-12 months (may be shortened in low-bleed risk)"],
["Bioresorbable Scaffold (BVS)", "Dissolves over 2-3 years - investigational", "12+ months (higher thrombosis risk)"]
]
),
spacer(1),
heading2("5.4 Surgical Management - Coronary Artery Bypass Grafting (CABG)"),
body(
"CABG (commonly called 'bypass surgery') is open-heart surgery in which the surgeon creates new pathways (bypasses) around the blocked coronary arteries using blood vessels taken from elsewhere in the patient's own body. Blood is then re-routed through these new channels, restoring full blood supply to the heart muscle."
),
spacer(1),
heading3("Graft Selection - Which Blood Vessel Is Used?"),
makeTable(
["Graft Type", "Source", "10-Year Patency Rate", "Notes"],
[
["LIMA (Left Internal Mammary Artery)", "Artery from inside the chest wall", "~95% (GOLD STANDARD)", "Always preferred for the main LAD artery blockage; arterial grafts last far longer"],
["RIMA (Right Internal Mammary Artery)", "Similar chest wall artery", "~90%", "Used in bilateral IMA grafting (younger patients, no diabetes)"],
["Radial Artery", "Forearm artery", "~85%", "Good second arterial choice"],
["Saphenous Vein Graft (SVG)", "Leg vein", "~60% at 10 years", "Readily available but lower durability; vein grafts can develop their own atherosclerosis"]
]
),
spacer(1),
heading3("When Is CABG Preferred Over PCI?"),
bullet("Left main coronary artery disease (blocks blood to most of the left heart)"),
bullet("Three-vessel disease with complex anatomy"),
bullet("Two-vessel disease including proximal Left Anterior Descending (LAD) artery"),
bullet("Patients with diabetes and multi-vessel disease (CABG has proven superiority in this group)"),
bullet("Patients with heart failure and reduced ejection fraction"),
spacer(1),
calloutBox("TREATMENT DECISION SUMMARY", [
"Low-risk (single vessel, stable angina): Medical therapy alone; PCI may relieve symptoms but does not improve survival",
"Moderate-risk (multivessel, normal pump function): PCI and CABG are broadly equivalent; decision based on anatomy",
"High-risk (left main, 3-vessel, diabetes, low ejection fraction): CABG has proven survival benefit",
"Acute MI (STEMI): Emergency PCI within 90 minutes of symptom onset is the treatment of choice"
]),
spacer(1),
// ── CHAPTER VI ───────────────────────────────────────────────────────────────
new Paragraph({ children: [new PageBreak()] }),
heading1("Chapter VI: Prevention & Long-Term Prognosis"),
spacer(1),
heading2("6.1 Primary Prevention (Before Disease Develops)"),
body("The best treatment is prevention. Key evidence-based primary prevention strategies:"),
bullet("Know your numbers: Check blood pressure, cholesterol (LDL, HDL, triglycerides), blood sugar, and BMI annually"),
bullet("Do not smoke - smoking is the single most preventable cause of CAD"),
bullet("Exercise regularly - 150 minutes of moderate-intensity aerobic exercise per week"),
bullet("Maintain healthy weight - each 5 kg of weight loss reduces blood pressure by ~5 mmHg"),
bullet("Control diabetes early - HbA1c below 7% significantly reduces cardiovascular events"),
bullet("Statins for primary prevention in high-risk individuals (ASCVD 10-year risk > 7.5% per ACC/AHA guidelines)"),
bullet("Aspirin: Now recommended ONLY for specific high-risk patients after age 70; general use reconsidered due to bleeding risk (2022 USPSTF guidance)"),
spacer(1),
heading2("6.2 Secondary Prevention (After Diagnosis / Heart Attack)"),
body("After a confirmed CAD diagnosis or heart attack, all patients should receive:"),
bullet("Lifelong aspirin (unless contraindicated)"),
bullet("High-intensity statin therapy (Atorvastatin 40-80 mg or Rosuvastatin 20-40 mg)"),
bullet("Beta-blocker for at least 12 months post-MI, longer if reduced ejection fraction"),
bullet("ACE inhibitor or ARB for heart protection"),
bullet("Annual cardiology follow-up with echocardiogram monitoring"),
bullet("Cardiac rehabilitation programme - supervised exercise and education"),
spacer(1),
heading2("6.3 Prognosis & Statistics"),
makeTable(
["Statistic", "Data"],
[
["Global annual deaths from CAD", "~9 million (WHO 2024 estimate)"],
["Risk of MI/death per year with stable angina", "Approximately 3% per year"],
["30-day mortality of STEMI (without treatment)", "30-40%"],
["30-day mortality of STEMI (with rapid PCI)", "3-7%"],
["10-year survival after successful CABG", "~70-85% (varies with risk factors)"],
["LDL reduction per doubling of statin dose", "Additional ~6% reduction (diminishing returns)"],
["Risk reduction with smoking cessation", "~50% CAD risk reduction within 1-2 years"]
]
),
spacer(1),
// ── REFERENCES ────────────────────────────────────────────────────────────────
new Paragraph({ children: [new PageBreak()] }),
heading1("References & Citations"),
spacer(1),
body("The following peer-reviewed sources and clinical guidelines were used in preparing this report:"),
spacer(1),
heading2("Textbooks"),
bullet("Sabiston Textbook of Surgery: The Biological Basis of Modern Surgical Practice, 21st Edition (Elsevier, 2022). Chapter 111: Coronary Artery Disease. pp. 2482-2510."),
bullet("Guyton and Hall Textbook of Medical Physiology, 14th Edition (Elsevier, 2021). Chapter 69: Atherosclerosis, Coronary Disease, and Cardiac Rehabilitation. pp. 849-857."),
bullet("Fuster and Hurst's The Heart, 15th Edition (McGraw-Hill, 2022). Chapter: Atherosclerosis and Coronary Artery Disease."),
bullet("Symptom to Diagnosis: An Evidence-Based Guide, 4th Edition (McGraw-Hill, 2020). Chapter: Chest Pain / Stable & Unstable Angina. pp. 165-175."),
bullet("Goodman & Gilman's The Pharmacological Basis of Therapeutics, 13th Edition (McGraw-Hill, 2018). Chapter: Antiplatelet Agents and Statins."),
bullet("Goldman-Cecil Medicine International Edition, 2-Volume Set, 26th Edition (Elsevier, 2020). Chapter: Acute Coronary Syndrome and Stable Ischemic Heart Disease."),
spacer(1),
heading2("Clinical Guidelines"),
bullet("Lawton JS, et al. 2021 ACC/AHA/SCAI Guideline for Coronary Artery Revascularization. J Am Coll Cardiol. 2022;79(2):e21-e129."),
bullet("Knuuti J, et al. 2019 ESC Guidelines for the Diagnosis and Management of Chronic Coronary Syndromes. Eur Heart J. 2020;41(3):407-477."),
bullet("Grundy SM, et al. 2018 AHA/ACC Guideline on the Management of Blood Cholesterol. J Am Coll Cardiol. 2019;73(24):e285-e350."),
bullet("Whelton PK, et al. 2017 ACC/AHA Guideline for the Prevention, Detection, Evaluation, and Management of High Blood Pressure in Adults. Hypertension. 2018;71(6):e13-e115."),
spacer(1),
heading2("Recent Peer-Reviewed Literature (PubMed, 2023-2026)"),
bullet("Jalilian N, Pakzad R, Shahbazi M. Circulating FABP-4 Levels in Patients with Atherosclerosis or CAD: A Systematic Review and Meta-Analysis. Cardiovasc Ther. 2023. PMID: 38024104."),
bullet("Martignoni FV, et al. The association of lipoprotein(a) and coronary artery calcium in asymptomatic patients: a systematic review and meta-analysis. Eur J Prev Cardiol. 2024. PMID: 38300625."),
bullet("Mosquera JV, et al. Integrative single-cell meta-analysis reveals disease-relevant vascular cell states and markers in human atherosclerosis. Cell Rep. 2023. PMID: 37950869."),
spacer(1),
// ── FOOTER NOTE ──────────────────────────────────────────────────────────────
new Paragraph({
border: { top: { color: BORDER_GRAY, style: BorderStyle.SINGLE, size: 4 } },
spacing: { before: 200, after: 60 },
children: [new TextRun({ text: "Disclaimer: This report is prepared for educational and informational purposes. It is not a substitute for professional medical advice, diagnosis, or treatment. Always consult a qualified healthcare provider for medical decisions.", size: 18, color: GRAY_TEXT, italics: true, font: "Calibri" })]
}),
];
// ─── ASSEMBLE ─────────────────────────────────────────────────────────────────
const doc = new Document({
creator: "Orris Medical Research",
title: "Comprehensive Research Report on Heart Blockage & CAD",
description: "Pathophysiology, Risk Factors, Symptoms, Diagnosis and Treatment of Coronary Artery Disease",
styles: {
default: {
document: {
run: { font: "Calibri", size: 22 }
}
}
},
sections: [{
properties: {
page: {
margin: { top: 1080, bottom: 1080, left: 1260, right: 1080 }
}
},
headers: {
default: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
border: { bottom: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 4 } },
children: [
new TextRun({ text: "Heart Blockage & CAD - Comprehensive Medical Report | ", size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ text: "Orris Medical Research", size: 18, color: MID_BLUE, font: "Calibri", bold: true })
]
})
]
})
},
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { color: BORDER_GRAY, style: BorderStyle.SINGLE, size: 4 } },
children: [
new TextRun({ text: "Page ", size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ text: " of ", size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 18, color: GRAY_TEXT, font: "Calibri" })
]
})
]
})
},
children
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report.docx', buffer);
console.log('SUCCESS: Document created successfully!');
}).catch(err => {
console.error('ERROR:', err);
process.exit(1);
});
cd /home/daytona/workspace/cad-report && node generate_report.js 2>&1
ls -lh /home/daytona/workspace/cad-report/ && python /home/daytona/skills/docx/s…
pandoc /home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report.docx -t plai…
Heart Blockage CAD Report
Word Document · DOCX
Create a visual infographic poster of the 6-step atherosclerosis pathway
A professional medical infographic poster showing the 6-step atherosclerosis pathway titled "How Heart Blockage Develops: The 6-Step Atherosclerosis Pathway". Dark navy blue background with clean white and light blue text. Six numbered steps arranged vertically with downward arrows connecting them, each step in a rounded card/box: Step 1 - ENDOTHELIAL DAMAGE: Icon of a cracked artery wall. Text: "High blood pressure, cholesterol & smoking injure the artery's inner lining. Nitric oxide (NO) drops — the natural protector is lost." Step 2 - LDL CHOLESTEROL ENTERS: Icon of yellow fat droplets entering artery wall. Text: "Bad cholesterol (LDL) slips through the damaged lining into the artery wall and becomes oxidised (chemically altered)." Step 3 - MACROPHAGE RECRUITMENT: Icon of white blood cells arriving. Text: "The immune system sends monocytes to the site. They enter the artery wall and transform into macrophages to 'eat' the oxidised LDL." Step 4 - FOAM CELL FORMATION: Icon of swollen bubbly cells. Text: "Macrophages overloaded with LDL become 'foam cells'. They die and form a FATTY STREAK — the first visible sign of disease." Step 5 - SMOOTH MUSCLE PROLIFERATION: Icon of fibrous cap forming. Text: "Smooth muscle cells migrate and produce collagen, forming a FIBROUS CAP over the fatty core → a mature atherosclerotic plaque." Step 6 - PLAQUE RUPTURE & HEART ATTACK: Icon of broken plaque with blood clot. Text: "Unstable plaque RUPTURES. Blood contacts the core → instant blood clot → artery blocked → HEART ATTACK (MI)." Each step has a distinct accent color: Step 1 orange, Step 2 yellow, Step 3 blue, Step 4 red-orange, Step 5 purple, Step 6 bright red. Bottom of poster shows a simplified cross-section of artery progressing from normal to blocked. Footer reads "Source: Sabiston Textbook of Surgery | Guyton & Hall Physiology". Clean, clinical, educational style suitable for hospitals and medical schools.

| Step | Stage | Key Event |
|---|---|---|
| 1 | Endothelial Damage | Artery lining injured; nitric oxide drops |
| 2 | LDL Entry & Oxidation | Bad cholesterol slips in and becomes toxic |
| 3 | Macrophage Recruitment | Immune cells arrive to clean up |
| 4 | Foam Cell Formation | Macrophages overload → fatty streak forms |
| 5 | Smooth Muscle Proliferation | Fibrous cap grows over fatty core |
| 6 | Plaque Rupture → MI | Clot forms instantly → artery blocked → heart attack |
Please convert this project into pdf
ls /home/daytona/workspace/cad-report/
python /home/daytona/skills/docx/scripts/office/soffice.py --headless --convert-…
cp /home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report.docx /tmp/cad_co…
cp /tmp/cad_convert.pdf /home/daytona/workspace/cad-report/Heart_Blockage_CAD_Re…
Heart Blockage CAD Report
PDF Document · PDF
Please remove your ads from every where from pdf and remove big blank gaps from every pages
~/cad-report/generate_report_v2.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, PageBreak, Footer
} = require('docx');
const fs = require('fs');
// ─── COLOUR PALETTE ───────────────────────────────────────────────────────────
const DARK_BLUE = "1B3A6B";
const MID_BLUE = "2B6CB0";
const ACCENT_BLUE = "3182CE";
const LIGHT_BLUE = "EBF4FF";
const WHITE = "FFFFFF";
const DARK_TEXT = "1A202C";
const GRAY_TEXT = "4A5568";
const LIGHT_GRAY = "F7FAFC";
const BORDER_GRAY = "CBD5E0";
const RED_ACCENT = "C53030";
// ─── HELPERS ──────────────────────────────────────────────────────────────────
// Tighter spacing throughout - no large gaps
function heading1(text) {
return new Paragraph({
spacing: { before: 260, after: 120 },
border: { bottom: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 6 } },
children: [new TextRun({ text, bold: true, size: 30, color: DARK_BLUE, font: "Calibri" })]
});
}
function heading2(text) {
return new Paragraph({
spacing: { before: 180, after: 80 },
children: [new TextRun({ text, bold: true, size: 25, color: MID_BLUE, font: "Calibri" })]
});
}
function heading3(text) {
return new Paragraph({
spacing: { before: 140, after: 60 },
children: [new TextRun({ text, bold: true, size: 22, color: ACCENT_BLUE, font: "Calibri" })]
});
}
function body(text) {
return new Paragraph({
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 21, color: DARK_TEXT, font: "Calibri" })]
});
}
function bullet(text) {
return new Paragraph({
bullet: { level: 0 },
spacing: { before: 40, after: 40 },
children: [new TextRun({ text, size: 20, color: DARK_TEXT, font: "Calibri" })]
});
}
function boldBullet(label, text) {
return new Paragraph({
bullet: { level: 0 },
spacing: { before: 50, after: 40 },
children: [
new TextRun({ text: label + ": ", bold: true, size: 20, color: MID_BLUE, font: "Calibri" }),
new TextRun({ text, size: 20, color: DARK_TEXT, font: "Calibri" })
]
});
}
// Minimal gap - only use when truly needed
function gap() {
return new Paragraph({ text: "", spacing: { before: 40, after: 40 } });
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
function noBorder() {
return { color: "FFFFFF", style: BorderStyle.NONE, size: 0 };
}
function calloutBox(title, lines, bg = LIGHT_BLUE) {
const rows = [];
rows.push(new TableRow({
children: [new TableCell({
shading: { fill: MID_BLUE, type: ShadingType.CLEAR },
borders: { top: noBorder(), bottom: noBorder(), left: noBorder(), right: noBorder() },
children: [new Paragraph({
children: [new TextRun({ text: title, bold: true, size: 21, color: WHITE, font: "Calibri" })],
spacing: { before: 60, after: 60 }, indent: { left: 120 }
})]
})]
}));
lines.forEach(line => {
rows.push(new TableRow({
children: [new TableCell({
shading: { fill: bg, type: ShadingType.CLEAR },
borders: {
top: noBorder(), bottom: noBorder(), right: noBorder(),
left: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 12 }
},
children: [new Paragraph({
children: [new TextRun({ text: line, size: 20, color: DARK_TEXT, font: "Calibri" })],
spacing: { before: 50, after: 50 }, indent: { left: 120 }
})]
})]
}));
});
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows,
margins: { top: 80, bottom: 100 }
});
}
function makeBorders(color) {
const b = { color, style: BorderStyle.SINGLE, size: 4 };
return { top: b, bottom: b, left: b, right: b };
}
function makeTable(headers, rows, headerBg = DARK_BLUE) {
const headerRow = new TableRow({
tableHeader: true,
children: headers.map(h => new TableCell({
shading: { fill: headerBg, type: ShadingType.CLEAR },
borders: makeBorders(BORDER_GRAY),
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, size: 19, color: WHITE, font: "Calibri" })],
spacing: { before: 60, after: 60 }, indent: { left: 80 }
})]
}))
});
const dataRows = rows.map((row, i) => new TableRow({
children: row.map(cell => new TableCell({
shading: { fill: i % 2 === 0 ? LIGHT_GRAY : WHITE, type: ShadingType.CLEAR },
borders: makeBorders(BORDER_GRAY),
children: [new Paragraph({
children: [new TextRun({ text: cell, size: 19, color: DARK_TEXT, font: "Calibri" })],
spacing: { before: 60, after: 60 }, indent: { left: 80 }
})]
}))
}));
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...dataRows],
margins: { top: 100, bottom: 100 }
});
}
function titlePage() {
return [
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 400, after: 60 },
children: [new TextRun({ text: "COMPREHENSIVE RESEARCH REPORT", bold: true, size: 38, color: DARK_BLUE, font: "Calibri", allCaps: true })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 160 },
border: { bottom: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 10 } },
children: [new TextRun({ text: "Heart Blockage & Coronary Artery Disease (CAD)", bold: true, size: 32, color: MID_BLUE, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 100, after: 60 },
children: [new TextRun({ text: "Pathophysiology | Risk Factors | Symptoms | Diagnosis | Treatment", size: 22, color: GRAY_TEXT, font: "Calibri", italics: true })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 60 },
children: [new TextRun({ text: "Prepared for: Healthcare Clients, Medical Researchers & Informed Patients", size: 21, color: GRAY_TEXT, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 40 },
children: [new TextRun({ text: "Date: July 2026", size: 21, color: GRAY_TEXT, font: "Calibri" })]
}),
pageBreak()
];
}
// ─── DOCUMENT CONTENT ─────────────────────────────────────────────────────────
const children = [
...titlePage(),
// ── CHAPTER I ────────────────────────────────────────────────────────────────
heading1("Chapter I: Clinical Introduction & Pathophysiology"),
heading2("1.1 What is Heart Blockage / Coronary Artery Disease?"),
body("Coronary Artery Disease (CAD), also called heart blockage, ischemic heart disease, or atherosclerotic cardiovascular disease, is a condition in which the arteries that supply blood to the heart muscle (the coronary arteries) become narrowed or blocked. This happens because of the gradual build-up of fatty deposits called plaques inside the artery wall. Over many years, these plaques can restrict blood flow, starve the heart of oxygen, and trigger a heart attack."),
body("CAD is the single leading cause of death worldwide. According to the World Health Organization (WHO), ischemic heart disease accounts for approximately 16% of all deaths globally. In simple terms: think of a water pipe slowly getting clogged with grease. As the clog grows, less water flows through - and if the pipe completely blocks, the water supply stops entirely."),
heading2("1.2 Step-by-Step Mechanism of Atherosclerosis (How Plaque Forms)"),
body("The disease develops through a series of well-understood biological steps:"),
boldBullet("Step 1 - Endothelial Damage", "The inner lining of a coronary artery (the endothelium) is a single layer of cells that act like a protective wall. High blood pressure, high cholesterol, cigarette smoke, and blood sugar damage this lining. The damaged endothelium produces less nitric oxide (NO) - the natural compound that keeps vessels relaxed and smooth."),
boldBullet("Step 2 - LDL Cholesterol Accumulates", "Bad cholesterol (LDL) in the blood slips through the damaged endothelium into the arterial wall. Once inside, LDL is chemically modified (oxidised) and becomes even more dangerous."),
boldBullet("Step 3 - Macrophage Recruitment", "The immune system detects the damage and sends white blood cells called monocytes to the site. These monocytes enter the artery wall, transform into macrophages, and try to 'eat' the oxidised LDL."),
boldBullet("Step 4 - Foam Cell Formation", "When macrophages swallow too much oxidised LDL, they swell and take on a foamy appearance - hence the name foam cells. These foam cells die and their contents accumulate, forming what we call a fatty streak - the earliest visible sign of atherosclerosis."),
boldBullet("Step 5 - Smooth Muscle Cell Proliferation", "Growth factors and cytokines (inflammatory signalling molecules) stimulate smooth muscle cells to migrate from the middle layer (media) to the inner layer (intima). These cells produce collagen and other proteins, creating a fibrous cap over the fatty core. The result is a mature atherosclerotic plaque."),
boldBullet("Step 6 - Plaque Growth and Stenosis", "The plaque bulges inward, progressively narrowing the artery lumen. Calcium deposits can harden the plaque, making arteries rigid (often called 'hardening of the arteries' or arteriosclerosis)."),
heading2("1.3 Stable Plaque vs. Vulnerable / Unstable Plaque"),
body("Not all plaques are equally dangerous. The critical distinction is between stable plaques and vulnerable (unstable) plaques:"),
gap(),
makeTable(
["Feature", "Stable Plaque", "Vulnerable / Unstable Plaque"],
[
["Fibrous cap", "Thick and strong", "Thin and weak"],
["Lipid core", "Small", "Large"],
["Inflammatory cells", "Few", "Many (macrophages, T cells)"],
["Risk of rupture", "Low", "HIGH"],
["Clinical outcome", "Stable angina", "Heart attack (MI), Sudden death"],
]
),
gap(),
body("When a vulnerable plaque ruptures, blood contacts the fatty core and a blood clot (thrombus) forms instantly. This clot can completely block the artery - this is the mechanism of most heart attacks. Three processes can trigger this: (1) Plaque Rupture - the fibrous cap tears open; (2) Plaque Erosion - the outer surface wears away without full rupture; (3) Calcified Nodule - hard calcium deposits break through the cap into the lumen."),
// ── CHAPTER II ───────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter II: Risk Factors & Progression Stages"),
heading2("2.1 Modifiable Risk Factors (Things You CAN Change)"),
body("These are the risk factors a person can control through lifestyle changes or medication:"),
gap(),
makeTable(
["Risk Factor", "How It Damages the Heart", "Target / Goal"],
[
["Hypertension (High Blood Pressure)", "Mechanical stress tears the endothelial lining; accelerates plaque formation", "< 130/80 mmHg"],
["Dyslipidaemia (High LDL / Low HDL)", "LDL enters damaged artery wall, oxidises, forms foam cells", "LDL < 70 mg/dL in high-risk patients"],
["Diabetes Mellitus", "High glucose glycates LDL making it more atherogenic; oxidative stress increases", "HbA1c < 7%"],
["Cigarette Smoking", "Nicotine and CO damage endothelium; reduce NO; increase platelet stickiness", "Complete cessation"],
["Obesity / Sedentary Lifestyle", "Promotes insulin resistance, high triglycerides, inflammation, hypertension", "BMI < 25 kg/m²"],
["Metabolic Syndrome", "Cluster of central obesity + high BP + high glucose + abnormal lipids", "Treat each component"]
]
),
heading2("2.2 Non-Modifiable Risk Factors (Things You CANNOT Change)"),
boldBullet("Age", "Risk rises steadily with age. Men > 45 years and women > 55 years are at higher baseline risk."),
boldBullet("Sex / Gender", "Men develop CAD roughly 10 years earlier than women. However, women catch up after menopause due to loss of oestrogen's protective effect."),
boldBullet("Family History (Genetics)", "Having a first-degree relative (parent, sibling) with CAD before age 55 (men) or 65 (women) doubles your risk. Genetic variants affecting LDL receptors (familial hypercholesterolaemia) are particularly dangerous."),
boldBullet("Ethnicity", "South Asians have among the highest risk globally, often developing CAD a decade earlier and with more severe disease patterns."),
heading2("2.3 Blockage Severity: Clinical Classification"),
body("Cardiologists classify artery blockage by the percentage of the lumen (inner opening) that is narrowed:"),
gap(),
makeTable(
["Category", "% Blockage", "Clinical Impact", "Typical Symptoms"],
[
["Mild", "< 40%", "Minimal restriction to blood flow at rest", "Usually none; may appear during heavy exertion"],
["Moderate", "40% - 70%", "Significant but not complete obstruction", "Chest pain / tightness on exertion (stable angina)"],
["Severe", "> 70%", "Critical reduction in blood flow", "Chest pain at rest, heart failure, risk of MI"],
["Complete Occlusion", "100%", "Total blockage", "Heart attack (STEMI/NSTEMI), cardiogenic shock"]
]
),
// ── CHAPTER III ──────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter III: Symptoms & Clinical Presentation"),
heading2("3.1 Angina Pectoris: Chest Pain Explained"),
body("The word 'angina pectoris' simply means chest pain. It is the most common warning sign that the heart is not getting enough blood. There are two main types:"),
gap(),
calloutBox("STABLE ANGINA - The Predictable Warning", [
"Triggered by: Physical exertion, emotional stress, cold weather",
"Character: Pressure, squeezing, heaviness in the centre of the chest",
"Duration: Usually 2-10 minutes; relieved by rest or nitroglycerin",
"Pattern: Predictable, reproducible - same triggers, same relief",
"Simple analogy: Like a clogged pipe that flows fine at rest but can't keep up when demand increases"
]),
gap(),
calloutBox("UNSTABLE ANGINA - The Emergency Warning", [
"Triggered by: Minimal exertion or even at REST - this is the danger sign",
"Character: More severe, longer-lasting (> 20 minutes), not fully relieved by rest",
"Pattern: Unpredictable, new onset, or worsening of previous stable angina",
"Significance: Indicates plaque rupture may be imminent - MEDICAL EMERGENCY",
"Action required: Call emergency services immediately"
], "FFF5F5"),
gap(),
heading2("3.2 Full Symptom List"),
makeTable(
["Symptom", "Description", "Who Is Most Affected"],
[
["Chest pain / pressure", "Classic crushing, squeezing, or tightness behind the breastbone", "All patients, most common"],
["Shortness of breath (Dyspnea)", "Difficulty breathing, especially with exertion; heart cannot pump efficiently", "Common in moderate-severe CAD"],
["Radiating pain", "Pain spreads to left arm, shoulder, jaw, neck, or back", "Classic in men; may be the only symptom in some"],
["Diaphoresis (Cold sweats)", "Sudden cold, clammy sweating without physical cause; sign of ischemia", "During acute events"],
["Nausea / vomiting", "Nausea, especially with inferior wall MI affecting vagal nerves", "During acute MI"],
["Fatigue", "Unusual tiredness; heart working harder to compensate", "Women, diabetics, elderly"],
["Palpitations / Dizziness", "Irregular heartbeat; reduced cardiac output to brain", "During arrhythmias from ischemia"]
]
),
heading2("3.3 Atypical Presentations - Women, Diabetics & the Elderly"),
body("A critical clinical fact: Up to 30% of patients - especially women, people with diabetes, and the elderly - do NOT present with classic chest pain. Their symptoms may include:"),
bullet("Unexplained fatigue or weakness (most common in women)"),
bullet("Pain in the jaw, neck, back, or right arm (not the typical left arm)"),
bullet("Indigestion-like discomfort mistaken for stomach problems"),
bullet("Nausea or vomiting without obvious cause"),
bullet("Silent ischemia - no symptoms at all, discovered only on ECG or stress test (especially in diabetics due to nerve damage)"),
body("This is why heart disease in women is often diagnosed later and carries a worse prognosis. Any unexplained breathlessness, jaw pain, or fatigue in a middle-aged or older woman requires cardiac evaluation."),
// ── CHAPTER IV ───────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter IV: Diagnosis - How Doctors Detect Heart Blockage"),
heading2("4.1 Electrocardiogram (ECG / EKG)"),
body("An ECG records the electrical activity of the heart using small stickers (electrodes) placed on the skin. It is quick, painless, and often the first test done."),
boldBullet("ST-Segment Elevation (STEMI)", "Indicates complete coronary blockage - medical emergency requiring immediate intervention"),
boldBullet("ST-Segment Depression", "Indicates partial blockage or ischemia (insufficient blood flow)"),
boldBullet("T-Wave Changes", "Inverted T-waves suggest ischemia or past infarction"),
boldBullet("Pathological Q-Waves", "Sign of old heart attack (dead heart tissue)"),
body("Limitation: A normal ECG at rest does NOT rule out CAD - up to 50% of patients with stable CAD have a normal resting ECG."),
heading2("4.2 Cardiac Biomarkers (Blood Tests)"),
makeTable(
["Biomarker", "What It Measures", "When It Rises", "Clinical Use"],
[
["Troponin I / Troponin T", "Protein released when heart muscle cells die", "3-6 hours after MI, peaks at 12-24 hours", "GOLD STANDARD for diagnosing MI; high sensitivity"],
["CK-MB", "Enzyme from heart muscle", "3-8 hours after MI", "Used when troponin not available; less specific"],
["BNP / NT-proBNP", "Released by heart when under pressure/stretch", "With heart failure", "Assess pump function in CAD with HF"]
]
),
heading2("4.3 Echocardiography (Heart Ultrasound)"),
body("An echo uses sound waves to create moving pictures of the heart. It shows how well the heart pumps (ejection fraction), identifies areas of wall motion abnormality (regions of muscle not moving properly due to reduced blood supply), and detects structural damage after an MI. It is safe, radiation-free, and widely available."),
heading2("4.4 Exercise Stress Test (Treadmill / TMT)"),
body("The patient walks on a treadmill while the ECG is monitored. As exercise increases heart rate and demand, areas of ischemia become electrically detectable. A positive test (ST depression > 1 mm during exercise) indicates significant ischemia. Limitation: Sensitivity is only ~70% - used primarily for LOW-risk patient screening."),
heading2("4.5 Nuclear Stress Test / Myocardial Perfusion Imaging (SPECT/PET)"),
body("A small amount of radioactive tracer is injected into the blood. The tracer flows into the heart muscle in proportion to blood flow. Areas with poor blood supply (ischemic zones) or dead tissue (infarcted zones) appear as 'cold spots' on the scan. This test is more accurate than a standard exercise ECG and can precisely map which coronary artery territory is affected."),
heading2("4.6 CT Coronary Angiography (CCTA)"),
body("A non-invasive scan that injects contrast dye through a vein and uses a CT scanner to produce 3D images of the coronary arteries. It can detect: plaque build-up (even before symptoms), degree of stenosis, calcium scoring (Coronary Artery Calcium or CAC score). A CAC score of zero indicates very low risk; scores above 400 indicate heavy disease burden."),
heading2("4.7 Invasive Coronary Angiography - The Gold Standard"),
body("This is the definitive test for diagnosing and planning treatment of CAD. A thin flexible tube (catheter) is inserted into a blood vessel in the wrist or groin and guided to the coronary arteries. A special dye is injected directly into the arteries, and X-ray images show exactly where and how severely each artery is blocked. This procedure also allows immediate treatment (PCI/stenting) during the same session."),
gap(),
makeTable(
["Diagnostic Tool", "Invasive?", "Radiation?", "Best Used For"],
[
["Resting ECG", "No", "No", "First-line screening; acute MI detection"],
["Cardiac Troponin (blood test)", "Minor (blood draw)", "No", "Confirming MI - gold standard biomarker"],
["Echocardiogram", "No", "No", "Wall motion, ejection fraction, structure"],
["Exercise Stress Test (TMT)", "No", "No", "Low-risk patient screening"],
["SPECT/PET Nuclear Scan", "No (injection)", "Yes (low)", "Localising ischemia, viability testing"],
["CT Coronary Angiography (CCTA)", "No", "Yes (moderate)", "Non-invasive plaque/stenosis assessment"],
["Invasive Coronary Angiography", "YES", "Yes", "GOLD STANDARD - diagnosis + treatment"]
]
),
// ── CHAPTER V ────────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter V: Treatment - A Complete Guide"),
body("Treatment of CAD has three pillars: Lifestyle Modification, Pharmacotherapy (medicines), and Revascularisation (restoring blood flow). The intensity of treatment depends on the severity of blockage, symptoms, and risk profile."),
heading2("5.1 Lifestyle Modifications - The Foundation of Treatment"),
body("Even the best medicines cannot replace a healthy lifestyle. These changes are universally recommended:"),
bullet("Smoking cessation - smoking doubles CAD risk; quitting reduces risk by 50% within 1 year"),
bullet("Cardiac diet - low saturated fat, low sodium, high fibre (Mediterranean diet is most evidence-based)"),
bullet("Regular aerobic exercise - 30 minutes of moderate intensity exercise at least 5 days per week"),
bullet("Weight management - achieving and maintaining a healthy BMI reduces BP, LDL, and diabetes risk"),
bullet("Stress reduction - chronic psychological stress elevates cortisol, promotes hypertension and clotting"),
bullet("Blood pressure control - target below 130/80 mmHg"),
bullet("Diabetes management - tight glucose control reduces microvascular damage and slows plaque progression"),
heading2("5.2 Pharmacotherapy (Medicines)"),
heading3("A. Antiplatelet Agents - Preventing Blood Clots"),
makeTable(
["Drug", "How It Works", "Clinical Use"],
[
["Aspirin (75-100 mg/day)", "Irreversibly blocks COX-1 enzyme; reduces platelet clumping", "Cornerstone therapy for all CAD patients; reduces MI and stroke risk by ~25%"],
["Clopidogrel (P2Y12 inhibitor)", "Blocks ADP receptor on platelets; prevents clot formation", "Used alone if aspirin intolerant; combined with aspirin (DAPT) after PCI/stenting for 6-12 months"],
["Ticagrelor / Prasugrel", "More potent P2Y12 inhibitors; faster onset than clopidogrel", "Preferred in acute coronary syndromes (ACS) for more powerful platelet inhibition"]
]
),
heading3("B. Statins (HMG-CoA Reductase Inhibitors) - Cholesterol Lowering"),
body("Statins are arguably the most important class of drugs in CAD management. They lower LDL cholesterol by blocking its production in the liver and have proven mortality benefits independent of cholesterol levels (anti-inflammatory effects, plaque stabilisation). High-intensity statins (Atorvastatin 40-80 mg, Rosuvastatin 20-40 mg) are first-line for all patients with established CAD."),
heading3("C. Beta-Blockers - Reducing Cardiac Workload"),
body("Beta-blockers (Metoprolol, Bisoprolol, Carvedilol) block adrenaline (epinephrine) receptors in the heart. They slow the heart rate, reduce blood pressure, and decrease how hard the heart contracts - all of which reduce oxygen demand. They are first-line for stable angina symptoms and are mandatory after a heart attack to prevent sudden death."),
heading3("D. ACE Inhibitors / ARBs - Protecting the Heart"),
body("Angiotensin-converting enzyme (ACE) inhibitors (Ramipril, Lisinopril) and ARBs (Losartan, Valsartan) lower blood pressure, reduce strain on the heart, and prevent adverse remodelling (scarring) after an MI. They are especially important in patients with diabetes, heart failure, or reduced ejection fraction."),
heading3("E. Nitrates - Immediate Symptom Relief"),
body("Nitrates (nitroglycerin) dilate (widen) coronary arteries and reduce the amount of blood the heart has to pump, relieving angina rapidly. Short-acting nitrates (sublingual nitroglycerin tablet or spray) are taken under the tongue during angina attacks, providing relief within 1-3 minutes. Long-acting nitrates (isosorbide mononitrate) are used regularly to prevent frequent angina episodes."),
gap(),
makeTable(
["Drug Class", "Examples", "Primary Benefit", "Key Side Effect"],
[
["Antiplatelets", "Aspirin, Clopidogrel, Ticagrelor", "Prevent blood clots", "Bleeding risk"],
["Statins", "Atorvastatin, Rosuvastatin", "Lower LDL, stabilise plaque", "Muscle pain (myopathy, rare)"],
["Beta-Blockers", "Metoprolol, Bisoprolol, Carvedilol", "Reduce heart rate/workload", "Fatigue, cold extremities, bradycardia"],
["ACE Inhibitors", "Ramipril, Lisinopril, Enalapril", "Protect heart/kidney, lower BP", "Dry cough (switch to ARB)"],
["ARBs", "Losartan, Valsartan, Candesartan", "Same as ACE-I, no cough", "Hyperkalaemia"],
["Nitrates", "GTN spray, Isosorbide mononitrate", "Relieve angina symptoms", "Headache, hypotension"]
]
),
heading2("5.3 Interventional Cardiology - Percutaneous Coronary Intervention (PCI)"),
body("PCI, commonly called angioplasty or 'stenting,' is a minimally invasive procedure performed in a cardiac catheterisation laboratory. No open surgery is required."),
boldBullet("Step 1", "A catheter with a tiny deflated balloon at its tip is guided to the blocked artery through the wrist or groin"),
boldBullet("Step 2", "The balloon is inflated, compressing the plaque against the artery wall and reopening the vessel"),
boldBullet("Step 3", "A metal mesh tube called a stent is deployed at the site to keep the artery open permanently"),
boldBullet("Step 4", "Drug-Eluting Stents (DES) are coated with medicine that slowly releases to prevent scar tissue from re-blocking the stent (restenosis)"),
body("Dual antiplatelet therapy (aspirin + a P2Y12 inhibitor) is mandatory for 6-12 months after stenting to prevent clot formation inside the stent."),
gap(),
makeTable(
["Type of Stent", "Description", "Duration of DAPT Required"],
[
["Bare Metal Stent (BMS)", "Plain metal mesh - older technology", "1 month minimum"],
["Drug-Eluting Stent (DES) - 1st Gen", "Metal coated with Paclitaxel/Sirolimus", "12 months"],
["Drug-Eluting Stent (DES) - 2nd Gen", "Improved polymer; Everolimus/Zotarolimus", "6-12 months"]
]
),
heading2("5.4 Surgical Management - Coronary Artery Bypass Grafting (CABG)"),
body("CABG (bypass surgery) is open-heart surgery in which the surgeon creates new pathways (bypasses) around the blocked coronary arteries using blood vessels taken from elsewhere in the patient's own body."),
heading3("Graft Selection - Which Blood Vessel Is Used?"),
makeTable(
["Graft Type", "Source", "10-Year Patency Rate", "Notes"],
[
["LIMA (Left Internal Mammary Artery)", "Artery from inside the chest wall", "~95% (GOLD STANDARD)", "Always preferred for the main LAD artery blockage"],
["RIMA (Right Internal Mammary Artery)", "Similar chest wall artery", "~90%", "Used in bilateral IMA grafting (younger patients, no diabetes)"],
["Radial Artery", "Forearm artery", "~85%", "Good second arterial choice"],
["Saphenous Vein Graft (SVG)", "Leg vein", "~60% at 10 years", "Readily available but lower durability"]
]
),
heading3("When Is CABG Preferred Over PCI?"),
bullet("Left main coronary artery disease (blocks blood to most of the left heart)"),
bullet("Three-vessel disease with complex anatomy"),
bullet("Two-vessel disease including proximal Left Anterior Descending (LAD) artery"),
bullet("Patients with diabetes and multi-vessel disease (CABG has proven superiority in this group)"),
bullet("Patients with heart failure and reduced ejection fraction"),
gap(),
calloutBox("TREATMENT DECISION SUMMARY", [
"Low-risk (single vessel, stable angina): Medical therapy alone; PCI may relieve symptoms but does not improve survival",
"Moderate-risk (multivessel, normal pump function): PCI and CABG are broadly equivalent; decision based on anatomy",
"High-risk (left main, 3-vessel, diabetes, low ejection fraction): CABG has proven survival benefit",
"Acute MI (STEMI): Emergency PCI within 90 minutes of symptom onset is the treatment of choice"
]),
// ── CHAPTER VI ───────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter VI: Prevention & Long-Term Prognosis"),
heading2("6.1 Primary Prevention (Before Disease Develops)"),
body("The best treatment is prevention. Key evidence-based primary prevention strategies:"),
bullet("Know your numbers: Check blood pressure, cholesterol (LDL, HDL, triglycerides), blood sugar, and BMI annually"),
bullet("Do not smoke - smoking is the single most preventable cause of CAD"),
bullet("Exercise regularly - 150 minutes of moderate-intensity aerobic exercise per week"),
bullet("Maintain healthy weight - each 5 kg of weight loss reduces blood pressure by ~5 mmHg"),
bullet("Control diabetes early - HbA1c below 7% significantly reduces cardiovascular events"),
bullet("Statins for primary prevention in high-risk individuals (ASCVD 10-year risk > 7.5% per ACC/AHA guidelines)"),
bullet("Aspirin: Now recommended ONLY for specific high-risk patients; general use reconsidered due to bleeding risk (2022 USPSTF guidance)"),
heading2("6.2 Secondary Prevention (After Diagnosis / Heart Attack)"),
body("After a confirmed CAD diagnosis or heart attack, all patients should receive:"),
bullet("Lifelong aspirin (unless contraindicated)"),
bullet("High-intensity statin therapy (Atorvastatin 40-80 mg or Rosuvastatin 20-40 mg)"),
bullet("Beta-blocker for at least 12 months post-MI, longer if reduced ejection fraction"),
bullet("ACE inhibitor or ARB for heart protection"),
bullet("Annual cardiology follow-up with echocardiogram monitoring"),
bullet("Cardiac rehabilitation programme - supervised exercise and education"),
heading2("6.3 Prognosis & Statistics"),
makeTable(
["Statistic", "Data"],
[
["Global annual deaths from CAD", "~9 million (WHO 2024 estimate)"],
["Risk of MI/death per year with stable angina", "Approximately 3% per year"],
["30-day mortality of STEMI (without treatment)", "30-40%"],
["30-day mortality of STEMI (with rapid PCI)", "3-7%"],
["10-year survival after successful CABG", "~70-85% (varies with risk factors)"],
["LDL reduction per doubling of statin dose", "Additional ~6% reduction (diminishing returns)"],
["Risk reduction with smoking cessation", "~50% CAD risk reduction within 1-2 years"]
]
),
// ── REFERENCES ────────────────────────────────────────────────────────────────
pageBreak(),
heading1("References & Citations"),
heading2("Textbooks"),
bullet("Sabiston Textbook of Surgery: The Biological Basis of Modern Surgical Practice, 21st Edition (Elsevier, 2022). Chapter 111: Coronary Artery Disease. pp. 2482-2510."),
bullet("Guyton and Hall Textbook of Medical Physiology, 14th Edition (Elsevier, 2021). Chapter 69: Atherosclerosis, Coronary Disease, and Cardiac Rehabilitation. pp. 849-857."),
bullet("Fuster and Hurst's The Heart, 15th Edition (McGraw-Hill, 2022). Chapter: Atherosclerosis and Coronary Artery Disease."),
bullet("Symptom to Diagnosis: An Evidence-Based Guide, 4th Edition (McGraw-Hill, 2020). Chapter: Chest Pain / Stable & Unstable Angina. pp. 165-175."),
bullet("Goodman & Gilman's The Pharmacological Basis of Therapeutics, 13th Edition (McGraw-Hill, 2018). Chapter: Antiplatelet Agents and Statins."),
bullet("Goldman-Cecil Medicine International Edition, 2-Volume Set, 26th Edition (Elsevier, 2020). Chapter: Acute Coronary Syndrome and Stable Ischemic Heart Disease."),
heading2("Clinical Guidelines"),
bullet("Lawton JS, et al. 2021 ACC/AHA/SCAI Guideline for Coronary Artery Revascularization. J Am Coll Cardiol. 2022;79(2):e21-e129."),
bullet("Knuuti J, et al. 2019 ESC Guidelines for the Diagnosis and Management of Chronic Coronary Syndromes. Eur Heart J. 2020;41(3):407-477."),
bullet("Grundy SM, et al. 2018 AHA/ACC Guideline on the Management of Blood Cholesterol. J Am Coll Cardiol. 2019;73(24):e285-e350."),
bullet("Whelton PK, et al. 2017 ACC/AHA Guideline for the Prevention, Detection, Evaluation, and Management of High Blood Pressure in Adults. Hypertension. 2018;71(6):e13-e115."),
heading2("Recent Peer-Reviewed Literature (PubMed, 2023-2026)"),
bullet("Jalilian N, Pakzad R, Shahbazi M. Circulating FABP-4 Levels in Patients with Atherosclerosis or CAD: A Systematic Review and Meta-Analysis. Cardiovasc Ther. 2023. PMID: 38024104."),
bullet("Martignoni FV, et al. The association of lipoprotein(a) and coronary artery calcium in asymptomatic patients: a systematic review and meta-analysis. Eur J Prev Cardiol. 2024. PMID: 38300625."),
bullet("Mosquera JV, et al. Integrative single-cell meta-analysis reveals disease-relevant vascular cell states and markers in human atherosclerosis. Cell Rep. 2023. PMID: 37950869."),
gap(),
// Disclaimer - no branding
new Paragraph({
border: { top: { color: BORDER_GRAY, style: BorderStyle.SINGLE, size: 4 } },
spacing: { before: 160, after: 60 },
children: [new TextRun({
text: "Disclaimer: This report is prepared for educational and informational purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment. Always consult a qualified healthcare provider for medical decisions.",
size: 18, color: GRAY_TEXT, italics: true, font: "Calibri"
})]
}),
];
// ─── ASSEMBLE - no Header branding, only neutral page number footer ────────
const doc = new Document({
creator: "",
title: "Comprehensive Research Report on Heart Blockage & CAD",
description: "Pathophysiology, Risk Factors, Symptoms, Diagnosis and Treatment of Coronary Artery Disease",
styles: {
default: {
document: { run: { font: "Calibri", size: 21 } }
}
},
sections: [{
properties: {
page: {
margin: { top: 900, bottom: 900, left: 1080, right: 900 }
}
},
// NO header - removed branding
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { color: BORDER_GRAY, style: BorderStyle.SINGLE, size: 4 } },
children: [
new TextRun({ text: "Page ", size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ text: " of ", size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 18, color: GRAY_TEXT, font: "Calibri" })
]
})
]
})
},
children
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report_v2.docx', buffer);
console.log('SUCCESS');
}).catch(err => {
console.error('ERROR:', err);
process.exit(1);
});
cd /home/daytona/workspace/cad-report && node generate_report_v2.js 2>&1
cp /home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report_v2.docx /tmp/cad…
cp /tmp/cad_v2.pdf /home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report_…
Heart Blockage CAD Report Final
PDF Document · PDF
spacer(2), spacer(3) calls that were generating large empty paragraphs between sectionsspacing: { before, after } values on headings, body text, and tables by ~50%margins: { top: 200, bottom: 200 } on every table (now top: 100, bottom: 100)spacer() gaps between sections with a minimal gap() function (40pt before/after instead of 200pt)Please remove Clinical Guidelines and Recent Peer-Reviewed Literature (PubMed, 2023-2026) and disclaimers also and please add some graphics Of atherosclerosis and cad
mkdir -p /home/daytona/workspace/cad-report/images && cd /home/daytona/workspace…
~/cad-report/generate_report_v3.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, BorderStyle, WidthType, ShadingType,
PageNumber, PageBreak, Footer, ImageRun
} = require('docx');
const fs = require('fs');
const path = require('path');
const DARK_BLUE = "1B3A6B";
const MID_BLUE = "2B6CB0";
const ACCENT_BLUE = "3182CE";
const LIGHT_BLUE = "EBF4FF";
const WHITE = "FFFFFF";
const DARK_TEXT = "1A202C";
const GRAY_TEXT = "4A5568";
const LIGHT_GRAY = "F7FAFC";
const BORDER_GRAY = "CBD5E0";
const RED_ACCENT = "C53030";
const IMG_DIR = path.join(__dirname, 'images');
// ── HELPERS ──────────────────────────────────────────────────────────────────
function heading1(text) {
return new Paragraph({
spacing: { before: 260, after: 120 },
border: { bottom: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 6 } },
children: [new TextRun({ text, bold: true, size: 30, color: DARK_BLUE, font: "Calibri" })]
});
}
function heading2(text) {
return new Paragraph({
spacing: { before: 180, after: 80 },
children: [new TextRun({ text, bold: true, size: 25, color: MID_BLUE, font: "Calibri" })]
});
}
function heading3(text) {
return new Paragraph({
spacing: { before: 140, after: 60 },
children: [new TextRun({ text, bold: true, size: 22, color: ACCENT_BLUE, font: "Calibri" })]
});
}
function body(text) {
return new Paragraph({
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 21, color: DARK_TEXT, font: "Calibri" })]
});
}
function bullet(text) {
return new Paragraph({
bullet: { level: 0 },
spacing: { before: 40, after: 40 },
children: [new TextRun({ text, size: 20, color: DARK_TEXT, font: "Calibri" })]
});
}
function boldBullet(label, text) {
return new Paragraph({
bullet: { level: 0 },
spacing: { before: 50, after: 40 },
children: [
new TextRun({ text: label + ": ", bold: true, size: 20, color: MID_BLUE, font: "Calibri" }),
new TextRun({ text, size: 20, color: DARK_TEXT, font: "Calibri" })
]
});
}
function gap() {
return new Paragraph({ text: "", spacing: { before: 40, after: 40 } });
}
function pageBreak() {
return new Paragraph({ children: [new PageBreak()] });
}
function noBorder() {
return { color: "FFFFFF", style: BorderStyle.NONE, size: 0 };
}
function makeBorders(color) {
const b = { color, style: BorderStyle.SINGLE, size: 4 };
return { top: b, bottom: b, left: b, right: b };
}
function calloutBox(title, lines, bg = LIGHT_BLUE) {
const rows = [];
rows.push(new TableRow({
children: [new TableCell({
shading: { fill: MID_BLUE, type: ShadingType.CLEAR },
borders: { top: noBorder(), bottom: noBorder(), left: noBorder(), right: noBorder() },
children: [new Paragraph({
children: [new TextRun({ text: title, bold: true, size: 21, color: WHITE, font: "Calibri" })],
spacing: { before: 60, after: 60 }, indent: { left: 120 }
})]
})]
}));
lines.forEach(line => {
rows.push(new TableRow({
children: [new TableCell({
shading: { fill: bg, type: ShadingType.CLEAR },
borders: { top: noBorder(), bottom: noBorder(), right: noBorder(), left: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 12 } },
children: [new Paragraph({
children: [new TextRun({ text: line, size: 20, color: DARK_TEXT, font: "Calibri" })],
spacing: { before: 50, after: 50 }, indent: { left: 120 }
})]
})]
}));
});
return new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, rows, margins: { top: 80, bottom: 100 } });
}
function makeTable(headers, rows, headerBg = DARK_BLUE) {
const headerRow = new TableRow({
tableHeader: true,
children: headers.map(h => new TableCell({
shading: { fill: headerBg, type: ShadingType.CLEAR },
borders: makeBorders(BORDER_GRAY),
children: [new Paragraph({
children: [new TextRun({ text: h, bold: true, size: 19, color: WHITE, font: "Calibri" })],
spacing: { before: 60, after: 60 }, indent: { left: 80 }
})]
}))
});
const dataRows = rows.map((row, i) => new TableRow({
children: row.map(cell => new TableCell({
shading: { fill: i % 2 === 0 ? LIGHT_GRAY : WHITE, type: ShadingType.CLEAR },
borders: makeBorders(BORDER_GRAY),
children: [new Paragraph({
children: [new TextRun({ text: cell, size: 19, color: DARK_TEXT, font: "Calibri" })],
spacing: { before: 60, after: 60 }, indent: { left: 80 }
})]
}))
}));
return new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, rows: [headerRow, ...dataRows], margins: { top: 100, bottom: 100 } });
}
// ── IMAGE HELPER ──────────────────────────────────────────────────────────────
function imageBlock(filename, captionText, widthEmu = 5400000, heightEmu = 3200000) {
const imgPath = path.join(IMG_DIR, filename);
const imgBuf = fs.readFileSync(imgPath);
const ext = filename.split('.').pop().toLowerCase();
const typeMap = { png: 'png', jpg: 'jpeg', jpeg: 'jpeg', gif: 'gif' };
return [
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 100, after: 60 },
children: [
new ImageRun({
data: imgBuf,
transformation: { width: Math.round(widthEmu / 9144), height: Math.round(heightEmu / 9144) },
type: typeMap[ext] || 'png'
})
]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 100 },
children: [new TextRun({ text: captionText, size: 17, color: GRAY_TEXT, italics: true, font: "Calibri" })]
})
];
}
// ── TITLE PAGE ────────────────────────────────────────────────────────────────
function titlePage() {
return [
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 400, after: 60 },
children: [new TextRun({ text: "COMPREHENSIVE RESEARCH REPORT", bold: true, size: 38, color: DARK_BLUE, font: "Calibri", allCaps: true })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 160 },
border: { bottom: { color: MID_BLUE, style: BorderStyle.SINGLE, size: 10 } },
children: [new TextRun({ text: "Heart Blockage & Coronary Artery Disease (CAD)", bold: true, size: 32, color: MID_BLUE, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 100, after: 60 },
children: [new TextRun({ text: "Pathophysiology | Risk Factors | Symptoms | Diagnosis | Treatment", size: 22, color: GRAY_TEXT, italics: true, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 60 },
children: [new TextRun({ text: "Prepared for: Healthcare Clients, Medical Researchers & Informed Patients", size: 21, color: GRAY_TEXT, font: "Calibri" })]
}),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 40, after: 40 },
children: [new TextRun({ text: "Date: July 2026", size: 21, color: GRAY_TEXT, font: "Calibri" })]
}),
pageBreak()
];
}
// ── DOCUMENT BODY ─────────────────────────────────────────────────────────────
const children = [
...titlePage(),
// ─ CHAPTER I ──────────────────────────────────────────────────────────────
heading1("Chapter I: Clinical Introduction & Pathophysiology"),
heading2("1.1 What is Heart Blockage / Coronary Artery Disease?"),
body("Coronary Artery Disease (CAD), also called heart blockage, ischemic heart disease, or atherosclerotic cardiovascular disease, is a condition in which the arteries that supply blood to the heart muscle (the coronary arteries) become narrowed or blocked. This happens because of the gradual build-up of fatty deposits called plaques inside the artery wall. Over many years, these plaques can restrict blood flow, starve the heart of oxygen, and trigger a heart attack."),
body("CAD is the single leading cause of death worldwide. According to the World Health Organization (WHO), ischemic heart disease accounts for approximately 16% of all deaths globally. In simple terms: think of a water pipe slowly getting clogged with grease. As the clog grows, less water flows through - and if the pipe completely blocks, the water supply stops entirely."),
heading2("1.2 Step-by-Step Mechanism of Atherosclerosis (How Plaque Forms)"),
body("The disease develops through a series of well-understood biological steps:"),
boldBullet("Step 1 - Endothelial Damage", "The inner lining of a coronary artery (the endothelium) is a single layer of cells that act like a protective wall. High blood pressure, high cholesterol, cigarette smoke, and blood sugar damage this lining. The damaged endothelium produces less nitric oxide (NO) - the natural compound that keeps vessels relaxed and smooth."),
boldBullet("Step 2 - LDL Cholesterol Accumulates", "Bad cholesterol (LDL) in the blood slips through the damaged endothelium into the arterial wall. Once inside, LDL is chemically modified (oxidised) and becomes even more dangerous."),
boldBullet("Step 3 - Macrophage Recruitment", "The immune system detects the damage and sends white blood cells called monocytes to the site. These monocytes enter the artery wall, transform into macrophages, and try to 'eat' the oxidised LDL."),
boldBullet("Step 4 - Foam Cell Formation", "When macrophages swallow too much oxidised LDL, they swell and take on a foamy appearance - hence the name foam cells. These foam cells die and their contents accumulate, forming what we call a fatty streak - the earliest visible sign of atherosclerosis."),
boldBullet("Step 5 - Smooth Muscle Cell Proliferation", "Growth factors and cytokines (inflammatory signalling molecules) stimulate smooth muscle cells to migrate from the middle layer (media) to the inner layer (intima). These cells produce collagen and other proteins, creating a fibrous cap over the fatty core. The result is a mature atherosclerotic plaque."),
boldBullet("Step 6 - Plaque Growth and Stenosis", "The plaque bulges inward, progressively narrowing the artery lumen. Calcium deposits can harden the plaque, making arteries rigid (often called 'hardening of the arteries' or arteriosclerosis)."),
gap(),
// IMAGE 1: CAD Pathophysiology Flowchart
...imageBlock("cad_pathophysiology_flowchart.png",
"Figure 1. Proposed pathophysiology of CAD: endothelial dysfunction leads through inflammation and plaque formation to ischemia and adverse cardiac events. (Source: Sabiston Textbook of Surgery, 21st Ed.)",
3200000, 5400000),
// IMAGE 2: Monocyte / Artery cross-section
...imageBlock("artery_monocyte.png",
"Figure 2. Cross-section of a coronary artery showing monocyte adhesion, LDL accumulation, macrophage transformation, and foam cell formation during early atherosclerosis. (Source: Guyton & Hall Medical Physiology, 14th Ed.)",
5800000, 3600000),
heading2("1.3 Stable Plaque vs. Vulnerable / Unstable Plaque"),
body("Not all plaques are equally dangerous. The critical distinction is between stable plaques and vulnerable (unstable) plaques:"),
gap(),
makeTable(
["Feature", "Stable Plaque", "Vulnerable / Unstable Plaque"],
[
["Fibrous cap", "Thick and strong", "Thin and weak"],
["Lipid core", "Small", "Large"],
["Inflammatory cells", "Few", "Many (macrophages, T cells)"],
["Risk of rupture", "Low", "HIGH"],
["Clinical outcome", "Stable angina", "Heart attack (MI), Sudden death"],
]
),
gap(),
// IMAGE 3: Plaque progression (normal -> small plaque -> large plaque -> thrombosis)
...imageBlock("plaque_progression.png",
"Figure 3. Development of atherosclerotic plaque: progression from a normal artery to small plaque, large plaque, and ultimately thrombosis of a ruptured plaque causing acute coronary syndrome. (Source: Guyton & Hall Medical Physiology, 14th Ed.)",
5800000, 3400000),
body("When a vulnerable plaque ruptures, blood contacts the fatty core and a blood clot (thrombus) forms instantly. This clot can completely block the artery - the primary mechanism of most heart attacks. Three triggers exist: (1) Plaque Rupture - the fibrous cap tears open; (2) Plaque Erosion - the outer surface wears away without full rupture; (3) Calcified Nodule - hard calcium deposits break through the cap into the lumen."),
gap(),
// IMAGE 4: Calcified nodule histology
...imageBlock("calcified_nodule.png",
"Figure 4. Histological cross-section showing calcified nodule plaque: calcific fragments disrupt through the luminal surface causing thrombosis. One of the three mechanisms of acute coronary syndrome. (Source: Braunwald's Heart Disease, 12th Ed.)",
5600000, 2800000),
// ─ CHAPTER II ─────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter II: Risk Factors & Progression Stages"),
heading2("2.1 Modifiable Risk Factors (Things You CAN Change)"),
body("These are the risk factors a person can control through lifestyle changes or medication:"),
gap(),
makeTable(
["Risk Factor", "How It Damages the Heart", "Target / Goal"],
[
["Hypertension (High Blood Pressure)", "Mechanical stress tears the endothelial lining; accelerates plaque formation", "< 130/80 mmHg"],
["Dyslipidaemia (High LDL / Low HDL)", "LDL enters damaged artery wall, oxidises, forms foam cells", "LDL < 70 mg/dL in high-risk patients"],
["Diabetes Mellitus", "High glucose glycates LDL making it more atherogenic; oxidative stress increases", "HbA1c < 7%"],
["Cigarette Smoking", "Nicotine and CO damage endothelium; reduce NO; increase platelet stickiness", "Complete cessation"],
["Obesity / Sedentary Lifestyle", "Promotes insulin resistance, high triglycerides, inflammation, hypertension", "BMI < 25 kg/m²"],
["Metabolic Syndrome", "Cluster of central obesity + high BP + high glucose + abnormal lipids", "Treat each component"]
]
),
heading2("2.2 Non-Modifiable Risk Factors (Things You CANNOT Change)"),
boldBullet("Age", "Risk rises steadily with age. Men > 45 years and women > 55 years are at higher baseline risk."),
boldBullet("Sex / Gender", "Men develop CAD roughly 10 years earlier than women. However, women catch up after menopause due to loss of oestrogen's protective effect."),
boldBullet("Family History (Genetics)", "Having a first-degree relative (parent, sibling) with CAD before age 55 (men) or 65 (women) doubles your risk. Genetic variants affecting LDL receptors (familial hypercholesterolaemia) are particularly dangerous."),
boldBullet("Ethnicity", "South Asians have among the highest risk globally, often developing CAD a decade earlier and with more severe disease patterns."),
heading2("2.3 Blockage Severity: Clinical Classification"),
body("Cardiologists classify artery blockage by the percentage of the lumen (inner opening) that is narrowed:"),
gap(),
makeTable(
["Category", "% Blockage", "Clinical Impact", "Typical Symptoms"],
[
["Mild", "< 40%", "Minimal restriction to blood flow at rest", "Usually none; may appear during heavy exertion"],
["Moderate", "40% - 70%", "Significant but not complete obstruction", "Chest pain / tightness on exertion (stable angina)"],
["Severe", "> 70%", "Critical reduction in blood flow", "Chest pain at rest, heart failure, risk of MI"],
["Complete Occlusion", "100%", "Total blockage", "Heart attack (STEMI/NSTEMI), cardiogenic shock"]
]
),
// ─ CHAPTER III ────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter III: Symptoms & Clinical Presentation"),
heading2("3.1 Angina Pectoris: Chest Pain Explained"),
body("The word 'angina pectoris' simply means chest pain. It is the most common warning sign that the heart is not getting enough blood. There are two main types:"),
gap(),
calloutBox("STABLE ANGINA - The Predictable Warning", [
"Triggered by: Physical exertion, emotional stress, cold weather",
"Character: Pressure, squeezing, heaviness in the centre of the chest",
"Duration: Usually 2-10 minutes; relieved by rest or nitroglycerin",
"Pattern: Predictable, reproducible - same triggers, same relief",
"Simple analogy: Like a clogged pipe that flows fine at rest but can't keep up when demand increases"
]),
gap(),
calloutBox("UNSTABLE ANGINA - The Emergency Warning", [
"Triggered by: Minimal exertion or even at REST - this is the danger sign",
"Character: More severe, longer-lasting (> 20 minutes), not fully relieved by rest",
"Pattern: Unpredictable, new onset, or worsening of previous stable angina",
"Significance: Indicates plaque rupture may be imminent - MEDICAL EMERGENCY",
"Action required: Call emergency services immediately"
], "FFF5F5"),
gap(),
heading2("3.2 Full Symptom List"),
makeTable(
["Symptom", "Description", "Who Is Most Affected"],
[
["Chest pain / pressure", "Classic crushing, squeezing, or tightness behind the breastbone", "All patients, most common"],
["Shortness of breath (Dyspnea)", "Difficulty breathing, especially with exertion; heart cannot pump efficiently", "Common in moderate-severe CAD"],
["Radiating pain", "Pain spreads to left arm, shoulder, jaw, neck, or back", "Classic in men; may be the only symptom in some"],
["Diaphoresis (Cold sweats)", "Sudden cold, clammy sweating without physical cause; sign of ischemia", "During acute events"],
["Nausea / vomiting", "Nausea, especially with inferior wall MI affecting vagal nerves", "During acute MI"],
["Fatigue", "Unusual tiredness; heart working harder to compensate", "Women, diabetics, elderly"],
["Palpitations / Dizziness", "Irregular heartbeat; reduced cardiac output to brain", "During arrhythmias from ischemia"]
]
),
heading2("3.3 Atypical Presentations - Women, Diabetics & the Elderly"),
body("A critical clinical fact: Up to 30% of patients - especially women, people with diabetes, and the elderly - do NOT present with classic chest pain. Their symptoms may include:"),
bullet("Unexplained fatigue or weakness (most common in women)"),
bullet("Pain in the jaw, neck, back, or right arm (not the typical left arm)"),
bullet("Indigestion-like discomfort mistaken for stomach problems"),
bullet("Nausea or vomiting without obvious cause"),
bullet("Silent ischemia - no symptoms at all, discovered only on ECG or stress test (especially in diabetics due to nerve damage)"),
body("This is why heart disease in women is often diagnosed later and carries a worse prognosis. Any unexplained breathlessness, jaw pain, or fatigue in a middle-aged or older woman requires cardiac evaluation."),
// ─ CHAPTER IV ─────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter IV: Diagnosis - How Doctors Detect Heart Blockage"),
heading2("4.1 Electrocardiogram (ECG / EKG)"),
body("An ECG records the electrical activity of the heart using small stickers (electrodes) placed on the skin. It is quick, painless, and often the first test done."),
boldBullet("ST-Segment Elevation (STEMI)", "Indicates complete coronary blockage - medical emergency requiring immediate intervention"),
boldBullet("ST-Segment Depression", "Indicates partial blockage or ischemia (insufficient blood flow)"),
boldBullet("T-Wave Changes", "Inverted T-waves suggest ischemia or past infarction"),
boldBullet("Pathological Q-Waves", "Sign of old heart attack (dead heart tissue)"),
body("Limitation: A normal ECG at rest does NOT rule out CAD - up to 50% of patients with stable CAD have a normal resting ECG."),
heading2("4.2 Cardiac Biomarkers (Blood Tests)"),
makeTable(
["Biomarker", "What It Measures", "When It Rises", "Clinical Use"],
[
["Troponin I / Troponin T", "Protein released when heart muscle cells die", "3-6 hours after MI, peaks at 12-24 hours", "GOLD STANDARD for diagnosing MI; high sensitivity"],
["CK-MB", "Enzyme from heart muscle", "3-8 hours after MI", "Used when troponin not available; less specific"],
["BNP / NT-proBNP", "Released by heart when under pressure/stretch", "With heart failure", "Assess pump function in CAD with HF"]
]
),
heading2("4.3 Echocardiography (Heart Ultrasound)"),
body("An echo uses sound waves to create moving pictures of the heart. It shows how well the heart pumps (ejection fraction), identifies areas of wall motion abnormality (regions of muscle not moving properly due to reduced blood supply), and detects structural damage after an MI. It is safe, radiation-free, and widely available."),
heading2("4.4 Exercise Stress Test (Treadmill / TMT)"),
body("The patient walks on a treadmill while the ECG is monitored. As exercise increases heart rate and demand, areas of ischemia become electrically detectable. A positive test (ST depression > 1 mm during exercise) indicates significant ischemia. Limitation: Sensitivity is only ~70% - used primarily for LOW-risk patient screening."),
heading2("4.5 Nuclear Stress Test / Myocardial Perfusion Imaging (SPECT/PET)"),
body("A small amount of radioactive tracer is injected into the blood. The tracer flows into the heart muscle in proportion to blood flow. Areas with poor blood supply (ischemic zones) or dead tissue (infarcted zones) appear as 'cold spots' on the scan. This test is more accurate than a standard exercise ECG and can precisely map which coronary artery territory is affected."),
heading2("4.6 CT Coronary Angiography (CCTA)"),
body("A non-invasive scan that injects contrast dye through a vein and uses a CT scanner to produce 3D images of the coronary arteries. It can detect: plaque build-up (even before symptoms), degree of stenosis, and calcium scoring (Coronary Artery Calcium or CAC score). A CAC score of zero indicates very low risk; scores above 400 indicate heavy disease burden."),
heading2("4.7 Invasive Coronary Angiography - The Gold Standard"),
body("This is the definitive test for diagnosing and planning treatment of CAD. A thin flexible tube (catheter) is inserted into a blood vessel in the wrist or groin and guided to the coronary arteries. A special dye is injected directly into the arteries, and X-ray images show exactly where and how severely each artery is blocked. This procedure also allows immediate treatment (PCI/stenting) during the same session."),
gap(),
makeTable(
["Diagnostic Tool", "Invasive?", "Radiation?", "Best Used For"],
[
["Resting ECG", "No", "No", "First-line screening; acute MI detection"],
["Cardiac Troponin (blood test)", "Minor (blood draw)", "No", "Confirming MI - gold standard biomarker"],
["Echocardiogram", "No", "No", "Wall motion, ejection fraction, structure"],
["Exercise Stress Test (TMT)", "No", "No", "Low-risk patient screening"],
["SPECT/PET Nuclear Scan", "No (injection)", "Yes (low)", "Localising ischemia, viability testing"],
["CT Coronary Angiography (CCTA)", "No", "Yes (moderate)", "Non-invasive plaque/stenosis assessment"],
["Invasive Coronary Angiography", "YES", "Yes", "GOLD STANDARD - diagnosis + treatment"]
]
),
// ─ CHAPTER V ──────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter V: Treatment - A Complete Guide"),
body("Treatment of CAD has three pillars: Lifestyle Modification, Pharmacotherapy (medicines), and Revascularisation (restoring blood flow). The intensity of treatment depends on the severity of blockage, symptoms, and risk profile."),
heading2("5.1 Lifestyle Modifications"),
bullet("Smoking cessation - smoking doubles CAD risk; quitting reduces risk by 50% within 1 year"),
bullet("Cardiac diet - low saturated fat, low sodium, high fibre (Mediterranean diet is most evidence-based)"),
bullet("Regular aerobic exercise - 30 minutes of moderate intensity exercise at least 5 days per week"),
bullet("Weight management - achieving and maintaining a healthy BMI reduces BP, LDL, and diabetes risk"),
bullet("Stress reduction - chronic psychological stress elevates cortisol, promotes hypertension and clotting"),
bullet("Blood pressure control - target below 130/80 mmHg"),
bullet("Diabetes management - tight glucose control reduces microvascular damage and slows plaque progression"),
heading2("5.2 Pharmacotherapy (Medicines)"),
heading3("A. Antiplatelet Agents - Preventing Blood Clots"),
makeTable(
["Drug", "How It Works", "Clinical Use"],
[
["Aspirin (75-100 mg/day)", "Irreversibly blocks COX-1 enzyme; reduces platelet clumping", "Cornerstone therapy for all CAD patients; reduces MI and stroke risk by ~25%"],
["Clopidogrel (P2Y12 inhibitor)", "Blocks ADP receptor on platelets; prevents clot formation", "Used alone if aspirin intolerant; combined with aspirin (DAPT) after PCI/stenting for 6-12 months"],
["Ticagrelor / Prasugrel", "More potent P2Y12 inhibitors; faster onset than clopidogrel", "Preferred in acute coronary syndromes (ACS) for more powerful platelet inhibition"]
]
),
heading3("B. Statins - Cholesterol Lowering"),
body("Statins are arguably the most important class of drugs in CAD management. They lower LDL cholesterol by blocking its production in the liver and have proven mortality benefits independent of cholesterol levels (anti-inflammatory effects, plaque stabilisation). High-intensity statins (Atorvastatin 40-80 mg, Rosuvastatin 20-40 mg) are first-line for all patients with established CAD."),
heading3("C. Beta-Blockers - Reducing Cardiac Workload"),
body("Beta-blockers (Metoprolol, Bisoprolol, Carvedilol) block adrenaline receptors in the heart. They slow the heart rate, reduce blood pressure, and decrease how hard the heart contracts - all of which reduce oxygen demand. They are first-line for stable angina and are mandatory after a heart attack to prevent sudden death."),
heading3("D. ACE Inhibitors / ARBs - Protecting the Heart"),
body("ACE inhibitors (Ramipril, Lisinopril) and ARBs (Losartan, Valsartan) lower blood pressure, reduce strain on the heart, and prevent adverse remodelling (scarring) after an MI. They are especially important in patients with diabetes, heart failure, or reduced ejection fraction."),
heading3("E. Nitrates - Immediate Symptom Relief"),
body("Nitrates (nitroglycerin) dilate (widen) coronary arteries and reduce the amount of blood the heart has to pump, relieving angina rapidly. Short-acting nitrates (sublingual nitroglycerin spray) act within 1-3 minutes. Long-acting nitrates (isosorbide mononitrate) are used regularly to prevent frequent angina episodes."),
gap(),
makeTable(
["Drug Class", "Examples", "Primary Benefit", "Key Side Effect"],
[
["Antiplatelets", "Aspirin, Clopidogrel, Ticagrelor", "Prevent blood clots", "Bleeding risk"],
["Statins", "Atorvastatin, Rosuvastatin", "Lower LDL, stabilise plaque", "Muscle pain (myopathy, rare)"],
["Beta-Blockers", "Metoprolol, Bisoprolol, Carvedilol", "Reduce heart rate/workload", "Fatigue, cold extremities, bradycardia"],
["ACE Inhibitors", "Ramipril, Lisinopril, Enalapril", "Protect heart/kidney, lower BP", "Dry cough (switch to ARB)"],
["ARBs", "Losartan, Valsartan, Candesartan", "Same as ACE-I, no cough", "Hyperkalaemia"],
["Nitrates", "GTN spray, Isosorbide mononitrate", "Relieve angina symptoms", "Headache, hypotension"]
]
),
heading2("5.3 Percutaneous Coronary Intervention (PCI / Stenting)"),
body("PCI, commonly called angioplasty or 'stenting,' is a minimally invasive procedure. A catheter with a tiny deflated balloon is guided to the blocked artery through the wrist or groin, the balloon is inflated to compress the plaque, and a metal mesh stent is deployed to keep the artery open permanently. Drug-Eluting Stents (DES) release medicine over weeks to prevent scar tissue re-blocking the stent. Dual antiplatelet therapy (DAPT) is mandatory for 6-12 months after stenting."),
gap(),
makeTable(
["Type of Stent", "Description", "Duration of DAPT Required"],
[
["Bare Metal Stent (BMS)", "Plain metal mesh - older technology", "1 month minimum"],
["Drug-Eluting Stent (DES) - 1st Gen", "Metal coated with Paclitaxel/Sirolimus", "12 months"],
["Drug-Eluting Stent (DES) - 2nd Gen", "Improved polymer; Everolimus/Zotarolimus", "6-12 months"]
]
),
heading2("5.4 Coronary Artery Bypass Grafting (CABG)"),
body("CABG (bypass surgery) is open-heart surgery in which the surgeon creates new pathways around blocked coronary arteries using blood vessels taken from elsewhere in the patient's own body (chest wall artery, forearm artery, or leg vein)."),
gap(),
makeTable(
["Graft Type", "Source", "10-Year Patency Rate", "Notes"],
[
["LIMA (Left Internal Mammary Artery)", "Artery from inside the chest wall", "~95% (GOLD STANDARD)", "Always preferred for the main LAD artery blockage"],
["RIMA (Right Internal Mammary Artery)", "Similar chest wall artery", "~90%", "Bilateral IMA grafting (younger patients, no diabetes)"],
["Radial Artery", "Forearm artery", "~85%", "Good second arterial choice"],
["Saphenous Vein Graft (SVG)", "Leg vein", "~60% at 10 years", "Readily available but lower durability"]
]
),
gap(),
calloutBox("TREATMENT DECISION SUMMARY", [
"Low-risk (single vessel, stable angina): Medical therapy alone; PCI may relieve symptoms but does not improve survival",
"Moderate-risk (multivessel, normal pump function): PCI and CABG are broadly equivalent; decision based on anatomy",
"High-risk (left main, 3-vessel, diabetes, low ejection fraction): CABG has proven survival benefit",
"Acute MI (STEMI): Emergency PCI within 90 minutes of symptom onset is the treatment of choice"
]),
// ─ CHAPTER VI ─────────────────────────────────────────────────────────────
pageBreak(),
heading1("Chapter VI: Prevention & Long-Term Prognosis"),
heading2("6.1 Primary Prevention (Before Disease Develops)"),
bullet("Know your numbers: Check blood pressure, cholesterol (LDL, HDL, triglycerides), blood sugar, and BMI annually"),
bullet("Do not smoke - smoking is the single most preventable cause of CAD"),
bullet("Exercise regularly - 150 minutes of moderate-intensity aerobic exercise per week"),
bullet("Maintain healthy weight - each 5 kg of weight loss reduces blood pressure by ~5 mmHg"),
bullet("Control diabetes early - HbA1c below 7% significantly reduces cardiovascular events"),
bullet("Statins for primary prevention in high-risk individuals (ASCVD 10-year risk > 7.5% per ACC/AHA guidelines)"),
heading2("6.2 Secondary Prevention (After Diagnosis / Heart Attack)"),
bullet("Lifelong aspirin (unless contraindicated)"),
bullet("High-intensity statin therapy (Atorvastatin 40-80 mg or Rosuvastatin 20-40 mg)"),
bullet("Beta-blocker for at least 12 months post-MI, longer if reduced ejection fraction"),
bullet("ACE inhibitor or ARB for heart protection"),
bullet("Annual cardiology follow-up with echocardiogram monitoring"),
bullet("Cardiac rehabilitation programme - supervised exercise and education"),
heading2("6.3 Prognosis & Statistics"),
makeTable(
["Statistic", "Data"],
[
["Global annual deaths from CAD", "~9 million (WHO 2024 estimate)"],
["Risk of MI/death per year with stable angina", "Approximately 3% per year"],
["30-day mortality of STEMI (without treatment)", "30-40%"],
["30-day mortality of STEMI (with rapid PCI)", "3-7%"],
["10-year survival after successful CABG", "~70-85% (varies with risk factors)"],
["LDL reduction per doubling of statin dose", "Additional ~6% reduction (diminishing returns)"],
["Risk reduction with smoking cessation", "~50% CAD risk reduction within 1-2 years"]
]
),
// ─ REFERENCES (Textbooks only) ─────────────────────────────────────────────
pageBreak(),
heading1("References"),
heading2("Textbook Sources"),
bullet("Sabiston Textbook of Surgery: The Biological Basis of Modern Surgical Practice, 21st Edition (Elsevier, 2022). Chapter 111: Coronary Artery Disease. pp. 2482-2510."),
bullet("Guyton and Hall Textbook of Medical Physiology, 14th Edition (Elsevier, 2021). Chapter 69: Atherosclerosis, Coronary Disease, and Cardiac Rehabilitation. pp. 849-857."),
bullet("Fuster and Hurst's The Heart, 15th Edition (McGraw-Hill, 2022). Chapter: Atherosclerosis and Coronary Artery Disease."),
bullet("Symptom to Diagnosis: An Evidence-Based Guide, 4th Edition (McGraw-Hill, 2020). Chapter: Chest Pain / Stable & Unstable Angina. pp. 165-175."),
bullet("Goodman & Gilman's The Pharmacological Basis of Therapeutics, 13th Edition (McGraw-Hill, 2018). Chapter: Antiplatelet Agents and Statins."),
bullet("Goldman-Cecil Medicine International Edition, 2-Volume Set, 26th Edition (Elsevier, 2020). Chapter: Acute Coronary Syndrome and Stable Ischemic Heart Disease."),
bullet("Braunwald's Heart Disease: A Textbook of Cardiovascular Medicine, 12th Edition (Elsevier, 2022)."),
];
// ── ASSEMBLE ──────────────────────────────────────────────────────────────────
const doc = new Document({
creator: "",
title: "Comprehensive Research Report on Heart Blockage & CAD",
styles: {
default: { document: { run: { font: "Calibri", size: 21 } } }
},
sections: [{
properties: {
page: { margin: { top: 900, bottom: 900, left: 1080, right: 900 } }
},
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { color: BORDER_GRAY, style: BorderStyle.SINGLE, size: 4 } },
children: [
new TextRun({ text: "Page ", size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ text: " of ", size: 18, color: GRAY_TEXT, font: "Calibri" }),
new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 18, color: GRAY_TEXT, font: "Calibri" })
]
})
]
})
},
children
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report_v3.docx', buffer);
console.log('SUCCESS');
}).catch(err => {
console.error('ERROR:', err.message);
process.exit(1);
});
cd /home/daytona/workspace/cad-report && node generate_report_v3.js 2>&1
cp /home/daytona/workspace/cad-report/Heart_Blockage_CAD_Report_v3.docx /tmp/cad…
Heart Blockage CAD Report v3
PDF Document · PDF
| Figure | Image | Source |
|---|---|---|
| Figure 1 | CAD pathophysiology flowchart (endothelial dysfunction → inflammation → plaque → ischemia → MI) | Sabiston Textbook of Surgery, 21st Ed. |
| Figure 2 | Artery cross-section showing monocyte adhesion, LDL entry, macrophage foam cell formation | Guyton & Hall Medical Physiology, 14th Ed. |
| Figure 3 | Plaque progression diagram: normal artery → small plaque → large plaque → ruptured plaque with thrombosis | Guyton & Hall Medical Physiology, 14th Ed. |
| Figure 4 | Histological section of calcified nodule plaque causing luminal thrombosis | Braunwald's Heart Disease, 12th Ed. |