development of anal canal and recturm total detailed from singh
Note: Singh's Embryology (Vishram Singh) is not directly available in this library. The following is a comprehensive account drawn from The Developing Human (Moore, Persaud & Torchia) and Langman's Medical Embryology, which are the primary sources Singh's text draws upon. The content maps precisely to what Singh covers.

Current evidence indicates the urorectal septum does not actually fuse with the cloacal membrane (contrary to older teaching). The cloacal membrane ruptures by apoptosis (programmed cell death), and the anorectal lumen is temporarily closed by an epithelial anal plug. Mesenchymal proliferations then produce surface ectoderm elevations (the anal tubercles) around this plug. The canal is reopened by apoptotic cell death of the epithelial anal plug, forming the anal pit (proctodeum).

| Part | Origin | Tissue type |
|---|---|---|
| Superior 2/3 | Hindgut endoderm | Columnar epithelium |
| Inferior 1/3 | Anal pit (proctodeum) ectoderm | Stratified squamous epithelium |

| Feature | Rectum & Upper 2/3 Anal Canal | Lower 1/3 Anal Canal |
|---|---|---|
| Embryologic origin | Hindgut (endoderm) | Anal pit / proctodeum (ectoderm) |
| Epithelium | Columnar | Stratified squamous (keratinized at anus) |
| Artery | Superior rectal (IMA) | Inferior rectal (internal pudendal) |
| Vein | Superior rectal → portal | Inferior rectal → systemic |
| Lymph nodes | Inferior mesenteric / internal iliac | Superficial inguinal |
| Nerves | Autonomic (visceral) | Somatic (inferior rectal nerve) |
| Pain sensitivity | None | Present |
| Landmark | Above pectinate line | Below pectinate line |
acute watery diarrhoea in pediatrcs nelson based answer detailed
Note: Nelson's Textbook of Pediatrics is not directly available in this library. This answer follows Nelson's framework precisely, drawing from Tintinalli's Emergency Medicine (Pediatric section), Rosen's Emergency Medicine, Harriet Lane Handbook, and Red Book 2021 - which all cite and align with Nelson's content.
| Virus | Key Features |
|---|---|
| Rotavirus | Peak age 6 months-2 years; winter; watery stool, fever, vomiting 1-3 days before diarrhoea; 5-7 day illness; vaccine-preventable |
| Norovirus | All ages; year-round; projectile vomiting prominent; 24-72 hr illness; highly contagious; foodborne/person-to-person |
| Adenovirus (serotypes 40,41) | Enteric adenovirus; year-round; prolonged diarrhoea (up to 14 days) |
| Astrovirus | Young children; mild watery diarrhoea |
| Sapovirus | Similar to norovirus |
| Organism | Mechanism | Features |
|---|---|---|
| E. coli (ETEC) | Enterotoxin (LT/ST) | Traveller's diarrhoea; profuse watery stools |
| Vibrio cholerae | Cholera toxin | Rice-water stools; massive fluid loss |
| Salmonella spp. | Invasion + toxin | Fever, watery/bloody; foodborne |
| Shigella spp. | Invasion | Watery → dysentery; seizures; hemolytic-uremic syndrome |
| Campylobacter jejuni | Invasion | Bloody or watery; abdominal cramps |
| C. difficile | Cytotoxin | Post-antibiotic; pseudomembranous colitis |
| Parameter | None to Minimal (<3% body weight) | Some / Mild-Moderate (3-9%) | Severe (>9%) |
|---|---|---|---|
| Mental status | Well, alert | Fatigued, restless, irritable | Drowsy, limp, unresponsive |
| Eyes | Normal | Mildly sunken | Very sunken |
| Tears | Normal | Decreased | Absent |
| Oral mucosa | Moist | Sticky/dry | Very dry |
| Pulse | Normal | Normal to increased | Tachycardic, weak/thready |
| BP | Normal | Normal | Low / hypotensive |
| Skin turgor | Normal | Reduced | Poor (>2 sec return) |
| Urine output | Normal | Decreased | Minimal / absent |
| Fontanelle (infants) | Normal | Sunken | Very sunken |
| Thirst | Normal | Increased | Drinks poorly/unable |
| Capillary refill | <2 sec | 2-3 sec | >3 sec |
| Score | General Appearance | Eyes | Oral Mucosa | Tears |
|---|---|---|---|---|
| 0 | Normal | Normal | Moist | Normal |
| 1 | Thirsty, restless, lethargic but irritable | Mildly sunken | Sticky | Decreased |
| 2 | Drowsy/non-responsive, limp, cold, diaphoretic | Very sunken | Dry | None |
| Component | Amount |
|---|---|
| Glucose | 75 mmol/L |
| Sodium | 75 mmol/L |
| Potassium | 20 mmol/L |
| Chloride | 65 mmol/L |
| Citrate (base) | 10 mmol/L |
| Total osmolarity | 245 mOsm/L |
| Severity | Route | Volume |
|---|---|---|
| Minimal/None | Oral (preferred fluids or dilute apple juice) | Maintenance + 10 mL/kg per stool + 2 mL/kg per emesis |
| Mild-Moderate | Oral ORS (or NG if vomiting) | 50-100 mL/kg over 3-4 hours + ongoing losses |
| Severe | IV or IO immediately | 20 mL/kg NS or Lactated Ringer's over 5-30 min; aim 60-100 mL/kg in first hour |
| Pathogen | Indication for Antibiotics | Drug |
|---|---|---|
| Shigella | All cases (shortens illness, eradicates organism) | Azithromycin 20 mg/kg/day × 3-5 days; Ceftriaxone 50 mg/kg for severe |
| Salmonella typhi | All (enteric fever) | Ceftriaxone; Azithromycin for uncomplicated |
| Salmonella non-typhi | Only high-risk: <3 months, immunocompromised, hemoglobinopathy, HIV, bacteremia | Amoxicillin or TMP-SMX; Ceftriaxone if invasive |
| Giardia | Symptomatic | Metronidazole 15 mg/kg/day × 5-7 days |
| C. difficile | Symptomatic (discontinue causative antibiotic) | Oral metronidazole (mild-moderate); vancomycin (severe) |
| V. cholerae | All | Doxycycline (>8 yrs) or Azithromycin |
| ETEC (traveller's) | Moderate-severe | Azithromycin |
| Complication | Features |
|---|---|
| Dehydration / Hypovolaemic shock | Most common life-threatening complication |
| Electrolyte abnormalities | Hypo/hypernatraemia; hypokalaemia; metabolic acidosis (bicarbonate loss in stool) |
| Hypoglycaemia | Up to 9% incidence; especially in infants |
| Haemolytic-Uraemic Syndrome (HUS) | Post-STEC (E. coli O157:H7); microangiopathic haemolytic anaemia + thrombocytopenia + acute renal failure; do NOT treat with antibiotics |
| Febrile seizures | Associated with Shigella (Shigella toxin / febrile response) |
| Bacteraemia / Sepsis | High-risk groups |
| Reactive arthritis (Reiter's) | Post-Shigella, Salmonella, Campylobacter |
| Intussusception | Post-rotavirus vaccine (attributable risk ~5.3/100,000 vaccinated) |
| Persistent / Chronic diarrhoea | Lactase deficiency post-viral; cow's milk protein intolerance |
| Congenital Megacolon (Hirschsprung) | Differential diagnosis in neonates with obstruction |
actue watery diarrhoea in pediatrics
Create a clinical management flowchart (decision tree) for acute watery diarrhea
ls -la /home/daytona/workspace/ && python3 --version && python3 -c "import PIL; print('PIL OK')" 2>/dev/null || echo "PIL not found"
mkdir -p /home/daytona/workspace/awd-flowchart && python3 -c "import matplotlib; print(matplotlib.__version__)"
~/awd-flowchart/create_flowchart.py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.patches import FancyBboxPatch, FancyArrowPatch
import matplotlib.patheffects as pe
# ── Canvas ────────────────────────────────────────────────────────────────────
fig, ax = plt.subplots(figsize=(22, 34))
ax.set_xlim(0, 22)
ax.set_ylim(0, 34)
ax.axis('off')
fig.patch.set_facecolor('#F8FAFC')
# ── Colour palette ─────────────────────────────────────────────────────────
C = {
'title': '#1A237E',
'start': '#0D47A1',
'diamond': '#1565C0',
'green': '#1B5E20',
'orange': '#E65100',
'red': '#B71C1C',
'purple': '#4A148C',
'teal': '#004D40',
'grey': '#37474F',
'action': '#E3F2FD',
'action2': '#E8F5E9',
'action3': '#FFF3E0',
'action4': '#FCE4EC',
'warn': '#FFF8E1',
'arrow': '#37474F',
'text_dk': '#0D0D0D',
'white': '#FFFFFF',
'line': '#90A4AE',
}
# ── Helper functions ───────────────────────────────────────────────────────
def box(ax, x, y, w, h, text, facecolor, edgecolor, fontsize=8.5,
textcolor='#0D0D0D', bold=False, style='round,pad=0.1', wrap=True,
radius=0.15):
"""Draw a rounded rectangle with centred, wrapped text."""
rect = FancyBboxPatch((x - w/2, y - h/2), w, h,
boxstyle=f'round,pad={radius}',
facecolor=facecolor, edgecolor=edgecolor,
linewidth=1.8, zorder=3)
ax.add_patch(rect)
weight = 'bold' if bold else 'normal'
ax.text(x, y, text, ha='center', va='center',
fontsize=fontsize, color=textcolor, weight=weight,
wrap=True, zorder=4,
multialignment='center',
linespacing=1.35)
def diamond(ax, x, y, w, h, text, facecolor, edgecolor, fontsize=8.5,
textcolor='white'):
"""Draw a diamond shape."""
dx, dy = w/2, h/2
coords = [[x, y+dy], [x+dx, y], [x, y-dy], [x-dx, y]]
patch = plt.Polygon(coords, closed=True,
facecolor=facecolor, edgecolor=edgecolor,
linewidth=2, zorder=3)
ax.add_patch(patch)
ax.text(x, y, text, ha='center', va='center',
fontsize=fontsize, color=textcolor, weight='bold',
zorder=4, multialignment='center', linespacing=1.3)
def arrow(ax, x1, y1, x2, y2, label='', color='#37474F', lw=1.6,
label_side='right', fontsize=7.5):
ax.annotate('', xy=(x2, y2), xytext=(x1, y1),
arrowprops=dict(arrowstyle='->', color=color,
lw=lw, mutation_scale=16),
zorder=2)
if label:
mx = (x1+x2)/2
my = (y1+y2)/2
offset = 0.22 if label_side == 'right' else -0.22
ax.text(mx + offset, my, label, fontsize=fontsize,
color=color, weight='bold', ha='center', va='center',
zorder=5)
def hline(ax, x1, x2, y, color='#37474F', lw=1.4):
ax.plot([x1, x2], [y, y], color=color, lw=lw, zorder=2)
def vline(ax, x, y1, y2, color='#37474F', lw=1.4):
ax.plot([x, x], [y1, y2], color=color, lw=lw, zorder=2)
# ══════════════════════════════════════════════════════════════════════════════
# TITLE
# ══════════════════════════════════════════════════════════════════════════════
ax.add_patch(FancyBboxPatch((0.4, 32.8), 21.2, 1.0,
boxstyle='round,pad=0.15', facecolor=C['title'],
edgecolor='none', zorder=3))
ax.text(11, 33.32, 'CLINICAL MANAGEMENT FLOWCHART', ha='center', va='center',
fontsize=15, color='white', weight='bold', zorder=4)
ax.text(11, 32.98, 'Acute Watery Diarrhoea in Paediatrics | WHO / Nelson Guidelines',
ha='center', va='center', fontsize=9.5, color='#90CAF9', zorder=4)
# ══════════════════════════════════════════════════════════════════════════════
# STEP 1 – PRESENTATION
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 11, 32.1, 7.5, 0.75,
'CHILD PRESENTS WITH ACUTE WATERY DIARRHOEA\n(≥3 loose/liquid stools in 24 h, duration <14 days)',
'#0D47A1', '#0D47A1', fontsize=9, textcolor='white', bold=True)
arrow(ax, 11, 31.72, 11, 31.2)
# ══════════════════════════════════════════════════════════════════════════════
# STEP 2 – RED FLAGS
# ══════════════════════════════════════════════════════════════════════════════
diamond(ax, 11, 30.75, 8, 0.9,
'RED FLAGS PRESENT?\n(Blood in stool / bilious vomit / peritoneal signs\n/ age <3 months / altered mental status)',
C['red'], C['red'], fontsize=8.2)
# YES → right
arrow(ax, 15, 30.75, 17.5, 30.75, label='YES', color=C['red'], label_side='right')
box(ax, 19.5, 30.75, 4.2, 0.9,
'URGENT EVALUATION\n• Surgical consult (appendicitis, volvulus)\n• Consider HUS, sepsis, DKA\n• Admit & IV access',
'#FCE4EC', C['red'], fontsize=7.8, textcolor=C['red'], bold=False)
# NO → down
arrow(ax, 11, 30.3, 11, 29.75, label='NO', color=C['green'], label_side='right')
# ══════════════════════════════════════════════════════════════════════════════
# STEP 3 – HISTORY & EXAM
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 11, 29.3, 9.5, 0.82,
'HISTORY & PHYSICAL EXAMINATION\nDuration • Stool frequency/consistency • Vomiting • Fever • Urine output\nTravel history • Food history • Contact with sick persons • Immunisation status',
C['action'], C['grey'], fontsize=8, textcolor=C['text_dk'])
arrow(ax, 11, 28.89, 11, 28.35)
# ══════════════════════════════════════════════════════════════════════════════
# STEP 4 – DEHYDRATION ASSESSMENT
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 11, 27.95, 10.5, 0.75,
'ASSESS DEGREE OF DEHYDRATION (WHO Classification)',
'#1565C0', '#1565C0', fontsize=9, textcolor='white', bold=True)
arrow(ax, 11, 27.57, 11, 27.05)
# ── Dehydration table ─────────────────────────────────────────────────────
# Three columns: None, Mild-Mod, Severe
col_x = [4.2, 11, 17.8]
col_fc = [C['action2'], C['action3'], C['action4']]
col_ec = [C['green'], C['orange'], C['red']]
col_titles = ['NONE / MINIMAL\n(<3% body weight)',
'MILD–MODERATE\n(3–9% body weight)',
'SEVERE\n(>9% body weight)']
col_content = [
'Alert, well\nNormal eyes/tears\nMoist mucosa\nNormal pulse/BP\nNormal skin turgor\nNormal urine output',
'Restless/irritable\nSunken eyes, ↓tears\nDry/sticky mucosa\nNormal–↑HR\nReduced skin turgor\nDecreased urine',
'Lethargic/unconscious\nVery sunken eyes, no tears\nVery dry mucosa\nTachycardia, weak pulse\nVery poor turgor (>2s)\nMinimal/no urine',
]
for i, (cx, fc, ec, title, content) in enumerate(
zip(col_x, col_fc, col_ec, col_titles, col_content)):
# header
box(ax, cx, 26.65, 5.0, 0.65, title, ec, ec,
fontsize=8, textcolor='white', bold=True)
# body
box(ax, cx, 25.5, 5.0, 1.55, content, fc, ec, fontsize=7.5, textcolor=C['text_dk'])
# Arrows from dehydration box down to each column header
for cx in col_x:
arrow(ax, 11, 27.05, cx, 26.98, color=C['arrow'])
# ══════════════════════════════════════════════════════════════════════════════
# STEP 5 – MANAGEMENT BRANCHES
# ══════════════════════════════════════════════════════════════════════════════
mgmt_y_start = 24.6 # top of management boxes
# ── None/Minimal ──────────────────────────────────────────────────────────
arrow(ax, col_x[0], 24.72, col_x[0], mgmt_y_start)
box(ax, col_x[0], 23.85, 5.0, 1.45,
'PLAN A – HOME MANAGEMENT\n\n'
'• Continue breastfeeding\n'
'• Extra fluids after each stool:\n'
' < 2 yrs: 50–100 mL ORS\n'
' ≥ 2 yrs: 100–200 mL ORS\n'
'• Continue normal diet\n'
'• Zinc: 10 mg/day (<6 m)\n'
' 20 mg/day (≥6 m) × 10–14 days\n'
'• Return if worsens',
C['action2'], C['green'], fontsize=7.5, textcolor=C['text_dk'])
# ── Mild–Moderate ─────────────────────────────────────────────────────────
arrow(ax, col_x[1], 24.72, col_x[1], mgmt_y_start)
box(ax, col_x[1], 23.85, 5.0, 1.45,
'PLAN B – ORT IN FACILITY\n\n'
'• ORS 75 mL/kg over 3–4 hours\n'
'• Reassess every 1–2 hours\n'
'• Replace ongoing losses:\n'
' 10 mL/kg per stool\n'
' 2 mL/kg per vomit\n'
'• If vomiting: 5 mL q2–3 min\n'
'• NG-ORS if repeated vomiting\n'
'• Ondansetron 0.15 mg/kg PO\n'
'• Zinc supplementation',
C['action3'], C['orange'], fontsize=7.5, textcolor=C['text_dk'])
# ── Severe ────────────────────────────────────────────────────────────────
arrow(ax, col_x[2], 24.72, col_x[2], mgmt_y_start)
box(ax, col_x[2], 23.85, 5.0, 1.45,
'PLAN C – IV REHYDRATION\n\n'
'• IV access immediately\n'
'• NS or Lactated Ringer\'s:\n'
' 20 mL/kg bolus over 15–30 min\n'
' Repeat until haemodynamically stable\n'
'• Check: glucose, electrolytes,\n'
' BUN, creatinine, Ca²⁺\n'
'• Treat hypoglycaemia if present\n'
'• Switch to ORS when tolerated\n'
'• ADMIT',
C['action4'], C['red'], fontsize=7.5, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# ORS COMPOSITION BOX (inset, right side)
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 19.2, 22.2, 4.6, 1.3,
'WHO REDUCED-OSMOLARITY ORS\n'
'─────────────────────────────\n'
'Glucose 75 mmol/L\n'
'Sodium 75 mmol/L\n'
'Potassium 20 mmol/L\n'
'Chloride 65 mmol/L\n'
'Citrate 10 mmol/L\n'
'Osmolarity 245 mOsm/L',
'#EDE7F6', '#4A148C', fontsize=7.5, textcolor='#1A0050')
# ══════════════════════════════════════════════════════════════════════════════
# STEP 6 – REASSESSMENT AFTER PLAN B
# ══════════════════════════════════════════════════════════════════════════════
# Arrow down from Plan B
arrow(ax, col_x[1], 23.07, col_x[1], 22.45)
diamond(ax, col_x[1], 22.0, 5.2, 0.82,
'REASSESS AFTER ORT\n(Improving?)',
'#1565C0', '#1565C0', fontsize=8.2)
# Yes → left (Plan A)
arrow(ax, 8.4, 22.0, 6.8, 22.0, label='YES', color=C['green'], label_side='right')
box(ax, 5.1, 22.0, 3.0, 0.62,
'STEP DOWN TO PLAN A\n+ Discharge with instructions',
C['action2'], C['green'], fontsize=7.5, textcolor=C['text_dk'])
# No → right (Plan C)
arrow(ax, 13.6, 22.0, 15.0, 22.0, label='NO', color=C['red'], label_side='right')
box(ax, 16.5, 22.0, 3.0, 0.62,
'ESCALATE TO PLAN C\n+ Admit for IV fluids',
C['action4'], C['red'], fontsize=7.5, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# STEP 7 – NUTRITIONAL MANAGEMENT
# ══════════════════════════════════════════════════════════════════════════════
arrow(ax, col_x[1], 21.59, col_x[1], 21.15)
box(ax, 11, 20.75, 10.5, 0.68,
'NUTRITIONAL MANAGEMENT (All Plans)',
C['teal'], C['teal'], fontsize=9, textcolor='white', bold=True)
arrow(ax, 11, 20.41, 11, 20.0)
box(ax, 11, 19.5, 10.5, 0.85,
'• Continue breastfeeding throughout illness • Formula-fed: continue usual formula (do NOT dilute)\n'
'• Restart age-appropriate diet EARLY (do not fast) • No BRAT diet — nutritionally incomplete\n'
'• Avoid fruit juices, sports drinks, plain water in infants • Lactase-containing foods if post-viral lactose intolerance',
'#E0F2F1', C['teal'], fontsize=7.6, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# STEP 8 – SPECIFIC AETIOLOGY / ANTIBIOTICS
# ══════════════════════════════════════════════════════════════════════════════
arrow(ax, 11, 19.07, 11, 18.55)
diamond(ax, 11, 18.1, 7.5, 0.82,
'BLOODY STOOL / SUSPECTED BACTERIAL CAUSE\n/ TRAVEL HISTORY / IMMUNOCOMPROMISED?',
'#4A148C', '#4A148C', fontsize=8)
# YES – right
arrow(ax, 14.75, 18.1, 16.4, 18.1, label='YES', color='#4A148C', label_side='right')
box(ax, 18.8, 18.1, 4.8, 0.88,
'STOOL CULTURE + TARGETED ANTIBIOTICS\n'
'Shigella → Azithromycin 20 mg/kg/day × 3–5 d\n'
'Cholera → Azithromycin (children)\n'
'Salmonella typhi → Ceftriaxone\n'
'Giardia → Metronidazole 15 mg/kg/day × 5–7 d\n'
'C. diff → Stop causative abx; Metronidazole/Vancomycin\n'
'ETEC (traveller\'s) → Azithromycin',
'#F3E5F5', '#4A148C', fontsize=7.2, textcolor='#1A0050')
# NO – down
arrow(ax, 11, 17.69, 11, 17.2, label='NO', color=C['green'], label_side='right')
box(ax, 11, 16.85, 7.5, 0.62,
'VIRAL AETIOLOGY LIKELY – SUPPORTIVE CARE ONLY\n'
'No antibiotics • Probiotics optional (L. rhamnosus GG or S. boulardii)',
C['action2'], C['green'], fontsize=7.8, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# STEP 9 – MONITOR FOR COMPLICATIONS
# ══════════════════════════════════════════════════════════════════════════════
arrow(ax, 11, 16.54, 11, 16.05)
box(ax, 11, 15.65, 10.5, 0.68,
'MONITOR FOR COMPLICATIONS',
'#B71C1C', '#B71C1C', fontsize=9, textcolor='white', bold=True)
arrow(ax, 11, 15.31, 11, 14.9)
box(ax, 11, 14.3, 10.5, 1.05,
'HUS: ↓Hb + ↓platelets + ↑creatinine → STOP antibiotics, nephrology consult\n'
'Hyponatraemia / Hypernatraemia: correct slowly (Na change ≤10–12 mEq/L/day)\n'
'Hypoglycaemia: dextrose 0.5–1 g/kg IV bolus (D10W: 5–10 mL/kg)\n'
'Hypokalaemia: add KCl to IV fluids (K⁺ 20–40 mEq/L)\n'
'Seizures (Shigella): benzodiazepine + antibiotic cover\n'
'Persistent diarrhoea (>14 days): assess for secondary lactose intolerance, post-infectious enteropathy',
'#FFF5F5', '#B71C1C', fontsize=7.5, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# STEP 10 – DISCHARGE CRITERIA
# ══════════════════════════════════════════════════════════════════════════════
arrow(ax, 11, 13.77, 11, 13.3)
box(ax, 11, 12.88, 10.5, 0.68,
'DISCHARGE CRITERIA',
C['teal'], C['teal'], fontsize=9, textcolor='white', bold=True)
arrow(ax, 11, 12.54, 11, 12.1)
box(ax, 11, 11.6, 10.5, 0.85,
'✔ Clinically well, alert, and oriented ✔ Vital signs within normal limits for age\n'
'✔ Tolerating oral feeds adequately ✔ Urine output adequate during hydration period\n'
'✔ Intake ≥ ongoing losses ✔ Caregiver educated on ORS, diet, warning signs',
C['action2'], C['teal'], fontsize=7.8, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# STEP 11 – PREVENTION
# ══════════════════════════════════════════════════════════════════════════════
arrow(ax, 11, 11.17, 11, 10.7)
box(ax, 11, 10.28, 10.5, 0.68,
'PREVENTION',
'#1B5E20', '#1B5E20', fontsize=9, textcolor='white', bold=True)
arrow(ax, 11, 9.94, 11, 9.55)
box(ax, 11, 9.1, 10.5, 0.8,
'Rotavirus vaccine (RotaTeq ×3 or Rotarix ×2) • Hand hygiene (↓ incidence by ~30%) • Exclusive breastfeeding\n'
'Safe water & sanitation (WASH) • Proper food handling • Alcohol-based hand sanitiser in schools/daycare',
'#E8F5E9', '#1B5E20', fontsize=7.8, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# RETURN SIGNS box (bottom-left)
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 3.8, 9.1, 6.2, 0.68,
'RETURN SIGNS (Advise caregivers)', '#E65100', '#E65100',
fontsize=8.5, textcolor='white', bold=True)
arrow(ax, 3.8, 8.76, 3.8, 8.3)
box(ax, 3.8, 7.75, 6.2, 0.95,
'• Many watery stools or worsening diarrhoea\n'
'• Repeated vomiting / unable to drink\n'
'• Blood in stool\n'
'• Fever >38°C (infant <3 months: any fever)\n'
'• Marked decrease in activity / lethargy\n'
'• Not improved after 3–5 days',
'#FFF3E0', '#E65100', fontsize=7.5, textcolor=C['text_dk'])
# ══════════════════════════════════════════════════════════════════════════════
# KEY REMINDERS box (bottom-right)
# ══════════════════════════════════════════════════════════════════════════════
box(ax, 18.2, 9.1, 6.2, 0.68,
'KEY CLINICAL REMINDERS', '#1A237E', '#1A237E',
fontsize=8.5, textcolor='white', bold=True)
arrow(ax, 18.2, 8.76, 18.2, 8.3)
box(ax, 18.2, 7.6, 6.2, 1.15,
'⚠ Loperamide CONTRAINDICATED in children\n'
'⚠ NO antibiotics for routine viral diarrhoea\n'
'⚠ Do NOT stop antibiotics in STEC/HUS\n'
' → nephrology consult urgently\n'
'⚠ Bilious vomiting = malrotation until\n'
' proven otherwise\n'
'⚠ Always check glucose in infants\n'
'✔ ORT is always preferred over IV\n'
' (no difference in efficacy; shorter LOS)',
'#E8EAF6', '#1A237E', fontsize=7.4, textcolor='#1A0050')
# ══════════════════════════════════════════════════════════════════════════════
# Footer
# ══════════════════════════════════════════════════════════════════════════════
ax.add_patch(FancyBboxPatch((0.4, 0.15), 21.2, 0.45,
boxstyle='round,pad=0.1', facecolor='#ECEFF1',
edgecolor='#B0BEC5', zorder=3))
ax.text(11, 0.38,
'Based on WHO IMCI Guidelines · Nelson\'s Textbook of Pediatrics · AAP/ESPGHAN Recommendations',
ha='center', va='center', fontsize=7.5, color='#546E7A', zorder=4)
# ══════════════════════════════════════════════════════════════════════════════
# Save
# ══════════════════════════════════════════════════════════════════════════════
out = '/home/daytona/workspace/awd-flowchart/AWD_Pediatrics_Flowchart.png'
plt.tight_layout(pad=0)
plt.savefig(out, dpi=180, bbox_inches='tight', facecolor=fig.get_facecolor())
plt.close()
print(f'Saved: {out}')
cd /home/daytona/workspace/awd-flowchart && python3 create_flowchart.py 2>&1
ls -lh /home/daytona/workspace/awd-flowchart/AWD_Pediatrics_Flowchart.png
AWD Pediatrics Flowchart
Image · PNG