attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment

Create a ppt on hyponatremia with 18-20 slides using this harrison 22 edition pictures as reference Also include a slide of normal sodium and water physiology related to this topic in the beginning Dont include slides like presentation outline,clinical case vignette,key clinical pearls Include a thank you slide at the end as a 21st slide

analyse_media
analyse_media
analyse_media
analyse_media
analyse_media
analyse_media
Reading File
Running Command

mkdir -p /tmp/workspace/hyponatremia-ppt && ls /tmp/workspace/hyponatremia-ppt/

Writing File

~/hyponatremia-ppt/create_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
from pptx.util import Inches, Pt
import json, subprocess, base64
from io import BytesIO

# ── Colour palette ──────────────────────────────────────────────────────────
NAVY      = RGBColor(0x10, 0x30, 0x6A)   # slide title bar
TEAL      = RGBColor(0x00, 0x7A, 0x8A)   # section accents / header cells
LIGHT_BG  = RGBColor(0xEF, 0xF4, 0xFB)   # slide background
WHITE     = RGBColor(0xFF, 0xFF, 0xFF)
BLACK     = RGBColor(0x1A, 0x1A, 0x2E)
GOLD      = RGBColor(0xF0, 0xA5, 0x00)
LIGHT_TEAL= RGBColor(0xCC, 0xEB, 0xEF)
MED_BLUE  = RGBColor(0x1A, 0x6F, 0xB5)
RED       = RGBColor(0xC0, 0x20, 0x20)

SLIDE_W = Inches(13.33)
SLIDE_H = Inches(7.5)

prs = Presentation()
prs.slide_width  = SLIDE_W
prs.slide_height = SLIDE_H

blank_layout = prs.slide_layouts[6]   # completely blank


# ═══════════════════════════ HELPERS ═══════════════════════════════════════

def add_rect(slide, l, t, w, h, fill=None, line_color=None, line_width=Pt(0)):
    from pptx.util import Emu
    shape = slide.shapes.add_shape(
        1,  # MSO_SHAPE_TYPE.RECTANGLE
        l, t, w, h
    )
    if fill:
        shape.fill.solid()
        shape.fill.fore_color.rgb = fill
    else:
        shape.fill.background()
    if line_color:
        shape.line.color.rgb = line_color
        shape.line.width = line_width
    else:
        shape.line.fill.background()
    return shape


def add_text_box(slide, text, l, t, w, h,
                 font_size=Pt(14), bold=False, italic=False,
                 color=BLACK, align=PP_ALIGN.LEFT,
                 wrap=True, font_name="Calibri"):
    txBox = slide.shapes.add_textbox(l, t, w, h)
    tf = txBox.text_frame
    tf.word_wrap = wrap
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = font_size
    run.font.bold = bold
    run.font.italic = italic
    run.font.color.rgb = color
    run.font.name = font_name
    return txBox


def add_title_bar(slide, title_text, subtitle_text=None):
    """Dark navy top bar + title text."""
    add_rect(slide, 0, 0, SLIDE_W, Inches(1.15), fill=NAVY)
    add_text_box(slide, title_text,
                 Inches(0.35), Inches(0.08), Inches(12.6), Inches(0.7),
                 font_size=Pt(30), bold=True, color=WHITE,
                 align=PP_ALIGN.LEFT)
    if subtitle_text:
        add_text_box(slide, subtitle_text,
                     Inches(0.35), Inches(0.78), Inches(12.6), Inches(0.35),
                     font_size=Pt(14), color=GOLD, align=PP_ALIGN.LEFT)
    # bottom accent line
    add_rect(slide, 0, Inches(1.15), SLIDE_W, Inches(0.05), fill=TEAL)


def set_bg(slide):
    """Light blue-grey background."""
    add_rect(slide, 0, 0, SLIDE_W, SLIDE_H, fill=LIGHT_BG)


def bullet_box(slide, bullets, l, t, w, h,
               font_size=Pt(13.5), color=BLACK, heading=None, heading_color=None):
    """Render a list of strings as bullet points."""
    txBox = slide.shapes.add_textbox(l, t, w, h)
    tf = txBox.text_frame
    tf.word_wrap = True
    first = True
    if heading:
        p = tf.paragraphs[0] if first else tf.add_paragraph()
        first = False
        p.alignment = PP_ALIGN.LEFT
        run = p.add_run()
        run.text = heading
        run.font.bold = True
        run.font.size = Pt(font_size.pt + 1)
        run.font.color.rgb = heading_color or TEAL
        run.font.name = "Calibri"

    for i, b in enumerate(bullets):
        if first:
            p = tf.paragraphs[0]
            first = False
        else:
            p = tf.add_paragraph()
        p.alignment = PP_ALIGN.LEFT
        p.space_before = Pt(2)
        run = p.add_run()
        # indent sub-bullets
        if b.startswith("  "):
            run.text = "    \u2013 " + b.strip()
            run.font.size = Pt(font_size.pt - 1.5)
        else:
            run.text = "\u2022  " + b
            run.font.size = font_size
        run.font.color.rgb = color
        run.font.name = "Calibri"
    return txBox


def divider_line(slide, y, color=TEAL, width_frac=0.92):
    add_rect(slide, Inches((1-width_frac)*13.33/2), y,
             Inches(13.33*width_frac), Inches(0.03), fill=color)


# ══════════════════════════════════════════════════════════════════════════════
#  SLIDE BUILDER FUNCTIONS
# ══════════════════════════════════════════════════════════════════════════════

# ── SLIDE 1  Title slide ──────────────────────────────────────────────────
def slide_title():
    slide = prs.slides.add_slide(blank_layout)
    # full gradient-like background: deep navy block + lighter overlay
    add_rect(slide, 0, 0, SLIDE_W, SLIDE_H, fill=NAVY)
    add_rect(slide, 0, Inches(4.5), SLIDE_W, Inches(3.0), fill=RGBColor(0x07, 0x1A, 0x45))
    # decorative teal accent strip
    add_rect(slide, 0, Inches(4.45), SLIDE_W, Inches(0.08), fill=TEAL)
    add_rect(slide, 0, Inches(4.6), Inches(3), Inches(0.04), fill=GOLD)

    add_text_box(slide, "HYPONATREMIA",
                 Inches(0.5), Inches(1.2), Inches(12), Inches(1.4),
                 font_size=Pt(56), bold=True, color=WHITE,
                 align=PP_ALIGN.CENTER)
    add_text_box(slide, "Pathophysiology, Classification, Diagnosis & Management",
                 Inches(0.5), Inches(2.7), Inches(12), Inches(0.7),
                 font_size=Pt(22), color=GOLD, align=PP_ALIGN.CENTER)
    add_text_box(slide, "Based on Harrison's Principles of Internal Medicine, 22nd Edition",
                 Inches(0.5), Inches(3.4), Inches(12), Inches(0.5),
                 font_size=Pt(16), italic=True, color=LIGHT_TEAL,
                 align=PP_ALIGN.CENTER)
    add_text_box(slide, "Chapter 56 \u2013 Fluid and Electrolyte Disturbances",
                 Inches(0.5), Inches(5.5), Inches(12), Inches(0.5),
                 font_size=Pt(14), color=WHITE, align=PP_ALIGN.CENTER)
    return slide


# ── SLIDE 2  Normal Na & Water Physiology ────────────────────────────────
def slide_physiology():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Normal Sodium & Water Physiology",
                  "Foundation for understanding sodium disorders")

    # Left column
    bullet_box(slide,
               ["Na\u207a is the primary extracellular cation (135\u2013145 mM)",
                "Determines extracellular fluid volume (ECFV) and osmolality",
                "Normal serum osmolality: 285\u2013295 mOsm/kg",
                "Calculated: 2[Na\u207a] + glucose/18 + BUN/2.8",
                "Na\u207a is freely filtered; reabsorption regulated by aldosterone (RAAS)",
                "Body water: 60% of body weight in men, 50% in women",
                "  TBW = ~42 L in a 70 kg man",
                "Distributed: ICF (2/3) and ECF (1/3)"],
               Inches(0.4), Inches(1.3), Inches(6.1), Inches(5.5),
               heading="Sodium Compartment", font_size=Pt(13))

    # Right column
    bullet_box(slide,
               ["ADH (AVP) is the master regulator of water balance",
                "Released from posterior pituitary in response to:",
                "  Increased plasma osmolality (osmoreceptors)",
                "  Decreased ECFV / hypotension (baroreceptors)",
                "AVP acts on V\u2082 receptors in collecting duct \u2192 aquaporin-2 insertion \u2192 water reabsorption",
                "Thirst is stimulated when plasma osmolality >295 mOsm/kg",
                "RAAS: Renin \u2192 Ang II \u2192 Aldosterone \u2192 Na\u207a retention",
                "Atrial natriuretic peptide (ANP) promotes Na\u207a excretion",
                "Key concept: [Na\u207a] reflects WATER balance, not sodium balance alone"],
               Inches(6.8), Inches(1.3), Inches(6.1), Inches(5.5),
               heading="AVP & Water Regulation", font_size=Pt(13))

    divider_line(slide, Inches(1.28))
    return slide


