Teach me Prostate cancer and Robotic Prostatectomy

Reading File
Finding Sources
Finding Sources
Searching PubMed

"robotic prostatectomy"[MeSH Terms] AND "prostate cancer"[MeSH Terms]

Reading File
Reading File
Searching PubMed

"radical prostatectomy" AND "robotic" AND outcomes

Reading File
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Loading Image
Loading Image
Reading File
Reading File
Loading Image
Reading File
Loading Image
Reading File

Prostate Cancer & Robotic Prostatectomy: A Complete Guide


PART 1: PROSTATE CANCER


1. Epidemiology & Risk Factors

Prostate cancer is the most common non-cutaneous malignancy in men in the Western world and the second leading cause of cancer death in men. Key risk factors include:
FactorDetails
AgeRare before 50; incidence rises steeply after 60
RaceAfrican-American men have highest incidence and mortality worldwide
Family history2-3x risk if first-degree relative affected; BRCA2 mutations confer high risk
DietHigh fat, red meat associated with increased risk; lycopene/selenium may be protective
GeographyHigh incidence in North America, Europe; low in Asia (rises with Westernization)
Over 70-80% of newly diagnosed cancers are now clinically organ-confined, largely due to PSA screening. - Harrison's Principles of Internal Medicine 22E, p. 740

2. Anatomy Review

The prostate is a walnut-sized gland at the bladder base surrounding the urethra. It has three zones relevant to cancer:
  • Peripheral zone (~70% of gland): Site of ~70-80% of prostate cancers - palpable on DRE
  • Transition zone (~25%): Site of BPH; ~20% of cancers
  • Central zone (~5%): Rarely affected by cancer
Key adjacent structures during surgery: the rectum (posterior), bladder neck (superior), external urethral sphincter (inferior), and the neurovascular bundles (NVBs) running posterolaterally - the key structures for erectile function preservation.

3. Pathology

Over 95% of prostate cancers are adenocarcinomas arising from the secretory epithelial cells. Key pathological features:
Macroscopic: Hard, grey-white, gritty texture; most arise in posterior peripheral zone.
Microscopic features of malignancy:
  • Small, crowded glands without a basal cell layer
  • Enlarged nuclei with prominent nucleoli (single, large, and central - a hallmark)
  • Dark cytoplasm
  • Perineural invasion (specific feature)
Useful immunohistochemical markers:
  • AMACR (alpha-methylacyl-CoA racemase) - upregulated in cancer (sensitivity 82-100%)
  • p63 / CK5/6 - basal cell markers absent in cancer (benign glands retain basal cells)
Here are histological images showing prostatic adenocarcinoma:
Prostatic adenocarcinoma - small malignant glands (arrows) crowded between larger benign glands, with prominent nucleoli at higher power
Prostatic adenocarcinoma: (A) small malignant glands (arrows) crowded between larger benign glands; (B) higher power showing enlarged nuclei and prominent nucleoli. - Robbins & Cotran Pathologic Basis of Disease
High-Grade PIN (HGPIN): Architecturally benign acini with cytologically atypical cells - found in ~80% of specimens harboring carcinoma. It retains a basal cell layer, unlike frank carcinoma.

4. Gleason Grading & Grade Groups

The Gleason system is the cornerstone of prostate cancer grading. It grades glandular patterns from 1 (most differentiated) to 5 (least differentiated). Because cancers are heterogeneous, the two most prevalent patterns are summed to give a Gleason Score (2-10).
The modern system uses Grade Groups (GG) as a simplified, clinically intuitive framework:
Grade GroupGleason ScoreDescriptionPrognosis
GG 1≤6 (3+3)Well-formed, uniform individual glandsExcellent
GG 27 (3+4)Predominantly well-formed glands + some poorly formedGood
GG 37 (4+3)Predominantly poorly formed glands + some well-formedIntermediate
GG 48 (4+4 or 3+5 or 5+3)Poorly formed / no glands or fusedPoor
GG 59-10No gland formation, sheets, single cellsVery poor
"The Grade Group scheme has been investigated, and its correlation with prostate cancer-specific mortality has been validated." - Campbell-Walsh-Wein Urology
Gleason grading of prostate cancer: (A) Grade Group 1 - well-formed uniform glands (low grade); (C) Grade Group 5 - sheets of malignant cells with no gland formation
Gleason grading: Top (A) = Grade Group 1 (GS 3+3=6), uniform well-formed glands. Bottom (C) = Grade Group 5 (GS 5+5=10), no gland formation, sheets of anaplastic cells. - Robbins & Cotran Pathologic Basis of Disease

5. Clinical Features & Diagnosis

Localized disease is typically asymptomatic. Disease is usually found via:
  1. Elevated or rising serum PSA
  2. Abnormal digital rectal exam (DRE) - hard, nodular, irregular, asymmetric
  3. Incidental finding on TURP specimen (T1a/T1b)
Advanced disease may present with:
  • Obstructive lower urinary tract symptoms
  • Hematuria, hematospermia
  • Bone pain from osteoblastic metastases (spine > pelvis > femur - a "blastic" pattern on plain X-ray and bone scan)
  • Spinal cord compression (oncologic emergency)
  • Elevated ALP, anemia (marrow involvement)

PSA (Prostate-Specific Antigen)

PSA is a kallikrein-related serine protease (KLK3) produced by prostatic epithelium - it is organ-specific but NOT cancer-specific. It can be elevated by:
  • Prostate cancer
  • BPH
  • Prostatitis
  • Prostate manipulation/biopsy (wait 4-6 weeks after DRE to draw PSA)
  • Ejaculation (wait 48 hours)
Key PSA concepts:
ConceptClinical Significance
Total PSA>4 ng/mL commonly triggers biopsy
PSA densityPSA/gland volume; density >0.15 associated with cancer
Free PSA %Lower free PSA % = higher cancer likelihood
PSA velocityRise >0.75 ng/mL/year suspicious
PSA doubling time (PSADT)<3 months = high risk; >14 months = low risk
"A single PSA measured at age 60 is associated (AUC of 0.90) with lifetime risk of death from prostate cancer." - Harrison's, p. 741

Diagnosis: Prostate Biopsy

  • Transrectal ultrasound (TRUS)-guided biopsy or MRI-targeted biopsy (preferred when available)
  • Standard: 12-core systematic biopsy of the peripheral zone
  • MRI-TRUS fusion biopsy detects more clinically significant cancers and avoids overdiagnosis of insignificant disease

Advanced Imaging

