Malaria

Reading File
Asking for Preferences
Finding Sources
Searching PubMed

"malaria"[MeSH Terms] AND "treatment"[MeSH Terms]

Searching the Web

malaria WHO treatment guidelines 2024 2025

Reading File
Reading File
Finding Sources
Searching PubMed

"malaria" AND "antimalarial" AND "resistance"

Reading File
Reading File
Reading File
Reading File
Loading Image
Reading File
Excellent content from Harrison's and Goldman-Cecil. I now have comprehensive material covering all aspects. Let me compile the full, detailed academic overview.

Malaria - Comprehensive Clinical & Academic Overview

Sources: Harrison's Principles of Internal Medicine 22E (2025), Goldman-Cecil Medicine, Robbins & Kumar Basic Pathology, Murray & Nadel's Respiratory Medicine, Katzung's Pharmacology

1. Etiology

Malaria is a protozoan disease caused by six species of the genus Plasmodium, transmitted by the bite of infected female Anopheles mosquitoes. Humans are the only natural reservoir for human-infecting species.
SpeciesFeatures
P. falciparumMost dangerous; causes tertian malaria (48-h cycle); nearly all deaths; widespread chloroquine resistance
P. vivaxCommon in Central/South America and Asia; forms hypnozoites (causes relapses)
P. ovale (curtisi & wallikeri)Two morphologically identical sympatric species; hypnozoites present; mild disease
P. malariae72-h (quartan) cycle; mild but can cause nephrotic syndrome; no hypnozoites
P. knowlesiSimian malaria in Southeast Asia; 24-h cycle; can be fatal; morphologically resembles P. malariae
P. simium / P. cynomolgiRare zoonotic infections
"In 2022, there were an estimated 249 million cases in 85 malaria-endemic countries and 608,000 deaths (approximately 1,660 deaths each day)." - Harrison's Principles of Internal Medicine 22E, p. 1804

2. Life Cycle & Pathogenesis

Life cycle of P. falciparum showing hepatic and erythrocytic stages

Hepatic (Pre-erythrocytic) Phase - Clinically Silent

  1. Female Anopheles mosquito injects sporozoites into the bloodstream during a blood meal
  2. Sporozoites travel to the liver within minutes, binding to hepatocyte surface via thrombospondin-related adhesive protein and circumsporozoite protein (which bind heparan sulfate proteoglycans)
  3. Sporozoites enter hepatocytes and undergo intrahepatic schizogony - one sporozoite produces 10,000-30,000 daughter merozoites
  4. Infected hepatocytes burst, releasing merozoites into the bloodstream
  5. In P. vivax and P. ovale, some forms become hypnozoites (dormant liver forms) - cause relapses weeks to over a year later

Erythrocytic Phase - Causes Disease

  1. Merozoites bind to RBC surface via a lectin-like molecule binding sialidated glycophorin (a RBC transmembrane protein)
  2. Merozoites invaginate into RBCs within a "digestive vacuole"
  3. Intraerythrocytic organisms differentiate into ring trophozoites → trophozoites → schizonts
  4. Schizonts express PfEMP1 (P. falciparum Erythrocyte Membrane Protein 1) on knob-like extensions on the RBC surface - this is the key virulence factor
  5. PfEMP1 binds to endothelial adhesion molecules (ICAM-1, VCAM-1, CD36) causing sequestration of parasitized RBCs in capillary beds - central to severe disease
  6. After several days, schizonts lyse RBCs and release new merozoites (every 48 h for P. falciparum; 72 h for P. malariae; 24 h for P. knowlesi)
  7. Some trophozoites become gametocytes, which are taken up by a mosquito to restart the sexual cycle

In the Mosquito

  • Male gametocyte exflagellates into 8 motile male gametes; fuses with female gametocytes
  • Undergoes meiosis in the midgut, forming a zygote → ookinete → oocyst
  • Oocyst bursts to release sporozoites which migrate to the salivary glands

Key Pathogenic Mechanisms

  • Cytoadherence and sequestration: PfEMP1-mediated; causes microvascular obstruction in brain, lung, kidney, placenta
  • Inflammatory cytokines: TNF-alpha, IL-1, IL-6 cause fever and systemic effects
  • Hemolytic anemia: RBC lysis with each schizont burst; increased splenic clearance of both infected and uninfected RBCs
  • Hemozoin: Brown degradation product of hemoglobin produced by the parasite; found in macrophages; contributes to anemia and inflammation
  • Genetic protection: Sickle cell trait, thalassemia, G6PD deficiency, and Duffy antigen negativity all confer partial protection - reflecting thousands of years of co-evolution

3. Epidemiology

  • Geography: P. falciparum predominates in sub-Saharan Africa, New Guinea, and Hispaniola. P. vivax predominates in Central/South America and most of Asia. P. malariae is found in most endemic areas. P. knowlesi is restricted to Southeast Asia
  • Burden: 85 endemic countries; predominantly affects children <5 years old in sub-Saharan Africa
  • Transmission patterns: Stable (year-round, intense, e.g. coastal West Africa) vs. Unstable (seasonal/epidemic, all age groups susceptible)
  • Resistance trends: The WHO World Malaria Report 2025 highlights artemisinin partial resistance now confirmed or suspected in at least 8 African countries - the most important current threat to malaria control

4. Clinical Features

Uncomplicated Malaria

  • Incubation period: 7-30 days (longer with P. malariae)
  • Prodrome: Headache, myalgia, anorexia, fatigue
  • Classic malarial paroxysm (3 stages):
    1. Cold stage: Rigors, shivering (1-2 h)
    2. Hot stage: Fever 39-41°C, headache, nausea (2-6 h)
    3. Sweating stage: Drenching sweats, defervescence, fatigue
  • Fever periodicity (corresponds to schizont rupture):
    • Every 24 h (quotidian) - P. knowlesi
    • Every 48 h (tertian) - P. falciparum, P. vivax, P. ovale
    • Every 72 h (quartan) - P. malariae
    • Note: Periodicity is unreliable, especially in P. falciparum
  • Splenomegaly: Almost universal in endemic areas; "big spleen disease" in chronically infected individuals

Severe Malaria (mainly P. falciparum)