# ── SLIDE 3  Definition & Epidemiology ───────────────────────────────────
def slide_definition():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Hyponatremia: Definition & Epidemiology",
                  "Harrison's Ch. 56 \u2013 Fluid and Electrolyte Disturbances")

    # Definition box
    box = add_rect(slide, Inches(0.4), Inches(1.35), Inches(12.5), Inches(1.45),
                   fill=NAVY)
    add_text_box(slide, "DEFINITION:  Plasma Na\u207a concentration  <  135 mM",
                 Inches(0.55), Inches(1.45), Inches(12), Inches(0.55),
                 font_size=Pt(22), bold=True, color=WHITE)
    add_text_box(slide,
                 "Almost always the result of increased circulating AVP and/or increased renal sensitivity to AVP, combined with an intake of free water",
                 Inches(0.55), Inches(1.95), Inches(12), Inches(0.7),
                 font_size=Pt(14), italic=True, color=LIGHT_TEAL)

    bullet_box(slide,
               ["One of the most common electrolyte disorders",
                "Occurs in up to 22% of hospitalised patients",
                "Sodium disorders are caused by abnormalities in WATER homeostasis",
                "Leading to changes in the relative ratio of Na\u207a to body water",
                "Water intake and circulating AVP are the two key effectors of serum osmolality",
                "Defects in either or both of these mechanisms cause most cases",
                "Subdivided diagnostically into three groups based on clinical history and volume status:",
                "  Hypovolemic hyponatremia",
                "  Euvolemic hyponatremia",
                "  Hypervolemic hyponatremia"],
               Inches(0.4), Inches(2.95), Inches(7.5), Inches(4.0),
               font_size=Pt(13.5))

    # Severity box
    add_rect(slide, Inches(8.2), Inches(2.95), Inches(4.7), Inches(4.0), fill=WHITE,
             line_color=TEAL, line_width=Pt(1.5))
    add_text_box(slide, "Severity Classification",
                 Inches(8.3), Inches(3.05), Inches(4.5), Inches(0.45),
                 font_size=Pt(14), bold=True, color=NAVY)
    rows = [
        ("Mild",     "130\u2013134 mM", LIGHT_TEAL),
        ("Moderate", "125\u2013129 mM", RGBColor(0xB2, 0xD8, 0xE8)),
        ("Severe",   "< 125 mM",    RGBColor(0xF5, 0xC6, 0xC6)),
    ]
    y = Inches(3.55)
    for label, val, clr in rows:
        add_rect(slide, Inches(8.3), y, Inches(4.5), Inches(0.55), fill=clr)
        add_text_box(slide, label,
                     Inches(8.4), y+Inches(0.08), Inches(2.0), Inches(0.45),
                     font_size=Pt(13.5), bold=True, color=NAVY)
        add_text_box(slide, val,
                     Inches(10.5), y+Inches(0.08), Inches(2.2), Inches(0.45),
                     font_size=Pt(13.5), color=NAVY)
        y += Inches(0.6)

    add_text_box(slide, "Acute: onset < 48 h\nChronic: onset > 48 h",
                 Inches(8.3), Inches(5.4), Inches(4.5), Inches(1.0),
                 font_size=Pt(13), color=BLACK)
    return slide


# ── SLIDE 4  Pathophysiology ──────────────────────────────────────────────
def slide_patho():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Pathophysiology of Hyponatremia",
                  "AVP-mediated water retention \u2013 the central mechanism")

    bullet_box(slide,
               ["Serum [Na\u207a] = Total body sodium / Total body water",
                "Hyponatremia = relative excess of water over sodium",
                "Two key defence mechanisms of serum osmolality:",
                "  1. Water intake (thirst regulated by hypothalamus)",
                "  2. Circulating AVP (regulates renal water reabsorption)",
                "Defects in one or both of these mechanisms cause most hyponatremia",
                "AVP-independent mechanisms: impaired renal diluting capacity, reset osmostat",
                "Brain adaptation to hyponatremia:",
                "  Acute: Increased ISF pressure \u2192 shunting of ECF to CSF",
                "  Efflux of Na\u207a, K\u207a, Cl\u207b from brain cells (rapid phase)",
                "  Chronic (>48 h): Efflux of organic osmolytes (creatine, glutamate, taurine, myoinositol)",
                "  This reduces intracellular osmolality and gradient for water entry",
                "  Brain volume normalises within 48 h \u2192 defines 'chronic' hyponatremia"],
               Inches(0.4), Inches(1.3), Inches(7.5), Inches(5.8),
               font_size=Pt(13))

    # Right: AVP pathway box
    add_rect(slide, Inches(8.1), Inches(1.3), Inches(4.85), Inches(5.8),
             fill=WHITE, line_color=TEAL, line_width=Pt(1.5))
    add_text_box(slide, "AVP Secretion Pathway",
                 Inches(8.2), Inches(1.4), Inches(4.6), Inches(0.45),
                 font_size=Pt(15), bold=True, color=NAVY)

    steps = [
        ("\u2191 Plasma osmolality (osmoreceptors)", NAVY),
        ("\u2193 ECFV / hypotension (baroreceptors)", NAVY),
        ("AVP released from posterior pituitary", TEAL),
        ("AVP binds V\u2082 receptors (collecting duct)", TEAL),
        ("Aquaporin-2 insertion \u2192 water reabsorption", MED_BLUE),
        ("\u2191 Urine osmolality, \u2193 free water excretion", MED_BLUE),
        ("Dilution of plasma Na\u207a \u2192 Hyponatremia", RED),
    ]
    y = Inches(1.95)
    for txt, clr in steps:
        add_rect(slide, Inches(8.2), y, Inches(4.6), Inches(0.55), fill=LIGHT_BG)
        add_text_box(slide, txt, Inches(8.3), y+Inches(0.05), Inches(4.4), Inches(0.45),
                     font_size=Pt(12), color=clr, bold=(clr==NAVY))
        y += Inches(0.65)
    return slide


# ── SLIDE 5  Hypovolemic Hyponatremia ────────────────────────────────────
def slide_hypovolemic():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Hypovolemic Hyponatremia",
                  "Volume depletion \u2192 baroreceptor activation \u2192 non-osmotic AVP release")

    # Mechanism box
    add_rect(slide, Inches(0.4), Inches(1.35), Inches(12.5), Inches(0.9), fill=NAVY)
    add_text_box(slide,
                 "Hypovolemia causes marked neurohumoral activation, increasing circulating levels of AVP \u2192 V\u2082-mediated water reabsorption \u2192 hyponatremia when combined with free water intake",
                 Inches(0.55), Inches(1.45), Inches(12.2), Inches(0.75),
                 font_size=Pt(13), italic=True, color=WHITE)

    # Two columns: Renal vs Non-renal
    bullet_box(slide,
               ["Vomiting",
                "Diarrhea",
                "Third spacing of fluids",
                "Burns",
                "Pancreatitis",
                "Trauma",
                "Insensible losses (sweating)"],
               Inches(0.4), Inches(2.4), Inches(4.5), Inches(4.5),
               heading="Non-Renal Causes  (U\u2099\u2090 < 20 mM)",
               font_size=Pt(13))

    bullet_box(slide,
               ["Diuretic excess (especially thiazides)",
                "Mineralocorticoid deficiency",
                "Salt-losing nephropathies",
                "Bicarbonaturia with renal tubular acidosis / metabolic alkalosis",
                "Ketonuria",
                "Osmotic diuresis",
                "Cerebral salt-wasting syndrome"],
               Inches(5.2), Inches(2.4), Inches(4.5), Inches(4.5),
               heading="Renal Causes  (U\u2099\u2090 > 20 mM)",
               font_size=Pt(13))

    # Key points box
    add_rect(slide, Inches(9.9), Inches(2.4), Inches(3.0), Inches(4.5),
             fill=WHITE, line_color=GOLD, line_width=Pt(2))
    add_text_box(slide, "Key Points",
                 Inches(10.0), Inches(2.5), Inches(2.8), Inches(0.4),
                 font_size=Pt(14), bold=True, color=NAVY)
    pts = [
        "Urine Na\u207a typically <20 mM (non-renal)",
        "Renal causes: U\u2099\u2090 typically >20 mM",
        "IV normal saline \u2192 rapid plasma Na\u207a rise as AVP falls",
        "These patients may look euvolemic \u2013 U\u2099\u2090 <20 mM is the clue",
        "Primary adrenal insufficiency: high U\u2099\u2090 + hyperkalemia + hypotension"
    ]
    y = Inches(3.0)
    for pt in pts:
        add_text_box(slide, "\u25B6  " + pt, Inches(10.0), y, Inches(2.8), Inches(0.55),
                     font_size=Pt(11.5), color=BLACK)
        y += Inches(0.6)
    return slide


