pph in obs

Reading File
Finding Sources
Searching PubMed

"postpartum hemorrhage" management

Reading File
Reading File
Reading File
Reading File
Now I have rich content from two OB textbooks. Let me compile a thorough, well-organized answer.

Postpartum Hemorrhage (PPH) in Obstetrics

Definition

  • Primary (early) PPH: Blood loss >500 mL after vaginal delivery, or >1000 mL after cesarean delivery, within 24 hours of delivery
  • Secondary (late) PPH: Abnormal bleeding occurring 24 hours to 6 weeks after delivery
  • Clinically, any bleeding causing signs/symptoms of hemodynamic instability - or that would cause instability if untreated - qualifies as PPH, regardless of measured volume

Causes - The "4 Ts"

CauseExamplesFrequency
Tone (atony)Failed uterine contraction~70-80%
TraumaCervical/vaginal/uterine lacerations, uterine rupture, uterine inversion
TissueRetained placenta/membranes, placenta accreta
ThrombinDIC, hereditary coagulopathy, pre-eclampsia
Late PPH causes: Subinvolution of the placental site, retained placental fragments, infection, hereditary coagulopathy.

Risk Factors

For uterine atony:
  • Uterine overdistension (polyhydramnios, multiple gestation, macrosomia)
  • High parity
  • Prolonged or rapid labor
  • Oxytocin use
  • Intraamniotic infection (chorioamnionitis)
  • Uterine-relaxing agents (magnesium, tocolytics)
For cesarean delivery hemorrhage:
  • Preeclampsia
  • Active labor disorders
  • Obesity
  • General anesthesia
  • Prior PPH history

Initial Assessment & Stabilization

  1. Monitor vital signs frequently
  2. Establish two large-bore IV lines
  3. Start IV crystalloid (lactated Ringer's)
  4. Prepare for blood transfusion (type and crossmatch)
  5. Supplemental oxygen
  6. Labs: CBC with platelets, fibrinogen, fibrin split products, PT, PTT
  7. Real-time ultrasound - identify retained placenta or blood clots

Management by Cause

1. Uterine Atony (most common)

Step 1 - Uterotonic agents (first-line):
DrugDose/RouteNotes
Oxytocin20-30 units in 1000 mL IV at ≤100 mU/minNo IV bolus (causes hypotension). Risk of water intoxication with large volumes.
Methylergonovine / Ergonovine0.2 mg IM q2-4hContraindicated in hypertension (causes vasoconstriction). Never IV (risk of severe HTN, CNS vasospasm, hemorrhage).
Carboprost (15-methyl PGF2α / Hemabate)250 μg IM q15-90 min; max 8 dosesCaution in asthma and cardiovascular disease. Monitor O₂ saturation.
Misoprostol800-1000 μg rectally or transvaginallyUsed when conventional pharmacotherapy fails.
Bimanual uterine compression is performed alongside uterotonics.
Step 2 - Tamponade (if uterotonics fail):
  • Bakri balloon or large Foley catheter - especially for low placental implantation site bleeding
  • Uterine packing with sterile gauze
Step 3 - Interventional radiology:
  • Selective embolization of pelvic vessels (where facilities are available)
Step 4 - Surgery (laparotomy):
  • Patient positioned in semilithotomy
  • Goals: identify occult bleeding sources, ligation of uterine/hypogastric (internal iliac) arteries
  • B-Lynch suture or other compression sutures
  • Hysterectomy as last resort
Internal iliac (hypogastric) artery ligation: reduces pulse pressure in pelvic vessels. Collateral circulation is ample; subsequent pregnancies are possible after this procedure.

2. Lacerations (Trauma)

  • Inspect cervix, vagina, and perineum with good lighting and assistance
  • Repair any identified lacerations
  • Firm fundus + ongoing bleeding = suspect occult laceration or retained placenta

3. Retained Placenta / Placenta Accreta (Tissue)

  • Manual exploration of uterine cavity
  • Curettage for suspected retained fragments
  • Placenta accreta: high suspicion required if previous uterine surgery; may require hysterectomy

4. Uterine Inversion

  • Uncommon but life-threatening; associated with fundal placentation
  • Do not remove placenta before reinversion if using the Johnson technique (easier without placenta in place)
  • Johnson technique: firm upward pressure on fundus through vagina to elevate uterus into abdomen; hold several minutes
  • Tocolysis aids reinversion: magnesium sulfate, β-mimetics, nitroglycerin (to relax the cervical ring)
  • Surgical options if Johnson fails: Huntington procedure (traction on round ligaments via laparotomy) or Haultain procedure (posterior longitudinal incision through inverted fundus)

5. Coagulopathy (Thrombin)

  • Treat underlying cause (DIC, preeclampsia, HELLP)
  • Blood product replacement: packed RBCs, FFP, platelets, cryoprecipitate
  • Tranexamic acid (TXA) - antifibrinolytic, recommended early in hemorrhage

Active Management of Third Stage of Labor (AMTSL) - Prevention

  • Early administration of oxytocin (10 units IM at delivery of anterior shoulder, or after delivery)
  • Early cord clamping
  • Controlled cord traction
AMTSL reduces PPH by approximately two-thirds compared to expectant management.

Monitoring in Severe PPH

In extensive PPH, central venous pressure (CVP) monitoring or Swan-Ganz catheter placement helps guide fluid resuscitation and avoids pulmonary edema.

Recent Evidence (2025)

A 2025 Cochrane network meta-analysis (PMID 40237648) found that carbetocin and combination uterotonic regimens may be superior to oxytocin alone for preventing PPH. A separate 2025 Cochrane systematic review (PMID 39911088) addresses blood product transfusion strategies in PPH management.

Sources: Creasy & Resnik's Maternal-Fetal Medicine, 8e; Textbook of Family Medicine, 9e

make ppt

Reading File
Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"

Running Command

mkdir -p /home/daytona/workspace/pph-ppt

Writing File

~/pph-ppt/create_pph.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Postpartum Hemorrhage (PPH)";
pres.author = "Obstetrics";

// ─── Color Palette ───────────────────────────────────────────────────────────
const C = {
  deepRed:   "8B1A1A",  // dominant dark red - medical/urgency
  crimson:   "C0392B",  // accent red
  darkGray:  "2C2C2C",  // near-black for text
  midGray:   "5A5A5A",
  lightGray: "F5F2F0",  // warm off-white for content bg
  white:     "FFFFFF",
  paleRose:  "FAE8E8",  // soft highlight bg
  gold:      "D4A017",  // accent for callouts
  steel:     "3D5A6B",  // cool blue-gray for variety
  teal:      "1A6B6B",
};

// ─── Helper: slide header bar ────────────────────────────────────────────────
function addHeader(slide, title, subtitle) {
  // dark header bar
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 1.15,
    fill: { color: C.deepRed }, line: { color: C.deepRed }
  });
  // accent stripe
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 1.15, w: 10, h: 0.07,
    fill: { color: C.gold }, line: { color: C.gold }
  });
  slide.addText(title, {
    x: 0.35, y: 0.05, w: 9.3, h: 0.65,
    fontSize: 24, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });
  if (subtitle) {
    slide.addText(subtitle, {
      x: 0.35, y: 0.68, w: 9.3, h: 0.38,
      fontSize: 13, color: "F5C0C0", fontFace: "Calibri", margin: 0, italic: true
    });
  }
}

