Gastroenterology pediatrics important questions from ghai textbook

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Searching the Web

Ghai Essential Pediatrics gastroenterology important exam questions topics

Finding Sources
Reading Web Page

https://jasu.kg/wp-content/uploads/2024/04/Ghai-Essential-Pe…

Reading File
Searching the Web

Ghai Essential Pediatrics chapter 12 gastrointestinal system liver topics list diarrhea jaundice hepatitis

Reading Web Page

https://dokumen.pub/ghai-essential-pediatrics-10e-tenth-edit…

I now have comprehensive data to compile a thorough answer. Let me synthesize everything from Ghai's chapter structure, the 10th edition competency list, and the extracted content.

Pediatric Gastroenterology - Important Questions from Ghai Essential Pediatrics

Based on Chapter 11/12: "Diseases of Gastrointestinal System and Liver" - Ghai Essential Pediatrics (8th/9th/10th editions)

CHAPTER STRUCTURE (Ghai GI Chapter)

Ghai Chapter 12 (10th ed) covers:
  • Vomiting, Dysphagia, Constipation, Abdominal pain
  • Acute diarrhea, Persistent diarrhea, Chronic diarrhea
  • GI bleeding
  • Hepatobiliary disorders: Jaundice, Liver failure, Chronic liver disease, Ascites, Portal hypertension
  • Autoimmune liver disease, Hepatitis B & C, Metabolic liver disease
  • Neonatal cholestasis, Liver transplantation

TOPIC 1: ACUTE DIARRHEA & DEHYDRATION ⭐⭐⭐ (Most High-Yield)

Important Questions:
Q1. Discuss the physiological basis of ORT and composition of ORS.
  • WHO-ORS (reduced osmolarity): Na 75 mEq/L, K 20 mEq/L, Cl 65 mEq/L, citrate 10 mEq/L, glucose 75 mmol/L, osmolarity 245 mOsm/L
  • Based on sodium-glucose co-transport in enterocytes - glucose drives Na absorption even during active secretory diarrhea
  • Reduced osmolarity ORS preferred over standard ORS - less stool output, less vomiting
Q2. Classify dehydration. How do you assess and manage?
Degree% Weight LossSigns
No dehydration<5%Normal
Some dehydration5-10%Restlessness, sunken eyes, reduced skin turgor, thirsty
Severe dehydration>10%Lethargy/unconscious, very sunken eyes, skin goes back very slowly, unable to drink
  • Plan A (no dehydration): ORS at home, zinc, continue feeding
  • Plan B (some dehydration): ORS 75 mL/kg over 4 hours in health facility
  • Plan C (severe dehydration): IV Ringer's lactate 100 mL/kg (Hartmann's); infants: 30 mL/kg in 1 hr then 70 mL/kg in 5 hrs
Q3. Role of zinc in acute diarrhea.
  • 20 mg elemental zinc/day for 14 days (10 mg/day for infants <6 months)
  • Reduces severity, duration of diarrhea, and risk of persistent diarrhea
  • Reduces subsequent incidence of diarrhea for 2-3 months
Q4. When to use antibiotics in acute diarrhea?
  • Cholera (tetracycline/azithromycin), dysentery (ciprofloxacin/azithromycin), Giardia (metronidazole)
  • NOT routinely for watery diarrhea
  • Antiemetic: single dose ondansetron 0.15 mg/kg if vomiting interferes with ORT

TOPIC 2: PERSISTENT & CHRONIC DIARRHEA ⭐⭐

Q5. Define and differentiate acute, persistent, and chronic diarrhea.
  • Acute: <14 days
  • Persistent: 14-30 days (WHO definition)
  • Chronic: >4 weeks (most common use in clinical practice)
Q6. Causes of chronic diarrhea by age (Ghai Table):
Age <6 monthsAge 6 months - 5 yearsAge >5 years
Cow milk protein allergyCeliac diseaseCeliac disease
Short bowel syndromeGiardiasisIBD
ImmunodeficiencyToddler's diarrheaGI tuberculosis
Anatomical defectsCow milk protein allergyLymphangiectasia
Intractable diarrheas of infancyImmunodeficiencyChronic pancreatitis