# ── SLIDE 6  Euvolemic Hyponatremia ──────────────────────────────────────
def slide_euvolemic():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Euvolemic Hyponatremia",
                  "Most common type in hospitalised patients \u2013 primarily SIAD")

    bullet_box(slide,
               ["Total body water is increased, total body sodium is essentially normal",
                "No oedema (hence 'euvolemic' clinically)",
                "SIAD is the most frequent cause",
                "Hypothyroidism (can cause moderate-severe hyponatremia)",
                "  Correction of hypothyroidism normalises AVP response",
                "Secondary adrenal insufficiency (glucocorticoid deficiency):",
                "  Predominant glucocorticoid deficiency \u2192 euvolemic hyponatremia",
                "  Hydrocortisone replacement rapidly normalises AVP response",
                "  Contrast: Primary adrenal insufficiency \u2192 hypovolemic hyponatremia",
                "Low solute intake (beer potomania, extreme vegetarian diets)",
                "  Very low urine osmolality (<100 mOsm/kg)",
                "  Urine Na\u207a <10\u201320 mM",
                "  Corrects rapidly with resumption of normal diet",
                "Psychogenic polydipsia (water intake overwhelms excretory capacity)"],
               Inches(0.4), Inches(1.3), Inches(7.5), Inches(5.8),
               font_size=Pt(13))

    add_rect(slide, Inches(8.1), Inches(1.3), Inches(4.85), Inches(5.8),
             fill=WHITE, line_color=TEAL, line_width=Pt(1.5))
    add_text_box(slide, "SIAD Overview",
                 Inches(8.2), Inches(1.4), Inches(4.6), Inches(0.4),
                 font_size=Pt(15), bold=True, color=NAVY)
    add_text_box(slide,
                 "Syndrome of Inappropriate Anti-Diuresis\n\n"
                 "\u2022 Persistent AVP secretion despite low plasma osmolality\n"
                 "\u2022 Urine osmolality persistently >100 mOsm/kg\n"
                 "\u2022 Urine Na\u207a usually >30 mM (but overlap exists)\n"
                 "\u2022 Four patterns of AVP secretion recognised\n"
                 "\u2022 A 5th subset: gain-of-function mutations in V\u2082 receptor ('nephrogenic SIAD')\n"
                 "\u2022 Strictly sub-clinically hypervolemic (AVP-induced water + Na\u207a-Cl\u207b retention)\n"
                 "\u2022 Serum uric acid often <4 mg/dL",
                 Inches(8.2), Inches(1.9), Inches(4.6), Inches(4.8),
                 font_size=Pt(12.5), color=BLACK)
    return slide


# ── SLIDE 7  Causes of SIAD (Table 56-1) ─────────────────────────────────
def slide_siad_causes():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Causes of SIAD  (Table 56-1  \u2013  Harrison 22e)",
                  "Syndrome of Inappropriate Antidiuresis")

    # Table layout: 5 columns
    cols = [
        ("Malignant\nDiseases",
         ["Carcinoma (Lung, Small cell, Mesothelioma, GI tract, GU tract)",
          "Endocrine thymoma", "Lymphomas", "Sarcomas", "Ewing's sarcoma"]),
        ("Pulmonary\nDisorders",
         ["Infections (bacterial, viral, TB, Aspergillosis)", "Asthma",
          "Cystic fibrosis", "ARDS / PPV"]),
        ("CNS\nDisorders",
         ["Encephalitis, Meningitis", "Brain abscess, Brain tumors",
          "Head trauma", "Subarachnoid / subdural hemorrhage",
          "Multiple sclerosis", "Guillain-Barr\u00e9 syndrome", "Acute intermittent porphyria"]),
        ("Drugs",
         ["Chlorpropamide", "SSRIs", "Tricyclic antidepressants",
          "Carbamazepine", "Nicotine", "Antipsychotics", "Cyclophosphamide",
          "NSAIDs", "MDMA ('Ecstasy')", "AVP analogues, Desmopressin",
          "Oxytocin, Vasopressin"]),
        ("Other\nCauses",
         ["Hereditary V\u2082 receptor gain-of-function mutations", "Idiopathic",
          "Transient", "Endurance exercise", "General anesthesia",
          "Nausea, Pain, Stress"]),
    ]

    col_w = Inches(2.5)
    x = Inches(0.25)
    for header, items in cols:
        add_rect(slide, x, Inches(1.25), col_w, Inches(0.55), fill=NAVY)
        add_text_box(slide, header, x+Inches(0.05), Inches(1.27),
                     col_w-Inches(0.1), Inches(0.5),
                     font_size=Pt(12), bold=True, color=WHITE, align=PP_ALIGN.CENTER)
        add_rect(slide, x, Inches(1.8), col_w, Inches(5.4), fill=WHITE,
                 line_color=TEAL, line_width=Pt(0.75))
        y = Inches(1.85)
        for item in items:
            add_text_box(slide, "\u2022 " + item, x+Inches(0.08), y,
                         col_w-Inches(0.15), Inches(0.65),
                         font_size=Pt(11), color=BLACK)
            y += Inches(0.65)
        x += col_w + Inches(0.07)
    return slide


# ── SLIDE 8  Hypervolemic Hyponatremia ───────────────────────────────────
def slide_hypervolemic():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Hypervolemic Hyponatremia",
                  "Increased total body Na\u207a-Cl\u207b AND greater increase in total body water")

    add_rect(slide, Inches(0.4), Inches(1.35), Inches(12.5), Inches(0.8), fill=NAVY)
    add_text_box(slide,
                 "Patients develop an increase in total body Na\u207a-Cl\u207b that is accompanied by a proportionately greater increase in total body water, leading to a reduced plasma Na\u207a concentration",
                 Inches(0.55), Inches(1.45), Inches(12.2), Inches(0.65),
                 font_size=Pt(13), italic=True, color=WHITE)

    bullet_box(slide,
               ["Congestive heart failure (CHF)",
                "Cirrhosis of the liver",
                "Nephrotic syndrome",
                "Acute or chronic renal failure",
                "Pathophysiology similar to hypovolemic hyponatremia",
                "  EXCEPT causative disorders exert specific etiologic factors",
                "  CHF: Cardiac dysfunction \u2192 reduced effective circulatory volume",
                "  Cirrhosis: Peripheral vasodilation \u2192 reduced ECFV",
                "Urine Na\u207a typically very low (<10 mM) \u2013 even after hydration",
                "  Unless obscured by diuretic therapy",
                "  This 'Na\u207a-avid' state is indirect index of neurohumoral activation",
                "Degree of hyponatremia is an indirect prognostic indicator",
                "Acute/chronic renal failure: uniquely associated with increased U\u2099\u2090"],
               Inches(0.4), Inches(2.3), Inches(7.0), Inches(4.9),
               font_size=Pt(13))

    add_rect(slide, Inches(7.7), Inches(2.3), Inches(5.2), Inches(4.9),
             fill=WHITE, line_color=GOLD, line_width=Pt(1.5))
    add_text_box(slide, "Comparison Table",
                 Inches(7.8), Inches(2.4), Inches(5.0), Inches(0.4),
                 font_size=Pt(13), bold=True, color=NAVY)
    hdrs = ["Feature", "Hypovolemic", "Euvolemic", "Hypervolemic"]
    rows = [
        ["TBW",    "\u2193\u2193",       "\u2191",          "\u2191\u2191"],
        ["TBNa\u207a", "\u2193",          "\u2194",          "\u2191"],
        ["Edema",  "No",           "No",           "Yes"],
        ["U\u2099\u2090",  "<20 (ex-renal)\n>20 (renal)", ">20 (SIAD)\n<20 (low solute)", "<10 mM"],
        ["AVP",    "\u2191\u2191",         "\u2191\u2191",          "\u2191"],
    ]
    col_ws = [Inches(1.3), Inches(1.2), Inches(1.2), Inches(1.35)]
    x_start = Inches(7.8)
    y = Inches(2.9)
    # header row
    x = x_start
    for i, h in enumerate(hdrs):
        add_rect(slide, x, y, col_ws[i], Inches(0.38), fill=TEAL)
        add_text_box(slide, h, x+Inches(0.03), y+Inches(0.02), col_ws[i]-Inches(0.06), Inches(0.34),
                     font_size=Pt(11), bold=True, color=WHITE, align=PP_ALIGN.CENTER)
        x += col_ws[i]
    y += Inches(0.38)
    for row in rows:
        x = x_start
        for i, cell in enumerate(row):
            add_rect(slide, x, y, col_ws[i], Inches(0.52),
                     fill=LIGHT_TEAL if row == rows[0] else LIGHT_BG)
            add_text_box(slide, cell, x+Inches(0.03), y+Inches(0.02),
                         col_ws[i]-Inches(0.06), Inches(0.48),
                         font_size=Pt(10.5), color=BLACK, align=PP_ALIGN.CENTER)
            x += col_ws[i]
        y += Inches(0.52)
    return slide


