Physiological changes during pregnancy from dc dutta textbook and at the end make a detailed summary chart to download for ready visual memory

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Reading File
Reading File
Reading File
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && mkdir -p /home/daytona/workspace/pregnancy-physiology

Writing File

~/pregnancy-physiology/create_chart.js

const pptxgen = require("pptxgenjs");

let pres = new pptxgen();
pres.layout = 'LAYOUT_WIDE'; // 13.3" x 7.5"
pres.title = 'Physiological Changes During Pregnancy';
pres.author = 'Orris Medical Reference';

// ─── Color Palette ───────────────────────────────────────────────────────────
const C = {
  darkBg:   "1A1A2E",   // deep navy – dark slides
  midBg:    "16213E",
  accent1:  "E94560",   // coral red – headings
  accent2:  "0F3460",   // dark blue
  teal:     "00B4D8",   // teal – sub-headings
  gold:     "FFD166",   // gold – numbers/values
  white:    "FFFFFF",
  lightGray:"E8EDF5",
  textDark: "1A1A2E",
  green:    "06D6A0",
  purple:   "9B5DE5",
  orange:   "F77F00",
  pink:     "FF6B9D",
};

// ─── SLIDE 1: Title ───────────────────────────────────────────────────────────
{
  let s = pres.addSlide();
  // background gradient effect via shapes
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:C.darkBg}, line:{color:C.darkBg} });
  s.addShape(pres.ShapeType.rect, { x:0, y:5.5, w:13.3, h:2, fill:{color:C.accent2}, line:{color:C.accent2} });

  // decorative bar
  s.addShape(pres.ShapeType.rect, { x:0.5, y:1.6, w:12.3, h:0.06, fill:{color:C.accent1}, line:{color:C.accent1} });
  s.addShape(pres.ShapeType.rect, { x:0.5, y:3.9, w:12.3, h:0.06, fill:{color:C.teal}, line:{color:C.teal} });

  s.addText("PHYSIOLOGICAL CHANGES", {
    x:0.5, y:1.0, w:12.3, h:0.65, fontSize:38, bold:true, color:C.white,
    fontFace:"Calibri", align:"center", charSpacing:4, margin:0
  });
  s.addText("DURING PREGNANCY", {
    x:0.5, y:1.7, w:12.3, h:0.65, fontSize:38, bold:true, color:C.gold,
    fontFace:"Calibri", align:"center", charSpacing:4, margin:0
  });
  s.addText("A Complete System-by-System Visual Reference", {
    x:0.5, y:2.55, w:12.3, h:0.5, fontSize:18, color:C.teal,
    fontFace:"Calibri", align:"center", italic:true, margin:0
  });
  s.addText("Based on DC Dutta's Textbook of Obstetrics & Standard References", {
    x:0.5, y:3.15, w:12.3, h:0.4, fontSize:13, color:C.lightGray,
    fontFace:"Calibri", align:"center", margin:0
  });

  // system icons row
  const systems = ["CARDIOVASCULAR","RESPIRATORY","HEMATOLOGICAL","RENAL","ENDOCRINE","GASTROINTESTINAL","NEUROLOGICAL","METABOLIC","MUSCULOSKELETAL"];
  systems.forEach((sys, i) => {
    const cols = 5;
    const col = i % cols;
    const row = Math.floor(i / cols);
    const xStart = 0.6;
    const xGap = 2.4;
    const yStart = 4.55;
    const yGap = 0.9;
    s.addShape(pres.ShapeType.roundRect, {
      x: xStart + col*xGap, y: yStart + row*yGap, w:2.1, h:0.7,
      fill:{color:C.accent1}, line:{color:C.accent1}, rectRadius:0.1
    });
    s.addText(sys, {
      x: xStart + col*xGap, y: yStart + row*yGap, w:2.1, h:0.7,
      fontSize:8, bold:true, color:C.white, fontFace:"Calibri", align:"center", valign:"middle", margin:0
    });
  });

  s.addText("Orris Medical Reference  |  Visual Memory Chart  |  2026", {
    x:0.5, y:7.1, w:12.3, h:0.3, fontSize:9, color:C.teal,
    fontFace:"Calibri", align:"center", margin:0
  });
}

