So I prepared a topic a fo 11 system of the human body with a diagram in a normally dor medical coding interview and its anatomy and physiology .

Asking for Preferences
Asking for Preferences
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/body-systems-flashcards && ls /home/daytona/wor…

Writing File

~/body-systems-flashcards/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3" x 7.5"
pres.title = "11 Systems of the Human Body - Medical Coding Interview Flashcards";
pres.author = "Medical Coding Interview Prep";

// ── Color palette ──────────────────────────────────────────────────────────────
const C = {
  darkNavy:   "0D1B2A",
  medBlue:    "1B4F72",
  accentTeal: "148F77",
  accentGold: "F0A500",
  lightBg:    "EAF2F8",
  white:      "FFFFFF",
  bodyText:   "1C2833",
  subText:    "5D6D7E",
  codingTag:  "1A5276",
  bullet1:    "2471A3",
};

// ── System data ─────────────────────────────────────────────────────────────────
const systems = [
  {
    name: "1. Integumentary System",
    emoji: "🧱",
    color: C.medBlue,
    accent: "D4AC0D",
    organs: "Skin (epidermis, dermis, hypodermis), hair, nails, sweat & sebaceous glands",
    functions: [
      "Protection against pathogens, UV, and physical trauma",
      "Thermoregulation via sweat glands and blood vessel dilation",
      "Sensation (touch, pain, temperature) via nerve endings",
      "Vitamin D synthesis from UV light",
      "Waterproofing via keratin in skin cells",
    ],
    coding: [
      "ICD-10: L-codes (skin/subcut disorders), S-codes (injuries)",
      "Key terms: dermatitis, cellulitis, pressure ulcer, melanoma, wound debridement",
      "CPT: wound repair (12001-13160), skin biopsy (11100-11101), destruction of lesions",
      "Body regions & wound depth (superficial / partial / full thickness) affect code selection",
    ],
  },
  {
    name: "2. Skeletal System",
    emoji: "🦴",
    color: "17202A",
    accent: "AEB6BF",
    organs: "206 bones, cartilage, tendons, ligaments, joints (synovial, fibrous, cartilaginous)",
    functions: [
      "Support and shape the body framework",
      "Protection of vital organs (skull, rib cage, vertebral column)",
      "Movement via levers for muscle attachment",
      "Hematopoiesis (blood cell production) in red bone marrow",
      "Mineral storage: calcium, phosphorus",
    ],
    coding: [
      "ICD-10: M-codes (musculoskeletal), S-codes (fractures/injuries)",
      "Key terms: fracture (open/closed/displaced), osteoporosis, arthritis, dislocation",
      "CPT: fracture care (open vs. closed reduction), joint arthroplasty, bone biopsy",
      "Laterality (left/right) and fracture type are critical for accurate coding",
    ],
  },
  {
    name: "3. Muscular System",
    emoji: "💪",
    color: "922B21",
    accent: "F1948A",
    organs: "700+ skeletal muscles, cardiac muscle (heart), smooth muscle (organs/vessels)",
    functions: [
      "Voluntary movement (skeletal) and involuntary movement (smooth/cardiac)",
      "Posture and joint stabilization",
      "Heat production (muscle contraction = ~85% body heat)",
      "Sphincter control (bladder, digestive tract openings)",
      "Facial expressions, breathing (diaphragm, intercostals)",
    ],
    coding: [
      "ICD-10: M60-M79 (soft tissue/muscle disorders), G71-G72 (myopathies)",
      "Key terms: muscle strain, myositis, fibromyalgia, tendinitis, spasm, atrophy",
      "CPT: muscle repair, tendon repair, trigger point injections (20552-20553)",
      "Distinguish strain (muscle/tendon) from sprain (ligament) for correct ICD-10",
    ],
  },
  {
    name: "4. Nervous System",
    emoji: "🧠",
    color: "1A5276",
    accent: "7FB3D3",
    organs: "Brain, spinal cord (CNS); cranial/spinal nerves, ganglia, sensory receptors (PNS)",
    functions: [
      "Sensory input: receives signals from internal/external environment",
      "Integration: processes and interprets information (brain & spinal cord)",
      "Motor output: sends commands to muscles and glands",
      "Controls autonomic functions (ANS): heart rate, digestion, breathing",
      "Higher functions: memory, cognition, emotion",
    ],
    coding: [
      "ICD-10: G-codes (nervous system), S00-S09 (head injuries), F-codes (mental/behavioral)",
      "Key terms: CVA/stroke, seizure, neuropathy, Parkinson's, MS, concussion, dementia",
      "CPT: EEG (95812-95827), nerve conduction (95907+), spinal procedures (62xxx, 63xxx)",
      "Distinguish G43 (migraine) vs G44 (other headache); code acute vs. chronic correctly",
    ],
  },
  {
    name: "5. Endocrine System",
    emoji: "⚗️",
    color: "6C3483",
    accent: "C39BD3",
    organs: "Hypothalamus, pituitary (master gland), thyroid, parathyroid, adrenals, pancreas (islets), gonads, pineal",
    functions: [
      "Hormone production and secretion (chemical messengers via bloodstream)",
      "Regulation of metabolism, growth, and development",
      "Blood glucose control (insulin/glucagon from pancreas)",
      "Stress response: cortisol and epinephrine from adrenal glands",
      "Reproductive function and circadian rhythm (melatonin)",
    ],
    coding: [
      "ICD-10: E-codes (endocrine/metabolic), E10-E11 (diabetes Type 1/Type 2)",
      "Key terms: hypothyroidism, hyperthyroidism, Cushing's, Addison's, DM complications",
      "CPT: thyroid biopsy, adrenal procedures, glucose tolerance testing (82951)",
      "Diabetes coding: always code type, complications, and manifestations separately",
    ],
  },
  {
    name: "6. Cardiovascular System",
    emoji: "❤️",
    color: "922B21",
    accent: "F1948A",
    organs: "Heart (4 chambers), arteries, veins, capillaries (~100,000 km of vessels)",
    functions: [
      "Pumps oxygenated blood to all body tissues (systemic circulation)",
      "Returns deoxygenated blood to lungs (pulmonary circulation)",
      "Transports nutrients, hormones, and waste products",
      "Thermoregulation via blood flow distribution",
      "Immune defense (WBC transport) and hemostasis",
    ],
    coding: [
      "ICD-10: I-codes (circulatory), I10 (hypertension), I21-I22 (AMI), I50 (heart failure)",
      "Key terms: CAD, angina, MI, CHF, arrhythmia, DVT, PE, atherosclerosis",
      "CPT: cardiac catheterization (93454+), CABG (33510+), stent placement (92928+)",
      "Hypertension coding: essential (I10) vs. secondary; always link HTN to heart/renal disease",
    ],
  },
  {
    name: "7. Lymphatic & Immune System",
    emoji: "🛡️",
    color: "1E8449",
    accent: "82E0AA",
    organs: "Lymph nodes, lymph vessels, spleen, thymus, tonsils, bone marrow, MALT (gut-associated lymphoid tissue)",
    functions: [
      "Returns excess interstitial fluid to bloodstream via lymph capillaries",
      "Filters pathogens and foreign particles in lymph nodes",
      "Immune surveillance: B cells (antibodies), T cells (cell-mediated immunity)",
      "Lipid absorption from digestive tract (lacteals)",
      "Removes cellular debris and maintains fluid balance",
    ],
    coding: [
      "ICD-10: C81-C96 (lymphoma/leukemia), D80-D89 (immune disorders), R59 (lymphadenopathy)",
      "Key terms: lymphedema, HIV/AIDS, lupus, rheumatoid arthritis, anaphylaxis, lymphoma",
      "CPT: lymph node biopsy (38500), lymphadenectomy (38700+), immunotherapy admin",
      "HIV (B20) requires coding the specific manifestations/opportunistic infections",
    ],
  },
  {
    name: "8. Respiratory System",
    emoji: "🫁",
    color: "117A65",
    accent: "76D7C4",
    organs: "Nose, pharynx, larynx, trachea, bronchi, bronchioles, alveoli, lungs, diaphragm, pleura",
    functions: [
      "Gas exchange: O₂ intake and CO₂ elimination at alveoli",
      "Ventilation: mechanical movement of air (inspiration/expiration)",
      "Acid-base balance via CO₂ regulation (respiratory buffer)",
      "Phonation (voice production via larynx and vocal cords)",
      "Filtering, warming, and humidifying inspired air",
    ],
    coding: [
      "ICD-10: J-codes (respiratory), J18 (pneumonia), J44 (COPD), J45 (asthma), J96 (resp failure)",
      "Key terms: COPD, asthma, pneumonia, pleural effusion, pulmonary embolism, COVID-19 (U07.1)",
      "CPT: bronchoscopy (31622-31651), spirometry (94010), intubation (31500), thoracentesis",
      "COPD: code underlying type (emphysema J43, chronic bronchitis J42) + exacerbation if present",
    ],
  },
  {
    name: "9. Digestive System",
    emoji: "🍽️",
    color: "784212",
    accent: "F0B27A",
    organs: "Mouth, esophagus, stomach, small intestine (duodenum/jejunum/ileum), large intestine, rectum, anus; + liver, gallbladder, pancreas",
    functions: [
      "Ingestion and mechanical digestion (chewing, peristalsis)",
      "Chemical digestion via enzymes (amylase, pepsin, lipase)",
      "Nutrient absorption mainly in small intestine",
      "Water absorption and waste formation in large intestine",
      "Liver: bile production, detoxification, glucose storage (glycogen)",
    ],
    coding: [
      "ICD-10: K-codes (digestive), K21 (GERD), K25-K28 (ulcers), K50-K51 (IBD), K70 (liver disease)",
      "Key terms: Crohn's, ulcerative colitis, cirrhosis, cholecystitis, appendicitis, hernia",
      "CPT: colonoscopy (45378+), cholecystectomy (47562 lap), EGD (43239), hernia repair (49505+)",
      "Colonoscopy: code differs significantly based on whether polyp removal or biopsy was done",
    ],
  },
  {
    name: "10. Urinary System",
    emoji: "💧",
    color: "1A5276",
    accent: "AED6F1",
    organs: "2 Kidneys, 2 ureters, urinary bladder, urethra; functional unit = nephron (~1 million per kidney)",
    functions: [
      "Filtration of blood and elimination of metabolic waste (urea, creatinine)",
      "Fluid and electrolyte balance (Na⁺, K⁺, Cl⁻)",
      "Acid-base regulation (bicarbonate reabsorption/secretion)",
      "Blood pressure control via renin-angiotensin-aldosterone system (RAAS)",
      "Erythropoietin (EPO) production to stimulate RBC synthesis",
    ],
    coding: [
      "ICD-10: N-codes (genitourinary), N17-N19 (AKI/CKD), N20 (kidney stones), N39 (UTI)",
      "Key terms: AKI, CKD (stage 1-5/ESRD), nephrotic syndrome, pyelonephritis, hematuria",
      "CPT: cystoscopy (52000+), urinalysis (81000-81003), dialysis (90935+), lithotripsy (50590)",
      "CKD staging (N18.1-N18.6) must match GFR; ESRD is N18.6; always code underlying cause",
    ],
  },
  {
    name: "11. Reproductive System",
    emoji: "🔬",
    color: "7D3C98",
    accent: "D7BDE2",
    organs: "Male: testes, epididymis, vas deferens, seminal vesicles, prostate, penis | Female: ovaries, fallopian tubes, uterus, cervix, vagina, mammary glands",
    functions: [
      "Production of gametes: sperm (male) and ova/eggs (female)",
      "Hormone production: testosterone (male), estrogen & progesterone (female)",
      "Fertilization, implantation, and fetal development (female)",
      "Childbirth and lactation (female)",
      "Sexual response and secondary sex characteristics",
    ],
    coding: [
      "ICD-10: N40-N53 (male genitourinary), N60-N98 (female), O-codes (obstetric/pregnancy)",
      "Key terms: BPH, prostate cancer, endometriosis, PCOS, ectopic pregnancy, preeclampsia",
      "CPT: hysterectomy (58150+), LEEP (57461), prostatectomy (55840+), C-section (59510+)",
      "Obstetric codes (O00-O9A): must reflect trimester; always use Z3A.xx for weeks of gestation",
    ],
  },
];

