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
Since you want 11 individual flashcards (one per body system) with diagrams, anatomy & physiology details, and medical coding relevance, I'll create a polished PowerPoint presentation where each slide is a visual flashcard. Let me build this for you now.
Searching sources...
Reading File
Reading File
Good - I have everything I need. Now I'll build a polished 13-slide PPTX (cover + 11 system flashcards + one summary/tips slide) with a medical blue-white color scheme, using pptxgenjs.
Running Command

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

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

The getQuickTips function is referenced before it's defined (JavaScript hoisting issue with function declaration inside a block, plus it uses sys.name as a key but the map uses number-prefixed names). Let me fix the function placement issue - the function needs to be declared before the forEach loop.
Editing File

~/body-systems-flashcards/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/body-systems-flashcards/build.js'
Now remove the duplicate getQuickTips function that appears later in the file:
Editing File

~/body-systems-flashcards/build.js

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/body-systems-flashcards/build.js'
The file is getting complex - let me just rewrite the entire file cleanly to avoid issues:
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' const pptxgen = require("pptxgenjs"); const pres = new pptxgen(); pres.layout = "LAYOUT_WIDE"; pres.title = "11 Systems of the Human Body - Medical Coding Interview Flashcards"; 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) staged 1-4 + unstageable + deep tissue. Stage = depth of 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), 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 (S43.xx); Strain = muscle/tendon (S46.xx).",options:{breakLine:true}},{text:"Fibromyalgia",options:{bold:true,color:"7B241C",breakLine:false}},{text:" (M79.3) is purely clinical - no objective confirmatory test.",options:{breakLine:true}},{text:"Coding tip:",options:{bold:true,color:"1A5276",breakLine:false}},{text:" Tendon repair CPT varies by body region and primary vs secondary repair.",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 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 - with 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; nephron = functional unit (~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:{}}] }, ]; // COVER SLIDE { 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"} }); s.addText(systems.slice(0,6).map(x=>x.name).join("\n"), { 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(systems.slice(6).map(x=>x.name).join("\n"), { 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" }); } // 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} }); // 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 }); 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" }); s.addText(sys.emoji, { x:0.7, y:1.15, w:3.0, h:1.4, fontSize:58, align:"center" }); // Organs 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 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 }); s.addText(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" } })), { x:4.55, y:0.6, w:3.85, h:2.9, fontFace:"Calibri", lineSpacingMultiple:1.45, valign:"top" }); // Coding 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 }); s.addText(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" } })), { 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} }); // 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 }); }); // SUMMARY SLIDE { 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 buildItems = 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(buildItems(tipPairs.slice(0,5)), { x:0.7, y:1.25, w:5.6, h:5.8, fontFace:"Calibri", fontSize:12.5, lineSpacingMultiple:1.65, valign:"top" }); s.addText(buildItems(tipPairs.slice(5)), { 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" }); } pres.writeFile({ fileName: "/home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Medical_Coding_Flashcards.pptx" }) .then(() => console.log("DONE")) .catch(e => { console.error("ERROR:", e); process.exit(1); }); SCRIPT_END echo "Script written"

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_Coding_Flashcards.pptx

The file is ready (331 KB, 13 slides). Let me update the todos and deliver it.

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
On it. Building the Word document now.
Running Command