# ── SLIDE 9  Diagnostic Algorithm (Fig 56-5) ─────────────────────────────
def slide_diagnostic():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Diagnostic Approach to Hyponatremia",
                  "Figure 56-5 \u2013 Harrison 22e: Assessment of Volume Status")

    # Three-column algorithm
    cols_data = [
        (NAVY,  "HYPOVOLEMIA",
         "Total body water \u2193\nTotal body sodium \u2193\u2193",
         [("U\u2099\u2090 > 20 mM", "Renal losses:\n\u2022 Diuretic excess\n\u2022 Mineralocorticoid deficiency\n\u2022 Salt-losing nephropathies\n\u2022 Bicarbonaturia\n\u2022 Ketonuria\n\u2022 Osmotic diuresis\n\u2022 Cerebral salt wasting"),
          ("U\u2099\u2090 < 20 mM", "Extrarenal losses:\n\u2022 Vomiting\n\u2022 Diarrhea\n\u2022 Third spacing\n\u2022 Burns\n\u2022 Pancreatitis\n\u2022 Trauma")]
        ),
        (TEAL,  "EUVOLEMIA",
         "Total body water \u2191\nTotal body sodium \u2194",
         [("U\u2099\u2090 > 20 mM", "Causes:\n\u2022 Glucocorticoid deficiency\n\u2022 Hypothyroidism\n\u2022 Stress\n\u2022 Drugs\n\u2022 SIAD"),
          ("U\u2099\u2090 < 20 mM", "Low solute intake:\n\u2022 Beer potomania\n\u2022 Psychogenic polydipsia")]
        ),
        (MED_BLUE, "HYPERVOLEMIA",
         "Total body water \u2191\u2191\nTotal body sodium \u2191",
         [("U\u2099\u2090 > 20 mM", "Renal failure:\n\u2022 Acute\n\u2022 Chronic"),
          ("U\u2099\u2090 < 20 mM", "Oedematous states:\n\u2022 Nephrotic syndrome\n\u2022 Cirrhosis\n\u2022 Cardiac failure")]
        ),
    ]

    x = Inches(0.25)
    for clr, title, sub, branches in cols_data:
        col_w = Inches(4.2)
        add_rect(slide, x, Inches(1.3), col_w, Inches(0.55), fill=clr)
        add_text_box(slide, title, x+Inches(0.05), Inches(1.33),
                     col_w-Inches(0.1), Inches(0.45),
                     font_size=Pt(15), bold=True, color=WHITE, align=PP_ALIGN.CENTER)
        add_rect(slide, x, Inches(1.85), col_w, Inches(0.55), fill=LIGHT_TEAL)
        add_text_box(slide, sub, x+Inches(0.08), Inches(1.88),
                     col_w-Inches(0.15), Inches(0.5),
                     font_size=Pt(11.5), color=NAVY)
        # two sub-boxes
        y2 = Inches(2.5)
        for u_label, items in branches:
            add_rect(slide, x+Inches(0.1), y2, col_w-Inches(0.2), Inches(2.35),
                     fill=WHITE, line_color=clr, line_width=Pt(1))
            add_rect(slide, x+Inches(0.1), y2, col_w-Inches(0.2), Inches(0.38), fill=clr)
            add_text_box(slide, u_label, x+Inches(0.15), y2+Inches(0.03),
                         col_w-Inches(0.3), Inches(0.3),
                         font_size=Pt(12), bold=True, color=WHITE)
            add_text_box(slide, items, x+Inches(0.15), y2+Inches(0.42),
                         col_w-Inches(0.3), Inches(1.85),
                         font_size=Pt(11), color=BLACK)
            y2 += Inches(2.5)
        x += col_w + Inches(0.23)

    add_text_box(slide,
                 "Reference: Figure 56-5, Harrison's Principles of Internal Medicine 22e (Adapted from S. Kumar, T. Berl, in RW Schrier ed., Atlas of Diseases of the Kidney, Philadelphia, Current Medicine, 1999)",
                 Inches(0.25), Inches(7.15), Inches(12.8), Inches(0.3),
                 font_size=Pt(9), italic=True, color=RGBColor(0x60, 0x60, 0x60))
    return slide


# ── SLIDE 10  Clinical Features ───────────────────────────────────────────
def slide_clinical():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Clinical Features of Hyponatremia",
                  "Symptoms are primarily neurological \u2013 reflecting cerebral oedema within a rigid skull")

    bullet_box(slide,
               ["Hyponatremia induces generalised cellular swelling \u2013 water moves down the osmotic gradient from hypotonic ECF to ICF",
                "CNS manifestations dominate: brain is encased in a rigid skull",
                "Initial CNS response to acute hyponatremia:",
                "  Increase in interstitial pressure \u2192 shunting of ECF and solutes from ISF into CSF",
                "  Efflux of major intracellular ions (Na\u207a, K\u207a, Cl\u207b) from brain cells",
                "ACUTE HYPONATREMIA symptoms (onset <48 h):",
                "  Nausea, headache, vomiting",
                "  Seizure activity, brainstem herniation, coma, death",
                "  Key complication: noncardiogenic / neurogenic pulmonary oedema",
                "  Normal pulmonary capillary wedge pressure (key differentiator)",
                "CHRONIC HYPONATREMIA (>48 h):",
                "  Less likely to have severe symptoms due to brain adaptation",
                "  Subtle gait disturbance and cognitive defects",
                "  Increased risk of falls, bone fractures"],
               Inches(0.4), Inches(1.3), Inches(7.0), Inches(5.8),
               font_size=Pt(13))

    # Symptom severity scale on right
    add_rect(slide, Inches(7.7), Inches(1.3), Inches(5.2), Inches(5.8),
             fill=WHITE, line_color=TEAL, line_width=Pt(1.5))
    add_text_box(slide, "Symptom Spectrum",
                 Inches(7.8), Inches(1.4), Inches(5.0), Inches(0.4),
                 font_size=Pt(14), bold=True, color=NAVY)
    symp_rows = [
        ("Mild / Moderate", "130\u2013134 mM", "Fatigue, nausea, headache, anorexia", LIGHT_BG),
        ("Moderate", "125\u2013129 mM", "Confusion, disorientation, muscle cramps", LIGHT_TEAL),
        ("Severe", "< 125 mM", "Seizures, coma, brainstem herniation, respiratory failure", RGBColor(0xF5, 0xC6, 0xC6)),
    ]
    y = Inches(1.9)
    for label, conc, desc, clr in symp_rows:
        add_rect(slide, Inches(7.8), y, Inches(5.0), Inches(1.3), fill=clr)
        add_text_box(slide, label + "  |  " + conc,
                     Inches(7.9), y+Inches(0.05), Inches(4.8), Inches(0.4),
                     font_size=Pt(12), bold=True, color=NAVY)
        add_text_box(slide, desc, Inches(7.9), y+Inches(0.45), Inches(4.8), Inches(0.75),
                     font_size=Pt(11.5), color=BLACK)
        y += Inches(1.4)
    add_text_box(slide,
                 "\u26A0  Acute symptomatic hyponatremia is a medical emergency\n"
                 "\u26A0  Women (pre-menopausal) and children are at higher risk of encephalopathy and severe neurologic sequelae",
                 Inches(7.8), Inches(5.7), Inches(5.0), Inches(1.3),
                 font_size=Pt(12), color=RED, bold=True)
    return slide


# ── SLIDE 11  Causes of Acute Hyponatremia (Table 56-2) ──────────────────
def slide_acute_causes():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Causes of Acute Hyponatremia  (Table 56-2 \u2013 Harrison 22e)",
                  "Onset < 48 hours \u2013 Medical emergency")

    causes = [
        ("Iatrogenic", [
            "Postoperative: especially premenopausal women",
            "Hypotonic intravenous fluids with cause of \u2191 vasopressin",
            "Glycine irrigation: TURP, uterine surgery",
            "Colonoscopy preparation"]),
        ("Drug-Induced", [
            "Recent institution of thiazide diuretics",
            "MDMA ('Ecstasy', 'Molly') ingestion",
            "Desmopressin, Oxytocin"]),
        ("Exercise-Associated", [
            "Exercise-induced hyponatremia (marathons, endurance events)",
            "Non-osmotic AVP increase + excessive free water intake",
            "Important clinical issue at endurance sporting events"]),
        ("Polydipsia", [
            "Psychogenic polydipsia",
            "Multifactorial (e.g., thiazide + polydipsia)"]),
    ]

    x = Inches(0.3)
    y = Inches(1.3)
    for title, items in causes:
        box_w = Inches(5.9)
        box_h = Inches(2.6)
        if x > Inches(6.5):
            x = Inches(0.3)
            y = Inches(4.1)
        add_rect(slide, x, y, box_w, box_h, fill=WHITE,
                 line_color=TEAL, line_width=Pt(1.5))
        add_rect(slide, x, y, box_w, Inches(0.45), fill=NAVY)
        add_text_box(slide, title, x+Inches(0.1), y+Inches(0.06),
                     box_w-Inches(0.2), Inches(0.38),
                     font_size=Pt(14), bold=True, color=WHITE)
        y2 = y + Inches(0.5)
        for item in items:
            add_text_box(slide, "\u2022  " + item, x+Inches(0.15), y2,
                         box_w-Inches(0.3), Inches(0.5),
                         font_size=Pt(12.5), color=BLACK)
            y2 += Inches(0.48)
        x += box_w + Inches(0.5)
    return slide