// ── Helper: draw a decorative icon circle ──────────────────────────────────────
function addIconBadge(slide, emoji, x, y, size, bgColor) {
  slide.addShape(pres.ShapeType.ellipse, {
    x, y, w: size, h: size,
    fill: { color: bgColor, transparency: 15 },
    line: { color: C.white, width: 1.5 },
  });
  slide.addText(emoji, {
    x: x - 0.05, y: y + size * 0.18,
    w: size + 0.1, h: size * 0.65,
    fontSize: size * 22,
    align: "center", valign: "middle",
    margin: 0,
  });
}

// ── SLIDE 0: Cover ─────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();

  // Full-bleed background gradient blocks
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 13.3, h: 7.5,
    fill: { color: C.darkNavy },
    line: { color: C.darkNavy },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 4.8, w: 13.3, h: 2.7,
    fill: { color: C.medBlue, transparency: 30 },
    line: { color: C.medBlue, transparency: 30 },
  });

  // Decorative vertical accent bar
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.3, h: 7.5,
    fill: { color: C.accentGold },
    line: { color: C.accentGold },
  });

  // Title
  s.addText("11 Systems of the Human Body", {
    x: 0.8, y: 1.2, w: 11.7, h: 1.2,
    fontSize: 44, bold: true, color: C.white,
    fontFace: "Calibri",
    align: "center",
    glow: { size: 8, opacity: 0.3, color: C.accentTeal },
  });

  s.addText("Medical Coding Interview Prep — Flashcard Deck", {
    x: 0.8, y: 2.55, w: 11.7, h: 0.55,
    fontSize: 20, color: "AED6F1", align: "center",
    fontFace: "Calibri",
  });

  // Divider
  s.addShape(pres.ShapeType.rect, {
    x: 2.5, y: 3.25, w: 8.3, h: 0.04,
    fill: { color: C.accentGold },
    line: { color: C.accentGold },
  });

  // System list in two columns
  const col1 = systems.slice(0, 6).map(s => s.name).join("\n");
  const col2 = systems.slice(6).map(s => s.name).join("\n");

  s.addText(col1, {
    x: 1.2, y: 3.5, w: 5.0, h: 3.2,
    fontSize: 12.5, color: "D6EAF8", fontFace: "Calibri", lineSpacingMultiple: 1.4,
    align: "left",
  });
  s.addText(col2, {
    x: 7.0, y: 3.5, w: 5.0, h: 3.2,
    fontSize: 12.5, color: "D6EAF8", fontFace: "Calibri", lineSpacingMultiple: 1.4,
    align: "left",
  });

  s.addText("Anatomy · Physiology · ICD-10 · CPT Coding", {
    x: 0, y: 7.05, w: 13.3, h: 0.4,
    fontSize: 11, color: "7FB3D3", align: "center",
    fontFace: "Calibri",
  });
}

