attachment
attachment
attachment
attachment
attachment
attachment

Make a presentation ppt for copper poisoning with a neat visual representation

analyse_media
analyse_media
analyse_media
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/copper-poisoning && ls /tmp/workspace/

Writing File

~/copper-poisoning/create_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.util import Inches, Pt
import io

# ── Colour Palette ──────────────────────────────────────────────
COPPER       = RGBColor(0xB8, 0x73, 0x33)   # warm copper
DARK_COPPER  = RGBColor(0x7C, 0x46, 0x10)   # deep brown-copper
COPPER_LIGHT = RGBColor(0xF5, 0xD9, 0xB5)   # light copper tint
WHITE        = RGBColor(0xFF, 0xFF, 0xFF)
BLACK        = RGBColor(0x1A, 0x1A, 0x1A)
DARK_GRAY    = RGBColor(0x2D, 0x2D, 0x2D)
MID_GRAY     = RGBColor(0x55, 0x55, 0x55)
TEAL         = RGBColor(0x0D, 0x7C, 0x8C)
RED          = RGBColor(0xC0, 0x39, 0x2B)
GREEN        = RGBColor(0x27, 0x7A, 0x45)
AMBER        = RGBColor(0xE6, 0x7E, 0x22)
SLIDE_BG     = RGBColor(0xF9, 0xF4, 0xEE)   # warm off-white
ACCENT_BLUE  = RGBColor(0x2E, 0x86, 0xAB)

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

# ════════════════════════════════════════════════════════════════
# HELPER FUNCTIONS
# ════════════════════════════════════════════════════════════════

def fill_slide_bg(slide, color):
    from pptx.oxml.ns import qn
    from lxml import etree
    bg = slide.background
    fill = bg.fill
    fill.solid()
    fill.fore_color.rgb = color

def add_rect(slide, l, t, w, h, fill_color=None, line_color=None, line_width=0):
    shape = slide.shapes.add_shape(1, Inches(l), Inches(t), Inches(w), Inches(h))
    if fill_color:
        shape.fill.solid()
        shape.fill.fore_color.rgb = fill_color
    else:
        shape.fill.background()
    if line_color and line_width:
        shape.line.color.rgb = line_color
        shape.line.width = Pt(line_width)
    else:
        shape.line.fill.background()
    return shape

def add_text(slide, text, l, t, w, h,
             font_size=18, bold=False, color=BLACK,
             align=PP_ALIGN.LEFT, italic=False, wrap=True,
             v_anchor=MSO_ANCHOR.MIDDLE, font_name="Calibri"):
    tb = slide.shapes.add_textbox(Inches(l), Inches(t), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = wrap
    tf.vertical_anchor = v_anchor
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)
    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
    run.font.color.rgb = color
    run.font.name = font_name
    return tb

def add_multiline(slide, lines, l, t, w, h,
                  font_size=13, bold_first=False, color=BLACK,
                  bullet=False, line_spacing=1.1, font_name="Calibri",
                  first_color=None, first_size=None, align=PP_ALIGN.LEFT):
    """lines = list of str; first item can be a header if bold_first."""
    from pptx.util import Pt as _Pt
    from pptx.oxml.ns import qn
    from lxml import etree

    tb = slide.shapes.add_textbox(Inches(l), Inches(t), Inches(w), Inches(h))
    tf = tb.text_frame
    tf.word_wrap = True
    tf.margin_left = Pt(4)
    tf.margin_right = Pt(4)
    tf.margin_top = Pt(2)
    tf.margin_bottom = Pt(2)

    for i, line in enumerate(lines):
        p = tf.paragraphs[0] if i == 0 else tf.add_paragraph()
        p.alignment = align
        run = p.add_run()
        prefix = "• " if bullet and i > 0 else ("• " if bullet and i == 0 else "")
        run.text = prefix + line
        is_first = (i == 0 and bold_first)
        run.font.bold = is_first
        run.font.size = Pt(first_size if (is_first and first_size) else font_size)
        run.font.color.rgb = first_color if (is_first and first_color) else color
        run.font.name = font_name
    return tb

def add_circle(slide, cx, cy, r, fill_color, line_color=None):
    """cx, cy, r all in Inches."""
    shape = slide.shapes.add_shape(
        9,  # oval
        Inches(cx - r), Inches(cy - r),
        Inches(r * 2), Inches(r * 2)
    )
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill_color
    if line_color:
        shape.line.color.rgb = line_color
        shape.line.width = Pt(1.5)
    else:
        shape.line.fill.background()
    return shape

def add_rounded_rect(slide, l, t, w, h, fill_color, line_color=None, radius=0.1):
    from pptx.util import Emu
    shape = slide.shapes.add_shape(
        5,  # rounded rectangle
        Inches(l), Inches(t), Inches(w), Inches(h)
    )
    shape.adjustments[0] = radius
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill_color
    if line_color:
        shape.line.color.rgb = line_color
        shape.line.width = Pt(1.5)
    else:
        shape.line.fill.background()
    return shape