# ── SLIDE 12  Osmotic Demyelination Syndrome ─────────────────────────────
def slide_ods():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Osmotic Demyelination Syndrome (ODS)",
                  "A critical complication of overly rapid correction of chronic hyponatremia")

    add_rect(slide, Inches(0.4), Inches(1.3), Inches(12.5), Inches(0.75), fill=RED)
    add_text_box(slide,
                 "\u26A0  ODS occurs when plasma Na\u207a is corrected too rapidly (>8\u201310 mM in 24 h  or  >18 mM in 48 h) in CHRONIC hyponatremia",
                 Inches(0.55), Inches(1.38), Inches(12.2), Inches(0.6),
                 font_size=Pt(14), bold=True, color=WHITE)

    bullet_box(slide,
               ["Brain cells reaccumulate organic osmolytes slowly \u2013 this reaccumulation is ATTENUATED after correction",
                "Overly rapid correction \u2192 brain cells unable to keep up \u2192 shrinkage \u2192 hypertonic stress",
                "Leads to generalised protein ubiquitination, endoplasmic reticulum stress, unfolded protein response",
                "Causes apoptotic and autophagic cell death",
                "Also disrupts blood-brain barrier \u2192 immune mediators \u2192 demyelination",
                "Lesions classically affect the PONS (central pontine myelinolysis)",
                "  Delay in reaccumulation of osmolytes is most pronounced here",
                "Extrapontine myelinolysis: cerebellum, lateral geniculate body, thalamus, putamen, cortex",
                "Clinical presentation (1 or more days after overcorrection):",
                "  Paraparesis or quadriparesis, dysphagia, dysarthria",
                "  Diplopia, 'locked-in syndrome'",
                "  Loss of consciousness"],
               Inches(0.4), Inches(2.15), Inches(7.5), Inches(5.0),
               font_size=Pt(12.5))

    add_rect(slide, Inches(8.1), Inches(2.15), Inches(4.85), Inches(5.0),
             fill=WHITE, line_color=RED, line_width=Pt(2))
    add_text_box(slide, "Risk Factors for ODS",
                 Inches(8.2), Inches(2.25), Inches(4.6), Inches(0.4),
                 font_size=Pt(14), bold=True, color=RED)
    risk_factors = [
        "Alcoholism",
        "Malnutrition",
        "Hypokalemia",
        "Liver transplantation",
        "Correction rate >8\u201310 mM/24 h",
        "Very low initial Na\u207a (<110 mM)",
    ]
    y = Inches(2.75)
    for rf in risk_factors:
        add_rect(slide, Inches(8.2), y, Inches(4.6), Inches(0.48),
                 fill=RGBColor(0xFD, 0xED, 0xEC))
        add_text_box(slide, "\u2716  " + rf, Inches(8.3), y+Inches(0.07),
                     Inches(4.4), Inches(0.38),
                     font_size=Pt(13), color=RED)
        y += Inches(0.53)

    add_text_box(slide,
                 "\u2714  If overcorrection occurs: Re-lower plasma Na\u207a by re-administration of free water (IV D5W) and/or desmopressin (DDAVP)",
                 Inches(8.2), y+Inches(0.1), Inches(4.6), Inches(0.9),
                 font_size=Pt(12), color=NAVY, bold=True)
    return slide


# ── SLIDE 13  Laboratory Investigation ───────────────────────────────────
def slide_lab():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Laboratory Investigation of Hyponatremia",
                  "Systematic approach \u2013 Harrison 22e")

    tests = [
        ("Serum Osmolality", NAVY,
         "Excludes pseudohyponatremia and isotonic hyponatremia.\n"
         "True hyponatremia \u2192 effective osmolality <275 mOsm/kg.\n"
         "Measured minus calculated (÷2.8 if BUN in mg/dL) = effective osmolality"),
        ("Urine Osmolality", TEAL,
         "Key discriminating test.\n"
         "<100 mOsm/kg: polydipsia / low solute intake (AVP suppressed)\n"
         ">100 mOsm/kg: AVP excess playing dominant role\n"
         ">450 mOsm/kg: concentrated urine \u2192 major AVP effect"),
        ("Urine Na\u207a Concentration", MED_BLUE,
         "<20\u201330 mM: Hypovolemia (non-renal) or hypervolemic states (CHF, cirrhosis)\n"
         ">30 mM: SIAD, renal losses, adrenal insufficiency (but overlap exists in elderly)\n"
         "Gold standard for hypovolemia: plasma Na\u207a corrects with normal saline"),
        ("Serum Glucose", RGBColor(0x5B, 0x2D, 0x8E),
         "Plasma Na\u207a falls ~1.6\u20132.4 mM per 100 mg/dL rise in glucose.\n"
         "'True' hyponatremia resolves after correction of hyperglycaemia"),
        ("Serum Uric Acid", RGBColor(0x2E, 0x7D, 0x32),
         "SIAD physiology \u2192 typically hypo-uricemic (<4 mg/dL)\n"
         "Volume-depleted patients are often hyper-uricemic\n"
         "Useful differentiator between SIAD and hypovolemic hyponatremia"),
        ("BUN & Creatinine", RGBColor(0x6A, 0x1A, 0x45),
         "Elevated BUN \u2192 renal dysfunction as potential cause.\n"
         "Prerenal azotemia also elevates BUN disproportionately to creatinine"),
        ("Urine K\u207a & UECR", TEAL,
         "Urine-to-plasma electrolyte ratio: [U\u2099\u2090 + U\u2096] / P\u2099\u2090\n"
         ">1: More aggressive fluid restriction needed (<500 mL/d)\n"
         "~1: Restrict to 500\u2013700 mL/d;  <1: Restrict to <1 L/d\n"
         "Useful to predict response to fluid restriction in SIAD"),
        ("Thyroid & Adrenal Function", RGBColor(0x8B, 0x45, 0x13),
         "TSH: Exclude hypothyroidism (euvolemic hyponatremia)\n"
         "Morning cortisol / cosyntropin stimulation test:\n"
         "  Exclude primary and secondary adrenal insufficiency"),
    ]

    x = Inches(0.3)
    y = Inches(1.3)
    box_w = Inches(4.15)
    box_h = Inches(1.5)
    col = 0
    for name, clr, desc in tests:
        if col == 3:
            col = 0
            x = Inches(0.3)
            y += box_h + Inches(0.1)
        add_rect(slide, x, y, box_w, box_h, fill=WHITE, line_color=clr, line_width=Pt(1.5))
        add_rect(slide, x, y, box_w, Inches(0.4), fill=clr)
        add_text_box(slide, name, x+Inches(0.1), y+Inches(0.04),
                     box_w-Inches(0.2), Inches(0.35),
                     font_size=Pt(12.5), bold=True, color=WHITE)
        add_text_box(slide, desc, x+Inches(0.1), y+Inches(0.44),
                     box_w-Inches(0.2), Inches(0.98),
                     font_size=Pt(11), color=BLACK)
        x += box_w + Inches(0.19)
        col += 1
    return slide


# ── SLIDE 14  Treatment Overview ─────────────────────────────────────────
def slide_treatment_overview():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Treatment of Hyponatremia \u2013 Overview",
                  "Three major considerations guide therapy \u2013 Harrison 22e")

    boxes = [
        ("1. Urgency & Goals", NAVY,
         "Determined by presence and/or severity of symptoms\n\n"
         "\u2022 Acute hyponatremia (<48 h): Symptoms can range from headache, nausea, vomiting \u2192 seizures, obtundation, central herniation\n"
         "\u2022 Chronic hyponatremia (>48 h): Less likely to have severe symptoms"),
        ("2. Risk of ODS", RED,
         "Chronic hyponatremia at risk for ODS if Na\u207a corrected:\n\n"
         "\u2022 >8\u201310 mM in the first 24 h\n"
         "\u2022 >18 mM within the first 48 h\n"
         "\u2022 Frequent monitoring of plasma Na\u207a during corrective therapy is IMPERATIVE"),
        ("3. Response to Interventions", TEAL,
         "Hypertonic saline, isotonic saline, or AVP antagonists can be highly unpredictable\n\n"
         "\u2022 Physiology changes rapidly (e.g., when AVP normalises with treatment of underlying cause)\n"
         "\u2022 Measure plasma Na\u207a every 2\u20134 hours during active treatment"),
    ]

    x = Inches(0.3)
    for title, clr, text in boxes:
        box_w = Inches(4.1)
        add_rect(slide, x, Inches(1.3), box_w, Inches(5.4),
                 fill=WHITE, line_color=clr, line_width=Pt(2))
        add_rect(slide, x, Inches(1.3), box_w, Inches(0.55), fill=clr)
        add_text_box(slide, title, x+Inches(0.1), Inches(1.34),
                     box_w-Inches(0.2), Inches(0.45),
                     font_size=Pt(15), bold=True, color=WHITE)
        add_text_box(slide, text, x+Inches(0.1), Inches(1.93),
                     box_w-Inches(0.2), Inches(4.7),
                     font_size=Pt(13), color=BLACK)
        x += box_w + Inches(0.27)

    add_text_box(slide,
                 "Once urgency is established and appropriate therapy instituted, focus should be on treatment or withdrawal of the underlying cause.",
                 Inches(0.3), Inches(6.9), Inches(12.7), Inches(0.5),
                 font_size=Pt(13), italic=True, color=NAVY, align=PP_ALIGN.CENTER)
    return slide