WHO criteria for severe falciparum malaria include:
ComplicationNotes
Cerebral malariaUnarousable coma (GCS < 11); most common in children; diffuse encephalopathy from sequestration and cytokines
Severe anemiaHb < 7 g/dL; commonest in children in high-transmission areas
Acute renal failure"Blackwater fever" = massive intravascular hemolysis + hemoglobinuria + renal failure; mainly in adults
Acute pulmonary edema / ARDSHigh mortality; more common in adults and pregnant women; can worsen with over-hydration
HypoglycemiaVery common in children and pregnant women; caused by parasite glucose consumption and quinine-induced hyperinsulinemia
Metabolic lactic acidosisMajor cause of death; from sequestration impairing tissue perfusion
Algid malariaSepticemic shock presentation
Abnormal bleeding / DICRare but serious
Hyperparasitemia>5% infected RBCs; high fatality risk
ConvulsionsEspecially in children
Complications vary by patient group (from Harrison's Table 231-4):
  • Children: Anemia, convulsions, hypoglycemia predominate
  • Adults: Jaundice, renal failure more prominent
  • Pregnant women: All complications amplified, especially hypoglycemia and pulmonary edema; fetal loss, low birth weight common

5. Diagnosis

Gold Standard: Blood Smear Microscopy

  • Thick smear: Screening - more sensitive for detecting parasites
  • Thin smear: Species identification, parasite count, morphology
  • Repeat smears every 12-24 h if initial negative but suspicion high

Rapid Diagnostic Tests (RDTs)

  • Detect malaria antigens (HRP-2 for P. falciparum; pLDH for all species)
  • Fast (15-20 min), no microscopy needed
  • Note: HRP-2 deletions in P. falciparum in some regions may give false-negative RDTs

PCR

  • Most sensitive; can detect mixed infections and low-density parasitemia
  • Used for research, surveillance, and when other tests ambiguous

Other Labs

  • FBC: Anemia, thrombocytopenia (almost universal in malaria)
  • Blood film: May show hemolytic picture (raised bilirubin, raised LDH, reduced haptoglobin)
  • Renal function, glucose, lactate (assess severity)
  • Peripheral blood smear findings by species:
SpeciesSmear Findings
P. falciparumRing forms only (schizonts sequestered); multiple rings per RBC; "appliqué" forms; banana-shaped gametocytes
P. vivaxEnlarged RBCs; Schüffner's dots; ameboid trophozoites; all stages present
P. ovaleEnlarged, oval-fimbriated RBCs; Schüffner's dots
P. malariae"Band-form" trophozoites; rosette schizonts; normal-sized RBCs
P. knowlesiResembles P. malariae on smear - PCR needed to distinguish

6. Treatment

Uncomplicated P. falciparum (or Unknown Species from Endemic Area)

First-line: Artemisinin-Based Combination Therapy (ACT)
ACT consists of an artemisinin derivative (artesunate, artemether, or dihydroartemisinin) combined with a longer-acting partner drug in a 3-day regimen. Recommended ACTs include:
  • Artemether-lumefantrine (Coartem) - the only ACT approved in the USA; widely used in Africa
  • Artesunate-amodiaquine - common in Africa
  • Artesunate-mefloquine - used in Southeast Asia
  • Dihydroartemisinin-piperaquine - effective but P. falciparum resistance emerging in SE Asia
In chloroquine-sensitive areas (Central America, Caribbean, parts of Middle East):
  • Chloroquine phosphate remains effective

P. vivax / P. ovale Treatment

  1. Chloroquine for blood-stage parasites (where sensitive)
  2. Primaquine or tafenoquine to eradicate hypnozoites and prevent relapse
    • Check G6PD status before primaquine/tafenoquine - can cause severe hemolysis in G6PD deficiency
    • Contraindicated in pregnancy

P. malariae

  • Chloroquine alone (no hypnozoites, no relapse concern)

Severe Malaria (Any Species)

  • IV artesunate - first-line globally; superior to quinine in trials (lower mortality, fewer side effects)
  • Quinine (IV) with doxycycline - alternative if artesunate unavailable
  • Important: Monitor blood glucose (hypoglycemia risk with quinine)
  • Manage complications: Fluids (cautiously), anticonvulsants, exchange transfusion for hyperparasitemia (controversial)

Drug Pharmacology Summary

Drug ClassMechanismKey DrugsNotes
ArtemisininsFree radical generation from endoperoxide bridge; kills all intraerythrocytic stagesArtesunate, artemether, dihydroartemisininShort half-life (used in combination); delayed hemolysis possible
AminoquinolinesConcentrate in parasite digestive vacuole; inhibit heme detoxification (prevent hemozoin formation)Chloroquine, amodiaquine, piperaquineChloroquine resistance via PfCRT mutation
AntifolatesInhibit dihydrofolate reductase (DHFR) and dihydropteroate synthase (DHPS)Pyrimethamine, sulfadoxine-pyrimethamineResistance common; used in IPT in pregnancy
8-AminoquinolinesKills hypnozoites and gametocytes; mechanism not fully clearPrimaquine, tafenoquineG6PD testing mandatory before use
NaphthoquinoneInhibits mitochondrial electron transport (Cyt bc1 complex)Atovaquone (with proguanil = Malarone)Used for treatment and prophylaxis; expensive
AntibioticsVarious; slow-actingDoxycycline, clindamycinUsed as partner drugs; not monotherapy

7. Prevention & Prophylaxis

Personal Protection

  • Insecticide-treated bed nets (ITNs) - highly effective
  • Residual indoor spraying (IRS) with insecticides
  • Repellents (DEET, picaridin)
  • Protective clothing

Chemoprophylaxis for Travelers

Choice depends on destination and resistance pattern:
  • Atovaquone-proguanil (Malarone): Daily; good for short trips; excellent tolerability
  • Doxycycline: Daily; cheap; photosensitivity and GI side effects; good for SE Asia
  • Mefloquine: Weekly; not recommended in areas with mefloquine-resistant P. falciparum (SE Asia); neuropsychiatric side effects in some
  • Chloroquine: Weekly; only for chloroquine-sensitive areas (limited use)

Intermittent Preventive Treatment (IPT)

  • IPTp (in pregnancy): Sulfadoxine-pyrimethamine at each antenatal visit; reduces maternal malaria and low birth weight
  • IPTi (in infants): SP at immunization contacts
  • SMC (Seasonal Malaria Chemoprevention): Amodiaquine + SP monthly in children during high-transmission season in the Sahel

Vaccines

  • RTS,S/AS01 (Mosquirix) and R21/Matrix-M: Pre-erythrocytic vaccines targeting circumsporozoite protein; WHO-recommended for children in high-transmission areas. The November 2024 WHO guidelines update includes updated recommendations on malaria vaccines. Efficacy is moderate (~36-75% reduction in clinical malaria in trials) but significant public health impact when combined with other measures.

8. Complications in Detail

Cerebral Malaria

  • Unarousable coma; more common in African children
  • CT/MRI may show cerebral edema
  • High mortality (~15-30% even with treatment); neurological sequelae in survivors (up to 25% of children)
  • Pathology: Sequestration of parasitized RBCs in cerebral microvessels; Durck granulomas (ring hemorrhages) on autopsy

Malarial Anemia

  • Multifactorial: Hemolysis of infected and uninfected RBCs, bone marrow dyserythropoiesis, increased splenic clearance
  • Severe anemia (Hb <7 g/dL) is a leading cause of death in children

Pulmonary Complications

  • From minimal cough to ARDS
  • Bilateral pulmonary edema visible on CXR (resembles cardiogenic edema)
  • Children, pregnant women, non-immune travelers most susceptible
  • Alveolar macrophages may contain hemozoin

Renal Failure

  • Acute tubular necrosis; "blackwater fever" (massive hemolysis + hemoglobinuria)
  • More common in adults; responds to dialysis

Malaria in Pregnancy

  • P. falciparum accumulates in the placenta via CSA (chondroitin sulfate A) binding of infected RBCs
  • Causes: Fetal growth restriction, low birth weight, premature labor, stillbirth, maternal death
  • Primigravid and secundigravid women most at risk in high-transmission settings
  • Congenital malaria: <5% of neonates of infected mothers

9. Antimicrobial Resistance (Current Threat)

This is the most pressing clinical challenge in malaria today:
  • Artemisinin partial resistance: Emerging in sub-Saharan Africa (Rwanda, Uganda, Eritrea) - due to kelch13 gene mutations (K13 propeller domain); manifests as delayed parasite clearance
  • ACT partner drug resistance: Resistance to piperaquine (combined with dihydroartemisinin) in SE Asia causes high treatment failure rates
  • Chloroquine resistance: Near-universal in P. falciparum outside Central America/Caribbean; mediated by PfCRT (chloroquine resistance transporter) mutations
  • Antifolate resistance: Widespread DHFR and DHPS mutations
Recent systematic reviews highlight ongoing spread of artemisinin resistance markers across Africa (PMID 39769406; PMID 38574550). The WHO World Malaria Report 2025 calls this the most serious current threat to malaria control progress.

10. Quick Summary: Species Comparison

FeatureP. falciparumP. vivaxP. ovaleP. malariaeP. knowlesi
Fever periodicity48 h (tertian)48 h48 h72 h (quartan)24 h
HypnozoitesNoYesYesNoNo
RBC preferenceAll agesReticulocytesReticulocytesOld RBCsAll ages
Max parasitemiaVery highModerateLowLowHigh
Severity++++++++++++
Geographic focusAfricaAmericas, AsiaAfricaWorldwideSE Asia
Chloroquine sensitivityResistant (mostly)Sensitive (mostly)SensitiveSensitiveSensitive

Key references:
  • Harrison's Principles of Internal Medicine 22E (2025), Chapter 231 "Malaria," pp. 1804-1876
  • Goldman-Cecil Medicine, Chapter 316 "Antimalarial Drug Treatment," pp. 3380-3381
  • Robbins & Kumar Basic Pathology, Chapter 10, pp. 392-393
  • Murray & Nadel's Textbook of Respiratory Medicine, Chapter 58, p. 1352
  • WHO World Malaria Report 2025 - highlights artemisinin resistance threat
  • WHO Guidelines for Malaria, updated August 2025

Make a presentation on severe malaria management for clinical staff

Reading File
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/severe-malaria-pptx && ls /tmp/workspace/severe-malaria-pptx

Writing File

~/severe-malaria-pptx/build_pptx.py

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.enum.dml import MSO_THEME_COLOR
from pptx.oxml.ns import qn
from pptx.util import Inches, Pt
import copy
from lxml import etree
from io import BytesIO

# ── Colour Palette ────────────────────────────────────────────────
C_DARK_RED   = RGBColor(0xB0, 0x1E, 0x28)   # deep red – header bars
C_MID_RED    = RGBColor(0xD9, 0x3A, 0x2F)   # medium red – accents
C_LIGHT_RED  = RGBColor(0xF9, 0xE8, 0xE8)   # pale red tint – content bg
C_WHITE      = RGBColor(0xFF, 0xFF, 0xFF)
C_DARK_GRAY  = RGBColor(0x1A, 0x1A, 0x2E)   # near-black text
C_MID_GRAY   = RGBColor(0x4A, 0x4A, 0x6A)
C_LIGHT_GRAY = RGBColor(0xF4, 0xF4, 0xF8)
C_ORANGE     = RGBColor(0xE8, 0x6A, 0x1A)   # warning accent
C_GREEN      = RGBColor(0x1A, 0x7A, 0x40)   # safe/good accent
C_YELLOW_BG  = RGBColor(0xFF, 0xF5, 0xCC)
C_TABLE_HEAD = RGBColor(0x7B, 0x0D, 0x14)

prs = Presentation()
prs.slide_width  = Inches(13.333)
prs.slide_height = Inches(7.5)
blank = prs.slide_layouts[6]

# ── Helper functions ──────────────────────────────────────────────

def solid_bg(slide, color):
    bg = slide.background
    bg.fill.solid()
    bg.fill.fore_color.rgb = color

def add_rect(slide, left, top, width, height, fill_color, line_color=None, line_width_pt=0):
    from pptx.util import Pt as pPt
    shape = slide.shapes.add_shape(1, left, top, width, height)  # MSO_SHAPE.RECTANGLE
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill_color
    if line_color:
        shape.line.color.rgb = line_color
        shape.line.width = Pt(line_width_pt)
    else:
        shape.line.fill.background()
    return shape

def add_textbox(slide, left, top, width, height, text, font_size, bold=False,
                color=None, align=PP_ALIGN.LEFT, italic=False, word_wrap=True,
                v_anchor=MSO_ANCHOR.TOP, margin_l=Inches(0.1), margin_t=Inches(0.05)):
    tb = slide.shapes.add_textbox(left, top, width, height)
    tf = tb.text_frame
    tf.word_wrap = word_wrap
    tf.vertical_anchor = v_anchor
    tf.margin_left = margin_l
    tf.margin_top = margin_t
    tf.margin_right = Inches(0.05)
    tf.margin_bottom = Inches(0.05)
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(font_size)
    run.font.bold = bold
    run.font.italic = italic
    if color:
        run.font.color.rgb = color
    return tb

def add_bullet_textbox(slide, left, top, width, height, items, font_size=13,
                       color=None, bullet_char="▸", indent=0.18,
                       line_spacing_pt=None, title=None, title_size=14):
    from pptx.oxml import parse_xml
    from pptx.oxml.ns import nsmap
    tb = slide.shapes.add_textbox(left, top, width, height)
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Inches(0.1)
    tf.margin_top = Inches(0.06)
    tf.margin_right = Inches(0.1)
    tf.margin_bottom = Inches(0.06)

    first = True
    if title:
        p = tf.paragraphs[0] if first else tf.add_paragraph()
        first = False
        p.alignment = PP_ALIGN.LEFT
        r = p.add_run()
        r.text = title
        r.font.bold = True
        r.font.size = Pt(title_size)
        if color:
            r.font.color.rgb = color

    for item in items:
        p = tf.paragraphs[0] if (first and not title) else tf.add_paragraph()
        first = False
        p.alignment = PP_ALIGN.LEFT
        # indentation
        p.level = 0
        pPr = p._pPr
        if pPr is None:
            pPr = p._p.get_or_add_pPr()
        from pptx.oxml.ns import qn as _qn
        buNone_el = pPr.find(_qn('a:buNone'))
        if buNone_el is not None:
            pPr.remove(buNone_el)
        r = p.add_run()
        r.text = f"{bullet_char}  {item}"
        r.font.size = Pt(font_size)
        if color:
            r.font.color.rgb = color
        if line_spacing_pt:
            from pptx.oxml.ns import qn as _qn
            lnSpc = etree.SubElement(pPr, _qn('a:lnSpc'))
            spcPts = etree.SubElement(lnSpc, _qn('a:spcPts'))
            spcPts.set('val', str(int(line_spacing_pt * 100)))
    return tb

def header_bar(slide, title, subtitle=None):
    # Dark red top bar
    add_rect(slide, 0, 0, prs.slide_width, Inches(1.15), C_DARK_RED)
    # Thin accent line below header
    add_rect(slide, 0, Inches(1.15), prs.slide_width, Inches(0.06), C_MID_RED)
    # Title text
    add_textbox(slide, Inches(0.4), Inches(0.1), Inches(12.5), Inches(0.7),
                title, 28, bold=True, color=C_WHITE, align=PP_ALIGN.LEFT,
                v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.15))
    if subtitle:
        add_textbox(slide, Inches(0.4), Inches(0.72), Inches(12.5), Inches(0.38),
                    subtitle, 13, bold=False, color=RGBColor(0xFF, 0xCC, 0xCC),
                    align=PP_ALIGN.LEFT, margin_l=Inches(0.15))