# ════════════════════════════════════════════════════════════════
# SLIDE 1 — TITLE SLIDE
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, DARK_COPPER)

# Big decorative circle top-right
add_circle(slide, 12.2, 0.8, 2.2, RGBColor(0xA0, 0x58, 0x18))
add_circle(slide, 12.8, 1.8, 1.3, RGBColor(0xC8, 0x82, 0x30))

# Bottom wave strip
add_rect(slide, 0, 6.4, 13.333, 1.1, fill_color=RGBColor(0x5C, 0x30, 0x08))

# Cu symbol big watermark
add_text(slide, "Cu", 8.5, 1.5, 4, 4.5,
         font_size=200, bold=True,
         color=RGBColor(0xA0, 0x58, 0x18),
         align=PP_ALIGN.CENTER, font_name="Georgia")

# Title
add_text(slide, "COPPER POISONING", 0.6, 1.6, 9, 1.4,
         font_size=52, bold=True, color=WHITE,
         align=PP_ALIGN.LEFT, font_name="Calibri")

# Subtitle line
add_rect(slide, 0.6, 3.15, 5.5, 0.055, fill_color=COPPER)

# Subtitle
add_text(slide, "A Comprehensive Medical Overview", 0.6, 3.3, 8, 0.7,
         font_size=22, bold=False, color=COPPER_LIGHT,
         align=PP_ALIGN.LEFT, font_name="Calibri")

# Tags
add_text(slide, "Heavy Metals  |  Forensic Toxicology  |  Clinical Management",
         0.6, 4.1, 9, 0.55,
         font_size=14, color=RGBColor(0xD4, 0xAF, 0x80),
         align=PP_ALIGN.LEFT, font_name="Calibri")

# Bottom strip text
add_text(slide, "Chapter 9 — Heavy Metals  •  Chemical Poisons", 0.5, 6.5, 10, 0.5,
         font_size=12, color=RGBColor(0xD4, 0xAF, 0x80),
         align=PP_ALIGN.LEFT, font_name="Calibri")


# ════════════════════════════════════════════════════════════════
# SLIDE 2 — PHYSICAL APPEARANCE & BASIC FACTS
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

# Header bar
add_rect(slide, 0, 0, 13.333, 1.1, fill_color=DARK_COPPER)
add_text(slide, "Physical Appearance & Basic Facts", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, align=PP_ALIGN.LEFT, font_name="Calibri")
add_text(slide, "COPPER POISONING", 11.0, 0.08, 2.1, 0.95,
         font_size=11, color=COPPER_LIGHT, align=PP_ALIGN.RIGHT, font_name="Calibri")