// ─── SLIDE 2: Quick Numbers Table ─────────────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"0D1B2A"}, line:{color:"0D1B2A"} });

  // header bar
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.75, fill:{color:C.accent1}, line:{color:C.accent1} });
  s.addText("AT-A-GLANCE: KEY NUMERICAL CHANGES IN PREGNANCY", {
    x:0.3, y:0, w:12.7, h:0.75, fontSize:17, bold:true, color:C.white,
    fontFace:"Calibri", align:"center", valign:"middle", margin:0
  });

  // table data
  const rows = [
    ["Parameter", "Change", "Direction", "Parameter", "Change", "Direction"],
    // Row pairs
    ["Plasma Volume", "+55%", "↑", "GFR (Renal)", "+50%", "↑"],
    ["Total Blood Volume", "+35%", "↑", "Creatinine", "↓ to ~0.4 mg/dL", "↓"],
    ["Cardiac Output", "+40%", "↑", "BUN", "↓ to ~9 mg/dL", "↓"],
    ["Heart Rate", "+20%", "↑", "Prolactin", "×10 increase", "↑↑"],
    ["Stroke Volume", "+30%", "↑", "Cortisol (total)", "×3 increase", "↑↑"],
    ["Systolic BP", "-5%", "↓", "Aldosterone", "+6× increase", "↑↑"],
    ["Diastolic BP", "-15%", "↓", "Thyroid (total T4/T3)", "↑ (free normal)", "→"],
    ["Peripheral Resistance", "-15%", "↓", "Serum Albumin", "↓", "↓"],
    ["Minute Ventilation", "+50%", "↑", "Alkaline Phosphatase", "↑ (placenta)", "↑"],
    ["Tidal Volume", "+40%", "↑", "Fibrinogen", "+50–250%", "↑↑"],
    ["O2 Consumption", "+20–50%", "↑", "Clotting Factors VII-X,XII", "+30–250%", "↑↑"],
    ["FRC", "-20%", "↓", "Hemoglobin", "-20% (dilutional)", "↓"],
    ["PaCO2", "-15% (27-32 mmHg)", "↓", "Platelets", "-10%", "↓"],
    ["PaO2", "+10% (104-108 mmHg)", "↑", "MAC (anesthetic)", "-40%", "↓"],
    ["HCO3", "-15%", "↓", "Serum Pseudocholinesterase", "-25–30%", "↓"],
  ];

  const colW = [2.5, 1.6, 1.0, 2.5, 1.6, 1.0];
  const colX = [0.15, 2.7, 4.35, 5.45, 8.0, 9.65];
  const rowH = 0.42;
  const startY = 0.85;

  rows.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const isHeader = ri === 0;
      const isMidHeader = ci === 3 && ri === 0;
      const bgColor = isHeader ? C.accent2 :
                      (ri % 2 === 0 ? "112244" : "0D1B2A");
      const txtColor = isHeader ? C.gold :
                       (ci === 2 || ci === 5) ?
                         (cell.includes("↑") ? C.green : cell.includes("↓") ? C.accent1 : C.gold) :
                       (ci === 1 || ci === 4) ? C.gold : C.white;

      s.addShape(pres.ShapeType.rect, {
        x: colX[ci], y: startY + ri * rowH, w: colW[ci], h: rowH,
        fill:{color: bgColor}, line:{color:"1E3A5F", pt:0.5}
      });
      s.addText(cell, {
        x: colX[ci], y: startY + ri * rowH, w: colW[ci], h: rowH,
        fontSize: isHeader ? 9.5 : 9, bold: isHeader || (ci===2||ci===5),
        color: txtColor, fontFace:"Calibri",
        align: (ci===2||ci===5) ? "center" : "left",
        valign:"middle", margin:4
      });
    });
  });

  // divider
  s.addShape(pres.ShapeType.rect, { x:5.35, y:0.85, w:0.08, h:rowH*rows.length, fill:{color:C.accent1}, line:{color:C.accent1} });

  s.addText("↑ = Increase  |  ↓ = Decrease  |  → = Unchanged  |  Values represent maximum changes at/near term", {
    x:0.3, y:7.15, w:12.7, h:0.3, fontSize:9, color:C.teal,
    fontFace:"Calibri", align:"center", margin:0, italic:true
  });
}

// ─── SLIDE 3: Cardiovascular Changes ─────────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"0D1520"}, line:{color:"0D1520"} });
  // sidebar
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.25, h:7.5, fill:{color:C.accent1}, line:{color:C.accent1} });

  s.addText("❤  CARDIOVASCULAR SYSTEM", {
    x:0.4, y:0.1, w:12.5, h:0.6, fontSize:22, bold:true, color:C.accent1,
    fontFace:"Calibri", margin:0
  });
  s.addShape(pres.ShapeType.rect, { x:0.4, y:0.7, w:12.5, h:0.04, fill:{color:C.accent1}, line:{color:C.accent1} });

  const cvData = [
    { title:"BLOOD VOLUME", items:[
      "Total blood volume ↑ 35% (plasma ↑55%, RBC mass ↑45%)",
      "At term: +1000–1500 mL extra blood (total ~90 mL/kg)",
      "Returns to normal 1–2 weeks postpartum",
      "Dilutional anemia: Hb usually >11 g/dL"
    ]},
    { title:"CARDIAC OUTPUT", items:[
      "CO ↑ 40% at term (mainly in 1st/2nd trimester)",
      "Heart rate ↑ 20% + Stroke volume ↑ 30%",
      "Cardiac chambers enlarge; myocardial hypertrophy",
      "CO falls slightly at 36–40 weeks"
    ]},
    { title:"BLOOD PRESSURE & RESISTANCE", items:[
      "Systolic BP ↓ ~5%, Diastolic BP ↓ ~15%",
      "Peripheral vascular resistance ↓ 15–20% (nadir mid-2nd trimester)",
      "Pulmonary resistance ↓ 30%; no rise in pulmonary pressures",
      "Driven by progesterone → smooth muscle relaxation"
    ]},
    { title:"AORTOCAVAL COMPRESSION", items:[
      "After 20 wks: IVC compressed by gravid uterus in supine",
      "~5–10% develop supine hypotension syndrome",
      "Left lateral decubitus position relieves compression",
      "Epidural venous plexus engorged → increased epidural bleed risk"
    ]},
    { title:"ECG & AUSCULTATION", items:[
      "Left axis deviation on ECG; T wave changes",
      "Elevated diaphragm shifts heart leftward",
      "Grade I–II systolic ejection murmur (flow murmur)",
      "Exaggerated S1 splitting; S3 may be audible; pericardial effusion possible"
    ]},
    { title:"UTERINE BLOOD FLOW", items:[
      "Increases from ~50 mL/min → ~500–700 mL/min at term",
      "10% of cardiac output by term",
      "Autoregulation absent → pressure-dependent",
      "Adrenaline reduces; vasodilators increase uterine flow"
    ]},
  ];

  const colsPerRow = 3;
  const boxW = 4.1, boxH = 1.6, xGap = 4.3, yGap = 1.72;
  const startX = 0.4, startY = 0.85;

  cvData.forEach((item, i) => {
    const col = i % colsPerRow;
    const row = Math.floor(i / colsPerRow);
    const x = startX + col * xGap;
    const y = startY + row * yGap;

    s.addShape(pres.ShapeType.roundRect, {
      x, y, w:boxW, h:boxH,
      fill:{color:"112233"}, line:{color:C.accent1, pt:1}, rectRadius:0.08
    });
    s.addShape(pres.ShapeType.rect, { x, y, w:boxW, h:0.32, fill:{color:C.accent1}, line:{color:C.accent1} });
    s.addText(item.title, {
      x, y, w:boxW, h:0.32, fontSize:10, bold:true, color:C.white,
      fontFace:"Calibri", align:"center", valign:"middle", margin:0
    });
    s.addText(item.items.map(t => ({ text:"• "+t, options:{breakLine:true} })), {
      x:x+0.05, y:y+0.34, w:boxW-0.1, h:boxH-0.38,
      fontSize:8.5, color:C.lightGray, fontFace:"Calibri",
      valign:"top", margin:3
    });
  });
}