// ── System flashcard slides ────────────────────────────────────────────────────
systems.forEach((sys, idx) => {
  const s = pres.addSlide();

  // LEFT PANEL background
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 4.4, h: 7.5,
    fill: { color: sys.color },
    line: { color: sys.color },
  });

  // Gold accent top strip
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 4.4, h: 0.12,
    fill: { color: sys.accent },
    line: { color: sys.accent },
  });

  // System number badge
  s.addShape(pres.ShapeType.ellipse, {
    x: 0.25, y: 0.3, w: 0.7, h: 0.7,
    fill: { color: sys.accent, transparency: 0 },
    line: { color: C.white, width: 1 },
  });
  s.addText(String(idx + 1), {
    x: 0.25, y: 0.3, w: 0.7, h: 0.7,
    fontSize: 16, bold: true, color: C.darkNavy,
    align: "center", valign: "middle", margin: 0,
  });

  // System name
  s.addText(sys.name.replace(/^\d+\.\s/, ""), {
    x: 1.05, y: 0.3, w: 3.15, h: 0.75,
    fontSize: 17, bold: true, color: C.white,
    fontFace: "Calibri", valign: "middle",
  });

  // Emoji icon
  s.addText(sys.emoji, {
    x: 0.7, y: 1.2, w: 3.0, h: 1.4,
    fontSize: 60, align: "center",
  });

  // Organs label
  s.addShape(pres.ShapeType.rect, {
    x: 0.2, y: 2.75, w: 4.0, h: 0.28,
    fill: { color: sys.accent, transparency: 20 },
    line: { color: sys.accent, transparency: 20 },
    rounding: 0.05,
  });
  s.addText("KEY ORGANS / STRUCTURES", {
    x: 0.2, y: 2.75, w: 4.0, h: 0.28,
    fontSize: 8.5, bold: true, color: C.darkNavy,
    align: "center", valign: "middle", margin: 0,
    charSpacing: 2,
  });

  s.addText(sys.organs, {
    x: 0.2, y: 3.08, w: 4.0, h: 1.5,
    fontSize: 10.5, color: "D6EAF8", fontFace: "Calibri",
    lineSpacingMultiple: 1.3, valign: "top",
    wrap: true,
  });

  // Slide number bottom-left
  s.addText(`${idx + 1} / 11`, {
    x: 0.2, y: 7.1, w: 1.0, h: 0.3,
    fontSize: 9, color: "7FB3D3",
  });

  // ── RIGHT PANEL ──────────────────────────────────────────────────────────────
  // Light background
  s.addShape(pres.ShapeType.rect, {
    x: 4.4, y: 0, w: 8.9, h: 7.5,
    fill: { color: C.lightBg },
    line: { color: C.lightBg },
  });

  // Top accent strip right
  s.addShape(pres.ShapeType.rect, {
    x: 4.4, y: 0, w: 8.9, h: 0.12,
    fill: { color: sys.color },
    line: { color: sys.color },
  });

  // FUNCTIONS section header
  s.addShape(pres.ShapeType.rect, {
    x: 4.55, y: 0.22, w: 4.0, h: 0.32,
    fill: { color: sys.color },
    line: { color: sys.color },
    rounding: 0.05,
  });
  s.addText("⚙ FUNCTIONS & PHYSIOLOGY", {
    x: 4.55, y: 0.22, w: 4.0, h: 0.32,
    fontSize: 9, bold: true, color: C.white,
    align: "center", valign: "middle", margin: 0,
    charSpacing: 1.5,
  });

  // Function bullets
  const funcItems = sys.functions.map((f, i) => ({
    text: f,
    options: { bullet: { code: "25B8", indent: 12, color: sys.color }, breakLine: i < sys.functions.length - 1, fontSize: 11, color: C.bodyText },
  }));
  s.addText(funcItems, {
    x: 4.55, y: 0.62, w: 3.85, h: 2.9,
    fontFace: "Calibri", lineSpacingMultiple: 1.45,
    valign: "top",
  });

  // CODING section header
  s.addShape(pres.ShapeType.rect, {
    x: 8.8, y: 0.22, w: 4.2, h: 0.32,
    fill: { color: C.codingTag },
    line: { color: C.codingTag },
    rounding: 0.05,
  });
  s.addText("💻 MEDICAL CODING NOTES", {
    x: 8.8, y: 0.22, w: 4.2, h: 0.32,
    fontSize: 9, bold: true, color: C.white,
    align: "center", valign: "middle", margin: 0,
    charSpacing: 1.5,
  });

  // Coding bullets
  const codeItems = sys.coding.map((c, i) => ({
    text: c,
    options: { bullet: { code: "25C6", indent: 12, color: C.accentGold }, breakLine: i < sys.coding.length - 1, fontSize: 11, color: C.bodyText },
  }));
  s.addText(codeItems, {
    x: 8.8, y: 0.62, w: 4.1, h: 2.9,
    fontFace: "Calibri", lineSpacingMultiple: 1.45,
    valign: "top",
  });

  // ── Horizontal divider ───────────────────────────────────────────────────────
  s.addShape(pres.ShapeType.rect, {
    x: 4.55, y: 3.65, w: 8.5, h: 0.03,
    fill: { color: sys.color, transparency: 40 },
    line: { color: sys.color, transparency: 40 },
  });

  // ── QUICK REFERENCE BOX ──────────────────────────────────────────────────────
  s.addShape(pres.ShapeType.rect, {
    x: 4.55, y: 3.75, w: 8.5, h: 3.5,
    fill: { color: C.white },
    line: { color: sys.color, width: 1.5 },
    rounding: 0.08,
  });

  // Quick ref label
  s.addShape(pres.ShapeType.rect, {
    x: 4.75, y: 3.65, w: 2.5, h: 0.3,
    fill: { color: sys.accent },
    line: { color: sys.accent },
    rounding: 0.05,
  });
  s.addText("INTERVIEW QUICK TIPS", {
    x: 4.75, y: 3.65, w: 2.5, h: 0.3,
    fontSize: 8.5, bold: true, color: C.darkNavy,
    align: "center", valign: "middle", margin: 0,
    charSpacing: 1,
  });

  // Tips content - system-specific
  const tips = getQuickTips(sys.name);
  s.addText(tips, {
    x: 4.75, y: 3.95, w: 8.1, h: 3.2,
    fontFace: "Calibri", fontSize: 11.5, color: C.bodyText,
    lineSpacingMultiple: 1.5, valign: "top",
    wrap: true,
  });
});

