Which BP medicine given in which condition

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Loading Image
Finding Sources
I now have everything needed for a thorough, well-referenced answer. Let me compile it.

Antihypertensive Drugs: Which Drug for Which Condition

Here is the complete clinical guide based on JNC 7/ACC-AHA 2018 guidelines and current textbook evidence.

Drug Treatment Algorithm for Uncomplicated Hypertension

European Core Drug Treatment Algorithm for Uncomplicated Hypertension
(Comprehensive Clinical Nephrology, 7th Ed., p. 531)
Step 1 - Initial (Dual combination): ACEi or ARB + CCB or Diuretic Step 2 - Triple combination: ACEi or ARB + CCB + Diuretic Step 3 - Resistant HTN: Add spironolactone 25-50 mg OD (or alpha-blocker or beta-blocker)
Beta-blockers are added at any step when there is a specific indication: heart failure, angina, post-MI, atrial fibrillation, or younger pregnant women.

Compelling Indications Table (JNC 7 / ACC-AHA)

(Textbook of Family Medicine, 9e, p. 662)
ConditionDiureticBeta-BlockerACE InhibitorARBCCBMRA (Spironolactone)
Heart Failure-
Post-MI---
High CAD Risk--
Diabetes Mellitus-
Renal Disease (CKD)----
Recurrent Stroke Prevention----

Detailed Drug-by-Drug Breakdown

(National Kidney Foundation Primer on Kidney Diseases, 8e, p. 691)

1. Thiazide/Thiazide-like Diuretics (e.g., Hydrochlorothiazide, Chlorthalidone)

  • Indications: Uncomplicated HTN (first-line), heart failure, high CAD risk, diabetes, stroke prevention
  • Mechanism: Inhibit Na-Cl cotransporter in distal convoluted tubule
  • Side effects: Hypokalemia, hyponatremia, hyperuricemia, impaired glucose tolerance, dyslipidemia
  • Note: Chlorthalidone preferred over HCTZ (longer duration, better CV outcomes)

2. Loop Diuretics (e.g., Furosemide)

  • Indications: HTN with volume overload, heart failure with fluid retention, CKD with low GFR (<30)
  • Mechanism: Inhibit Na-K-2Cl cotransporter in thick ascending limb
  • Side effects: Hypokalemia, ototoxicity, fewer metabolic effects than thiazides

3. ACE Inhibitors (e.g., Ramipril, Lisinopril, Enalapril)

  • Indications: Heart failure, post-MI, CKD (especially with proteinuria), diabetes, high CAD risk, stroke prevention
  • Mechanism: Block conversion of angiotensin I to angiotensin II
  • Side effects: Dry cough (10-15%), hyperkalemia, elevated creatinine, angioedema, teratogenic (avoid in pregnancy)

4. Angiotensin Receptor Blockers/ARBs (e.g., Losartan, Valsartan, Telmisartan)

  • Indications: Same as ACEi - heart failure, CKD, diabetes; preferred when patient cannot tolerate ACEi (due to cough)
  • Mechanism: Block angiotensin II at the AT1 receptor
  • Side effects: Similar to ACEi but NO cough; also teratogenic (avoid in pregnancy)

5. Calcium Channel Blockers/CCBs

SubclassExamplesIndicationsNotes
DihydropyridineAmlodipine, NifedipineHTN + angina, elderly, diabetes, high CAD riskPeripheral vasodilation; edema as side effect
Non-DHP (Diltiazem)DiltiazemHTN + angina + atrial fibrillationAV node blockade; bradycardia
Non-DHP (Verapamil)VerapamilHTN + SVT, anginaAV node blockade; constipation; avoid in HFrEF

6. Beta-Blockers (e.g., Metoprolol, Carvedilol, Atenolol, Labetalol)

  • Indications: HTN + heart failure (HFrEF), post-MI, angina, atrial fibrillation (rate control), hypertensive urgency in pregnancy (labetalol)
  • Side effects: Reduced exercise tolerance, depression, bronchospasm (non-selective BB), impaired glucose masking
  • Contraindication: Asthma/COPD (use cardioselective if essential), severe bradycardia, decompensated HF acutely

7. MRA - Mineralocorticoid Receptor Antagonists (e.g., Spironolactone, Eplerenone)

  • Indications: Resistant hypertension (4th-line add-on), heart failure (HFrEF), post-MI with HF, primary hyperaldosteronism
  • Side effects: Hyperkalemia, gynecomastia (spironolactone), menstrual irregularities

8. Alpha-Blockers (e.g., Doxazosin, Prazosin)

  • Indications: HTN + benign prostatic hyperplasia (BPH), pheochromocytoma (phentolamine)
  • Note: Not first-line for HTN alone due to increased CV events in ALLHAT trial

9. Central Alpha-2 Agonists (e.g., Methyldopa, Clonidine)

  • Indications: Hypertension in pregnancy (methyldopa is drug of choice), resistant HTN
  • Side effects: Sedation, dry mouth, rebound HTN on abrupt withdrawal (clonidine)

Special Situations - Drug of Choice

Clinical SituationPreferred Drug(s)
PregnancyMethyldopa, Labetalol, Nifedipine (extended-release)
Hypertensive emergencyIV Labetalol, IV Nicardipine, IV Nitroprusside, IV Clevidipine, Fenoldopam
Hypertensive emergency + aortic dissectionIV Esmolol + IV Nitroprusside (reduce HR and BP simultaneously)
Hypertension + pheochromocytomaPhentolamine (alpha-blocker) FIRST, then beta-blocker
Hypertension + BPHDoxazosin (alpha-blocker)
Isolated systolic hypertension in elderlyDihydropyridine CCB (amlodipine) or thiazide diuretic
Hypertension + metabolic syndromeACEi or ARB (avoid thiazide + beta-blocker combination - worsens glucose control)
Black/African patientsCCB or thiazide diuretics (RAS blockers less effective as monotherapy)
CKD + proteinuriaACEi or ARB (renoprotective)
Post-MIBeta-blocker + ACEi + MRA
Atrial fibrillationBeta-blocker or non-DHP CCB (rate control)

Hypertensive Emergency - Drug Guide

(Comprehensive Clinical Nephrology, 7th Ed.; Lippincott Pharmacology)
Emergency TypeFirst-Line IV AgentsAvoid
Hypertensive encephalopathyNicardipine, Labetalol, ClevidipineNitroprusside
Acute ischemic strokeNicardipine, Labetalol, ClevidipineNitroprusside, Nimodipine (usually)
Aortic dissectionEsmolol + NitroprussideHydralazine (reflex tachycardia)
Acute pulmonary edemaIV Nitroglycerine, Furosemide, NicardipineBeta-blockers
Acute MIBeta-blocker, Nitroglycerine, ACEiHydralazine
EclampsiaIV Hydralazine, IV Labetalol, IV MgSO4 (seizure prophylaxis)ACEi, ARBs
Key rule in emergencies: Reduce BP by no more than 25% in the first hour, then to 160/100-110 mmHg over the next 2-6 hours. Too-rapid reduction risks ischemia.

Drugs to Avoid in Specific Conditions

ConditionAvoid
Bilateral renal artery stenosisACEi, ARBs
PregnancyACEi, ARBs, Direct renin inhibitors
Asthma/COPDNon-selective beta-blockers
AV block (2nd/3rd degree)Verapamil, Diltiazem, Beta-blockers
HyperkalemiaACEi, ARBs, Potassium-sparing diuretics, MRA
GoutThiazide diuretics (worsen hyperuricemia)
Decompensated heart failure (acute)Verapamil, Non-DHP CCBs

Sources: Comprehensive Clinical Nephrology 7e; National Kidney Foundation Primer on Kidney Diseases 8e; Textbook of Family Medicine 9e; Goldman-Cecil Medicine; Lippincott Pharmacology

Create a quick-reference PDF chart of BP medications I can print

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"

Running Command

mkdir -p /home/daytona/workspace/bp-chart && python3 -c "import reportlab; print('reportlab ok')" && python3 -c "from reportlab.lib import colors; print('colors ok')"

Writing File

~/bp-chart/generate_bp_chart.py