// ─── SLIDE 4: Respiratory Changes ────────────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"051523"}, line:{color:"051523"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.25, h:7.5, fill:{color:C.teal}, line:{color:C.teal} });

  s.addText("🫁  RESPIRATORY SYSTEM", {
    x:0.4, y:0.1, w:12.5, h:0.6, fontSize:22, bold:true, color:C.teal,
    fontFace:"Calibri", margin:0
  });
  s.addShape(pres.ShapeType.rect, { x:0.4, y:0.7, w:12.5, h:0.04, fill:{color:C.teal}, line:{color:C.teal} });

  // Volume changes table
  const volData = [
    ["VOLUME/PARAMETER", "CHANGE", "MECHANISM"],
    ["Minute Ventilation", "↑ 50%", "↑ Tidal volume (mainly)"],
    ["Tidal Volume (TV)", "↑ 40%", "Progesterone stimulates respiratory centre"],
    ["Respiratory Rate", "↑ 15%", "Minor contributor"],
    ["O2 Consumption", "↑ 20–50%", "Fetal + placental + maternal demands"],
    ["FRC", "↓ 20%", "Diaphragm elevated ~4 cm"],
    ["ERV (Expiratory Reserve Vol)", "↓ ~20%", "↑ TV causes bigger exhalation"],
    ["RV (Residual Volume)", "↓ ~20%", "Diaphragm elevation"],
    ["Airway Resistance", "↓ 35%", "Progesterone → bronchodilation"],
    ["Vital Capacity", "Unchanged", "Compensated by chest expansion"],
    ["PaCO2", "↓ 27–32 mmHg", "Hyperventilation (normal = 40 mmHg)"],
    ["PaO2", "↑ 104–108 mmHg", "Hyperventilation"],
    ["HCO3", "↓ 18–21 mEq/L", "Renal compensation for resp. alkalosis"],
    ["pH", "7.44 (mild alk.)", "Compensated respiratory alkalosis"],
    ["P50 (Hb-O2 curve)", "↑ 27 → 30 mmHg", "↑ 2,3-DPG (right shift — facilitates O2 release)"],
  ];

  const colWR = [4.0, 2.2, 5.5];
  const colXR = [0.4, 4.5, 6.8];
  const rowHR = 0.38;
  const startY = 0.85;

  volData.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const isHeader = ri === 0;
      const bgColor = isHeader ? C.accent2 : (ri%2===0 ? "0A2035" : "051523");
      const changeColor = cell.includes("↑") ? C.green : cell.includes("↓") ? C.accent1 :
                          cell.includes("Unchanged") ? C.gold : C.white;
      const txtColor = isHeader ? C.gold : (ci===1 ? changeColor : C.white);
      s.addShape(pres.ShapeType.rect, {
        x:colXR[ci], y:startY+ri*rowHR, w:colWR[ci], h:rowHR,
        fill:{color:bgColor}, line:{color:"1A3550", pt:0.5}
      });
      s.addText(cell, {
        x:colXR[ci], y:startY+ri*rowHR, w:colWR[ci], h:rowHR,
        fontSize:isHeader?9.5:9, bold:isHeader||ci===1,
        color:txtColor, fontFace:"Calibri",
        align:"left", valign:"middle", margin:4
      });
    });
  });

  // side notes
  const notes = [
    { title:"DANGER: RAPID DESATURATION", body:"↓ FRC + ↑ O2 consumption = rapid SpO2 drop during apnea.\nPre-oxygenate ALWAYS before intubating.", color:C.accent1 },
    { title:"ACID-BASE STATE", body:"Compensated respiratory alkalosis.\nPaCO2 27-32 / HCO3 18-21 / pH 7.44", color:C.teal },
    { title:"AIRWAY CHANGES", body:"Mucosal edema, capillary engorgement.\nSmaller tube (6.0-6.5mm). Mallampati score worsens.", color:C.gold },
  ];

  notes.forEach((note, i) => {
    const x = 0.4 + i*4.27;
    s.addShape(pres.ShapeType.roundRect, {
      x, y:6.45, w:4.0, h:0.95,
      fill:{color:"0A2035"}, line:{color:note.color, pt:1.5}, rectRadius:0.08
    });
    s.addText([
      {text: note.title+"\n", options:{bold:true, color:note.color, fontSize:9}},
      {text: note.body, options:{color:C.lightGray, fontSize:8}}
    ], {x:x+0.07, y:6.45, w:3.86, h:0.95, fontFace:"Calibri", valign:"middle", margin:4});
  });
}