def footer_bar(slide, note="Source: Harrison's 22E · WHO Guidelines 2025 · Goldman-Cecil Medicine"):
    add_rect(slide, 0, Inches(7.18), prs.slide_width, Inches(0.32), C_DARK_GRAY)
    add_textbox(slide, Inches(0.3), Inches(7.19), Inches(12.7), Inches(0.3),
                note, 8, color=RGBColor(0xBB, 0xBB, 0xCC),
                align=PP_ALIGN.LEFT, margin_l=Inches(0.1), margin_t=Inches(0.02))

def section_card(slide, left, top, width, height, heading, items, heading_color=C_DARK_RED,
                 bg_color=C_LIGHT_RED, font_size=12.5, heading_size=13.5, bullet="▸"):
    add_rect(slide, left, top, width, Inches(0.38), heading_color)
    add_textbox(slide, left + Inches(0.1), top, width - Inches(0.2), Inches(0.38),
                heading, heading_size, bold=True, color=C_WHITE,
                v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.1), margin_t=0)
    add_rect(slide, left, top + Inches(0.38), width, height - Inches(0.38), bg_color)
    add_bullet_textbox(slide, left + Inches(0.1), top + Inches(0.42),
                       width - Inches(0.2), height - Inches(0.5),
                       items, font_size=font_size, color=C_DARK_GRAY, bullet_char=bullet)