TOPIC 3: CELIAC DISEASE ⭐⭐⭐

Q7. Discuss etiopathogenesis, clinical features, diagnosis and management of celiac disease.
  • Permanent sensitivity to gluten (wheat, rye, barley) in genetically susceptible individuals (HLA DQ2/DQ8)
  • Most common cause of chronic diarrhea in children >2 years in North India
  • Classical: small bowel diarrhea, growth failure, abdominal distension, anemia, irritability
High-risk groups to screen:
  • Type 1 diabetes mellitus
  • Down syndrome
  • Selective IgA deficiency
  • Autoimmune thyroid disease
  • Turner syndrome, Williams syndrome
  • First-degree relatives of celiac patients
Diagnosis:
  • Anti-tissue transglutaminase (anti-tTG) IgA antibody - screening test of choice
  • Check total serum IgA (false negative if IgA deficient)
  • Duodenal biopsy: villous atrophy, crypt hyperplasia, increased intraepithelial lymphocytes (gold standard)
  • Endoscopy: scalloping of duodenal folds
Treatment: Strict lifelong gluten-free diet

TOPIC 4: GASTROINTESTINAL BLEEDING ⭐⭐

Q8. Causes of GI bleeding by age (Upper vs Lower):
AgeUpper GILower GI
NewbornSwallowed maternal blood, gastritisNEC, malrotation with volvulus, anal fissure, Hirschsprung
InfantsEsophagitis, peptic ulcerIntussusception, Meckel's diverticulum, anal fissure
ChildrenVarices, peptic ulcer, Mallory-WeissPolyps, IBD, Meckel's, intussusception
AdolescentsPeptic ulcer, varicesIBD, hemorrhoids, polyps
Q9. Red currant jelly stools - classic feature of intussusception (blood + mucoid exudate + stool)
Q10. Approach to GI bleeding:
  • Apt test - differentiates fetal from maternal hemoglobin (in newborn hematemesis)
  • Meckel scan (Tc-99m pertechnetate) - for Meckel's diverticulum

TOPIC 5: VOMITING & CONSTIPATION ⭐

Q11. Red flag features indicating serious illness in a child with abdominal pain (Ghai Table):
  • Pain localized away from umbilicus (RUQ/RLQ)
  • Nocturnal pain
  • Failure to thrive / weight loss
  • Bilious vomiting
  • GI blood loss
  • Chronic diarrhea
  • Persistent fever, jaundice
  • Arthritis / rash
  • Family history of IBD
  • Localized tenderness or abdominal mass
  • Perianal fistulae

TOPIC 6: JAUNDICE IN CHILDREN ⭐⭐⭐

Q12. Classify jaundice with causes:
Unconjugated hyperbilirubinemia:
  • Hemolysis (G6PD, hereditary spherocytosis, ABO/Rh incompatibility)
  • Gilbert syndrome, Crigler-Najjar syndrome
  • Physiological jaundice of newborn
Conjugated hyperbilirubinemia:
  • Neonatal cholestasis, biliary atresia, choledochal cyst
  • Infections: sepsis, viral hepatitis, enteric fever, malaria, leptospirosis
  • Chronic liver disease
  • Liver tumors (hepatoblastoma)
  • Metabolic: Wilson disease, galactosemia, tyrosinemia
  • Enzyme defects: Dubin-Johnson, Rotor syndrome
  • Drug toxicity

TOPIC 7: NEONATAL CHOLESTASIS ⭐⭐⭐

Q13. Differentiate biliary atresia from neonatal hepatitis:
FeatureBiliary AtresiaNeonatal Hepatitis
Onset2-6 weeksFirst 2 weeks
Stool colorPersistently acholicMay be pigmented
Liver biopsyPortal tract expansion, ductular proliferation, fibrosisGiant cell formation, lobular necrosis
HIDA scanNo excretion into bowelMay show excretion
TreatmentKasai portoenterostomyMedical (UDCA)
Q14. HIDA scan:
  • Negative predictive value 100% - if excretion present, biliary atresia ruled out
  • Prime with UDCA or phenobarbitone for 3 days before scan to improve diagnostic efficacy