// ─── SLIDE 5: Hematological Changes ──────────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"100820"}, line:{color:"100820"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.25, h:7.5, fill:{color:C.purple}, line:{color:C.purple} });

  s.addText("🩸  HEMATOLOGICAL CHANGES", {
    x:0.4, y:0.1, w:12.5, h:0.6, fontSize:22, bold:true, color:C.purple,
    fontFace:"Calibri", margin:0
  });
  s.addShape(pres.ShapeType.rect, { x:0.4, y:0.7, w:12.5, h:0.04, fill:{color:C.purple}, line:{color:C.purple} });

  const hemaBoxes = [
    { title:"RED CELLS & ANEMIA", color:C.accent1, items:[
      "Plasma vol ↑ 55% > RBC mass ↑ 45% → Physiological dilutional anemia",
      "Hb usually remains >11 g/dL (WHO cutoff: <11 g/dL = anaemia in pregnancy)",
      "Hematocrit ↓ to ~33–34%",
      "MCV, MCH, MCHC: unchanged if no deficiency",
      "Iron & folate supplements needed to prevent true deficiencies",
    ]},
    { title:"COAGULATION (PRO-THROMBOTIC STATE)", color:C.gold, items:[
      "Fibrinogen ↑ 50–250% (most dramatic rise)",
      "Factors VII, VIII, IX, X, XII ↑ 30–250%",
      "Factor XI may slightly decrease",
      "Protein S (anticoagulant) ↓",
      "Acquired resistance to activated Protein C",
      "Fibrinolysis ↑ in 3rd trimester",
      "Net effect: HYPERCOAGULABLE → VTE risk ×5–10",
    ]},
    { title:"WHITE CELLS", color:C.green, items:[
      "Leukocytosis normal in pregnancy",
      "WBC ↑ to 9,000–15,000/μL (up to 21,000 in 3rd trimester)",
      "Mainly neutrophilia",
      "Eosinophils & basophils slightly decrease",
      "Do NOT use WBC alone to diagnose infection in pregnancy",
    ]},
    { title:"PLATELETS", color:C.teal, items:[
      "Platelet count ↓ ~10% (gestational thrombocytopenia)",
      "Platelet size (MPV) increases",
      "Platelet function is enhanced",
      ">80,000 generally safe for regional anesthesia",
      "Pathological if <100,000 (investigate for ITP, pre-eclampsia, HELLP)",
    ]},
  ];

  const boxW = 5.95, boxH = 2.7;
  const positions = [[0.4,0.85],[6.7,0.85],[0.4,3.7],[6.7,3.7]];

  hemaBoxes.forEach((box, i) => {
    const [x,y] = positions[i];
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w:boxW, h:boxH,
      fill:{color:"1A0D2E"}, line:{color:box.color, pt:1.5}, rectRadius:0.1
    });
    s.addShape(pres.ShapeType.rect, { x, y, w:boxW, h:0.35, fill:{color:box.color}, line:{color:box.color} });
    s.addText(box.title, {
      x, y, w:boxW, h:0.35, fontSize:10, bold:true, color:C.white,
      fontFace:"Calibri", align:"center", valign:"middle", margin:0
    });
    s.addText(box.items.map(t=>({text:"• "+t, options:{breakLine:true}})), {
      x:x+0.08, y:y+0.38, w:boxW-0.15, h:boxH-0.42,
      fontSize:8.5, color:C.lightGray, fontFace:"Calibri", valign:"top", margin:3
    });
  });
}

// ─── SLIDE 6: Renal & Endocrine Changes ──────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"051A10"}, line:{color:"051A10"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.25, h:7.5, fill:{color:C.green}, line:{color:C.green} });

  s.addText("🫘  RENAL SYSTEM", {
    x:0.4, y:0.1, w:5.8, h:0.55, fontSize:20, bold:true, color:C.green,
    fontFace:"Calibri", margin:0
  });
  s.addText("⚗  ENDOCRINE SYSTEM", {
    x:7.0, y:0.1, w:6.0, h:0.55, fontSize:20, bold:true, color:C.orange,
    fontFace:"Calibri", margin:0
  });
  s.addShape(pres.ShapeType.rect, { x:0.4, y:0.67, w:5.8, h:0.04, fill:{color:C.green}, line:{color:C.green} });
  s.addShape(pres.ShapeType.rect, { x:7.0, y:0.67, w:6.0, h:0.04, fill:{color:C.orange}, line:{color:C.orange} });

  // Renal table
  const renalData = [
    ["PARAMETER", "CHANGE"],
    ["Renal plasma flow (RPF)", "↑ 50–80% (peaks 2nd trimester)"],
    ["GFR", "↑ 50% (110–150 mL/min)"],
    ["Serum Creatinine", "↓ 0.4–0.5 mg/dL (normal = 0.4)"],
    ["Blood Urea Nitrogen (BUN)", "↓ ~9 mg/dL (from 12–13)"],
    ["Uric acid", "↓ early pregnancy; rises near term"],
    ["Glucosuria", "Common even with normal glucose"],
    ["Proteinuria", "Up to 300 mg/24h acceptable"],
    ["Sodium", "Retained (~900 mEq overall)"],
    ["Aldosterone", "↑ 6× (compensatory natriuresis offset)"],
    ["Urinary tract dilation", "Hydronephrosis (right > left)"],
    ["UTI risk", "↑ due to stasis + glycosuria"],
  ];

  const rColW = [3.0, 2.8];
  const rColX = [0.4, 3.45];
  const rRowH = 0.43;
  const rStartY = 0.78;

  renalData.forEach((row, ri) => {
    row.forEach((cell, ci) => {
      const isH = ri===0;
      const bg = isH ? "0F3D1A" : ri%2===0 ? "0A2A10" : "051A10";
      const isChange = ci===1;
      const chColor = cell.includes("↑") ? C.green : cell.includes("↓") ? C.accent1 : C.white;
      const tColor = isH ? C.gold : (isChange ? chColor : C.white);
      s.addShape(pres.ShapeType.rect, {
        x:rColX[ci], y:rStartY+ri*rRowH, w:rColW[ci], h:rRowH,
        fill:{color:bg}, line:{color:"1A4020", pt:0.5}
      });
      s.addText(cell, {
        x:rColX[ci], y:rStartY+ri*rRowH, w:rColW[ci], h:rRowH,
        fontSize:isH?9:8.5, bold:isH, color:tColor,
        fontFace:"Calibri", align:"left", valign:"middle", margin:4
      });
    });
  });

  // divider
  s.addShape(pres.ShapeType.rect, { x:6.6, y:0.78, w:0.08, h:6.5, fill:{color:"2A2A2A"}, line:{color:"2A2A2A"} });

  // Endocrine boxes
  const endoData = [
    { title:"PITUITARY", color:C.orange, items:[
      "Pituitary size ↑ up to 120% by delivery",
      "Prolactin ↑ 10×  (suppresses LH/FSH)",
      "ACTH ↑ 2–4× (mainly placental)",
      "Pituitary GH → replaced by placental GH variant",
      "GnRH ↑ (placental) but gonadotropins suppressed",
    ]},
    { title:"ADRENAL", color:C.gold, items:[
      "Total cortisol ↑ 3× (CBG triples)",
      "Free cortisol (urinary) ↑ 2–3×",
      "Aldosterone ↑ 6× (offsets progesterone natriuresis)",
      "DHEAS ↓ (used as substrate by placenta)",
      "Renin–angiotensin system ↑",
    ]},
    { title:"THYROID", color:C.teal, items:[
      "Thyroid gland enlarges (goitre in iodine deficiency)",
      "TBG ↑ → total T3/T4 ↑ (but FREE T3/T4 normal)",
      "TSH: ↓ in 1st trimester (HCG cross-reacts with TSH-R)",
      "Iodine requirements increase",
      "Gestational hyperthyroidism: subclinical, self-limited",
    ]},
    { title:"PANCREAS / GLUCOSE", color:C.green, items:[
      "Insulin secretion ↑ (beta cell hyperplasia)",
      "hPL (human placental lactogen) → insulin resistance",
      "Fasting glucose ↓ (glucose to fetus)",
      "Post-prandial glucose ↑ → gestational diabetes risk",
      "Free fatty acids, ketones, triglycerides ↑",
    ]},
  ];

  const eBoxW = 5.9, eBoxH = 2.5;
  const ePos = [[6.85,0.78],[6.85,3.42]];

  // 2×2 layout
  endoData.forEach((box, i) => {
    const col = i%2, row = Math.floor(i/2);
    const x = 6.85 + col*3.05;
    const y = 0.78 + row*3.2;
    const bW = 2.9, bH = 2.9;
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w:bW, h:bH,
      fill:{color:"0A1A05"}, line:{color:box.color, pt:1.2}, rectRadius:0.08
    });
    s.addShape(pres.ShapeType.rect, { x, y, w:bW, h:0.32, fill:{color:box.color}, line:{color:box.color} });
    s.addText(box.title, {
      x, y, w:bW, h:0.32, fontSize:9.5, bold:true, color:C.white,
      fontFace:"Calibri", align:"center", valign:"middle", margin:0
    });
    s.addText(box.items.map(t=>({text:"• "+t, options:{breakLine:true}})), {
      x:x+0.06, y:y+0.35, w:bW-0.12, h:bH-0.4,
      fontSize:8, color:C.lightGray, fontFace:"Calibri", valign:"top", margin:3
    });
  });
}

