And merge both files in 1 Can you put the questions at the end. And also I’ve got an exam I don’t know anything. Explain everything in detail in simple words like you’re teaching it to a very dumb kid

Reading File
Running Command

python -m markitdown /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/Lecture_6_Oncology_DH_26.pptx 2>/dev/null

Running Command

python -m markitdown /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/Lecture_7_Oncology_DH_26.pptx 2>/dev/null

Running Command

cd /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/ && python3 -c " from pptx import Presentation import sys for fname in ['Lecture_6_Oncology_DH_26.pptx', 'Lecture_7_Oncology_DH_26.pptx']: prs = Presentation(fname) print(f'=== {fname} ===') for i, slide in enumerate(prs.slides): print(f'--- Slide {i+1} ---') for shape in slide.shapes: if hasattr(shape, 'text') and shape.text.strip(): print(shape.text.strip()) print() "

Reading File
Running Command

ls /home/daytona/skills/pptx/scripts/ 2>/dev/null || ls /home/daytona/skills/pptx/ 2>/dev/null

Running Command

# Unpack both PPTX files python /home/daytona/skills/pptx/scripts/office/unpack.py /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/Lecture_6_Oncology_DH_26.pptx /home/daytona/workspace/lec6_unpacked/ 2>&1 | tail -5 python /home/daytona/skills/pptx/scripts/office/unpack.py /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/Lecture_7_Oncology_DH_26.pptx /home/daytona/workspace/lec7_unpacked/ 2>&1 | tail -5

Running Command

cd /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/ && unzip -o Lecture_6_Oncology_DH_26.pptx -d /home/daytona/workspace/lec6_raw/ > /dev/null 2>&1 && echo "Lec6 done" && unzip -o Lecture_7_Oncology_DH_26.pptx -d /home/daytona/workspace/lec7_raw/ > /dev/null 2>&1 && echo "Lec7 done"

Running Command

ls -lh /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/

Running Command

cd /tmp && unzip -o /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/Lecture_6_Oncology_DH_26.pptx -d lec6/ > /dev/null 2>&1 && echo "done"

Running Command

cd /tmp && unzip -o /home/daytona/workspace/attachments/bb1deca4-298a-4cf9-814b-e4a4d5e5e042/Lecture_7_Oncology_DH_26.pptx -d lec7/ > /dev/null 2>&1 && echo "done"

Running Command

python3 << 'EOF' import os, re from xml.etree import ElementTree as ET def extract_pptx_text(folder): slides_dir = os.path.join(folder, 'ppt', 'slides') if not os.path.exists(slides_dir): return "No slides dir" slides = sorted([f for f in os.listdir(slides_dir) if f.startswith('slide') and f.endswith('.xml')], key=lambda x: int(re.search(r'\d+', x).group())) ns = {'a': 'http://schemas.openxmlformats.org/drawingml/2006/main', 'p': 'http://schemas.openxmlformats.org/presentationml/2006/main', 'r': 'http://schemas.openxmlformats.org/officeDocument/2006/relationships'} result = [] for slide_file in slides: path = os.path.join(slides_dir, slide_file) tree = ET.parse(path) root = tree.getroot() slide_num = re.search(r'\d+', slide_file).group() texts = [] for elem in root.iter('{http://schemas.openxmlformats.org/drawingml/2006/main}t'): t = elem.text if t and t.strip(): texts.append(t.strip()) if texts: result.append(f"=== SLIDE {slide_num} ===") result.append('\n'.join(texts)) return '\n'.join(result) lec6 = extract_pptx_text('/tmp/lec6') lec7 = extract_pptx_text('/tmp/lec7') with open('/tmp/lec6_content.txt', 'w') as f: f.write(lec6) with open('/tmp/lec7_content.txt', 'w') as f: f.write(lec7) print(f"Lec6: {len(lec6)} chars, {lec6.count('=== SLIDE')} slides") print(f"Lec7: {len(lec7)} chars, {lec7.count('=== SLIDE')} slides") print("\n--- LEC6 FIRST 3000 chars ---") print(lec6[:3000]) EOF

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Writing File

~/oncology/build_doc.js

const { Document, Packer, Paragraph, TextRun, HeadingLevel, AlignmentType, PageBreak, BorderStyle, Table, TableRow, TableCell, WidthType, ShadingType } = require('docx');
const fs = require('fs');

// Helper functions
function h1(text) {
  return new Paragraph({
    text,
    heading: HeadingLevel.HEADING_1,
    spacing: { before: 400, after: 200 },
  });
}

function h2(text) {
  return new Paragraph({
    text,
    heading: HeadingLevel.HEADING_2,
    spacing: { before: 300, after: 150 },
  });
}

function h3(text) {
  return new Paragraph({
    text,
    heading: HeadingLevel.HEADING_3,
    spacing: { before: 200, after: 100 },
  });
}

function body(text) {
  return new Paragraph({
    children: [new TextRun({ text, size: 24 })],
    spacing: { before: 80, after: 80 },
  });
}

function bullet(text, level = 0) {
  return new Paragraph({
    children: [new TextRun({ text, size: 24 })],
    bullet: { level },
    spacing: { before: 60, after: 60 },
  });
}

function boldBody(label, text) {
  return new Paragraph({
    children: [
      new TextRun({ text: label, bold: true, size: 24 }),
      new TextRun({ text, size: 24 }),
    ],
    spacing: { before: 80, after: 80 },
  });
}

function pageBreak() {
  return new Paragraph({ children: [new PageBreak()] });
}

function divider() {
  return new Paragraph({
    border: { bottom: { color: '999999', space: 1, style: BorderStyle.SINGLE, size: 6 } },
    spacing: { before: 200, after: 200 },
  });
}

function infoBox(lines) {
  const rows = lines.map(line =>
    new TableRow({
      children: [
        new TableCell({
          children: [new Paragraph({ children: [new TextRun({ text: line, size: 22 })] })],
          shading: { type: ShadingType.CLEAR, color: 'auto', fill: 'EAF4FB' },
          margins: { top: 80, bottom: 80, left: 120, right: 120 },
        }),
      ],
    })
  );
  return new Table({
    rows,
    width: { size: 100, type: WidthType.PERCENTAGE },
    margins: { top: 100, bottom: 100 },
  });
}

function questionBox(num, question, answer) {
  return new Table({
    rows: [
      new TableRow({
        children: [
          new TableCell({
            children: [
              new Paragraph({
                children: [
                  new TextRun({ text: `Q${num}: `, bold: true, size: 24, color: '1F5C8B' }),
                  new TextRun({ text: question, bold: true, size: 24 }),
                ],
              }),
            ],
            shading: { type: ShadingType.CLEAR, color: 'auto', fill: 'D6EAF8' },
            margins: { top: 100, bottom: 100, left: 140, right: 140 },
          }),
        ],
      }),
      new TableRow({
        children: [
          new TableCell({
            children: [
              new Paragraph({
                children: [
                  new TextRun({ text: 'Answer: ', bold: true, size: 22, color: '1A7A4A' }),
                  new TextRun({ text: answer, size: 22 }),
                ],
              }),
            ],
            shading: { type: ShadingType.CLEAR, color: 'auto', fill: 'E9F7EF' },
            margins: { top: 100, bottom: 100, left: 140, right: 140 },
          }),
        ],
      }),
    ],
    width: { size: 100, type: WidthType.PERCENTAGE },
    margins: { top: 120, bottom: 120 },
  });
}

