Pediatrics iv fluids rule When what where and how much to use

Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
I now have comprehensive data. Let me compile the full answer.

Pediatric IV Fluids - Complete Guide

The Core Framework: Three Questions

Every pediatric IV fluid order must answer:
  1. Why (indication) - maintenance, resuscitation, deficit replacement, or special condition
  2. What (fluid type) - which solution to use
  3. How much & how fast (rate/volume) - calculated by formula

PART 1 - WHEN to Use IV Fluids

IV fluids are indicated when oral/enteral rehydration is not possible or has failed:
  • Shock or severe dehydration (>9% in older children, >15% in infants)
  • Intractable vomiting preventing adequate oral intake
  • Altered mental status
  • Hypoglycemia requiring IV dextrose
  • Electrolyte derangements (severe hypo/hypernatremia, hypokalemia)
  • Surgical NPO status / perioperative management
  • Inability to tolerate ORT after 8 hours trial
Key point: Oral rehydration therapy (ORT) is always preferred over IV for mild-moderate dehydration. IV fluids are a step up when ORT fails or is contraindicated.

PART 2 - WHAT Fluid to Use

Current Standard: ISOTONIC fluids for maintenance

The 2018 AAP guidelines updated decades of practice - isotonic normal saline (0.9% NaCl) or Lactated Ringer's are now the preferred maintenance fluids for most hospitalized children, replacing the old 1/4 NS (0.225%) standard. This change came after evidence showed hypotonic maintenance fluids caused hospital-acquired hyponatremia.
FluidNa⁺ (mEq/L)Use
0.9% NaCl (Normal Saline)154Resuscitation bolus, isotonic maintenance
Lactated Ringer's130Resuscitation, surgery, preferred where Cl⁻ load is a concern
Plasmalyte140Balanced, near-physiologic
0.45% NaCl (1/2 NS)77Ongoing repletion after resuscitation (with caution)
0.225% NaCl (1/4 NS)38.5Largely abandoned for routine maintenance
D5W0Free water only; risk of hyponatremia - not for resuscitation
D5 0.9% NaCl154Post-resuscitation repletion with glucose
D10W0Neonatal hypoglycemia
Potassium: Add KCl 20 mEq/L (or up to 40 mEq/L) to maintenance fluids only after urine output is confirmed.
Dextrose: Added to maintenance fluids for ongoing caloric/glucose needs (especially in infants and neonates). NOT added to resuscitation boluses.

PART 3 - HOW MUCH (Volume Calculations)

A. Maintenance Fluids - The Holliday-Segar Method ("4-2-1 Rule")

The most widely used formula, based on caloric expenditure:
WeightRate (hourly)Rate (daily)
First 10 kg4 mL/kg/hr100 mL/kg/day
Second 10 kg+ 2 mL/kg/hr+ 50 mL/kg/day
Each kg >20 kg+ 1 mL/kg/hr+ 20 mL/kg/day
Maximum recommended rate: 120 mL/hr (in absence of cardiac, hepatic, or renal disease)
Important: Holliday-Segar is NOT suitable for neonates <14 days old - it overestimates their needs. See neonatal fluid protocols separately.
Worked example (25 kg child):
  • First 10 kg: 4 × 10 = 40 mL/hr
  • Second 10 kg: 2 × 10 = 20 mL/hr
  • Remaining 5 kg: 1 × 5 = 5 mL/hr
  • Total = 65 mL/hr (or 1600 mL/day)

B. Dehydration Assessment - Grading

SignMildModerateSevere
Older child3% (30 mL/kg)6% (60 mL/kg)9% (90 mL/kg)
Infant5% (50 mL/kg)10% (100 mL/kg)15% (150 mL/kg)
Mental statusAlertNormalLethargic/obtunded
EyesNormalDeep setSunken
TearsPresentReducedNone
MucosaNormal/dryDryParched/cracked
FontanelleFlatSoftSunken
Calculating deficit:
Fluid deficit (mL) = % dehydration × 10 mL/kg × weight (kg) 1% dehydration = 10 mL/kg fluid deficit

C. Resuscitation Phase (Emergency Phase - Shock/Severe Dehydration)

