Make ppt on normal labour from oxorn foote and D.C.Dutta and make it more creative crisp amd pictorical with many pictures in ppt
normal labour stages mechanism obstetrics Oxorn Foote DC Dutta key points
normal labour mechanism cardinal movements obstetrics images free medical education
mkdir -p /home/daytona/workspace/normal-labour-ppt && ls /home/daytona/workspace/normal-labour-ppt/
node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://cdn.lecturio.com/assets/The-cardinal-movements-of-labor.jpg" \ "https://www.childbirthgraphics.com/c.3352071/childbirthgraphics/img/Cardinal-Movements-Large-Chart.jpg" \ 2>/dev/null | node -e "const d=require('fs');let s='';process.stdin.on('data',c=>s+=c);process.stdin.on('end',()=>{const r=JSON.parse(s);r.forEach((x,i)=>console.log(i,x.error?'ERROR:'+x.error:x.base64.substring(0,40)));})"
stages of labour uterine contractions cervical dilation partograph obstetrics diagram
node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://d45jl3w9libvn.cloudfront.net/jaypee/static/books/9789351527237/Chapters/images/151-1.jpg" \ 2>/dev/null | node -e "const d=require('fs');let s='';process.stdin.on('data',c=>s+=c);process.stdin.on('end',()=>{const r=JSON.parse(s);r.forEach((x,i)=>console.log(i,x.error?'ERROR:'+x.error:x.base64.substring(0,50)));})"
~/normal-labour-ppt/create_ppt.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ── Fetch images ──────────────────────────────────────────────────────────────
function fetchImages(urls) {
try {
const result = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`,
{ maxBuffer: 50 * 1024 * 1024 }
);
return JSON.parse(result.toString());
} catch (e) {
return urls.map(() => ({ error: "fetch failed", base64: null }));
}
}
const imageUrls = [
"https://cdn.lecturio.com/assets/The-cardinal-movements-of-labor.jpg",
"https://www.childbirthgraphics.com/c.3352071/childbirthgraphics/img/Cardinal-Movements-Large-Chart.jpg",
"https://d45jl3w9libvn.cloudfront.net/jaypee/static/books/9789351527237/Chapters/images/151-1.jpg",
];
console.log("Fetching images...");
const imgs = fetchImages(imageUrls);
console.log("Images fetched:", imgs.map((x, i) => `${i}: ${x.error || "OK"}`));
// ── Color palette ─────────────────────────────────────────────────────────────
const C = {
navy: "0D2B4E", // dominant dark
teal: "1B8A8F", // accent
rose: "E05A6B", // highlight
amber: "F4A847", // accent 2
cream: "FDF6EC", // light bg
white: "FFFFFF",
slate: "4A5568", // body text
ltTeal: "D4F0F2", // light teal for cards
ltRose: "FDEAED", // light rose for cards
ltAmber: "FEF3DC", // light amber
};
// ── PPT setup ─────────────────────────────────────────────────────────────────
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Medical Education";
pres.title = "Normal Labour";
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
// full-bleed navy background
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.navy } });
// teal diagonal accent band
s.addShape(pres.ShapeType.rect, { x:0, y:3.8, w:10, h:0.35, fill:{ color:C.teal }, line:{ color:C.teal } });
// rose accent bar top
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.18, fill:{ color:C.rose }, line:{ color:C.rose } });
// Big uterus / baby silhouette using geometric shapes
s.addShape(pres.ShapeType.ellipse, { x:6.8, y:0.6, w:2.8, h:3.5,
fill:{ color:"1A3F6A" }, line:{ color:C.teal, width:2 } });
// baby circle inside
s.addShape(pres.ShapeType.ellipse, { x:7.15, y:0.85, w:1.0, h:1.0,
fill:{ color:C.teal }, line:{ color:C.teal } });
// body oval
s.addShape(pres.ShapeType.ellipse, { x:7.05, y:1.7, w:1.2, h:1.8,
fill:{ color:"16707A" }, line:{ color:C.teal } });
s.addText("NORMAL", { x:0.5, y:0.55, w:6, h:0.9, fontSize:54, bold:true,
color:C.white, fontFace:"Calibri", charSpacing:8 });
s.addText("LABOUR", { x:0.5, y:1.4, w:6, h:0.9, fontSize:54, bold:true,
color:C.amber, fontFace:"Calibri", charSpacing:8 });
s.addText("Physiology · Mechanism · Management", {
x:0.5, y:2.35, w:6, h:0.45, fontSize:16, color:C.ltTeal,
fontFace:"Calibri", italic:true });
// divider line
s.addShape(pres.ShapeType.line, { x:0.5, y:2.88, w:5.5, h:0,
line:{ color:C.rose, width:2 } });
s.addText([
{ text:"📖 Sources: ", options:{ bold:true } },
{ text:"Oxorn-Foote Human Labour & Birth (6e) • DC Dutta Textbook of Obstetrics (9e)" },
], { x:0.5, y:3.0, w:9, h:0.4, fontSize:12, color:C.ltTeal, fontFace:"Calibri" });
s.addText("Presented by Medical Education Department", {
x:0.5, y:4.5, w:9, h:0.35, fontSize:11, color:"7A9EB5", fontFace:"Calibri", italic:true });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — OVERVIEW / CONTENTS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.7, fill:{ color:C.navy } });
s.addText("AT A GLANCE", { x:0.3, y:0.1, w:9, h:0.5, fontSize:22, bold:true,
color:C.white, fontFace:"Calibri" });
const boxes = [
{ label:"01", title:"Definition &\nDiagnosis", emoji:"🔍", col:C.ltTeal, accent:C.teal, x:0.3 },
{ label:"02", title:"3 Ps of\nLabour", emoji:"🧩", col:C.ltRose, accent:C.rose, x:2.55 },
{ label:"03", title:"Stages of\nLabour", emoji:"📊", col:C.ltAmber, accent:C.amber, x:4.8 },
{ label:"04", title:"Cardinal\nMovements", emoji:"🌀", col:C.ltTeal, accent:C.teal, x:7.05 },
];
boxes.forEach(b => {
s.addShape(pres.ShapeType.roundRect, { x:b.x, y:0.9, w:2.1, h:2.2,
fill:{ color:b.col }, line:{ color:b.accent, width:2 }, rectRadius:0.12 });
s.addText(b.label, { x:b.x+0.08, y:0.95, w:0.5, h:0.4, fontSize:11,
bold:true, color:b.accent });
s.addText(b.emoji, { x:b.x+0.6, y:1.05, w:0.9, h:0.7, fontSize:28, align:"center" });
s.addText(b.title, { x:b.x+0.08, y:1.8, w:1.95, h:0.8, fontSize:13,
bold:true, color:C.navy, fontFace:"Calibri", align:"center" });
});
const boxes2 = [
{ label:"05", title:"Active\nManagement", emoji:"💉", col:C.ltRose, accent:C.rose, x:0.3 },
{ label:"06", title:"Partograph", emoji:"📈", col:C.ltAmber, accent:C.amber, x:2.55 },
{ label:"07", title:"Third Stage\nLabour", emoji:"🩺", col:C.ltTeal, accent:C.teal, x:4.8 },
{ label:"08", title:"Complications\n& Care", emoji:"⚠️", col:C.ltRose, accent:C.rose, x:7.05 },
];
boxes2.forEach(b => {
s.addShape(pres.ShapeType.roundRect, { x:b.x, y:3.25, w:2.1, h:2.1,
fill:{ color:b.col }, line:{ color:b.accent, width:2 }, rectRadius:0.12 });
s.addText(b.label, { x:b.x+0.08, y:3.3, w:0.5, h:0.4, fontSize:11,
bold:true, color:b.accent });
s.addText(b.emoji, { x:b.x+0.6, y:3.4, w:0.9, h:0.65, fontSize:26, align:"center" });
s.addText(b.title, { x:b.x+0.08, y:4.1, w:1.95, h:0.8, fontSize:13,
bold:true, color:C.navy, fontFace:"Calibri", align:"center" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — DEFINITION
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.18, h:5.625, fill:{ color:C.teal } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.75, fill:{ color:C.teal } });
s.addText("DEFINITION & DIAGNOSIS", { x:0.3, y:0.12, w:9, h:0.5,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri" });
// big quote box
s.addShape(pres.ShapeType.roundRect, { x:0.4, y:0.9, w:9.2, h:1.55,
fill:{ color:"E8F6F7" }, line:{ color:C.teal, width:2 }, rectRadius:0.1 });
s.addText(""", { x:0.5, y:0.78, w:0.6, h:0.8, fontSize:50, color:C.teal, bold:true });
s.addText(
"Labour is the process by which the products of conception are expelled from the uterus after the period of viability.",
{ x:0.9, y:0.97, w:8.5, h:0.7, fontSize:15, color:C.navy,
fontFace:"Calibri", italic:true, align:"center" });
s.addText("— DC Dutta, Textbook of Obstetrics", { x:0.9, y:1.65, w:8.5, h:0.3,
fontSize:11, color:C.teal, align:"right", italic:true });
// WHO definition
s.addShape(pres.ShapeType.roundRect, { x:0.4, y:2.6, w:9.2, h:0.9,
fill:{ color:C.ltAmber }, line:{ color:C.amber, width:1.5 }, rectRadius:0.1 });
s.addText("🌍 WHO Definition of Normal Labour:", { x:0.65, y:2.65, w:4, h:0.35,
fontSize:12, bold:true, color:C.navy });
s.addText(
"Spontaneous onset • Low risk at start & throughout • Cephalic presentation • 37–42 weeks • No intervention required • Healthy mother & baby",
{ x:0.65, y:2.92, w:8.8, h:0.45, fontSize:12, color:C.slate });
// Signs of true labour cards
const signs = [
{ icon:"🔄", title:"Regular\nContractions", desc:"Painful, rhythmic,\nincreasing frequency" },
{ icon:"📏", title:"Cervical\nChanges", desc:"Effacement\n& Dilatation" },
{ icon:"🩸", title:"Show", desc:"Blood-stained\nmucus plug" },
{ icon:"💧", title:"ROM", desc:"Rupture of\nmembranes (possible)" },
];
signs.forEach((sg, i) => {
const bx = 0.4 + i * 2.35;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:3.65, w:2.15, h:1.7,
fill:{ color:C.ltTeal }, line:{ color:C.teal, width:1.5 }, rectRadius:0.1 });
s.addText(sg.icon, { x:bx, y:3.72, w:2.15, h:0.55, fontSize:22, align:"center" });
s.addText(sg.title, { x:bx+0.05, y:4.25, w:2.05, h:0.45, fontSize:11,
bold:true, color:C.navy, align:"center", fontFace:"Calibri" });
s.addText(sg.desc, { x:bx+0.05, y:4.68, w:2.05, h:0.55, fontSize:10,
color:C.slate, align:"center" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — 3 Ps OF LABOUR
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.rose } });
s.addText("THE 3 Ps OF LABOUR", { x:0.3, y:0.12, w:9.4, h:0.5,
fontSize:26, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
s.addText("Power · Passage · Passenger", { x:0.3, y:0.55, w:9.4, h:0.22,
fontSize:12, color:"FFD9DE", align:"center", italic:true });
const ps = [
{
title:"POWER", emoji:"⚡",
subtitle:"Uterine Contractions",
color: C.ltRose, accent: C.rose,
points:[
"Fundal dominance — strongest at fundus",
"Polarity — upper segment contracts, lower relaxes",
"Frequency: 3–5 / 10 min in active phase",
"Duration: 45–60 seconds",
"Intensity: 40–60 mmHg (active phase)",
"Retraction: progressive shortening of muscle fibres",
],
x:0.3, w:2.9
},
{
title:"PASSAGE", emoji:"🏞️",
subtitle:"Bony Pelvis & Soft Tissues",
color: C.ltTeal, accent: C.teal,
points:[
"Pelvic inlet: transverse diameter 13 cm",
"Mid-pelvis: ischial spines (narrowest)",
"Pelvic outlet: AP diameter 11 cm",
"Gynecoid pelvis — most favourable",
"Subpubic angle ≥ 90° (female)",
"Soft tissue: cervix, vagina, perineum",
],
x:3.55, w:2.9
},
{
title:"PASSENGER", emoji:"👶",
subtitle:"Fetus & Placenta",
color: C.ltAmber, accent: C.amber,
points:[
"Fetal skull — most important presenting part",
"BPD: 9.5 cm | SOB: 9.5 cm (most favourable)",
"Attitude: flexion (vertex presentation)",
"Lie: longitudinal (normal)",
"Presentation: cephalic (vertex)",
"Position: LOA — most common",
],
x:6.8, w:2.9
},
];
ps.forEach(p => {
s.addShape(pres.ShapeType.roundRect, { x:p.x, y:0.85, w:p.w, h:4.55,
fill:{ color:p.color }, line:{ color:p.accent, width:2 }, rectRadius:0.12 });
s.addText(p.emoji, { x:p.x, y:0.95, w:p.w, h:0.55, fontSize:28, align:"center" });
s.addText(p.title, { x:p.x+0.1, y:1.48, w:p.w-0.2, h:0.42, fontSize:16,
bold:true, color:p.accent, fontFace:"Calibri", align:"center" });
s.addText(p.subtitle, { x:p.x+0.1, y:1.87, w:p.w-0.2, h:0.3, fontSize:10.5,
color:C.slate, align:"center", italic:true });
s.addShape(pres.ShapeType.line, { x:p.x+0.2, y:2.22, w:p.w-0.4, h:0,
line:{ color:p.accent, width:1 } });
const items = p.points.map((pt, i) => ({
text: pt,
options: { bullet:{ code:"25B8" }, breakLine: i < p.points.length-1, color:C.slate, fontSize:10.5 }
}));
s.addText(items, { x:p.x+0.18, y:2.3, w:p.w-0.3, h:3.0, fontFace:"Calibri" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — STAGES OF LABOUR (timeline)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.navy } });
s.addText("STAGES OF LABOUR", { x:0.3, y:0.13, w:9.4, h:0.47,
fontSize:26, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// horizontal timeline bar
s.addShape(pres.ShapeType.rect, { x:0.4, y:1.6, w:9.2, h:0.28,
fill:{ color:"D1D5DB" }, line:{ color:"D1D5DB" } });
const stages = [
{
num:"I", label:"FIRST STAGE", x:0.4, w:3.2, color:C.teal, lt:C.ltTeal,
dot:{ x:0.55, y:1.5 },
sub:"Onset → Full Dilatation (10 cm)",
dur:[ "Primi: 12–14 hrs", "Multi: 6–8 hrs" ],
phases:[
"🔵 Latent: 0–3 cm, slow dilation",
"🟡 Active: 4–10 cm, 1 cm/hr",
"🔴 Transition: 8–10 cm, intense",
],
},
{
num:"II", label:"SECOND STAGE", x:3.75, w:3.0, color:C.rose, lt:C.ltRose,
dot:{ x:3.9, y:1.5 },
sub:"Full Dilatation → Delivery of Baby",
dur:[ "Primi: 1–2 hrs", "Multi: 30 min" ],
phases:[
"👶 Cardinal movements occur",
"🌀 Engagement → Expulsion",
"⚡ Pushing & crowning",
],
},
{
num:"III", label:"THIRD STAGE", x:6.9, w:2.7, color:C.amber, lt:C.ltAmber,
dot:{ x:7.05, y:1.5 },
sub:"Delivery of Placenta",
dur:[ "5–30 minutes", "Active management" ],
phases:[
"📌 Placental separation",
"🔽 Schultze / Matthews Duncan",
"💉 Oxytocin 10 IU IM",
],
},
];
stages.forEach(st => {
// timeline dot
s.addShape(pres.ShapeType.ellipse, { x:st.dot.x, y:st.dot.y, w:0.32, h:0.32,
fill:{ color:st.color }, line:{ color:st.color } });
// card
s.addShape(pres.ShapeType.roundRect, { x:st.x, y:1.98, w:st.w, h:3.42,
fill:{ color:st.lt }, line:{ color:st.color, width:2 }, rectRadius:0.12 });
s.addShape(pres.ShapeType.rect, { x:st.x, y:1.98, w:st.w, h:0.5,
fill:{ color:st.color }, line:{ color:st.color } });
s.addText(`STAGE ${st.num}`, { x:st.x+0.08, y:2.01, w:st.w-0.16, h:0.44,
fontSize:14, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
s.addText(st.sub, { x:st.x+0.1, y:2.55, w:st.w-0.2, h:0.45,
fontSize:10.5, color:C.navy, italic:true, align:"center" });
s.addShape(pres.ShapeType.roundRect, { x:st.x+0.1, y:3.08, w:st.w-0.2, h:0.52,
fill:{ color:"FFFFFF" }, line:{ color:st.color, width:1 }, rectRadius:0.07 });
s.addText("⏱ " + st.dur[0] + " | " + st.dur[1], {
x:st.x+0.12, y:3.12, w:st.w-0.24, h:0.44, fontSize:10, color:C.slate, align:"center" });
const items = st.phases.map((p, i) => ({
text: p,
options:{ bullet:false, breakLine: i < st.phases.length-1, color:C.slate, fontSize:10.5 }
}));
s.addText(items, { x:st.x+0.15, y:3.7, w:st.w-0.3, h:1.55, fontFace:"Calibri" });
});
// connector arrows
s.addShape(pres.ShapeType.line, { x:3.65, y:1.64, w:0.3, h:0,
line:{ color:C.slate, width:1.5, endArrowType:"arrow" } });
s.addShape(pres.ShapeType.line, { x:6.82, y:1.64, w:0.3, h:0,
line:{ color:C.slate, width:1.5, endArrowType:"arrow" } });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — FIRST STAGE IN DEPTH (Partograph concept)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.teal } });
s.addText("FIRST STAGE: CERVIMETRY & PARTOGRAPH", { x:0.3, y:0.14, w:9.4, h:0.47,
fontSize:22, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// Phase cards
const phases = [
{ name:"LATENT PHASE", icon:"🌙", color:C.ltTeal, accent:C.teal,
points:["0–3 cm dilation","Irregular contractions","Duration: up to 8 hrs (primi)","Cervical effacement occurs"] },
{ name:"ACTIVE PHASE", icon:"⚡", color:C.ltRose, accent:C.rose,
points:["4–10 cm dilation","Regular strong contractions","Rate: ≥1 cm/hr","Friedman curve applies"] },
{ name:"TRANSITION", icon:"🔥", color:C.ltAmber, accent:C.amber,
points:["8–10 cm","Most intense contractions","Urge to push begins","Full effacement complete"] },
];
phases.forEach((p, i) => {
const bx = 0.3 + i * 3.15;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:0.88, w:2.95, h:2.15,
fill:{ color:p.color }, line:{ color:p.accent, width:2 }, rectRadius:0.1 });
s.addText(p.icon, { x:bx, y:0.93, w:2.95, h:0.52, fontSize:24, align:"center" });
s.addText(p.name, { x:bx+0.1, y:1.44, w:2.75, h:0.4,
fontSize:12, bold:true, color:p.accent, align:"center" });
const items = p.points.map((pt, j) => ({
text:pt, options:{ bullet:true, breakLine:j<p.points.length-1, fontSize:10, color:C.slate }
}));
s.addText(items, { x:bx+0.12, y:1.88, w:2.7, h:1.0 });
});
// Partograph description box
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:3.15, w:9.4, h:2.25,
fill:{ color:C.white }, line:{ color:C.teal, width:2 }, rectRadius:0.12 });
s.addShape(pres.ShapeType.rect, { x:0.3, y:3.15, w:9.4, h:0.42,
fill:{ color:C.teal }, line:{ color:C.teal } });
s.addText("📈 PARTOGRAPH (WHO Tool)", { x:0.45, y:3.18, w:9.1, h:0.36,
fontSize:14, bold:true, color:C.white, fontFace:"Calibri" });
const pcols = [
{ title:"Alert Line", desc:"1 cm/hr from 4 cm\nDilation should stay LEFT", color:C.teal },
{ title:"Action Line", desc:"4 hrs right of alert\nCrossing = intervention", color:C.rose },
{ title:"Parameters", desc:"FHR • Contractions\nDescent • Vitals", color:C.amber },
{ title:"Decision Aid", desc:"Early detection of\nAbnormal labour", color:C.navy },
];
pcols.forEach((pc, i) => {
const cx = 0.5 + i * 2.35;
s.addShape(pres.ShapeType.roundRect, { x:cx, y:3.65, w:2.1, h:1.55,
fill:{ color:C.cream }, line:{ color:pc.color, width:1.5 }, rectRadius:0.08 });
s.addShape(pres.ShapeType.rect, { x:cx, y:3.65, w:2.1, h:0.32,
fill:{ color:pc.color }, line:{ color:pc.color } });
s.addText(pc.title, { x:cx+0.05, y:3.67, w:2.0, h:0.28,
fontSize:11, bold:true, color:C.white, align:"center" });
s.addText(pc.desc, { x:cx+0.05, y:4.02, w:2.0, h:1.0,
fontSize:10.5, color:C.slate, align:"center" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — FETAL SKULL (image slide)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.navy } });
s.addText("FETAL SKULL — KEY DIAMETERS", { x:0.3, y:0.13, w:9.4, h:0.47,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// try to embed the partograph/obstetric image if available
if (imgs[2] && !imgs[2].error) {
s.addImage({ data: imgs[2].base64, x:5.3, y:0.85, w:4.4, h:4.5 });
}
const dims = [
{ d:"SOB (Sub-occipito Bregmatic)", v:"9.5 cm", note:"Fully flexed vertex — most favourable", color:C.teal },
{ d:"SOF (Sub-occipito Frontal)", v:"10 cm", note:"Partially flexed", color:C.teal },
{ d:"OF (Occipito Frontal)", v:"11.5 cm", note:"Military attitude", color:C.amber },
{ d:"OM (Occipito Mental)", v:"13.5 cm", note:"Face presentation", color:C.rose },
{ d:"BPD (Biparietal Diameter)", v:"9.5 cm", note:"Transverse — engagement", color:C.navy },
{ d:"Bitemporal", v:"8.0 cm", note:"Smallest transverse", color:C.navy },
];
dims.forEach((d, i) => {
const bx = 0.3;
const by = 0.9 + i * 0.77;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.7, h:0.65,
fill:{ color:C.cream }, line:{ color:d.color, width:1.5 }, rectRadius:0.07 });
s.addShape(pres.ShapeType.rect, { x:bx, y:by, w:0.22, h:0.65,
fill:{ color:d.color }, line:{ color:d.color } });
s.addText(d.d, { x:bx+0.3, y:by+0.05, w:2.6, h:0.3, fontSize:11, bold:true, color:C.navy });
s.addText(d.v, { x:bx+2.95, y:by+0.05, w:0.8, h:0.3, fontSize:12, bold:true, color:d.color, align:"center" });
s.addText(d.note, { x:bx+0.3, y:by+0.35, w:4.2, h:0.25, fontSize:9.5, color:C.slate, italic:true });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — CARDINAL MOVEMENTS (with image)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.rose } });
s.addText("CARDINAL MOVEMENTS OF LABOUR", { x:0.3, y:0.13, w:9.4, h:0.47,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// Embed cardinal movements image
if (imgs[0] && !imgs[0].error) {
s.addImage({ data: imgs[0].base64, x:5.35, y:0.85, w:4.4, h:4.6 });
s.addText("Source: Lecturio Medical", { x:5.35, y:5.2, w:4.4, h:0.3,
fontSize:8, color:C.slate, italic:true, align:"center" });
}
const moves = [
{ n:"1", name:"ENGAGEMENT", desc:"BPD passes pelvic inlet,\noccurs before/during labour" },
{ n:"2", name:"DESCENT", desc:"Throughout labour;\ncontinuous progressive" },
{ n:"3", name:"FLEXION", desc:"Head flexes on neck;\nSOB becomes presenting diameter" },
{ n:"4", name:"INTERNAL ROTATION",desc:"Occiput rotates to OA;\noccurs at ischial spines level" },
{ n:"5", name:"EXTENSION", desc:"Head delivers under\npubic symphysis" },
{ n:"6", name:"RESTITUTION", desc:"Head realigns with\nfetal shoulders (45°)" },
{ n:"7", name:"EXTERNAL ROTATION",desc:"Further 45° rotation;\nshoulders align with outlet" },
];
moves.forEach((m, i) => {
const by = 0.85 + i * 0.68;
const colors = [C.teal, C.rose, C.amber, C.teal, C.rose, C.amber, C.teal];
const bgs = [C.ltTeal, C.ltRose, C.ltAmber, C.ltTeal, C.ltRose, C.ltAmber, C.ltTeal];
s.addShape(pres.ShapeType.roundRect, { x:0.25, y:by, w:4.85, h:0.6,
fill:{ color:bgs[i] }, line:{ color:colors[i], width:1.5 }, rectRadius:0.08 });
s.addShape(pres.ShapeType.ellipse, { x:0.3, y:by+0.12, w:0.36, h:0.36,
fill:{ color:colors[i] }, line:{ color:colors[i] } });
s.addText(m.n, { x:0.3, y:by+0.11, w:0.36, h:0.36,
fontSize:11, bold:true, color:C.white, align:"center", valign:"middle" });
s.addText(m.name, { x:0.74, y:by+0.04, w:1.9, h:0.28,
fontSize:11, bold:true, color:C.navy, fontFace:"Calibri" });
s.addText(m.desc, { x:0.74, y:by+0.32, w:4.2, h:0.26,
fontSize:9.5, color:C.slate });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — SECOND STAGE: DELIVERY OF HEAD
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.navy } });
s.addText("SECOND STAGE — DELIVERY OF HEAD & SHOULDERS", {
x:0.3, y:0.12, w:9.4, h:0.5, fontSize:20, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// Steps of delivery
const steps = [
{ step:"1", title:"Pushing Phase", color:C.teal, lt:C.ltTeal,
details:"Active pushing with contractions\nValsalva / physiological pushing\nFetal head descends to perineum" },
{ step:"2", title:"Crowning", color:C.rose, lt:C.ltRose,
details:"Largest diameter distends vulva\n'Ring of fire' felt by mother\nHead not recedes between contractions" },
{ step:"3", title:"Delivery of Head", color:C.amber, lt:C.ltAmber,
details:"Guard perineum (Ritgen manoeuvre)\nHead delivered with gentle pressure\nCheck for nuchal cord" },
{ step:"4", title:"Delivery of Shoulders", color:C.teal, lt:C.ltTeal,
details:"Anterior shoulder first (downward traction)\nThen posterior shoulder\nBaby delivered in 1 continuous movement" },
];
steps.forEach((st, i) => {
const row = Math.floor(i/2);
const col = i % 2;
const bx = 0.3 + col * 4.85;
const by = 0.88 + row * 2.32;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.6, h:2.12,
fill:{ color:st.lt }, line:{ color:st.color, width:2 }, rectRadius:0.12 });
s.addShape(pres.ShapeType.rect, { x:bx, y:by, w:4.6, h:0.45,
fill:{ color:st.color }, line:{ color:st.color } });
s.addShape(pres.ShapeType.ellipse, { x:bx+0.12, y:by+0.06, w:0.33, h:0.33,
fill:{ color:C.white }, line:{ color:C.white } });
s.addText(st.step, { x:bx+0.12, y:by+0.05, w:0.33, h:0.33,
fontSize:11, bold:true, color:st.color, align:"center", valign:"middle" });
s.addText(st.title, { x:bx+0.54, y:by+0.06, w:4.0, h:0.35,
fontSize:14, bold:true, color:C.white, fontFace:"Calibri" });
s.addText(st.details, { x:bx+0.15, y:by+0.55, w:4.3, h:1.4,
fontSize:12, color:C.slate, fontFace:"Calibri" });
});
// Episiotomy note
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:5.1, w:9.4, h:0.38,
fill:{ color:"FEF3DC" }, line:{ color:C.amber, width:1.5 }, rectRadius:0.07 });
s.addText("⚠️ Episiotomy: NOT routine — only if indicated (fetal distress, rigid perineum) — DC Dutta", {
x:0.45, y:5.12, w:9.1, h:0.32, fontSize:11, color:C.slate, italic:true });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — THIRD STAGE & ACTIVE MANAGEMENT
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.amber } });
s.addText("THIRD STAGE & ACTIVE MANAGEMENT (AMTSL)", {
x:0.3, y:0.12, w:9.4, h:0.5, fontSize:22, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// Placental separation mechanisms
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:0.85, w:9.4, h:0.5,
fill:{ color:C.white }, line:{ color:C.amber, width:1.5 }, rectRadius:0.08 });
s.addText("💡 Placental Separation Mechanisms:", { x:0.5, y:0.88, w:4, h:0.3, fontSize:12, bold:true, color:C.navy });
s.addText("Schultze (80%): central separation, fetal surface first, cleaner • Matthews Duncan (20%): edge separation, maternal surface, more bleeding",
{ x:0.5, y:1.08, w:9.1, h:0.25, fontSize:10.5, color:C.slate });
// AMTSL steps
const amtsl = [
{ n:"1", act:"OXYTOCIN 10 IU IM", time:"Within 1 min of birth", icon:"💉",
note:"Drug of choice\n(Oxorn-Foote & Dutta)", color:C.teal },
{ n:"2", act:"CONTROLLED CORD\nTRACTION", time:"With uterine contraction", icon:"✋",
note:"Brandt-Andrews method\nAvoid if uterus not contracted", color:C.rose },
{ n:"3", act:"UTERINE MASSAGE", time:"After placenta delivered", icon:"🔄",
note:"Sustained compression\nPrevent PPH", color:C.amber },
];
amtsl.forEach((a, i) => {
const bx = 0.3 + i * 3.15;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:1.48, w:3.0, h:2.6,
fill:{ color:C.white }, line:{ color:a.color, width:2.5 }, rectRadius:0.12 });
s.addShape(pres.ShapeType.ellipse, { x:bx+1.1, y:1.55, w:0.8, h:0.8,
fill:{ color:a.color }, line:{ color:a.color } });
s.addText(a.icon, { x:bx+1.1, y:1.54, w:0.8, h:0.8, fontSize:20, align:"center", valign:"middle" });
s.addShape(pres.ShapeType.ellipse, { x:bx+2.55, y:1.55, w:0.32, h:0.32,
fill:{ color:a.color }, line:{ color:a.color } });
s.addText(a.n, { x:bx+2.55, y:1.54, w:0.32, h:0.32,
fontSize:11, bold:true, color:C.white, align:"center", valign:"middle" });
s.addText(a.act, { x:bx+0.12, y:2.42, w:2.75, h:0.6,
fontSize:12, bold:true, color:a.color, align:"center", fontFace:"Calibri" });
s.addText("⏱ " + a.time, { x:bx+0.12, y:3.0, w:2.75, h:0.3,
fontSize:10, color:C.slate, align:"center", italic:true });
s.addText(a.note, { x:bx+0.12, y:3.32, w:2.75, h:0.6,
fontSize:10, color:C.slate, align:"center" });
});
// Signs of placental separation
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:4.25, w:9.4, h:1.2,
fill:{ color:"E8F6F7" }, line:{ color:C.teal, width:1.5 }, rectRadius:0.1 });
s.addText("Signs of Placental Separation:", { x:0.5, y:4.3, w:3, h:0.32, fontSize:12, bold:true, color:C.teal });
const signs = [
"🔺 Uterus becomes globular & firm",
"⬆️ Uterus rises in abdomen",
"🩸 Gush of blood",
"📏 Cord lengthens at vulva",
];
s.addText(signs.join(" | "), { x:0.5, y:4.65, w:9.1, h:0.6,
fontSize:11, color:C.slate, fontFace:"Calibri" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — COMPLICATIONS & ABNORMAL LABOUR
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:"8B1A2C" } });
s.addText("WHEN LABOUR DEVIATES — RED FLAGS", {
x:0.3, y:0.13, w:9.4, h:0.47, fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const flags = [
{ cat:"PROLONGED LABOUR", color:"8B1A2C", items:[
"Prolonged latent phase: >20 hrs (primi), >14 hrs (multi)",
"Prolonged active phase: <1 cm/hr",
"Prolonged 2nd stage: >2 hrs (primi), >1 hr (multi)",
]},
{ cat:"FETAL DISTRESS", color:C.rose, items:[
"FHR <100 or >160 bpm",
"Late decelerations / variable decelerations",
"Thick meconium-stained liquor",
]},
{ cat:"MATERNAL DISTRESS", color:C.amber, items:[
"Bandl's ring — obstructed labour",
"Maternal exhaustion",
"Pyrexia >38°C in labour",
]},
{ cat:"PPH (PRIMARY)", color:C.teal, items:[
"Blood loss >500 mL (vaginal) or >1000 mL (LSCS)",
"4 Ts: Tone, Trauma, Tissue, Thrombin",
"Oxytocin → Misoprostol → B-Lynch suture",
]},
];
flags.forEach((f, i) => {
const row = Math.floor(i/2);
const col = i % 2;
const bx = 0.3 + col * 4.85;
const by = 0.9 + row * 2.35;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.6, h:2.18,
fill:{ color:C.cream }, line:{ color:f.color, width:2 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:by, w:4.6, h:0.4,
fill:{ color:f.color }, line:{ color:f.color } });
s.addText("⚠️ " + f.cat, { x:bx+0.1, y:by+0.04, w:4.4, h:0.32,
fontSize:12, bold:true, color:C.white, fontFace:"Calibri" });
const items = f.items.map((it, j) => ({
text:"• " + it,
options:{ breakLine: j < f.items.length-1, fontSize:11, color:C.slate }
}));
s.addText(items, { x:bx+0.15, y:by+0.5, w:4.3, h:1.55, fontFace:"Calibri" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — ANALGESIA IN LABOUR
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.teal } });
s.addText("PAIN RELIEF IN LABOUR", {
x:0.3, y:0.13, w:9.4, h:0.47, fontSize:26, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const methods = [
{ name:"Non-\nPharmacological", icon:"🧘", color:C.teal, lt:C.ltTeal,
items:["Breathing techniques","Hydrotherapy","Massage & mobilisation","TENS machine","Continuous support"] },
{ name:"Systemic\nAnalgesia", icon:"💊", color:C.rose, lt:C.ltRose,
items:["Pethidine 50–100 mg IM","Tramadol","Entonox (N₂O + O₂)","Avoid near delivery","Fetal resp. depression risk"] },
{ name:"Regional\nAnalgesia", icon:"💉", color:C.amber, lt:C.ltAmber,
items:["Epidural — GOLD standard","CSE (Combined spinal-epidural)","Continuous infusion","Allows instrumental delivery","Monitor BP closely"] },
{ name:"Paracervical\n& Pudendal", icon:"🎯", color:C.navy, lt:"E8EBF4",
items:["Paracervical: 1st stage only","Pudendal: 2nd stage & repair","Lignocaine 1%","Simple, quick technique","Limited fetal risk"] },
];
methods.forEach((m, i) => {
const bx = 0.25 + i * 2.38;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:0.88, w:2.22, h:4.52,
fill:{ color:m.lt }, line:{ color:m.color, width:2 }, rectRadius:0.1 });
s.addText(m.icon, { x:bx, y:0.95, w:2.22, h:0.55, fontSize:26, align:"center" });
s.addText(m.name, { x:bx+0.08, y:1.48, w:2.06, h:0.55,
fontSize:12, bold:true, color:m.color, align:"center", fontFace:"Calibri" });
s.addShape(pres.ShapeType.line, { x:bx+0.15, y:2.08, w:1.92, h:0,
line:{ color:m.color, width:1 } });
const items = m.items.map((it, j) => ({
text:it, options:{ bullet:true, breakLine:j<m.items.length-1, fontSize:10.5, color:C.slate }
}));
s.addText(items, { x:bx+0.1, y:2.15, w:2.05, h:3.1, fontFace:"Calibri" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 — KEY MNEMONICS & PEARLS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.navy } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.72, fill:{ color:C.teal } });
s.addText("CLINICAL PEARLS & MNEMONICS", {
x:0.3, y:0.13, w:9.4, h:0.47, fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const pearls = [
{ title:"4 Ts of PPH", content:"Tone (70%) · Trauma · Tissue · Thrombin", icon:"🩸", color:C.rose },
{ title:"ABCDE of Fetal Wellbeing", content:"Auscultation · Breathing · Colour · Descent · Engagement", icon:"👂", color:C.teal },
{ title:"Mechanism Memory Aid", content:"Every Decent Firm Intern Earns Respect\nEngagement→Descent→Flexion→Int.Rot→Extension→Restitution→Ext.Rot", icon:"🌀", color:C.amber },
{ title:"Caldwell-Moloy Pelvis Types", content:"Gynecoid (50%) · Android · Anthropoid · Platypelloid\nGynecoid = most favourable for vaginal birth", icon:"🏞️", color:C.teal },
{ title:"Bishop Score", content:"Cervical: Dilation · Effacement · Consistency\n Station · Position — Score ≥8 = favourable", icon:"📊", color:C.rose },
{ title:"Oxorn-Foote Key Principle", content:'"Labour is a normal physiological process — intervention\nshould ONLY occur when clearly indicated"', icon:"📖", color:C.amber },
];
pearls.forEach((p, i) => {
const row = Math.floor(i/2);
const col = i % 2;
const bx = 0.3 + col * 4.85;
const by = 0.88 + row * 1.58;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.6, h:1.42,
fill:{ color:"132A48" }, line:{ color:p.color, width:2 }, rectRadius:0.1 });
s.addText(p.icon + " " + p.title, { x:bx+0.15, y:by+0.08, w:4.3, h:0.38,
fontSize:12, bold:true, color:p.color, fontFace:"Calibri" });
s.addText(p.content, { x:bx+0.15, y:by+0.48, w:4.3, h:0.8,
fontSize:10.5, color:"B0C4D8", fontFace:"Calibri", italic:p.title.includes("Oxorn") });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 — SUMMARY / TAKE-HOME
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.navy } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.18, fill:{ color:C.teal } });
s.addShape(pres.ShapeType.rect, { x:0, y:5.44, w:10, h:0.18, fill:{ color:C.rose } });
s.addText("KEY TAKEAWAYS", { x:0.4, y:0.35, w:9.2, h:0.7,
fontSize:32, bold:true, color:C.white, fontFace:"Calibri", align:"center", charSpacing:4 });
const takes = [
"Labour = 3 Stages driven by 3 Ps: Power · Passage · Passenger",
"7 Cardinal movements guide the fetus safely through the pelvis",
"Active phase: cervical dilation ≥1 cm/hr; Partograph detects deviations early",
"Active Management of 3rd Stage (AMTSL) prevents PPH — Oxytocin is cornerstone",
"Episiotomy is NOT routine; evidence favours selective use only",
"Normal labour needs watchful expectancy, not routine intervention",
];
takes.forEach((t, i) => {
const colors = [C.teal, C.amber, C.teal, C.rose, C.amber, C.teal];
s.addShape(pres.ShapeType.roundRect, { x:0.4, y:1.12 + i * 0.7, w:9.2, h:0.58,
fill:{ color:"0E2240" }, line:{ color:colors[i], width:1.5 }, rectRadius:0.08 });
s.addShape(pres.ShapeType.ellipse, { x:0.5, y:1.17 + i * 0.7, w:0.42, h:0.42,
fill:{ color:colors[i] }, line:{ color:colors[i] } });
s.addText(String(i+1), { x:0.5, y:1.16 + i * 0.7, w:0.42, h:0.42,
fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
s.addText(t, { x:1.02, y:1.16 + i * 0.7, w:8.45, h:0.42,
fontSize:12, color:"D1E8F0", fontFace:"Calibri", valign:"middle" });
});
s.addText("References: Oxorn-Foote Human Labour & Birth (6e) · DC Dutta Textbook of Obstetrics (9e) · WHO Guidelines",
{ x:0.4, y:5.1, w:9.2, h:0.3, fontSize:9.5, color:"4A7A9B", italic:true, align:"center" });
}
// ── Write file ────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/normal-labour-ppt/Normal_Labour.pptx";
pres.writeFile({ fileName: outPath })
.then(() => console.log("✅ PPT saved to:", outPath))
.catch(e => { console.error("❌ Error:", e); process.exit(1); });
cd /home/daytona/workspace/normal-labour-ppt && node create_ppt.js 2>&1
~/normal-labour-ppt/create_ppt.js
Error: String not found in file: ' s.addText("\u201c", { x:0.5, y:0.78, w:0.6, h:0.8, fontSize:50, color:C.teal, bold:true });'sed -n '147,152p' /home/daytona/workspace/normal-labour-ppt/create_ppt.js | cat -A | head -20
sed -i 's/s\.addText(""",/s.addText("\\"",/' /home/daytona/workspace/normal-labour-ppt/create_ppt.js && node /home/daytona/workspace/normal-labour-ppt/create_ppt.js 2>&1
~/normal-labour-ppt/create_ppt.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/normal-labour-ppt/create_ppt.js'
node /home/daytona/workspace/normal-labour-ppt/create_ppt.js 2>&1
Now what
Normal Labour
Presentation · PPTX
| # | Slide | Highlights |
|---|---|---|
| 1 | Title | Dark navy design, teal/rose accents, source citations |
| 2 | Overview | 8 topic cards in a visual grid |
| 3 | Definition & Diagnosis | DC Dutta quote block, WHO definition, 4 signs of true labour |
| 4 | 3 Ps of Labour | Power / Passage / Passenger — 3 detailed columns |
| 5 | Stages of Labour | Timeline with 3 stage cards + durations |
| 6 | First Stage & Partograph | Latent / Active / Transition phases + Alert & Action lines |
| 7 | Fetal Skull Diameters | All key diameters (SOB, BPD, OM, etc.) with image |
| 8 | Cardinal Movements | All 7 movements with embedded Lecturio diagram |
| 9 | Second Stage | Crowning → delivery of head & shoulders step-by-step |
| 10 | Third Stage & AMTSL | Oxytocin, CCT, uterine massage; Schultze vs Matthews Duncan |
| 11 | Red Flags | Prolonged labour, fetal distress, PPH — 4 warning boxes |
| 12 | Analgesia in Labour | Non-pharma, systemic, epidural, pudendal in 4 columns |
| 13 | Pearls & Mnemonics | 4 Ts of PPH, cardinal movement mnemonic, Bishop score |
| 14 | Key Takeaways | 6 numbered summary points |
This slide is not clear boxes are there on written content
cd /home/daytona/workspace/normal-labour-ppt && python3 /home/daytona/skills/pptx/scripts/thumbnail.py Normal_Labour.pptx 2>&1 | head -20
~/normal-labour-ppt/create_ppt_v2.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// ── Fetch images ──────────────────────────────────────────────────────────────
function fetchImages(urls) {
try {
const result = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`,
{ maxBuffer: 50 * 1024 * 1024 }
);
return JSON.parse(result.toString());
} catch (e) {
return urls.map(() => ({ error: "fetch failed", base64: null }));
}
}
const imageUrls = [
"https://cdn.lecturio.com/assets/The-cardinal-movements-of-labor.jpg",
"https://d45jl3w9libvn.cloudfront.net/jaypee/static/books/9789351527237/Chapters/images/151-1.jpg",
];
console.log("Fetching images...");
const imgs = fetchImages(imageUrls);
console.log("Images:", imgs.map((x, i) => `${i}: ${x.error || "OK"}`));
// ── Palette ───────────────────────────────────────────────────────────────────
const C = {
navy: "0D2B4E",
teal: "1B8A8F",
rose: "C0392B",
amber: "D4860A",
white: "FFFFFF",
cream: "F8F5F0",
slate: "2C3E50",
ltTeal: "D6ECEE",
ltRose: "FAE5E3",
ltAmb: "FDF0D8",
ltNav: "E8EDF3",
gray: "6B7280",
};
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Medical Education";
pres.title = "Normal Labour";
// ── helpers ───────────────────────────────────────────────────────────────────
function titleBar(s, text, bgColor) {
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:bgColor } });
s.addText(text, { x:0.3, y:0.13, w:9.4, h:0.55,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
}
function accentDot(s, x, y, color) {
s.addShape(pres.ShapeType.ellipse, { x, y, w:0.15, h:0.15, fill:{ color }, line:{ color } });
}
function numBadge(s, num, x, y, color) {
s.addShape(pres.ShapeType.ellipse, { x, y, w:0.4, h:0.4,
fill:{ color }, line:{ color } });
s.addText(String(num), { x, y, w:0.4, h:0.4,
fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
}
function card(s, x, y, w, h, fillColor, borderColor) {
s.addShape(pres.ShapeType.roundRect, { x, y, w, h,
fill:{ color:fillColor }, line:{ color:borderColor, width:1.8 }, rectRadius:0.1 });
}
function cardHeader(s, x, y, w, h, fillColor, text, fontSize) {
s.addShape(pres.ShapeType.rect, { x, y, w, h, fill:{ color:fillColor }, line:{ color:fillColor } });
s.addText(text, { x:x+0.12, y:y+0.07, w:w-0.24, h:h-0.1,
fontSize:fontSize||13, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
// Background gradient effect using stacked rects
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.navy } });
s.addShape(pres.ShapeType.rect, { x:0, y:4.2, w:10, h:1.4, fill:{ color:"091E38" }, line:{ color:"091E38" } });
// Left accent stripe
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.25, h:5.625, fill:{ color:C.teal }, line:{ color:C.teal } });
// Top thin rose line
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.12, fill:{ color:C.rose }, line:{ color:C.rose } });
// Right side decorative circles (no emoji)
s.addShape(pres.ShapeType.ellipse, { x:7.0, y:0.4, w:2.6, h:2.6,
fill:{ color:"112D50" }, line:{ color:C.teal, width:2 } });
s.addShape(pres.ShapeType.ellipse, { x:7.4, y:0.8, w:1.8, h:1.8,
fill:{ color:C.teal }, line:{ color:C.teal } });
s.addShape(pres.ShapeType.ellipse, { x:7.7, y:1.1, w:1.2, h:1.2,
fill:{ color:"0D6A6F" }, line:{ color:"0D6A6F" } });
s.addShape(pres.ShapeType.ellipse, { x:7.9, y:3.2, w:1.8, h:1.8,
fill:{ color:"112D50" }, line:{ color:C.amber, width:1.5 } });
s.addText("NORMAL", { x:0.5, y:0.65, w:6.2, h:1.0,
fontSize:60, bold:true, color:C.white, fontFace:"Calibri", charSpacing:6 });
s.addText("LABOUR", { x:0.5, y:1.55, w:6.2, h:1.0,
fontSize:60, bold:true, color:"F4A847", fontFace:"Calibri", charSpacing:6 });
s.addShape(pres.ShapeType.line, { x:0.5, y:2.65, w:5.8, h:0,
line:{ color:C.teal, width:2.5 } });
s.addText("Physiology | Mechanism | Management", {
x:0.5, y:2.78, w:6, h:0.42,
fontSize:15, color:"8FB8D0", fontFace:"Calibri", italic:true });
s.addText("Based on: Oxorn-Foote Human Labour & Birth (6e) | DC Dutta Textbook of Obstetrics (9e)", {
x:0.5, y:3.28, w:9, h:0.35,
fontSize:12, color:"5E8FAA", fontFace:"Calibri" });
s.addShape(pres.ShapeType.line, { x:0, y:4.2, w:10, h:0,
line:{ color:C.teal, width:1 } });
s.addText("Medical Education Department", {
x:0.5, y:4.35, w:9, h:0.35,
fontSize:12, color:"4A7A9B", italic:true });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — TABLE OF CONTENTS (text-only, clean)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:C.navy } });
s.addText("CONTENTS AT A GLANCE", { x:0.3, y:0.14, w:9.4, h:0.52,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const items = [
{ n:"01", title:"Definition & Diagnosis of Normal Labour", color:C.teal },
{ n:"02", title:"The 3 Ps: Power, Passage & Passenger", color:C.rose },
{ n:"03", title:"Stages of Labour — Duration & Features", color:C.teal },
{ n:"04", title:"First Stage — Cervimetry & Partograph", color:C.amber },
{ n:"05", title:"Fetal Skull — Key Diameters", color:C.teal },
{ n:"06", title:"Cardinal Movements of Labour (7 steps)", color:C.rose },
{ n:"07", title:"Second Stage — Delivery of Head & Shoulders",color:C.amber },
{ n:"08", title:"Third Stage & Active Management (AMTSL)", color:C.teal },
{ n:"09", title:"Complications & Red Flags", color:C.rose },
{ n:"10", title:"Analgesia in Labour", color:C.amber },
];
// Two columns
const col1 = items.slice(0, 5);
const col2 = items.slice(5);
[col1, col2].forEach((col, ci) => {
col.forEach((item, i) => {
const bx = ci === 0 ? 0.3 : 5.25;
const by = 0.92 + i * 0.9;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.7, h:0.72,
fill:{ color:C.cream }, line:{ color:item.color, width:2 }, rectRadius:0.08 });
s.addShape(pres.ShapeType.rect, { x:bx, y:by, w:0.6, h:0.72,
fill:{ color:item.color }, line:{ color:item.color } });
s.addText(item.n, { x:bx, y:by, w:0.6, h:0.72,
fontSize:14, bold:true, color:C.white, align:"center", valign:"middle" });
s.addText(item.title, { x:bx+0.7, y:by+0.1, w:3.9, h:0.52,
fontSize:12.5, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — DEFINITION & DIAGNOSIS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
titleBar(s, "DEFINITION & DIAGNOSIS OF NORMAL LABOUR", C.teal);
// Big definition box
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:0.92, w:9.4, h:1.35,
fill:{ color:C.ltTeal }, line:{ color:C.teal, width:2.5 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:0.3, y:0.92, w:0.22, h:1.35,
fill:{ color:C.teal }, line:{ color:C.teal } });
s.addText("DEFINITION", { x:0.6, y:0.97, w:2.2, h:0.35,
fontSize:11, bold:true, color:C.teal, fontFace:"Calibri" });
s.addText(
"Labour is the process by which the products of conception are expelled from the uterus\nafter the period of viability (28 weeks).",
{ x:0.6, y:1.27, w:9.0, h:0.62,
fontSize:14, color:C.slate, fontFace:"Calibri", italic:true });
s.addText("— DC Dutta, Textbook of Obstetrics (9e)", { x:6.5, y:1.98, w:3.0, h:0.25,
fontSize:10, color:C.teal, italic:true, align:"right" });
// WHO definition
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:2.42, w:9.4, h:0.82,
fill:{ color:C.ltAmb }, line:{ color:C.amber, width:2 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:0.3, y:2.42, w:0.22, h:0.82,
fill:{ color:C.amber }, line:{ color:C.amber } });
s.addText("WHO Normal Labour:", { x:0.62, y:2.48, w:2.5, h:0.3,
fontSize:12, bold:true, color:C.amber });
s.addText("Spontaneous onset | Cephalic presentation | 37-42 weeks | Low risk throughout | No intervention needed | Healthy mother & baby",
{ x:0.62, y:2.78, w:9.0, h:0.38, fontSize:12, color:C.slate });
// 4 Signs cards — NO emoji, use colored labels
const signs = [
{ title:"Regular Contractions", desc:"Painful, rhythmic\nincreasing frequency\n& intensity", color:C.teal, lt:C.ltTeal },
{ title:"Cervical Changes", desc:"Effacement (thinning)\nthen Dilatation\n0 to 10 cm", color:C.rose, lt:C.ltRose },
{ title:"Bloody Show", desc:"Blood-stained mucus\npassing cervical plug\nat onset", color:C.amber, lt:C.ltAmb },
{ title:"Ruptured Membranes", desc:"Spontaneous ROM\nmay occur before\nor during labour", color:C.navy, lt:C.ltNav },
];
signs.forEach((sg, i) => {
const bx = 0.3 + i * 2.37;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:3.38, w:2.2, h:2.0,
fill:{ color:sg.lt }, line:{ color:sg.color, width:2 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:3.38, w:2.2, h:0.42,
fill:{ color:sg.color }, line:{ color:sg.color } });
s.addText(sg.title, { x:bx+0.06, y:3.4, w:2.08, h:0.38,
fontSize:11, bold:true, color:C.white, align:"center", fontFace:"Calibri" });
s.addText(sg.desc, { x:bx+0.08, y:3.85, w:2.04, h:1.3,
fontSize:11.5, color:C.slate, align:"center", fontFace:"Calibri" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — 3 Ps OF LABOUR
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:C.rose } });
s.addText("THE 3 Ps OF LABOUR", { x:0.3, y:0.14, w:9.4, h:0.52,
fontSize:26, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const ps = [
{ title:"POWER", sub:"Uterine Contractions", color:C.teal, lt:C.ltTeal,
points:["Fundal dominance — strongest at fundus","Polarity: upper contracts, lower relaxes","Frequency: 3-5 per 10 min (active)","Duration: 45-60 seconds","Intensity: 40-60 mmHg (active phase)","Retraction: fibres progressively shorten"] },
{ title:"PASSAGE", sub:"Bony Pelvis & Soft Parts", color:C.rose, lt:C.ltRose,
points:["Pelvic inlet: transverse 13 cm","Mid-pelvis: ischial spines level (narrowest)","Pelvic outlet: AP diameter 11 cm","Gynecoid = most favourable (50%)","Subpubic angle: 90 degrees or more","Soft tissue: cervix, vagina, perineum"] },
{ title:"PASSENGER", sub:"Fetus & Placenta", color:C.amber, lt:C.ltAmb,
points:["Fetal skull = most important","BPD: 9.5 cm | SOB: 9.5 cm (vertex)","Attitude: flexion (most favourable)","Lie: longitudinal","Presentation: cephalic vertex","Position: LOA = most common"] },
];
ps.forEach((p, i) => {
const bx = 0.25 + i * 3.2;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:0.9, w:3.02, h:4.55,
fill:{ color:p.lt }, line:{ color:p.color, width:2.5 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:0.9, w:3.02, h:0.65,
fill:{ color:p.color }, line:{ color:p.color } });
s.addText(p.title, { x:bx+0.08, y:0.93, w:2.86, h:0.38,
fontSize:17, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
s.addText(p.sub, { x:bx+0.08, y:1.55, w:2.86, h:0.32,
fontSize:11, color:p.color, align:"center", italic:true, bold:true });
s.addShape(pres.ShapeType.line, { x:bx+0.2, y:1.92, w:2.62, h:0,
line:{ color:p.color, width:1 } });
p.points.forEach((pt, j) => {
s.addShape(pres.ShapeType.ellipse, { x:bx+0.18, y:2.06 + j*0.55, w:0.14, h:0.14,
fill:{ color:p.color }, line:{ color:p.color } });
s.addText(pt, { x:bx+0.38, y:1.99 + j*0.55, w:2.56, h:0.42,
fontSize:11.5, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — STAGES OF LABOUR
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:C.navy } });
s.addText("STAGES OF LABOUR", { x:0.3, y:0.14, w:9.4, h:0.52,
fontSize:26, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// Timeline bar
s.addShape(pres.ShapeType.rect, { x:0.5, y:1.6, w:9.0, h:0.22,
fill:{ color:"CBD5E1" }, line:{ color:"CBD5E1" } });
// Dots on timeline
[[0.55, C.teal],[3.6, C.rose],[7.05, C.amber]].forEach(([x, col]) => {
s.addShape(pres.ShapeType.ellipse, { x, y:1.51, w:0.4, h:0.4,
fill:{ color:col }, line:{ color:col } });
});
const stages = [
{ num:"I", title:"FIRST STAGE", sub:"Onset to Full Dilatation (10 cm)",
color:C.teal, lt:C.ltTeal, x:0.3, w:3.15,
dur:["Primigravida: 12-14 hrs","Multigravida: 6-8 hrs"],
phases:["Latent: 0-3 cm, irregular contractions","Active: 4-10 cm, at least 1 cm/hr","Transition: 8-10 cm, intense contractions"] },
{ num:"II", title:"SECOND STAGE", sub:"Full Dilatation to Delivery of Baby",
color:C.rose, lt:C.ltRose, x:3.65, w:3.2,
dur:["Primigravida: 1-2 hours","Multigravida: 30-45 min"],
phases:["All 7 cardinal movements occur","Active pushing with contractions","Crowning and delivery of baby"] },
{ num:"III", title:"THIRD STAGE", sub:"Delivery of Placenta & Membranes",
color:C.amber, lt:C.ltAmb, x:7.05, w:2.65,
dur:["Duration: 5-30 minutes","AMTSL reduces PPH risk"],
phases:["Placental separation occurs","Schultze or Matthews Duncan","Oxytocin 10 IU IM given"] },
];
stages.forEach(st => {
s.addShape(pres.ShapeType.roundRect, { x:st.x, y:2.05, w:st.w, h:3.42,
fill:{ color:st.lt }, line:{ color:st.color, width:2.5 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:st.x, y:2.05, w:st.w, h:0.5,
fill:{ color:st.color }, line:{ color:st.color } });
s.addText("STAGE " + st.num, { x:st.x+0.06, y:2.07, w:st.w-0.12, h:0.44,
fontSize:15, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
s.addText(st.sub, { x:st.x+0.1, y:2.62, w:st.w-0.2, h:0.42,
fontSize:10.5, color:C.navy, italic:true, align:"center", bold:true });
// Duration box
s.addShape(pres.ShapeType.roundRect, { x:st.x+0.12, y:3.1, w:st.w-0.24, h:0.58,
fill:{ color:C.white }, line:{ color:st.color, width:1.2 }, rectRadius:0.06 });
s.addText(st.dur[0] + "\n" + st.dur[1], { x:st.x+0.14, y:3.12, w:st.w-0.28, h:0.52,
fontSize:10, color:C.slate, align:"center" });
st.phases.forEach((ph, j) => {
s.addShape(pres.ShapeType.ellipse, { x:st.x+0.15, y:3.82 + j*0.52, w:0.13, h:0.13,
fill:{ color:st.color }, line:{ color:st.color } });
s.addText(ph, { x:st.x+0.35, y:3.76 + j*0.52, w:st.w-0.45, h:0.44,
fontSize:10.5, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — FIRST STAGE & PARTOGRAPH
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
titleBar(s, "FIRST STAGE — CERVIMETRY & PARTOGRAPH", C.teal);
// 3 phase cards — clean, no emoji
const phases = [
{ name:"LATENT PHASE", color:C.teal, lt:C.ltTeal,
pts:["0 to 3 cm dilatation","Irregular contractions","Up to 8 hrs (primigravida)","Cervical effacement occurs"] },
{ name:"ACTIVE PHASE", color:C.rose, lt:C.ltRose,
pts:["4 to 10 cm dilatation","Regular strong contractions","Rate: at least 1 cm per hour","Friedman curve applies"] },
{ name:"TRANSITION", color:C.amber, lt:C.ltAmb,
pts:["8 to 10 cm dilatation","Most intense contractions","Urge to push begins","Full effacement complete"] },
];
phases.forEach((p, i) => {
const bx = 0.3 + i * 3.17;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:0.92, w:3.0, h:2.2,
fill:{ color:p.lt }, line:{ color:p.color, width:2 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:0.92, w:3.0, h:0.46,
fill:{ color:p.color }, line:{ color:p.color } });
s.addText(p.name, { x:bx+0.06, y:0.95, w:2.88, h:0.38,
fontSize:14, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
p.pts.forEach((pt, j) => {
s.addShape(pres.ShapeType.ellipse, { x:bx+0.18, y:1.52 + j*0.49, w:0.12, h:0.12,
fill:{ color:p.color }, line:{ color:p.color } });
s.addText(pt, { x:bx+0.36, y:1.45 + j*0.49, w:2.52, h:0.42,
fontSize:12, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
// Partograph section
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:3.25, w:9.4, h:2.2,
fill:{ color:C.white }, line:{ color:C.navy, width:2 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:0.3, y:3.25, w:9.4, h:0.46,
fill:{ color:C.navy }, line:{ color:C.navy } });
s.addText("PARTOGRAPH (WHO Monitoring Tool)", { x:0.45, y:3.28, w:9.1, h:0.4,
fontSize:14, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const pcols = [
{ title:"Alert Line", desc:"1 cm/hr from 4 cm\nLabour curve stays LEFT", color:C.teal },
{ title:"Action Line", desc:"4 hrs right of alert\nCross = intervention", color:C.rose },
{ title:"Parameters", desc:"FHR | Contractions\nDescent | Vitals", color:C.amber },
{ title:"Purpose", desc:"Early detection of\nabnormal labour progress", color:C.navy },
];
pcols.forEach((pc, i) => {
const cx = 0.5 + i * 2.35;
s.addShape(pres.ShapeType.roundRect, { x:cx, y:3.78, w:2.2, h:1.5,
fill:{ color:C.cream }, line:{ color:pc.color, width:1.8 }, rectRadius:0.08 });
s.addShape(pres.ShapeType.rect, { x:cx, y:3.78, w:2.2, h:0.36,
fill:{ color:pc.color }, line:{ color:pc.color } });
s.addText(pc.title, { x:cx+0.06, y:3.8, w:2.08, h:0.3,
fontSize:12, bold:true, color:C.white, align:"center" });
s.addText(pc.desc, { x:cx+0.06, y:4.2, w:2.08, h:1.0,
fontSize:11.5, color:C.slate, align:"center" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — FETAL SKULL DIAMETERS (with image)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:C.navy } });
s.addText("FETAL SKULL — KEY DIAMETERS", { x:0.3, y:0.14, w:9.4, h:0.52,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// Image on right
if (imgs[1] && !imgs[1].error) {
s.addImage({ data: imgs[1].base64, x:5.1, y:0.88, w:4.65, h:4.55 });
} else {
s.addShape(pres.ShapeType.roundRect, { x:5.1, y:0.88, w:4.65, h:4.55,
fill:{ color:C.ltTeal }, line:{ color:C.teal, width:1.5 }, rectRadius:0.1 });
s.addText("Fetal Skull Diagram", { x:5.1, y:2.8, w:4.65, h:0.5,
fontSize:13, color:C.teal, align:"center", italic:true });
}
// Diameter table on left
const dims = [
{ d:"SOB (Sub-occipito Bregmatic)", v:"9.5 cm", note:"Fully flexed — MOST favourable", color:C.teal },
{ d:"SOF (Sub-occipito Frontal)", v:"10 cm", note:"Partially flexed", color:C.teal },
{ d:"OF (Occipito Frontal)", v:"11.5 cm",note:"Military attitude", color:C.amber },
{ d:"OM (Occipito Mental)", v:"13.5 cm",note:"Face presentation (extended)", color:C.rose },
{ d:"BPD (Biparietal)", v:"9.5 cm", note:"Transverse — engagement diameter", color:C.navy },
{ d:"Bitemporal", v:"8.0 cm", note:"Smallest transverse diameter", color:C.navy },
];
s.addText("AP DIAMETERS", { x:0.3, y:0.88, w:4.6, h:0.32,
fontSize:11, bold:true, color:C.teal, fontFace:"Calibri" });
dims.forEach((d, i) => {
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:1.22 + i*0.71, w:4.65, h:0.62,
fill:{ color:C.cream }, line:{ color:d.color, width:1.8 }, rectRadius:0.07 });
s.addShape(pres.ShapeType.rect, { x:0.3, y:1.22 + i*0.71, w:0.18, h:0.62,
fill:{ color:d.color }, line:{ color:d.color } });
s.addText(d.d, { x:0.55, y:1.24 + i*0.71, w:2.85, h:0.28,
fontSize:11, bold:true, color:C.navy, fontFace:"Calibri" });
s.addText(d.v, { x:3.45, y:1.24 + i*0.71, w:1.4, h:0.28,
fontSize:13, bold:true, color:d.color, align:"center" });
s.addText(d.note, { x:0.55, y:1.52 + i*0.71, w:4.25, h:0.25,
fontSize:9.5, color:C.gray, italic:true });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — CARDINAL MOVEMENTS (with Lecturio image)
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.cream } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:C.rose } });
s.addText("CARDINAL MOVEMENTS OF LABOUR", { x:0.3, y:0.14, w:9.4, h:0.52,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
// Image right side
if (imgs[0] && !imgs[0].error) {
s.addImage({ data: imgs[0].base64, x:5.0, y:0.88, w:4.75, h:4.6 });
s.addText("Source: Lecturio Medical Education", { x:5.0, y:5.27, w:4.75, h:0.25,
fontSize:8, color:C.gray, italic:true, align:"center" });
}
const moves = [
{ n:"1", name:"ENGAGEMENT", desc:"BPD passes through pelvic inlet" },
{ n:"2", name:"DESCENT", desc:"Continuous throughout all stages" },
{ n:"3", name:"FLEXION", desc:"SOB becomes presenting diameter" },
{ n:"4", name:"INTERNAL ROTATION", desc:"Occiput rotates to OA at ischial spine level" },
{ n:"5", name:"EXTENSION", desc:"Head delivers under pubic symphysis" },
{ n:"6", name:"RESTITUTION", desc:"Head realigns 45 degrees with shoulders" },
{ n:"7", name:"EXTERNAL ROTATION", desc:"Further 45 degrees — shoulders align with outlet" },
];
const mColors = [C.teal, C.rose, C.amber, C.teal, C.rose, C.amber, C.teal];
const mBgs = [C.ltTeal, C.ltRose, C.ltAmb, C.ltTeal, C.ltRose, C.ltAmb, C.ltTeal];
moves.forEach((m, i) => {
const by = 0.9 + i * 0.67;
s.addShape(pres.ShapeType.roundRect, { x:0.25, y:by, w:4.6, h:0.58,
fill:{ color:mBgs[i] }, line:{ color:mColors[i], width:1.8 }, rectRadius:0.08 });
s.addShape(pres.ShapeType.ellipse, { x:0.3, y:by+0.11, w:0.36, h:0.36,
fill:{ color:mColors[i] }, line:{ color:mColors[i] } });
s.addText(m.n, { x:0.3, y:by+0.11, w:0.36, h:0.36,
fontSize:12, bold:true, color:C.white, align:"center", valign:"middle" });
s.addText(m.name, { x:0.74, y:by+0.04, w:1.85, h:0.3,
fontSize:11, bold:true, color:C.navy, fontFace:"Calibri" });
s.addText(m.desc, { x:0.74, y:by+0.3, w:4.0, h:0.25,
fontSize:10, color:C.slate });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — SECOND STAGE: DELIVERY
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
titleBar(s, "SECOND STAGE — DELIVERY OF HEAD & SHOULDERS", C.navy);
const steps = [
{ n:"1", title:"PUSHING PHASE", color:C.teal, lt:C.ltTeal,
pts:["Active pushing with each contraction","Valsalva or physiological pushing","Fetal head descends to perineum","Crowning begins to occur"] },
{ n:"2", title:"CROWNING", color:C.rose, lt:C.ltRose,
pts:["Largest diameter distends vulva","Ring of fire sensation felt","Head no longer recedes between contractions","Perineum maximally stretched"] },
{ n:"3", title:"DELIVERY OF HEAD", color:C.amber, lt:C.ltAmb,
pts:["Guard perineum (Ritgen manoeuvre)","Gentle controlled delivery","Check for nuchal cord immediately","Wipe face, clear airway"] },
{ n:"4", title:"DELIVERY OF SHOULDERS", color:C.navy, lt:C.ltNav,
pts:["Anterior shoulder first — downward traction","Posterior shoulder next — upward sweep","Baby delivered in one smooth movement","Note time of birth"] },
];
steps.forEach((st, i) => {
const row = Math.floor(i/2);
const col = i % 2;
const bx = 0.3 + col * 4.85;
const by = 0.9 + row * 2.32;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.6, h:2.2,
fill:{ color:st.lt }, line:{ color:st.color, width:2.5 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:by, w:4.6, h:0.46,
fill:{ color:st.color }, line:{ color:st.color } });
s.addShape(pres.ShapeType.ellipse, { x:bx+0.1, y:by+0.06, w:0.34, h:0.34,
fill:{ color:C.white }, line:{ color:C.white } });
s.addText(st.n, { x:bx+0.1, y:by+0.06, w:0.34, h:0.34,
fontSize:12, bold:true, color:st.color, align:"center", valign:"middle" });
s.addText(st.title, { x:bx+0.52, y:by+0.06, w:4.0, h:0.36,
fontSize:13, bold:true, color:C.white, fontFace:"Calibri" });
st.pts.forEach((pt, j) => {
s.addShape(pres.ShapeType.ellipse, { x:bx+0.18, y:by+0.58 + j*0.4, w:0.11, h:0.11,
fill:{ color:st.color }, line:{ color:st.color } });
s.addText(pt, { x:bx+0.36, y:by+0.52 + j*0.4, w:4.15, h:0.35,
fontSize:11, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:5.22, w:9.4, h:0.3,
fill:{ color:C.ltAmb }, line:{ color:C.amber, width:1.5 }, rectRadius:0.06 });
s.addText("NOTE: Episiotomy is NOT routine — perform only if indicated (fetal distress, rigid perineum) — DC Dutta",
{ x:0.45, y:5.23, w:9.1, h:0.28, fontSize:10.5, color:C.slate, italic:true });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — THIRD STAGE & AMTSL
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
titleBar(s, "THIRD STAGE & ACTIVE MANAGEMENT (AMTSL)", C.amber);
// Separation mechanisms
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:0.92, w:9.4, h:0.82,
fill:{ color:C.ltAmb }, line:{ color:C.amber, width:2 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:0.3, y:0.92, w:0.22, h:0.82,
fill:{ color:C.amber }, line:{ color:C.amber } });
s.addText("Placental Separation:", { x:0.62, y:0.97, w:2.5, h:0.3,
fontSize:12, bold:true, color:C.amber });
s.addText("Schultze mechanism (80%): central separation, fetal surface first, cleaner blood loss", {
x:0.62, y:1.24, w:4.4, h:0.38, fontSize:11.5, color:C.slate });
s.addText("Matthews Duncan (20%): edge separation, maternal surface first, more bleeding", {
x:5.2, y:1.24, w:4.35, h:0.38, fontSize:11.5, color:C.slate });
// AMTSL 3 steps
const steps = [
{ n:"1", title:"OXYTOCIN 10 IU IM", color:C.teal, lt:C.ltTeal,
pts:["Give within 1 min of birth","Drug of choice for 3rd stage","Prevents uterine atony","Oxorn-Foote & Dutta recommend"] },
{ n:"2", title:"CONTROLLED CORD TRACTION", color:C.rose, lt:C.ltRose,
pts:["Brandt-Andrews method","Apply ONLY with contraction","Counter-pressure on uterus","Do not force if placenta not separated"] },
{ n:"3", title:"UTERINE MASSAGE", color:C.amber, lt:C.ltAmb,
pts:["After placenta is delivered","Sustained uterine compression","Ensures uterus remains firm","Inspect placenta for completeness"] },
];
steps.forEach((st, i) => {
const bx = 0.3 + i * 3.2;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:1.9, w:3.02, h:2.62,
fill:{ color:st.lt }, line:{ color:st.color, width:2.5 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:1.9, w:3.02, h:0.46,
fill:{ color:st.color }, line:{ color:st.color } });
s.addShape(pres.ShapeType.ellipse, { x:bx+0.1, y:1.96, w:0.34, h:0.34,
fill:{ color:C.white }, line:{ color:C.white } });
s.addText(st.n, { x:bx+0.1, y:1.96, w:0.34, h:0.34,
fontSize:12, bold:true, color:st.color, align:"center", valign:"middle" });
s.addText(st.title, { x:bx+0.52, y:1.97, w:2.42, h:0.38,
fontSize:11.5, bold:true, color:C.white, fontFace:"Calibri" });
st.pts.forEach((pt, j) => {
s.addShape(pres.ShapeType.ellipse, { x:bx+0.18, y:2.48 + j*0.49, w:0.11, h:0.11,
fill:{ color:st.color }, line:{ color:st.color } });
s.addText(pt, { x:bx+0.36, y:2.42 + j*0.49, w:2.58, h:0.42,
fontSize:11, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
// Signs of separation
s.addShape(pres.ShapeType.roundRect, { x:0.3, y:4.65, w:9.4, h:0.82,
fill:{ color:C.ltTeal }, line:{ color:C.teal, width:2 }, rectRadius:0.1 });
s.addText("Signs of Placental Separation:", { x:0.5, y:4.7, w:3, h:0.3,
fontSize:12, bold:true, color:C.teal });
s.addText("Uterus becomes globular & firm | Uterus rises in abdomen | Sudden gush of blood | Cord lengthens at vulva",
{ x:0.5, y:5.0, w:9.1, h:0.38, fontSize:12, color:C.slate });
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — COMPLICATIONS & RED FLAGS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.white } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:"7B1D1D" } });
s.addText("WHEN LABOUR DEVIATES — RED FLAGS", { x:0.3, y:0.14, w:9.4, h:0.52,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const flags = [
{ cat:"PROLONGED LABOUR", color:"7B1D1D", lt:"FDE8E8",
items:["Prolonged latent phase: >20 hrs (primi), >14 hrs (multi)","Prolonged active phase: <1 cm per hour","Prolonged 2nd stage: >2 hrs (primi) or >1 hr (multi)","Secondary arrest: no progress for 2+ hours"] },
{ cat:"FETAL DISTRESS", color:C.rose, lt:C.ltRose,
items:["FHR below 100 or above 160 bpm","Late or variable decelerations on CTG","Thick meconium-stained liquor","Loss of beat-to-beat variability"] },
{ cat:"MATERNAL COMPLICATIONS", color:C.amber, lt:C.ltAmb,
items:["Bandl's ring — sign of obstructed labour","Maternal exhaustion and dehydration","Pyrexia >38 degrees in labour (suspect infection)","Abnormal vital signs"] },
{ cat:"PPH — PRIMARY", color:C.navy, lt:C.ltNav,
items:["Blood loss >500 mL (vaginal delivery)","The 4 Ts: Tone, Trauma, Tissue, Thrombin","Tone (uterine atony) = 70% of PPH cases","Management: Oxytocin, Misoprostol, B-Lynch"] },
];
flags.forEach((f, i) => {
const row = Math.floor(i/2);
const col = i % 2;
const bx = 0.3 + col * 4.85;
const by = 0.9 + row * 2.35;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.6, h:2.22,
fill:{ color:f.lt }, line:{ color:f.color, width:2.5 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:by, w:4.6, h:0.42,
fill:{ color:f.color }, line:{ color:f.color } });
s.addText(f.cat, { x:bx+0.1, y:by+0.05, w:4.4, h:0.32,
fontSize:13, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
f.items.forEach((it, j) => {
s.addShape(pres.ShapeType.ellipse, { x:bx+0.18, y:by+0.55 + j*0.42, w:0.11, h:0.11,
fill:{ color:f.color }, line:{ color:f.color } });
s.addText(it, { x:bx+0.36, y:by+0.48 + j*0.42, w:4.15, h:0.38,
fontSize:11, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — ANALGESIA IN LABOUR
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
titleBar(s, "PAIN RELIEF IN LABOUR", C.teal);
const methods = [
{ name:"NON-PHARMACOLOGICAL", color:C.teal, lt:C.ltTeal,
items:["Breathing & relaxation techniques","Hydrotherapy (warm bath/shower)","Massage & active mobilisation","TENS machine","Continuous labour support (doula)"] },
{ name:"SYSTEMIC ANALGESIA", color:C.rose, lt:C.ltRose,
items:["Pethidine 50-100 mg IM","Tramadol (caution near delivery)","Entonox: 50% N2O + 50% O2","Risk: neonatal respiratory depression","Naloxone reverses if needed"] },
{ name:"EPIDURAL ANALGESIA", color:C.amber, lt:C.ltAmb,
items:["Gold standard pain relief","Continuous lumbar epidural infusion","Combined Spinal-Epidural (CSE)","Allows instrumental delivery","Monitor BP — risk of hypotension"] },
{ name:"PUDENDAL BLOCK", color:C.navy, lt:C.ltNav,
items:["2nd stage and perineal repair","Lignocaine 1% injection","Targets pudendal nerve bilaterally","Simple and effective technique","Safe: minimal fetal risk"] },
];
methods.forEach((m, i) => {
const bx = 0.25 + i * 2.38;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:0.9, w:2.22, h:4.55,
fill:{ color:m.lt }, line:{ color:m.color, width:2.5 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:0.9, w:2.22, h:0.55,
fill:{ color:m.color }, line:{ color:m.color } });
s.addText(m.name, { x:bx+0.06, y:0.93, w:2.1, h:0.48,
fontSize:11, bold:true, color:C.white, align:"center", fontFace:"Calibri" });
s.addShape(pres.ShapeType.line, { x:bx+0.15, y:1.52, w:1.92, h:0,
line:{ color:m.color, width:1 } });
m.items.forEach((it, j) => {
s.addShape(pres.ShapeType.ellipse, { x:bx+0.14, y:1.6 + j*0.59, w:0.11, h:0.11,
fill:{ color:m.color }, line:{ color:m.color } });
s.addText(it, { x:bx+0.3, y:1.53 + j*0.59, w:1.85, h:0.52,
fontSize:11, color:C.slate, fontFace:"Calibri", valign:"middle" });
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 — PEARLS & MNEMONICS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.navy } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.78, fill:{ color:C.teal } });
s.addText("CLINICAL PEARLS & MNEMONICS", { x:0.3, y:0.14, w:9.4, h:0.52,
fontSize:24, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
const pearls = [
{ title:"4 Ts of PPH",
content:"Tone (70%) | Trauma | Tissue | Thrombin",
color:C.rose },
{ title:"Cardinal Movements Mnemonic",
content:"Every Decent Firm Intern Earns Respect Evidently\nEngagement - Descent - Flexion - Int. Rotation - Extension - Restitution - Ext. Rotation",
color:C.teal },
{ title:"Caldwell-Moloy Pelvis Types",
content:"Gynecoid (50%) - Android - Anthropoid - Platypelloid\nGynecoid is the most favourable type for vaginal birth",
color:C.amber },
{ title:"Bishop Score (Cervical Favourability)",
content:"Dilation | Effacement | Consistency | Station | Position\nScore of 8 or more = favourable cervix for induction",
color:C.teal },
{ title:"Oxorn-Foote Key Principle",
content:"Labour is a normal physiological process. Intervention should ONLY occur when clearly indicated.",
color:C.amber },
{ title:"Engagement vs Station",
content:"0 station = head at level of ischial spines = engaged\nNegative = above spines | Positive = below spines",
color:C.rose },
];
pearls.forEach((p, i) => {
const row = Math.floor(i/2);
const col = i % 2;
const bx = 0.3 + col * 4.85;
const by = 0.9 + row * 1.6;
s.addShape(pres.ShapeType.roundRect, { x:bx, y:by, w:4.6, h:1.48,
fill:{ color:"0E2240" }, line:{ color:p.color, width:2 }, rectRadius:0.1 });
s.addShape(pres.ShapeType.rect, { x:bx, y:by, w:4.6, h:0.38,
fill:{ color:p.color }, line:{ color:p.color } });
s.addText(p.title, { x:bx+0.1, y:by+0.05, w:4.4, h:0.28,
fontSize:12, bold:true, color:C.white, fontFace:"Calibri", align:"center" });
s.addText(p.content, { x:bx+0.12, y:by+0.44, w:4.36, h:0.9,
fontSize:11, color:"B0C8DC", fontFace:"Calibri" });
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 14 — KEY TAKEAWAYS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:5.625, fill:{ color:C.navy } });
s.addShape(pres.ShapeType.rect, { x:0, y:0, w:10, h:0.15, fill:{ color:C.teal }, line:{ color:C.teal } });
s.addShape(pres.ShapeType.rect, { x:0, y:5.47, w:10, h:0.15, fill:{ color:C.rose }, line:{ color:C.rose } });
s.addText("KEY TAKEAWAYS", { x:0.4, y:0.22, w:9.2, h:0.65,
fontSize:32, bold:true, color:C.white, fontFace:"Calibri", align:"center", charSpacing:3 });
const takes = [
{ text:"Labour = 3 Stages driven by 3 Ps: Power, Passage and Passenger", color:C.teal },
{ text:"7 Cardinal movements guide the fetus safely through the birth canal", color:C.amber },
{ text:"Active phase: cervical dilation at least 1 cm per hour; Partograph detects deviations early", color:C.teal },
{ text:"Active Management of 3rd Stage (AMTSL) prevents PPH — Oxytocin is cornerstone", color:C.rose },
{ text:"Episiotomy is NOT routine; selective use only based on clear indication", color:C.amber },
{ text:"Normal labour needs watchful expectancy, not routine intervention — Oxorn-Foote", color:C.teal },
];
takes.forEach((tk, i) => {
s.addShape(pres.ShapeType.roundRect, { x:0.4, y:1.0 + i*0.71, w:9.2, h:0.62,
fill:{ color:"0E2240" }, line:{ color:tk.color, width:2 }, rectRadius:0.08 });
s.addShape(pres.ShapeType.ellipse, { x:0.5, y:1.09 + i*0.71, w:0.42, h:0.42,
fill:{ color:tk.color }, line:{ color:tk.color } });
s.addText(String(i+1), { x:0.5, y:1.09 + i*0.71, w:0.42, h:0.42,
fontSize:13, bold:true, color:C.white, align:"center", valign:"middle" });
s.addText(tk.text, { x:1.05, y:1.09 + i*0.71, w:8.45, h:0.42,
fontSize:12.5, color:"D4E8F5", fontFace:"Calibri", valign:"middle" });
});
s.addText("References: Oxorn-Foote Human Labour & Birth (6e) | DC Dutta Textbook of Obstetrics (9e) | WHO Labour Guidelines",
{ x:0.4, y:5.18, w:9.2, h:0.26, fontSize:9, color:"3A6A8A", italic:true, align:"center" });
}
// ── Write ─────────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/normal-labour-ppt/Normal_Labour_v2.pptx";
pres.writeFile({ fileName: outPath })
.then(() => console.log("PPT saved:", outPath))
.catch(e => { console.error("Error:", e); process.exit(1); });
cd /home/daytona/workspace/normal-labour-ppt && node create_ppt_v2.js 2>&1
cd /home/daytona/workspace/normal-labour-ppt && python3 /home/daytona/skills/pptx/scripts/thumbnail.py Normal_Labour_v2.pptx 2>&1
Normal Labour v2
Presentation · PPTX
| Problem | Fix Applied |
|---|---|
| Blank emoji boxes | Removed all emoji icons - replaced with clean colored shape badges |
| Text cramped/cut off | Increased font sizes, more breathing room between elements |
| Overlapping boxes | Proper spacing and padding on all 14 slides |
| Unclear layout | Colored left-edge accent bars clearly separate headers from content |
| Icon boxes blocking text | All decorative boxes removed or replaced with dot bullets |
Still same problem
~/normal-labour-ppt/create_v3.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
function fetchImages(urls) {
try {
const r = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`,
{ maxBuffer: 50 * 1024 * 1024 }
);
return JSON.parse(r.toString());
} catch (e) { return urls.map(() => ({ error: "fail" })); }
}
console.log("Fetching images...");
const imgs = fetchImages([
"https://cdn.lecturio.com/assets/The-cardinal-movements-of-labor.jpg",
"https://d45jl3w9libvn.cloudfront.net/jaypee/static/books/9789351527237/Chapters/images/151-1.jpg",
]);
console.log(imgs.map((x,i)=>`${i}: ${x.error||"OK"}`));
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9"; // 10 x 5.625 inches
// PALETTE
const navy = "0D2B4E";
const teal = "0F7B82";
const rose = "C0392B";
const amber = "B7770D";
const white = "FFFFFF";
const offwh = "F5F5F5";
const dark = "1A1A2E";
const ltbl = "E8F4F5";
const ltrz = "FAEAEA";
const ltam = "FDF3DC";
const ltgr = "E8EDF4";
const txt = "1C2833";
const gray = "5D6D7E";
// ─── HELPERS ──────────────────────────────────────────────────────────────────
// Full background + top header bar
function header(s, title, barColor) {
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:5.625, fill:{color:offwh}});
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:0.85, fill:{color:barColor}});
s.addText(title, {x:0.3,y:0.1,w:9.4,h:0.65, fontSize:26, bold:true,
color:white, fontFace:"Calibri", align:"center", valign:"middle"});
}
// A simple filled row (like a table row) — very legible
function row(s, x, y, w, h, fillColor, text, textColor, fontSize, bold) {
s.addShape(pres.ShapeType.rect, {x, y, w, h, fill:{color:fillColor}, line:{color:fillColor}});
s.addText(text, {x:x+0.15, y, w:w-0.2, h,
fontSize:fontSize||12, color:textColor||txt, bold:bold||false,
fontFace:"Calibri", valign:"middle"});
}
// Colored left-bar card — ONE layer, very clean
function lcard(s, x, y, w, h, barColor, title, body, bodySize) {
s.addShape(pres.ShapeType.roundRect,
{x, y, w, h, fill:{color:white}, line:{color:barColor, width:2}, rectRadius:0.08});
s.addShape(pres.ShapeType.rect,
{x, y, w:0.18, h, fill:{color:barColor}, line:{color:barColor}});
s.addText(title, {x:x+0.25, y:y+0.08, w:w-0.32, h:0.35,
fontSize:12, bold:true, color:barColor, fontFace:"Calibri"});
s.addText(body, {x:x+0.25, y:y+0.42, w:w-0.32, h:h-0.5,
fontSize:bodySize||11.5, color:txt, fontFace:"Calibri"});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — TITLE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:5.625, fill:{color:navy}});
// Bottom band
s.addShape(pres.ShapeType.rect, {x:0,y:4.5,w:10,h:1.125, fill:{color:dark}, line:{color:dark}});
// Teal top stripe
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:0.15, fill:{color:teal}, line:{color:teal}});
// Right decorative block
s.addShape(pres.ShapeType.rect, {x:7.2,y:0.15,w:2.8,h:4.35, fill:{color:"0A2240"}, line:{color:"0A2240"}});
s.addShape(pres.ShapeType.rect, {x:7.2,y:0.15,w:0.12,h:4.35, fill:{color:teal}, line:{color:teal}});
s.addText("NORMAL", {x:0.5,y:0.6,w:6.5,h:1.2,
fontSize:68, bold:true, color:white, fontFace:"Calibri", charSpacing:5});
s.addText("LABOUR", {x:0.5,y:1.7,w:6.5,h:1.2,
fontSize:68, bold:true, color:"F0A500", fontFace:"Calibri", charSpacing:5});
s.addShape(pres.ShapeType.line,{x:0.5,y:3.05,w:6.5,h:0, line:{color:teal,width:2.5}});
s.addText("Physiology | Mechanism | Management", {
x:0.5,y:3.18,w:6.5,h:0.42, fontSize:14, color:"7FB3C8", italic:true, fontFace:"Calibri"});
s.addText("Oxorn-Foote Human Labour & Birth (6e) | DC Dutta Textbook of Obstetrics (9e)", {
x:0.5,y:4.62,w:9,h:0.32, fontSize:11.5, color:"4A7A9B"});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — DEFINITION & DIAGNOSIS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "DEFINITION & DIAGNOSIS OF NORMAL LABOUR", teal);
// Definition — big text box, very readable
s.addShape(pres.ShapeType.roundRect,
{x:0.3,y:1.0,w:9.4,h:1.35, fill:{color:ltbl}, line:{color:teal,width:2.5}, rectRadius:0.1});
s.addText("DEFINITION (DC Dutta)", {x:0.5,y:1.05,w:5,h:0.38,
fontSize:13, bold:true, color:teal, fontFace:"Calibri"});
s.addText(
"Labour is the process by which the products of conception are expelled from the uterus after the period of viability.",
{x:0.5,y:1.42,w:9.1,h:0.52, fontSize:14.5, color:txt, fontFace:"Calibri", italic:true});
// WHO box
s.addShape(pres.ShapeType.roundRect,
{x:0.3,y:2.5,w:9.4,h:0.78, fill:{color:ltam}, line:{color:amber,width:2}, rectRadius:0.08});
s.addText("WHO: Spontaneous onset | Cephalic | 37-42 weeks | Low risk | No intervention | Healthy outcome",
{x:0.5,y:2.56,w:9.1,h:0.58, fontSize:13, color:txt, bold:false, fontFace:"Calibri", valign:"middle"});
// 4 signs — simple flat colored boxes, text only, NO inner boxes
const signs = [
{t:"Regular Contractions", b:"Painful, rhythmic\nincreasing strength", c:teal},
{t:"Cervical Changes", b:"Effacement then\nDilatation 0-10 cm", c:rose},
{t:"Bloody Show", b:"Blood-stained mucus\npassing of plug", c:amber},
{t:"Membrane Rupture", b:"Spontaneous ROM\nbefore or during", c:navy},
];
signs.forEach((sg,i)=>{
const bx = 0.3+i*2.38;
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:3.42,w:2.22,h:1.98, fill:{color:white}, line:{color:sg.c,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:3.42,w:2.22,h:0.48, fill:{color:sg.c}, line:{color:sg.c}});
s.addText(sg.t, {x:bx+0.06,y:3.44,w:2.1,h:0.44,
fontSize:12, bold:true, color:white, align:"center", fontFace:"Calibri", valign:"middle"});
s.addText(sg.b, {x:bx+0.08,y:3.95,w:2.06,h:1.3,
fontSize:12.5, color:txt, align:"center", fontFace:"Calibri"});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — THE 3 Ps
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "THE 3 Ps OF LABOUR — Power | Passage | Passenger", rose);
const ps = [
{ title:"POWER", sub:"Uterine Contractions", color:teal, bg:ltbl,
pts:["Fundal dominance — strongest at fundus","Polarity: upper contracts, lower relaxes","Frequency: 3-5 contractions per 10 min","Duration: 45-60 seconds each","Intensity: 40-60 mmHg (active phase)","Retraction: fibres shorten progressively"] },
{ title:"PASSAGE", sub:"Bony Pelvis & Soft Parts", color:rose, bg:ltrz,
pts:["Pelvic inlet transverse diameter: 13 cm","Mid-pelvis: narrowest at ischial spines","Pelvic outlet AP: 11 cm","Gynecoid type: most favourable (50%)","Subpubic angle: 90 degrees or more","Soft: cervix, vagina, perineum"] },
{ title:"PASSENGER", sub:"Fetus & Placenta", color:amber, bg:ltam,
pts:["Fetal skull = most critical part","BPD: 9.5 cm | SOB: 9.5 cm (vertex)","Attitude: flexion is most favourable","Lie: longitudinal (normal)","Presentation: cephalic (vertex)","Position: LOA = most common"] },
];
ps.forEach((p,i)=>{
const bx = 0.25+i*3.22;
// Header bar
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:0.95,w:3.05,h:4.5, fill:{color:p.bg}, line:{color:p.color,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:0.95,w:3.05,h:0.58, fill:{color:p.color}, line:{color:p.color}});
s.addText(p.title, {x:bx+0.06,y:0.97,w:2.93,h:0.34,
fontSize:18, bold:true, color:white, align:"center", fontFace:"Calibri"});
s.addText(p.sub, {x:bx+0.06,y:1.56,w:2.93,h:0.3,
fontSize:11.5, color:p.color, align:"center", italic:true, bold:true});
s.addShape(pres.ShapeType.line,
{x:bx+0.2,y:1.92,w:2.65,h:0, line:{color:p.color,width:1}});
p.pts.forEach((pt,j)=>{
s.addShape(pres.ShapeType.roundRect,
{x:bx+0.14,y:2.0+j*0.54,w:0.16,h:0.16, fill:{color:p.color}, line:{color:p.color}, rectRadius:0.05});
s.addText(pt, {x:bx+0.36,y:1.95+j*0.54,w:2.62,h:0.48,
fontSize:11.5, color:txt, fontFace:"Calibri", valign:"middle"});
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — STAGES OF LABOUR
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "STAGES OF LABOUR", navy);
// Timeline
s.addShape(pres.ShapeType.rect, {x:0.5,y:1.65,w:9.0,h:0.2, fill:{color:"CBD5E1"}, line:{color:"CBD5E1"}});
[{x:0.55,c:teal},{x:3.6,c:rose},{x:7.1,c:amber}].forEach(d=>{
s.addShape(pres.ShapeType.ellipse,{x:d.x,y:1.55,w:0.4,h:0.4, fill:{color:d.c}, line:{color:d.c}});
});
s.addText("START", {x:0.42,y:1.32,w:0.9,h:0.22, fontSize:9, color:teal, align:"center", bold:true});
s.addText("10 cm", {x:3.47,y:1.32,w:0.9,h:0.22, fontSize:9, color:rose, align:"center", bold:true});
s.addText("PLACENTA", {x:6.92,y:1.32,w:1.0,h:0.22, fontSize:9, color:amber, align:"center", bold:true});
const st = [
{num:"I", title:"FIRST STAGE", color:teal, bg:ltbl, x:0.3, w:3.18,
sub:"Onset → Full Dilatation (10 cm)",
rows:["Primigravida: 12-14 hours","Multigravida: 6-8 hours",
"LATENT: 0-3 cm, irregular ctx","ACTIVE: 4-10 cm, 1 cm/hr min","TRANSITION: 8-10 cm, intense"]},
{num:"II", title:"SECOND STAGE", color:rose, bg:ltrz, x:3.65, w:3.18,
sub:"Full Dilatation → Delivery of Baby",
rows:["Primigravida: up to 2 hours","Multigravida: up to 45 min",
"All 7 cardinal movements occur","Active pushing with contractions","Crowning then birth of baby"]},
{num:"III",title:"THIRD STAGE", color:amber, bg:ltam, x:7.0, w:2.7,
sub:"Delivery of Placenta",
rows:["Duration: 5-30 minutes","AMTSL reduces PPH risk",
"Placental separation occurs","Schultze or Matthews Duncan","Oxytocin 10 IU IM given"]},
];
st.forEach(s2=>{
s.addShape(pres.ShapeType.roundRect,
{x:s2.x,y:2.05,w:s2.w,h:3.42, fill:{color:s2.bg}, line:{color:s2.color,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:s2.x,y:2.05,w:s2.w,h:0.52, fill:{color:s2.color}, line:{color:s2.color}});
s.addText("STAGE "+s2.num, {x:s2.x+0.06,y:2.07,w:s2.w-0.12,h:0.44,
fontSize:16, bold:true, color:white, align:"center", fontFace:"Calibri", valign:"middle"});
s.addText(s2.sub, {x:s2.x+0.08,y:2.62,w:s2.w-0.16,h:0.38,
fontSize:10.5, color:s2.color, align:"center", italic:true, bold:true});
s2.rows.forEach((r,j)=>{
const isHead = j===0||j===1;
s.addShape(pres.ShapeType.roundRect,
{x:s2.x+0.12,y:3.06+j*0.48,w:s2.w-0.24,h:0.42,
fill:{color:isHead?white:"F0F0F0"}, line:{color:isHead?s2.color:"CCCCCC",width:1}, rectRadius:0.05});
s.addText(r, {x:s2.x+0.2,y:3.07+j*0.48,w:s2.w-0.35,h:0.4,
fontSize:10.5, color:isHead?s2.color:txt, bold:isHead,
fontFace:"Calibri", valign:"middle"});
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — PARTOGRAPH & FIRST STAGE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "FIRST STAGE IN DETAIL — PARTOGRAPH", teal);
// Phase boxes — 3 columns, clean
const ph = [
{n:"LATENT PHASE", c:teal, bg:ltbl,
rows:["0 to 3 cm dilatation","Irregular contractions","Up to 8 hrs (primigravida)","Cervical effacement occurs"]},
{n:"ACTIVE PHASE", c:rose, bg:ltrz,
rows:["4 to 10 cm dilatation","Regular strong contractions","Rate: min 1 cm per hour","Friedman curve applies"]},
{n:"TRANSITION", c:amber, bg:ltam,
rows:["8 to 10 cm dilatation","Most intense contractions","Urge to push develops","Complete effacement"]},
];
ph.forEach((p,i)=>{
const bx = 0.3+i*3.18;
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:0.98,w:3.02,h:2.18, fill:{color:p.bg}, line:{color:p.c,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:0.98,w:3.02,h:0.46, fill:{color:p.c}, line:{color:p.c}});
s.addText(p.n, {x:bx+0.06,y:1.0,w:2.9,h:0.42,
fontSize:14, bold:true, color:white, align:"center", fontFace:"Calibri", valign:"middle"});
p.rows.forEach((r,j)=>{
s.addShape(pres.ShapeType.roundRect,
{x:bx+0.14,y:1.5+j*0.42,w:0.14,h:0.14, fill:{color:p.c}, line:{color:p.c}, rectRadius:0.04});
s.addText(r, {x:bx+0.34,y:1.44+j*0.42,w:2.6,h:0.42,
fontSize:12, color:txt, fontFace:"Calibri", valign:"middle"});
});
});
// Partograph — clean table rows
s.addShape(pres.ShapeType.roundRect,
{x:0.3,y:3.28,w:9.4,h:2.22, fill:{color:white}, line:{color:navy,width:2}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:0.3,y:3.28,w:9.4,h:0.44, fill:{color:navy}, line:{color:navy}});
s.addText("PARTOGRAPH — WHO Monitoring Tool", {x:0.45,y:3.3,w:9.1,h:0.4,
fontSize:14, bold:true, color:white, fontFace:"Calibri", align:"center", valign:"middle"});
const prows = [
{label:"Alert Line:", desc:"Drawn at 1 cm/hr from 4 cm — labour curve must stay to the LEFT", c:teal},
{label:"Action Line:", desc:"4 hours right of alert — crossing means intervention is needed", c:rose},
{label:"Parameters:", desc:"Fetal heart rate | Contractions | Descent | BP | Urine", c:amber},
{label:"Goal:", desc:"Early detection of slow progress — prevents obstructed labour", c:navy},
];
prows.forEach((pr,i)=>{
s.addShape(pres.ShapeType.rect,
{x:0.3,y:3.72+i*0.44,w:0.12,h:0.4, fill:{color:pr.c}, line:{color:pr.c}});
s.addText(pr.label, {x:0.48,y:3.74+i*0.44,w:1.3,h:0.38,
fontSize:12, bold:true, color:pr.c, fontFace:"Calibri", valign:"middle"});
s.addText(pr.desc, {x:1.82,y:3.74+i*0.44,w:7.7,h:0.38,
fontSize:12, color:txt, fontFace:"Calibri", valign:"middle"});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — FETAL SKULL with image
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "FETAL SKULL — KEY DIAMETERS", navy);
// Right: image
if(imgs[1]&&!imgs[1].error){
s.addImage({data:imgs[1].base64, x:5.2,y:0.95,w:4.55,h:4.45});
} else {
s.addShape(pres.ShapeType.roundRect,
{x:5.2,y:0.95,w:4.55,h:4.45, fill:{color:ltbl}, line:{color:teal,width:1.5}, rectRadius:0.1});
s.addText("Fetal Skull Image", {x:5.2,y:2.8,w:4.55,h:0.5,
fontSize:14, color:teal, align:"center", italic:true});
}
// Left: clean list with alternating row colors
const dims = [
{d:"SOB (Sub-occipito Bregmatic)", v:"9.5 cm", note:"Fully flexed — BEST", c:teal},
{d:"SOF (Sub-occipito Frontal)", v:"10 cm", note:"Partially flexed", c:teal},
{d:"OF (Occipito Frontal)", v:"11.5 cm",note:"Military attitude", c:amber},
{d:"OM (Occipito Mental)", v:"13.5 cm",note:"Face presentation", c:rose},
{d:"BPD (Biparietal)", v:"9.5 cm", note:"Transverse — engagement", c:navy},
{d:"Bitemporal", v:"8.0 cm", note:"Smallest transverse", c:navy},
];
const bgs = [ltbl,white,ltam,ltrz,ltgr,white];
s.addShape(pres.ShapeType.rect,
{x:0.3,y:0.95,w:4.7,h:0.38, fill:{color:navy}, line:{color:navy}});
s.addText(" DIAMETER SIZE NOTE", {x:0.3,y:0.96,w:4.7,h:0.36,
fontSize:10, bold:true, color:white, fontFace:"Calibri", valign:"middle"});
dims.forEach((d,i)=>{
s.addShape(pres.ShapeType.rect,
{x:0.3,y:1.33+i*0.68,w:4.7,h:0.65, fill:{color:bgs[i]}, line:{color:"DDDDDD",width:0.5}});
s.addShape(pres.ShapeType.rect,
{x:0.3,y:1.33+i*0.68,w:0.18,h:0.65, fill:{color:d.c}, line:{color:d.c}});
s.addText(d.d, {x:0.54,y:1.35+i*0.68,w:2.4,h:0.3,
fontSize:11.5, bold:true, color:navy, fontFace:"Calibri"});
s.addText(d.v, {x:2.98,y:1.35+i*0.68,w:1.0,h:0.3,
fontSize:13, bold:true, color:d.c, align:"center"});
s.addText(d.note, {x:0.54,y:1.65+i*0.68,w:4.35,h:0.28,
fontSize:10, color:gray, italic:true});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — CARDINAL MOVEMENTS with image
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "CARDINAL MOVEMENTS OF LABOUR", rose);
// RIGHT: lecturio image
if(imgs[0]&&!imgs[0].error){
s.addImage({data:imgs[0].base64, x:5.0,y:0.92,w:4.75,h:4.45});
s.addText("Source: Lecturio", {x:5.0,y:5.25,w:4.75,h:0.25,
fontSize:8, color:gray, italic:true, align:"right"});
}
// LEFT: 7 numbered rows
const moves = [
{n:"1",name:"ENGAGEMENT", d:"BPD passes through pelvic inlet", c:teal},
{n:"2",name:"DESCENT", d:"Continuous throughout labour", c:navy},
{n:"3",name:"FLEXION", d:"SOB becomes presenting diameter", c:rose},
{n:"4",name:"INTERNAL ROTATION",d:"Occiput rotates to OA at ischial spines", c:teal},
{n:"5",name:"EXTENSION", d:"Head delivers under pubic symphysis", c:amber},
{n:"6",name:"RESTITUTION", d:"Head realigns 45 degrees with shoulders", c:rose},
{n:"7",name:"EXTERNAL ROTATION",d:"Further 45 degrees to align for shoulders",c:teal},
];
const mbg = [ltbl,ltgr,ltrz,ltbl,ltam,ltrz,ltbl];
moves.forEach((m,i)=>{
s.addShape(pres.ShapeType.roundRect,
{x:0.25,y:0.95+i*0.66,w:4.6,h:0.58,
fill:{color:mbg[i]}, line:{color:m.c,width:1.8}, rectRadius:0.08});
s.addShape(pres.ShapeType.ellipse,
{x:0.32,y:1.03+i*0.66,w:0.38,h:0.38, fill:{color:m.c}, line:{color:m.c}});
s.addText(m.n, {x:0.32,y:1.03+i*0.66,w:0.38,h:0.38,
fontSize:13, bold:true, color:white, align:"center", valign:"middle"});
s.addText(m.name, {x:0.78,y:0.97+i*0.66,w:1.7,h:0.3,
fontSize:11, bold:true, color:navy, fontFace:"Calibri"});
s.addText(m.d, {x:0.78,y:1.25+i*0.66,w:3.98,h:0.25,
fontSize:10.5, color:gray, fontFace:"Calibri"});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — SECOND STAGE
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "SECOND STAGE — DELIVERY OF HEAD & SHOULDERS", navy);
const steps = [
{n:"1",title:"PUSHING PHASE", c:teal, bg:ltbl,
pts:["Active pushing with each contraction","Valsalva or physiological pushing","Head descends to perineum","Crowning begins"]},
{n:"2",title:"CROWNING", c:rose, bg:ltrz,
pts:["Largest diameter distends vulva","Head does not recede between contractions","Perineum maximally stretched","Ring of fire felt"]},
{n:"3",title:"DELIVERY OF HEAD", c:amber, bg:ltam,
pts:["Guard perineum (Ritgen manoeuvre)","Gentle controlled delivery","Check for nuchal cord","Clear airway gently"]},
{n:"4",title:"DELIVERY OF SHOULDERS", c:navy, bg:ltgr,
pts:["Anterior shoulder first — downward traction","Posterior shoulder — upward sweep","Baby delivered in one movement","Note time of birth"]},
];
steps.forEach((st,i)=>{
const col = i%2, row2 = Math.floor(i/2);
const bx = 0.3+col*4.85, by = 0.95+row2*2.35;
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:by,w:4.6,h:2.22, fill:{color:st.bg}, line:{color:st.c,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:by,w:4.6,h:0.48, fill:{color:st.c}, line:{color:st.c}});
s.addShape(pres.ShapeType.ellipse,
{x:bx+0.1,y:by+0.07,w:0.34,h:0.34, fill:{color:white}, line:{color:white}});
s.addText(st.n, {x:bx+0.1,y:by+0.07,w:0.34,h:0.34,
fontSize:12, bold:true, color:st.c, align:"center", valign:"middle"});
s.addText(st.title, {x:bx+0.52,y:by+0.08,w:4.0,h:0.35,
fontSize:13, bold:true, color:white, fontFace:"Calibri", valign:"middle"});
st.pts.forEach((pt,j)=>{
s.addShape(pres.ShapeType.roundRect,
{x:bx+0.18,y:by+0.6+j*0.4,w:0.14,h:0.14, fill:{color:st.c}, line:{color:st.c}, rectRadius:0.04});
s.addText(pt, {x:bx+0.38,y:by+0.54+j*0.4,w:4.12,h:0.38,
fontSize:11.5, color:txt, fontFace:"Calibri", valign:"middle"});
});
});
s.addShape(pres.ShapeType.roundRect,
{x:0.3,y:5.28,w:9.4,h:0.28, fill:{color:ltam}, line:{color:amber,width:1.5}, rectRadius:0.06});
s.addText("NOTE: Episiotomy is NOT routine — only if clearly indicated (fetal distress, rigid perineum) — DC Dutta",
{x:0.45,y:5.28,w:9.1,h:0.28, fontSize:10.5, color:amber, italic:true, valign:"middle"});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — THIRD STAGE & AMTSL
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "THIRD STAGE & ACTIVE MANAGEMENT (AMTSL)", amber);
// Mechanisms bar
s.addShape(pres.ShapeType.roundRect,
{x:0.3,y:0.98,w:9.4,h:0.72, fill:{color:ltam}, line:{color:amber,width:2}, rectRadius:0.08});
s.addShape(pres.ShapeType.rect, {x:0.3,y:0.98,w:0.18,h:0.72, fill:{color:amber}, line:{color:amber}});
s.addText("Schultze (80%): central separation, fetal surface first — cleaner", {
x:0.55,y:1.0,w:4.5,h:0.34, fontSize:12, color:txt, fontFace:"Calibri"});
s.addText("Matthews Duncan (20%): edge separation, maternal surface — more bleeding", {
x:5.1,y:1.0,w:4.5,h:0.34, fontSize:12, color:txt, fontFace:"Calibri"});
s.addText("Placental Separation Mechanisms:", {x:0.55,y:1.34,w:9.1,h:0.28,
fontSize:10, color:gray, italic:true});
// AMTSL 3 columns
const amtsl = [
{n:"1",title:"OXYTOCIN 10 IU IM", c:teal, bg:ltbl,
pts:["Give within 1 min of birth","Drug of CHOICE (WHO & Dutta)","Prevents uterine atony","Most cost-effective"]},
{n:"2",title:"CONTROLLED CORD TRACTION", c:rose, bg:ltrz,
pts:["Brandt-Andrews method","Apply WITH contraction ONLY","Counter-pressure on uterus","Do not force prematurely"]},
{n:"3",title:"UTERINE MASSAGE", c:amber, bg:ltam,
pts:["After placenta delivered","Sustained compression","Keep uterus contracted","Inspect placenta for completeness"]},
];
amtsl.forEach((a,i)=>{
const bx = 0.3+i*3.22;
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:1.85,w:3.05,h:2.65, fill:{color:a.bg}, line:{color:a.c,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:1.85,w:3.05,h:0.52, fill:{color:a.c}, line:{color:a.c}});
s.addShape(pres.ShapeType.ellipse,
{x:bx+0.1,y:1.91,w:0.36,h:0.36, fill:{color:white}, line:{color:white}});
s.addText(a.n, {x:bx+0.1,y:1.91,w:0.36,h:0.36,
fontSize:13, bold:true, color:a.c, align:"center", valign:"middle"});
s.addText(a.title, {x:bx+0.54,y:1.92,w:2.44,h:0.44,
fontSize:11.5, bold:true, color:white, fontFace:"Calibri", valign:"middle"});
a.pts.forEach((pt,j)=>{
s.addShape(pres.ShapeType.roundRect,
{x:bx+0.16,y:2.5+j*0.5,w:0.13,h:0.13, fill:{color:a.c}, line:{color:a.c}, rectRadius:0.04});
s.addText(pt, {x:bx+0.36,y:2.43+j*0.5,w:2.62,h:0.44,
fontSize:11.5, color:txt, fontFace:"Calibri", valign:"middle"});
});
});
// Signs of separation
s.addShape(pres.ShapeType.roundRect,
{x:0.3,y:4.65,w:9.4,h:0.78, fill:{color:ltbl}, line:{color:teal,width:2}, rectRadius:0.08});
s.addShape(pres.ShapeType.rect, {x:0.3,y:4.65,w:0.18,h:0.78, fill:{color:teal}, line:{color:teal}});
s.addText("SIGNS OF PLACENTAL SEPARATION:", {x:0.55,y:4.68,w:3.5,h:0.3,
fontSize:12, bold:true, color:teal});
s.addText("Uterus globular & firm | Uterus rises in abdomen | Gush of blood | Cord lengthens at vulva",
{x:0.55,y:5.0,w:9.1,h:0.35, fontSize:12, color:txt});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — COMPLICATIONS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:5.625, fill:{color:offwh}});
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:0.85, fill:{color:"7B1D1D"}});
s.addText("COMPLICATIONS & RED FLAGS IN LABOUR", {x:0.3,y:0.1,w:9.4,h:0.65,
fontSize:26, bold:true, color:white, fontFace:"Calibri", align:"center", valign:"middle"});
const flags = [
{cat:"PROLONGED LABOUR", c:"7B1D1D", bg:"FDE8E8",
items:["Prolonged latent: >20 hrs (primi), >14 hrs (multi)","Prolonged active: <1 cm per hour","Prolonged 2nd stage: >2 hrs (primi), >1 hr (multi)","Secondary arrest: no progress for 2+ hours"]},
{cat:"FETAL DISTRESS", c:rose, bg:ltrz,
items:["FHR below 100 or above 160 bpm","Late or variable decelerations on CTG","Thick meconium-stained amniotic fluid","Loss of beat-to-beat variability"]},
{cat:"MATERNAL COMPLICATIONS", c:amber, bg:ltam,
items:["Bandl's ring — sign of obstructed labour","Maternal exhaustion and dehydration","Pyrexia above 38 degrees C in labour","Abnormal vital signs — tachycardia, hypotension"]},
{cat:"PRIMARY PPH", c:navy, bg:ltgr,
items:["Blood loss >500 mL (vaginal delivery)","4 Ts: Tone (70%), Trauma, Tissue, Thrombin","Management: Oxytocin, Misoprostol, B-Lynch","Uterine atony is most common cause"]},
];
flags.forEach((f,i)=>{
const col=i%2, row2=Math.floor(i/2);
const bx=0.3+col*4.85, by=0.98+row2*2.32;
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:by,w:4.6,h:2.2, fill:{color:f.bg}, line:{color:f.c,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:by,w:4.6,h:0.46, fill:{color:f.c}, line:{color:f.c}});
s.addText(f.cat, {x:bx+0.1,y:by+0.06,w:4.4,h:0.34,
fontSize:13, bold:true, color:white, align:"center", fontFace:"Calibri", valign:"middle"});
f.items.forEach((it,j)=>{
s.addShape(pres.ShapeType.roundRect,
{x:bx+0.16,y:by+0.56+j*0.42,w:0.13,h:0.13, fill:{color:f.c}, line:{color:f.c}, rectRadius:0.04});
s.addText(it, {x:bx+0.36,y:by+0.5+j*0.42,w:4.16,h:0.38,
fontSize:11.5, color:txt, fontFace:"Calibri", valign:"middle"});
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 11 — ANALGESIA
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
header(s, "PAIN RELIEF IN LABOUR", teal);
const methods = [
{name:"NON-PHARMA\nMETHODS", c:teal, bg:ltbl,
items:["Breathing & relaxation","Hydrotherapy (bath/shower)","Massage & mobilisation","TENS machine","Continuous support (doula)"]},
{name:"SYSTEMIC\nANALGESIA", c:rose, bg:ltrz,
items:["Pethidine 50-100 mg IM","Tramadol (caution near birth)","Entonox: 50% N2O + 50% O2","Risk: neonatal resp. depression","Naloxone available as reversal"]},
{name:"EPIDURAL\nANALGESIA", c:amber, bg:ltam,
items:["Gold standard pain relief","Continuous lumbar epidural","Combined Spinal-Epidural (CSE)","Allows instrumental delivery","Monitor BP — risk of hypotension"]},
{name:"PUDENDAL\nBLOCK", c:navy, bg:ltgr,
items:["2nd stage and perineal repair","Lignocaine 1% injection","Targets pudendal nerve bilaterally","Simple, quick technique","Minimal fetal risk"]},
];
methods.forEach((m,i)=>{
const bx = 0.25+i*2.4;
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:0.95,w:2.25,h:4.5, fill:{color:m.bg}, line:{color:m.c,width:2.5}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:0.95,w:2.25,h:0.62, fill:{color:m.c}, line:{color:m.c}});
s.addText(m.name, {x:bx+0.06,y:0.97,w:2.13,h:0.56,
fontSize:11.5, bold:true, color:white, align:"center", fontFace:"Calibri", valign:"middle"});
s.addShape(pres.ShapeType.line,
{x:bx+0.15,y:1.64,w:1.95,h:0, line:{color:m.c,width:1}});
m.items.forEach((it,j)=>{
s.addShape(pres.ShapeType.roundRect,
{x:bx+0.14,y:1.72+j*0.6,w:0.13,h:0.13, fill:{color:m.c}, line:{color:m.c}, rectRadius:0.04});
s.addText(it, {x:bx+0.32,y:1.66+j*0.6,w:1.86,h:0.52,
fontSize:11, color:txt, fontFace:"Calibri", valign:"middle"});
});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 12 — PEARLS & MNEMONICS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:5.625, fill:{color:"0A1628"}});
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:0.85, fill:{color:teal}});
s.addText("CLINICAL PEARLS & MNEMONICS", {x:0.3,y:0.1,w:9.4,h:0.65,
fontSize:26, bold:true, color:white, fontFace:"Calibri", align:"center", valign:"middle"});
const pearls = [
{title:"4 Ts of PPH", c:rose, content:"Tone (70%) | Trauma | Tissue | Thrombin"},
{title:"Cardinal Movements Mnemonic", c:teal, content:"Every Decent Firm Intern Earns Respect Evidently\nEngagement - Descent - Flexion - Int.Rotation - Extension - Restitution - Ext.Rotation"},
{title:"Caldwell-Moloy Pelvis Types", c:amber, content:"Gynecoid (50%) - Android - Anthropoid - Platypelloid\nGynecoid = most favourable for vaginal birth"},
{title:"Bishop Score (Cervical Favourability)", c:teal, content:"Dilation | Effacement | Consistency | Station | Position\nScore 8 or more = favourable cervix for induction"},
{title:"Oxorn-Foote Core Principle", c:rose, content:"Labour is a normal physiological process — intervention should ONLY occur when clearly indicated"},
{title:"Station vs Engagement", c:amber, content:"0 station = ischial spines = engaged\nNegative = above spines | Positive = below spines"},
];
pearls.forEach((p,i)=>{
const col=i%2, row2=Math.floor(i/2);
const bx=0.3+col*4.85, by=0.98+row2*1.55;
s.addShape(pres.ShapeType.roundRect,
{x:bx,y:by,w:4.6,h:1.44, fill:{color:"0E2240"}, line:{color:p.c,width:2}, rectRadius:0.1});
s.addShape(pres.ShapeType.rect,
{x:bx,y:by,w:4.6,h:0.4, fill:{color:p.c}, line:{color:p.c}});
s.addText(p.title, {x:bx+0.1,y:by+0.05,w:4.4,h:0.3,
fontSize:12.5, bold:true, color:white, fontFace:"Calibri", align:"center", valign:"middle"});
s.addText(p.content, {x:bx+0.12,y:by+0.46,w:4.36,h:0.9,
fontSize:11.5, color:"B5D0E8", fontFace:"Calibri"});
});
}
// ══════════════════════════════════════════════════════════════════════════════
// SLIDE 13 — KEY TAKEAWAYS
// ══════════════════════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:5.625, fill:{color:navy}});
s.addShape(pres.ShapeType.rect, {x:0,y:0,w:10,h:0.15, fill:{color:teal}, line:{color:teal}});
s.addShape(pres.ShapeType.rect, {x:0,y:5.47,w:10,h:0.15, fill:{color:rose}, line:{color:rose}});
s.addText("KEY TAKEAWAYS", {x:0.4,y:0.22,w:9.2,h:0.68,
fontSize:34, bold:true, color:white, fontFace:"Calibri", align:"center", charSpacing:3, valign:"middle"});
const takes = [
{t:"Labour = 3 Stages driven by 3 Ps: Power, Passage and Passenger", c:teal},
{t:"7 Cardinal movements guide the fetus safely through the birth canal", c:amber},
{t:"Active phase: dilatation at least 1 cm per hour — use Partograph to monitor", c:teal},
{t:"AMTSL (Oxytocin + CCT + Massage) is cornerstone of PPH prevention", c:rose},
{t:"Episiotomy NOT routine — use selectively only on clear indication", c:amber},
{t:"Normal labour = watchful expectancy, not routine intervention — Oxorn-Foote", c:teal},
];
takes.forEach((tk,i)=>{
s.addShape(pres.ShapeType.roundRect,
{x:0.4,y:1.0+i*0.72,w:9.2,h:0.62,
fill:{color:"0D2248"}, line:{color:tk.c,width:2.5}, rectRadius:0.08});
s.addShape(pres.ShapeType.ellipse,
{x:0.5,y:1.1+i*0.72,w:0.4,h:0.4, fill:{color:tk.c}, line:{color:tk.c}});
s.addText(String(i+1), {x:0.5,y:1.1+i*0.72,w:0.4,h:0.4,
fontSize:13, bold:true, color:white, align:"center", valign:"middle"});
s.addText(tk.t, {x:1.05,y:1.1+i*0.72,w:8.45,h:0.42,
fontSize:13, color:"D4E8F5", fontFace:"Calibri", valign:"middle"});
});
s.addText("Oxorn-Foote Human Labour & Birth (6e) | DC Dutta Textbook of Obstetrics (9e) | WHO Labour Guidelines",
{x:0.4,y:5.22,w:9.2,h:0.22, fontSize:9, color:"2E5F7A", italic:true, align:"center"});
}
// ─── WRITE ────────────────────────────────────────────────────────────────────
const out = "/home/daytona/workspace/normal-labour-ppt/Normal_Labour_v3.pptx";
pres.writeFile({fileName:out})
.then(()=>console.log("Saved:", out))
.catch(e=>{console.error(e); process.exit(1);});
cd /home/daytona/workspace/normal-labour-ppt && node create_v3.js 2>&1
cd /home/daytona/workspace/normal-labour-ppt && python3 /home/daytona/skills/pptx/scripts/thumbnail.py Normal_Labour_v3.pptx 2>&1
Normal Labour v3
Presentation · PPTX
| Problem | Fix |
|---|---|
| Blank emoji/icon boxes | Completely removed - no emoji used anywhere |
| Boxes overlapping text | Single-layer design - one box per section, header bar on top, text below |
| Text cramped/unreadable | Larger font sizes (11.5-14pt body text), more vertical spacing |
| Too many nested shapes | Maximum 2 layers per element (background + header bar only) |
| Content overflow | Each slide has fewer items with more breathing room |