// =====================================================================
// DOCUMENT CONTENT
// =====================================================================

const children = [

  // ===== COVER PAGE =====
  new Paragraph({
    children: [new TextRun({ text: 'ONCOLOGY STUDY GUIDE', bold: true, size: 52, color: '1F5C8B' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 2000, after: 200 },
  }),
  new Paragraph({
    children: [new TextRun({ text: 'Lectures 6 & 7 — Merged & Explained Simply', size: 30, color: '444444' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 100, after: 200 },
  }),
  new Paragraph({
    children: [new TextRun({ text: 'Lecture 6: Lung Cancers  |  Lecture 7: CNS Cancers', size: 26, italics: true, color: '666666' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 100, after: 100 },
  }),
  new Paragraph({
    children: [new TextRun({ text: 'Daron Hakimian, M.Sc. Synthetic Biotechnology', size: 22, color: '888888' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 100, after: 3000 },
  }),

  pageBreak(),

  // =====================================================================
  // PART 1: LUNG CANCERS
  // =====================================================================
  new Paragraph({
    children: [new TextRun({ text: 'PART 1: LUNG CANCERS', bold: true, size: 44, color: '1F5C8B' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 400, after: 300 },
  }),

  // --- Overview ---
  h1('1. What Is Lung Cancer? — The Big Picture'),
  body('Lung cancer is the NUMBER ONE cancer killer worldwide, causing about 1.8 MILLION deaths per year. That is more than breast, prostate, and colon cancer combined.'),
  body('Think of it this way: your lungs are like two big sponges that bring oxygen into your blood. The cells lining the airways and air sacs can get damaged (mainly by cigarette smoke) and start growing out of control. That is cancer.'),

  h2('Risk Factors — What Causes It?'),
  bullet('Smoking — by far the biggest risk factor. Cigarette smoke contains hundreds of cancer-causing chemicals that directly damage DNA in lung cells.'),
  bullet('Radon gas — a radioactive gas that comes from uranium breaking down underground. It seeps into homes and damages lung cells when you breathe it in.'),
  bullet('Air pollution — fine particles from cars and factories can damage lung tissue over years.'),
  bullet('Hereditary mutations — if close family members had lung cancer, your risk is higher.'),
  bullet('Pre-existing lung diseases — COPD (chronic obstructive pulmonary disease), lung fibrosis, and tuberculosis all increase risk.'),

  divider(),

  // --- Anatomy & Location ---
  h1('2. Anatomy — WHERE in the Lung Does Cancer Start?'),
  body('This is super important because WHERE a cancer starts tells you WHAT TYPE it is. The lung has two main zones:'),

  h2('Central Zone (near the center, around the main airways)'),
  body('Tumors that start here are near the large airways (bronchi). This area is irritated most by cigarette smoke because smoke travels down the center first.'),
  bullet('Small Cell Lung Cancer (SCLC) — starts centrally'),
  bullet('Squamous Cell Carcinoma — also starts centrally'),

  h2('Peripheral Zone (outer edges, near the air sacs)'),
  body('Tumors that start in the outer lung, in the tiny air sacs (alveoli). These are often found by accident on X-rays because they do not cause symptoms early.'),
  bullet('Adenocarcinoma — starts peripherally (most common type!)'),
  bullet('Large Cell Undifferentiated Carcinoma — also peripheral'),

  divider(),

  // --- PD-L1 ---
  h1('3. PD-L1 — The Immune Escape Switch'),
  body('Before we talk about each cancer type, you need to understand PD-L1. Think of it like this:'),
  body('Your immune system has "killer cells" (T-cells) that hunt down cancer. PD-L1 is a protein that cancer cells put on their surface like a FAKE ID that says "Do not kill me, I am a normal cell." The T-cell sees the fake ID and backs off.'),
  body('Drugs called Immune Checkpoint Inhibitors (like Pembrolizumab) can BLOCK this fake ID signal, letting T-cells attack the cancer again.'),
  body('Key points:'),
  bullet('ALL types of lung cancer can put up this PD-L1 fake ID.'),
  bullet('PD-L1 testing is MANDATORY for every single lung cancer patient.'),
  bullet('The higher the PD-L1 expression, the better the cancer responds to immunotherapy drugs.'),

  divider(),

  // --- CLASSIFICATION ---
  h1('4. The Two Big Categories of Lung Cancer'),
  body('Lung cancers are split into two groups based on how aggressive they are:'),
  infoBox([
    '1. NSCLC (Non-Small Cell Lung Cancer) — ~85% of all lung cancers. Grows slower.',
    '   Includes: Adenocarcinoma, Squamous Cell Carcinoma, Large Cell Undifferentiated Carcinoma',
    '',
    '2. SCLC (Small Cell Lung Cancer) — ~15% of lung cancers. Extremely aggressive.',
    '   Almost always linked to smoking. Spreads very fast.',
  ]),

  divider(),

  // --- Adenocarcinoma ---
  h1('5. Adenocarcinoma — The Most Common Type'),
  body('Adenocarcinoma is the MOST COMMON type of lung cancer. It starts in the alveolar epithelial cells — the cells lining your tiny air sacs (alveoli). It is found in the PERIPHERAL (outer) lung.'),
  body('Fun fact: This is also the most common lung cancer in NON-SMOKERS. It is often found as an accidental finding on imaging.'),

  h2('Driver Mutations — The Engines of Adenocarcinoma'),
  body('These are specific gene mutations that tell the cancer cells to keep growing. If you find one, you can often target it with a specific drug. Think of each mutation as a specific "engine" running the cancer — and targeted drugs as the "off switch" for that specific engine.'),
  bullet('EGFR Mutation — most common driver, especially in non-smokers, women, Asian patients. Treated with EGFR tyrosine kinase inhibitors (e.g., Osimertinib/Erlotinib).'),
  bullet('KRAS Mutation — previously "undruggable" but now can be targeted with KRAS G12C inhibitors (e.g., Sotorasib). Note: you CAN drug RAS in lung cancer with these new drugs!'),
  bullet('ALK Fusion — chromosomal rearrangement fusing ALK with another gene. Young, non-smoking patients. Treated with ALK inhibitors (e.g., Alectinib).'),
  bullet('ROS1 / BRAF / MET / RET — less common, but each has targeted drugs.'),

  h2('Treatment for Adenocarcinoma'),
  bullet('If EGFR mutated: EGFR tyrosine kinase inhibitors'),
  bullet('If ALK fused: ALK fusion-targeted inhibitors'),
  bullet('VEGF inhibitors: Block blood vessel formation that feeds the tumor'),
  bullet('Immunotherapy + chemotherapy: If no targetable mutation, use PD-L1/PD-1 inhibitors combined with chemo'),

  h2('Metastatic Pattern — Where Does It Spread?'),
  body('Adenocarcinoma loves to spread to:'),
  bullet('Brain (very common — causes headaches, confusion, neurological symptoms)'),
  bullet('Bone'),
  bullet('Adrenal glands'),
  bullet('Liver'),

  divider(),

  // --- Squamous Cell ---
  h1('6. Squamous Cell Carcinoma — The Smoker\'s Cancer'),
  body('Squamous cell carcinoma starts in the CENTRAL airways (near the main bronchi). It is STRONGLY linked to smoking. Here is what happens step by step:'),
  body('Smoke damages the cells → cells try to protect themselves → squamous metaplasia (cells change shape) → dysplasia (cells start looking abnormal) → carcinoma (full cancer)'),

  h2('Key Feature: Field Cancerization'),
  body('Because smoke is breathed in everywhere, the ENTIRE airway gets exposed. This means when you find one squamous cell cancer, there are often OTHER abnormal areas throughout the airways. This is called "field cancerization."'),

  h2('Key Feature: Keratinization & Necrotic Cavitation'),
  body('Squamous cells normally make keratin (like in your skin). When they become cancerous, they still make keratin. On imaging, you can see a central hollow (necrosis/cavitation) in the tumor — this is a classic sign.'),

  h2('Mutations'),
  body('Unlike adenocarcinoma, squamous cell carcinoma usually does NOT have strong targetable driver mutations. However, it has a HIGH MUTATIONAL BURDEN — meaning lots of random mutations accumulate. This is actually good for immunotherapy!'),
  body('High mutational burden = lots of neoantigens (weird new proteins that the immune system can recognize) = cancer cells look "foreign" = PD-L1 immunotherapy works well.'),
  body('Sometimes driver mutations DO accumulate: EGFR, MET, BRAF — when present, they can also be targeted.'),

  h2('Metastatic Pattern'),
  bullet('Local invasion first (spreads nearby before going far)'),
  bullet('Then: Bone, Liver'),
  bullet('Brain metastases are LESS COMMON compared to adenocarcinoma'),

  divider(),

  // --- Large Cell ---
  h1('7. Large Cell Undifferentiated Carcinoma — The "Junk Drawer" Cancer'),
  body('Large cell carcinoma is basically a diagnosis of EXCLUSION. When a tumor does not fit adenocarcinoma and does not fit squamous cell carcinoma, it gets called "large cell undifferentiated." Think of it as the "junk drawer" — it does not neatly belong anywhere.'),
  body('Why "undifferentiated"? Because the cells are so badly damaged/mutated that they have lost all their normal features:'),
  bullet('No gland formation (not adenocarcinoma)'),
  bullet('No keratinization / intercellular bridges (not squamous)'),
  bullet('Originates from poorly differentiated epithelial precursor cells'),

  h2('Mutations'),
  body('No dominant mutation, but can have:'),
  bullet('TP53 mutations (tumor suppressor gene — breaks the "stop growing" brakes)'),
  bullet('KRAS mutations'),
  bullet('STK11 mutations'),
  bullet('KEAP1 alterations — this one is super important for treatment resistance!'),

  h2('KEAP1/NRF2 Axis — Why This Cancer is Hard to Treat'),
  body('Normally: KEAP1 grabs NRF2 and destroys it. NRF2 stays low. Cells are normal.'),
  body('When KEAP1 is mutated: It cannot grab NRF2 anymore. NRF2 stays permanently ON. NRF2 then activates hundreds of genes that protect the cell from stress, oxidative damage, and drugs. Result: The cancer becomes resistant to almost everything — chemo, targeted drugs, even some immunotherapies. Low survivability.'),

  h2('Metastatic Pattern'),
  body('Same as adenocarcinoma: Brain → Bone → Adrenal glands → Liver'),

  h2('Treatment'),
  bullet('If targetable mutations are present, use them'),
  bullet('If PD-L1 is high, use immune checkpoint inhibitors'),
  bullet('Always combine with chemotherapy'),

  divider(),

  // --- SCLC ---
  h1('8. Small Cell Lung Carcinoma (SCLC) — The Most Dangerous'),
  body('SCLC is a completely different beast. It is extremely aggressive, grows at rocket speed, and by the time most patients are diagnosed, it has already spread everywhere.'),
  body('Key stat: Only about 7% of patients survive 5 years. That is devastatingly low.'),

  h2('Origin'),
  body('SCLC comes from pulmonary neuroendocrine precursor cells — specialized cells in the lung that are connected to the nervous system. This is why SCLC sometimes causes weird PARANEOPLASTIC SYNDROMES (see below).'),

  h2('Key Features'),
  bullet('ALMOST ALWAYS associated with smoking'),
  bullet('Can arise out of a previous lung cancer (transformation)'),
  bullet('Universal mutations: TP53 and RB1 — these are the two "master brake" systems of the cell. When both are broken, the cell divides without any control.'),
  bullet('Very high KI-67 activity — KI-67 is a marker of how fast cells are dividing. Very high = dividing extremely fast.'),

  h2('Paraneoplastic Syndromes — SCLC\'s Sneaky Symptoms'),
  body('Because SCLC comes from neuroendocrine cells, it can secrete hormones and antibodies that attack your OWN body. These are called paraneoplastic syndromes:'),
  bullet('SIADH (Syndrome of Inappropriate ADH secretion): Cancer secretes too much ADH hormone → kidneys retain too much water → sodium levels DROP (hyponatremia). Patient presents with confusion, low sodium. Classic SCLC sign!'),
  bullet('Ectopic ACTH: Cancer secretes ACTH → stimulates adrenal glands → too much cortisol → Cushing\'s syndrome (weight gain, moon face, high blood sugar).'),
  bullet('Lambert-Eaton Syndrome: Cancer makes antibodies that attack nerve-muscle junctions → muscle weakness (especially proximal muscles).'),
  bullet('Cerebellar degeneration: Antibodies attack the cerebellum → balance problems, coordination issues.'),

  h2('Treatment'),
  body('Treatment is always chemotherapy + radiotherapy + immunotherapy COMBINED. However, almost all patients relapse. SCLC almost always develops resistance.'),

  h2('Metastatic Pattern'),
  body('EXTENSIVE early spread!'),
  bullet('Brain'),
  bullet('Liver'),
  bullet('Bone marrow'),

  divider(),

  // --- Clinical Workflow ---
  h1('9. Clinical Workflow — How to Detect and Treat Lung Cancer'),
  body('Here is the step-by-step process for any lung cancer patient. Learn this workflow!'),

  h2('Step 1: Suspicion & Imaging'),
  bullet('Patient presents with symptoms: cough, hemoptysis (coughing blood), bone pain, headache, weight loss, fatigue'),
  bullet('CT scan of chest: Identifies mass, its location (central vs peripheral), and size'),
  bullet('PET scan: Shows metabolic activity — cancer cells "glow" because they eat lots of glucose'),

  h2('Step 2: Tissue Confirmation'),
  bullet('Biopsy — you MUST get a tissue sample to confirm cancer. Without tissue, you cannot definitively diagnose.'),
  bullet('Bronchoscopy: For central tumors — pass a camera down the airways'),
  bullet('CT-guided needle biopsy: For peripheral tumors — stick a needle through the chest wall'),
  bullet('Histopathology: Pathologist looks at cells under microscope — identifies type'),

  h2('Step 3: Staging — How Far Has It Spread?'),
  bullet('Staging determines treatment strategy. Stage I = local, Stage IV = widespread metastases.'),
  bullet('CT of chest, abdomen, pelvis'),
  bullet('Brain MRI (especially important for adenocarcinoma — it loves the brain)'),
  bullet('Bone scan if bone pain'),

  h2('Step 4: Molecular Testing — The "GPS" for Treatment'),
  body('This is modern precision oncology. You test the tumor\'s DNA/proteins to find specific targets:'),
  bullet('EGFR mutation? → Use EGFR TKI'),
  bullet('ALK fusion? → Use ALK inhibitor'),
  bullet('ROS1/BRAF/MET/RET? → Use targeted drugs'),
  bullet('KRAS G12C? → Use KRAS inhibitor (Sotorasib)'),
  bullet('PD-L1 level? → Determines immunotherapy eligibility'),

  h2('Step 5: Treatment'),
  bullet('Surgery: Only in early stages (Stage I-II) for NSCLC. Curative intent.'),
  bullet('Radiotherapy: For locally advanced disease or SCLC'),
  bullet('Systemic therapy: Targeted drugs, immunotherapy, chemotherapy based on molecular profile'),
  bullet('SCLC: Always chemo + radio + immunotherapy'),

  divider(),

  // --- Lecture 6 Case Studies ---
  h1('10. Case Studies — Lecture 6 (Practice Scenarios)'),

  h2('Case 1'),
  infoBox([
    '63-year-old woman, never smoked',
    'Incidental CT finding: 2.1 cm peripheral right upper lobe nodule',
    'No metastases — STAGE I',
    'Histopathology: Adenocarcinoma',
    'Molecular: EGFR+, ALK-, ROS1-, KRAS-, BRAF-, MET-, RET-, PD-L1 ~10%',
  ]),
  body('Analysis: Peripheral location + non-smoker + EGFR+ = classic adenocarcinoma profile. Since Stage I, surgery is the first choice (potentially curative). After surgery, adjuvant EGFR TKI (Osimertinib) is recommended to prevent recurrence. Low PD-L1 (10%) — immunotherapy not the priority here.'),

  h2('Case 2'),
  infoBox([
    '71-year-old man, heavy smoker',
    'Hemoptysis and cough',
    'CT: Central bronchial tumor',
    'Bronchoscopy + histopathology: NSCLC, Squamous Cell Carcinoma',
    'No metastases — STAGE III',
    'Molecular: EGFR-, ALK-, ROS1-, KRAS-, BRAF-, MET-, RET-, PD-L1 ~55%',
  ]),
  body('Analysis: Central location + heavy smoker + squamous = exactly what you expect. No targetable driver mutations. But PD-L1 ~55% is quite high — this patient benefits from immunotherapy (Pembrolizumab). Stage III = not surgical, treat with chemoradiotherapy + immunotherapy.'),

  h2('Case 3'),
  infoBox([
    '45-year-old woman, never smoked',
    'Severe headaches → brain metastases found',
    'Biopsy: Lung adenocarcinoma',
    'Metastases — STAGE IV',
    'Molecular: EGFR-, ALK+, ROS1-, KRAS-, BRAF-, MET-, RET-, PD-L1 ~80%',
  ]),
  body('Analysis: Young, non-smoking woman with brain metastases. ALK+ is the key driver. ALK inhibitors (Alectinib, Lorlatinib) cross the blood-brain barrier well — perfect for brain metastases. Even though PD-L1 is high (80%), ALK+ patients should get ALK inhibitors FIRST (not immunotherapy) because immunotherapy can cause dangerous side effects combined with ALK inhibitors. Lorlatinib is preferred as it has the best brain penetration.'),

  h2('Case 4'),
  infoBox([
    '68-year-old former smoker',
    'Bone pain (ribcage)',
    'CT: Metastases across thorax and lungs',
    'Biopsy: Lung adenocarcinoma',
    'Metastases — STAGE IV',
    'Molecular: EGFR-, ALK-, ROS1-, KRAS+, BRAF-, MET-, RET-, PD-L1 ~5%',
  ]),
  body('Analysis: KRAS+ mutation. Historically "undruggable," but now KRAS G12C inhibitors exist (Sotorasib, Adagrasib). Very low PD-L1 (5%) — immunotherapy alone won\'t work. KRAS inhibitor + chemotherapy is the strategy. Bone pain → bone metastases confirmed by imaging.'),

  h2('Case 5'),
  infoBox([
    '64-year-old heavy smoker',
    'Confusion + Hyponatremia (low sodium)',
    'CT thorax: Large hilar mass (central!)',
    'CT abdomen/brain: Metastases in brain and liver',
    'Biopsy: SCLC',
    'Metastases — STAGE IV',
    'Molecular: All drivers negative, PD-L1 ~15%',
  ]),
  body('Analysis: Heavy smoker + central hilar mass + confusion + hyponatremia = SCLC with SIADH. The cancer is secreting ADH causing sodium to drop. Already Stage IV. Treatment: Chemotherapy (Carboplatin/Etoposide) + Atezolizumab (immunotherapy) + prophylactic brain radiation. Prognosis is poor but treatment can extend life.'),

  pageBreak(),

  // =====================================================================
  // PART 2: CNS CANCERS
  // =====================================================================
  new Paragraph({
    children: [new TextRun({ text: 'PART 2: CNS CANCERS (BRAIN & SPINAL CORD)', bold: true, size: 44, color: '1F5C8B' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 400, after: 300 },
  }),

  // --- CNS Overview ---
  h1('11. CNS Cancers — The Big Picture'),
  body('The CNS (Central Nervous System) includes the brain and spinal cord. Brain tumors are different from most other cancers in a very important way: even a SLOW GROWING brain tumor can be deadly because of WHERE it is. The brain controls everything — movement, speech, breathing, personality.'),

  h2('Key Epidemiology Facts'),
  bullet('Primary CNS tumors are more common in White individuals than Black individuals'),
  bullet('Mortality is higher in men than women'),
  bullet('MOST IMPORTANT: Primary brain tumors RARELY spread to other organs. But they CAN spread to other parts of the brain and down the spinal cord.'),
  bullet('This is the opposite of most cancers: CNS tumors mostly stay in the CNS, but what makes them dangerous is destroying brain tissue locally.'),

  h2('How CNS Tumors Form — The Core Concept'),
  body('Every CNS tumor is a variation of the same fundamental problem: a specific brain cell gets STUCK between dividing and becoming a mature cell.'),
  body('In a normal developing brain, cells divide a lot, then stop and mature into specific cell types (neurons, glia, etc.). Cancer happens when a cell cannot stop dividing. What differs between tumor types is:'),
  bullet('Which cell type got stuck (stem cell? progenitor? mature glia? cells covering the brain?)'),
  bullet('Which molecular pathway was hijacked to keep dividing'),
  bullet('How that change affects behavior (does it invade like a glioma, or push like a meningioma?)'),

  body('This determines:'),
  bullet('Whether the tumor INVADES brain tissue (gliomas — spreads through brain like roots)'),
  bullet('Whether it COMPRESSES brain tissue (meningiomas — pushes the brain like a ball)'),
  bullet('Whether it is therapy-sensitive or resistant'),

  divider(),

  // --- Classification ---
  h1('12. Classification of CNS Tumors'),
  infoBox([
    '1. Diffuse Gliomas (invasive, arise in brain tissue itself)',
    '   a. Glioblastoma (IDH-wildtype) — most aggressive',
    '   b. Astrocytoma (IDH-mutant) — slower growing',
    '   c. Oligodendroglioma (IDH-mutant + 1p/19q co-deletion) — most treatment-sensitive',
    '',
    '2. Non-Invasive Brain Tumors',
    '   a. Meningioma — arises from brain covering (meninges), pushes brain',
    '   b. Medulloblastoma — arises in cerebellum, mainly in children',
  ]),

  divider(),

  // --- Diffuse Gliomas ---
  h1('13. Diffuse Gliomas — The Invasive Brain Cancers'),
  body('Gliomas come from GLIAL CELLS — the support cells of the brain (not neurons). The key word is DIFFUSE. Unlike a solid ball of cancer you could cut out, glioma cells spread like invisible roots through the brain. By the time you find it, it is already everywhere.'),
  body('Surgery is almost impossible to be curative because:'),
  bullet('Glioma cells are naturally migratory (they move around during development)'),
  bullet('By the time of diagnosis, cancer cells have already dispersed throughout brain tissue'),
  bullet('You cannot remove brain tissue indiscriminately without causing devastating neurological damage'),

  divider(),

  // --- Glioblastoma ---
  h1('14. Glioblastoma (GBM) — IDH-Wildtype — The Worst'),
  body('Glioblastoma is the most aggressive primary brain tumor. Median survival is 15 months even with treatment. "IDH-wildtype" means the IDH gene is NOT mutated (important for classification).'),

  h2('The Three Molecular Drivers of GBM'),
  h3('1. Constitutive EGFR Expression → Constant Proliferation'),
  body('Normally, EGFR is a receptor that gets activated when a growth signal arrives, then turns off. In GBM, EGFR is ALWAYS ON — like a stuck gas pedal. Cells divide nonstop without needing a signal.'),

  h3('2. Loss of PTEN → Cells Ignore All Stop Signals'),
  body('PTEN is like the brakes of the cell. It turns off growth signals after they have done their job. When PTEN is lost, the PI3K/AKT pathway is always active. This means cells:'),
  bullet('Ignore hypoxia (low oxygen) — normally triggers cell death, but not here'),
  bullet('Ignore DNA damage — normally triggers repair or death, but not here'),
  bullet('Ignore stress signals — the cell is essentially invulnerable to its environment'),

  h3('3. TERT Activation → Replicative Immortality'),
  body('Normally, every time a cell divides, its telomeres (protective caps at chromosome ends) get shorter. After ~50 divisions, telomeres are gone and the cell dies. TERT is the enzyme that rebuilds telomeres. In GBM, TERT is always active, so cells NEVER reach that death limit — they are immortal.'),

  h2('The Vicious Cycle: Hypoxia and Genomic Instability'),
  body('The tumor grows so fast that it outstrips its blood supply. Parts of the tumor become hypoxic (low oxygen). These hypoxic niches do something dangerous:'),
  bullet('Cells in hypoxic areas divide SLOWER and repair DNA BETTER (more time to fix mistakes)'),
  bullet('This makes them MORE resistant to chemotherapy (chemo works best on fast-dividing cells)'),
  bullet('Hypoxia also causes genetic instability — more random mutations = more chances to evolve resistance'),

  h2('Treatment and Resistance'),
  body('Main chemotherapy: Temozolomide (TMZ) — this drug causes DNA damage in cancer cells. But there is a problem:'),
  bullet('MGMT is an enzyme that REPAIRS the exact type of DNA damage TMZ causes.'),
  bullet('If the MGMT gene is METHYLATED (turned off by epigenetic silencing), the repair enzyme cannot be made, and TMZ works well.'),
  bullet('If MGMT is NOT methylated (active), it fixes all the damage TMZ causes — resistance.'),
  body('MGMT methylation status is therefore a key predictive biomarker for TMZ response.'),

  divider(),

  // --- Astrocytoma ---
  h1('15. Astrocytoma — IDH-Mutant — The Slow Burner'),
  body('Astrocytoma has an IDH MUTATION. This completely changes the tumor\'s behavior compared to GBM.'),

  h2('What Does IDH Mutation Do?'),
  body('IDH (Isocitrate Dehydrogenase) is normally an enzyme in energy metabolism. When mutated, it creates a new molecule called 2-HG (2-hydroxyglutarate).'),
  body('2-HG is what we call an "oncometabolite" — a metabolic product that drives cancer. Here is how:'),
  bullet('2-HG interferes with enzymes that regulate DNA methylation (TET enzymes and histone demethylases)'),
  bullet('This causes "epigenetic locking" — certain genes get abnormally silenced'),
  bullet('The cell cannot fully differentiate (mature) and stays in a progenitor-like state'),
  bullet('It keeps dividing slowly and persistently'),

  h2('Why Is IDH-Mutant Better Than IDH-Wildtype?'),
  body('Slower growth because the cells are epigenetically locked in a less aggressive state. They do not have the massive genetic instability of GBM. They have a lower mutational burden, so there are fewer ways to develop resistance. They respond better to treatment (TMZ works well). Patients have better prognosis.'),

  divider(),

  // --- Oligodendroglioma ---
  h1('16. Oligodendroglioma — IDH-Mutant + 1p/19q Co-Deletion'),
  body('Oligodendroglioma comes from oligodendrocytes (cells that make myelin, the insulation around nerve fibers). It has TWO defining molecular features:'),
  bullet('IDH mutation (like astrocytoma) — causes slow growth'),
  bullet('1p/19q co-deletion — loss of parts of chromosomes 1 and 19'),

  h2('Why Does 1p/19q Co-Deletion Matter?'),
  body('The genes lost on chromosomes 1p and 19q include:'),
  bullet('DNA repair genes'),
  bullet('Cell cycle regulation genes'),
  body('Without these genes, the cancer cells cannot properly repair DNA damage caused by chemotherapy. This is actually GOOD for us — drugs like PCV (Procarbazine, CCNU, Vincristine) damage DNA and the cancer cells cannot fix it, so they die.'),
  body('Oligodendroglioma has the BEST prognosis of all diffuse gliomas. Some patients survive 10-15+ years.'),

  divider(),

  // --- Meningioma ---
  h1('17. Meningioma — The Non-Invasive "Pusher"'),
  body('Meningioma arises from ARACHNOID CELLS — part of the meninges (the three-layer covering that wraps around the brain and spinal cord). Crucially, it does NOT arise from brain tissue itself.'),

  h2('Why Is It Less Aggressive?'),
  body('Because it grows OUTSIDE the brain tissue, it COMPRESSES rather than INVADES. It pushes the brain to the side like a ball pressing against a pillow.'),
  body('Molecular mechanism: Loss of NF2 (neurofibromin 2) gene. NF2 normally suppresses cell growth at boundaries — it tells cells "you have reached the edge, stop growing." When NF2 is lost, cells ignore this boundary signal and proliferate locally.'),
  body('Clear borders → surgery is usually curative. The neurosurgeon can often simply remove it completely.'),

  h2('Important Caveat — Check the Spine!'),
  body('Even though meningiomas are generally non-invasive, they CAN spread — specifically along the spinal cord (drop metastases). This is why:'),
  bullet('SPINAL MRI is always necessary after finding a meningioma'),
  bullet('Never assume it is just a brain problem'),

  divider(),

  // --- Medulloblastoma ---
  h1('18. Medulloblastoma — The Childhood Brain Cancer'),
  body('Medulloblastoma is a highly malignant tumor that mainly affects CHILDREN. It arises in the CEREBELLUM (the back/bottom part of the brain that controls balance and coordination).'),

  h2('Key Molecular Feature: SHH Pathway'),
  body('The Sonic Hedgehog (SHH) pathway is a normal developmental pathway that tells cells to divide during embryonic development. It should be turned OFF after development. In medulloblastoma, SHH is stuck ON.'),
  bullet('SHH activation → cells in the cerebellum keep dividing → tumor'),
  bullet('SHH inhibitors (like Vismodegib) can target this'),

  h2('Why Cerebellum?'),
  body('The cerebellum is very active during childhood development. Cells there are dividing rapidly. If the SHH pathway gets stuck on during this active period, you get medulloblastoma.'),

  h2('Symptoms'),
  body('Because it is in the cerebellum and near the 4th ventricle (a space for cerebrospinal fluid):'),
  bullet('Ataxia (balance problems, wobbly walking)'),
  bullet('Vomiting (increased intracranial pressure)'),
  bullet('Headaches in the morning (from lying flat all night increasing pressure)'),

  h2('Treatment'),
  body('Surgery + Radiotherapy + Chemotherapy. Children tolerate radiotherapy less well (it damages the developing brain) so the balance between tumor control and side effects is delicate.'),

  divider(),

  // --- CNS Clinical Workflow ---
  h1('19. Clinical Workflow for CNS Tumors'),

  h2('Step 1: Symptoms & Initial Suspicion'),
  bullet('New-onset seizures (very suspicious for brain tumor)'),
  bullet('Progressive headaches (especially in the morning, or with nausea/vomiting)'),
  bullet('Focal neurological deficits (weakness, speech problems, vision changes)'),
  bullet('Personality/behavior changes'),
  bullet('Confusion or cognitive decline'),

  h2('Step 2: Imaging'),
  bullet('MRI with contrast is the gold standard for brain tumors'),
  bullet('Ring-enhancing lesion with central necrosis → highly suspicious for GBM'),
  bullet('Non-enhancing diffuse lesion → lower grade glioma'),
  bullet('Well-circumscribed dural-based lesion → meningioma'),
  bullet('Midline cerebellar mass in a child → medulloblastoma'),

  h2('Step 3: Biopsy & Molecular Testing'),
  bullet('Stereotactic biopsy (precise needle-guided biopsy into brain)'),
  bullet('Key molecular tests:'),
  bullet('IDH status (IDH1/IDH2 mutation or wildtype) — determines aggressiveness', 1),
  bullet('1p/19q co-deletion — confirms oligodendroglioma', 1),
  bullet('MGMT methylation — predicts TMZ response', 1),
  bullet('SHH pathway activation — relevant for medulloblastoma', 1),

  h2('Step 4: Treatment Planning'),
  bullet('Surgery: For meningioma (curative), for GBM (debulking/reduces tumor burden, not curative), not feasible for diffuse gliomas once widely spread'),
  bullet('Radiotherapy: Standard for GBM, also used in astrocytoma and medulloblastoma'),
  bullet('Chemotherapy: TMZ for GBM/astrocytoma, PCV for oligodendroglioma'),
  bullet('Targeted therapy: SHH inhibitors for medulloblastoma (Vismodegib)'),

  divider(),

  // --- Lecture 7 Case Studies ---
  h1('20. Case Studies — Lecture 7 (Practice Scenarios)'),

  h2('Case 1'),
  infoBox([
    '32-year-old',
    'New-onset focal seizure + mild speech hesitation',
    'MRI: Non-enhancing, diffuse lesion in left frontal lobe',
    'Slow-growing, no necrosis (not aggressive appearance)',
    'Molecular: IDH+, 1p/19q-, MGMT-, SHH-',
  ]),
  body('Analysis: Young adult + IDH-mutant + NO 1p/19q deletion + frontal lobe = Astrocytoma (IDH-mutant). Non-enhancing means it is not aggressively invading with new blood vessels. IDH mutation + slow growth = better prognosis. MGMT negative means TMZ may have limited effect, but radiotherapy + TMZ is still standard. Speech area involvement (left frontal) requires careful surgical planning.'),

  h2('Case 2'),
  infoBox([
    '68-year-old',
    'Progressive headache, confusion, right-sided weakness',
    'MRI: Ring-enhancing lesion with necrosis',
    'Molecular: IDH-, 1p/19q-, MGMT+, SHH-',
  ]),
  body('Analysis: Older adult + IDH-wildtype + ring-enhancing lesion with necrosis = GLIOBLASTOMA (GBM). This is the classic GBM presentation. MGMT+ (methylated) = good news! This means TMZ will actually work because the repair enzyme is silenced. Treatment: maximal surgical resection + Temozolomide + Radiotherapy. Despite MGMT+ being favorable, prognosis is still poor (median ~15-18 months with MGMT methylation vs ~12 months without).'),

  h2('Case 3'),
  infoBox([
    '45-year-old',
    'Seizures, otherwise neurologically intact',
    'MRI: Frontal lobe lesion, partially calcified',
    'Molecular: IDH+, 1p/19q+, MGMT-, SHH-',
  ]),
  body('Analysis: IDH+ + 1p/19q co-deletion = OLIGODENDROGLIOMA. Calcification on imaging is a classic finding for oligodendroglioma. The 1p/19q co-deletion means DNA repair is impaired → PCV chemotherapy will kill the cells effectively. Best prognosis of all gliomas. Often survives 10-15 years.'),

  h2('Case 4'),
  infoBox([
    '7-year-old child',
    'Ataxia (balance problems) + Vomiting (increased intracranial pressure)',
    'MRI: Midline cerebellar mass',
    'Molecular: IDH-, 1p/19q-, MGMT-, SHH+',
  ]),
  body('Analysis: Child + cerebellar + SHH+ = MEDULLOBLASTOMA. The SHH pathway is the key driver. Ataxia is from cerebellar damage. Vomiting is from increased intracranial pressure (tumor blocks cerebrospinal fluid drainage). Treatment: Surgery + radiotherapy + chemotherapy. SHH inhibitors (Vismodegib) can be added for SHH-subtype.'),

  h2('Case 5'),
  infoBox([
    '60-year-old',
    'Mild headaches, tumor found incidentally',
    'MRI: Well-circumscribed, dural-based lesion',
    'Molecular: IDH-, 1p/19q-, MGMT-, SHH-',
  ]),
  body('Analysis: All molecular markers negative + dural-based + well-circumscribed + incidental finding + older patient = MENINGIOMA. The dural-based location (on the brain\'s covering, not inside brain tissue) is the key clue. All glioma markers are negative. Treatment: Often just observation if small and asymptomatic. Surgery if growing or causing symptoms. Remember: also get a SPINAL MRI to check for drop metastases!'),

  pageBreak(),

  // =====================================================================
  // PART 3: SUMMARY TABLE
  // =====================================================================
  new Paragraph({
    children: [new TextRun({ text: 'PART 3: QUICK REFERENCE SUMMARY', bold: true, size: 44, color: '1F5C8B' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 400, after: 300 },
  }),

  h1('21. Lung Cancer Summary Table'),
  infoBox([
    'ADENOCARCINOMA: Peripheral | Non-smokers/smokers | EGFR/ALK/KRAS drivers | Targeted therapy + immunotherapy | Spreads to brain, bone, adrenal, liver',
    '',
    'SQUAMOUS CELL: Central | Smokers | Few targetable mutations | High TMB → Immunotherapy | Spreads locally, bone, liver (less brain)',
    '',
    'LARGE CELL: Peripheral | Smokers | KEAP1/NRF2 resistance | Chemo + immunotherapy | Same as adenocarcinoma',
    '',
    'SCLC: Central | Always smokers | TP53+RB1 | Chemo + radio + immunotherapy | Brain + liver + bone marrow. Paraneoplastics.',
  ]),

  h1('22. CNS Tumor Summary Table'),
  infoBox([
    'GLIOBLASTOMA: IDH-wildtype | Ring-enhancing+necrosis | EGFR/PTEN/TERT | TMZ+Radio | Worst prognosis ~15mo',
    '',
    'ASTROCYTOMA: IDH-mutant | Non-enhancing diffuse | 2-HG epigenetic locking | TMZ+Radio | Better prognosis',
    '',
    'OLIGODENDROGLIOMA: IDH-mutant + 1p/19q del | Calcified frontal | DNA repair loss | PCV chemo | Best prognosis',
    '',
    'MENINGIOMA: NF2 loss | Dural-based well-circumscribed | Compresses brain | Surgery curative | Need spine MRI',
    '',
    'MEDULLOBLASTOMA: SHH+ | Midline cerebellum in child | SHH pathway ON | Surgery+Radio+Chemo | Check spine for spread',
  ]),

  pageBreak(),

  // =====================================================================
  // PART 4: QUESTIONS
  // =====================================================================
  new Paragraph({
    children: [new TextRun({ text: 'PART 4: EXAM QUESTIONS', bold: true, size: 44, color: '1F5C8B' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 400, after: 300 },
  }),
  new Paragraph({
    children: [new TextRun({ text: 'All questions from Lecture 6 (Lung Cancer) and Lecture 7 (CNS Cancer) recaps, plus additional exam-style questions with answers.', size: 22, italics: true, color: '555555' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 100, after: 400 },
  }),

  h2('Section A — Lecture 6 Recap Questions (Lung Cancer)'),
  new Paragraph({ spacing: { before: 100, after: 100 } }),

  questionBox(1,
    'What is the highest risk factor for lung cancer?',
    'Smoking. Cigarette smoke contains hundreds of carcinogens that directly damage DNA in lung epithelial cells, particularly causing mutations in TP53, KRAS, and other oncogenes/tumor suppressors.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(2,
    'Which two major classifications are done in lung cancers?',
    'Non-Small Cell Lung Cancer (NSCLC, ~85%) and Small Cell Lung Cancer (SCLC, ~15%). NSCLC is further divided into adenocarcinoma, squamous cell carcinoma, and large cell undifferentiated carcinoma.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(3,
    'Which location is associated with which subtype of lung cancer?',
    'Central location: SCLC and Squamous Cell Carcinoma. Peripheral location: Adenocarcinoma and Large Cell Undifferentiated Carcinoma.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(4,
    'Which type of lung cancer is the most frequent?',
    'Adenocarcinoma — it is the most common subtype of NSCLC and the most common lung cancer overall, accounting for about 40% of all lung cancers.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(5,
    'Why can you drug RAS in lung cancer?',
    'Historically, RAS (KRAS) was considered "undruggable" because its surface had no good binding pocket for drugs. However, the KRAS G12C mutation creates a new binding pocket. KRAS G12C-specific inhibitors (Sotorasib, Adagrasib) can now covalently bind this mutant form and lock it in its inactive state.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(6,
    'Which molecular testing is done in all lung cancers?',
    'PD-L1 testing is mandatory for ALL lung cancer subtypes. Additionally, for NSCLC: full molecular panel including EGFR, ALK, ROS1, KRAS, BRAF, MET, RET mutations/fusions. For SCLC: PD-L1 still tested but there are typically no targetable driver mutations (universal TP53 and RB1 mutations).'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(7,
    'What are the metastatic patterns of each lung cancer type?',
    'Adenocarcinoma: Brain → Bone → Adrenal glands → Liver. | Squamous Cell: Local invasion first → Bone → Liver (brain less common). | Large Cell: Similar to adenocarcinoma (Brain → Bone → Adrenal glands → Liver). | SCLC: Extensive early spread → Brain → Liver → Bone marrow.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(8,
    'Explain the general workflow to detect and treat Lung Cancer.',
    '1. Symptoms/screening → CT chest imaging. 2. Biopsy (bronchoscopy for central, CT-guided needle for peripheral) + histopathology for type. 3. Staging (CT chest/abdomen/pelvis + brain MRI for adenocarcinoma). 4. Molecular testing (EGFR, ALK, ROS1, KRAS, BRAF, MET, RET, PD-L1). 5. Treatment: Surgery (early NSCLC), Targeted therapy (if driver mutation), Immunotherapy (if PD-L1 high), Chemotherapy + radiotherapy (SCLC always).'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(9,
    'CASE: 45-year-old woman, never smoked, brain metastases, lung adenocarcinoma, EGFR-, ALK+, PD-L1 ~80%. What is the treatment?',
    'ALK+ is the dominant driver. Treatment: ALK inhibitor (Lorlatinib preferred for brain metastases due to excellent CNS penetration, or Alectinib). Despite high PD-L1 (80%), do NOT give immunotherapy first — combining immunotherapy with ALK inhibitors can cause dangerous pneumonitis. ALK inhibitor is the priority.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(10,
    'CASE: 64-year-old heavy smoker, confusion + hyponatremia, large hilar mass, SCLC, Stage IV. What syndrome is this and what is the treatment?',
    'SIADH (Syndrome of Inappropriate ADH secretion) — a paraneoplastic syndrome. SCLC secretes ADH, causing water retention and dilutional hyponatremia (low sodium). Treatment: Chemotherapy (Carboplatin + Etoposide) + Immunotherapy (Atezolizumab) + Prophylactic cranial irradiation to prevent brain metastases.'
  ),
  new Paragraph({ spacing: { before: 240, after: 240 } }),

  h2('Section B — Lecture 7 Recap Questions (CNS Cancers)'),
  new Paragraph({ spacing: { before: 100, after: 100 } }),

  questionBox(11,
    'What is the highest risk factor for lung cancer? (Lecture 7 Recap 1)',
    'Smoking is the highest risk factor for lung cancer overall.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(12,
    'Which molecular testing is done in all CNS tumors?',
    'IDH status (IDH1/IDH2 mutation or wildtype) — the single most important classifier. Also: 1p/19q co-deletion status, MGMT methylation status, and SHH pathway activation (for posterior fossa tumors in children).'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(13,
    'What are the metastatic patterns in CNS tumors?',
    'Primary CNS tumors RARELY spread outside the CNS to other organs. However, they can spread to other parts of the brain and DOWN the spinal cord (called "drop metastases" or leptomeningeal spread). This is why spinal MRI is important. Medulloblastoma is especially known for spinal seeding.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(14,
    'Explain the general workflow to detect and treat CNS cancer.',
    '1. Symptoms (seizures, headaches, focal deficits, personality change). 2. MRI with contrast (gold standard — look for ring-enhancement, necrosis, location, borders). 3. Stereotactic biopsy + molecular testing (IDH, 1p/19q, MGMT, SHH). 4. Treatment based on type: Surgery (meningioma/debulking GBM), Radiotherapy (GBM, astrocytoma, medulloblastoma), Chemotherapy (TMZ for GBM/astrocytoma, PCV for oligodendroglioma), Targeted (SHH inhibitors for medulloblastoma).'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(15,
    'CASE: 32-year-old with focal seizure, IDH+, 1p/19q-, left frontal diffuse non-enhancing lesion. Diagnosis and treatment?',
    'Astrocytoma (IDH-mutant). The IDH mutation without 1p/19q co-deletion = astrocytoma (not oligodendroglioma). Non-enhancing + diffuse confirms lower-grade glial tumor. Treatment: Maximal safe surgical resection (careful due to speech area) + Radiotherapy + Temozolomide. Better prognosis than GBM.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(16,
    'CASE: 68-year-old with ring-enhancing lesion + necrosis, IDH-, MGMT+. Diagnosis and what does MGMT+ mean for treatment?',
    'Glioblastoma (IDH-wildtype). MGMT+ means the MGMT gene is methylated (epigenetically silenced). The MGMT enzyme repairs the DNA damage caused by Temozolomide. Since MGMT is silenced, the enzyme is not made → TMZ-induced DNA damage cannot be repaired → cancer cells die. MGMT methylation is a POSITIVE prognostic/predictive marker — these patients respond better to TMZ.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(17,
    'CASE: 45-year-old with seizures, frontal lobe lesion with calcification, IDH+, 1p/19q+. Diagnosis and treatment?',
    'Oligodendroglioma. IDH+ + 1p/19q co-deletion = oligodendroglioma by definition. Calcification on imaging is a classic feature. The 1p/19q co-deletion removes DNA repair genes → PCV chemotherapy (Procarbazine, CCNU, Vincristine) causes lethal DNA damage. Best prognosis of all gliomas — often 10-15+ year survival.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(18,
    'CASE: 7-year-old with ataxia, vomiting, midline cerebellar mass, SHH+. Diagnosis and treatment?',
    'Medulloblastoma (SHH subtype). SHH pathway activation in cerebellar cells. Ataxia from cerebellar damage, vomiting from raised intracranial pressure. Treatment: Surgical resection (often curative debulking) + Craniospinal radiotherapy (whole brain and spine — to treat potential drop metastases) + Chemotherapy + SHH inhibitor (Vismodegib).'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(19,
    'CASE: 60-year-old, mild headaches, incidental finding, well-circumscribed dural-based lesion, all markers negative. Diagnosis and what must you always do?',
    'Meningioma. Dural-based + well-circumscribed + all glioma markers negative (IDH-, 1p/19q-, MGMT-, SHH-) = meningioma. Loss of NF2 is the typical driver. If small and asymptomatic → observation. If growing/symptomatic → surgery (usually curative). ALWAYS get a spinal MRI — meningiomas can spread along the spinal cord.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(20,
    'What is the KEAP1/NRF2 axis and why does its mutation matter for lung cancer?',
    'Normally, KEAP1 protein binds NRF2 and marks it for destruction. NRF2 stays low. When KEAP1 is mutated, it cannot capture NRF2. NRF2 accumulates permanently and activates hundreds of cytoprotective genes. Cancer cells become resistant to chemotherapy, targeted drugs, and oxidative stress. This is seen in Large Cell Undifferentiated Carcinoma and makes these tumors very hard to treat.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(21,
    'What paraneoplastic syndromes does SCLC cause and why?',
    'SCLC arises from neuroendocrine cells that can secrete hormones. Syndromes: 1. SIADH — secretes ADH → hyponatremia/confusion. 2. Ectopic ACTH — secretes ACTH → Cushing\'s syndrome (high cortisol). 3. Lambert-Eaton Myasthenic Syndrome — antibodies attack nerve-muscle junctions → proximal muscle weakness. 4. Cerebellar degeneration — anti-neuronal antibodies attack cerebellum → ataxia.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(22,
    'What is field cancerization and in which lung cancer type is it seen?',
    'Field cancerization occurs in Squamous Cell Carcinoma. Because cigarette smoke is inhaled throughout the entire airway, ALL airway cells are exposed to carcinogens simultaneously. This means the entire mucosal field is at risk. When you find one squamous cell tumor, other areas of the airway may already have pre-malignant changes. This is why surveillance of the whole airway is important.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(23,
    'Why is surgery almost impossible for diffuse gliomas?',
    'Glioma cells are intrinsically migratory — they evolved to move during brain development. By the time a diffuse glioma is diagnosed, cancer cells have already spread diffusely throughout the brain parenchyma like invisible roots. You cannot remove enough brain tissue to get a "clear margin" without causing devastating neurological damage. Surgery can debulk (reduce tumor volume) but cannot cure.'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(24,
    'What is the role of IDH mutation in determining glioma prognosis?',
    'IDH mutation is the single most important prognostic marker in gliomas. IDH-mutant tumors (astrocytoma, oligodendroglioma) have better prognosis because: the oncometabolite 2-HG causes epigenetic locking that slows growth, the tumors have lower mutational burden and fewer resistance mechanisms, they respond better to treatment. IDH-wildtype (GBM) has the worst prognosis (~15 months survival).'
  ),
  new Paragraph({ spacing: { before: 120, after: 120 } }),

  questionBox(25,
    'Why does SCLC have such poor prognosis compared to NSCLC?',
    'Several reasons: 1. Universal TP53 + RB1 mutations destroy all cell cycle checkpoints — cells divide uncontrollably. 2. Very high KI-67 = extremely fast proliferation. 3. Extensive early metastatic spread — most patients already have metastases at diagnosis. 4. Neuroendocrine origin allows it to exploit hormonal pathways. 5. Almost universal relapse after initial treatment response. 6. No targetable driver mutations like NSCLC has.'
  ),

  new Paragraph({ spacing: { before: 400, after: 200 } }),
  new Paragraph({
    children: [new TextRun({ text: 'Good luck on your exam! You have got this.', bold: true, size: 28, color: '1F5C8B', italics: true })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 200, after: 200 },
  }),
];

// =====================================================================
// BUILD DOCUMENT
// =====================================================================
const doc = new Document({
  styles: {
    default: {
      heading1: {
        run: { bold: true, color: '1F5C8B', size: 32 },
        paragraph: { spacing: { before: 400, after: 200 } },
      },
      heading2: {
        run: { bold: true, color: '2E86AB', size: 26 },
        paragraph: { spacing: { before: 280, after: 140 } },
      },
      heading3: {
        run: { bold: true, color: '444444', size: 24 },
        paragraph: { spacing: { before: 200, after: 100 } },
      },
    },
  },
  sections: [{ children }],
});

const outDir = '/home/daytona/workspace/oncology/output/';
if (!require('fs').existsSync(outDir)) require('fs').mkdirSync(outDir, { recursive: true });

Packer.toBuffer(doc).then(buffer => {
  const outPath = outDir + 'Oncology_Lectures_6_7_Study_Guide.docx';
  fs.writeFileSync(outPath, buffer);
  console.log('Written to:', outPath);
}).catch(err => { console.error(err); process.exit(1); });
Running Command

cd /home/daytona/workspace/oncology && node build_doc.js 2>&1

Model call limits exceeded: run limit (20/20)
This is a shared conversation. Sign in to Orris to start your own chat.