Goal: Rapid restoration of intravascular volume
  • Bolus: 20 mL/kg of isotonic crystalloid (0.9% NaCl or LR) IV/IO as fast as possible
  • Reassess every 5-15 minutes
  • Repeat boluses of 20 mL/kg PRN until shock resolves
  • If >60 mL/kg without improvement: investigate for cardiogenic shock, septic shock, hemorrhage, or adrenal insufficiency
Glucose correction ("Rule of 50"):
  • Dextrose % × mL/kg = 50
  • Neonate: D10W at 5 mL/kg
  • 1 month - ~8 yr (up to 25 kg): D25% at 2 mL/kg
  • Older child: D50% at 1 mL/kg
  • D10% is safe at all ages and preferred if extravasation risk exists

D. Deficit Replacement Phase (Repletion Phase - 24 hours)

The 3-phase replacement approach:
PhaseAction
Phase I - Stabilization20 mL/kg isotonic bolus (subtract from deficit)
Phase II - Deficit + MaintenanceReplace 1/2 remaining deficit over first 8 hr + maintenance; Replace 2nd half over next 16 hr + maintenance
Phase III - RecoveryContinue maintenance + replace ongoing losses
Ongoing losses replacement:
  • Each diarrheal stool: replace 10 mL/kg
  • Each vomiting episode: replace 2 mL/kg
Worked example (15 kg child, 10% dehydration, isonatremic):
  • Maintenance: 1250 mL/24 hr (52 mL/hr)
  • Deficit: 10% × 10 mL/kg × 15 kg = 1500 mL
  • If 20 mL/kg bolus given (300 mL): remaining deficit = 1200 mL
    • First 8 hr: 600 mL/8 hr (75 mL/hr) + 52 mL/hr maintenance = 127 mL/hr
    • Next 16 hr: 600 mL/16 hr (38 mL/hr) + 52 mL/hr maintenance = 90 mL/hr

PART 4 - SPECIAL CONSIDERATIONS

Isonatremic Dehydration (Na 130-150 mEq/L)

Use isotonic fluid (NS or LR) for replacement per the 3-phase protocol above.

Hyponatremic Dehydration (Na <130 mEq/L)

  • Use isotonic NS; avoid hypotonic solutions
  • Correct sodium slowly to prevent osmotic demyelination syndrome (central pontine myelinolysis)
  • Target correction: no faster than 8-12 mEq/L per 24 hours

Hypernatremic Dehydration (Na >150 mEq/L)

  • Use isotonic NS initially; correct slowly
  • Overly rapid correction causes cerebral edema
  • Target correction: no faster than 10-12 mEq/L per 24 hours
  • Replace deficit over 48-72 hours, not 24 hours

Neonates (<14 days old)

  • Holliday-Segar does NOT apply - overestimates needs
  • Start D10W for glucose needs
  • Consult neonatal fluid protocols

DKA

  • 10-20 mL/kg isotonic NS bolus in shock
  • Avoid excessive fluid boluses (cerebral edema risk)
  • Switch to specific DKA protocol

Quick Reference Summary

ScenarioFluidRate/Volume
Maintenance0.9% NaCl or LR ± dextrose4-2-1 rule (Holliday-Segar)
Shock resuscitation0.9% NaCl or LR20 mL/kg bolus, repeat PRN
Mild dehydrationORT preferred; if IV: NS or LRDeficit over 24 hr + maintenance
Moderate dehydration0.9% NaCl or LRPhase I bolus + Phase II deficit replacement
Severe dehydration0.9% NaClAggressive boluses + 24 hr deficit replacement
HypoglycemiaD10W (safe all ages) / D25% / D50%Rule of 50
Hyponatremia maintenance0.9% NaCl (isotonic)Slow correction
Hypernatremic dehydration0.9% NaCl, then 0.45% NSCorrect over 48-72 hr

Sources: The Harriet Lane Handbook, 23rd ed. (Johns Hopkins), p. 389-395 | Roberts and Hedges' Clinical Procedures in Emergency Medicine, p. 1732 | Rosen's Emergency Medicine, p. 3260-3262