ModalityRole
Multiparametric MRI (mpMRI)Best local staging - capsular extension, seminal vesicle invasion, NVB involvement
PSMA PET/CTGold standard for staging and biochemical recurrence; FDA-approved (¹⁸F-piflufolastat, ¹⁸F-DCFPyL)
Bone scan (⁹⁹ᵐTc-MDP)Osteoblastic metastases; being replaced by PSMA PET
CT abdomen/pelvisLymph node assessment in intermediate/high-risk disease

6. Staging (TNM)

T stages of prostate cancer: T1 - clinically inapparent; T2 - confined within prostate; T3 - extends through capsule/seminal vesicles; T4 - fixed or invades adjacent structures
T stages of prostate cancer. 80% of patients present with local disease (T1/T2) - 5-year survival ~100%. 4% present with distant disease - 5-year survival ~30%. - Harrison's Principles of Internal Medicine 22E
StageDescription
T1aIncidental finding, ≤5% of TURP chips
T1bIncidental finding, >5% of TURP chips
T1cFound on needle biopsy (elevated PSA)
T2aInvolves ≤50% of one lobe
T2b>50% of one lobe, not both
T2cBoth lobes involved
T3aExtracapsular extension
T3bSeminal vesicle invasion
T4Invades adjacent structures (bladder, rectum, levator muscles)
N1Regional lymph node metastasis
M1Distant metastasis (M1a = non-regional LN, M1b = bone, M1c = other)
Risk Stratification (D'Amico / NCCN):
RiskPSAGrade GroupT Stage
Very Low<10GG1T1c
Low<10GG1T1-T2a
Intermediate10-20 OR GG2-3 OR T2b-T2c--
High>20 OR GG4-5 OR T3a--
Very HighGG5, T3b-T4, or >4 biopsy cores GG4+--

7. Treatment Overview

Localized Disease

"Patients with clinically localized disease are typically managed by radical prostatectomy, radiation therapy, or active surveillance. There is no clear evidence for the superiority of any one form of local therapy relative to another." - Harrison's, p. 742
ApproachIndication
Active Surveillance (AS)Very low/low risk; defers treatment to avoid overtreatment morbidity
Radical Prostatectomy (RP)Localized disease, good performance status; curative intent
External Beam Radiation (EBRT)Localized/locally advanced; alternative to surgery
BrachytherapyLow-intermediate risk; radioactive seeds implanted
Combined EBRT + ADTIntermediate/high-risk disease

Metastatic / Advanced Disease

  • Androgen Deprivation Therapy (ADT): GnRH agonists (leuprolide, goserelin) or antagonists (degarelix, relugolix) - reduces testosterone to castrate levels (<50 ng/dL)
  • mCSPC (metastatic castration-sensitive): ADT + docetaxel, or ADT + abiraterone/enzalutamide - triplet therapy now standard in high-volume disease
  • mCRPC (metastatic castration-resistant): Enzalutamide, abiraterone, cabazitaxel, PARP inhibitors (olaparib for BRCA mutations), ¹⁷⁷Lu-PSMA-617 (lutetium therapy)
  • Bone-targeted therapy: Denosumab, zoledronic acid, Radium-223 (bone-specific)

PART 2: ROBOTIC PROSTATECTOMY (RARP/RALRP)


8. What is RALRP?

Robot-Assisted Laparoscopic Radical Prostatectomy (RALRP) uses the da Vinci Surgical System to perform minimally invasive removal of the prostate with curative intent. Introduced into urology in 2002, it has rapidly become the dominant surgical approach - today, >85% of radical prostatectomies in the USA are performed robotically.
The da Vinci system provides:
  • 7 degrees of freedom (vs. 4 for laparoscopy)
  • 10-12x 3D magnification
  • Tremor filtration
  • Articulating "Endowrist" instruments that mimic the human wrist

9. Indications & Contraindications

Indications:
  • Clinically localized prostate cancer (T1-T3a)
  • Life expectancy >10 years
  • Fit for general anesthesia and Trendelenburg position
  • Particularly beneficial in patients with previous mesh hernia repair, obesity, or prior abdominal surgery (where open approach is difficult)
Relative contraindications:
  • Extensive prior pelvic surgery with dense adhesions
  • Severe cardiopulmonary compromise (cannot tolerate steep Trendelenburg + pneumoperitoneum)
  • Morbid obesity (though RALRP is often preferred over open in obese patients)
  • Uncorrectable coagulopathy

10. Patient Positioning & OR Setup

Positioning: Steep Trendelenburg (~22-25°) with arms tucked at sides, padded with "egg crate" foam. Sequential compression stockings. The feet may be in stirrups or spread on foot rests.
"Fixed shoulder rests should be avoided because this can result in compression injury to the shoulders and brachial plexus when in the steep Trendelenburg position." - Campbell-Walsh-Wein Urology, p. 4677
Key team requirements: A trained bedside assistant (manages insufflation, passes instruments, suction), scrub tech familiar with robotic instruments, and an anesthesiologist experienced with pneumoperitoneum physiology.
Equipment:
  • da Vinci S/Si/Xi system
  • 0° and 30° robotic cameras
  • Endowrist instruments: Maryland bipolar forceps, curved monopolar scissors, ProGrasp forceps, large needle drivers
  • 12-mm and 8-mm trocars
  • 18-Fr urethral catheter

11. Surgical Approach: Transperitoneal vs. Extraperitoneal

FeatureTransperitonealExtraperitoneal
Working spaceLargerSmaller
Trendelenburg neededYesMay be less steep
Bowel involvementMore risk if adhesionsPeritoneum acts as barrier
Postoperative ileusMore commonLess common (diet quicker)
Operative timeSlightly longerSlightly shorter
Previous mesh hernioplastyPreferredDifficult - space obliterated
Most published series use the transperitoneal anterior approach due to the larger working space.

12. Key Surgical Steps (Transperitoneal Anterior RALRP)

  1. Port placement: 5-6 trocars placed in a fan arrangement (see trocar configuration figure in Campbell-Walsh Ch. 156). Camera port periumbilically.
  2. Pneumoperitoneum: CO₂ to 15 mmHg, steep Trendelenburg.
  3. Bowel mobilization: Sigmoid reflected, space of Retzius developed.
  4. Incision of the endopelvic fascia: Lateral to the prostate bilaterally.
  5. Dorsal venous complex (DVC) ligation: 0-polydioxanone suture around the DVC (Santorini's plexus) to control bleeding.
  6. Bladder neck dissection: Circumferential division of bladder neck, identification of ureteral orifices to avoid injury.
  7. Posterior dissection: Division of seminal vesicles and vas deferens; Denonvilliers' fascia incised.
  8. Neurovascular bundle (NVB) preservation (nerve-sparing technique - see below).
  9. Apical dissection: Division of the urethra at the apex with careful preservation of sphincter length.
  10. Specimen removal: Through a small extension of a port site (laparoscopic bag).
  11. Pelvic lymph node dissection (PLND): Performed in intermediate/high-risk cases; obturator fossa + external iliac nodes.
  12. Vesicourethral anastomosis (VUA): 3-0 Monocryl double-armed suture; a running (Van Velthoven) technique is standard. Watertight anastomosis over 18-Fr catheter.

13. Nerve-Sparing Technique - The Most Critical Step

The neurovascular bundles (NVBs) run posterolaterally along the prostate within the peri-prostatic fascia and are responsible for penile erections. Their preservation determines post-operative erectile function.
Cross-section of prostate showing fascial planes: levator fascia, prostatic fascia, neurovascular bundle position, Denonvilliers fascia, and dissection planes for standard vs. high anterior release of NVB
Cross-section of prostate showing fascial planes and NVB preservation dissection planes. Interfascial (solid line) = standard release; High anterior release (dashed line) = maximizes nerve preservation. - Campbell-Walsh-Wein Urology
Fascial dissection planes (from least to most nerve-sparing):
  • Extrafascial: Between lateral prostatic fascia and levator fascia. Used for locally advanced disease (T3). Maximum cancer control, sacrifices NVB.
  • Interfascial: Between levator fascia and prostatic fascia. Standard nerve-sparing for organ-confined disease.
  • Intrafascial: Directly on prostatic capsule. Maximum nerve preservation for low-risk, smaller prostates.
"The superb visualization of the periprostatic tissues with minimally invasive surgery has led to a greater appreciation of the periprostatic fascial layers." - Campbell-Walsh-Wein Urology, p. 4678
Principles of nerve-sparing:
  • Cold scissors dissection preferred near NVB (avoid thermal energy)
  • Antegrade vs. retrograde NVB release depending on anatomy
  • Hemostasis with bipolar only where necessary
  • "High anterior release" takes the nerve bundle off the anterior prostate surface - maximizes nerve tissue preservation

14. Outcomes of RALRP vs. Open Radical Prostatectomy

A systematic review and meta-analysis (Wang et al., 2023 - PMID 37721644) confirmed that RALRP achieves equivalent oncological outcomes with significant perioperative advantages.
OutcomeRALRPOpen RP
Blood loss~300 mL~1400 mL
Transfusion rate1-2%10-15%
Hospital stay1-2 days3-5 days
Return to activityFasterSlower
Positive surgical marginsEquivalentEquivalent
Cancer control (PSA-free survival)EquivalentEquivalent
Continence recoveryEquivalent at 12 monthsEquivalent at 12 months
Potency recoveryEquivalent (surgeon dependent)Equivalent (surgeon dependent)
"Outcomes are very dependent on the individual surgeon's ability and experience, and outcomes improve when surgery is performed by high-volume surgeons at high-volume centers." - Campbell-Walsh-Wein Urology, p. 4682
A landmark 2024 RCT (Nahas et al., PMID 38723593) confirmed equivalent oncological and functional outcomes between RALRP and open RP in a prospective randomized design, with RALRP favored for blood loss and length of stay.
A 2025 Phase 3 RCT (NeuroSAFE PROOF, Dinneen et al., Lancet Oncology, PMID 40147459) demonstrated that NeuroSAFE-guided RARP - using intraoperative frozen section of the NVB interface - significantly improved erectile function and urinary continence recovery compared to standard RARP.

15. Complications of Robotic Prostatectomy

Intraoperative

ComplicationNotes
BleedingDVC injury; transfusion rare (1-2%)
Rectal injuryRare but serious; recognized = primary repair + omental interposition; unrecognized = recto-vesical fistula, needs colostomy
Ureteral injuryAt bladder neck (post-TURP, large median lobe); ureter passes close to vas; stent if at risk
Robot failureCritical failure rate ~0.4%; conversion to laparoscopic or open

Postoperative

ComplicationNotes
Urinary incontinenceMost common functional complication; 90% continent by 12 months; Kegel exercises help recovery
Erectile dysfunctionRelated to NVB preservation; age and baseline function are key predictors
Anastomotic leakEarly urinary extravasation; catheter left for 7-14 days
DVT/PERisk from Trendelenburg + pneumoperitoneum; sequential compression stockings + early ambulation
Positive surgical margin (PSM)~10-20%; risk increases with extracapsular extension
Biochemical recurrencePSA >0.2 ng/mL after RP; triggers salvage radiation ± ADT

Positioning Complications (unique to steep Trendelenburg)

  • Brachial plexus injury (arms not tucked properly)
  • Radial/ulnar nerve compression
  • Femoral neurapraxia (excessive hip flexion of table)
  • Facial/laryngeal edema (prolonged Trendelenburg)
  • Ocular complications (increased intraocular pressure)
  • Rhabdomyolysis (prolonged compression of compartments)

16. Functional Recovery After RALRP

Urinary continence:
  • Immediate post-catheter removal: variable incontinence
  • 3 months: ~60-70% continent
  • 12 months: ~85-95% continent (no pad or 1 security pad)
  • Predictors of recovery: pre-op continence, sphincter length, preservation of urethra length at apex
Erectile function:
  • Bilateral nerve-sparing + young patient + good baseline function: ~60-80% potency at 12-18 months
  • Unilateral nerve-sparing: ~40-50%
  • Non-nerve-sparing: <10%
  • PDE5 inhibitors (sildenafil, tadalafil) used early as "penile rehabilitation"
PSA monitoring (oncological surveillance):
  • PSA should be undetectable (<0.1 ng/mL) by 6 weeks post-RP
  • Biochemical recurrence defined as PSA ≥0.2 ng/mL (confirmed on repeat)
  • PSADT calculated - guides need for salvage radiation vs. observation

17. Special Procedure: Salvage RALRP

For patients with locally recurrent prostate cancer after primary radiation therapy, salvage RALRP can be offered. This is technically demanding due to radiation-induced fibrosis and tissue planes being obliterated. Complication rates are higher than primary RALRP, but outcomes in well-selected patients with biopsy-proven local recurrence and no distant disease can be favorable. - Hinman's Atlas of Urologic Surgery

Summary Table: Prostate Cancer at a Glance

DomainKey Points
Most common histologyAdenocarcinoma (>95%)
Most common locationPeripheral zone (~70-80%)
Key markerPSA (organ-specific, NOT cancer-specific)
Grading systemGleason score / Grade Groups 1-5
Pathological hallmarkAbsent basal cell layer; prominent nucleoli; AMACR+
Metastasis patternOsteoblastic bone metastases (spine, pelvis)
Local staging modalitympMRI prostate
Systemic stagingPSMA PET/CT (gold standard)
Curative treatmentsSurgery (RALRP), EBRT, Brachytherapy
Hormonal treatmentADT (GnRH agonist/antagonist)
RALRP advantagesLess blood loss, faster recovery, equivalent oncological outcomes
Key RALRP stepNVB preservation (potency); watertight VUA (continence)
Post-RALRP surveillancePSA should be undetectable by 6 weeks

Sources:

Make into a word document

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && ls /home/daytona/skills/docx/

Running Command

mkdir -p /home/daytona/workspace/prostate-cancer-doc && node -e "require('docx')…

Writing File

~/prostate-cancer-doc/build.js

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

// ── helpers ──────────────────────────────────────────────────────────────────

function h1(text) {
  return new Paragraph({ text, heading: HeadingLevel.HEADING_1, spacing: { before: 360, after: 120 } });
}
function h2(text) {
  return new Paragraph({ text, heading: HeadingLevel.HEADING_2, spacing: { before: 280, after: 80 } });
}
function h3(text) {
  return new Paragraph({ text, heading: HeadingLevel.HEADING_3, spacing: { before: 200, after: 60 } });
}
function para(text, opts = {}) {
  return new Paragraph({
    children: [new TextRun({ text, size: 22, ...opts })],
    spacing: { before: 60, after: 60 },
  });
}
function bold(text) {
  return new Paragraph({
    children: [new TextRun({ text, bold: true, size: 22 })],
    spacing: { before: 60, after: 60 },
  });
}
function bullet(text) {
  return new Paragraph({
    children: [new TextRun({ text, size: 22 })],
    bullet: { level: 0 },
    spacing: { before: 40, after: 40 },
  });
}
function subbullet(text) {
  return new Paragraph({
    children: [new TextRun({ text, size: 22 })],
    bullet: { level: 1 },
    spacing: { before: 30, after: 30 },
  });
}
function italic(text) {
  return new Paragraph({
    children: [new TextRun({ text, italics: true, size: 22, color: '555555' })],
    spacing: { before: 40, after: 60 },
  });
}
function divider() {
  return new Paragraph({
    children: [new TextRun({ text: '' })],
    border: { bottom: { color: 'AAAAAA', space: 1, style: BorderStyle.SINGLE, size: 6 } },
    spacing: { before: 120, after: 120 },
  });
}
function pageBreak() {
  return new Paragraph({ children: [new PageBreak()] });
}
function noteText(text) {
  return new Paragraph({
    children: [new TextRun({ text, italics: true, size: 20, color: '444488' })],
    spacing: { before: 40, after: 60 },
    indent: { left: 360 },
    border: { left: { color: '4444AA', space: 10, style: BorderStyle.SINGLE, size: 12 } },
  });
}

// ── table builder ─────────────────────────────────────────────────────────────
function makeTable(headers, rows, colWidths) {
  const HEADER_COLOR = '1F4E79';
  const ALT_COLOR = 'D6E4F0';

  const headerRow = new TableRow({
    tableHeader: true,
    children: headers.map((h, i) =>
      new TableCell({
        children: [new Paragraph({
          children: [new TextRun({ text: h, bold: true, color: 'FFFFFF', size: 20 })],
          alignment: AlignmentType.CENTER,
        })],
        shading: { fill: HEADER_COLOR, type: ShadingType.CLEAR },
        verticalAlign: VerticalAlign.CENTER,
        width: colWidths ? { size: colWidths[i], type: WidthType.PERCENTAGE } : undefined,
      })
    ),
  });

  const dataRows = rows.map((row, ri) =>
    new TableRow({
      children: row.map((cell, ci) =>
        new TableCell({
          children: [new Paragraph({
            children: [new TextRun({ text: cell, size: 20, bold: ci === 0 && row.length > 1 })],
          })],
          shading: ri % 2 === 1 ? { fill: ALT_COLOR, type: ShadingType.CLEAR } : undefined,
          width: colWidths ? { size: colWidths[ci], type: WidthType.PERCENTAGE } : undefined,
        })
      ),
    })
  );

  return new Table({
    rows: [headerRow, ...dataRows],
    width: { size: 100, type: WidthType.PERCENTAGE },
    margins: { top: 80, bottom: 80, left: 120, right: 120 },
  });
}

// ── DOCUMENT ─────────────────────────────────────────────────────────────────
const children = [];

// ── Title page ────────────────────────────────────────────────────────────────
children.push(
  new Paragraph({
    children: [new TextRun({ text: 'Prostate Cancer', bold: true, size: 64, color: '1F4E79' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 1440, after: 200 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '& Robotic Prostatectomy', bold: true, size: 48, color: '2E75B6' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 0, after: 400 },
  }),
  new Paragraph({
    children: [new TextRun({ text: 'A Comprehensive Clinical Teaching Guide', size: 28, italics: true, color: '555555' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 0, after: 200 },
  }),
  new Paragraph({
    children: [new TextRun({ text: 'Sources: Campbell-Walsh-Wein Urology | Robbins & Cotran Pathology | Harrison\'s Internal Medicine 22E', size: 20, color: '777777' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 0, after: 1440 },
  }),
  pageBreak()
);

// ── PART 1: Prostate Cancer ───────────────────────────────────────────────────
children.push(
  new Paragraph({
    children: [new TextRun({ text: 'PART 1: PROSTATE CANCER', bold: true, size: 36, color: '1F4E79' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 200, after: 300 },
  })
);

// 1. Epidemiology
children.push(
  h1('1. Epidemiology & Risk Factors'),
  para('Prostate cancer is the most common non-cutaneous malignancy in men in the Western world and the second leading cause of cancer death in men.'),
  para(''),
  makeTable(
    ['Risk Factor', 'Details'],
    [
      ['Age', 'Rare before 50; incidence rises steeply after 60'],
      ['Race', 'African-American men have the highest incidence and mortality worldwide'],
      ['Family History', '2–3× risk if first-degree relative affected; BRCA2 mutations confer high risk'],
      ['Diet', 'High fat, red meat associated with increased risk; lycopene/selenium may be protective'],
      ['Geography', 'High incidence in North America, Europe; low in Asia (rises with Westernisation)'],
    ],
    [25, 75]
  ),
  para(''),
  noteText('Over 70–80% of newly diagnosed cancers are now clinically organ-confined, largely due to PSA screening. — Harrison\'s Principles of Internal Medicine 22E'),
  divider()
);

// 2. Anatomy
children.push(
  h1('2. Anatomy Review'),
  para('The prostate is a walnut-sized gland at the bladder base surrounding the urethra. It has three zones relevant to cancer:'),
  bullet('Peripheral zone (~70% of gland): Site of ~70–80% of prostate cancers — palpable on DRE'),
  bullet('Transition zone (~25%): Site of BPH; ~20% of cancers'),
  bullet('Central zone (~5%): Rarely affected by cancer'),
  para(''),
  para('Key adjacent structures during surgery: rectum (posterior), bladder neck (superior), external urethral sphincter (inferior), and the neurovascular bundles (NVBs) running posterolaterally — critical for erectile function preservation.'),
  divider()
);

// 3. Pathology
children.push(
  h1('3. Pathology'),
  para('Over 95% of prostate cancers are adenocarcinomas arising from the secretory epithelial cells. Key pathological features:'),
  para(''),
  h2('Microscopic Features of Malignancy'),
  bullet('Small, crowded glands without a basal cell layer'),
  bullet('Enlarged nuclei with prominent nucleoli (single, large, central — a hallmark)'),
  bullet('Dark cytoplasm'),
  bullet('Perineural invasion (specific feature)'),
  para(''),
  h2('Useful Immunohistochemical Markers'),
  makeTable(
    ['Marker', 'Role in Prostate Cancer'],
    [
      ['AMACR (alpha-methylacyl-CoA racemase)', 'Upregulated in cancer; sensitivity 82–100%'],
      ['p63 / CK5/6', 'Basal cell markers — ABSENT in cancer (benign glands retain basal cells)'],
    ],
    [40, 60]
  ),
  para(''),
  h2('High-Grade PIN (HGPIN)'),
  para('Architecturally benign large acini with cytologically atypical cells. Found in ~80% of specimens harbouring carcinoma. It RETAINS a basal cell layer — unlike frank carcinoma.'),
  divider()
);

// 4. Gleason Grading
children.push(
  h1('4. Gleason Grading & Grade Groups'),
  para('The Gleason system grades glandular patterns from 1 (most differentiated) to 5 (least differentiated). The two most prevalent patterns are summed to give a Gleason Score (2–10). The modern system uses Grade Groups (GG):'),
  para(''),
  makeTable(
    ['Grade Group', 'Gleason Score', 'Description', 'Prognosis'],
    [
      ['GG 1', '≤6 (3+3)', 'Well-formed, uniform individual glands', 'Excellent'],
      ['GG 2', '7 (3+4)', 'Predominantly well-formed + some poorly formed', 'Good'],
      ['GG 3', '7 (4+3)', 'Predominantly poorly formed + some well-formed', 'Intermediate'],
      ['GG 4', '8 (4+4/3+5/5+3)', 'Poorly formed / no glands or fused', 'Poor'],
      ['GG 5', '9–10', 'No gland formation, sheets, single cells', 'Very poor'],
    ],
    [15, 20, 45, 20]
  ),
  para(''),
  noteText('"The Grade Group scheme has been investigated, and its correlation with prostate cancer-specific mortality has been validated." — Campbell-Walsh-Wein Urology'),
  divider()
);

// 5. Clinical Features & Diagnosis
children.push(
  h1('5. Clinical Features & Diagnosis'),
  para('Localized disease is typically asymptomatic. It is usually found via:'),
  bullet('Elevated or rising serum PSA'),
  bullet('Abnormal digital rectal exam (DRE) — hard, nodular, irregular, asymmetric'),
  bullet('Incidental finding on TURP specimen (T1a/T1b)'),
  para(''),
  h2('Advanced Disease Presentation'),
  bullet('Obstructive lower urinary tract symptoms'),
  bullet('Hematuria, hematospermia'),
  bullet('Bone pain from osteoblastic metastases (spine > pelvis > femur)'),
  bullet('Spinal cord compression (oncologic emergency)'),
  bullet('Elevated ALP, anemia (marrow involvement)'),
  para(''),
  h2('PSA (Prostate-Specific Antigen)'),
  para('PSA is a kallikrein-related serine protease (KLK3) produced by prostatic epithelium — organ-specific but NOT cancer-specific. Elevated by: prostate cancer, BPH, prostatitis, prostate manipulation, ejaculation.'),
  para(''),
  makeTable(
    ['PSA Concept', 'Clinical Significance'],
    [
      ['Total PSA', '>4 ng/mL commonly triggers biopsy'],
      ['PSA Density', 'PSA / gland volume; density >0.15 associated with cancer'],
      ['Free PSA %', 'Lower free PSA % = higher cancer likelihood'],
      ['PSA Velocity', 'Rise >0.75 ng/mL/year is suspicious'],
      ['PSA Doubling Time (PSADT)', '<3 months = high risk; >14 months = low risk'],
    ],
    [35, 65]
  ),
  para(''),
  h2('Imaging Modalities'),
  makeTable(
    ['Modality', 'Role'],
    [
      ['Multiparametric MRI (mpMRI)', 'Best local staging — capsular extension, seminal vesicle invasion, NVB involvement'],
      ['PSMA PET/CT', 'Gold standard for staging and biochemical recurrence; FDA-approved'],
      ['Bone Scan (99mTc-MDP)', 'Osteoblastic metastases; being replaced by PSMA PET'],
      ['CT Abdomen/Pelvis', 'Lymph node assessment in intermediate/high-risk disease'],
    ],
    [30, 70]
  ),
  divider()
);

// 6. Staging
children.push(
  h1('6. Staging (TNM)'),
  makeTable(
    ['Stage', 'Description'],
    [
      ['T1a', 'Incidental finding, ≤5% of TURP chips'],
      ['T1b', 'Incidental finding, >5% of TURP chips'],
      ['T1c', 'Found on needle biopsy (elevated PSA)'],
      ['T2a', 'Involves ≤50% of one lobe'],
      ['T2b', '>50% of one lobe, not both'],
      ['T2c', 'Both lobes involved'],
      ['T3a', 'Extracapsular extension'],
      ['T3b', 'Seminal vesicle invasion'],
      ['T4', 'Invades adjacent structures (bladder, rectum, levator muscles)'],
      ['N1', 'Regional lymph node metastasis'],
      ['M1a/b/c', 'Distant metastasis (non-regional LN / bone / other)'],
    ],
    [15, 85]
  ),
  para(''),
  h2('Risk Stratification (NCCN)'),
  makeTable(
    ['Risk Group', 'PSA', 'Grade Group', 'T Stage'],
    [
      ['Very Low', '<10', 'GG1', 'T1c'],
      ['Low', '<10', 'GG1', 'T1–T2a'],
      ['Intermediate', '10–20 OR GG2–3', 'GG2–3', 'T2b–T2c'],
      ['High', '>20 OR GG4–5', 'GG4–5', 'T3a'],
      ['Very High', 'Any', 'GG5 or >4 cores GG4+', 'T3b–T4'],
    ],
    [20, 25, 30, 25]
  ),
  divider()
);

// 7. Treatment
children.push(
  h1('7. Treatment Overview'),
  h2('Localized Disease'),
  makeTable(
    ['Approach', 'Indication'],
    [
      ['Active Surveillance (AS)', 'Very low/low risk; defers treatment to avoid overtreatment morbidity'],
      ['Radical Prostatectomy (RP)', 'Localized disease, good performance status; curative intent'],
      ['External Beam Radiation (EBRT)', 'Localized/locally advanced; alternative to surgery'],
      ['Brachytherapy', 'Low–intermediate risk; radioactive seeds implanted'],
      ['Combined EBRT + ADT', 'Intermediate/high-risk disease'],
    ],
    [30, 70]
  ),
  para(''),
  h2('Metastatic / Advanced Disease'),
  bullet('Androgen Deprivation Therapy (ADT): GnRH agonists (leuprolide, goserelin) or antagonists (degarelix, relugolix)'),
  bullet('mCSPC: ADT + docetaxel, or ADT + abiraterone/enzalutamide — triplet therapy now standard in high-volume disease'),
  bullet('mCRPC: Enzalutamide, abiraterone, cabazitaxel, PARP inhibitors (olaparib for BRCA mutations), 177Lu-PSMA-617'),
  bullet('Bone-targeted therapy: Denosumab, zoledronic acid, Radium-223'),
  divider()
);

// ── PART 2: Robotic Prostatectomy ────────────────────────────────────────────
children.push(
  pageBreak(),
  new Paragraph({
    children: [new TextRun({ text: 'PART 2: ROBOTIC PROSTATECTOMY', bold: true, size: 36, color: '1F4E79' })],
    alignment: AlignmentType.CENTER,
    spacing: { before: 200, after: 300 },
  })
);

// 8. What is RALRP
children.push(
  h1('8. What is RALRP?'),
  para('Robot-Assisted Laparoscopic Radical Prostatectomy (RALRP) uses the da Vinci Surgical System to perform minimally invasive removal of the prostate with curative intent. Introduced into urology in 2002, it has rapidly become the dominant surgical approach — today >85% of radical prostatectomies in the USA are performed robotically.'),
  para(''),
  para('The da Vinci system provides:'),
  bullet('7 degrees of freedom (vs. 4 for laparoscopy)'),
  bullet('10–12× 3D magnification'),
  bullet('Tremor filtration'),
  bullet('Articulating "Endowrist" instruments that mimic the human wrist'),
  divider()
);

// 9. Indications & Contraindications
children.push(
  h1('9. Indications & Contraindications'),
  h2('Indications'),
  bullet('Clinically localized prostate cancer (T1–T3a)'),
  bullet('Life expectancy >10 years'),
  bullet('Fit for general anaesthesia and Trendelenburg position'),
  bullet('Particularly beneficial in patients with previous mesh hernia repair, obesity, or prior abdominal surgery'),
  para(''),
  h2('Relative Contraindications'),
  bullet('Extensive prior pelvic surgery with dense adhesions'),
  bullet('Severe cardiopulmonary compromise (cannot tolerate steep Trendelenburg + pneumoperitoneum)'),
  bullet('Morbid obesity (RALRP is often still preferred over open in these patients)'),
  bullet('Uncorrectable coagulopathy'),
  divider()
);

// 10. Patient Positioning & OR Setup
children.push(
  h1('10. Patient Positioning & OR Setup'),
  para('Positioning: Steep Trendelenburg (~22–25°) with arms tucked at sides, padded with "egg crate" foam. Sequential compression stockings. Feet may be in stirrups or spread on foot rests.'),
  para(''),
  noteText('"Fixed shoulder rests should be avoided because this can result in compression injury to the shoulders and brachial plexus when in the steep Trendelenburg position." — Campbell-Walsh-Wein Urology, p. 4677'),
  para(''),
  h2('Key Equipment'),
  bullet('da Vinci S/Si/Xi system with 0° and 30° robotic cameras'),
  bullet('Endowrist instruments: Maryland bipolar forceps, curved monopolar scissors, ProGrasp forceps, large needle drivers'),
  bullet('12-mm and 8-mm trocars (5–6 total)'),
  bullet('18-Fr urethral catheter'),
  bullet('0-polydioxanone suture for DVC ligation; 3-0 Monocryl for anastomosis'),
  divider()
);

// 11. Transperitoneal vs Extraperitoneal
children.push(
  h1('11. Surgical Approach: Transperitoneal vs. Extraperitoneal'),
  makeTable(
    ['Feature', 'Transperitoneal', 'Extraperitoneal'],
    [
      ['Working space', 'Larger', 'Smaller'],
      ['Trendelenburg needed', 'Yes, steep', 'May be less steep'],
      ['Bowel involvement', 'More risk if adhesions', 'Peritoneum acts as barrier'],
      ['Postoperative ileus', 'More common', 'Less common (diet quicker)'],
      ['Operative time', 'Slightly longer', 'Slightly shorter'],
      ['Previous mesh hernioplasty', 'Preferred approach', 'Difficult — space obliterated'],
    ],
    [34, 33, 33]
  ),
  divider()
);

// 12. Surgical Steps
children.push(
  h1('12. Key Surgical Steps (Transperitoneal Anterior RALRP)'),
  para(''),
  new Paragraph({
    children: [new TextRun({ text: '1.  Port Placement', bold: true, size: 22 }), new TextRun({ text: ' — 5–6 trocars placed in a fan arrangement. Camera port periumbilically.', size: 22 })],
    spacing: { before: 60, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '2.  Pneumoperitoneum', bold: true, size: 22 }), new TextRun({ text: ' — CO₂ to 15 mmHg, steep Trendelenburg.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '3.  Bowel Mobilization', bold: true, size: 22 }), new TextRun({ text: ' — Sigmoid reflected, space of Retzius developed.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '4.  Endopelvic Fascia Incision', bold: true, size: 22 }), new TextRun({ text: ' — Lateral to prostate bilaterally.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '5.  Dorsal Venous Complex (DVC) Ligation', bold: true, size: 22 }), new TextRun({ text: ' — 0-polydioxanone suture around Santorini\'s plexus to control bleeding.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '6.  Bladder Neck Dissection', bold: true, size: 22 }), new TextRun({ text: ' — Circumferential division; identify ureteral orifices to avoid injury.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '7.  Posterior Dissection', bold: true, size: 22 }), new TextRun({ text: ' — Division of seminal vesicles and vas deferens; Denonvilliers\' fascia incised.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '8.  NVB Preservation', bold: true, size: 22 }), new TextRun({ text: ' — (See Section 13 — the most critical step).', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '9.  Apical Dissection', bold: true, size: 22 }), new TextRun({ text: ' — Division of urethra at apex; preserve maximum sphincter length for continence.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '10. Specimen Removal', bold: true, size: 22 }), new TextRun({ text: ' — Through a small extension of a port site in a laparoscopic bag.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '11. Pelvic Lymph Node Dissection (PLND)', bold: true, size: 22 }), new TextRun({ text: ' — Obturator fossa + external iliac nodes; performed in intermediate/high-risk cases.', size: 22 })],
    spacing: { before: 40, after: 40 },
  }),
  new Paragraph({
    children: [new TextRun({ text: '12. Vesicourethral Anastomosis (VUA)', bold: true, size: 22 }), new TextRun({ text: ' — 3-0 Monocryl double-armed suture; Van Velthoven running technique; watertight over 18-Fr catheter.', size: 22 })],
    spacing: { before: 40, after: 60 },
  }),
  divider()
);

// 13. Nerve Sparing
children.push(
  h1('13. Nerve-Sparing Technique — The Most Critical Step'),
  para('The neurovascular bundles (NVBs) run posterolaterally along the prostate within the peri-prostatic fascia and are responsible for penile erections. Their preservation determines post-operative erectile function.'),
  para(''),
  h2('Fascial Dissection Planes (least to most nerve-sparing)'),
  makeTable(
    ['Plane', 'Location', 'Indication'],
    [
      ['Extrafascial', 'Between lateral prostatic fascia and levator fascia', 'Locally advanced (T3); maximum cancer control, sacrifices NVB'],
      ['Interfascial', 'Between levator fascia and prostatic fascia', 'Standard nerve-sparing for organ-confined disease'],
      ['Intrafascial', 'Directly on prostatic capsule', 'Maximum nerve preservation for low-risk, smaller prostates'],
    ],
    [18, 50, 32]
  ),
  para(''),
  h2('Principles of Nerve Sparing'),
  bullet('Cold scissors dissection preferred near NVB — avoid thermal energy'),
  bullet('Antegrade vs. retrograde NVB release depending on anatomy'),
  bullet('Haemostasis with bipolar only where strictly necessary'),
  bullet('"High anterior release" takes nerve bundle off the anterior prostate surface — maximises nerve tissue preserved'),
  para(''),
  noteText('"The superb visualization of the periprostatic tissues with minimally invasive surgery has led to a greater appreciation of the periprostatic fascial layers." — Campbell-Walsh-Wein Urology, p. 4678'),
  divider()
);

// 14. Outcomes
children.push(
  h1('14. Outcomes: RALRP vs. Open Radical Prostatectomy'),
  makeTable(
    ['Outcome', 'RALRP', 'Open RP'],
    [
      ['Blood loss', '~300 mL', '~1,400 mL'],
      ['Transfusion rate', '1–2%', '10–15%'],
      ['Hospital stay', '1–2 days', '3–5 days'],
      ['Return to activity', 'Faster', 'Slower'],
      ['Positive surgical margins', 'Equivalent', 'Equivalent'],
      ['Cancer control (PSA-free survival)', 'Equivalent', 'Equivalent'],
      ['Continence recovery at 12 months', 'Equivalent', 'Equivalent'],
      ['Potency recovery', 'Equivalent (surgeon dependent)', 'Equivalent (surgeon dependent)'],
    ],
    [40, 30, 30]
  ),
  para(''),
  noteText('"Outcomes are very dependent on the individual surgeon\'s ability and experience, and outcomes improve when surgery is performed by high-volume surgeons at high-volume centers." — Campbell-Walsh-Wein Urology, p. 4682'),
  para(''),
  h2('Recent Evidence'),
  bullet('Wang et al. 2023 (PMID 37721644) — Systematic review & meta-analysis confirming RALRP achieves equivalent oncological outcomes with significantly less blood loss and shorter hospital stay vs. open RP.'),
  bullet('Nahas et al. 2024 (PMID 38723593) — Randomized clinical trial confirming equivalent oncological and functional outcomes; RALRP favoured for blood loss and length of stay.'),
  bullet('Dinneen et al. 2025 — NeuroSAFE PROOF Phase 3 RCT (Lancet Oncology, PMID 40147459): NeuroSAFE-guided RARP (intraoperative frozen section of NVB interface) significantly improved erectile function and urinary continence recovery vs. standard RARP.'),
  divider()
);

// 15. Complications
children.push(
  h1('15. Complications of Robotic Prostatectomy'),
  h2('Intraoperative Complications'),
  makeTable(
    ['Complication', 'Notes'],
    [
      ['Bleeding (DVC)', 'Transfusion rare (1–2%); CO2 pneumoperitoneum compresses venous bleeding'],
      ['Rectal injury', 'Rare but serious; recognized = primary repair + omental interposition; unrecognized = recto-vesical fistula (requires colostomy)'],
      ['Ureteral injury', 'At bladder neck (post-TURP, large median lobe); stent if at risk'],
      ['Robot failure', 'Critical failure ~0.4%; conversion to laparoscopic or open'],
    ],
    [25, 75]
  ),
  para(''),
  h2('Postoperative Complications'),
  makeTable(
    ['Complication', 'Notes'],
    [
      ['Urinary incontinence', 'Most common functional issue; 90% continent by 12 months; Kegel exercises help'],
      ['Erectile dysfunction', 'Related to NVB preservation; age and baseline function are key predictors'],
      ['Anastomotic leak', 'Early urinary extravasation; catheter left 7–14 days'],
      ['DVT / PE', 'Risk from Trendelenburg + pneumoperitoneum; compression stockings + early ambulation'],
      ['Positive surgical margin', '~10–20%; risk increases with extracapsular extension'],
      ['Biochemical recurrence', 'PSA >0.2 ng/mL after RP; triggers salvage radiation ± ADT'],
    ],
    [30, 70]
  ),
  para(''),
  h2('Positioning Complications (Unique to Steep Trendelenburg)'),
  bullet('Brachial plexus injury (arms not tucked properly)'),
  bullet('Radial / ulnar nerve compression'),
  bullet('Femoral neurapraxia (excessive hip flexion of table)'),
  bullet('Facial / laryngeal oedema (prolonged Trendelenburg)'),
  bullet('Raised intraocular pressure / ocular complications'),
  bullet('Rhabdomyolysis (prolonged compression of compartments)'),
  divider()
);

// 16. Functional Recovery
children.push(
  h1('16. Functional Recovery After RALRP'),
  h2('Urinary Continence'),
  bullet('Immediate post-catheter removal: variable incontinence'),
  bullet('3 months: ~60–70% continent'),
  bullet('12 months: ~85–95% continent (no pad or 1 security pad)'),
  bullet('Predictors of recovery: pre-op continence status, sphincter length, preservation of urethra length at apex'),
  para(''),
  h2('Erectile Function'),
  bullet('Bilateral nerve-sparing + young patient + good baseline function: ~60–80% potency at 12–18 months'),
  bullet('Unilateral nerve-sparing: ~40–50%'),
  bullet('Non-nerve-sparing: <10%'),
  bullet('PDE5 inhibitors (sildenafil, tadalafil) used early as "penile rehabilitation"'),
  para(''),
  h2('PSA Monitoring (Oncological Surveillance)'),
  bullet('PSA should be undetectable (<0.1 ng/mL) by 6 weeks post-RP'),
  bullet('Biochemical recurrence: PSA ≥0.2 ng/mL confirmed on repeat testing'),
  bullet('PSA doubling time (PSADT) calculated — guides need for salvage radiation vs. observation'),
  divider()
);

// 17. Summary Table
children.push(
  pageBreak(),
  h1('17. Summary: Prostate Cancer at a Glance'),
  makeTable(
    ['Domain', 'Key Points'],
    [
      ['Most common histology', 'Adenocarcinoma (>95%)'],
      ['Most common location', 'Peripheral zone (~70–80%)'],
      ['Key marker', 'PSA (organ-specific, NOT cancer-specific)'],
      ['Grading system', 'Gleason score / Grade Groups 1–5'],
      ['Pathological hallmark', 'Absent basal cell layer; prominent nucleoli; AMACR+'],
      ['Metastasis pattern', 'Osteoblastic bone metastases (spine, pelvis)'],
      ['Local staging modality', 'mpMRI prostate'],
      ['Systemic staging', 'PSMA PET/CT (gold standard)'],
      ['Curative treatments', 'Surgery (RALRP), EBRT, Brachytherapy'],
      ['Hormonal treatment', 'ADT (GnRH agonist/antagonist)'],
      ['RALRP advantages', 'Less blood loss, faster recovery, equivalent oncological outcomes'],
      ['Key RALRP steps', 'NVB preservation (potency); watertight VUA (continence)'],
      ['Post-RALRP surveillance', 'PSA should be undetectable by 6 weeks'],
    ],
    [35, 65]
  ),
  divider()
);

// Sources
children.push(
  h2('Sources & References'),
  bullet('Campbell-Walsh-Wein Urology (Chapters 84, 85, 156) — Gold standard urology reference'),
  bullet('Robbins & Cotran Pathologic Basis of Disease (2023), Chapter 21'),
  bullet("Harrison's Principles of Internal Medicine 22E (2025), Chapter 92"),
  bullet('Miller\'s Anesthesia 10E, Chapter 23 (RALRP anaesthetic considerations)'),
  bullet('Wang et al. 2023 — Robot-assisted versus open radical prostatectomy: systematic review and meta-analysis of prospective studies. J Robot Surg. PMID 37721644'),
  bullet('Nahas et al. 2024 — Perioperative, Oncological, and Functional Outcomes Between RALRP and Open RRP: A Randomized Clinical Trial. J Urol. PMID 38723593'),
  bullet('Dinneen et al. 2025 — NeuroSAFE PROOF: multicentre, patient-blinded, randomised, controlled phase 3 trial. Lancet Oncol. PMID 40147459'),
);

// ── Build document ────────────────────────────────────────────────────────────
const doc = new Document({
  creator: 'Orris Medical AI',
  title: 'Prostate Cancer & Robotic Prostatectomy',
  description: 'Comprehensive clinical teaching guide',
  styles: {
    default: {
      document: {
        run: { font: 'Calibri', size: 22 },
      },
      heading1: {
        run: { font: 'Calibri', bold: true, size: 32, color: '1F4E79' },
        paragraph: { spacing: { before: 360, after: 120 } },
      },
      heading2: {
        run: { font: 'Calibri', bold: true, size: 26, color: '2E75B6' },
        paragraph: { spacing: { before: 240, after: 80 } },
      },
      heading3: {
        run: { font: 'Calibri', bold: true, size: 24, color: '2E75B6' },
        paragraph: { spacing: { before: 160, after: 60 } },
      },
    },
  },
  sections: [{
    properties: {
      page: {
        margin: { top: 1080, bottom: 1080, left: 1080, right: 1080 },
      },
    },
    headers: {
      default: new Header({
        children: [new Paragraph({
          children: [
            new TextRun({ text: 'Prostate Cancer & Robotic Prostatectomy  |  Clinical Teaching Guide', size: 18, color: '888888' }),
          ],
          alignment: AlignmentType.RIGHT,
          border: { bottom: { color: 'CCCCCC', style: BorderStyle.SINGLE, size: 6, space: 4 } },
        })],
      }),
    },
    footers: {
      default: new Footer({
        children: [new Paragraph({
          children: [
            new TextRun({ text: 'Source: Campbell-Walsh-Wein Urology | Robbins & Cotran Pathology | Harrison\'s 22E    Page ', size: 18, color: '888888' }),
            new TextRun({ children: [PageNumber.CURRENT], size: 18, color: '888888' }),
          ],
          alignment: AlignmentType.CENTER,
          border: { top: { color: 'CCCCCC', style: BorderStyle.SINGLE, size: 6, space: 4 } },
        })],
      }),
    },
    children,
  }],
});

Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync('/home/daytona/workspace/prostate-cancer-doc/Prostate_Cancer_Robotic_Prostatectomy.docx', buffer);
  console.log('Done');
});
Running Command

cd /home/daytona/workspace/prostate-cancer-doc && node build.js 2>&1

Running Command

python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/worksp…

Running Command

python3 -c " import zipfile, os path = '/home/daytona/workspace/prostate-cancer-…

The file is valid - 21 KB, correct ZIP/DOCX structure with all required XML parts. Here's your download link:

Prostate Cancer Robotic Prostatectomy

Word Document · DOCX

What's included in the document:
  • Title page with styled heading
  • Header and footer on every page (title + page numbers)
  • 17 fully formatted sections covering:
    • Epidemiology & risk factors
    • Anatomy, pathology, Gleason grading
    • Clinical features, PSA, imaging, staging (TNM + NCCN risk groups)
    • Treatment (localized through metastatic)
    • RALRP: indications, positioning, OR setup, surgical steps (numbered)
    • Nerve-sparing technique and fascial planes
    • Outcomes (RALRP vs. open RP comparison table)
    • Complications (intraoperative, postoperative, positioning)
    • Functional recovery (continence + erectile function)
    • Summary table + full references with PMIDs
  • Color-coded tables (navy headers, alternating row shading)
  • Blockquote callouts for key citations from Campbell-Walsh, Harrison's, and Robbins
This is a shared conversation. Sign in to Orris to start your own chat.