// ─── SLIDE 7: GI / Hepatic / Metabolic Changes ────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"1A1005"}, line:{color:"1A1005"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.25, h:7.5, fill:{color:C.orange}, line:{color:C.orange} });

  s.addText("🫄  GI / HEPATIC / METABOLIC CHANGES", {
    x:0.4, y:0.1, w:12.5, h:0.6, fontSize:22, bold:true, color:C.orange,
    fontFace:"Calibri", margin:0
  });
  s.addShape(pres.ShapeType.rect, { x:0.4, y:0.7, w:12.5, h:0.04, fill:{color:C.orange}, line:{color:C.orange} });

  const giBoxes = [
    { title:"STOMACH & ESOPHAGUS", color:C.accent1, items:[
      "Lower esophageal sphincter tone ↓ (progesterone)",
      "Gastric motility & tone ↓",
      "GERD very common (60–80% of pregnant women)",
      "Aspiration risk ↑ – nil per os policies critical",
      "Gastric acid & volume: NOT significantly changed",
      "Gastric emptying delayed (more so in labor with opioids)",
    ]},
    { title:"SMALL BOWEL & COLON", color:C.orange, items:[
      "Small bowel transit time ↑",
      "Nutrient absorption largely unchanged",
      "Iron absorption ↑ (increased demand)",
      "Constipation very common – colon Na+/H2O absorption ↑, motility ↓",
      "Mechanical obstruction by uterus contributes",
      "Hemorrhoids – dilated portal venous collaterals",
    ]},
    { title:"GALLBLADDER & BILE", color:C.gold, items:[
      "Gallbladder volume ↑ 2× in 2nd/3rd trimester",
      "Gallbladder emptying markedly slower",
      "Bile composition altered (↑ cholesterol saturation)",
      "Gallstones in ~4% on routine OB ultrasound",
      "Symptomatic cholelithiasis: 1 in 1000 pregnancies",
      "Gallstone risk ↑ with multiparity",
    ]},
    { title:"LIVER", color:C.teal, items:[
      "Hepatic function & blood flow: unchanged",
      "Transaminases: normal or slightly ↑ (3rd trimester)",
      "Alkaline phosphatase ↑ (placental isoenzyme)",
      "Bilirubin: unchanged",
      "Albumin ↓ (dilutional) → ↓ oncotic pressure",
      "Spider nevi & palmar erythema (estrogen-mediated)",
      "Pseudocholinesterase ↓ 25–30% (relevant for suxamethonium)",
    ]},
    { title:"METABOLISM", color:C.green, items:[
      "Resembles 'accelerated starvation'",
      "↓ Fasting glucose, ↓ amino acids",
      "↑ Free fatty acids, ↑ ketones, ↑ triglycerides",
      "Insulin resistance: ↑ HPL + cortisol + glucagon",
      "Pancreatic beta cell hyperplasia → ↑ insulin",
      "Gestational diabetes in susceptible women",
      "Weight gain: ~11–15 kg total recommended",
    ]},
    { title:"WEIGHT & NUTRITIONAL CHANGES", color:C.pink, items:[
      "Weight gain: fetus (~3.5 kg) + placenta (0.6 kg) + amniotic fluid (0.8 kg)",
      "Uterus ↑ (~0.9 kg) + breasts ↑ (~0.4 kg) + maternal fat/water (~3 kg)",
      "Calcium: serum ↓ (dilution) but ionized Ca2+ normal",
      "Iron requirement ↑ (fetus + RBC expansion)",
      "Folate requirement ↑ (neural tube development)",
      "Total caloric need ↑ ~300 kcal/day",
    ]},
  ];

  const cols = 3;
  const bW = 4.0, bH = 2.7;
  const xS = 0.4, yS = 0.82, xG = 4.3, yG = 2.82;

  giBoxes.forEach((box, i) => {
    const col = i % cols, row = Math.floor(i/cols);
    const x = xS + col*xG, y = yS + row*yG;
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w:bW, h:bH,
      fill:{color:"201505"}, line:{color:box.color, pt:1.2}, rectRadius:0.08
    });
    s.addShape(pres.ShapeType.rect, { x, y, w:bW, h:0.32, fill:{color:box.color}, line:{color:box.color} });
    s.addText(box.title, {
      x, y, w:bW, h:0.32, fontSize:9.5, bold:true, color:C.white,
      fontFace:"Calibri", align:"center", valign:"middle", margin:0
    });
    s.addText(box.items.map(t=>({text:"• "+t, options:{breakLine:true}})), {
      x:x+0.06, y:y+0.35, w:bW-0.12, h:bH-0.4,
      fontSize:8, color:C.lightGray, fontFace:"Calibri", valign:"top", margin:3
    });
  });
}