# ════════════════════════════════════════════════════════════════════
# SLIDE 1 – Title Slide
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_DARK_GRAY)

# Big red accent bar left side
add_rect(slide, 0, 0, Inches(0.5), prs.slide_height, C_DARK_RED)
add_rect(slide, Inches(0.5), 0, Inches(0.12), prs.slide_height, C_MID_RED)

# Central content
add_textbox(slide, Inches(1.2), Inches(1.4), Inches(11), Inches(0.7),
            "SEVERE MALARIA", 46, bold=True, color=C_WHITE,
            align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE)
add_rect(slide, Inches(1.2), Inches(2.18), Inches(6), Inches(0.07), C_MID_RED)
add_textbox(slide, Inches(1.2), Inches(2.3), Inches(11), Inches(0.55),
            "Recognition, Assessment & Management", 22, bold=False,
            color=RGBColor(0xFF, 0xCC, 0xCC), align=PP_ALIGN.LEFT)
add_textbox(slide, Inches(1.2), Inches(2.95), Inches(10), Inches(0.45),
            "A Clinical Practice Guide for Healthcare Professionals", 14,
            color=RGBColor(0xAA, 0xAA, 0xBB), align=PP_ALIGN.LEFT, italic=True)

# Key stats box
add_rect(slide, Inches(1.2), Inches(3.7), Inches(10.8), Inches(1.55),
         RGBColor(0x2A, 0x2A, 0x44))
add_textbox(slide, Inches(1.4), Inches(3.82), Inches(3.2), Inches(0.4),
            "249 million", 26, bold=True, color=C_MID_RED)
add_textbox(slide, Inches(1.4), Inches(4.22), Inches(3.2), Inches(0.45),
            "cases globally (2022)", 12, color=RGBColor(0xCC, 0xCC, 0xDD))

add_rect(slide, Inches(4.8), Inches(3.82), Inches(0.04), Inches(1.1), RGBColor(0x55, 0x55, 0x77))
add_textbox(slide, Inches(5.1), Inches(3.82), Inches(3.2), Inches(0.4),
            "608,000", 26, bold=True, color=C_ORANGE)
add_textbox(slide, Inches(5.1), Inches(4.22), Inches(3.2), Inches(0.45),
            "deaths/year (~1,660/day)", 12, color=RGBColor(0xCC, 0xCC, 0xDD))

add_rect(slide, Inches(8.5), Inches(3.82), Inches(0.04), Inches(1.1), RGBColor(0x55, 0x55, 0x77))
add_textbox(slide, Inches(8.8), Inches(3.82), Inches(3.2), Inches(0.4),
            "P. falciparum", 22, bold=True, color=RGBColor(0xFF, 0xCC, 0xCC), italic=True)
add_textbox(slide, Inches(8.8), Inches(4.22), Inches(3.2), Inches(0.45),
            "responsible for most deaths", 12, color=RGBColor(0xCC, 0xCC, 0xDD))

add_textbox(slide, Inches(1.2), Inches(5.5), Inches(10), Inches(0.4),
            "WHO 2025  |  Harrison's Principles of Internal Medicine 22E  |  Goldman-Cecil Medicine",
            10, color=RGBColor(0x88, 0x88, 0x99), italic=True)

# ════════════════════════════════════════════════════════════════════
# SLIDE 2 – WHO Criteria for Severe Malaria
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "WHO Criteria for Severe Malaria",
           "Any ONE of the following in a patient with confirmed malaria = Severe Disease → Admit to HDU/ICU")
footer_bar(slide)

criteria_left = [
    "Unarousable coma (GCS < 11) – Cerebral malaria",
    "Prostration / extreme weakness",
    "Multiple convulsions (>2 in 24 h)",
    "Respiratory distress / deep breathing (acidotic breathing)",
    "Acute pulmonary oedema / ARDS",
    "Circulatory collapse / shock (algid malaria)",
]
criteria_right = [
    "Abnormal bleeding / DIC",
    "Jaundice + evidence of vital organ dysfunction",
    "Haemoglobinuria (blackwater fever)",
    "Severe anaemia (Hb < 7 g/dL)",
    "Hypoglycaemia (BGL < 2.2 mmol/L)",
    "Hyperparasitaemia (>5% infected RBCs)",
    "Acute kidney injury (creatinine > 265 µmol/L)",
]

section_card(slide, Inches(0.3), Inches(1.3), Inches(6.2), Inches(5.5),
             "Clinical / Neurological", criteria_left, font_size=12.5)
section_card(slide, Inches(6.7), Inches(1.3), Inches(6.3), Inches(5.5),
             "Metabolic / Laboratory", criteria_right, font_size=12.5)

# Red warning box at bottom
add_rect(slide, Inches(0.3), Inches(6.75), Inches(12.7), Inches(0.34),
         RGBColor(0xFF, 0xF0, 0xC8))
add_textbox(slide, Inches(0.45), Inches(6.76), Inches(12.4), Inches(0.33),
            "⚠  If uncertain, treat as severe — delay is fatal. Most deaths in non-endemic countries are due to delayed diagnosis.",
            11, bold=True, color=RGBColor(0x7A, 0x4A, 0x00))