// ── Quick tips per system ────────────────────────────────────────────────────────
function getQuickTips(name) {
  const map = {
    "1. Integumentary System": [
      { text: "Pressure ulcers", options: { bold: true, breakLine: false, color: "922B21" } },
      { text: " (L89.xx) are staged 1–4 + unstageable + deep tissue. Stage = depth of tissue damage.", options: { breakLine: true } },
      { text: "Wound laterality & anatomical site", options: { bold: true, breakLine: false, color: "922B21" } },
      { text: " are required for specificity (e.g., L89.213 = Stage 3 pressure ulcer, right hip).", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Debridement CPT code depends on depth (selective vs. non-selective) and provider type.", options: { breakLine: true } },
      { text: "Burns:", options: { bold: true, breakLine: false, color: "922B21" } },
      { text: " Code degree (1st/2nd/3rd), body site, and total body surface area (TBSA) using Rule of Nines.", options: {} },
    ],
    "2. Skeletal System": [
      { text: "Fracture coding", options: { bold: true, breakLine: false, color: "17202A" } },
      { text: " requires: bone, side (laterality), open vs. closed, displaced vs. nondisplaced, encounter type (A=initial, D=subsequent, S=sequela).", options: { breakLine: true } },
      { text: "Osteoporosis fractures", options: { bold: true, breakLine: false, color: "17202A" } },
      { text: " (M80.xx) differ from traumatic fractures (S codes) — important distinction!", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Joint replacement CPT (arthroplasty) is a high-value code; always document primary vs. revision.", options: {} },
    ],
    "3. Muscular System": [
      { text: "Sprain vs. Strain:", options: { bold: true, breakLine: false, color: "7B241C" } },
      { text: " Sprain = ligament injury (S43.xx, S53.xx); Strain = muscle/tendon injury (S46.xx, S56.xx).", options: { breakLine: true } },
      { text: "Fibromyalgia", options: { bold: true, breakLine: false, color: "7B241C" } },
      { text: " (M79.3) is a common chronic pain diagnosis — no objective test, purely clinical.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Tendon repair CPT varies by body region and whether repair is primary or secondary.", options: {} },
    ],
    "4. Nervous System": [
      { text: "Stroke (CVA) coding:", options: { bold: true, breakLine: false, color: "154360" } },
      { text: " I63.xx (ischemic) vs. I61.xx (hemorrhagic) — always code neurological deficits as additional codes.", options: { breakLine: true } },
      { text: "Sequelae of CVA", options: { bold: true, breakLine: false, color: "154360" } },
      { text: " use I69.xx — code the specific deficit (hemiplegia, aphasia, dysphagia) + I69 category.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " In pain coding, code the underlying cause first, then G89.xx for chronic pain syndrome.", options: {} },
    ],
    "5. Endocrine System": [
      { text: "Diabetes coding:", options: { bold: true, breakLine: false, color: "512E5F" } },
      { text: " E10 (Type 1), E11 (Type 2), E13 (other). Always add 5th/6th characters for complications (nephropathy, retinopathy, neuropathy).", options: { breakLine: true } },
      { text: "NEVER assume Type 2", options: { bold: true, breakLine: false, color: "512E5F" } },
      { text: " if not documented — query the provider if type is unclear.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Thyroid disorder codes (E00-E07) require specifying hypothyroid vs. hyperthyroid and goiter presence.", options: {} },
    ],
    "6. Cardiovascular System": [
      { text: "Hypertension:", options: { bold: true, breakLine: false, color: "7B241C" } },
      { text: " I10 is a standalone code; I11.xx when with heart disease; I12.xx when with CKD; I13.xx when both.", options: { breakLine: true } },
      { text: "AMI coding:", options: { bold: true, breakLine: false, color: "7B241C" } },
      { text: " I21.xx (initial); I22.xx (subsequent MI within 4 weeks); site (STEMI vs NSTEMI) required.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Heart failure: I50.2 (systolic), I50.3 (diastolic), I50.4 (combined) + acuity (acute/chronic).", options: {} },
    ],
    "7. Lymphatic & Immune System": [
      { text: "HIV vs AIDS:", options: { bold: true, breakLine: false, color: "196F3D" } },
      { text: " B20 (AIDS — with AIDS-defining illness), Z21 (asymptomatic HIV+). Never use B20 for asymptomatic status.", options: { breakLine: true } },
      { text: "Autoimmune disorders", options: { bold: true, breakLine: false, color: "196F3D" } },
      { text: " (e.g., Lupus M32.xx, RA M05-M06): code the system(s) affected as additional codes.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Lymphedema (I89.0) must be distinguished from localized edema (R60.0) and pitting edema.", options: {} },
    ],
    "8. Respiratory System": [
      { text: "COPD exacerbation:", options: { bold: true, breakLine: false, color: "0B5345" } },
      { text: " J44.1 (with acute exacerbation). Always code the infectious agent additionally if present.", options: { breakLine: true } },
      { text: "Pneumonia coding:", options: { bold: true, breakLine: false, color: "0B5345" } },
      { text: " Code specific organism when known (J15.xx). J18.9 = unspecified pneumonia (less specific).", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Asthma: J45.20/30/40/50 = mild/moderate/severe persistent or intermittent + acute exacerbation.", options: {} },
    ],
    "9. Digestive System": [
      { text: "Colonoscopy coding:", options: { bold: true, breakLine: false, color: "6E2F1A" } },
      { text: " CPT 45378 (diagnostic), 45380 (biopsy), 45385 (polypectomy) — code the HIGHEST level of service.", options: { breakLine: true } },
      { text: "Hernia coding:", options: { bold: true, breakLine: false, color: "6E2F1A" } },
      { text: " Specify type (inguinal/umbilical/incisional), side, reducible vs. incarcerated vs. strangulated.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Cirrhosis (K74.60) should have alcohol use/abuse/dependence coded additionally if applicable.", options: {} },
    ],
    "10. Urinary System": [
      { text: "CKD staging:", options: { bold: true, breakLine: false, color: "154360" } },
      { text: " N18.1-N18.5 (stages 1-5), N18.6 (ESRD). Always code the underlying cause (diabetic nephropathy, HTN).", options: { breakLine: true } },
      { text: "UTI coding:", options: { bold: true, breakLine: false, color: "154360" } },
      { text: " N39.0 = UTI unspecified. Code site if documented (cystitis N30.xx, pyelonephritis N10/N11).", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " Hematuria (R31.xx) is a symptom code — do NOT code separately when cause has been established.", options: {} },
    ],
    "11. Reproductive System": [
      { text: "Obstetric coding:", options: { bold: true, breakLine: false, color: "5B2C6F" } },
      { text: " O-codes (O00-O9A) ALWAYS require a trimester 7th character; use Z3A.xx for gestational age.", options: { breakLine: true } },
      { text: "Ectopic pregnancy:", options: { bold: true, breakLine: false, color: "5B2C6F" } },
      { text: " O00.xx — site matters (tubal, ovarian, abdominal). Life-threatening — emergency CPT codes apply.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, breakLine: false, color: "1A5276" } },
      { text: " C-section delivery: 59510 (complete OB care), 59514 (C-section only), 59515 (C-section + postpartum).", options: {} },
    ],
  };
  return map[sys.name] || "Review ICD-10-CM and CPT guidelines for this system.";
}

// ── LAST SLIDE: Summary Tips ───────────────────────────────────────────────────
{
  const s = pres.addSlide();
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 13.3, h: 7.5,
    fill: { color: C.darkNavy },
    line: { color: C.darkNavy },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.3, h: 7.5,
    fill: { color: C.accentGold },
    line: { color: C.accentGold },
  });

  s.addText("Interview Prep — Top 10 Medical Coding Tips", {
    x: 0.7, y: 0.25, w: 12.3, h: 0.75,
    fontSize: 30, bold: true, color: C.white, fontFace: "Calibri",
    align: "center",
  });

  s.addShape(pres.ShapeType.rect, {
    x: 1.5, y: 1.1, w: 10.3, h: 0.04,
    fill: { color: C.accentGold },
    line: { color: C.accentGold },
  });

  const tips = [
    { label: "1. ICD-10 code order:", tip: " Principal diagnosis first; complications and comorbidities after." },
    { label: "2. Code to highest specificity:", tip: " Always choose the most specific code available (use all available digits)." },
    { label: "3. Laterality matters:", tip: " Left/right is often required — unspecified side is a last resort." },
    { label: "4. Encounter type (7th character):", tip: " A = initial, D = subsequent, S = sequela for trauma codes." },
    { label: "5. Never code symptoms:", tip: " Do not code signs/symptoms when a definitive diagnosis is established." },
    { label: "6. Link conditions:", tip: " Always code causal relationships (e.g., diabetic nephropathy = E11.65 + N18.x)." },
    { label: "7. Outpatient vs. Inpatient:", tip: " Outpatient: code confirmed conditions only. Inpatient: can code 'probable/suspected'." },
    { label: "8. Trimesters in OB:", tip: " All O-codes require trimester — 1st (<14 wks), 2nd (14-27 wks), 3rd (≥28 wks)." },
    { label: "9. Exclude notes:", tip: " Excludes1 = never code together; Excludes2 = may code together if both present." },
    { label: "10. Query the provider:", tip: " When documentation is unclear (e.g., DM type, fracture type), always query — do not assume." },
  ];

  const col1 = tips.slice(0, 5);
  const col2 = tips.slice(5);

  function buildTipItems(arr) {
    const items = [];
    arr.forEach((t, i) => {
      items.push({ text: t.label, options: { bold: true, color: C.accentGold, breakLine: false } });
      items.push({ text: t.tip, options: { color: "D6EAF8", breakLine: i < arr.length - 1 } });
    });
    return items;
  }

  s.addText(buildTipItems(col1), {
    x: 0.7, y: 1.25, w: 5.6, h: 5.8,
    fontFace: "Calibri", fontSize: 12.5,
    lineSpacingMultiple: 1.6, valign: "top",
  });

  s.addText(buildTipItems(col2), {
    x: 7.0, y: 1.25, w: 5.9, h: 5.8,
    fontFace: "Calibri", fontSize: 12.5,
    lineSpacingMultiple: 1.6, valign: "top",
  });

  s.addText("Good luck with your Medical Coding Interview! 🎯", {
    x: 0, y: 7.05, w: 13.3, h: 0.4,
    fontSize: 13, color: "82E0AA", align: "center",
    fontFace: "Calibri",
  });
}

// ── Write file ─────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Medical_Coding_Flashcards.pptx" })
  .then(() => console.log("DONE: File written successfully."))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cd /home/daytona/workspace/body-systems-flashcards && node build.js 2>&1

Editing File

~/body-systems-flashcards/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/body-systems-flashcards/build.js'
Editing File

~/body-systems-flashcards/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/body-systems-flashcards/build.js'
Writing File

~/body-systems-flashcards/build.js

const pptxgen = require("pptxgenjs");

const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE";
pres.title = "11 Systems of the Human Body - Medical Coding Interview Flashcards";
pres.author = "Medical Coding Interview Prep";

const C = {
  darkNavy:   "0D1B2A",
  medBlue:    "1B4F72",
  accentTeal: "148F77",
  accentGold: "F0A500",
  lightBg:    "EAF2F8",
  white:      "FFFFFF",
  bodyText:   "1C2833",
  subText:    "5D6D7E",
  codingTag:  "1A5276",
};

const systems = [
  {
    name: "1. Integumentary System",
    emoji: "🧱",
    color: "1B4F72",
    accent: "D4AC0D",
    organs: "Skin (epidermis, dermis, hypodermis), hair, nails, sweat & sebaceous glands",
    functions: [
      "Protection against pathogens, UV, and physical trauma",
      "Thermoregulation via sweat glands and vasodilation",
      "Sensation (touch, pain, temperature) via nerve endings",
      "Vitamin D synthesis from UV light",
      "Waterproofing via keratin in skin cells",
    ],
    coding: [
      "ICD-10: L-codes (skin disorders), S-codes (injuries)",
      "Key terms: dermatitis, cellulitis, pressure ulcer, melanoma",
      "CPT: wound repair (12001-13160), skin biopsy (11100), lesion destruction",
      "Wound depth & body region affect code selection",
    ],
    tips: [
      { text: "Pressure ulcers", options: { bold: true, color: "922B21", breakLine: false } },
      { text: " (L89.xx) are staged 1-4 + unstageable + deep tissue. Stage = depth of tissue damage.", options: { breakLine: true } },
      { text: "Burns:", options: { bold: true, color: "922B21", breakLine: false } },
      { text: " Code degree (1st/2nd/3rd), site, and TBSA using Rule of Nines.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Debridement CPT depends on depth (selective vs non-selective) and provider type.", options: {} },
    ],
  },
  {
    name: "2. Skeletal System",
    emoji: "🦴",
    color: "212F3D",
    accent: "AEB6BF",
    organs: "206 bones, cartilage, tendons, ligaments, synovial/fibrous/cartilaginous joints",
    functions: [
      "Support and shape the body framework",
      "Protection of vital organs (skull, rib cage, spine)",
      "Movement via levers for muscle attachment",
      "Hematopoiesis (blood cell production) in red marrow",
      "Mineral storage: calcium and phosphorus",
    ],
    coding: [
      "ICD-10: M-codes (musculoskeletal), S-codes (fractures)",
      "Key terms: fracture (open/closed/displaced), osteoporosis, arthritis",
      "CPT: fracture care (open vs. closed reduction), arthroplasty, bone biopsy",
      "Laterality and fracture type are critical for accurate coding",
    ],
    tips: [
      { text: "Fracture coding", options: { bold: true, color: "1C2833", breakLine: false } },
      { text: " needs: bone, laterality, open/closed, displaced/nondisplaced, encounter type (A/D/S).", options: { breakLine: true } },
      { text: "Osteoporosis fractures", options: { bold: true, color: "1C2833", breakLine: false } },
      { text: " (M80.xx) differ from traumatic fractures (S codes) - key distinction!", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Arthroplasty: document primary vs. revision - CPT codes differ significantly.", options: {} },
    ],
  },
  {
    name: "3. Muscular System",
    emoji: "💪",
    color: "7B241C",
    accent: "F1948A",
    organs: "700+ skeletal muscles, cardiac muscle (heart), smooth muscle (organs/vessels)",
    functions: [
      "Voluntary (skeletal) and involuntary (smooth/cardiac) movement",
      "Posture and joint stabilization",
      "Heat production (~85% body heat from muscle contraction)",
      "Sphincter control (bladder, digestive tract openings)",
      "Facial expressions and breathing (diaphragm, intercostals)",
    ],
    coding: [
      "ICD-10: M60-M79 (soft tissue/muscle disorders), G71-G72 (myopathies)",
      "Key terms: strain, myositis, fibromyalgia, tendinitis, spasm, atrophy",
      "CPT: muscle repair, tendon repair, trigger point injections (20552-20553)",
      "Distinguish strain (muscle/tendon) from sprain (ligament) for ICD-10",
    ],
    tips: [
      { text: "Sprain vs. Strain:", options: { bold: true, color: "7B241C", breakLine: false } },
      { text: " Sprain = ligament injury (S43.xx); Strain = muscle/tendon injury (S46.xx).", options: { breakLine: true } },
      { text: "Fibromyalgia", options: { bold: true, color: "7B241C", breakLine: false } },
      { text: " (M79.3) is a purely clinical diagnosis - no confirmatory objective test.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Tendon repair CPT varies by body region and whether repair is primary or secondary.", options: {} },
    ],
  },
  {
    name: "4. Nervous System",
    emoji: "🧠",
    color: "154360",
    accent: "7FB3D3",
    organs: "Brain, spinal cord (CNS); cranial/spinal nerves, ganglia, sensory receptors (PNS)",
    functions: [
      "Sensory input: receives signals from environment",
      "Integration: processes information (brain & spinal cord)",
      "Motor output: sends commands to muscles and glands",
      "Autonomic control (ANS): heart rate, digestion, breathing",
      "Higher functions: memory, cognition, emotion",
    ],
    coding: [
      "ICD-10: G-codes (nervous system), S00-S09 (head injuries), F-codes (mental)",
      "Key terms: CVA/stroke, seizure, neuropathy, Parkinson's, MS, concussion",
      "CPT: EEG (95812+), nerve conduction (95907+), spinal procedures (62xxx, 63xxx)",
      "G43 (migraine) vs G44 (other headache) - specify correctly",
    ],
    tips: [
      { text: "Stroke (CVA):", options: { bold: true, color: "154360", breakLine: false } },
      { text: " I63.xx (ischemic) vs I61.xx (hemorrhagic) - code neurological deficits separately.", options: { breakLine: true } },
      { text: "CVA sequelae", options: { bold: true, color: "154360", breakLine: false } },
      { text: " use I69.xx - code specific deficit (hemiplegia, aphasia, dysphagia) + I69 category.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Code underlying cause first, then G89.xx for chronic pain syndrome.", options: {} },
    ],
  },
  {
    name: "5. Endocrine System",
    emoji: "⚗️",
    color: "5B2C6F",
    accent: "C39BD3",
    organs: "Hypothalamus, pituitary, thyroid, parathyroid, adrenals, pancreatic islets, gonads, pineal",
    functions: [
      "Hormone production and secretion via bloodstream",
      "Regulation of metabolism, growth, and development",
      "Blood glucose control: insulin and glucagon (pancreas)",
      "Stress response: cortisol and epinephrine (adrenal glands)",
      "Reproductive function and circadian rhythm (melatonin)",
    ],
    coding: [
      "ICD-10: E-codes (endocrine/metabolic), E10 (T1DM), E11 (T2DM)",
      "Key terms: hypothyroidism, hyperthyroidism, Cushing's, Addison's, DM complications",
      "CPT: thyroid biopsy, adrenal procedures, glucose tolerance test (82951)",
      "Diabetes: always code type, complications, and manifestations",
    ],
    tips: [
      { text: "Diabetes coding:", options: { bold: true, color: "5B2C6F", breakLine: false } },
      { text: " E10 (Type 1), E11 (Type 2), E13 (other) - add characters for complications.", options: { breakLine: true } },
      { text: "NEVER assume Type 2", options: { bold: true, color: "5B2C6F", breakLine: false } },
      { text: " if not documented - always query the provider if type is unclear.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Thyroid codes (E00-E07) require specifying hypo vs. hyperthyroid and goiter presence.", options: {} },
    ],
  },
  {
    name: "6. Cardiovascular System",
    emoji: "❤️",
    color: "922B21",
    accent: "F1948A",
    organs: "Heart (4 chambers), arteries, veins, capillaries (~100,000 km of vessels)",
    functions: [
      "Pumps oxygenated blood to all body tissues (systemic)",
      "Returns deoxygenated blood to lungs (pulmonary circulation)",
      "Transports nutrients, hormones, and metabolic waste",
      "Thermoregulation via blood flow distribution",
      "Immune defense (WBC transport) and hemostasis",
    ],
    coding: [
      "ICD-10: I-codes; I10 (HTN), I21 (AMI), I50 (heart failure), I48 (a-fib)",
      "Key terms: CAD, angina, MI, CHF, arrhythmia, DVT, PE, atherosclerosis",
      "CPT: cardiac cath (93454+), CABG (33510+), stent placement (92928+)",
      "Always link hypertension to heart/renal disease when both present",
    ],
    tips: [
      { text: "Hypertension:", options: { bold: true, color: "7B241C", breakLine: false } },
      { text: " I10 standalone; I11.xx + heart disease; I12.xx + CKD; I13.xx when both.", options: { breakLine: true } },
      { text: "AMI coding:", options: { bold: true, color: "7B241C", breakLine: false } },
      { text: " I21.xx (initial); I22.xx (subsequent within 4 weeks); STEMI vs NSTEMI site required.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " CHF: I50.2 (systolic), I50.3 (diastolic), I50.4 (combined) + acuity (acute/chronic).", options: {} },
    ],
  },
  {
    name: "7. Lymphatic & Immune System",
    emoji: "🛡️",
    color: "1E8449",
    accent: "82E0AA",
    organs: "Lymph nodes, lymph vessels, spleen, thymus, tonsils, bone marrow, MALT",
    functions: [
      "Returns excess interstitial fluid to bloodstream",
      "Filters pathogens and foreign particles in lymph nodes",
      "B cells (antibodies) and T cells (cell-mediated immunity)",
      "Lipid absorption from digestive tract (lacteals)",
      "Removes cellular debris and maintains fluid balance",
    ],
    coding: [
      "ICD-10: C81-C96 (lymphoma/leukemia), D80-D89 (immune disorders)",
      "Key terms: lymphedema, HIV/AIDS, lupus, RA, anaphylaxis, lymphoma",
      "CPT: lymph node biopsy (38500), lymphadenectomy (38700+), immunotherapy admin",
      "HIV (B20) requires coding specific manifestations/opportunistic infections",
    ],
    tips: [
      { text: "HIV vs AIDS:", options: { bold: true, color: "196F3D", breakLine: false } },
      { text: " B20 (AIDS - AIDS-defining illness); Z21 (asymptomatic HIV+). Never B20 for asymptomatic.", options: { breakLine: true } },
      { text: "Autoimmune disorders:", options: { bold: true, color: "196F3D", breakLine: false } },
      { text: " Lupus M32.xx, RA M05-M06 - code systems affected as additional codes.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Lymphedema (I89.0) differs from localized edema (R60.0) - document carefully.", options: {} },
    ],
  },
  {
    name: "8. Respiratory System",
    emoji: "🫁",
    color: "117A65",
    accent: "76D7C4",
    organs: "Nose, pharynx, larynx, trachea, bronchi, bronchioles, alveoli, lungs, diaphragm, pleura",
    functions: [
      "Gas exchange: O2 intake and CO2 elimination at alveoli",
      "Ventilation: mechanical movement of air (inspiration/expiration)",
      "Acid-base balance via CO2 regulation (respiratory buffer)",
      "Phonation (voice production via larynx and vocal cords)",
      "Filtering, warming, and humidifying inspired air",
    ],
    coding: [
      "ICD-10: J-codes; J18 (pneumonia), J44 (COPD), J45 (asthma), J96 (resp failure)",
      "Key terms: COPD, asthma, pneumonia, pleural effusion, PE, COVID-19 (U07.1)",
      "CPT: bronchoscopy (31622-31651), spirometry (94010), intubation (31500)",
      "COPD: code underlying type + exacerbation if present",
    ],
    tips: [
      { text: "COPD exacerbation:", options: { bold: true, color: "0B5345", breakLine: false } },
      { text: " J44.1 (with acute exacerbation). Code infectious agent additionally if present.", options: { breakLine: true } },
      { text: "Pneumonia:", options: { bold: true, color: "0B5345", breakLine: false } },
      { text: " Code specific organism when known (J15.xx). J18.9 = unspecified (less specific).", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Asthma: J45.xx - code severity (intermittent/mild/moderate/severe) + exacerbation.", options: {} },
    ],
  },
  {
    name: "9. Digestive System",
    emoji: "🍽️",
    color: "784212",
    accent: "F0B27A",
    organs: "Mouth, esophagus, stomach, small intestine, large intestine, rectum; liver, gallbladder, pancreas",
    functions: [
      "Ingestion and mechanical digestion (chewing, peristalsis)",
      "Chemical digestion via enzymes (amylase, pepsin, lipase)",
      "Nutrient absorption mainly in small intestine",
      "Water absorption and waste formation in large intestine",
      "Liver: bile production, detoxification, glycogen storage",
    ],
    coding: [
      "ICD-10: K-codes; K21 (GERD), K25 (ulcer), K50-K51 (IBD), K70 (liver disease)",
      "Key terms: Crohn's, ulcerative colitis, cirrhosis, cholecystitis, appendicitis, hernia",
      "CPT: colonoscopy (45378+), cholecystectomy (47562 lap), EGD (43239)",
      "Colonoscopy CPT differs significantly by biopsy or polypectomy performed",
    ],
    tips: [
      { text: "Colonoscopy CPT:", options: { bold: true, color: "6E2F1A", breakLine: false } },
      { text: " 45378 (diagnostic), 45380 (biopsy), 45385 (polypectomy) - code HIGHEST level.", options: { breakLine: true } },
      { text: "Hernia coding:", options: { bold: true, color: "6E2F1A", breakLine: false } },
      { text: " Specify type (inguinal/umbilical/incisional), side, reducible vs. incarcerated vs. strangulated.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Cirrhosis (K74.60): code alcohol use/abuse/dependence additionally if applicable.", options: {} },
    ],
  },
  {
    name: "10. Urinary System",
    emoji: "💧",
    color: "154360",
    accent: "AED6F1",
    organs: "2 Kidneys, 2 ureters, urinary bladder, urethra; functional unit = nephron (~1 million/kidney)",
    functions: [
      "Filtration of blood and elimination of waste (urea, creatinine)",
      "Fluid and electrolyte balance (Na+, K+, Cl-)",
      "Acid-base regulation (bicarbonate reabsorption/secretion)",
      "Blood pressure control via RAAS (renin-angiotensin-aldosterone)",
      "EPO production to stimulate red blood cell synthesis",
    ],
    coding: [
      "ICD-10: N-codes; N17-N19 (AKI/CKD), N20 (kidney stones), N39 (UTI)",
      "Key terms: AKI, CKD (stage 1-5/ESRD), nephrotic syndrome, pyelonephritis",
      "CPT: cystoscopy (52000+), urinalysis (81000), dialysis (90935+), lithotripsy",
      "CKD stage must match GFR; ESRD is N18.6; code underlying cause",
    ],
    tips: [
      { text: "CKD staging:", options: { bold: true, color: "154360", breakLine: false } },
      { text: " N18.1-N18.5 (stages 1-5), N18.6 (ESRD). Always code underlying cause (DM/HTN).", options: { breakLine: true } },
      { text: "UTI coding:", options: { bold: true, color: "154360", breakLine: false } },
      { text: " N39.0 = UTI unspecified. Code site if documented (cystitis N30.xx, pyelonephritis N10).", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " Hematuria (R31.xx) is a symptom - do NOT code separately once cause is established.", options: {} },
    ],
  },
  {
    name: "11. Reproductive System",
    emoji: "🔬",
    color: "6C3483",
    accent: "D7BDE2",
    organs: "Male: testes, epididymis, vas deferens, prostate, penis | Female: ovaries, fallopian tubes, uterus, cervix, vagina, mammary glands",
    functions: [
      "Production of gametes: sperm (male) and ova (female)",
      "Hormone production: testosterone (male), estrogen/progesterone (female)",
      "Fertilization, implantation, and fetal development",
      "Childbirth and lactation (female)",
      "Sexual response and secondary sex characteristics",
    ],
    coding: [
      "ICD-10: N40-N53 (male), N60-N98 (female), O-codes (obstetric/pregnancy)",
      "Key terms: BPH, prostate cancer, endometriosis, PCOS, ectopic pregnancy",
      "CPT: hysterectomy (58150+), LEEP (57461), prostatectomy (55840+), C-section (59510+)",
      "Obstetric codes require trimester character; use Z3A.xx for gestational age",
    ],
    tips: [
      { text: "Obstetric coding:", options: { bold: true, color: "5B2C6F", breakLine: false } },
      { text: " O-codes ALWAYS require trimester 7th character; use Z3A.xx for weeks of gestation.", options: { breakLine: true } },
      { text: "Ectopic pregnancy:", options: { bold: true, color: "5B2C6F", breakLine: false } },
      { text: " O00.xx - site matters (tubal/ovarian/abdominal). Life-threatening emergency.", options: { breakLine: true } },
      { text: "Coding tip:", options: { bold: true, color: "1A5276", breakLine: false } },
      { text: " C-section: 59510 (complete OB care), 59514 (surgery only), 59515 (+ postpartum).", options: {} },
    ],
  },
];

// ── SLIDE 0: Cover ─────────────────────────────────────────────────────────────
{
  const s = pres.addSlide();

  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 13.3, h: 7.5,
    fill: { color: "0D1B2A" },
    line: { color: "0D1B2A" },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 4.8, w: 13.3, h: 2.7,
    fill: { color: "1B4F72", transparency: 30 },
    line: { color: "1B4F72", transparency: 30 },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.3, h: 7.5,
    fill: { color: "F0A500" },
    line: { color: "F0A500" },
  });

  s.addText("11 Systems of the Human Body", {
    x: 0.8, y: 1.1, w: 11.7, h: 1.2,
    fontSize: 44, bold: true, color: "FFFFFF",
    fontFace: "Calibri", align: "center",
  });

  s.addText("Medical Coding Interview Prep  |  Anatomy & Physiology Flashcard Deck", {
    x: 0.8, y: 2.5, w: 11.7, h: 0.55,
    fontSize: 19, color: "AED6F1", align: "center",
    fontFace: "Calibri",
  });

  s.addShape(pres.ShapeType.rect, {
    x: 2.5, y: 3.2, w: 8.3, h: 0.04,
    fill: { color: "F0A500" },
    line: { color: "F0A500" },
  });

  const col1 = systems.slice(0, 6).map(s => s.name).join("\n");
  const col2 = systems.slice(6).map(s => s.name).join("\n");

  s.addText(col1, {
    x: 1.2, y: 3.45, w: 5.0, h: 3.2,
    fontSize: 12.5, color: "D6EAF8", fontFace: "Calibri", lineSpacingMultiple: 1.4,
    align: "left",
  });
  s.addText(col2, {
    x: 7.0, y: 3.45, w: 5.0, h: 3.2,
    fontSize: 12.5, color: "D6EAF8", fontFace: "Calibri", lineSpacingMultiple: 1.4,
    align: "left",
  });

  s.addText("Anatomy  |  Physiology  |  ICD-10  |  CPT Coding", {
    x: 0, y: 7.05, w: 13.3, h: 0.4,
    fontSize: 11, color: "7FB3D3", align: "center",
    fontFace: "Calibri",
  });
}

// ── System flashcard slides ────────────────────────────────────────────────────
systems.forEach((sys, idx) => {
  const s = pres.addSlide();

  // LEFT PANEL
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 4.4, h: 7.5,
    fill: { color: sys.color },
    line: { color: sys.color },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 4.4, h: 0.12,
    fill: { color: sys.accent },
    line: { color: sys.accent },
  });

  // Number badge
  s.addShape(pres.ShapeType.ellipse, {
    x: 0.25, y: 0.28, w: 0.7, h: 0.7,
    fill: { color: sys.accent },
    line: { color: "FFFFFF", width: 1 },
  });
  s.addText(String(idx + 1), {
    x: 0.25, y: 0.28, w: 0.7, h: 0.7,
    fontSize: 16, bold: true, color: "0D1B2A",
    align: "center", valign: "middle", margin: 0,
  });

  // System name
  s.addText(sys.name.replace(/^\d+\.\s/, ""), {
    x: 1.05, y: 0.28, w: 3.15, h: 0.75,
    fontSize: 17, bold: true, color: "FFFFFF",
    fontFace: "Calibri", valign: "middle",
  });

  // Emoji
  s.addText(sys.emoji, {
    x: 0.7, y: 1.15, w: 3.0, h: 1.4,
    fontSize: 58, align: "center",
  });

  // Organs label
  s.addShape(pres.ShapeType.rect, {
    x: 0.2, y: 2.72, w: 4.0, h: 0.28,
    fill: { color: sys.accent, transparency: 20 },
    line: { color: sys.accent, transparency: 20 },
  });
  s.addText("KEY ORGANS / STRUCTURES", {
    x: 0.2, y: 2.72, w: 4.0, h: 0.28,
    fontSize: 8.5, bold: true, color: "0D1B2A",
    align: "center", valign: "middle", margin: 0,
    charSpacing: 2,
  });

  s.addText(sys.organs, {
    x: 0.2, y: 3.05, w: 4.0, h: 1.5,
    fontSize: 10.5, color: "D6EAF8", fontFace: "Calibri",
    lineSpacingMultiple: 1.3, valign: "top", wrap: true,
  });

  s.addText((idx + 1) + " / 11", {
    x: 0.2, y: 7.1, w: 1.0, h: 0.3,
    fontSize: 9, color: "7FB3D3",
  });

  // RIGHT PANEL
  s.addShape(pres.ShapeType.rect, {
    x: 4.4, y: 0, w: 8.9, h: 7.5,
    fill: { color: "EAF2F8" },
    line: { color: "EAF2F8" },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 4.4, y: 0, w: 8.9, h: 0.12,
    fill: { color: sys.color },
    line: { color: sys.color },
  });

  // Functions header
  s.addShape(pres.ShapeType.rect, {
    x: 4.55, y: 0.2, w: 4.0, h: 0.32,
    fill: { color: sys.color },
    line: { color: sys.color },
  });
  s.addText("FUNCTIONS & PHYSIOLOGY", {
    x: 4.55, y: 0.2, w: 4.0, h: 0.32,
    fontSize: 9, bold: true, color: "FFFFFF",
    align: "center", valign: "middle", margin: 0,
    charSpacing: 1.5,
  });

  const funcItems = sys.functions.map((f, i) => ({
    text: f,
    options: {
      bullet: { code: "25B8", indent: 12, color: sys.color },
      breakLine: i < sys.functions.length - 1,
      fontSize: 11, color: "1C2833",
    },
  }));
  s.addText(funcItems, {
    x: 4.55, y: 0.6, w: 3.85, h: 2.9,
    fontFace: "Calibri", lineSpacingMultiple: 1.45, valign: "top",
  });

  // Coding header
  s.addShape(pres.ShapeType.rect, {
    x: 8.8, y: 0.2, w: 4.2, h: 0.32,
    fill: { color: "1A5276" },
    line: { color: "1A5276" },
  });
  s.addText("MEDICAL CODING NOTES", {
    x: 8.8, y: 0.2, w: 4.2, h: 0.32,
    fontSize: 9, bold: true, color: "FFFFFF",
    align: "center", valign: "middle", margin: 0,
    charSpacing: 1.5,
  });

  const codeItems = sys.coding.map((c, i) => ({
    text: c,
    options: {
      bullet: { code: "25C6", indent: 12, color: "F0A500" },
      breakLine: i < sys.coding.length - 1,
      fontSize: 11, color: "1C2833",
    },
  }));
  s.addText(codeItems, {
    x: 8.8, y: 0.6, w: 4.1, h: 2.9,
    fontFace: "Calibri", lineSpacingMultiple: 1.45, valign: "top",
  });

  // Divider
  s.addShape(pres.ShapeType.rect, {
    x: 4.55, y: 3.65, w: 8.5, h: 0.03,
    fill: { color: sys.color, transparency: 40 },
    line: { color: sys.color, transparency: 40 },
  });

  // Interview tips box
  s.addShape(pres.ShapeType.rect, {
    x: 4.55, y: 3.75, w: 8.5, h: 3.5,
    fill: { color: "FFFFFF" },
    line: { color: sys.color, width: 1.5 },
  });

  s.addShape(pres.ShapeType.rect, {
    x: 4.75, y: 3.65, w: 2.7, h: 0.3,
    fill: { color: sys.accent },
    line: { color: sys.accent },
  });
  s.addText("INTERVIEW QUICK TIPS", {
    x: 4.75, y: 3.65, w: 2.7, h: 0.3,
    fontSize: 8.5, bold: true, color: "0D1B2A",
    align: "center", valign: "middle", margin: 0,
    charSpacing: 1,
  });

  s.addText(sys.tips, {
    x: 4.75, y: 3.95, w: 8.1, h: 3.2,
    fontFace: "Calibri", fontSize: 11.5, color: "1C2833",
    lineSpacingMultiple: 1.5, valign: "top", wrap: true,
  });
});

// ── LAST SLIDE: Summary Tips ───────────────────────────────────────────────────
{
  const s = pres.addSlide();

  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 13.3, h: 7.5,
    fill: { color: "0D1B2A" },
    line: { color: "0D1B2A" },
  });
  s.addShape(pres.ShapeType.rect, {
    x: 0, y: 0, w: 0.3, h: 7.5,
    fill: { color: "F0A500" },
    line: { color: "F0A500" },
  });

  s.addText("Interview Prep - Top 10 Medical Coding Tips", {
    x: 0.7, y: 0.25, w: 12.3, h: 0.75,
    fontSize: 30, bold: true, color: "FFFFFF", fontFace: "Calibri",
    align: "center",
  });

  s.addShape(pres.ShapeType.rect, {
    x: 1.5, y: 1.1, w: 10.3, h: 0.04,
    fill: { color: "F0A500" },
    line: { color: "F0A500" },
  });

  const tipPairs = [
    { label: "1. Code order:", tip: " Principal diagnosis first; complications and comorbidities after." },
    { label: "2. Highest specificity:", tip: " Always choose the most specific code - use all available digits." },
    { label: "3. Laterality:", tip: " Left/right is often required - unspecified side is a last resort." },
    { label: "4. 7th character:", tip: " A = initial, D = subsequent, S = sequela for trauma codes." },
    { label: "5. No symptom codes:", tip: " Do not code signs/symptoms when a definitive diagnosis is established." },
    { label: "6. Link conditions:", tip: " Code causal relationships (e.g., diabetic nephropathy = E11.65 + N18.x)." },
    { label: "7. Inpatient rule:", tip: " Inpatient can code 'probable/suspected'; outpatient: confirmed only." },
    { label: "8. OB trimesters:", tip: " All O-codes require trimester - 1st (<14 wks), 2nd (14-27), 3rd (28+)." },
    { label: "9. Exclude notes:", tip: " Excludes1 = never code together; Excludes2 = may code if both present." },
    { label: "10. Query providers:", tip: " When documentation is unclear (DM type, fracture type), query - do not assume." },
  ];

  const col1 = tipPairs.slice(0, 5);
  const col2 = tipPairs.slice(5);

  function buildTipItems(arr) {
    const items = [];
    arr.forEach((t, i) => {
      items.push({ text: t.label, options: { bold: true, color: "F0A500", breakLine: false } });
      items.push({ text: t.tip, options: { color: "D6EAF8", breakLine: i < arr.length - 1 } });
    });
    return items;
  }

  s.addText(buildTipItems(col1), {
    x: 0.7, y: 1.25, w: 5.6, h: 5.8,
    fontFace: "Calibri", fontSize: 12.5,
    lineSpacingMultiple: 1.65, valign: "top",
  });

  s.addText(buildTipItems(col2), {
    x: 7.0, y: 1.25, w: 5.9, h: 5.8,
    fontFace: "Calibri", fontSize: 12.5,
    lineSpacingMultiple: 1.65, valign: "top",
  });

  s.addText("Good luck with your Medical Coding Interview!", {
    x: 0, y: 7.05, w: 13.3, h: 0.4,
    fontSize: 13, color: "82E0AA", align: "center",
    fontFace: "Calibri",
  });
}