# Left card — Chemical Symbol
add_rounded_rect(slide, 0.4, 1.3, 3.0, 5.6, fill_color=DARK_COPPER)
add_text(slide, "Cu", 0.4, 1.4, 3.0, 2.2,
         font_size=110, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Georgia")
add_text(slide, "Copper", 0.4, 3.4, 3.0, 0.6,
         font_size=20, bold=True, color=COPPER_LIGHT,
         align=PP_ALIGN.CENTER, font_name="Calibri")
add_text(slide, "Atomic No: 29\nAtomic Wt: 63.5\nPeriod 4, Group 11", 0.4, 4.1, 3.0, 1.3,
         font_size=14, color=WHITE, align=PP_ALIGN.CENTER, font_name="Calibri")
add_text(slide, "Element Symbol", 0.4, 5.5, 3.0, 0.55,
         font_size=12, color=COPPER_LIGHT, align=PP_ALIGN.CENTER, font_name="Calibri",
         italic=True)
add_text(slide, "3rd Most Abundant\nTrace Element in Body", 0.4, 6.1, 3.0, 0.7,
         font_size=11, bold=True, color=COPPER_LIGHT, align=PP_ALIGN.CENTER, font_name="Calibri")

# Right info boxes
props = [
    ("Appearance", "Lustrous, ductile, malleable, odourless solid\nDistinct golden-red / reddish-brown colour", COPPER),
    ("Metallic Copper", "Little to NO toxicity by itself\n(Reports in literature conflicting)", GREEN),
    ("Copper Salts", "Produce TOXICITY\nSoluble salts (e.g. CuSO₄) are strong irritants\nto skin and mucous membranes", RED),
    ("Biological Role", "Essential catalyst for haem synthesis &\niron absorption; required for catalase &\nperoxidase enzymes", TEAL),
]

tops = [1.3, 2.65, 3.95, 5.25]
for (label, body, accent), top in zip(props, tops):
    add_rounded_rect(slide, 3.7, top, 9.2, 1.15, fill_color=WHITE,
                     line_color=accent)
    add_rect(slide, 3.7, top, 0.12, 1.15, fill_color=accent)
    add_text(slide, label, 3.95, top + 0.0, 3.5, 0.42,
             font_size=13, bold=True, color=accent, font_name="Calibri")
    add_text(slide, body, 3.95, top + 0.4, 8.8, 0.75,
             font_size=12, color=DARK_GRAY, font_name="Calibri", wrap=True)


# ════════════════════════════════════════════════════════════════
# SLIDE 3 — TOXIC SALTS & USUAL FATAL DOSE
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

add_rect(slide, 0, 0, 13.333, 1.1, fill_color=DARK_COPPER)
add_text(slide, "Toxic Salts of Copper & Fatal Dose", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, font_name="Calibri")

# Table headers
cols = [1.0, 4.5, 8.0]
col_w = [3.3, 3.3, 4.5]
col_labels = ["Chemical Name", "Common Name", "Notable Use / Colour"]
for i, (cx, cw, cl) in enumerate(zip(cols, col_w, col_labels)):
    add_rounded_rect(slide, cx, 1.3, cw, 0.5, fill_color=COPPER)
    add_text(slide, cl, cx, 1.3, cw, 0.5,
             font_size=13, bold=True, color=WHITE,
             align=PP_ALIGN.CENTER, font_name="Calibri")

rows = [
    ("Copper acetoarsenite", "Paris Green", "Vivid green pigment / insecticide"),
    ("Copper arsenite",       "Scheele's Green", "Historical green wallpaper dye"),
    ("Copper carbonate (native)", "Mountain Green", "Mineral pigment"),
    ("Copper carbonate (with chalk)", "Brunswick Green", "Paint pigment"),
    ("Copper subacetate",     "Verdigris", "Blue-green corrosion on copper"),
    ("Copper sulfate",        "Blue Vitriol", "Blue crystals — most common toxic salt"),
]
row_colors = [WHITE, RGBColor(0xF5, 0xEB, 0xDD), WHITE,
              RGBColor(0xF5, 0xEB, 0xDD), WHITE, RGBColor(0xF5, 0xEB, 0xDD)]

for r_idx, (chem, common, use) in enumerate(rows):
    top = 1.9 + r_idx * 0.57
    bg = row_colors[r_idx]
    for i, (cx, cw, val) in enumerate(zip(cols, col_w, [chem, common, use])):
        add_rect(slide, cx, top, cw, 0.55, fill_color=bg, line_color=RGBColor(0xCC, 0xBB, 0xAA))
        add_text(slide, val, cx + 0.08, top, cw - 0.12, 0.55,
                 font_size=12, color=DARK_GRAY,
                 align=PP_ALIGN.LEFT if i == 0 else PP_ALIGN.CENTER,
                 font_name="Calibri")

# Fatal dose callout
add_rounded_rect(slide, 0.35, 1.5, 0.55, 4.9, fill_color=DARK_COPPER)
add_text(slide, "TABLE 9.9", 0.35, 3.6, 0.55, 1.0,
         font_size=9, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Calibri")

# Fatal dose box at bottom
add_rounded_rect(slide, 0.35, 6.6, 12.6, 0.7, fill_color=RED)
add_text(slide, "⚠  USUAL FATAL DOSE:  10 – 20 grams of Copper Sulfate (Blue Vitriol)", 0.5, 6.6, 12.4, 0.7,
         font_size=17, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Calibri")


# ════════════════════════════════════════════════════════════════
# SLIDE 4 — TOXICOKINETICS
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

add_rect(slide, 0, 0, 13.333, 1.1, fill_color=DARK_COPPER)
add_text(slide, "Toxicokinetics", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, font_name="Calibri")

# Flow diagram: Ingestion → Absorption → Distribution → Excretion
steps = [
    ("INGESTION", "Safe daily intake:\n2–3 mg/day\nRequired: 0.8 mg/day", COPPER),
    ("ABSORPTION", "Via GI mucosa\nand intact skin", TEAL),
    ("DISTRIBUTION", "7% bound to Albumin\n93% bound to\nCaeruloplasmin", ACCENT_BLUE),
    ("EXCRETION", "Urine: 5–25 µg/day\n0.1–1.3 ng via bile\nTotal body: 150 mg", GREEN),
]

box_w = 2.7
box_h = 2.8
gap = 0.45
start_x = 0.5

for i, (label, body, color) in enumerate(steps):
    lx = start_x + i * (box_w + gap)
    # Box
    add_rounded_rect(slide, lx, 1.5, box_w, box_h, fill_color=color)
    # Step number circle
    add_circle(slide, lx + 0.35, 1.5 + 0.35, 0.3, WHITE)
    add_text(slide, str(i + 1), lx + 0.05, 1.2, 0.6, 0.6,
             font_size=14, bold=True, color=color,
             align=PP_ALIGN.CENTER, font_name="Calibri")
    # Label
    add_text(slide, label, lx, 1.45, box_w, 0.6,
             font_size=14, bold=True, color=WHITE,
             align=PP_ALIGN.CENTER, font_name="Calibri")
    # Body
    add_text(slide, body, lx, 2.05, box_w, 2.0,
             font_size=12.5, color=WHITE,
             align=PP_ALIGN.CENTER, font_name="Calibri", wrap=True)
    # Arrow between boxes
    if i < len(steps) - 1:
        ax = lx + box_w + 0.02
        add_text(slide, "▶", ax, 2.5, 0.4, 0.6,
                 font_size=22, color=DARK_COPPER,
                 align=PP_ALIGN.CENTER, font_name="Calibri")

# Serum binding visual
add_rounded_rect(slide, 0.5, 4.55, 12.3, 2.65, fill_color=WHITE,
                 line_color=DARK_COPPER)
add_rect(slide, 0.5, 4.55, 12.3, 0.45, fill_color=DARK_COPPER)
add_text(slide, "Serum Copper Distribution", 0.6, 4.55, 12.0, 0.45,
         font_size=14, bold=True, color=WHITE, font_name="Calibri")

# Visual bar
add_rect(slide, 0.7, 5.2, 5.2, 0.65, fill_color=RGBColor(0x2E, 0x86, 0xAB))
add_text(slide, "Caeruloplasmin  93%", 0.7, 5.2, 5.2, 0.65,
         font_size=13, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Calibri")
add_rect(slide, 5.95, 5.2, 0.5, 0.65, fill_color=AMBER)
add_text(slide, "Albumin 7%", 5.95, 5.2, 1.8, 0.65,
         font_size=12, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Calibri")

add_text(slide, "Copper is an essential trace element — third most abundant in the body. Catalyses haem synthesis & iron absorption.",
         0.7, 6.0, 12.0, 0.7,
         font_size=12, color=DARK_GRAY, italic=True,
         align=PP_ALIGN.LEFT, font_name="Calibri")


# ════════════════════════════════════════════════════════════════
# SLIDE 5 — ACUTE CLINICAL FEATURES (visual body map)
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

add_rect(slide, 0, 0, 13.333, 1.1, fill_color=RED)
add_text(slide, "Acute Poisoning — Clinical Features", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, font_name="Calibri")

# Body silhouette (simple shapes)
body_cx = 6.67
# Head
add_circle(slide, body_cx, 2.0, 0.55, RGBColor(0xE8, 0xC8, 0xA0), line_color=DARK_COPPER)
add_text(slide, "👁", body_cx - 0.22, 1.72, 0.5, 0.4, font_size=13, align=PP_ALIGN.CENTER)
add_text(slide, "👁", body_cx + 0.02, 1.72, 0.5, 0.4, font_size=13, align=PP_ALIGN.CENTER)

# Torso
add_rounded_rect(slide, body_cx - 0.7, 2.6, 1.4, 2.3, fill_color=RGBColor(0xE8, 0xC8, 0xA0),
                 line_color=DARK_COPPER)
# Arms
add_rounded_rect(slide, body_cx - 1.7, 2.65, 0.95, 0.35, fill_color=RGBColor(0xE8, 0xC8, 0xA0),
                 line_color=DARK_COPPER)
add_rounded_rect(slide, body_cx + 0.75, 2.65, 0.95, 0.35, fill_color=RGBColor(0xE8, 0xC8, 0xA0),
                 line_color=DARK_COPPER)
# Legs
add_rounded_rect(slide, body_cx - 0.65, 4.95, 0.55, 1.7, fill_color=RGBColor(0xE8, 0xC8, 0xA0),
                 line_color=DARK_COPPER)
add_rounded_rect(slide, body_cx + 0.1, 4.95, 0.55, 1.7, fill_color=RGBColor(0xE8, 0xC8, 0xA0),
                 line_color=DARK_COPPER)

# Left side labels
left_labels = [
    (1.1, 1.65, "Eye: Conjunctivitis,\nCorneal ulceration,\nChalcosis lentis"),
    (0.15, 2.7,  "Respiratory: Cough,\nSore throat,\nMetal fume fever,\nDyspnoea"),
    (0.25, 4.0,  "Musculoskeletal:\nMyalgia,\nSeizures"),
    (0.15, 5.2,  "Skin: Irritation,\nErythema,\nDermatitis, Eczema"),
]
for lx, lt, txt in left_labels:
    add_rounded_rect(slide, lx, lt, 2.85, 0.9, fill_color=WHITE, line_color=RED)
    add_text(slide, txt, lx + 0.1, lt, 2.7, 0.9,
             font_size=10, color=DARK_GRAY, font_name="Calibri", wrap=True)
    # Connector line to body
    add_rect(slide, lx + 2.85, lt + 0.4, body_cx - lx - 2.85 - 0.7, 0.03, fill_color=RED)

# Right side labels
right_labels = [
    (8.2, 1.65, "CNS: Delirium,\nSeizures, Coma"),
    (8.2, 2.7,  "Hepatic: Hepatomegaly,\nJaundice, ↑ Transaminase,\nLiver tenderness"),
    (8.2, 4.0,  "Renal: Acute failure\n(20-40%), Oliguria,\nAnuria, ↑ BUN"),
    (8.2, 5.2,  "GI: Vomiting (bluish/\ngreenish), Diarrhoea,\nAcidosis, Pancreatitis"),
]
for lx, lt, txt in right_labels:
    add_rounded_rect(slide, lx, lt, 3.0, 0.9, fill_color=WHITE, line_color=RED)
    add_text(slide, txt, lx + 0.1, lt, 2.85, 0.9,
             font_size=10, color=DARK_GRAY, font_name="Calibri", wrap=True)
    add_rect(slide, body_cx + 0.7, lt + 0.4, lx - body_cx - 0.7, 0.03, fill_color=RED)

# Methaemoglobinaemia box at bottom
add_rounded_rect(slide, 3.5, 6.7, 6.3, 0.65, fill_color=RED)
add_text(slide, "Methaemoglobinaemia  •  Haemolysis  •  Pancreatitis",
         3.5, 6.7, 6.3, 0.65,
         font_size=13, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Calibri")


# ════════════════════════════════════════════════════════════════
# SLIDE 6 — CHRONIC POISONING
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

add_rect(slide, 0, 0, 13.333, 1.1, fill_color=AMBER)
add_text(slide, "Chronic Poisoning — Features & Causes", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, font_name="Calibri")

# Wilson's Disease highlight
add_rounded_rect(slide, 0.4, 1.2, 4.5, 5.8, fill_color=DARK_COPPER)
add_text(slide, "Wilson's Disease", 0.5, 1.25, 4.3, 0.65,
         font_size=18, bold=True, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Calibri")
add_text(slide,
         "Hallmark of chronic\ncopper toxicity\n\nAutosomal recessive\ngenetic disorder\n\nDeficiency of\ncaeruloplasmin\n\nKayser-Fleischer Ring:\nGolden-brown copper\ndeposit at corneal periphery\n(Pathognomonic)\n\nSunflower cataract\nin anterior lens",
         0.5, 1.95, 4.2, 4.8,
         font_size=13, color=WHITE,
         align=PP_ALIGN.CENTER, font_name="Calibri", wrap=True)

# KF ring description
add_rounded_rect(slide, 5.1, 1.2, 7.8, 5.8, fill_color=WHITE, line_color=AMBER)
add_text(slide, "Other Chronic Exposure Scenarios", 5.2, 1.2, 7.5, 0.55,
         font_size=14, bold=True, color=AMBER, font_name="Calibri")

chronic_items = [
    (AMBER,      "Vineyard Sprayer's Lung",
                 "Chronic inhalation of copper sulfate spray (insecticide)\ncauses histiocytic granulomatous lung + liver damage"),
    (TEAL,       "Green Hair Discolouration",
                 "Chronic contact with swimming pool water\ncontaining algicidal copper chemicals"),
    (RED,        "'Spiritual Green Water'",
                 "Copper sulfate–laced water distributed in some\ndeveloping countries — serious toxicity, even death"),
    (GREEN,      "Cooking Vessel Leaching",
                 "Cooking in copper/brass vessels → verdigris poisoning\nAlso from storing acidic beverages in copper containers"),
    (DARK_COPPER,"Metal Fume Fever",
                 "Workers exposed to fine copper dust/fumes:\nWheezing, rales, dyspnoea"),
]

for i, (col, title, body) in enumerate(chronic_items):
    top = 1.85 + i * 0.98
    add_rect(slide, 5.1, top, 0.15, 0.82, fill_color=col)
    add_text(slide, title, 5.35, top + 0.0, 7.4, 0.38,
             font_size=12.5, bold=True, color=col, font_name="Calibri")
    add_text(slide, body, 5.35, top + 0.38, 7.4, 0.52,
             font_size=11, color=DARK_GRAY, font_name="Calibri", wrap=True)
    if i < 4:
        add_rect(slide, 5.1, top + 0.84, 7.8, 0.02, fill_color=RGBColor(0xDD, 0xCC, 0xBB))


# ════════════════════════════════════════════════════════════════
# SLIDE 7 — DIAGNOSIS
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

add_rect(slide, 0, 0, 13.333, 1.1, fill_color=TEAL)
add_text(slide, "Diagnosis of Copper Poisoning", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, font_name="Calibri")

diag_items = [
    ("1", "Serum Caeruloplasmin",
     "≤ 35 mg% at 24 hours\n→ Associated with serious toxicity",
     TEAL, "Low caeruloplasmin = copper flooding free in serum"),
    ("2", "Blood Copper Level",
     "Elevated > 1.5 mg/100 mL = serious toxicity\nNormal: Men 1.09 | Non-pregnant women 1.20 | Pregnant 2.39 mg/L",
     COPPER, "Direct measure of toxic copper burden"),
    ("3", "Urine Copper Level",
     "Normal daily excretion < 0.6 micromole/day\nElevated excretion confirms copper overload",
     GREEN, "Sensitive indicator of ongoing exposure"),
    ("4", "Radiography",
     "Metallic copper is RADIOPAQUE on X-ray\nCopper salts are NOT radiopaque",
     ACCENT_BLUE, "Useful to locate ingested copper objects"),
]

for i, (num, title, body, color, note) in enumerate(diag_items):
    row = i // 2
    col = i % 2
    lx = 0.4 + col * 6.4
    lt = 1.3 + row * 3.0

    add_rounded_rect(slide, lx, lt, 6.0, 2.7, fill_color=WHITE, line_color=color)
    add_rect(slide, lx, lt, 6.0, 0.55, fill_color=color)
    add_text(slide, f"{num}.  {title}", lx + 0.1, lt, 5.8, 0.55,
             font_size=15, bold=True, color=WHITE, font_name="Calibri")
    add_text(slide, body, lx + 0.15, lt + 0.6, 5.7, 1.1,
             font_size=12.5, color=DARK_GRAY, font_name="Calibri", wrap=True)
    add_rect(slide, lx, lt + 1.75, 6.0, 0.04, fill_color=RGBColor(0xDD, 0xCC, 0xBB))
    add_text(slide, f"📌 {note}", lx + 0.15, lt + 1.82, 5.7, 0.7,
             font_size=11, color=color, italic=True, font_name="Calibri", wrap=True)

# KF ring note
add_rounded_rect(slide, 0.4, 7.1, 12.5, 0.25, fill_color=DARK_COPPER)
add_text(slide, "Kayser-Fleischer Ring (corneal copper deposits) is PATHOGNOMONIC for Wilson's Disease",
         0.5, 7.1, 12.3, 0.25,
         font_size=11, bold=True, color=WHITE, align=PP_ALIGN.CENTER, font_name="Calibri")


# ════════════════════════════════════════════════════════════════
# SLIDE 8 — TREATMENT
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

add_rect(slide, 0, 0, 13.333, 1.1, fill_color=GREEN)
add_text(slide, "Treatment & Management", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, font_name="Calibri")

# General measures column
add_rounded_rect(slide, 0.3, 1.2, 4.0, 6.1, fill_color=WHITE, line_color=GREEN)
add_rect(slide, 0.3, 1.2, 4.0, 0.5, fill_color=GREEN)
add_text(slide, "General Measures", 0.35, 1.2, 3.9, 0.5,
         font_size=14, bold=True, color=WHITE, font_name="Calibri")

gen_measures = [
    ("Haemodialysis", "Useful early when copper still circulates as free metal"),
    ("Egg white / Milk", "Oral — detoxifies copper by forming albuminate"),
    ("Stomach wash", "Potassium ferrocyanide solution — converts CuSO₄ to insoluble cupric ferrocyanide"),
    ("Emesis", "CONTRAINDICATED"),
    ("Symptomatic", "Antacids + ranitidine (gastric erosions)\nDopamine (shock)"),
    ("Eye exposure", "0.9% saline irrigation ≥ 15 min"),
    ("Skin exposure", "Remove clothing; wash with soap/water; monitor serum Cu"),
]
for i, (title, body) in enumerate(gen_measures):
    lt = 1.8 + i * 0.76
    add_text(slide, f"• {title}", 0.45, lt, 3.7, 0.32,
             font_size=12, bold=True,
             color=RED if "CONTRA" in body else GREEN, font_name="Calibri")
    add_text(slide, body, 0.45, lt + 0.3, 3.7, 0.42,
             font_size=10.5, color=DARK_GRAY, font_name="Calibri", wrap=True)

# Chelation agents column
add_rounded_rect(slide, 4.6, 1.2, 8.4, 6.1, fill_color=WHITE, line_color=ACCENT_BLUE)
add_rect(slide, 4.6, 1.2, 8.4, 0.5, fill_color=ACCENT_BLUE)
add_text(slide, "Chelation Therapy", 4.65, 1.2, 8.3, 0.5,
         font_size=14, bold=True, color=WHITE, font_name="Calibri")

chelators = [
    ("D-Penicillamine", "DRUG OF CHOICE for Wilson's disease (chronic overload)",
     "Adult: 1000–1500 mg/day ÷ q6–12h (before meals)\nPaeds: 10 → 30 mg/kg/day; max 1 g/day\n⚠ Teratogenic risk in pregnancy", COPPER),
    ("Dimercaprol (BAL)", "Used in acute copper sulfate intoxication",
     "3–5 mg/kg/dose IM q4h × 2 days, then q4–6h × 2 days,\nthen q4–12h × 7 days\n(Efficacy data lacking)", AMBER),
    ("Unithiol", "Not FDA-approved; beneficial in some cases",
     "5 mg/kg IM/SC 3–4× on day 1, 2–3× day 2,\n1–2× daily thereafter", GREEN),
    ("Ca-Na₂ EDTA", "Used for acute copper sulfate poisoning",
     "75 mg/kg/24h deep IM or slow IV, 3–6 divided doses\nover 5 days; max 500 mg/kg/course", TEAL),
]

for i, (name, indication, dose, color) in enumerate(chelators):
    lt = 1.85 + i * 1.35
    add_rounded_rect(slide, 4.7, lt, 8.2, 1.2, fill_color=SLIDE_BG, line_color=color)
    add_rect(slide, 4.7, lt, 0.15, 1.2, fill_color=color)
    add_text(slide, name, 4.95, lt, 4.5, 0.38,
             font_size=13, bold=True, color=color, font_name="Calibri")
    add_text(slide, indication, 4.95, lt + 0.35, 8.0, 0.3,
             font_size=11, color=DARK_GRAY, italic=True, font_name="Calibri")
    add_text(slide, dose, 4.95, lt + 0.65, 8.0, 0.6,
             font_size=10, color=DARK_GRAY, font_name="Calibri", wrap=True)


# ════════════════════════════════════════════════════════════════
# SLIDE 9 — AUTOPSY & FORENSIC
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, SLIDE_BG)

add_rect(slide, 0, 0, 13.333, 1.1, fill_color=DARK_GRAY)
add_text(slide, "Autopsy Features & Forensic Issues", 0.35, 0.08, 11, 0.95,
         font_size=30, bold=True, color=WHITE, font_name="Calibri")

# Autopsy findings
add_rounded_rect(slide, 0.4, 1.3, 5.8, 5.9, fill_color=WHITE, line_color=DARK_GRAY)
add_rect(slide, 0.4, 1.3, 5.8, 0.55, fill_color=DARK_GRAY)
add_text(slide, "Autopsy Findings", 0.5, 1.3, 5.7, 0.55,
         font_size=17, bold=True, color=WHITE, font_name="Calibri")

autopsy = [
    ("Skin & Conjunctivae", "Jaundiced (yellow discolouration)"),
    ("Stomach Contents",    "Greenish or bluish discolouration\n(Vomitus turns deep blue with ammonium hydroxide)"),
    ("Liver",               "Hepatic necrosis — centrolobular\nHepatomegaly, marked congestion"),
    ("Kidneys",             "Renal cortical necrosis\nAcute tubular injury"),
    ("Differentiating Bile","Bile is also greenish but adding\nammonium hydroxide — will NOT change colour\n(vs copper vomitus which turns blue)"),
]
for i, (organ, finding) in enumerate(autopsy):
    lt = 2.0 + i * 0.99
    add_rect(slide, 0.55, lt, 0.12, 0.82, fill_color=DARK_GRAY)
    add_text(slide, organ, 0.78, lt, 5.2, 0.35,
             font_size=12.5, bold=True, color=DARK_GRAY, font_name="Calibri")
    add_text(slide, finding, 0.78, lt + 0.35, 5.2, 0.58,
             font_size=11.5, color=MID_GRAY, font_name="Calibri", wrap=True)

# Forensic Issues
add_rounded_rect(slide, 6.6, 1.3, 6.35, 5.9, fill_color=WHITE, line_color=RED)
add_rect(slide, 6.6, 1.3, 6.35, 0.55, fill_color=RED)
add_text(slide, "Forensic Issues — India", 6.7, 1.3, 6.2, 0.55,
         font_size=17, bold=True, color=WHITE, font_name="Calibri")

forensic_pts = [
    "Copper sulfate (Blue Vitriol) was a common\nmethod of suicidal ingestion in India",
    "Incidence was high until recently — declining trend observed",
    "Vomitus colour (bluish/greenish) is an important\nclinical and autopsy clue",
    "Copper sulfate is readily available as an\nagricultural fungicide/algaecide",
    "Chelation evidence mostly from Wilson's disease\nand Indian childhood cirrhosis cases",
    "Forensic clue: Deep blue vomitus on adding\nammonium hydroxide = copper poisoning confirmed",
]
for i, pt in enumerate(forensic_pts):
    lt = 2.0 + i * 0.82
    add_rounded_rect(slide, 6.7, lt, 6.1, 0.72, fill_color=RGBColor(0xFD, 0xF0, 0xEE),
                     line_color=RED)
    add_text(slide, f"⚖  {pt}", 6.8, lt, 5.9, 0.72,
             font_size=11, color=DARK_GRAY, font_name="Calibri", wrap=True)


# ════════════════════════════════════════════════════════════════
# SLIDE 10 — SUMMARY / KEY POINTS
# ════════════════════════════════════════════════════════════════
slide = prs.slides.add_slide(blank)
fill_slide_bg(slide, DARK_COPPER)

add_circle(slide, 12.5, 7.0, 3.0, RGBColor(0x7C, 0x46, 0x10))
add_circle(slide, 0.8, 7.2, 2.0, RGBColor(0x7C, 0x46, 0x10))

add_text(slide, "Cu", 9.5, 0.2, 3.5, 3.5,
         font_size=130, bold=True,
         color=RGBColor(0xA0, 0x58, 0x18),
         align=PP_ALIGN.CENTER, font_name="Georgia")

add_text(slide, "KEY TAKEAWAYS", 0.5, 0.2, 9.0, 0.8,
         font_size=28, bold=True, color=WHITE,
         align=PP_ALIGN.LEFT, font_name="Calibri")
add_rect(slide, 0.5, 1.05, 6.0, 0.055, fill_color=COPPER)

key_points = [
    ("Fatal Dose",      "10–20 g copper sulfate (Blue Vitriol)"),
    ("Acute Vomitus",   "Bluish/greenish; turns DEEP BLUE with NH₃ (ammonium hydroxide)"),
    ("Renal Failure",   "Develops in 20–40% of acute CuSO₄ poisoning"),
    ("Liver",           "Hepatomegaly + jaundice appear Day 2–3"),
    ("Wilson's Disease","Autosomal recessive, caeruloplasmin deficiency, K-F ring"),
    ("Drug of Choice",  "D-Penicillamine (chronic); Dimercaprol (acute)"),
    ("Contraindicated", "Induction of emesis is CONTRAINDICATED"),
    ("Autopsy Triad",   "Jaundice  •  Greenish stomach  •  Hepatic & renal necrosis"),
]

for i, (title, body) in enumerate(key_points):
    lt = 1.25 + i * 0.74
    color = COPPER if i % 2 == 0 else COPPER_LIGHT
    add_text(slide, f"▸  {title}:", 0.5, lt, 3.2, 0.42,
             font_size=13, bold=True, color=color, font_name="Calibri")
    add_text(slide, body, 3.6, lt, 9.4, 0.42,
             font_size=13, color=WHITE, font_name="Calibri")

# Bottom
add_rect(slide, 0, 7.1, 13.333, 0.4, fill_color=RGBColor(0x5C, 0x30, 0x08))
add_text(slide, "Chapter 9 • Heavy Metals • Chemical Poisons — Forensic Toxicology",
         0.5, 7.1, 12.3, 0.4,
         font_size=11, color=COPPER_LIGHT,
         align=PP_ALIGN.CENTER, font_name="Calibri")


# ════════════════════════════════════════════════════════════════
# SAVE
# ════════════════════════════════════════════════════════════════
out_path = "/tmp/workspace/copper-poisoning/Copper_Poisoning.pptx"
prs.save(out_path)
print(f"Saved: {out_path}")
Running Command

cd /tmp/workspace/copper-poisoning && python create_pptx.py 2>&1

Running Command

ls -lh /tmp/workspace/copper-poisoning/Copper_Poisoning.pptx

Your presentation is ready! Download it here:

Copper Poisoning

Presentation · PPTX


Here's what's included across 10 visually designed slides with a warm copper colour palette (deep copper, amber, white, teal, red, green):
SlideContent
1 - TitleFull cover with large "Cu" watermark, copper theme
2 - Physical AppearanceElement card with atomic data + 4 colour-coded property cards
3 - Toxic Salts & Fatal DoseFull Table 9.9 (Paris green, Blue vitriol, etc.) + red fatal dose banner (10–20g)
4 - Toxicokinetics4-step flow diagram (Ingestion → Absorption → Distribution → Excretion) + serum binding bar
5 - Acute PoisoningHuman body silhouette with colour-coded organ-system labels (GI, CNS, Renal, Hepatic, Eye, Skin, Respiratory)
6 - Chronic PoisoningWilson's Disease panel + 5 chronic exposure scenarios
7 - Diagnosis4-box grid - serum caeruloplasmin, blood copper, urine copper, radiography
8 - TreatmentGeneral measures column + chelation therapy (D-Penicillamine, Dimercaprol, Unithiol, CaNa₂EDTA) with doses
9 - Autopsy & ForensicAutopsy triad + India forensic context
10 - SummaryKey takeaways quick-reference with copper accent styling
This is a shared conversation. Sign in to Orris to start your own chat.