from reportlab.lib.pagesizes import A4, landscape
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm, cm
from reportlab.platypus import (
    SimpleDocTemplate, Table, TableStyle, Paragraph,
    Spacer, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT
from reportlab.platypus import PageBreak

OUTPUT = "/home/daytona/workspace/bp-chart/BP_Medications_QuickRef.pdf"

# ── Colour palette ──────────────────────────────────────────────────────────
NAVY      = colors.HexColor("#1a3a5c")
TEAL      = colors.HexColor("#1a7a8a")
AMBER     = colors.HexColor("#d4830a")
RED       = colors.HexColor("#c0392b")
GREEN     = colors.HexColor("#1e7d44")
LTBLUE    = colors.HexColor("#dceef5")
LTTEAL    = colors.HexColor("#d4f0f0")
LTAMBER   = colors.HexColor("#fdf3dc")
LTRED     = colors.HexColor("#fde8e6")
LTGREEN   = colors.HexColor("#e6f5ec")
GREY1     = colors.HexColor("#f2f4f6")
GREY2     = colors.HexColor("#dce0e5")
WHITE     = colors.white
BLACK     = colors.black

# ── Styles ──────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

title_style = ParagraphStyle(
    "Title", fontSize=20, textColor=WHITE, fontName="Helvetica-Bold",
    alignment=TA_CENTER, spaceAfter=2
)
subtitle_style = ParagraphStyle(
    "Subtitle", fontSize=9, textColor=colors.HexColor("#cce0ee"),
    fontName="Helvetica", alignment=TA_CENTER, spaceAfter=0
)
section_style = ParagraphStyle(
    "Section", fontSize=11, textColor=WHITE, fontName="Helvetica-Bold",
    alignment=TA_CENTER
)
cell_body = ParagraphStyle(
    "CellBody", fontSize=7.5, fontName="Helvetica", leading=10,
    alignment=TA_LEFT
)
cell_bold = ParagraphStyle(
    "CellBold", fontSize=7.5, fontName="Helvetica-Bold", leading=10,
    alignment=TA_LEFT
)
cell_center = ParagraphStyle(
    "CellCenter", fontSize=7.5, fontName="Helvetica", leading=10,
    alignment=TA_CENTER
)
cell_center_bold = ParagraphStyle(
    "CellCenterBold", fontSize=8, fontName="Helvetica-Bold", leading=11,
    alignment=TA_CENTER
)
small_note = ParagraphStyle(
    "SmallNote", fontSize=6.5, fontName="Helvetica-Oblique", leading=9,
    textColor=colors.HexColor("#555555"), alignment=TA_CENTER
)

# ── Helper ───────────────────────────────────────────────────────────────────
def p(text, style=cell_body):
    return Paragraph(text, style)

def tick(yes=True):
    return p("✔" if yes else "—", cell_center)

# ─────────────────────────────────────────────────────────────────────────────
# PAGE 1  –  Compelling Indications + Drug Classes
# ─────────────────────────────────────────────────────────────────────────────

def build_page1():
    elems = []

    # ── Header banner ─────────────────────────────────────────────────────
    header_data = [[
        p("BP MEDICATIONS  |  QUICK REFERENCE CHART", title_style)
    ]]
    header_tbl = Table(header_data, colWidths=[267*mm])
    header_tbl.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), NAVY),
        ("TOPPADDING",  (0,0), (-1,-1), 10),
        ("BOTTOMPADDING",(0,0),(-1,-1), 6),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING",(0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 6),
    ]))
    elems.append(header_tbl)
    elems.append(Spacer(1, 4*mm))

    # ── SECTION 1: Compelling Indications ─────────────────────────────────
    sec1_hdr = Table([[p("COMPELLING INDICATIONS  (JNC 7 / ACC-AHA 2018)", section_style)]],
                     colWidths=[267*mm])
    sec1_hdr.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), TEAL),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 4),
    ]))
    elems.append(sec1_hdr)
    elems.append(Spacer(1, 2*mm))

    col_w = [44, 30, 30, 36, 30, 30, 30, 37]  # mm
    col_w_pts = [x*mm for x in col_w]

    ci_header = [
        p("Condition", cell_center_bold),
        p("Diuretic\n(Thiazide)", cell_center_bold),
        p("Beta-\nBlocker", cell_center_bold),
        p("ACE\nInhibitor", cell_center_bold),
        p("ARB", cell_center_bold),
        p("CCB", cell_center_bold),
        p("MRA\n(Spiro)", cell_center_bold),
        p("Notes", cell_center_bold),
    ]

    ci_data = [
        ci_header,
        [p("Heart Failure (HFrEF)", cell_bold), tick(), tick(), tick(), tick(), tick(False),
         tick(), p("Avoid verapamil/diltiazem", cell_body)],
        [p("Post-MI", cell_bold), tick(False), tick(), tick(), tick(False), tick(False),
         tick(), p("Beta-blocker within 24h", cell_body)],
        [p("High CAD Risk / Angina", cell_bold), tick(), tick(), tick(), tick(False), tick(),
         tick(False), p("CCB: prefer amlodipine", cell_body)],
        [p("Diabetes Mellitus", cell_bold), tick(), tick(), tick(), tick(), tick(),
         tick(False), p("ACEi/ARB renoprotective", cell_body)],
        [p("CKD / Proteinuria", cell_bold), tick(False), tick(False), tick(), tick(),
         tick(False), tick(False), p("ACEi or ARB first-line", cell_body)],
        [p("Stroke Prevention\n(Recurrent)", cell_bold), tick(), tick(False), tick(),
         tick(False), tick(False), tick(False), p("Thiazide + ACEi combo", cell_body)],
        [p("Atrial Fibrillation\n(Rate control)", cell_bold), tick(False), tick(), tick(False),
         tick(False), p("✔ non-DHP\n(diltiazem)", cell_center), tick(False),
         p("Avoid DHP CCBs alone", cell_body)],
        [p("Pregnancy", cell_bold), tick(False), p("✔ Labetalol\nonly", cell_center),
         tick(False), tick(False), p("✔ Nifedipine\n(long-acting)", cell_center),
         tick(False), p("Methyldopa also safe", cell_body)],
        [p("BPH", cell_bold), tick(False), tick(False), tick(False), tick(False), tick(False),
         tick(False), p("Alpha-blocker (doxazosin)", cell_body)],
        [p("Phaeochromocytoma", cell_bold), tick(False), p("✔ After\nalpha-block", cell_center),
         tick(False), tick(False), tick(False), tick(False),
         p("Alpha-blocker (phentolamine) FIRST", cell_body)],
    ]

    ci_tbl = Table(ci_data, colWidths=col_w_pts, repeatRows=1)
    ci_style = [
        # Header row
        ("BACKGROUND",   (0,0), (-1,0), NAVY),
        ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,0), 8),
        ("ALIGN",        (0,0), (-1,0), "CENTER"),
        ("VALIGN",       (0,0), (-1,-1),"MIDDLE"),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("LEFTPADDING",  (0,0), (-1,-1), 4),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("GRID",         (0,0), (-1,-1), 0.4, GREY2),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, GREY1]),
        # Condition column highlight
        ("BACKGROUND",   (0,1), (0,-1), LTBLUE),
        ("FONTNAME",     (0,1), (0,-1), "Helvetica-Bold"),
    ]
    ci_tbl.setStyle(TableStyle(ci_style))
    elems.append(ci_tbl)
    elems.append(Spacer(1, 4*mm))

    # ── SECTION 2: Drug Class Summary ─────────────────────────────────────
    sec2_hdr = Table([[p("DRUG CLASS SUMMARY  –  Mechanisms, Side Effects & Key Indications", section_style)]],
                     colWidths=[267*mm])
    sec2_hdr.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), colors.HexColor("#1e5e3e")),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 4),
    ]))
    elems.append(sec2_hdr)
    elems.append(Spacer(1, 2*mm))

    dc_col_w = [45, 38, 55, 55, 74]  # mm
    dc_col_w_pts = [x*mm for x in dc_col_w]

    dc_header = [
        p("Drug Class", cell_center_bold),
        p("Examples", cell_center_bold),
        p("Mechanism", cell_center_bold),
        p("Side Effects", cell_center_bold),
        p("Key Indications / Notes", cell_center_bold),
    ]

    dc_rows = [
        ["Thiazide/Thiazide-like\nDiuretics",
         "HCTZ, Chlorthalidone\nIndapamide",
         "Inhibit Na-Cl cotransporter\n(distal convoluted tubule)",
         "Hypokalemia, hyponatremia,\nhyperuricemia, hyperglycemia,\ndyslipidemia",
         "First-line uncomplicated HTN;\nheart failure; CAD risk;\nstroke prevention.\nChlorothalidone preferred over HCTZ"],
        ["Loop Diuretics",
         "Furosemide\nBumetanide",
         "Inhibit Na-K-2Cl cotransporter\n(thick ascending limb)",
         "Hypokalemia, ototoxicity,\ndehydration",
         "HTN + volume overload;\nheart failure;\nCKD with GFR <30 (thiazides lose efficacy)"],
        ["ACE Inhibitors",
         "Ramipril, Lisinopril\nEnalapril, Perindopril",
         "Block Ang I → Ang II conversion\n(bradykinin accumulation)",
         "Dry cough (10-15%),\nhyperkalemia, ↑creatinine,\nangioedema (rare)",
         "Heart failure, post-MI, CKD with\nproteinuria, diabetes, stroke.\nAVOID: pregnancy, bilateral RAS"],
        ["Angiotensin Receptor\nBlockers (ARBs)",
         "Losartan, Valsartan\nTelmisartan, Irbesartan",
         "Block Ang II at AT1 receptor\n(no bradykinin accumulation)",
         "Similar to ACEi;\nNO cough; rare angioedema",
         "Same as ACEi — preferred when\nACEi cough intolerable.\nAVOID: pregnancy, bilateral RAS"],
        ["Dihydropyridine\nCCBs (DHP)",
         "Amlodipine\nNifedipine (SR)\nFelodipine",
         "Block L-type Ca²⁺ channels\n→ vasodilation",
         "Peripheral edema, flushing,\ngingival hyperplasia",
         "Uncomplicated HTN, elderly,\nisolated systolic HTN, angina,\nCKD, black patients, diabetes"],
        ["Non-DHP CCBs",
         "Diltiazem\nVerapamil",
         "Block L-type Ca²⁺ channels\n+ AV nodal depression",
         "Bradycardia, AV block;\nverapamil: constipation",
         "HTN + angina + AF (rate control).\nAVOID: HFrEF, AV block,\nwith beta-blockers"],
        ["Beta-Blockers",
         "Metoprolol, Atenolol\nCarvedilol, Bisoprolol\nLabetalol (IV/oral)",
         "Block β1 (and β2 if non-selective)\nadrenergic receptors",
         "Fatigue, bradycardia,\nbronchospasm, masks hypoglycemia,\nlipid changes",
         "HFrEF, post-MI, angina, AF rate\ncontrol, pregnancy (labetalol).\nAVOID: asthma, severe bradycardia"],
        ["MRA / K-sparing",
         "Spironolactone\nEplerenone",
         "Block aldosterone receptor\n→ Na excretion, K retention",
         "Hyperkalemia, gynecomastia\n(spironolactone), menstrual changes",
         "Resistant HTN (4th-line add-on);\nHFrEF, post-MI with HF;\nprimary hyperaldosteronism"],
        ["Alpha-1 Blockers",
         "Doxazosin\nPrazosin\nPhentolamine (IV)",
         "Block α1 receptors\n→ vasodilation",
         "First-dose orthostatic\nhypotension, reflex tachycardia",
         "HTN + BPH; phaeochromocytoma\n(phentolamine FIRST before β-blocker).\nNot first-line alone"],
        ["Central α2-Agonists",
         "Methyldopa\nClonidine",
         "Stimulate α2 receptors in CNS\n→ reduce sympathetic outflow",
         "Sedation, dry mouth;\nrebound HTN on withdrawal\n(clonidine)",
         "Methyldopa: drug of choice in\npregnancy. Clonidine: resistant HTN.\nNot 1st-line otherwise"],
    ]

    dc_data = [dc_header] + [[p(r[0], cell_bold)] + [p(x, cell_body) for x in r[1:]] for r in dc_rows]
    row_colors_dc = [LTBLUE, LTTEAL, LTBLUE, LTTEAL, LTBLUE, LTTEAL,
                     LTBLUE, LTTEAL, LTBLUE, LTTEAL]

    dc_tbl = Table(dc_data, colWidths=dc_col_w_pts, repeatRows=1)
    dc_style = [
        ("BACKGROUND",   (0,0), (-1,0), colors.HexColor("#1e5e3e")),
        ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,0), 8),
        ("ALIGN",        (0,0), (-1,0), "CENTER"),
        ("VALIGN",       (0,0), (-1,-1),"MIDDLE"),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("LEFTPADDING",  (0,0), (-1,-1), 4),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("GRID",         (0,0), (-1,-1), 0.4, GREY2),
        ("FONTNAME",     (0,1), (0,-1), "Helvetica-Bold"),
    ]
    for i, bg in enumerate(row_colors_dc, start=1):
        dc_style.append(("BACKGROUND", (0,i), (-1,i), bg))
    dc_tbl.setStyle(TableStyle(dc_style))
    elems.append(dc_tbl)
    elems.append(Spacer(1, 4*mm))

    return elems