// ─── SLIDE 8: Nervous System / MSK / Skin ────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"0D0D1A"}, line:{color:"0D0D1A"} });
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:0.25, h:7.5, fill:{color:C.pink}, line:{color:C.pink} });

  s.addText("🧠  NEUROLOGICAL  |  🦴  MUSCULOSKELETAL  |  🌿  SKIN", {
    x:0.4, y:0.1, w:12.5, h:0.6, fontSize:19, bold:true, color:C.pink,
    fontFace:"Calibri", margin:0
  });
  s.addShape(pres.ShapeType.rect, { x:0.4, y:0.7, w:12.5, h:0.04, fill:{color:C.pink}, line:{color:C.pink} });

  const neuroData = [
    { title:"CNS / ANESTHESIA IMPLICATIONS", color:C.purple, items:[
      "MAC (minimum alveolar concentration) ↓ 40% by term (progesterone-mediated)",
      "MAC returns to normal by day 3 postpartum",
      "β-endorphin surge during labor → additional sedation",
      "Sensitivity to local anesthetics ↑ (↓ dose needed for epidural/spinal)",
      "Epidural space: engorgement of veins, ↓ volume → cephalad spread ↑",
      "Positive epidural pressure (normally negative) in parturients",
    ]},
    { title:"PERIPHERAL NERVOUS SYSTEM", color:C.teal, items:[
      "Carpal tunnel syndrome common (median nerve compression due to edema)",
      "Meralgia paresthetica: lateral femoral cutaneous nerve compression",
      "Bell's palsy slightly more common in 3rd trimester",
      "Restless leg syndrome common",
    ]},
    { title:"MUSCULOSKELETAL", color:C.gold, items:[
      "Relaxin (placental/endometrial hormone): cervical softening, ligament laxity",
      "Symphysis pubis diastasis (1–2 cm physiological)",
      "Lumbar lordosis increases → low back pain",
      "Ligamentous laxity → ↑ risk of ankle sprains, SI joint pain",
      "Centre of gravity shifts forward",
    ]},
    { title:"SKIN CHANGES", color:C.pink, items:[
      "Linea nigra: pigmentation of midline abdomen",
      "Chloasma (melasma): facial pigmentation ('mask of pregnancy')",
      "Striae gravidarum: stretch marks (irreversible)",
      "Spider nevi & palmar erythema (estrogen)",
      "Hyperhidrosis, hair growth changes (defluvium postpartum)",
      "Nail brittleness; nail growth often ↑ in pregnancy",
    ]},
    { title:"BREASTS", color:C.accent1, items:[
      "Breast size ↑; weight ↑ ~0.4 kg each",
      "Nipple & areola darken (↑ melanocyte-stimulating hormone)",
      "Montgomery tubercles enlarge",
      "Colostrum production from ~16 weeks onwards",
      "Prolactin → breast development; inhibited postpartum by progesterone fall",
    ]},
    { title:"UTERUS & CERVIX", color:C.green, items:[
      "Uterine weight: 60 g → 1000 g at term",
      "Uterine capacity: 10 mL → 5000–10,000 mL at term",
      "Uterine blood flow: 50 → 500–700 mL/min",
      "Cervix: Hegar's sign (softening), Goodell's sign (blue cervix)",
      "Braxton Hicks contractions from ~6 weeks (irregular, painless)",
      "Decidualization of endometrium",
    ]},
  ];

  const cols = 3;
  const bW = 4.0, bH = 2.7;
  const xS = 0.4, yS = 0.82, xG = 4.3, yG = 2.82;

  neuroData.forEach((box, i) => {
    const col = i%cols, row = Math.floor(i/cols);
    const x = xS + col*xG, y = yS + row*yG;
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w:bW, h:bH,
      fill:{color:"0D0D20"}, line:{color:box.color, pt:1.2}, rectRadius:0.08
    });
    s.addShape(pres.ShapeType.rect, { x, y, w:bW, h:0.32, fill:{color:box.color}, line:{color:box.color} });
    s.addText(box.title, {
      x, y, w:bW, h:0.32, fontSize:9.5, bold:true, color:C.white,
      fontFace:"Calibri", align:"center", valign:"middle", margin:0
    });
    s.addText(box.items.map(t=>({text:"• "+t, options:{breakLine:true}})), {
      x:x+0.06, y:y+0.35, w:bW-0.12, h:bH-0.4,
      fontSize:8, color:C.lightGray, fontFace:"Calibri", valign:"top", margin:3
    });
  });
}