# ════════════════════════════════════════════════════════════════════
# SLIDE 3 – Immediate Assessment
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Immediate Assessment on Presentation",
           "Parallel assessment and management — do not wait for all results before starting treatment")
footer_bar(slide)

# 3-column layout
cols = [
    ("HISTORY", [
        "Travel to endemic region (dates, locations)",
        "Symptoms onset & duration",
        "Prior malaria / antimalarial prophylaxis",
        "Pregnancy status",
        "HIV / immunosuppression status",
        "G6PD deficiency history",
    ]),
    ("EXAMINATION", [
        "GCS / conscious level",
        "Vital signs: HR, BP, RR, SpO₂, Temp",
        "Signs of jaundice / hepatomegaly",
        "Splenomegaly",
        "Respiratory signs (crackles, work of breathing)",
        "Urinary output / colour (haemoglobinuria?)",
    ]),
    ("URGENT INVESTIGATIONS", [
        "Thick & thin blood films (STAT)",
        "Malaria RDT if microscopy delayed",
        "FBC, blood film, reticulocytes",
        "U&E, creatinine, LFTs, bilirubin",
        "Blood glucose (repeat 1-2 hourly)",
        "Blood cultures (bacteraemia in 6% of children)",
        "Lactate, ABG/VBG",
        "Coagulation screen",
        "Urinalysis + urine output",
    ]),
]

col_width = Inches(4.1)
for i, (heading, items) in enumerate(cols):
    left = Inches(0.25) + i * (col_width + Inches(0.12))
    section_card(slide, left, Inches(1.3), col_width, Inches(5.6),
                 heading, items, font_size=11.5, heading_size=13)

# ════════════════════════════════════════════════════════════════════
# SLIDE 4 – First-Line Treatment (Pharmacotherapy)
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "First-Line Pharmacotherapy: IV Artesunate",
           "IV artesunate is superior to quinine for severe malaria — lower mortality, faster parasite clearance, better tolerability")
footer_bar(slide)

# Main big card – IV Artesunate
add_rect(slide, Inches(0.3), Inches(1.3), Inches(7.8), Inches(5.6), C_LIGHT_RED)
add_rect(slide, Inches(0.3), Inches(1.3), Inches(7.8), Inches(0.42), C_DARK_RED)
add_textbox(slide, Inches(0.45), Inches(1.3), Inches(7.5), Inches(0.42),
            "FIRST-LINE:  IV Artesunate", 15, bold=True, color=C_WHITE,
            v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.1), margin_t=0)

artesunate_details = [
    ("Dose", "2.4 mg/kg IV at 0, 12, 24 h — then every 24 h (max 7 days)"),
    ("Paediatric", "2.4 mg/kg IV (same weight-based dose as adults)"),
    ("Pregnancy", "IV artesunate preferred in 2nd/3rd trimester"),
    ("Duration", "Minimum 24 h IV, then switch to oral ACT (e.g. artemether-lumefantrine) to complete 3-day course"),
    ("Monitoring", "Glucose every 1–2 h; parasite count every 12–24 h; haematology at 28 days (delayed haemolysis)"),
    ("Key SE", "Delayed haemolytic anaemia (post-treatment days 7–30) — check Hb at 28 days post-treatment"),
]
y_pos = Inches(1.82)
for label, detail in artesunate_details:
    add_rect(slide, Inches(0.4), y_pos, Inches(1.5), Inches(0.56), RGBColor(0xD9, 0x3A, 0x2F))
    add_textbox(slide, Inches(0.42), y_pos + Inches(0.04), Inches(1.46), Inches(0.5),
                label, 11, bold=True, color=C_WHITE, v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.06), margin_t=0)
    add_rect(slide, Inches(1.9), y_pos, Inches(6.0), Inches(0.56), RGBColor(0xFC, 0xF0, 0xF0))
    add_textbox(slide, Inches(2.0), y_pos + Inches(0.04), Inches(5.9), Inches(0.5),
                detail, 11, color=C_DARK_GRAY, v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.06), margin_t=0)
    y_pos += Inches(0.62)

# Right side – alternative & special notes
right_x = Inches(8.4)
add_rect(slide, right_x, Inches(1.3), Inches(4.6), Inches(2.6), RGBColor(0xFD, 0xF5, 0xE8))
add_rect(slide, right_x, Inches(1.3), Inches(4.6), Inches(0.38), C_ORANGE)
add_textbox(slide, right_x + Inches(0.1), Inches(1.3), Inches(4.4), Inches(0.38),
            "IF IV ARTESUNATE UNAVAILABLE", 12, bold=True, color=C_WHITE,
            v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.1), margin_t=0)
add_bullet_textbox(slide, right_x + Inches(0.1), Inches(1.72), Inches(4.4), Inches(2.1),
    [
        "IV Quinine: 20 mg/kg loading dose over 4 h → 10 mg/kg every 8 h",
        "Give with doxycycline or clindamycin (pregnant/children)",
        "Monitor ECG (QTc prolongation, hypoglycaemia)",
        "IM artemether: 3.2 mg/kg loading, then 1.6 mg/kg daily — if IV unavailable",
    ], font_size=11, color=C_DARK_GRAY)

add_rect(slide, right_x, Inches(4.1), Inches(4.6), Inches(2.7), RGBColor(0xE8, 0xF8, 0xEE))
add_rect(slide, right_x, Inches(4.1), Inches(4.6), Inches(0.38), C_GREEN)
add_textbox(slide, right_x + Inches(0.1), Inches(4.1), Inches(4.4), Inches(0.38),
            "PRE-REFERRAL (LIMITED SETTINGS)", 12, bold=True, color=C_WHITE,
            v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.1), margin_t=0)
add_bullet_textbox(slide, right_x + Inches(0.1), Inches(4.52), Inches(4.4), Inches(2.2),
    [
        "Rectal artesunate (10 mg/kg) — if parenteral route unavailable",
        "Single pre-referral dose buys time; refer urgently",
        "Do NOT delay transfer for full treatment course",
        "WHO recommends pre-referral artesunate in children under 6",
    ], font_size=11, color=C_DARK_GRAY)

# ════════════════════════════════════════════════════════════════════
# SLIDE 5 – Cerebral Malaria Management
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Cerebral Malaria: Recognition & Management",
           "Unarousable coma (GCS <11) in confirmed malaria — most common in children in sub-Saharan Africa")
footer_bar(slide)

add_rect(slide, Inches(0.3), Inches(1.28), Inches(12.7), Inches(0.38),
         RGBColor(0xFF, 0xF3, 0xCD))
add_textbox(slide, Inches(0.5), Inches(1.28), Inches(12.3), Inches(0.38),
            "⚠  Rule out hypoglycaemia FIRST — check BGL immediately in every comatose malaria patient",
            12, bold=True, color=RGBColor(0x7A, 0x4A, 0x00), v_anchor=MSO_ANCHOR.MIDDLE)

