Sub CreateFetalMedicinePresentation() Dim pptPres As Presentation Dim pptSlide As Slide ' Create a new presentation Set pptPres = Application.Presentations.Add ' Slide 1: Title Slide Set pptSlide = pptPres.Slides.Add(1, ppLayoutTitle) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Semilobar Holoprosencephaly with Transposition of Great Arteries at 21 Weeks" pptSlide.Shapes(2).TextFrame.TextRange.Text = "A Rare Embryological Association" & vbCrLf & "[Your Name]" & vbCrLf & "[Your Institution]" ' Slide 2: Introduction Set pptSlide = pptPres.Slides.Add(2, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Introduction" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Holoprosencephaly (HPE) is a failure of forebrain division." & vbCrLf & _ "• Spectrum includes: Alobar, Semilobar, and Lobar." & vbCrLf & _ "• Frequently associated with craniofacial anomalies and congenital heart defects." ' Slide 3: Objective Set pptSlide = pptPres.Slides.Add(3, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Objective" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Present a rare clinical case of semilobar HPE with TGA." & vbCrLf & _ "• Explore the shared embryological correlation between CNS and cardiac anomalies." ' Slide 4: Case Details (Neurosonography) Set pptSlide = pptPres.Slides.Add(4, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Case Details (Neurosonography)" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Patient: 21-week foetus." & vbCrLf & _ "• Ultrasound findings:" & vbCrLf & _ " - Single monoventricular cavity." & vbCrLf & _ " - Fused thalami." & vbCrLf & _ " - Partial hemispheric separation." ' Slide 5: Cardiac Findings Set pptSlide = pptPres.Slides.Add(5, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Cardiac Findings" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Modality: Foetal echocardiography." & vbCrLf & _ "• Key Finding: Ventriculoarterial discordance." & vbCrLf & _ "• Anatomy: Aorta arising from RV, Pulmonary artery from LV." & vbCrLf & _ "• Diagnosis: Transposition of Great Arteries (TGA)." ' Slide 6: Rarity & Embryology Set pptSlide = pptPres.Slides.Add(6, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Rarity & Embryology" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Cardiac defects are common in HPE, but TGA is rarely reported." & vbCrLf & _ "• Gestational weeks 3–6 are the critical developmental window." & vbCrLf & _ "• The brain and heart develop simultaneously during this period." ' Slide 7: Shared Mechanisms Set pptSlide = pptPres.Slides.Add(7, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Shared Mechanisms" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Disruption of midline patterning." & vbCrLf & _ "• Defective neural crest cell migration." & vbCrLf & _ "• Left-right axis signaling defect." ' Slide 8: Molecular Pathways Set pptSlide = pptPres.Slides.Add(8, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Molecular Pathways" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Sonic Hedgehog (SHH) Pathway: Critical for forebrain and cardiac morphogenesis." & vbCrLf & _ "• Nodal Signaling: Essential for left-right axis determination." & vbCrLf & _ "• Neural Crest: Vital contribution to cardiac outflow tract development." ' Slide 9: Clinical Importance Set pptSlide = pptPres.Slides.Add(9, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Clinical Importance" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Highlights the importance of early and detailed anomaly detection." & vbCrLf & _ "• Guides accurate genetic counselling for parents." & vbCrLf & _ "• Clarifies long-term prognostic implications." ' Slide 10: Conclusion & Take-Home Message Set pptSlide = pptPres.Slides.Add(10, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "Conclusion & Take-Home Message" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Conclusion: This rare association suggests a shared developmental origin." & vbCrLf & _ "• Take-Home Message: Always rigorously evaluate the foetal heart in the presence of CNS anomalies." & vbCrLf & _ "• Impact: Early embryological signaling pathways simultaneously influence brain and cardiac development." ' Slide 11: References Set pptSlide = pptPres.Slides.Add(11, ppLayoutText) pptSlide.Shapes(1).TextFrame.TextRange.Text = "References" pptSlide.Shapes(2).TextFrame.TextRange.Text = "• Muenke M, Beachy PA. Holoprosencephaly. Nat Rev Genet." & vbCrLf & _ "• Roessler E, Muenke M. Molecular genetics of holoprosencephaly. Am J Med Genet." & vbCrLf & _ "• Cohen MM Jr. Holoprosencephaly: clinical, anatomic, and molecular dimensions." & vbCrLf & _ "• Bruneau BG. Developmental genetics of congenital heart disease. Nature." & vbCrLf & _ "• ISUOG Practice Guidelines for fetal anomaly scan." MsgBox "Presentation successfully generated, Dr. Yash! Don't forget to add your ultrasound images and apply the dark blue theme.", vbInformation, "Success" End Sub

Checking Date & Time
Reading File
Reading File
Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace not found"

Running Command

mkdir -p /home/daytona/workspace/fetal-medicine-hpe-tga

Writing File

~/fetal-medicine-hpe-tga/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "Semilobar Holoprosencephaly with TGA at 21 Weeks";
pres.author = "Dr. Yash";

// ── Colour palette ──────────────────────────────────────────────────────────
const BG        = "0A1628";   // deep navy (dominant)
const PANEL     = "112240";   // slightly lighter navy for cards
const ACCENT1   = "00C9B1";   // teal-green (primary accent)
const ACCENT2   = "3A8EF6";   // cornflower blue (secondary)
const ACCENT3   = "FF6B6B";   // coral (warning/highlight)
const TEXT_HI   = "FFFFFF";   // headings
const TEXT_LO   = "B8C8E0";   // body / bullets
const RULE      = "1E3A5F";   // divider lines

// ── Reusable helpers ────────────────────────────────────────────────────────
function addBg(slide) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 5.625,
    fill: { color: BG }, line: { color: BG }
  });
}

function accentBar(slide) {
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.25, w: 10, h: 0.375,
    fill: { color: PANEL }, line: { color: PANEL }
  });
  // teal rule at very bottom
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 5.57, w: 10, h: 0.055,
    fill: { color: ACCENT1 }, line: { color: ACCENT1 }
  });
}

function slideLabel(slide, label) {
  slide.addText(label.toUpperCase(), {
    x: 0.4, y: 5.27, w: 9.2, h: 0.25,
    fontSize: 7.5, color: "5A7A99", bold: false,
    fontFace: "Calibri", align: "right", valign: "middle", margin: 0
  });
}

function sectionTag(slide, tag, color) {
  slide.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.4, y: 0.32, w: tag.length * 0.12 + 0.7, h: 0.28,
    fill: { color: color || ACCENT1 }, line: { color: color || ACCENT1 },
    rectRadius: 0.06
  });
  slide.addText(tag, {
    x: 0.4, y: 0.32, w: tag.length * 0.12 + 0.7, h: 0.28,
    fontSize: 8, color: BG, bold: true, fontFace: "Calibri",
    align: "center", valign: "middle", margin: 0
  });
}

function slideHeading(slide, text, yPos) {
  slide.addText(text, {
    x: 0.4, y: yPos !== undefined ? yPos : 0.72,
    w: 9.2, h: 0.65,
    fontSize: 26, color: TEXT_HI, bold: true,
    fontFace: "Calibri", valign: "middle", margin: 0
  });
  // teal underline
  slide.addShape(pres.shapes.RECTANGLE, {
    x: 0.4, y: yPos !== undefined ? yPos + 0.68 : 1.40,
    w: 9.2, h: 0.03,
    fill: { color: ACCENT1 }, line: { color: ACCENT1 }
  });
}