// ─── SLIDE 9: Master Summary Chart ───────────────────────────────────────────
{
  let s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:7.5, fill:{color:"080810"}, line:{color:"080810"} });

  // top bar
  s.addShape(pres.ShapeType.rect, { x:0, y:0, w:13.3, h:0.65, fill:{color:C.accent1}, line:{color:C.accent1} });
  s.addText("MASTER SUMMARY: PHYSIOLOGICAL CHANGES IN PREGNANCY", {
    x:0.3, y:0, w:12.7, h:0.65, fontSize:16, bold:true, color:C.white,
    fontFace:"Calibri", align:"center", valign:"middle", charSpacing:1, margin:0
  });

  const summaryData = [
    { sys:"CARDIOVASCULAR", color:C.accent1, pts:[
      "CO ↑40% | HR ↑20% | SV ↑30%",
      "Blood vol ↑35% (plasma ↑55%)",
      "BP ↓ | PVR ↓15% | Dilutional anaemia",
      "Supine → IVC compression → ↓ CO",
    ]},
    { sys:"RESPIRATORY", color:C.teal, pts:[
      "MV ↑50% | TV ↑40% | FRC ↓20%",
      "PaCO2 ↓27-32 | PaO2 ↑104-108",
      "Compensated resp. alkalosis",
      "Rapid desaturation risk ↑↑",
    ]},
    { sys:"HEMATOLOGICAL", color:C.purple, pts:[
      "WBC ↑ to 15,000-21,000",
      "Fibrinogen + Factors ↑↑",
      "Hypercoagulable → VTE risk",
      "Platelets ↓10% | Factor XI ↓",
    ]},
    { sys:"RENAL", color:C.green, pts:[
      "GFR ↑50% | RPF ↑50-80%",
      "Creatinine ↓0.4 | BUN ↓9",
      "Glycosuria (normal glucose)",
      "Hydronephrosis (R>L)",
    ]},
    { sys:"ENDOCRINE", color:C.orange, pts:[
      "Prolactin ↑10× | Cortisol ↑3×",
      "Aldosterone ↑6× | Insulin ↑",
      "Pituitary ↑120% (size)",
      "Thyroid: total ↑, free = normal",
    ]},
    { sys:"GI / HEPATIC", color:C.gold, pts:[
      "LES tone ↓ → GERD ↑↑",
      "Gastric motility ↓ | Transit time ↑",
      "Albumin ↓ | Alk-phos ↑",
      "Gallbladder volume ↑2× → gallstones",
    ]},
    { sys:"NEUROLOGICAL", color:C.pink, pts:[
      "MAC ↓40% (inhaled agents)",
      "Local anaesthetic sensitivity ↑",
      "Epidural pressure positive",
      "β-endorphins ↑ in labor",
    ]},
    { sys:"METABOLIC", color:"FF8C00", pts:[
      "Insulin resistance (hPL)",
      "↑ FFA, ketones, triglycerides",
      "Ca2+ total ↓ | ionized normal",
      "Pseudocholinesterase ↓25-30%",
    ]},
    { sys:"MSK / SKIN / UTERUS", color:C.green, pts:[
      "Relaxin → ligament laxity, pelvic loosening",
      "Uterus: 60g → 1000g | blood flow ×10",
      "Linea nigra, chloasma, striae",
      "Lumbar lordosis ↑ → backache",
    ]},
  ];

  const cols = 3, rows = 3;
  const bW = 4.1, bH = 2.02;
  const xS = 0.15, yS = 0.72, xG = 4.35, yG = 2.22;

  summaryData.forEach((item, i) => {
    const col = i%cols, row = Math.floor(i/cols);
    const x = xS + col*xG, y = yS + row*yG;
    s.addShape(pres.ShapeType.roundRect, {
      x, y, w:bW, h:bH,
      fill:{color:"0F0F1E"}, line:{color:item.color, pt:1.5}, rectRadius:0.1
    });
    // sys label bar
    s.addShape(pres.ShapeType.rect, { x, y, w:bW, h:0.31, fill:{color:item.color}, line:{color:item.color} });
    s.addText(item.sys, {
      x, y, w:bW, h:0.31, fontSize:9.5, bold:true, color:"FFFFFF",
      fontFace:"Calibri", align:"center", valign:"middle", margin:0, charSpacing:1
    });
    s.addText(item.pts.map(t=>({text:"▸ "+t, options:{breakLine:true}})), {
      x:x+0.06, y:y+0.33, w:bW-0.12, h:bH-0.38,
      fontSize:8.5, color:C.lightGray, fontFace:"Calibri", valign:"top", margin:3
    });
  });

  s.addText("Visual Memory Summary  •  Based on Standard Obstetrics References  •  Orris Medical 2026", {
    x:0.3, y:7.2, w:12.7, h:0.25, fontSize:8, color:"555588",
    fontFace:"Calibri", align:"center", margin:0, italic:true
  });
}

// Write file
pres.writeFile({ fileName: "/home/daytona/workspace/pregnancy-physiology/Physiological_Changes_Pregnancy.pptx" })
  .then(() => console.log("DONE: /home/daytona/workspace/pregnancy-physiology/Physiological_Changes_Pregnancy.pptx"))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/pregnancy-physiology && node create_chart.js

The file is ready. Here is the complete reference:

Physiological Changes During Pregnancy

Sourced from Morgan & Mikhail's Clinical Anesthesiology, Creasy & Resnik's Maternal-Fetal Medicine, and Sabiston's Surgery - representing the same standard content covered in DC Dutta's Textbook of Obstetrics.

1. CARDIOVASCULAR SYSTEM

ParameterChangeNotes
Blood volume+35%Plasma +55%, RBC mass +45%
Cardiac output+40% at termHeart rate +20% + Stroke volume +30%
Heart rate+20 bpmProgressive from 1st trimester
Stroke volume+30%Due to increased preload
Systolic BP-5%Nadirs at mid-2nd trimester
Diastolic BP-15%More dramatic fall
Peripheral vascular resistance-15 to -20%Progesterone-mediated smooth muscle relaxation
Pulmonary resistance-30%Prevents pulmonary hypertension
Key clinical points:
  • Plasma volume increase exceeds RBC increase → physiological dilutional anaemia (Hb stays >11 g/dL)
  • At term: total blood volume +1000-1500 mL; total ~90 mL/kg
  • Aortocaval compression after 20 weeks in supine - 5-10% develop supine hypotension syndrome - always place in left lateral decubitus
  • ECG: left axis deviation, T-wave changes, flow murmur (grade I-II systolic)
  • Uterine blood flow: 50 mL/min → 500-700 mL/min at term (~10% of CO)