# ─────────────────────────────────────────────────────────────────────────────
# PAGE 2  –  Special Situations + Hypertensive Emergency + Avoid table
# ─────────────────────────────────────────────────────────────────────────────

def build_page2():
    elems = []
    elems.append(PageBreak())

    # Header (repeat)
    header_data = [[p("BP MEDICATIONS  |  QUICK REFERENCE CHART  (Page 2)", title_style)]]
    header_tbl = Table(header_data, colWidths=[267*mm])
    header_tbl.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), NAVY),
        ("TOPPADDING",  (0,0), (-1,-1), 8),
        ("BOTTOMPADDING",(0,0),(-1,-1), 6),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 6),
    ]))
    elems.append(header_tbl)
    elems.append(Spacer(1, 4*mm))

    # ── Algorithm box ─────────────────────────────────────────────────────
    algo_hdr = Table([[p("STEP-UP TREATMENT ALGORITHM  (Uncomplicated HTN)", section_style)]],
                     colWidths=[267*mm])
    algo_hdr.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), AMBER),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 4),
    ]))
    elems.append(algo_hdr)
    elems.append(Spacer(1, 2*mm))

    algo_col_w = [25, 55, 110, 77]
    algo_data = [
        [p("Step", cell_center_bold), p("Regimen", cell_center_bold),
         p("Detail", cell_center_bold), p("When to use", cell_center_bold)],
        [p("1", cell_center_bold),
         p("Dual combination", cell_bold),
         p("ACEi or ARB  +  CCB  or  Thiazide diuretic", cell_body),
         p("All patients BP ≥140/90 mmHg\n(monotherapy if BP just >140/90 or very elderly)", cell_body)],
        [p("2", cell_center_bold),
         p("Triple combination", cell_bold),
         p("ACEi or ARB  +  CCB  +  Thiazide diuretic", cell_body),
         p("Dual combo insufficient to reach target", cell_body)],
        [p("3", cell_center_bold),
         p("Resistant HTN", cell_bold),
         p("Triple combo  +  Spironolactone 25-50 mg OD\n(or alpha-blocker or beta-blocker)", cell_body),
         p("BP still uncontrolled on 3 drugs;\nrefer to specialist", cell_body)],
        [p("★", cell_center_bold),
         p("Beta-blockers", cell_bold),
         p("Add at ANY step if specific indication present", cell_body),
         p("HFrEF, angina, AF, post-MI,\npregnancy (labetalol)", cell_body)],
    ]
    algo_tbl = Table(algo_data, colWidths=[x*mm for x in algo_col_w], repeatRows=1)
    algo_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,0), colors.HexColor("#9b5e04")),
        ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,0), 8),
        ("ALIGN",        (0,0), (-1,0), "CENTER"),
        ("VALIGN",       (0,0), (-1,-1),"MIDDLE"),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("LEFTPADDING",  (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("GRID",         (0,0), (-1,-1), 0.4, GREY2),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[LTAMBER, WHITE, LTAMBER, WHITE]),
        ("FONTNAME",     (0,1), (1,-1), "Helvetica-Bold"),
        ("BACKGROUND",   (0,4), (-1,4), colors.HexColor("#fff0d0")),
    ]))
    elems.append(algo_tbl)
    elems.append(Spacer(1, 4*mm))

    # ── Two-column section: Special Situations | Hypertensive Emergency ──
    # Special situations table
    sp_hdr_data = [[p("SPECIAL CLINICAL SITUATIONS", section_style)]]
    sp_hdr_tbl = Table(sp_hdr_data, colWidths=[130*mm])
    sp_hdr_tbl.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), colors.HexColor("#5b2d8e")),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 4),
    ]))

    sp_rows = [
        [p("Situation", cell_center_bold), p("Preferred Drug(s)", cell_center_bold)],
        [p("Pregnancy", cell_bold), p("Methyldopa  |  Labetalol  |  Nifedipine SR", cell_body)],
        [p("Elderly / Isolated systolic HTN", cell_bold), p("Amlodipine  |  Chlorthalidone", cell_body)],
        [p("Black / African-descent patients", cell_bold), p("CCB or Thiazide (RAS blockers less\neffective as monotherapy)", cell_body)],
        [p("CKD + Proteinuria", cell_bold), p("ACEi or ARB (renoprotective)", cell_body)],
        [p("Metabolic syndrome / Pre-diabetes", cell_bold), p("ACEi or ARB or CCB\n(avoid thiazide+BB combo)", cell_body)],
        [p("Post-renal transplant", cell_bold), p("CCB (amlodipine) — first-line", cell_body)],
        [p("Bilateral renal artery stenosis", cell_bold), p("CCB or diuretic\n(AVOID ACEi / ARBs)", cell_body)],
        [p("Aortic aneurysm / Marfan syndrome", cell_bold), p("Beta-blocker (atenolol/metoprolol)\nor ARB (losartan)", cell_body)],
        [p("Migraines", cell_bold), p("Beta-blocker (propranolol, metoprolol)\nor verapamil", cell_body)],
        [p("Raynaud's phenomenon", cell_bold), p("Amlodipine (vasodilatory CCB)\nAVOID non-selective beta-blockers", cell_body)],
        [p("Hyperthyroidism / Thyroid storm", cell_bold), p("Beta-blocker (propranolol)", cell_body)],
    ]
    sp_tbl = Table(sp_rows, colWidths=[50*mm, 78*mm])
    sp_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,0), colors.HexColor("#5b2d8e")),
        ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,0), 7.5),
        ("ALIGN",        (0,0), (-1,0), "CENTER"),
        ("VALIGN",       (0,0), (-1,-1),"MIDDLE"),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("LEFTPADDING",  (0,0), (-1,-1), 4),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("GRID",         (0,0), (-1,-1), 0.4, GREY2),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.HexColor("#f3eeff"), WHITE]),
        ("FONTNAME",     (0,1), (0,-1), "Helvetica-Bold"),
    ]))

    # Hypertensive emergency table
    em_hdr_data = [[p("HYPERTENSIVE EMERGENCY  –  IV Agents", section_style)]]
    em_hdr_tbl = Table(em_hdr_data, colWidths=[131*mm])
    em_hdr_tbl.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), RED),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 4),
    ]))

    em_rows = [
        [p("Emergency Type", cell_center_bold), p("Preferred Agent(s)", cell_center_bold), p("Avoid", cell_center_bold)],
        [p("Hypertensive\nEncephalopathy", cell_bold), p("Nicardipine, Labetalol,\nClevidipine", cell_body),
         p("Nitroprusside", cell_body)],
        [p("Acute Ischemic\nStroke", cell_bold), p("Nicardipine, Labetalol,\nClevidipine", cell_body),
         p("Nitroprusside, Nimodipine", cell_body)],
        [p("Haemorrhagic\nStroke", cell_bold), p("Nicardipine, Labetalol", cell_body),
         p("Nitroprusside", cell_body)],
        [p("Aortic Dissection", cell_bold), p("Esmolol (IV) + Nitroprusside\nor Labetalol", cell_body),
         p("Hydralazine\n(reflex tachycardia)", cell_body)],
        [p("Acute Pulmonary\nOedema", cell_bold), p("IV Nitroglycerine +\nFurosemide + Nicardipine", cell_body),
         p("Beta-blockers", cell_body)],
        [p("Acute MI + HTN", cell_bold), p("Beta-blocker +\nNitroglycerine + ACEi", cell_body),
         p("Hydralazine", cell_body)],
        [p("Eclampsia /\nSevere pre-eclampsia", cell_bold), p("IV Hydralazine, IV Labetalol,\nIV MgSO4 (seizures)", cell_body),
         p("ACEi, ARBs", cell_body)],
        [p("Phaeochromocytoma\nCrisis", cell_bold), p("Phentolamine (alpha-blocker)\nTHEN beta-blocker", cell_body),
         p("Beta-blocker FIRST\n(paradoxical HTN!)", cell_body)],
        [p("Renal Crisis\n(Scleroderma)", cell_bold), p("ACE Inhibitor\n(captopril)", cell_body),
         p("ARB (less evidence)", cell_body)],
    ]
    em_tbl = Table(em_rows, colWidths=[38*mm, 54*mm, 39*mm])
    em_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,0), RED),
        ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,0), 7.5),
        ("ALIGN",        (0,0), (-1,0), "CENTER"),
        ("VALIGN",       (0,0), (-1,-1),"MIDDLE"),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("LEFTPADDING",  (0,0), (-1,-1), 4),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("GRID",         (0,0), (-1,-1), 0.4, GREY2),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[LTRED, WHITE]),
        ("FONTNAME",     (0,1), (0,-1), "Helvetica-Bold"),
    ]))

    # Side-by-side layout
    two_col_header = Table(
        [[sp_hdr_tbl, Spacer(6*mm, 1), em_hdr_tbl]],
        colWidths=[130*mm, 6*mm, 131*mm]
    )
    two_col_header.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "TOP"),
        ("TOPPADDING", (0,0), (-1,-1), 0),
        ("BOTTOMPADDING", (0,0), (-1,-1), 0),
        ("LEFTPADDING", (0,0), (-1,-1), 0),
        ("RIGHTPADDING", (0,0), (-1,-1), 0),
    ]))
    elems.append(two_col_header)
    elems.append(Spacer(1, 2*mm))

    two_col = Table(
        [[sp_tbl, Spacer(6*mm, 1), em_tbl]],
        colWidths=[130*mm, 6*mm, 131*mm]
    )
    two_col.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "TOP"),
        ("TOPPADDING", (0,0), (-1,-1), 0),
        ("BOTTOMPADDING", (0,0), (-1,-1), 0),
        ("LEFTPADDING", (0,0), (-1,-1), 0),
        ("RIGHTPADDING", (0,0), (-1,-1), 0),
    ]))
    elems.append(two_col)
    elems.append(Spacer(1, 4*mm))

    # ── AVOID table ───────────────────────────────────────────────────────
    av_hdr = Table([[p("DRUGS TO AVOID IN SPECIFIC CONDITIONS", section_style)]],
                   colWidths=[267*mm])
    av_hdr.setStyle(TableStyle([
        ("BACKGROUND",  (0,0), (-1,-1), RED),
        ("TOPPADDING",  (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("ROUNDEDCORNERS",(0,0),(-1,-1), 4),
    ]))
    elems.append(av_hdr)
    elems.append(Spacer(1, 2*mm))

    av_col_w = [65, 202]
    av_rows = [
        [p("Condition", cell_center_bold), p("Drug(s) to Avoid  (with reason)", cell_center_bold)],
        [p("Pregnancy", cell_bold), p("ACEi, ARBs, Direct Renin Inhibitors (aliskiren)  –  all TERATOGENIC", cell_body)],
        [p("Bilateral renal artery stenosis", cell_bold), p("ACEi / ARBs  –  can precipitate acute renal failure", cell_body)],
        [p("Hyperkalaemia", cell_bold), p("ACEi, ARBs, MRA (spironolactone), K-sparing diuretics  –  worsen hyperkalaemia", cell_body)],
        [p("Asthma / COPD", cell_bold), p("Non-selective beta-blockers (propranolol)  –  bronchospasm; use cardioselective (bisoprolol) with caution only if essential", cell_body)],
        [p("AV block (2nd / 3rd degree)", cell_bold), p("Verapamil, Diltiazem, Beta-blockers  –  worsen AV conduction block; risk of asystole", cell_body)],
        [p("Gout", cell_bold), p("Thiazide diuretics  –  raise serum uric acid; worsen gout attacks", cell_body)],
        [p("Decompensated / acute HF", cell_bold), p("Verapamil, Non-DHP CCBs  –  negative inotropy worsens acute failure", cell_body)],
        [p("Phaeochromocytoma", cell_bold), p("Beta-blockers FIRST without alpha-blockade  –  causes paradoxical severe HTN (unopposed alpha stimulation)", cell_body)],
        [p("Metabolic syndrome / Diabetes risk", cell_bold), p("Thiazide + Beta-blocker combination  –  synergistically worsen insulin resistance and glucose tolerance", cell_body)],
    ]
    av_tbl = Table(av_rows, colWidths=[x*mm for x in av_col_w])
    av_tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,0), RED),
        ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,0), 8),
        ("ALIGN",        (0,0), (-1,0), "CENTER"),
        ("VALIGN",       (0,0), (-1,-1),"MIDDLE"),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("LEFTPADDING",  (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
        ("GRID",         (0,0), (-1,-1), 0.4, GREY2),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[LTRED, WHITE]),
        ("FONTNAME",     (0,1), (0,-1), "Helvetica-Bold"),
    ]))
    elems.append(av_tbl)
    elems.append(Spacer(1, 4*mm))

    # ── Footer note ───────────────────────────────────────────────────────
    elems.append(HRFlowable(width="100%", thickness=0.5, color=GREY2))
    elems.append(Spacer(1, 2*mm))
    elems.append(p(
        "Sources: JNC 7 Guidelines | ACC/AHA 2018 | Comprehensive Clinical Nephrology 7e | "
        "NKF Primer 8e | Textbook of Family Medicine 9e | Goldman-Cecil Medicine | Lippincott Pharmacology  |  "
        "For clinical decisions, always verify against current local guidelines.",
        small_note
    ))
    return elems