Make a4 I want to take print out

Reading File
Running Command

mkdir -p /home/daytona/workspace/peds-iv-fluids && ls /home/daytona/workspace/peds-iv-fluids/

Writing File

~/peds-iv-fluids/generate_pdf.py

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

OUTPUT = "/home/daytona/workspace/peds-iv-fluids/Pediatric_IV_Fluids.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=18*mm, rightMargin=18*mm,
    topMargin=16*mm, bottomMargin=16*mm
)

W = A4[0] - 36*mm   # usable width

# ── Colour palette ──────────────────────────────────────────────────────────
NAVY   = colors.HexColor("#0D3B66")
TEAL   = colors.HexColor("#1A7A8A")
LTBLUE = colors.HexColor("#D6EAF8")
MINT   = colors.HexColor("#D5F5E3")
AMBER  = colors.HexColor("#FEF9E7")
RED    = colors.HexColor("#C0392B")
GREY   = colors.HexColor("#F2F3F4")
WHITE  = colors.white
BLACK  = colors.black
ORANGE = colors.HexColor("#E67E22")
PURPLE = colors.HexColor("#7D3C98")

# ── Styles ───────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()

def S(name, **kw):
    s = ParagraphStyle(name, **kw)
    return s

title_style = S("Title",
    fontName="Helvetica-Bold", fontSize=18,
    textColor=WHITE, alignment=TA_CENTER,
    spaceAfter=2, leading=22)

subtitle_style = S("Subtitle",
    fontName="Helvetica", fontSize=9,
    textColor=WHITE, alignment=TA_CENTER,
    spaceAfter=0, leading=12)

section_style = S("Section",
    fontName="Helvetica-Bold", fontSize=10,
    textColor=WHITE, alignment=TA_LEFT,
    spaceAfter=0, leading=14, leftIndent=3)

body_style = S("Body",
    fontName="Helvetica", fontSize=8.2,
    textColor=BLACK, alignment=TA_LEFT,
    spaceAfter=2, leading=11, leftIndent=4)

bold_style = S("Bold",
    fontName="Helvetica-Bold", fontSize=8.2,
    textColor=BLACK, alignment=TA_LEFT,
    spaceAfter=2, leading=11, leftIndent=4)

note_style = S("Note",
    fontName="Helvetica-Oblique", fontSize=7.5,
    textColor=colors.HexColor("#555555"), alignment=TA_LEFT,
    spaceAfter=2, leading=10, leftIndent=6)

footer_style = S("Footer",
    fontName="Helvetica-Oblique", fontSize=6.5,
    textColor=colors.HexColor("#777777"), alignment=TA_CENTER,
    spaceAfter=0, leading=9)

th_style = S("TH",
    fontName="Helvetica-Bold", fontSize=7.8,
    textColor=WHITE, alignment=TA_CENTER, leading=10)

td_style = S("TD",
    fontName="Helvetica", fontSize=7.5,
    textColor=BLACK, alignment=TA_CENTER, leading=10)

tdb_style = S("TDB",
    fontName="Helvetica-Bold", fontSize=7.5,
    textColor=BLACK, alignment=TA_LEFT, leading=10)

tdc_style = S("TDC",
    fontName="Helvetica", fontSize=7.5,
    textColor=BLACK, alignment=TA_LEFT, leading=10)

# ── Helper builders ──────────────────────────────────────────────────────────
def section_header(text, color=NAVY):
    tbl = Table([[Paragraph(text, section_style)]], colWidths=[W])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS", [3]),
    ]))
    return tbl

def rule():
    return HRFlowable(width="100%", thickness=0.5,
                      color=colors.HexColor("#CCCCCC"), spaceAfter=4, spaceBefore=2)

def sp(h=4):
    return Spacer(1, h)

def bullet(text, indent=8):
    return Paragraph(f"<bullet bulletIndent='{indent}'>•</bullet> {text}", body_style)

def note(text):
    return Paragraph(f"⚠ {text}", note_style)