cat > /home/daytona/workspace/body-systems-flashcards/build_docx.js << 'EOF' const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType, VerticalAlign, PageNumber, Header, Footer, TableOfContents, PageBreak, UnderlineType } = require('docx'); const fs = require('fs'); // ── Colors ────────────────────────────────────────────────────────────────── const NAVY = "0D1B2A"; const BLUE = "1B4F72"; const GOLD = "F0A500"; const TEAL = "148F77"; const LTBLUE = "D6EAF8"; const WHITE = "FFFFFF"; const GRAY = "F2F3F4"; const RED = "922B21"; const CODEBG = "EAF2F8"; // ── System data ───────────────────────────────────────────────────────────── const systems = [ { num: 1, name: "Integumentary System", color: "1B4F72", organs: "Skin (epidermis, dermis, hypodermis), hair, nails, sweat glands, sebaceous glands", functions: [ "Protection against pathogens, UV radiation, and physical trauma", "Thermoregulation via sweat glands and blood vessel dilation/constriction", "Sensation: touch, pain, pressure, and temperature via sensory nerve endings", "Vitamin D synthesis when skin is exposed to UV light", "Waterproofing the body via keratin protein in skin cells", ], icd10: "L-codes (skin/subcutaneous disorders), S-codes (injuries)", keyTerms: "Dermatitis, cellulitis, pressure ulcer (L89.xx), melanoma, wound debridement, burns", cpt: "Wound repair (12001–13160), skin biopsy (11100–11101), destruction of lesions (17000+)", tip: "Pressure ulcers (L89.xx) are staged 1–4 + unstageable + deep tissue. Burns require degree, site, and TBSA (Rule of Nines). Wound laterality and anatomical site affect code selection.", }, { num: 2, name: "Skeletal System", color: "212F3D", organs: "206 bones, cartilage, tendons, ligaments; synovial, fibrous, and cartilaginous joints", functions: [ "Structural support and body framework", "Protection of vital organs: brain (skull), heart/lungs (rib cage), spinal cord (vertebrae)", "Movement: bones act as levers for muscle attachment", "Hematopoiesis: blood cell production in red bone marrow", "Mineral storage: calcium and phosphorus reservoir", ], icd10: "M-codes (musculoskeletal disorders), S-codes (fractures and injuries)", keyTerms: "Fracture (open/closed/displaced/nondisplaced), osteoporosis, osteoarthritis, dislocation, scoliosis", cpt: "Fracture care (open vs. closed reduction), joint arthroplasty (27447 TKA), bone biopsy (20220+)", tip: "Fracture coding requires: bone, laterality, open/closed, displaced/nondisplaced, and 7th character encounter type (A=initial, D=subsequent, S=sequela). Osteoporosis fractures (M80.xx) differ from traumatic fractures (S-codes).", }, { num: 3, name: "Muscular System", color: "7B241C", organs: "700+ skeletal muscles (voluntary), cardiac muscle (heart), smooth muscle (organs and vessel walls)", functions: [ "Voluntary movement (skeletal) and involuntary movement (smooth/cardiac)", "Posture maintenance and joint stabilization", "Heat production: muscle contractions generate ~85% of body heat", "Sphincter control at bladder, stomach, and digestive tract openings", "Facial expressions, breathing (diaphragm and intercostal muscles)", ], icd10: "M60–M79 (soft tissue/muscle disorders), G71–G72 (myopathies)", keyTerms: "Muscle strain, myositis, fibromyalgia (M79.3), tendinitis, muscle spasm, atrophy, rhabdomyolysis", cpt: "Muscle and tendon repair, trigger point injections (20552–20553), fasciotomy", tip: "Sprain = ligament injury (S43.xx, S53.xx); Strain = muscle/tendon injury (S46.xx, S56.xx). Never confuse them. Fibromyalgia (M79.3) is a clinical diagnosis with no objective confirmatory test.", }, { num: 4, name: "Nervous System", color: "154360", organs: "CNS: Brain (cerebrum, cerebellum, brainstem) + Spinal cord | PNS: 12 cranial nerves, 31 spinal nerve pairs, ganglia, sensory receptors", functions: [ "Sensory input: detects and receives signals from internal and external environments", "Integration: processes and interprets information (brain and spinal cord)", "Motor output: sends commands to muscles and glands", "Autonomic nervous system (ANS): controls heart rate, digestion, respiration, glandular secretion", "Higher cortical functions: memory, language, cognition, emotion, and consciousness", ], icd10: "G-codes (nervous system disorders), S00–S09 (head injuries), F-codes (mental/behavioral)", keyTerms: "CVA/stroke, TIA, seizure (G40.xx), peripheral neuropathy, Parkinson's (G20), MS (G35), concussion, dementia (G30–G31)", cpt: "EEG (95812–95827), nerve conduction studies (95907+), lumbar puncture (62270), spinal procedures (62xxx, 63xxx)", tip: "Stroke: I63.xx (ischemic) vs. I61.xx (hemorrhagic). Code neurological deficits as additional codes. CVA sequelae use I69.xx — specify exact deficit (hemiplegia, aphasia, dysphagia). In chronic pain, code underlying cause first, then G89.xx.", }, { num: 5, name: "Endocrine System", color: "5B2C6F", organs: "Hypothalamus, pituitary (master gland), thyroid, parathyroid (x4), adrenal glands (cortex/medulla), pancreatic islets of Langerhans, gonads (ovaries/testes), pineal gland", functions: [ "Hormone production and secretion (chemical messengers traveling via bloodstream)", "Regulation of metabolism, growth, and development", "Blood glucose control: insulin (lowers) and glucagon (raises) from pancreatic islets", "Stress response: cortisol and epinephrine from adrenal glands", "Regulation of reproductive cycles and circadian rhythm (melatonin from pineal gland)", ], icd10: "E-codes (endocrine and metabolic disorders), E10 (Type 1 DM), E11 (Type 2 DM)", keyTerms: "Hypothyroidism (E03.9), hyperthyroidism (E05.xx), Cushing's syndrome (E24.xx), Addison's disease (E27.1), SIADH, DM complications", cpt: "Thyroid ultrasound and biopsy, adrenal procedures, glucose tolerance test (82951), HbA1c (83036)", tip: "Diabetes: E10 (Type 1), E11 (Type 2), E13 (other). Add characters for complications: E11.65 = T2DM with hyperglycemia. NEVER assume Type 2 — query provider. Thyroid codes (E00–E07) require hypo vs. hyperthyroid specificity.", }, { num: 6, name: "Cardiovascular System", color: "922B21", organs: "Heart (4 chambers: RA, RV, LA, LV; 4 valves: tricuspid, pulmonary, mitral, aortic), arteries, veins, capillaries (~100,000 km of vessels total)", functions: [ "Pumps oxygenated blood to all body tissues via systemic circulation", "Returns deoxygenated blood to lungs for gas exchange via pulmonary circulation", "Transports nutrients, hormones, immune cells, and metabolic waste", "Thermoregulation through adjustment of peripheral blood flow", "Hemostasis: platelet and clotting factor delivery to sites of injury", ], icd10: "I-codes: I10 (HTN), I21–I22 (AMI), I25 (CAD), I48 (a-fib), I50 (heart failure), I63 (ischemic stroke)", keyTerms: "Hypertension, CAD, angina, MI (STEMI/NSTEMI), CHF, arrhythmia, DVT (I82.xx), PE (I26.xx), atherosclerosis", cpt: "Cardiac catheterization (93454+), CABG (33510+), PCI/stent (92928+), echocardiogram (93306), Holter monitor (93224)", tip: "HTN coding: I10 (alone); I11.xx (+ heart disease); I12.xx (+ CKD); I13.xx (both). AMI: I21.xx initial, I22.xx subsequent (within 4 weeks). CHF: I50.2 (systolic), I50.3 (diastolic), I50.4 (combined) — always add acuity (acute/chronic/acute-on-chronic).", }, { num: 7, name: "Lymphatic & Immune System", color: "1E8449", organs: "Lymph nodes, lymph capillaries and vessels, thoracic duct, spleen, thymus, tonsils (palatine/lingual/pharyngeal), bone marrow, MALT (gut-associated lymphoid tissue)", functions: [ "Returns excess interstitial fluid (lymph) to the bloodstream via lymph capillaries", "Filters pathogens and foreign particles through lymph node macrophages", "Adaptive immunity: B lymphocytes (humoral/antibody-mediated) and T lymphocytes (cell-mediated)", "Lipid absorption from the digestive tract via lacteals in the small intestine", "Removes cellular debris, abnormal cells, and maintains fluid homeostasis", ], icd10: "C81–C96 (lymphoma/leukemia), D80–D89 (immune disorders), B20 (AIDS), Z21 (asymptomatic HIV)", keyTerms: "Lymphedema (I89.0), HIV/AIDS, systemic lupus erythematosus (M32), rheumatoid arthritis (M05–M06), anaphylaxis (T78.2), Hodgkin/non-Hodgkin lymphoma", cpt: "Lymph node biopsy (38500), lymphadenectomy (38700+), immunotherapy administration, allergy testing", tip: "HIV vs AIDS: B20 = AIDS (patient has AIDS-defining illness); Z21 = asymptomatic HIV+. Never use B20 for asymptomatic HIV. Autoimmune diseases: always code systems affected as additional codes. Excludes1 vs. Excludes2 notes are common here.", }, { num: 8, name: "Respiratory System", color: "117A65", organs: "Upper: nose/nasal cavity, pharynx, larynx | Lower: trachea, bronchi, bronchioles, alveoli (gas exchange units), lungs (lobes: 3 right, 2 left), diaphragm, pleural membranes", functions: [ "Gas exchange: O₂ intake and CO₂ elimination at the alveolar-capillary membrane", "Ventilation: mechanical breathing — inspiration (active) and expiration (passive at rest)", "Acid-base balance: adjusts CO₂ levels to regulate blood pH (respiratory buffer)", "Phonation: voice production via vibration of vocal cords in the larynx", "Filters, warms, and humidifies inspired air via mucus and cilia", ], icd10: "J-codes: J18 (pneumonia), J44 (COPD), J45 (asthma), J96 (respiratory failure), J81 (pulmonary edema)", keyTerms: "COPD (J44.xx), asthma (J45.xx), pneumonia (J18.xx), pleural effusion (J90), PE (I26.xx), COVID-19 (U07.1), bronchiectasis", cpt: "Bronchoscopy (31622–31651), spirometry (94010), intubation (31500), thoracentesis (32554), chest tube (32551)", tip: "COPD exacerbation: J44.1. Code the infectious agent additionally if infection is present. Asthma: J45.xx — code severity (intermittent/mild/moderate/severe persistent) + acute exacerbation. Pneumonia: code specific organism when known (J15.xx) rather than J18.9.", }, { num: 9, name: "Digestive System", color: "784212", organs: "Oral cavity, pharynx, esophagus, stomach (cardia/fundus/body/pylorus), small intestine (duodenum/jejunum/ileum), large intestine (cecum/colon/rectum), anus | Accessory: liver, gallbladder, pancreas (exocrine + endocrine)", functions: [ "Ingestion and mechanical digestion: chewing (mastication) and peristalsis", "Chemical digestion: salivary amylase, gastric pepsin, pancreatic lipase/protease", "Nutrient absorption: primarily in the small intestine (brush border enzymes, villi, microvilli)", "Water absorption and waste (feces) formation in the large intestine", "Liver: bile production, detoxification, lipid metabolism, glycogen storage, plasma protein synthesis", ], icd10: "K-codes: K21 (GERD), K25–K28 (peptic ulcers), K50–K51 (IBD), K70 (alcoholic liver disease), K80 (cholelithiasis)", keyTerms: "Crohn's disease (K50.xx), ulcerative colitis (K51.xx), cirrhosis (K74.60), cholecystitis, appendicitis (K37), GERD, hernia types", cpt: "Colonoscopy (45378+), cholecystectomy (47562 lap / 47600 open), EGD (43239), hernia repair (49505+), liver biopsy (47000)", tip: "Colonoscopy: 45378 (diagnostic), 45380 (biopsy), 45385 (polypectomy) — always code the HIGHEST level of service performed. Hernia: specify type, laterality, and reducible vs. incarcerated vs. strangulated. Cirrhosis (K74.60): add alcohol use/abuse/dependence if applicable.", }, { num: 10, name: "Urinary System", color: "154360", organs: "2 Kidneys (cortex/medulla/pelvis), 2 ureters, urinary bladder (detrusor muscle), urethra | Functional unit: nephron (~1 million per kidney) — glomerulus + tubules", functions: [ "Filtration of blood and excretion of metabolic waste: urea, creatinine, uric acid", "Fluid and electrolyte balance: regulates Na⁺, K⁺, Cl⁻, Ca²⁺ levels", "Acid-base regulation: reabsorbs bicarbonate, secretes H⁺ and NH₄⁺", "Blood pressure control via RAAS (renin-angiotensin-aldosterone system)", "Erythropoietin (EPO) production to stimulate RBC synthesis in bone marrow", ], icd10: "N-codes: N17 (AKI), N18.1–N18.6 (CKD stages 1–5/ESRD), N20 (urolithiasis), N30 (cystitis), N39.0 (UTI)", keyTerms: "AKI (N17.xx), CKD stages (N18.1–N18.6), nephrotic syndrome (N04.xx), pyelonephritis (N10/N11), hematuria (R31.xx), BPH", cpt: "Cystoscopy (52000+), urinalysis (81000–81003), dialysis (90935+ hemodialysis), lithotripsy ESWL (50590), renal biopsy (50200)", tip: "CKD: N18.1–N18.5 (stages 1–5), N18.6 (ESRD). Stage must match documented GFR. Always code underlying cause (E11.65 for diabetic nephropathy, I12.xx for hypertensive CKD). Hematuria (R31.xx) is a symptom — do NOT code it separately once a cause is documented.", }, { num: 11, name: "Reproductive System", color: "6C3483", organs: "Male: testes, epididymis, vas deferens, seminal vesicles, prostate gland, urethra, penis | Female: ovaries, fallopian tubes, uterus (fundus/body/cervix), vagina, mammary glands | Gametes: sperm (male) / ova (female)", functions: [ "Gamete production: spermatogenesis (male) and oogenesis (female)", "Hormone production: testosterone (male); estrogen and progesterone (female)", "Fertilization, implantation, and fetal development (female reproductive tract)", "Parturition (childbirth) and lactation via prolactin and oxytocin", "Development of secondary sex characteristics during puberty", ], icd10: "N40–N53 (male genital organs), N60–N98 (female genital organs), O00–O9A (obstetric/pregnancy)", keyTerms: "BPH (N40.xx), prostate cancer (C61), endometriosis (N80.xx), PCOS (E28.2), ectopic pregnancy (O00.xx), preeclampsia (O14.xx), gestational diabetes (O24.4x)", cpt: "Hysterectomy (58150+ abdominal, 58570+ lap), LEEP (57461), prostatectomy (55840+), C-section (59510 global, 59514 surgery only), vaginal delivery (59400 global)", tip: "Obstetric O-codes ALWAYS require a trimester 7th character. Use Z3A.xx for weeks of gestation. Ectopic pregnancy (O00.xx): code the site (tubal/ovarian/abdominal). Postpartum complications extend to 6 weeks after delivery. C-section: 59510 (global), 59514 (surgery only), 59515 (surgery + postpartum care).", }, ]; // ── Helper: section heading row ───────────────────────────────────────────── function sectionHeader(label, bgHex) { return new TableRow({ children: [ new TableCell({ columnSpan: 2, shading: { type: ShadingType.SOLID, color: bgHex, fill: bgHex }, verticalAlign: VerticalAlign.CENTER, margins: { top: 60, bottom: 60, left: 120, right: 120 }, children: [ new Paragraph({ children: [new TextRun({ text: label, bold: true, color: WHITE, size: 20, font: "Calibri" })], alignment: AlignmentType.LEFT, }), ], }), ], }); } // ── Helper: data row ───────────────────────────────────────────────────────── function dataRow(label, value, shade) { return new TableRow({ children: [ new TableCell({ width: { size: 22, type: WidthType.PERCENTAGE }, shading: shade ? { type: ShadingType.SOLID, color: GRAY, fill: GRAY } : undefined, margins: { top: 60, bottom: 60, left: 120, right: 120 }, children: [ new Paragraph({ children: [new TextRun({ text: label, bold: true, size: 18, font: "Calibri", color: "1A5276" })], }), ], }), new TableCell({ width: { size: 78, type: WidthType.PERCENTAGE }, shading: shade ? { type: ShadingType.SOLID, color: GRAY, fill: GRAY } : undefined, margins: { top: 60, bottom: 60, left: 120, right: 120 }, children: [ new Paragraph({ children: [new TextRun({ text: value, size: 18, font: "Calibri", color: "1C2833" })], }), ], }), ], }); } // ── Helper: tip row ────────────────────────────────────────────────────────── function tipRow(text) { return new TableRow({ children: [ new TableCell({ columnSpan: 2, shading: { type: ShadingType.SOLID, color: "FEF9E7", fill: "FEF9E7" }, margins: { top: 80, bottom: 80, left: 140, right: 140 }, children: [ new Paragraph({ children: [ new TextRun({ text: "Interview Tip: ", bold: true, size: 18, font: "Calibri", color: "7D6608" }), new TextRun({ text: text, size: 18, font: "Calibri", color: "1C2833" }), ], }), ], }), ], }); } // ── Helper: bordered table ─────────────────────────────────────────────────── const THIN_BORDER = { style: BorderStyle.SINGLE, size: 4, color: "BFC9CA" }; const TABLE_BORDERS = { top: THIN_BORDER, bottom: THIN_BORDER, left: THIN_BORDER, right: THIN_BORDER, insideHorizontal: THIN_BORDER, insideVertical: THIN_BORDER }; // ── Build document sections ─────────────────────────────────────────────────── const children = []; // TITLE children.push( new Paragraph({ children: [new TextRun({ text: "11 Systems of the Human Body", bold: true, size: 52, font: "Calibri", color: NAVY })], alignment: AlignmentType.CENTER, spacing: { after: 120 }, }), new Paragraph({ children: [new TextRun({ text: "Medical Coding Interview Prep | Anatomy & Physiology Study Notes", size: 26, font: "Calibri", color: "1A5276", italics: true })], alignment: AlignmentType.CENTER, spacing: { after: 80 }, }), new Paragraph({ children: [new TextRun({ text: "Includes: Key Organs • Physiology • ICD-10 Codes • CPT Codes • Interview Tips", size: 20, font: "Calibri", color: "5D6D7E" })], alignment: AlignmentType.CENTER, spacing: { after: 400 }, }), ); // QUICK REFERENCE TABLE OF CONTENTS children.push( new Paragraph({ children: [new TextRun({ text: "Contents", bold: true, size: 28, font: "Calibri", color: NAVY, underline: { type: UnderlineType.SINGLE } })], spacing: { before: 200, after: 160 }, }), ); systems.forEach(sys => { children.push( new Paragraph({ bullet: { level: 0 }, children: [new TextRun({ text: `System ${sys.num}: ${sys.name}`, size: 20, font: "Calibri", color: "1A5276" })], spacing: { after: 60 }, }), ); }); children.push( new Paragraph({ bullet: { level: 0 }, children: [new TextRun({ text: "Top 10 Medical Coding Interview Rules", size: 20, font: "Calibri", color: "1A5276" })], spacing: { after: 60 }, }), ); children.push(new Paragraph({ children: [new PageBreak()], spacing: { after: 0 } })); // SYSTEM CARDS systems.forEach((sys, idx) => { // System heading children.push( new Paragraph({ children: [ new TextRun({ text: `System ${sys.num} `, bold: true, size: 36, font: "Calibri", color: sys.color }), new TextRun({ text: sys.name, bold: true, size: 36, font: "Calibri", color: sys.color }), ], spacing: { before: idx === 0 ? 0 : 400, after: 200 }, border: { bottom: { style: BorderStyle.SINGLE, size: 8, color: sys.color } }, }), ); // Main table const rows = [ sectionHeader("KEY ORGANS & STRUCTURES", sys.color), dataRow("Organs", sys.organs, false), sectionHeader("FUNCTIONS & PHYSIOLOGY", sys.color), ...sys.functions.map((f, i) => dataRow(`${i + 1}.`, f, i % 2 === 1)), sectionHeader("MEDICAL CODING REFERENCE", "1A5276"), dataRow("ICD-10", sys.icd10, false), dataRow("Key Terms", sys.keyTerms, true), dataRow("CPT Codes", sys.cpt, false), tipRow(sys.tip), ]; children.push( new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, borders: TABLE_BORDERS, rows: rows, }), ); // Page break after each system except last if (idx < systems.length - 1) { children.push(new Paragraph({ children: [new PageBreak()], spacing: { after: 0 } })); } }); // TOP 10 CODING RULES PAGE children.push(new Paragraph({ children: [new PageBreak()], spacing: { after: 0 } })); children.push( new Paragraph({ children: [new TextRun({ text: "Top 10 Medical Coding Interview Rules", bold: true, size: 36, font: "Calibri", color: NAVY })], spacing: { before: 0, after: 280 }, border: { bottom: { style: BorderStyle.SINGLE, size: 8, color: GOLD } }, }), ); const rules = [ { rule: "1. Code Order", detail: "Always list the principal/primary diagnosis first. Complications, comorbidities, and secondary diagnoses follow." }, { rule: "2. Highest Specificity", detail: "Always choose the most specific code available. Use all available digits (characters). Unspecified codes are a last resort." }, { rule: "3. Laterality", detail: "Left, right, or bilateral must be specified when available. Never use unspecified laterality when the record documents a side." }, { rule: "4. 7th Character (Trauma)", detail: "A = Initial encounter (active treatment), D = Subsequent encounter (healing/routine care), S = Sequela (late effects)." }, { rule: "5. No Symptom Codes", detail: "Do NOT code signs or symptoms that are integral to an established diagnosis. Code the diagnosis, not the symptom (outpatient rule)." }, { rule: "6. Link Causal Conditions", detail: "ICD-10 has combination codes for causal relationships. Example: Diabetic nephropathy = E11.65 (T2DM with hyperglycemia) + N18.x (CKD stage)." }, { rule: "7. Outpatient vs. Inpatient", detail: "Outpatient: code only confirmed diagnoses. Inpatient: can code 'probable', 'suspected', or 'possible' diagnoses documented at discharge." }, { rule: "8. Obstetric Trimesters", detail: "All O-codes require a trimester character: 1st trimester <14 weeks, 2nd trimester 14–27 weeks, 3rd trimester ≥28 weeks. Use Z3A.xx for gestational age." }, { rule: "9. Excludes Notes", detail: "Excludes1 = NEVER code together (mutually exclusive). Excludes2 = CAN code together if both conditions genuinely coexist and are documented." }, { rule: "10. Query the Provider", detail: "When documentation is ambiguous (DM type unclear, fracture type not specified, etc.) — always query the provider. Do NOT assume or guess." }, ]; rules.forEach((r, i) => { const bg = i % 2 === 0 ? WHITE : GRAY; children.push( new Table({ width: { size: 100, type: WidthType.PERCENTAGE }, borders: TABLE_BORDERS, rows: [ new TableRow({ children: [ new TableCell({ width: { size: 22, type: WidthType.PERCENTAGE }, shading: { type: ShadingType.SOLID, color: NAVY, fill: NAVY }, margins: { top: 80, bottom: 80, left: 140, right: 140 }, verticalAlign: VerticalAlign.CENTER, children: [new Paragraph({ children: [new TextRun({ text: r.rule, bold: true, size: 20, font: "Calibri", color: WHITE })] })], }), new TableCell({ width: { size: 78, type: WidthType.PERCENTAGE }, shading: { type: ShadingType.SOLID, color: bg, fill: bg }, margins: { top: 80, bottom: 80, left: 140, right: 140 }, children: [new Paragraph({ children: [new TextRun({ text: r.detail, size: 19, font: "Calibri", color: "1C2833" })] })], }), ], }), ], }), ); children.push(new Paragraph({ children: [new TextRun({ text: "" })], spacing: { after: 80 } })); }); // ── Footer ──────────────────────────────────────────────────────────────────── const footer = new Footer({ children: [ new Paragraph({ children: [ new TextRun({ text: "11 Systems of the Human Body | Medical Coding Interview Prep | Page ", size: 16, font: "Calibri", color: "888888" }), new TextRun({ children: [PageNumber.CURRENT], size: 16, font: "Calibri", color: "888888" }), new TextRun({ text: " of ", size: 16, font: "Calibri", color: "888888" }), new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 16, font: "Calibri", color: "888888" }), ], alignment: AlignmentType.CENTER, }), ], }); // ── Assemble & write ────────────────────────────────────────────────────────── const doc = new Document({ styles: { default: { document: { run: { font: "Calibri", size: 20 } }, }, }, sections: [{ properties: { page: { margin: { top: 720, bottom: 720, left: 900, right: 900 } } }, footers: { default: footer }, children: children, }], }); Packer.toBuffer(doc).then(buf => { fs.writeFileSync("/home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Study_Notes.docx", buf); console.log("DONE"); }).catch(e => { console.error(e); process.exit(1); }); EOF echo "Script written"

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_Notes.docx && python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Study_Notes.docx 2>&1

Validator has a missing dependency, but the file was generated successfully. Let me do a quick structural sanity check instead:
Running Command

cd /tmp && cp /home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Study_Notes.docx test.zip && unzip -l test.zip | head -20 && pandoc /home/daytona/workspace/body-systems-flashcards/11_Body_Systems_Study_Notes.docx -t plain 2>/dev/null | head -40

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.