Neonatal mortality indetail from spm
| Period | Definition |
|---|---|
| Early neonatal | Deaths in the first 7 days of life (day 0-6) |
| Late neonatal | Deaths from day 7 to 27 |

| Cause | Percentage |
|---|---|
| Preterm birth complications | 35% |
| Intrapartum-related complications (birth asphyxia) | 24% |
| Sepsis | 15% |
| Congenital abnormalities | 11% |
| Pneumonia | 6% |
| Other | 7% |
| Tetanus | 1% |
| Diarrhoea | 1% |
| Country | 1990 | 2018 |
|---|---|---|
| India | 88 | 32 |
| Bangladesh | 100 | 25 |
| Pakistan | 106 | 57 |
| China | 42 | 7 |
| Nepal | 99 | 27 |
| Sri Lanka | 18 | 6 |
| UK | 8 | 4 |
| Japan | 5 | 2 |
| World | 63 | 29 |
Infant mortality rate indetail from spm and explain indetail abt causes in flow chart and make a graph for infant mortality raye
mkdir -p /home/daytona/workspace/imr-charts && cat > /home/daytona/workspace/imr-charts/flowchart.html << 'HTMLEOF' <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; background: #fff; width: 1100px; } .title { text-align: center; font-size: 22px; font-weight: bold; color: #1a237e; padding: 22px 10px 10px; letter-spacing: 1px; } .subtitle { text-align: center; font-size: 13px; color: #555; margin-bottom: 24px; } .main-box { display: block; margin: 0 auto 0; width: 380px; background: #1a237e; color: #fff; font-size: 16px; font-weight: bold; text-align: center; padding: 14px 10px; border-radius: 10px; letter-spacing: 0.5px; } .arrow-down { text-align: center; font-size: 28px; color: #1a237e; line-height: 1; margin: 4px 0; } .three-cols { display: flex; justify-content: center; gap: 30px; margin: 0 30px; } .col { flex: 1; } .col-header { text-align: center; font-size: 13.5px; font-weight: bold; color: #fff; padding: 9px 6px; border-radius: 8px 8px 0 0; letter-spacing: 0.3px; } .bio-hdr { background: #1565c0; } .eco-hdr { background: #6a1b9a; } .soc-hdr { background: #2e7d32; } .col-body { border: 2px solid; border-top: none; border-radius: 0 0 8px 8px; padding: 0; } .bio-body { border-color: #1565c0; } .eco-body { border-color: #6a1b9a; } .soc-body { border-color: #2e7d32; } .item { display: flex; align-items: flex-start; padding: 7px 10px 7px 10px; font-size: 12.5px; color: #222; border-bottom: 1px solid #e0e0e0; gap: 7px; } .item:last-child { border-bottom: none; } .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; } .bio-dot { background: #1565c0; } .eco-dot { background: #6a1b9a; } .soc-dot { background: #2e7d32; } .outcomes { display: flex; justify-content: center; gap: 24px; margin: 24px 30px 0; } .outcome-box { flex: 1; text-align: center; padding: 10px 8px; border-radius: 8px; font-size: 12.5px; font-weight: bold; color: #fff; } .o1 { background: #c62828; } .o2 { background: #e65100; } .o3 { background: #ad1457; } .o4 { background: #00695c; } .footer { text-align: center; font-size: 11px; color: #888; margin: 18px 0 14px; } .arrow-three { display: flex; justify-content: center; gap: 30px; margin: 0 30px; } .arrow-three .arrow-down { flex: 1; } .conn-line { text-align: center; color: #1a237e; font-size: 13px; font-weight: bold; margin: 10px 0 4px; } </style> </head> <body> <div class="title">CAUSES OF INFANT MORTALITY RATE (IMR)</div> <div class="subtitle">Park's Textbook of Preventive and Social Medicine — Flowchart of Factors</div> <div class="main-box">INFANT MORTALITY RATE (IMR)<br><span style="font-size:12px;font-weight:normal;">Deaths <1 year / 1000 Live Births</span></div> <div class="arrow-down">↓</div> <div class="conn-line">Multifactorial Aetiology — Interaction of Three Groups</div> <div class="arrow-three"> <div class="arrow-down" style="color:#1565c0;">↙</div> <div class="arrow-down" style="color:#6a1b9a;">↓</div> <div class="arrow-down" style="color:#2e7d32;">↘</div> </div> <div class="three-cols"> <!-- BIOLOGICAL --> <div class="col"> <div class="col-header bio-hdr">🔬 BIOLOGICAL FACTORS</div> <div class="col-body bio-body"> <div class="item"><span class="dot bio-dot"></span><span><b>Low Birth Weight</b> (<2.5 kg)<br><span style="font-size:11px;color:#555;">Major determinant; <1000g = near 100% mortality</span></span></div> <div class="item"><span class="dot bio-dot"></span><span><b>Age of Mother</b><br><span style="font-size:11px;color:#555;">Very young (<19 yrs) or older (>30 yrs) = high risk</span></span></div> <div class="item"><span class="dot bio-dot"></span><span><b>Birth Order</b><br><span style="font-size:11px;color:#555;">Highest for 1st born; escalates after 3rd birth; 5th+ = worst</span></span></div> <div class="item"><span class="dot bio-dot"></span><span><b>Birth Spacing</b><br><span style="font-size:11px;color:#555;">Interval <2 yrs → 2–4× higher risk; Khanna Study</span></span></div> <div class="item"><span class="dot bio-dot"></span><span><b>Multiple Births</b><br><span style="font-size:11px;color:#555;">Higher LBW frequency → higher death risk</span></span></div> <div class="item"><span class="dot bio-dot"></span><span><b>Family Size</b><br><span style="font-size:11px;color:#555;">↑ family size → ↑ infections, malnutrition, illness duration</span></span></div> <div class="item"><span class="dot bio-dot"></span><span><b>High Fertility</b><br><span style="font-size:11px;color:#555;">High fertility and high IMR go hand-in-hand</span></span></div> </div> </div> <!-- ECONOMIC --> <div class="col"> <div class="col-header eco-hdr">💰 ECONOMIC FACTORS</div> <div class="col-body eco-body"> <div class="item"><span class="dot eco-dot"></span><span><b>Socio-economic Status</b><br><span style="font-size:11px;color:#555;">Most important variable — directly & indirectly affects IMR</span></span></div> <div class="item"><span class="dot eco-dot"></span><span><b>Slum vs. Rich Areas</b><br><span style="font-size:11px;color:#555;">IMR highest in slums, lowest in affluent localities</span></span></div> <div class="item"><span class="dot eco-dot"></span><span><b>Quality & Access to Health Care</b><br><span style="font-size:11px;color:#555;">Closely linked to socio-economic status</span></span></div> <div class="item"><span class="dot eco-dot"></span><span><b>Poverty → Malnutrition</b><br><span style="font-size:11px;color:#555;">↓ food → ↓ birth weight → ↑ mortality</span></span></div> <div class="item"><span class="dot eco-dot"></span><span><b>Unemployment / Low Income</b><br><span style="font-size:11px;color:#555;">Limits access to nutrition, healthcare, sanitation</span></span></div> </div> </div> <!-- CULTURAL/SOCIAL --> <div class="col"> <div class="col-header soc-hdr">👥 CULTURAL & SOCIAL FACTORS</div> <div class="col-body soc-body"> <div class="item"><span class="dot soc-dot"></span><span><b>Breast-feeding</b><br><span style="font-size:11px;color:#555;">Early weaning / bottle-feeding → GI + respiratory infections</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Religion & Caste</b><br><span style="font-size:11px;color:#555;">Socio-cultural patterns — habits, customs, cleanliness</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Early Marriage</b><br><span style="font-size:11px;color:#555;">Teen-age mothers — highest risk for neonatal & post-neonatal death</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Sex of Child</b><br><span style="font-size:11px;color:#555;">Female infants neglected in India → higher post-neonatal deaths</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Quality of Mothering</b><br><span style="font-size:11px;color:#555;">Efficient mother can reduce IMR even in poverty</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Maternal Education</b><br><span style="font-size:11px;color:#555;">Illiteracy = greatest barrier; Kerala model</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Quality of Health Care</b><br><span style="font-size:11px;color:#555;">Untrained birth attendants (dais); only 47% trained in India</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Broken Families / Illegitimacy</b><br><span style="font-size:11px;color:#555;">Death & separation → neglected child</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Brutal Customs</b><br><span style="font-size:11px;color:#555;">Discarding colostrum, cow-dung on cord, early bathing</span></span></div> <div class="item"><span class="dot soc-dot"></span><span><b>Bad Environmental Sanitation</b><br><span style="font-size:11px;color:#555;">Unsafe water, poor housing, overcrowding, insect breeding</span></span></div> </div> </div> </div> <div class="arrow-down" style="margin-top:18px;">↓</div> <div class="outcomes"> <div class="outcome-box o1">🦠 INFECTIONS<br><small style="font-weight:normal">Diarrhoea, Pneumonia, Tetanus, Sepsis</small></div> <div class="outcome-box o2">⚖️ MALNUTRITION<br><small style="font-weight:normal">PEM, Anaemia, Vitamin deficiencies</small></div> <div class="outcome-box o3">🧬 LOW BIRTH WEIGHT<br><small style="font-weight:normal">Preterm, IUGR, Asphyxia</small></div> <div class="outcome-box o4">🏥 POOR HEALTH CARE<br><small style="font-weight:normal">No ANC, Untrained TBA, No NICU</small></div> </div> <div class="arrow-down" style="margin-top:12px; color:#c62828; font-size:32px;">↓</div> <div style="text-align:center; background:#c62828; color:#fff; font-size:15px; font-weight:bold; padding:12px 20px; border-radius:10px; width:400px; margin:0 auto 10px;">INFANT DEATH (<1 year of age)</div> <div class="footer">Source: Park's Textbook of Preventive and Social Medicine | IMR = Deaths <1 yr / 1000 Live Births</div> </body> </html> HTMLEOF echo "Flowchart HTML created"
cat > /home/daytona/workspace/imr-charts/graph.py << 'PYEOF' import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.patches as mpatches import numpy as np countries = ['India', 'Bangladesh', 'Nepal', 'Myanmar', 'Pakistan', 'China', 'Thailand', 'Sri Lanka', 'New Zealand', 'USA', 'UK', 'Japan', 'World\nAverage'] imr_1990 = [88, 100, 99, 78, 106, 42, 30, 18, 9, 9, 8, 5, 63] imr_2018 = [32, 25, 27, 37, 57, 7, 8, 6, 5, 6, 4, 2, 29] x = np.arange(len(countries)) width = 0.38 fig, ax = plt.subplots(figsize=(15, 7.5)) fig.patch.set_facecolor('#f7f9fc') ax.set_facecolor('#f7f9fc') bars1 = ax.bar(x - width/2, imr_1990, width, color='#1565c0', alpha=0.88, label='1990', zorder=3) bars2 = ax.bar(x + width/2, imr_2018, width, color='#e53935', alpha=0.88, label='2018', zorder=3) # Value labels on top for bar in bars1: h = bar.get_height() ax.text(bar.get_x() + bar.get_width()/2., h + 1.2, str(int(h)), ha='center', va='bottom', fontsize=9, color='#1565c0', fontweight='bold') for bar in bars2: h = bar.get_height() ax.text(bar.get_x() + bar.get_width()/2., h + 1.2, str(int(h)), ha='center', va='bottom', fontsize=9, color='#c62828', fontweight='bold') # Reduction % annotation for i, (a, b) in enumerate(zip(imr_1990, imr_2018)): pct = round((a - b) / a * 100) ax.annotate(f'▼{pct}%', xy=(x[i], max(a,b) + 6.5), ha='center', fontsize=7.8, color='#2e7d32', fontweight='bold') ax.set_xlabel('Country', fontsize=13, fontweight='bold', labelpad=10) ax.set_ylabel('IMR (per 1000 Live Births)', fontsize=13, fontweight='bold', labelpad=10) ax.set_title('Infant Mortality Rate (IMR) — International Comparison: 1990 vs 2018\n(Park\'s SPM, Table 23)', fontsize=14, fontweight='bold', pad=15, color='#1a237e') ax.set_xticks(x) ax.set_xticklabels(countries, fontsize=9.5) ax.set_ylim(0, 130) ax.yaxis.grid(True, linestyle='--', alpha=0.6, color='#ccc', zorder=0) ax.set_axisbelow(True) # India line highlight ax.axvline(x=0, color='#ffa000', lw=1.2, linestyle=':', alpha=0.6) legend = ax.legend(fontsize=12, frameon=True, facecolor='white', edgecolor='#aaa', loc='upper right') # Footnote fig.text(0.5, -0.01, '1990 = MDG Baseline | Source: Park\'s Textbook of Preventive and Social Medicine | IMR = Deaths <1 yr per 1000 Live Births', ha='center', fontsize=9, color='#666', style='italic') ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) plt.tight_layout(pad=2) plt.savefig('/home/daytona/workspace/imr-charts/imr_graph.png', dpi=160, bbox_inches='tight', facecolor='#f7f9fc') print("Graph saved!") PYEOF python3 /home/daytona/workspace/imr-charts/graph.py
~/imr-charts/graph.py
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
countries = ['India', 'Bangladesh', 'Nepal', 'Myanmar', 'Pakistan', 'China', 'Thailand', 'Sri Lanka', 'New Zealand', 'USA', 'UK', 'Japan', 'World\nAvg']
imr_1990 = [88, 100, 99, 78, 106, 42, 30, 18, 9, 9, 8, 5, 63]
imr_2018 = [32, 25, 27, 37, 57, 7, 8, 6, 5, 6, 4, 2, 29]
x = np.arange(len(countries))
width = 0.38
fig, ax = plt.subplots(figsize=(15, 7.5))
fig.patch.set_facecolor('#f7f9fc')
ax.set_facecolor('#f7f9fc')
bars1 = ax.bar(x - width/2, imr_1990, width, color='#1565c0', alpha=0.88, label='1990', zorder=3)
bars2 = ax.bar(x + width/2, imr_2018, width, color='#e53935', alpha=0.88, label='2018', zorder=3)
for bar in bars1:
h = bar.get_height()
ax.text(bar.get_x() + bar.get_width()/2., h + 1.2, str(int(h)), ha='center', va='bottom', fontsize=9, color='#1565c0', fontweight='bold')
for bar in bars2:
h = bar.get_height()
ax.text(bar.get_x() + bar.get_width()/2., h + 1.2, str(int(h)), ha='center', va='bottom', fontsize=9, color='#c62828', fontweight='bold')
for i, (a, b) in enumerate(zip(imr_1990, imr_2018)):
pct = round((a - b) / a * 100)
ax.annotate(f'v{pct}%', xy=(x[i], max(a,b) + 7), ha='center', fontsize=7.8, color='#2e7d32', fontweight='bold')
ax.set_xlabel('Country', fontsize=13, fontweight='bold', labelpad=10)
ax.set_ylabel('IMR (per 1000 Live Births)', fontsize=13, fontweight='bold', labelpad=10)
ax.set_title("Infant Mortality Rate (IMR) - International Comparison: 1990 vs 2018\n(Park's SPM, Table 23)", fontsize=14, fontweight='bold', pad=15, color='#1a237e')
ax.set_xticks(x)
ax.set_xticklabels(countries, fontsize=9.5)
ax.set_ylim(0, 135)
ax.yaxis.grid(True, linestyle='--', alpha=0.6, color='#ccc', zorder=0)
ax.set_axisbelow(True)
ax.legend(fontsize=12, frameon=True, facecolor='white', edgecolor='#aaa', loc='upper right')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
fig.text(0.5, -0.01, "1990 = MDG Baseline | Source: Park's Textbook of Preventive and Social Medicine | IMR = Deaths <1 yr per 1000 Live Births",
ha='center', fontsize=9, color='#666', style='italic')
plt.tight_layout(pad=2)
plt.savefig('/home/daytona/workspace/imr-charts/imr_graph.png', dpi=160, bbox_inches='tight', facecolor='#f7f9fc')
print("Graph saved!")
python3 /home/daytona/workspace/imr-charts/graph.py
wkhtmltoimage --width 1100 --quality 95 /home/daytona/workspace/imr-charts/flowchart.html /home/daytona/workspace/imr-charts/flowchart.png 2>&1 && echo "Flowchart PNG done" || echo "wkhtmltoimage not available"
python3 - << 'EOF' from PIL import Image, ImageDraw, ImageFont import textwrap W, H = 1100, 1450 img = Image.new('RGB', (W, H), '#f7f9fc') draw = ImageDraw.Draw(img) def rect(x1,y1,x2,y2,fill,radius=10): draw.rounded_rectangle([x1,y1,x2,y2], radius=radius, fill=fill) def text_c(text, cx, y, size=14, color='#000', bold=False): try: font = ImageFont.truetype('/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf' if bold else '/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf', size) except: font = ImageFont.load_default() bb = draw.textbbox((0,0), text, font=font) tw = bb[2]-bb[0] draw.text((cx - tw//2, y), text, fill=color, font=font) def text_left(text, x, y, size=12, color='#000', bold=False, max_w=None): try: font = ImageFont.truetype('/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf' if bold else '/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf', size) except: font = ImageFont.load_default() if max_w: words = text.split() lines = [] cur = '' for w in words: test = (cur+' '+w).strip() bb = draw.textbbox((0,0),test,font=font) if bb[2]-bb[0] > max_w and cur: lines.append(cur) cur = w else: cur = test if cur: lines.append(cur) for i, line in enumerate(lines): draw.text((x, y + i*16), line, fill=color, font=font) return len(lines)*16 else: draw.text((x, y), text, fill=color, font=font) return 16 # TITLE rect(0,0,W,70,'#1a237e',0) text_c('CAUSES OF INFANT MORTALITY RATE (IMR)', W//2, 12, 22, '#fff', True) text_c("Park's Textbook of Preventive and Social Medicine", W//2, 42, 14, '#90caf9') # Main box rect(350, 90, 750, 140, '#1a237e', 10) text_c('INFANT MORTALITY RATE (IMR)', W//2, 99, 16, '#fff', True) text_c('Deaths < 1 year / 1000 Live Births', W//2, 120, 12, '#90caf9') # Arrow draw.line([(W//2,140),(W//2,165)], fill='#1a237e', width=3) draw.polygon([(W//2-8,163),(W//2+8,163),(W//2,175)], fill='#1a237e') # "Multifactorial" text rect(300, 176, 800, 200, '#e3f2fd', 6) text_c('Multifactorial Aetiology — Interaction of Three Groups', W//2, 182, 13, '#1a237e', True) # Three arrows draw.line([(550, 200),(200, 230)], fill='#1565c0', width=2) draw.line([(550, 200),(550, 230)], fill='#6a1b9a', width=2) draw.line([(550, 200),(900, 230)], fill='#2e7d32', width=2) # Column definitions cols = [ {'x': 30, 'w': 320, 'title': 'BIOLOGICAL FACTORS', 'hdr': '#1565c0', 'dot': '#1565c0', 'items': [ ('Low Birth Weight (<2.5 kg)', 'Main determinant; <1000g = near 100% mortality'), ('Age of Mother', '<19 yrs or >30 yrs = high risk'), ('Birth Order', 'Highest 1st born; escalates after 3rd; 5th+ worst'), ('Birth Spacing', 'Interval <2 yrs = 2-4x higher risk (Khanna Study)'), ('Multiple Births', 'Higher LBW frequency -> higher death risk'), ('Family Size', 'More children = more infections, malnutrition'), ('High Fertility', 'High fertility and high IMR go together'), ]}, {'x': 385, 'w': 330, 'title': 'ECONOMIC FACTORS', 'hdr': '#6a1b9a', 'dot': '#6a1b9a', 'items': [ ('Socio-economic Status', 'Most important variable — direct & indirect effect'), ('Slum vs. Rich Localities', 'IMR highest in slums, lowest in affluent areas'), ('Access to Health Care', 'Closely linked to socio-economic status'), ('Poverty -> Malnutrition', 'Low food -> low birth weight -> high mortality'), ('Low Income', 'Limits nutrition, healthcare, sanitation'), ]}, {'x': 750, 'w': 320, 'title': 'CULTURAL & SOCIAL FACTORS', 'hdr': '#2e7d32', 'dot': '#2e7d32', 'items': [ ('Breast-feeding', 'Early weaning/bottle feeding -> GI + respiratory infections'), ('Religion & Caste', 'Socio-cultural habits, customs, cleanliness'), ('Early Marriage', 'Teen mothers = highest neonatal+post-neonatal risk'), ('Sex of Child', 'Female infants neglected -> higher post-neonatal deaths'), ('Quality of Mothering', 'Efficient mother can reduce IMR even in poverty'), ('Maternal Education', 'Illiteracy = greatest barrier; Kerala experience'), ('Quality of Health Care', 'Untrained dais; only 47% trained TBAs in India'), ('Broken Families', 'Parental death/separation -> child neglect'), ('Brutal Customs', 'Discarding colostrum, cow-dung on cord'), ('Bad Sanitation', 'Unsafe water, overcrowding, poor housing'), ]}, ] col_start_y = 235 for col in cols: cx = col['x'] cw = col['w'] hdr_col = col['hdr'] # Header rect(cx, col_start_y, cx+cw, col_start_y+32, hdr_col, 8) text_c(col['title'], cx + cw//2, col_start_y+8, 13, '#fff', True) # Items iy = col_start_y + 36 for (title, desc) in col['items']: # dot draw.ellipse([cx+8, iy+3, cx+16, iy+11], fill=col['dot']) # title text_left(title, cx+22, iy, 11, '#111', True, cw-30) iy += 15 text_left(desc, cx+22, iy, 10, '#555', False, cw-30) iy += 20 draw.line([(cx+4, iy), (cx+cw-4, iy)], fill='#e0e0e0', width=1) iy += 4 # Border draw.rounded_rectangle([cx, col_start_y+32, cx+cw, iy+4], radius=0, outline=hdr_col, width=2) # Outcomes row outcomes_y = 960 outcomes = [ ('#c62828', 'INFECTIONS', 'Diarrhoea, Pneumonia,\nTetanus, Sepsis'), ('#e65100', 'MALNUTRITION', 'PEM, Anaemia,\nVitamin deficiencies'), ('#6a1b9a', 'LOW BIRTH WEIGHT', 'Preterm, IUGR,\nBirth Asphyxia'), ('#00695c', 'POOR HEALTH CARE', 'No ANC, Untrained TBA,\nNo NICU'), ] draw.line([(W//2, 950),(W//2, 965)], fill='#333', width=2) draw.polygon([(W//2-8,963),(W//2+8,963),(W//2,975)], fill='#333') ow = 240 gap = 18 total_w = len(outcomes)*ow + (len(outcomes)-1)*gap ox_start = (W - total_w)//2 for i, (col, title, desc) in enumerate(outcomes): ox = ox_start + i*(ow+gap) rect(ox, outcomes_y, ox+ow, outcomes_y+80, col, 10) text_c(title, ox+ow//2, outcomes_y+10, 12, '#fff', True) for j, line in enumerate(desc.split('\n')): text_c(line, ox+ow//2, outcomes_y+32+j*18, 11, '#ffe0e0') # Final arrow draw.line([(W//2, outcomes_y+80),(W//2, outcomes_y+105)], fill='#c62828', width=3) draw.polygon([(W//2-10,outcomes_y+103),(W//2+10,outcomes_y+103),(W//2,outcomes_y+116)], fill='#c62828') # Final box rect(330, outcomes_y+116, 770, outcomes_y+160, '#c62828', 10) text_c('INFANT DEATH (< 1 year of age)', W//2, outcomes_y+125, 17, '#fff', True) text_c('IMR = Deaths / 1000 Live Births', W//2, outcomes_y+147, 12, '#ffcdd2') # Footer rect(0, H-40, W, H, '#e8eaf6', 0) text_c("Source: Park's Textbook of Preventive and Social Medicine | Causes of Infant Mortality Rate", W//2, H-30, 11, '#555') img.save('/home/daytona/workspace/imr-charts/flowchart.png', quality=95) print("Flowchart PNG saved!") EOF
IMR = (Deaths of children < 1 year in a year ÷ Live births in same year) × 1000
| Component | Period | Causes |
|---|---|---|
| Neonatal mortality | 0-28 days | Endogenous - prematurity, LBW, birth asphyxia, congenital anomalies |
| Post-neonatal mortality | 29 days - 1 year | Exogenous - infections (diarrhoea, pneumonia), malnutrition |
flowchart
Image · PNG
imr graph
Image · PNG
| Country | 1990 | 2018 | % Reduction |
|---|---|---|---|
| India | 88 | 32 | 64% |
| Bangladesh | 100 | 25 | 75% |
| Nepal | 99 | 27 | 73% |
| Myanmar | 78 | 37 | 53% |
| Pakistan | 106 | 57 | 46% (least reduced) |
| China | 42 | 7 | 83% |
| Thailand | 30 | 8 | 73% |
| Sri Lanka | 18 | 6 | 67% |
| Japan | 5 | 2 | 60% (best globally) |
| UK | 8 | 4 | 50% |
| USA | 9 | 6 | 33% |
| World Average | 63 | 29 | 54% |
| # | Measure | Key Points |
|---|---|---|
| 1 | Prenatal Nutrition | Extra 500 kcal + 10g protein in last 4 weeks → +300g birth weight (Indian study); ICDS programme |
| 2 | Prevention of Infection | Immunization; Universal Immunization Programme (1985) for 9 vaccine-preventable diseases |
| 3 | Promotion of Breast-feeding | Most effective measure; safeguard against GI + respiratory infections and PEM |
| 4 | Growth Monitoring | Monthly weighing; growth charts to identify at-risk children early |
| 5 | Family Planning | Birth spacing + limiting family size; risk greatly enhanced if last child born <2 yrs ago |
| 6 | Sanitation | Safe water, hygienic housing, vector control |
| 7 | Primary Health Care | High-risk antenatal detection; special care baby units for <2000g; referral services |
| 8 | Socio-economic Development | Ultimate solution - female education, nutrition standards, safe water, housing, agriculture, commerce |
| 9 | Education | Tamil Nadu study: mid-day meals + women's healthcare → IMR fell from 90 (1984) to 57 (1991) |
Infant mortality rate indetail causes explain in flow chart
python3 - << 'EOF' from PIL import Image, ImageDraw, ImageFont import textwrap W, H = 1300, 1700 img = Image.new('RGB', (W, H), '#FAFBFF') draw = ImageDraw.Draw(img) def get_font(size, bold=False): paths = [ '/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf' if bold else '/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf' if bold else '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', ] for p in paths: try: return ImageFont.truetype(p, size) except: pass return ImageFont.load_default() def rrect(x1,y1,x2,y2,fill,outline=None,radius=12,lw=2): draw.rounded_rectangle([x1,y1,x2,y2], radius=radius, fill=fill, outline=outline, width=lw) def center_text(text, cx, y, size=14, color='#000', bold=False): font = get_font(size, bold) bb = draw.textbbox((0,0), text, font=font) tw = bb[2]-bb[0] draw.text((cx - tw//2, y), text, fill=color, font=font) return bb[3]-bb[1] def draw_arrow(x1,y1,x2,y2,color='#555',width=2,head=8): draw.line([(x1,y1),(x2,y2)], fill=color, width=width) # arrowhead (pointing down assumed) if x1==x2: draw.polygon([(x2-head,y2-head),(x2+head,y2-head),(x2,y2+2)], fill=color) else: import math angle = math.atan2(y2-y1, x2-x1) draw.polygon([ (int(x2-head*math.cos(angle-0.4)), int(y2-head*math.sin(angle-0.4))), (int(x2-head*math.cos(angle+0.4)), int(y2-head*math.sin(angle+0.4))), (x2,y2) ], fill=color) # ── TITLE BAR ────────────────────────────────────────────────────────────── rrect(0,0,W,72,'#1A237E',radius=0) center_text('INFANT MORTALITY RATE (IMR) — CAUSES FLOWCHART', W//2, 10, 24, '#FFFFFF', True) center_text("Park's Textbook of Preventive and Social Medicine", W//2, 44, 14, '#90CAF9') # ── MAIN IMR BOX ──────────────────────────────────────────────────────────── rrect(420,90,880,148,'#1A237E','#0D47A1',14) center_text('INFANT MORTALITY RATE (IMR)', W//2, 100, 18, '#FFFFFF', True) center_text('Deaths < 1 year of age ÷ Live Births × 1000', W//2, 125, 12, '#BBDEFB') draw_arrow(W//2,148,W//2,175,'#1A237E',3) # ── "Multifactorial" ribbon ───────────────────────────────────────────────── rrect(310,175,990,208,'#E3F2FD','#1565C0',8,2) center_text('MULTIFACTORIAL AETIOLOGY — Interaction of Biological, Economic & Social Factors', W//2, 183, 13, '#0D47A1', True) # ── Three branch arrows ────────────────────────────────────────────────────── # Left (Bio), Centre (Eco), Right (Social) draw_arrow(540, 208, 200, 250, '#1565C0', 2, 7) draw_arrow(650, 208, 650, 250, '#6A1B9A', 2, 7) draw_arrow(760, 208, 1100, 250, '#2E7D32', 2, 7) # ────────────────────────────────────────────────────────────────────────────── # HELPER: draw a full column box with header + item list # Returns the bottom y of the box def draw_col(x, y, w, title, hdr_color, items, dot_color): line_h = 38 box_h = 36 + len(items)*line_h + 8 # header rrect(x, y, x+w, y+36, hdr_color, None, 10) center_text(title, x+w//2, y+8, 13, '#FFFFFF', True) # body bg rrect(x, y+36, x+w, y+box_h, '#FFFFFF', hdr_color, 0, 2) draw.rectangle([x+2, y+36, x+w-2, y+box_h-2], fill='#FFFFFF') iy = y + 44 for (head, sub) in items: # dot draw.ellipse([x+10, iy+3, x+20, iy+13], fill=dot_color) # heading text font_b = get_font(12, True) font_r = get_font(11, False) draw.text((x+26, iy), head, fill='#111111', font=font_b) iy += 16 # sub text — wrap to col width max_chars = (w-36)//7 wrapped = textwrap.wrap(sub, max_chars) for wline in wrapped: draw.text((x+26, iy), wline, fill='#555555', font=font_r) iy += 14 # divider draw.line([(x+6, iy+2),(x+w-6, iy+2)], fill='#E0E0E0', width=1) iy += 8 # border draw.rounded_rectangle([x,y+36,x+w,y+box_h], radius=0, outline=hdr_color, width=2) return y + box_h COL_Y = 258 COL_W = 370 # ── BIOLOGICAL ─────────────────────────────────────────────────────────────── bio_items = [ ('Low Birth Weight (<2.5 kg)', 'Major determinant. <1000g = near 100% mortality. Caused by poor maternal nutrition.'), ('Age of Mother', 'Risk highest if <19 yrs (teen mothers) or >30 yrs. Young mothers are poorer and less educated.'), ('Birth Order', 'Highest risk for 1st born; lowest for 2nd. Escalates after 3rd birth. 5th+ birth = worst outcome.'), ('Birth Spacing (<2 yrs)', 'Causes malnutrition + anaemia in mother → LBW. 2-4x higher risk (Khanna Study, WHO India Study).'), ('Multiple Births', 'Twins/multiples have higher frequency of LBW → higher infant death risk.'), ('Family Size', 'More children → more infections, malnutrition, longer illness, less maternal care.'), ('High Fertility', 'High fertility and high IMR consistently go together.'), ] bio_bot = draw_col(20, COL_Y, COL_W, 'A. BIOLOGICAL FACTORS', '#1565C0', bio_items, '#1565C0') # ── ECONOMIC ────────────────────────────────────────────────────────────────── eco_items = [ ('Socio-economic Status', 'Single most important variable — affects IMR both directly and indirectly.'), ('Slum vs. Affluent Areas', 'IMR highest in slums; lowest in rich residential localities.'), ('Access to Health Care', 'Quality and availability closely linked to socio-economic level.'), ('Poverty → Malnutrition', 'Low income → poor diet → LBW → increased infant death.'), ('Unemployment', 'Limits access to nutrition, medicine, clean water, and adequate housing.'), ] eco_bot = draw_col(465, COL_Y, COL_W, 'B. ECONOMIC FACTORS', '#6A1B9A', eco_items, '#6A1B9A') # ── SOCIAL/CULTURAL ─────────────────────────────────────────────────────────── soc_items = [ ('Breast-feeding Failure', 'Early weaning / bottle feeding → GI + respiratory infections and PEM.'), ('Early Marriage', 'Teenage mothers have highest neonatal and post-neonatal death risk.'), ('Sex of Child (India)', 'Female infants neglected → higher post-neonatal mortality.'), ('Maternal Education', 'Illiteracy = greatest barrier. Educated mothers → better health practices (Kerala model).'), ('Quality of Mothering', 'An efficient mother can reduce IMR even under poverty.'), ('Untrained Birth Attendants', 'Only 47% of deliveries in India attended by trained persons (dais problem).'), ('Broken Families/Illegitimacy', 'Parental death or separation → child neglect → increased IMR.'), ('Brutal Customs', 'Discarding colostrum, cow-dung on cord, early bathing, frequent purgation.'), ('Bad Environmental Sanitation', 'Unsafe water, overcrowding, poor drainage, insect breeding.'), ('Religion & Caste', 'Socio-cultural habits, traditions affecting cleanliness and child care.'), ] soc_bot = draw_col(910, COL_Y, COL_W, 'C. CULTURAL & SOCIAL FACTORS', '#2E7D32', soc_items, '#2E7D32') bot = max(bio_bot, eco_bot, soc_bot) # ── Converging arrows to intermediate outcomes ─────────────────────────────── mid_y = bot + 30 draw_arrow(20+COL_W//2, bio_bot, 20+COL_W//2, mid_y, '#1565C0', 2, 7) draw_arrow(465+COL_W//2, eco_bot, 465+COL_W//2, mid_y, '#6A1B9A', 2, 7) draw_arrow(910+COL_W//2, soc_bot, 910+COL_W//2, mid_y, '#2E7D32', 2, 7) # Horizontal connecting bar bar_x1 = 20+COL_W//2 bar_x2 = 910+COL_W//2 cy = mid_y draw.line([(bar_x1, cy),(bar_x2, cy)], fill='#444', width=3) draw_arrow(W//2, cy, W//2, cy+30, '#333', 3, 9) # ── INTERMEDIATE PROXIMATE CAUSES ───────────────────────────────────────────── prox_y = mid_y + 30 prox_items = [ ('#C62828','#FFCDD2','INFECTIONS','Diarrhoea · Pneumonia\nTetanus · Sepsis · ARI'), ('#E65100','#FFE0B2','MALNUTRITION','PEM · Anaemia\nVitamin Deficiencies'), ('#6A1B9A','#E1BEE7','LOW BIRTH WEIGHT','Prematurity · IUGR\nBirth Asphyxia'), ('#00695C','#B2DFDB','POOR HEALTH CARE','No ANC · Untrained TBA\nNo NICU / Referral'), ] pw = 285; pg = 20 total_pw = len(prox_items)*pw + (len(prox_items)-1)*pg px_start = (W - total_pw)//2 ph = 95 for i,(hcol,lcol,ptitle,psub) in enumerate(prox_items): px = px_start + i*(pw+pg) rrect(px, prox_y, px+pw, prox_y+ph, hcol, None, 10) center_text(ptitle, px+pw//2, prox_y+10, 13, '#FFFFFF', True) for j,line in enumerate(psub.split('\n')): center_text(line, px+pw//2, prox_y+34+j*22, 12, '#FFFFFF') # Arrow down draw_arrow(W//2, prox_y+ph, W//2, prox_y+ph+30, '#B71C1C', 3, 10) # ── FINAL DEATH BOX ─────────────────────────────────────────────────────────── fb_y = prox_y + ph + 30 rrect(350, fb_y, 950, fb_y+68, '#B71C1C', '#7F0000', 14, 3) center_text('INFANT DEATH (< 1 Year of Age)', W//2, fb_y+8, 20, '#FFFFFF', True) center_text('IMR = Deaths < 1 yr ÷ 1000 Live Births', W//2, fb_y+38, 13, '#FFCDD2') # ── PREVENTIVE MEASURES BOX ─────────────────────────────────────────────────── prev_y = fb_y + 90 rrect(30, prev_y, W-30, prev_y+32, '#1B5E20', None, 10) center_text('PREVENTIVE MEASURES TO REDUCE IMR (Park\'s SPM)', W//2, prev_y+7, 14, '#FFFFFF', True) prev_items = [ '1. Prenatal Nutrition — extra 500 kcal + 10g protein → +300g birth wt (ICDS)', '2. Immunization — UIP (1985) for 9 vaccine-preventable diseases', '3. Promote Breast-feeding — most effective single measure against infections & PEM', '4. Growth Monitoring — monthly weight; growth chart; early identification of at-risk babies', '5. Family Planning — birth spacing >2 yrs; limit family size', '6. Environmental Sanitation — safe water, proper drainage, good housing', '7. Primary Health Care — high-risk ANC detection; special care baby units (<2000g)', '8. Socio-economic Development — female education, nutrition, agriculture, industry', '9. Education — Tamil Nadu: IMR dropped 90→57 (1984→1991) via school meals + women\'s care', ] font_r = get_font(11) font_b = get_font(11, True) py = prev_y + 38 for item in prev_items: num, rest = item.split('. ', 1) draw.text((50, py), num+'.', fill='#2E7D32', font=font_b) draw.text((72, py), rest, fill='#111', font=font_r) py += 18 # final border around prev box rrect(30, prev_y, W-30, py+10, None, '#1B5E20', 10, 2) # ── FOOTER ──────────────────────────────────────────────────────────────────── fy = py + 20 draw.rectangle([0, fy, W, fy+34], fill='#E8EAF6') center_text("Source: Park's Textbook of Preventive and Social Medicine | IMR = Deaths <1 yr per 1000 Live Births | Multifactorial aetiology", W//2, fy+8, 11, '#444') # Crop to content final_h = fy + 34 img_cropped = img.crop((0,0,W,final_h)) img_cropped.save('/home/daytona/workspace/imr-charts/imr_causes_flowchart_v2.png', quality=96) print(f"Done! Size: {W}x{final_h}") EOF
python3 - << 'EOF' from PIL import Image, ImageDraw, ImageFont import textwrap W = 1300 img = Image.new('RGB', (W, 2200), '#FAFBFF') draw = ImageDraw.Draw(img) def get_font(size, bold=False): for path in [ '/usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf' if bold else '/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf', '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf' if bold else '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', ]: try: return ImageFont.truetype(path, size) except: pass return ImageFont.load_default() def rrect(x1,y1,x2,y2,fill,outline=None,radius=12,lw=2): draw.rounded_rectangle([x1,y1,x2,y2], radius=radius, fill=fill, outline=outline, width=lw) def cx_text(text, cx, y, size=14, color='#000', bold=False): font = get_font(size, bold) bb = draw.textbbox((0,0), text, font=font) draw.text((cx-(bb[2]-bb[0])//2, y), text, fill=color, font=font) def arrow_down(x, y1, y2, color='#333', w=2, hs=8): draw.line([(x,y1),(x,y2)], fill=color, width=w) draw.polygon([(x-hs,y2-hs),(x+hs,y2-hs),(x,y2+2)], fill=color) def arrow_diag(x1,y1,x2,y2,color='#333',w=2,hs=7): import math draw.line([(x1,y1),(x2,y2)], fill=color, width=w) angle=math.atan2(y2-y1,x2-x1) draw.polygon([ (int(x2-hs*math.cos(angle-0.45)),int(y2-hs*math.sin(angle-0.45))), (int(x2-hs*math.cos(angle+0.45)),int(y2-hs*math.sin(angle+0.45))), (x2,y2) ], fill=color) # ── TITLE ────────────────────────────────────────────────────────────── rrect(0,0,W,76,'#0D1B6E',radius=0) cx_text('INFANT MORTALITY RATE (IMR) — CAUSES FLOWCHART', W//2, 10, 24, '#FFFFFF', True) cx_text("Park's Textbook of Preventive and Social Medicine", W//2, 46, 14, '#90CAF9') # ── IMR BOX ──────────────────────────────────────────────────────────── rrect(400,96,900,154,'#0D1B6E','#283593',14,3) cx_text('INFANT MORTALITY RATE (IMR)', W//2, 106, 18, '#FFFFFF', True) cx_text('Deaths < 1 year of age ÷ Total Live Births × 1000', W//2, 132, 12, '#BBDEFB') arrow_down(W//2, 154, 186, '#0D1B6E', 3) # ── Ribbon ───────────────────────────────────────────────────────────── rrect(270,186,1030,220,'#E3F2FD','#1565C0',8,2) cx_text('MULTIFACTORIAL AETIOLOGY — Interaction of Biological, Economic & Cultural/Social Factors', W//2, 194, 13, '#0D47A1', True) # Branch arrows arrow_diag(W//2-20, 220, 195, 262, '#1565C0', 2) arrow_down(W//2, 220, 262, '#6A1B9A', 2) arrow_diag(W//2+20, 220, 1105, 262, '#2E7D32', 2) # ── COLUMN BUILDER ──────────────────────────────────────────────────── def make_col(x, y, w, title, hdr, dot, items): LH = 14 # sub line height BH = 17 # bold line height PAD = 12 # compute total height total = 0 for (head, sub) in items: total += BH max_chars = (w - 36)//6 lines = textwrap.wrap(sub, max_chars) if sub else [] total += len(lines)*LH + PAD box_h = 40 + total + 6 # header rrect(x, y, x+w, y+38, hdr, None, 10) cx_text(title, x+w//2, y+9, 13, '#FFFFFF', True) # body rrect(x, y+38, x+w, y+box_h, '#FFFFFF', hdr, 4, 2) iy = y + 48 fb = get_font(12, True) fr = get_font(11, False) for (head, sub) in items: draw.ellipse([x+10, iy+2, x+21, iy+13], fill=dot) draw.text((x+28, iy), head, fill='#111', font=fb) iy += BH if sub: max_chars = (w-36)//6 for wl in textwrap.wrap(sub, max_chars): draw.text((x+28, iy), wl, fill='#555', font=fr) iy += LH draw.line([(x+6,iy+2),(x+w-6,iy+2)], fill='#E0E0E0', width=1) iy += PAD draw.rounded_rectangle([x,y+38,x+w,y+box_h], outline=hdr, width=2) return y + box_h COL_Y = 268 BIO_X, ECO_X, SOC_X = 15, 460, 905 BIO_W, ECO_W, SOC_W = 420, 420, 375 bio_items = [ ('Low Birth Weight (<2.5 kg)', 'MAJOR determinant. <1000g = near 100% death. Caused by poor maternal nutrition before & during pregnancy.'), ('Age of Mother', 'IMR greatest: very young mothers (<19 yrs) or older (>30 yrs). Teen mothers tend to be poorer and less educated.'), ('Birth Order', 'Highest IMR for 1st born; lowest for 2nd born. Risk escalates sharply after 3rd birth; 5th+ = worst.'), ('Birth Spacing (<2 yrs)', 'Short interval → malnutrition + anaemia in mother → LBW. Risk 2–4x higher (Khanna Study & WHO India Study).'), ('Multiple Births', 'Twins/multiples have higher LBW frequency → higher death risk.'), ('Family Size', 'More children → more episodes of diarrhoea, respiratory infections, malnutrition, and less maternal care.'), ('High Fertility', 'High fertility and high IMR consistently co-exist.'), ] eco_items = [ ('Socio-economic Status', 'Single MOST IMPORTANT variable — affects IMR both directly and indirectly.'), ('Slum vs. Affluent Areas', 'IMR is highest in slums and lowest in richer residential localities.'), ('Access to Health Care', 'Availability and quality of health care are closely tied to socio-economic level.'), ('Poverty → Malnutrition', 'Low income → inadequate diet → LBW → increased infant death.'), ('Unemployment', 'Limits access to nutrition, medicines, clean water and adequate housing.'), ] soc_items = [ ('Breast-feeding Failure', 'Early weaning / bottle feeding → GI + respiratory infections + PEM.'), ('Early Marriage', 'Teenage mother = highest neonatal and post-neonatal death risk.'), ('Sex of Child (India)', 'Female infants neglected → higher post-neonatal mortality.'), ('Maternal Education', 'Illiteracy is the greatest barrier. Kerala experience — educated mothers delay marriage, space births.'), ('Quality of Mothering', 'Even in poverty, an efficient mother can significantly reduce IMR.'), ('Untrained Birth Attendants', 'Only 47% of deliveries in India attended by trained persons; unhygienic dai practices cause high IMR.'), ('Broken Families / Illegitimacy', 'Parental death / separation or unwanted child → neglect → increased IMR.'), ('Brutal Customs', 'Discarding colostrum, cow-dung on cord, early bathing, frequent purgation, early weaning.'), ('Bad Environmental Sanitation', 'Unsafe water, overcrowding, poor housing, bad drainage, insect breeding.'), ('Religion & Caste', 'Socio-cultural habits and traditions affecting cleanliness, eating, clothing and child care.'), ] bio_bot = make_col(BIO_X, COL_Y, BIO_W, 'A. BIOLOGICAL FACTORS', '#1565C0', '#1565C0', bio_items) eco_bot = make_col(ECO_X, COL_Y, ECO_W, 'B. ECONOMIC FACTORS', '#6A1B9A', '#6A1B9A', eco_items) soc_bot = make_col(SOC_X, COL_Y, SOC_W, 'C. CULTURAL & SOCIAL FACTORS', '#2E7D32', '#2E7D32', soc_items) col_bot = max(bio_bot, eco_bot, soc_bot) # convergence arrow_down(BIO_X+BIO_W//2, bio_bot, col_bot+8, '#1565C0', 2) arrow_down(ECO_X+ECO_W//2, eco_bot, col_bot+8, '#6A1B9A', 2) arrow_down(SOC_X+SOC_W//2, soc_bot, col_bot+8, '#2E7D32', 2) bar_y = col_bot + 10 draw.line([(BIO_X+BIO_W//2, bar_y),(SOC_X+SOC_W//2, bar_y)], fill='#444', width=3) arrow_down(W//2, bar_y, bar_y+32, '#333', 3, 10) # ── PROXIMATE CAUSES ─────────────────────────────────────────────────── prx_y = bar_y + 34 prx_boxes = [ ('#B71C1C','INFECTIONS', 'Diarrhoea · Pneumonia\nTetanus · Sepsis · ARI'), ('#E65100','MALNUTRITION', 'PEM · Anaemia\nVitamin Deficiencies'), ('#4A148C','LOW BIRTH WEIGHT', 'Prematurity · IUGR\nBirth Asphyxia'), ('#004D40','POOR HEALTH CARE', 'No ANC · Untrained TBA\nNo NICU / Referral'), ] pw = 295; pg = 16 total_pw = len(prx_boxes)*pw + (len(prx_boxes)-1)*pg px0 = (W-total_pw)//2 ph = 100 for i,(hc,pt,ps) in enumerate(prx_boxes): px = px0 + i*(pw+pg) rrect(px, prx_y, px+pw, prx_y+ph, hc, None, 10) cx_text(pt, px+pw//2, prx_y+12, 13, '#FFFFFF', True) for j,line in enumerate(ps.split('\n')): cx_text(line, px+pw//2, prx_y+38+j*24, 12, '#FFFFFF') arrow_down(W//2, prx_y+ph, prx_y+ph+32, '#B71C1C', 3, 10) # ── DEATH BOX ───────────────────────────────────────────────────────── db_y = prx_y + ph + 34 rrect(330, db_y, 970, db_y+72, '#B71C1C', '#7F0000', 14, 3) cx_text('INFANT DEATH (< 1 Year of Age)', W//2, db_y+10, 21, '#FFFFFF', True) cx_text('IMR = Deaths < 1 yr ÷ 1000 Live Births', W//2, db_y+42, 14, '#FFCDD2') # ── PREVENTION BOX ──────────────────────────────────────────────────── pv_y = db_y + 90 rrect(20, pv_y, W-20, pv_y+38, '#1B5E20', None, 10) cx_text("PREVENTIVE & SOCIAL MEASURES TO REDUCE IMR (Park's SPM)", W//2, pv_y+9, 15, '#FFFFFF', True) prev_list = [ ('1.','Prenatal Nutrition','Extra 500 kcal + 10g protein in last 4 wks → +300g birth weight; ICDS programme active in India'), ('2.','Prevention of Infection','UIP (1985) — 9 vaccine-preventable diseases; immunization greatly lowers neonatal tetanus'), ('3.','Promotion of Breast-feeding','Single most effective measure — guards against GI & respiratory infections and PEM'), ('4.','Growth Monitoring','Monthly weight; growth chart identifies at-risk babies early; low-cost technology'), ('5.','Family Planning','Birth spacing >2 yrs + limiting family size; risk greatly enhanced if last child born <2 yrs'), ('6.','Environmental Sanitation','Safe water supply, proper drainage, good housing, vector control'), ('7.','Primary Health Care','High-risk ANC detection; special care baby units for <2000g; proper referral services'), ('8.','Socio-economic Development','Female education, nutritional standards, safe water, housing, agriculture, communication'), ('9.','Education','Tamil Nadu: mid-day meal + women\'s healthcare → IMR fell 90 (1984) → 57 (1991)'), ] fb2 = get_font(12, True) fr2 = get_font(12, False) py2 = pv_y + 44 for (num,bold_t,rest) in prev_list: draw.text((40, py2), num, fill='#2E7D32', font=fb2) draw.text((60, py2), bold_t+' — ', fill='#111', font=fb2) bb = draw.textbbox((0,0), bold_t+' — ', font=fb2) draw.text((60+bb[2]-bb[0], py2), rest, fill='#333', font=fr2) py2 += 20 rrect(20, pv_y, W-20, py2+12, None, '#1B5E20', 10, 2) # ── FOOTER ──────────────────────────────────────────────────────────── fy = py2 + 20 draw.rectangle([0,fy,W,fy+34], fill='#E8EAF6') cx_text("Source: Park's Textbook of Preventive and Social Medicine | IMR = Deaths <1 yr per 1000 Live Births | Multifactorial Aetiology", W//2, fy+8, 11, '#555') final_h = fy + 34 img.crop((0,0,W,final_h)).save('/home/daytona/workspace/imr-charts/imr_causes_flowchart_final.png', quality=97) print(f"Saved! {W}x{final_h}") EOF
imr causes flowchart final
Image · PNG
IMR (Definition & Formula)
↓
Multifactorial Aetiology
↙ ↓ ↘
[A] [B] [C]
Biological Economic Cultural & Social
Factors Factors Factors
↓ (all converge)
Proximate Causes
(Infections · Malnutrition · LBW · Poor Health Care)
↓
INFANT DEATH
↓
Preventive Measures (9 key interventions)
| Factor | Key Detail |
|---|---|
| Low Birth Weight (<2.5 kg) | Major determinant; <1000g = near 100% death |
| Age of Mother | <19 yrs or >30 yrs = highest risk |
| Birth Order | 1st born = highest; escalates after 3rd birth |
| Birth Spacing <2 yrs | 2-4x higher risk (Khanna Study) |
| Multiple Births | Higher LBW → higher death |
| Family Size | More children = more infections, less maternal care |
| High Fertility | Always co-exists with high IMR |
| Factor | Key Detail |
|---|---|
| Socio-economic Status | Single most important variable |
| Slum vs. Affluent | IMR highest in slums |
| Access to Health Care | Tied to income level |
| Poverty → Malnutrition | Low income → LBW → death |
| Unemployment | Limits nutrition, housing, medicines |
| Factor | Key Detail |
|---|---|
| Breast-feeding failure | Early weaning → GI/respiratory infections + PEM |
| Early marriage | Teenage mother = highest neonatal risk |
| Sex of child (India) | Female infants neglected |
| Maternal education | Illiteracy = greatest barrier; Kerala model |
| Quality of mothering | Efficient mother reduces IMR even in poverty |
| Untrained birth attendants | Only 47% trained in India |
| Broken families/illegitimacy | Neglect → increased IMR |
| Brutal customs | Discarding colostrum, cow-dung on cord |
| Bad environmental sanitation | Unsafe water, overcrowding, poor housing |
| Religion & caste | Socio-cultural practices affecting child care |