Tomorrow is my psm viva. And I don't know nothing about ADD . And external will ask from this slide. Help me to remember all this point in easy language
cd /home/daytona/workspace/attachments/1b0203a1-9def-440a-ac6b-e70df4b1ac98/ && python -m markitdown "Acute diarrhoeal diseases.pptx" 2>/dev/null
cd /home/daytona/workspace/attachments/1b0203a1-9def-440a-ac6b-e70df4b1ac98/ && python3 -c " from pptx import Presentation prs = Presentation('Acute diarrhoeal diseases.pptx') for i, slide in enumerate(prs.slides): print(f'=== SLIDE {i+1} ===') for shape in slide.shapes: if hasattr(shape, 'text') and shape.text.strip(): print(shape.text) print() "
pip install python-pptx --quiet --user 2>&1 | tail -3
cd /home/daytona/workspace/attachments/1b0203a1-9def-440a-ac6b-e70df4b1ac98/ && python3 -c " from pptx import Presentation prs = Presentation('Acute diarrhoeal diseases.pptx') for i, slide in enumerate(prs.slides): print(f'=== SLIDE {i+1} ===') for shape in slide.shapes: if hasattr(shape, 'text') and shape.text.strip(): print(shape.text) print() "
cd /home/daytona/workspace/attachments/1b0203a1-9def-440a-ac6b-e70df4b1ac98/ && python3 -c " from pptx import Presentation from pptx.util import Pt import re prs = Presentation('Acute diarrhoeal diseases.pptx') for i, slide in enumerate(prs.slides): print(f'=== SLIDE {i+1} ===') for shape in slide.shapes: if hasattr(shape, 'text_frame'): for para in shape.text_frame.paragraphs: text = para.text.strip() if text: print(text) print() " 2>&1
cd /home/daytona/workspace/attachments/1b0203a1-9def-440a-ac6b-e70df4b1ac98/ && python3 -c " from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE_TYPE import os prs = Presentation('Acute diarrhoeal diseases.pptx') os.makedirs('/home/daytona/workspace/add_slides', exist_ok=True) for i, slide in enumerate(prs.slides): for j, shape in enumerate(slide.shapes): if shape.shape_type == MSO_SHAPE_TYPE.PICTURE: img = shape.image ext = img.ext fname = f'/home/daytona/workspace/add_slides/slide{i+1}_img{j}.{ext}' with open(fname, 'wb') as f: f.write(img.blob) print(f'Saved: {fname}') "
# Convert tiff to png for analysis for f in /home/daytona/workspace/add_slides/*.tiff; do base="${f%.tiff}" convert "$f" "${base}.png" 2>/dev/null && echo "Converted: ${base}.png" done
python3 -c " from PIL import Image import os for f in os.listdir('/home/daytona/workspace/add_slides/'): if f.endswith('.tiff'): path = f'/home/daytona/workspace/add_slides/{f}' out = path.replace('.tiff', '.png') try: img = Image.open(path) img.save(out) print(f'Converted: {out}') except Exception as e: print(f'Failed {f}: {e}') "
cd /home/daytona/workspace/attachments/1b0203a1-9def-440a-ac6b-e70df4b1ac98/ && python3 -c " from pptx import Presentation from pptx.util import Pt prs = Presentation('Acute diarrhoeal diseases.pptx') for i, slide in enumerate(prs.slides): has_content = False content = [] for shape in slide.shapes: # Tables if shape.has_table: has_content = True content.append('[TABLE]') for row in shape.table.rows: row_text = ' | '.join(cell.text.strip() for cell in row.cells) if row_text.strip('| '): content.append(row_text) # Text frames elif hasattr(shape, 'text_frame'): for para in shape.text_frame.paragraphs: text = para.text.strip() if text and text not in [str(i+1), '.']: content.append(text) has_content = True if has_content or content: print(f'=== SLIDE {i+1} ===') for c in content: print(c) print() " 2>&1 | head -400
| Type | Duration | Key Point |
|---|---|---|
| Acute watery diarrhoea | <4 weeks | Watery loose stool |
| Acute bloody diarrhoea (Dysentery) | <4 weeks | Blood/mucus in stool |
| Persistent diarrhoea | >14 days | Between acute & chronic |
| Chronic diarrhoea | >4 weeks | Long-standing |
| Diarrhoea with malnutrition | - | Marasmus/Kwashiorkor |
Viva tip: MCC (Most Common Cause) of dysentery = Shigella
Viva tip: Rotavirus = MCC in children | Shigella = MCC of dysentery
| Feature | No Dehydration | Some Dehydration | Severe Dehydration |
|---|---|---|---|
| General | Well, alert | Restless, irritable | Lethargic/unconscious |
| Eyes | Normal | Sunken | Very sunken & dry |
| Tears | Present | Absent | Absent |
| Mouth/tongue | Moist | Dry | Very dry |
| Thirst | Normal, not thirsty | Thirsty, drinks eagerly | Drinks poorly/can't drink |
| Skin pinch | Goes back quickly | Goes back slowly (<2 sec) | Goes back very slowly (>2 sec) |
| Decision rule | No signs | ≥2 signs = Some | ≥2 signs = Severe |
| Treatment | Plan A | Plan B | Plan C (urgently!) |
Viva tip for the case scenario: 8-month-old with sunken eyes + skin pinch >2 sec + drowsy = SEVERE DEHYDRATION → Plan C
20 kg = 20 ml/kg/day
| Age | Dose | Duration |
|---|---|---|
| <6 months | 10 mg/day | 10-14 days |
| >6 months | 20 mg/day | 10-14 days |
Why zinc? It reduces duration and severity of diarrhoea AND prevents future episodes.
| Organism | Drug |
|---|---|
| Vibrio cholerae | Doxycycline / Tetracycline / Erythromycin / TMP-SMX |
| Shigella | Ciprofloxacin |
Note: Antibiotics are NOT given routinely for all diarrhoea - only for specific causative organisms!
| Topic | Key Number/Fact |
|---|---|
| Deaths per year in under-5 | 525,000 |
| Global cases per year | 1.7 billion |
| Deaths in first 2 years | 80% |
| Nepal 2017 under-5 deaths | 1193 |
| Main cause of death from diarrhoea | Dehydration |
| MCC diarrhoea in children | Rotavirus |
| MCC of dysentery | Shigella |
| Drug for Shigella | Ciprofloxacin |
| Drug for Cholera | Doxycycline |
| Zinc <6 months | 10 mg/day × 10-14 days |
| Zinc >6 months | 20 mg/day × 10-14 days |
| ORS Plan B deficit | 75 ml/kg in 4 hours |
| Plan C bolus IVF | 100 ml/kg RL/NS |
| Severe dehydration skin pinch | >2 seconds |
| Homemade ORS | 1L water + 6 tsp sugar + ½ tsp salt |
Quick reference pdf of add
mkdir -p /home/daytona/workspace/add-pdf && ls /home/daytona/workspace/add-pdf/
~/add-pdf/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_RIGHT
from reportlab.platypus import PageBreak
OUTPUT = "/home/daytona/workspace/add-pdf/ADD_Quick_Reference.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
rightMargin=1.5*cm,
leftMargin=1.5*cm,
topMargin=1.8*cm,
bottomMargin=1.5*cm,
)
# ─── Color palette ───────────────────────────────────────────────────────────
NAVY = colors.HexColor("#1a3a5c")
TEAL = colors.HexColor("#0e7c7b")
AMBER = colors.HexColor("#f4a011")
RED = colors.HexColor("#c0392b")
GREEN = colors.HexColor("#1e8449")
LBLUE = colors.HexColor("#d6eaf8")
LYELLOW = colors.HexColor("#fef9e7")
LGREEN = colors.HexColor("#eafaf1")
LPINK = colors.HexColor("#fdf2f8")
LRED = colors.HexColor("#fdedec")
WHITE = colors.white
LGRAY = colors.HexColor("#f5f6fa")
GRAY = colors.HexColor("#7f8c8d")
DGRAY = colors.HexColor("#2c3e50")
# ─── Styles ──────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
title_style = S("Title2",
fontSize=20, fontName="Helvetica-Bold",
textColor=WHITE, alignment=TA_CENTER, spaceAfter=2)
subtitle_style = S("Sub2",
fontSize=9, fontName="Helvetica",
textColor=colors.HexColor("#cce8ff"), alignment=TA_CENTER, spaceAfter=0)
section_style = S("Section",
fontSize=10.5, fontName="Helvetica-Bold",
textColor=WHITE, alignment=TA_LEFT, spaceAfter=0,
spaceBefore=0, leftIndent=6)
body_style = S("Body2",
fontSize=8.5, fontName="Helvetica",
textColor=DGRAY, leading=13, spaceAfter=1)
bold_body = S("BoldBody",
fontSize=8.5, fontName="Helvetica-Bold",
textColor=DGRAY, leading=13)
small_style = S("Small",
fontSize=7.5, fontName="Helvetica",
textColor=DGRAY, leading=11)
small_bold = S("SmallBold",
fontSize=7.5, fontName="Helvetica-Bold",
textColor=DGRAY, leading=11)
tip_style = S("Tip",
fontSize=8, fontName="Helvetica-BoldOblique",
textColor=RED, leading=11, leftIndent=4)
cell_style = S("Cell",
fontSize=8, fontName="Helvetica",
textColor=DGRAY, leading=11)
cell_bold = S("CellBold",
fontSize=8, fontName="Helvetica-Bold",
textColor=DGRAY, leading=11)
hdr_cell = S("HdrCell",
fontSize=8, fontName="Helvetica-Bold",
textColor=WHITE, leading=11, alignment=TA_CENTER)
# ─── Helpers ─────────────────────────────────────────────────────────────────
def section_header(text, bg=NAVY):
data = [[Paragraph(text, section_style)]]
t = Table(data, colWidths=[17.7*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("ROUNDEDCORNERS", [4]),
]))
return t
def tip_box(text):
data = [[Paragraph(f"⚑ {text}", tip_style)]]
t = Table(data, colWidths=[17.7*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), LRED),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING", (0,0), (-1,-1), 8),
("LINEBELOW", (0,0), (-1,-1), 0.5, RED),
]))
return t
def info_box(text, bg=LBLUE):
data = [[Paragraph(text, body_style)]]
t = Table(data, colWidths=[17.7*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 10),
("RIGHTPADDING", (0,0), (-1,-1), 10),
]))
return t
def sp(h=4):
return Spacer(1, h)
# ─── Build story ─────────────────────────────────────────────────────────────
story = []
# ═══════════════ TITLE BANNER ════════════════════════════════════════════════
title_data = [
[Paragraph("ACUTE DIARRHOEAL DISEASES (ADD)", title_style)],
[Paragraph("PSM Viva Quick Reference • Dr. Narendra Kumar Yadav", subtitle_style)],
]
title_table = Table(title_data, colWidths=[17.7*cm])
title_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (0,0), 10),
("BOTTOMPADDING", (0,-1),(-1,-1),10),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
]))
story.append(title_table)
story.append(sp(8))
# ═══════════════ TWO-COLUMN LAYOUT: top section ══════════════════════════════
# Left col: Definition + Classification | Right col: Epidemiology numbers
# --- DEFINITION ---
def_block = [
section_header("1. DEFINITION", NAVY),
sp(3),
info_box("<b>Diarrhoea</b> = Change in <b>consistency</b> (watery/loose stool) <b>AND frequency</b> (>3 times/day)", LBLUE),
sp(3),
]
# --- CLASSIFICATION ---
def_block.append(section_header("2. CLINICAL TYPES", TEAL))
def_block.append(sp(3))
class_data = [
[Paragraph("Type", hdr_cell), Paragraph("Duration", hdr_cell), Paragraph("Key Point", hdr_cell)],
[Paragraph("Acute watery diarrhoea", cell_bold), Paragraph("< 4 weeks", cell_style), Paragraph("Watery loose stool", cell_style)],
[Paragraph("Acute bloody (Dysentery)", cell_bold), Paragraph("< 4 weeks", cell_style), Paragraph("Blood/mucus in stool", cell_style)],
[Paragraph("Persistent diarrhoea", cell_bold), Paragraph("> 14 days", cell_style), Paragraph("Between acute & chronic", cell_style)],
[Paragraph("Chronic diarrhoea", cell_bold), Paragraph("> 4 weeks", cell_style), Paragraph("Long-standing", cell_style)],
[Paragraph("With malnutrition", cell_bold), Paragraph("-", cell_style), Paragraph("Marasmus / Kwashiorkor", cell_style)],
]
class_table = Table(class_data, colWidths=[5.5*cm, 3*cm, 5.5*cm], spaceBefore=0)
class_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("BACKGROUND", (0,1), (-1,1), LGREEN),
("BACKGROUND", (0,2), (-1,2), WHITE),
("BACKGROUND", (0,3), (-1,3), LGREEN),
("BACKGROUND", (0,4), (-1,4), WHITE),
("BACKGROUND", (0,5), (-1,5), LGREEN),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
def_block.append(class_table)
def_block.append(sp(3))
def_block.append(tip_box("MCC of Dysentery = Shigella | MCC of Diarrhoea in children = Rotavirus"))
# ═══════════════ EPIDEMIOLOGY ════════════════════════════════════════════════
story.append(KeepTogether(def_block))
story.append(sp(6))
story.append(section_header("3. EPIDEMIOLOGY (WHO)", NAVY))
story.append(sp(3))
epi_data = [
[Paragraph("Indicator", hdr_cell), Paragraph("Figure", hdr_cell)],
[Paragraph("Rank among causes of under-5 deaths", cell_style), Paragraph("<b>2nd leading cause</b>", cell_bold)],
[Paragraph("Global childhood diarrhoea cases/year", cell_style), Paragraph("<b>1.7 billion</b>", cell_bold)],
[Paragraph("Under-5 deaths per year", cell_style), Paragraph("<b>525,000</b>", cell_bold)],
[Paragraph("Deaths in first 2 years of life", cell_style), Paragraph("<b>80%</b>", cell_bold)],
[Paragraph("Main cause of death from diarrhoea", cell_style), Paragraph("<b>Dehydration</b>", cell_bold)],
[Paragraph("Nepal under-5 deaths (2017)", cell_style), Paragraph("<b>1,193 children</b>", cell_bold)],
]
epi_table = Table(epi_data, colWidths=[10*cm, 7.7*cm])
epi_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("BACKGROUND", (0,1), (-1,1), LYELLOW),
("BACKGROUND", (0,2), (-1,2), WHITE),
("BACKGROUND", (0,3), (-1,3), LYELLOW),
("BACKGROUND", (0,4), (-1,4), WHITE),
("BACKGROUND", (0,5), (-1,5), LYELLOW),
("BACKGROUND", (0,6), (-1,6), WHITE),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("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), "MIDDLE"),
]))
story.append(epi_table)
story.append(sp(6))
# ═══════════════ EPIDEMIOLOGICAL DETERMINANTS ════════════════════════════════
story.append(section_header("4. EPIDEMIOLOGICAL DETERMINANTS (Agent - Host - Environment)", TEAL))
story.append(sp(3))
det_data = [
[Paragraph("AGENT", hdr_cell), Paragraph("HOST", hdr_cell), Paragraph("ENVIRONMENT", hdr_cell)],
[
Paragraph("<b>Bacterial:</b> E. coli, Shigella, V. cholerae, Salmonella<br/><br/>"
"<b>Viral:</b> Rotavirus (MCC in children), Adenovirus, Calcivirus<br/><br/>"
"<b>Parasitic:</b> Giardia lamblia", cell_style),
Paragraph("<b>Age:</b> 6 months – 2 years (most at risk)<br/><br/>"
"<b>Malnutrition</b> → weaker immunity<br/><br/>"
"<b>No exclusive breastfeeding</b> in first 6 months<br/><br/>"
"<b>Zinc/Vit A deficiency, HIV,</b> no rotavirus vaccine", cell_style),
Paragraph("<b>Bacterial diarrhoea:</b> warm/rainy season<br/><br/>"
"<b>Viral diarrhoea:</b> winter season<br/><br/>"
"Poor sanitation, unsafe water, contaminated food<br/><br/>"
"Crowded living, refugee camps, disasters", cell_style),
],
]
det_table = Table(det_data, colWidths=[5.9*cm, 5.9*cm, 5.9*cm])
det_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), TEAL),
("BACKGROUND", (0,1), (0,1), LGREEN),
("BACKGROUND", (1,1), (1,1), LYELLOW),
("BACKGROUND", (2,1), (2,1), LRED),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(det_table)
story.append(sp(6))
# ═══════════════ RISK FACTORS + TRANSMISSION (side by side) ══════════════════
rf_block = [
section_header("5. RISK FACTORS", NAVY),
sp(3),
Paragraph("• Children 6 months – 2 years", body_style),
Paragraph("• Poor sanitation & personal hygiene", body_style),
Paragraph("• No safe drinking water", body_style),
Paragraph("• Unsafe food preparation", body_style),
Paragraph("• Low breastfeeding / immunization rates", body_style),
Paragraph("• Immunodeficiency", body_style),
Paragraph("• Malnutrition", body_style),
Paragraph("• Crowded living conditions", body_style),
Paragraph("• Poverty", body_style),
]
tx_block = [
section_header("6. MODE OF TRANSMISSION", TEAL),
sp(3),
info_box("<b>Primary route = Faecal-Oral Route</b>", LBLUE),
sp(4),
Paragraph("<b>a. Water-borne</b> – contaminated water supply", body_style),
Paragraph("<b>b. Food-borne</b> – contaminated/undercooked food", body_style),
Paragraph("<b>c. Direct transmission</b> – person to person, hand to mouth", body_style),
sp(4),
tip_box("Remember: F-O-R → Faecal → Oral via Water / Food / Direct"),
]
left_col = [[item] for item in rf_block]
right_col = [[item] for item in tx_block]
# Render as two-column table
combined = Table(
[[rf_block, tx_block]],
colWidths=[8.6*cm, 9.1*cm],
spaceBefore=0
)
combined.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING",(0,0), (-1,-1), 0),
("INNERGRID", (0,0), (-1,-1), 0, WHITE),
]))
story.append(combined)
story.append(sp(6))
# ═══════════════ DEHYDRATION ASSESSMENT TABLE ═════════════════════════════════
story.append(section_header("7. ASSESSMENT OF DEHYDRATION", RED))
story.append(sp(3))
deh_data = [
[Paragraph("Feature", hdr_cell), Paragraph("No Dehydration", hdr_cell),
Paragraph("Some Dehydration", hdr_cell), Paragraph("Severe Dehydration", hdr_cell)],
[Paragraph("General condition", cell_bold), Paragraph("Well, alert", cell_style),
Paragraph("Restless, irritable", cell_style), Paragraph("Lethargic / unconscious", cell_style)],
[Paragraph("Eyes", cell_bold), Paragraph("Normal", cell_style),
Paragraph("Sunken", cell_style), Paragraph("Very sunken & dry", cell_style)],
[Paragraph("Tears", cell_bold), Paragraph("Present", cell_style),
Paragraph("Absent", cell_style), Paragraph("Absent", cell_style)],
[Paragraph("Mouth / tongue", cell_bold), Paragraph("Moist", cell_style),
Paragraph("Dry", cell_style), Paragraph("Very dry", cell_style)],
[Paragraph("Thirst", cell_bold), Paragraph("Normal, not thirsty", cell_style),
Paragraph("Thirsty, drinks eagerly", cell_style), Paragraph("Drinks poorly / can't drink", cell_style)],
[Paragraph("Skin pinch", cell_bold), Paragraph("Goes back quickly", cell_style),
Paragraph("Slowly (<2 sec)", cell_style), Paragraph("Very slowly (>2 sec)", cell_style)],
[Paragraph("Decision", cell_bold), Paragraph("No dehydration", cell_style),
Paragraph("≥2 signs = SOME", cell_bold), Paragraph("≥2 signs = SEVERE", cell_bold)],
[Paragraph("TREATMENT", cell_bold),
Paragraph("PLAN A", ParagraphStyle("PlanA", fontSize=8, fontName="Helvetica-Bold", textColor=GREEN, leading=11)),
Paragraph("PLAN B", ParagraphStyle("PlanB", fontSize=8, fontName="Helvetica-Bold", textColor=colors.HexColor("#e67e22"), leading=11)),
Paragraph("PLAN C (URGENT)", ParagraphStyle("PlanC", fontSize=8, fontName="Helvetica-Bold", textColor=RED, leading=11))],
]
deh_table = Table(deh_data, colWidths=[3.5*cm, 4.3*cm, 4.5*cm, 5.4*cm])
deh_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), RED),
("BACKGROUND", (1,1), (1,-1), LGREEN),
("BACKGROUND", (2,1), (2,-1), LYELLOW),
("BACKGROUND", (3,1), (3,-1), LRED),
("BACKGROUND", (0,1), (0,-1), LGRAY),
("BACKGROUND", (0,-1), (-1,-1), colors.HexColor("#e8f8f5")),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
story.append(deh_table)
story.append(sp(3))
story.append(tip_box("Case: 8-month-old — drowsy + sunken eyes + skin pinch >2 sec = SEVERE DEHYDRATION → PLAN C"))
story.append(sp(8))
# ═══════════════ TREATMENT PLANS ══════════════════════════════════════════════
story.append(section_header("8. TREATMENT PLANS", GREEN))
story.append(sp(3))
plan_a = [
Paragraph("<b>PLAN A — No Dehydration (Home)</b>", ParagraphStyle("PA", fontSize=9, fontName="Helvetica-Bold", textColor=GREEN, leading=13)),
sp(2),
Paragraph("• WHO ORS after every loose stool:", body_style),
Paragraph(" – <2 years: <b>50–100 ml</b>/loose stool", body_style),
Paragraph(" – 2–10 years: <b>100–200 ml</b>/loose stool", body_style),
Paragraph("• Zinc supplementation", body_style),
Paragraph("• Teach mother danger signs", body_style),
]
plan_b = [
Paragraph("<b>PLAN B — Some Dehydration (Hospital)</b>", ParagraphStyle("PB", fontSize=9, fontName="Helvetica-Bold", textColor=colors.HexColor("#e67e22"), leading=13)),
sp(2),
Paragraph("1. IV fluids (RL/NS):", body_style),
Paragraph(" <10 kg = <b>100 ml/kg/day</b>", body_style),
Paragraph(" 10–20 kg = <b>50 ml/kg/day</b>", body_style),
Paragraph(" >20 kg = <b>20 ml/kg/day</b>", body_style),
Paragraph("2. WHO ORS: <b>75 ml/kg</b> in first 4 hours", body_style),
Paragraph("3. Zinc supplementation", body_style),
Paragraph("4. Maintenance ORS (Plan A)", body_style),
]
plan_c = [
Paragraph("<b>PLAN C — Severe Dehydration (EMERGENCY)</b>", ParagraphStyle("PC", fontSize=9, fontName="Helvetica-Bold", textColor=RED, leading=13)),
sp(2),
Paragraph("1. IV Bolus: <b>100 ml/kg</b> RL/NS (±5% dextrose)", body_style),
Paragraph("2. WHO ORS if child can drink orally", body_style),
Paragraph("3. Zinc supplementation", body_style),
Paragraph("4. Reassess every <b>2–3 hrs</b>", body_style),
Paragraph(" If improved → Plan B → Plan A", body_style),
]
plans_table = Table(
[[plan_a, plan_b, plan_c]],
colWidths=[5.5*cm, 6*cm, 6.2*cm]
)
plans_table.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 6),
("RIGHTPADDING", (0,0), (-1,-1), 6),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("BACKGROUND", (0,0), (0,0), LGREEN),
("BACKGROUND", (1,0), (1,0), LYELLOW),
("BACKGROUND", (2,0), (2,0), LRED),
("BOX", (0,0), (0,0), 0.8, GREEN),
("BOX", (1,0), (1,0), 0.8, colors.HexColor("#e67e22")),
("BOX", (2,0), (2,0), 0.8, RED),
]))
story.append(plans_table)
story.append(sp(6))
# ═══════════════ ORS + ZINC + CHEMOTHERAPY ═══════════════════════════════════
ors_block = [
section_header("9. ORS COMPOSITION (WHO)", TEAL),
sp(3),
info_box("<b>WHO Low-Osmolarity ORS</b> (per litre):<br/>"
"Sodium chloride: <b>2.6 g</b> | Glucose anhydrous: <b>13.5 g</b><br/>"
"Trisodium citrate: <b>2.9 g</b> | Potassium chloride: <b>1.5 g</b><br/>"
"Osmolarity: <b>~245 mOsmol/L</b>", LBLUE),
sp(4),
section_header("HOMEMADE ORS", colors.HexColor("#5d6d7e")),
sp(3),
info_box("1 litre clean water + <b>6 level tsp sugar</b> + <b>½ tsp salt</b><br/>"
"Tastes like tears (not too salty, not too sweet)<br/>"
"Use within <b>24 hours</b>", LGRAY),
]
zinc_chemo_block = [
section_header("10. ZINC SUPPLEMENTATION", AMBER),
sp(3),
]
zinc_data = [
[Paragraph("Age", hdr_cell), Paragraph("Dose", hdr_cell), Paragraph("Duration", hdr_cell)],
[Paragraph("< 6 months", cell_style), Paragraph("<b>10 mg/day</b>", cell_bold), Paragraph("10–14 days", cell_style)],
[Paragraph("> 6 months", cell_style), Paragraph("<b>20 mg/day</b>", cell_bold), Paragraph("10–14 days", cell_style)],
]
zinc_table = Table(zinc_data, colWidths=[2.8*cm, 3*cm, 2.8*cm])
zinc_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), AMBER),
("BACKGROUND", (0,1), (-1,1), LYELLOW),
("BACKGROUND", (0,2), (-1,2), WHITE),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
zinc_chemo_block.append(zinc_table)
zinc_chemo_block.append(sp(5))
zinc_chemo_block.append(section_header("11. CHEMOTHERAPY", RED))
zinc_chemo_block.append(sp(3))
chemo_data = [
[Paragraph("Organism", hdr_cell), Paragraph("Drug of Choice", hdr_cell)],
[Paragraph("Vibrio cholerae", cell_bold), Paragraph("Doxycycline / Tetracycline / Erythromycin / TMP-SMX", cell_style)],
[Paragraph("Shigella", cell_bold), Paragraph("Ciprofloxacin", cell_style)],
]
chemo_table = Table(chemo_data, colWidths=[3.5*cm, 5.1*cm])
chemo_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), RED),
("BACKGROUND", (0,1), (-1,1), LRED),
("BACKGROUND", (0,2), (-1,2), WHITE),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("TOPPADDING", (0,0), (-1,-1), 4),
("BOTTOMPADDING", (0,0), (-1,-1), 4),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
]))
zinc_chemo_block.append(chemo_table)
zinc_chemo_block.append(sp(3))
zinc_chemo_block.append(tip_box("Antibiotics only for specific organisms — NOT routine!"))
two_col = Table(
[[ors_block, zinc_chemo_block]],
colWidths=[8.5*cm, 9.2*cm]
)
two_col.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
]))
story.append(two_col)
story.append(sp(6))
# ═══════════════ PREVENTION & CONTROL ════════════════════════════════════════
story.append(section_header("12. PREVENTION & CONTROL (WHO Recommendations)", NAVY))
story.append(sp(3))
prev_data = [
[Paragraph("SHORT-TERM (Clinical)", hdr_cell), Paragraph("LONG-TERM (A): MCH Care", hdr_cell), Paragraph("LONG-TERM (B): Preventive Strategies", hdr_cell)],
[
Paragraph("• ORS (oral rehydration)<br/>• IV fluids (RL/NS)<br/>• Maintenance ORS<br/>• Chemotherapy (when indicated)<br/>• Zinc supplementation", cell_style),
Paragraph("1. Promote <b>breastfeeding</b><br/>2. Appropriate <b>weaning</b> practices<br/>3. <b>Supplementary feeding</b><br/>4. <b>Vitamin A</b> supplementation<br/>5. Maternal nutrition", cell_style),
Paragraph("<b>Health Education:</b> sanitation, hygiene, safe water, latrine use<br/>"
"<b>Sanitation:</b> clean toilets, safe water, excreta disposal<br/>"
"<b>Immunization:</b> Measles vaccine + <b>Rotavirus vaccine</b><br/>"
"<b>Fly control:</b> control flies near faeces", cell_style),
],
]
prev_table = Table(prev_data, colWidths=[4.5*cm, 5.5*cm, 7.7*cm])
prev_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("BACKGROUND", (0,1), (0,1), LGREEN),
("BACKGROUND", (1,1), (1,1), LYELLOW),
("BACKGROUND", (2,1), (2,1), LPINK),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "TOP"),
]))
story.append(prev_table)
story.append(sp(6))
# ═══════════════ QUICK RECALL NUMBERS ════════════════════════════════════════
story.append(section_header("QUICK RECALL — KEY NUMBERS FOR VIVA", AMBER))
story.append(sp(3))
recall_items = [
("Under-5 deaths/year globally", "525,000"),
("Global cases/year", "1.7 billion"),
("Deaths in first 2 years", "80%"),
("Nepal under-5 deaths (2017)", "1,193"),
("MCC diarrhoea in children", "Rotavirus"),
("MCC of dysentery", "Shigella"),
("Drug for Shigella", "Ciprofloxacin"),
("Drug for Cholera", "Doxycycline"),
("Zinc <6 months", "10 mg/day × 10–14 days"),
("Zinc >6 months", "20 mg/day × 10–14 days"),
("Plan B ORS deficit", "75 ml/kg in 4 hours"),
("Plan C IV bolus", "100 ml/kg RL/NS"),
("Skin pinch — severe dehyd.", "> 2 seconds"),
("Homemade ORS", "1L water + 6 tsp sugar + ½ tsp salt"),
]
# Split into 2 columns of 7
col1 = recall_items[:7]
col2 = recall_items[7:]
def recall_mini_table(items):
rows = [[Paragraph(k, small_style), Paragraph(v, small_bold)] for k, v in items]
t = Table(rows, colWidths=[4.5*cm, 3.8*cm])
style = [
("TOPPADDING", (0,0), (-1,-1), 3),
("BOTTOMPADDING", (0,0), (-1,-1), 3),
("LEFTPADDING", (0,0), (-1,-1), 5),
("RIGHTPADDING", (0,0), (-1,-1), 5),
("VALIGN", (0,0), (-1,-1), "MIDDLE"),
("LINEBELOW", (0,0), (-1,-2), 0.3, colors.HexColor("#f0d080")),
]
for i in range(0, len(rows), 2):
style.append(("BACKGROUND", (0,i), (-1,i), LYELLOW))
if i+1 < len(rows):
style.append(("BACKGROUND", (0,i+1), (-1,i+1), WHITE))
t.setStyle(TableStyle(style))
return t
recall_table = Table(
[[recall_mini_table(col1), recall_mini_table(col2)]],
colWidths=[8.6*cm, 9.1*cm]
)
recall_table.setStyle(TableStyle([
("VALIGN", (0,0), (-1,-1), "TOP"),
("LEFTPADDING", (0,0), (-1,-1), 0),
("RIGHTPADDING", (0,0), (-1,-1), 0),
("TOPPADDING", (0,0), (-1,-1), 0),
("BOTTOMPADDING", (0,0), (-1,-1), 0),
]))
story.append(recall_table)
story.append(sp(6))
# ═══════════════ VIVA QUESTION ════════════════════════════════════════════════
story.append(section_header("SAMPLE VIVA QUESTION & ANSWER", RED))
story.append(sp(3))
story.append(info_box(
"<b>Q. A 28-year-old man from flood-affected Terai presents with profuse watery diarrhoea, "
"vomiting, dehydration. Water supply contaminated. Several similar cases in the village. "
"Name five public health strategies to prevent spread.</b>", LPINK))
story.append(sp(4))
ans_data = [
[Paragraph("Strategy", hdr_cell), Paragraph("Action", hdr_cell)],
[Paragraph("1. Safe drinking water", cell_bold),
Paragraph("Chlorine tablets, boil water, repair water supply systems", cell_style)],
[Paragraph("2. Sanitation & hygiene", cell_bold),
Paragraph("Handwashing with soap, safe food handling, proper waste disposal", cell_style)],
[Paragraph("3. Disease surveillance", cell_bold),
Paragraph("Activate Rapid Response Teams (RRTs), monitor cases, report outbreaks", cell_style)],
[Paragraph("4. Health education", cell_bold),
Paragraph("Media, volunteers, posters — educate on symptoms, prevention, when to seek care", cell_style)],
[Paragraph("5. Emergency rehydration services", cell_bold),
Paragraph("Set up ORS corners, ensure ORS/IV fluids/medicines at health posts", cell_style)],
]
ans_table = Table(ans_data, colWidths=[4.5*cm, 13.2*cm])
ans_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), RED),
("BACKGROUND", (0,1), (-1,1), LRED),
("BACKGROUND", (0,2), (-1,2), WHITE),
("BACKGROUND", (0,3), (-1,3), LRED),
("BACKGROUND", (0,4), (-1,4), WHITE),
("BACKGROUND", (0,5), (-1,5), LRED),
("GRID", (0,0), (-1,-1), 0.4, colors.HexColor("#bdc3c7")),
("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), "MIDDLE"),
]))
story.append(ans_table)
story.append(sp(8))
# ═══════════════ FOOTER ══════════════════════════════════════════════════════
footer_data = [[
Paragraph("ADD Quick Reference • PSM Viva 2026 • Based on lecture slides by Dr. Narendra Kumar Yadav",
ParagraphStyle("Footer", fontSize=7, fontName="Helvetica",
textColor=WHITE, alignment=TA_CENTER))
]]
footer_table = Table(footer_data, colWidths=[17.7*cm])
footer_table.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 5),
("BOTTOMPADDING", (0,0), (-1,-1), 5),
]))
story.append(footer_table)
# ─── Build ────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF saved to: {OUTPUT}")
cd /home/daytona/workspace/add-pdf && python3 generate_pdf.py 2>&1
ls -lh /home/daytona/workspace/add-pdf/ADD_Quick_Reference.pdf
ADD Quick Reference
PDF Document · PDF