Hyponatremia evaluation teach me from basics to clinical cases

Reading File
Finding Sources
Finding Sources
Searching PubMed

"hyponatremia"[MeSH Terms] AND "diagnosis"[MeSH Terms]

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
I now have comprehensive material to write a thorough, textbook-quality teaching guide. Let me compose the full response.

Hyponatremia: From Basics to Clinical Cases

A structured deep dive using Harrison's 22E, Brenner & Rector's Kidney, Tintinalli's EM, NKF Primer, and Symptom-to-Diagnosis.

Part 1 - The Physiology Foundation

Water and Sodium: Why Na+ Reflects Water Balance

Sodium is the dominant extracellular cation. But serum [Na+] tells you nothing about total body sodium - it reflects the ratio of total body sodium to total body water (TBW).
Effective plasma osmolality (tonicity):
Posm = 2 × [Na+] + glucose/18 Normal: 275-290 mOsm/kg
Two key defense mechanisms maintain osmolality:
  1. AVP (vasopressin/ADH) - released by posterior pituitary in response to osmoreceptors in hypothalamus. Promotes free water reabsorption via V2 receptors in the collecting duct.
  2. Thirst - drives oral free water intake.
When either or both of these mechanisms malfunction - and the patient continues taking in free water - hyponatremia results.
"A key concept is that the absolute plasma Na+ concentration tells one nothing about the volume status of a given patient." - Harrison's Principles, 22E

What Happens to Cells?

When plasma becomes hypotonic (low osmolality), water moves into cells by osmosis - cells swell. Brain cells swelling inside a rigid skull is what causes the neurological symptoms of hyponatremia. Conversely, if hyponatremia is chronic, brain cells adapt by exporting organic osmolytes (taurine, glutamate, myoinositol) - this is why chronic hyponatremia is better tolerated than acute.

Part 2 - Definition and Epidemiology