def make_table(headers, rows, col_widths, header_color=NAVY,
               alt_color=GREY, bold_first=False):
    data = []
    header_row = [Paragraph(h, th_style) for h in headers]
    data.append(header_row)
    for i, row in enumerate(rows):
        cells = []
        for j, cell in enumerate(row):
            if j == 0 and bold_first:
                cells.append(Paragraph(cell, tdb_style))
            else:
                cells.append(Paragraph(cell, tdc_style))
        data.append(cells)

    t = Table(data, colWidths=col_widths)
    style = [
        ("BACKGROUND",   (0,0), (-1,0),  header_color),
        ("TEXTCOLOR",    (0,0), (-1,0),  WHITE),
        ("FONTNAME",     (0,0), (-1,0),  "Helvetica-Bold"),
        ("ALIGN",        (0,0), (-1,-1), "CENTER"),
        ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
        ("GRID",         (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
        ("TOPPADDING",   (0,0), (-1,-1), 3),
        ("BOTTOMPADDING",(0,0), (-1,-1), 3),
        ("LEFTPADDING",  (0,0), (-1,-1), 4),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
    ]
    for i in range(1, len(data)):
        bg = WHITE if i % 2 == 1 else alt_color
        style.append(("BACKGROUND", (0,i), (-1,i), bg))
    t.setStyle(TableStyle(style))
    return t

# ── TITLE BANNER ─────────────────────────────────────────────────────────────
title_banner = Table(
    [[Paragraph("PEDIATRIC IV FLUIDS — COMPLETE REFERENCE", title_style)],
     [Paragraph("When · What · How Much · Special Scenarios", subtitle_style)]],
    colWidths=[W]
)
title_banner.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,-1), NAVY),
    ("TOPPADDING",    (0,0), (-1,-1), 8),
    ("BOTTOMPADDING", (0,0), (-1,-1), 8),
    ("LEFTPADDING",   (0,0), (-1,-1), 10),
    ("RIGHTPADDING",  (0,0), (-1,-1), 10),
]))

# ══════════════════════════════════════════════════════════════════════════════
# BUILD STORY
# ══════════════════════════════════════════════════════════════════════════════
story = []

story.append(title_banner)
story.append(sp(8))

# ── SECTION 1: WHEN ──────────────────────────────────────────────────────────
story.append(section_header("1.  WHEN TO USE IV FLUIDS  (Indications)", TEAL))
story.append(sp(4))

indications = [
    ["Shock / Circulatory Failure", "Immediate IV access; bolus therapy"],
    ["Severe dehydration (>9% older child / >15% infant)", "Cannot correct orally; IV replacement needed"],
    ["Intractable vomiting / unable to maintain ORT", "ORT failed after attempt; switch to IV"],
    ["Altered mental status / decreased consciousness", "Airway protection; ORT unsafe"],
    ["Hypoglycemia requiring dextrose bolus", "Glucose emergency; IV dextrose required"],
    ["Electrolyte derangements (severe hypo/hypernatremia)", "Controlled IV correction needed"],
    ["Surgical / procedural NPO status", "Perioperative maintenance fluids"],
    ["ORT failure after 8-hour trial", "Insufficient volume repletion orally"],
]
story.append(make_table(
    ["Indication", "Rationale"],
    indications,
    [W*0.45, W*0.55],
    header_color=TEAL, bold_first=True
))
story.append(sp(3))
story.append(note("ORT (Oral Rehydration Therapy) is ALWAYS preferred over IV for mild-moderate dehydration. IV = step up when ORT fails or is contraindicated."))
story.append(sp(8))

# ── SECTION 2: WHAT ──────────────────────────────────────────────────────────
story.append(section_header("2.  WHAT FLUID TO USE", NAVY))
story.append(sp(4))

story.append(Paragraph("<b>Current Standard (AAP 2018 Guidelines): Isotonic fluids for maintenance</b> — replaces old ¼ NS practice to prevent hospital-acquired hyponatremia.", body_style))
story.append(sp(4))