# ── SLIDE 15  Treatment of Hypovolemic Hyponatremia ──────────────────────
def slide_tx_hypovolemic():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Treatment: Hypovolemic Hyponatremia",
                  "Restore normovolemia \u2013 saline therapy reduces AVP \u2192 water diuresis")

    bullet_box(slide,
               ["Therapeutic goals: Restore normovolemia and replace ongoing fluid losses",
                "Mild hypovolemia: Oral hydration and resumption of normal maintenance diet",
                "Moderate-severe hypovolemia: IV fluid replacement",
                "Fluid of choice: Isotonic ('normal') saline (0.9% NaCl, 154 mM Na\u207a)",
                "  Most appropriate resuscitation fluid for normonatremic or hyponatremic patients",
                "  Colloid solutions (e.g., albumin) not demonstrably superior",
                "Mechanism of correction:",
                "  Saline therapy \u2192 restores ECFV \u2192 circulating AVP plummets \u2192 water diuresis",
                "  This rapidly increases plasma Na\u207a concentration",
                "  May need to REDUCE rate of correction if hyponatremia is chronic",
                "Hypernatremic patients (if present simultaneously):",
                "  Give hypotonic solution: 5% dextrose (water loss only) or 0.5 normal saline",
                "Patients with bicarbonate loss / metabolic acidosis (diarrhea):",
                "  Give IV bicarbonate (isotonic: 150 mEq NaHCO\u2083 in 5% dextrose)",
                "Monitor serum electrolytes frequently during correction"],
               Inches(0.4), Inches(1.3), Inches(8.5), Inches(5.8),
               font_size=Pt(13))

    # TREATMENT box
    add_rect(slide, Inches(9.1), Inches(1.3), Inches(3.9), Inches(5.8),
             fill=WHITE, line_color=NAVY, line_width=Pt(2))
    add_text_box(slide, "Special Situations",
                 Inches(9.2), Inches(1.4), Inches(3.7), Inches(0.4),
                 font_size=Pt(13), bold=True, color=NAVY)
    specials = [
        ("Severe hemorrhage / anemia", "Red cell transfusion (avoid \u2191 haematocrit >35%)"),
        ("Hypovolemic shock", "Isotonic saline \u2192 vasopressors if needed"),
        ("Adrenal insufficiency", "Hydrocortisone replacement rapidly normalises AVP response"),
        ("Thiazide-induced", "Stop thiazide; K\u207a replacement if hypokalaemic"),
    ]
    y = Inches(1.9)
    for title, desc in specials:
        add_rect(slide, Inches(9.2), y, Inches(3.7), Inches(1.1), fill=LIGHT_BG)
        add_text_box(slide, title, Inches(9.3), y+Inches(0.07),
                     Inches(3.5), Inches(0.38),
                     font_size=Pt(12.5), bold=True, color=TEAL)
        add_text_box(slide, desc, Inches(9.3), y+Inches(0.48),
                     Inches(3.5), Inches(0.5),
                     font_size=Pt(11.5), color=BLACK)
        y += Inches(1.2)
    return slide


# ── SLIDE 16  Treatment of Euvolemic Hyponatremia / SIAD ─────────────────
def slide_tx_euvolemic():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Treatment: Euvolemic Hyponatremia (SIAD)",
                  "SIAD, Hypothyroidism, Secondary Adrenal Insufficiency")

    bullet_box(slide,
               ["Treat underlying cause first whenever possible",
                "HYPOTHYROIDISM: Thyroid hormone replacement \u2192 Na\u207a normalises",
                "SECONDARY ADRENAL INSUFFICIENCY: Hydrocortisone replacement",
                "FLUID RESTRICTION (cornerstone of chronic SIAD therapy):",
                "  Guide by urine-to-plasma electrolyte ratio (UECR = [U\u2099\u2090 + U\u2096] / P\u2099\u2090)",
                "  UECR >1: Aggressive restriction (<500 mL/d)",
                "  UECR ~1: Restrict to 500\u2013700 mL/d",
                "  UECR <1: Restrict to <1 L/d",
                "  Caution: Difficult for SIAD patients (thirst inappropriately stimulated)",
                "POTASSIUM REPLACEMENT (if hypokalaemic):",
                "  K\u207a replacement increases plasma Na\u207a even without hypertonic saline",
                "  Aggressive K\u207a repletion can overcorrect Na\u207a \u2013 monitor closely",
                "INCREASED DIETARY SOLUTE INTAKE:",
                "  Oral salt tablets + oral urea preparations \u2192 increase free water excretion",
                "ORAL FUROSEMIDE (20 mg BD) + oral salt tablets:",
                "  Furosemide inhibits TALH countercurrent mechanism",
                "  Blunts renal concentrating ability \u2192 increases free water excretion"],
               Inches(0.4), Inches(1.3), Inches(7.5), Inches(5.8),
               font_size=Pt(12.5))

    add_rect(slide, Inches(8.1), Inches(1.3), Inches(4.85), Inches(5.8),
             fill=WHITE, line_color=TEAL, line_width=Pt(1.5))
    add_text_box(slide, "Pharmacologic Options",
                 Inches(8.2), Inches(1.4), Inches(4.6), Inches(0.4),
                 font_size=Pt(14), bold=True, color=NAVY)
    pharm = [
        ("Vaptans (AVP Antagonists)",
         "Tolvaptan (oral V\u2082 antagonist) \u2013 approved for SIAD and heart failure\n"
         "Conivaptan (IV V\u2081\u2090/V\u2082 antagonist) \u2013 IV use in hospital\n"
         "\u26A0 Liver function tests abnormalities with chronic tolvaptan\n"
         "Restricted to <1\u20132 months use"),
        ("Demeclocycline",
         "Inhibits principal cells \u2013 nephrogenic DI-like effect\n"
         "Used when Na\u207a does not rise with furosemide + salt tablets\n"
         "\u26A0 Risk of nephrotoxicity in cirrhosis"),
        ("Oral Urea",
         "Palatable preparations available\n"
         "Increases solute excretion \u2192 free water excretion\n"
         "Comparable efficacy to vaptans"),
    ]
    y = Inches(1.9)
    for drug, desc in pharm:
        add_rect(slide, Inches(8.2), y, Inches(4.6), Inches(1.6),
                 fill=LIGHT_BG, line_color=TEAL, line_width=Pt(0.75))
        add_text_box(slide, drug, Inches(8.3), y+Inches(0.07),
                     Inches(4.4), Inches(0.38),
                     font_size=Pt(12.5), bold=True, color=TEAL)
        add_text_box(slide, desc, Inches(8.3), y+Inches(0.45),
                     Inches(4.4), Inches(1.05),
                     font_size=Pt(11.5), color=BLACK)
        y += Inches(1.7)
    return slide


# ── SLIDE 17  Treatment of Hypervolemic Hyponatremia ─────────────────────
def slide_tx_hypervolemic():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Treatment: Hypervolemic Hyponatremia",
                  "CHF, Cirrhosis, Nephrotic Syndrome, Renal Failure")

    bullet_box(slide,
               ["Focus is on treatment of the underlying cause",
                "HEART FAILURE:",
                "  Optimise cardiac function: ACE inhibitors, beta-blockers, device therapy",
                "  Loop diuretics (furosemide) \u2192 increase free water excretion",
                "  Tolvaptan (vaptan) highly effective: 'aquaretic' effect",
                "  Caution with vaptans: initiate in hospital with liberalisation of fluid restriction",
                "CIRRHOSIS:",
                "  Optimise management of portal hypertension",
                "  ACE inhibition / intensification of cardiomyopathy therapy",
                "  Avoid vaptans: Higher risk of nephrotoxicity due to drug accumulation",
                "  Oral urea as alternative to vaptans (comparable efficacy)",
                "  Avoid aggressive diuresis \u2013 risk of hepatorenal syndrome",
                "RENAL FAILURE:",
                "  Dialysis if severe (corrects both hyponatremia and fluid overload)",
                "NEPHROTIC SYNDROME:",
                "  Treatment of underlying renal disease",
                "  Salt and water restriction; loop diuretics",
                "GENERAL:",
                "  Correct Na\u207a slowly to prevent ODS: <8\u201310 mM/24 h",
                "  Monitor electrolytes every 2\u20134 hours during active correction"],
               Inches(0.4), Inches(1.3), Inches(8.5), Inches(5.8),
               font_size=Pt(12.5))

    add_rect(slide, Inches(9.0), Inches(1.3), Inches(4.0), Inches(5.8),
             fill=WHITE, line_color=GOLD, line_width=Pt(2))
    add_text_box(slide, "Vaptan (V\u2082 Antagonist)\nTherapy",
                 Inches(9.1), Inches(1.4), Inches(3.8), Inches(0.6),
                 font_size=Pt(14), bold=True, color=NAVY)
    add_text_box(slide,
                 "\u2714 Approved for:\n"
                 "  - All but hypovolemic hyponatremia\n"
                 "  - CHF and SIAD (tolvaptan)\n\n"
                 "\u2714 Mechanism:\n"
                 "  Aquaretic effect: free water excretion without Na\u207a loss\n\n"
                 "\u26A0 Contraindications:\n"
                 "  - Hypovolemic hyponatremia\n"
                 "  - Acute hyponatremia (no approved role)\n"
                 "  - Cirrhosis (risk of nephrotoxicity)\n"
                 "  - Use >1\u20132 months (liver toxicity risk)\n\n"
                 "\u26A0 ~10% patients will overcorrect\n"
                 "  Monitor Na\u207a closely; re-lower if needed\n"
                 "  with DDAVP + free water",
                 Inches(9.1), Inches(2.05), Inches(3.8), Inches(4.9),
                 font_size=Pt(12), color=BLACK)
    return slide