TermDefinition
HyponatremiaSerum [Na+] < 135 mEq/L
Symptomatic thresholdUsually ≤ 125-130 mEq/L (but varies with acuity)
Severe hyponatremia< 120 mEq/L
AcuteDuration < 24-48 hours
ChronicDuration > 48 hours
  • Occurs in up to 22% of hospitalized patients (Harrison's 22E)
  • In cancer patients, prevalence: 4-47%; associated with 2-5x increased 90-day mortality (Brenner & Rector)
  • Most common electrolyte disorder encountered in clinical medicine

Part 3 - Step-by-Step Diagnostic Framework

The classic approach moves through four sequential questions:

Step 1 - Is This True Hypotonic Hyponatremia?

First, measure serum osmolality and calculate effective osmolality (tonicity).
Three types of hyponatremia by osmolality:
TypeMeasured PosmCauseExample
Isotonic (pseudohyponatremia)Normal (275-290)Lab artifactExtreme hyperlipidemia, hyperproteinemia (myeloma)
HypertonicElevated (>290)Osmotically active soluteHyperglycemia, mannitol, sorbitol
Hypotonic (true hyponatremia)Low (<275)Excess free water relative to Na+All causes below
Glucose correction: For every 100 mg/dL rise in glucose, serum [Na+] falls by ~1.6-2.4 mEq/L due to osmotic water efflux from cells. This is "true" hyponatremia that resolves when glucose is corrected.
In pseudohyponatremia (e.g., severe hyperlipidemia), the lab overestimates plasma water because it assumes plasma is 93% water. The measured osmolality is normal even though reported [Na+] is low. - Harrison's 22E

Step 2 - What is the Volume Status? (ECF Assessment)

This is the most important clinical step. Classify the patient into one of three categories:
Volume StatusClinical SignsPathophysiology
HypovolemicOrthostatic hypotension, tachycardia, dry mucous membranes, skin tenting, ↑BUN/Cr, ↑uric acidNa+ and water lost; AVP rises to preserve volume
EuvolemicNormal exam - no edema, no signs of depletionWater retained without Na+ retention
HypervolemicPeripheral edema, ascites, elevated JVP, S3 gallopNa+ and water both retained, but water excess > Na+
"Clinically detectable hypovolemia, determined most sensitively by careful measurement of orthostatic changes in BP and pulse, usually indicates some degree of solute depletion. Elevations of BUN and uric acid are useful laboratory correlates." - NKF Primer on Kidney Diseases, 8E

Step 3 - Urine Osmolality (Uosm)

This tells you what the kidneys are doing with water - i.e., is AVP active?
UosmInterpretation
< 100 mOsm/kgAVP is suppressed - kidney is making maximally dilute urine. Think: polydipsia (psychogenic or beer potomania), exercise-associated hyponatremia
100-300 mOsm/kgPartially diluted urine - mixed picture (partial AVP, or solute depletion limiting water excretion)
> 300 mOsm/kgAVP is active - kidney is concentrating. Most clinical hyponatremia
> 400 mOsm/kgAVP playing dominant role
"Urine osmolality > 100 mOsm/L H2O with the exception of patients with psychogenic polydipsia, which drives down urine osmolality below 100." - Tintinalli's EM
Quick estimation trick: If urine osmolality not immediately available, use specific gravity (π):
Uosm ≈ (hundredths + thousandths digits of π) × 35 Example: π = 1.015 → 15 × 35 = 525 mOsm/L

Step 4 - Urine Sodium (UNa)

This tells you the kidney's sodium-handling, which helps narrow the cause within each volume category.
Volume StatusUNaInterpretation
Hypovolemic< 20-30 mEq/LExtra-renal Na+ loss (GI, skin) - kidneys appropriately conserving Na+
Hypovolemic> 20-30 mEq/LRenal Na+ wasting (diuretics, adrenal insufficiency, salt-losing nephropathy, CSW)
Euvolemic (SIADH)> 30 mEq/LInappropriately high despite low plasma [Na+]
Hypervolemic (CHF, cirrhosis, nephrotic)< 10 mEq/LKidneys avidly retaining Na+ due to perceived underfilling
Hypervolemic (renal failure)> 20 mEq/LKidneys cannot retain Na+
Caution: Thiazide diuretics can produce high UNa mimicking SIADH. Wait 1-2 weeks after stopping thiazide before diagnosing SIADH. Diuretics are the most common cause of hypovolemic hyponatremia - and thiazides cause it far more commonly than loop diuretics because they impair the diluting segment (early distal tubule) while preserving the concentrating mechanism.

The Master Diagnostic Algorithm

Hyponatremia evaluation and treatment algorithm from NKF Primer on Kidney Diseases, 8E
Fig. 7.1 - Algorithm for evaluation and treatment of hyponatremia. (NKF Primer on Kidney Diseases, 8E)

Part 4 - Causes by Volume Category

A. Hypovolemic Hyponatremia

The body loses Na+ (and water), AVP rises to defend blood pressure, and if free water is then consumed, [Na+] falls.
Extra-renal causes (UNa < 20):
  • GI losses: vomiting, diarrhea, NG drainage
  • Insensible losses: sweating (especially cystic fibrosis with salty sweat), burns
  • Third spacing: pancreatitis, bowel obstruction
Renal causes (UNa > 20):
  • Thiazide diuretics (most common - impairs NaCl cotransporter in DCT)
  • Adrenal insufficiency (primary Addison's: ↓aldosterone → Na+ wasting; also hyperkalemia + hyponatremia + hypotension is a classic triad)
  • Salt-losing nephropathies: reflux nephropathy, interstitial nephritis, medullary cystic disease, post-ATN recovery
  • Cerebral salt wasting (CSW) - seen in intracranial pathology (SAH, TBI); must distinguish from SIADH because treatment differs (CSW requires sodium + volume replacement, not fluid restriction)

B. Euvolemic Hyponatremia

The most common category in hospitalized patients. Water is retained without a matching Na+ gain, so no obvious edema.

SIADH - Syndrome of Inappropriate Antidiuretic Hormone

Diagnostic criteria:
CriterionValue
Hypotonic hyponatremiaPosm < 275 mOsm/kg
Inappropriately elevated urine osmolalityUsually > 200 mOsm/kg
Elevated urine Na+Typically > 20 mEq/L
Clinical euvolemiaNo signs of volume depletion or overload
Normal adrenal, renal, cardiac, hepatic, thyroid functionRule out other causes
(Tintinalli's Emergency Medicine, Table 17-6)
Causes of SIADH:
CategoryExamples
CNS disordersMeningitis, encephalitis, brain abscess, SAH, subdural hematoma, stroke, trauma, psychosis
Pulmonary disordersPneumonia, TB, lung abscess, empyema, acute respiratory failure, positive-pressure ventilation
Malignancy (ectopic AVP)Small cell lung cancer (most common - 10-15% of SCLC), pancreatic, duodenal, bladder, prostate, lymphoma
MedicationsSSRIs/SNRIs, thiazides, carbamazepine, oxcarbazepine, cyclophosphamide, vincristine, cisplatin, NSAIDs, opioids, amiodarone, desmopressin, haloperidol, phenothiazines
MiscellaneousMajor surgery, pain, nausea, HIV, hypothyroidism (also separate mechanism)
Serum uric acid in SIADH: Patients with SIAD physiology are typically hypouricemic (< 4 mg/dL) due to uricosuria from volume expansion, in contrast to hypovolemic patients who are hyperuricemic.
U/P electrolyte ratio: Calculate (urine [Na+] + urine [K+]) / plasma [Na+]:
  • Ratio > 1: Aggressively restrict fluids to < 500 mL/day
  • Ratio ~1: Restrict to 500-700 mL/day
  • Ratio < 1: Restrict to < 1 L/day This predicts responsiveness to fluid restriction.

Other Euvolemic Causes:

  • Hypothyroidism: Reduced cardiac output → reduced GFR + non-osmotic AVP release. TSH is essential in the workup.
  • Secondary adrenal insufficiency (pituitary/hypothalamic): Unlike primary Addison's (which is hypovolemic with hyperkalemia), secondary AI is euvolemic and normokalemic - aldosterone is intact, only cortisol is deficient. Cosyntropin stimulation test differentiates.
  • Beer potomania / low solute intake: Extremely low solute intake limits the kidneys' ability to excrete free water regardless of AVP status. Uosm is typically very low (100-200s), UNa < 20. High risk of ODS upon treatment due to associated hypokalemia + malnutrition.
  • Psychogenic polydipsia: Massive water intake overwhelms renal excretion. Uosm < 100 (maximally dilute - AVP is suppressed). Common in schizophrenia.
  • Exercise-associated hyponatremia (EAH): Acute, from excessive hypotonic fluid intake during endurance events, combined in ~44% of cases with SIADH. Weight gain during race is the key clue. Uosm < 100 in pure water intoxication. Dangerous because acute onset causes severe symptoms.

C. Hypervolemic Hyponatremia

Both Na+ and water are retained, but water exceeds Na+. There is "effective arterial underfilling" - the body perceives low perfusion despite expanded ECF, leading to neurohumoral activation and AVP release.
CauseUNaKey Features
Congestive heart failure< 10 mEq/L↑JVP, S3, dyspnea, BNP elevated
Cirrhosis< 10 mEq/LAscites, spider angiomata, asterixis, ↑bilirubin
Nephrotic syndrome< 10 mEq/LMassive proteinuria, edema, hypoalbuminemia
Advanced renal failure> 20 mEq/L↑Cr, ↑K+, uremic features

Part 5 - Symptoms and Severity

Symptoms are primarily neurological due to cerebral edema:
SeveritySymptoms
Mild (130-135)Often asymptomatic; nausea, malaise
Moderate (125-130)Headache, lethargy, confusion, muscle cramps
Severe (<125, especially acute)Seizures, obtundation, respiratory arrest, brain herniation, coma, death
Acute vs. chronic matters clinically:
  • Acute hyponatremia (< 48 h) - brain hasn't adapted, symptoms occur at higher [Na+] levels, risk of herniation
  • Chronic hyponatremia (> 48 h) - brain has adapted by losing organic osmolytes, symptoms may be minimal even at [Na+] 115-120

Part 6 - Treatment

Three Governing Principles (Harrison's 22E)

  1. Symptom severity determines urgency
  2. Overcorrection risk - ODS in chronic hyponatremia
  3. Monitor frequently - response to treatment is unpredictable

Treatment by Category

Symptomatic / Acute / Severe

Hypertonic 3% NaCl is the treatment for acute life-threatening hyponatremia (seizures, coma):
StepAction
1Give 100-150 mL of 3% NaCl IV over 15-20 minutes
2Check serum [Na+] after each infusion
3Stop when symptoms improve OR [Na+] rises 4-6 mEq/L
4May repeat up to 3 doses (total 450 mL)
5Limit total correction to ≤ 8-12 mEq/L in first 24 h, ≤ 18 mEq/L in 48 h
(Tintinalli's EM, Table 17-7)

Chronic Mild-Moderate Hyponatremia - By Cause

CauseTreatment
HypovolemicIsotonic normal saline (0.9% NaCl) - repletes volume → AVP suppresses → water diuresis corrects [Na+]. Correct K+ as needed.
SIADH / euvolemicFluid restriction (first-line); oral Na+ supplementation; urea; demeclocycline; vaptans (tolvaptan, conivaptan)
CHF / hypervolemicTreat underlying cause (ACE-I, diuretics, optimize cardiac output); fluid restriction; vaptans for refractory cases
HypothyroidismThyroid hormone replacement
Adrenal insufficiencyCorticosteroid replacement
Beer potomania / low soluteIV saline + resume normal diet; high-risk for ODS
EAH (acute)Hypertonic saline urgently if symptomatic; fluid restriction; stop hypotonic fluid intake
Fluid restriction guidance (SIADH): Use the urine-to-plasma electrolyte ratio to individualize:
  • U/P ratio > 1 → restrict to < 500 mL/day
  • U/P ratio ~1 → 500-700 mL/day
  • U/P ratio < 1 → < 1 L/day
Vaptans (AVP V2 receptor antagonists - tolvaptan, conivaptan): Cause selective free water excretion (aquaresis). Indicated in SIADH and hypervolemic hyponatremia refractory to other measures. A 2025 meta-analysis (PMID 40288608) confirmed low-dose tolvaptan is effective and safe for SIADH. Contraindicated in hypovolemic hyponatremia (will worsen volume depletion). Must start in hospital with close monitoring due to overcorrection risk.
Urea (oral): Increases solute load → increases free water excretion. A 2025 systematic review (PMID 39362395) confirmed efficacy and safety for SIADH hyponatremia.

Part 7 - Osmotic Demyelination Syndrome (ODS)

The most feared complication of hyponatremia treatment.

Mechanism

When chronic hyponatremia is corrected too rapidly, water exits brain cells into a now hypertonic ECF. Brain cells that had lost organic osmolytes during adaptation are left with insufficient osmolytes to maintain volume - leading to intracellular dehydration and myelin damage. The pons is most vulnerable - hence the older term central pontine myelinolysis (CPM).

Risk Factors for ODS

  • Serum [Na+] < 120 mEq/L
  • Duration > 48 hours (chronic)
  • Hypokalemia
  • Alcoholism, cirrhosis
  • Malnutrition
  • Beer potomania (extremely high risk)
  • Use of vaptans

Correction Limits

Time PeriodMax Safe Correction
First 24 hours≤ 8-10 mEq/L (some guidelines allow up to 12 for acute)
First 48 hours≤ 18 mEq/L

Clinical Presentation of ODS

Symptoms appear 2-6 days AFTER rapid correction (not immediately):
  • Dysarthria, dysphagia
  • Behavioral changes, lethargy
  • Paraparesis or quadriparesis
  • Locked-in syndrome (in severe cases)
  • Seizures, coma

If Overcorrection Occurs

  • Administer 5% dextrose in water at 3 mL/kg/h
  • Add desmopressin (DDAVP) to stop further free water excretion
  • Loop diuretics
  • Goal: bring [Na+] back down toward the safe correction target

Part 8 - Clinical Cases


Case 1 - The Dehydrated Vomiter

67-year-old woman presents with 3 days of vomiting and decreased PO intake. BP 95/60 mmHg lying, 78/50 mmHg standing (orthostatic drop). HR 112. Dry mucous membranes. Skin tenting. No edema.
Labs: [Na+] 124, K+ 3.1, Cl- 88, BUN 42, Cr 1.6, glucose 95, serum Posm 258. Urine [Na+] 8, Uosm 680.
Analysis:
  • Step 1: Posm 258 - true hypotonic hyponatremia ✓
  • Step 2: Clearly hypovolemic (orthostatics, tachycardia, dry MM, ↑BUN/Cr, ↑uric acid presumed)
  • Step 3: Uosm 680 - AVP is very active (kidney concentrating urine to preserve volume)
  • Step 4: UNa 8 - extra-renal Na+ loss (kidneys are avid for Na+ - GI losses)
Diagnosis: Hypovolemic hyponatremia from GI losses
Treatment: Isotonic normal saline (0.9% NaCl). As volume is restored → baroreceptors detect volume repletion → AVP suppresses → brisk water diuresis → [Na+] corrects. Also correct K+ (hypokalemia can drive further [Na+] falls and is an ODS risk factor). Monitor [Na+] every 4-6 hours to avoid overcorrection. Limit correction to < 10 mEq/L in first 24 h.

Case 2 - The SIADH Patient

52-year-old man with small cell lung cancer presents with fatigue, confusion, and headache for 1 week. No edema, no orthostasis, no signs of volume depletion.
Labs: [Na+] 118, K+ 3.9, BUN 12, Cr 0.8, glucose 90, serum Posm 242. Urine [Na+] 65, Uosm 520. Serum uric acid 2.8 mg/dL.
Analysis:
  • Step 1: Posm 242 - true hypotonic hyponatremia ✓
  • Step 2: Euvolemic - no edema, no depletion
  • Step 3: Uosm 520 - AVP is active despite hyponatremia (inappropriate)
  • Step 4: UNa 65 - very high (kidney not retaining Na+)
  • Serum uric acid < 4 → SIADH physiology
  • Clinical context: SCLC producing ectopic AVP
Diagnosis: SIADH from paraneoplastic (small cell lung cancer)
U/P electrolyte ratio: (65 + 18) / 118 ≈ 0.70 → restrict to < 1 L/day
Treatment: Fluid restriction < 1 L/day. Consider oral sodium tablets + urea to increase solute load. If refractory, tolvaptan (in-hospital initiation). Treat underlying SCLC - AVP levels track with tumor response.
Important: Cancer-associated hyponatremia is associated with 2-5x higher 90-day mortality. Serial [Na+] tracks disease course.

Case 3 - The Marathon Runner

29-year-old woman collapses 30 minutes after completing a marathon. She is confused and seizing. Bystanders report she drank water continuously during the race. Weight gain noted during race.
Labs: [Na+] 112, Posm 228. Uosm 68. UNa 12.
Analysis:
  • Uosm < 100 → AVP is SUPPRESSED → maximally dilute urine
  • This is acute water intoxication, not chronic hyponatremia
  • UNa 12 reflects some sodium conservation but is less useful here
  • The low Uosm with acute onset during endurance event = Exercise-Associated Hyponatremia (EAH)
Treatment (Emergency): This is acute, life-threatening, symptomatic hyponatremia. Despite the "slow" risk of ODS from rapid correction, acute hyponatremia presenting with seizures/coma requires immediate hypertonic saline:
  • 150 mL of 3% NaCl IV over 20 minutes
  • Recheck [Na+], may repeat up to 3 times
  • Stop when seizures resolve or [Na+] rises 4-6 mEq/L
  • Since this is acute (< 24 hours), the risk of ODS is low - the brain has not had time to adapt by losing osmolytes

Case 4 - Thiazide Mimic of SIADH

72-year-old woman started on HCTZ 3 weeks ago for hypertension. Presents with weakness, mild confusion. No edema, no orthostasis.
Labs: [Na+] 122, Posm 256, Uosm 380, UNa 45, K+ 2.8.
Analysis:
  • Looks exactly like SIADH - euvolemic, high UNa, high Uosm
  • But: started thiazide 3 weeks ago, hypokalemia (K+ 2.8)
  • Thiazide mechanism: blocks NaCl cotransporter in DCT (diluting segment) → impairs water excretion + volume depletion → AVP rises + polydipsia
Pitfall: Do NOT diagnose SIADH until 1-2 weeks after stopping the thiazide. The low K+ is an important clue - few causes of hyponatremia also produce significant hypokalemia.
Treatment: Stop thiazide. Correct K+ (KCl replacement will itself raise [Na+]). Normal saline if symptomatic. Monitor closely. Consider switching to loop diuretic if BP control still needed.

Case 5 - Adrenal Crisis

38-year-old man with HIV, fatigue, nausea, hyperpigmentation, weight loss. BP 88/55, HR 105.
Labs: [Na+] 126, K+ 5.9, glucose 58, BUN 28, Cr 1.2, Posm 268. Uosm 520, UNa 68.
Analysis:
  • Hypovolemic + hyperkalemia + hyponatremia + hypotension → classic triad
  • Hyperpigmentation in HIV patient → think primary adrenal insufficiency (Addison's disease - HIV can cause adrenal infiltration by CMV, MAI, or direct HIV)
  • High UNa despite hypovolemia → kidneys cannot retain Na+ (no aldosterone)
Diagnosis: Primary adrenal insufficiency (Addison's disease)
Treatment: IV hydrocortisone 100 mg immediately + isotonic saline. Cosyntropin stimulation test (if time permits before starting steroids, draw cortisol level first). Do not delay treatment for test results in a sick patient.

Part 9 - High-Yield Summary Table

ConditionVolumeUosmUNaKey ClueTreatment
GI lossesHigh< 20Orthostasis, vomiting/diarrhea0.9% NS
Thiazide↓ or euvolemicHigh> 20Hypokalemia, recent thiazideStop drug, correct K+
Adrenal insufficiency (primary)High>> 20Hyperkalemia, hyperpigmentationHydrocortisone + NS
CSWHigh> 20CNS pathology (SAH, TBI)Na+ + volume
SIADHEuvolemic> 200> 30Exclusion diagnosisFluid restriction ± urea ± vaptan
HypothyroidismEuvolemicVariableVariableFatigue, myxedema, ↑TSHT4 replacement
Secondary AIEuvolemicHigh> 20Normokalemic, pituitary diseaseCortisol
Beer potomaniaEuvolemic< 100-200< 20Alcoholism, low solute dietNS + diet; high ODS risk
Psychogenic polydipsiaEuvolemic< 100LowPsychiatric hx, schizophreniaFluid restriction, treat psych
EAHEuvolemic< 100LowPost-endurance event, weight gainHypertonic saline if severe
CHFHigh< 10Edema, ↑JVP, ↑BNPTreat CHF, fluid restrict, vaptan
CirrhosisHigh< 10Ascites, spider angiomataTreat liver disease, fluid restrict
Renal failureVariable> 20↑Cr, ↑K+Dialysis

Part 10 - Recent Evidence Updates (2024-2026)

  • Tolvaptan (PMID 40288608, 2025): Systematic review/meta-analysis confirmed low-dose tolvaptan is effective and safe for SIADH-associated hyponatremia, with comparable efficacy to standard doses but fewer adverse effects.
  • Urea (PMID 39362395, 2025): Meta-analysis of urea vs. other treatments for SIADH hyponatremia confirmed urea is effective, safe, inexpensive, and under-utilized. Particularly useful when fluid restriction is poorly tolerated.
  • Point-of-care ultrasound (PMID 41528666, 2026): Systematic review supports POCUS as a complementary tool in hyponatremia evaluation for assessing ECF volume status (IVC collapsibility, lung B-lines for CHF, ascites for cirrhosis) - particularly valuable when clinical volume assessment is uncertain.

Quick Reference: The 4-Question Framework

1. Is Posm low? (True hypotonic hyponatremia?)
        ↓
2. What is the ECF volume? (Hypo / Eu / Hypervolemic?)
        ↓
3. What is Uosm? (Is AVP active?)
        ↓
4. What is UNa? (Renal vs. extra-renal? Appropriate vs. inappropriate?)
Once you have these four answers + the clinical context, the diagnosis is almost always apparent.

Sources: Harrison's Principles of Internal Medicine 22E (2025); NKF Primer on Kidney Diseases 8E; Tintinalli's Emergency Medicine; Symptom to Diagnosis 4E; Brenner & Rector's The Kidney; PubMed: PMID 40288608, 39362395, 41528666

Convert above data into short presentation

Reading File
Reading File
Reading File
Running Command

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

Writing File

~/hyponatremia-ppt/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Hyponatremia: Evaluation & Management";
pres.author = "Orris Medical Education";

// ─── PALETTE ───────────────────────────────────────────────────────────────
const C = {
  navy:    "0A2342",   // dominant bg
  teal:    "0D7377",   // accent / header bars
  aqua:    "14BDAC",   // highlight / accent
  white:   "FFFFFF",
  offWhite:"F0F4F8",
  yellow:  "F5C518",   // callout
  red:     "E63946",   // danger / ODS
  gray:    "94A3B8",
  lightBg: "EBF4F6",   // light slide bg
  darkText:"1E293B",
};

// ─── HELPERS ────────────────────────────────────────────────────────────────
function darkSlide(slide) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy}, line:{color:C.navy} });
}
function lightSlide(slide) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.offWhite}, line:{color:C.offWhite} });
}
function tealBar(slide, y=0, h=1.1) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:y, w:"100%", h:h, fill:{color:C.teal}, line:{color:C.teal} });
}
function accentLine(slide, y) {
  slide.addShape(pres.ShapeType.rect, { x:0.4, y:y, w:1.2, h:0.07, fill:{color:C.aqua}, line:{color:C.aqua} });
}
function sectionTag(slide, label) {
  slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:2.6, h:0.38, fill:{color:C.aqua}, line:{color:C.aqua} });
  slide.addText(label, { x:0, y:0, w:2.6, h:0.38, fontSize:11, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 });
}
function slideTitle(slide, title, x=0.4, y=0.55, w=9.2, color=C.white) {
  slide.addText(title, { x, y, w, h:0.65, fontSize:26, bold:true, color, fontFace:"Calibri", valign:"middle" });
}
function bodyText(slide, items, x, y, w, h, color=C.darkText, size=14) {
  const arr = items.map((item, i) => ({
    text: item,
    options: { bullet: true, breakLine: i < items.length - 1, fontSize: size, color, fontFace:"Calibri" }
  }));
  slide.addText(arr, { x, y, w, h, valign:"top" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  // teal left accent strip
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:"100%", fill:{color:C.aqua}, line:{color:C.aqua} });
  // big aqua circle decoration
  s.addShape(pres.ShapeType.ellipse, { x:7.5, y:-1.2, w:4.5, h:4.5, fill:{color:C.teal, transparency:75}, line:{color:C.teal, transparency:75} });
  s.addShape(pres.ShapeType.ellipse, { x:8.2, y:2.8, w:2.8, h:2.8, fill:{color:C.aqua, transparency:85}, line:{color:C.aqua, transparency:85} });

  s.addText("HYPONATREMIA", { x:0.5, y:1.2, w:9, h:0.7, fontSize:44, bold:true, color:C.aqua, charSpacing:6, fontFace:"Calibri" });
  s.addText("Evaluation & Management", { x:0.5, y:2.0, w:9, h:0.55, fontSize:26, color:C.white, fontFace:"Calibri" });
  s.addText("From Basics to Clinical Cases", { x:0.5, y:2.65, w:9, h:0.4, fontSize:16, color:C.gray, fontFace:"Calibri", italic:true });
  accentLine(s, 3.2);
  s.addText("Based on Harrison's 22E · Brenner & Rector · Tintinalli's EM · NKF Primer", {
    x:0.5, y:4.8, w:9, h:0.35, fontSize:11, color:C.gray, fontFace:"Calibri", italic:true
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — DEFINITION & EPIDEMIOLOGY
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  tealBar(s, 0, 1.05);
  sectionTag(s, "BASICS");
  slideTitle(s, "Definition & Epidemiology", 0.4, 0.2, 9.2, C.white);

  // 4 stat boxes
  const boxes = [
    { label:"Definition", val:"Na⁺ < 135 mEq/L", sub:"Symptoms rare until ≤125 mEq/L" },
    { label:"Prevalence", val:"Up to 22%", sub:"Of all hospitalized patients" },
    { label:"Acute", val:"< 48 hours", sub:"Brain not yet adapted — high risk" },
    { label:"Chronic", val:"> 48 hours", sub:"Brain adapted — symptoms milder" },
  ];
  boxes.forEach((b, i) => {
    const x = 0.3 + i * 2.38;
    s.addShape(pres.ShapeType.rect, { x, y:1.25, w:2.15, h:3.6, fill:{color:C.white}, line:{color:C.teal, pt:2},
      shadow:{type:"outer", color:"000000", blur:8, offset:2, angle:135, opacity:0.10} });
    s.addShape(pres.ShapeType.rect, { x, y:1.25, w:2.15, h:0.45, fill:{color:C.teal}, line:{color:C.teal} });
    s.addText(b.label, { x, y:1.25, w:2.15, h:0.45, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
    s.addText(b.val, { x, y:1.78, w:2.15, h:1.1, fontSize:17, bold:true, color:C.navy, align:"center", valign:"middle", fontFace:"Calibri" });
    s.addText(b.sub, { x, y:2.88, w:2.15, h:1.5, fontSize:11, color:C.darkText, align:"center", valign:"top", fontFace:"Calibri", wrap:true });
  });

  // severity strip
  s.addShape(pres.ShapeType.rect, { x:0.3, y:5.0, w:9.4, h:0.4, fill:{color:C.navy}, line:{color:C.navy} });
  s.addText("Severity: Mild 130–135 | Moderate 125–130 | Severe < 125 mEq/L", {
    x:0.3, y:5.0, w:9.4, h:0.4, fontSize:12, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — PHYSIOLOGY
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  tealBar(s, 0, 1.05);
  sectionTag(s, "PHYSIOLOGY");
  slideTitle(s, "Why Does Hyponatremia Happen?", 0.4, 0.2, 9.2, C.white);

  // two columns
  // Left: physiology
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.2, w:4.55, h:4.1, fill:{color:C.white}, line:{color:C.teal, pt:1.5} });
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.2, w:4.55, h:0.42, fill:{color:C.navy}, line:{color:C.navy} });
  s.addText("Key Concept: Na⁺ Reflects Water Balance", { x:0.3, y:1.2, w:4.55, h:0.42, fontSize:11.5, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 });
  bodyText(s, [
    "Serum [Na⁺] = Total Body Na⁺ / Total Body Water",
    "Hyponatremia = excess water relative to sodium",
    "AVP (vasopressin) is the main regulator — promotes renal free-water reabsorption",
    "Most cases = excess AVP + free water intake",
    "Volume status modulates AVP: hypovolemia → ↑AVP even at normal osmolality",
  ], 0.5, 1.75, 4.2, 3.4, C.darkText, 12.5);

  // Right: defense mechanisms
  s.addShape(pres.ShapeType.rect, { x:5.15, y:1.2, w:4.55, h:4.1, fill:{color:C.white}, line:{color:C.aqua, pt:1.5} });
  s.addShape(pres.ShapeType.rect, { x:5.15, y:1.2, w:4.55, h:0.42, fill:{color:C.aqua}, line:{color:C.aqua} });
  s.addText("Two Defense Mechanisms", { x:5.15, y:1.2, w:4.55, h:0.42, fontSize:11.5, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 });
  bodyText(s, [
    "① AVP release by posterior pituitary → water reabsorption",
    "② Thirst → drives oral water intake",
    "Defect in either + free water intake → hyponatremia",
    "Brain cell swelling → neurological symptoms",
    "Chronic: brain adapts by losing organic osmolytes (taurine, glutamate) → less symptomatic",
  ], 5.35, 1.75, 4.2, 3.4, C.darkText, 12.5);

  // formula bar
  s.addShape(pres.ShapeType.rect, { x:0.3, y:5.35, w:9.4, h:0.42, fill:{color:C.yellow, transparency:15}, line:{color:C.yellow} });
  s.addText("Effective Osmolality = 2×[Na⁺] + Glucose/18    |    Normal: 275–290 mOsm/kg", {
    x:0.3, y:5.35, w:9.4, h:0.42, fontSize:13, bold:true, color:C.navy, align:"center", valign:"middle", margin:0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — 4-STEP DIAGNOSTIC FRAMEWORK
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionTag(s, "DIAGNOSIS");
  slideTitle(s, "The 4-Step Diagnostic Framework", 0.4, 0.2, 9.2, C.aqua);
  accentLine(s, 1.0);

  const steps = [
    { num:"1", title:"Serum Osmolality", body:"Is this TRUE hypotonic hyponatremia?\nRule out pseudohyponatremia (lipemia, paraprotein)\nand hypertonic (hyperglycemia, mannitol)", color:C.teal },
    { num:"2", title:"ECF Volume Status", body:"Hypovolemic / Euvolemic / Hypervolemic\nMost important clinical step\nOrthostatics, JVP, edema, BUN/Cr, uric acid", color:"1565C0" },
    { num:"3", title:"Urine Osmolality", body:"Is AVP active?\n< 100 = AVP suppressed (polydipsia, EAH)\n> 300 = AVP active (most clinical hyponatremia)", color:"6A0572" },
    { num:"4", title:"Urine Sodium", body:"Renal vs. extra-renal? Appropriate vs. not?\n< 20: extra-renal loss or Na⁺-avid state\n> 30: renal wasting or SIADH", color:"B5451B" },
  ];

  steps.forEach((st, i) => {
    const x = 0.25 + i * 2.42;
    s.addShape(pres.ShapeType.rect, { x, y:1.18, w:2.2, h:4.15, fill:{color:st.color}, line:{color:st.color} });
    s.addShape(pres.ShapeType.ellipse, { x: x+0.7, y:1.25, w:0.8, h:0.8, fill:{color:C.white}, line:{color:C.white} });
    s.addText(st.num, { x: x+0.7, y:1.25, w:0.8, h:0.8, fontSize:20, bold:true, color:st.color, align:"center", valign:"middle", margin:0 });
    s.addText("STEP "+st.num, { x, y:2.18, w:2.2, h:0.35, fontSize:10, bold:true, color:C.white, align:"center", valign:"middle", margin:0, charSpacing:3 });
    s.addText(st.title, { x, y:2.55, w:2.2, h:0.5, fontSize:13.5, bold:true, color:C.yellow, align:"center", valign:"middle", fontFace:"Calibri" });
    s.addText(st.body, { x:x+0.1, y:3.1, w:2.0, h:2.1, fontSize:10.5, color:C.white, fontFace:"Calibri", wrap:true, valign:"top" });
  });

  s.addText("Combine all 4 steps with clinical context → diagnosis is almost always apparent", {
    x:0.4, y:5.4, w:9.2, h:0.35, fontSize:12, italic:true, color:C.gray, align:"center"
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — URINE VALUES QUICK REF
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  tealBar(s, 0, 1.05);
  sectionTag(s, "LAB KEYS");
  slideTitle(s, "Key Urine Tests at a Glance", 0.4, 0.2, 9.2, C.white);

  // Uosm table
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:0.42, fill:{color:C.navy}, line:{color:C.navy} });
  s.addText("URINE OSMOLALITY (Uosm)", { x:0.3, y:1.15, w:9.4, h:0.42, fontSize:13, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 });
  const uosmRows = [
    ["< 100 mOsm/kg", "AVP suppressed", "Psychogenic polydipsia, beer potomania, EAH"],
    ["100 – 300", "Partial suppression", "Mixed picture, solute depletion"],
    ["> 300 mOsm/kg", "AVP active", "Most clinical hyponatremia"],
    ["> 400 mOsm/kg", "AVP dominant", "SIADH, severe volume depletion"],
  ];
  const rowColors = [C.lightBg, C.white, C.lightBg, C.white];
  uosmRows.forEach((row, i) => {
    const y = 1.57 + i * 0.5;
    s.addShape(pres.ShapeType.rect, { x:0.3, y, w:9.4, h:0.49, fill:{color:rowColors[i]}, line:{color:C.teal, pt:0.5} });
    s.addText(row[0], { x:0.35, y, w:2.4, h:0.49, fontSize:12, bold:true, color:C.teal, valign:"middle" });
    s.addText(row[1], { x:2.8, y, w:2.4, h:0.49, fontSize:12, color:C.navy, valign:"middle" });
    s.addText(row[2], { x:5.25, y, w:4.4, h:0.49, fontSize:11, color:C.darkText, valign:"middle", italic:true });
  });

  // UNa strip
  s.addShape(pres.ShapeType.rect, { x:0.3, y:3.65, w:9.4, h:0.42, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText("URINE SODIUM (UNa)", { x:0.3, y:3.65, w:9.4, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
  const unaRows = [
    ["< 20 mEq/L", "Extra-renal loss / Na⁺-avid state", "Diarrhea/vomiting, CHF, cirrhosis, nephrotic"],
    ["> 20–30 mEq/L", "Renal Na⁺ wasting or SIADH", "Diuretics, adrenal insufficiency, SIADH, CSW"],
  ];
  unaRows.forEach((row, i) => {
    const y = 4.07 + i * 0.5;
    s.addShape(pres.ShapeType.rect, { x:0.3, y, w:9.4, h:0.49, fill:{color:i===0?C.lightBg:C.white}, line:{color:C.teal, pt:0.5} });
    s.addText(row[0], { x:0.35, y, w:2.4, h:0.49, fontSize:12, bold:true, color:C.teal, valign:"middle" });
    s.addText(row[1], { x:2.8, y, w:2.9, h:0.49, fontSize:12, color:C.navy, valign:"middle" });
    s.addText(row[2], { x:5.75, y, w:3.9, h:0.49, fontSize:11, color:C.darkText, valign:"middle", italic:true });
  });

  s.addText("Quick Tip: Urine specific gravity 1.015 → Uosm ≈ 15 × 35 = 525 mOsm/L", {
    x:0.3, y:5.12, w:9.4, h:0.35, fontSize:11, italic:true, color:C.gray, align:"center"
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — THREE VOLUME CATEGORIES
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionTag(s, "CATEGORIES");
  slideTitle(s, "Three Volume Categories of Hyponatremia", 0.4, 0.2, 9.2, C.aqua);
  accentLine(s, 1.0);

  const cats = [
    {
      title:"HYPOVOLEMIC",
      icon:"↓ Volume",
      color:C.teal,
      signs:["Orthostatic hypotension", "Tachycardia, dry MM", "↑BUN/Cr, ↑uric acid"],
      causes:["Extra-renal: GI losses, burns, sweat (UNa < 20)", "Renal: thiazides, adrenal insuff, salt-losing nephropathy (UNa > 20)", "Cerebral salt wasting (CSW)"],
      tx:"0.9% Normal Saline",
    },
    {
      title:"EUVOLEMIC",
      icon:"= Volume",
      color:"1565C0",
      signs:["Normal exam", "No edema, no depletion", "Most common in hospital"],
      causes:["SIADH (most common)", "Hypothyroidism", "Secondary adrenal insufficiency", "Beer potomania, polydipsia, EAH"],
      tx:"Fluid restriction ± urea ± vaptan",
    },
    {
      title:"HYPERVOLEMIC",
      icon:"↑ Volume",
      color:"6A0572",
      signs:["Peripheral edema", "Ascites, ↑JVP, S3 gallop", "\"Effective underfilling\""],
      causes:["CHF (UNa < 10)", "Cirrhosis (UNa < 10)", "Nephrotic syndrome (UNa < 10)", "Renal failure (UNa > 20)"],
      tx:"Treat underlying cause, fluid restrict",
    },
  ];

  cats.forEach((cat, i) => {
    const x = 0.22 + i * 3.26;
    s.addShape(pres.ShapeType.rect, { x, y:1.18, w:3.05, h:4.15, fill:{color:cat.color, transparency:15}, line:{color:cat.color, pt:2} });
    s.addShape(pres.ShapeType.rect, { x, y:1.18, w:3.05, h:0.5, fill:{color:cat.color}, line:{color:cat.color} });
    s.addText(cat.icon+"   "+cat.title, { x, y:1.18, w:3.05, h:0.5, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
    s.addText("Signs:", { x:x+0.1, y:1.75, w:2.85, h:0.3, fontSize:11, bold:true, color:C.yellow, valign:"middle" });
    cat.signs.forEach((sg, j) => {
      s.addText("• "+sg, { x:x+0.15, y:2.05+j*0.34, w:2.8, h:0.33, fontSize:10.5, color:C.white, fontFace:"Calibri" });
    });
    s.addText("Causes:", { x:x+0.1, y:3.15, w:2.85, h:0.3, fontSize:11, bold:true, color:C.yellow, valign:"middle" });
    cat.causes.forEach((c, j) => {
      s.addText("• "+c, { x:x+0.15, y:3.45+j*0.32, w:2.8, h:0.31, fontSize:9.5, color:C.white, fontFace:"Calibri", wrap:true });
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — SIADH DEEP DIVE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  tealBar(s, 0, 1.05);
  sectionTag(s, "SIADH");
  slideTitle(s, "SIADH: The Most Common Euvolemic Cause", 0.4, 0.2, 9.2, C.white);

  // Criteria box
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:4.4, h:3.5, fill:{color:C.white}, line:{color:C.teal, pt:2},
    shadow:{type:"outer", color:"000000", blur:8, offset:2, angle:135, opacity:0.10} });
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:4.4, h:0.42, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText("Diagnostic Criteria", { x:0.3, y:1.15, w:4.4, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
  const criteria = [
    "Hypotonic hyponatremia (Posm < 275 mOsm/kg)",
    "Urine osmolality inappropriately elevated (> 200 mOsm/kg)",
    "Urine Na⁺ > 20 mEq/L",
    "Clinical euvolemia",
    "Normal adrenal, renal, cardiac, hepatic, thyroid function",
    "Serum uric acid typically < 4 mg/dL (hypouricemia)",
  ];
  criteria.forEach((c, i) => {
    s.addShape(pres.ShapeType.rect, { x:0.3, y:1.57+i*0.38, w:0.38, h:0.34, fill:{color:C.aqua}, line:{color:C.aqua} });
    s.addText((i+1).toString(), { x:0.3, y:1.57+i*0.38, w:0.38, h:0.34, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
    s.addText(c, { x:0.73, y:1.57+i*0.38, w:3.92, h:0.34, fontSize:11, color:C.darkText, valign:"middle" });
  });

  // Causes box
  s.addShape(pres.ShapeType.rect, { x:5.0, y:1.15, w:4.7, h:3.5, fill:{color:C.white}, line:{color:C.navy, pt:1.5} });
  s.addShape(pres.ShapeType.rect, { x:5.0, y:1.15, w:4.7, h:0.42, fill:{color:C.navy}, line:{color:C.navy} });
  s.addText("Common Causes", { x:5.0, y:1.15, w:4.7, h:0.42, fontSize:13, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 });
  const causeGroups = [
    { cat:"CNS:", items:"Meningitis, SAH, stroke, trauma, psychosis" },
    { cat:"Pulmonary:", items:"Pneumonia, TB, ARDS, PPV" },
    { cat:"Malignancy:", items:"SCLC (most common, 10–15%), lymphoma, pancreas, bladder" },
    { cat:"Drugs:", items:"SSRIs, carbamazepine, cyclophosphamide, NSAIDs, opioids, amiodarone" },
    { cat:"Other:", items:"Surgery, pain, nausea, HIV, hypothyroidism, adrenal insufficiency" },
  ];
  causeGroups.forEach((g, i) => {
    s.addText([
      {text:g.cat+" ", options:{bold:true, color:C.teal, fontSize:11.5}},
      {text:g.items, options:{bold:false, color:C.darkText, fontSize:11.5}}
    ], { x:5.15, y:1.65+i*0.55, w:4.45, h:0.5, valign:"top", wrap:true });
  });

  // U/P ratio callout
  s.addShape(pres.ShapeType.rect, { x:0.3, y:4.73, w:9.4, h:0.72, fill:{color:C.yellow, transparency:20}, line:{color:C.yellow, pt:1.5} });
  s.addText([
    {text:"U/P Electrolyte Ratio: ", options:{bold:true, fontSize:12.5, color:C.navy}},
    {text:"(Urine [Na⁺]+[K⁺]) / Plasma [Na⁺]  |  ", options:{fontSize:12, color:C.navy}},
    {text:"> 1 → restrict < 500 mL/d   |   ~1 → 500–700 mL/d   |   < 1 → < 1 L/d", options:{fontSize:12, color:C.darkText}},
  ], { x:0.3, y:4.73, w:9.4, h:0.72, valign:"middle", align:"center" });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — ODS / TREATMENT SAFETY
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionTag(s, "TREATMENT SAFETY");
  slideTitle(s, "Osmotic Demyelination Syndrome (ODS)", 0.4, 0.2, 9.2, C.red);
  accentLine(s, 1.0);

  // Left panel: mechanism + risk
  s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:4.15, fill:{color:"1C0A0A"}, line:{color:C.red, pt:2} });
  s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:0.42, fill:{color:C.red}, line:{color:C.red} });
  s.addText("Why It Happens", { x:0.25, y:1.15, w:4.6, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
  bodyText(s, [
    "Rapid correction of chronic hyponatremia",
    "Water exits brain cells → ECF becomes hypertonic relative to cells",
    "Cells that lost organic osmolytes cannot maintain volume",
    "Myelin damage — pons most vulnerable (central pontine myelinolysis)",
    "Symptoms appear 2–6 days AFTER rapid correction (not immediately)",
  ], 0.4, 1.65, 4.3, 2.5, C.white, 11.5);
  s.addText("Risk Factors:", { x:0.4, y:4.2, w:4.3, h:0.3, fontSize:12, bold:true, color:C.yellow, valign:"middle" });
  s.addText("Na⁺ < 120  |  Duration > 48 h  |  Hypokalemia  |  Alcoholism\nCirrhosis  |  Malnutrition  |  Beer potomania  |  Vaptans", {
    x:0.4, y:4.52, w:4.3, h:0.72, fontSize:11, color:C.white, fontFace:"Calibri", wrap:true
  });

  // Right panel: limits + tx
  s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:4.15, fill:{color:"0A1A0A"}, line:{color:C.aqua, pt:2} });
  s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:0.42, fill:{color:C.aqua}, line:{color:C.aqua} });
  s.addText("Correction Limits & Management", { x:5.15, y:1.15, w:4.6, h:0.42, fontSize:12, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 });

  // Correction boxes
  const limits = [["First 24 h","≤ 8–10 mEq/L","(≤12 if acute)"],["First 48 h","≤ 18 mEq/L","total"]];
  limits.forEach((l, i) => {
    s.addShape(pres.ShapeType.rect, { x:5.25+i*2.2, y:1.65, w:2.0, h:1.2, fill:{color:"1A2A1A"}, line:{color:C.aqua, pt:1.5} });
    s.addText(l[0], { x:5.25+i*2.2, y:1.65, w:2.0, h:0.38, fontSize:11, bold:true, color:C.gray, align:"center", valign:"middle" });
    s.addText(l[1], { x:5.25+i*2.2, y:2.03, w:2.0, h:0.45, fontSize:18, bold:true, color:C.yellow, align:"center", valign:"middle" });
    s.addText(l[2], { x:5.25+i*2.2, y:2.5, w:2.0, h:0.3, fontSize:10, color:C.gray, align:"center", italic:true });
  });

  s.addText("If Overcorrected:", { x:5.25, y:2.95, w:4.3, h:0.3, fontSize:12, bold:true, color:C.red, valign:"middle" });
  bodyText(s, [
    "Give 5% dextrose water at 3 mL/kg/h",
    "Add DDAVP to stop further free-water excretion",
    "Loop diuretics",
    "Target: bring Na⁺ back to safe correction limit",
  ], 5.25, 3.28, 4.3, 1.85, C.white, 11.5);

  // Symptoms bar
  s.addShape(pres.ShapeType.rect, { x:0.25, y:5.35, w:9.5, h:0.42, fill:{color:C.red, transparency:20}, line:{color:C.red} });
  s.addText("ODS Symptoms (days 2–6 post-correction): Dysarthria · Dysphagia · Paraparesis · Locked-in · Seizures · Coma", {
    x:0.25, y:5.35, w:9.5, h:0.42, fontSize:11.5, bold:true, color:C.white, align:"center", valign:"middle", margin:0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — TREATMENT SUMMARY
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  tealBar(s, 0, 1.05);
  sectionTag(s, "TREATMENT");
  slideTitle(s, "Treatment by Cause", 0.4, 0.2, 9.2, C.white);

  // Emergency box
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:1.5, fill:{color:"FFF3E0"}, line:{color:C.red, pt:2} });
  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:0.42, fill:{color:C.red}, line:{color:C.red} });
  s.addText("EMERGENCY: Symptomatic / Seizures / Coma → 3% Hypertonic NaCl", {
    x:0.3, y:1.15, w:9.4, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0
  });
  s.addText("150 mL 3% NaCl IV over 20 min  →  recheck Na⁺  →  repeat up to 3× total (450 mL max)\nStop when symptoms resolve OR Na⁺ rises 4–6 mEq/L  |  Limit: ≤ 8–12 mEq/L / 24 h", {
    x:0.5, y:1.6, w:9.0, h:0.96, fontSize:12, color:C.darkText, valign:"middle", wrap:true
  });

  // Treatment table
  const rows = [
    { cause:"Hypovolemic (GI/extra-renal)", tx:"0.9% NaCl — volume repletion → AVP suppresses → aquaresis", color:C.teal },
    { cause:"Thiazide-induced", tx:"Stop thiazide, correct K⁺ (KCl raises Na⁺), consider loop diuretic instead", color:C.teal },
    { cause:"Adrenal insufficiency", tx:"IV hydrocortisone + NS — draw cortisol first, don't delay treatment", color:C.teal },
    { cause:"SIADH", tx:"Fluid restriction (U/P ratio guided) ± oral Na⁺ ± urea ± tolvaptan (inpatient)", color:"1565C0" },
    { cause:"Hypothyroidism", tx:"Thyroid hormone (T4) replacement", color:"1565C0" },
    { cause:"CHF / Cirrhosis", tx:"Treat underlying cause + fluid restriction + vaptan if refractory", color:"6A0572" },
    { cause:"Beer potomania", tx:"0.9% NS + normal diet — HIGH ODS RISK — monitor very closely", color:C.red },
  ];
  rows.forEach((row, i) => {
    const y = 2.72 + i * 0.41;
    s.addShape(pres.ShapeType.rect, { x:0.3, y, w:9.4, h:0.4, fill:{color:i%2===0?C.white:C.lightBg}, line:{color:C.teal, pt:0.5} });
    s.addShape(pres.ShapeType.rect, { x:0.3, y, w:0.14, h:0.4, fill:{color:row.color}, line:{color:row.color} });
    s.addText(row.cause, { x:0.5, y, w:3.0, h:0.4, fontSize:11, bold:true, color:C.navy, valign:"middle" });
    s.addText(row.tx, { x:3.55, y, w:6.1, h:0.4, fontSize:10.5, color:C.darkText, valign:"middle", wrap:true });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — CLINICAL CASE 1 (Hypovolemic)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionTag(s, "CASE 1");
  slideTitle(s, "Case 1: The Dehydrated Vomiter", 0.4, 0.2, 9.2, C.yellow);
  accentLine(s, 1.0);

  // Vignette
  s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:9.5, h:1.0, fill:{color:C.teal, transparency:80}, line:{color:C.teal, pt:1} });
  s.addText("67F | 3 days vomiting | BP 95/60 → 78/50 orthostatic | HR 112 | Dry MM, skin tenting, no edema", {
    x:0.4, y:1.2, w:9.2, h:0.9, fontSize:12.5, color:C.white, fontFace:"Calibri", valign:"middle", italic:true
  });

  // Labs row
  const labs = [["Na⁺","124 mEq/L"],["Posm","258 mOsm/kg"],["Uosm","680 mOsm/kg"],["UNa","8 mEq/L"],["BUN","42"],["K⁺","3.1"]];
  labs.forEach((l, i) => {
    const x = 0.25 + i * 1.6;
    s.addShape(pres.ShapeType.rect, { x, y:2.25, w:1.45, h:0.72, fill:{color:C.navy, transparency:30}, line:{color:C.aqua, pt:1.5} });
    s.addText(l[0], { x, y:2.25, w:1.45, h:0.35, fontSize:11, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 });
    s.addText(l[1], { x, y:2.6, w:1.45, h:0.37, fontSize:12, bold:true, color:C.yellow, align:"center", valign:"middle", margin:0 });
  });

  // Analysis
  const steps = [
    ["Step 1 — Posm 258", "TRUE hypotonic hyponatremia ✓"],
    ["Step 2 — Volume", "HYPOVOLEMIC — orthostatics, tachycardia, ↑BUN"],
    ["Step 3 — Uosm 680", "AVP very active (concentrating urine to preserve volume)"],
    ["Step 4 — UNa 8", "EXTRA-RENAL loss — kidneys avid for Na⁺ (GI losses)"],
  ];
  steps.forEach((st, i) => {
    const x = 0.25 + (i%2)*4.75;
    const y = 3.1 + Math.floor(i/2)*0.9;
    s.addShape(pres.ShapeType.rect, { x, y, w:4.45, h:0.82, fill:{color:"0A1A2A"}, line:{color:C.teal, pt:1} });
    s.addText(st[0], { x:x+0.1, y, w:4.25, h:0.37, fontSize:11, bold:true, color:C.aqua, valign:"middle" });
    s.addText(st[1], { x:x+0.1, y:y+0.37, w:4.25, h:0.4, fontSize:11, color:C.white, valign:"middle", wrap:true });
  });

  s.addShape(pres.ShapeType.rect, { x:0.25, y:5.0, w:9.5, h:0.42, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText("Dx: Hypovolemic hyponatremia (GI losses)   |   Rx: 0.9% NaCl + correct K⁺   |   Monitor Na⁺ q4–6h", {
    x:0.25, y:5.0, w:9.5, h:0.42, fontSize:12.5, bold:true, color:C.white, align:"center", valign:"middle", margin:0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — CASE 2 (SIADH / Cancer)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  tealBar(s, 0, 1.05);
  sectionTag(s, "CASE 2");
  slideTitle(s, "Case 2: SIADH in Small Cell Lung Cancer", 0.4, 0.2, 9.2, C.white);

  s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:0.78, fill:{color:C.navy, transparency:85}, line:{color:C.navy, pt:1} });
  s.addText("52M | SCLC | 1 week fatigue, confusion, headache | No edema, no orthostasis", {
    x:0.5, y:1.2, w:9.0, h:0.68, fontSize:12.5, color:C.darkText, fontFace:"Calibri", valign:"middle", italic:true
  });

  const labs = [["Na⁺","118 mEq/L"],["Posm","242 mOsm/kg"],["Uosm","520 mOsm/kg"],["UNa","65 mEq/L"],["Uric Acid","2.8 mg/dL"],["K⁺","3.9"]];
  labs.forEach((l, i) => {
    const x = 0.3 + i * 1.6;
    s.addShape(pres.ShapeType.rect, { x, y:2.05, w:1.45, h:0.72, fill:{color:C.teal, transparency:85}, line:{color:C.teal, pt:1.5} });
    s.addText(l[0], { x, y:2.05, w:1.45, h:0.35, fontSize:11, bold:true, color:C.teal, align:"center", valign:"middle", margin:0 });
    s.addText(l[1], { x, y:2.4, w:1.45, h:0.37, fontSize:12, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 });
  });

  const analysis = [
    "Posm 242 → true hypotonic hyponatremia",
    "Euvolemic — no edema, no depletion signs",
    "Uosm 520 → AVP active despite hyponatremia (inappropriate!)",
    "UNa 65 → kidney NOT retaining Na⁺",
    "Uric acid 2.8 mg/dL → hypouricemia = SIADH physiology",
    "SCLC context → paraneoplastic ectopic AVP production",
  ];
  analysis.forEach((a, i) => {
    const x = 0.3 + (i%2)*4.75;
    const y = 2.88 + Math.floor(i/2)*0.55;
    s.addShape(pres.ShapeType.rect, { x, y, w:0.34, h:0.5, fill:{color:C.teal}, line:{color:C.teal} });
    s.addText((i+1).toString(), { x, y, w:0.34, h:0.5, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
    s.addText(a, { x:x+0.38, y, w:4.28, h:0.5, fontSize:11.5, color:C.darkText, valign:"middle", wrap:true });
  });

  s.addShape(pres.ShapeType.rect, { x:0.3, y:5.55, w:9.4, h:0.42, fill:{color:C.navy}, line:{color:C.navy} });
  s.addText("Dx: SIADH (paraneoplastic SCLC)   |   Rx: Fluid restriction < 1 L/d (U/P = 0.70) ± urea ± tolvaptan   |   Treat SCLC", {
    x:0.3, y:5.55, w:9.4, h:0.42, fontSize:11.5, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — CASES 3 & 4 (EAH + Thiazide pitfall)
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  sectionTag(s, "CASES 3 & 4");
  slideTitle(s, "More Clinical Cases", 0.4, 0.2, 9.2, C.aqua);
  accentLine(s, 1.0);

  // Case 3 — Left
  s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:4.55, fill:{color:"0A1520"}, line:{color:C.teal, pt:2} });
  s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:0.42, fill:{color:C.teal}, line:{color:C.teal} });
  s.addText("Case 3 — The Marathon Runner (EAH)", { x:0.25, y:1.15, w:4.6, h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
  s.addText("29F, collapses post-marathon, seizing\nDrank water throughout race, weight gain\nNa⁺ 112 | Posm 228 | Uosm 68 | UNa 12", {
    x:0.4, y:1.65, w:4.3, h:0.95, fontSize:11, color:C.gray, fontFace:"Calibri", italic:true, wrap:true
  });
  s.addText("Key Clue: Uosm < 100 → AVP is SUPPRESSED\n→ Pure water intoxication (not SIADH)\n→ ACUTE onset (< 24 h) = high-risk neurologic\n→ Weight gain during race = excessive free H₂O", {
    x:0.4, y:2.65, w:4.3, h:1.4, fontSize:11.5, color:C.white, fontFace:"Calibri", wrap:true
  });
  s.addShape(pres.ShapeType.rect, { x:0.25, y:4.08, w:4.6, h:0.56, fill:{color:C.red, transparency:20}, line:{color:C.red} });
  s.addText("Rx: 150 mL 3% NaCl IV stat (acute → ODS risk low)\nRepeat ×3 max — stop when seizing resolves", {
    x:0.35, y:4.1, w:4.4, h:0.52, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", wrap:true
  });

  // Case 4 — Right
  s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:4.55, fill:{color:"100A20"}, line:{color:C.yellow, pt:2} });
  s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:0.42, fill:{color:"6A0572"}, line:{color:"6A0572"} });
  s.addText("Case 4 — Thiazide Mimic of SIADH", { x:5.15, y:1.15, w:4.6, h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
  s.addText("72F on HCTZ × 3 weeks for HTN\nWeakness, mild confusion, no edema\nNa⁺ 122 | Posm 256 | Uosm 380 | UNa 45 | K⁺ 2.8", {
    x:5.3, y:1.65, w:4.3, h:0.95, fontSize:11, color:C.gray, fontFace:"Calibri", italic:true, wrap:true
  });
  s.addText("Looks exactly like SIADH but...\n► Started thiazide 3 weeks ago\n► Hypokalemia (K⁺ 2.8) — key clue!\n► Thiazide blocks DCT NaCl cotransporter → impairs diluting segment + volume depletion → ↑AVP\n► Do NOT diagnose SIADH until 1–2 weeks after stopping thiazide", {
    x:5.3, y:2.65, w:4.3, h:1.9, fontSize:11, color:C.white, fontFace:"Calibri", wrap:true
  });
  s.addShape(pres.ShapeType.rect, { x:5.15, y:4.08, w:4.6, h:0.56, fill:{color:C.yellow, transparency:30}, line:{color:C.yellow} });
  s.addText("Rx: Stop HCTZ · Correct K⁺ (KCl raises Na⁺) · 0.9% NS if symptomatic · Monitor closely", {
    x:5.25, y:4.1, w:4.4, h:0.52, fontSize:11, bold:true, color:C.navy, fontFace:"Calibri", wrap:true
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 — MASTER TABLE
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  lightSlide(s);
  tealBar(s, 0, 1.05);
  sectionTag(s, "SUMMARY TABLE");
  slideTitle(s, "High-Yield Summary Table", 0.4, 0.2, 9.2, C.white);

  const hdr = ["Condition","Volume","Uosm","UNa","Key Clue","Treatment"];
  const hdrW = [2.0, 0.9, 0.8, 0.7, 2.1, 3.2];
  let cx = 0.18;
  hdr.forEach((h, i) => {
    s.addShape(pres.ShapeType.rect, { x:cx, y:1.12, w:hdrW[i], h:0.38, fill:{color:C.navy}, line:{color:C.navy} });
    s.addText(h, { x:cx, y:1.12, w:hdrW[i], h:0.38, fontSize:10.5, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 });
    cx += hdrW[i];
  });

  const rows = [
    ["GI / Extra-renal loss","↓","High","< 20","Orthostasis, vomiting","0.9% NS"],
    ["Thiazide diuretic","↓ / Eu","High","> 20","Hypokalemia","Stop drug, correct K⁺"],
    ["Adrenal insufficiency (1°)","↓","High",">> 20","Hyperkalemia, pigment.","Hydrocortisone + NS"],
    ["CSW","↓","High","> 20","CNS pathology (SAH)","Na⁺ + volume"],
    ["SIADH","Eu","> 200","> 30","Hypouricemia, exclusion dx","Fluid restrict ± urea ± vaptan"],
    ["Hypothyroidism","Eu","Var.","Var.","↑TSH, myxedema","T4 replacement"],
    ["Beer potomania","Eu","< 200","< 20","Alcoholism, low solute","NS + diet — HIGH ODS risk!"],
    ["Psychogenic polydipsia","Eu","< 100","Low","Psych hx, schizophrenia","Fluid restriction"],
    ["EAH","Eu","< 100","Low","Post-race, weight gain","3% NaCl if severe (acute)"],
    ["CHF / Cirrhosis","↑","High","< 10","Edema, ascites, ↑BNP","Treat cause, fluid restrict"],
    ["Renal failure","↑","Var.","> 20","↑Cr, ↑K⁺","Dialysis"],
  ];
  const rowH = 0.37;
  rows.forEach((row, ri) => {
    let rx = 0.18;
    const bg = ri % 2 === 0 ? C.white : C.lightBg;
    const volColor = row[1]==="↓" ? C.teal : row[1]==="↑" ? "6A0572" : "1565C0";
    hdrW.forEach((w, ci) => {
      s.addShape(pres.ShapeType.rect, { x:rx, y:1.5+ri*rowH, w, h:rowH, fill:{color:bg}, line:{color:C.teal, pt:0.5} });
      const isVol = ci === 1;
      s.addText(row[ci], {
        x:rx, y:1.5+ri*rowH, w, h:rowH,
        fontSize: ci===5 ? 9 : 10,
        bold: ci===0 || ci===1,
        color: isVol ? volColor : (ci===4 ? C.teal : C.darkText),
        align: ci===0 ? "left" : "center",
        valign:"middle",
        wrap: true,
        margin: ci===0 ? [0,0,0,4] : 0,
      });
      rx += w;
    });
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 — KEY TAKEAWAYS
// ══════════════════════════════════════════════════════════════════════════════
{
  const s = pres.addSlide();
  darkSlide(s);
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:"100%", fill:{color:C.aqua}, line:{color:C.aqua} });
  s.addShape(pres.ShapeType.ellipse, { x:7.2, y:-0.8, w:4, h:4, fill:{color:C.teal, transparency:80}, line:{color:C.teal, transparency:80} });

  s.addText("Key Takeaways", { x:0.5, y:0.35, w:9, h:0.6, fontSize:30, bold:true, color:C.aqua, fontFace:"Calibri" });
  accentLine(s, 1.05);

  const takes = [
    ["1","Serum [Na⁺] reflects water balance, not total body Na⁺ — volume status is the first clinical step"],
    ["2","Always exclude pseudohyponatremia (check measured Posm) and hypertonic causes (glucose) first"],
    ["3","Uosm < 100 = AVP suppressed → polydipsia / EAH. Most other cases have Uosm > 100"],
    ["4","UNa < 20 with hypovolemia = extra-renal loss. High UNa despite low [Na⁺] = SIADH or renal wasting"],
    ["5","SIADH is a diagnosis of exclusion — rule out hypothyroidism, adrenal insufficiency, diuretics first"],
    ["6","Correction limit: ≤ 8–10 mEq/L/24 h in chronic hyponatremia to prevent ODS"],
    ["7","Symptomatic acute hyponatremia → 3% NaCl stat (150 mL bolus, repeat up to 3×)"],
    ["8","Hypokalemia correction itself raises plasma [Na⁺] — watch for inadvertent overcorrection"],
  ];

  takes.forEach((t, i) => {
    const y = 1.2 + i * 0.5;
    s.addShape(pres.ShapeType.ellipse, { x:0.45, y:y+0.08, w:0.34, h:0.34, fill:{color:C.teal}, line:{color:C.teal} });
    s.addText(t[0], { x:0.45, y:y+0.08, w:0.34, h:0.34, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 });
    s.addText(t[1], { x:0.9, y, w:8.8, h:0.48, fontSize:12.5, color:C.white, fontFace:"Calibri", valign:"middle", wrap:true });
  });

  s.addText("Sources: Harrison's 22E · Brenner & Rector · Tintinalli's EM · NKF Primer · Symptom to Diagnosis 4E", {
    x:0.5, y:5.25, w:9, h:0.3, fontSize:9.5, color:C.gray, fontFace:"Calibri", italic:true
  });
}

// ══════════════════════════════════════════════════════════════════════════════
// WRITE FILE
// ══════════════════════════════════════════════════════════════════════════════
pres.writeFile({ fileName: "/home/daytona/workspace/hyponatremia-ppt/Hyponatremia_Evaluation.pptx" })
  .then(() => console.log("✓ Done: Hyponatremia_Evaluation.pptx"))
  .catch(err => { console.error("Error:", err); process.exit(1); });
Editing File

~/hyponatremia-ppt/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/hyponatremia-ppt/build.js'
Running Command

cat > /home/daytona/workspace/hyponatremia-ppt/build.js << 'ENDOFSCRIPT' const pptxgen = require("pptxgenjs"); const pres = new pptxgen(); pres.layout = "LAYOUT_16x9"; pres.title = "Hyponatremia: Evaluation & Management"; pres.author = "Orris Medical Education"; const C = { navy: "0A2342", teal: "0D7377", aqua: "14BDAC", white: "FFFFFF", offWhite:"F0F4F8", yellow: "F5C518", red: "E63946", gray: "94A3B8", lightBg: "EBF4F6", darkText:"1E293B", }; function darkSlide(slide) { slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.navy}, line:{color:C.navy} }); } function lightSlide(slide) { slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:"100%", h:"100%", fill:{color:C.offWhite}, line:{color:C.offWhite} }); } function tealBar(slide, y=0, h=1.05) { slide.addShape(pres.ShapeType.rect, { x:0, y:y, w:"100%", h:h, fill:{color:C.teal}, line:{color:C.teal} }); } function accentLine(slide, y) { slide.addShape(pres.ShapeType.rect, { x:0.4, y:y, w:1.2, h:0.07, fill:{color:C.aqua}, line:{color:C.aqua} }); } function sectionTag(slide, label) { slide.addShape(pres.ShapeType.rect, { x:0, y:0, w:2.6, h:0.38, fill:{color:C.aqua}, line:{color:C.aqua} }); slide.addText(label, { x:0, y:0, w:2.6, h:0.38, fontSize:11, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 }); } function slideTitle(slide, title, x, y, w, color) { x = x||0.4; y = y||0.2; w = w||9.2; color = color||C.white; slide.addText(title, { x, y, w, h:0.65, fontSize:26, bold:true, color, fontFace:"Calibri", valign:"middle" }); } // ─── SLIDE 1: TITLE ─────────────────────────────────────────────────────────── { const s = pres.addSlide(); darkSlide(s); s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:"100%", fill:{color:C.aqua}, line:{color:C.aqua} }); s.addShape(pres.ShapeType.ellipse, { x:7.5, y:-1.2, w:4.5, h:4.5, fill:{color:C.teal, transparency:75}, line:{color:C.teal, transparency:75} }); s.addShape(pres.ShapeType.ellipse, { x:8.2, y:2.8, w:2.8, h:2.8, fill:{color:C.aqua, transparency:85}, line:{color:C.aqua, transparency:85} }); s.addText("HYPONATREMIA", { x:0.5, y:1.2, w:9, h:0.7, fontSize:44, bold:true, color:C.aqua, charSpacing:6, fontFace:"Calibri" }); s.addText("Evaluation & Management", { x:0.5, y:2.0, w:9, h:0.55, fontSize:26, color:C.white, fontFace:"Calibri" }); s.addText("From Basics to Clinical Cases", { x:0.5, y:2.65, w:9, h:0.4, fontSize:16, color:C.gray, fontFace:"Calibri", italic:true }); accentLine(s, 3.2); s.addText("Based on Harrison's 22E · Brenner & Rector · Tintinalli's EM · NKF Primer", { x:0.5, y:4.8, w:9, h:0.35, fontSize:11, color:C.gray, fontFace:"Calibri", italic:true }); } // ─── SLIDE 2: DEFINITION & EPIDEMIOLOGY ─────────────────────────────────────── { const s = pres.addSlide(); lightSlide(s); tealBar(s, 0, 1.05); sectionTag(s, "BASICS"); slideTitle(s, "Definition & Epidemiology", 0.4, 0.2, 9.2, C.white); const boxes = [ { label:"Definition", val:"Na\u207a < 135 mEq/L", sub:"Symptoms rare until \u2264125 mEq/L" }, { label:"Prevalence", val:"Up to 22%", sub:"Of all hospitalized patients" }, { label:"Acute", val:"< 48 hours", sub:"Brain not yet adapted — high risk" }, { label:"Chronic", val:"> 48 hours", sub:"Brain adapted — symptoms milder" }, ]; boxes.forEach((b, i) => { const x = 0.3 + i * 2.38; s.addShape(pres.ShapeType.rect, { x, y:1.25, w:2.15, h:3.6, fill:{color:C.white}, line:{color:C.teal, pt:2}, shadow:{type:"outer", color:"000000", blur:8, offset:2, angle:135, opacity:0.10} }); s.addShape(pres.ShapeType.rect, { x, y:1.25, w:2.15, h:0.45, fill:{color:C.teal}, line:{color:C.teal} }); s.addText(b.label, { x, y:1.25, w:2.15, h:0.45, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText(b.val, { x, y:1.78, w:2.15, h:1.1, fontSize:17, bold:true, color:C.navy, align:"center", valign:"middle", fontFace:"Calibri" }); s.addText(b.sub, { x, y:2.88, w:2.15, h:1.5, fontSize:11, color:C.darkText, align:"center", valign:"top", fontFace:"Calibri", wrap:true }); }); s.addShape(pres.ShapeType.rect, { x:0.3, y:5.0, w:9.4, h:0.4, fill:{color:C.navy}, line:{color:C.navy} }); s.addText("Severity: Mild 130-135 | Moderate 125-130 | Severe < 125 mEq/L", { x:0.3, y:5.0, w:9.4, h:0.4, fontSize:12, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 }); } // ─── SLIDE 3: PHYSIOLOGY ────────────────────────────────────────────────────── { const s = pres.addSlide(); lightSlide(s); tealBar(s, 0, 1.05); sectionTag(s, "PHYSIOLOGY"); slideTitle(s, "Why Does Hyponatremia Happen?", 0.4, 0.2, 9.2, C.white); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.2, w:4.55, h:4.1, fill:{color:C.white}, line:{color:C.teal, pt:1.5} }); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.2, w:4.55, h:0.42, fill:{color:C.navy}, line:{color:C.navy} }); s.addText("Key Concept", { x:0.3, y:1.2, w:4.55, h:0.42, fontSize:12, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 }); s.addText([ {text:"Serum [Na+] = Total Body Na+ / Total Body Water\n", options:{bold:true, breakLine:false}}, {text:"Hyponatremia = excess water relative to sodium\n"}, {text:"AVP (vasopressin) = main regulator — promotes renal free-water reabsorption\n"}, {text:"Most cases: excess AVP + free water intake\n"}, {text:"Volume status modulates AVP: hypovolemia raises AVP even at normal osmolality"}, ], { x:0.5, y:1.72, w:4.2, h:3.4, fontSize:12.5, color:C.darkText, fontFace:"Calibri", valign:"top", wrap:true }); s.addShape(pres.ShapeType.rect, { x:5.15, y:1.2, w:4.55, h:4.1, fill:{color:C.white}, line:{color:C.aqua, pt:1.5} }); s.addShape(pres.ShapeType.rect, { x:5.15, y:1.2, w:4.55, h:0.42, fill:{color:C.aqua}, line:{color:C.aqua} }); s.addText("Two Defense Mechanisms", { x:5.15, y:1.2, w:4.55, h:0.42, fontSize:12, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 }); s.addText([ {text:"1 AVP release by posterior pituitary -> water reabsorption\n"}, {text:"2 Thirst -> drives oral water intake\n"}, {text:"Defect in either + free water intake -> hyponatremia\n\n"}, {text:"Brain cell swelling -> neurological symptoms\n\n"}, {text:"Chronic: brain adapts by exporting organic osmolytes (taurine, glutamate, myoinositol) -> less symptomatic"}, ], { x:5.35, y:1.72, w:4.2, h:3.4, fontSize:12.5, color:C.darkText, fontFace:"Calibri", valign:"top", wrap:true }); s.addShape(pres.ShapeType.rect, { x:0.3, y:5.35, w:9.4, h:0.42, fill:{color:C.yellow, transparency:15}, line:{color:C.yellow} }); s.addText("Effective Osmolality = 2 x [Na+] + Glucose/18 | Normal: 275-290 mOsm/kg", { x:0.3, y:5.35, w:9.4, h:0.42, fontSize:13, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 }); } // ─── SLIDE 4: 4-STEP FRAMEWORK ──────────────────────────────────────────────── { const s = pres.addSlide(); darkSlide(s); sectionTag(s, "DIAGNOSIS"); slideTitle(s, "The 4-Step Diagnostic Framework", 0.4, 0.2, 9.2, C.aqua); accentLine(s, 1.0); const steps = [ { num:"1", title:"Serum Osmolality", body:"Is this TRUE hypotonic hyponatremia?\nRule out pseudohyponatremia\n(lipemia, paraprotein)\nand hypertonic causes\n(hyperglycemia, mannitol)", color:C.teal }, { num:"2", title:"ECF Volume Status", body:"Hypovolemic / Euvolemic\n/ Hypervolemic\nMost important clinical step\nOrthostatics, JVP, edema,\nBUN/Cr, uric acid", color:"1565C0" }, { num:"3", title:"Urine Osmolality", body:"Is AVP active?\n< 100 = AVP suppressed\n(polydipsia, EAH)\n> 300 = AVP active\n(most clinical hyponatremia)", color:"6A0572" }, { num:"4", title:"Urine Sodium", body:"Renal vs. extra-renal?\nAppropriate vs. not?\n< 20: extra-renal or Na-avid\n> 30: renal wasting or SIADH", color:"B5451B" }, ]; steps.forEach((st, i) => { const x = 0.25 + i * 2.42; s.addShape(pres.ShapeType.rect, { x, y:1.18, w:2.2, h:4.15, fill:{color:st.color}, line:{color:st.color} }); s.addShape(pres.ShapeType.ellipse, { x:x+0.7, y:1.25, w:0.8, h:0.8, fill:{color:C.white}, line:{color:C.white} }); s.addText(st.num, { x:x+0.7, y:1.25, w:0.8, h:0.8, fontSize:20, bold:true, color:st.color, align:"center", valign:"middle", margin:0 }); s.addText("STEP "+st.num, { x, y:2.18, w:2.2, h:0.35, fontSize:10, bold:true, color:C.white, align:"center", valign:"middle", margin:0, charSpacing:3 }); s.addText(st.title, { x, y:2.55, w:2.2, h:0.5, fontSize:13.5, bold:true, color:C.yellow, align:"center", valign:"middle", fontFace:"Calibri" }); s.addText(st.body, { x:x+0.1, y:3.1, w:2.0, h:2.1, fontSize:10.5, color:C.white, fontFace:"Calibri", wrap:true, valign:"top" }); }); s.addText("Combine all 4 steps with clinical context -> diagnosis is almost always apparent", { x:0.4, y:5.4, w:9.2, h:0.35, fontSize:12, italic:true, color:C.gray, align:"center" }); } // ─── SLIDE 5: URINE TEST QUICK REF ──────────────────────────────────────────── { const s = pres.addSlide(); lightSlide(s); tealBar(s, 0, 1.05); sectionTag(s, "LAB KEYS"); slideTitle(s, "Key Urine Tests at a Glance", 0.4, 0.2, 9.2, C.white); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:0.42, fill:{color:C.navy}, line:{color:C.navy} }); s.addText("URINE OSMOLALITY (Uosm)", { x:0.3, y:1.15, w:9.4, h:0.42, fontSize:13, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 }); const uosmRows = [ ["< 100 mOsm/kg", "AVP suppressed", "Psychogenic polydipsia, beer potomania, EAH"], ["100 - 300", "Partial suppression", "Mixed picture, solute depletion"], ["> 300 mOsm/kg", "AVP active", "Most clinical hyponatremia"], ["> 400 mOsm/kg", "AVP dominant", "SIADH, severe volume depletion"], ]; uosmRows.forEach((row, i) => { const y = 1.57 + i * 0.5; s.addShape(pres.ShapeType.rect, { x:0.3, y, w:9.4, h:0.49, fill:{color:i%2===0?C.lightBg:C.white}, line:{color:C.teal, pt:0.5} }); s.addText(row[0], { x:0.35, y, w:2.4, h:0.49, fontSize:12, bold:true, color:C.teal, valign:"middle" }); s.addText(row[1], { x:2.8, y, w:2.4, h:0.49, fontSize:12, color:C.navy, valign:"middle" }); s.addText(row[2], { x:5.25, y, w:4.4, h:0.49, fontSize:11, color:C.darkText, valign:"middle", italic:true }); }); s.addShape(pres.ShapeType.rect, { x:0.3, y:3.65, w:9.4, h:0.42, fill:{color:C.teal}, line:{color:C.teal} }); s.addText("URINE SODIUM (UNa)", { x:0.3, y:3.65, w:9.4, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); const unaRows = [ ["< 20 mEq/L", "Extra-renal loss / Na-avid state", "Diarrhea/vomiting, CHF, cirrhosis, nephrotic"], ["> 20-30 mEq/L", "Renal Na wasting or SIADH", "Diuretics, adrenal insufficiency, SIADH, CSW"], ]; unaRows.forEach((row, i) => { const y = 4.07 + i * 0.5; s.addShape(pres.ShapeType.rect, { x:0.3, y, w:9.4, h:0.49, fill:{color:i===0?C.lightBg:C.white}, line:{color:C.teal, pt:0.5} }); s.addText(row[0], { x:0.35, y, w:2.4, h:0.49, fontSize:12, bold:true, color:C.teal, valign:"middle" }); s.addText(row[1], { x:2.8, y, w:2.9, h:0.49, fontSize:12, color:C.navy, valign:"middle" }); s.addText(row[2], { x:5.75, y, w:3.9, h:0.49, fontSize:11, color:C.darkText, valign:"middle", italic:true }); }); s.addText("Quick Tip: Urine specific gravity 1.015 -> Uosm approx 15 x 35 = 525 mOsm/L", { x:0.3, y:5.12, w:9.4, h:0.35, fontSize:11, italic:true, color:C.gray, align:"center" }); } // ─── SLIDE 6: THREE VOLUME CATEGORIES ───────────────────────────────────────── { const s = pres.addSlide(); darkSlide(s); sectionTag(s, "CATEGORIES"); slideTitle(s, "Three Volume Categories", 0.4, 0.2, 9.2, C.aqua); accentLine(s, 1.0); const cats = [ { title:"HYPOVOLEMIC", icon:"DOWN Vol", color:C.teal, signs:["Orthostatic hypotension", "Tachycardia, dry MM", "High BUN/Cr, high uric acid"], causes:["Extra-renal: GI losses, burns, sweat (UNa < 20)", "Renal: thiazides, adrenal insufficiency, salt-losing nephropathy (UNa > 20)", "Cerebral salt wasting (CSW)"], tx:"0.9% Normal Saline", }, { title:"EUVOLEMIC", icon:"NORMAL Vol", color:"1565C0", signs:["Normal exam", "No edema, no depletion", "Most common in hospital"], causes:["SIADH (most common)", "Hypothyroidism", "Secondary adrenal insufficiency", "Beer potomania, polydipsia, EAH"], tx:"Fluid restriction +/- urea +/- vaptan", }, { title:"HYPERVOLEMIC", icon:"UP Vol", color:"6A0572", signs:["Peripheral edema", "Ascites, high JVP, S3", "'Effective underfilling'"], causes:["CHF (UNa < 10)", "Cirrhosis (UNa < 10)", "Nephrotic syndrome (UNa < 10)", "Renal failure (UNa > 20)"], tx:"Treat underlying cause, restrict fluids", }, ]; cats.forEach((cat, i) => { const x = 0.22 + i * 3.26; s.addShape(pres.ShapeType.rect, { x, y:1.18, w:3.05, h:4.15, fill:{color:cat.color, transparency:15}, line:{color:cat.color, pt:2} }); s.addShape(pres.ShapeType.rect, { x, y:1.18, w:3.05, h:0.5, fill:{color:cat.color}, line:{color:cat.color} }); s.addText(cat.title, { x, y:1.18, w:3.05, h:0.5, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText("Signs:", { x:x+0.1, y:1.75, w:2.85, h:0.3, fontSize:11, bold:true, color:C.yellow, valign:"middle" }); cat.signs.forEach((sg, j) => { s.addText(" " + sg, { x:x+0.1, y:2.08+j*0.34, w:2.85, h:0.33, fontSize:10.5, color:C.white, fontFace:"Calibri", wrap:true }); }); s.addText("Causes:", { x:x+0.1, y:3.22, w:2.85, h:0.3, fontSize:11, bold:true, color:C.yellow, valign:"middle" }); cat.causes.forEach((c, j) => { s.addText(" " + c, { x:x+0.1, y:3.55+j*0.32, w:2.85, h:0.31, fontSize:9.5, color:C.white, fontFace:"Calibri", wrap:true }); }); }); } // ─── SLIDE 7: SIADH ─────────────────────────────────────────────────────────── { const s = pres.addSlide(); lightSlide(s); tealBar(s, 0, 1.05); sectionTag(s, "SIADH"); slideTitle(s, "SIADH: Most Common Euvolemic Cause", 0.4, 0.2, 9.2, C.white); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:4.4, h:3.5, fill:{color:C.white}, line:{color:C.teal, pt:2}, shadow:{type:"outer", color:"000000", blur:8, offset:2, angle:135, opacity:0.10} }); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:4.4, h:0.42, fill:{color:C.teal}, line:{color:C.teal} }); s.addText("Diagnostic Criteria", { x:0.3, y:1.15, w:4.4, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); const criteria = [ "Hypotonic hyponatremia (Posm < 275 mOsm/kg)", "Urine osmolality elevated (> 200 mOsm/kg)", "Urine Na > 20 mEq/L", "Clinical euvolemia", "Normal adrenal, renal, cardiac, hepatic, thyroid", "Serum uric acid < 4 mg/dL (hypouricemia)", ]; criteria.forEach((c, i) => { s.addShape(pres.ShapeType.rect, { x:0.3, y:1.57+i*0.38, w:0.38, h:0.34, fill:{color:C.aqua}, line:{color:C.aqua} }); s.addText((i+1).toString(), { x:0.3, y:1.57+i*0.38, w:0.38, h:0.34, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText(c, { x:0.73, y:1.57+i*0.38, w:3.92, h:0.34, fontSize:11, color:C.darkText, valign:"middle" }); }); s.addShape(pres.ShapeType.rect, { x:5.0, y:1.15, w:4.7, h:3.5, fill:{color:C.white}, line:{color:C.navy, pt:1.5} }); s.addShape(pres.ShapeType.rect, { x:5.0, y:1.15, w:4.7, h:0.42, fill:{color:C.navy}, line:{color:C.navy} }); s.addText("Common Causes", { x:5.0, y:1.15, w:4.7, h:0.42, fontSize:13, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 }); const causes = [ { cat:"CNS:", items:"Meningitis, SAH, stroke, trauma, psychosis" }, { cat:"Pulmonary:", items:"Pneumonia, TB, ARDS, positive-pressure ventilation" }, { cat:"Malignancy:", items:"SCLC (most common, 10-15%), lymphoma, pancreas, bladder" }, { cat:"Drugs:", items:"SSRIs, carbamazepine, cyclophosphamide, NSAIDs, opioids, amiodarone" }, { cat:"Other:", items:"Surgery, pain, nausea, HIV" }, ]; causes.forEach((g, i) => { s.addText([ {text:g.cat+" ", options:{bold:true, color:C.teal, fontSize:11.5}}, {text:g.items, options:{bold:false, color:C.darkText, fontSize:11.5}} ], { x:5.15, y:1.65+i*0.55, w:4.45, h:0.5, valign:"top", wrap:true }); }); s.addShape(pres.ShapeType.rect, { x:0.3, y:4.73, w:9.4, h:0.72, fill:{color:C.yellow, transparency:20}, line:{color:C.yellow, pt:1.5} }); s.addText([ {text:"U/P Electrolyte Ratio: ", options:{bold:true, fontSize:12.5, color:C.navy}}, {text:"(Urine [Na+]+[K+]) / Plasma [Na+] | >1 -> restrict < 500 mL/d | ~1 -> 500-700 mL/d | <1 -> < 1 L/d", options:{fontSize:12, color:C.darkText}}, ], { x:0.3, y:4.73, w:9.4, h:0.72, valign:"middle", align:"center" }); } // ─── SLIDE 8: ODS ───────────────────────────────────────────────────────────── { const s = pres.addSlide(); darkSlide(s); sectionTag(s, "TREATMENT SAFETY"); slideTitle(s, "Osmotic Demyelination Syndrome (ODS)", 0.4, 0.2, 9.2, C.red); accentLine(s, 1.0); s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:4.15, fill:{color:"1C0A0A"}, line:{color:C.red, pt:2} }); s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:0.42, fill:{color:C.red}, line:{color:C.red} }); s.addText("Why It Happens", { x:0.25, y:1.15, w:4.6, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText([ {text:"Rapid correction of chronic hyponatremia\n"}, {text:"Water exits brain cells -> ECF becomes hypertonic\n"}, {text:"Cells that lost organic osmolytes cannot maintain volume\n"}, {text:"Myelin damage -- pons most vulnerable (central pontine myelinolysis)\n"}, {text:"Symptoms appear 2-6 days AFTER rapid correction -- NOT immediately"}, ], { x:0.4, y:1.65, w:4.3, h:2.5, fontSize:11.5, color:C.white, fontFace:"Calibri", valign:"top", wrap:true }); s.addText("Risk Factors:", { x:0.4, y:4.2, w:4.3, h:0.3, fontSize:12, bold:true, color:C.yellow, valign:"middle" }); s.addText("Na < 120 | Duration > 48 h | Hypokalemia | Alcoholism\nCirrhosis | Malnutrition | Beer potomania | Vaptans", { x:0.4, y:4.52, w:4.3, h:0.72, fontSize:11, color:C.white, fontFace:"Calibri", wrap:true }); s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:4.15, fill:{color:"0A1A0A"}, line:{color:C.aqua, pt:2} }); s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:0.42, fill:{color:C.aqua}, line:{color:C.aqua} }); s.addText("Correction Limits & Management", { x:5.15, y:1.15, w:4.6, h:0.42, fontSize:12, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 }); const limits = [["First 24 h","8-10 mEq/L","(up to 12 if acute)"],["First 48 h","18 mEq/L","total limit"]]; limits.forEach((l, i) => { s.addShape(pres.ShapeType.rect, { x:5.25+i*2.2, y:1.65, w:2.0, h:1.2, fill:{color:"1A2A1A"}, line:{color:C.aqua, pt:1.5} }); s.addText(l[0], { x:5.25+i*2.2, y:1.65, w:2.0, h:0.38, fontSize:11, bold:true, color:C.gray, align:"center", valign:"middle" }); s.addText(l[1], { x:5.25+i*2.2, y:2.03, w:2.0, h:0.45, fontSize:18, bold:true, color:C.yellow, align:"center", valign:"middle" }); s.addText(l[2], { x:5.25+i*2.2, y:2.5, w:2.0, h:0.3, fontSize:10, color:C.gray, align:"center", italic:true }); }); s.addText("If Overcorrected:", { x:5.25, y:2.95, w:4.3, h:0.3, fontSize:12, bold:true, color:C.red, valign:"middle" }); s.addText([ {text:"Give 5% dextrose water at 3 mL/kg/h\n"}, {text:"Add DDAVP to stop further free-water excretion\n"}, {text:"Loop diuretics\n"}, {text:"Target: bring Na+ back to safe correction limit"}, ], { x:5.25, y:3.28, w:4.3, h:1.85, fontSize:11.5, color:C.white, fontFace:"Calibri", valign:"top", wrap:true }); s.addShape(pres.ShapeType.rect, { x:0.25, y:5.35, w:9.5, h:0.42, fill:{color:C.red, transparency:20}, line:{color:C.red} }); s.addText("ODS Symptoms (days 2-6 post-correction): Dysarthria Dysphagia Paraparesis Locked-in Seizures Coma", { x:0.25, y:5.35, w:9.5, h:0.42, fontSize:11.5, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); } // ─── SLIDE 9: TREATMENT ─────────────────────────────────────────────────────── { const s = pres.addSlide(); lightSlide(s); tealBar(s, 0, 1.05); sectionTag(s, "TREATMENT"); slideTitle(s, "Treatment by Cause", 0.4, 0.2, 9.2, C.white); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:1.5, fill:{color:"FFF3E0"}, line:{color:C.red, pt:2} }); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:0.42, fill:{color:C.red}, line:{color:C.red} }); s.addText("EMERGENCY: Symptomatic / Seizures / Coma -> 3% Hypertonic NaCl", { x:0.3, y:1.15, w:9.4, h:0.42, fontSize:13, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText("150 mL 3% NaCl IV over 20 min -> recheck Na -> repeat up to 3x (450 mL max)\nStop when symptoms resolve OR Na rises 4-6 mEq/L | Limit: 8-12 mEq/L / 24 h", { x:0.5, y:1.6, w:9.0, h:0.96, fontSize:12, color:C.darkText, valign:"middle", wrap:true }); const rows = [ { cause:"Hypovolemic (GI/extra-renal)", tx:"0.9% NaCl -- volume repletion -> AVP suppresses -> aquaresis", color:C.teal }, { cause:"Thiazide-induced", tx:"Stop thiazide, correct K+ (itself raises Na+), consider loop diuretic instead", color:C.teal }, { cause:"Adrenal insufficiency (primary)", tx:"IV hydrocortisone + NS -- draw cortisol first, do not delay", color:C.teal }, { cause:"SIADH", tx:"Fluid restriction (U/P ratio guided) +/- oral Na +/- urea +/- tolvaptan (inpatient start)", color:"1565C0" }, { cause:"Hypothyroidism", tx:"Thyroid hormone (T4) replacement", color:"1565C0" }, { cause:"CHF / Cirrhosis", tx:"Treat underlying cause + fluid restriction + vaptan if refractory", color:"6A0572" }, { cause:"Beer potomania", tx:"0.9% NS + normal diet -- HIGH ODS RISK -- monitor very closely", color:C.red }, ]; rows.forEach((row, i) => { const y = 2.72 + i * 0.41; s.addShape(pres.ShapeType.rect, { x:0.3, y, w:9.4, h:0.4, fill:{color:i%2===0?C.white:C.lightBg}, line:{color:C.teal, pt:0.5} }); s.addShape(pres.ShapeType.rect, { x:0.3, y, w:0.14, h:0.4, fill:{color:row.color}, line:{color:row.color} }); s.addText(row.cause, { x:0.5, y, w:3.0, h:0.4, fontSize:11, bold:true, color:C.navy, valign:"middle" }); s.addText(row.tx, { x:3.55, y, w:6.1, h:0.4, fontSize:10.5, color:C.darkText, valign:"middle", wrap:true }); }); } // ─── SLIDE 10: CASE 1 ───────────────────────────────────────────────────────── { const s = pres.addSlide(); darkSlide(s); sectionTag(s, "CASE 1"); slideTitle(s, "Case 1: The Dehydrated Vomiter", 0.4, 0.2, 9.2, C.yellow); accentLine(s, 1.0); s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:9.5, h:0.9, fill:{color:C.teal, transparency:80}, line:{color:C.teal, pt:1} }); s.addText("67F | 3 days vomiting | BP 95/60 -> 78/50 orthostatic | HR 112 | Dry mucous membranes, skin tenting, no edema", { x:0.4, y:1.18, w:9.2, h:0.82, fontSize:12.5, color:C.white, fontFace:"Calibri", valign:"middle", italic:true, wrap:true }); const labs = [["Na+","124 mEq/L"],["Posm","258 mOsm/kg"],["Uosm","680 mOsm/kg"],["UNa","8 mEq/L"],["BUN","42"],["K+","3.1"]]; labs.forEach((l, i) => { const x = 0.25 + i * 1.6; s.addShape(pres.ShapeType.rect, { x, y:2.18, w:1.45, h:0.72, fill:{color:C.navy, transparency:30}, line:{color:C.aqua, pt:1.5} }); s.addText(l[0], { x, y:2.18, w:1.45, h:0.35, fontSize:11, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 }); s.addText(l[1], { x, y:2.53, w:1.45, h:0.37, fontSize:12, bold:true, color:C.yellow, align:"center", valign:"middle", margin:0 }); }); const analysis = [ ["Step 1 -- Posm 258","TRUE hypotonic hyponatremia confirmed"], ["Step 2 -- Volume","HYPOVOLEMIC -- orthostatics, tachycardia, high BUN"], ["Step 3 -- Uosm 680","AVP very active (kidney concentrating to preserve volume)"], ["Step 4 -- UNa 8","EXTRA-RENAL Na loss -- kidneys avid for sodium (GI losses)"], ]; analysis.forEach((st, i) => { const x = 0.25 + (i%2)*4.75; const y = 3.05 + Math.floor(i/2)*0.95; s.addShape(pres.ShapeType.rect, { x, y, w:4.45, h:0.85, fill:{color:"0A1A2A"}, line:{color:C.teal, pt:1} }); s.addText(st[0], { x:x+0.1, y, w:4.25, h:0.38, fontSize:11, bold:true, color:C.aqua, valign:"middle" }); s.addText(st[1], { x:x+0.1, y:y+0.38, w:4.25, h:0.4, fontSize:11, color:C.white, valign:"middle", wrap:true }); }); s.addShape(pres.ShapeType.rect, { x:0.25, y:5.02, w:9.5, h:0.42, fill:{color:C.teal}, line:{color:C.teal} }); s.addText("Dx: Hypovolemic hyponatremia (GI losses) | Rx: 0.9% NaCl + correct K+ | Monitor Na q4-6h", { x:0.25, y:5.02, w:9.5, h:0.42, fontSize:12.5, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); } // ─── SLIDE 11: CASE 2 ───────────────────────────────────────────────────────── { const s = pres.addSlide(); lightSlide(s); tealBar(s, 0, 1.05); sectionTag(s, "CASE 2"); slideTitle(s, "Case 2: SIADH in Small Cell Lung Cancer", 0.4, 0.2, 9.2, C.white); s.addShape(pres.ShapeType.rect, { x:0.3, y:1.15, w:9.4, h:0.78, fill:{color:C.navy, transparency:85}, line:{color:C.navy, pt:1} }); s.addText("52M | SCLC | 1 week: fatigue, confusion, headache | No edema, no orthostasis", { x:0.5, y:1.2, w:9.0, h:0.68, fontSize:12.5, color:C.darkText, fontFace:"Calibri", valign:"middle", italic:true }); const labs = [["Na+","118 mEq/L"],["Posm","242 mOsm/kg"],["Uosm","520 mOsm/kg"],["UNa","65 mEq/L"],["Uric Acid","2.8 mg/dL"],["K+","3.9"]]; labs.forEach((l, i) => { const x = 0.3 + i * 1.6; s.addShape(pres.ShapeType.rect, { x, y:2.05, w:1.45, h:0.72, fill:{color:C.teal, transparency:85}, line:{color:C.teal, pt:1.5} }); s.addText(l[0], { x, y:2.05, w:1.45, h:0.35, fontSize:11, bold:true, color:C.teal, align:"center", valign:"middle", margin:0 }); s.addText(l[1], { x, y:2.4, w:1.45, h:0.37, fontSize:12, bold:true, color:C.navy, align:"center", valign:"middle", margin:0 }); }); const steps = [ "Posm 242 -> true hypotonic hyponatremia", "Euvolemic -- no edema, no depletion signs", "Uosm 520 -> AVP active despite hyponatremia (inappropriate!)", "UNa 65 -> kidney NOT retaining sodium", "Uric acid 2.8 mg/dL -> hypouricemia = SIADH physiology", "SCLC context -> paraneoplastic ectopic AVP production", ]; steps.forEach((a, i) => { const x = 0.3 + (i%2)*4.75; const y = 2.88 + Math.floor(i/2)*0.55; s.addShape(pres.ShapeType.rect, { x, y, w:0.34, h:0.5, fill:{color:C.teal}, line:{color:C.teal} }); s.addText((i+1).toString(), { x, y, w:0.34, h:0.5, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText(a, { x:x+0.38, y, w:4.28, h:0.5, fontSize:11.5, color:C.darkText, valign:"middle", wrap:true }); }); s.addShape(pres.ShapeType.rect, { x:0.3, y:5.55, w:9.4, h:0.42, fill:{color:C.navy}, line:{color:C.navy} }); s.addText("Dx: SIADH paraneoplastic (SCLC) | Rx: Fluid restriction < 1 L/d +/- urea +/- tolvaptan | Treat SCLC", { x:0.3, y:5.55, w:9.4, h:0.42, fontSize:11.5, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 }); } // ─── SLIDE 12: CASES 3 & 4 ──────────────────────────────────────────────────── { const s = pres.addSlide(); darkSlide(s); sectionTag(s, "CASES 3 & 4"); slideTitle(s, "More Clinical Cases", 0.4, 0.2, 9.2, C.aqua); accentLine(s, 1.0); // Case 3 s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:4.55, fill:{color:"0A1520"}, line:{color:C.teal, pt:2} }); s.addShape(pres.ShapeType.rect, { x:0.25, y:1.15, w:4.6, h:0.42, fill:{color:C.teal}, line:{color:C.teal} }); s.addText("Case 3 - Marathon Runner (EAH)", { x:0.25, y:1.15, w:4.6, h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText("29F, collapses post-marathon, seizing\nDrank water continuously, gained weight during race\nNa 112 | Posm 228 | Uosm 68 | UNa 12", { x:0.4, y:1.65, w:4.3, h:0.9, fontSize:11, color:C.gray, fontFace:"Calibri", italic:true, wrap:true }); s.addText([ {text:"Key Clue: Uosm < 100 -> AVP is SUPPRESSED\n", options:{bold:true, color:C.yellow}}, {text:"-> Pure water intoxication (not SIADH)\n"}, {text:"-> ACUTE onset (< 24 h) = high neurologic risk\n"}, {text:"-> Weight gain during race = excessive free water intake\n"}, {text:"-> 44% of EAH cases also have SIADH component"}, ], { x:0.4, y:2.62, w:4.3, h:1.6, fontSize:11.5, color:C.white, fontFace:"Calibri", wrap:true, valign:"top" }); s.addShape(pres.ShapeType.rect, { x:0.25, y:4.28, w:4.6, h:0.56, fill:{color:C.red, transparency:20}, line:{color:C.red} }); s.addText("Rx: 150 mL 3% NaCl IV stat (acute - ODS risk low)\nRepeat up to 3x max -- stop when seizures resolve", { x:0.35, y:4.30, w:4.4, h:0.52, fontSize:11, bold:true, color:C.white, fontFace:"Calibri", wrap:true }); // Case 4 s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:4.55, fill:{color:"100A20"}, line:{color:C.yellow, pt:2} }); s.addShape(pres.ShapeType.rect, { x:5.15, y:1.15, w:4.6, h:0.42, fill:{color:"6A0572"}, line:{color:"6A0572"} }); s.addText("Case 4 - Thiazide Mimic of SIADH", { x:5.15, y:1.15, w:4.6, h:0.42, fontSize:12, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText("72F on HCTZ x 3 weeks for HTN\nWeakness, mild confusion, no edema\nNa 122 | Posm 256 | Uosm 380 | UNa 45 | K+ 2.8", { x:5.3, y:1.65, w:4.3, h:0.9, fontSize:11, color:C.gray, fontFace:"Calibri", italic:true, wrap:true }); s.addText([ {text:"Looks exactly like SIADH but...\n", options:{bold:true, color:C.yellow}}, {text:"Started thiazide 3 weeks ago\n"}, {text:"Hypokalemia (K+ 2.8) -- key clue! Few other hyponatremia causes also cause hypokalemia\n"}, {text:"Thiazide blocks DCT -> impairs diluting segment + volume depletion -> AVP rises\n"}, {text:"Do NOT diagnose SIADH until 1-2 weeks after stopping thiazide"}, ], { x:5.3, y:2.62, w:4.3, h:1.75, fontSize:11, color:C.white, fontFace:"Calibri", wrap:true, valign:"top" }); s.addShape(pres.ShapeType.rect, { x:5.15, y:4.28, w:4.6, h:0.56, fill:{color:C.yellow, transparency:30}, line:{color:C.yellow} }); s.addText("Rx: Stop HCTZ | Correct K+ (KCl itself raises Na+) | 0.9% NS if symptomatic | Monitor closely", { x:5.25, y:4.30, w:4.4, h:0.52, fontSize:11, bold:true, color:C.navy, fontFace:"Calibri", wrap:true }); } // ─── SLIDE 13: MASTER TABLE ─────────────────────────────────────────────────── { const s = pres.addSlide(); lightSlide(s); tealBar(s, 0, 1.05); sectionTag(s, "SUMMARY TABLE"); slideTitle(s, "High-Yield Summary Table", 0.4, 0.2, 9.2, C.white); const hdr = ["Condition","Vol","Uosm","UNa","Key Clue","Treatment"]; const hdrW = [2.0, 0.7, 0.75, 0.7, 2.2, 3.35]; let cx = 0.18; hdr.forEach((h, i) => { s.addShape(pres.ShapeType.rect, { x:cx, y:1.12, w:hdrW[i], h:0.38, fill:{color:C.navy}, line:{color:C.navy} }); s.addText(h, { x:cx, y:1.12, w:hdrW[i], h:0.38, fontSize:10.5, bold:true, color:C.aqua, align:"center", valign:"middle", margin:0 }); cx += hdrW[i]; }); const rows = [ ["GI / Extra-renal loss","Down","High","< 20","Orthostasis, vomiting","0.9% NS"], ["Thiazide diuretic","Down/Eu","High","> 20","Hypokalemia","Stop drug, correct K+"], ["Adrenal insufficiency","Down","High",">> 20","Hyperkalemia, pigmentation","Hydrocortisone + NS"], ["Cerebral salt wasting","Down","High","> 20","CNS pathology (SAH)","Na+ + volume"], ["SIADH","Eu","> 200","> 30","Hypouricemia, exclusion","Fluid restrict +/- urea/vaptan"], ["Hypothyroidism","Eu","Var","Var","High TSH, myxedema","T4 replacement"], ["Beer potomania","Eu","< 200","< 20","Alcoholism, low solute","NS + diet -- HIGH ODS risk!"], ["Psychogenic polydipsia","Eu","< 100","Low","Psych hx, schizophrenia","Fluid restriction"], ["EAH (exercise)","Eu","< 100","Low","Post-race, weight gain","3% NaCl if severe (acute)"], ["CHF / Cirrhosis","Up","High","< 10","Edema, ascites, high BNP","Treat cause, restrict fluids"], ["Renal failure","Up","Var","> 20","High Cr, high K+","Dialysis"], ]; const rH = 0.37; rows.forEach((row, ri) => { let rx = 0.18; hdrW.forEach((w, ci) => { const bg = ri % 2 === 0 ? C.white : C.lightBg; const vCol = row[1]==="Down" ? C.teal : row[1]==="Up" ? "6A0572" : "1565C0"; s.addShape(pres.ShapeType.rect, { x:rx, y:1.5+ri*rH, w, h:rH, fill:{color:bg}, line:{color:C.teal, pt:0.5} }); s.addText(row[ci], { x:rx, y:1.5+ri*rH, w, h:rH, fontSize: ci===5 ? 9 : 10, bold: ci===0 || ci===1, color: ci===1 ? vCol : (ci===4 ? C.teal : C.darkText), align: ci===0 ? "left" : "center", valign:"middle", wrap:true, margin: ci===0 ? [0,0,0,4] : 0, }); rx += w; }); }); } // ─── SLIDE 14: KEY TAKEAWAYS ────────────────────────────────────────────────── { const s = pres.addSlide(); darkSlide(s); s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:"100%", fill:{color:C.aqua}, line:{color:C.aqua} }); s.addShape(pres.ShapeType.ellipse, { x:7.2, y:-0.8, w:4, h:4, fill:{color:C.teal, transparency:80}, line:{color:C.teal, transparency:80} }); s.addText("Key Takeaways", { x:0.5, y:0.3, w:9, h:0.6, fontSize:30, bold:true, color:C.aqua, fontFace:"Calibri" }); accentLine(s, 1.0); const takes = [ ["1","Serum [Na+] reflects water balance, not total body Na+ -- volume status is the critical first clinical step"], ["2","Always exclude pseudohyponatremia (check measured Posm) and hypertonic causes (glucose) first"], ["3","Uosm < 100 = AVP suppressed -> polydipsia or EAH. Most other hyponatremia has Uosm > 100"], ["4","UNa < 20 with hypovolemia = extra-renal loss. High UNa despite low [Na+] = SIADH or renal Na+ wasting"], ["5","SIADH is a diagnosis of exclusion -- rule out hypothyroidism, adrenal insufficiency, diuretics first"], ["6","Correction limit: 8-10 mEq/L / 24 h in chronic hyponatremia -- exceeding this causes ODS"], ["7","Symptomatic acute hyponatremia -> 3% NaCl bolus 150 mL over 20 min, repeat up to 3x"], ["8","Hypokalemia correction itself raises plasma [Na+] -- watch for inadvertent overcorrection"], ]; takes.forEach((t, i) => { const y = 1.18 + i * 0.5; s.addShape(pres.ShapeType.ellipse, { x:0.45, y:y+0.08, w:0.34, h:0.34, fill:{color:C.teal}, line:{color:C.teal} }); s.addText(t[0], { x:0.45, y:y+0.08, w:0.34, h:0.34, fontSize:11, bold:true, color:C.white, align:"center", valign:"middle", margin:0 }); s.addText(t[1], { x:0.9, y, w:8.8, h:0.48, fontSize:12.5, color:C.white, fontFace:"Calibri", valign:"middle", wrap:true }); }); s.addText("Sources: Harrison's 22E | Brenner & Rector | Tintinalli's EM | NKF Primer | Symptom to Diagnosis 4E", { x:0.5, y:5.25, w:9, h:0.3, fontSize:9.5, color:C.gray, fontFace:"Calibri", italic:true }); } // ─── WRITE ──────────────────────────────────────────────────────────────────── pres.writeFile({ fileName: "/home/daytona/workspace/hyponatremia-ppt/Hyponatremia_Evaluation.pptx" }) .then(() => console.log("Done: Hyponatremia_Evaluation.pptx")) .catch(err => { console.error("Error:", err); process.exit(1); }); ENDOFSCRIPT echo "Script written successfully"

Running Command

cd /home/daytona/workspace/hyponatremia-ppt && node build.js 2>&1

Running Command

ls -lh /home/daytona/workspace/hyponatremia-ppt/Hyponatremia_Evaluation.pptx

Your presentation is ready. Here's your download link:

Hyponatremia Evaluation

Presentation · PPTX


14 slides covering everything from the previous session, organized as:
SlideContent
1Title slide (dark navy + aqua theme)
2Definition & Epidemiology - 4 stat cards
3Physiology - why hyponatremia happens
4The 4-Step Diagnostic Framework
5Urine Osmolality + Urine Sodium quick reference
6Three Volume Categories (hypo/eu/hyper)
7SIADH deep dive - criteria + causes + U/P ratio
8ODS - mechanism, limits, treatment if overcorrected
9Treatment by cause (including emergency 3% NaCl protocol)
10Clinical Case 1: Dehydrated vomiter (hypovolemic)
11Clinical Case 2: SIADH in SCLC
12Clinical Cases 3 & 4: Marathon runner (EAH) + Thiazide pitfall
13High-yield summary table - all 11 conditions
148 key takeaways
Design: Navy/teal/aqua color palette with yellow accents for callouts, red for danger/ODS - built for dark and light slides to keep attention.
This is a shared conversation. Sign in to Orris to start your own chat.