recog_items = [
    "Unarousable coma: no purposeful response to pain",
    "Exclude other causes: hypoglycaemia, meningitis, encephalitis",
    "Fundoscopy: malarial retinopathy (pathognomonic) — whitening, vessel changes, haemorrhages",
    "Seizures may precede coma (esp. children)",
    "Prognosis: ~15–25% mortality even with treatment; up to 25% neurological sequelae in children",
]
mgmt_items = [
    "START IV artesunate IMMEDIATELY — do not wait for LP",
    "Secure airway — intubate if GCS ≤8 or airway unprotected",
    "IV access × 2; blood glucose STAT — treat hypoglycaemia with 50% dextrose IV",
    "Maintain lateral decubitus position; seizure precautions",
    "Treat seizures: IV diazepam 0.15 mg/kg or lorazepam (NOT prophylactic phenobarbitone)",
    "Avoid dexamethasone — HARMFUL in cerebral malaria (increases coma duration, GI bleeding)",
    "Monitor GCS hourly; parasite count 12–24 hourly",
    "Fever control: paracetamol (tepid sponging); avoid NSAIDs",
    "Fluid management: cautious (avoid pulmonary oedema)",
]

section_card(slide, Inches(0.3), Inches(1.75), Inches(5.6), Inches(5.05),
             "RECOGNITION", recog_items, font_size=12)
section_card(slide, Inches(6.1), Inches(1.75), Inches(6.9), Inches(5.05),
             "MANAGEMENT PRIORITIES", mgmt_items, font_size=11.5)

# ════════════════════════════════════════════════════════════════════
# SLIDE 6 – Complication Management
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Managing Key Complications",
           "Anticipate and proactively manage — many complications develop or worsen during treatment")
footer_bar(slide)

comp_data = [
    ("SEVERE ANAEMIA\n(Hb < 7 g/dL)", C_DARK_RED, [
        "Transfuse: Hb <7 (or <10 if respiratory distress)",
        "Use leuco-depleted, screened blood",
        "Children: 10 mL/kg packed RBCs over 3–4 h",
        "Monitor for fluid overload",
    ]),
    ("HYPOGLYCAEMIA\n(BGL < 2.2 mmol/L)", C_DARK_RED, [
        "50% dextrose 1 mL/kg IV (children: 2 mL/kg of 10%)",
        "Follow with 10% dextrose infusion",
        "Monitor glucose 1–2 hourly (esp. with quinine)",
        "Quinine stimulates insulin → refractory hypoglycaemia",
    ]),
    ("PULMONARY OEDEMA / ARDS", C_DARK_RED, [
        "Prop up 45°; restrict IV fluids aggressively",
        "High-flow O₂ → CPAP/NIV → intubation if needed",
        "Furosemide only if fluid overloaded",
        "Mortality >50% — early ITU involvement essential",
    ]),
    ("ACUTE KIDNEY INJURY", C_DARK_RED, [
        "Strict fluid balance; avoid nephrotoxins",
        "Haemofiltration/dialysis for oliguria unresponsive to fluids",
        "'Blackwater fever': IV fluids + prompt dialysis",
        "Avoid ACE inhibitors; dose-adjust all renally-cleared drugs",
    ]),
    ("METABOLIC ACIDOSIS", C_DARK_RED, [
        "Treat underlying cause: anaemia, hypovolaemia, sepsis",
        "Fluids cautiously — boluses of 10 mL/kg crystalloid",
        "Bicarbonate NOT recommended (treat cause)",
        "Lactate >5 mmol/L = very high mortality risk",
    ]),
    ("HYPERPARASITAEMIA\n(> 5%)", C_DARK_RED, [
        "IV artesunate clears parasites rapidly",
        "Exchange transfusion: controversial, not routinely recommended",
        "Monitor parasite count 12-hourly",
        "Consider ITU transfer urgently",
    ]),
]

cols_per_row = 3
card_w = Inches(4.1)
card_h = Inches(2.5)
gap = Inches(0.15)
for idx, (heading, hcolor, items) in enumerate(comp_data):
    row = idx // cols_per_row
    col = idx % cols_per_row
    left = Inches(0.25) + col * (card_w + gap)
    top  = Inches(1.32) + row * (card_h + gap)
    section_card(slide, left, top, card_w, card_h, heading, items,
                 heading_color=hcolor, font_size=11, heading_size=12)

# ════════════════════════════════════════════════════════════════════
# SLIDE 7 – Malaria in Pregnancy
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Severe Malaria in Pregnancy",
           "High-risk group — complications are amplified; fetal loss, pulmonary oedema, hypoglycaemia especially common")
footer_bar(slide)

risks = [
    "Primigravid & secundigravid most susceptible in stable transmission areas",
    "P. falciparum accumulates in placenta via CSA binding",
    "Fetal growth restriction, preterm labour, stillbirth, low birth weight",
    "Hypoglycaemia more frequent and severe (parasite + quinine effect)",
    "Pulmonary oedema risk greatly increased",
    "Maternal mortality from anaemia, haemorrhage, severe infection",
    "Congenital malaria in <5% of neonates of infected mothers",
    "HIV co-infection amplifies all risks",
]
treatment = [
    "IV artesunate: PREFERRED in 2nd and 3rd trimester",
    "1st trimester: IV artesunate still preferred if benefits outweigh risk (WHO 2024)",
    "Quinine + clindamycin: alternative if artesunate unavailable",
    "Monitor blood glucose every 1–2 h (hypoglycaemia very common)",
    "Careful fluid management — very low threshold for pulmonary oedema",
    "Fetal monitoring: cardiotocography if viable fetus",
    "Do NOT use primaquine or tafenoquine (haemolytic in fetus)",
    "Doxycycline CONTRAINDICATED in pregnancy — use clindamycin",
    "Delivery: only if necessary for maternal condition; malaria itself not indication for C/S",
]

section_card(slide, Inches(0.3), Inches(1.3), Inches(5.8), Inches(5.6),
             "RISKS & COMPLICATIONS", risks, font_size=12)
section_card(slide, Inches(6.3), Inches(1.3), Inches(6.7), Inches(5.6),
             "TREATMENT CONSIDERATIONS", treatment, font_size=12)

# ════════════════════════════════════════════════════════════════════
# SLIDE 8 – Monitoring & Response to Treatment
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Monitoring & Response to Treatment",
           "Regular monitoring guides treatment decisions — parasitaemia should fall within 24–48 h of IV artesunate")
footer_bar(slide)

monitor_items = [
    ("PARAMETER", "FREQUENCY", "ACTION THRESHOLD"),
    ("Blood glucose", "Every 1–2 hours", "BGL < 2.2 mmol/L → IV dextrose STAT"),
    ("GCS / neurology", "Every 1 hour (comatose)", "No improvement in 48 h → CT / LP"),
    ("Parasite count", "Every 12–24 hours", ">5% at 48 h → review treatment / resistance"),
    ("Temperature", "Every 4 hours", "Persistent fever >72 h despite Rx → consider resistance"),
    ("Fluid balance / urine output", "Hourly (IDC)", "UO <0.5 mL/kg/h → assess for AKI"),
    ("FBC / Haemoglobin", "Daily then Day 7, 28", "Post-treatment Hb fall day 7–30 = delayed haemolysis"),
    ("Respiratory rate / SpO₂", "Every 1–2 hours", "SpO₂ <94% / RR rising → ARDS screen"),
    ("Blood pressure", "Every 1–4 hours", "MAP <65 → fluid bolus, vasopressors, sepsis screen"),
    ("LFTs / Bilirubin", "Every 24–48 hours", "Rising bilirubin + coagulopathy = poor prognosis"),
]