// ─── Helper: content card ─────────────────────────────────────────────────────
function addCard(slide, x, y, w, h, title, items, titleColor, bgColor) {
  bgColor = bgColor || C.white;
  titleColor = titleColor || C.deepRed;
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x, y, w, h,
    fill: { color: bgColor },
    line: { color: "D8C8C8", width: 1 },
    rectRadius: 0.08,
    shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.1 }
  });
  slide.addText(title, {
    x: x + 0.15, y: y + 0.06, w: w - 0.3, h: 0.35,
    fontSize: 12, bold: true, color: titleColor, fontFace: "Calibri", margin: 0
  });
  // divider
  slide.addShape(pres.shapes.RECTANGLE, {
    x: x + 0.15, y: y + 0.43, w: w - 0.3, h: 0.025,
    fill: { color: titleColor }, line: { color: titleColor }
  });
  const bullets = items.map((item, i) => ({
    text: item,
    options: { bullet: { code: "25B8" }, fontSize: 10.5, color: C.darkGray, breakLine: i < items.length - 1 }
  }));
  slide.addText(bullets, {
    x: x + 0.15, y: y + 0.5, w: w - 0.3, h: h - 0.6,
    fontFace: "Calibri", valign: "top", paraSpaceAfter: 2
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 1 — TITLE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  // full-bleed background
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: C.deepRed }, line: { color: C.deepRed }
  });
  // decorative large circle
  s.addShape(pres.shapes.ELLIPSE, {
    x: 6.2, y: -1.2, w: 5.5, h: 5.5,
    fill: { color: "A52020", transparency: 55 }, line: { color: "A52020", transparency: 55 }
  });
  s.addShape(pres.shapes.ELLIPSE, {
    x: 7.5, y: 2.5, w: 3.5, h: 3.5,
    fill: { color: "6B1010", transparency: 60 }, line: { color: "6B1010", transparency: 60 }
  });
  // gold accent bar
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.5, y: 1.55, w: 0.12, h: 2.5,
    fill: { color: C.gold }, line: { color: C.gold }
  });
  s.addText("Postpartum", {
    x: 0.75, y: 1.5, w: 8, h: 0.95,
    fontSize: 48, bold: true, color: C.white, fontFace: "Calibri", margin: 0
  });
  s.addText("Hemorrhage", {
    x: 0.75, y: 2.35, w: 8, h: 0.95,
    fontSize: 48, bold: true, color: "F5C0C0", fontFace: "Calibri", margin: 0
  });
  s.addText("PPH", {
    x: 0.75, y: 3.22, w: 3, h: 0.55,
    fontSize: 22, bold: true, color: C.gold, fontFace: "Calibri", charSpacing: 8, margin: 0
  });
  s.addText("Obstetrics  |  Diagnosis & Management", {
    x: 0.75, y: 3.78, w: 8, h: 0.4,
    fontSize: 14, color: "F5C0C0", fontFace: "Calibri", margin: 0
  });
  // sources note
  s.addText("Based on Creasy & Resnik's Maternal-Fetal Medicine, 8e", {
    x: 0.5, y: 5.2, w: 9, h: 0.3,
    fontSize: 9, color: "C08080", fontFace: "Calibri", italic: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 2 — DEFINITION & INCIDENCE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Definition & Classification", "What constitutes postpartum hemorrhage?");

  // Big stat boxes
  const boxes = [
    { label: "Primary PPH", val: ">500 mL", sub: "Vaginal delivery", col: C.deepRed },
    { label: "Primary PPH", val: ">1000 mL", sub: "Caesarean section", col: C.steel },
    { label: "Early PPH", val: "< 24 hrs", sub: "after delivery", col: C.teal },
    { label: "Late PPH", val: "24 hrs–6 wks", sub: "after delivery", col: "7B4F2E" },
  ];
  boxes.forEach((b, i) => {
    const x = 0.3 + i * 2.38;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y: 1.45, w: 2.2, h: 1.9,
      fill: { color: b.col }, line: { color: b.col }, rectRadius: 0.1,
      shadow: { type: "outer", color: "000000", blur: 8, offset: 3, angle: 135, opacity: 0.18 }
    });
    s.addText(b.label, { x: x + 0.1, y: 1.52, w: 2.0, h: 0.32, fontSize: 10, color: "FFDDDD", fontFace: "Calibri", bold: true, align: "center", margin: 0 });
    s.addText(b.val, { x: x + 0.05, y: 1.82, w: 2.1, h: 0.72, fontSize: 22, color: C.white, fontFace: "Calibri", bold: true, align: "center", margin: 0 });
    s.addText(b.sub, { x: x + 0.05, y: 2.52, w: 2.1, h: 0.55, fontSize: 10, color: "FFDEDE", fontFace: "Calibri", align: "center", margin: 0 });
  });

  // Clinical definition
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.3, y: 3.55, w: 9.4, h: 1.65,
    fill: { color: C.paleRose }, line: { color: "D8B0B0", width: 1.2 }, rectRadius: 0.1
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0.3, y: 3.55, w: 0.18, h: 1.65,
    fill: { color: C.crimson }, line: { color: C.crimson }
  });
  s.addText("Clinical Definition", { x: 0.6, y: 3.62, w: 8.8, h: 0.32, fontSize: 12, bold: true, color: C.deepRed, fontFace: "Calibri", margin: 0 });
  s.addText([
    { text: "Any bleeding causing signs/symptoms of hemodynamic instability, or bleeding that ", options: { fontSize: 11, color: C.darkGray } },
    { text: "would", options: { fontSize: 11, color: C.darkGray, bold: true, italic: true } },
    { text: " cause instability if left untreated — regardless of measured volume.", options: { fontSize: 11, color: C.darkGray } },
  ], { x: 0.6, y: 3.96, w: 8.8, h: 0.55, fontFace: "Calibri", margin: 0 });
  s.addText("PPH is a leading cause of maternal mortality worldwide", {
    x: 0.6, y: 4.55, w: 8.8, h: 0.4,
    fontSize: 10.5, color: C.steel, fontFace: "Calibri", italic: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 3 — CAUSES: THE 4 Ts
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Causes of PPH — The \"4 Ts\"", "A systematic framework for aetiology");

  const Ts = [
    { T: "TONE", title: "Uterine Atony", pct: "70–80%", items: ["Failed uterine contraction", "Most common cause", "Uterine overdistension", "Prolonged / rapid labour", "Chorioamnionitis", "High parity", "Oxytocin use"], col: C.deepRed },
    { T: "TRAUMA", title: "Lacerations / Rupture", pct: "~10%", items: ["Cervical lacerations", "Vaginal lacerations", "Uterine rupture", "Uterine inversion", "Extension of uterine incision"], col: C.steel },
    { T: "TISSUE", title: "Retained Products", pct: "~10%", items: ["Retained placenta", "Retained membranes", "Placenta accreta", "Placenta increta/percreta", "Abnormal placentation"], col: C.teal },
    { T: "THROMBIN", title: "Coagulopathy", pct: "~1%", items: ["DIC", "Hereditary coagulopathy", "Thrombocytopaenia", "Anticoagulant therapy", "Pre-eclampsia / HELLP"], col: "7B4F2E" },
  ];

  Ts.forEach((t, i) => {
    const x = 0.22 + i * 2.42;
    // card bg
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y: 1.3, w: 2.25, h: 3.95,
      fill: { color: C.white }, line: { color: "E0D0D0", width: 0.8 }, rectRadius: 0.1,
      shadow: { type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }
    });
    // colored top cap
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y: 1.3, w: 2.25, h: 1.15,
      fill: { color: t.col }, line: { color: t.col }, rectRadius: 0.1
    });
    // cover bottom corners of cap
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.05, w: 2.25, h: 0.4,
      fill: { color: t.col }, line: { color: t.col }
    });
    s.addText(t.T, { x: x + 0.08, y: 1.36, w: 2.1, h: 0.46, fontSize: 18, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0, charSpacing: 3 });
    s.addText(t.title, { x: x + 0.08, y: 1.78, w: 2.1, h: 0.35, fontSize: 10, color: "FFE0E0", fontFace: "Calibri", align: "center", margin: 0 });
    s.addText(t.pct, { x: x + 0.08, y: 2.13, w: 2.1, h: 0.28, fontSize: 9.5, color: C.gold, fontFace: "Calibri", bold: true, align: "center", margin: 0 });
    const bullets = t.items.map((item, idx) => ({
      text: item,
      options: { bullet: { code: "25B8" }, fontSize: 9.5, color: C.darkGray, breakLine: idx < t.items.length - 1 }
    }));
    s.addText(bullets, { x: x + 0.12, y: 2.48, w: 2.05, h: 2.6, fontFace: "Calibri", valign: "top", paraSpaceAfter: 3 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 4 — RISK FACTORS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Risk Factors", "Identify high-risk patients before delivery");

  addCard(s, 0.25, 1.4, 3.05, 3.9, "Uterine Atony", [
    "Polyhydramnios",
    "Multiple gestation",
    "Fetal macrosomia",
    "High parity (grand multipara)",
    "Prolonged or rapid labour",
    "Oxytocin augmentation",
    "Uterine-relaxing agents",
    "Chorioamnionitis",
  ], C.deepRed);

  addCard(s, 3.5, 1.4, 3.05, 3.9, "Caesarean Delivery", [
    "Pre-eclampsia",
    "Active labour disorders",
    "Prior PPH history",
    "Obesity",
    "General anaesthesia",
    "Intraamniotic infection",
    "Abnormal placentation",
    "Previous uterine surgery",
  ], C.steel);

  addCard(s, 6.75, 1.4, 3.0, 3.9, "General Risk Factors", [
    "Prior uterine surgery",
    "Placenta praevia",
    "Placenta accreta spectrum",
    "Coagulation disorders",
    "Anticoagulant therapy",
    "Anaemia pre-delivery",
    "Obstructed labour",
    "Abnormal fetal lie",
  ], C.teal);
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 5 — CLINICAL ASSESSMENT
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Initial Assessment & Stabilization", "Simultaneous evaluation and resuscitation");

  // numbered steps
  const steps = [
    { n: "01", label: "Vitals", text: "Continuous monitoring of HR, BP, SpO₂, RR" },
    { n: "02", label: "IV Access", text: "Two large-bore (≥16G) IV cannulae" },
    { n: "03", label: "Fluids", text: "IV Lactated Ringer's; prepare for blood transfusion" },
    { n: "04", label: "Oxygen", text: "Supplemental O₂ to optimise tissue delivery" },
    { n: "05", label: "Labs", text: "CBC, platelets, fibrinogen, PT, PTT, group & crossmatch" },
    { n: "06", label: "Ultrasound", text: "Bedside USS — retained placenta, clots, uterine tone" },
  ];

  steps.forEach((st, i) => {
    const col = i % 2 === 0 ? 0.25 : 5.15;
    const row = Math.floor(i / 2);
    const y = 1.42 + row * 1.3;

    s.addShape(pres.shapes.ELLIPSE, {
      x: col, y: y, w: 0.72, h: 0.72,
      fill: { color: C.deepRed }, line: { color: C.deepRed }
    });
    s.addText(st.n, { x: col, y: y + 0.06, w: 0.72, h: 0.55, fontSize: 14, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });

    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: col + 0.82, y: y, w: 3.7, h: 0.72,
      fill: { color: C.white }, line: { color: "D8C8C8", width: 0.8 }, rectRadius: 0.06
    });
    s.addText(st.label, { x: col + 0.98, y: y + 0.05, w: 3.4, h: 0.28, fontSize: 11, bold: true, color: C.deepRed, fontFace: "Calibri", margin: 0 });
    s.addText(st.text, { x: col + 0.98, y: y + 0.32, w: 3.4, h: 0.32, fontSize: 10, color: C.midGray, fontFace: "Calibri", margin: 0 });
  });

  // Source note
  s.addText("ACOG Practice Bulletin | Creasy & Resnik Maternal-Fetal Medicine 8e", {
    x: 0.25, y: 5.28, w: 9.5, h: 0.25,
    fontSize: 8.5, color: "AAAAAA", fontFace: "Calibri", italic: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 6 — UTEROTONIC DRUGS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Uterotonic Agents", "First-line pharmacotherapy for uterine atony");

  // Table header
  const cols = [1.8, 2.2, 1.9, 1.9, 2.2];
  const headers = ["Drug", "Dose / Route", "Line", "Caution", "Key Notes"];
  let xPos = 0.15;
  s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: 1.35, w: 9.7, h: 0.42, fill: { color: C.deepRed }, line: { color: C.deepRed } });
  headers.forEach((h, i) => {
    s.addText(h, { x: xPos + 0.05, y: 1.38, w: cols[i] - 0.1, h: 0.35, fontSize: 10.5, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
    xPos += cols[i];
  });

  const drugs = [
    ["Oxytocin", "20-30U in 1L IV\n≤100 mU/min", "1st", "Water intoxication", "NO IV bolus\n(→ hypotension)"],
    ["Methylergonovine", "0.2 mg IM\nq2–4 h", "2nd", "Hypertension\n(contraindicated)", "NO IV\n(→ HTN, vasospasm)"],
    ["Carboprost\n(15-Me PGF2α)", "250 μg IM\nq15–90 min\nMax 8 doses", "2nd", "Asthma / CVD\n(avoid)", "Monitor SpO₂;\nIntramyometrial use\nok at CS"],
    ["Misoprostol\n(PGE1)", "800–1000 μg\nrectal / SL", "3rd", "GI side effects", "Use when other\nagents fail"],
  ];

  drugs.forEach((row, ri) => {
    const bg = ri % 2 === 0 ? C.white : C.paleRose;
    let xp = 0.15;
    const yRow = 1.82 + ri * 0.87;
    s.addShape(pres.shapes.RECTANGLE, { x: 0.15, y: yRow, w: 9.7, h: 0.82, fill: { color: bg }, line: { color: "E0D0D0", width: 0.5 } });
    row.forEach((cell, ci) => {
      const isBold = ci === 0 || ci === 2;
      const cellColor = ci === 2 ? (ri === 0 ? C.teal : C.steel) : (ci === 3 ? C.crimson : C.darkGray);
      s.addText(cell, { x: xp + 0.07, y: yRow + 0.06, w: cols[ci] - 0.14, h: 0.7, fontSize: 9.5, color: cellColor, fontFace: "Calibri", bold: isBold, valign: "middle", margin: 0 });
      xp += cols[ci];
    });
  });

  s.addText("2025 Cochrane network meta-analysis (PMID 40237648): carbetocin and combination regimens may be superior to oxytocin alone for PPH prevention", {
    x: 0.15, y: 5.25, w: 9.7, h: 0.28,
    fontSize: 8.5, color: C.steel, fontFace: "Calibri", italic: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 7 — STEPWISE MANAGEMENT
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Stepwise Management of PPH", "Escalating intervention from medical → surgical");

  const steps = [
    { step: "Step 1", title: "Medical Management", items: ["Oxytocin IV infusion + bimanual uterine compression", "Methylergonovine 0.2 mg IM", "Carboprost 250 μg IM (if above fails)", "Misoprostol 800–1000 μg if all others fail"], col: C.teal },
    { step: "Step 2", title: "Tamponade", items: ["Bakri balloon or large Foley catheter", "Uterine gauze packing", "Especially for low placental implantation site"], col: C.steel },
    { step: "Step 3", title: "Interventional Radiology", items: ["Selective pelvic vessel embolisation", "Available at tertiary centres only", "Preserves fertility"], col: "7B4F2E" },
    { step: "Step 4", title: "Surgery (Laparotomy)", items: ["B-Lynch suture / uterine compression sutures", "Uterine artery ligation", "Internal iliac (hypogastric) artery ligation", "Peripartum hysterectomy (last resort)"], col: C.crimson },
  ];

  steps.forEach((st, i) => {
    const x = 0.22 + i * 2.42;
    // arrow connector (except last)
    if (i < 3) {
      s.addShape(pres.shapes.RECTANGLE, { x: x + 2.25, y: 2.65, w: 0.17, h: 0.3, fill: { color: "CCBBBB" }, line: { color: "CCBBBB" } });
    }
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y: 1.3, w: 2.25, h: 3.95,
      fill: { color: C.white }, line: { color: "E0D0D0", width: 0.8 }, rectRadius: 0.1,
      shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.1 }
    });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y: 1.3, w: 2.25, h: 1.1,
      fill: { color: st.col }, line: { color: st.col }, rectRadius: 0.1
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 1.95, w: 2.25, h: 0.45,
      fill: { color: st.col }, line: { color: st.col }
    });
    s.addText(st.step, { x: x + 0.08, y: 1.35, w: 2.1, h: 0.38, fontSize: 11, bold: true, color: "FFE0E0", fontFace: "Calibri", align: "center", margin: 0, charSpacing: 2 });
    s.addText(st.title, { x: x + 0.06, y: 1.7, w: 2.14, h: 0.7, fontSize: 10.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
    const bullets = st.items.map((item, idx) => ({
      text: item,
      options: { bullet: { code: "25B8" }, fontSize: 9.5, color: C.darkGray, breakLine: idx < st.items.length - 1 }
    }));
    s.addText(bullets, { x: x + 0.12, y: 2.48, w: 2.05, h: 2.6, fontFace: "Calibri", valign: "top", paraSpaceAfter: 4 });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 8 — SPECIFIC CAUSES & MANAGEMENT
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Management of Specific Causes", "Trauma, Tissue, Thrombin");

  addCard(s, 0.2, 1.35, 3.1, 3.9, "TRAUMA — Lacerations", [
    "Inspect cervix, vagina, perineum",
    "Good lighting + adequate exposure",
    "Repair all identified lacerations",
    "Firm fundus + ongoing bleed → occult laceration?",
    "Uterine rupture → immediate surgery",
    "Puerperal haematoma <4 cm: ice + observe",
    "Large haematoma: incise, irrigate, pack, ligate vessels",
  ], C.steel);

  addCard(s, 3.55, 1.35, 3.1, 3.9, "TISSUE — Retained Products", [
    "Manual uterine exploration",
    "Curettage for retained fragments",
    "Ultrasound: retained tissue / clots",
    "Placenta accreta spectrum:",
    "  → High suspicion if prior CS",
    "  → Plan for hysterectomy",
    "  → Multi-disciplinary team",
  ], C.teal);

  addCard(s, 6.9, 1.35, 2.85, 3.9, "THROMBIN — Coagulopathy", [
    "Treat underlying cause (DIC, HELLP)",
    "Tranexamic acid (TXA) — early",
    "Packed RBCs",
    "Fresh Frozen Plasma (FFP)",
    "Platelets",
    "Cryoprecipitate (fibrinogen)",
    "1:1:1 resuscitation ratio",
  ], C.crimson);
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 9 — UTERINE INVERSION
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Uterine Inversion", "Rare but life-threatening complication");

  // left panel - recognition
  addCard(s, 0.2, 1.35, 4.4, 2.0, "Recognition", [
    "Beefy-red mass at vaginal introitus (complete inversion)",
    "Uterine fundus not palpable abdominally",
    "Profound shock often disproportionate to visible blood loss",
    "Associated with fundal placentation",
  ], C.steel);

  // right panel - management
  addCard(s, 4.8, 1.35, 5.0, 2.0, "Immediate Management", [
    "IV fluid resuscitation, call anaesthesiologist immediately",
    "Tocolysis to relax cervical ring: MgSO₄, β-mimetics, nitroglycerin",
    "Johnson technique: firm upward pressure on fundus through vagina",
  ], C.deepRed);

  // surgical options
  addCard(s, 0.2, 3.5, 9.6, 1.8, "Surgical Options (if Johnson technique fails)", [
    "Huntington procedure: laparotomy — traction on round ligaments while assistant elevates fundus from below",
    "Haultain procedure: posterior longitudinal incision through inverted fundus to widen cervical ring, then re-invert; close incision (equivalent to classical CS scar)",
  ], "7B4F2E");
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 10 — PREVENTION (AMTSL)
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.lightGray }, line: { color: C.lightGray } });
  addHeader(s, "Prevention — Active Management of Third Stage of Labour (AMTSL)", "Reduces PPH by ~two-thirds");

  const components = [
    { num: "1", title: "Oxytocin", detail: "10 units IM at delivery of anterior shoulder\nor immediately after baby is born", col: C.teal },
    { num: "2", title: "Early Cord\nClamping", detail: "Clamp and cut the umbilical cord\nwithin 1–3 minutes of delivery", col: C.steel },
    { num: "3", title: "Controlled Cord\nTraction", detail: "Gentle downward traction on cord\nwhile supporting uterus (Brandt-Andrews)", col: C.deepRed },
    { num: "4", title: "Uterine\nMassage", detail: "Fundal massage after placental\ndelivery to maintain tone", col: "7B4F2E" },
  ];

  components.forEach((c, i) => {
    const x = 0.4 + i * 2.32;
    s.addShape(pres.shapes.ELLIPSE, { x: x + 0.72, y: 1.42, w: 0.82, h: 0.82, fill: { color: c.col }, line: { color: c.col } });
    s.addText(c.num, { x: x + 0.72, y: 1.5, w: 0.82, h: 0.65, fontSize: 20, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y: 2.38, w: 2.16, h: 2.82,
      fill: { color: C.white }, line: { color: "E0D0D0", width: 0.8 }, rectRadius: 0.1,
      shadow: { type: "outer", color: "000000", blur: 5, offset: 2, angle: 135, opacity: 0.1 }
    });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x, y: 2.38, w: 2.16, h: 0.55,
      fill: { color: c.col }, line: { color: c.col }, rectRadius: 0.1
    });
    s.addShape(pres.shapes.RECTANGLE, {
      x, y: 2.65, w: 2.16, h: 0.28,
      fill: { color: c.col }, line: { color: c.col }
    });
    s.addText(c.title, { x: x + 0.06, y: 2.42, w: 2.05, h: 0.52, fontSize: 10.5, bold: true, color: C.white, fontFace: "Calibri", align: "center", margin: 0 });
    s.addText(c.detail, { x: x + 0.1, y: 3.05, w: 1.96, h: 1.8, fontSize: 10, color: C.darkGray, fontFace: "Calibri", align: "center", margin: 0 });
  });

  // efficacy badge
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 2.8, y: 5.1, w: 4.4, h: 0.42,
    fill: { color: C.gold }, line: { color: C.gold }, rectRadius: 0.08
  });
  s.addText("AMTSL reduces postpartum haemorrhage by approximately two-thirds", {
    x: 2.8, y: 5.12, w: 4.4, h: 0.35,
    fontSize: 10, bold: true, color: C.darkGray, fontFace: "Calibri", align: "center", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 11 — SUMMARY / KEY POINTS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  // dark bg
  s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.deepRed }, line: { color: C.deepRed } });
  s.addShape(pres.shapes.ELLIPSE, { x: 6.5, y: -1.5, w: 5, h: 5, fill: { color: "A52020", transparency: 60 }, line: { color: "A52020", transparency: 60 } });
  s.addShape(pres.shapes.ELLIPSE, { x: -1.5, y: 3.5, w: 4, h: 4, fill: { color: "6B1010", transparency: 65 }, line: { color: "6B1010", transparency: 65 } });

  s.addShape(pres.shapes.RECTANGLE, { x: 0.45, y: 0.35, w: 0.12, h: 1.05, fill: { color: C.gold }, line: { color: C.gold } });
  s.addText("Key Points", { x: 0.7, y: 0.3, w: 8, h: 0.52, fontSize: 30, bold: true, color: C.white, fontFace: "Calibri", margin: 0 });
  s.addText("Postpartum Haemorrhage", { x: 0.7, y: 0.8, w: 8, h: 0.38, fontSize: 15, color: "F5C0C0", fontFace: "Calibri", margin: 0 });

  const points = [
    { icon: "▸", text: "PPH: >500 mL (vaginal) / >1000 mL (CS) within 24 hours; leading cause of maternal mortality worldwide" },
    { icon: "▸", text: "Remember the 4 Ts: Tone (70-80%), Trauma, Tissue, Thrombin" },
    { icon: "▸", text: "Uterine atony is the most common cause — treat with bimanual compression + oxytocin first" },
    { icon: "▸", text: "Escalate: Uterotonics → Tamponade → Interventional Radiology → Surgery → Hysterectomy" },
    { icon: "▸", text: "AMTSL (oxytocin + early cord clamping + controlled cord traction) reduces PPH by two-thirds" },
    { icon: "▸", text: "Placenta accreta and uterine inversion require early specialist input and surgical planning" },
  ];

  points.forEach((p, i) => {
    const y = 1.42 + i * 0.67;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: 0.3, y, w: 9.4, h: 0.58,
      fill: { color: "6B1010", transparency: 30 }, line: { color: "C07070", width: 0.5 }, rectRadius: 0.06
    });
    s.addText([
      { text: p.icon + "  ", options: { color: C.gold, bold: true, fontSize: 11 } },
      { text: p.text, options: { color: C.white, fontSize: 10.5 } },
    ], { x: 0.45, y: y + 0.06, w: 9.1, h: 0.45, fontFace: "Calibri", margin: 0, valign: "middle" });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// WRITE FILE
