Malaria treatment in indian rural hospitals setup
malaria treatment India rural
India NVBDCP malaria treatment guidelines 2024 rural hospitals ACT
| Drug | Dose | Duration |
|---|---|---|
| Chloroquine | 25 mg/kg total, divided over 3 days (10 mg/kg Day 1, 10 mg/kg Day 2, 5 mg/kg Day 3) | 3 days |
| Primaquine | 0.25 mg/kg/day | 14 days (radical cure) |
| Age group | AS 50 mg tabs | SP tabs | Primaquine (2.5 mg) |
|---|---|---|---|
| <1 year | ½ | ½ | 0 |
| 1-4 years | 1 | 1 | 1 tab |
| 5-8 years | 2 | 1½ | 2 tabs |
| 9-14 years | 3 | 2 | 4 tabs |
| ≥15 years | 4 | 3 | 6 tabs (0.75 mg/kg) |
Important: Production and sale of artemisinin monotherapy is banned in India to prevent resistance development.
| Trimester | P. falciparum | P. vivax |
|---|---|---|
| 1st trimester | Quinine (ACT avoided) | Chloroquine |
| 2nd & 3rd trimesters | ACT (ACT-SP or ACT-AL) | Chloroquine |
| Option | Dose |
|---|---|
| Artesunate IV/IM (preferred) | 2.4 mg/kg at 0 h, 12 h, 24 h, then once daily |
| Artemether IM | 3.2 mg/kg loading, then 1.6 mg/kg/day |
| Arteether IM | 150 mg/day for 3 days (adults only, not children) |
| Quinine IV infusion | 20 mg/kg loading, then 10 mg/kg 8-hourly (rate ≤5 mg/kg/hr) |
Parenteral treatment must continue for a minimum of 24 hours even if the patient improves and can take oral medications earlier.
Create a quick reference PDF flowchart for malaria diagnosis and treatment in rural PHCs
mkdir -p /home/daytona/workspace/malaria-phc-flowchart && ls /home/daytona/works…
~/malaria-phc-flowchart/generate_flowchart.py
#!/usr/bin/env python3
"""
Malaria Diagnosis & Treatment Quick Reference Flowchart
For Indian Rural PHC Settings (NVBDCP / National Drug Policy 2013)
Generated with ReportLab
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import mm, cm
from reportlab.pdfgen import canvas
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.platypus import Paragraph
from reportlab.lib.enums import TA_CENTER, TA_LEFT
import textwrap
# ── Colour palette ──────────────────────────────────────────────────────────
C_HEADER = colors.HexColor("#1a5276") # deep navy
C_DIAG = colors.HexColor("#2e86c1") # diagnosis blue
C_VIVAX = colors.HexColor("#1e8449") # vivax green
C_FALCI = colors.HexColor("#922b21") # falciparum red
C_SEVERE = colors.HexColor("#6c3483") # severe purple
C_REFER = colors.HexColor("#b7950b") # referral amber
C_PREG = colors.HexColor("#2e4057") # pregnancy slate
C_MIXED = colors.HexColor("#117a65") # mixed teal
C_DECISION = colors.HexColor("#f0b27a") # decision diamond orange
C_WHITE = colors.white
C_LTGRAY = colors.HexColor("#f4f6f7")
C_LTGREEN = colors.HexColor("#d5f5e3")
C_LTRED = colors.HexColor("#fadbd8")
C_LTBLUE = colors.HexColor("#d6eaf8")
C_LTPURPLE = colors.HexColor("#e8daef")
C_LTAMBER = colors.HexColor("#fef9e7")
C_BORDER = colors.HexColor("#aab7b8")
W, H = A4 # 595 x 842 pt
def draw_rect_box(c, x, y, w, h, fill_color, text_lines,
font_size=7.5, bold=False, text_color=C_WHITE,
border_color=None, radius=4):
"""Draw a rounded rectangle with centred multi-line text."""
c.setFillColor(fill_color)
bc = border_color or fill_color
c.setStrokeColor(bc)
c.setLineWidth(0.8)
c.roundRect(x, y, w, h, radius, fill=1, stroke=1)
# Text
c.setFillColor(text_color)
font = "Helvetica-Bold" if bold else "Helvetica"
c.setFont(font, font_size)
total_lines = len(text_lines)
line_h = font_size * 1.25
start_y = y + h / 2 + (total_lines - 1) * line_h / 2
for i, line in enumerate(text_lines):
c.drawCentredString(x + w / 2, start_y - i * line_h, line)
def draw_diamond(c, cx, cy, hw, hh, fill_color, text_lines,
font_size=7, text_color=colors.black):
"""Draw a decision diamond."""
c.setFillColor(fill_color)
c.setStrokeColor(colors.HexColor("#e67e22"))
c.setLineWidth(1)
path = c.beginPath()
path.moveTo(cx, cy + hh)
path.lineTo(cx + hw, cy)
path.lineTo(cx, cy - hh)
path.lineTo(cx - hw, cy)
path.closePath()
c.drawPath(path, fill=1, stroke=1)
c.setFillColor(text_color)
c.setFont("Helvetica-Bold", font_size)
total_lines = len(text_lines)
line_h = font_size * 1.3
start_y = cy + (total_lines - 1) * line_h / 2
for i, line in enumerate(text_lines):
c.drawCentredString(cx, start_y - i * line_h, line)
def arrow(c, x1, y1, x2, y2, label="", color=C_BORDER):
"""Draw an arrow from (x1,y1) to (x2,y2)."""
c.setStrokeColor(color)
c.setFillColor(color)
c.setLineWidth(1.2)
c.line(x1, y1, x2, y2)
# arrowhead
import math
angle = math.atan2(y2 - y1, x2 - x1)
aw = 6
c.setLineWidth(0.5)
path = c.beginPath()
path.moveTo(x2, y2)
path.lineTo(x2 - aw * math.cos(angle - 0.4), y2 - aw * math.sin(angle - 0.4))
path.lineTo(x2 - aw * math.cos(angle + 0.4), y2 - aw * math.sin(angle + 0.4))
path.closePath()
c.drawPath(path, fill=1, stroke=0)
if label:
mx, my = (x1 + x2) / 2, (y1 + y2) / 2
c.setFont("Helvetica-Bold", 6.5)
c.setFillColor(colors.HexColor("#922b21"))
c.drawCentredString(mx + 8, my + 3, label)
def draw_small_label(c, x, y, text, color=colors.HexColor("#555555")):
c.setFont("Helvetica", 6)
c.setFillColor(color)
c.drawCentredString(x, y, text)
# ── PAGE 1: Diagnosis + Treatment flowchart ─────────────────────────────────
def page1(c):
# Background
c.setFillColor(C_LTGRAY)
c.rect(0, 0, W, H, fill=1, stroke=0)
# Header banner
c.setFillColor(C_HEADER)
c.rect(0, H - 52, W, 52, fill=1, stroke=0)
c.setFillColor(C_WHITE)
c.setFont("Helvetica-Bold", 15)
c.drawCentredString(W / 2, H - 22, "MALARIA: QUICK REFERENCE FLOWCHART FOR RURAL PHC")
c.setFont("Helvetica", 8)
c.drawCentredString(W / 2, H - 38, "National Drug Policy 2013 | NVBDCP / NCVBDC | India")
# Sub-header strip
c.setFillColor(colors.HexColor("#2e4057"))
c.rect(0, H - 66, W, 14, fill=1, stroke=0)
c.setFillColor(C_WHITE)
c.setFont("Helvetica-Bold", 7.5)
c.drawCentredString(W / 2, H - 61, "STEP 1: DIAGNOSIS | STEP 2: CLASSIFY | STEP 3: TREAT or REFER | STEP 4: FOLLOW-UP")
# ── ROW 1: Start ──
BW = 130; BH = 26
start_x = W / 2 - BW / 2
start_y = H - 100
draw_rect_box(c, start_x, start_y, BW, BH, C_DIAG,
["FEVER PATIENT PRESENTS TO PHC"],
font_size=8, bold=True)
arrow(c, W/2, start_y, W/2, start_y - 18)
# ── ROW 2: Diagnosis ──
DW = 160; DH = 32; diag_y = start_y - 18 - DH
draw_rect_box(c, W/2 - DW/2, diag_y, DW, DH, C_DIAG,
["CONFIRM DIAGNOSIS", "(No presumptive treatment)"],
font_size=7.5, bold=False)
# side note
c.setFillColor(C_WHITE)
c.setFont("Helvetica", 6.5)
note_x = W/2 + DW/2 + 5
note_y = diag_y + 20
c.setFillColor(C_LTBLUE)
c.setStrokeColor(C_DIAG)
c.setLineWidth(0.6)
c.roundRect(note_x, note_y - 14, 115, 28, 3, fill=1, stroke=1)
c.setFillColor(C_DIAG)
c.setFont("Helvetica-Bold", 6.5)
c.drawString(note_x + 4, note_y + 8, "Diagnostic Tools (Free at PHC):")
c.setFont("Helvetica", 6)
c.setFillColor(colors.black)
c.drawString(note_x + 4, note_y - 1, " RDT (Rapid Diagnostic Test)")
c.drawString(note_x + 4, note_y - 10, " Microscopy (Blood smear)")
arrow(c, W/2, diag_y, W/2, diag_y - 18)
# ── ROW 3: Decision diamond ──
diam_cy = diag_y - 18 - 28
draw_diamond(c, W/2, diam_cy, 88, 28,
C_DECISION, ["MALARIA", "CONFIRMED?"])
# YES arrow down
arrow(c, W/2, diam_cy - 28, W/2, diam_cy - 48, "YES")
# NO arrow right
arrow(c, W/2 + 88, diam_cy, W - 35, diam_cy, "NO")
c.setFillColor(colors.HexColor("#555555"))
c.setFont("Helvetica", 6.5)
no_box_x = W - 35 - 68
c.setFillColor(colors.HexColor("#f9f9f9"))
c.setStrokeColor(C_BORDER)
c.roundRect(W - 103, diam_cy - 12, 90, 24, 3, fill=1, stroke=1)
c.setFillColor(colors.HexColor("#555555"))
c.setFont("Helvetica", 6.5)
c.drawString(W - 100, diam_cy + 5, "Treat for other")
c.drawString(W - 100, diam_cy - 5, "cause of fever")
# ── ROW 4: Second diamond ──
sp_cy = diam_cy - 48 - 28
draw_diamond(c, W/2, sp_cy, 92, 28,
C_DECISION, ["SEVERE", "MALARIA?"])
arrow(c, W/2, sp_cy - 28, W/2, sp_cy - 20, "NO")
arrow(c, W/2 + 92, sp_cy, W - 30, sp_cy, "YES")
# SEVERE box (right)
sev_x = W - 30 - 118; sev_y = sp_cy - 38; sev_w = 118; sev_h = 76
draw_rect_box(c, sev_x, sev_y, sev_w, sev_h, C_SEVERE,
["SEVERE MALARIA", "Pre-referral: Give parenteral",
"artemisinin/quinine dose,", "take blood smear, RDT",
"→ REFER IMMEDIATELY"],
font_size=7, bold=False)
# connect arrow down to severe box
arrow(c, W-30, sp_cy, W-30, sev_y + sev_h)
# Severity criteria note
c.setFillColor(C_LTPURPLE)
c.setStrokeColor(C_SEVERE)
c.setLineWidth(0.6)
c.roundRect(sev_x - 120, sev_y, 116, 76, 3, fill=1, stroke=1)
c.setFillColor(C_SEVERE)
c.setFont("Helvetica-Bold", 6.5)
c.drawString(sev_x - 117, sev_y + 63, "Severe Malaria Criteria (any 1):")
criteria = [
"Coma / impaired consciousness",
"Convulsions (repeated)",
"Hb <5 g/dL; severe anaemia",
"Renal failure (Cr >3 mg/dL)",
"Jaundice (bili >3 mg/dL)",
"Pulmonary oedema / ARDS",
"Hypoglycaemia (<40 mg/dL)",
"Shock (SBP <80 mmHg)",
"Haemoglobinuria",
]
c.setFont("Helvetica", 5.8)
c.setFillColor(colors.black)
for i, crit in enumerate(criteria):
c.drawString(sev_x - 117, sev_y + 53 - i * 8, f"• {crit}")
# ── ROW 5: Third diamond (species) ──
spec_cy = sp_cy - 20 - 28
draw_diamond(c, W/2, spec_cy, 95, 28,
C_DECISION, ["SPECIES?"])
# VIVAX arrow left
arrow(c, W/2 - 95, spec_cy, 30, spec_cy, "P. VIVAX")
# FALCIPARUM arrow right
arrow(c, W/2 + 95, spec_cy, W - 30, spec_cy, "P. FALCI")
# MIXED arrow down
arrow(c, W/2, spec_cy - 28, W/2, spec_cy - 20, "MIXED")
# ── VIVAX TREATMENT BOX (left) ──
vx = 10; vy = spec_cy - 100; vw = 145; vh = 108
draw_rect_box(c, vx, vy, vw, vh, C_VIVAX,
["P. VIVAX TREATMENT",
"Chloroquine 25 mg/kg ÷ 3 days:",
" Day 1: 10 mg/kg",
" Day 2: 10 mg/kg",
" Day 3: 5 mg/kg",
"+ Primaquine 0.25 mg/kg/day",
" × 14 days (radical cure)",
"⚠ PQ: contraindicated in",
" G6PD defic., pregnancy,",
" infants"],
font_size=7, bold=False, text_color=C_WHITE)
arrow(c, 30, spec_cy, vx + vw/2, vy + vh)
# ── FALCIPARUM TREATMENT BOX (right) ──
fx = W - 155; fy = spec_cy - 108; fw = 148; fh = 116
draw_rect_box(c, fx, fy, fw, fh, C_FALCI,
["P. FALCIPARUM TREATMENT",
"Most states: ACT-SP",
" AS 4 tabs + SP 3 tabs × 3 days",
" + PQ 0.75 mg/kg (Day 2 only)",
"NE states (SP resistance):",
" ACT-AL (Artemether-Lumefantrine)",
" Age-specific dose × 3 days",
" + PQ single dose (Day 2)",
"⚠ No artemisinin monotherapy",
"⚠ ACT-AL: avoid 1st trimester",
" & weight <5 kg"],
font_size=6.8, bold=False, text_color=C_WHITE)
arrow(c, W - 30, spec_cy, fx + fw/2, fy + fh)
# ── MIXED TREATMENT BOX (center) ──
mx2 = W/2 - 75; my2 = spec_cy - 20 - 62; mw = 150; mh = 62
draw_rect_box(c, mx2, my2, mw, mh, C_MIXED,
["MIXED (Pf + Pv) TREATMENT",
"ACT-SP × 3 days (or ACT-AL in NE)",
"+ PQ 0.25 mg/kg/day × 14 days",
"(for vivax radical cure)",
"⚠ Treat as falciparum severity"],
font_size=7, bold=False, text_color=C_WHITE)
# ── PREGNANCY STRIP ──
preg_y = vy - 18 - 30
preg_w = W - 20
draw_rect_box(c, 10, preg_y, preg_w, 30, C_PREG,
["MALARIA IN PREGNANCY | 1st trimester: Quinine (Pf) / Chloroquine (Pv) "
"2nd & 3rd trimester: ACT (Pf) / Chloroquine (Pv) ⚠ Primaquine CONTRAINDICATED throughout"],
font_size=7, bold=False, text_color=C_WHITE)
# ── REFERRAL STRIP ──
ref_y = preg_y - 14 - 26
draw_rect_box(c, 10, ref_y, preg_w, 26, C_REFER,
["REFER IMMEDIATELY IF: Fever >24 h despite Rx | Repeated vomiting | "
"Convulsions | Altered sensorium | Severe dehydration | Unable to walk | Worsening headache"],
font_size=7, bold=False, text_color=C_WHITE)
# ── Footer ──
c.setFillColor(C_HEADER)
c.rect(0, 0, W, 18, fill=1, stroke=0)
c.setFillColor(C_WHITE)
c.setFont("Helvetica", 6)
c.drawCentredString(W / 2, 6, "Source: NVBDCP National Drug Policy 2013 | Park's Textbook of Preventive & Social Medicine | Page 1 of 2")
# ── PAGE 2: Dosage Tables + Treatment Failure + Parenteral Severe ────────────
def page2(c):
c.setFillColor(C_LTGRAY)
c.rect(0, 0, W, H, fill=1, stroke=0)
# Header
c.setFillColor(C_HEADER)
c.rect(0, H - 42, W, 42, fill=1, stroke=0)
c.setFillColor(C_WHITE)
c.setFont("Helvetica-Bold", 13)
c.drawCentredString(W / 2, H - 20, "MALARIA PHC QUICK REFERENCE — DOSING TABLES & SPECIAL SITUATIONS")
c.setFont("Helvetica", 7.5)
c.drawCentredString(W / 2, H - 34, "India NVBDCP 2013 | For use by Medical Officers, PHC/CHC Staff")
top = H - 52
# ─ TABLE 1: ACT-SP Age-wise Dosing ─────────────────────────────────────
def table_header(c, x, y, w, title, color):
c.setFillColor(color)
c.roundRect(x, y, w, 16, 3, fill=1, stroke=0)
c.setFillColor(C_WHITE)
c.setFont("Helvetica-Bold", 8)
c.drawCentredString(x + w / 2, y + 5, title)
# Table 1
t1x = 10; t1y = top - 16 - 90; t1w = 270
table_header(c, t1x, top - 16, t1w, "ACT-SP DOSING (Most States) — 3 Days + PQ Day 2", C_FALCI)
cols = [50, 45, 45, 50, 55, 50] # widths
headers = ["Age", "AS (50mg)", "SP tabs", "PQ tabs", "PQ tabs", "PQ tabs"]
subh = ["", "Day1/2/3", "Day1", "Day1", "Day2", "Day3-14"]
rows = [
["<1 yr", "½", "½", "0", "0", "0"],
["1–4 yrs", "1", "1", "1", "1", "1"],
["5–8 yrs", "2", "1½", "2", "2", "2"],
["9–14 yrs", "3", "2", "4", "4", "4"],
["≥15 yrs", "4", "3", "6", "6", "6"],
]
row_h = 13; col_x = t1x
# sub-header
c.setFillColor(colors.HexColor("#d6eaf8"))
c.setStrokeColor(C_DIAG)
c.setLineWidth(0.5)
c.rect(t1x, top - 16 - 13, t1w, 13, fill=1, stroke=1)
cx = t1x
for i, (h, sh, cw) in enumerate(zip(headers, subh, cols)):
c.setFillColor(C_DIAG)
c.setFont("Helvetica-Bold", 6.2)
c.drawCentredString(cx + cw/2, top - 16 - 5, h)
c.setFont("Helvetica", 5.5)
c.setFillColor(colors.HexColor("#444"))
c.drawCentredString(cx + cw/2, top - 16 - 11, sh)
cx += cw
for ri, row in enumerate(rows):
ry = top - 16 - 13 - (ri + 1) * row_h
bg = C_WHITE if ri % 2 == 0 else colors.HexColor("#f0f3f4")
c.setFillColor(bg)
c.setStrokeColor(C_BORDER)
c.rect(t1x, ry, t1w, row_h, fill=1, stroke=1)
cx = t1x
for val, cw in zip(row, cols):
c.setFillColor(colors.black)
c.setFont("Helvetica" if ri > 0 or val != row[0] else "Helvetica-Bold", 6.5)
c.drawCentredString(cx + cw/2, ry + 4, val)
cx += cw
# Table 2: ACT-AL dosing
t2x = 10; t2y = top - 16 - 200; t2w = 270
table_header(c, t2x, top - 16 - 110, t2w, "ACT-AL DOSING (NE States) — Artemether 20mg + Lumefantrine 120mg", C_FALCI)
al_rows = [
["5–14 kg", "1 tab", "1 tab", "1 tab"],
["15–24 kg", "2 tabs", "2 tabs", "2 tabs"],
["25–34 kg", "3 tabs", "3 tabs", "3 tabs"],
["≥35 kg", "4 tabs", "4 tabs", "4 tabs"],
]
al_cols = [60, 60, 60, 90]
al_headers = ["Weight", "Morning D1", "Evening D1", "D2 & D3 (morn+eve)"]
c.setFillColor(colors.HexColor("#d6eaf8"))
c.setStrokeColor(C_DIAG)
c.rect(t2x, top - 16 - 110 - 13, t2w, 13, fill=1, stroke=1)
cx = t2x
for h, cw in zip(al_headers, al_cols):
c.setFillColor(C_DIAG)
c.setFont("Helvetica-Bold", 6.2)
c.drawCentredString(cx + cw/2, top - 16 - 110 - 5, h)
cx += cw
for ri, row in enumerate(al_rows):
ry = top - 16 - 110 - 13 - (ri + 1) * row_h
bg = C_WHITE if ri % 2 == 0 else colors.HexColor("#f0f3f4")
c.setFillColor(bg)
c.setStrokeColor(C_BORDER)
c.rect(t2x, ry, t2w, row_h, fill=1, stroke=1)
cx = t2x
for val, cw in zip(row, al_cols):
c.setFillColor(colors.black)
c.setFont("Helvetica", 6.5)
c.drawCentredString(cx + cw/2, ry + 4, val)
cx += cw
# ─ RIGHT COLUMN: Parenteral Severe Malaria ──────────────────────────────
rx = 295; ry_top = top
# Parenteral box
par_box_h = 150
table_header(c, rx, ry_top - 16, W - rx - 10, "SEVERE MALARIA — PARENTERAL TREATMENT", C_SEVERE)
c.setFillColor(C_LTPURPLE)
c.setStrokeColor(C_SEVERE)
c.setLineWidth(0.6)
c.roundRect(rx, ry_top - 16 - par_box_h, W - rx - 10, par_box_h, 3, fill=1, stroke=1)
lines = [
("Artesunate IV/IM (PREFERRED):", True),
(" 2.4 mg/kg at 0h, 12h, 24h → then once daily", False),
("Artemether IM:", True),
(" 3.2 mg/kg loading → 1.6 mg/kg/day", False),
("Arteether IM (adults only):", True),
(" 150 mg/day × 3 days", False),
("Quinine IV:", True),
(" Loading: 20 mg/kg (rate ≤5 mg/kg/hr)", False),
(" Maintenance: 10 mg/kg 8-hourly", False),
("", False),
("After ≥24h parenteral → switch to oral ACT", False),
("Quinine follow-up: + Doxycycline (adults)", False),
(" or Clindamycin (pregnancy/children <8 yrs)", False),
]
ly = ry_top - 16 - 14
for text, bold in lines:
c.setFillColor(C_SEVERE if bold else colors.black)
c.setFont("Helvetica-Bold" if bold else "Helvetica", 6.8 if bold else 6.5)
c.drawString(rx + 6, ly, text)
ly -= 10
# Treatment failure box
tf_y = ry_top - 16 - par_box_h - 16 - 90
table_header(c, rx, ry_top - 16 - par_box_h - 16, W - rx - 10, "TREATMENT FAILURE (Pf)", colors.HexColor("#784212"))
c.setFillColor(colors.HexColor("#fdf2e9"))
c.setStrokeColor(colors.HexColor("#784212"))
c.roundRect(rx, tf_y, W - rx - 10, 90, 3, fill=1, stroke=1)
tf_lines = [
("Early Tx Failure (ETF):", "Danger signs + parasitaemia D1/2/3"),
("Late Clinical Failure (LCF):", "Fever + parasitaemia D4–6"),
("Late Parasitol. Failure (LPF):", "Parasitaemia D7–28, afebrile"),
("Management:", "Alternative ACT OR Quinine + Doxycycline"),
(" ", "(Doxycycline: CI in pregnancy, lactation, <8 yrs)"),
]
tly = tf_y + 78
for label, val in tf_lines:
c.setFillColor(colors.HexColor("#784212"))
c.setFont("Helvetica-Bold", 6.5)
c.drawString(rx + 6, tly, label)
c.setFillColor(colors.black)
c.setFont("Helvetica", 6.5)
c.drawString(rx + 6 + 110, tly, val)
tly -= 12
# Special populations box
sp_bx = rx; sp_by = tf_y - 16 - 100; sp_bh = 100
table_header(c, sp_bx, tf_y - 16, W - sp_bx - 10, "SPECIAL POPULATIONS", colors.HexColor("#1f618d"))
c.setFillColor(colors.HexColor("#d6eaf8"))
c.setStrokeColor(colors.HexColor("#1f618d"))
c.roundRect(sp_bx, sp_by, W - sp_bx - 10, sp_bh, 3, fill=1, stroke=1)
sp_lines = [
"PREGNANCY:",
" 1st trimester Pf→ Quinine | Pv→ Chloroquine",
" 2nd/3rd trim. Pf→ ACT (SP/AL) | Pv→ Chloroquine",
" ⚠ Primaquine CONTRAINDICATED in all trimesters",
" ⚠ Doxycycline CONTRAINDICATED in pregnancy",
" ⚠ Use Clindamycin instead of Doxycycline",
"G6PD DEFICIENCY:",
" Screen before primaquine in tribal areas",
" Stop PQ if: dark urine, jaundice, cyanosis",
]
sly = sp_by + 88
for line in sp_lines:
c.setFillColor(colors.HexColor("#1f618d") if not line.startswith(" ") and not line.startswith("⚠") else colors.black)
c.setFont("Helvetica-Bold" if not line.startswith(" ") and not line.startswith("⚠") else "Helvetica", 6.5)
c.drawString(sp_bx + 6, sly, line)
sly -= 10
# ─ BOTTOM: Vivax dosing table ──────────────────────────────────────────
bot_y = tf_y - 16 - 100 - 16
table_header(c, 10, bot_y, (W - 20), "VIVAX & MIXED MALARIA — CHLOROQUINE + PRIMAQUINE DOSING (Age-wise)", C_VIVAX)
vv_rows = [
["<1 yr", "½ tab (Day1)", "½ tab (Day2)", "¼ tab (Day3)", "—", "Do not give PQ"],
["1–4 yrs", "1 (D1)", "1 (D2)", "½ (D3)", "1 tab/day", "14 days"],
["5–8 yrs", "2 (D1)", "2 (D2)", "1 (D3)", "2 tabs/day","14 days"],
["9–14 yrs", "3 (D1)", "3 (D2)", "1½ (D3)", "4 tabs/day","14 days"],
["≥15 yrs", "4 (D1)", "4 (D2)", "2 (D3)", "6 tabs/day","14 days"],
]
vv_cols = [52, 60, 60, 60, 60, 80]
vv_headers = ["Age", "CQ 250mg", "CQ 250mg", "CQ 250mg", "PQ 2.5mg", "Duration PQ"]
vv_subh = ["", "Day 1", "Day 2", "Day 3", "Daily dose",""]
boty2 = bot_y - 13
c.setFillColor(colors.HexColor("#d5f5e3"))
c.setStrokeColor(C_VIVAX)
c.rect(10, boty2, W - 20, 13, fill=1, stroke=1)
cx = 10
for h, sh, cw in zip(vv_headers, vv_subh, vv_cols):
c.setFillColor(C_VIVAX)
c.setFont("Helvetica-Bold", 6.2)
c.drawCentredString(cx + cw/2, boty2 + 5, h)
cx += cw
for ri, row in enumerate(vv_rows):
ry2 = boty2 - (ri + 1) * row_h
bg = C_WHITE if ri % 2 == 0 else colors.HexColor("#eafaf1")
c.setFillColor(bg)
c.setStrokeColor(C_BORDER)
c.rect(10, ry2, W - 20, row_h, fill=1, stroke=1)
cx = 10
for val, cw in zip(row, vv_cols):
c.setFillColor(colors.black)
c.setFont("Helvetica", 6.3)
c.drawCentredString(cx + cw/2, ry2 + 4, val)
cx += cw
# Footer
c.setFillColor(C_HEADER)
c.rect(0, 0, W, 18, fill=1, stroke=0)
c.setFillColor(C_WHITE)
c.setFont("Helvetica", 6)
c.drawCentredString(W / 2, 6,
"Source: NVBDCP National Drug Policy 2013 | Park's Textbook of Preventive & Social Medicine | Page 2 of 2")
# ── MAIN ────────────────────────────────────────────────────────────────────
output_path = "/home/daytona/workspace/malaria-phc-flowchart/Malaria_PHC_Quick_Reference.pdf"
c = canvas.Canvas(output_path, pagesize=A4)
c.setTitle("Malaria Quick Reference Flowchart — Rural PHC India")
c.setAuthor("NVBDCP / Orris Medical Reference")
c.setSubject("Malaria Diagnosis and Treatment Flowchart for Rural PHCs in India")
page1(c)
c.showPage()
page2(c)
c.save()
print(f"PDF saved to: {output_path}")
cd /home/daytona/workspace/malaria-phc-flowchart && python3 generate_flowchart.p…
~/malaria-phc-flowchart/generate_flowchart.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/malaria-phc-flowchart/generate_flowchart.py'
~/malaria-phc-flowchart/generate_flowchart.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/malaria-phc-flowchart/generate_flowchart.py'
cd /home/daytona/workspace/malaria-phc-flowchart && python3 generate_flowchart.p…
ls -lh /home/daytona/workspace/malaria-phc-flowchart/Malaria_PHC_Quick_Reference…
Malaria PHC Quick Reference
PDF Document · PDF