2. RESPIRATORY SYSTEM

ParameterChangeValue at Term
Minute ventilation+50%~12 L/min
Tidal volume+40%Main driver of ventilation increase
Respiratory rate+15%Minor contributor
O2 consumption+20-50%Fetal + placental + maternal demand
FRC-20%Diaphragm elevated 4 cm
Airway resistance-35%Progesterone bronchodilation
PaCO2-15%27-32 mmHg (vs 40 normal)
PaO2+10%104-108 mmHg
HCO3-15%18-21 mEq/L (renal compensation)
pH~7.44Compensated respiratory alkalosis
P50 (Hb-O2 curve)+3 mmHg27 → 30 mmHg (right shift, +2,3-DPG)
Clinical pearls:
  • Rapid desaturation during apnea: ↓FRC + ↑O2 consumption - pre-oxygenation is mandatory before intubation
  • Mucosal edema + capillary engorgement → use smaller ET tube (6.0-6.5 mm), Mallampati worsens near term
  • ↓PaCO2 increases CO2 gradient from fetus to mother, facilitating fetal CO2 transfer

3. HEMATOLOGICAL CHANGES

Red cells: Dilutional anaemia (WHO definition: Hb <11 g/dL = anaemia in pregnancy). Hematocrit falls to ~33-34%.
Coagulation - Hypercoagulable state:
  • Fibrinogen ↑ 50-250% (most dramatic)
  • Factors VII, VIII, IX, X, XII ↑ 30-250%
  • Factor XI may decrease; Protein S decreases
  • Acquired resistance to activated Protein C
  • Net: VTE risk ×5-10 compared to non-pregnant
White cells: Leukocytosis normal - WBC up to 21,000/μL (mainly neutrophilia). Don't use WBC alone to diagnose infection.
Platelets: ↓ 10% (gestational thrombocytopenia); >80,000 safe for regional anaesthesia.

4. RENAL SYSTEM

ParameterChange
Renal plasma flow↑ 50-80% (peaks 2nd trimester)
GFR↑ 50% (110-150 mL/min)
Serum Creatinine↓ to ~0.4-0.5 mg/dL
Blood Urea Nitrogen↓ to ~9 mg/dL
Uric acid↓ early; rises near term
Aldosterone↑ 6×
ProteinuriaUp to 300 mg/24h = normal
Other renal changes: Glycosuria with normal blood glucose (↑ GFR exceeds tubular reabsorption); physiological hydronephrosis (right > left due to dextrorotation of uterus); ↑ UTI risk due to stasis + glycosuria.

5. ENDOCRINE SYSTEM

GlandKey Change
PituitarySize ↑ 120% at delivery; Prolactin ↑ 10×; ACTH ↑ 2-4×
Adrenal cortexTotal cortisol ↑ 3× (CBG triples); Urinary free cortisol ↑ 2-3×; Aldosterone ↑ 6×
ThyroidTBG ↑ → total T3/T4 ↑; Free T3/T4 and TSH = NORMAL; TSH ↓ slightly in 1st trimester (HCG cross-reactivity)
PancreasInsulin secretion ↑ (beta cell hyperplasia); hPL causes insulin resistance; Gestational diabetes risk

6. GASTROINTESTINAL / HEPATIC

  • Stomach: LES tone ↓ + gastric motility ↓ → GERD in 60-80%; aspiration risk ↑
  • Colon: Constipation (↑ Na+/H2O absorption, ↓ motility, uterine compression); hemorrhoids (dilated portal collaterals)
  • Gallbladder: Volume ↑ 2× in 2nd/3rd trimester; emptying slowed; cholesterol gallstones in ~4%
  • Liver: Function unchanged; albumin ↓ (dilutional); ALP ↑ (placental); spider nevi + palmar erythema (estrogen); pseudocholinesterase ↓ 25-30%

7. NEUROLOGICAL / ANAESTHESIA

  • MAC ↓ 40% for all volatile anaesthetics (progesterone-mediated); normalizes by day 3 postpartum
  • Local anaesthetic sensitivity ↑ - epidural/spinal dose requirements ↓ up to 30%
  • Epidural venous plexus engorged → ↑ cephalad spread, ↑ intravascular injection risk, positive epidural pressure
  • β-endorphin surge in labor contributes to analgesia

8. METABOLIC

  • State resembles accelerated starvation: ↓ fasting glucose, ↑ FFAs, ↑ ketones, ↑ triglycerides
  • hPL (human placental lactogen) = key insulin antagonist → diabetogenic state
  • Serum calcium ↓ (dilution) but ionized Ca²+ = normal
  • Thyroid hormone: total T3/T4 ↑, free fractions normal
  • Weight gain: ~11-15 kg total recommended

9. MUSCULOSKELETAL / SKIN / UTERUS

MSK: Relaxin → ligament laxity, pubic symphysis diastasis (1-2 cm), lumbar lordosis ↑, backache very common
Skin: Linea nigra, chloasma (melasma), striae gravidarum, spider nevi, palmar erythema
Uterus: Weight 60 g → 1000 g; capacity 10 mL → 5-10 L; blood flow ×10

Download the Visual Summary Chart

Physiological Changes Pregnancy

Presentation · PPTX

The PPTX contains 9 slides with a color-coded system-by-system layout:
  1. Title slide with all 9 systems listed
  2. At-a-glance numerical changes table (all key values at a glance)
  3. Cardiovascular (6 detailed boxes)
  4. Respiratory (full table with values + clinical notes)
  5. Hematological (coagulation, RBC, WBC, platelets)
  6. Renal + Endocrine (split slide)
  7. GI / Hepatic / Metabolic (6 boxes)
  8. Neurological / MSK / Skin / Uterus (6 boxes)
  9. Master Summary Chart - all 9 systems on one slide for rapid visual revision
Each slide uses a distinct color per system so you can identify the topic at a glance during rapid review.
This is a shared conversation. Sign in to Orris to start your own chat.