# ── SLIDE 18  Treatment of Acute Symptomatic Hyponatremia ────────────────
def slide_tx_acute():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Treatment: Acute Symptomatic Hyponatremia",
                  "Medical emergency \u2013 prompt correction with hypertonic saline")

    add_rect(slide, Inches(0.4), Inches(1.3), Inches(12.5), Inches(0.65), fill=RED)
    add_text_box(slide,
                 "\u26A0  Acute symptomatic hyponatremia is a MEDICAL EMERGENCY requiring prompt but controlled correction with 3% hypertonic saline",
                 Inches(0.55), Inches(1.36), Inches(12.2), Inches(0.55),
                 font_size=Pt(13.5), bold=True, color=WHITE)

    bullet_box(slide,
               ["TARGET: Increase plasma Na\u207a by 1\u20132 mM/h to a total of 4\u20136 mM initially",
                "This is typically sufficient to alleviate severe acute symptoms",
                "BOLUS approach (preferred): 100 mL of 3% hypertonic saline IV",
                "  More effective than infusion for rapidly improving serum Na\u207a and mental status",
                "  May repeat bolus(es) if symptoms persist",
                "For ongoing infusions \u2013 estimate rate using Na\u207a deficit formula:",
                "  Na\u207a deficit = 0.6 \u00d7 body weight (kg) \u00d7 (target [Na\u207a] \u2013 starting [Na\u207a])",
                "  Then calculate required rate of administration",
                "Additional supportive measures:",
                "  Supplemental oxygen and ventilatory support",
                "  Intravenous loop diuretics: Treat acute pulmonary oedema and increase free water excretion",
                "  Loop diuretics interfere with renal countercurrent multiplication \u2192 free water excretion",
                "  AVP antagonists have NO approved role in acute hyponatremia",
                "After initial acute correction \u2192 apply CHRONIC hyponatremia correction guidelines",
                "  Chronic rate: <6\u20138 mM in first 24 h, then <6 mM each subsequent 24 h",
                "  Lower targets for patients at high ODS risk"],
               Inches(0.4), Inches(2.05), Inches(8.5), Inches(5.1),
               font_size=Pt(12.5))

    # Correction targets
    add_rect(slide, Inches(9.0), Inches(2.05), Inches(4.0), Inches(5.1),
             fill=WHITE, line_color=RED, line_width=Pt(2))
    add_text_box(slide, "Safe Correction Targets",
                 Inches(9.1), Inches(2.15), Inches(3.8), Inches(0.4),
                 font_size=Pt(14), bold=True, color=NAVY)
    targets = [
        ("ACUTE correction", "1\u20132 mM/h\nTotal 4\u20136 mM initially", LIGHT_TEAL),
        ("CHRONIC correction\n(safe rate)", "<6\u20138 mM\nin 24 h", LIGHT_BG),
        ("MAX in 24 h", "8\u201310 mM\n(ODS threshold)", RGBColor(0xF5, 0xC6, 0xC6)),
        ("MAX in 48 h", "<18 mM", RGBColor(0xF5, 0xC6, 0xC6)),
    ]
    y = Inches(2.65)
    for label, val, clr in targets:
        add_rect(slide, Inches(9.1), y, Inches(3.8), Inches(0.9), fill=clr)
        add_text_box(slide, label, Inches(9.2), y+Inches(0.04),
                     Inches(2.0), Inches(0.8), font_size=Pt(12), bold=True, color=NAVY)
        add_text_box(slide, val, Inches(11.2), y+Inches(0.04),
                     Inches(1.6), Inches(0.8), font_size=Pt(12.5), bold=True, color=RED)
        y += Inches(1.0)
    return slide


# ── SLIDE 19  Correction Rate & Monitoring ───────────────────────────────
def slide_monitoring():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Correction Rate, Monitoring & Overcorrection",
                  "Controlling the rate of correction \u2013 preventing ODS")

    bullet_box(slide,
               ["Rate of correction should be comparatively slow in CHRONIC hyponatremia",
                "Chronic rate targets: <6\u20138 mM in first 24 h  AND  <6 mM each subsequent 24 h",
                "Lower targets appropriate for patients at particular risk for ODS:",
                "  Alcoholics, malnourished patients, hypokalaemic patients",
                "Overcorrection CAN OCCUR even with appropriately slow correction:",
                "  When AVP levels rapidly normalise (e.g., after treatment of:",
                "    - Chronic hypovolemic hyponatremia with normal saline",
                "    - Hypopituitarism with glucocorticoid replacement",
                "    - Treatment of SIAD underlying cause)",
                "  ~10% of patients treated with vaptans will overcorrect",
                "  Risk increased if water intake not liberalised during vaptan therapy",
                "HOW TO MANAGE OVERCORRECTION:",
                "  Reinstitute / stabilize AVP effect \u2192 administer desmopressin (DDAVP)",
                "  Give free water (oral or IV D5W)",
                "  Goal: Prevent or reverse development of ODS",
                "MONITORING SCHEDULE:",
                "  During active correction: Check plasma Na\u207a every 2\u20134 hours",
                "  Adjust therapy based on observed rate of change",
                "  Institute twice-daily DDAVP + hypertonic saline if needed (controlled approach)"],
               Inches(0.4), Inches(1.3), Inches(8.0), Inches(5.8),
               font_size=Pt(13))

    add_rect(slide, Inches(8.7), Inches(1.3), Inches(4.3), Inches(5.8),
             fill=WHITE, line_color=TEAL, line_width=Pt(1.5))
    add_text_box(slide, "Monitoring Protocol",
                 Inches(8.8), Inches(1.4), Inches(4.1), Inches(0.4),
                 font_size=Pt(14), bold=True, color=NAVY)

    steps_monitor = [
        ("Every 2\u20134 hours", "Plasma Na\u207a during active correction", LIGHT_TEAL),
        ("Daily", "Serum electrolytes, renal function, urine osmolality", LIGHT_BG),
        ("Ongoing", "Urine output, fluid balance", LIGHT_BG),
        ("Assess", "If Na\u207a rising >10 mM/24 h \u2192 intervene with DDAVP + free water", RGBColor(0xF5, 0xC6, 0xC6)),
    ]
    y = Inches(1.9)
    for label, desc, clr in steps_monitor:
        add_rect(slide, Inches(8.8), y, Inches(4.1), Inches(1.0), fill=clr)
        add_text_box(slide, label, Inches(8.9), y+Inches(0.05),
                     Inches(3.9), Inches(0.35), font_size=Pt(12), bold=True, color=NAVY)
        add_text_box(slide, desc, Inches(8.9), y+Inches(0.42),
                     Inches(3.9), Inches(0.5), font_size=Pt(11.5), color=BLACK)
        y += Inches(1.1)

    add_text_box(slide,
                 "\u26A0  Twice-daily DDAVP + hypertonic saline 'clamp' approach: Used for patients with marked hyponatremia to maintain constant AVP bioactivity and allow controlled correction with hypertonic saline",
                 Inches(8.8), y+Inches(0.1), Inches(4.1), Inches(1.2),
                 font_size=Pt(11.5), color=NAVY, bold=True)
    return slide