Q15. Kasai portoenterostomy:
  • Procedure of choice for biliary atresia
  • Must be done before 8 weeks of age for best outcomes
  • Bile flow established in ~80% if done early; 30-40% if after 90 days

TOPIC 8: ACUTE VIRAL HEPATITIS ⭐⭐⭐

Q16. Compare Hepatitis A, B, C, D, E:
FeatureHep AHep BHep CHep E
VirusRNADNARNARNA
TransmissionFeco-oralParenteral/verticalParenteralFeco-oral
ChronicNoYes (5-10%)Yes (70-80%)No (except pregnancy)
VaccineYesYesNoYes (in some countries)
Fulminant failureRareMore commonRareCommon in pregnancy
Q17. Diagnosis of hepatitis B:
  • HBsAg - surface antigen (marker of infection)
  • Anti-HBs - protective antibody (post-vaccination/recovery)
  • HBeAg - active viral replication
  • HBV DNA - viral load
  • Window period: HBsAg negative, anti-HBs negative, anti-HBc IgM positive

TOPIC 9: LIVER FAILURE ⭐⭐⭐

Q18. Define and discuss acute liver failure (fulminant hepatic failure):
  • Severe acute liver injury with coagulopathy (INR >1.5 with encephalopathy, or INR >2 without encephalopathy) in absence of known chronic liver disease
  • Features: jaundice, coagulopathy, encephalopathy, hypoglycemia, ascites