fluids = [
    ["0.9% NaCl (Normal Saline)", "154", "Isotonic", "Resuscitation bolus, isotonic maintenance"],
    ["Lactated Ringer's (LR)", "130", "Isotonic", "Resuscitation, surgery; lower Cl⁻ load"],
    ["Plasmalyte", "140", "Isotonic", "Balanced, near-physiologic; ideal for maintenance"],
    ["0.45% NaCl (½ NS)", "77", "Hypotonic", "Post-resuscitation repletion (with caution)"],
    ["0.225% NaCl (¼ NS)", "38.5", "Hypotonic", "LARGELY ABANDONED for routine maintenance"],
    ["D5W / D10W", "0", "Hypotonic", "Neonatal hypoglycemia; NOT for resuscitation"],
    ["D5 0.9% NaCl", "154", "Isotonic", "Post-resuscitation repletion with glucose support"],
    ["3% NaCl (Hypertonic saline)", "513", "Hypertonic", "Symptomatic severe hyponatremia ONLY (ICU)"],
]
story.append(make_table(
    ["Fluid", "Na⁺ (mEq/L)", "Tonicity", "Use"],
    fluids,
    [W*0.24, W*0.13, W*0.13, W*0.50],
    header_color=NAVY, bold_first=True
))
story.append(sp(3))
story.append(note("Potassium (KCl 20 mEq/L, max 40 mEq/L): Add to maintenance fluids ONLY after urine output is confirmed."))
story.append(note("Dextrose: Add to maintenance fluids for caloric/glucose needs — especially in infants/neonates. Do NOT add to resuscitation boluses."))
story.append(sp(8))

# ── SECTION 3: HOW MUCH ──────────────────────────────────────────────────────
story.append(section_header("3.  HOW MUCH — VOLUME CALCULATIONS", PURPLE))
story.append(sp(5))

# 3A – Holliday-Segar
story.append(Paragraph("<b>A. Maintenance Fluids — Holliday-Segar Method (4-2-1 Rule)</b>", bold_style))
story.append(sp(3))

hs = [
    ["First 10 kg",       "4 mL/kg/hr",  "100 mL/kg/day"],
    ["Second 10 kg",      "+ 2 mL/kg/hr","+ 50 mL/kg/day"],
    ["Each kg above 20 kg","+ 1 mL/kg/hr","+ 20 mL/kg/day"],
]
story.append(make_table(
    ["Weight Category", "Hourly Rate", "Daily Rate"],
    hs,
    [W*0.40, W*0.30, W*0.30],
    header_color=PURPLE, bold_first=True
))
story.append(sp(3))

# Worked example box
ex_data = [[
    Paragraph("<b>Worked Example — 25 kg child:</b>", tdb_style),
    Paragraph(
        "First 10 kg: 4×10 = 40 mL/hr  |  Second 10 kg: 2×10 = 20 mL/hr  |  Remaining 5 kg: 1×5 = 5 mL/hr<br/>"
        "<b>Total = 65 mL/hr  (1,600 mL/day)</b>  |  Maximum rate: 120 mL/hr (no cardiac/hepatic/renal pathology)",
        tdc_style)
]]
ex_box = Table(ex_data, colWidths=[W*0.27, W*0.73])
ex_box.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), AMBER),
    ("GRID",       (0,0), (-1,-1), 0.4, colors.HexColor("#F0C040")),
    ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING", (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",(0,0), (-1,-1), 6),
]))
story.append(ex_box)
story.append(sp(3))
story.append(note("Holliday-Segar is NOT suitable for neonates <14 days old — overestimates fluid needs. Use neonatal protocols instead."))
story.append(sp(6))

# 3B – Dehydration assessment
story.append(Paragraph("<b>B. Dehydration Assessment & Grading</b>", bold_style))
story.append(sp(3))