# Draw table
table_left = Inches(0.3)
table_top = Inches(1.32)
table_w = Inches(12.7)
row_h = Inches(0.53)
col_widths = [Inches(2.8), Inches(2.8), Inches(7.0)]

for r_idx, row in enumerate(monitor_items):
    y = table_top + r_idx * row_h
    for c_idx, (text, cw) in enumerate(zip(row, col_widths)):
        x = table_left + sum(col_widths[:c_idx])
        if r_idx == 0:
            bg = C_TABLE_HEAD
            fc = C_WHITE
            bold = True
            fsize = 12
        elif r_idx % 2 == 0:
            bg = RGBColor(0xEE, 0xEE, 0xF8)
            fc = C_DARK_GRAY
            bold = False
            fsize = 11
        else:
            bg = C_WHITE
            fc = C_DARK_GRAY
            bold = False
            fsize = 11
        add_rect(slide, x, y, cw, row_h, bg, line_color=RGBColor(0xCC, 0xCC, 0xDD), line_width_pt=0.5)
        add_textbox(slide, x + Inches(0.08), y + Inches(0.04), cw - Inches(0.12), row_h - Inches(0.08),
                    text, fsize, bold=bold, color=fc,
                    v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.06), margin_t=0)

# ════════════════════════════════════════════════════════════════════
# SLIDE 9 – Antimicrobial Resistance Alert
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Antimicrobial Resistance: A Growing Threat",
           "WHO World Malaria Report 2025: Artemisinin partial resistance now confirmed or suspected in ≥8 African countries")
footer_bar(slide)

add_rect(slide, Inches(0.3), Inches(1.28), Inches(12.7), Inches(0.45),
         RGBColor(0xFF, 0xEE, 0xCC))
add_textbox(slide, Inches(0.5), Inches(1.28), Inches(12.3), Inches(0.45),
            "⚠  If parasite clearance is delayed (>48–72 h on IV artesunate), consider partial artemisinin resistance — review travel history, consult infectious diseases",
            11.5, bold=True, color=RGBColor(0x7A, 0x4A, 0x00), v_anchor=MSO_ANCHOR.MIDDLE)

resist_types = [
    ("CHLOROQUINE RESISTANCE", C_DARK_RED, [
        "Near-universal in P. falciparum globally",
        "Mediated by PfCRT gene mutations",
        "Only use chloroquine in Central America / Caribbean",
        "P. vivax resistance in parts of SE Asia & Oceania",
    ]),
    ("ARTEMISININ PARTIAL RESISTANCE", C_DARK_RED, [
        "Kelch13 (K13) gene mutations — key marker",
        "Manifests as delayed parasite clearance (not full failure)",
        "Emerged in SE Asia; now spreading to Africa (Rwanda, Uganda, Eritrea)",
        "WHO 2025 report: declining ACT partner drug efficacy in some regions",
        "CLINICAL: Parasitaemia still present >48–72 h after IV artesunate",
    ]),
    ("CLINICAL RESPONSE TO RESISTANCE", C_DARK_RED, [
        "Do NOT switch from artesunate prematurely (still most effective available)",
        "Extend IV artesunate duration to 7 days if clearance delayed",
        "Add or switch partner drug if confirmed ACT failure",
        "Report suspected resistance to national health authority",
        "Travel history essential — note specific country/region",
        "Consult infectious diseases / tropical medicine specialist",
    ]),
]

cw = Inches(4.1)
gap = Inches(0.15)
for idx, (heading, hcolor, items) in enumerate(resist_types):
    left = Inches(0.25) + idx * (cw + gap)
    section_card(slide, left, Inches(1.82), cw, Inches(4.95),
                 heading, items, heading_color=hcolor, font_size=11.5)

# ════════════════════════════════════════════════════════════════════
# SLIDE 10 – Step-Down Oral Therapy & Discharge
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Step-Down Oral Therapy & Discharge Planning",
           "Switch to oral ACT once patient can tolerate oral medications and parasitaemia is falling")
footer_bar(slide)

stepdown = [
    ("STEP-DOWN CRITERIA", C_GREEN, [
        "Patient conscious and able to swallow",
        "Tolerating oral fluids / medications",
        "Parasitaemia falling (ideally <1%)",
        "No active severe complication",
        "Minimum 24 h of IV artesunate completed",
    ]),
    ("ORAL ACT REGIMENS", C_GREEN, [
        "Artemether-lumefantrine (Coartem): 6-dose regimen over 3 days with fatty food",
        "Dihydroartemisinin-piperaquine: 3-day regimen (once daily)",
        "Artesunate-mefloquine: used in SE Asia",
        "Complete full 3-day course regardless of symptom resolution",
    ]),
    ("HYPNOZOITE ERADICATION\n(P. vivax / P. ovale)", C_MID_RED, [
        "Must add anti-relapse therapy after blood-stage treatment",
        "Primaquine 0.25–0.5 mg/kg/day × 14 days",
        "Or tafenoquine (single dose) — adults only",
        "CHECK G6PD STATUS FIRST — can cause fatal haemolysis",
        "Contraindicated in pregnancy — defer until postpartum",
    ]),
]

cw2 = Inches(4.1)
for idx, (heading, hcolor, items) in enumerate(stepdown):
    left = Inches(0.25) + idx * (cw2 + gap)
    section_card(slide, left, Inches(1.3), cw2, Inches(4.2),
                 heading, items, heading_color=hcolor, font_size=12)

# Discharge checklist
add_rect(slide, Inches(0.25), Inches(5.65), Inches(12.7), Inches(0.38), C_DARK_RED)
add_textbox(slide, Inches(0.4), Inches(5.65), Inches(12.5), Inches(0.38),
            "DISCHARGE CHECKLIST", 13, bold=True, color=C_WHITE,
            v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.1), margin_t=0)
add_rect(slide, Inches(0.25), Inches(6.03), Inches(12.7), Inches(0.95), RGBColor(0xF0, 0xF8, 0xF0))
discharge_items = "  ✓ Full oral ACT course complete   ✓ Haemoglobin checked (and at Day 28)   ✓ G6PD tested (if vivax/ovale)   ✓ Written treatment summary   ✓ Return precautions explained   ✓ Notification to public health (notifiable disease)"
add_textbox(slide, Inches(0.4), Inches(6.06), Inches(12.4), Inches(0.9),
            discharge_items, 12, color=C_DARK_GRAY, word_wrap=True,
            margin_l=Inches(0.1), margin_t=Inches(0.05))

# ════════════════════════════════════════════════════════════════════
# SLIDE 11 – Paediatric Considerations
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_LIGHT_GRAY)
header_bar(slide, "Paediatric Considerations",
           "Children <5 years in sub-Saharan Africa bear the greatest malaria mortality burden — unique clinical features and dosing")
footer_bar(slide)