Management (4 H's approach):
  • Hypoglycemia: 10% dextrose infusion
  • Hemorrhage: FFP, vitamin K
  • Hepatic encephalopathy: lactulose, rifaximin, restrict protein
  • Hyperammonemia: sodium benzoate, zinc supplementation
Criteria for liver transplantation (King's College Criteria):

TOPIC 10: CHRONIC LIVER DISEASE & PORTAL HYPERTENSION ⭐⭐

Q19. Clinical features of chronic liver disease in children: External markers: jaundice, palmar erythema, spider nevi, gynecomastia, caput medusae, clubbing, leuconychia, parotid enlargement, Dupuytren's contracture, failure to thrive, vitamin A/D deficiency signs
Q20. Portal hypertension - causes and complications:
  • Pre-hepatic: portal vein thrombosis (most common in India)
  • Hepatic: cirrhosis, schistosomiasis
  • Post-hepatic: Budd-Chiari syndrome
Complications: esophageal varices, hypersplenism, ascites, hepatorenal syndrome, hepatopulmonary syndrome
Management of variceal bleed: IV octreotide/terlipressin, endoscopic band ligation/sclerotherapy, balloon tamponade (Sengstaken-Blakemore tube), TIPS, surgical shunts

TOPIC 11: INFLAMMATORY BOWEL DISEASE ⭐⭐

Q21. Differentiate Crohn's disease from Ulcerative Colitis:
FeatureCrohn's DiseaseUlcerative Colitis
LocationAny part of GI tractColon only (rectum always)
DistributionSkip lesionsContinuous
DepthTransmuralMucosal/submucosal
HistologyGranulomasCrypt abscesses, goblet cell depletion
BleedingLess commonProminent
FistulaeCommonRare
Perianal diseaseCommonRare
SmokingWorsensProtective
Extraintestinal manifestations: Aphthous ulcers, uveitis/iritis, arthritis, erythema nodosum, pyoderma gangrenosum, primary sclerosing cholangitis (UC > CD), growth failure

TOPIC 12: METABOLIC LIVER DISEASES ⭐⭐

Q22. Wilson disease:
  • Autosomal recessive - ATP7B gene on chromosome 13
  • Copper accumulation in liver, brain, cornea
  • Age: usually >3 years (rare <5 years)
  • Features: chronic hepatitis/cirrhosis, neuropsychiatric symptoms, Kayser-Fleischer rings (greenish-brown ring at corneal periphery)
  • Diagnosis: low serum ceruloplasmin (<20 mg/dL), high 24-hr urinary copper (>100 mcg/day), liver copper >250 mcg/g dry weight
  • Treatment: D-penicillamine (first line), trientine (second line), zinc (maintenance)

TOPIC 13: INTUSSUSCEPTION ⭐⭐

Q23. Discuss intussusception in children:
  • Most common in 3 months to 2 years
  • Ileocolic most common type
  • Classical triad: colicky abdominal pain + vomiting + red currant jelly stools
  • Examination: sausage-shaped mass in right hypochondrium, Dance sign (emptiness in RIF)
  • Diagnosis: USG - target/doughnut sign; X-ray - crescent sign
  • Treatment: Air/hydrostatic reduction (non-surgical, 1st line) if no peritonitis; surgical reduction if failed or peritonitis

EXAM-FOCUSED MNEMONICS FROM GHAI

Chronic Diarrhea RED FLAGS (GHAI):
  • Nocturnal pain, Bloody stools, Organomegaly, Weight loss/FTT, Family history IBD, Perianal disease
Causes of Hepatosplenomegaly in children: Infections, hemolytic anemias, portal hypertension, storage disorders (Gaucher, Niemann-Pick), malignancies
HIDA scan preparation: "Pheno/UDCA for 3 days = better HIDA"

FREQUENTLY ASKED LONG QUESTIONS (Ghai)

  1. Discuss acute diarrhea - etiology, assessment, management (ORS, zinc, antibiotics)
  2. Classify dehydration and management - Plan A, B, C
  3. Celiac disease - pathogenesis, clinical features, diagnosis, treatment
  4. Neonatal cholestasis - causes, approach to diagnosis, biliary atresia vs neonatal hepatitis
  5. Acute liver failure in children - definition, causes, management
  6. Portal hypertension - causes, clinical features, management of variceal bleed
  7. Viral hepatitis - comparison, chronic hepatitis B management
  8. Wilson disease - clinical features, diagnosis, treatment
  9. Intussusception - clinical features, diagnosis, management
  10. IBD in children - Crohn's vs UC, extraintestinal manifestations

Short Questions

  • ORS composition and reduced osmolarity ORS
  • Apt test (distinguishes fetal/maternal Hb)
  • Meckel's diverticulum features
  • HIDA scan in neonatal cholestasis
  • Kasai operation
  • Rotavirus - features and vaccine
  • Toddler's diarrhea
  • Lactose intolerance
  • Hirschsprung disease
  • Pseudomembranous colitis (C. difficile)

Sources: Ghai Essential Pediatrics 8th, 9th & 10th editions, Chapter 11/12 (Diseases of Gastrointestinal System and Liver); supplemented by Harriet Lane Handbook 23rd ed for GI bleeding tables

Generate a quick reference PDF comparing celiac disease, IBD, and toddler's diarrhea

Reading File
Running Command

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

Running Command

mkdir -p /home/daytona/workspace/gi-quickref && python3 -c "import reportlab; pr…

Writing File

~/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}")
Running Command

python3 /home/daytona/workspace/gi-quickref/generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/gi-quickref/Pediatric_GI_QuickRef.pdf

Your quick reference PDF is ready:

Pediatric GI QuickRef

PDF Document · PDF


Here's what's packed into the PDF:
Section 1 - Master Comparison Table (16 rows × 5 columns) Covers: Celiac Disease | Crohn's Disease | Ulcerative Colitis | Toddler's Diarrhea - comparing:
  • Other names, age of onset, etiology/pathogenesis
  • Stool character, key clinical features
  • Extra-intestinal manifestations, distribution, histology/endoscopy
  • Key investigations, serological markers, anemia
  • Differential diagnosis, treatment, prognosis
  • Memory mnemonics for each condition
Section 2 - Diagnostic Criteria
  • Celiac: Marsh Classification (0 → 3c) with descriptions
  • IBD: PCDAI and PUCAI activity indices, fecal calprotectin thresholds
  • Toddler's Diarrhea: Rome IV criteria
Section 3 - Clinical Pearls at a Glance Three colour-coded boxes with high-yield exam bullet points per condition:
  • Celiac: anti-tTG, GFD, lymphoma risk, who to screen
  • IBD: EEN for pediatric Crohn's, infliximab, PSC association, perianal disease
  • Toddler's: "thriving child" as key feature, dietary management, self-limiting course
This is a shared conversation. Sign in to Orris to start your own chat.