// ── Write file ─────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Medical_Coding_Flashcards.pptx" })
  .then(() => console.log("DONE: File written successfully."))
  .catch(e => { console.error("ERROR:", e); process.exit(1); });
Running Command

cat > /home/daytona/workspace/body-systems-flashcards/build2.js << 'SCRIPT_END' …

Running Command

cd /home/daytona/workspace/body-systems-flashcards && node build2.js 2>&1

Running Command

ls -lh /home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Medical_C…

Where are my notes

Your flashcard deck is right here — ready to download:

11 Body Systems Medical Coding Flashcards

Presentation · PPTX

Here's what's inside (13 slides total):
SlideContent
Slide 1Cover page - all 11 systems listed
Slides 2-12One flashcard per body system
Slide 13Top 10 Medical Coding Interview Tips
Each flashcard (slides 2-12) contains:
  • System name + emoji icon + number badge
  • Key organs/structures (left panel)
  • Functions & Physiology bullets (right panel - top left)
  • Medical Coding Notes with ICD-10 and CPT codes (right panel - top right)
  • Interview Quick Tips box with bold coding rules specific to that system
Systems covered: Integumentary, Skeletal, Muscular, Nervous, Endocrine, Cardiovascular, Lymphatic/Immune, Respiratory, Digestive, Urinary, Reproductive.
Just click the link above to download the .pptx file. It opens in PowerPoint, Google Slides, or LibreOffice Impress. Let me know if you want any changes - color, content, layout, or additional slides!