deh = [
    ["Mental status",       "Alert",          "Normal → drowsy",       "Lethargic / obtunded"],
    ["Eyes",                "Normal",          "Deep set",              "Sunken"],
    ["Tears",               "Present",         "Reduced",               "Absent"],
    ["Buccal mucosa/lips",  "Normal / dry",    "Dry",                   "Parched / cracked"],
    ["Fontanelle (infant)", "Flat",            "Soft depression",       "Sunken"],
    ["Capillary refill",    "< 2 sec",         "2–3 sec",               "≥ 3 sec"],
    ["Skin turgor",         "Normal",          "Slightly reduced",      "Tenting"],
    ["Heart rate",          "Normal",          "Mildly elevated",       "Tachycardia"],
    ["Urine output",        "Normal",          "Reduced",               "Markedly decreased / none"],
    ["<b>Older child</b>",  "<b>3% (30 mL/kg)</b>","<b>6% (60 mL/kg)</b>","<b>9% (90 mL/kg)</b>"],
    ["<b>Infant</b>",       "<b>5% (50 mL/kg)</b>","<b>10% (100 mL/kg)</b>","<b>15% (150 mL/kg)</b>"],
]
story.append(make_table(
    ["Clinical Sign", "Mild", "Moderate", "Severe"],
    deh,
    [W*0.30, W*0.23, W*0.23, W*0.24],
    header_color=TEAL, bold_first=True
))
story.append(sp(3))

formula_data = [[
    Paragraph("<b>Deficit formula:</b>", tdb_style),
    Paragraph("Fluid deficit (mL) = % dehydration × 10 mL/kg × weight (kg)<br/><i>1% dehydration = 10 mL/kg fluid deficit</i>", tdc_style)
]]
formula_box = Table(formula_data, colWidths=[W*0.22, W*0.78])
formula_box.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), MINT),
    ("GRID",       (0,0), (-1,-1), 0.4, colors.HexColor("#27AE60")),
    ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING", (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",(0,0), (-1,-1), 6),
]))
story.append(formula_box)
story.append(sp(8))

# ── SECTION 4: PHASES OF MANAGEMENT ─────────────────────────────────────────
story.append(section_header("4.  THREE-PHASE IV FLUID MANAGEMENT", ORANGE))
story.append(sp(4))

phases = [
    ["Phase I\nStabilization",
     "Rapid expansion of intravascular volume",
     "20 mL/kg isotonic NS or LR  IV/IO as fast as possible\nRepeat every 5-15 min PRN until shock resolves\nIf >60 mL/kg no improvement → investigate other causes"],
    ["Phase II\nDeficit + Maintenance\n(24 hr)",
     "Correct fluid deficit + provide maintenance",
     "Subtract any Phase I bolus from total deficit\n½ remaining deficit over first 8 hr + maintenance rate\n½ remaining deficit over next 16 hr + maintenance rate\nReplace ongoing losses: 10 mL/kg/stool, 2 mL/kg/emesis"],
    ["Phase III\nRecovery",
     "Sustain homeostasis; replace ongoing losses",
     "Continue maintenance rate\nReplace ongoing losses as they occur\nTransition to oral fluids as tolerated"],
]

phase_rows = []
for row in phases:
    phase_rows.append([
        Paragraph(row[0], tdb_style),
        Paragraph(row[1], tdc_style),
        Paragraph(row[2], tdc_style),
    ])

phase_tbl = Table(
    [[Paragraph("Phase", th_style), Paragraph("Goal", th_style), Paragraph("Action", th_style)]] + phase_rows,
    colWidths=[W*0.16, W*0.27, W*0.57]
)
phase_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), ORANGE),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("RIGHTPADDING",  (0,0), (-1,-1), 4),
    ("BACKGROUND",    (0,1), (-1,1), WHITE),
    ("BACKGROUND",    (0,2), (-1,2), GREY),
    ("BACKGROUND",    (0,3), (-1,3), WHITE),
]))
story.append(phase_tbl)
story.append(sp(5))

# Worked example Phase II
ex2_data = [[
    Paragraph("<b>Phase II Example:</b>\n15 kg child, 10% dehydration, isonatremic:", tdb_style),
    Paragraph(
        "Maintenance = 1,250 mL/24 hr (52 mL/hr)  |  Deficit = 10% × 10 mL/kg × 15 kg = <b>1,500 mL</b><br/>"
        "After 20 mL/kg bolus (300 mL): remaining deficit = 1,200 mL<br/>"
        "First 8 hr: 600÷8 = 75 mL/hr + 52 mL/hr maintenance = <b>127 mL/hr</b><br/>"
        "Next 16 hr: 600÷16 = 38 mL/hr + 52 mL/hr maintenance = <b>90 mL/hr</b>",
        tdc_style)
]]
ex2_box = Table(ex2_data, colWidths=[W*0.32, W*0.68])
ex2_box.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), AMBER),
    ("GRID",       (0,0), (-1,-1), 0.4, colors.HexColor("#F0C040")),
    ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
    ("TOPPADDING", (0,0), (-1,-1), 5),
    ("BOTTOMPADDING",(0,0), (-1,-1), 5),
    ("LEFTPADDING",(0,0), (-1,-1), 6),
]))
story.append(ex2_box)
story.append(sp(8))

