Gastroenterology pediatrics important questions from ghai textbook
Ghai Essential Pediatrics gastroenterology important exam questions topics
https://jasu.kg/wp-content/uploads/2024/04/Ghai-Essential-Pe…
Ghai Essential Pediatrics chapter 12 gastrointestinal system liver topics list diarrhea jaundice hepatitis
https://dokumen.pub/ghai-essential-pediatrics-10e-tenth-edit…
| Degree | % Weight Loss | Signs |
|---|---|---|
| No dehydration | <5% | Normal |
| Some dehydration | 5-10% | Restlessness, sunken eyes, reduced skin turgor, thirsty |
| Severe dehydration | >10% | Lethargy/unconscious, very sunken eyes, skin goes back very slowly, unable to drink |
| Age <6 months | Age 6 months - 5 years | Age >5 years |
|---|---|---|
| Cow milk protein allergy | Celiac disease | Celiac disease |
| Short bowel syndrome | Giardiasis | IBD |
| Immunodeficiency | Toddler's diarrhea | GI tuberculosis |
| Anatomical defects | Cow milk protein allergy | Lymphangiectasia |
| Intractable diarrheas of infancy | Immunodeficiency | Chronic pancreatitis |
| Age | Upper GI | Lower GI |
|---|---|---|
| Newborn | Swallowed maternal blood, gastritis | NEC, malrotation with volvulus, anal fissure, Hirschsprung |
| Infants | Esophagitis, peptic ulcer | Intussusception, Meckel's diverticulum, anal fissure |
| Children | Varices, peptic ulcer, Mallory-Weiss | Polyps, IBD, Meckel's, intussusception |
| Adolescents | Peptic ulcer, varices | IBD, hemorrhoids, polyps |
| Feature | Biliary Atresia | Neonatal Hepatitis |
|---|---|---|
| Onset | 2-6 weeks | First 2 weeks |
| Stool color | Persistently acholic | May be pigmented |
| Liver biopsy | Portal tract expansion, ductular proliferation, fibrosis | Giant cell formation, lobular necrosis |
| HIDA scan | No excretion into bowel | May show excretion |
| Treatment | Kasai portoenterostomy | Medical (UDCA) |
| Feature | Hep A | Hep B | Hep C | Hep E |
|---|---|---|---|---|
| Virus | RNA | DNA | RNA | RNA |
| Transmission | Feco-oral | Parenteral/vertical | Parenteral | Feco-oral |
| Chronic | No | Yes (5-10%) | Yes (70-80%) | No (except pregnancy) |
| Vaccine | Yes | Yes | No | Yes (in some countries) |
| Fulminant failure | Rare | More common | Rare | Common in pregnancy |
| Feature | Crohn's Disease | Ulcerative Colitis |
|---|---|---|
| Location | Any part of GI tract | Colon only (rectum always) |
| Distribution | Skip lesions | Continuous |
| Depth | Transmural | Mucosal/submucosal |
| Histology | Granulomas | Crypt abscesses, goblet cell depletion |
| Bleeding | Less common | Prominent |
| Fistulae | Common | Rare |
| Perianal disease | Common | Rare |
| Smoking | Worsens | Protective |
Generate a quick reference PDF comparing celiac disease, IBD, and toddler's diarrhea
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"
mkdir -p /home/daytona/workspace/gi-quickref && python3 -c "import reportlab; pr…
~/gi-quickref/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
SimpleDocTemplate, Table, TableStyle, Paragraph,
Spacer, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
OUTPUT = "/home/daytona/workspace/gi-quickref/Pediatric_GI_QuickRef.pdf"
# ── Colour palette ───────────────────────────────────────────────
DARK_BLUE = colors.HexColor("#1A3A5C")
MID_BLUE = colors.HexColor("#2E6DA4")
LIGHT_BLUE = colors.HexColor("#D6E8F7")
GREEN = colors.HexColor("#1D6A3A")
LIGHT_GREEN = colors.HexColor("#D4EDDA")
ORANGE = colors.HexColor("#B85C00")
LIGHT_ORANGE= colors.HexColor("#FDE8CC")
PURPLE = colors.HexColor("#5B2D8E")
LIGHT_PURPLE= colors.HexColor("#EAD9F7")
RED = colors.HexColor("#A02020")
LIGHT_RED = colors.HexColor("#FAD7D7")
YELLOW_BG = colors.HexColor("#FFFBE6")
GREY_BG = colors.HexColor("#F4F6F9")
GREY_BORDER = colors.HexColor("#CCCCCC")
WHITE = colors.white
BLACK = colors.HexColor("#1A1A1A")
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
topMargin=1.5*cm, bottomMargin=1.5*cm,
leftMargin=1.5*cm, rightMargin=1.5*cm,
title="Pediatric GI Quick Reference",
author="Ghai Essential Pediatrics"
)
styles = getSampleStyleSheet()
def style(name, **kw):
return ParagraphStyle(name, **kw)
S_TITLE = style("Title2", fontName="Helvetica-Bold", fontSize=20, textColor=WHITE,
alignment=TA_CENTER, leading=26)
S_SUBTITLE = style("Sub2", fontName="Helvetica", fontSize=11, textColor=LIGHT_BLUE,
alignment=TA_CENTER, leading=16)
S_SECTION = style("Sec", fontName="Helvetica-Bold", fontSize=13, textColor=WHITE,
alignment=TA_CENTER, leading=18)
S_HEAD = style("Head", fontName="Helvetica-Bold", fontSize=10, textColor=WHITE,
alignment=TA_CENTER, leading=14, wordWrap='CJK')
S_BODY = style("Body", fontName="Helvetica", fontSize=8.5, textColor=BLACK,
leading=13, alignment=TA_LEFT)
S_BODY_C = style("BodyC", fontName="Helvetica", fontSize=8.5, textColor=BLACK,
leading=13, alignment=TA_CENTER)
S_BOLD = style("Bold", fontName="Helvetica-Bold", fontSize=8.5, textColor=BLACK,
leading=13, alignment=TA_LEFT)
S_BOLD_C = style("BoldC", fontName="Helvetica-Bold", fontSize=8.5, textColor=BLACK,
leading=13, alignment=TA_CENTER)
S_SMALL = style("Small", fontName="Helvetica", fontSize=7.5, textColor=BLACK,
leading=11, alignment=TA_LEFT)
S_SMALL_C= style("SmallC", fontName="Helvetica", fontSize=7.5, textColor=BLACK,
leading=11, alignment=TA_CENTER)
S_NOTE = style("Note", fontName="Helvetica-Oblique", fontSize=7.5,
textColor=colors.HexColor("#555555"), leading=11, alignment=TA_CENTER)
S_LABEL = style("Label", fontName="Helvetica-Bold", fontSize=9, textColor=WHITE,
alignment=TA_CENTER, leading=13)
S_TAG = style("Tag", fontName="Helvetica-Bold", fontSize=7.5, textColor=WHITE,
alignment=TA_CENTER, leading=11)
def P(text, s=None):
return Paragraph(text, s or S_BODY)
def PC(text, s=None):
return Paragraph(text, s or S_BODY_C)
def bold(text):
return P(text, S_BOLD)
def boldC(text):
return PC(text, S_BOLD_C)
# ── Helper: section banner ───────────────────────────────────────
def section_banner(title, color=DARK_BLUE):
tbl = Table([[Paragraph(title, S_SECTION)]], colWidths=[17.7*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("ROUNDEDCORNERS", [6]),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
]))
return tbl
# ── TITLE BLOCK ──────────────────────────────────────────────────
def title_block():
tbl = Table([
[Paragraph("Pediatric Gastroenterology", S_TITLE)],
[Paragraph("Quick Reference Card", S_TITLE)],
[Spacer(1, 4)],
[Paragraph("Celiac Disease • Inflammatory Bowel Disease • Toddler's Diarrhea", S_SUBTITLE)],
[Paragraph("Based on Ghai Essential Pediatrics (10th Edition)", S_NOTE)],
], colWidths=[17.7*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING",(0,0),(-1,-1), 8),
("ROUNDEDCORNERS", [8]),
]))
return tbl
# ── COMPARISON TABLE ─────────────────────────────────────────────
def main_comparison():
W = 17.7*cm
# col widths: feature | celiac | IBD-CD | IBD-UC | toddler
cw = [3.2*cm, 3.6*cm, 3.6*cm, 3.6*cm, 3.7*cm]
# Header row
headers = [
boldC("Feature"),
Paragraph("🌾 Celiac Disease", S_LABEL),
Paragraph("🔥 Crohn's Disease", S_LABEL),
Paragraph("🩸 Ulcerative Colitis", S_LABEL),
Paragraph("🍼 Toddler's Diarrhea", S_LABEL),
]
rows = [headers]
data = [
("Other Name",
"Gluten-sensitive enteropathy",
"Regional enteritis",
"Idiopathic proctocolitis",
"Functional diarrhea of childhood / Chronic non-specific diarrhea"),
("Age of Onset",
"6 mo – 2 yr (after gluten intro); can present at any age",
"Teens most common; can be any age >5 yr",
"Teens; can be any age >5 yr",
"1 – 4 years (toddler age group)"),
("Etiology / Pathogenesis",
"Immune reaction to gliadin (wheat, rye, barley)\nHLA DQ2/DQ8 association",
"Unknown; dysregulated immune response to gut flora\nTransmural inflammation",
"Unknown; mucosal autoimmunity\nConcentrated in colon",
"Functional; excessive fruit juice, low fat diet, high fluid intake\nNormal gut motility"),
("Stool Character",
"Pale, bulky, frothy, offensive, floats (steatorrhoea)\nFrequency: 3–8/day",
"Loose, often bloody with mucus\nNocturnal diarrhea common",
"Bloody mucoid stools\nTenesmus common",
"Loose watery stools with undigested food\nNo blood, no nocturnal symptoms\nChild thrives normally"),
("Key Clinical Features",
"• Abdominal distension\n• Growth failure/FTT\n• Irritability, anorexia\n• Anemia (Fe/folate)\n• Wasted buttocks\n• Short stature",
"• Colicky abdominal pain (RIF)\n• Perianal disease\n• Fistulae, abscesses\n• Mouth ulcers\n• Weight loss / FTT\n• Skip lesions",
"• Bloody diarrhea\n• Rectal urgency\n• Diffuse colicky pain\n• Continuous mucosal disease\n• Rectum always involved",
"• Well child, normal growth\n• No failure to thrive\n• No fever, no blood in stool\n• Diarrhea worse with juice/high sugar\n• Resolves by age 4–5 yr"),
("Extra-intestinal\nManifestations",
"• Dermatitis herpetiformis\n• Short stature\n• Dental enamel defects\n• Osteoporosis\n• Peripheral neuropathy\n• Infertility",
"• Arthritis/arthralgia\n• Uveitis/iritis\n• Erythema nodosum\n• Pyoderma gangrenosum\n• Growth failure\n• Primary sclerosing cholangitis (rare)",
"• Arthritis\n• Uveitis\n• Erythema nodosum\n• Pyoderma gangrenosum\n• Primary sclerosing cholangitis (more common than CD)",
"None"),
("Distribution",
"Small bowel (duodenum/jejunum)\nDiffuse",
"Any part: mouth to anus\nSkip lesions",
"Colon only\nRectum → proximal; continuous",
"Entire gut (functional)\nNo structural lesion"),
("Histology /\nEndoscopy",
"• Villous atrophy\n• Crypt hyperplasia\n• ↑ Intraepithelial lymphocytes\n• Endoscopy: scalloped duodenal folds",
"• Transmural inflammation\n• Non-caseating granulomas\n• Cobblestone mucosa\n• Deep ulcers, fissures",
"• Mucosal/submucosal only\n• Crypt abscesses\n• Goblet cell depletion\n• Pseudopolyps\n• No granulomas",
"Normal (no structural pathology)"),
("Key Investigations",
"1. Anti-tTG IgA (screening)\n2. Total serum IgA (if deficient → IgG-based tests)\n3. Duodenal biopsy (gold standard)\n4. HLA DQ2/DQ8 typing",
"1. ↑ ESR, CRP, fecal calprotectin\n2. Colonoscopy + biopsy\n3. MR enterography\n4. ASCA (anti-Saccharomyces)\n5. ↑ Fecal lactoferrin",
"1. ↑ ESR, CRP\n2. Colonoscopy + biopsy (gold standard)\n3. p-ANCA positive in ~70%\n4. Fecal calprotectin ↑",
"1. Stool routine/culture – normal\n2. Stool reducing substances – absent\n3. Diagnosis of exclusion\n4. Dietary history key"),
("Serological\nMarkers",
"Anti-tTG IgA ✓\nAnti-endomysial antibody (EMA) ✓\nAnti-gliadin antibody (less specific)",
"ASCA (anti-Saccharomyces cerevisiae antibody) +ve\np-ANCA –ve",
"p-ANCA +ve (~70%)\nASCA –ve",
"None (normal serology)"),
("Anemia",
"Iron deficiency + folate/B12 deficiency\n(malabsorption)\nMicrocytic / megaloblastic",
"Iron deficiency (chronic inflammation, GI loss)\n+ Anemia of chronic disease",
"Iron deficiency (blood loss)\nAnemia of chronic disease",
"Not present"),
("High-Risk Groups\n(to Screen)",
"• Type 1 DM\n• Down syndrome\n• Turner/Williams syndrome\n• Autoimmune thyroid disease\n• IgA deficiency\n• First-degree relatives",
"N/A",
"N/A",
"N/A"),
("Differential\nDiagnosis",
"Giardiasis, cow milk protein allergy,\ntropical sprue, immunodeficiency",
"Intestinal TB, infective colitis,\nbehçet's, celiac",
"Infective colitis, allergic colitis,\nCrohn's colitis, polyps",
"Giardiasis, toddler's osmotic diarrhea,\nceliac disease"),
("Treatment",
"⭐ STRICT LIFELONG GLUTEN-FREE DIET\n• No wheat, rye, barley\n• Rice, maize, potato allowed\n• Supplement: Fe, folate, Ca, vitamin D",
"• 5-ASA (mild)\n• Steroids (moderate-severe)\n• Azathioprine/6-MP (maintenance)\n• Biologics: infliximab, adalimumab\n• Nutrition: exclusive enteral nutrition (first line in children for CD induction)\n• Surgery: strictureplasty, resection",
"• 5-ASA (mesalazine) – mainstay\n• Steroids (acute flare)\n• Azathioprine (steroid-sparing)\n• Biologics (infliximab) for severe\n• Surgery: colectomy (curative)",
"⭐ DIETARY MODIFICATION\n• Reduce fruit juice/squash intake\n• Balanced fat intake\n• Avoid excessive fluids\n• Reassurance – self-limiting\n• No medications needed"),
("Prognosis",
"Excellent on GFD\nRisk of lymphoma if non-compliant\nGrowth catch-up on diet",
"Chronic relapsing course\nMay need surgery\nGrowth may be impaired",
"Chronic relapsing course\nColectomy in refractory cases\nSlightly ↑ colorectal cancer risk (long-standing)",
"Excellent – self-resolves by age 4–5 yr\nNo long-term complications"),
("Key\nMnemonic",
"GFD = Gliadin-Free Diet\nHLA DQ2/DQ8 → Celiac",
"SKIP (Skip lesions, Kids mainly, IBD-Granuloma, Perianal)",
"RACE (Rectum always, Continuous, no granuloma, Endoscopy key)",
"THRIVES (Toddler, Healthy, Resolves, Juice ↓, Exclusion dx, No fever/blood, Self-limiting)"),
]
for feat, cel, cd, uc, tod in data:
rows.append([
P(feat, S_BOLD),
P(cel, S_SMALL),
P(cd, S_SMALL),
P(uc, S_SMALL),
P(tod, S_SMALL),
])
tbl = Table(rows, colWidths=cw, repeatRows=1)
ts = TableStyle([
# Header row styling
("BACKGROUND", (0,0), (0,0), DARK_BLUE),
("BACKGROUND", (1,0), (1,0), MID_BLUE),
("BACKGROUND", (2,0), (2,0), GREEN),
("BACKGROUND", (3,0), (3,0), RED),
("BACKGROUND", (4,0), (4,0), ORANGE),
("TEXTCOLOR", (0,0), (-1,0), WHITE),
("FONTNAME", (0,0), (-1,0), "Helvetica-Bold"),
("FONTSIZE", (0,0), (-1,0), 9),
("ALIGN", (0,0), (-1,0), "CENTER"),
("VALIGN", (0,0), (-1,0), "MIDDLE"),
("TOPPADDING", (0,0), (-1,0), 6),
("BOTTOMPADDING", (0,0), (-1,0), 6),
# Alternating row colors
("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, GREY_BG]),
# Feature column background
("BACKGROUND", (0,1), (0,-1), LIGHT_BLUE),
("FONTNAME", (0,1), (0,-1), "Helvetica-Bold"),
("FONTSIZE", (0,1), (0,-1), 8),
# Grid
("GRID", (0,0), (-1,-1), 0.5, GREY_BORDER),
("LINEBELOW", (0,0), (-1,0), 1.5, DARK_BLUE),
# Padding
("TOPPADDING", (0,1), (-1,-1), 5),
("BOTTOMPADDING", (0,1), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
# Vertical alignment
("VALIGN", (0,0), (-1,-1), "TOP"),
# Highlight treatment rows
("BACKGROUND", (1,14), (1,14), LIGHT_BLUE),
("BACKGROUND", (2,14), (2,14), LIGHT_GREEN),
("BACKGROUND", (3,14), (3,14), LIGHT_RED),
("BACKGROUND", (4,14), (4,14), LIGHT_ORANGE),
# Highlight mnemonic row
("BACKGROUND", (0,16), (-1,16), YELLOW_BG),
])
tbl.setStyle(ts)
return tbl
# ── DIAGNOSTIC CRITERIA BOX ─────────────────────────────────────
def diagnostic_criteria():
items = [
# Celiac - Marsh Classification
("Celiac: Marsh Classification", MID_BLUE, LIGHT_BLUE, [
("Marsh 0", "Normal mucosa"),
("Marsh 1", "↑ Intraepithelial lymphocytes (>25/100 enterocytes) only"),
("Marsh 2", "Marsh 1 + crypt hyperplasia"),
("Marsh 3a", "Partial villous atrophy"),
("Marsh 3b", "Subtotal villous atrophy"),
("Marsh 3c", "Total villous atrophy (classic celiac)"),
]),
# IBD - PCDAI
("IBD: Disease Activity Indices", GREEN, LIGHT_GREEN, [
("PCDAI", "Pediatric Crohn's Disease Activity Index (<10 = remission; >30 = severe)"),
("PUCAI", "Pediatric Ulcerative Colitis Activity Index (<10 = remission; ≥65 = severe)"),
("CRP + ESR", "Elevated in active IBD; correlate with disease activity"),
("Fecal calprotectin", ">200 µg/g = active intestinal inflammation (IBD > IBS)"),
("Endoscopy", "Required to confirm diagnosis and extent of disease"),
]),
# Toddler's Diarrhea criteria
("Toddler's Diarrhea: Rome IV Criteria", ORANGE, LIGHT_ORANGE, [
("Duration", "Loose/unformed stools ≥4 weeks"),
("Age", "Onset between 6 months and 5 years"),
("Timing", "Stools during waking hours only (no nocturnal diarrhea)"),
("Thriving", "Child grows and develops normally"),
("Exclusion", "No failure to thrive, blood, fever, or significant abdominal pain"),
]),
]
story_items = []
for title, color, bg, entries in items:
header = [[Paragraph(title, S_LABEL)]]
header_tbl = Table(header, colWidths=[17.7*cm])
header_tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), color),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
]))
story_items.append(header_tbl)
rows = []
for k, v in entries:
rows.append([P(k, S_BOLD), P(v, S_SMALL)])
inner = Table(rows, colWidths=[4.5*cm, 13.2*cm])
inner.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("GRID", (0,0), (-1,-1), 0.5, GREY_BORDER),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story_items.append(inner)
story_items.append(Spacer(1, 6))
return story_items
# ── QUICK COMPARISON HIGHLIGHT BOXES ────────────────────────────
def highlight_boxes():
boxes = [
("CELIAC DISEASE\n★ Key Points", MID_BLUE, LIGHT_BLUE, [
"Most common cause of chronic diarrhea in children >2 yr in North India",
"Gold standard diagnosis: Duodenal biopsy (Marsh 3c = total villous atrophy)",
"Best screening test: Anti-tTG IgA",
"Treatment: Strict LIFELONG gluten-free diet (no wheat, rye, barley)",
"Risk of T-cell lymphoma if non-compliant with GFD",
"Screen high-risk groups: T1DM, Down, Turner, thyroid disease",
]),
("IBD IN CHILDREN\n★ Key Points", GREEN, LIGHT_GREEN, [
"Crohn's: Transmural, any part of GI tract, skip lesions, granulomas",
"UC: Mucosal only, colon (rectum always), continuous, no granulomas",
"FIRST LINE induction in pediatric CD: Exclusive Enteral Nutrition (EEN)",
"Biological therapy: Infliximab (anti-TNF) for moderate-severe IBD",
"PSC (Primary Sclerosing Cholangitis): more associated with UC than CD",
"Perianal disease (fistulae, abscesses): Hallmark of Crohn's disease",
]),
("TODDLER'S DIARRHEA\n★ Key Points", ORANGE, LIGHT_ORANGE, [
"Age 1–4 years, THRIVING child — this is the most reassuring feature",
"No blood, no nocturnal symptoms, no fever, no failure to thrive",
"Caused by excess fruit juice, high carb diet, low fat intake",
"Treatment: Dietary advice only — reduce juice, balanced fat intake",
"Self-limiting: resolves by age 4–5 years",
"Diagnosis of exclusion — rule out giardia, celiac, cow milk allergy",
]),
]
cols = []
for title, color, bg, points in boxes:
rows = [[Paragraph(title.replace('\n', '<br/>'), S_LABEL)]]
for pt in points:
rows.append([P("• " + pt, S_SMALL)])
inner = Table(rows, colWidths=[5.5*cm])
inner.setStyle(TableStyle([
("BACKGROUND", (0,0), (0,0), color),
("BACKGROUND", (0,1), (-1,-1), bg),
("GRID", (0,0), (-1,-1), 0.5, GREY_BORDER),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("VALIGN", (0,0), (-1,-1), "TOP"),
("ALIGN", (0,0), (-1,0), "CENTER"),
]))
cols.append(inner)
outer = Table([cols], colWidths=[5.7*cm, 5.7*cm, 5.7*cm], hAlign='CENTER')
outer.setStyle(TableStyle([
("LEFTPADDING", (0,0), (-1,-1), 3),
("RIGHTPADDING", (0,0), (-1,-1), 3),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
return outer
# ── FOOTER ───────────────────────────────────────────────────────
def footer():
tbl = Table([[
Paragraph("Based on: Ghai Essential Pediatrics, 10th Edition | Chapter 12: Diseases of Gastrointestinal System & Liver", S_NOTE),
Paragraph("Quick Reference Card — For Educational Use Only", S_NOTE),
]], colWidths=[11*cm, 6.7*cm])
tbl.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), DARK_BLUE),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("TEXTCOLOR", (0,0), (-1,-1), LIGHT_BLUE),
("ALIGN", (1,0), (1,0), "RIGHT"),
]))
return tbl
# ── BUILD STORY ──────────────────────────────────────────────────
story = []
story.append(title_block())
story.append(Spacer(1, 8))
story.append(section_banner("COMPARATIVE TABLE: CELIAC DISEASE vs IBD vs TODDLER'S DIARRHEA"))
story.append(Spacer(1, 4))
story.append(main_comparison())
story.append(Spacer(1, 10))
story.append(section_banner("DIAGNOSTIC CRITERIA & DISEASE ACTIVITY INDICES", GREEN))
story.append(Spacer(1, 4))
story.extend(diagnostic_criteria())
story.append(Spacer(1, 8))
story.append(section_banner("CLINICAL PEARLS AT A GLANCE", PURPLE))
story.append(Spacer(1, 6))
story.append(highlight_boxes())
story.append(Spacer(1, 10))
story.append(footer())
doc.build(story)
print(f"PDF generated: {OUTPUT}")
python3 /home/daytona/workspace/gi-quickref/generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/gi-quickref/Pediatric_GI_QuickRef.pdf
Pediatric GI QuickRef
PDF Document · PDF