# ── SLIDE 20  Summary & Approach Algorithm ────────────────────────────────
def slide_summary():
    slide = prs.slides.add_slide(blank_layout)
    set_bg(slide)
    add_title_bar(slide, "Summary: Clinical Approach to Hyponatremia",
                  "Step-by-step approach \u2013 Harrison 22e")

    steps = [
        ("Step 1", "Confirm true hyponatremia", NAVY,
         "Measure serum osmolality. Exclude pseudohyponatremia (hyperlipidemia, hyperproteinemia) and hypertonic hyponatremia (hyperglycemia). Effective osmolality <275 mOsm/kg confirms true hyponatremia."),
        ("Step 2", "Assess volume status", TEAL,
         "Clinical examination: JVP, skin turgor, mucous membranes, orthostatic hypotension. Classify as hypovolemic, euvolemic, or hypervolemic. This determines the etiologic group."),
        ("Step 3", "Measure urine Na\u207a & urine osmolality", MED_BLUE,
         "U\u2099\u2090: Distinguishes renal from non-renal Na\u207a loss. U osmolality: Distinguishes AVP-excess from polydipsia/low solute. Calculate urine-to-plasma electrolyte ratio (UECR) if fluid restriction planned for SIAD."),
        ("Step 4", "Determine acuity & severity", RGBColor(0x8B, 0x45, 0x13),
         "Acute (<48 h) or chronic (>48 h)? Severity: mild (130\u2013134 mM), moderate (125\u2013129 mM), severe (<125 mM)? Symptomatic? This determines urgency of correction."),
        ("Step 5", "Targeted treatment", RGBColor(0x2E, 0x7D, 0x32),
         "Hypovolemic: isotonic saline. Euvolemic/SIAD: fluid restriction \u00b1 pharmacotherapy (furosemide + salt tablets, vaptans, urea). Hypervolemic: treat underlying cause \u00b1 vaptans/diuretics."),
        ("Step 6", "Monitor & prevent ODS", RED,
         "Check plasma Na\u207a every 2\u20134 h. Target: <8\u201310 mM rise in 24 h (chronic). If overcorrection occurs: DDAVP + free water immediately. Provide supplemental O\u2082 if needed."),
    ]

    x_left = Inches(0.3)
    x_right = Inches(6.8)
    y = Inches(1.3)
    for i, (step_n, title, clr, desc) in enumerate(steps):
        x = x_left if i % 2 == 0 else x_right
        if i == 2:
            y = Inches(3.1)
        if i == 4:
            y = Inches(5.0)
        box_w = Inches(6.2)
        box_h = Inches(1.6)
        add_rect(slide, x, y, box_w, box_h, fill=WHITE, line_color=clr, line_width=Pt(1.5))
        add_rect(slide, x, y, Inches(1.1), box_h, fill=clr)
        add_text_box(slide, step_n, x+Inches(0.05), y+Inches(0.1),
                     Inches(1.0), Inches(0.4), font_size=Pt(13), bold=True, color=WHITE,
                     align=PP_ALIGN.CENTER)
        add_text_box(slide, title, x+Inches(1.2), y+Inches(0.05),
                     Inches(4.8), Inches(0.45), font_size=Pt(13.5), bold=True, color=clr)
        add_text_box(slide, desc, x+Inches(1.2), y+Inches(0.52),
                     Inches(4.8), Inches(1.0), font_size=Pt(11.5), color=BLACK)
    return slide


# ── SLIDE 21  Thank You ────────────────────────────────────────────────────
def slide_thankyou():
    slide = prs.slides.add_slide(blank_layout)
    add_rect(slide, 0, 0, SLIDE_W, SLIDE_H, fill=NAVY)
    add_rect(slide, 0, Inches(4.5), SLIDE_W, Inches(3.0), fill=RGBColor(0x07, 0x1A, 0x45))
    add_rect(slide, 0, Inches(4.45), SLIDE_W, Inches(0.08), fill=TEAL)
    add_rect(slide, 0, Inches(4.6), Inches(5), Inches(0.04), fill=GOLD)

    add_text_box(slide, "Thank You",
                 Inches(0.5), Inches(1.5), Inches(12), Inches(1.2),
                 font_size=Pt(64), bold=True, color=WHITE, align=PP_ALIGN.CENTER)
    add_text_box(slide,
                 "Hyponatremia: Pathophysiology, Classification, Diagnosis & Management",
                 Inches(0.5), Inches(2.9), Inches(12), Inches(0.6),
                 font_size=Pt(20), color=GOLD, align=PP_ALIGN.CENTER)
    add_text_box(slide,
                 "Based on Harrison's Principles of Internal Medicine, 22nd Edition\n"
                 "Chapter 56 \u2013 Fluid and Electrolyte Disturbances",
                 Inches(0.5), Inches(3.6), Inches(12), Inches(0.8),
                 font_size=Pt(16), italic=True, color=LIGHT_TEAL, align=PP_ALIGN.CENTER)
    add_text_box(slide,
                 "\u2022 Normal Na\u207a & Water Physiology   \u2022 Definition & Epidemiology   \u2022 Pathophysiology\n"
                 "\u2022 Hypovolemic / Euvolemic / Hypervolemic Hyponatremia   \u2022 SIAD Causes\n"
                 "\u2022 Clinical Features   \u2022 Acute Causes   \u2022 ODS   \u2022 Lab Investigation\n"
                 "\u2022 Treatment (Overview, Hypovolemic, Euvolemic, Hypervolemic, Acute)\n"
                 "\u2022 Correction Rate & Monitoring   \u2022 Clinical Approach Summary",
                 Inches(0.5), Inches(5.2), Inches(12), Inches(1.8),
                 font_size=Pt(12.5), color=WHITE, align=PP_ALIGN.CENTER)
    return slide


# ══════════════════════════════════════════════════════════════════════════
#  BUILD PRESENTATION
# ══════════════════════════════════════════════════════════════════════════
slide_title()             # Slide 1
slide_physiology()        # Slide 2
slide_definition()        # Slide 3
slide_patho()             # Slide 4
slide_hypovolemic()       # Slide 5
slide_euvolemic()         # Slide 6
slide_siad_causes()       # Slide 7
slide_hypervolemic()      # Slide 8
slide_diagnostic()        # Slide 9
slide_clinical()          # Slide 10
slide_acute_causes()      # Slide 11
slide_ods()               # Slide 12
slide_lab()               # Slide 13
slide_treatment_overview() # Slide 14
slide_tx_hypovolemic()    # Slide 15
slide_tx_euvolemic()      # Slide 16
slide_tx_hypervolemic()   # Slide 17
slide_tx_acute()          # Slide 18
slide_monitoring()        # Slide 19
slide_summary()           # Slide 20
slide_thankyou()          # Slide 21

output_path = "/tmp/workspace/hyponatremia-ppt/Hyponatremia_Harrison22.pptx"
prs.save(output_path)
print(f"Saved: {output_path}")
print(f"Total slides: {len(prs.slides)}")
Running Command

cd /tmp/workspace/hyponatremia-ppt && python create_ppt.py 2>&1

Running Command

ls -lh /tmp/workspace/hyponatremia-ppt/Hyponatremia_Harrison22.pptx

Your 21-slide Hyponatremia presentation is ready:

Hyponatremia Harrison22

Presentation · PPTX


Here's what's included across all 21 slides:
#Slide Title
1Title Slide - Hyponatremia (dark navy theme)
2Normal Sodium & Water Physiology (Na+ compartment, AVP regulation, RAAS, TBW)
3Definition & Epidemiology (up to 22% hospitalised patients; mild/moderate/severe classification)
4Pathophysiology (AVP pathway, brain adaptation in acute vs. chronic)
5Hypovolemic Hyponatremia (renal vs. non-renal causes, U_Na cutoffs)
6Euvolemic Hyponatremia (SIAD overview, hypothyroidism, secondary adrenal, low solute)
7Causes of SIAD - Table 56-1 (5-column table: malignancy, pulmonary, CNS, drugs, other)
8Hypervolemic Hyponatremia (CHF, cirrhosis, nephrotic; comparison table of all 3 types)
9Diagnostic Algorithm - Figure 56-5 (3-column flowchart: hypo/eu/hypervolemia + U_Na branches)
10Clinical Features (acute vs. chronic symptoms, severity spectrum)
11Causes of Acute Hyponatremia - Table 56-2 (iatrogenic, drugs, exercise, polydipsia)
12Osmotic Demyelination Syndrome (pathophysiology, risk factors, rescue with DDAVP)
13Laboratory Investigation (8 key tests: serum Osm, U_Osm, U_Na, glucose, uric acid, BUN, UECR, thyroid/adrenal)
14Treatment Overview - 3 major considerations (urgency, ODS risk, unpredictability)
15Treatment: Hypovolemic (isotonic saline, mechanism, special situations)
16Treatment: Euvolemic/SIAD (fluid restriction, UECR-guided, furosemide + salt, vaptans, urea)
17Treatment: Hypervolemic (CHF, cirrhosis, renal failure; vaptan guidance table)
18Treatment: Acute Symptomatic (100 mL 3% saline bolus, Na+ deficit formula, correction targets)
19Correction Rate & Monitoring (ODS prevention, overcorrection management, DDAVP clamp)
20Summary Algorithm (6-step clinical approach)
21Thank You slide
All content is sourced directly from Harrison's 22nd Edition, Chapter 56 (pages 347-352), referencing Figures 56-5 and Tables 56-1, 56-2, and 56-3.
This is a shared conversation. Sign in to Orris to start your own chat.