paed_l = [
    ("CLINICAL DIFFERENCES IN CHILDREN", C_DARK_RED, [
        "Severe anaemia more common than renal failure",
        "Convulsions very frequent (febrile seizures common)",
        "Hypoglycaemia more severe — monitor aggressively",
        "Cerebral malaria: worse neurological outcomes",
        "Respiratory distress from acidosis (not just pulmonary oedema)",
        "Rapid deterioration — reassess frequently",
        "Malaria commonly coexists with bacterial sepsis",
    ]),
    ("DOSING (WEIGHT-BASED)", C_DARK_RED, [
        "IV artesunate: 2.4 mg/kg (same as adults — weight-based)",
        "50% dextrose (hypoglycaemia): 1 mL/kg IV",
        "Diazepam (seizures): 0.15–0.3 mg/kg IV or 0.5 mg/kg rectal",
        "Paracetamol: 15 mg/kg every 4–6 h (fever)",
        "Blood transfusion: 10 mL/kg pRBCs over 3–4 h",
        "Pre-referral rectal artesunate: 10 mg/kg (if <6 years old)",
    ]),
]

for idx, (heading, hcolor, items) in enumerate(paed_l):
    left = Inches(0.3) + idx * (Inches(6.3) + gap)
    section_card(slide, left, Inches(1.3), Inches(6.3), Inches(5.6),
                 heading, items, heading_color=hcolor, font_size=12)

# ════════════════════════════════════════════════════════════════════
# SLIDE 12 – Quick Reference Summary
# ════════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
solid_bg(slide, C_DARK_GRAY)
# Top bar
add_rect(slide, 0, 0, prs.slide_width, Inches(1.0), C_DARK_RED)
add_rect(slide, 0, Inches(1.0), prs.slide_width, Inches(0.06), C_MID_RED)
add_textbox(slide, Inches(0.4), Inches(0.1), Inches(12.5), Inches(0.82),
            "SEVERE MALARIA: Quick Reference Card", 24, bold=True,
            color=C_WHITE, align=PP_ALIGN.LEFT, v_anchor=MSO_ANCHOR.MIDDLE,
            margin_l=Inches(0.15))

# 4 summary cards on dark background
summary_cards = [
    ("DIAGNOSE", C_DARK_RED, [
        "Blood film (thick + thin) — STAT",
        "RDT if microscopy delayed",
        "ANY 1 WHO severity criterion = Severe",
        "Check glucose immediately",
    ]),
    ("TREAT", RGBColor(0x7B, 0x1D, 0x1D), [
        "IV artesunate 2.4 mg/kg at 0, 12, 24 h",
        "Then every 24 h (min 24 h IV)",
        "Switch to oral ACT when tolerating",
        "Complete full 3-day oral course",
    ]),
    ("MONITOR", RGBColor(0x4A, 0x2A, 0x6A), [
        "Glucose every 1–2 h",
        "GCS hourly (if comatose)",
        "Parasite count every 12–24 h",
        "Daily Hb; check at Day 28",
    ]),
    ("AVOID", RGBColor(0x1A, 0x4A, 0x2A), [
        "✗ Dexamethasone (harmful in cerebral malaria)",
        "✗ Prophylactic anticonvulsants",
        "✗ Primaquine in pregnancy",
        "✗ Doxycycline in pregnancy",
        "✗ Excessive IV fluids (ARDS risk)",
    ]),
]

card_w3 = Inches(3.0)
for idx, (heading, hcolor, items) in enumerate(summary_cards):
    left = Inches(0.25) + idx * (card_w3 + Inches(0.15))
    top = Inches(1.2)
    h = Inches(5.8)
    add_rect(slide, left, top, card_w3, h, RGBColor(0x2A, 0x2A, 0x44))
    add_rect(slide, left, top, card_w3, Inches(0.45), hcolor)
    add_textbox(slide, left + Inches(0.1), top, card_w3, Inches(0.45),
                heading, 14, bold=True, color=C_WHITE,
                v_anchor=MSO_ANCHOR.MIDDLE, margin_l=Inches(0.1), margin_t=0)
    add_bullet_textbox(slide, left + Inches(0.12), top + Inches(0.5),
                       card_w3 - Inches(0.2), h - Inches(0.65),
                       items, font_size=12, color=RGBColor(0xDD, 0xDD, 0xEE),
                       bullet_char="▸")

footer_note = "Harrison's Principles of Internal Medicine 22E (2025)  ·  WHO Guidelines for Malaria (Aug 2025)  ·  Goldman-Cecil Medicine  ·  Katzung Pharmacology 16E"
add_rect(slide, 0, Inches(7.18), prs.slide_width, Inches(0.32), RGBColor(0x11, 0x11, 0x22))
add_textbox(slide, Inches(0.3), Inches(7.19), Inches(12.7), Inches(0.3),
            footer_note, 8, color=RGBColor(0x88, 0x88, 0x99),
            align=PP_ALIGN.CENTER, margin_l=Inches(0.1), margin_t=Inches(0.02))

# ── Save ────────────────────────────────────────────────────────────
out_path = "/tmp/workspace/severe-malaria-pptx/Severe_Malaria_Management.pptx"
buf = BytesIO()
prs.save(buf)
with open(out_path, "wb") as f:
    f.write(buf.getvalue())
print(f"Saved to {out_path}")
Running Command

cd /tmp/workspace/severe-malaria-pptx && python build_pptx.py 2>&1

Running Command

ls -lh /tmp/workspace/severe-malaria-pptx/Severe_Malaria_Management.pptx

Your presentation is ready:

Severe Malaria Management

Presentation · PPTX


What's in the deck (12 slides)

SlideContent
1. TitleGlobal burden stats (249M cases, 608K deaths) with dark red/charcoal design
2. WHO Severity CriteriaAll clinical + lab criteria laid out in two columns; warning box on delayed diagnosis
3. Immediate Assessment3-column layout: History / Examination / Urgent investigations
4. First-Line TreatmentIV artesunate dosing table (with dose, paediatric, pregnancy, monitoring); quinine fallback; pre-referral rectal artesunate
5. Cerebral MalariaRecognition checklist + management priorities; warning on dexamethasone (harmful)
6. Complication Management6-card grid: anaemia, hypoglycaemia, ARDS, AKI, acidosis, hyperparasitaemia
7. Malaria in PregnancyRisks + treatment modifications; G6PD note; contraindicated drugs
8. Monitoring Table9-parameter table with frequency and action thresholds
9. Antimicrobial ResistanceChloroquine resistance + artemisinin partial resistance (kelch13/K13); clinical response
10. Step-Down & DischargeOral ACT criteria + regimens; primaquine/tafenoquine for hypnozoites; discharge checklist
11. Paediatric ConsiderationsClinical differences in children + weight-based dosing
12. Quick Reference CardDark-background 4-card summary: Diagnose / Treat / Monitor / Avoid
Colour scheme: Deep red headers, pale red content cards, with orange/green safety callouts. All sourced from Harrison's 22E (2025), WHO Guidelines 2025, Goldman-Cecil Medicine, and Katzung Pharmacology 16E.
This is a shared conversation. Sign in to Orris to start your own chat.