// ─────────────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/pph-ppt/PPH_Obstetrics.pptx" })
  .then(() => console.log("✅ PPH_Obstetrics.pptx created successfully"))
  .catch(err => { console.error("❌ Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/pph-ppt && node create_pph.js

Running Command

node -e "const p = require('pptxgenjs'); const pr = new p(); console.log(Object.keys(pr.shapes).filter(k => k.includes('RECT') || k.includes('rect')).slice(0,10))"

Running Command

node -e " const pptxgen = require('pptxgenjs'); const pres = new pptxgen(); const s = pres.addSlide(); s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x: 1, y: 1, w: 3, h: 2, fill: { color: 'FFFFFF' }, rectRadius: 0.1 }); console.log('ROUNDED_RECTANGLE OK'); s.addShape(pres.shapes.ELLIPSE, { x: 1, y: 1, w: 2, h: 2, fill: { color: 'FF0000' } }); console.log('ELLIPSE OK'); "

Running Command

node -e "const p = require('pptxgenjs'); const pr = new p(); console.log(Object.keys(pr.shapes).filter(k => k.includes('ELL') || k.includes('OVAL') || k.includes('CIRCLE')))"

Running Command

sed -i 's/pres\.shapes\.ELLIPSE/pres.shapes.OVAL/g' /home/daytona/workspace/pph-ppt/create_pph.js && echo "Done"

Editing File

~/pph-ppt/create_pph.js

Successfully replaced 6 instance(s) of the string in '/home/daytona/workspace/pph-ppt/create_pph.js'
Running Command

cd /home/daytona/workspace/pph-ppt && node create_pph.js

Your PPH presentation is ready!

PPH Obstetrics

Presentation · PPTX

The deck has 11 slides with a deep red medical theme:
SlideContent
1Title slide
2Definition & Classification (primary/secondary, vaginal/CS thresholds)
3The 4 Ts - Tone, Trauma, Tissue, Thrombin (with % frequency cards)
4Risk Factors (atony / CS / general)
5Initial Assessment & Stabilization (6-step numbered layout)
6Uterotonic Agents table (oxytocin, methylergonovine, carboprost, misoprostol)
7Stepwise Management (Medical → Tamponade → IR → Surgery)
8Management of specific causes (Trauma, Tissue, Thrombin)
9Uterine Inversion (recognition + Johnson/Huntington/Haultain techniques)
10Prevention - AMTSL (4 components with efficacy badge)
11Key Points summary (dark closing slide)

pdf format

Running Command

cd /home/daytona/workspace/pph-ppt && libreoffice --headless --convert-to pdf PPH_Obstetrics.pptx --outdir . 2>&1

Running Command

mkdir -p /home/daytona/workspace/pph-ppt/output && libreoffice --headless --convert-to pdf /home/daytona/workspace/pph-ppt/PPH_Obstetrics.pptx --outdir /home/daytona/workspace/pph-ppt/output 2>&1

Running Command

cp /home/daytona/workspace/pph-ppt/PPH_Obstetrics.pptx /tmp/PPH_Obstetrics.pptx && libreoffice --headless --convert-to pdf /tmp/PPH_Obstetrics.pptx --outdir /tmp 2>&1 && ls -lh /tmp/PPH_Obstetrics.pdf

Running Command

cp /tmp/PPH_Obstetrics.pdf /home/daytona/workspace/pph-ppt/PPH_Obstetrics.pdf && echo "Copied OK"

Here you go:

PPH Obstetrics

PDF Document · PDF

All 11 slides converted to PDF (264 KB).
This is a shared conversation. Sign in to Orris to start your own chat.