# ── BUILD PDF ─────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=landscape(A4),
    leftMargin=12*mm, rightMargin=12*mm,
    topMargin=10*mm, bottomMargin=10*mm
)
story = build_page1() + build_page2()
doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /home/daytona/workspace/bp-chart && python3 generate_bp_chart.py 2>&1

Running Command

ls -lh /home/daytona/workspace/bp-chart/BP_Medications_QuickRef.pdf

Your printable PDF is ready!

BP Medications QuickRef

PDF Document · PDF


What's inside (2 pages, landscape A4 - print-ready):
Page 1:
  • Compelling Indications table (JNC 7 / ACC-AHA 2018) - checkmark grid across all 11 conditions vs 6 drug classes
  • Full Drug Class Summary - mechanism, examples, side effects, and key indications for all 10 drug classes (thiazides through central agonists)
Page 2:
  • Step-up Treatment Algorithm (dual → triple → resistant HTN)
  • Special Clinical Situations (pregnancy, elderly, black patients, CKD, Raynaud's, etc.)
  • Hypertensive Emergency IV agents by emergency type (with "Avoid" column)
  • Drugs to Avoid table with reasons
Print settings: A4 landscape, scale to fit page. Works best in colour but readable in grayscale too.

Unable to download

Running Command

ls -lh /home/daytona/workspace/bp-chart/ && file /home/daytona/workspace/bp-chart/BP_Medications_QuickRef.pdf

Running Command

cp /home/daytona/workspace/bp-chart/BP_Medications_QuickRef.pdf /home/daytona/workspace/BP_Medications_QuickRef.pdf && ls -lh /home/daytona/workspace/BP_Medications_QuickRef.pdf

Running Command

python3 -c " import base64 with open('/home/daytona/workspace/BP_Medications_QuickRef.pdf','rb') as f: data = base64.b64encode(f.read()).decode() html = f'''<!DOCTYPE html> <html> <head><title>BP Medications Quick Reference</title></head> <body style=\"font-family:Arial;text-align:center;padding:40px\"> <h2>BP Medications Quick Reference Chart</h2> <p>Click the button below to download your PDF:</p> <a href=\"data:application/pdf;base64,{data}\" download=\"BP_Medications_QuickRef.pdf\"> <button style=\"padding:16px 32px;font-size:18px;background:#1a3a5c;color:white;border:none;border-radius:8px;cursor:pointer\"> Download PDF </button> </a> <p style=\"margin-top:20px;color:#666;font-size:13px\">Print at A4 landscape for best results</p> </body> </html>''' with open('/home/daytona/workspace/bp-chart/download.html','w') as f: f.write(html) print('HTML created, size:', len(html), 'chars') "

Try these two options:
Option 1 - Direct PDF link (try right-click → Save As):

BP Medications QuickRef

PDF Document · PDF

Option 2 - HTML download page (open this, then click the Download button inside):

download

HTML File · HTML


If neither works, here's a workaround - I can generate the full chart as a nicely formatted HTML page you can open directly in your browser and use your browser's File → Print → Save as PDF to get a print-ready version. Just let me know and I'll build that instead.
attachment
attachment

Still showing this

Writing File

~/bp-chart/BP_Medications_Chart.html

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BP Medications Quick Reference</title>
<style>
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: Arial, sans-serif; font-size: 12px; background: #f5f7fa; color: #1a1a1a; }

  .page { max-width: 1100px; margin: 0 auto; padding: 16px; }

  .header {
    background: linear-gradient(135deg, #1a3a5c, #2a6090);
    color: white; text-align: center;
    padding: 14px 10px 10px; border-radius: 8px; margin-bottom: 12px;
  }
  .header h1 { font-size: 22px; letter-spacing: 1px; margin-bottom: 4px; }
  .header p { font-size: 11px; color: #b0d0e8; }

  .section-title {
    color: white; font-size: 13px; font-weight: bold;
    padding: 7px 12px; border-radius: 6px; margin-bottom: 6px;
    text-align: center; letter-spacing: 0.5px;
  }
  .teal   { background: #1a7a8a; }
  .green  { background: #1e5e3e; }
  .amber  { background: #d4830a; }
  .purple { background: #5b2d8e; }
  .red    { background: #c0392b; }
  .navy   { background: #1a3a5c; }

  table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 11.5px; }
  th { padding: 7px 8px; text-align: center; font-size: 12px; }
  td { padding: 6px 8px; vertical-align: middle; border: 1px solid #dce0e5; }
  tr:nth-child(even) td { background: #f2f4f6; }
  tr:nth-child(odd) td { background: #ffffff; }
  .td-label { font-weight: bold; }

  /* Compelling indications */
  #ci th { background: #1a3a5c; color: white; border: 1px solid #2a5c8a; }
  #ci .td-label { background: #dceef5 !important; }
  #ci td { text-align: center; }
  #ci td:first-child { text-align: left; }
  .tick { color: #1e7d44; font-size: 15px; font-weight: bold; }
  .dash { color: #aaa; }

  /* Drug class table */
  #dc th { background: #1e5e3e; color: white; border: 1px solid #2a8a5e; }
  #dc .td-label { background: #dceef5 !important; }
  #dc tr:nth-child(even) td { background: #d4f0f0; }
  #dc tr:nth-child(odd) td { background: #ffffff; }

  /* Algorithm */
  #algo th { background: #9b5e04; color: white; border: 1px solid #d4830a; }
  #algo tr:nth-child(even) td { background: #fdf3dc; }
  #algo tr:nth-child(odd) td { background: #ffffff; }
  #algo .td-label { font-weight: bold; }
  .algo-star td { background: #fff0d0 !important; }

  /* Two-col layout */
  .two-col { display: flex; gap: 14px; margin-bottom: 14px; }
  .two-col > div { flex: 1; }

  /* Special situations */
  #sp th { background: #5b2d8e; color: white; border: 1px solid #7b4dae; }
  #sp .td-label { background: #f3eeff !important; }
  #sp tr:nth-child(even) td { background: #f3eeff; }
  #sp tr:nth-child(odd) td { background: #ffffff; }

  /* Emergency */
  #em th { background: #c0392b; color: white; border: 1px solid #e05040; }
  #em .td-label { background: #fde8e6 !important; }
  #em tr:nth-child(even) td { background: #fde8e6; }
  #em tr:nth-child(odd) td { background: #ffffff; }

  /* Avoid */
  #av th { background: #c0392b; color: white; border: 1px solid #e05040; }
  #av .td-label { background: #fde8e6 !important; }
  #av tr:nth-child(even) td { background: #fde8e6; }
  #av tr:nth-child(odd) td { background: #ffffff; }

  .page-break { border: none; border-top: 3px dashed #ccc; margin: 20px 0; }

  .footer { text-align: center; font-size: 10px; color: #777; margin-top: 8px; padding: 8px; border-top: 1px solid #dce0e5; }

  .print-btn {
    display: block; margin: 0 auto 16px; padding: 12px 30px;
    background: #1a3a5c; color: white; font-size: 15px; font-weight: bold;
    border: none; border-radius: 8px; cursor: pointer; letter-spacing: 0.5px;
  }
  .print-btn:hover { background: #2a6090; }

  @media print {
    .print-btn { display: none !important; }
    body { background: white; font-size: 10px; }
    .page { padding: 8px; max-width: 100%; }
    .header h1 { font-size: 16px; }
    .two-col { gap: 8px; }
    td, th { padding: 4px 5px; font-size: 9.5px; }
    .section-title { font-size: 11px; padding: 5px 8px; }
    @page { size: A4 landscape; margin: 8mm; }
  }
</style>
</head>
<body>
<div class="page">

  <button class="print-btn" onclick="window.print()">🖨️ Print / Save as PDF</button>

  <!-- HEADER -->
  <div class="header">
    <h1>BP MEDICATIONS — QUICK REFERENCE CHART</h1>
    <p>JNC 7 · ACC/AHA 2018 · Comprehensive Clinical Nephrology 7e · NKF Primer 8e</p>
  </div>

  <!-- SECTION 1: Compelling Indications -->
  <div class="section-title teal">COMPELLING INDICATIONS (JNC 7 / ACC-AHA 2018)</div>
  <table id="ci">
    <thead><tr>
      <th style="text-align:left">Condition</th>
      <th>Diuretic<br>(Thiazide)</th>
      <th>Beta-<br>Blocker</th>
      <th>ACE<br>Inhibitor</th>
      <th>ARB</th>
      <th>CCB</th>
      <th>MRA<br>(Spiro)</th>
      <th>Notes</th>
    </tr></thead>
    <tbody>
      <tr><td class="td-label">Heart Failure (HFrEF)</td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td>Avoid verapamil / diltiazem</td></tr>
      <tr><td class="td-label">Post-MI</td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td>Beta-blocker within 24 h</td></tr>
      <tr><td class="td-label">High CAD Risk / Angina</td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td>CCB: prefer amlodipine</td></tr>
      <tr><td class="td-label">Diabetes Mellitus</td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td>ACEi/ARB renoprotective</td></tr>
      <tr><td class="td-label">CKD / Proteinuria</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>ACEi or ARB first-line</td></tr>
      <tr><td class="td-label">Stroke Prevention (Recurrent)</td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>Thiazide + ACEi combo</td></tr>
      <tr><td class="td-label">Atrial Fibrillation (Rate control)</td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>✔ non-DHP<br>(diltiazem)</td><td><span class="dash">—</span></td><td>Avoid DHP CCBs alone</td></tr>
      <tr><td class="td-label">Pregnancy</td><td><span class="dash">—</span></td><td>✔ Labetalol only</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>✔ Nifedipine SR</td><td><span class="dash">—</span></td><td>Methyldopa also safe</td></tr>
      <tr><td class="td-label">BPH</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>Alpha-blocker (doxazosin)</td></tr>
      <tr><td class="td-label">Phaeochromocytoma</td><td><span class="dash">—</span></td><td>✔ After alpha-block</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>Phentolamine FIRST, then BB</td></tr>
    </tbody>
  </table>

  <!-- SECTION 2: Drug Classes -->
  <div class="section-title green">DRUG CLASS SUMMARY — Mechanisms, Side Effects &amp; Key Indications</div>
  <table id="dc">
    <thead><tr>
      <th style="text-align:left">Drug Class</th>
      <th>Examples</th>
      <th>Mechanism</th>
      <th>Side Effects</th>
      <th style="text-align:left">Key Indications / Notes</th>
    </tr></thead>
    <tbody>
      <tr><td class="td-label">Thiazide / Thiazide-like Diuretics</td><td>HCTZ, Chlorthalidone, Indapamide</td><td>Inhibit Na-Cl cotransporter (DCT)</td><td>Hypokalemia, hyperuricemia, hyperglycemia, dyslipidemia</td><td>First-line uncomplicated HTN; HF; CAD; stroke. Chlorthalidone preferred over HCTZ.</td></tr>
      <tr><td class="td-label">Loop Diuretics</td><td>Furosemide, Bumetanide</td><td>Inhibit Na-K-2Cl cotransporter (thick ascending limb)</td><td>Hypokalemia, ototoxicity, dehydration</td><td>HTN + volume overload; HF; CKD with GFR &lt;30 (thiazides lose efficacy)</td></tr>
      <tr><td class="td-label">ACE Inhibitors</td><td>Ramipril, Lisinopril, Enalapril, Perindopril</td><td>Block Ang I → Ang II conversion; bradykinin accumulation</td><td>Dry cough (10-15%), hyperkalemia, ↑creatinine, angioedema (rare)</td><td>HF, post-MI, CKD with proteinuria, diabetes, stroke. AVOID: pregnancy, bilateral RAS.</td></tr>
      <tr><td class="td-label">ARBs (Angiotensin Receptor Blockers)</td><td>Losartan, Valsartan, Telmisartan, Irbesartan</td><td>Block Ang II at AT1 receptor (no bradykinin)</td><td>Similar to ACEi — NO cough; rare angioedema</td><td>Same as ACEi. Preferred when ACEi cough intolerable. AVOID: pregnancy, bilateral RAS.</td></tr>
      <tr><td class="td-label">Dihydropyridine CCBs (DHP)</td><td>Amlodipine, Nifedipine SR, Felodipine</td><td>Block L-type Ca²⁺ channels → vasodilation</td><td>Peripheral edema, flushing, gingival hyperplasia</td><td>Uncomplicated HTN, elderly, isolated systolic HTN, angina, CKD, black patients, diabetes</td></tr>
      <tr><td class="td-label">Non-DHP CCBs</td><td>Diltiazem, Verapamil</td><td>Block L-type Ca²⁺ channels + AV nodal depression</td><td>Bradycardia, AV block; verapamil: constipation</td><td>HTN + angina + AF rate control. AVOID: HFrEF, AV block, combined with beta-blockers.</td></tr>
      <tr><td class="td-label">Beta-Blockers</td><td>Metoprolol, Atenolol, Carvedilol, Bisoprolol, Labetalol (IV/oral)</td><td>Block β1 (and β2 if non-selective) adrenergic receptors</td><td>Fatigue, bradycardia, bronchospasm, masks hypoglycemia</td><td>HFrEF, post-MI, angina, AF rate control, pregnancy (labetalol). AVOID: asthma, severe bradycardia.</td></tr>
      <tr><td class="td-label">MRA / K-sparing (Spironolactone)</td><td>Spironolactone, Eplerenone</td><td>Block aldosterone receptor → Na excretion, K retention</td><td>Hyperkalemia, gynecomastia (spironolactone), menstrual changes</td><td>Resistant HTN (4th-line add-on); HFrEF; post-MI with HF; primary hyperaldosteronism</td></tr>
      <tr><td class="td-label">Alpha-1 Blockers</td><td>Doxazosin, Prazosin, Phentolamine (IV)</td><td>Block α1 receptors → vasodilation</td><td>First-dose orthostatic hypotension, reflex tachycardia</td><td>HTN + BPH; phaeochromocytoma (phentolamine FIRST before β-blocker). Not first-line alone.</td></tr>
      <tr><td class="td-label">Central α2-Agonists</td><td>Methyldopa, Clonidine</td><td>Stimulate α2 in CNS → reduce sympathetic outflow</td><td>Sedation, dry mouth; rebound HTN on withdrawal (clonidine)</td><td>Methyldopa: drug of choice in pregnancy. Clonidine: resistant HTN. Not 1st-line otherwise.</td></tr>
    </tbody>
  </table>

  <hr class="page-break">

  <!-- SECTION 3: Algorithm -->
  <div class="section-title amber">STEP-UP TREATMENT ALGORITHM (Uncomplicated HTN)</div>
  <table id="algo">
    <thead><tr>
      <th>Step</th><th>Regimen</th><th>Detail</th><th>When to Use</th>
    </tr></thead>
    <tbody>
      <tr><td style="text-align:center;font-weight:bold">1</td><td class="td-label">Dual combination</td><td><strong>ACEi or ARB + CCB</strong> or <strong>Thiazide diuretic</strong></td><td>All patients BP ≥140/90 mmHg (monotherapy if BP just &gt;140/90 or very elderly/frail)</td></tr>
      <tr><td style="text-align:center;font-weight:bold">2</td><td class="td-label">Triple combination</td><td><strong>ACEi or ARB + CCB + Thiazide diuretic</strong></td><td>Dual combo insufficient to reach BP target</td></tr>
      <tr><td style="text-align:center;font-weight:bold">3</td><td class="td-label">Resistant HTN</td><td>Triple combo + <strong>Spironolactone 25–50 mg OD</strong> (or alpha-blocker or beta-blocker)</td><td>BP uncontrolled on 3 drugs; refer to specialist</td></tr>
      <tr class="algo-star"><td style="text-align:center;font-weight:bold">★</td><td class="td-label">Beta-blockers</td><td>Add at <strong>ANY step</strong> when specific indication present</td><td>HFrEF, angina, AF, post-MI, pregnancy (labetalol)</td></tr>
    </tbody>
  </table>

  <!-- SECTION 4: Two-col -->
  <div class="two-col">
    <div>
      <div class="section-title purple">SPECIAL CLINICAL SITUATIONS</div>
      <table id="sp">
        <thead><tr><th style="text-align:left">Situation</th><th style="text-align:left">Preferred Drug(s)</th></tr></thead>
        <tbody>
          <tr><td class="td-label">Pregnancy</td><td>Methyldopa | Labetalol | Nifedipine SR</td></tr>
          <tr><td class="td-label">Elderly / Isolated systolic HTN</td><td>Amlodipine | Chlorthalidone</td></tr>
          <tr><td class="td-label">Black / African-descent patients</td><td>CCB or Thiazide (RAS blockers less effective as monotherapy)</td></tr>
          <tr><td class="td-label">CKD + Proteinuria</td><td>ACEi or ARB (renoprotective)</td></tr>
          <tr><td class="td-label">Metabolic syndrome / Pre-diabetes</td><td>ACEi or ARB or CCB (avoid thiazide+BB combo)</td></tr>
          <tr><td class="td-label">Post-renal transplant</td><td>CCB (amlodipine) — first-line</td></tr>
          <tr><td class="td-label">Bilateral renal artery stenosis</td><td>CCB or diuretic (AVOID ACEi / ARBs)</td></tr>
          <tr><td class="td-label">Aortic aneurysm / Marfan</td><td>Beta-blocker (atenolol) or ARB (losartan)</td></tr>
          <tr><td class="td-label">Migraines</td><td>Beta-blocker (propranolol, metoprolol) or verapamil</td></tr>
          <tr><td class="td-label">Raynaud's phenomenon</td><td>Amlodipine. AVOID non-selective beta-blockers.</td></tr>
          <tr><td class="td-label">Hyperthyroidism / Thyroid storm</td><td>Beta-blocker (propranolol)</td></tr>
        </tbody>
      </table>
    </div>
    <div>
      <div class="section-title red">HYPERTENSIVE EMERGENCY — IV Agents</div>
      <table id="em">
        <thead><tr><th style="text-align:left">Emergency Type</th><th>Preferred Agent(s)</th><th>Avoid</th></tr></thead>
        <tbody>
          <tr><td class="td-label">HTN Encephalopathy</td><td>Nicardipine, Labetalol, Clevidipine</td><td>Nitroprusside</td></tr>
          <tr><td class="td-label">Acute Ischaemic Stroke</td><td>Nicardipine, Labetalol, Clevidipine</td><td>Nitroprusside, Nimodipine</td></tr>
          <tr><td class="td-label">Haemorrhagic Stroke</td><td>Nicardipine, Labetalol</td><td>Nitroprusside</td></tr>
          <tr><td class="td-label">Aortic Dissection</td><td>Esmolol IV + Nitroprusside or Labetalol</td><td>Hydralazine (reflex tachycardia)</td></tr>
          <tr><td class="td-label">Acute Pulmonary Oedema</td><td>IV Nitroglycerine + Furosemide + Nicardipine</td><td>Beta-blockers</td></tr>
          <tr><td class="td-label">Acute MI + HTN</td><td>Beta-blocker + Nitroglycerine + ACEi</td><td>Hydralazine</td></tr>
          <tr><td class="td-label">Eclampsia / Severe Pre-eclampsia</td><td>IV Hydralazine, IV Labetalol, IV MgSO4 (seizures)</td><td>ACEi, ARBs</td></tr>
          <tr><td class="td-label">Phaeochromocytoma Crisis</td><td>Phentolamine (alpha-blocker) THEN beta-blocker</td><td>Beta-blocker FIRST (paradoxical HTN!)</td></tr>
          <tr><td class="td-label">Scleroderma Renal Crisis</td><td>ACE Inhibitor (captopril)</td><td>ARB (less evidence)</td></tr>
        </tbody>
      </table>
      <p style="font-size:10.5px;color:#c0392b;font-weight:bold;margin-top:4px;">⚠ Reduce BP by max 25% in first hour. Never drop too fast — risk of ischaemia.</p>
    </div>
  </div>

  <!-- SECTION 5: Avoid -->
  <div class="section-title red">DRUGS TO AVOID IN SPECIFIC CONDITIONS</div>
  <table id="av">
    <thead><tr>
      <th style="text-align:left">Condition</th>
      <th style="text-align:left">Drug(s) to Avoid &amp; Reason</th>
    </tr></thead>
    <tbody>
      <tr><td class="td-label">Pregnancy</td><td>ACEi, ARBs, Direct Renin Inhibitors (aliskiren) — all TERATOGENIC</td></tr>
      <tr><td class="td-label">Bilateral renal artery stenosis</td><td>ACEi / ARBs — can precipitate acute renal failure</td></tr>
      <tr><td class="td-label">Hyperkalaemia</td><td>ACEi, ARBs, MRA (spironolactone), K-sparing diuretics — worsen hyperkalaemia</td></tr>
      <tr><td class="td-label">Asthma / COPD</td><td>Non-selective beta-blockers (propranolol) — bronchospasm. Use cardioselective (bisoprolol) with caution if essential.</td></tr>
      <tr><td class="td-label">AV block (2nd / 3rd degree)</td><td>Verapamil, Diltiazem, Beta-blockers — worsen conduction block; risk of asystole</td></tr>
      <tr><td class="td-label">Gout</td><td>Thiazide diuretics — raise serum uric acid; worsen gout attacks</td></tr>
      <tr><td class="td-label">Decompensated / acute HF</td><td>Verapamil, Non-DHP CCBs — negative inotropy worsens acute failure</td></tr>
      <tr><td class="td-label">Phaeochromocytoma</td><td>Beta-blockers FIRST (without alpha-blockade) — paradoxical severe HTN from unopposed alpha stimulation</td></tr>
      <tr><td class="td-label">Metabolic syndrome / Diabetes risk</td><td>Thiazide + Beta-blocker combination — synergistically worsen insulin resistance and glucose tolerance</td></tr>
    </tbody>
  </table>

  <div class="footer">
    Sources: JNC 7 Guidelines · ACC/AHA 2018 · Comprehensive Clinical Nephrology 7e · NKF Primer 8e · Textbook of Family Medicine 9e · Goldman-Cecil Medicine · Lippincott Pharmacology<br>
    For clinical decisions, always verify against current local guidelines.
  </div>

  <button class="print-btn" onclick="window.print()" style="margin-top:14px">🖨️ Print / Save as PDF</button>

</div>
</body>
</html>
Running Command

python3 -c " import base64 with open('/home/daytona/workspace/bp-chart/BP_Medications_Chart.html', 'rb') as f: content = f.read() b64 = base64.b64encode(content).decode() data_uri = 'data:text/html;base64,' + b64 # Write a tiny launcher HTML with the data URI as an href launcher = '''<!DOCTYPE html> <html> <head><meta charset=\"UTF-8\"><title>BP Chart Launcher</title> <style>body{font-family:Arial;text-align:center;padding:50px;background:#f0f4f8;} .btn{display:inline-block;padding:18px 36px;background:#1a3a5c;color:white;font-size:18px;font-weight:bold;border-radius:10px;text-decoration:none;margin:10px;} p{color:#555;margin:10px 0;} </style></head> <body> <h2 style=\"color:#1a3a5c\">BP Medications Quick Reference</h2> <p>Tap the button to open the chart, then use your browser menu to print or save as PDF.</p> <a class=\"btn\" href=\"''' + data_uri + '''\" target=\"_blank\">Open Chart</a> <p style=\"font-size:12px;color:#888;margin-top:20px\">After opening: tap ⋮ menu → Print → Save as PDF</p> </body></html>''' with open('/home/daytona/workspace/bp-chart/open_chart.html', 'w') as f: f.write(launcher) print('Launcher created, size:', len(launcher), 'bytes') print('Data URI length:', len(data_uri)) "

I understand the root issue now - the sandbox file links simply don't resolve outside the platform. The most reliable solution is to copy the full chart content below so you can save it yourself. Here's what to do:

How to get your printable PDF (2 easy options):

Option A - Use an online HTML-to-PDF converter (easiest on mobile)

  1. Go to htmltomd.com or sejda.com/html-to-pdf
  2. Paste the HTML code below into the text box
  3. Download the PDF

Option B - Save as HTML and print

  1. Copy all the HTML code below
  2. Paste it into a new file called bp_chart.html on your computer
  3. Open in Chrome → Press Ctrl+P (or ⌘+P) → Save as PDF → Set paper to A4 Landscape

Here is the complete, self-contained HTML. Copy everything between the triple backticks:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BP Medications Quick Reference</title>
<style>
  *{box-sizing:border-box;margin:0;padding:0}body{font-family:Arial,sans-serif;font-size:12px;background:#f5f7fa;color:#1a1a1a}.page{max-width:1100px;margin:0 auto;padding:16px}.header{background:linear-gradient(135deg,#1a3a5c,#2a6090);color:white;text-align:center;padding:14px 10px 10px;border-radius:8px;margin-bottom:12px}.header h1{font-size:22px;letter-spacing:1px;margin-bottom:4px}.header p{font-size:11px;color:#b0d0e8}.section-title{color:white;font-size:13px;font-weight:bold;padding:7px 12px;border-radius:6px;margin-bottom:6px;text-align:center;letter-spacing:.5px}.teal{background:#1a7a8a}.green{background:#1e5e3e}.amber{background:#d4830a}.purple{background:#5b2d8e}.red{background:#c0392b}.navy{background:#1a3a5c}table{width:100%;border-collapse:collapse;margin-bottom:14px;font-size:11.5px}th{padding:7px 8px;text-align:center;font-size:12px}td{padding:6px 8px;vertical-align:middle;border:1px solid #dce0e5}tr:nth-child(even) td{background:#f2f4f6}tr:nth-child(odd) td{background:#fff}.td-label{font-weight:bold}#ci th{background:#1a3a5c;color:white;border:1px solid #2a5c8a}#ci .td-label{background:#dceef5!important}#ci td{text-align:center}#ci td:first-child{text-align:left}.tick{color:#1e7d44;font-size:15px;font-weight:bold}.dash{color:#aaa}#dc th{background:#1e5e3e;color:white;border:1px solid #2a8a5e}#dc .td-label{background:#dceef5!important}#dc tr:nth-child(even) td{background:#d4f0f0}#dc tr:nth-child(odd) td{background:#fff}#algo th{background:#9b5e04;color:white;border:1px solid #d4830a}#algo tr:nth-child(even) td{background:#fdf3dc}#algo tr:nth-child(odd) td{background:#fff}#algo .td-label{font-weight:bold}.algo-star td{background:#fff0d0!important}.two-col{display:flex;gap:14px;margin-bottom:14px}.two-col>div{flex:1}#sp th{background:#5b2d8e;color:white;border:1px solid #7b4dae}#sp .td-label{background:#f3eeff!important}#sp tr:nth-child(even) td{background:#f3eeff}#sp tr:nth-child(odd) td{background:#fff}#em th{background:#c0392b;color:white;border:1px solid #e05040}#em .td-label{background:#fde8e6!important}#em tr:nth-child(even) td{background:#fde8e6}#em tr:nth-child(odd) td{background:#fff}#av th{background:#c0392b;color:white;border:1px solid #e05040}#av .td-label{background:#fde8e6!important}#av tr:nth-child(even) td{background:#fde8e6}#av tr:nth-child(odd) td{background:#fff}.page-break{border:none;border-top:3px dashed #ccc;margin:20px 0}.footer{text-align:center;font-size:10px;color:#777;margin-top:8px;padding:8px;border-top:1px solid #dce0e5}.print-btn{display:block;margin:0 auto 16px;padding:12px 30px;background:#1a3a5c;color:white;font-size:15px;font-weight:bold;border:none;border-radius:8px;cursor:pointer;letter-spacing:.5px}@media print{.print-btn{display:none!important}body{background:white;font-size:10px}.page{padding:8px;max-width:100%}.header h1{font-size:16px}.two-col{gap:8px}td,th{padding:4px 5px;font-size:9.5px}.section-title{font-size:11px;padding:5px 8px}@page{size:A4 landscape;margin:8mm}}
</style>
</head>
<body>
<div class="page">
<button class="print-btn" onclick="window.print()">🖨️ Print / Save as PDF</button>
<div class="header"><h1>BP MEDICATIONS — QUICK REFERENCE CHART</h1><p>JNC 7 · ACC/AHA 2018 · Comprehensive Clinical Nephrology 7e · NKF Primer 8e</p></div>
<div class="section-title teal">COMPELLING INDICATIONS (JNC 7 / ACC-AHA 2018)</div>
<table id="ci"><thead><tr><th style="text-align:left">Condition</th><th>Diuretic<br>(Thiazide)</th><th>Beta-Blocker</th><th>ACE Inhibitor</th><th>ARB</th><th>CCB</th><th>MRA (Spiro)</th><th>Notes</th></tr></thead><tbody>
<tr><td class="td-label">Heart Failure (HFrEF)</td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td>Avoid verapamil / diltiazem</td></tr>
<tr><td class="td-label">Post-MI</td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td>Beta-blocker within 24 h</td></tr>
<tr><td class="td-label">High CAD Risk / Angina</td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td>CCB: prefer amlodipine</td></tr>
<tr><td class="td-label">Diabetes Mellitus</td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td>ACEi/ARB renoprotective</td></tr>
<tr><td class="td-label">CKD / Proteinuria</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>ACEi or ARB first-line</td></tr>
<tr><td class="td-label">Stroke Prevention (Recurrent)</td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>Thiazide + ACEi combo</td></tr>
<tr><td class="td-label">Atrial Fibrillation (Rate control)</td><td><span class="dash">—</span></td><td><span class="tick">✔</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>✔ non-DHP (diltiazem)</td><td><span class="dash">—</span></td><td>Avoid DHP CCBs alone</td></tr>
<tr><td class="td-label">Pregnancy</td><td><span class="dash">—</span></td><td>✔ Labetalol only</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>✔ Nifedipine SR</td><td><span class="dash">—</span></td><td>Methyldopa also safe</td></tr>
<tr><td class="td-label">BPH</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>Alpha-blocker (doxazosin)</td></tr>
<tr><td class="td-label">Phaeochromocytoma</td><td><span class="dash">—</span></td><td>✔ After alpha-block</td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td><span class="dash">—</span></td><td>Phentolamine FIRST, then BB</td></tr>
</tbody></table>
<div class="section-title green">DRUG CLASS SUMMARY — Mechanisms, Side Effects &amp; Key Indications</div>
<table id="dc"><thead><tr><th style="text-align:left">Drug Class</th><th>Examples</th><th>Mechanism</th><th>Side Effects</th><th style="text-align:left">Key Indications / Notes</th></tr></thead><tbody>
<tr><td class="td-label">Thiazide / Thiazide-like Diuretics</td><td>HCTZ, Chlorthalidone, Indapamide</td><td>Inhibit Na-Cl cotransporter (DCT)</td><td>Hypokalemia, hyperuricemia, hyperglycemia, dyslipidemia</td><td>First-line uncomplicated HTN; HF; CAD; stroke. Chlorthalidone preferred over HCTZ.</td></tr>
<tr><td class="td-label">Loop Diuretics</td><td>Furosemide, Bumetanide</td><td>Inhibit Na-K-2Cl cotransporter (thick ascending limb)</td><td>Hypokalemia, ototoxicity, dehydration</td><td>HTN + volume overload; HF; CKD with GFR &lt;30</td></tr>
<tr><td class="td-label">ACE Inhibitors</td><td>Ramipril, Lisinopril, Enalapril</td><td>Block Ang I→Ang II; bradykinin accumulation</td><td>Dry cough (10-15%), hyperkalemia, angioedema</td><td>HF, post-MI, CKD+proteinuria, diabetes, stroke. AVOID: pregnancy, bilateral RAS.</td></tr>
<tr><td class="td-label">ARBs</td><td>Losartan, Valsartan, Telmisartan</td><td>Block Ang II at AT1 receptor (no bradykinin)</td><td>Similar to ACEi — NO cough</td><td>Same as ACEi. Preferred when ACEi cough intolerable. AVOID: pregnancy, bilateral RAS.</td></tr>
<tr><td class="td-label">Dihydropyridine CCBs (DHP)</td><td>Amlodipine, Nifedipine SR, Felodipine</td><td>Block L-type Ca²⁺ → vasodilation</td><td>Peripheral edema, flushing, gingival hyperplasia</td><td>Uncomplicated HTN, elderly, angina, CKD, black patients, diabetes</td></tr>
<tr><td class="td-label">Non-DHP CCBs</td><td>Diltiazem, Verapamil</td><td>Block L-type Ca²⁺ + AV nodal depression</td><td>Bradycardia, AV block; verapamil: constipation</td><td>HTN + angina + AF rate control. AVOID: HFrEF, AV block, with beta-blockers.</td></tr>
<tr><td class="td-label">Beta-Blockers</td><td>Metoprolol, Carvedilol, Bisoprolol, Labetalol</td><td>Block β1 (±β2) adrenergic receptors</td><td>Fatigue, bradycardia, bronchospasm, masks hypoglycemia</td><td>HFrEF, post-MI, angina, AF, pregnancy (labetalol). AVOID: asthma, severe bradycardia.</td></tr>
<tr><td class="td-label">MRA / Spironolactone</td><td>Spironolactone, Eplerenone</td><td>Block aldosterone receptor</td><td>Hyperkalemia, gynecomastia, menstrual changes</td><td>Resistant HTN (4th-line); HFrEF; post-MI with HF; primary hyperaldosteronism</td></tr>
<tr><td class="td-label">Alpha-1 Blockers</td><td>Doxazosin, Prazosin, Phentolamine IV</td><td>Block α1 receptors → vasodilation</td><td>First-dose orthostatic hypotension</td><td>HTN + BPH; phaeochromocytoma (phentolamine FIRST). Not first-line alone.</td></tr>
<tr><td class="td-label">Central α2-Agonists</td><td>Methyldopa, Clonidine</td><td>Stimulate α2 in CNS → reduce sympathetic outflow</td><td>Sedation, dry mouth; rebound HTN (clonidine)</td><td>Methyldopa: drug of choice in pregnancy. Not 1st-line otherwise.</td></tr>
</tbody></table>
<hr class="page-break">
<div class="section-title amber">STEP-UP TREATMENT ALGORITHM (Uncomplicated HTN)</div>
<table id="algo"><thead><tr><th>Step</th><th>Regimen</th><th>Detail</th><th>When to Use</th></tr></thead><tbody>
<tr><td style="text-align:center;font-weight:bold">1</td><td class="td-label">Dual combination</td><td><strong>ACEi or ARB + CCB</strong> or <strong>Thiazide diuretic</strong></td><td>BP ≥140/90 mmHg (monotherapy if just above 140/90 or frail elderly)</td></tr>
<tr><td style="text-align:center;font-weight:bold">2</td><td class="td-label">Triple combination</td><td><strong>ACEi or ARB + CCB + Thiazide diuretic</strong></td><td>Dual combo insufficient to reach BP target</td></tr>
<tr><td style="text-align:center;font-weight:bold">3</td><td class="td-label">Resistant HTN</td><td>Triple combo + Spironolactone 25–50 mg OD (or alpha-blocker or beta-blocker)</td><td>BP uncontrolled on 3 drugs; refer to specialist</td></tr>
<tr class="algo-star"><td style="text-align:center;font-weight:bold">★</td><td class="td-label">Beta-blockers</td><td>Add at ANY step when specific indication present</td><td>HFrEF, angina, AF, post-MI, pregnancy (labetalol)</td></tr>
</tbody></table>
<div class="two-col">
<div>
<div class="section-title purple">SPECIAL CLINICAL SITUATIONS</div>
<table id="sp"><thead><tr><th style="text-align:left">Situation</th><th style="text-align:left">Preferred Drug(s)</th></tr></thead><tbody>
<tr><td class="td-label">Pregnancy</td><td>Methyldopa | Labetalol | Nifedipine SR</td></tr>
<tr><td class="td-label">Elderly / Isolated systolic HTN</td><td>Amlodipine | Chlorthalidone</td></tr>
<tr><td class="td-label">Black / African-descent patients</td><td>CCB or Thiazide (RAS blockers less effective as monotherapy)</td></tr>
<tr><td class="td-label">CKD + Proteinuria</td><td>ACEi or ARB (renoprotective)</td></tr>
<tr><td class="td-label">Metabolic syndrome / Pre-diabetes</td><td>ACEi or ARB or CCB (avoid thiazide+BB combo)</td></tr>
<tr><td class="td-label">Post-renal transplant</td><td>CCB (amlodipine) — first-line</td></tr>
<tr><td class="td-label">Bilateral renal artery stenosis</td><td>CCB or diuretic (AVOID ACEi / ARBs)</td></tr>
<tr><td class="td-label">Aortic aneurysm / Marfan</td><td>Beta-blocker (atenolol) or ARB (losartan)</td></tr>
<tr><td class="td-label">Migraines</td><td>Beta-blocker (propranolol, metoprolol) or verapamil</td></tr>
<tr><td class="td-label">Raynaud's phenomenon</td><td>Amlodipine. AVOID non-selective beta-blockers.</td></tr>
<tr><td class="td-label">Hyperthyroidism / Thyroid storm</td><td>Beta-blocker (propranolol)</td></tr>
</tbody></table>
</div>
<div>
<div class="section-title red">HYPERTENSIVE EMERGENCY — IV Agents</div>
<table id="em"><thead><tr><th style="text-align:left">Emergency Type</th><th>Preferred Agents</th><th>Avoid</th></tr></thead><tbody>
<tr><td class="td-label">HTN Encephalopathy</td><td>Nicardipine, Labetalol, Clevidipine</td><td>Nitroprusside</td></tr>
<tr><td class="td-label">Acute Ischaemic Stroke</td><td>Nicardipine, Labetalol, Clevidipine</td><td>Nitroprusside, Nimodipine</td></tr>
<tr><td class="td-label">Haemorrhagic Stroke</td><td>Nicardipine, Labetalol</td><td>Nitroprusside</td></tr>
<tr><td class="td-label">Aortic Dissection</td><td>Esmolol IV + Nitroprusside or Labetalol</td><td>Hydralazine</td></tr>
<tr><td class="td-label">Acute Pulmonary Oedema</td><td>IV Nitroglycerine + Furosemide + Nicardipine</td><td>Beta-blockers</td></tr>
<tr><td class="td-label">Acute MI + HTN</td><td>Beta-blocker + Nitroglycerine + ACEi</td><td>Hydralazine</td></tr>
<tr><td class="td-label">Eclampsia / Pre-eclampsia</td><td>IV Hydralazine, IV Labetalol, IV MgSO4</td><td>ACEi, ARBs</td></tr>
<tr><td class="td-label">Phaeochromocytoma Crisis</td><td>Phentolamine THEN beta-blocker</td><td>Beta-blocker FIRST!</td></tr>
<tr><td class="td-label">Scleroderma Renal Crisis</td><td>ACE Inhibitor (captopril)</td><td>ARB (less evidence)</td></tr>
</tbody></table>
<p style="font-size:10.5px;color:#c0392b;font-weight:bold;margin-top:4px;">⚠ Reduce BP max 25% in first hour. Avoid rapid drops — risk of ischaemia.</p>
</div></div>
<div class="section-title red">DRUGS TO AVOID IN SPECIFIC CONDITIONS</div>
<table id="av"><thead><tr><th style="text-align:left">Condition</th><th style="text-align:left">Drug(s) to Avoid &amp; Reason</th></tr></thead><tbody>
<tr><td class="td-label">Pregnancy</td><td>ACEi, ARBs, Direct Renin Inhibitors — all TERATOGENIC</td></tr>
<tr><td class="td-label">Bilateral renal artery stenosis</td><td>ACEi / ARBs — can precipitate acute renal failure</td></tr>
<tr><td class="td-label">Hyperkalaemia</td><td>ACEi, ARBs, MRA (spironolactone), K-sparing diuretics</td></tr>
<tr><td class="td-label">Asthma / COPD</td><td>Non-selective beta-blockers (propranolol) — bronchospasm</td></tr>
<tr><td class="td-label">AV block (2nd / 3rd degree)</td><td>Verapamil, Diltiazem, Beta-blockers — risk of asystole</td></tr>
<tr><td class="td-label">Gout</td><td>Thiazide diuretics — raise serum uric acid</td></tr>
<tr><td class="td-label">Decompensated / acute HF</td><td>Verapamil, Non-DHP CCBs — negative inotropy worsens acute failure</td></tr>
<tr><td class="td-label">Phaeochromocytoma</td><td>Beta-blockers FIRST (without alpha-blockade) — paradoxical severe HTN</td></tr>
<tr><td class="td-label">Metabolic syndrome / Diabetes risk</td><td>Thiazide + Beta-blocker combination — worsen insulin resistance</td></tr>
</tbody></table>
<div class="footer">Sources: JNC 7 · ACC/AHA 2018 · Comprehensive Clinical Nephrology 7e · NKF Primer 8e · Textbook of Family Medicine 9e · Goldman-Cecil Medicine · Lippincott Pharmacology<br>For clinical decisions, always verify against current local guidelines.</div>
<button class="print-btn" onclick="window.print()" style="margin-top:14px">🖨️ Print / Save as PDF</button>
</div></body></html>
Steps on Android Chrome:
  1. Copy the code above
  2. Open a new Chrome tab → type data:text/html, in the address bar → paste the code after the comma → tap Go
  3. Tap the Print / Save as PDF button that appears on the page
  4. Select Save as PDF from the print menu
This is a shared conversation. Sign in to Orris to start your own chat.