explain abtianginal drugs
antianginal drugs mechanisms classification pharmacology
| Drug | Heart Rate | Contractility | Vasodilation |
|---|---|---|---|
| Verapamil | ↓↓ | ↓↓ | ↑ |
| Diltiazem | ↓ | ↓ | ↑ |
| Nifedipine/Amlodipine | ↑ (reflex) | minimal | ↑↑ |
| Situation | First-Line | Second-Line |
|---|---|---|
| Chronic stable angina | β-Blocker OR diltiazem/verapamil | Add DHP, long-acting nitrate, ranolazine, ivabradine |
| Vasospastic angina | CCB (DHP or non-DHP) + long-acting nitrate | Avoid β-blockers |
| Angina + low HR | Long-acting DHP | — |
| Angina + HF | Amlodipine (safe), avoid verapamil | Nicorandil, ranolazine |
| Acute attack | Sublingual GTN | IV nitroglycerin (ACS) |
| ACS | Aspirin + anticoagulant + β-blocker + nitrate | Reperfusion |
also give me flashcards
mkdir -p /home/daytona/workspace/antianginal-flashcards
~/antianginal-flashcards/make_flashcards.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Spacer, Paragraph, HRFlowable
)
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.platypus import KeepTogether
OUTPUT = "/home/daytona/workspace/antianginal-flashcards/Antianginal_Drugs_Flashcards.pdf"
# ── Colour palette ────────────────────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1B3A5C")
MID_BLUE = colors.HexColor("#2E6DA4")
LIGHT_BLUE = colors.HexColor("#D6E8F7")
ACCENT = colors.HexColor("#E8F4FD")
GREEN = colors.HexColor("#1A7A4A")
GREEN_LIGHT = colors.HexColor("#D4EDDA")
ORANGE = colors.HexColor("#C05A00")
ORANGE_LIGHT= colors.HexColor("#FFF0D9")
PURPLE = colors.HexColor("#5B2D8E")
PURPLE_LIGHT= colors.HexColor("#EDE3F7")
RED = colors.HexColor("#B22222")
RED_LIGHT = colors.HexColor("#FDECEA")
GREY_LIGHT = colors.HexColor("#F5F5F5")
WHITE = colors.white
styles = getSampleStyleSheet()
# Custom paragraph styles
Q_style = ParagraphStyle(
"Question",
parent=styles["Normal"],
fontSize=10.5,
leading=14,
textColor=DARK_BLUE,
fontName="Helvetica-Bold",
)
A_style = ParagraphStyle(
"Answer",
parent=styles["Normal"],
fontSize=10,
leading=14,
textColor=colors.HexColor("#1A1A1A"),
fontName="Helvetica",
)
LABEL_style = ParagraphStyle(
"Label",
parent=styles["Normal"],
fontSize=7.5,
textColor=WHITE,
fontName="Helvetica-Bold",
alignment=TA_CENTER,
)
TITLE_style = ParagraphStyle(
"Title",
parent=styles["Normal"],
fontSize=20,
leading=26,
textColor=WHITE,
fontName="Helvetica-Bold",
alignment=TA_CENTER,
)
SUBTITLE_style = ParagraphStyle(
"Subtitle",
parent=styles["Normal"],
fontSize=12,
leading=16,
textColor=LIGHT_BLUE,
fontName="Helvetica",
alignment=TA_CENTER,
)
SECTION_style = ParagraphStyle(
"Section",
parent=styles["Normal"],
fontSize=13,
leading=18,
textColor=WHITE,
fontName="Helvetica-Bold",
alignment=TA_CENTER,
)
# ── Flashcard data ────────────────────────────────────────────────────────────
# Each card: (category, label_color, q_bg, question, answer)
CARDS = [
# ── BASICS ────────────────────────────────────────────────────────────────
("BASICS", MID_BLUE, ACCENT,
"What is the core problem in angina pectoris?",
"Mismatch between myocardial O₂ supply and demand.\n"
"Demand > Supply → ischaemia → chest pain."),
("BASICS", MID_BLUE, ACCENT,
"What are the 4 determinants of myocardial O₂ demand?",
"1. Heart rate (chronotropy)\n"
"2. Contractility (inotropy)\n"
"3. Preload (ventricular filling pressure / wall stress)\n"
"4. Afterload (arterial resistance)"),
("BASICS", MID_BLUE, ACCENT,
"Name the 3 types of angina and their main cause.",
"1. Stable (exertional) — fixed atherosclerotic stenosis; demand ↑\n"
"2. Vasospastic (Prinzmetal's) — coronary vasospasm; supply ↓\n"
"3. Unstable angina (ACS) — plaque rupture + thrombosis; supply ↓"),
("BASICS", MID_BLUE, ACCENT,
"What is the first-line drug for an ACUTE angina attack?",
"Sublingual nitroglycerin (GTN) — onset 1–3 min.\n"
"All CAD patients should carry it as standby medication."),
# ── NITRATES ──────────────────────────────────────────────────────────────
("NITRATES", GREEN, GREEN_LIGHT,
"Mechanism of organic nitrates.",
"Bioconverted → Nitric Oxide (NO)\n"
"→ activates soluble guanylyl cyclase\n"
"→ ↑ cGMP → myosin light-chain dephosphorylation\n"
"→ smooth muscle relaxation & vasodilation"),
("NITRATES", GREEN, GREEN_LIGHT,
"Primary vs. secondary haemodynamic effect of nitrates.",
"Primary: VENODILATION → ↓ preload → ↓ wall stress → ↓ O₂ demand\n"
"Secondary (higher doses): Arterial dilation → ↓ afterload\n"
"Also: Direct coronary vasodilation → relieves vasospasm"),
("NITRATES", GREEN, GREEN_LIGHT,
"Examples of organic nitrates and their duration.",
"• Nitroglycerin (GTN) sublingual — 30–60 min\n"
"• GTN patch / spray — 4–8 h\n"
"• Isosorbide dinitrate (ISDN) — 4–6 h\n"
"• Isosorbide mononitrate (ISMN) — 6–10 h"),
("NITRATES", GREEN, GREEN_LIGHT,
"What is nitrate tolerance? How is it prevented?",
"Continuous exposure → loss of efficacy (tolerance).\n"
"Prevention: nitrate-free interval of 8–12 h daily\n"
"(e.g., remove transdermal patch at night)."),
("NITRATES", GREEN, GREEN_LIGHT,
"Key adverse effects of nitrates.",
"• Headache (most common — meningeal vasodilation)\n"
"• Postural hypotension\n"
"• Reflex tachycardia\n"
"• Flushing\n"
"⚠ Contraindicated within 24 h of PDE5 inhibitors → profound hypotension"),
# ── BETA-BLOCKERS ─────────────────────────────────────────────────────────
("β-BLOCKERS", ORANGE, ORANGE_LIGHT,
"Mechanism of beta-blockers in angina.",
"Block β₁ receptors in the heart:\n"
"→ ↓ Heart rate (chronotropy)\n"
"→ ↓ Contractility (inotropy)\n"
"→ ↓ AV conduction velocity\n"
"Net: ↓ myocardial O₂ consumption (especially on exertion)"),
("β-BLOCKERS", ORANGE, ORANGE_LIGHT,
"Which type of angina are β-blockers FIRST-LINE for?",
"Chronic STABLE (exertional) angina.\n"
"Also: Post-MI, angina + HF, angina + hypertension.\n"
"⚠ AVOID in vasospastic angina — unopposed α-activity worsens spasm."),
("β-BLOCKERS", ORANGE, ORANGE_LIGHT,
"Examples of β-blockers used in angina.",
"Cardioselective (β₁): Metoprolol, Atenolol, Bisoprolol\n"
"Non-selective: Propranolol\n"
"α+β blocker: Carvedilol (useful in angina + HF)"),
("β-BLOCKERS", ORANGE, ORANGE_LIGHT,
"Why are β-blockers + nitrates a good combination?",
"Complementary actions:\n"
"• β-blockers block reflex tachycardia from nitrates\n"
"• Nitrates counteract ↑ preload from β-blockade\n"
"• Nitrates alleviate ↑ coronary vascular resistance from β-blockade\n"
"→ Synergistic reduction of O₂ demand"),
("β-BLOCKERS", ORANGE, ORANGE_LIGHT,
"Key adverse effects and contraindications of β-blockers.",
"Side effects: Bradycardia, fatigue, cold extremities,\n"
" bronchoconstriction (non-selective), masks hypoglycaemia\n"
"Contraindications: Severe asthma/COPD, significant bradycardia,\n"
" high-degree AV block, vasospastic angina, decompensated HF"),
# ── CALCIUM CHANNEL BLOCKERS ──────────────────────────────────────────────
("CALCIUM CHANNEL BLOCKERS", PURPLE, PURPLE_LIGHT,
"Mechanism of calcium channel blockers (CCBs).",
"Block voltage-gated L-type Ca²⁺ channels (bind open/inactivated state)\n"
"→ ↓ Ca²⁺ influx into smooth muscle → vasodilation\n"
"→ ↓ Ca²⁺ in cardiac muscle → ↓ contractility, HR, AV conduction"),
("CALCIUM CHANNEL BLOCKERS", PURPLE, PURPLE_LIGHT,
"Difference between DHP and non-DHP CCBs.",
"Dihydropyridines (nifedipine, amlodipine): mainly vascular\n"
" → vasodilation ↑↑, reflex tachycardia, minimal cardiac effect\n\n"
"Non-DHPs (verapamil, diltiazem): cardiac + vascular\n"
" → ↓ HR, ↓ contractility, ↓ AV conduction + vasodilation"),
("CALCIUM CHANNEL BLOCKERS", PURPLE, PURPLE_LIGHT,
"Which CCB sub-class is used for vasospastic angina?",
"BOTH DHPs and non-DHPs are first-line for vasospastic angina.\n"
"They relax coronary smooth muscle and prevent vasospasm.\n"
"Long-acting nitrates are also first-line; β-blockers are avoided."),
("CALCIUM CHANNEL BLOCKERS", PURPLE, PURPLE_LIGHT,
"When do guidelines prefer DHPs over non-DHPs in stable angina?",
"• When heart rate is already LOW\n"
"• When β-blockers are not tolerated or contraindicated\n"
"• DHP + β-blocker combination → for PERSISTENT angina\n"
"⚠ Non-DHPs + β-blockers → risk of severe bradycardia / heart block"),
("CALCIUM CHANNEL BLOCKERS", PURPLE, PURPLE_LIGHT,
"Adverse effects of verapamil vs. nifedipine.",
"Verapamil: Constipation, bradycardia, heart block, ↓ contractility\n"
" ⚠ Avoid in HFrEF\n\n"
"Nifedipine: Peripheral oedema, flushing, reflex tachycardia\n\n"
"Both: Hypotension"),
# ── SECOND-LINE AGENTS ─────────────────────────────────────────────────────
("SECOND-LINE", RED, RED_LIGHT,
"Mechanism of ranolazine.",
"Inhibits late inward Na⁺ current (late Iₙₐ)\n"
"→ ↓ intracellular Na⁺ → ↓ Na⁺/Ca²⁺ exchanger activity\n"
"→ ↓ intracellular Ca²⁺ overload → ↓ diastolic wall tension\n"
"✓ No significant effect on BP or HR"),
("SECOND-LINE", RED, RED_LIGHT,
"Mechanism and advantage of ivabradine.",
"Selectively inhibits HCN (If 'funny') channels in SA node\n"
"→ ↓ heart rate WITHOUT affecting contractility or BP\n"
"Use: Alternative to β-blockers in normal sinus rhythm\n"
"⚠ Avoid combining with β-blockers, verapamil, or diltiazem"),
("SECOND-LINE", RED, RED_LIGHT,
"Mechanism of nicorandil.",
"Dual mechanism:\n"
"1. K⁺-channel opener → arteriolar dilation → ↓ afterload\n"
"2. Nitrate-like action → venodilation → ↓ preload\n"
"Add-on therapy; not available in the US"),
("SECOND-LINE", RED, RED_LIGHT,
"Mechanism of trimetazidine.",
"Metabolic agent — inhibits fatty acid β-oxidation\n"
"→ shifts myocardial fuel to glucose (more O₂-efficient per ATP)\n"
"✓ No haemodynamic effects → safe to combine with all antianginals\n"
"Available mainly in Europe"),
# ── GUIDELINES ────────────────────────────────────────────────────────────
("GUIDELINES", MID_BLUE, ACCENT,
"First-line antianginal treatment per ACC/AHA & ESC guidelines.",
"All CAD patients:\n"
" • Sublingual nitrate (standby) + Aspirin + Statin\n\n"
"Chronic stable angina:\n"
" • β-Blocker (preferred) OR diltiazem/verapamil\n"
" • DHP if HR is low or β-blockers not tolerated\n"
" • β-Blocker + DHP for persistent angina"),
("GUIDELINES", MID_BLUE, ACCENT,
"Second-line antianginal options per ESC guidelines.",
"Add or switch to:\n"
"• Ivabradine\n"
"• Long-acting nitrates\n"
"• Nicorandil\n"
"• Ranolazine\n"
"• Trimetazidine (Europe only)\n\n"
"Ranolazine & trimetazidine can combine with ALL first-line agents."),
("GUIDELINES", MID_BLUE, ACCENT,
"Meta-analysis comparison of the 3 main antianginal classes.",
"β-Blockers > nifedipine: fewer angina episodes/week, fewer withdrawals.\n"
"No significant difference: long-acting nitrates vs. CCBs vs. β-blockers in outcomes.\n"
"→ β-Blockers remain guideline-preferred first-line."),
("GUIDELINES", MID_BLUE, ACCENT,
"Antianginal drug to AVOID in vasospastic angina and why?",
"β-BLOCKERS — avoid!\n"
"β-blockade leaves α-adrenoceptors unopposed\n"
"→ vasoconstriction → worsens coronary vasospasm\n\n"
"Use CCBs and/or long-acting nitrates instead."),
]
CATEGORY_COLORS = {
"BASICS": MID_BLUE,
"NITRATES": GREEN,
"β-BLOCKERS": ORANGE,
"CALCIUM CHANNEL BLOCKERS": PURPLE,
"SECOND-LINE": RED,
"GUIDELINES": MID_BLUE,
}
SECTION_ORDER = [
("BASICS", "Basics of Angina"),
("NITRATES", "Class 1 — Organic Nitrates"),
("β-BLOCKERS", "Class 2 — Beta-Blockers"),
("CALCIUM CHANNEL BLOCKERS", "Class 3 — Calcium Channel Blockers"),
("SECOND-LINE", "Class 4 — Second-Line Agents"),
("GUIDELINES", "Clinical Guidelines"),
]
# ── Build PDF ─────────────────────────────────────────────────────────────────
def build_pdf():
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.5*cm,
rightMargin=1.5*cm,
topMargin=1.5*cm,
bottomMargin=1.5*cm,
)
W = A4[0] - 3*cm # usable width
story = []
# ── Cover block ────────────────────────────────────────────────────────
cover_data = [[Paragraph("💊 Antianginal Drugs", TITLE_style)],
[Paragraph("Pharmacology Flashcards", SUBTITLE_style)],
[Paragraph("Based on Katzung's Basic & Clinical Pharmacology, 16th Ed.\n"
"Goodman & Gilman's Pharmacological Basis of Therapeutics", SUBTITLE_style)]]
cover = Table(cover_data, colWidths=[W])
cover.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("ROUNDEDCORNERS", [12]),
("TOPPADDING", (0,0), (-1,-1), 18),
("BOTTOMPADDING", (0,0), (-1,-1), 18),
("LEFTPADDING", (0,0), (-1,-1), 20),
("RIGHTPADDING", (0,0), (-1,-1), 20),
]))
story.append(cover)
story.append(Spacer(1, 0.6*cm))
# ── Cards grouped by section ───────────────────────────────────────────
cards_by_cat = {cat: [] for cat, _ in SECTION_ORDER}
for cat, label_color, q_bg, q, a in CARDS:
cards_by_cat[cat].append((label_color, q_bg, q, a))
card_num = 0
for cat_key, cat_title in SECTION_ORDER:
if not cards_by_cat[cat_key]:
continue
# Section header
sect_color = CATEGORY_COLORS[cat_key]
sect_data = [[Paragraph(cat_title, SECTION_style)]]
sect_tbl = Table(sect_data, colWidths=[W])
sect_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), sect_color),
("ROUNDEDCORNERS", [8]),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
]))
story.append(KeepTogether([sect_tbl, Spacer(1, 0.3*cm)]))
for label_color, q_bg, q_text, a_text in cards_by_cat[cat_key]:
card_num += 1
# Q label pill
label_pill_data = [[Paragraph(f"Q{card_num}", LABEL_style)]]
label_pill = Table(label_pill_data, colWidths=[1.4*cm])
label_pill.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), label_color),
("ROUNDEDCORNERS", [6]),
("TOPPADDING", (0,0), (-1,-1), 2),
("BOTTOMPADDING", (0,0), (-1,-1), 2),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING", (0,0), (-1,-1), 4),
]))
# Question row
q_para = Paragraph(q_text, Q_style)
q_row_data = [[label_pill, q_para]]
q_row = Table(q_row_data, colWidths=[1.6*cm, W - 1.6*cm])
q_row.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), q_bg),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [8]),
]))
# Answer
a_label_data = [[Paragraph("ANSWER", LABEL_style)]]
a_label = Table(a_label_data, colWidths=[1.8*cm])
a_label.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#999999")),
("ROUNDEDCORNERS", [4]),
("TOPPADDING", (0,0), (-1,-1), 1),
("BOTTOMPADDING", (0,0), (-1,-1), 1),
("LEFTPADDING", (0,0), (-1,-1), 4),
("RIGHTPADDING", (0,0), (-1,-1), 4),
]))
a_para = Paragraph(a_text.replace("\n", "<br/>"), A_style)
a_row_data = [[a_label, a_para]]
a_row = Table(a_row_data, colWidths=[2.0*cm, W - 2.0*cm])
a_row.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), GREY_LIGHT),
("VALIGN", (0,0), (-1,-1), "TOP"),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
# Outer card container
card_data = [[q_row], [a_row]]
card = Table(card_data, colWidths=[W])
card.setStyle(TableStyle([
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#CCCCCC")),
("ROUNDEDCORNERS", [10]),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("LINEBELOW", (0,0), (-1,0), 1, colors.HexColor("#CCCCCC")),
]))
story.append(KeepTogether([card, Spacer(1, 0.35*cm)]))
story.append(Spacer(1, 0.2*cm))
# ── Footer note ────────────────────────────────────────────────────────
footer_data = [[Paragraph(
"Sources: Katzung's Basic & Clinical Pharmacology 16th Ed. | "
"Goodman & Gilman's 13th Ed. | Fuster & Hurst's The Heart 15th Ed.",
ParagraphStyle("footer", parent=styles["Normal"], fontSize=7.5,
textColor=colors.HexColor("#888888"), alignment=TA_CENTER))]]
footer = Table(footer_data, colWidths=[W])
story.append(footer)
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
build_pdf()
python /home/daytona/workspace/antianginal-flashcards/make_flashcards.py
Antianginal Drugs Flashcards
PDF Document · PDF
| Color | Section |
|---|---|
| 🔵 Blue | Basics of Angina (4 cards) |
| 🟢 Green | Class 1 — Organic Nitrates (5 cards) |
| 🟠 Orange | Class 2 — Beta-Blockers (5 cards) |
| 🟣 Purple | Class 3 — Calcium Channel Blockers (5 cards) |
| 🔴 Red | Class 4 — Second-Line Agents (4 cards) |
| 🔵 Blue | Clinical Guidelines (3 cards) |