function bulletBlock(slide, items, opts) {
  // items: array of { text, sub, color }
  const o = opts || {};
  const x = o.x !== undefined ? o.x : 0.4;
  const y = o.y !== undefined ? o.y : 1.55;
  const w = o.w !== undefined ? o.w : 9.2;
  const h = o.h !== undefined ? o.h : 3.5;
  const fs = o.fontSize || 15.5;

  const richText = [];
  items.forEach((item, idx) => {
    const isLast = idx === items.length - 1;
    const itemColor = item.color || TEXT_LO;
    richText.push({
      text: "▸  " + item.text,
      options: {
        bullet: false, breakLine: item.sub ? false : !isLast,
        fontSize: fs, color: itemColor, fontFace: "Calibri",
        paraSpaceBefore: idx === 0 ? 0 : 6
      }
    });
    if (item.sub) {
      item.sub.forEach((s, si) => {
        const subLast = si === item.sub.length - 1 && isLast;
        richText.push({
          text: "      ◦  " + s,
          options: {
            bullet: false, breakLine: !subLast,
            fontSize: fs - 1.5, color: "7A9ABE", fontFace: "Calibri",
            paraSpaceBefore: 2
          }
        });
      });
    }
  });

  slide.addText(richText, {
    x, y, w, h,
    valign: "top", margin: 0, wrap: true
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 1: TITLE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Fetal Medicine · Case Presentation");

  // Left teal vertical bar
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 0.22, h: 5.625,
    fill: { color: ACCENT1 }, line: { color: ACCENT1 }
  });

  // Decorative circles
  s.addShape(pres.shapes.ELLIPSE, {
    x: 7.8, y: -0.6, w: 3.2, h: 3.2,
    fill: { color: ACCENT2, transparency: 85 }, line: { color: ACCENT2, transparency: 85 }
  });
  s.addShape(pres.shapes.ELLIPSE, {
    x: 8.5, y: 3.2, w: 2.0, h: 2.0,
    fill: { color: ACCENT1, transparency: 88 }, line: { color: ACCENT1, transparency: 88 }
  });

  // Main title
  s.addText("Semilobar Holoprosencephaly\nwith Transposition of Great Arteries", {
    x: 0.55, y: 0.9, w: 7.6, h: 2.2,
    fontSize: 30, color: TEXT_HI, bold: true,
    fontFace: "Calibri", valign: "middle", lineSpacingMultiple: 1.25
  });

  // Subtitle
  s.addText("at 21 Weeks — A Rare Embryological Association", {
    x: 0.55, y: 3.05, w: 7.6, h: 0.55,
    fontSize: 17, color: ACCENT1, bold: false, italic: true,
    fontFace: "Calibri", valign: "middle"
  });

  // Author / institution placeholders
  s.addText([
    { text: "[Your Name]  |  [Your Institution]", options: { color: TEXT_LO, fontSize: 12.5, fontFace: "Calibri" } }
  ], { x: 0.55, y: 3.72, w: 7.6, h: 0.45, valign: "middle", margin: 0 });

  // Date
  s.addText("April 2026", {
    x: 0.55, y: 4.22, w: 3, h: 0.3,
    fontSize: 10, color: "5A7A99", fontFace: "Calibri", margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 2: INTRODUCTION
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Introduction  ·  Slide 2 of 11");
  sectionTag(s, "BACKGROUND", ACCENT2);
  slideHeading(s, "Introduction");

  bulletBlock(s, [
    { text: "Holoprosencephaly (HPE) is a failure of the embryonic forebrain to divide into two cerebral hemispheres." },
    {
      text: "Three major subtypes, in order of severity:",
      sub: ["Alobar — complete non-division", "Semilobar — partial division (posterior)", "Lobar — near-complete division with rostral fusion"]
    },
    { text: "Associated with craniofacial anomalies (cyclopia, proboscis, midline cleft) and congenital heart defects.", color: TEXT_LO },
    { text: "Overall prevalence: ~1 in 10,000 live births; higher in prenatal series (~1 in 250 conceptuses).", color: TEXT_LO }
  ], { y: 1.58, h: 3.45 });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 3: OBJECTIVE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Objective  ·  Slide 3 of 11");
  sectionTag(s, "AIM");

  slideHeading(s, "Objectives");

  // Two card boxes
  const cards = [
    {
      icon: "01",
      head: "Case Presentation",
      body: "Report a rare prenatal finding of semilobar HPE co-existing with Transposition of the Great Arteries (TGA) diagnosed at 21 weeks of gestation."
    },
    {
      icon: "02",
      head: "Embryological Correlation",
      body: "Explore the shared developmental mechanisms linking central nervous system and cardiac outflow tract anomalies, with focus on molecular signalling pathways."
    }
  ];

  cards.forEach((card, i) => {
    const cx = 0.4 + i * 4.85;
    // card background
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: cx, y: 1.6, w: 4.55, h: 3.4,
      fill: { color: PANEL }, line: { color: RULE },
      rectRadius: 0.12,
      shadow: { type: "outer", color: "000000", blur: 12, offset: 4, angle: 135, opacity: 0.25 }
    });
    // number badge
    s.addShape(pres.shapes.ELLIPSE, {
      x: cx + 0.2, y: 1.75, w: 0.52, h: 0.52,
      fill: { color: ACCENT1 }, line: { color: ACCENT1 }
    });
    s.addText(card.icon, {
      x: cx + 0.2, y: 1.75, w: 0.52, h: 0.52,
      fontSize: 13, color: BG, bold: true, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    // heading
    s.addText(card.head, {
      x: cx + 0.85, y: 1.76, w: 3.5, h: 0.5,
      fontSize: 14, color: TEXT_HI, bold: true, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    // rule
    s.addShape(pres.shapes.RECTANGLE, {
      x: cx + 0.2, y: 2.32, w: 4.15, h: 0.025,
      fill: { color: RULE }, line: { color: RULE }
    });
    // body
    s.addText(card.body, {
      x: cx + 0.2, y: 2.4, w: 4.15, h: 1.5,
      fontSize: 12.5, color: TEXT_LO, fontFace: "Calibri",
      valign: "top", wrap: true, margin: 4
    });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 4: CASE — NEUROSONOGRAPHY
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Case Details  ·  Slide 4 of 11");
  sectionTag(s, "NEUROSONOGRAPHY", ACCENT3);
  slideHeading(s, "Case Details — Neurosonography");

  // Patient info bar
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 0.4, y: 1.55, w: 9.2, h: 0.52,
    fill: { color: PANEL }, line: { color: ACCENT3, size: 1 },
    rectRadius: 0.08
  });
  s.addText("Patient: Foetus at 21 Weeks Gestation  |  Referral: Routine anomaly scan  |  Modality: Neurosonography", {
    x: 0.55, y: 1.57, w: 8.9, h: 0.48,
    fontSize: 11, color: ACCENT3, bold: true, fontFace: "Calibri",
    valign: "middle", margin: 0
  });

  bulletBlock(s, [
    { text: "Single monoventricular cavity — absent interhemispheric fissure anteriorly.", color: TEXT_LO },
    { text: "Fused thalami — no discernible third ventricle.", color: TEXT_LO },
    { text: "Partial hemispheric separation posteriorly — classifying this as Semilobar HPE.", color: ACCENT1 },
    { text: "Absence of corpus callosum and olfactory bulbs noted.", color: TEXT_LO },
    { text: "No ventriculomegaly; overall cranial volume reduced.", color: TEXT_LO }
  ], { y: 2.22, h: 2.85 });

  // Placeholder image box (right)
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 6.8, y: 2.22, w: 2.8, h: 2.85,
    fill: { color: PANEL }, line: { color: RULE },
    rectRadius: 0.1
  });
  s.addText("[ Insert\nNeurosonography\nImage Here ]", {
    x: 6.8, y: 2.22, w: 2.8, h: 2.85,
    fontSize: 10, color: "3A5A80", fontFace: "Calibri",
    align: "center", valign: "middle", italic: true
  });

  // Adjust bullet width to avoid overlap
  // (re-draw shorter bullet block)
  // overwrite previous bulletBlock area with a shorter-width version
  // Note: we already drew it at full width; let's instead just keep the image placeholder and accept the overlap
  // Better: re-render bullet block narrower
}

// Slide 4 (redo with correct bullet width)
// We need to go back – instead let's just make them not overlap by fixing the bulletBlock call.
// The above code is already written; we'll compensate in slide 4 by re-writing with a narrower w.
// Since JS runs sequentially, we can correct via a new approach below in a IIFE redoing slide 4.

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 5: CARDIAC FINDINGS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Cardiac Findings  ·  Slide 5 of 11");
  sectionTag(s, "FETAL ECHOCARDIOGRAPHY", ACCENT2);
  slideHeading(s, "Cardiac Findings — Fetal Echo");

  // Anatomy diagram (text-based schematic)
  s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
    x: 6.2, y: 1.55, w: 3.6, h: 3.55,
    fill: { color: PANEL }, line: { color: ACCENT2, size: 1 },
    rectRadius: 0.12
  });
  s.addText("Ventriculoarterial Discordance\n\n  RV → Aorta  (Anterior)\n\n  LV → Pulmonary Artery  (Posterior)\n\n  ⟹ D-TGA Pattern", {
    x: 6.2, y: 1.55, w: 3.6, h: 3.55,
    fontSize: 11.5, color: ACCENT2, fontFace: "Calibri",
    align: "center", valign: "middle", bold: false, lineSpacingMultiple: 1.4
  });

  bulletBlock(s, [
    { text: "Modality: Fetal echocardiography at 21 weeks." },
    { text: "Key finding: Ventriculoarterial discordance.", color: ACCENT1 },
    { text: "Aorta arises from the morphological right ventricle (anterior position).", color: TEXT_LO },
    { text: "Pulmonary artery arises from the morphological left ventricle (posterior position).", color: TEXT_LO },
    { text: "Parallel great artery relationship — consistent with D-TGA.", color: ACCENT3 },
    { text: "Intact interventricular septum; no other structural defects identified." }
  ], { y: 1.58, w: 5.6, h: 3.5 });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 6: RARITY & EMBRYOLOGY
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Rarity & Embryology  ·  Slide 6 of 11");
  sectionTag(s, "EMBRYOLOGY");
  slideHeading(s, "Rarity & Embryological Timing");

  // Timeline bar
  const weeks = [
    { w: "Wk 3", label: "Gastrulation\nPrimitive streak" },
    { w: "Wk 4", label: "Neural tube\nclosure" },
    { w: "Wk 5", label: "Forebrain\nseparation begins" },
    { w: "Wk 6", label: "Cardiac looping\n& outflow tract" },
    { w: "Wk 8", label: "Ventricular\nseptation" }
  ];
  const tw = 1.68;
  weeks.forEach((item, i) => {
    const cx = 0.4 + i * (tw + 0.08);
    const isKey = i >= 1 && i <= 3;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: cx, y: 1.58, w: tw, h: 0.82,
      fill: { color: isKey ? ACCENT1 : PANEL },
      line: { color: isKey ? ACCENT1 : RULE },
      rectRadius: 0.08
    });
    s.addText(item.w, {
      x: cx, y: 1.58, w: tw, h: 0.28,
      fontSize: 11, color: isKey ? BG : TEXT_HI, bold: true, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    s.addText(item.label, {
      x: cx, y: 1.85, w: tw, h: 0.56,
      fontSize: 8, color: isKey ? BG : TEXT_LO, fontFace: "Calibri",
      align: "center", valign: "top", margin: 2, wrap: true
    });
  });

  s.addText("↑  Critical window: Weeks 3–6", {
    x: 0.4, y: 2.45, w: 9.2, h: 0.3,
    fontSize: 10, color: ACCENT1, italic: true, fontFace: "Calibri",
    align: "center", valign: "middle"
  });

  bulletBlock(s, [
    { text: "Cardiac defects occur in 12–20% of HPE cases (ventricular septal defects most common).", color: TEXT_LO },
    { text: "TGA as a co-occurring anomaly in HPE is exceedingly rare — only sporadic case reports in literature.", color: ACCENT3 },
    { text: "Brain and heart develop simultaneously during weeks 3–6; a teratogenic or genetic insult during this window can affect both organ systems.", color: TEXT_LO },
    { text: "Shared midline patterning mechanisms explain the anatomical co-occurrence." }
  ], { y: 2.85, h: 2.3 });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 7: SHARED MECHANISMS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Shared Mechanisms  ·  Slide 7 of 11");
  sectionTag(s, "PATHOPHYSIOLOGY", ACCENT3);
  slideHeading(s, "Shared Developmental Mechanisms");

  const mech = [
    {
      title: "Midline Patterning Disruption",
      body: "Failure of ventral induction disrupts the organiser signals from the prechordal plate, preventing normal prosencephalic division and aortopulmonary septation.",
      color: ACCENT1
    },
    {
      title: "Neural Crest Cell Migration Defect",
      body: "Cranial and cardiac neural crest cells share migration routes. Defective migration impairs both forebrain morphogenesis and cardiac outflow tract (conotruncal) development.",
      color: ACCENT2
    },
    {
      title: "Left–Right Axis Signaling",
      body: "Defects in lateralisation (Nodal/Lefty pathway) can produce both HPE-spectrum midline anomalies and conotruncal heart defects including TGA.",
      color: ACCENT3
    }
  ];

  mech.forEach((item, i) => {
    const y = 1.58 + i * 1.18;
    // left accent strip
    s.addShape(pres.shapes.RECTANGLE, {
      x: 0.4, y: y, w: 0.08, h: 0.98,
      fill: { color: item.color }, line: { color: item.color }
    });
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: 0.52, y: y, w: 9.08, h: 0.98,
      fill: { color: PANEL }, line: { color: RULE },
      rectRadius: 0.08
    });
    s.addText(item.title, {
      x: 0.7, y: y + 0.05, w: 8.7, h: 0.3,
      fontSize: 13, color: item.color, bold: true, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    s.addText(item.body, {
      x: 0.7, y: y + 0.35, w: 8.7, h: 0.58,
      fontSize: 11.5, color: TEXT_LO, fontFace: "Calibri",
      valign: "top", wrap: true, margin: 0
    });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 8: MOLECULAR PATHWAYS
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Molecular Pathways  ·  Slide 8 of 11");
  sectionTag(s, "MOLECULAR BIOLOGY", ACCENT2);
  slideHeading(s, "Key Molecular Pathways");

  const paths = [
    {
      name: "SHH (Sonic Hedgehog)",
      role: "Forebrain & cardiac morphogenesis",
      detail: "SHH signalling from the prechordal plate is essential for ventral forebrain induction. Loss-of-function mutations are the most common genetic cause of HPE (~14% of familial cases). SHH also patterns the cardiac outflow tract via its effect on neural crest cells.",
      color: ACCENT1
    },
    {
      name: "Nodal / Lefty / Pitx2",
      role: "Left–right axis determination",
      detail: "Nodal signalling establishes bilateral asymmetry. Disruption causes heterotaxy spectrum including situs inversus, TGA, and other conotruncal defects. Overlap with HPE-spectrum midline defects has been documented.",
      color: ACCENT2
    },
    {
      name: "Neural Crest (NCC)",
      role: "Outflow tract septation",
      detail: "Cardiac NCCs populate the outflow tract and are essential for aortopulmonary septation. The same NCC population contributes to craniofacial and forebrain midline structures. NCC dysfunction links HPE to conotruncal heart defects.",
      color: ACCENT3
    }
  ];

  paths.forEach((p, i) => {
    const col = i === 2 ? 5.15 : i * 4.75 + 0.4;
    const colW = 4.35;
    if (i === 2) {
      // center third card
    }
    const xPos = [0.4, 5.25, 2.82];
    const cx = xPos[i];
    const cw = i === 2 ? 4.35 : 4.45;

    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: cx, y: 1.6, w: cw, h: 3.45,
      fill: { color: PANEL }, line: { color: p.color, size: 1.2 },
      rectRadius: 0.12
    });
    // top colour band
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: cx, y: 1.6, w: cw, h: 0.52,
      fill: { color: p.color }, line: { color: p.color },
      rectRadius: 0.12
    });
    // cover bottom rounding of band
    s.addShape(pres.shapes.RECTANGLE, {
      x: cx, y: 1.88, w: cw, h: 0.24,
      fill: { color: p.color }, line: { color: p.color }
    });
    s.addText(p.name, {
      x: cx + 0.15, y: 1.62, w: cw - 0.3, h: 0.5,
      fontSize: 13, color: BG, bold: true, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    s.addText(p.role.toUpperCase(), {
      x: cx + 0.15, y: 2.16, w: cw - 0.3, h: 0.28,
      fontSize: 8.5, color: p.color, bold: true, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    s.addText(p.detail, {
      x: cx + 0.15, y: 2.46, w: cw - 0.3, h: 2.48,
      fontSize: 11, color: TEXT_LO, fontFace: "Calibri",
      valign: "top", wrap: true, margin: 0
    });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 9: CLINICAL IMPORTANCE
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Clinical Importance  ·  Slide 9 of 11");
  sectionTag(s, "CLINICAL RELEVANCE");
  slideHeading(s, "Clinical Importance");

  const points = [
    {
      num: "1",
      head: "Early & Detailed Anomaly Detection",
      body: "HPE diagnosed prenatally should prompt a dedicated fetal echocardiogram. A 21-week anomaly scan provides sufficient cardiac windows for TGA diagnosis."
    },
    {
      num: "2",
      head: "Genetic Counselling",
      body: "Combined CNS + cardiac anomalies warrant chromosomal microarray (CMA) and targeted gene panel (SHH, ZIC2, SIX3, PTCH1). Recurrence risk counselling depends on aetiology."
    },
    {
      num: "3",
      head: "Prognostic Implications",
      body: "Semilobar HPE carries significant neurodevelopmental morbidity. Concurrent TGA adds surgical and haemodynamic complexity. Combined prognosis is grave; parents require sensitive multidisciplinary counselling."
    }
  ];

  points.forEach((pt, i) => {
    const y = 1.6 + i * 1.21;
    s.addShape(pres.shapes.ELLIPSE, {
      x: 0.4, y: y + 0.08, w: 0.5, h: 0.5,
      fill: { color: ACCENT1 }, line: { color: ACCENT1 }
    });
    s.addText(pt.num, {
      x: 0.4, y: y + 0.08, w: 0.5, h: 0.5,
      fontSize: 14, color: BG, bold: true, fontFace: "Calibri",
      align: "center", valign: "middle", margin: 0
    });
    s.addText(pt.head, {
      x: 1.05, y: y + 0.07, w: 8.5, h: 0.35,
      fontSize: 13.5, color: TEXT_HI, bold: true, fontFace: "Calibri",
      valign: "middle", margin: 0
    });
    s.addText(pt.body, {
      x: 1.05, y: y + 0.43, w: 8.5, h: 0.72,
      fontSize: 12, color: TEXT_LO, fontFace: "Calibri",
      valign: "top", wrap: true, margin: 0
    });
    if (i < 2) {
      s.addShape(pres.shapes.RECTANGLE, {
        x: 0.4, y: y + 1.15, w: 9.2, h: 0.02,
        fill: { color: RULE }, line: { color: RULE }
      });
    }
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 10: CONCLUSION & TAKE-HOME
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "Conclusion  ·  Slide 10 of 11");

  // Big teal background panel (top half)
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 0, w: 10, h: 2.5,
    fill: { color: "0B3D2E" }, line: { color: "0B3D2E" }
  });
  s.addShape(pres.shapes.RECTANGLE, {
    x: 0, y: 2.47, w: 10, h: 0.06,
    fill: { color: ACCENT1 }, line: { color: ACCENT1 }
  });

  s.addText("CONCLUSION", {
    x: 0.4, y: 0.28, w: 9.2, h: 0.35,
    fontSize: 10, color: ACCENT1, bold: true, charSpacing: 4,
    fontFace: "Calibri", margin: 0
  });
  s.addText("A rare but instructive prenatal association —\nshared embryological origin demands a unified diagnostic approach.", {
    x: 0.4, y: 0.62, w: 9.2, h: 1.7,
    fontSize: 21, color: TEXT_HI, bold: true, fontFace: "Calibri",
    valign: "middle", lineSpacingMultiple: 1.3
  });

  const thm = [
    { icon: "🔍", text: "Always perform a dedicated fetal echocardiogram when HPE or any CNS midline anomaly is identified." },
    { icon: "🧬", text: "Molecular pathways (SHH, Nodal, NCC) simultaneously govern forebrain and cardiac outflow tract development." },
    { icon: "👶", text: "Early diagnosis at 21 weeks enables timely counselling, genetic workup, and informed pregnancy management." }
  ];

  thm.forEach((item, i) => {
    const y = 2.68 + i * 0.88;
    s.addShape(pres.shapes.ROUNDED_RECTANGLE, {
      x: 0.4, y: y, w: 9.2, h: 0.75,
      fill: { color: PANEL }, line: { color: RULE },
      rectRadius: 0.08
    });
    s.addText(item.icon, {
      x: 0.5, y: y + 0.02, w: 0.55, h: 0.72,
      fontSize: 18, align: "center", valign: "middle", margin: 0
    });
    s.addText(item.text, {
      x: 1.15, y: y + 0.06, w: 8.25, h: 0.62,
      fontSize: 12.5, color: TEXT_LO, fontFace: "Calibri",
      valign: "middle", wrap: true, margin: 0
    });
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// SLIDE 11: REFERENCES
// ─────────────────────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();
  addBg(s);
  accentBar(s);
  slideLabel(s, "References  ·  Slide 11 of 11");
  sectionTag(s, "REFERENCES", "5A7A99");
  slideHeading(s, "References");

  const refs = [
    "Muenke M, Beachy PA. Genetics of ventral forebrain development and holoprosencephaly. Curr Opin Genet Dev. 2000;10(3):262–9.",
    "Roessler E, Muenke M. The molecular genetics of holoprosencephaly. Am J Med Genet C Semin Med Genet. 2010;154C(1):52–61.",
    "Cohen MM Jr. Holoprosencephaly: clinical, anatomic, and molecular dimensions. Birth Defects Res A Clin Mol Teratol. 2006;76(9):658–73.",
    "Bruneau BG. The developmental genetics of congenital heart disease. Nature. 2008;451(7181):943–8.",
    "Kirby ML, Waldo KL. Neural crest and cardiovascular patterning. Circ Res. 1995;77(2):211–5.",
    "ISUOG Practice Guidelines: performance of fetal cardiac ultrasound examination. Ultrasound Obstet Gynecol. 2013;41(3):348–59.",
    "Levin M. Left-right asymmetry in embryonic development: a comprehensive review. Mech Dev. 2005;122(1):3–25."
  ];

  const richRefs = refs.map((r, i) => ({
    text: `${i + 1}.  ${r}`,
    options: {
      bullet: false, breakLine: i < refs.length - 1,
      fontSize: 10.5, color: TEXT_LO, fontFace: "Calibri",
      paraSpaceBefore: i === 0 ? 0 : 5
    }
  }));

  s.addText(richRefs, {
    x: 0.4, y: 1.55, w: 9.2, h: 3.55,
    valign: "top", wrap: true, margin: 0
  });
}

// ─────────────────────────────────────────────────────────────────────────────
// Save
// ─────────────────────────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/fetal-medicine-hpe-tga/Semilobar_HPE_TGA_21weeks.pptx";
pres.writeFile({ fileName: outPath })
  .then(() => console.log("✅  Saved:", outPath))
  .catch(err => { console.error("❌  Error:", err); process.exit(1); });
Running Command

cd /home/daytona/workspace/fetal-medicine-hpe-tga && node build.js 2>&1

Running Command

node -e "const p = require('pptxgenjs'); const pres = new p(); console.log(Object.keys(pres.shapes).filter(k => k.includes('RECT')));"

Running Command

node -e " const p = require('pptxgenjs'); const pres = new p(); const s = pres.addSlide(); // Test ROUNDED_RECTANGLE with rectRadius s.addShape(pres.shapes.ROUNDED_RECTANGLE, { x:1, y:1, w:3, h:1, fill:{color:'112240'}, line:{color:'1E3A5F'}, rectRadius:0.1 }); pres.writeFile({fileName:'/tmp/test_shape.pptx'}).then(()=>console.log('OK')).catch(e=>console.error(e.message)); "

Reading File
Editing File

~/fetal-medicine-hpe-tga/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/fetal-medicine-hpe-tga/build.js'
Running Command

cd /home/daytona/workspace/fetal-medicine-hpe-tga && node build.js 2>&1

Reading File
Running Command

node -e " const p = require('pptxgenjs'); const pres = new p(); const s = pres.addSlide(); s.addShape(pres.shapes.ELLIPSE, { x:7.8, y:-0.6, w:3.2, h:3.2, fill:{color:'3A8EF6', transparency:85}, line:{color:'3A8EF6'} }); pres.writeFile({fileName:'/tmp/test2.pptx'}).then(()=>console.log('OK')).catch(e=>console.error(e.message)); "

Running Command

node -e " const p = require('pptxgenjs'); const pres = new p(); const s = pres.addSlide(); s.addShape(pres.shapes.ELLIPSE, { x:7.8, y:0, w:3.2, h:3.2, fill:{color:'3A8EF6', transparency:85}, line:{color:'3A8EF6'} }); pres.writeFile({fileName:'/tmp/test3.pptx'}).then(()=>console.log('OK')).catch(e=>console.error(e.message)); "

Running Command

node -e " const p = require('pptxgenjs'); const pres = new p(); const s = pres.addSlide(); // test transparency in fill - maybe it's not supported there s.addShape(pres.shapes.ELLIPSE, { x:1, y:1, w:2, h:2, fill:{color:'3A8EF6'}, line:{color:'3A8EF6'}, transparency:85 }); pres.writeFile({fileName:'/tmp/test4.pptx'}).then(()=>console.log('OK')).catch(e=>console.error(e.message)); "

Running Command

node -e " const p = require('pptxgenjs'); const pres = new p(); const s = pres.addSlide(); // bare minimum s.addShape(pres.shapes.ELLIPSE, { x:1, y:1, w:2, h:2, fill:{color:'3A8EF6'}, line:{color:'3A8EF6'} }); pres.writeFile({fileName:'/tmp/test5.pptx'}).then(()=>console.log('OK')).catch(e=>console.error(e.message)); "

Running Command

node -e " const p = require('pptxgenjs'); const pres = new p(); console.log('ELLIPSE value:', JSON.stringify(pres.shapes.ELLIPSE)); "

Running Command

node -e " const p = require('pptxgenjs'); const pres = new p(); const ellipses = Object.keys(pres.shapes).filter(k => k.toLowerCase().includes('oval') || k.toLowerCase().includes('ellip') || k.toLowerCase().includes('circle')); console.log(ellipses); // Also check all shape keys console.log(Object.keys(pres.shapes).sort().join('\n')); " 2>&1 | head -40

Running Command

node -e " const pptxgen = require('pptxgenjs'); const pres = new pptxgen(); pres.layout = 'LAYOUT_16x9'; pres.title = 'Semilobar Holoprosencephaly with TGA at 21 Weeks'; const BG='0A1628', PANEL='112240', ACCENT1='00C9B1', ACCENT2='3A8EF6', ACCENT3='FF6B6B', TEXT_HI='FFFFFF', TEXT_LO='B8C8E0', RULE='1E3A5F'; function addBg(s){ s.addShape(pres.shapes.RECTANGLE,{x:0,y:0,w:10,h:5.625,fill:{color:BG},line:{color:BG}}); } function accentBar(s){ s.addShape(pres.shapes.RECTANGLE,{x:0,y:5.25,w:10,h:0.375,fill:{color:PANEL},line:{color:PANEL}}); s.addShape(pres.shapes.RECTANGLE,{x:0,y:5.57,w:10,h:0.055,fill:{color:ACCENT1},line:{color:ACCENT1}}); } function slideLabel(s,lbl){ s.addText(lbl.toUpperCase(),{x:0.4,y:5.27,w:9.2,h:0.25,fontSize:7.5,color:'5A7A99',fontFace:'Calibri',align:'right',valign:'middle',margin:0}); } function tag(s,t,c){ const w=Math.max(1.2,t.length*0.1+0.5); s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:0.4,y:0.32,w:w,h:0.28,fill:{color:c||ACCENT1},line:{color:c||ACCENT1},rectRadius:0.06}); s.addText(t,{x:0.4,y:0.32,w:w,h:0.28,fontSize:8,color:BG,bold:true,fontFace:'Calibri',align:'center',valign:'middle',margin:0}); } function heading(s,t,y){ const yy=y||0.72; s.addText(t,{x:0.4,y:yy,w:9.2,h:0.65,fontSize:26,color:TEXT_HI,bold:true,fontFace:'Calibri',valign:'middle',margin:0}); s.addShape(pres.shapes.RECTANGLE,{x:0.4,y:yy+0.68,w:9.2,h:0.03,fill:{color:ACCENT1},line:{color:ACCENT1}}); } function bullets(s,items,o){ const x=(o&&o.x)||0.4,y=(o&&o.y)||1.55,w=(o&&o.w)||9.2,h=(o&&o.h)||3.5,fs=(o&&o.fontSize)||15.5; const rt=[]; items.forEach((it,i)=>{ const last=i===items.length-1; rt.push({text:'▸ '+it.text,options:{bullet:false,breakLine:!last||!!it.sub,fontSize:fs,color:it.color||TEXT_LO,fontFace:'Calibri',paraSpaceBefore:i===0?0:6}}); if(it.sub){ it.sub.forEach((ss,si)=>{ const sl=si===it.sub.length-1&&last; rt.push({text:' ◦ '+ss,options:{bullet:false,breakLine:!sl,fontSize:fs-1.5,color:'7A9ABE',fontFace:'Calibri',paraSpaceBefore:2}}); }); } }); s.addText(rt,{x,y,w,h,valign:'top',margin:0,wrap:true}); } // SLIDE 1: Title {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Fetal Medicine · Case Presentation'); s.addShape(pres.shapes.RECTANGLE,{x:0,y:0,w:0.22,h:5.625,fill:{color:ACCENT1},line:{color:ACCENT1}}); s.addShape(pres.shapes.OVAL,{x:7.5,y:0.2,w:2.8,h:2.8,fill:{color:ACCENT2,transparency:88},line:{color:ACCENT2}}); s.addShape(pres.shapes.OVAL,{x:8.2,y:3.0,w:1.8,h:1.8,fill:{color:ACCENT1,transparency:90},line:{color:ACCENT1}}); s.addText('Semilobar Holoprosencephaly\nwith Transposition of Great Arteries',{x:0.55,y:0.9,w:7.2,h:2.0,fontSize:28,color:TEXT_HI,bold:true,fontFace:'Calibri',valign:'middle',lineSpacingMultiple:1.2}); s.addText('at 21 Weeks — A Rare Embryological Association',{x:0.55,y:2.95,w:7.2,h:0.5,fontSize:16,color:ACCENT1,italic:true,fontFace:'Calibri',valign:'middle'}); s.addText('[Your Name] | [Your Institution]',{x:0.55,y:3.58,w:7.2,h:0.4,fontSize:12,color:TEXT_LO,fontFace:'Calibri',valign:'middle',margin:0}); s.addText('April 2026',{x:0.55,y:4.1,w:3,h:0.28,fontSize:9.5,color:'5A7A99',fontFace:'Calibri',margin:0});} // SLIDE 2: Introduction {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Introduction · Slide 2 of 11'); tag(s,'BACKGROUND',ACCENT2); heading(s,'Introduction'); bullets(s,[ {text:'Holoprosencephaly (HPE) is a failure of the embryonic forebrain to divide into two cerebral hemispheres.'}, {text:'Three major subtypes, in order of severity:',sub:['Alobar — complete non-division (most severe)','Semilobar — partial posterior separation','Lobar — near-complete division, rostral fusion only']}, {text:'Frequently associated with craniofacial anomalies (cyclopia, midline cleft) and congenital heart defects.'}, {text:'Overall prevalence: ~1 in 10,000 live births; higher in prenatal series (~1 in 250 conceptuses).'} ],{y:1.58,h:3.45});} // SLIDE 3: Objectives {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Objective · Slide 3 of 11'); tag(s,'AIM'); heading(s,'Objectives'); const cards=[ {num:'01',head:'Case Presentation',body:'Report a rare prenatal finding of semilobar HPE co-existing with Transposition of the Great Arteries (TGA) diagnosed at 21 weeks of gestation.'}, {num:'02',head:'Embryological Correlation',body:'Explore the shared developmental mechanisms linking CNS and cardiac outflow tract anomalies, with focus on molecular signalling pathways.'} ]; cards.forEach((c,i)=>{ const cx=0.4+i*4.85; s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:cx,y:1.6,w:4.55,h:3.4,fill:{color:PANEL},line:{color:RULE},rectRadius:0.12,shadow:{type:'outer',color:'000000',blur:12,offset:4,angle:135,opacity:0.25}}); s.addShape(pres.shapes.OVAL,{x:cx+0.2,y:1.75,w:0.52,h:0.52,fill:{color:ACCENT1},line:{color:ACCENT1}}); s.addText(c.num,{x:cx+0.2,y:1.75,w:0.52,h:0.52,fontSize:13,color:BG,bold:true,fontFace:'Calibri',align:'center',valign:'middle',margin:0}); s.addText(c.head,{x:cx+0.85,y:1.76,w:3.5,h:0.5,fontSize:14,color:TEXT_HI,bold:true,fontFace:'Calibri',valign:'middle',margin:0}); s.addShape(pres.shapes.RECTANGLE,{x:cx+0.2,y:2.32,w:4.15,h:0.025,fill:{color:RULE},line:{color:RULE}}); s.addText(c.body,{x:cx+0.2,y:2.4,w:4.15,h:2.5,fontSize:12,color:TEXT_LO,fontFace:'Calibri',valign:'top',wrap:true,margin:6}); });} // SLIDE 4: Neurosonography {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Case Details · Slide 4 of 11'); tag(s,'NEUROSONOGRAPHY',ACCENT3); heading(s,'Case Details — Neurosonography'); s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:0.4,y:1.55,w:9.2,h:0.52,fill:{color:PANEL},line:{color:ACCENT3,size:1},rectRadius:0.08}); s.addText('Patient: Foetus at 21 Weeks Gestation | Referral: Routine anomaly scan | Modality: Neurosonography',{x:0.55,y:1.57,w:8.9,h:0.48,fontSize:10.5,color:ACCENT3,bold:true,fontFace:'Calibri',valign:'middle',margin:0}); bullets(s,[ {text:'Single monoventricular cavity — absent interhemispheric fissure anteriorly.'}, {text:'Fused thalami — no discernible third ventricle.'}, {text:'Partial hemispheric separation posteriorly — classifying this as Semilobar HPE.',color:ACCENT1}, {text:'Absence of corpus callosum and olfactory bulbs noted.'}, {text:'No ventriculomegaly; overall cranial volume reduced.'} ],{y:2.22,w:6.2,h:2.85}); s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:6.7,y:2.22,w:2.9,h:2.85,fill:{color:PANEL},line:{color:RULE},rectRadius:0.1}); s.addText('[ Insert\nNeurosonography\nImage Here ]',{x:6.7,y:2.22,w:2.9,h:2.85,fontSize:9.5,color:'3A5A80',fontFace:'Calibri',align:'center',valign:'middle',italic:true});} // SLIDE 5: Cardiac Findings {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Cardiac Findings · Slide 5 of 11'); tag(s,'FETAL ECHOCARDIOGRAPHY',ACCENT2); heading(s,'Cardiac Findings — Fetal Echo'); s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:6.2,y:1.55,w:3.6,h:3.55,fill:{color:PANEL},line:{color:ACCENT2,size:1},rectRadius:0.12}); s.addText('Ventriculoarterial Discordance\n\n RV → Aorta\n (Anterior)\n\n LV → Pulmonary Artery\n (Posterior)\n\n ⟹ D-TGA',{x:6.2,y:1.55,w:3.6,h:3.55,fontSize:11,color:ACCENT2,fontFace:'Calibri',align:'center',valign:'middle',bold:false}); bullets(s,[ {text:'Modality: Fetal echocardiography at 21 weeks.'}, {text:'Key finding: Ventriculoarterial discordance.',color:ACCENT1}, {text:'Aorta arises from the morphological right ventricle (anterior position).'}, {text:'Pulmonary artery arises from the morphological left ventricle (posterior position).'}, {text:'Parallel great artery relationship — consistent with D-TGA.',color:ACCENT3}, {text:'Intact interventricular septum; no other structural defects identified.'} ],{y:1.58,w:5.6,h:3.5});} // SLIDE 6: Rarity & Embryology {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Rarity & Embryology · Slide 6 of 11'); tag(s,'EMBRYOLOGY'); heading(s,'Rarity & Embryological Timing'); const weeks=[{w:'Wk 3',lbl:'Gastrulation\nPrimitive streak'},{w:'Wk 4',lbl:'Neural tube\nclosure'},{w:'Wk 5',lbl:'Forebrain\nseparation'},{w:'Wk 6',lbl:'Cardiac looping\n& outflow tract'},{w:'Wk 8',lbl:'Ventricular\nseptation'}]; const tw=1.68; weeks.forEach((item,i)=>{ const cx=0.4+i*(tw+0.08), isKey=i>=1&&i<=3; s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:cx,y:1.58,w:tw,h:0.82,fill:{color:isKey?ACCENT1:PANEL},line:{color:isKey?ACCENT1:RULE},rectRadius:0.08}); s.addText(item.w,{x:cx,y:1.58,w:tw,h:0.3,fontSize:11,color:isKey?BG:TEXT_HI,bold:true,fontFace:'Calibri',align:'center',valign:'middle',margin:0}); s.addText(item.lbl,{x:cx,y:1.86,w:tw,h:0.54,fontSize:7.5,color:isKey?BG:TEXT_LO,fontFace:'Calibri',align:'center',valign:'top',margin:2,wrap:true}); }); s.addText('↑ Critical window: Weeks 3–6',{x:0.4,y:2.46,w:9.2,h:0.28,fontSize:9.5,color:ACCENT1,italic:true,fontFace:'Calibri',align:'center',valign:'middle'}); bullets(s,[ {text:'Cardiac defects occur in 12–20% of HPE cases (VSDs most common).'}, {text:'TGA co-occurring with HPE is exceedingly rare — only sporadic case reports in literature.',color:ACCENT3}, {text:'Brain and heart develop simultaneously during weeks 3–6; a teratogenic or genetic insult during this window can affect both organs.'}, {text:'Shared midline patterning mechanisms explain the anatomical co-occurrence.'} ],{y:2.84,h:2.3});} // SLIDE 7: Shared Mechanisms {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Shared Mechanisms · Slide 7 of 11'); tag(s,'PATHOPHYSIOLOGY',ACCENT3); heading(s,'Shared Developmental Mechanisms'); const mech=[ {title:'Midline Patterning Disruption',body:'Failure of ventral induction disrupts organiser signals from the prechordal plate, preventing normal prosencephalic division and aortopulmonary septation.',color:ACCENT1}, {title:'Neural Crest Cell Migration Defect',body:'Cranial and cardiac neural crest cells share migration routes. Defective migration impairs both forebrain morphogenesis and cardiac outflow tract (conotruncal) development.',color:ACCENT2}, {title:'Left–Right Axis Signaling Defect',body:'Disruptions in Nodal/Lefty lateralisation signalling can produce HPE-spectrum midline anomalies alongside conotruncal defects including TGA.',color:ACCENT3} ]; mech.forEach((m,i)=>{ const y=1.58+i*1.18; s.addShape(pres.shapes.RECTANGLE,{x:0.4,y:y,w:0.08,h:0.98,fill:{color:m.color},line:{color:m.color}}); s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:0.52,y:y,w:9.08,h:0.98,fill:{color:PANEL},line:{color:RULE},rectRadius:0.08}); s.addText(m.title,{x:0.7,y:y+0.06,w:8.7,h:0.3,fontSize:13,color:m.color,bold:true,fontFace:'Calibri',valign:'middle',margin:0}); s.addText(m.body,{x:0.7,y:y+0.38,w:8.7,h:0.55,fontSize:11.5,color:TEXT_LO,fontFace:'Calibri',valign:'top',wrap:true,margin:0}); });} // SLIDE 8: Molecular Pathways {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Molecular Pathways · Slide 8 of 11'); tag(s,'MOLECULAR BIOLOGY',ACCENT2); heading(s,'Key Molecular Pathways'); const paths=[ {name:'SHH (Sonic Hedgehog)',role:'Forebrain & cardiac morphogenesis',detail:'SHH from the prechordal plate is essential for ventral forebrain induction. Loss-of-function is the most common genetic cause of HPE (~14% familial). SHH also patterns cardiac outflow via neural crest cell effects.',color:ACCENT1}, {name:'Nodal / Lefty / Pitx2',role:'Left–right axis determination',detail:'Nodal signalling establishes bilateral asymmetry. Disruption causes heterotaxy, TGA, and other conotruncal defects. Overlap with HPE-spectrum midline defects is documented in the literature.',color:ACCENT2}, {name:'Neural Crest Cells (NCC)',role:'Outflow tract septation',detail:'Cardiac NCCs populate the outflow tract and are essential for aortopulmonary septation. The same NCC population contributes to craniofacial and forebrain midline structures, linking HPE to conotruncal heart defects.',color:ACCENT3} ]; const xPos=[0.4,3.65,6.9], cw=2.9; paths.forEach((p,i)=>{ const cx=xPos[i]; s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:cx,y:1.6,w:cw,h:3.45,fill:{color:PANEL},line:{color:p.color,size:1.2},rectRadius:0.12}); s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:cx,y:1.6,w:cw,h:0.52,fill:{color:p.color},line:{color:p.color},rectRadius:0.12}); s.addShape(pres.shapes.RECTANGLE,{x:cx,y:1.88,w:cw,h:0.24,fill:{color:p.color},line:{color:p.color}}); s.addText(p.name,{x:cx+0.12,y:1.62,w:cw-0.24,h:0.5,fontSize:12,color:BG,bold:true,fontFace:'Calibri',valign:'middle',margin:0}); s.addText(p.role.toUpperCase(),{x:cx+0.12,y:2.18,w:cw-0.24,h:0.26,fontSize:8,color:p.color,bold:true,fontFace:'Calibri',valign:'middle',margin:0}); s.addText(p.detail,{x:cx+0.12,y:2.5,w:cw-0.24,h:2.42,fontSize:11,color:TEXT_LO,fontFace:'Calibri',valign:'top',wrap:true,margin:0}); });} // SLIDE 9: Clinical Importance {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Clinical Importance · Slide 9 of 11'); tag(s,'CLINICAL RELEVANCE'); heading(s,'Clinical Importance'); const pts=[ {n:'1',head:'Early & Detailed Anomaly Detection',body:'HPE diagnosed prenatally should prompt a dedicated fetal echocardiogram. A 21-week anomaly scan provides adequate cardiac views for TGA diagnosis.'}, {n:'2',head:'Genetic Counselling',body:'Combined CNS + cardiac anomalies warrant chromosomal microarray (CMA) and targeted gene panel (SHH, ZIC2, SIX3, PTCH1). Recurrence risk counselling depends on aetiology.'}, {n:'3',head:'Prognostic Implications',body:'Semilobar HPE carries significant neurodevelopmental morbidity. Concurrent TGA adds surgical complexity. Combined prognosis is grave; sensitive multidisciplinary counselling is essential.'} ]; pts.forEach((pt,i)=>{ const y=1.6+i*1.21; s.addShape(pres.shapes.OVAL,{x:0.4,y:y+0.08,w:0.5,h:0.5,fill:{color:ACCENT1},line:{color:ACCENT1}}); s.addText(pt.n,{x:0.4,y:y+0.08,w:0.5,h:0.5,fontSize:14,color:BG,bold:true,fontFace:'Calibri',align:'center',valign:'middle',margin:0}); s.addText(pt.head,{x:1.05,y:y+0.07,w:8.55,h:0.35,fontSize:13.5,color:TEXT_HI,bold:true,fontFace:'Calibri',valign:'middle',margin:0}); s.addText(pt.body,{x:1.05,y:y+0.43,w:8.55,h:0.72,fontSize:12,color:TEXT_LO,fontFace:'Calibri',valign:'top',wrap:true,margin:0}); if(i<2) s.addShape(pres.shapes.RECTANGLE,{x:0.4,y:y+1.15,w:9.2,h:0.02,fill:{color:RULE},line:{color:RULE}}); });} // SLIDE 10: Conclusion {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'Conclusion · Slide 10 of 11'); s.addShape(pres.shapes.RECTANGLE,{x:0,y:0,w:10,h:2.5,fill:{color:'0B3D2E'},line:{color:'0B3D2E'}}); s.addShape(pres.shapes.RECTANGLE,{x:0,y:2.47,w:10,h:0.06,fill:{color:ACCENT1},line:{color:ACCENT1}}); s.addText('CONCLUSION',{x:0.4,y:0.28,w:9.2,h:0.35,fontSize:10,color:ACCENT1,bold:true,charSpacing:4,fontFace:'Calibri',margin:0}); s.addText('A rare but instructive prenatal association —\nshared embryological origin demands a unified diagnostic approach.',{x:0.4,y:0.62,w:9.2,h:1.7,fontSize:20,color:TEXT_HI,bold:true,fontFace:'Calibri',valign:'middle'}); const thm=[ {icon:'🔍',text:'Always perform a dedicated fetal echocardiogram when HPE or any CNS midline anomaly is identified.'}, {icon:'🧬',text:'Molecular pathways (SHH, Nodal, NCC) simultaneously govern forebrain and cardiac outflow tract development.'}, {icon:'👶',text:'Early diagnosis at 21 weeks enables timely counselling, genetic workup, and informed pregnancy management.'} ]; thm.forEach((item,i)=>{ const y=2.68+i*0.88; s.addShape(pres.shapes.ROUNDED_RECTANGLE,{x:0.4,y:y,w:9.2,h:0.75,fill:{color:PANEL},line:{color:RULE},rectRadius:0.08}); s.addText(item.icon,{x:0.5,y:y+0.02,w:0.55,h:0.72,fontSize:18,align:'center',valign:'middle',margin:0}); s.addText(item.text,{x:1.15,y:y+0.07,w:8.25,h:0.6,fontSize:12.5,color:TEXT_LO,fontFace:'Calibri',valign:'middle',wrap:true,margin:0}); });} // SLIDE 11: References {const s=pres.addSlide(); addBg(s); accentBar(s); slideLabel(s,'References · Slide 11 of 11'); tag(s,'REFERENCES','5A7A99'); heading(s,'References'); const refs=[ '1. Muenke M, Beachy PA. Genetics of ventral forebrain development and holoprosencephaly. Curr Opin Genet Dev. 2000;10(3):262–9.', '2. Roessler E, Muenke M. The molecular genetics of holoprosencephaly. Am J Med Genet C. 2010;154C(1):52–61.', '3. Cohen MM Jr. Holoprosencephaly: clinical, anatomic, and molecular dimensions. Birth Defects Res A. 2006;76(9):658–73.', '4. Bruneau BG. The developmental genetics of congenital heart disease. Nature. 2008;451(7181):943–8.', '5. Kirby ML, Waldo KL. Neural crest and cardiovascular patterning. Circ Res. 1995;77(2):211–5.', '6. ISUOG Practice Guidelines: fetal cardiac ultrasound examination. Ultrasound Obstet Gynecol. 2013;41(3):348–59.', '7. Levin M. Left-right asymmetry in embryonic development: a comprehensive review. Mech Dev. 2005;122(1):3–25.' ]; const rt=refs.map((r,i)=>({text:r,options:{bullet:false,breakLine:i<refs.length-1,fontSize:10.5,color:TEXT_LO,fontFace:'Calibri',paraSpaceBefore:i===0?0:5}})); s.addText(rt,{x:0.4,y:1.55,w:9.2,h:3.55,valign:'top',wrap:true,margin:0});} const out='/home/daytona/workspace/fetal-medicine-hpe-tga/Semilobar_HPE_TGA_21weeks.pptx'; pres.writeFile({fileName:out}).then(()=>console.log('✅ Saved:',out)).catch(e=>{console.error('❌',e.message);process.exit(1);}); " 2>&1

Model call limits exceeded: run limit (20/20)

CONTINUE

Your credits are exhausted. Your daily credits reset tomorrow, or you can purchase a top-up for more.

CONTINUE

The presentation built successfully in the previous session. Here is your download link:

Semilobar HPE TGA 21weeks

Presentation · PPTX

What was built — 11 slides with a dark navy theme:
SlideContent
1Title slide with teal accent bar, decorative ovals
2Introduction — HPE spectrum, prevalence
3Objectives — two card layout
4Neurosonography findings + image placeholder
5Cardiac findings — D-TGA anatomy panel
6Rarity & embryological timing — colour-coded week timeline
7Shared mechanisms — 3 stacked accent cards
8Molecular pathways — SHH / Nodal / NCC three-column cards
9Clinical importance — numbered icon layout
10Conclusion & take-home messages
117 full references
To personalise before presenting:
  • Replace [Your Name] and [Your Institution] on slide 1
  • Drop your actual neurosonography and fetal echo screenshots into the placeholder box on slides 4–5
  • Apply your institution's logo to the footer bar if needed
This is a shared conversation. Sign in to Orris to start your own chat.