# ── SECTION 5: HYPOGLYCEMIA ───────────────────────────────────────────────────
story.append(section_header("5.  HYPOGLYCEMIA — RULE OF 50  (Dextrose % × mL/kg = 50)", RED))
story.append(sp(4))

gluc = [
    ["Neonate", "D10W", "5 mL/kg", "Safe tonicity; lowest extravasation risk"],
    ["1 month – ~8 yr (up to 25 kg)", "D25%", "2 mL/kg", "Peripheral IV acceptable; monitor site"],
    ["Older child / adolescent", "D50%", "1 mL/kg", "Higher tonicity — caution with peripheral IV"],
    ["All ages (if extravasation concern)", "D10W", "5 mL/kg", "Safest option at all ages for peripheral IV"],
]
story.append(make_table(
    ["Age Group", "Solution", "Dose", "Notes"],
    gluc,
    [W*0.30, W*0.12, W*0.12, W*0.46],
    header_color=RED, bold_first=True
))
story.append(sp(3))
story.append(note("Monitor glucose every 30-60 min until stable. Recurrent hypoglycemia → consider sepsis, adrenal insufficiency, fatty acid oxidation defect."))
story.append(sp(8))

# ── SECTION 6: SPECIAL SCENARIOS ─────────────────────────────────────────────
story.append(section_header("6.  SPECIAL SCENARIOS", TEAL))
story.append(sp(4))

special = [
    ["Isonatremic dehydration\n(Na 130–150 mEq/L)",
     "0.9% NaCl or LR",
     "Standard 3-phase protocol above. Correct over 24 hr."],
    ["Hyponatremic dehydration\n(Na < 130 mEq/L)",
     "0.9% NaCl (isotonic)\nAVOID hypotonic fluids",
     "Correct Na⁺ slowly: max 8–12 mEq/L per 24 hr\nRisk: osmotic demyelination syndrome (central pontine myelinolysis) if too fast"],
    ["Hypernatremic dehydration\n(Na > 150 mEq/L)",
     "0.9% NaCl initially\nthen 0.45% NaCl",
     "Correct Na⁺ slowly: max 10–12 mEq/L per 24 hr\nReplace deficit over 48–72 hr (NOT 24 hr)\nRisk: cerebral edema if corrected too rapidly"],
    ["DKA",
     "0.9% NaCl",
     "10–20 mL/kg bolus for shock only\nAvoid excess fluids (cerebral edema risk)\nFollow dedicated DKA protocol for ongoing management"],
    ["Neonates < 14 days",
     "D10W",
     "Do NOT use Holliday-Segar — overestimates needs\nUse neonatal-specific protocols\nMonitor glucose closely"],
    ["Septic shock",
     "0.9% NaCl or LR",
     "20 mL/kg boluses; reassess after each\nAvoid albumin routinely unless specific indication\nEarly vasopressors if fluid-refractory"],
]

sp_rows = []
for row in special:
    sp_rows.append([
        Paragraph(row[0], tdb_style),
        Paragraph(row[1], tdc_style),
        Paragraph(row[2], tdc_style),
    ])

