Create a ppt topic is antihistamine classification, drugs, mechanism of action ,side effects, contraindications , drug of choice
mkdir -p /tmp/workspace/antihistamine-ppt && ls /tmp/workspace/antihistamine-ppt/
~/antihistamine-ppt/build_ppt.py
from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from io import BytesIO
# ── Color Palette ──────────────────────────────────────────────
DARK_BLUE = RGBColor(0x0D, 0x2B, 0x55) # navy header
MED_BLUE = RGBColor(0x1A, 0x6B, 0xAA) # accent
LIGHT_BLUE = RGBColor(0xD6, 0xE8, 0xF7) # content bg
TEAL = RGBColor(0x00, 0x7B, 0x83) # subheading accent
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
DARK_TEXT = RGBColor(0x1A, 0x1A, 0x2E)
ORANGE = RGBColor(0xE8, 0x7B, 0x1E)
YELLOW_BG = RGBColor(0xFF, 0xF3, 0xCD)
GREEN_DARK = RGBColor(0x1B, 0x6B, 0x3A)
GREEN_LIGHT = RGBColor(0xD4, 0xED, 0xDA)
RED_DARK = RGBColor(0x7B, 0x1A, 0x1A)
RED_LIGHT = RGBColor(0xF8, 0xD7, 0xDA)
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]
def add_rect(slide, x, y, w, h, fill_color, line_color=None, line_width=None):
shape = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
shape.fill.solid()
shape.fill.fore_color.rgb = fill_color
if line_color:
shape.line.color.rgb = line_color
if line_width:
shape.line.width = line_width
else:
shape.line.fill.background()
return shape
def add_textbox(slide, x, y, w, h, text, font_size, bold=False,
color=DARK_TEXT, align=PP_ALIGN.LEFT, italic=False,
word_wrap=True, v_anchor=MSO_ANCHOR.TOP):
tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
tf = tb.text_frame
tf.word_wrap = word_wrap
tf.vertical_anchor = v_anchor
tf.margin_left = 0; tf.margin_right = 0
tf.margin_top = 0; tf.margin_bottom = 0
p = tf.paragraphs[0]
p.alignment = align
r = p.add_run()
r.text = text
r.font.size = Pt(font_size)
r.font.bold = bold
r.font.italic = italic
r.font.color.rgb = color
r.font.name = "Calibri"
return tb
def add_bullet_box(slide, x, y, w, h, items, font_size=14, color=DARK_TEXT,
bullet_color=MED_BLUE, leading_space=80, para_space=60):
tb = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
tf = tb.text_frame
tf.word_wrap = True
tf.margin_left = Pt(4); tf.margin_right = Pt(4)
tf.margin_top = Pt(4); tf.margin_bottom = Pt(4)
first = True
for item in items:
if first:
p = tf.paragraphs[0]
first = False
else:
p = tf.add_paragraph()
p.space_before = Pt(leading_space / 100)
p.space_after = Pt(para_space / 100)
# bullet character
r_bullet = p.add_run()
r_bullet.text = "• "
r_bullet.font.size = Pt(font_size)
r_bullet.font.color.rgb = bullet_color
r_bullet.font.bold = True
r_bullet.font.name = "Calibri"
r_body = p.add_run()
r_body.text = item
r_body.font.size = Pt(font_size)
r_body.font.color.rgb = color
r_body.font.name = "Calibri"
return tb
def slide_header(slide, title, subtitle=None):
"""Adds a navy header band + title text."""
add_rect(slide, 0, 0, 13.333, 1.05, DARK_BLUE)
add_rect(slide, 0, 1.05, 13.333, 0.06, TEAL)
add_textbox(slide, 0.3, 0.08, 12.7, 0.88, title,
font_size=30, bold=True, color=WHITE,
align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
if subtitle:
add_textbox(slide, 0.3, 0.75, 12.7, 0.38, subtitle,
font_size=15, bold=False, color=RGBColor(0xAD, 0xD8, 0xE6),
align=PP_ALIGN.LEFT)
def slide_footer(slide):
add_rect(slide, 0, 7.25, 13.333, 0.25, DARK_BLUE)
add_textbox(slide, 0.3, 7.26, 12.7, 0.22,
"Antihistamines — Classification, MOA, Side Effects, Contraindications & Drug of Choice",
font_size=8, color=RGBColor(0xAA, 0xCC, 0xEE),
align=PP_ALIGN.LEFT)
# ═══════════════════════════════════════════════════════════════
# SLIDE 1 — TITLE SLIDE
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE)
add_rect(slide, 0, 3.2, 13.333, 0.08, TEAL)
add_rect(slide, 0, 5.5, 13.333, 2.0, MED_BLUE)
add_textbox(slide, 1.0, 0.8, 11.3, 1.2,
"ANTIHISTAMINES",
font_size=52, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
add_textbox(slide, 1.0, 1.95, 11.3, 0.7,
"A Comprehensive Pharmacological Overview",
font_size=22, bold=False, color=RGBColor(0xAD, 0xD8, 0xE6),
align=PP_ALIGN.CENTER)
add_textbox(slide, 1.0, 2.55, 11.3, 0.55,
"Classification | Drugs | Mechanism of Action | Side Effects | Contraindications | Drug of Choice",
font_size=14, italic=True, color=RGBColor(0x90, 0xC8, 0xF0),
align=PP_ALIGN.CENTER)
topics = [
("Classification", "H1 / H2 / H3 / H4 Receptors"),
("Drug List", "1st & 2nd Generation Agents"),
("Mechanism", "Inverse Agonism at H-Receptors"),
("Side Effects", "CNS, Anticholinergic, Cardiac"),
("Contraindications", "Glaucoma, MAOIs, Pregnancy…"),
("Drug of Choice", "Condition-Specific Agents"),
]
box_w = 13.333 / 6
for i, (top, sub) in enumerate(topics):
x = i * box_w
add_rect(slide, x, 5.55, box_w - 0.05, 1.55, MED_BLUE)
add_textbox(slide, x + 0.08, 5.62, box_w - 0.2, 0.5, top,
font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
add_textbox(slide, x + 0.08, 6.1, box_w - 0.2, 0.65, sub,
font_size=9.5, color=RGBColor(0xAD, 0xD8, 0xE6),
align=PP_ALIGN.CENTER)
# ═══════════════════════════════════════════════════════════════
# SLIDE 2 — OVERVIEW: HISTAMINE RECEPTORS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "Overview: Histamine & Its Receptors")
slide_footer(slide)
headers = ["Receptor", "Location", "Effects", "Blocker Used"]
col_w = [1.8, 3.2, 4.8, 2.8]
col_x = [0.25, 2.05, 5.25, 10.05]
rows = [
["H1", "Smooth muscle, endothelium, brain, skin",
"Bronchoconstriction, vasodilation, itch, allergic symptoms",
"1st & 2nd gen antihistamines"],
["H2", "Gastric parietal cells, heart, uterus",
"Gastric acid secretion, tachycardia",
"Cimetidine, Ranitidine, Famotidine"],
["H3", "Pre-synaptic neurons (CNS & PNS)",
"Modulates neurotransmitter release (histamine, NE, DA)",
"Pitolisant (narcolepsy)"],
["H4", "Bone marrow, eosinophils, mast cells",
"Chemotaxis of eosinophils, immune modulation",
"Investigational agents"],
]
row_colors = [LIGHT_BLUE, WHITE, LIGHT_BLUE, WHITE]
# header row
y = 1.25
add_rect(slide, 0.25, y, 12.83, 0.42, DARK_BLUE)
for j, h in enumerate(headers):
add_textbox(slide, col_x[j] + 0.05, y + 0.04, col_w[j] - 0.1, 0.35,
h, font_size=13, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.42
for i, row in enumerate(rows):
rh = 0.9
add_rect(slide, 0.25, y, 12.83, rh, row_colors[i])
for j, cell in enumerate(row):
fs = 13 if j == 0 else 11.5
bold = (j == 0)
add_textbox(slide, col_x[j] + 0.05, y + 0.05, col_w[j] - 0.1, rh - 0.1,
cell, font_size=fs, bold=bold, color=DARK_TEXT,
align=PP_ALIGN.CENTER, v_anchor=MSO_ANCHOR.MIDDLE)
y += rh
add_textbox(slide, 0.3, 5.78, 12.7, 0.6,
"Note: The term 'antihistamine' clinically refers to H1 blockers unless otherwise specified. "
"H2 blockers are used for peptic ulcer disease and GERD.",
font_size=11, italic=True, color=MED_BLUE)
# ═══════════════════════════════════════════════════════════════
# SLIDE 3 — CLASSIFICATION: 1st vs 2nd GENERATION
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "Classification of H1 Antihistamines")
slide_footer(slide)
# Left box — 1st generation
add_rect(slide, 0.25, 1.2, 6.2, 5.85, DARK_BLUE)
add_rect(slide, 0.25, 1.2, 6.2, 0.52, MED_BLUE)
add_textbox(slide, 0.35, 1.22, 6.0, 0.46,
"FIRST GENERATION (Sedating / Classical)",
font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
gen1_groups = [
("Ethanolamines", "Diphenhydramine, Dimenhydrinate, Clemastine"),
("Ethylenediamines", "Tripelennamine, Pyrilamine"),
("Alkylamines", "Chlorpheniramine, Brompheniramine"),
("Phenothiazines", "Promethazine, Trimeprazine"),
("Piperazines", "Hydroxyzine, Cyclizine, Meclizine"),
("Piperidines (1st)", "Cyproheptadine, Ketotifen"),
]
y = 1.8
for grp, drugs in gen1_groups:
add_rect(slide, 0.35, y, 6.0, 0.28, MED_BLUE)
add_textbox(slide, 0.42, y + 0.02, 5.86, 0.24,
grp, font_size=11.5, bold=True, color=WHITE)
add_textbox(slide, 0.42, y + 0.29, 5.86, 0.4,
drugs, font_size=10.5, color=DARK_TEXT)
y += 0.72
# Right box — 2nd generation
add_rect(slide, 6.85, 1.2, 6.25, 5.85, RGBColor(0xE8, 0xF4, 0xFF))
add_rect(slide, 6.85, 1.2, 6.25, 0.52, TEAL)
add_textbox(slide, 6.95, 1.22, 6.05, 0.46,
"SECOND GENERATION (Non-Sedating / Selective)",
font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
gen2_drugs = [
("Loratadine", "10 mg OD — minimal sedation"),
("Desloratadine", "Active metabolite of loratadine, 5 mg OD"),
("Fexofenadine", "Active metabolite of terfenadine, 180 mg OD"),
("Cetirizine", "Metabolite of hydroxyzine, mildly sedating"),
("Levocetirizine", "R-enantiomer of cetirizine, more potent"),
("Bilastine", "Very low CNS penetration, 20 mg OD"),
("Rupatadine", "Dual H1 + PAF antagonist, 10 mg OD"),
("Ebastine", "Long-acting, low sedation, 10–20 mg OD"),
]
y = 1.8
for drug, note in gen2_drugs:
add_rect(slide, 6.95, y, 6.05, 0.58, WHITE)
add_rect(slide, 6.95, y, 0.08, 0.58, TEAL)
add_textbox(slide, 7.1, y + 0.02, 5.8, 0.26,
drug, font_size=12, bold=True, color=DARK_BLUE)
add_textbox(slide, 7.1, y + 0.28, 5.8, 0.26,
note, font_size=10, color=DARK_TEXT)
y += 0.63
# ═══════════════════════════════════════════════════════════════
# SLIDE 4 — DRUG LIST: FIRST GENERATION (DETAILED)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "First-Generation H1 Antihistamines — Key Drugs")
slide_footer(slide)
first_gen_table = [
["Drug", "Class", "Route", "Key Feature / Use"],
["Diphenhydramine", "Ethanolamine", "Oral / IV / IM / Topical", "Allergy, motion sickness, sleep aid, anaphylaxis"],
["Dimenhydrinate", "Ethanolamine", "Oral / IM / IV", "Motion sickness (Dramamine)"],
["Promethazine", "Phenothiazine", "Oral / IM / IV", "Nausea, vomiting, pre-anesthesia, sedation"],
["Chlorpheniramine", "Alkylamine", "Oral", "Allergic rhinitis; least sedating 1st-gen"],
["Hydroxyzine", "Piperazine", "Oral / IM", "Urticaria, anxiety, pre-op sedation"],
["Meclizine", "Piperazine", "Oral", "Motion sickness, vertigo"],
["Cyclizine", "Piperazine", "Oral / IM / IV", "Motion sickness, nausea"],
["Cyproheptadine", "Piperidine", "Oral", "Urticaria, appetite stimulant, serotonin antagonist"],
["Ketotifen", "Piperidine", "Oral / Ophthalmic", "Allergic conjunctivitis, mast cell stabilizer"],
]
col_ws = [2.6, 2.3, 2.8, 4.8]
col_xs = [0.25, 2.85, 5.15, 7.95]
y = 1.25
add_rect(slide, 0.25, y, 12.85, 0.4, DARK_BLUE)
for j, h in enumerate(first_gen_table[0]):
add_textbox(slide, col_xs[j] + 0.05, y + 0.04, col_ws[j] - 0.1, 0.32,
h, font_size=12.5, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.4
row_c = [LIGHT_BLUE, WHITE]
for i, row in enumerate(first_gen_table[1:]):
rh = 0.56
add_rect(slide, 0.25, y, 12.85, rh, row_c[i % 2])
fss = [13, 11.5, 11, 11]
bolds = [True, False, False, False]
for j, cell in enumerate(row):
add_textbox(slide, col_xs[j] + 0.05, y + 0.04, col_ws[j] - 0.1, rh - 0.08,
cell, font_size=fss[j], bold=bolds[j], color=DARK_TEXT,
v_anchor=MSO_ANCHOR.MIDDLE, align=PP_ALIGN.CENTER)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 5 — DRUG LIST: SECOND GENERATION (DETAILED)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "Second-Generation H1 Antihistamines — Key Drugs")
slide_footer(slide)
sec_gen_table = [
["Drug", "Dose", "Half-life", "Sedation", "Notes"],
["Fexofenadine", "180 mg OD", "14-18 h", "None", "Least sedating; renal excretion; safe in pilots"],
["Loratadine", "10 mg OD", "8-28 h", "Minimal", "Pro-drug; hepatic metabolism (CYP3A4/2D6)"],
["Desloratadine", "5 mg OD", "27 h", "None", "Active metabolite of loratadine; potent"],
["Cetirizine", "10 mg OD", "7-10 h", "Mild (10%)", "Metabolite of hydroxyzine; also antipruritic"],
["Levocetirizine", "5 mg OD", "7-9 h", "Mild", "R-enantiomer; more potent than cetirizine"],
["Bilastine", "20 mg OD", "14.5 h", "None", "Not metabolized; food reduces absorption"],
["Rupatadine", "10 mg OD", "6 h", "Low", "H1 + PAF antagonist; metabolized to desloratadine"],
["Azelastine", "Intranasal / Ophthalmic", "22 h", "Low-mod", "Mast cell stabilizer; fast onset (15 min)"],
["Olopatadine", "Ophthalmic / Intranasal", "3-12 h", "None", "Mast cell stabilizer; allergic conjunctivitis"],
]
col_ws2 = [2.5, 2.2, 1.8, 1.8, 4.5]
col_xs2 = [0.2, 2.7, 4.9, 6.7, 8.5]
y = 1.25
add_rect(slide, 0.2, y, 12.93, 0.4, TEAL)
for j, h in enumerate(sec_gen_table[0]):
add_textbox(slide, col_xs2[j] + 0.05, y + 0.04, col_ws2[j] - 0.1, 0.32,
h, font_size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.4
sed_colors = {
"None": RGBColor(0x1B, 0x6B, 0x3A),
"Minimal": RGBColor(0x00, 0x7B, 0x83),
"Mild": RGBColor(0xB8, 0x76, 0x0C),
"Mild (10%)": RGBColor(0xB8, 0x76, 0x0C),
"Low": RGBColor(0x00, 0x7B, 0x83),
"Low-mod": RGBColor(0xB8, 0x76, 0x0C),
}
for i, row in enumerate(sec_gen_table[1:]):
rh = 0.56
add_rect(slide, 0.2, y, 12.93, rh, row_c[i % 2])
for j, cell in enumerate(row):
if j == 3:
sc = sed_colors.get(cell, DARK_TEXT)
add_textbox(slide, col_xs2[j] + 0.05, y + 0.04, col_ws2[j] - 0.1,
rh - 0.08, cell, font_size=11, bold=True, color=sc,
v_anchor=MSO_ANCHOR.MIDDLE, align=PP_ALIGN.CENTER)
else:
fs = 12.5 if j == 0 else 10.5
bold = (j == 0)
add_textbox(slide, col_xs2[j] + 0.05, y + 0.04, col_ws2[j] - 0.1,
rh - 0.08, cell, font_size=fs, bold=bold, color=DARK_TEXT,
v_anchor=MSO_ANCHOR.MIDDLE, align=PP_ALIGN.CENTER)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 6 — MECHANISM OF ACTION
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "Mechanism of Action")
slide_footer(slide)
# Left panel — core mechanism
add_rect(slide, 0.25, 1.2, 8.2, 5.85, WHITE)
add_rect(slide, 0.25, 1.2, 8.2, 0.45, MED_BLUE)
add_textbox(slide, 0.35, 1.22, 8.0, 0.4, "Core Mechanism",
font_size=14, bold=True, color=WHITE)
moa_points = [
"Inverse Agonists: H1 antihistamines bind and STABILIZE the inactive state of H1 receptors (not simple competitive antagonists). They shift the receptor equilibrium toward its inactive conformation.",
"The H1 receptor is a G-protein coupled receptor (GPCR). When activated by histamine, it signals via Gq/11 → IP3 → intracellular Ca2+ → downstream inflammatory effects.",
"By occupying H1 receptors, antihistamines PREVENT histamine from triggering: bronchoconstriction, vasodilation, increased capillary permeability, itch sensation, and CNS histaminergic transmission.",
"They also reduce proinflammatory cytokine production, downregulate cell-adhesion molecules (e.g., ICAM-1), and inhibit eosinophil chemotaxis — contributing to anti-allergic effects beyond simple receptor blockade.",
"First-generation agents ALSO bind muscarinic (M1/M2), α1-adrenergic, and serotonin receptors → responsible for anticholinergic side effects.",
"Mast cell stabilizers (azelastine, ketotifen): additionally inhibit Ca2+ influx into mast cells → reduced degranulation and mediator release.",
]
y = 1.72
for pt in moa_points:
tb = slide.shapes.add_textbox(Inches(0.42), Inches(y), Inches(7.9), Inches(0.76))
tf = tb.text_frame; tf.word_wrap = True
tf.margin_left = Pt(3); tf.margin_right = Pt(3)
tf.margin_top = Pt(2); tf.margin_bottom = Pt(2)
p = tf.paragraphs[0]
r1 = p.add_run(); r1.text = "▶ "; r1.font.size = Pt(9); r1.font.color.rgb = MED_BLUE; r1.font.name = "Calibri"
r2 = p.add_run(); r2.text = pt; r2.font.size = Pt(10); r2.font.color.rgb = DARK_TEXT; r2.font.name = "Calibri"
y += 0.8
# Right panel — comparison
add_rect(slide, 8.75, 1.2, 4.35, 5.85, LIGHT_BLUE)
add_rect(slide, 8.75, 1.2, 4.35, 0.45, DARK_BLUE)
add_textbox(slide, 8.85, 1.22, 4.15, 0.4, "1st vs 2nd Gen MOA",
font_size=13, bold=True, color=WHITE)
comparison = [
("CNS Penetration", "HIGH (lipophilic)", "LOW (polar/charged)"),
("Receptor Selectivity", "H1 + M, α1, 5-HT", "H1 only (selective)"),
("Binding Type", "Reversible / Competitive", "Non-competitive (slow dissociation)"),
("BBB Crossing", "Yes → sedation", "No → non-sedating"),
("Duration of Action", "4-6 hrs (most)", "12-24 hrs (once daily)"),
("Metabolism", "Hepatic CYP450 (extensive)", "Minimal / renal excretion"),
("Tachyphylaxis", "None", "None"),
]
y = 1.72
for prop, gen1, gen2 in comparison:
add_rect(slide, 8.75, y, 4.35, 0.2, MED_BLUE)
add_textbox(slide, 8.8, y + 0.01, 4.2, 0.17, prop,
font_size=9, bold=True, color=WHITE)
add_rect(slide, 8.75, y + 0.2, 4.35, 0.52, WHITE)
add_textbox(slide, 8.8, y + 0.21, 2.1, 0.5,
f"1G: {gen1}", font_size=9, color=RED_DARK)
add_textbox(slide, 10.9, y + 0.21, 2.1, 0.5,
f"2G: {gen2}", font_size=9, color=GREEN_DARK)
y += 0.78
# ═══════════════════════════════════════════════════════════════
# SLIDE 7 — SIDE EFFECTS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "Side Effects of Antihistamines")
slide_footer(slide)
side_categories = [
{
"title": "CNS Effects (mainly 1st gen)",
"color": RGBColor(0x7B, 0x1A, 0x1A),
"bg": RED_LIGHT,
"items": [
"Sedation, drowsiness (most common)",
"Dizziness, lack of coordination",
"Fatigue, cognitive impairment",
"Paradoxical excitation in children",
"Tremors, insomnia (high doses)",
],
},
{
"title": "Anticholinergic Effects (1st gen)",
"color": RGBColor(0x7B, 0x4E, 0x00),
"bg": YELLOW_BG,
"items": [
"Dry mouth (xerostomia)",
"Urinary retention",
"Blurred vision (mydriasis)",
"Constipation",
"Tachycardia",
],
},
{
"title": "Cardiovascular",
"color": RGBColor(0x5A, 0x00, 0x7A),
"bg": RGBColor(0xF3, 0xE5, 0xF5),
"items": [
"Postural hypotension (α1 block)",
"Prolonged QT interval",
"Ventricular arrhythmias",
"Torsades de pointes (rare, esp. old agents like terfenadine/astemizole — now withdrawn)",
],
},
{
"title": "GI Effects",
"color": RGBColor(0x1B, 0x5E, 0x20),
"bg": GREEN_LIGHT,
"items": [
"Nausea, vomiting",
"Epigastric distress",
"Diarrhea or constipation",
"Anorexia",
],
},
{
"title": "Other / Systemic",
"color": MED_BLUE,
"bg": LIGHT_BLUE,
"items": [
"Headache (most common with 2nd gen)",
"Contact dermatitis (topical diphenhydramine)",
"Photosensitivity (promethazine)",
"Drug interactions: potentiate CNS depressants, alcohol, MAOIs",
"Increased appetite / weight gain (cyproheptadine)",
],
},
]
box_w_se = 2.5
box_x_positions = [0.2, 2.75, 5.3, 7.85, 10.4]
for i, cat in enumerate(side_categories):
x = box_x_positions[i]
add_rect(slide, x, 1.2, box_w_se, 5.85, cat["bg"])
add_rect(slide, x, 1.2, box_w_se, 0.5, cat["color"])
add_textbox(slide, x + 0.05, 1.22, box_w_se - 0.1, 0.46,
cat["title"], font_size=11, bold=True, color=WHITE,
align=PP_ALIGN.CENTER, word_wrap=True)
y = 1.8
for item in cat["items"]:
add_textbox(slide, x + 0.1, y, box_w_se - 0.2, 0.75,
f"• {item}", font_size=10, color=DARK_TEXT, word_wrap=True)
y += 0.88
# ═══════════════════════════════════════════════════════════════
# SLIDE 8 — CONTRAINDICATIONS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "Contraindications & Precautions")
slide_footer(slide)
# Absolute CIs
add_rect(slide, 0.25, 1.2, 6.1, 5.85, RED_LIGHT)
add_rect(slide, 0.25, 1.2, 6.1, 0.5, RED_DARK)
add_textbox(slide, 0.35, 1.22, 5.9, 0.46,
"ABSOLUTE CONTRAINDICATIONS",
font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
abs_ci = [
("Narrow-Angle Glaucoma",
"Anticholinergic effects increase intraocular pressure, precipitating acute angle-closure attack"),
("Concurrent MAOI Use",
"MAOIs inhibit histamine degradation; combination causes severe hypertensive crisis and serotonin syndrome"),
("Hypersensitivity to the Drug",
"Known allergy to the specific antihistamine or its structural class"),
("Premature Neonates / Infants < 2 years",
"Risk of fatal respiratory depression; promethazine contraindicated in children < 2 years (BLACK BOX)"),
]
y = 1.8
for title, expl in abs_ci:
add_rect(slide, 0.35, y, 5.9, 0.3, RED_DARK)
add_textbox(slide, 0.42, y + 0.02, 5.76, 0.26, title,
font_size=12, bold=True, color=WHITE)
add_rect(slide, 0.35, y + 0.3, 5.9, 0.72, WHITE)
add_textbox(slide, 0.42, y + 0.32, 5.76, 0.68, expl,
font_size=10.5, color=DARK_TEXT, word_wrap=True)
y += 1.1
# Relative CIs / Precautions
add_rect(slide, 6.75, 1.2, 6.35, 5.85, YELLOW_BG)
add_rect(slide, 6.75, 1.2, 6.35, 0.5, RGBColor(0xB8, 0x76, 0x0C))
add_textbox(slide, 6.85, 1.22, 6.15, 0.46,
"PRECAUTIONS / USE WITH CAUTION",
font_size=14, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
rel_ci = [
("Prostatic Hypertrophy", "Anticholinergic effects → urinary retention risk"),
("Bladder Neck Obstruction", "Same mechanism as above"),
("Pyloroduodenal Obstruction", "Anticholinergic slowing of GI motility"),
("Pregnancy (1st Trimester)", "1st-gen: avoid; loratadine/cetirizine relatively safer"),
("Elderly Patients", "Increased CNS sensitivity; fall risk; confusion; urinary retention"),
("Hepatic Impairment", "Loratadine, desloratadine dose adjustment needed"),
("Renal Impairment", "Cetirizine, levocetirizine, fexofenadine dose reduction required"),
("QT Prolongation / Arrhythmias", "Avoid 1st-gen agents; terfenadine/astemizole withdrawn"),
("CNS Depressants / Alcohol", "Potentiation of sedative effects with 1st-gen agents"),
("Hyperthyroidism / Cardiovascular Disease", "Caution with anticholinergic effects"),
]
y = 1.8
for title, expl in rel_ci:
add_rect(slide, 6.85, y, 6.15, 0.52, WHITE)
add_rect(slide, 6.85, y, 0.1, 0.52, RGBColor(0xB8, 0x76, 0x0C))
add_textbox(slide, 7.02, y + 0.02, 5.9, 0.24,
title, font_size=11, bold=True, color=DARK_BLUE)
add_textbox(slide, 7.02, y + 0.26, 5.9, 0.24,
expl, font_size=9.5, color=DARK_TEXT)
y += 0.56
# ═══════════════════════════════════════════════════════════════
# SLIDE 9 — DRUG OF CHOICE
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "Drug of Choice — Condition-Specific Guide")
slide_footer(slide)
doc_data = [
["Condition", "Drug of Choice", "Alternatives / Notes"],
["Allergic Rhinitis", "Fexofenadine or Loratadine (2nd gen)", "Intranasal corticosteroids are most effective overall"],
["Acute Urticaria", "Cetirizine or Loratadine", "Add H2 blocker (famotidine) for refractory cases"],
["Chronic Spontaneous Urticaria", "2nd-gen H1 (cetirizine/loratadine) — up to 4× dose", "Add omalizumab if no response at 4 weeks"],
["Motion Sickness", "Scopolamine (1st choice); Meclizine, Promethazine, Dimenhydrinate", "Must be given BEFORE symptoms; not effective after onset"],
["Allergic Conjunctivitis", "Olopatadine or Azelastine (ophthalmic)", "Ketotifen, alcaftadine — mast cell stabilizer dual action"],
["Pruritus (Itch)", "Hydroxyzine (1st gen, sedation useful at night)", "Cetirizine / levocetirizine for daytime"],
["Nausea / Vomiting", "Promethazine (most potent antihistamine antiemetic)", "Diphenhydramine, dimenhydrinate"],
["Anaphylaxis", "Epinephrine (1st line) + Diphenhydramine (IV/IM) adjunct", "Antihistamines are ADJUNCT only — never replace epinephrine"],
["Sedation (pre-op/insomnia)", "Promethazine / Hydroxyzine / Diphenhydramine", "Not recommended for chronic insomnia"],
["Serotonin Syndrome", "Cyproheptadine (H1 + 5-HT antagonist)", "Supportive care + benzodiazepines"],
["Appetite Stimulation", "Cyproheptadine", "Used in children with failure to thrive"],
["Pregnancy (rhinitis/urticaria)", "Loratadine or Cetirizine (Category B)", "Avoid 1st-gen in 1st trimester"],
["Pediatric Allergies", "Cetirizine (> 2 yrs) or Loratadine (> 2 yrs)", "Avoid promethazine in < 2 yrs (Black Box Warning)"],
]
col_ws_doc = [3.6, 4.4, 5.0]
col_xs_doc = [0.2, 3.8, 8.2]
y = 1.25
add_rect(slide, 0.2, y, 12.93, 0.38, DARK_BLUE)
for j, h in enumerate(doc_data[0]):
add_textbox(slide, col_xs_doc[j] + 0.05, y + 0.03, col_ws_doc[j] - 0.1, 0.32,
h, font_size=12, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.38
for i, row in enumerate(doc_data[1:]):
rh = 0.44
add_rect(slide, 0.2, y, 12.93, rh, row_c[i % 2])
fss_doc = [11.5, 11, 10]
bolds_doc = [True, True, False]
for j, cell in enumerate(row):
add_textbox(slide, col_xs_doc[j] + 0.05, y + 0.03, col_ws_doc[j] - 0.1,
rh - 0.06, cell, font_size=fss_doc[j], bold=bolds_doc[j],
color=DARK_TEXT if j < 2 else RGBColor(0x33, 0x55, 0x77),
v_anchor=MSO_ANCHOR.MIDDLE)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 10 — H2, H3, H4 BLOCKERS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
slide_header(slide, "H2, H3 & H4 Receptor Antagonists")
slide_footer(slide)
# H2 blockers
add_rect(slide, 0.25, 1.2, 12.83, 0.45, TEAL)
add_textbox(slide, 0.35, 1.22, 12.6, 0.4, "H2 RECEPTOR BLOCKERS (H2 Antihistamines)",
font_size=14, bold=True, color=WHITE)
h2_data = [
["Drug", "Brand", "Dose", "Use", "Key Notes"],
["Cimetidine", "Tagamet", "400 mg BD", "PUD, GERD, Zollinger-Ellison", "Most drug interactions (CYP inhibitor); anti-androgenic"],
["Ranitidine", "Zantac", "150 mg BD", "PUD, GERD", "Withdrawn (NDMA contamination, 2020)"],
["Famotidine", "Pepcid", "20-40 mg OD/BD", "PUD, GERD, urticaria (adjunct)", "Fewest drug interactions; preferred"],
["Nizatidine", "Axid", "150 mg BD", "PUD, GERD", "Similar to famotidine"],
]
col_ws_h2 = [2.2, 1.8, 2.0, 3.2, 3.3]
col_xs_h2 = [0.25, 2.45, 4.25, 6.25, 9.45]
y = 1.72
add_rect(slide, 0.25, y, 12.83, 0.35, MED_BLUE)
for j, h in enumerate(h2_data[0]):
add_textbox(slide, col_xs_h2[j] + 0.04, y + 0.03, col_ws_h2[j] - 0.08, 0.28,
h, font_size=11, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.35
for i, row in enumerate(h2_data[1:]):
rh = 0.52
add_rect(slide, 0.25, y, 12.83, rh, row_c[i % 2])
for j, cell in enumerate(row):
add_textbox(slide, col_xs_h2[j] + 0.04, y + 0.04, col_ws_h2[j] - 0.08,
rh - 0.08, cell, font_size=10.5 if j > 0 else 11.5,
bold=(j == 0), color=DARK_TEXT, v_anchor=MSO_ANCHOR.MIDDLE)
y += rh
# H3 and H4 boxes
y += 0.15
add_rect(slide, 0.25, y, 6.2, 1.75, LIGHT_BLUE)
add_rect(slide, 0.25, y, 6.2, 0.4, DARK_BLUE)
add_textbox(slide, 0.35, y + 0.02, 6.0, 0.36, "H3 BLOCKERS",
font_size=13, bold=True, color=WHITE)
h3_text = ("Pitolisant (Wakix) — approved for narcolepsy. H3 receptors are pre-synaptic "
"autoreceptors that inhibit histamine release. Blocking H3 increases wakefulness. "
"Also studied in ADHD, Alzheimer's disease.")
add_textbox(slide, 0.35, y + 0.45, 6.0, 1.25, h3_text,
font_size=10.5, color=DARK_TEXT, word_wrap=True)
add_rect(slide, 6.9, y, 6.18, 1.75, GREEN_LIGHT)
add_rect(slide, 6.9, y, 6.18, 0.4, GREEN_DARK)
add_textbox(slide, 7.0, y + 0.02, 5.98, 0.36, "H4 BLOCKERS",
font_size=13, bold=True, color=WHITE)
h4_text = ("H4 receptor antagonists are still investigational. H4 receptors are expressed on "
"eosinophils, mast cells, and basophils — key in allergic inflammation and pruritus. "
"JNJ7777120 is a research compound under study.")
add_textbox(slide, 7.0, y + 0.45, 5.98, 1.25, h4_text,
font_size=10.5, color=DARK_TEXT, word_wrap=True)
# ═══════════════════════════════════════════════════════════════
# SLIDE 11 — SUMMARY / KEY TAKEAWAYS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
add_rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE)
slide_footer(slide)
add_rect(slide, 0, 0, 13.333, 1.0, MED_BLUE)
add_textbox(slide, 0.3, 0.1, 12.7, 0.8, "Key Takeaways — Antihistamines",
font_size=32, bold=True, color=WHITE, align=PP_ALIGN.CENTER,
v_anchor=MSO_ANCHOR.MIDDLE)
takeaways = [
("Classification", "H1 (1st & 2nd gen) | H2 | H3 | H4 blockers — each with distinct receptor targets & clinical roles"),
("1st Gen MOA", "Inverse agonists at H1; also block M, α1, 5-HT receptors → sedation & anticholinergic effects"),
("2nd Gen MOA", "Selective H1 inverse agonists; polar molecules; poor BBB penetration → non-sedating, once-daily dosing"),
("Key Side Effects", "CNS: sedation; Anticholinergic: dry mouth, urinary retention, blurred vision; Cardiac: QT prolongation (1st gen)"),
("Key CIs", "Narrow-angle glaucoma, concurrent MAOIs, infants < 2 yrs (promethazine), prostatic hypertrophy"),
("Drug of Choice — Allergy", "Allergic rhinitis/urticaria: 2nd gen (fexofenadine, loratadine, cetirizine)"),
("Drug of Choice — Motion Sickness", "Meclizine or promethazine (must be pre-emptive); scopolamine is 1st choice"),
("Drug of Choice — Anaphylaxis", "Epinephrine is ALWAYS 1st line; diphenhydramine IV is adjunct only"),
("H2 Blockers", "Famotidine preferred for PUD/GERD; ranitidine withdrawn; cimetidine has most drug interactions"),
("Remember", "Terfenadine & astemizole (old 2nd gen) were WITHDRAWN due to fatal cardiac arrhythmias (QT/torsades)"),
]
col_xs_tk = [0.3, 2.8]
col_ws_tk = [2.4, 10.0]
y = 1.1
for prop, val in takeaways:
add_rect(slide, 0.3, y, 2.4, 0.54, MED_BLUE)
add_textbox(slide, 0.38, y + 0.04, 2.26, 0.46, prop,
font_size=11, bold=True, color=WHITE, v_anchor=MSO_ANCHOR.MIDDLE)
add_rect(slide, 2.7, y, 10.33, 0.54, RGBColor(0x14, 0x3A, 0x6B))
add_textbox(slide, 2.82, y + 0.04, 10.1, 0.46, val,
font_size=11, color=RGBColor(0xD6, 0xE8, 0xF7), v_anchor=MSO_ANCHOR.MIDDLE)
y += 0.59
# ─── Save ─────────────────────────────────────────────────────
out = "/tmp/workspace/antihistamine-ppt/Antihistamines_Complete.pptx"
buf = BytesIO()
prs.save(buf)
with open(out, "wb") as f:
f.write(buf.getvalue())
print(f"Saved: {out}")
cd /tmp/workspace/antihistamine-ppt && python build_ppt.py 2>&1
python -c " from pptx import Presentation prs = Presentation('/tmp/workspace/antihistamine-ppt/Antihistamines_Complete.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): texts = [s.text_frame.text.strip().split('\n')[0][:60] for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] if texts: print(f' Slide {i}: {texts[0]}') "
Antihistamines Complete
Presentation · PPTX
| # | Slide | Content |
|---|---|---|
| 1 | Title Slide | Topic overview with all 6 sections highlighted |
| 2 | Histamine Receptors Overview | H1/H2/H3/H4 — location, effects, blockers in a color-coded table |
| 3 | Classification of H1 Antihistamines | Side-by-side: 6 chemical groups of 1st gen vs. 8 drugs of 2nd gen |
| 4 | 1st Generation Drugs (Detailed) | Table: 9 drugs with class, route, and key features |
| 5 | 2nd Generation Drugs (Detailed) | Table: 9 drugs with dose, half-life, sedation level, and notes |
| 6 | Mechanism of Action | Inverse agonism, Gq/11 pathway, mast cell stabilization + 1st vs 2nd gen comparison |
| 7 | Side Effects | 5 color-coded panels: CNS, Anticholinergic, Cardiovascular, GI, Other |
| 8 | Contraindications & Precautions | Absolute CIs (glaucoma, MAOIs, infants) + 10 relative precautions |
| 9 | Drug of Choice | 13 conditions mapped to DOC with alternatives (allergic rhinitis, anaphylaxis, pregnancy, pediatrics, etc.) |
| 10 | H2 / H3 / H4 Blockers | H2 table (cimetidine, famotidine, etc.) + H3 (pitolisant) + H4 (investigational) |
| 11 | Key Takeaways | 10-point summary table for rapid revision |
Increase the font size and create a ppt
~/antihistamine-ppt/build_ppt_v2.py
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from io import BytesIO
# ── Color Palette ──────────────────────────────────────────────
DARK_BLUE = RGBColor(0x0D, 0x2B, 0x55)
MED_BLUE = RGBColor(0x1A, 0x6B, 0xAA)
LIGHT_BLUE = RGBColor(0xD6, 0xE8, 0xF7)
TEAL = RGBColor(0x00, 0x7B, 0x83)
WHITE = RGBColor(0xFF, 0xFF, 0xFF)
DARK_TEXT = RGBColor(0x1A, 0x1A, 0x2E)
YELLOW_BG = RGBColor(0xFF, 0xF3, 0xCD)
GREEN_DARK = RGBColor(0x1B, 0x6B, 0x3A)
GREEN_LIGHT = RGBColor(0xD4, 0xED, 0xDA)
RED_DARK = RGBColor(0x7B, 0x1A, 0x1A)
RED_LIGHT = RGBColor(0xF8, 0xD7, 0xDA)
ORANGE = RGBColor(0xE8, 0x7B, 0x1E)
AMBER = RGBColor(0xB8, 0x76, 0x0C)
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]
# ── Helpers ────────────────────────────────────────────────────
def rect(slide, x, y, w, h, fill, line=None):
s = slide.shapes.add_shape(1, Inches(x), Inches(y), Inches(w), Inches(h))
s.fill.solid(); s.fill.fore_color.rgb = fill
if line: s.line.color.rgb = line
else: s.line.fill.background()
return s
def tb(slide, x, y, w, h, text, fs, bold=False, color=DARK_TEXT,
align=PP_ALIGN.LEFT, italic=False, wrap=True, va=MSO_ANCHOR.TOP):
t = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
tf = t.text_frame; tf.word_wrap = wrap; tf.vertical_anchor = va
tf.margin_left = tf.margin_right = tf.margin_top = tf.margin_bottom = 0
p = tf.paragraphs[0]; p.alignment = align
r = p.add_run(); r.text = text
r.font.size = Pt(fs); r.font.bold = bold; r.font.italic = italic
r.font.color.rgb = color; r.font.name = "Calibri"
return t
def header(slide, title, sub=None):
rect(slide, 0, 0, 13.333, 1.15, DARK_BLUE)
rect(slide, 0, 1.15, 13.333, 0.07, TEAL)
tb(slide, 0.35, 0.1, 12.6, 0.95, title, 34, bold=True,
color=WHITE, align=PP_ALIGN.LEFT, va=MSO_ANCHOR.MIDDLE)
if sub:
tb(slide, 0.35, 0.82, 12.6, 0.38, sub, 16,
color=RGBColor(0xAD, 0xD8, 0xE6), align=PP_ALIGN.LEFT)
def footer(slide, note="Antihistamines — Pharmacology Overview"):
rect(slide, 0, 7.25, 13.333, 0.25, DARK_BLUE)
tb(slide, 0.3, 7.265, 12.7, 0.2, note, 9,
color=RGBColor(0xAA, 0xCC, 0xEE), align=PP_ALIGN.LEFT)
def bg(slide):
rect(slide, 0, 0, 13.333, 7.5, RGBColor(0xF4, 0xF7, 0xFB))
ROW_C = [LIGHT_BLUE, WHITE]
# ═══════════════════════════════════════════════════════════════
# SLIDE 1 — TITLE
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE)
rect(slide, 0, 3.3, 13.333, 0.1, TEAL)
rect(slide, 0, 5.6, 13.333, 1.9, MED_BLUE)
tb(slide, 0.8, 0.7, 11.7, 1.4, "ANTIHISTAMINES",
60, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
tb(slide, 0.8, 2.1, 11.7, 0.8,
"A Comprehensive Pharmacological Overview",
26, color=RGBColor(0xAD, 0xD8, 0xE6), align=PP_ALIGN.CENTER)
tb(slide, 0.8, 2.85, 11.7, 0.5,
"Classification | Drugs | Mechanism of Action | Side Effects | Contraindications | Drug of Choice",
17, italic=True, color=RGBColor(0x90, 0xC8, 0xF0), align=PP_ALIGN.CENTER)
topics = ["Classification", "Drug List", "Mechanism\nof Action",
"Side\nEffects", "Contra-\nindications", "Drug of\nChoice"]
bw = 13.333 / 6
for i, t_text in enumerate(topics):
x = i * bw
rect(slide, x+0.03, 5.65, bw-0.06, 1.75, MED_BLUE)
tb(slide, x+0.08, 5.75, bw-0.16, 1.55, t_text,
17, bold=True, color=WHITE, align=PP_ALIGN.CENTER, wrap=True)
footer(slide)
# ═══════════════════════════════════════════════════════════════
# SLIDE 2 — HISTAMINE RECEPTORS OVERVIEW
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide); header(slide, "Histamine Receptors — Overview"); footer(slide)
cols = ["Receptor", "Location", "Effects When Activated", "Blocker"]
cw = [1.6, 3.1, 4.9, 3.0]
cx = [0.25, 1.85, 4.95, 9.85]
rows = [
["H1", "Smooth muscle, endothelium,\nbrain, skin mast cells",
"Bronchoconstriction, vasodilation,\nitch, allergic symptoms",
"1st & 2nd gen\nAntihistamines"],
["H2", "Gastric parietal cells,\nheart, uterus",
"Gastric acid secretion,\ntachycardia",
"Cimetidine\nFamotidine"],
["H3", "Pre-synaptic neurons\n(CNS & PNS)",
"Modulates neurotransmitter\nrelease (histamine, NE, DA)",
"Pitolisant\n(narcolepsy)"],
["H4", "Bone marrow,\neosinophils, mast cells",
"Eosinophil chemotaxis,\nimmune modulation",
"Investigational\nagents"],
]
y = 1.32
rect(slide, 0.25, y, 12.85, 0.52, DARK_BLUE)
for j, h in enumerate(cols):
tb(slide, cx[j]+0.06, y+0.06, cw[j]-0.12, 0.4,
h, 16, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.52
for i, row in enumerate(rows):
rh = 1.3
rect(slide, 0.25, y, 12.85, rh, ROW_C[i % 2])
for j, cell in enumerate(row):
fs = 17 if j == 0 else 14
bold = (j == 0)
tb(slide, cx[j]+0.06, y+0.08, cw[j]-0.12, rh-0.16,
cell, fs, bold=bold, color=DARK_TEXT,
align=PP_ALIGN.CENTER, va=MSO_ANCHOR.MIDDLE, wrap=True)
y += rh
tb(slide, 0.3, 6.72, 12.7, 0.45,
"Note: 'Antihistamine' in clinical practice = H1 blocker unless specified. Epinephrine (not antihistamines) is 1st-line in anaphylaxis.",
13, italic=True, color=MED_BLUE)
# ═══════════════════════════════════════════════════════════════
# SLIDE 3 — CLASSIFICATION (1st Gen Groups)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Classification — First Generation H1 Antihistamines",
"Sedating / Classical — cross the blood-brain barrier")
footer(slide)
rect(slide, 0.25, 1.28, 12.83, 0.52, MED_BLUE)
tb(slide, 0.35, 1.3, 12.6, 0.48,
"6 Chemical Groups (Based on Structure)",
20, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
gen1 = [
("Ethanolamines", "Diphenhydramine, Dimenhydrinate, Clemastine"),
("Ethylenediamines", "Tripelennamine, Pyrilamine, Antazoline"),
("Alkylamines", "Chlorpheniramine, Brompheniramine, Triprolidine"),
("Phenothiazines", "Promethazine, Trimeprazine (Alimemazine)"),
("Piperazines", "Hydroxyzine, Cyclizine, Meclizine, Buclizine"),
("Piperidines (1st)", "Cyproheptadine, Ketotifen, Azatadine"),
]
# 2 columns × 3 rows
col_positions = [0.25, 6.65]
for idx, (grp, drugs) in enumerate(gen1):
col = idx % 2
row = idx // 2
x = col_positions[col]
y = 1.9 + row * 1.72
rect(slide, x, y, 6.2, 1.62, WHITE)
rect(slide, x, y, 6.2, 0.46, DARK_BLUE)
tb(slide, x+0.12, y+0.06, 5.96, 0.38,
grp, 17, bold=True, color=WHITE)
tb(slide, x+0.12, y+0.52, 5.96, 1.0,
drugs, 15, color=DARK_TEXT, wrap=True)
# ═══════════════════════════════════════════════════════════════
# SLIDE 4 — CLASSIFICATION (2nd Gen)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Classification — Second Generation H1 Antihistamines",
"Non-sedating / Selective — peripheral H1 only, once-daily dosing")
footer(slide)
rect(slide, 0.25, 1.28, 12.83, 0.52, TEAL)
tb(slide, 0.35, 1.3, 12.6, 0.48,
"Key Second-Generation Agents",
20, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
gen2 = [
("Fexofenadine", "180 mg OD", "None", "Least sedating; renal excretion; safe for pilots/drivers"),
("Loratadine", "10 mg OD", "Minimal", "Pro-drug; CYP3A4/2D6 metabolism"),
("Desloratadine", "5 mg OD", "None", "Active metabolite of loratadine; potent"),
("Cetirizine", "10 mg OD", "Mild (~10%)", "Metabolite of hydroxyzine; also antipruritic"),
("Levocetirizine", "5 mg OD", "Mild", "R-enantiomer of cetirizine; more potent"),
("Bilastine", "20 mg OD", "None", "Not metabolized; avoid food (reduces absorption)"),
("Rupatadine", "10 mg OD", "Low", "H1 + PAF antagonist; metabolized → desloratadine"),
("Ebastine", "10–20 mg OD", "Low", "Long-acting; converted to carebastine"),
]
cols2 = ["Drug", "Dose", "Sedation", "Key Notes"]
cw2 = [2.5, 1.9, 1.9, 6.3]
cx2 = [0.25, 2.75, 4.65, 6.55]
y = 1.88
rect(slide, 0.25, y, 12.58, 0.44, DARK_BLUE)
for j, h in enumerate(cols2):
tb(slide, cx2[j]+0.06, y+0.05, cw2[j]-0.12, 0.34,
h, 15, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.44
sed_c = {"None": GREEN_DARK, "Minimal": TEAL, "Mild (~10%)": AMBER,
"Mild": AMBER, "Low": TEAL}
for i, row in enumerate(gen2):
rh = 0.6
rect(slide, 0.25, y, 12.58, rh, ROW_C[i % 2])
for j, cell in enumerate(row):
if j == 2:
c = sed_c.get(cell, DARK_TEXT)
tb(slide, cx2[j]+0.06, y+0.08, cw2[j]-0.12, rh-0.16,
cell, 14, bold=True, color=c,
align=PP_ALIGN.CENTER, va=MSO_ANCHOR.MIDDLE)
else:
tb(slide, cx2[j]+0.06, y+0.08, cw2[j]-0.12, rh-0.16,
cell, 14 if j > 0 else 15, bold=(j == 0), color=DARK_TEXT,
align=PP_ALIGN.CENTER if j < 3 else PP_ALIGN.LEFT,
va=MSO_ANCHOR.MIDDLE, wrap=True)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 5 — FIRST-GEN DRUG TABLE
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "First-Generation H1 Antihistamines — Key Drugs")
footer(slide)
fgt = [
["Diphenhydramine", "Ethanolamine", "Oral/IV/IM/Topical", "Allergy, motion sickness, sleep aid, anaphylaxis adjunct"],
["Dimenhydrinate", "Ethanolamine", "Oral/IM/IV", "Motion sickness (Dramamine)"],
["Promethazine", "Phenothiazine", "Oral/IM/IV", "Nausea, vomiting, pre-anesthesia, sedation"],
["Chlorpheniramine", "Alkylamine", "Oral", "Allergic rhinitis — least sedating 1st-gen"],
["Hydroxyzine", "Piperazine", "Oral/IM", "Urticaria, anxiety, pre-op sedation"],
["Meclizine", "Piperazine", "Oral", "Motion sickness, vertigo"],
["Cyproheptadine", "Piperidine", "Oral", "Urticaria, appetite stimulant, serotonin antagonist"],
["Ketotifen", "Piperidine", "Oral/Ophthalmic", "Allergic conjunctivitis, mast cell stabilizer"],
]
cw_fg = [2.8, 2.3, 2.4, 5.0]
cx_fg = [0.25, 3.05, 5.35, 7.75]
cols_fg = ["Drug", "Chemical Class", "Route", "Key Feature / Use"]
y = 1.32
rect(slide, 0.25, y, 12.75, 0.48, DARK_BLUE)
for j, h in enumerate(cols_fg):
tb(slide, cx_fg[j]+0.06, y+0.06, cw_fg[j]-0.12, 0.36,
h, 16, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.48
for i, row in enumerate(fgt):
rh = 0.67
rect(slide, 0.25, y, 12.75, rh, ROW_C[i % 2])
for j, cell in enumerate(row):
tb(slide, cx_fg[j]+0.06, y+0.06, cw_fg[j]-0.12, rh-0.12,
cell, 15 if j == 0 else 13, bold=(j == 0), color=DARK_TEXT,
align=PP_ALIGN.CENTER if j < 3 else PP_ALIGN.LEFT,
va=MSO_ANCHOR.MIDDLE, wrap=True)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 6 — MECHANISM OF ACTION (Part 1)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Mechanism of Action — Core Concepts")
footer(slide)
moa_pts = [
("Inverse Agonists, NOT Simple Antagonists",
"H1 antihistamines bind and STABILIZE the inactive conformation of the H1 receptor. They shift the equilibrium toward the inactive state, suppressing constitutive receptor activity."),
("H1 Receptor is a GPCR (Gq/11)",
"Histamine activates H1 → Gq/11 → PLC → IP3 → ↑intracellular Ca²⁺ → bronchoconstriction, vasodilation, itch, increased capillary permeability. Antihistamines BLOCK all of these downstream effects."),
("Anti-inflammatory Effects Beyond Receptor Blockade",
"H1 antihistamines reduce pro-inflammatory cytokine production, downregulate ICAM-1 (cell adhesion molecule) expression on keratinocytes, and inhibit eosinophil chemotaxis."),
("Mast Cell Stabilization (Azelastine, Ketotifen)",
"These agents additionally inhibit Ca²⁺ influx into mast cells → reduced degranulation → less histamine, leukotrienes & prostaglandins released."),
]
y = 1.32
for title, body in moa_pts:
rect(slide, 0.3, y, 12.73, 0.4, MED_BLUE)
tb(slide, 0.45, y+0.04, 12.43, 0.34, title, 17, bold=True, color=WHITE)
rect(slide, 0.3, y+0.4, 12.73, 0.72, WHITE)
tb(slide, 0.45, y+0.44, 12.43, 0.64, body, 15, color=DARK_TEXT, wrap=True)
y += 1.2
# ═══════════════════════════════════════════════════════════════
# SLIDE 7 — MECHANISM: 1st vs 2nd Gen Comparison
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Mechanism — 1st Generation vs 2nd Generation")
footer(slide)
comparison = [
("Property", "1st Generation", "2nd Generation"),
("BBB Penetration", "HIGH — lipophilic", "LOW — polar/charged"),
("Receptor Selectivity", "H1 + Muscarinic (M1/M2),\nα1-adrenergic, Serotonin", "H1 only (highly selective)"),
("Binding Kinetics", "Competitive / Reversible", "Non-competitive\n(slow dissociation, longer effect)"),
("Sedation", "Marked (blocks CNS histamine)", "Minimal to none"),
("Duration of Action", "4–6 hours (most)", "12–24 hours (once daily)"),
("Anticholinergic SE", "Present (dry mouth, urinary retention)", "Absent"),
("Hepatic Metabolism", "Extensive CYP450", "Minimal / renal excretion"),
("Tachyphylaxis", "None", "None"),
]
cw_c = [3.5, 4.4, 4.7]
cx_c = [0.25, 3.75, 8.15]
y = 1.32
rect(slide, 0.25, y, 12.85, 0.5, DARK_BLUE)
for j, h in enumerate(comparison[0]):
tb(slide, cx_c[j]+0.08, y+0.06, cw_c[j]-0.16, 0.38,
h, 17, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.5
for i, row in enumerate(comparison[1:]):
rh = 0.67
rect(slide, 0.25, y, 12.85, rh, ROW_C[i % 2])
tb(slide, cx_c[0]+0.08, y+0.06, cw_c[0]-0.16, rh-0.12,
row[0], 16, bold=True, color=DARK_BLUE, va=MSO_ANCHOR.MIDDLE)
tb(slide, cx_c[1]+0.08, y+0.06, cw_c[1]-0.16, rh-0.12,
row[1], 14, color=RED_DARK, align=PP_ALIGN.CENTER,
va=MSO_ANCHOR.MIDDLE, wrap=True)
tb(slide, cx_c[2]+0.08, y+0.06, cw_c[2]-0.16, rh-0.12,
row[2], 14, color=GREEN_DARK, align=PP_ALIGN.CENTER,
va=MSO_ANCHOR.MIDDLE, wrap=True)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 8 — SIDE EFFECTS (Part 1: CNS + Anticholinergic)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Side Effects — CNS & Anticholinergic Effects",
"Predominantly 1st-generation antihistamines")
footer(slide)
# CNS panel (left)
rect(slide, 0.25, 1.28, 6.15, 5.9, RED_LIGHT)
rect(slide, 0.25, 1.28, 6.15, 0.52, RED_DARK)
tb(slide, 0.35, 1.3, 5.95, 0.48,
"CNS EFFECTS (mainly 1st gen)", 19, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
cns_items = [
"Sedation & drowsiness (MOST COMMON)",
"Dizziness, lack of coordination",
"Fatigue, cognitive impairment",
"Paradoxical excitation in children",
"Tremors, restlessness (high doses)",
"Insomnia (paradoxical at toxic doses)",
"Elderly: increased fall risk, confusion",
]
y = 1.88
for item in cns_items:
t_obj = slide.shapes.add_textbox(Inches(0.42), Inches(y), Inches(5.82), Inches(0.68))
tf = t_obj.text_frame; tf.word_wrap = True
tf.margin_left = Pt(3); tf.margin_right = Pt(3)
tf.margin_top = Pt(2); tf.margin_bottom = Pt(2)
p = tf.paragraphs[0]
r1 = p.add_run(); r1.text = "• "; r1.font.size = Pt(16)
r1.font.color.rgb = RED_DARK; r1.font.name = "Calibri"
r2 = p.add_run(); r2.text = item; r2.font.size = Pt(15)
r2.font.color.rgb = DARK_TEXT; r2.font.name = "Calibri"
y += 0.7
# Anticholinergic panel (right)
rect(slide, 6.75, 1.28, 6.33, 5.9, YELLOW_BG)
rect(slide, 6.75, 1.28, 6.33, 0.52, AMBER)
tb(slide, 6.85, 1.3, 6.13, 0.48,
"ANTICHOLINERGIC EFFECTS (1st gen)", 19, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
ach_items = [
"Dry mouth (xerostomia)",
"Urinary retention (↑ in BPH)",
"Blurred vision (mydriasis)",
"Constipation",
"Tachycardia",
"Confusion / delirium (elderly)",
"Thick respiratory secretions",
]
y = 1.88
for item in ach_items:
t_obj = slide.shapes.add_textbox(Inches(6.92), Inches(y), Inches(5.9), Inches(0.68))
tf = t_obj.text_frame; tf.word_wrap = True
tf.margin_left = Pt(3); tf.margin_right = Pt(3)
tf.margin_top = Pt(2); tf.margin_bottom = Pt(2)
p = tf.paragraphs[0]
r1 = p.add_run(); r1.text = "• "; r1.font.size = Pt(16)
r1.font.color.rgb = AMBER; r1.font.name = "Calibri"
r2 = p.add_run(); r2.text = item; r2.font.size = Pt(15)
r2.font.color.rgb = DARK_TEXT; r2.font.name = "Calibri"
y += 0.7
# ═══════════════════════════════════════════════════════════════
# SLIDE 9 — SIDE EFFECTS (Part 2: CV + GI + Other)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Side Effects — Cardiovascular, GI & Other")
footer(slide)
panels = [
{
"title": "CARDIOVASCULAR",
"hc": RGBColor(0x5A, 0x00, 0x7A),
"bg": RGBColor(0xF3, 0xE5, 0xF5),
"items": [
"Postural hypotension (α1 blockade)",
"Prolonged QT interval (1st gen)",
"Ventricular arrhythmias",
"Torsades de pointes (rare)",
"Terfenadine & Astemizole — WITHDRAWN for fatal arrhythmias",
]
},
{
"title": "GI EFFECTS",
"hc": GREEN_DARK,
"bg": GREEN_LIGHT,
"items": [
"Nausea & vomiting",
"Epigastric distress",
"Diarrhea or constipation",
"Anorexia",
]
},
{
"title": "OTHER EFFECTS",
"hc": MED_BLUE,
"bg": LIGHT_BLUE,
"items": [
"Headache (most common with 2nd gen)",
"Contact dermatitis (topical diphenhydramine)",
"Photosensitivity (promethazine)",
"Weight gain / appetite ↑ (cyproheptadine)",
"Potentiates CNS depressants & alcohol",
"MAOIs — severe interaction (hypertensive crisis)",
]
},
]
px = [0.25, 4.45, 8.65]
pw = 4.15
for i, panel in enumerate(panels):
x = px[i]
rect(slide, x, 1.28, pw, 5.9, panel["bg"])
rect(slide, x, 1.28, pw, 0.52, panel["hc"])
tb(slide, x+0.1, 1.3, pw-0.2, 0.48,
panel["title"], 18, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y = 1.88
for item in panel["items"]:
t_obj = slide.shapes.add_textbox(
Inches(x+0.15), Inches(y), Inches(pw-0.3), Inches(0.78))
tf = t_obj.text_frame; tf.word_wrap = True
tf.margin_left = Pt(2); tf.margin_right = Pt(2)
tf.margin_top = Pt(2); tf.margin_bottom = Pt(2)
p = tf.paragraphs[0]
r1 = p.add_run(); r1.text = "▶ "; r1.font.size = Pt(13)
r1.font.color.rgb = panel["hc"]; r1.font.name = "Calibri"
r2 = p.add_run(); r2.text = item; r2.font.size = Pt(14)
r2.font.color.rgb = DARK_TEXT; r2.font.name = "Calibri"
y += 0.82
# ═══════════════════════════════════════════════════════════════
# SLIDE 10 — CONTRAINDICATIONS (Absolute)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Contraindications — Absolute",
"Conditions where 1st-generation antihistamines must NOT be used")
footer(slide)
abs_ci = [
("Narrow-Angle Glaucoma",
"Anticholinergic effects → mydriasis → ↑ intraocular pressure → may precipitate acute angle-closure attack."),
("Concurrent MAOI Use",
"MAOIs inhibit histamine breakdown. Combination causes severe hypertensive crisis and risk of serotonin syndrome."),
("Infants < 2 Years / Premature Neonates",
"Risk of fatal CNS/respiratory depression. Promethazine carries a BLACK BOX WARNING — contraindicated in children < 2 years."),
("Hypersensitivity to the Drug",
"Known allergy to the specific antihistamine or its structural class (cross-sensitivity within groups possible)."),
]
y = 1.32
for title, body in abs_ci:
rect(slide, 0.3, y, 12.73, 0.45, RED_DARK)
tb(slide, 0.45, y+0.05, 12.43, 0.38, f"✖ {title}", 18, bold=True, color=WHITE)
rect(slide, 0.3, y+0.45, 12.73, 0.82, RED_LIGHT)
tb(slide, 0.45, y+0.5, 12.43, 0.72, body, 15, color=DARK_TEXT, wrap=True)
y += 1.38
# ═══════════════════════════════════════════════════════════════
# SLIDE 11 — CONTRAINDICATIONS (Precautions)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Contraindications — Precautions / Use with Caution")
footer(slide)
rel_ci = [
("Prostatic Hypertrophy / Bladder Neck Obstruction",
"Anticholinergic effects → urinary retention. Avoid 1st-gen agents."),
("Pregnancy (1st Trimester)",
"1st-gen: avoid. Loratadine & cetirizine (Category B) are relatively safer options."),
("Elderly Patients",
"Highly sensitive to CNS & anticholinergic effects: falls, confusion, urinary retention (Beers Criteria — avoid 1st-gen)."),
("Hepatic Impairment",
"Loratadine, desloratadine require dose adjustment. Prolonged half-life."),
("Renal Impairment",
"Cetirizine, levocetirizine, fexofenadine require dose reduction (renally excreted)."),
("QT Prolongation / Cardiac Arrhythmias",
"Avoid 1st-gen agents. Monitor ECG. Terfenadine/astemizole were withdrawn for this reason."),
("CNS Depressants / Alcohol",
"1st-gen antihistamines potentiate sedation. Combination dangerous."),
("Pyloroduodenal Obstruction",
"Anticholinergic slowing of GI motility worsens obstruction."),
]
col_x_rel = [0.25, 6.75]
col_w_rel = 6.35
y_left = y_right = 1.32
for i, (title, body) in enumerate(rel_ci):
if i % 2 == 0:
x = col_x_rel[0]; y_use = y_left
else:
x = col_x_rel[1]; y_use = y_right
rh_h = 0.38; rh_b = 0.58
rect(slide, x, y_use, col_w_rel, rh_h, AMBER)
tb(slide, x+0.1, y_use+0.03, col_w_rel-0.2, rh_h-0.06,
f"⚠ {title}", 14, bold=True, color=WHITE, wrap=True)
rect(slide, x, y_use+rh_h, col_w_rel, rh_b, YELLOW_BG)
tb(slide, x+0.1, y_use+rh_h+0.05, col_w_rel-0.2, rh_b-0.1,
body, 13, color=DARK_TEXT, wrap=True)
step = rh_h + rh_b + 0.1
if i % 2 == 0: y_left += step
else: y_right += step
# ═══════════════════════════════════════════════════════════════
# SLIDE 12 — DRUG OF CHOICE (Part 1)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Drug of Choice — Part 1")
footer(slide)
doc1 = [
["Condition", "Drug of Choice", "Notes"],
["Allergic Rhinitis", "Fexofenadine or Loratadine\n(2nd generation)", "Intranasal corticosteroids most effective overall. AH controls rhinorrhea, itch, sneezing — not congestion."],
["Acute Urticaria", "Cetirizine or Loratadine", "Add H2 blocker (famotidine) for refractory cases. Avoid triggers."],
["Chronic Spontaneous\nUrticaria", "2nd-gen H1 AH up to 4× dose\n(cetirizine/loratadine/bilastine)", "Omalizumab if no response at 4 wks. Avoid 1st-gen as routine."],
["Motion Sickness", "Meclizine, Promethazine,\nor Dimenhydrinate", "Must be given BEFORE symptoms. Scopolamine (anticholinergic) is overall 1st choice."],
["Allergic Conjunctivitis", "Olopatadine or Azelastine\n(ophthalmic drops)", "Ketotifen — dual H1 block + mast cell stabilizer. Rapid onset."],
["Nausea / Vomiting", "Promethazine", "Most potent antihistamine antiemetic. IV/IM available."],
]
cw_d1 = [3.0, 3.8, 5.95]
cx_d1 = [0.2, 3.2, 7.0]
y = 1.32
rect(slide, 0.2, y, 12.93, 0.48, DARK_BLUE)
for j, h in enumerate(doc1[0]):
tb(slide, cx_d1[j]+0.07, y+0.06, cw_d1[j]-0.14, 0.36,
h, 17, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.48
for i, row in enumerate(doc1[1:]):
rh = 0.83
rect(slide, 0.2, y, 12.93, rh, ROW_C[i % 2])
tb(slide, cx_d1[0]+0.07, y+0.07, cw_d1[0]-0.14, rh-0.14,
row[0], 15, bold=True, color=DARK_BLUE, va=MSO_ANCHOR.MIDDLE, wrap=True)
tb(slide, cx_d1[1]+0.07, y+0.07, cw_d1[1]-0.14, rh-0.14,
row[1], 14, bold=True, color=TEAL, va=MSO_ANCHOR.MIDDLE, wrap=True)
tb(slide, cx_d1[2]+0.07, y+0.07, cw_d1[2]-0.14, rh-0.14,
row[2], 13, color=DARK_TEXT, va=MSO_ANCHOR.MIDDLE, wrap=True)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 13 — DRUG OF CHOICE (Part 2)
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "Drug of Choice — Part 2")
footer(slide)
doc2 = [
["Condition", "Drug of Choice", "Notes"],
["Anaphylaxis", "EPINEPHRINE (1st line)\n+ Diphenhydramine (adjunct)", "Antihistamines are ADJUNCT only — NEVER replace epinephrine. Give IM adrenaline first."],
["Pruritus / Itch", "Hydroxyzine at night;\nCetirizine / Levocetirizine daytime", "Sedation of hydroxyzine is therapeutically useful at night."],
["Pre-op Sedation", "Promethazine or Hydroxyzine\n(IM/oral)", "Reduces anxiety, augments anesthesia, antiemetic effect useful."],
["Serotonin Syndrome", "Cyproheptadine\n(4–8 mg oral)", "H1 + 5-HT2 antagonist. Used as adjunct alongside supportive care + benzodiazepines."],
["Appetite Stimulation", "Cyproheptadine\n(4 mg TDS)", "Used in children with failure to thrive. Serotonin antagonism increases appetite."],
["Pregnancy (rhinitis / urticaria)", "Loratadine or Cetirizine\n(Category B)", "Avoid 1st-gen in 1st trimester. 2nd-gen preferred throughout pregnancy."],
["Pediatric Allergies\n(> 2 yrs)", "Cetirizine or Loratadine\n(weight-based dosing)", "AVOID promethazine in < 2 yrs (Black Box Warning — respiratory depression)."],
]
y = 1.32
rect(slide, 0.2, y, 12.93, 0.48, DARK_BLUE)
for j, h in enumerate(doc2[0]):
tb(slide, cx_d1[j]+0.07, y+0.06, cw_d1[j]-0.14, 0.36,
h, 17, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.48
for i, row in enumerate(doc2[1:]):
rh = 0.77
rect(slide, 0.2, y, 12.93, rh, ROW_C[i % 2])
tb(slide, cx_d1[0]+0.07, y+0.06, cw_d1[0]-0.14, rh-0.12,
row[0], 14, bold=True, color=DARK_BLUE, va=MSO_ANCHOR.MIDDLE, wrap=True)
tb(slide, cx_d1[1]+0.07, y+0.06, cw_d1[1]-0.14, rh-0.12,
row[1], 13, bold=True, color=TEAL, va=MSO_ANCHOR.MIDDLE, wrap=True)
tb(slide, cx_d1[2]+0.07, y+0.06, cw_d1[2]-0.14, rh-0.12,
row[2], 12, color=DARK_TEXT, va=MSO_ANCHOR.MIDDLE, wrap=True)
y += rh
# ═══════════════════════════════════════════════════════════════
# SLIDE 14 — H2 BLOCKERS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
bg(slide)
header(slide, "H2 Receptor Blockers (H2 Antihistamines)",
"Used for peptic ulcer disease, GERD, and Zollinger-Ellison syndrome")
footer(slide)
h2t = [
["Drug", "Dose", "Key Uses", "Important Notes"],
["Cimetidine\n(Tagamet)", "400 mg BD\n800 mg OD", "PUD, GERD,\nZollinger-Ellison", "Most drug interactions (CYP1A2/2C9/3A4 inhibitor)\nAnti-androgenic (gynecomastia, impotence)"],
["Ranitidine\n(Zantac)", "150 mg BD", "PUD, GERD", "WITHDRAWN globally 2020\n(NDMA carcinogen contamination)"],
["Famotidine\n(Pepcid)", "20–40 mg OD/BD", "PUD, GERD,\nUrticaria adjunct", "PREFERRED — fewest drug interactions\nNo antiandrogenic effects"],
["Nizatidine\n(Axid)", "150 mg BD", "PUD, GERD", "Similar to famotidine\nMostly replaced by PPIs"],
]
cw_h2 = [2.4, 2.2, 2.8, 5.3]
cx_h2 = [0.2, 2.6, 4.8, 7.6]
y = 1.32
rect(slide, 0.2, y, 12.93, 0.5, TEAL)
for j, h in enumerate(h2t[0]):
tb(slide, cx_h2[j]+0.07, y+0.06, cw_h2[j]-0.14, 0.38,
h, 17, bold=True, color=WHITE, align=PP_ALIGN.CENTER)
y += 0.5
for i, row in enumerate(h2t[1:]):
rh = 1.18
rect(slide, 0.2, y, 12.93, rh, ROW_C[i % 2])
for j, cell in enumerate(row):
tb(slide, cx_h2[j]+0.07, y+0.08, cw_h2[j]-0.14, rh-0.16,
cell, 15 if j == 0 else 14, bold=(j == 0), color=DARK_TEXT,
align=PP_ALIGN.CENTER, va=MSO_ANCHOR.MIDDLE, wrap=True)
y += rh
rect(slide, 0.2, y+0.05, 12.93, 0.55, GREEN_LIGHT)
tb(slide, 0.35, y+0.08, 12.6, 0.45,
"Mechanism: H2 inverse agonists → ↓ cAMP in parietal cells → ↓ H⁺/K⁺-ATPase activation → ↓ gastric acid secretion by ~70%",
14, color=GREEN_DARK, wrap=True)
# ═══════════════════════════════════════════════════════════════
# SLIDE 15 — SUMMARY / KEY TAKEAWAYS
# ═══════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
rect(slide, 0, 0, 13.333, 7.5, DARK_BLUE)
footer(slide)
rect(slide, 0, 0, 13.333, 1.05, MED_BLUE)
tb(slide, 0.3, 0.1, 12.7, 0.85,
"Key Takeaways — Antihistamines",
36, bold=True, color=WHITE, align=PP_ALIGN.CENTER, va=MSO_ANCHOR.MIDDLE)
takeaways = [
("Classification", "H1 (1st & 2nd gen), H2, H3, H4 — distinct receptors, locations & clinical roles"),
("1st Gen MOA", "Inverse agonist at H1 + block M, α1, 5-HT → sedation & anticholinergic effects"),
("2nd Gen MOA", "Selective H1 inverse agonist; polar → no BBB crossing → non-sedating; once daily"),
("Key Side Effects", "CNS: sedation | Anticholinergic: dry mouth, urinary retention | Cardiac: QT ↑"),
("Key CIs", "Narrow-angle glaucoma, MAOIs, infants < 2 yrs (promethazine), prostatic hypertrophy"),
("DOC — Allergy", "Allergic rhinitis/urticaria → 2nd gen (fexofenadine, loratadine, cetirizine)"),
("DOC — Motion Sickness", "Meclizine / Promethazine (pre-emptive). Scopolamine = overall 1st choice"),
("DOC — Anaphylaxis", "Epinephrine ALWAYS 1st line. Diphenhydramine IV = adjunct only"),
("H2 Blockers", "Famotidine preferred for PUD/GERD. Ranitidine withdrawn. Cimetidine = most interactions"),
("Safety Alert", "Terfenadine & Astemizole WITHDRAWN — fatal QT prolongation / torsades de pointes"),
]
y = 1.12
for prop, val in takeaways:
rect(slide, 0.3, y, 3.0, 0.56, MED_BLUE)
tb(slide, 0.4, y+0.05, 2.85, 0.46, prop,
14, bold=True, color=WHITE, va=MSO_ANCHOR.MIDDLE)
rect(slide, 3.3, y, 9.8, 0.56, RGBColor(0x14, 0x3A, 0x6B))
tb(slide, 3.42, y+0.05, 9.62, 0.46, val,
13, color=RGBColor(0xD6, 0xE8, 0xF7), va=MSO_ANCHOR.MIDDLE, wrap=True)
y += 0.6
# ─── Save ─────────────────────────────────────────────────────
out = "/tmp/workspace/antihistamine-ppt/Antihistamines_LargeFonts.pptx"
buf = BytesIO()
prs.save(buf)
with open(out, "wb") as f:
f.write(buf.getvalue())
print(f"Saved: {out}")
cd /tmp/workspace/antihistamine-ppt && python build_ppt_v2.py 2>&1
python -c " from pptx import Presentation prs = Presentation('/tmp/workspace/antihistamine-ppt/Antihistamines_LargeFonts.pptx') print(f'Total slides: {len(prs.slides)}') for i, slide in enumerate(prs.slides, 1): texts = [s.text_frame.text.strip().split('\n')[0][:65] for s in slide.shapes if s.has_text_frame and s.text_frame.text.strip()] if texts: print(f' Slide {i:02d}: {texts[0]}') "
Antihistamines LargeFonts
Presentation · PPTX
| Element | Before | After |
|---|---|---|
| Header title font | 30 pt | 34 pt |
| Table header text | 12–13 pt | 15–17 pt |
| Table body text | 10–11 pt | 13–15 pt |
| Bullet point text | 10 pt | 15–16 pt |
| Section heading boxes | 11–14 pt | 17–20 pt |
| Slide count | 11 slides | 15 slides (content split across more slides so larger fonts still fit) |