Give me answers in detail
| Group | Drugs | Main Effect |
|---|---|---|
| Dihydropyridines (DHPs) | Nifedipine, Amlodipine, Felodipine, Nicardipine | Predominantly vascular |
| Phenylalkylamines | Verapamil | Predominantly cardiac (heart) |
| Benzothiazepines | Diltiazem | Intermediate (heart + vessels) |
| Class | Examples |
|---|---|
| Diuretics | Hydrochlorothiazide, Furosemide, Spironolactone |
| Beta-blockers | Atenolol, Metoprolol, Propranolol |
| ACE Inhibitors | Enalapril, Ramipril, Lisinopril |
| ARBs | Losartan, Valsartan, Telmisartan |
| CCBs | Amlodipine, Nifedipine, Verapamil |
| Centrally acting | Clonidine, Methyldopa |
| Alpha-1 blockers | Prazosin, Doxazosin |
| Vasodilators | Hydralazine, Minoxidil, Sodium nitroprusside |
| Drug | Generation | Details |
|---|---|---|
| Streptokinase | 1st | Non-fibrin-specific; antigenic; allergic reactions; given by IV infusion; cheaper |
| Urokinase | 1st | Non-fibrin-specific; non-antigenic; expensive |
| Alteplase (t-PA) | 2nd | Fibrin-specific; activated only at clot site; short half-life |
| Reteplase | 2nd | Fibrin-specific; can give as bolus |
| Tenecteplase | 3rd | Most fibrin-specific; single IV bolus; longest half-life |
| Group | Drugs | Spectrum |
|---|---|---|
| Natural penicillins | Penicillin G (IV), Penicillin V (oral) | Narrow: Streptococcus, Neisseria, Clostridium, Spirochetes, Actinomyces |
| Aminopenicillins | Ampicillin, Amoxicillin | Extended: gram-positives + gram-negatives (E. coli, H. influenzae, Salmonella, Listeria) |
| Anti-staph penicillins | Cloxacillin, Flucloxacillin, Methicillin, Nafcillin | MSSA (staph producing penicillinase) |
| Anti-pseudomonal | Piperacillin, Ticarcillin | Pseudomonas aeruginosa + gram-negatives |
| Generation | Examples | Coverage |
|---|---|---|
| 1st | Cefazolin (IV), Cefalexin (oral) | Gram-positives > gram-negatives; surgical prophylaxis |
| 2nd | Cefuroxime, Cefaclor | Broader gram-negative; H. influenzae, Moraxella |
| 3rd | Ceftriaxone, Cefotaxime, Ceftazidime | Broader gram-negatives; meningitis (cross BBB); Ceftazidime covers Pseudomonas |
| 4th | Cefepime | Anti-pseudomonal + gram-positives |
| 5th | Ceftaroline | MRSA activity |
| Drug | MOA | Side Effects |
|---|---|---|
| Rifampicin | Inhibits DNA-dependent RNA polymerase | Orange-red urine/body fluids; hepatotoxicity; potent CYP inducer; drug interactions (reduces efficacy of OCP, warfarin, etc.); flu-like syndrome |
| Isoniazid (INH) | Inhibits mycolic acid synthesis (inhibits InhA) - prodrug activated by KatG | Peripheral neuropathy (prevent with pyridoxine/Vit B6); hepatotoxicity; drug-induced lupus; psychosis; slow vs fast acetylators |
| Pyrazinamide | Mechanism uncertain - disrupts membrane energy metabolism; active in acidic environment (inside macrophages) | Hepatotoxicity (most common serious); hyperuricemia (gout); arthralgia |
| Ethambutol | Inhibits arabinosyl transferase → ↓arabinogalactan synthesis in cell wall | Optic neuritis (dose-dependent, reversible); ↓visual acuity, red-green color blindness; contraindicated in children <5 years (cannot report visual symptoms) |
| Streptomycin | Aminoglycoside; inhibits 30S ribosome; only injectable first-line agent | Ototoxicity (vestibular > cochlear); nephrotoxicity; teratogenic |
| Group | Drugs | Stage active against |
|---|---|---|
| 4-Aminoquinolines | Chloroquine, Hydroxychloroquine, Amodiaquine | Blood schizontocide; chloroquine also gametocidal for P.vivax/ovale |
| Aryl alcohols | Quinine, Mefloquine, Halofantrine | Blood schizontocide |
| Artemisinin derivatives | Artemisinin, Artesunate, Artemether, Dihydroartemisinin | Fastest acting blood schizontocide; active against all stages |
| 8-Aminoquinolines | Primaquine, Tafenoquine | Hypnozoitocidal (P. vivax/ovale liver stages); gametocidal |
| Antifolates | Pyrimethamine, Proguanil, Sulfadoxine | Blood schizontocide |
| Antibiotics | Doxycycline, Tetracycline, Clindamycin | Blood schizontocide (slow acting) |
| Hydroxynaphthoquinone | Atovaquone (+ proguanil = Malarone) | Blood + liver stages |
| Class | Drugs | MOA |
|---|---|---|
| Azoles | Fluconazole, Itraconazole, Voriconazole, Ketoconazole, Clotrimazole, Miconazole | Inhibit CYP51 (lanosterol 14-alpha demethylase) → ↓ergosterol synthesis → ↑toxic sterol precursors |
| Polyenes | Amphotericin B, Nystatin | Bind ergosterol → form pores in membrane → ion leakage → cell death |
| Echinocandins | Caspofungin, Micafungin, Anidulafungin | Inhibit beta-1,3-glucan synthase → ↓cell wall synthesis |
| Antimetabolites | Flucytosine (5-FC) | Converted to 5-FU inside fungal cells → inhibits DNA/RNA synthesis |
| Allylamines | Terbinafine, Naftifine | Inhibit squalene epoxidase → ↓ergosterol; ↑squalene (toxic) |
| Morpholines | Amorolfine | Inhibit ergosterol synthesis |
| Class | Mechanism | Examples |
|---|---|---|
| Alkylating agents | Cross-link DNA strands → prevent DNA replication | Cyclophosphamide, Ifosfamide, Chlorambucil, Melphalan, Busulfan, Carmustine |
| Antimetabolites | Block nucleotide synthesis or DNA synthesis | Methotrexate (DHFR inhibitor), 5-FU (thymidylate synthase inhibitor), Cytarabine, Gemcitabine, 6-MP, 6-TG |
| Plant alkaloids (Vinca) | Inhibit tubulin polymerization → prevent spindle formation → arrest in metaphase | Vincristine, Vinblastine, Vinorelbine |
| Taxanes | Promote tubulin polymerization → prevent spindle disassembly → arrest in metaphase | Paclitaxel, Docetaxel |
| Topoisomerase inhibitors | Topotecan, Irinotecan (topo I); Etoposide, Teniposide (topo II) | |
| Antitumor antibiotics | Doxorubicin (anthracycline), Bleomycin, Mitomycin C, Actinomycin D | |
| Platinum compounds | Intra/interstrand cross-linking of DNA | Cisplatin, Carboplatin, Oxaliplatin |
| Monoclonal antibodies | Targeted therapy | Rituximab (anti-CD20), Trastuzumab (anti-HER2), Bevacizumab (anti-VEGF) |
| Tyrosine kinase inhibitors | Imatinib (BCR-ABL), Gefitinib/Erlotinib (EGFR) | |
| Hormonal | Block hormone-driven tumor growth | Tamoxifen, Anastrozole, Flutamide, Bicalutamide |
| Class | Drugs | Site of Action | Mechanism |
|---|---|---|---|
| Loop diuretics | Furosemide, Bumetanide, Ethacrynic acid, Torsemide | Thick ascending limb of loop of Henle | Block Na+/K+/2Cl- cotransporter (NKCC2) |
| Thiazides | Hydrochlorothiazide (HCTZ), Chlorthalidone, Indapamide | Distal convoluted tubule | Block Na+/Cl- cotransporter (NCC) |
| K+-sparing | Spironolactone, Eplerenone; Amiloride, Triamterene | Collecting duct/tubule | Spiro: Aldosterone antagonist; Amiloride: block ENaC |
| Osmotic | Mannitol | Proximal tubule, loop, collecting duct | Osmotic retention of water in tubule |
| CA inhibitors | Acetazolamide | Proximal tubule | Block carbonic anhydrase → ↓HCO3- reabsorption |
| Antidiuretic hormone antagonists | Conivaptan, Tolvaptan (Vaptans) | Collecting duct | Block V2 receptors |
Create a comprehensive study guide PDF for exam preparation
ls -la /tmp/workspace/ && mkdir -p /tmp/workspace/pharma-study-guide && echo "Directory ready"
~/pharma-study-guide/generate_pdf.py
#!/usr/bin/env python3
"""
Comprehensive Pharmacology Study Guide PDF Generator
Covers: Cardiovascular System, Blood & Blood Formation, Chemotherapy, Renal Pharmacology
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.platypus.flowables import HRFlowable
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.lib.colors import HexColor
import os
# ── Color Palette ──────────────────────────────────────────────────────────────
DARK_BLUE = HexColor('#1A3A5C')
MED_BLUE = HexColor('#2E6DA4')
LIGHT_BLUE = HexColor('#D6E8F7')
ACCENT_GREEN = HexColor('#1E7A4E')
LIGHT_GREEN = HexColor('#D6F0E3')
ACCENT_RED = HexColor('#C0392B')
LIGHT_RED = HexColor('#FDECEA')
ACCENT_PURP = HexColor('#6C3483')
LIGHT_PURP = HexColor('#EDE0F5')
GOLD = HexColor('#D4AC0D')
LIGHT_GOLD = HexColor('#FEF9E7')
LIGHT_GREY = HexColor('#F5F5F5')
MID_GREY = HexColor('#BDBDBD')
DARK_GREY = HexColor('#424242')
WHITE = colors.white
BLACK = colors.black
# ── Document Setup ─────────────────────────────────────────────────────────────
OUTPUT_PATH = '/tmp/workspace/pharma-study-guide/Pharmacology_Study_Guide.pdf'
PAGE_W, PAGE_H = A4
MARGIN = 1.8 * cm
def build_styles():
base = getSampleStyleSheet()
styles = {
'cover_title': ParagraphStyle(
'cover_title', fontSize=32, textColor=WHITE,
fontName='Helvetica-Bold', alignment=TA_CENTER, spaceAfter=6, leading=40
),
'cover_sub': ParagraphStyle(
'cover_sub', fontSize=14, textColor=HexColor('#D6E8F7'),
fontName='Helvetica', alignment=TA_CENTER, spaceAfter=4
),
'chapter_title': ParagraphStyle(
'chapter_title', fontSize=20, textColor=WHITE,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=26
),
'section_title': ParagraphStyle(
'section_title', fontSize=13, textColor=DARK_BLUE,
fontName='Helvetica-Bold', spaceBefore=10, spaceAfter=4, leading=17
),
'subsection_title': ParagraphStyle(
'subsection_title', fontSize=11, textColor=MED_BLUE,
fontName='Helvetica-Bold', spaceBefore=7, spaceAfter=3, leading=15
),
'drug_name': ParagraphStyle(
'drug_name', fontSize=10, textColor=ACCENT_GREEN,
fontName='Helvetica-Bold', spaceBefore=4, spaceAfter=2, leading=14
),
'body': ParagraphStyle(
'body', fontSize=9.5, textColor=DARK_GREY,
fontName='Helvetica', spaceBefore=2, spaceAfter=2,
leading=14, alignment=TA_JUSTIFY
),
'bullet': ParagraphStyle(
'bullet', fontSize=9.5, textColor=DARK_GREY,
fontName='Helvetica', spaceBefore=1, spaceAfter=1,
leading=13, leftIndent=14, bulletIndent=4
),
'sub_bullet': ParagraphStyle(
'sub_bullet', fontSize=9, textColor=DARK_GREY,
fontName='Helvetica', spaceBefore=1, spaceAfter=1,
leading=12, leftIndent=28, bulletIndent=16
),
'warning_box': ParagraphStyle(
'warning_box', fontSize=9, textColor=ACCENT_RED,
fontName='Helvetica-Bold', spaceBefore=2, spaceAfter=2,
leading=13, leftIndent=8
),
'tip_box': ParagraphStyle(
'tip_box', fontSize=9, textColor=ACCENT_GREEN,
fontName='Helvetica-Bold', spaceBefore=2, spaceAfter=2,
leading=13, leftIndent=8
),
'table_header': ParagraphStyle(
'table_header', fontSize=8.5, textColor=WHITE,
fontName='Helvetica-Bold', alignment=TA_CENTER, leading=11
),
'table_cell': ParagraphStyle(
'table_cell', fontSize=8, textColor=DARK_GREY,
fontName='Helvetica', leading=11
),
'marks_badge': ParagraphStyle(
'marks_badge', fontSize=9, textColor=WHITE,
fontName='Helvetica-Bold', alignment=TA_CENTER
),
'footer': ParagraphStyle(
'footer', fontSize=7.5, textColor=MID_GREY,
fontName='Helvetica', alignment=TA_CENTER
),
'toc_chapter': ParagraphStyle(
'toc_chapter', fontSize=11, textColor=DARK_BLUE,
fontName='Helvetica-Bold', spaceBefore=6, spaceAfter=2, leading=15
),
'toc_topic': ParagraphStyle(
'toc_topic', fontSize=9.5, textColor=DARK_GREY,
fontName='Helvetica', spaceBefore=1, spaceAfter=1,
leading=13, leftIndent=16
),
}
return styles
# ── Helper Flowables ───────────────────────────────────────────────────────────
def section_header(title, color=DARK_BLUE, styles=None):
"""A colored banner for section titles."""
tbl = Table([[Paragraph(title, styles['chapter_title'])]], colWidths=[PAGE_W - 2*MARGIN])
tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 12),
('RIGHTPADDING', (0,0), (-1,-1), 12),
('ROUNDEDCORNERS', [6]),
]))
return tbl
def marks_box(label, color=GOLD, styles=None):
"""Small colored badge showing mark weight."""
tbl = Table([[Paragraph(label, styles['marks_badge'])]], colWidths=[3.5*cm])
tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), color),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('ROUNDEDCORNERS', [4]),
]))
return tbl
def info_box(title, content_lines, bg_color=LIGHT_BLUE, title_color=DARK_BLUE, styles=None):
"""Colored info/alert box."""
inner = []
inner.append(Paragraph(f"<b>{title}</b>", ParagraphStyle(
'ib_title', fontSize=9, textColor=title_color, fontName='Helvetica-Bold', leading=13)))
for line in content_lines:
inner.append(Paragraph(line, ParagraphStyle(
'ib_body', fontSize=8.5, textColor=DARK_GREY, fontName='Helvetica', leading=12)))
tbl = Table([[inner]], colWidths=[PAGE_W - 2*MARGIN - 8])
tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), bg_color),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
('BOX', (0,0), (-1,-1), 0.8, title_color),
('ROUNDEDCORNERS', [4]),
]))
return tbl
def make_table(headers, rows, col_widths, styles, alt_color=LIGHT_GREY):
"""Styled data table."""
header_row = [Paragraph(h, styles['table_header']) for h in headers]
data = [header_row]
for row in rows:
data.append([Paragraph(str(cell), styles['table_cell']) for cell in row])
tbl = Table(data, colWidths=col_widths, repeatRows=1)
ts = [
('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
('GRID', (0,0), (-1,-1), 0.4, MID_GREY),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('VALIGN', (0,0), (-1,-1), 'TOP'),
]
for i in range(1, len(data)):
if i % 2 == 0:
ts.append(('BACKGROUND', (0,i), (-1,i), alt_color))
tbl.setStyle(TableStyle(ts))
return tbl
def hr(styles):
return HRFlowable(width='100%', thickness=0.5, color=MID_GREY, spaceAfter=4, spaceBefore=4)
def sp(n=6):
return Spacer(1, n)
# ══════════════════════════════════════════════════════════════════════════════
# CONTENT BUILDERS
# ══════════════════════════════════════════════════════════════════════════════
def build_cover(story, styles):
# Full-page color cover
story.append(Spacer(1, 2.5*cm))
cover_tbl = Table([
[Paragraph("PHARMACOLOGY", styles['cover_title'])],
[Paragraph("Comprehensive Exam Study Guide", styles['cover_sub'])],
[Spacer(1, 0.4*cm)],
[Paragraph("Cardiovascular System • Blood & Blood Formation", styles['cover_sub'])],
[Paragraph("Chemotherapy • Renal Pharmacology", styles['cover_sub'])],
[Spacer(1, 1.5*cm)],
[Paragraph("10-Mark | 5-Mark | 3-Mark Topics", ParagraphStyle(
'badge', fontSize=13, textColor=GOLD, fontName='Helvetica-Bold',
alignment=TA_CENTER))],
[Spacer(1, 2.5*cm)],
[Paragraph("Based on KD Tripathi & Lippincott Pharmacology", ParagraphStyle(
'ref', fontSize=10, textColor=HexColor('#A9CCE3'),
fontName='Helvetica', alignment=TA_CENTER))],
], colWidths=[PAGE_W - 2*MARGIN])
cover_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), DARK_BLUE),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 20),
('RIGHTPADDING', (0,0), (-1,-1), 20),
('BOX', (0,0), (-1,-1), 2, GOLD),
('ROUNDEDCORNERS', [10]),
]))
story.append(cover_tbl)
story.append(PageBreak())
def build_toc(story, styles):
story.append(section_header("TABLE OF CONTENTS", DARK_BLUE, styles))
story.append(sp(10))
chapters = [
("1. CARDIOVASCULAR SYSTEM", [
"ACE Inhibitors (10M)", "Angiotensin Receptor Blockers - ARBs (10M)",
"Organic Nitrates (10M)", "Calcium Channel Blockers - CCBs (10M)",
"Cardiac Glycosides / Digoxin (10M)", "Sodium Nitroprusside (5M)",
"Classification of Antihypertensives (5M)", "Pharmacotherapy of Acute MI (5M)",
"Lignocaine (5M)", "Amiodarone (5M)", "Adenosine (5M)",
"Beta-Blockers in Angina & Hypertension (3M)",
"Centrally Acting Sympatholytics / Clonidine (3M)", "Vasodilators (3M)",
]),
("2. BLOOD & BLOOD FORMATION", [
"Hypolipidemic Drug Classification (5M)", "HMG-CoA Reductase Inhibitors / Statins (5M)",
"Plasma Volume Expanders (5M)", "Thrombolytics / Fibrinolytics (5M)",
"Antiplatelet Drugs (5M)", "Anticoagulants: Heparin & Warfarin (10M)",
"Iron: Absorption, Oral & Parenteral Preparations (10M)",
"Vitamin B12 (5M)", "Folic Acid (5M)", "Erythropoietin (5M)",
"Anti-thrombotic Drugs / Streptokinase (3M)",
"Clopidogrel (3M)", "Rational Use of Aspirin in MI (3M)",
]),
("3. CHEMOTHERAPY", [
"Fluoroquinolones (10M)", "Beta-Lactam Antibiotics (10M)",
"Penicillins (10M)", "Cephalosporins - Generations (10M)",
"Carbapenems & Monobactams (10M)", "Macrolide Antibiotics (5M)",
"Antitubercular Drugs (10M)", "Antimalarial Drugs / Chloroquine (10M)",
"Antifungal Drugs (5M)", "Aminoglycosides (5M)", "Tetracyclines (5M)",
"Dapsone (5M)", "Anticancer Drug Classification (5M)",
"Cyclophosphamide & Methotrexate (5M)", "Vinca Alkaloids (5M)",
"Leprosy / Clofazimine (3M)", "Antimalarials in Acute Attack (3M)",
"Albendazole / Mebendazole (3M)", "Ivermectin (3M)",
]),
("4. RENAL PHARMACOLOGY", [
"Classification of Diuretics (5M)", "Carbonic Anhydrase Inhibitors (5M)",
"Osmotic Diuretics / Mannitol (5M)", "Loop Diuretics / Furosemide (5M)",
"Thiazide Diuretics (5M)", "Potassium-Sparing Diuretics (5M)",
"Antidiuretics / Vasopressin / Desmopressin (5M)",
]),
]
for chap_title, topics in chapters:
story.append(Paragraph(chap_title, styles['toc_chapter']))
for t in topics:
story.append(Paragraph(f"• {t}", styles['toc_topic']))
story.append(sp(4))
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────────
# CHAPTER 1: CARDIOVASCULAR SYSTEM
# ──────────────────────────────────────────────────────────────────────────────
def build_cvs(story, styles):
story.append(section_header("CHAPTER 1: CARDIOVASCULAR SYSTEM", MED_BLUE, styles))
story.append(sp(8))
# ── ACE INHIBITORS ──
story.append(KeepTogether([
marks_box("★ 10 MARKS", GOLD, styles),
sp(4),
Paragraph("1. ACE INHIBITORS", styles['section_title']),
hr(styles),
]))
story.append(Paragraph("<b>Drugs:</b> Captopril, Enalapril, Lisinopril, Ramipril, Perindopril, Fosinopril, Benazepril", styles['body']))
story.append(sp(4))
story.append(Paragraph("Mechanism of Action", styles['subsection_title']))
story.append(Paragraph(
"ACE (Angiotensin Converting Enzyme) inhibitors block the conversion of <b>Angiotensin I → Angiotensin II</b>. "
"Angiotensin II normally causes vasoconstriction, stimulates aldosterone release (Na+/water retention), and promotes "
"cardiac/vascular hypertrophy. ACE inhibitors also prevent bradykinin degradation → bradykinin accumulates → "
"vasodilation via NO and prostaglandins (causes the characteristic dry cough).", styles['body']))
story.append(sp(4))
story.append(Paragraph("Therapeutic Uses", styles['subsection_title']))
uses = [
"Hypertension — <b>drug of choice in diabetics</b>",
"Heart failure (reduce afterload and preload)",
"Post-MI (reduce mortality, ventricular remodeling)",
"Diabetic nephropathy — renoprotective (reduce intraglomerular pressure)",
"Chronic kidney disease with proteinuria",
"Left ventricular dysfunction (asymptomatic)",
]
for u in uses:
story.append(Paragraph(f"• {u}", styles['bullet']))
story.append(sp(4))
story.append(Paragraph("Adverse Effects", styles['subsection_title']))
ae = [
("<b>Dry persistent cough</b> (most common — bradykinin↑) → switch to ARB", ACCENT_RED),
("Hyperkalemia (↓aldosterone)", None),
("First-dose hypotension (volume-depleted patients)", None),
("<b>Angioedema</b> (rare but potentially fatal — bradykinin)", ACCENT_RED),
("<b>TERATOGENIC</b> — contraindicated in pregnancy (fetal renal agenesis)", ACCENT_RED),
("Taste disturbances (captopril — sulfhydryl group)", None),
("Acute renal failure in bilateral renal artery stenosis", None),
]
for line, c in ae:
story.append(Paragraph(f"• {line}", styles['bullet']))
story.append(sp(4))
story.append(info_box(
"⚠ CONTRAINDICATIONS",
["Pregnancy • Bilateral renal artery stenosis • History of angioedema • Severe aortic stenosis"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(8))
# ── ARBs ──
story.append(KeepTogether([
Paragraph("2. ANGIOTENSIN RECEPTOR BLOCKERS (ARBs)", styles['section_title']),
hr(styles),
]))
story.append(Paragraph("<b>Drugs:</b> Losartan, Valsartan, Candesartan, Irbesartan, Telmisartan, Olmesartan", styles['body']))
story.append(Paragraph("Mechanism of Action", styles['subsection_title']))
story.append(Paragraph(
"Block AT₁ receptor → prevent all effects of Angiotensin II. Unlike ACEi, they do <b>NOT affect bradykinin</b> — "
"so NO dry cough. More complete blockade of Ang II effects (including Ang II formed by chymase pathway). "
"<b>Losartan</b> has a uricosuric property — useful in hypertensive patients with gout.", styles['body']))
story.append(Paragraph("Key Differences from ACE Inhibitors", styles['subsection_title']))
diff_data = [
["Property", "ACE Inhibitors", "ARBs"],
["Mechanism", "Block ACE enzyme", "Block AT₁ receptor"],
["Bradykinin", "↑ (cough, angioedema)", "Unaffected"],
["Cough", "Yes (common)", "No"],
["Angioedema", "Yes (rare)", "Very rare"],
["Ang II blockade", "Incomplete", "More complete"],
["Use in pregnancy", "Contraindicated", "Contraindicated"],
]
story.append(make_table(diff_data[0], diff_data[1:], [5*cm, 5.5*cm, 5.5*cm], styles))
story.append(sp(8))
# ── ORGANIC NITRATES ──
story.append(KeepTogether([
Paragraph("3. ORGANIC NITRATES", styles['section_title']),
hr(styles),
]))
story.append(Paragraph("<b>Drugs:</b> Glyceryl trinitrate (GTN/Nitroglycerin), ISDN, ISMN, Amyl nitrite", styles['body']))
story.append(Paragraph("Mechanism of Action", styles['subsection_title']))
story.append(Paragraph(
"Prodrugs that release <b>Nitric Oxide (NO)</b> in vascular smooth muscle → activates guanylyl cyclase → "
"↑cGMP → protein kinase G activation → dephosphorylation of myosin light chain → <b>vascular smooth muscle relaxation</b>. "
"At low doses: mainly <b>venodilation</b> (↓preload). At higher doses: arteriolar dilation (↓afterload).", styles['body']))
story.append(Paragraph("Therapeutic Uses", styles['subsection_title']))
uses = [
"Acute angina: Sublingual GTN (onset 1–2 min, duration 20–30 min) — FIRST LINE",
"Prophylaxis: ISDN or ISMN oral",
"Acute LVF/pulmonary edema: IV GTN",
"Unstable angina; Controlled hypotension in surgery",
]
for u in uses:
story.append(Paragraph(f"• {u}", styles['bullet']))
story.append(sp(4))
story.append(info_box(
"⚠ IMPORTANT — Nitrate Tolerance",
["Develops with continuous use. Require a nitrate-free interval of 8–12 hours (usually at night)."],
LIGHT_GOLD, GOLD, styles
))
story.append(info_box(
"CONTRAINDICATIONS",
["Sildenafil/PDE-5 inhibitors (severe hypotension) • Severe hypotension • Raised ICP"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(8))
# ── CCBs ──
story.append(KeepTogether([
Paragraph("4. CALCIUM CHANNEL BLOCKERS (CCBs)", styles['section_title']),
hr(styles),
]))
story.append(Paragraph("Mechanism of Action", styles['subsection_title']))
story.append(Paragraph(
"Block L-type voltage-gated Ca²⁺ channels in vascular smooth muscle and myocardium. "
"↓Vascular Ca²⁺ → vasodilation. Verapamil/Diltiazem additionally slow SA/AV node conduction "
"(negative chronotropy and dromotropy) and reduce contractility.", styles['body']))
ccb_data = [
["Class", "Drugs", "Main Effect", "Key Uses"],
["Dihydropyridines (DHPs)", "Nifedipine, Amlodipine, Felodipine, Nimodipine", "Predominantly vascular", "Hypertension, Stable/Vasospastic angina, Raynaud's, Subarachnoid haemorrhage (Nimodipine)"],
["Phenylalkylamines", "Verapamil", "Predominantly cardiac", "SVT, AF rate control, Angina, HTN; Contraindicated with beta-blockers"],
["Benzothiazepines", "Diltiazem", "Intermediate", "SVT, Angina, HTN; Less bradycardia than verapamil"],
]
story.append(make_table(ccb_data[0], ccb_data[1:], [3.5*cm, 4.5*cm, 3.5*cm, 4.5*cm], styles))
story.append(sp(4))
story.append(Paragraph("<b>Adverse Effects:</b> DHPs — flushing, peripheral edema, reflex tachycardia (nifedipine). "
"Verapamil — constipation (most common), bradycardia, AV block. "
"Diltiazem — bradycardia, AV block (intermediate).", styles['body']))
story.append(sp(8))
# ── CARDIAC GLYCOSIDES ──
story.append(KeepTogether([
Paragraph("5. CARDIAC GLYCOSIDES (DIGOXIN)", styles['section_title']),
hr(styles),
]))
story.append(Paragraph("Mechanism of Action", styles['subsection_title']))
story.append(Paragraph(
"Inhibits <b>Na⁺/K⁺-ATPase</b> (sodium pump) → ↑intracellular Na⁺ → Na⁺/Ca²⁺ exchanger less active "
"→ ↑intracellular Ca²⁺ → <b>positive inotropic effect</b>. Also: negative chronotropic (↓HR), "
"negative dromotropic (↓AV conduction, prolongs PR interval), positive bathmotropic "
"(↑ventricular automaticity — pro-arrhythmic in toxicity).", styles['body']))
story.append(Paragraph("Digitalis Toxicity", styles['subsection_title']))
tox_data = [
["System", "Features"],
["GI (earliest)", "Nausea, vomiting, anorexia"],
["CNS", "Visual disturbances (xanthopsia — yellow/green vision), confusion, headache"],
["Cardiac (most serious)", "PVCs (most common), bigeminy, VT, AV block, PAT with block"],
]
story.append(make_table(tox_data[0], tox_data[1:], [4*cm, 12*cm], styles))
story.append(sp(4))
story.append(info_box(
"Precipitating Factors for Toxicity",
["Hypokalemia ★ • Hypomagnesemia • Hypercalcemia • Hypothyroidism • Renal failure",
"Drug interactions: Amiodarone, Verapamil, Quinidine — all ↑digoxin levels"],
LIGHT_PURP, ACCENT_PURP, styles
))
story.append(info_box(
"Treatment of Toxicity",
["Stop digoxin • Correct K⁺ and Mg²⁺ • Digoxin-Fab antibody fragments (Digibind) — for life-threatening toxicity"],
LIGHT_BLUE, MED_BLUE, styles
))
story.append(PageBreak())
# ── 5-MARK CVS TOPICS ──
story.append(marks_box("★ 5 MARKS", MED_BLUE, styles))
story.append(sp(6))
story.append(Paragraph("PHARMACOTHERAPY OF ACUTE MI", styles['section_title']))
story.append(hr(styles))
mi_data = [
["Drug / Class", "Role", "Notes"],
["Aspirin 300 mg stat", "Antiplatelet", "Irreversibly inhibits COX-1 → ↓TXA₂; then 75 mg/day maintenance"],
["Clopidogrel/Ticagrelor (P2Y12 blocker)", "Antiplatelet (DAPT)", "Dual antiplatelet therapy with aspirin"],
["Morphine IV", "Analgesia", "Reduce pain, preload; caution: respiratory depression"],
["Nitrates (SL GTN)", "Vasodilation", "Reduce chest pain; avoid if hypotensive"],
["Oxygen", "Correct hypoxia", "Only if SpO₂ < 94%"],
["Beta-blockers (Metoprolol)", "↓HR, ↓O₂ demand", "Reduce mortality; avoid in acute decompensated HF"],
["ACE Inhibitors", "Remodeling prevention", "Start within 24 h if no contraindication; especially if EF↓"],
["Statins (Atorvastatin 80 mg)", "Plaque stabilization", "Start immediately; high-intensity statin"],
["Heparin (UFH/LMWH)", "Anticoagulation", "Prevent thrombus extension; fondaparinux in NSTEMI"],
["Primary PCI / Thrombolysis", "Reperfusion", "PCI preferred; Thrombolysis if PCI >120 min away"],
]
story.append(make_table(mi_data[0], mi_data[1:], [4.5*cm, 3.5*cm, 8*cm], styles))
story.append(sp(8))
story.append(Paragraph("AMIODARONE", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph("<b>Class:</b> Class III antiarrhythmic (K⁺ channel blocker) — also has Class I, II, IV properties.", styles['body']))
story.append(Paragraph(
"<b>Uses:</b> VT/VF (drug of choice in cardiac arrest), AF/flutter (cardioversion + maintenance), WPW syndrome.", styles['body']))
story.append(Paragraph("Adverse Effects — 'THYROID, LUNG, LIVER, EYE, SKIN':", styles['subsection_title']))
ae_amio = [
"Pulmonary toxicity (most serious — pneumonitis/fibrosis)",
"Thyroid dysfunction: hypo- OR hyperthyroidism (37% iodine content)",
"Hepatotoxicity",
"Corneal microdeposits (most common — usually asymptomatic)",
"Blue-grey skin pigmentation, photosensitivity",
"Peripheral neuropathy; Bradycardia; QT prolongation",
"Drug interactions: ↑Digoxin levels, ↑Warfarin effect (reduce doses)",
]
for a in ae_amio:
story.append(Paragraph(f"• {a}", styles['bullet']))
story.append(sp(4))
story.append(info_box(
"Pharmacokinetics — KEY",
["Half-life: 40–55 days (extremely long). IV loading dose needed for urgent use."],
LIGHT_GOLD, GOLD, styles
))
story.append(sp(8))
story.append(Paragraph("ADENOSINE", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph(
"<b>Mechanism:</b> Activates adenosine A₁ receptors in AV node → hyperpolarizes AV nodal cells → "
"transiently blocks AV conduction. <b>Half-life: ~10 seconds</b> (extremely short). "
"Given as rapid IV bolus.", styles['body']))
story.append(Paragraph(
"<b>Use:</b> Drug of choice for acute termination of <b>paroxysmal SVT (PSVT)</b>; also diagnostic (unmask atrial flutter).", styles['body']))
story.append(info_box(
"⚠ Contraindications & Interactions",
["CONTRAINDICATED in: Asthma/COPD, 2nd/3rd degree AV block, sick sinus syndrome",
"ANTAGONIZED by: Theophylline/Caffeine (block adenosine receptors)",
"POTENTIATED by: Dipyridamole (inhibits adenosine breakdown)"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(8))
# ── 3-MARK CVS ──
story.append(marks_box("★ 3 MARKS", ACCENT_GREEN, styles))
story.append(sp(6))
story.append(Paragraph("BETA-BLOCKERS", styles['section_title']))
story.append(hr(styles))
bb_data = [
["Drug", "Selectivity", "Special Property"],
["Propranolol", "Non-selective β1+β2", "Membrane stabilizing; Lipophilic (crosses BBB)"],
["Atenolol, Metoprolol", "β1-selective (cardioselective)", "Safer in mild asthma; preferred post-MI"],
["Carvedilol", "Non-selective β + α1", "Used in heart failure; vasodilatory"],
["Nebivolol", "β1-selective", "Also releases NO → vasodilation"],
["Labetalol", "Non-selective β + α1", "IV in hypertensive emergencies; safe in pregnancy"],
]
story.append(make_table(bb_data[0], bb_data[1:], [3.5*cm, 5*cm, 7.5*cm], styles))
story.append(sp(4))
story.append(info_box(
"⚠ Contraindications",
["Asthma/COPD (non-selective) • Uncompensated heart failure • 2nd/3rd degree AV block",
"Sick sinus syndrome • Raynaud's disease • AVOID abrupt withdrawal (rebound angina/MI)"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────────
# CHAPTER 2: BLOOD AND BLOOD FORMATION
# ──────────────────────────────────────────────────────────────────────────────
def build_blood(story, styles):
story.append(section_header("CHAPTER 2: BLOOD AND BLOOD FORMATION", ACCENT_GREEN, styles))
story.append(sp(8))
story.append(marks_box("★ 5 MARKS", GOLD, styles))
story.append(sp(6))
# ── HYPOLIPIDEMIC ──
story.append(Paragraph("1. HYPOLIPIDEMIC DRUGS — CLASSIFICATION", styles['section_title']))
story.append(hr(styles))
hlip_data = [
["Class", "Drugs", "Mechanism", "Main Effect"],
["HMG-CoA Reductase Inhibitors (Statins)", "Atorvastatin, Rosuvastatin, Simvastatin, Lovastatin, Pravastatin", "Competitively inhibit HMG-CoA reductase → ↓cholesterol synthesis → ↑LDL receptor expression", "↓LDL 20–60%; modest ↑HDL; ↓TG; pleiotropic effects"],
["Bile Acid Sequestrants", "Cholestyramine, Colestipol, Colesevelam", "Bind bile acids in intestine → ↑LDL receptor expression", "↓LDL; may ↑TG"],
["Fibrates", "Gemfibrozil, Fenofibrate, Clofibrate", "PPAR-α activation → ↑lipoprotein lipase → ↑TG clearance", "↓TG most effectively; modest ↑HDL; ↓VLDL"],
["Niacin (Nicotinic Acid)", "Niacin", "↓Adipose lipolysis → ↓FFA → ↓VLDL synthesis", "Best ↑HDL; ↓TG; ↓LDL"],
["Cholesterol Absorption Inhibitor", "Ezetimibe", "Inhibit NPC1L1 in intestinal brush border", "↓Intestinal cholesterol absorption; add-on to statins"],
["PCSK9 Inhibitors", "Evolocumab, Alirocumab", "Inhibit PCSK9 → ↑LDL receptor recycling", "↓LDL 50–60%; used in familial hypercholesterolemia"],
]
story.append(make_table(hlip_data[0], hlip_data[1:], [3.5*cm, 3.5*cm, 5*cm, 4*cm], styles))
story.append(sp(4))
story.append(info_box(
"Statin Adverse Effects — IMPORTANT",
["Myopathy/Rhabdomyolysis (↑risk with fibrates, CYP3A4 inhibitors — especially simvastatin/lovastatin)",
"Elevated liver enzymes (check LFTs) • New-onset diabetes (high-intensity statins) • Teratogenic (avoid in pregnancy)"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(8))
# ── THROMBOLYTICS ──
story.append(Paragraph("2. THROMBOLYTICS (FIBRINOLYTICS)", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph(
"<b>Common Mechanism:</b> All convert <b>plasminogen → plasmin</b> → plasmin breaks down fibrin clots.", styles['body']))
story.append(sp(4))
tl_data = [
["Drug", "Generation", "Fibrin Specificity", "Key Notes"],
["Streptokinase", "1st", "Non-specific", "Antigenic; allergic reactions; cheap; given by IV infusion; NOT used >5 days apart"],
["Urokinase", "1st", "Non-specific", "Non-antigenic; expensive"],
["Alteplase (t-PA)", "2nd", "Fibrin-specific", "Short half-life; standard for ischemic stroke (within 4.5 h); IV bolus + infusion"],
["Reteplase", "2nd", "Fibrin-specific", "Can give as IV bolus"],
["Tenecteplase (TNK-tPA)", "3rd", "Most specific", "Single IV bolus; longest half-life; used in STEMI"],
]
story.append(make_table(tl_data[0], tl_data[1:], [3.5*cm, 2.2*cm, 3*cm, 7.3*cm], styles))
story.append(sp(4))
story.append(info_box(
"⚠ Absolute Contraindications",
["Active internal bleeding • Recent surgery/trauma <10 days • Recent stroke <3 months",
"Severe uncontrolled hypertension • Aortic dissection • Pregnancy"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(8))
# ── ANTIPLATELET ──
story.append(Paragraph("3. ANTIPLATELET DRUGS", styles['section_title']))
story.append(hr(styles))
ap_data = [
["Class", "Drugs", "Mechanism", "Notes"],
["COX-1 Inhibitor", "Aspirin", "Irreversibly inhibits COX-1 → ↓TXA₂ in platelets", "Effect lasts 7–10 days (platelet lifespan); low dose 75–150 mg/day"],
["P2Y12 ADP Antagonists", "Clopidogrel, Ticagrelor, Prasugrel", "Block P2Y12 receptor → ↓ADP-mediated platelet aggregation", "Clopidogrel: prodrug (CYP2C19); Ticagrelor: direct-acting, reversible; Prasugrel: more potent"],
["GPIIb/IIIa Inhibitors", "Abciximab, Eptifibatide, Tirofiban", "Block final common pathway (fibrinogen binding to GPIIb/IIIa)", "IV only; used during PCI"],
["PDE Inhibitors", "Dipyridamole, Cilostazol", "↑cAMP → ↓platelet activation", "Cilostazol: peripheral arterial disease; Dipyridamole + aspirin = Aggrenox (stroke prevention)"],
]
story.append(make_table(ap_data[0], ap_data[1:], [3.5*cm, 3.5*cm, 4.5*cm, 4.5*cm], styles))
story.append(sp(8))
# ── ANTICOAGULANTS ──
story.append(marks_box("★ 10 MARKS", GOLD, styles))
story.append(sp(6))
story.append(Paragraph("4. ANTICOAGULANTS", styles['section_title']))
story.append(hr(styles))
ac_data = [
["Drug", "Route", "Mechanism", "Monitor", "Antidote", "Key Uses"],
["Unfractionated Heparin (UFH)", "IV/SC", "Binds ATIII → inhibits Xa + IIa (1:1)", "aPTT (1.5–2.5× normal)", "Protamine sulfate", "DVT/PE, ACS, cardiac surgery, dialysis"],
["LMWH (Enoxaparin, Dalteparin)", "SC", "Mainly anti-Xa (Xa:IIa = 2–4:1)", "NOT required (predictable PK)", "Protamine (partial)", "DVT prophylaxis/treatment; ACS; pregnancy"],
["Fondaparinux", "SC", "Selective anti-Xa only", "NOT required", "None", "DVT/PE; no HIT risk"],
["Warfarin", "Oral", "Inhibit Vit K epoxide reductase → ↓Factors II,VII,IX,X + Protein C,S", "INR (goal 2–3)", "Vit K (slow) / FFP/PCC (rapid)", "AF, DVT/PE, mechanical valves, antiphospholipid syndrome"],
["Dabigatran (DOAC)", "Oral", "Direct thrombin inhibitor (Factor IIa)", "NOT required", "Idarucizumab", "AF, VTE prevention/treatment"],
["Rivaroxaban, Apixaban (DOACs)", "Oral", "Direct Factor Xa inhibitor", "NOT required", "Andexanet alfa", "AF, VTE prevention/treatment"],
]
story.append(make_table(ac_data[0], ac_data[1:], [3.2*cm, 1.6*cm, 3.8*cm, 2.5*cm, 2.5*cm, 2.4*cm], styles))
story.append(sp(4))
story.append(info_box(
"HIT — Heparin-Induced Thrombocytopenia",
["Type II (immune-mediated): IgG antibodies against heparin-PF4 complex → platelet activation → THROMBOSIS",
"Paradox: low platelets but HIGH RISK of thrombosis!",
"Management: STOP heparin immediately → start non-heparin anticoagulant (Argatroban, Bivalirudin, Fondaparinux)"],
LIGHT_PURP, ACCENT_PURP, styles
))
story.append(PageBreak())
# ── IRON ──
story.append(Paragraph("5. IRON — ABSORPTION & PREPARATIONS", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph("Iron Absorption Pathway:", styles['subsection_title']))
iron_steps = [
"Dietary Fe³⁺ reduced to Fe²⁺ by Vitamin C (ascorbic acid) or brush border reductase",
"Absorbed in <b>proximal duodenum and jejunum</b> via <b>DMT-1</b> (divalent metal transporter 1)",
"Inside enterocyte: used or stored as <b>ferritin</b>",
"Exported to blood via <b>ferroportin</b> (controlled by hepcidin — master regulator of iron homeostasis)",
"In blood: transported by <b>transferrin</b> (binds 2 Fe³⁺)",
"Stored as ferritin (liver, spleen, BM) or hemosiderin (insoluble, iron overload)",
]
for step in iron_steps:
story.append(Paragraph(f"• {step}", styles['bullet']))
story.append(sp(4))
iron_prep_data = [
["Preparation", "Route", "Key Points"],
["Ferrous sulphate (most used)", "Oral", "200 mg tab (65 mg elemental iron); 2–3×/day; take on empty stomach for better absorption; black stools, GI upset"],
["Ferrous gluconate, Ferrous fumarate", "Oral", "Less GI side effects than sulphate; more expensive"],
["Iron sucrose (Venofer)", "IV", "Safe; no test dose needed; used in CKD, IBD"],
["Ferric carboxymaltose", "IV", "Can give large dose in single infusion; expensive"],
["Iron dextran", "IV/IM", "Oldest; risk of anaphylaxis (test dose mandatory); IM causes staining"],
]
story.append(make_table(iron_prep_data[0], iron_prep_data[1:], [4*cm, 2*cm, 10*cm], styles))
story.append(sp(4))
story.append(info_box(
"Response to Oral Iron Therapy",
["Reticulocytosis: 7–10 days (earliest sign of response)",
"Haemoglobin rise: ~1 g/dL per week",
"Continue 3–6 months after Hb normalises (to replenish stores)"],
LIGHT_GREEN, ACCENT_GREEN, styles
))
story.append(info_box(
"Acute Iron Poisoning — Treatment",
["Gastric lavage (early) → Desferrioxamine IV/IM (chelating agent — antidote)"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(8))
# ── ERYTHROPOIETIN ──
story.append(Paragraph("6. ERYTHROPOIETIN (EPO)", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph(
"Glycoprotein hormone produced by peritubular fibroblasts of the kidney (85%) and liver (15%) "
"in response to hypoxia. Stimulates erythroid progenitor cells in bone marrow.", styles['body']))
epo_data = [
["Preparation", "Half-Life", "Dosing"],
["Epoetin alfa/beta", "~8 hours", "SC or IV, 3×/week"],
["Darbepoetin alfa", "~25 hours", "Weekly dosing"],
["Methoxy-PEG epoetin beta (CERA)", "~130 hours", "Monthly dosing"],
]
story.append(make_table(epo_data[0], epo_data[1:], [5*cm, 4*cm, 7*cm], styles))
story.append(sp(4))
story.append(Paragraph("<b>Uses:</b> Anaemia of CKD (most important) • Chemotherapy-induced anaemia • HIV (AZT therapy) • Pre-surgical autologous donation", styles['body']))
story.append(info_box(
"Adverse Effects",
["Hypertension (most common serious AE — monitor BP closely)",
"Thromboembolism • Flu-like symptoms",
"Pure red cell aplasia (rare — anti-EPO antibodies, especially SC epoetin alfa)"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────────
# CHAPTER 3: CHEMOTHERAPY
# ──────────────────────────────────────────────────────────────────────────────
def build_chemo(story, styles):
story.append(section_header("CHAPTER 3: CHEMOTHERAPY", ACCENT_PURP, styles))
story.append(sp(8))
story.append(marks_box("★ 10 MARKS", GOLD, styles))
story.append(sp(6))
# ── FLUOROQUINOLONES ──
story.append(Paragraph("1. FLUOROQUINOLONES", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph(
"<b>MOA:</b> Inhibit <b>DNA gyrase (topoisomerase II)</b> in gram-negative bacteria and "
"<b>topoisomerase IV</b> in gram-positive bacteria → prevent DNA replication and repair → <b>BACTERICIDAL</b>.", styles['body']))
fq_data = [
["Generation", "Drugs", "Spectrum", "Key Uses"],
["1st", "Nalidixic acid", "Gram-negative (limited)", "Urinary tract (historical)"],
["2nd", "Norfloxacin, Ciprofloxacin, Ofloxacin", "Gram-negative (broad incl. Pseudomonas — Cipro)", "UTI, prostatitis, enteric fever, gonorrhea, anthrax"],
["3rd ('Respiratory')", "Levofloxacin", "Gram-negative + Gram-positive + atypicals", "CAP, HAP, TB (2nd line), UTI"],
["4th", "Moxifloxacin", "Broadest (incl. anaerobes, MRSA-like activity)", "CAP, TB (2nd line) — NOT for UTI (no renal excretion)"],
]
story.append(make_table(fq_data[0], fq_data[1:], [2.5*cm, 4*cm, 4.5*cm, 5*cm], styles))
story.append(sp(4))
story.append(Paragraph("<b>Adverse Effects:</b>", styles['subsection_title']))
fq_ae = [
"GI effects (most common — nausea, vomiting)",
"CNS effects (dizziness, rarely seizures) — especially elderly",
"<b>Tendinopathy / Achilles tendon rupture</b> (especially with corticosteroids — risk in elderly)",
"QT prolongation (especially moxifloxacin)",
"Photosensitivity",
"<b>Arthropathy / cartilage damage</b> → CONTRAINDICATED in children (<18 yrs) and PREGNANCY",
"Chelation by divalent cations (antacids, iron, calcium) → take 2 hours apart",
]
for ae in fq_ae:
story.append(Paragraph(f"• {ae}", styles['bullet']))
story.append(sp(8))
# ── BETA-LACTAMS ──
story.append(Paragraph("2. BETA-LACTAM ANTIBIOTICS", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph(
"<b>Common MOA:</b> Bind to <b>Penicillin Binding Proteins (PBPs)</b> / transpeptidases → inhibit peptidoglycan "
"cross-linking → prevent cell wall synthesis → osmotic lysis → <b>BACTERICIDAL</b>.", styles['body']))
story.append(sp(4))
story.append(Paragraph("A. PENICILLINS", styles['subsection_title']))
pen_data = [
["Subgroup", "Drugs", "Spectrum", "Key Clinical Uses"],
["Natural penicillins", "Penicillin G (IV), Penicillin V (oral)", "Narrow — Streptococcus, Neisseria, Spirochetes, Clostridium", "Syphilis (DOC), Streptococcal pharyngitis, Meningococcal meningitis, Gas gangrene, Rheumatic fever prophylaxis"],
["Aminopenicillins", "Ampicillin, Amoxicillin", "Extended — gram+ + gram−: E. coli, H. influenzae, Salmonella, Listeria", "UTI, otitis media, Salmonellosis, H. pylori (amoxicillin), Listeria meningitis"],
["Anti-staphylococcal", "Cloxacillin, Flucloxacillin, Methicillin", "MSSA (penicillinase-producing Staph aureus)", "Skin/soft tissue MSSA infections, osteomyelitis"],
["Anti-pseudomonal", "Piperacillin, Ticarcillin", "Broad gram-negative incl. Pseudomonas", "Serious gram-negative + pseudomonal infections (usually + BLI)"],
["BLI Combinations", "Amoxicillin + Clavulanate (Augmentin), Ampicillin + Sulbactam, Piperacillin + Tazobactam", "Protects penicillin from beta-lactamase destruction", "Polymicrobial infections, ESBL organisms, intra-abdominal sepsis"],
]
story.append(make_table(pen_data[0], pen_data[1:], [3*cm, 3.5*cm, 4*cm, 5.5*cm], styles))
story.append(sp(4))
story.append(info_box(
"Penicillin Adverse Effects",
["Hypersensitivity reactions (MOST IMPORTANT) — anaphylaxis, urticaria, serum sickness",
"10% cross-reactivity with cephalosporins • Neurotoxicity (seizures — high doses) • Electrolyte disturbances (K+/Na+ overload)"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(6))
story.append(Paragraph("B. CEPHALOSPORINS — GENERATIONS", styles['subsection_title']))
ceph_data = [
["Generation", "Key Drugs", "Coverage", "Main Uses"],
["1st", "Cefazolin (IV), Cefalexin (oral)", "Gram+ > Gram−; limited gram-neg", "Surgical prophylaxis (DOC), Skin/soft tissue, UTI (cefalexin)"],
["2nd", "Cefuroxime, Cefaclor, Cefoxitin", "Broader gram-neg (H. influenzae, Moraxella); Cefoxitin: anaerobes", "Respiratory infections, UTI, surgical prophylaxis (abdominal)"],
["3rd", "Ceftriaxone, Cefotaxime, Ceftazidime", "Broad gram-neg; BBB penetration (meningitis); Ceftazidime: Pseudomonas", "Meningitis (Ceftriaxone DOC), Gonorrhea, Typhoid, Sepsis, Hospital infections"],
["4th", "Cefepime", "Broad gram+ and gram-neg; anti-pseudomonal", "Febrile neutropenia, nosocomial infections, Pseudomonas"],
["5th", "Ceftaroline, Ceftolozane-Tazobactam", "MRSA activity (Ceftaroline)", "MRSA skin infections, CAP with resistant organisms"],
]
story.append(make_table(ceph_data[0], ceph_data[1:], [2*cm, 4*cm, 4*cm, 6*cm], styles))
story.append(sp(6))
story.append(Paragraph("C. CARBAPENEMS & MONOBACTAMS", styles['subsection_title']))
carb_data = [
["Drug", "Class", "Spectrum", "Key Notes"],
["Imipenem + Cilastatin", "Carbapenem", "BROADEST — gram+, gram−, anaerobes; resistant to most β-lactamases", "Cilastatin inhibits renal dehydropeptidase (prevents imipenem inactivation); Seizure risk!"],
["Meropenem", "Carbapenem", "Similar to imipenem", "Less seizure risk; preferred for CNS infections"],
["Ertapenem", "Carbapenem", "NOT for Pseudomonas/Acinetobacter", "Once-daily dosing; outpatient use"],
["Aztreonam", "Monobactam", "GRAM-NEGATIVE ONLY (incl. Pseudomonas)", "SAFE in penicillin allergy (no cross-reactivity); no gram+ or anaerobic coverage"],
]
story.append(make_table(carb_data[0], carb_data[1:], [3.5*cm, 2.5*cm, 4*cm, 6*cm], styles))
story.append(PageBreak())
# ── ANTITUBERCULAR ──
story.append(Paragraph("3. ANTITUBERCULAR DRUGS (ATT)", styles['section_title']))
story.append(hr(styles))
att_data = [
["Drug", "MOA", "Key Adverse Effects", "Special Notes"],
["Rifampicin (R)", "Inhibits DNA-dependent RNA polymerase", "Orange-red body fluids (warn patient!); Hepatotoxicity; Potent CYP inducer (↓OCP, warfarin, etc.); Flu-like syndrome", "Most bactericidal; sterilizing drug; treats latent TB"],
["Isoniazid (H/INH)", "Inhibits mycolic acid synthesis (InhA); prodrug activated by KatG catalase", "Peripheral neuropathy (prevent with Vit B6/Pyridoxine); Hepatotoxicity; Drug-induced lupus; Psychosis", "Fast vs slow acetylators (NAT2); Slow acetylators → more peripheral neuropathy"],
["Pyrazinamide (Z)", "Disrupts membrane energy; active in acidic pH inside macrophages", "Hepatotoxicity (most serious); Hyperuricemia (gout); Arthralgia", "Only drug effective in acidic environment; sterilizing drug; used first 2 months"],
["Ethambutol (E)", "Inhibits arabinosyl transferase → ↓arabinogalactan in cell wall", "Optic neuritis: ↓visual acuity, red-green colour blindness (dose-dependent, reversible)", "Contraindicated in children <5 yrs and renal failure (without dose adjustment)"],
["Streptomycin (S)", "Binds 30S ribosome (aminoglycoside)", "Ototoxicity (vestibular > cochlear); Nephrotoxicity; Teratogenic", "Only injectable 1st-line drug; NOT used in pregnancy"],
]
story.append(make_table(att_data[0], att_data[1:], [2.5*cm, 4*cm, 4.5*cm, 5*cm], styles))
story.append(sp(4))
story.append(info_box(
"Standard ATT Regimen (WHO)",
["INTENSIVE PHASE (2 months): R + H + Z + E (4-drug RHZE)",
"CONTINUATION PHASE (4 months): R + H (2-drug RH)",
"Total duration: 6 months for drug-sensitive pulmonary TB"],
LIGHT_BLUE, MED_BLUE, styles
))
story.append(sp(8))
# ── ANTIMALARIALS ──
story.append(Paragraph("4. ANTIMALARIAL DRUGS", styles['section_title']))
story.append(hr(styles))
anti_mal_data = [
["Drug", "Class", "Action", "Key Uses / Notes"],
["Chloroquine", "4-Aminoquinoline", "↓Heme polymerization → toxic free heme accumulates (blood schizontocide)", "P. vivax, P. ovale, P. malariae; prophylaxis in sensitive areas; RA/SLE; retinopathy (chronic toxicity)"],
["Primaquine", "8-Aminoquinoline", "Hypnozoitocidal — kills liver hypnozoites; gametocidal", "ONLY drug for P. vivax/ovale relapse prevention; causes haemolysis in G6PD deficiency — SCREEN FIRST"],
["Artesunate / Artemether", "Artemisinin", "Generates free radicals → alkylates parasitic proteins (fastest acting)", "DOC for severe falciparum malaria (IV Artesunate); ACT for uncomplicated falciparum (Artemether + Lumefantrine)"],
["Mefloquine", "Aryl alcohol", "Blood schizontocide", "Prophylaxis and treatment of chloroquine-resistant P. falciparum; CNS side effects"],
["Quinine + Doxycycline", "Quinoline + Antibiotic", "Blood schizontocide", "Severe malaria (if artesunate unavailable); IV Quinine; cinchonism (tinnitus, deafness, nausea)"],
["Pyrimethamine + Sulfadoxine (SP)", "Antifolate combination", "Inhibit DHFR + DHPS → ↓folate synthesis", "Treatment of uncomplicated falciparum (ACT partner); IPTp in pregnancy (intermittent preventive treatment)"],
["Atovaquone + Proguanil (Malarone)", "Hydroxynaphthoquinone", "Inhibit mitochondrial electron transport", "Prophylaxis and treatment of falciparum; no cross-resistance with chloroquine"],
]
story.append(make_table(anti_mal_data[0], anti_mal_data[1:], [2.8*cm, 3*cm, 3.5*cm, 6.7*cm], styles))
story.append(PageBreak())
# ── ANTIFUNGALS ──
story.append(marks_box("★ 5 MARKS", MED_BLUE, styles))
story.append(sp(6))
story.append(Paragraph("5. ANTIFUNGAL DRUGS", styles['section_title']))
story.append(hr(styles))
af_data = [
["Class", "Drugs", "MOA", "Key Uses & Notes"],
["Azoles", "Fluconazole, Itraconazole, Voriconazole, Ketoconazole, Clotrimazole (topical)", "Inhibit CYP51 (lanosterol 14α-demethylase) → ↓ergosterol synthesis → toxic sterol precursors accumulate", "Fluconazole: Candida, Cryptococcal meningitis maintenance; Voriconazole: DOC for Aspergillosis; CYP3A4 inhibitors"],
["Polyenes", "Amphotericin B, Nystatin (topical)", "Bind ergosterol → form pores → ion leakage → cell death (fungicidal)", "AmB: DOC for systemic fungal infections (Aspergillus, Cryptococcus, Mucormycosis, Histoplasma); Nephrotoxicity (dose-limiting)"],
["Echinocandins", "Caspofungin, Micafungin, Anidulafungin", "Inhibit β-1,3-glucan synthase → ↓fungal cell wall synthesis", "Candida (incl. Fluconazole-resistant); Aspergillosis (salvage); Safe in renal impairment"],
["Allylamines", "Terbinafine, Naftifine", "Inhibit squalene epoxidase → ↓ergosterol; toxic squalene accumulation", "Dermatophyte infections (tinea unguium/onychomycosis — terbinafine oral is DOC)"],
["Antimetabolite", "Flucytosine (5-FC)", "Converted to 5-FU inside fungal cells → inhibit thymidylate synthase", "Cryptococcal meningitis (combined with Amphotericin B); resistance develops rapidly — never use alone"],
]
story.append(make_table(af_data[0], af_data[1:], [2.8*cm, 3.2*cm, 4*cm, 6*cm], styles))
story.append(sp(4))
story.append(info_box(
"Amphotericin B — Adverse Effects (IMPORTANT)",
["Nephrotoxicity (dose-limiting — most serious; pre-hydrate; monitor creatinine)",
"Infusion reactions (fever, chills, rigors — 'Shake and Bake'; premedicate with paracetamol + hydrocortisone)",
"Hypokalemia + Hypomagnesemia (tubular dysfunction) • Normochromic normocytic anaemia",
"Liposomal AmB (AmBisome) = less nephrotoxic; preferred for CNS infections"],
LIGHT_RED, ACCENT_RED, styles
))
story.append(sp(8))
# ── ANTICANCER ──
story.append(Paragraph("6. ANTICANCER DRUG CLASSIFICATION", styles['section_title']))
story.append(hr(styles))
cancer_data = [
["Class", "Examples", "MOA", "Key Toxicities"],
["Alkylating Agents", "Cyclophosphamide, Ifosfamide, Busulfan, Chlorambucil, Cisplatin", "Cross-link DNA strands → prevent replication (cell-cycle non-specific)", "Haemorrhagic cystitis (cyclophosphamide/ifosfamide — acrolein; prevent with MESNA); myelosuppression; nephrotoxicity (cisplatin)"],
["Antimetabolites", "Methotrexate, 5-FU, Cytarabine, Gemcitabine, 6-Mercaptopurine", "Methotrexate: inhibits DHFR; 5-FU: inhibits thymidylate synthase → ↓DNA synthesis (S-phase specific)", "Myelosuppression, mucositis, hepatotoxicity (MTX), pulmonary fibrosis (MTX), teratogenic; Leucovorin rescue for MTX"],
["Vinca Alkaloids", "Vincristine, Vinblastine, Vinorelbine", "Inhibit tubulin polymerisation → prevent spindle formation → metaphase arrest", "Vincristine: peripheral neuropathy (dose-limiting); Vinblastine: myelosuppression (dose-limiting); alopecia"],
["Taxanes", "Paclitaxel, Docetaxel", "Promote tubulin polymerisation → prevent spindle disassembly → metaphase arrest", "Myelosuppression, peripheral neuropathy, hypersensitivity (paclitaxel — premedicate)"],
["Anthracyclines", "Doxorubicin, Daunorubicin, Epirubicin", "Intercalate DNA; inhibit topoisomerase II; generate free radicals", "Cardiotoxicity (dose-related, irreversible DCM — cumulative dose limit!); red urine; alopecia"],
["Platinum Compounds", "Cisplatin, Carboplatin, Oxaliplatin", "Intra/interstrand DNA cross-links", "Cisplatin: nephrotoxicity (most serious — hydrate!), ototoxicity, peripheral neuropathy, severe N&V"],
["Topoisomerase Inhibitors", "Etoposide (Topo II), Topotecan, Irinotecan (Topo I)", "Inhibit topoisomerase → DNA strand breaks", "Myelosuppression; irinotecan — severe diarrhoea"],
["Monoclonal Antibodies", "Rituximab (CD20), Trastuzumab (HER2), Bevacizumab (VEGF)", "Targeted receptor blockade or ADCC", "Trastuzumab: cardiotoxicity; Bevacizumab: hypertension, wound healing impairment"],
]
story.append(make_table(cancer_data[0], cancer_data[1:], [3*cm, 4*cm, 4*cm, 5*cm], styles))
story.append(PageBreak())
# ──────────────────────────────────────────────────────────────────────────────
# CHAPTER 4: RENAL PHARMACOLOGY
# ──────────────────────────────────────────────────────────────────────────────
def build_renal(story, styles):
story.append(section_header("CHAPTER 4: RENAL PHARMACOLOGY", ACCENT_RED, styles))
story.append(sp(8))
story.append(marks_box("★ 5 MARKS", GOLD, styles))
story.append(sp(6))
story.append(Paragraph("CLASSIFICATION OF DIURETICS", styles['section_title']))
story.append(hr(styles))
diur_data = [
["Class", "Drugs", "Site of Action", "Mechanism", "Electrolyte Effects"],
["Loop Diuretics", "Furosemide, Bumetanide, Ethacrynic acid, Torsemide", "Thick ascending limb (Loop of Henle)", "Block NKCC2 (Na⁺/K⁺/2Cl⁻ cotransporter)", "↓K⁺, ↓Na⁺, ↓Cl⁻, ↓Ca²⁺, ↓Mg²⁺; metabolic alkalosis"],
["Thiazides", "HCTZ, Chlorthalidone, Indapamide, Metolazone", "Distal convoluted tubule (DCT)", "Block NCC (Na⁺/Cl⁻ cotransporter)", "↓K⁺, ↓Na⁺, ↑Ca²⁺ (reabsorption); metabolic alkalosis"],
["K⁺-Sparing", "Spironolactone, Eplerenone (aldosterone antagonists); Amiloride, Triamterene (ENaC blockers)", "Collecting duct", "Block aldosterone receptor or ENaC directly", "↑K⁺ (hyperkalemia risk); mild Na⁺ loss"],
["Carbonic Anhydrase Inhibitors", "Acetazolamide", "Proximal convoluted tubule (PCT)", "Block carbonic anhydrase → ↓HCO₃⁻ reabsorption", "↑K⁺ loss; metabolic hyperchloremic ACIDOSIS"],
["Osmotic", "Mannitol", "PCT, Loop, Collecting duct", "Osmotic retention of water", "Dilutional; plasma expansion first"],
["Vaptans (ADH antagonists)", "Tolvaptan (oral), Conivaptan (IV)", "Collecting duct", "Block V2 receptors → ↓AQP2 insertion", "Free water loss without Na⁺ loss (aquaresis)"],
]
story.append(make_table(diur_data[0], diur_data[1:], [2.8*cm, 3.5*cm, 2.8*cm, 3.5*cm, 3.4*cm], styles))
story.append(sp(8))
# ── FUROSEMIDE ──
story.append(Paragraph("LOOP DIURETICS — FUROSEMIDE", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph("<b>Mechanism:</b> Blocks NKCC2 in thick ascending limb → most potent diuresis (up to 25% of filtered Na⁺). Also has venodilation (reduces preload even before diuresis begins — important in acute pulmonary oedema).", styles['body']))
furo_uses = [
"<b>Acute pulmonary oedema (LVF)</b> — drug of choice",
"Chronic heart failure (symptom relief)",
"Hypercalcaemia (↑urinary Ca²⁺ excretion — combined with IV saline)",
"Hypertension (resistant/volume-overloaded)",
"Nephrotic syndrome, cirrhotic ascites",
"Acute renal failure (maintain urine flow)",
"Hyperkalemia",
]
story.append(Paragraph("Therapeutic Uses:", styles['subsection_title']))
for u in furo_uses:
story.append(Paragraph(f"• {u}", styles['bullet']))
story.append(Paragraph("Adverse Effects:", styles['subsection_title']))
furo_ae = [
"<b>Hypokalaemic metabolic alkalosis</b> (most common — supplement K⁺)",
"Hyponatraemia, hypomagnesaemia, hypocalcaemia",
"<b>Ototoxicity</b> (high IV doses, or combined with aminoglycosides — additive!)",
"Hyperuricaemia (precipitate gout)",
"Hyperglycaemia (mild)",
"Dehydration, postural hypotension",
"Sulfonamide allergy (cross-reactivity possible with thiazides too)",
]
for ae in furo_ae:
story.append(Paragraph(f"• {ae}", styles['bullet']))
story.append(sp(8))
# ── THIAZIDES ──
story.append(Paragraph("THIAZIDE DIURETICS", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph(
"<b>MOA:</b> Block NCC in DCT → moderate diuresis. Unique: <b>↑Ca²⁺ reabsorption</b> (useful in hypercalciuria/calcium stones). "
"Lose effectiveness in renal failure (GFR <30 mL/min) — use loop diuretics instead.", styles['body']))
story.append(Paragraph("<b>Thiazide Uses:</b>", styles['subsection_title']))
thia_uses = [
"Hypertension — first-line (especially in elderly, Black patients)",
"Heart failure (mild-moderate)",
"Nephrogenic diabetes insipidus (paradoxical — ↓urine volume via ↑PCT reabsorption)",
"Hypercalciuria / Calcium nephrolithiasis",
"Osteoporosis prevention",
]
for u in thia_uses:
story.append(Paragraph(f"• {u}", styles['bullet']))
story.append(info_box(
"Thiazide Adverse Effects — 'HyperGLUC'",
["Hyperglycaemia (↓insulin secretion) • Hyperlipidaemia (↑LDL, TG) • Hyperuricaemia (gout)",
"Hypokalaemia + metabolic alkalosis • Hyponatraemia (most serious) • Hypercalcaemia"],
LIGHT_GOLD, GOLD, styles
))
story.append(sp(8))
# ── POTASSIUM-SPARING ──
story.append(Paragraph("POTASSIUM-SPARING DIURETICS", styles['section_title']))
story.append(hr(styles))
ks_data = [
["Drug", "MOA", "Uses", "Adverse Effects"],
["Spironolactone", "Competitive aldosterone antagonist → blocks mineralocorticoid receptor in collecting duct", "Hyperaldosteronism (Conn's — DOC), HFrEF (↓mortality — RALES trial), cirrhotic ascites, hypertension (add-on), PCOS/hirsutism (anti-androgen)", "Hyperkalemia; Gynecomastia, menstrual irregularities (anti-androgen effect); Onset delayed 2–3 days"],
["Eplerenone", "Selective aldosterone antagonist (more selective than spironolactone)", "HFrEF post-MI (EPHESUS trial), hypertension", "Hyperkalemia; NO gynecomastia (selective — no anti-androgen)"],
["Amiloride", "Directly blocks ENaC (Na⁺ channel) in collecting duct — independent of aldosterone", "Hypertension (add-on), prevention of hypokalaemia with loop/thiazide, Liddle syndrome", "Hyperkalemia; GI effects"],
["Triamterene", "Same as amiloride (ENaC blocker)", "Same as amiloride", "Hyperkalemia; Renal stones (triamterene stones); Folate deficiency"],
]
story.append(make_table(ks_data[0], ks_data[1:], [2.5*cm, 4.5*cm, 4*cm, 5*cm], styles))
story.append(sp(8))
# ── ADH/VASOPRESSIN ──
story.append(Paragraph("ANTIDIURETICS — VASOPRESSIN & DESMOPRESSIN", styles['section_title']))
story.append(hr(styles))
story.append(Paragraph(
"<b>ADH Physiology:</b> Released from posterior pituitary in response to ↑osmolality or ↓blood volume → "
"V2 receptors on collecting duct → inserts Aquaporin-2 (AQP2) channels → ↑water reabsorption → "
"concentrated urine. V1 receptors on vessels → vasoconstriction.", styles['body']))
story.append(sp(4))
adh_data = [
["Drug", "Receptor Selectivity", "Route", "Uses"],
["Desmopressin (DDAVP)", "Selective V2 agonist (no V1/pressor effect at low doses)", "Intranasal, SC, IV, Oral", "Central diabetes insipidus (DOC); Nocturnal enuresis; Haemophilia A and vWD (releases stored vWF + Factor VIII); Nocturnal polyuria"],
["Vasopressin (ADH)", "V1 + V2 agonist", "IV/SC", "Septic shock (vasopressor — V1); Central DI; Bleeding oesophageal varices (V1 — splanchnic vasoconstriction)"],
["Terlipressin", "V1 agonist (predominantly)", "IV bolus", "Hepatorenal syndrome (with albumin — DOC); Oesophageal varices"],
["Tolvaptan (Vaptan)", "V2 ANTAGONIST", "Oral", "Euvolemic/hypervolemic hyponatraemia (SIADH, HF, cirrhosis) — aquaresis; ADPKD (slows cyst growth)"],
["Conivaptan", "V1A + V2 ANTAGONIST", "IV", "Hyponatraemia in hospitalised patients"],
]
story.append(make_table(adh_data[0], adh_data[1:], [3*cm, 3.5*cm, 2*cm, 7.5*cm], styles))
story.append(sp(8))
# ── QUICK REFERENCE TABLE ──
story.append(section_header("QUICK REFERENCE: DRUG OF CHOICE (DOC) SUMMARY", HexColor('#2C3E50'), styles))
story.append(sp(8))
doc_data = [
["Condition", "Drug of Choice", "Notes"],
["Hypertension in Diabetes", "ACE Inhibitor (e.g. Enalapril)", "Also renoprotective; ARB if ACEi not tolerated"],
["Hypertension in Pregnancy", "Methyldopa (1st line), Labetalol, Nifedipine", "ACEi/ARBs CONTRAINDICATED"],
["Hypertensive Emergency", "IV Sodium Nitroprusside (most), IV Labetalol", "Aortic dissection: Labetalol; Pre-eclampsia: IV Labetalol or MgSO₄"],
["Acute Angina Attack", "Sublingual GTN (nitroglycerin)", "Onset 1–2 min"],
["Vasospastic (Prinzmetal) Angina", "Calcium Channel Blocker (Nifedipine)", "Beta-blockers contraindicated"],
["Acute Pulmonary Oedema", "IV Furosemide + IV GTN + Morphine", "Oxygen if SpO₂ <94%"],
["Acute Paroxysmal SVT", "Adenosine (IV rapid bolus)", "Verapamil if adenosine fails"],
["Ventricular Fibrillation (cardiac arrest)", "Amiodarone (IV)", "After defibrillation + CPR"],
["Digoxin Toxicity", "Digoxin-specific Fab antibodies (Digibind)", "Correct K⁺ and Mg²⁺; stop digoxin"],
["Acute MI", "Aspirin + Clopidogrel + Primary PCI", "Tenecteplase if PCI unavailable"],
["Syphilis", "Benzathine Penicillin G IM", "Doxycycline if penicillin-allergic"],
["Severe Falciparum Malaria", "IV Artesunate", "Oral ACT for uncomplicated"],
["P. vivax Relapse Prevention", "Primaquine", "Screen G6PD before use"],
["Cryptococcal Meningitis", "IV Amphotericin B + Flucytosine (induction)", "Then Fluconazole (maintenance)"],
["Invasive Aspergillosis", "Voriconazole", "Liposomal AmB alternative"],
["Anaemia of CKD", "Erythropoietin (Epoetin/Darbepoetin)", "With IV Iron supplementation"],
["Iron Poisoning", "Desferrioxamine (IV/IM)", "Chelating agent"],
["Cerebral Oedema / Raised ICP", "IV Mannitol (osmotic)", "Also dexamethasone for vasogenic oedema"],
["Hyperaldosteronism (Conn's)", "Spironolactone", "Eplerenone if gynecomastia is a problem"],
["Central Diabetes Insipidus", "Desmopressin (DDAVP)", "Intranasal or oral"],
["Haemophilia A + vWD (acute)", "Desmopressin (DDAVP)", "Releases stored vWF + Factor VIII"],
]
story.append(make_table(doc_data[0], doc_data[1:], [5.5*cm, 5*cm, 5.5*cm], styles))
story.append(PageBreak())
# ── MEMORY AIDS ──
story.append(section_header("MEMORY AIDS & EXAM TIPS", HexColor('#1A3A5C'), styles))
story.append(sp(8))
mnemonics = [
("ACE Inhibitor Side Effects — 'CAPTOPRIL'",
["C — Cough (dry)", "A — Angioedema", "P — Proteinuria (↑in bilateral RAS)",
"T — Teratogenic (pregnancy)", "O — hypOtension (first dose)",
"P — Potassium ↑ (hyperkalemia)", "R — Renal failure (bilateral RAS)",
"I — ↑Immunosuppression (neutropenia — captopril)", "L — Loss of taste (captopril)"],
LIGHT_BLUE, DARK_BLUE),
("Digitalis Toxicity Features — 'GI + CNS + HEART'",
["GI (EARLIEST): Anorexia, nausea, vomiting",
"CNS: Xanthopsia (yellow-green vision), confusion, headache",
"HEART (WORST): ANY arrhythmia — PVCs (most common), bigeminy, PAT with block, VT, VF"],
LIGHT_PURP, ACCENT_PURP),
("Warfarin Vitamin K Factors — 'Ten Two's'",
["Factors inhibited: II (prothrombin), VII, IX, X",
"Proteins inhibited: Protein C and Protein S (anticoagulant — fall first → transient pro-thrombotic state!)",
"Mnemonic: '1972' = I, IX, VII, II"],
LIGHT_GREEN, ACCENT_GREEN),
("ATT Drug Side Effects — Quick Recall",
["R — Rifampicin: Red urine, CYP inducer, Hepatotoxicity",
"I — INH: Isoniazid: peripheral neuropathy (B6!), hepatotoxicity",
"P — Pyrazinamide: Hepatotoxicity (most), gout (hyperuricaemia)",
"E — Ethambutol: Eye (optic neuritis)",
"S — Streptomycin: Sensorineural hearing loss, vestibular damage"],
LIGHT_GOLD, GOLD),
("Thiazide Adverse Effects — 'HyperGLUC'",
["Hyper-Glycaemia • Hyper-Lipidaemia • Hyper-Uricaemia • Hyper-Calcaemia",
"Hypo-Kalaemia • Hypo-Natraemia (most serious — dilutional)"],
LIGHT_RED, ACCENT_RED),
("Beta-Lactam Mnemonics",
["PenS = Penicillinase-Sensitive (pen G, pen V, aminopenicillins, anti-pseudo)",
"PenR = Penicillinase-Resistant = Cloxacillin, Flucloxacillin (anti-staph)",
"3rd gen cephalosporins cross BBB = treat MENINGITIS (CeftRiaxone)",
"Aztreonam = GRAM NEGATIVE ONLY + SAFE in penicillin allergy"],
LIGHT_BLUE, MED_BLUE),
]
for title, lines, bg, fg in mnemonics:
story.append(info_box(title, lines, bg, fg, styles))
story.append(sp(6))
story.append(PageBreak())
def build_quick_summary(story, styles):
story.append(section_header("EXAM QUICK SUMMARY — ALL SECTIONS", DARK_BLUE, styles))
story.append(sp(8))
# High-yield comparison table
story.append(Paragraph("HIGH-YIELD COMPARISONS", styles['section_title']))
story.append(hr(styles))
comp_data = [
["Topic", "Key Differentiator"],
["UFH vs LMWH", "UFH: monitor aPTT, reverse with protamine fully, risk of HIT; LMWH: no monitoring, SC, predictable, less HIT"],
["Streptokinase vs Alteplase", "SK: antigenic, cheap, non-fibrin-specific; Alteplase: fibrin-specific, safer, used in stroke"],
["Verapamil vs Nifedipine", "Verapamil: heart (bradycardia, constipation) — don't combine with beta-blocker; Nifedipine: vessels (flushing, oedema, reflex tachycardia)"],
["Clopidogrel vs Ticagrelor", "Clopidogrel: prodrug (CYP2C19), irreversible; Ticagrelor: direct acting, reversible, faster onset"],
["Cisplatin vs Carboplatin", "Cisplatin: more nephrotoxic + ototoxic; Carboplatin: more myelosuppressive but less nephro/oto"],
["Vincristine vs Vinblastine", "Vincristine: Neuropathy (dose-limiting); Vinblastine: Myelosuppression (dose-limiting)"],
["Chloroquine vs Primaquine", "Chloroquine: blood schizontocide; Primaquine: liver hypnozoites (vivax/ovale relapse prevention); risk in G6PD"],
["Amphotericin B vs Fluconazole", "AmB: broadest spectrum, nephrotoxic; Fluconazole: narrower (candida/crypto), oral, well-tolerated"],
["ACEi vs ARB", "ACEi: bradykinin↑ → cough + angioedema; ARB: no bradykinin effect → no cough"],
["Furosemide vs HCTZ", "Furosemide: loop (powerful, ↓Ca²⁺); HCTZ: thiazide (moderate, ↑Ca²⁺ — use in nephrolithiasis)"],
["Spironolactone vs Amiloride", "Spironolactone: aldosterone antagonist (gynecomastia); Amiloride: ENaC blocker (no hormonal effects)"],
["Desmopressin vs Vasopressin", "Desmopressin: V2-selective (no pressor); Vasopressin: V1+V2 (pressor + antidiuretic)"],
]
story.append(make_table(comp_data[0], comp_data[1:], [5*cm, 11*cm], styles))
story.append(sp(8))
story.append(Paragraph("MARKS DISTRIBUTION SUMMARY", styles['section_title']))
story.append(hr(styles))
marks_data = [
["Section", "10-Mark Topics", "5-Mark Topics", "3-Mark Topics"],
["Cardiovascular System", "ACE Inhibitors, ARBs, Organic Nitrates, CCBs, Cardiac Glycosides", "Sodium Nitroprusside, Classification Antihypertensives, Acute MI pharmacotherapy, Lignocaine, Amiodarone, Adenosine", "Beta-blockers (angina/HTN), Clonidine, Vasodilators"],
["Blood & Blood Formation", "Anticoagulants (parenteral+oral), Iron absorption & preparations, Anticoagulant pharmacology", "Hypolipidemic classification, Plasma volume expanders, Thrombolytics, Antiplatelets, VitB12, Folic acid, EPO", "Antithrombolytics, Clopidogrel, Aspirin in MI"],
["Chemotherapy", "Fluoroquinolones, Beta-lactams, Macrolides, ATT drugs, Antimalarials", "Antifungals, Aminoglycosides, Tetracyclines, Dapsone, Anticancer classification, Cyclophosphamide, Methotrexate, Vinca alkaloids", "Leprosy drugs, Malaria acute attack, Albendazole, Ivermectin"],
["Renal Pharmacology", "-", "Diuretic classification, Acetazolamide, Mannitol, Furosemide, Thiazides, K⁺-sparing diuretics, Antidiuretics", "-"],
]
story.append(make_table(marks_data[0], marks_data[1:], [3.5*cm, 5*cm, 4.5*cm, 3*cm], styles))
story.append(PageBreak())
def on_page(canvas, doc):
"""Add header and footer to each page."""
canvas.saveState()
w, h = A4
# Header bar
canvas.setFillColor(DARK_BLUE)
canvas.rect(MARGIN, h - 1.2*cm, w - 2*MARGIN, 0.6*cm, fill=1, stroke=0)
canvas.setFillColor(WHITE)
canvas.setFont('Helvetica-Bold', 8)
canvas.drawString(MARGIN + 5, h - 0.9*cm, "PHARMACOLOGY STUDY GUIDE")
canvas.drawRightString(w - MARGIN - 5, h - 0.9*cm, "Exam Preparation")
# Footer
canvas.setFillColor(MID_GREY)
canvas.setFont('Helvetica', 7.5)
canvas.drawCentredString(w/2, 0.7*cm, f"Page {doc.page} | Based on KD Tripathi & Lippincott Pharmacology")
canvas.restoreState()
def main():
os.makedirs(os.path.dirname(OUTPUT_PATH), exist_ok=True)
doc = SimpleDocTemplate(
OUTPUT_PATH,
pagesize=A4,
leftMargin=MARGIN,
rightMargin=MARGIN,
topMargin=1.5*cm,
bottomMargin=1.5*cm,
title="Pharmacology Study Guide",
author="Orris AI",
subject="Pharmacology Exam Preparation"
)
styles = build_styles()
story = []
build_cover(story, styles)
build_toc(story, styles)
build_cvs(story, styles)
build_blood(story, styles)
build_chemo(story, styles)
build_renal(story, styles)
build_quick_summary(story, styles)
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF generated successfully: {OUTPUT_PATH}")
import os
size = os.path.getsize(OUTPUT_PATH)
print(f"File size: {size / 1024:.1f} KB")
if __name__ == '__main__':
main()
cd /tmp/workspace/pharma-study-guide && python3 generate_pdf.py 2>&1
~/pharma-study-guide/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/pharma-study-guide/generate_pdf.py'
~/pharma-study-guide/generate_pdf.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/pharma-study-guide/generate_pdf.py'
cd /tmp/workspace/pharma-study-guide && python3 generate_pdf.py 2>&1
cd /tmp/workspace/pharma-study-guide && python3 -c " from pypdf import PdfReader r = PdfReader('Pharmacology_Study_Guide.pdf') print(f'Pages: {len(r.pages)}') print(f'Title: {r.metadata.title}') for i, p in enumerate(r.pages[:3]): txt = p.extract_text()[:80] print(f'Page {i+1}: {txt!r}') "
Pharmacology Study Guide
PDF Document · PDF
| Section | Content |
|---|---|
| Cover Page | Title, section overview, source references |
| Table of Contents | All topics listed by chapter with mark weightage |
| Chapter 1 — Cardiovascular System | ACE Inhibitors, ARBs, Organic Nitrates, CCBs, Cardiac Glycosides, Acute MI Pharmacotherapy, Amiodarone, Adenosine, Beta-Blockers, Clonidine |
| Chapter 2 — Blood & Blood Formation | Hypolipidemic classification, Thrombolytics, Antiplatelets, Anticoagulants (full table), Iron preparations, Erythropoietin |
| Chapter 3 — Chemotherapy | Fluoroquinolones, Beta-Lactams (all generations), ATT drugs, Antimalarials, Antifungals, Anticancer drug classification |
| Chapter 4 — Renal Pharmacology | Diuretic classification, Furosemide, Thiazides, K⁺-sparing, ADH/Desmopressin |
| Quick Reference | Drug of Choice (DOC) table for 21 conditions, High-yield comparison table (UFH vs LMWH, ACEi vs ARB, etc.) |
| Memory Aids | 6 mnemonics including CAPTOPRIL, HyperGLUC, ATT RIPES side effects |