Prepare ppt on following topic
Topic - how to read basic laboratory test related to nutrition .... 1. Cbc 2. Ferritin 3. Albumin and prealbumin 4. Vitamin B12 5. Folate 6. Vitamin D
mkdir -p /home/daytona/workspace/nutrition-labs-ppt && ls /home/daytona/workspace/nutrition-labs-ppt/
Where is ppt ?
~/nutrition-labs-ppt/build.js
const pptxgen = require("pptxgenjs");
const pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.title = "How to Read Basic Nutrition Laboratory Tests";
// ─── COLOR PALETTE ───────────────────────────────────────────
const DARK_BG = "0A2342"; // deep navy – title / section slides
const MID_BG = "0E3460"; // mid navy – accent blocks
const ACCENT = "2EC4B6"; // teal – headers, icons
const ACCENT2 = "F4A261"; // amber – highlights / normal values
const WHITE = "FFFFFF";
const LIGHT_TXT = "D0E8F5";
const CARD_BG = "112D50"; // slightly lighter navy for cards
const RED_FLAG = "E63946"; // low/abnormal
const GREEN_OK = "2DC653"; // normal
// ─── HELPERS ─────────────────────────────────────────────────
function darkSlide(slide) {
slide.background = { color: DARK_BG };
}
function sectionHeader(slide, num, title, subtitle) {
darkSlide(slide);
// left accent bar
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h: 5.625, fill: { color: ACCENT } });
// section number badge
slide.addShape(pres.ShapeType.rect, { x: 0.4, y: 1.5, w: 1.1, h: 1.1, fill: { color: ACCENT }, line: { color: ACCENT } });
slide.addText(String(num), { x: 0.4, y: 1.5, w: 1.1, h: 1.1, fontSize: 36, bold: true, color: DARK_BG, align: "center", valign: "middle" });
slide.addText(title, { x: 1.7, y: 1.55, w: 7.8, h: 0.85, fontSize: 34, bold: true, color: WHITE, fontFace: "Calibri" });
if (subtitle) {
slide.addText(subtitle, { x: 1.7, y: 2.45, w: 7.8, h: 0.6, fontSize: 17, color: ACCENT, fontFace: "Calibri", italic: true });
}
}
function addCard(slide, x, y, w, h, title, lines, titleColor) {
slide.addShape(pres.ShapeType.rect, { x, y, w, h, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1.5 } });
slide.addText(title, { x: x + 0.12, y: y + 0.1, w: w - 0.24, h: 0.38, fontSize: 13, bold: true, color: titleColor || ACCENT, fontFace: "Calibri" });
const items = lines.map((l, i) => ({
text: l,
options: { bullet: { type: "bullet" }, fontSize: 11, color: LIGHT_TXT, fontFace: "Calibri", breakLine: i < lines.length - 1 }
}));
slide.addText(items, { x: x + 0.12, y: y + 0.52, w: w - 0.24, h: h - 0.64, valign: "top" });
}
function labeledValue(slide, x, y, label, value, valueColor) {
slide.addText(label, { x, y, w: 2.5, h: 0.3, fontSize: 11, color: LIGHT_TXT, fontFace: "Calibri" });
slide.addText(value, { x, y: y + 0.28, w: 2.5, h: 0.32, fontSize: 13, bold: true, color: valueColor || ACCENT2, fontFace: "Calibri" });
}
// ════════════════════════════════════════════════════════════
// SLIDE 1 – TITLE
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
// full-width top band
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 1.2, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText("NUTRITION LABORATORY TESTS", { x: 0.4, y: 0.15, w: 9.2, h: 0.9, fontSize: 13, bold: true, color: DARK_BG, charSpacing: 4, fontFace: "Calibri" });
s.addText("How to Read Basic\nLaboratory Tests\nRelated to Nutrition", {
x: 0.6, y: 1.4, w: 8.8, h: 2.5, fontSize: 40, bold: true, color: WHITE, fontFace: "Calibri", align: "left"
});
s.addShape(pres.ShapeType.rect, { x: 0.6, y: 3.95, w: 8.8, h: 0.04, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText("CBC | Ferritin | Albumin & Prealbumin | Vitamin B12 | Folate | Vitamin D", {
x: 0.6, y: 4.05, w: 8.8, h: 0.45, fontSize: 14, color: ACCENT, fontFace: "Calibri", italic: true
});
s.addText("A Clinical Reference for Healthcare Professionals", {
x: 0.6, y: 4.9, w: 8.8, h: 0.4, fontSize: 12, color: LIGHT_TXT, fontFace: "Calibri"
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 2 – WHY NUTRITION LABS MATTER
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.85, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Why Nutrition Laboratory Tests Matter", { x: 0.4, y: 0.1, w: 9.2, h: 0.65, fontSize: 24, bold: true, color: ACCENT, fontFace: "Calibri" });
const points = [
["Detect Deficiencies Early", "Lab values can identify nutritional deficiencies before clinical symptoms appear, allowing timely intervention."],
["Guide Nutritional Therapy", "Results direct decisions about supplementation, dietary changes, and enteral/parenteral nutrition."],
["Monitor Treatment Response", "Serial measurements track whether nutritional support is achieving the desired outcome."],
["Identify Risk Factors", "Poor nutritional status increases surgical risk, impairs wound healing, and raises infection susceptibility."],
];
points.forEach(([title, body], i) => {
const col = i % 2 === 0 ? 0.3 : 5.2;
const row = i < 2 ? 1.05 : 3.1;
s.addShape(pres.ShapeType.rect, { x: col, y: row, w: 4.6, h: 1.75, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1.5 } });
s.addShape(pres.ShapeType.rect, { x: col, y: row, w: 4.6, h: 0.44, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText(title, { x: col + 0.15, y: row + 0.04, w: 4.3, h: 0.36, fontSize: 13, bold: true, color: DARK_BG, fontFace: "Calibri" });
s.addText(body, { x: col + 0.15, y: row + 0.5, w: 4.3, h: 1.15, fontSize: 11.5, color: LIGHT_TXT, fontFace: "Calibri", valign: "top" });
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 3 – OVERVIEW TABLE
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.85, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Overview: Nutrition Labs at a Glance", { x: 0.4, y: 0.1, w: 9.2, h: 0.65, fontSize: 24, bold: true, color: ACCENT, fontFace: "Calibri" });
const rows = [
["Test", "What It Reflects", "Key Normal Range", "Deficiency Flag"],
["CBC (Hb, MCV, RBC)", "Iron, B12, Folate status via RBC morphology", "Hb: M >13 g/dL, F >12 g/dL; MCV 80-100 fL", "Low Hb, microcytic or macrocytic anemia"],
["Ferritin", "Iron stores (most sensitive iron test)", "12–300 ng/mL (M); 12–150 ng/mL (F)", "<12 ng/mL = iron deficiency"],
["Albumin", "Chronic protein-energy status (t½ 20 days)", "3.5–5.0 g/dL", "<3.5 g/dL = malnutrition risk"],
["Prealbumin (Transthyretin)", "Short-term protein status (t½ 2 days)", "18–36 mg/dL", "<18 mg/dL = acute malnutrition"],
["Vitamin B12", "Cobalamin stores (nerve, RBC synthesis)", "200–900 pg/mL", "<200 pg/mL (MMA/tHcy confirm)"],
["Folate (Serum / RBC)", "Folate balance; RBC folate = tissue stores", "Serum: 2–20 ng/mL; RBC: 140–628 ng/mL", "Low RBC folate = tissue depletion"],
["Vitamin D [25(OH)D]", "Bone health, immunity, muscle function", "Preferred: 30–60 ng/mL", "<20 ng/mL = deficiency; 20-30 = insufficiency"],
];
const colW = [2.0, 2.8, 2.5, 2.4];
const colX = [0.15, 2.2, 5.05, 7.6];
rows.forEach((row, ri) => {
const ry = 0.98 + ri * 0.57;
const isHeader = ri === 0;
row.forEach((cell, ci) => {
const fillColor = isHeader ? ACCENT : ri % 2 === 0 ? CARD_BG : "0C2850";
s.addShape(pres.ShapeType.rect, { x: colX[ci], y: ry, w: colW[ci], h: 0.54, fill: { color: fillColor }, line: { color: "1A3D6A", pt: 0.5 } });
s.addText(cell, {
x: colX[ci] + 0.07, y: ry + 0.05, w: colW[ci] - 0.1, h: 0.44,
fontSize: isHeader ? 11 : 10, bold: isHeader, color: isHeader ? DARK_BG : LIGHT_TXT,
fontFace: "Calibri", valign: "middle"
});
});
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 4 – CBC SECTION HEADER
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionHeader(s, 1, "Complete Blood Count (CBC)", "A nutritional window into red blood cell health");
}
// ════════════════════════════════════════════════════════════
// SLIDE 5 – CBC DETAIL
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("CBC – Key Components in Nutritional Assessment", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 21, bold: true, color: ACCENT, fontFace: "Calibri" });
// Hemoglobin card
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.92, w: 4.5, h: 2.2, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1.5 } });
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.92, w: 4.5, h: 0.44, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText("Hemoglobin (Hb)", { x: 0.4, y: 0.96, w: 4.2, h: 0.36, fontSize: 14, bold: true, color: DARK_BG, fontFace: "Calibri" });
s.addText([
{ text: "Normal: ", options: { bold: true, color: ACCENT2 } },
{ text: "Men ≥13 g/dL | Women ≥12 g/dL\n", options: { color: LIGHT_TXT } },
{ text: "Low Hb = Anemia", options: { bold: true, color: RED_FLAG } },
{ text: " — trigger further workup\n", options: { color: LIGHT_TXT } },
{ text: "Nutritional causes: Iron, B12, Folate deficiency\n", options: { color: LIGHT_TXT } },
{ text: "Also check: MCV, MCH, RDW to classify type", options: { color: LIGHT_TXT } }
], { x: 0.4, y: 1.42, w: 4.25, h: 1.6, fontSize: 11.5, fontFace: "Calibri", valign: "top" });
// MCV card
s.addShape(pres.ShapeType.rect, { x: 5.25, y: 0.92, w: 4.5, h: 2.2, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1.5 } });
s.addShape(pres.ShapeType.rect, { x: 5.25, y: 0.92, w: 4.5, h: 0.44, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText("MCV – Mean Corpuscular Volume", { x: 5.4, y: 0.96, w: 4.2, h: 0.36, fontSize: 14, bold: true, color: DARK_BG, fontFace: "Calibri" });
s.addText([
{ text: "Normal: ", options: { bold: true, color: ACCENT2 } },
{ text: "80–100 fL\n", options: { color: LIGHT_TXT } },
{ text: "Microcytic (MCV <80): ", options: { bold: true, color: ACCENT2 } },
{ text: "Iron deficiency anemia\n", options: { color: LIGHT_TXT } },
{ text: "Macrocytic (MCV >100): ", options: { bold: true, color: ACCENT2 } },
{ text: "B12 or Folate deficiency\n", options: { color: LIGHT_TXT } },
{ text: "Normocytic (MCV 80–100): ", options: { bold: true, color: ACCENT2 } },
{ text: "Chronic disease, mixed deficiency", options: { color: LIGHT_TXT } }
], { x: 5.4, y: 1.42, w: 4.25, h: 1.6, fontSize: 11.5, fontFace: "Calibri", valign: "top" });
// Bottom row
const bottom = [
{ title: "RBC Count", lines: ["Men: 4.5–5.5 ×10⁶/µL", "Women: 4.0–5.0 ×10⁶/µL", "Low in nutritional anemias"] },
{ title: "WBC Count", lines: ["Normal: 4,500–11,000/µL", "Low WBC: severe malnutrition", "Hypersegmented neutrophils → B12/Folate deficiency"] },
{ title: "Platelets", lines: ["Normal: 150,000–400,000/µL", "Thrombocytopenia in severe B12 deficiency", "Can also be seen in severe malnutrition"] },
{ title: "RDW (Red Cell Distribution Width)", lines: ["Normal: 11.5–14.5%", "Elevated RDW = mixed or early deficiency", "Useful when MCV is still normal"] },
];
bottom.forEach((card, i) => {
const cx = 0.25 + i * 2.4;
addCard(s, cx, 3.3, 2.28, 2.1, card.title, card.lines);
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 6 – CBC ANEMIA PATTERN
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("CBC – Interpreting Anemia Patterns in Nutrition", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 21, bold: true, color: ACCENT, fontFace: "Calibri" });
const patterns = [
{ type: "MICROCYTIC ANEMIA", mcv: "MCV < 80 fL", color: RED_FLAG, causes: ["Iron deficiency (most common)", "Thalassemia", "Chronic disease (sometimes)"], labs: "↓ Ferritin, ↑ TIBC, ↓ Serum Iron", morphology: "Small, pale RBCs (hypochromic)" },
{ type: "MACROCYTIC ANEMIA", mcv: "MCV > 100 fL", color: ACCENT2, causes: ["Vitamin B12 deficiency", "Folate deficiency", "Liver disease, alcoholism"], labs: "↓ B12 or ↓ Folate; ↑ MMA (B12); ↑ tHcy (both)", morphology: "Large RBCs; hypersegmented neutrophils" },
{ type: "NORMOCYTIC ANEMIA", mcv: "MCV 80–100 fL", color: GREEN_OK, causes: ["Chronic disease / inflammation", "Mixed deficiency (B12 + Iron)", "Early nutritional deficiency"], labs: "Check ferritin, B12, folate, CRP, renal function", morphology: "Normal size but reduced number" },
];
patterns.forEach((p, i) => {
const cx = 0.28 + i * 3.22;
s.addShape(pres.ShapeType.rect, { x: cx, y: 0.92, w: 3.05, h: 4.5, fill: { color: CARD_BG }, line: { color: p.color, pt: 2 } });
s.addShape(pres.ShapeType.rect, { x: cx, y: 0.92, w: 3.05, h: 0.5, fill: { color: p.color }, line: { color: p.color } });
s.addText(p.type, { x: cx + 0.1, y: 0.96, w: 2.85, h: 0.42, fontSize: 12, bold: true, color: WHITE, fontFace: "Calibri", align: "center" });
s.addText(p.mcv, { x: cx + 0.1, y: 1.5, w: 2.85, h: 0.38, fontSize: 13, bold: true, color: p.color, fontFace: "Calibri", align: "center" });
s.addText("Causes:", { x: cx + 0.15, y: 1.95, w: 2.75, h: 0.3, fontSize: 11, bold: true, color: ACCENT, fontFace: "Calibri" });
s.addText(p.causes.map(c => "• " + c).join("\n"), { x: cx + 0.15, y: 2.28, w: 2.75, h: 0.95, fontSize: 10.5, color: LIGHT_TXT, fontFace: "Calibri", valign: "top" });
s.addText("Key Labs:", { x: cx + 0.15, y: 3.28, w: 2.75, h: 0.3, fontSize: 11, bold: true, color: ACCENT, fontFace: "Calibri" });
s.addText(p.labs, { x: cx + 0.15, y: 3.6, w: 2.75, h: 0.7, fontSize: 10, color: ACCENT2, fontFace: "Calibri", valign: "top" });
s.addText("Morphology:", { x: cx + 0.15, y: 4.35, w: 2.75, h: 0.28, fontSize: 10, bold: true, color: ACCENT, fontFace: "Calibri" });
s.addText(p.morphology, { x: cx + 0.15, y: 4.63, w: 2.75, h: 0.55, fontSize: 10, color: LIGHT_TXT, fontFace: "Calibri", valign: "top" });
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 7 – FERRITIN SECTION HEADER
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionHeader(s, 2, "Ferritin", "The most sensitive marker of iron stores");
}
// ════════════════════════════════════════════════════════════
// SLIDE 8 – FERRITIN DETAIL
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Ferritin – Understanding Iron Storage", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 22, bold: true, color: ACCENT, fontFace: "Calibri" });
// What is ferritin
s.addText("What is Ferritin?", { x: 0.35, y: 0.92, w: 9.3, h: 0.35, fontSize: 14, bold: true, color: ACCENT2, fontFace: "Calibri" });
s.addText("Ferritin is an intracellular iron-storage protein. Serum ferritin reflects total body iron stores and is the earliest and most sensitive indicator of iron deficiency when not complicated by concurrent inflammation or disease.", { x: 0.35, y: 1.3, w: 9.3, h: 0.65, fontSize: 12, color: LIGHT_TXT, fontFace: "Calibri" });
// Reference ranges
const ranges = [
{ label: "Normal (Men)", value: "30–300 ng/mL", color: GREEN_OK },
{ label: "Normal (Women)", value: "12–150 ng/mL", color: GREEN_OK },
{ label: "Iron Deficiency", value: "< 12 ng/mL", color: RED_FLAG },
{ label: "Functional Deficiency (dialysis)", value: "< 200 ng/mL", color: ACCENT2 },
{ label: "Iron Deficiency Excluded", value: "> 200 ng/mL", color: GREEN_OK },
];
s.addText("Reference Ranges", { x: 0.35, y: 1.98, w: 4.5, h: 0.35, fontSize: 13, bold: true, color: ACCENT, fontFace: "Calibri" });
ranges.forEach((r, i) => {
const ry = 2.38 + i * 0.5;
s.addShape(pres.ShapeType.rect, { x: 0.35, y: ry, w: 4.4, h: 0.46, fill: { color: i % 2 === 0 ? CARD_BG : "0C2850" }, line: { color: "1A3D6A", pt: 0.5 } });
s.addText(r.label, { x: 0.5, y: ry + 0.06, w: 2.5, h: 0.34, fontSize: 11, color: LIGHT_TXT, fontFace: "Calibri" });
s.addText(r.value, { x: 3.0, y: ry + 0.06, w: 1.6, h: 0.34, fontSize: 11, bold: true, color: r.color, fontFace: "Calibri" });
});
// Interpretation pitfalls
s.addText("⚠ Critical Interpretation Notes", { x: 5.2, y: 1.98, w: 4.5, h: 0.35, fontSize: 13, bold: true, color: ACCENT2, fontFace: "Calibri" });
const notes = [
["Acute-Phase Reactant:", "Ferritin is an acute-phase protein. Inflammation, infection, liver disease, and malignancy can falsely ELEVATE ferritin — masking true iron deficiency."],
["Low Ferritin = Iron Deficiency:", "A low ferritin (< 12 ng/mL) is highly specific for iron deficiency even in the setting of inflammation."],
["Normal Ferritin ≠ Adequate Iron:", "In chronic kidney disease (dialysis), functional iron deficiency can occur with ferritin up to 500 ng/mL."],
["Always Pair With:", "Serum iron, TIBC (transferrin saturation), and CBC for full iron panel interpretation."],
];
notes.forEach(([title, body], i) => {
const ry = 2.38 + i * 0.78;
s.addShape(pres.ShapeType.rect, { x: 5.2, y: ry, w: 4.5, h: 0.74, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1 } });
s.addText([
{ text: title + " ", options: { bold: true, color: ACCENT2 } },
{ text: body, options: { color: LIGHT_TXT } }
], { x: 5.35, y: ry + 0.06, w: 4.2, h: 0.62, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 9 – ALBUMIN & PREALBUMIN SECTION HEADER
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionHeader(s, 3, "Albumin & Prealbumin", "Visceral protein markers of nutritional status");
}
// ════════════════════════════════════════════════════════════
// SLIDE 10 – ALBUMIN & PREALBUMIN DETAIL
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Albumin & Prealbumin – Protein Status Markers", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 22, bold: true, color: ACCENT, fontFace: "Calibri" });
// ALBUMIN
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.88, w: 4.6, h: 4.62, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 2 } });
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.88, w: 4.6, h: 0.48, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText("ALBUMIN", { x: 0.4, y: 0.92, w: 4.3, h: 0.4, fontSize: 16, bold: true, color: DARK_BG, fontFace: "Calibri" });
const albLines = [
["Half-Life:", "20 days → reflects CHRONIC nutritional status"],
["Normal Range:", "3.5 – 5.0 g/dL"],
["Mild Depletion:", "3.0 – 3.4 g/dL"],
["Moderate Depletion:", "2.5 – 2.9 g/dL"],
["Severe Depletion:", "< 2.5 g/dL"],
["Limitations:", "Negative acute-phase reactant (drops in inflammation, surgery, trauma — NOT just malnutrition)"],
["Also affected by:", "Fluid shifts, liver failure, nephrotic syndrome, age"],
["Clinical use:", "Pre-op risk assessment; albumin < 3.5 g/dL = ↑ surgical morbidity & mortality"],
];
albLines.forEach(([lbl, val], i) => {
s.addText([
{ text: lbl + " ", options: { bold: true, color: ACCENT2 } },
{ text: val, options: { color: LIGHT_TXT } }
], { x: 0.4, y: 1.44 + i * 0.48, w: 4.3, h: 0.44, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
});
// PREALBUMIN
s.addShape(pres.ShapeType.rect, { x: 5.15, y: 0.88, w: 4.6, h: 4.62, fill: { color: CARD_BG }, line: { color: ACCENT2, pt: 2 } });
s.addShape(pres.ShapeType.rect, { x: 5.15, y: 0.88, w: 4.6, h: 0.48, fill: { color: ACCENT2 }, line: { color: ACCENT2 } });
s.addText("PREALBUMIN (Transthyretin)", { x: 5.3, y: 0.92, w: 4.3, h: 0.4, fontSize: 15, bold: true, color: DARK_BG, fontFace: "Calibri" });
const prealbLines = [
["Half-Life:", "2 days → reflects ACUTE / recent nutritional status"],
["Normal Range:", "18 – 36 mg/dL"],
["Mild Depletion:", "15 – 17 mg/dL"],
["Moderate Depletion:", "10 – 14 mg/dL"],
["Severe Depletion:", "< 10 mg/dL"],
["Advantage:", "Short half-life → more responsive to nutritional changes; useful for monitoring feeding response"],
["Limitations:", "Also a negative acute-phase reactant (drops in inflammation, stress). Zinc deficiency also lowers levels."],
["Best used for:", "Monitoring short-term response to nutritional support (rising trend = improvement)"],
];
prealbLines.forEach(([lbl, val], i) => {
s.addText([
{ text: lbl + " ", options: { bold: true, color: ACCENT } },
{ text: val, options: { color: LIGHT_TXT } }
], { x: 5.3, y: 1.44 + i * 0.48, w: 4.3, h: 0.44, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 11 – VITAMIN B12 SECTION HEADER
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionHeader(s, 4, "Vitamin B12 (Cobalamin)", "Neurological & hematological implications of deficiency");
}
// ════════════════════════════════════════════════════════════
// SLIDE 12 – VITAMIN B12 DETAIL
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Vitamin B12 – Laboratory Interpretation", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 22, bold: true, color: ACCENT, fontFace: "Calibri" });
// Left column
addCard(s, 0.25, 0.88, 4.6, 2.1, "Serum B12 – Reference Values", [
"Normal: 200 – 900 pg/mL (148–664 pmol/L)",
"Borderline: 150 – 200 pg/mL → order MMA & tHcy to confirm",
"Deficiency: < 150–200 pg/mL (lab-dependent)",
"Supplemental monitoring: check 1–3 months after starting B12"
]);
addCard(s, 0.25, 3.1, 4.6, 2.38, "Confirmatory Tests", [
"Methylmalonic Acid (MMA): elevated in B12 deficiency (>0.4 µmol/L)",
"Total Homocysteine (tHcy): elevated in BOTH B12 and Folate deficiency",
"MMA + tHcy both elevated → B12 deficiency",
"tHcy elevated, MMA normal → Folate deficiency",
"Note: No single test is diagnostic alone — correlate with clinical picture"
]);
// Right column
addCard(s, 5.15, 0.88, 4.6, 1.65, "Causes of B12 Deficiency", [
"Dietary: strict vegans/vegetarians (B12 only in animal products)",
"Malabsorption: pernicious anemia (lack of intrinsic factor), gastrectomy",
"Drugs: metformin, PPI, H2 blockers (long-term)",
"Ileal disease (Crohn's), celiac disease, bariatric surgery"
]);
addCard(s, 5.15, 2.62, 4.6, 1.65, "Clinical Features of Deficiency", [
"Hematologic: macrocytic (megaloblastic) anemia; pancytopenia",
"Neurologic: subacute combined degeneration (spinal cord)",
"Peripheral neuropathy, paresthesias, ataxia",
"Glossitis, angular stomatitis",
"Psychiatric: depression, cognitive impairment"
]);
addCard(s, 5.15, 4.36, 4.6, 1.1, "Important Caveat", [
"Folate supplementation can correct anemia but will NOT correct B12-related neurologic damage — always rule out B12 deficiency before treating folate-only.",
], ACCENT2);
}
// ════════════════════════════════════════════════════════════
// SLIDE 13 – FOLATE SECTION HEADER
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionHeader(s, 5, "Folate", "Serum vs. Red Cell Folate in nutritional assessment");
}
// ════════════════════════════════════════════════════════════
// SLIDE 14 – FOLATE DETAIL
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Folate – Laboratory Interpretation", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 22, bold: true, color: ACCENT, fontFace: "Calibri" });
// Two test types
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.9, w: 4.6, h: 3.0, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 2 } });
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 0.9, w: 4.6, h: 0.46, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText("SERUM FOLATE", { x: 0.4, y: 0.94, w: 4.3, h: 0.38, fontSize: 15, bold: true, color: DARK_BG });
s.addText([
{ text: "Range: ", options: { bold: true, color: ACCENT2 } },
{ text: "2 – 20 ng/mL (4.5–45 nmol/L)\n", options: { color: LIGHT_TXT } },
{ text: "Reflects: ", options: { bold: true, color: ACCENT2 } },
{ text: "Recent dietary intake (days)\n", options: { color: LIGHT_TXT } },
{ text: "Limitation: ", options: { bold: true, color: RED_FLAG } },
{ text: "Highly labile — can be normal even in tissue depletion if patient ate folate-rich meal recently\n", options: { color: LIGHT_TXT } },
{ text: "Low serum folate: ", options: { bold: true, color: ACCENT2 } },
{ text: "Indicates negative folate balance but does NOT confirm tissue deficiency alone", options: { color: LIGHT_TXT } },
], { x: 0.4, y: 1.42, w: 4.3, h: 2.35, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
s.addShape(pres.ShapeType.rect, { x: 5.15, y: 0.9, w: 4.6, h: 3.0, fill: { color: CARD_BG }, line: { color: ACCENT2, pt: 2 } });
s.addShape(pres.ShapeType.rect, { x: 5.15, y: 0.9, w: 4.6, h: 0.46, fill: { color: ACCENT2 }, line: { color: ACCENT2 } });
s.addText("RED CELL FOLATE (Preferred)", { x: 5.3, y: 0.94, w: 4.3, h: 0.38, fontSize: 14, bold: true, color: DARK_BG });
s.addText([
{ text: "Range: ", options: { bold: true, color: ACCENT } },
{ text: "140 – 628 ng/mL (317–1422 nmol/L)\n", options: { color: LIGHT_TXT } },
{ text: "Reflects: ", options: { bold: true, color: ACCENT } },
{ text: "Tissue folate stores over 3 months (RBC lifespan)\n", options: { color: LIGHT_TXT } },
{ text: "Preferred test: ", options: { bold: true, color: GREEN_OK } },
{ text: "Less affected by recent diet — more reliable indicator of true tissue folate depletion\n", options: { color: LIGHT_TXT } },
{ text: "Low RBC folate (<140 ng/mL): ", options: { bold: true, color: ACCENT } },
{ text: "Confirms tissue folate deficiency", options: { color: LIGHT_TXT } },
], { x: 5.3, y: 1.42, w: 4.3, h: 2.35, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
// Bottom row
addCard(s, 0.25, 4.05, 2.9, 1.4, "Causes of Folate Deficiency", [
"Poor diet (no leafy greens, fruit)", "Alcoholism (most common cause)",
"Malabsorption (celiac, inflammatory bowel disease)",
"Increased requirements: pregnancy, hemolysis",
"Drugs: methotrexate, phenytoin, trimethoprim"
]);
addCard(s, 3.3, 4.05, 2.9, 1.4, "Clinical Features", [
"Macrocytic megaloblastic anemia", "Glossitis, cheilitis",
"No neurologic deficits (unlike B12!)",
"Neural tube defects in pregnancy if deficient",
"tHcy elevated; MMA normal (distinguishes from B12)"
]);
addCard(s, 6.85, 4.05, 2.9, 1.4, "Lab Panel Strategy", [
"Order BOTH serum and RBC folate when possible",
"tHcy: elevated in folate deficiency",
"MMA: normal (vs. elevated in B12 def.)",
"Always check B12 simultaneously — overlap of symptoms"
]);
}
// ════════════════════════════════════════════════════════════
// SLIDE 15 – VITAMIN D SECTION HEADER
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
sectionHeader(s, 6, "Vitamin D [25(OH)D]", "Bone health, immunity, and metabolic function");
}
// ════════════════════════════════════════════════════════════
// SLIDE 16 – VITAMIN D DETAIL
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Vitamin D – Laboratory Interpretation", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 22, bold: true, color: ACCENT, fontFace: "Calibri" });
// Status spectrum bar
const levels = [
{ label: "Severe\nDeficiency", range: "< 10 ng/mL", color: RED_FLAG },
{ label: "Deficiency", range: "< 20 ng/mL", color: "E07020" },
{ label: "Insufficiency", range: "20–30 ng/mL", color: ACCENT2 },
{ label: "Sufficiency\n(Preferred)", range: "30–60 ng/mL", color: GREEN_OK },
{ label: "Upper\nNormal", range: "60–100 ng/mL", color: ACCENT },
{ label: "Toxicity\nRisk", range: "> 150 ng/mL", color: RED_FLAG },
];
levels.forEach((l, i) => {
const cx = 0.25 + i * 1.6;
s.addShape(pres.ShapeType.rect, { x: cx, y: 0.92, w: 1.5, h: 1.35, fill: { color: l.color }, line: { color: DARK_BG, pt: 1 } });
s.addText(l.label, { x: cx + 0.05, y: 0.96, w: 1.4, h: 0.62, fontSize: 10, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
s.addText(l.range, { x: cx + 0.05, y: 1.6, w: 1.4, h: 0.56, fontSize: 11, bold: true, color: WHITE, fontFace: "Calibri", align: "center", valign: "middle" });
});
s.addText("25(OH)D Level Status Spectrum", { x: 0.25, y: 2.3, w: 9.5, h: 0.3, fontSize: 10, color: LIGHT_TXT, fontFace: "Calibri", italic: true, align: "center" });
// Metabolism note
s.addShape(pres.ShapeType.rect, { x: 0.25, y: 2.65, w: 4.6, h: 2.8, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1.5 } });
s.addText("Which Test to Order?", { x: 0.4, y: 2.72, w: 4.3, h: 0.36, fontSize: 13, bold: true, color: ACCENT, fontFace: "Calibri" });
s.addText([
{ text: "Order: 25(OH)D (25-hydroxyvitamin D)\n", options: { bold: true, color: GREEN_OK } },
{ text: "→ The major circulating form; half-life ~3 weeks\n→ Best reflects dietary intake + sun exposure\n\n", options: { color: LIGHT_TXT } },
{ text: "Do NOT order: 1,25(OH)₂D (calcitriol)\n", options: { bold: true, color: RED_FLAG } },
{ text: "→ Active form but half-life only 4 hours\n→ Paradoxically rises in deficiency (PTH stimulus)\n→ Not recommended for clinical monitoring\n\n", options: { color: LIGHT_TXT } },
{ text: "Monitor: ", options: { bold: true, color: ACCENT2 } },
{ text: "Re-check 25(OH)D after 3 months of supplementation", options: { color: LIGHT_TXT } },
], { x: 0.4, y: 3.12, w: 4.3, h: 2.25, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
s.addShape(pres.ShapeType.rect, { x: 5.15, y: 2.65, w: 4.6, h: 2.8, fill: { color: CARD_BG }, line: { color: ACCENT2, pt: 1.5 } });
s.addText("Causes & Consequences", { x: 5.3, y: 2.72, w: 4.3, h: 0.36, fontSize: 13, bold: true, color: ACCENT2, fontFace: "Calibri" });
s.addText([
{ text: "Causes of Deficiency:\n", options: { bold: true, color: ACCENT } },
{ text: "• Insufficient sun exposure\n• Poor dietary intake\n• Fat malabsorption (celiac, IBD, bariatric surgery)\n• Chronic kidney disease (reduced activation)\n• Dark skin pigmentation; obesity\n• Medications: anticonvulsants, steroids\n\n", options: { color: LIGHT_TXT } },
{ text: "Consequences:\n", options: { bold: true, color: ACCENT } },
{ text: "• Rickets (children); Osteomalacia (adults)\n• Osteoporosis, increased fracture risk\n• Muscle weakness and falls in elderly\n• Elevated PTH (secondary hyperparathyroidism)\n• ↑ Alkaline phosphatase (in rickets)", options: { color: LIGHT_TXT } },
], { x: 5.3, y: 3.12, w: 4.3, h: 2.25, fontSize: 10.5, fontFace: "Calibri", valign: "top" });
}
// ════════════════════════════════════════════════════════════
// SLIDE 17 – CLINICAL INTEGRATION
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Putting It All Together – Clinical Interpretation Guide", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 21, bold: true, color: ACCENT, fontFace: "Calibri" });
const scenarios = [
{ sx: 0.25, sy: 0.92, scenario: "Macrocytic Anemia (MCV > 100)", findings: "Low B12 + elevated MMA → B12 deficiency\nLow RBC folate + normal MMA → Folate deficiency\nBoth low → Combined deficiency (treat B12 first!)" },
{ sx: 5.15, sy: 0.92, scenario: "Microcytic Anemia (MCV < 80)", findings: "Low ferritin → Iron deficiency (most likely)\nIf ferritin normal/high → check serum iron & TIBC\nHigh TIBC + low Fe sat → Iron deficiency despite normal ferritin (inflammation)" },
{ sx: 0.25, sy: 2.78, scenario: "Suspected Malnutrition / Post-Op", findings: "Albumin < 3.5 g/dL → Chronic protein-energy malnutrition\nPrealbumin < 18 mg/dL + falling → Active catabolism or inadequate nutrition\nRising prealbumin on TPN/EN → Nutritional support working" },
{ sx: 5.15, sy: 2.78, scenario: "Bone Pain / Muscle Weakness / Elderly", findings: "25(OH)D < 20 ng/mL → Vitamin D deficiency → supplement\n↑ Alkaline phosphatase + low 25(OH)D → Osteomalacia\nCheck calcium, phosphate, and PTH as companion tests" },
{ sx: 0.25, sy: 4.62, scenario: "Fatigue / Vegan / Bariatric Surgery Patient", findings: "Check: CBC, B12, folate, ferritin, vitamin D, albumin as full panel\nB12 deficiency common after gastrectomy, ileal resection, long-term PPI/metformin\nEnsure B12 parenteral if absorption impaired" },
{ sx: 5.15, sy: 4.62, scenario: "Monitoring Nutritional Support (ICU/TPN)", findings: "Prealbumin: check 2–3× per week (short half-life)\nAlbumin: trending weekly (lags behind)\nNote: Albumin & prealbumin DROP in inflammation regardless of adequate feeding — do not misinterpret" },
];
scenarios.forEach(({ sx, sy, scenario, findings }) => {
s.addShape(pres.ShapeType.rect, { x: sx, y: sy, w: 4.6, h: 1.72, fill: { color: CARD_BG }, line: { color: ACCENT, pt: 1 } });
s.addText("SCENARIO: " + scenario, { x: sx + 0.12, y: sy + 0.08, w: 4.36, h: 0.32, fontSize: 10.5, bold: true, color: ACCENT2, fontFace: "Calibri" });
s.addText(findings, { x: sx + 0.12, y: sy + 0.44, w: 4.36, h: 1.2, fontSize: 10, color: LIGHT_TXT, fontFace: "Calibri", valign: "top" });
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 18 – QUICK REFERENCE SUMMARY TABLE
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.78, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Quick Reference Summary", { x: 0.4, y: 0.1, w: 9.2, h: 0.6, fontSize: 24, bold: true, color: ACCENT, fontFace: "Calibri" });
const tableData = [
["Test", "Reflects", "Normal Value", "Deficiency Cut-off", "Confounders"],
["Hemoglobin", "O₂-carrying capacity; anemia", "M >13 | F >12 g/dL", "Below reference range", "Dehydration (falsely normal)"],
["MCV", "RBC size (anemia type)", "80 – 100 fL", "<80 micro; >100 macro", "Mixed deficiency = normal MCV"],
["Ferritin", "Iron stores", "12–300 ng/mL", "< 12 ng/mL", "Elevated in inflammation"],
["Albumin", "Chronic protein status", "3.5 – 5.0 g/dL", "< 3.5 g/dL", "Inflammation, fluid shifts"],
["Prealbumin", "Acute protein status", "18 – 36 mg/dL", "< 18 mg/dL", "Inflammation, zinc deficiency"],
["Vitamin B12", "Cobalamin stores", "200 – 900 pg/mL", "< 200 pg/mL", "Confirm with MMA / tHcy"],
["Serum Folate", "Recent folate intake", "2 – 20 ng/mL", "< 2 ng/mL", "Diet-dependent; unreliable"],
["RBC Folate", "Tissue folate stores", "140 – 628 ng/mL", "< 140 ng/mL", "Falsely low in B12 deficiency"],
["25(OH)D", "Vitamin D status", "30 – 60 ng/mL (preferred)", "< 20 ng/mL", "Obesity (sequestration in fat)"],
];
const colWidths = [1.55, 1.9, 1.95, 1.85, 2.5];
const colXs = [0.12, 1.72, 3.67, 5.67, 7.57];
tableData.forEach((row, ri) => {
const ry = 0.88 + ri * 0.47;
const isHeader = ri === 0;
row.forEach((cell, ci) => {
const fillColor = isHeader ? ACCENT : ri % 2 === 0 ? CARD_BG : "0C2850";
s.addShape(pres.ShapeType.rect, { x: colXs[ci], y: ry, w: colWidths[ci], h: 0.44, fill: { color: fillColor }, line: { color: "1A3D6A", pt: 0.5 } });
s.addText(cell, {
x: colXs[ci] + 0.06, y: ry + 0.04, w: colWidths[ci] - 0.1, h: 0.36,
fontSize: isHeader ? 11 : 10, bold: isHeader, color: isHeader ? DARK_BG : LIGHT_TXT,
fontFace: "Calibri", valign: "middle"
});
});
});
}
// ════════════════════════════════════════════════════════════
// SLIDE 19 – CLOSING
// ════════════════════════════════════════════════════════════
{
const s = pres.addSlide();
darkSlide(s);
s.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.22, h: 5.625, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addShape(pres.ShapeType.rect, { x: 0.22, y: 0, w: 9.78, h: 1.3, fill: { color: MID_BG }, line: { color: MID_BG } });
s.addText("Key Takeaways", { x: 0.5, y: 0.2, w: 9.2, h: 0.9, fontSize: 32, bold: true, color: ACCENT, fontFace: "Calibri" });
const takeaways = [
"CBC + MCV together classify the TYPE of nutritional anemia — always interpret them as a pair.",
"Ferritin is the FIRST test to fall in iron deficiency — but beware: it rises in inflammation, masking deficiency.",
"Albumin reflects CHRONIC status (weeks); Prealbumin reflects ACUTE status (days) — use both for complete picture.",
"Never treat folate deficiency without ruling out B12 deficiency first — folate corrects anemia but not B12 neurologic damage.",
"Always order 25(OH)D for vitamin D status — NOT 1,25(OH)₂D, which can be misleadingly normal or elevated in deficiency.",
"Pair lab values with clinical context: inflammation, medications, organ dysfunction all alter lab results independently of nutrition.",
];
takeaways.forEach((t, i) => {
s.addShape(pres.ShapeType.rect, { x: 0.5, y: 1.45 + i * 0.68, w: 0.3, h: 0.38, fill: { color: ACCENT }, line: { color: ACCENT } });
s.addText(String(i + 1), { x: 0.5, y: 1.45 + i * 0.68, w: 0.3, h: 0.38, fontSize: 12, bold: true, color: DARK_BG, align: "center", valign: "middle", fontFace: "Calibri" });
s.addText(t, { x: 0.92, y: 1.45 + i * 0.68, w: 8.8, h: 0.38, fontSize: 11.5, color: LIGHT_TXT, fontFace: "Calibri", valign: "middle" });
});
}
// ─── WRITE FILE ───────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/nutrition-labs-ppt/Nutrition_Lab_Tests.pptx" })
.then(() => console.log("DONE: /home/daytona/workspace/nutrition-labs-ppt/Nutrition_Lab_Tests.pptx"))
.catch(err => { console.error("ERROR:", err); process.exit(1); });
cd /home/daytona/workspace/nutrition-labs-ppt && node build.js
ls -lh /home/daytona/workspace/nutrition-labs-ppt/Nutrition_Lab_Tests.pptx
Nutrition Lab Tests
Presentation · PPTX
| Slide | Content |
|---|---|
| 1 | Title slide |
| 2 | Why nutrition labs matter |
| 3 | Overview table - all 6 tests at a glance |
| 4-6 | CBC - components, anemia patterns (micro/macro/normo), normal ranges |
| 7-8 | Ferritin - reference ranges, acute-phase pitfalls, interpretation |
| 9-10 | Albumin & Prealbumin - half-lives, depletion grades, limitations |
| 11-12 | Vitamin B12 - serum values, confirmatory tests (MMA/tHcy), causes |
| 13-14 | Folate - serum vs. RBC folate, clinical distinction, causes |
| 15-16 | Vitamin D - 25(OH)D spectrum, which test to order, consequences |
| 17 | Clinical integration scenarios (6 case-based examples) |
| 18 | Quick reference summary table - all tests on one slide |
| 19 | Key takeaways |
Fuck offfff