sp_tbl = Table(
    [[Paragraph("Scenario", th_style), Paragraph("Fluid of Choice", th_style), Paragraph("Key Points", th_style)]] + sp_rows,
    colWidths=[W*0.25, W*0.22, W*0.53]
)
sp_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), TEAL),
    ("TEXTCOLOR",     (0,0), (-1,0), WHITE),
    ("GRID",          (0,0), (-1,-1), 0.4, colors.HexColor("#AAAAAA")),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ("TOPPADDING",    (0,0), (-1,-1), 4),
    ("BOTTOMPADDING", (0,0), (-1,-1), 4),
    ("LEFTPADDING",   (0,0), (-1,-1), 4),
    ("RIGHTPADDING",  (0,0), (-1,-1), 4),
]))
for i in range(1, len(sp_rows)+1):
    bg = WHITE if i % 2 == 1 else GREY
    sp_tbl._argH  # force layout
    sp_tbl.setStyle(TableStyle([("BACKGROUND", (0,i), (-1,i), bg)]))

story.append(sp_tbl)
story.append(sp(8))

# ── SECTION 7: QUICK REFERENCE TABLE ─────────────────────────────────────────
story.append(section_header("7.  QUICK REFERENCE SUMMARY", NAVY))
story.append(sp(4))

qr = [
    ["Maintenance (all hospitalized children)",  "0.9% NaCl or LR ± dextrose", "4-2-1 Rule (Holliday-Segar)"],
    ["Shock / circulatory failure",              "0.9% NaCl or LR",            "20 mL/kg bolus IV/IO; repeat PRN"],
    ["Mild dehydration",                         "ORT preferred; if IV: NS/LR", "Deficit over 24 hr + maintenance"],
    ["Moderate dehydration",                     "0.9% NaCl or LR",            "Phase I bolus → Phase II deficit"],
    ["Severe dehydration",                       "0.9% NaCl",                  "Aggressive boluses + 24 hr replacement"],
    ["Hypoglycemia",                             "D10W / D25% / D50%",         "Rule of 50 (% dextrose × mL/kg = 50)"],
    ["Hyponatremia",                             "0.9% NaCl (isotonic)",       "Correct ≤ 8-12 mEq/L per 24 hr"],
    ["Hypernatremia",                            "0.9% NaCl → 0.45% NaCl",    "Correct ≤ 10-12 mEq/L per 24 hr; 48-72 hr"],
    ["Neonate < 14 days",                        "D10W (neonatal protocol)",   "Do NOT use Holliday-Segar"],
    ["DKA",                                      "0.9% NaCl",                  "10-20 mL/kg bolus; dedicated DKA protocol"],
]
story.append(make_table(
    ["Clinical Scenario", "Fluid", "Rate / Volume"],
    qr,
    [W*0.35, W*0.27, W*0.38],
    header_color=NAVY, bold_first=True
))
story.append(sp(6))

# ── FOOTER ────────────────────────────────────────────────────────────────────
story.append(rule())
story.append(Paragraph(
    "Sources: Harriet Lane Handbook 23rd ed. (Johns Hopkins) · Roberts & Hedges' Clinical Procedures in Emergency Medicine · "
    "Rosen's Emergency Medicine · AAP 2018 Maintenance IV Fluid Guidelines  |  For clinical use — always verify with current institutional protocols.",
    footer_style
))

# ── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
Running Command

cd /home/daytona/workspace/peds-iv-fluids && python generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/peds-iv-fluids/Pediatric_IV_Fluids.pdf

Your A4 print-ready PDF is ready! Download it here:

Pediatric IV Fluids

PDF Document · PDF

What's included in the PDF (A4, print-optimised):
  1. When to Use IV Fluids - indications table with rationale
  2. What Fluid to Use - all common solutions (NS, LR, Plasmalyte, D5W, etc.) with Na⁺ content, tonicity, and clinical use
  3. How Much - Holliday-Segar 4-2-1 Rule - with worked example (25 kg child)
  4. Dehydration Grading Table - clinical signs for mild/moderate/severe with deficit volumes
  5. Three-Phase Management - stabilization, deficit+maintenance, recovery with a full worked example (15 kg, 10% dehydrated child)
  6. Hypoglycemia Rule of 50 - dextrose dosing by age
  7. Special Scenarios - isonatremic, hyponatremic, hypernatremic dehydration, DKA, neonates, septic shock
  8. Quick Reference Summary - one-glance table for all clinical scenarios
Color-coded by section for easy reading when printed.
This is a shared conversation. Sign in to Orris to start your own chat.