Create a Word document summary to print as study notes

Reading File
Running Command

cat > /home/daytona/workspace/body-systems-flashcards/build_docx.js << 'EOF' con…

Running Command

cd /home/daytona/workspace/body-systems-flashcards && node build_docx.js 2>&1

Running Command

ls -lh /home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Study_Not…

Running Command

cd /tmp && cp /home/daytona/workspace/body-systems-flashcards/11_Body_Systems_St…

The document is valid and well-structured. Here it is:

11 Body Systems Study Notes

Word Document · DOCX


What's inside (print-ready, ~13 pages):
SectionDetails
Title pageHeader, subtitle, and topic overview
Contents listAll 11 systems + coding rules page
11 system pagesOne page per system (page-break separated)
Summary pageTop 10 Medical Coding Interview Rules
Footer"Page X of Y" on every page
Each system page has a structured table with:
  • Key Organs & Structures - colored header with the system's theme color
  • Functions & Physiology - numbered rows (1-5), alternating shaded rows for readability
  • Medical Coding Reference - ICD-10 codes, key terms, CPT codes
  • Interview Tip box - gold-highlighted tip with the most important coding rule for that system
Designed for clean black-and-white printing too - the shading and borders remain readable even without color.
This is a shared conversation. Sign in to Orris to start your own chat.