Pediatrics iv fluids rule When what where and how much to use
| Fluid | Na⁺ (mEq/L) | Use |
|---|---|---|
| 0.9% NaCl (Normal Saline) | 154 | Resuscitation bolus, isotonic maintenance |
| Lactated Ringer's | 130 | Resuscitation, surgery, preferred where Cl⁻ load is a concern |
| Plasmalyte | 140 | Balanced, near-physiologic |
| 0.45% NaCl (1/2 NS) | 77 | Ongoing repletion after resuscitation (with caution) |
| 0.225% NaCl (1/4 NS) | 38.5 | Largely abandoned for routine maintenance |
| D5W | 0 | Free water only; risk of hyponatremia - not for resuscitation |
| D5 0.9% NaCl | 154 | Post-resuscitation repletion with glucose |
| D10W | 0 | Neonatal hypoglycemia |
| Weight | Rate (hourly) | Rate (daily) |
|---|---|---|
| First 10 kg | 4 mL/kg/hr | 100 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 |
| Sign | Mild | Moderate | Severe |
|---|---|---|---|
| Older child | 3% (30 mL/kg) | 6% (60 mL/kg) | 9% (90 mL/kg) |
| Infant | 5% (50 mL/kg) | 10% (100 mL/kg) | 15% (150 mL/kg) |
| Mental status | Alert | Normal | Lethargic/obtunded |
| Eyes | Normal | Deep set | Sunken |
| Tears | Present | Reduced | None |
| Mucosa | Normal/dry | Dry | Parched/cracked |
| Fontanelle | Flat | Soft | Sunken |
Fluid deficit (mL) = % dehydration × 10 mL/kg × weight (kg) 1% dehydration = 10 mL/kg fluid deficit
| Phase | Action |
|---|---|
| Phase I - Stabilization | 20 mL/kg isotonic bolus (subtract from deficit) |
| Phase II - Deficit + Maintenance | Replace 1/2 remaining deficit over first 8 hr + maintenance; Replace 2nd half over next 16 hr + maintenance |
| Phase III - Recovery | Continue maintenance + replace ongoing losses |
| Scenario | Fluid | Rate/Volume |
|---|---|---|
| Maintenance | 0.9% NaCl or LR ± dextrose | 4-2-1 rule (Holliday-Segar) |
| Shock resuscitation | 0.9% NaCl or LR | 20 mL/kg bolus, repeat PRN |
| Mild dehydration | ORT preferred; if IV: NS or LR | Deficit over 24 hr + maintenance |
| Moderate dehydration | 0.9% NaCl or LR | Phase I bolus + Phase II deficit replacement |
| Severe dehydration | 0.9% NaCl | Aggressive boluses + 24 hr deficit replacement |
| Hypoglycemia | D10W (safe all ages) / D25% / D50% | Rule of 50 |
| Hyponatremia maintenance | 0.9% NaCl (isotonic) | Slow correction |
| Hypernatremic dehydration | 0.9% NaCl, then 0.45% NS | Correct over 48-72 hr |
Make a4 I want to take print out
mkdir -p /home/daytona/workspace/peds-iv-fluids && ls /home/daytona/workspace/peds-iv-fluids/
~/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}")
cd /home/daytona/workspace/peds-iv-fluids && python generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/peds-iv-fluids/Pediatric_IV_Fluids.pdf
Pediatric IV Fluids
PDF Document · PDF