Write short note on men syndromes pathology prospective and make pdf

Reading File
Reading File
Finding Sources
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Finding Sources
Reading File
Reading File
Reading File
Running Command

mkdir -p /tmp/workspace/men-syndromes && ls /tmp/workspace/

Writing File

~/men-syndromes/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY

OUTPUT = "/tmp/workspace/men-syndromes/MEN_Syndromes_Pathology.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=2*cm, leftMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=2.2*cm,
    title="MEN Syndromes – Pathology Perspective",
    author="Orris Medical Reference"
)

styles = getSampleStyleSheet()

# Custom styles
TITLE = ParagraphStyle(
    "Title", parent=styles["Title"],
    fontSize=22, leading=28, textColor=colors.HexColor("#1a3a5c"),
    spaceAfter=6, alignment=TA_CENTER, fontName="Helvetica-Bold"
)
SUBTITLE = ParagraphStyle(
    "Subtitle", parent=styles["Normal"],
    fontSize=11, leading=14, textColor=colors.HexColor("#4a6fa5"),
    spaceAfter=4, alignment=TA_CENTER, fontName="Helvetica-Oblique"
)
H1 = ParagraphStyle(
    "H1", parent=styles["Heading1"],
    fontSize=15, leading=18, textColor=colors.white,
    spaceBefore=14, spaceAfter=4,
    fontName="Helvetica-Bold", backColor=colors.HexColor("#1a3a5c"),
    leftIndent=-0.5*cm, rightIndent=-0.5*cm, borderPadding=(5, 6, 5, 6)
)
H2 = ParagraphStyle(
    "H2", parent=styles["Heading2"],
    fontSize=12, leading=15, textColor=colors.HexColor("#1a3a5c"),
    spaceBefore=10, spaceAfter=3,
    fontName="Helvetica-Bold",
    borderPad=3, leftIndent=0
)
H3 = ParagraphStyle(
    "H3", parent=styles["Heading3"],
    fontSize=11, leading=13, textColor=colors.HexColor("#2e6fa3"),
    spaceBefore=7, spaceAfter=2,
    fontName="Helvetica-Bold"
)
BODY = ParagraphStyle(
    "Body", parent=styles["Normal"],
    fontSize=10, leading=14, alignment=TA_JUSTIFY,
    spaceAfter=5, fontName="Helvetica"
)
BULLET = ParagraphStyle(
    "Bullet", parent=styles["Normal"],
    fontSize=10, leading=13, leftIndent=16, firstLineIndent=-12,
    spaceAfter=3, fontName="Helvetica"
)
CAPTION = ParagraphStyle(
    "Caption", parent=styles["Normal"],
    fontSize=8.5, leading=11, textColor=colors.HexColor("#555555"),
    alignment=TA_CENTER, fontName="Helvetica-Oblique", spaceAfter=4
)
SOURCE = ParagraphStyle(
    "Source", parent=styles["Normal"],
    fontSize=8, leading=11, textColor=colors.HexColor("#888888"),
    alignment=TA_CENTER, fontName="Helvetica-Oblique"
)

def bullet(text):
    return Paragraph(f"\u2022  {text}", BULLET)

def hline(color="#cccccc", thickness=0.5):
    return HRFlowable(width="100%", thickness=thickness,
                      color=colors.HexColor(color), spaceAfter=4, spaceBefore=2)

# ─── CONTENT ───────────────────────────────────────────────────────────────────
story = []

# Cover block
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("Multiple Endocrine Neoplasia (MEN) Syndromes", TITLE))
story.append(Paragraph("A Pathology Perspective – Short Clinical Note", SUBTITLE))
story.append(Spacer(1, 0.3*cm))
story.append(hline("#1a3a5c", 1.5))
story.append(Spacer(1, 0.15*cm))

# Overview summary table
overview_data = [
    ["Syndrome", "Alias", "Gene / Locus", "Key Tumors"],
    ["MEN 1", "Werner syndrome", "MEN1 (11q13)\nTumor suppressor",
     "Parathyroid, Pancreatic NETs,\nPituitary adenoma"],
    ["MEN 2A", "Sipple syndrome", "RET proto-oncogene\n(10q11)",
     "Medullary thyroid CA,\nPheochromocytoma, Parathyroid"],
    ["MEN 2B", "–", "RET proto-oncogene\n(10q11)",
     "Medullary thyroid CA,\nPheochromocytoma, Mucosal neuromas"],
    ["MEN 4", "MEN1-like", "CDKN1B / p27\nTumor suppressor",
     "Parathyroid, Pituitary,\nPancreatic NETs"],
]
col_widths = [2.4*cm, 2.6*cm, 4.3*cm, 7.2*cm]
tbl = Table(overview_data, colWidths=col_widths, repeatRows=1)
tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  colors.HexColor("#1a3a5c")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("FONTNAME",      (0, 0), (-1, 0),  "Helvetica-Bold"),
    ("FONTSIZE",      (0, 0), (-1, -1), 9),
    ("FONTNAME",      (0, 1), (-1, -1), "Helvetica"),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [colors.HexColor("#eef2f7"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, colors.HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 5),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING",   (0, 0), (-1, -1), 6),
    ("ALIGN",         (0, 0), (-1, -1), "LEFT"),
]))
story.append(tbl)
story.append(Spacer(1, 0.3*cm))

# ─── INTRODUCTION ──────────────────────────────────────────────────────────────
story.append(Paragraph("1. Introduction", H1))
story.append(Paragraph(
    "The Multiple Endocrine Neoplasia (MEN) syndromes are a group of inherited diseases "
    "resulting in proliferative lesions – hyperplasia, adenomas, and carcinomas – affecting "
    "multiple endocrine organs. As in other inherited cancer syndromes, MEN-associated tumors "
    "share several defining pathological characteristics that distinguish them from their "
    "sporadic counterparts:", BODY))

for pt in [
    "Occur at a <b>younger age</b> than sporadic endocrine tumors.",
    "Arise in <b>multiple endocrine organs</b>, either synchronously or metachronously.",
    "Are <b>multifocal</b> even within a single organ.",
    "Are usually preceded by an <b>asymptomatic hyperplastic stage</b> involving the cell of origin.",
    "Tend to be <b>more aggressive</b> with higher recurrence rates than comparable sporadic tumors.",
]:
    story.append(bullet(pt))

story.append(Spacer(1, 0.2*cm))

# ─── MEN 1 ─────────────────────────────────────────────────────────────────────
story.append(Paragraph("2. MEN Type 1 (Werner Syndrome)", H1))

story.append(Paragraph("2.1 Epidemiology", H2))
story.append(Paragraph(
    "MEN 1 is rare, with a prevalence of approximately 1–3 per 100,000. It shows no racial or "
    "ethnic predisposition and affects males and females equally. Clinical manifestations develop "
    "by age 50 in 75% of mutation carriers. If untreated, there is a 50% probability of death "
    "by 50 years of age.", BODY))

story.append(Paragraph("2.2 Genetics", H2))
story.append(Paragraph(
    "MEN 1 follows an <b>autosomal dominant</b> inheritance pattern. It results from germline "
    "mutations in the <b>MEN1 gene on chromosome 11q13</b>, which encodes the protein "
    "<b>menin</b> – a 610-amino acid tumor suppressor. Menin resides in the cell nucleus and "
    "participates in transcription factor complexes regulating cell growth. Loss of heterozygosity "
    "(two-hit model) leads to tumor development.", BODY))
for pt in [
    "Over <b>1,600 distinct mutations</b> have been described; 85% are germline, 15% somatic.",
    "Nearly 70% of germline mutations are pathogenic – frame-shift (42%), nonsense (14%), or splicing defects (11%).",
    "Mutations are distributed throughout the coding region (no hotspot clustering).",
    "~5–20% of clinically diagnosed MEN1 patients have no identifiable coding-region mutation.",
]:
    story.append(bullet(pt))

story.append(Paragraph("2.3 Pathology – The Three Ps", H2))

story.append(Paragraph("Parathyroid (80–95% penetrance)", H3))
story.append(Paragraph(
    "Hyperparathyroidism (HPT) is the <b>most common and earliest manifestation</b>, presenting "
    "in almost all patients by age 40–50. Pathologically it appears as multiple parathyroid "
    "adenomas (not true four-gland hyperplasia). PTH excess causes hypercalcemia, leading to "
    "nephrolithiasis, peptic ulcers, and bone disease (osteitis fibrosa cystica).", BODY))

story.append(Paragraph("Pancreas / Gastropancreatic NETs", H3))
story.append(Paragraph(
    "Pancreatic and gastroduodenal neuroendocrine tumors (NETs) are the <b>leading cause of "
    "morbidity and mortality</b> in MEN1. They are often multifocal with microadenomas scattered "
    "throughout the pancreas alongside one or two dominant lesions. Functional tumors include:", BODY))
for pt in [
    "<b>Gastrinomas (54%)</b> – Zollinger-Ellison syndrome (ZES): intractable peptic ulcers, diarrhea. Duodenal location more common than pancreatic.",
    "<b>Insulinomas (15%)</b> – recurrent hypoglycemia, neurological symptoms.",
    "<b>VIPomas, glucagonomas</b> – less common.",
    "Most tumors also secrete pancreatic polypeptide but this does not cause a clinically evident syndrome.",
]:
    story.append(bullet(pt))

story.append(Paragraph("Pituitary Adenomas (30–40%)", H3))
story.append(Paragraph(
    "The most frequent pituitary tumor is a <b>prolactinoma</b>. Growth-hormone-secreting "
    "tumors cause acromegaly. ACTH-secreting tumors are rare.", BODY))

story.append(Paragraph("2.4 Other Manifestations (Beyond the 3 Ps)", H2))
for pt in [
    "Thymic and bronchial <b>carcinoid tumors</b>",
    "<b>Adrenocortical adenomas</b> (usually non-functional)",
    "<b>Meningiomas, ependymomas</b>",
    "Cutaneous: <b>angiofibromas, lipomas, collagenomas</b>",
]:
    story.append(bullet(pt))

story.append(Paragraph("2.5 Diagnosis", H2))
story.append(Paragraph(
    "Clinical diagnosis requires: (a) two or more MEN1-associated tumors, or (b) one MEN1-"
    "associated tumor plus a first-degree relative with MEN1. Genetic testing is recommended "
    "for all suspected cases and at-risk relatives. Biochemical surveillance (serum calcium, "
    "PTH, gastrin, glucose, prolactin, IGF-1) and imaging should begin in childhood for "
    "confirmed mutation carriers.", BODY))

story.append(Spacer(1, 0.2*cm))

# ─── MEN 2 ─────────────────────────────────────────────────────────────────────
story.append(Paragraph("3. MEN Type 2 (Sipple Syndrome and Variants)", H1))

story.append(Paragraph("3.1 Genetics – RET Proto-Oncogene", H2))
story.append(Paragraph(
    "All MEN2 variants are caused by <b>activating germline mutations in the RET proto-oncogene "
    "on chromosome 10q11</b>. RET encodes a transmembrane tyrosine kinase receptor expressed on "
    "thyroid C cells, adrenal medullary cells, and autonomic ganglion cells. Unlike MEN1 where "
    "mutations are scattered, MEN2 mutations cluster in <b>specific codons</b> that predict "
    "phenotype and aggressiveness – the basis for risk-stratified prophylactic thyroidectomy.", BODY))

story.append(Paragraph("3.2 MEN 2A (Sipple Syndrome)", H2))
story.append(Paragraph(
    "The classic triad of MEN 2A consists of:", BODY))
for pt in [
    "<b>Medullary thyroid carcinoma (MTC)</b> – virtually 100% lifetime penetrance; usually multifocal; almost always associated with C-cell hyperplasia in adjacent thyroid parenchyma. MTC secretes <b>calcitonin</b> (tumor marker).",
    "<b>Pheochromocytoma</b> – 40–50% of patients; often bilateral; adrenal medullary origin; secretes catecholamines causing paroxysmal hypertension, headache, sweating.",
    "<b>Primary hyperparathyroidism (PHPT)</b> – 10–35% of patients; parathyroid hyperplasia or adenoma.",
]:
    story.append(bullet(pt))

story.append(Paragraph(
    "MEN 2A subclassifications include: classical MEN 2A; MEN 2A with <b>cutaneous lichen "
    "amyloidosis</b> (pruritic plaques on the back, codon 634 mutations); MEN 2A with "
    "<b>Hirschsprung disease</b> (aganglionosis of distal colon, codons 609/618/620); and "
    "<b>familial medullary thyroid carcinoma (FMTC)</b> – RET mutation with MTC only, "
    "diagnosed ~20 years later than classical MEN 2A.", BODY))

story.append(Paragraph("3.3 MEN 2B", H2))
story.append(Paragraph(
    "MEN 2B is the most aggressive MEN2 variant. Features include:", BODY))
for pt in [
    "<b>Medullary thyroid carcinoma</b> – earliest onset; most aggressive; MTC often presents in infancy.",
    "<b>Pheochromocytoma</b> – similar to MEN 2A.",
    "<b>Mucosal neuromas</b> – on lips, tongue, eyelids (highly specific feature).",
    "<b>Ganglioneuromatosis</b> of the GI tract – causing abdominal distension, megacolon.",
    "<b>Marfanoid habitus</b> – tall, slender build with long extremities.",
    "<b>No parathyroid disease</b> – distinguishes MEN 2B from MEN 2A.",
]:
    story.append(bullet(pt))
story.append(Paragraph(
    "The most common mutation in MEN 2B is <b>codon 918 (M918T)</b> of RET, associated with "
    "the highest risk category and recommendation for thyroidectomy within the first 6 months "
    "of life.", BODY))

story.append(Paragraph("3.4 Pathology of Key MEN2 Tumors", H2))

story.append(Paragraph("Medullary Thyroid Carcinoma (MTC)", H3))
story.append(Paragraph(
    "MTC arises from <b>parafollicular C cells</b> and represents ~5–10% of all thyroid "
    "cancers. Histologically, tumor cells are polygonal to spindle-shaped arranged in nests "
    "or sheets within an <b>amyloid-rich stroma</b> (calcitonin deposits staining with Congo "
    "red). C-cell hyperplasia is invariably found in adjacent thyroid tissue in hereditary "
    "cases. Immunostaining is positive for <b>calcitonin, CEA, and chromogranin</b>.", BODY))

story.append(Paragraph("Pheochromocytoma", H3))
story.append(Paragraph(
    "Arise from adrenal medullary chromaffin cells. Characteristic 'zellballen' (ball-like "
    "nests) pattern on histology with abundant cytoplasm and neurosecretory granules containing "
    "catecholamines on electron microscopy. Diagnosis confirmed by elevated urinary "
    "catecholamines / metanephrines or plasma metanephrines.", BODY))

story.append(Spacer(1, 0.2*cm))

# ─── MEN 4 ─────────────────────────────────────────────────────────────────────
story.append(Paragraph("4. MEN Type 4", H1))
story.append(Paragraph(
    "MEN 4 is a rare, relatively recently characterized syndrome with clinical features "
    "overlapping MEN 1. It results from mutations in <b>CDKN1B</b> (encoding p27, a "
    "cyclin-dependent kinase inhibitor / tumor suppressor) rather than MEN1. Manifestations "
    "include parathyroid adenomas, pituitary adenomas, and pancreatic NETs. Some MEN 4 patients "
    "also show features of MEN 2 (pheochromocytomas, paragangliomas, thyroid tumors). MEN 4 "
    "may account for some patients who meet clinical criteria for MEN1 but lack a MEN1 gene "
    "mutation. The condition is autosomal dominant. Investigation is ongoing.", BODY))

story.append(Spacer(1, 0.2*cm))

# ─── COMPARATIVE TABLE ─────────────────────────────────────────────────────────
story.append(Paragraph("5. Comparative Summary", H1))

comp_data = [
    ["Feature", "MEN 1", "MEN 2A", "MEN 2B", "MEN 4"],
    ["Inheritance", "AD", "AD", "AD", "AD"],
    ["Gene", "MEN1\n(chr 11q13)", "RET\n(chr 10q11)", "RET\n(chr 10q11)", "CDKN1B\n(p27)"],
    ["Mechanism", "Tumor suppressor\n(loss of function)", "Proto-oncogene\n(gain of function)", "Proto-oncogene\n(gain of function)", "Tumor suppressor\n(loss of function)"],
    ["Key mutation\nexample", "Menin truncation\n(frameshift/nonsense)", "Codon 634 (MEN2A)\nCodon 918 (MEN2B)", "Codon M918T", "p27 loss"],
    ["Parathyroid", "Multiple adenomas\n(~100%)", "Hyperplasia\n(10-35%)", "Absent", "Adenoma"],
    ["Pancreas/\nGI NETs", "Gastrinoma,\nInsulinoma", "–", "GI ganglioneuroma", "PNETs (variable)"],
    ["Pituitary", "Prolactinoma,\nSomatotropinoma", "–", "–", "Adenoma"],
    ["Thyroid", "–", "MTC (~100%)", "MTC (infancy)", "–"],
    ["Adrenal", "Adenoma (rare)", "Pheochromocy-\ntoma (40-50%)", "Pheochromocy-\ntoma", "Pheo (some)"],
    ["Other", "Carcinoid,\nLipoma, Angiofibroma", "Lichen amyloidosis,\nHirschsprung Dx", "Mucosal neuromas,\nMarfanoid habitus", "Variable"],
]
cw2 = [3.0*cm, 3.2*cm, 3.2*cm, 3.2*cm, 3.0*cm]
tbl2 = Table(comp_data, colWidths=cw2, repeatRows=1)
tbl2.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  colors.HexColor("#1a3a5c")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("FONTNAME",      (0, 0), (-1, 0),  "Helvetica-Bold"),
    ("FONTNAME",      (0, 1), (-1, -1), "Helvetica"),
    ("FONTSIZE",      (0, 0), (-1, -1), 8.5),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [colors.HexColor("#eef2f7"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, colors.HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 4),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5),
    ("BACKGROUND",    (0, 1), (0, -1),  colors.HexColor("#c8d8ea")),
    ("FONTNAME",      (0, 1), (0, -1),  "Helvetica-Bold"),
]))
story.append(tbl2)
story.append(Spacer(1, 0.15*cm))
story.append(Paragraph("AD = Autosomal Dominant; MTC = Medullary Thyroid Carcinoma; NETs = Neuroendocrine Tumors; Pheo = Pheochromocytoma", CAPTION))

story.append(Spacer(1, 0.25*cm))

# ─── MANAGEMENT OVERVIEW ───────────────────────────────────────────────────────
story.append(Paragraph("6. Management Principles", H1))

story.append(Paragraph("6.1 Genetic Testing and Surveillance", H2))
story.append(Paragraph(
    "Genetic testing is recommended for all patients suspected of MEN and for first-degree "
    "relatives. Once a mutation is identified, surveillance protocols are initiated based on "
    "syndrome type. Annual biochemical and imaging screening is standard.", BODY))

story.append(Paragraph("6.2 MEN 1", H2))
for pt in [
    "<b>Parathyroid:</b> Subtotal (3.5 glands) or total parathyroidectomy with forearm autotransplantation.",
    "<b>Gastrinoma:</b> Proton pump inhibitors for ZES control; surgery for resectable disease.",
    "<b>Insulinoma:</b> Surgical resection; enucleation if solitary.",
    "<b>Pituitary:</b> Dopamine agonists (prolactinoma); transsphenoidal surgery if indicated.",
]:
    story.append(bullet(pt))

story.append(Paragraph("6.3 MEN 2A / 2B", H2))
for pt in [
    "<b>Prophylactic thyroidectomy:</b> Timing depends on RET codon – highest risk (codon 918/MEN2B): within 6 months of birth; high risk: before age 5; moderate risk: by age 5–10.",
    "<b>Pheochromocytoma:</b> Surgical adrenalectomy after alpha-blockade (phenoxybenzamine) to prevent hypertensive crisis.",
    "<b>Parathyroid (MEN2A):</b> Parathyroidectomy if hypercalcemic.",
]:
    story.append(bullet(pt))

story.append(Spacer(1, 0.25*cm))

# ─── SOURCES ───────────────────────────────────────────────────────────────────
story.append(hline("#1a3a5c", 1))
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph(
    "Sources: Robbins & Cotran Pathologic Basis of Disease (10e), Sabiston Textbook of Surgery (21e), "
    "Yamada's Textbook of Gastroenterology (7e) | Compiled by Orris Medical Reference | July 2026",
    SOURCE))

# ─── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF written to: {OUTPUT}")
Running Command

python /tmp/workspace/men-syndromes/generate_pdf.py

Your PDF is ready. Here is the full short note it contains:

Multiple Endocrine Neoplasia (MEN) Syndromes – Pathology Perspective

General Features of MEN Syndromes

MEN syndromes are inherited disorders causing proliferative lesions (hyperplasia, adenomas, carcinomas) in multiple endocrine organs. Compared to sporadic tumors, MEN-associated tumors:
  • Occur at a younger age
  • Arise in multiple organs simultaneously or sequentially
  • Are multifocal within a single organ
  • Are preceded by an asymptomatic hyperplastic stage
  • Are generally more aggressive with higher recurrence

MEN 1 – Werner Syndrome

Gene: MEN1 on chromosome 11q13 (encodes menin, a tumor suppressor) - autosomal dominant Prevalence: 1–3 per 100,000; no sex or race predisposition
The Three Ps:
  • Parathyroid (80–95%) – multiple parathyroid adenomas causing primary hyperparathyroidism (HPT); earliest and most penetrant manifestation; leads to hypercalcemia, nephrolithiasis, ZES
  • Pancreatic/GI NETs – most common: gastrinomas (54%, Zollinger-Ellison syndrome), insulinomas (15%); often multifocal with microadenomas; leading cause of MEN1 mortality
  • Pituitary adenomas (30–40%) – most often prolactinoma; less commonly GH-secreting (acromegaly)
Beyond 3Ps: thymic/bronchial carcinoids, adrenocortical adenomas, meningiomas, angiofibromas, lipomas

MEN 2 – Variants

Gene: RET proto-oncogene on chromosome 10q11 (gain-of-function, tyrosine kinase receptor) - autosomal dominant. Specific codon mutations predict phenotype and risk.
MEN 2A (Sipple)MEN 2B
MTC~100%, multifocal~100%, infancy onset
Pheochromocytoma40–50%Present
Parathyroid10–35% (hyperplasia)Absent
Extra featuresCutaneous lichen amyloidosis (codon 634); Hirschsprung disease (codons 609/618/620)Mucosal neuromas, marfanoid habitus, GI ganglioneuromatosis
Medullary Thyroid Carcinoma pathology: C-cell origin; polygonal/spindle cells in nests; amyloid-rich stroma (calcitonin deposits, Congo red positive); C-cell hyperplasia in adjacent thyroid. Markers: calcitonin, CEA, chromogranin A.
Pheochromocytoma pathology: Adrenal medullary origin; characteristic zellballen (ball-like nests) histology; catecholamine-containing neurosecretory granules on EM.

MEN 4

Gene: CDKN1B (p27 tumor suppressor) – autosomal dominant. MEN1-like phenotype: parathyroid and pituitary adenomas, pancreatic NETs. Some cases also show pheochromocytomas, paragangliomas. Accounts for some patients meeting MEN1 clinical criteria without a MEN1 mutation.

MEN Syndromes Pathology

PDF Document · PDF

The PDF includes a color-coded overview table, all six sections (Introduction, MEN1, MEN2, MEN4, full comparative table, and management principles), sourced from Robbins & Cotran Pathologic Basis of Disease, Sabiston Textbook of Surgery, and Yamada's Textbook of Gastroenterology.

Pdf of detailed answer of this

Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Writing File

~/men-syndromes/generate_detailed_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether, ListFlowable, ListItem
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY, TA_RIGHT
from reportlab.platypus.frames import Frame
from reportlab.platypus.doctemplate import PageTemplate, BaseDocTemplate
from reportlab.lib.colors import HexColor

W, H = A4
LM = RM = 2.0*cm
TM = 2.5*cm
BM = 2.0*cm

# ─── PAGE TEMPLATE WITH HEADER/FOOTER ─────────────────────────────────────────
class MyDocTemplate(BaseDocTemplate):
    def __init__(self, filename, **kwargs):
        BaseDocTemplate.__init__(self, filename, **kwargs)
        frame = Frame(LM, BM + 0.6*cm, W - LM - RM, H - TM - BM - 0.6*cm,
                      id='normal', leftPadding=0, rightPadding=0,
                      topPadding=0, bottomPadding=0)
        template = PageTemplate(id='all', frames=frame,
                                onPage=self._draw_page)
        self.addPageTemplates([template])

    def _draw_page(self, canvas, doc):
        canvas.saveState()
        # Header bar
        canvas.setFillColor(HexColor("#1a3a5c"))
        canvas.rect(LM, H - TM + 4*mm, W - LM - RM, 7*mm, fill=1, stroke=0)
        canvas.setFillColor(colors.white)
        canvas.setFont("Helvetica-Bold", 8)
        canvas.drawString(LM + 3*mm, H - TM + 6.5*mm,
                          "MULTIPLE ENDOCRINE NEOPLASIA (MEN) SYNDROMES — DETAILED PATHOLOGY NOTE")
        canvas.setFont("Helvetica", 8)
        canvas.drawRightString(W - RM - 3*mm, H - TM + 6.5*mm, "Orris Medical Reference | July 2026")
        # Footer
        canvas.setFillColor(HexColor("#1a3a5c"))
        canvas.rect(LM, BM - 2*mm, W - LM - RM, 0.5*mm, fill=1, stroke=0)
        canvas.setFillColor(HexColor("#555555"))
        canvas.setFont("Helvetica", 7.5)
        canvas.drawString(LM, BM - 5*mm,
            "Sources: Robbins & Cotran Pathologic Basis of Disease (10e) | Robbins & Kumar Basic Pathology | Sabiston Textbook of Surgery (21e)")
        canvas.setFont("Helvetica-Bold", 8)
        canvas.drawRightString(W - RM, BM - 5*mm, f"Page {doc.page}")
        canvas.restoreState()

OUTPUT = "/tmp/workspace/men-syndromes/MEN_Syndromes_Detailed.pdf"

doc = MyDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=RM, leftMargin=LM,
    topMargin=TM, bottomMargin=BM + 0.8*cm,
    title="MEN Syndromes – Detailed Pathology Note",
    author="Orris Medical Reference"
)

styles = getSampleStyleSheet()

COVER_TITLE = ParagraphStyle("CoverTitle", fontSize=26, leading=32,
    textColor=HexColor("#1a3a5c"), alignment=TA_CENTER,
    fontName="Helvetica-Bold", spaceAfter=8)
COVER_SUB = ParagraphStyle("CoverSub", fontSize=13, leading=17,
    textColor=HexColor("#4a6fa5"), alignment=TA_CENTER,
    fontName="Helvetica-Oblique", spaceAfter=4)
COVER_INFO = ParagraphStyle("CoverInfo", fontSize=9.5, leading=13,
    textColor=HexColor("#666666"), alignment=TA_CENTER, fontName="Helvetica")

H1 = ParagraphStyle("H1", fontSize=14, leading=18, textColor=colors.white,
    spaceBefore=16, spaceAfter=6, fontName="Helvetica-Bold",
    backColor=HexColor("#1a3a5c"), leftIndent=-0.2*cm, rightIndent=-0.2*cm,
    borderPadding=(5, 8, 5, 8))
H2 = ParagraphStyle("H2", fontSize=12, leading=15, textColor=HexColor("#1a3a5c"),
    spaceBefore=12, spaceAfter=4, fontName="Helvetica-Bold",
    borderPadding=(0, 0, 2, 0))
H3 = ParagraphStyle("H3", fontSize=11, leading=14, textColor=HexColor("#2e6fa3"),
    spaceBefore=8, spaceAfter=2, fontName="Helvetica-Bold")
H4 = ParagraphStyle("H4", fontSize=10.5, leading=13, textColor=HexColor("#1a3a5c"),
    spaceBefore=6, spaceAfter=2, fontName="Helvetica-BoldOblique")
BODY = ParagraphStyle("Body", fontSize=10, leading=14.5, alignment=TA_JUSTIFY,
    spaceAfter=5, fontName="Helvetica")
BULLET = ParagraphStyle("Bullet", fontSize=10, leading=13.5, leftIndent=18,
    firstLineIndent=-12, spaceAfter=3, fontName="Helvetica")
SUBBULLET = ParagraphStyle("SubBullet", fontSize=9.5, leading=13, leftIndent=32,
    firstLineIndent=-12, spaceAfter=2, fontName="Helvetica",
    textColor=HexColor("#333333"))
BOX = ParagraphStyle("Box", fontSize=9.5, leading=13, alignment=TA_JUSTIFY,
    spaceAfter=3, fontName="Helvetica", textColor=HexColor("#1a1a1a"))
CAPTION = ParagraphStyle("Caption", fontSize=8, leading=11,
    textColor=HexColor("#666666"), alignment=TA_CENTER,
    fontName="Helvetica-Oblique", spaceAfter=5)
TBL_HDR = ParagraphStyle("TblHdr", fontSize=8.5, fontName="Helvetica-Bold",
    textColor=colors.white, alignment=TA_CENTER)
TBL_CELL = ParagraphStyle("TblCell", fontSize=8.5, fontName="Helvetica",
    alignment=TA_LEFT, leading=12)

def bul(text, style=None):
    return Paragraph(f"\u2022  {text}", style or BULLET)

def subbul(text):
    return Paragraph(f"\u2013  {text}", SUBBULLET)

def hline(color="#1a3a5c", t=0.8):
    return HRFlowable(width="100%", thickness=t, color=HexColor(color),
                      spaceAfter=4, spaceBefore=2)

def box_table(content_para_list, bg="#eef3f9", border="#2e6fa3"):
    """Wrap paragraphs in a shaded box."""
    tbl = Table([[content_para_list]], colWidths=[W - LM - RM - 0.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",    (0, 0), (-1, -1), HexColor(bg)),
        ("BOX",           (0, 0), (-1, -1), 1.2, HexColor(border)),
        ("LEFTPADDING",   (0, 0), (-1, -1), 8),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 8),
        ("TOPPADDING",    (0, 0), (-1, -1), 6),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 6),
        ("VALIGN",        (0, 0), (-1, -1), "TOP"),
    ]))
    return tbl

story = []

# ════════════════════════════════════════════════════════
# COVER
# ════════════════════════════════════════════════════════
story.append(Spacer(1, 1.5*cm))
story.append(Paragraph("Multiple Endocrine Neoplasia", COVER_TITLE))
story.append(Paragraph("(MEN) Syndromes", COVER_TITLE))
story.append(Spacer(1, 0.4*cm))
story.append(hline("#1a3a5c", 2))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("Detailed Pathology Perspective", COVER_SUB))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
    "A comprehensive clinical and pathological reference note covering MEN1, MEN2A, MEN2B, "
    "MEN4 and MEN5 — genetics, molecular mechanisms, organ-by-organ pathology, clinical "
    "manifestations, diagnostic criteria, screening protocols, and management principles.",
    COVER_INFO))
story.append(Spacer(1, 0.5*cm))

# Summary table
cov_data = [
    [Paragraph("Syndrome", TBL_HDR), Paragraph("Alias", TBL_HDR),
     Paragraph("Gene / Locus", TBL_HDR), Paragraph("Core Tumors", TBL_HDR),
     Paragraph("Inheritance", TBL_HDR)],
    [Paragraph("MEN 1", TBL_CELL), Paragraph("Werner syndrome", TBL_CELL),
     Paragraph("MEN1 – 11q13\n(Menin, TSG)", TBL_CELL),
     Paragraph("Parathyroid · Pancreatic NETs · Pituitary", TBL_CELL),
     Paragraph("AD", TBL_CELL)],
    [Paragraph("MEN 2A", TBL_CELL), Paragraph("Sipple syndrome", TBL_CELL),
     Paragraph("RET – 10q11.2\n(Proto-oncogene)", TBL_CELL),
     Paragraph("MTC · Pheochromocytoma · Parathyroid", TBL_CELL),
     Paragraph("AD", TBL_CELL)],
    [Paragraph("MEN 2B", TBL_CELL), Paragraph("(formerly MEN 3)", TBL_CELL),
     Paragraph("RET – 10q11.2\nCodon 918 (M918T)", TBL_CELL),
     Paragraph("MTC · Pheo · Mucosal neuromas · Marfanoid", TBL_CELL),
     Paragraph("AD", TBL_CELL)],
    [Paragraph("MEN 4", TBL_CELL), Paragraph("MEN1-like", TBL_CELL),
     Paragraph("CDKN1B (p27)\nTSG", TBL_CELL),
     Paragraph("Parathyroid · Pituitary · Pancreatic NETs", TBL_CELL),
     Paragraph("AD", TBL_CELL)],
    [Paragraph("MEN 5", TBL_CELL), Paragraph("–", TBL_CELL),
     Paragraph("MAX – TSG", TBL_CELL),
     Paragraph("Bilateral Pheo · Other tumors\n(No MTC / C-cell hyperplasia)", TBL_CELL),
     Paragraph("AD", TBL_CELL)],
]
cw = [1.8*cm, 2.6*cm, 3.4*cm, 6.2*cm, 2.3*cm]
cov_tbl = Table(cov_data, colWidths=cw, repeatRows=1)
cov_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#1a3a5c")),
    ("FONTNAME",      (0, 0), (-1, 0),  "Helvetica-Bold"),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#dde8f5"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.5, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 5),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5),
]))
story.append(cov_tbl)
story.append(Spacer(1, 0.15*cm))
story.append(Paragraph("AD = Autosomal Dominant · TSG = Tumor Suppressor Gene · MTC = Medullary Thyroid Carcinoma · Pheo = Pheochromocytoma · NETs = Neuroendocrine Tumors", CAPTION))

story.append(PageBreak())

# ════════════════════════════════════════════════════════
# SECTION 1 – INTRODUCTION
# ════════════════════════════════════════════════════════
story.append(Paragraph("1. Introduction to MEN Syndromes", H1))
story.append(Paragraph(
    "The Multiple Endocrine Neoplasia (MEN) syndromes represent a group of inherited diseases "
    "causing proliferative lesions — hyperplasia, adenomas, and carcinomas — in multiple "
    "endocrine organs. They are paradigm examples of <b>inherited cancer predisposition</b> "
    "involving endocrine tissues. Unlike most sporadic endocrine tumors, MEN-associated neoplasms "
    "have several pathologically distinct characteristics:", BODY))

for pt in [
    "<b>Earlier age of onset</b> — tumors develop decades before sporadic counterparts.",
    "<b>Multiorgan involvement</b> — two or more endocrine glands affected, either simultaneously (synchronous) or at different times (metachronous).",
    "<b>Multifocality</b> — even within a single organ, multiple independent tumor foci arise.",
    "<b>Precursor hyperplasia</b> — tumor development is almost invariably preceded by an asymptomatic hyperplastic stage of the cell of origin (e.g., C-cell hyperplasia before MTC in MEN2).",
    "<b>Greater aggressiveness</b> — higher recurrence rates and more aggressive behavior compared with histologically similar sporadic tumors.",
    "<b>Autosomal dominant inheritance</b> — all main MEN syndromes follow an AD pattern, implying 50% transmission risk to offspring.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
    "The underlying molecular basis follows either the <b>two-hit tumor suppressor model</b> "
    "(MEN1, MEN4 — loss-of-function mutations in menin or p27) or an <b>oncogenic gain-of-function "
    "model</b> (MEN2A/2B — activating RET proto-oncogene mutations). This mechanistic distinction "
    "has profound implications for pathogenesis, phenotypic expression, and clinical management.", BODY))

story.append(Spacer(1, 0.3*cm))

# ════════════════════════════════════════════════════════
# SECTION 2 – MEN 1
# ════════════════════════════════════════════════════════
story.append(Paragraph("2. MEN Type 1 — Werner Syndrome", H1))

story.append(Paragraph("2.1 Epidemiology", H2))
story.append(Paragraph(
    "MEN1 is rare, with a <b>prevalence of 1–3 per 100,000</b> in the general population. "
    "Germline MEN1 mutations are identified in 1–18% of patients with reportedly sporadic "
    "primary hyperparathyroidism (PHPT) and in fewer than 3% of pituitary tumor patients. "
    "MEN1 shows <b>no racial, ethnic, or sex predisposition</b> — it affects males and females "
    "equally. Clinical manifestations are present by age 50 in 75% of mutation carriers. "
    "Without treatment, patients have a 50% probability of death by the age of 50, "
    "historically from Zollinger-Ellison syndrome (ZES) complications (bleeding, perforation). "
    "The introduction of proton pump inhibitors (PPIs) has dramatically improved survival.", BODY))

story.append(Paragraph("2.2 Molecular Genetics and Pathogenesis", H2))
story.append(Paragraph(
    "MEN1 follows an <b>autosomal dominant, two-hit tumor suppressor model</b>. The causative "
    "gene, <b>MEN1</b>, is located on <b>chromosome 11q13</b> and encodes a 610-amino acid "
    "nuclear protein called <b>menin</b>.", BODY))

story.append(Paragraph("Menin — Structure and Function", H3))
for pt in [
    "Menin resides primarily in the cell <b>nucleus</b>.",
    "It is a component of <b>multiple transcription factor complexes</b> — depending on binding partners and cell context, it can either promote or inhibit tumorigenesis.",
    "Loss of menin leads to <b>deregulation of binding partners</b>, promoting uncontrolled transcriptional activity and neoplasia.",
    "Menin also has a pro-oncogenic role in <b>mixed lineage leukemia (MLL)</b> via interaction with MLL-1 fusion proteins and may regulate <b>estrogen receptor signaling</b> (linked to increased breast cancer risk in some studies).",
]:
    story.append(bul(pt))

story.append(Paragraph("Mutational Landscape", H3))
for pt in [
    "Over <b>1,600 mutations</b> in MEN1 have been described; <b>85% germline, 15% somatic</b>.",
    "Nearly <b>70% of germline mutations are pathogenic</b>: frameshift (42%), nonsense (14%), splicing defects (11%).",
    "Mutations are <b>dispersed throughout the coding region</b> — no mutational hotspot (unlike RET in MEN2).",
    "~<b>5–20% of clinically diagnosed MEN1 cases</b> have no identifiable coding-region mutation (may involve promoter or regulatory regions).",
    "Loss of heterozygosity (LOH) at 11q13 is the second hit confirming the two-hit model.",
]:
    story.append(bul(pt))

story.append(Paragraph("Diagnostic Criteria", H3))
story.append(Paragraph(
    "MEN1 is diagnosed clinically when a patient has:", BODY))
for pt in [
    "<b>Two or more</b> primary MEN1-associated tumors (parathyroid, enteropancreatic NET, pituitary), OR",
    "<b>One MEN1-associated tumor PLUS</b> a first-degree relative with MEN1.",
    "Genetic testing is confirmatory and recommended for all suspected patients and relatives.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.2*cm))

story.append(Paragraph("2.3 Clinical Manifestations — Organ by Organ", H2))

# Parathyroid box
story.append(Paragraph("A. Parathyroid (80–95% penetrance — Most Common Manifestation)", H3))
story.append(Paragraph(
    "Primary hyperparathyroidism (PHPT) is the <b>earliest and most penetrant</b> feature of "
    "MEN1, present in 80–95% of patients, appearing in nearly all by age 40–50. Unlike sporadic "
    "PHPT (which usually involves a single adenoma), MEN1-related PHPT presents as "
    "<b>multiple parathyroid adenomas in separate glands</b> (though often described as "
    "four-gland hyperplasia).", BODY))
for pt in [
    "<b>Biochemistry:</b> Elevated serum calcium with inappropriately non-suppressed PTH.",
    "<b>Clinical effects:</b> Nephrolithiasis (calcium oxalate/phosphate stones), osteopenia/osteoporosis, fatigue, depression, anxiety. The mnemonic: <i>Bones, Stones, Groans, Moans (psychic overtones)</i>.",
    "<b>Compared to sporadic PHPT:</b> Earlier onset, equal sex ratio, greater severity of bone and renal involvement.",
    "<b>Surgery:</b> Subtotal parathyroidectomy (3.5 glands) or total parathyroidectomy with forearm autotransplantation. Preoperative imaging (sestamibi, 4D-CT) has limited utility compared with sporadic PHPT due to multiglandular disease.",
    "<b>Co-existing gastrinoma:</b> Parathyroidectomy is recommended first as hypercalcemia independently raises gastrin levels — correcting calcium reduces acid hypersecretion.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.15*cm))

story.append(Paragraph("B. Pancreatic / Gastropancreatic NETs (Leading Cause of Mortality)", H3))
story.append(Paragraph(
    "Pancreatic and duodenal neuroendocrine tumors (NETs) are the <b>leading cause of death</b> "
    "in MEN1. They are usually <b>aggressive, often multifocal</b>, with microadenomas scattered "
    "throughout the pancreas alongside dominant lesions. The duodenum is the most common site "
    "for gastrinomas (more frequent than pancreatic gastrinomas). Synchronous duodenal and "
    "pancreatic tumors may coexist.", BODY))

# Sub-table for pancreatic NETs
pnet_data = [
    [Paragraph("Tumor Type", TBL_HDR), Paragraph("Frequency in MEN1", TBL_HDR),
     Paragraph("Clinical Syndrome", TBL_HDR), Paragraph("Key Features", TBL_HDR)],
    ["Gastrinoma", "~50-54%", "Zollinger-Ellison Syndrome (ZES)",
     "Recurrent peptic ulcers, multiple/atypical sites, chronic diarrhea, GERD"],
    ["Insulinoma", "~15%", "Hypoglycemia syndrome",
     "Recurrent hypoglycemia, neurological symptoms (Whipple's triad)"],
    ["Non-functional NET", "~20-30%", "No hormonal syndrome", "Detected incidentally; risk of malignancy"],
    ["VIPoma", "Rare", "Verner-Morrison / WDHA", "Watery diarrhea, hypokalemia, achlorhydria"],
    ["Glucagonoma", "Rare", "Glucagonoma syndrome", "Necrolytic migratory erythema, DM, DVT"],
    ["PPoma", "Common", "None (PP excess)", "Non-functional; PP secretion alone"],
]
pnet_cw = [3.2*cm, 2.8*cm, 3.8*cm, 6.5*cm]
pnet_tbl = Table([[Paragraph(str(r[0]), TBL_CELL if i > 0 else BOX),
                   Paragraph(str(r[1]), TBL_CELL if i > 0 else BOX),
                   Paragraph(str(r[2]), TBL_CELL if i > 0 else BOX),
                   Paragraph(str(r[3]), TBL_CELL if i > 0 else BOX)]
                  for i, r in enumerate(pnet_data)],
                 colWidths=pnet_cw, repeatRows=1)
pnet_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#2e6fa3")),
    ("FONTNAME",      (0, 0), (-1, 0),  "Helvetica-Bold"),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#eef2f7"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 4),
    ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5),
    ("FONTSIZE",      (0, 0), (-1, -1), 8.5),
]))
story.append(pnet_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: Pancreatic/duodenal NETs in MEN1 – types, frequency, and clinical syndromes.", CAPTION))

story.append(Paragraph("Gastrinoma — Zollinger-Ellison Syndrome (ZES)", H4))
for pt in [
    "ZES is characterized by recurrent multiple peptic ulcers, abdominal pain, chronic diarrhea, and GERD.",
    "<b>Diagnosis:</b> Elevated fasting serum gastrin (>1000 pg/mL with gastric acid = definitive). If below threshold: secretin stimulation test (>200 pg/mL rise is diagnostic).",
    "<b>Management:</b> PPIs control acid hypersecretion in most patients. Surgical cure rate is low due to multifocality and early nodal metastases. Disease is often indolent despite metastases.",
]:
    story.append(bul(pt))

story.append(Paragraph("Insulinoma", H4))
for pt in [
    "Presents with Whipple's triad: (1) hypoglycemic symptoms, (2) documented low blood glucose, (3) symptom relief with glucose.",
    "Surgical enucleation for solitary lesion. Distal pancreatectomy for body/tail lesions. Medical options: diazoxide, somatostatin analogues.",
]:
    story.append(bul(pt))

story.append(Paragraph("Imaging of Enteropancreatic NETs", H4))
for pt in [
    "<b>CT:</b> Hypervascular lesions with arterial-phase enhancement; sensitivity 73-80%.",
    "<b>MRI:</b> T1 hypointense, T2 hyperintense with arterial hyperenhancement; specificity 78–100%; sensitivity increases with tumor size.",
    "<b>Somatostatin receptor scintigraphy (SRS):</b> Sensitivity 40–70%, specificity 92–100%.",
    "<b>68Ga-DOTATATE PET/CT:</b> Sensitivity 88–93%, specificity 88–95%; lower radiation dose than SRS; preferred for metastasis detection.",
    "<b>Endoscopic ultrasound (EUS):</b> Best for small pancreatic head lesions.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.15*cm))

story.append(Paragraph("C. Pituitary Adenomas (30–60%)", H3))
story.append(Paragraph(
    "The prevalence of pituitary adenomas in MEN1 ranges from 30–60%, typically presenting "
    "in the fourth decade. Only 1% of sporadic pituitary adenoma patients have MEN1.", BODY))
for pt in [
    "<b>Most common: Prolactinoma (57% of MEN1 pituitary tumors)</b> — amenorrhea, galactorrhea, loss of libido, infertility.",
    "<b>Somatotroph adenoma:</b> GH excess — acromegaly (adults), gigantism (children), glucose intolerance.",
    "<b>Corticotroph (ACTH) adenoma:</b> Cushing's disease — rare in MEN1.",
    "<b>Non-functional:</b> Present with mass effects — visual field defects (bitemporal hemianopia), headache.",
    "<b>MEN1 pituitary tumors are larger</b> (macroadenomas >1 cm more common) and more often <b>secrete multiple hormones</b> compared with sporadic forms.",
    "<b>Screening:</b> Annual prolactin + IGF-1 from age 5; MRI every 3 years.",
    "<b>Treatment:</b> Dopamine agonists (cabergoline) for prolactinomas; somatostatin analogues/surgery for GH-secreting tumors. Note: lower proportion achieve hormonal normalization than sporadic counterparts.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.15*cm))

story.append(Paragraph("D. Beyond the Three Ps — Other MEN1 Manifestations", H3))
pane_data = [
    ["Tumor / Lesion", "Frequency", "Key Notes"],
    ["Thymic carcinoid", "~5%", "Most are malignant and aggressive; poor prognosis; CT/MRI every 1–2 yrs"],
    ["Bronchial carcinoid", "Rare", "Usually benign; surveillance with CT/MRI"],
    ["Adrenocortical tumor", "~20% (hyperplasia)", "Increased risk of ACC and primary hyperaldosteronism; pheochromocytoma less frequent than in MEN2"],
    ["Lipomas", "Common", "Subcutaneous; no malignant potential"],
    ["Facial angiofibromas", "~80%", "Cutaneous marker; multiple perinasal lesions"],
    ["Collagenomas", "~70%", "Skin-colored papules on trunk"],
    ["Meningioma / ependymoma", "Rare", "CNS involvement"],
]
pane_cw = [4.4*cm, 2.4*cm, 9.5*cm]
pane_tbl = Table([[Paragraph(str(c), TBL_CELL if i > 0 else TBL_HDR) for c in r]
                  for i, r in enumerate(pane_data)],
                 colWidths=pane_cw, repeatRows=1)
pane_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#2e6fa3")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#eef2f7"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 4), ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5), ("FONTSIZE", (0, 0), (-1, -1), 8.5),
]))
story.append(pane_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: Additional MEN1-associated tumors beyond the classic three Ps.", CAPTION))

story.append(Spacer(1, 0.2*cm))

story.append(Paragraph("2.4 MEN1 Surveillance Protocol", H2))
surv_data = [
    ["Organ / Marker", "Test", "Frequency", "Age to Start"],
    ["Parathyroid / Calcium", "Serum Ca²⁺, PTH", "Annual", "Age 8"],
    ["Gastrinoma", "Fasting gastrin, gastric pH", "Annual", "Age 20"],
    ["Insulinoma", "Fasting glucose, insulin", "Annual", "Age 5"],
    ["Other pancreatic NETs", "CT / MRI abdomen, EUS", "Annual", "Age 20"],
    ["Pituitary", "Prolactin, IGF-1", "Annual", "Age 5"],
    ["Pituitary (imaging)", "MRI pituitary", "Every 3 years", "Age 5"],
    ["Thymic/bronchial carcinoid", "CT chest / MRI", "Every 1–2 years", "Age 15"],
    ["Adrenal", "CT abdomen", "Every 1–2 years", "Age 20"],
]
surv_cw = [4.0*cm, 4.2*cm, 3.0*cm, 2.8*cm]
surv_tbl = Table([[Paragraph(str(c), TBL_CELL if i > 0 else TBL_HDR) for c in r]
                  for i, r in enumerate(surv_data)],
                 colWidths=surv_cw, repeatRows=1)
surv_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#1a3a5c")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#f5f8fc"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 4), ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5), ("FONTSIZE", (0, 0), (-1, -1), 8.5),
]))
story.append(surv_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: MEN1 biochemical and imaging surveillance — recommended schedule.", CAPTION))

story.append(PageBreak())

# ════════════════════════════════════════════════════════
# SECTION 3 – MEN 2
# ════════════════════════════════════════════════════════
story.append(Paragraph("3. MEN Type 2 — Sipple Syndrome and Variants", H1))

story.append(Paragraph("3.1 Epidemiology", H2))
story.append(Paragraph(
    "The prevalence of MEN2A is approximately <b>20 per million</b>; MEN2B is rarer at "
    "<b>2 per million</b>. Incidence ranges 8–28 and 1–3 per million live births, respectively. "
    "MEN2 accounts for approximately <b>25% of all medullary thyroid carcinoma (MTC)</b> cases "
    "— the remainder being sporadic (though even apparently sporadic MTC may harbor germline "
    "RET mutations and warrant testing).", BODY))

story.append(Paragraph("3.2 Molecular Genetics — RET Proto-Oncogene", H2))
story.append(Paragraph(
    "All MEN2 variants are caused by <b>activating (gain-of-function) germline missense mutations "
    "in the RET proto-oncogene</b>, located on <b>chromosome 10q11.2</b>.", BODY))

story.append(Paragraph("RET Protein Structure and Function", H3))
for pt in [
    "RET encodes a <b>transmembrane receptor tyrosine kinase</b> with: extracellular ligand-binding domain, transmembrane domain, and intracellular tyrosine kinase domain.",
    "Normal RET activation requires a <b>multi-protein ligand complex</b> (glial-derived neurotrophic factor / GDNF family), leading to receptor dimerization and downstream signaling for cell growth, differentiation, and survival.",
    "RET is expressed in <b>neural crest-derived tissues</b>: thyroid C cells, adrenal chromaffin cells, parathyroid glands, enteric ganglia, peripheral/central neurons.",
    "<b>Gain-of-function mutations (MEN2A/2B):</b> Constitutive ligand-independent RET activation — unregulated cell proliferation and tumor development.",
    "<b>Loss-of-function mutations (Hirschsprung disease):</b> Failure of enteric neuron development — intestinal aganglionosis, megacolon.",
    "Inactivating RET mutations in mice cause renal agenesis and absence of intestinal neurons.",
]:
    story.append(bul(pt))

story.append(Paragraph("Genotype-Phenotype Correlation (Key Clinical Tool)", H3))
story.append(Paragraph(
    "Unlike MEN1 (mutations scattered widely), MEN2 mutations <b>cluster in specific codons</b> "
    "and strongly predict phenotype, tumor aggressiveness, and age of MTC onset — forming the "
    "basis for risk-stratified management:", BODY))

ret_data = [
    ["Risk Category", "RET Codon(s)", "MEN2 Phenotype", "Recommended Thyroidectomy"],
    ["Highest (D)", "918 (M918T)", "MEN2B — most aggressive MTC (infantile)", "Within 6 months of birth"],
    ["High (C)", "634, 883", "Classical MEN2A / MEN2B variants", "Before age 5 years"],
    ["Moderate (B)", "609, 611, 618, 620, 630, 768, 790, 804, 891", "MEN2A / FMTC", "Before age 5–10 (individual assessment)"],
    ["Lower (A)", "533, 768, 912, others", "FMTC (MTC only, later onset)", "Consider by age 10; individualized"],
]
ret_cw = [2.8*cm, 3.5*cm, 4.0*cm, 5.9*cm]
ret_tbl = Table([[Paragraph(str(c), TBL_CELL if i > 0 else TBL_HDR) for c in r]
                 for i, r in enumerate(ret_data)],
                colWidths=ret_cw, repeatRows=1)
ret_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#1a3a5c")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#fff3e0"), HexColor("#fffbf5"),
                                          HexColor("#e8f5e9"), HexColor("#f1f8e9")]),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 4), ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5), ("FONTSIZE", (0, 0), (-1, -1), 8.5),
    ("FONTNAME",      (0, 1), (0, -1),  "Helvetica-Bold"),
]))
story.append(ret_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: ATA risk stratification for MEN2 based on RET codon — guides timing of prophylactic thyroidectomy.", CAPTION))

story.append(Spacer(1, 0.2*cm))

story.append(Paragraph("3.3 MEN 2A — Classic Sipple Syndrome", H2))
story.append(Paragraph(
    "MEN2A is the most common form, with <b>three defining tumor types</b>:", BODY))

story.append(Paragraph("A. Medullary Thyroid Carcinoma (MTC) — ~100% penetrance", H3))
story.append(Paragraph(
    "MTC is present in virtually all untreated MEN2A patients, usually developing in the "
    "<b>first two decades of life</b>. It is the primary cause of MEN2-related mortality.", BODY))
for pt in [
    "<b>Cell of origin:</b> Parafollicular C cells (neural crest-derived), which normally secrete calcitonin.",
    "<b>Gross pathology:</b> Multifocal, firm, grey-white tumors within the thyroid.",
    "<b>Histology:</b> Polygonal to spindle-shaped cells arranged in nests, trabeculae, or sheets. <b>Amyloid-rich stroma</b> — deposits are composed of calcitonin fibrils, staining with Congo red (apple-green birefringence under polarized light).",
    "<b>C-cell hyperplasia:</b> Invariably present in the surrounding thyroid parenchyma in hereditary cases (a precursor/marker of familial disease; absent or rare in sporadic MTC).",
    "<b>Electron microscopy:</b> Variable numbers of membrane-bound, electron-dense neurosecretory granules (catecholamine/calcitonin storage).",
    "<b>Immunohistochemistry:</b> Strongly positive for calcitonin, CEA (carcinoembryonic antigen), chromogranin A, synaptophysin.",
    "<b>Tumor marker:</b> Serum calcitonin — used for diagnosis, post-operative surveillance, and detection of residual/recurrent disease. CEA is a second marker.",
    "<b>Familial vs Sporadic:</b> Familial MTC is multifocal and bilateral; sporadic MTC is usually unilateral and solitary.",
]:
    story.append(bul(pt))

story.append(Paragraph("B. Pheochromocytoma — 40–50% of MEN2A patients", H3))
story.append(Paragraph(
    "Arise from <b>adrenal medullary chromaffin cells</b>. In MEN2A, pheochromocytomas are "
    "often bilateral (vs. sporadic, which are usually unilateral).", BODY))
for pt in [
    "<b>Pathogenesis:</b> MEN2A pheochromocytomas are bilateral in ~50% of cases, and no more than 10% are malignant.",
    "<b>Gross pathology:</b> Well-encapsulated tumors within attenuated adrenal cortex; areas of hemorrhage and necrosis common.",
    "<b>Histology:</b> Classic <i>zellballen</i> (ball-like nests) pattern; cells have abundant cytoplasm; nuclear pleomorphism can be present even in benign tumors.",
    "<b>Electron microscopy:</b> Membrane-bound electron-dense secretory granules containing catecholamines (epinephrine, norepinephrine).",
    "<b>Clinical:</b> Episodic hypertension, headache, palpitations, sweating (catecholamine excess). May also secrete corticotropin, somatostatin.",
    "<b>Laboratory diagnosis:</b> Elevated 24-hour urinary catecholamines/metanephrines, or elevated plasma metanephrines.",
    "<b>In MEN2A:</b> Pheochromocytoma must be identified and treated BEFORE thyroidectomy to prevent intraoperative hypertensive crisis.",
]:
    story.append(bul(pt))

story.append(Paragraph("C. Primary Hyperparathyroidism — 10–35% of MEN2A patients", H3))
story.append(Paragraph(
    "Less prevalent and less severe than in MEN1. Caused by parathyroid hyperplasia or "
    "adenoma. Manifests as hypercalcemia, nephrolithiasis, and bone disease. "
    "Treatment is parathyroidectomy if symptomatic.", BODY))

story.append(Spacer(1, 0.15*cm))
story.append(Paragraph("3.4 MEN2A Subclassifications", H2))
sub_data = [
    ["Subtype", "Prevalence", "Key RET Codon", "Distinguishing Features"],
    ["Classical MEN2A", "Most common", "634 (most)",
     "Full triad: MTC (~95%), Pheo (40-50%), Parathyroid (10-35%)"],
    ["MEN2A + Cutaneous Lichen Amyloidosis", "Uncommon", "634",
     "Pruritic cutaneous plaques on back; amyloid in papillary dermis from repeated scratching"],
    ["MEN2A + Hirschsprung Disease", "~7% of MEN2A", "609, 618, 620",
     "Congenital aganglionosis of distal colon; abdominal distension, megacolon in neonates; MTC 77%, Pheo 17%"],
    ["Familial MTC (FMTC)", "Variable", "533, 768, 804",
     "MTC only; no pheo or parathyroid disease; diagnosis ~20 years later than classical MEN2A; more indolent"],
]
sub_cw = [3.5*cm, 2.3*cm, 2.5*cm, 8.0*cm]
sub_tbl = Table([[Paragraph(str(c), TBL_CELL if i > 0 else TBL_HDR) for c in r]
                 for i, r in enumerate(sub_data)],
                colWidths=sub_cw, repeatRows=1)
sub_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#2e6fa3")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#eef2f7"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 4), ("BOTTOMPADDING", (0, 0), (-1, -1), 4),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5), ("FONTSIZE", (0, 0), (-1, -1), 8.5),
]))
story.append(sub_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: MEN2A clinical subclassifications with genotype-phenotype correlations.", CAPTION))

story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("3.5 MEN 2B (formerly MEN 3) — Most Aggressive Variant", H2))
story.append(Paragraph(
    "MEN2B is the most aggressive MEN2 form. It is caused by a single missense mutation at "
    "<b>codon 918 (M918T)</b> in the RET tyrosine kinase domain in virtually all cases. This "
    "substitution causes <b>constitutive RET activation without ligand</b> and is associated "
    "with the earliest and most aggressive MTC.", BODY))

story.append(Paragraph("Key Features of MEN2B", H3))
for pt in [
    "<b>MTC:</b> Often presents in <b>infancy</b>; most aggressive of all MEN2 variants; prophylactic thyroidectomy within the first 6 months of life is recommended.",
    "<b>Pheochromocytoma:</b> Present in similar proportion to MEN2A; bilateral; pre-operative alpha blockade mandatory.",
    "<b>Primary hyperparathyroidism:</b> ABSENT in MEN2B — this is a key distinguishing feature from MEN2A.",
    "<b>Mucosal neuromas:</b> Ganglioneuromas on lips, tongue, eyelids, conjunctiva — highly specific; often the first visible feature in infancy.",
    "<b>GI ganglioneuromatosis:</b> Transmural involvement of the gut wall; causes abdominal distension, constipation, megacolon.",
    "<b>Marfanoid habitus:</b> Tall, slender build; long extremities; hyperextensible joints; resembles Marfan syndrome but without lens dislocation or cardiovascular defects.",
    "<b>No parathyroid disease</b> unlike MEN2A.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("3.6 MEN2 Management Summary", H2))
for pt in [
    "<b>Genetic testing:</b> All patients with MTC — sporadic or familial — should undergo germline RET testing. First-degree relatives of confirmed mutation carriers need genetic counseling and testing.",
    "<b>Prophylactic thyroidectomy:</b> Timing based on ATA risk category (codon). Highest risk (codon 918/MEN2B): within 6 months of birth. Pre-operative calcitonin level guides extent of surgery.",
    "<b>Pheochromocytoma management:</b> (1) Pre-operative alpha-adrenergic blockade (phenoxybenzamine) ≥10–14 days. (2) Adequate salt and fluid loading. (3) Laparoscopic adrenalectomy. Beta-blockers added only after alpha blockade to avoid unopposed alpha crisis.",
    "<b>Parathyroid (MEN2A):</b> Parathyroidectomy if symptomatic hypercalcemia; resect at time of thyroidectomy if enlarged glands identified.",
    "<b>Post-thyroidectomy follow-up:</b> Calcitonin and CEA every 6 months; undetectable calcitonin = biochemical cure.",
]:
    story.append(bul(pt))

story.append(PageBreak())

# ════════════════════════════════════════════════════════
# SECTION 4 – MEN 4 & MEN 5
# ════════════════════════════════════════════════════════
story.append(Paragraph("4. MEN Type 4 and MEN Type 5 — Emerging Entities", H1))

story.append(Paragraph("4.1 MEN Type 4", H2))
story.append(Paragraph(
    "MEN4 is a recently characterized autosomal dominant syndrome that <b>phenocopies MEN1</b> "
    "but is caused by germline <b>inactivating mutations in CDKN1B</b>, which encodes the "
    "cell-cycle checkpoint protein <b>p27 (Kip1)</b> — a cyclin-dependent kinase inhibitor "
    "that normally restricts G1-S cell cycle transition.", BODY))
for pt in [
    "<b>Gene:</b> CDKN1B on chromosome 12p13; p27 acts as a tumor suppressor.",
    "<b>Tumors:</b> Parathyroid adenomas (most common), pituitary adenomas, pancreatic NETs.",
    "<b>Some MEN4 cases</b> also show features of MEN2 — pheochromocytomas, paragangliomas, thyroid tumors.",
    "MEN4 may account for patients who <b>clinically meet MEN1 criteria but lack a MEN1 gene mutation</b>.",
    "Investigation is ongoing; prevalence and full clinical spectrum are not yet fully defined.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.15*cm))

story.append(Paragraph("4.2 MEN Type 5", H2))
story.append(Paragraph(
    "MEN5 is the newest recognized MEN syndrome, caused by germline mutations in the "
    "<b>MAX tumor suppressor gene</b>.", BODY))
for pt in [
    "<b>Gene:</b> MAX (MYC-associated factor X) — tumor suppressor.",
    "<b>Key tumor:</b> Bilateral pheochromocytomas.",
    "<b>Critically differs from MEN2:</b> Medullary thyroid carcinoma and C-cell hyperplasia are <b>absent</b> in MEN5.",
    "Other tumors may occur; full phenotype under investigation.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.25*cm))

# ════════════════════════════════════════════════════════
# SECTION 5 – PATHOLOGY COMPARISON
# ════════════════════════════════════════════════════════
story.append(Paragraph("5. Detailed Pathological Comparison Table", H1))

comp_data = [
    [Paragraph("Feature", TBL_HDR), Paragraph("MEN 1", TBL_HDR),
     Paragraph("MEN 2A", TBL_HDR), Paragraph("MEN 2B", TBL_HDR),
     Paragraph("MEN 4", TBL_HDR)],
    ["Gene", "MEN1\n(chr 11q13)", "RET\n(chr 10q11.2)", "RET\n(chr 10q11.2)", "CDKN1B\n(chr 12p13)"],
    ["Protein", "Menin (TSG)", "RET TK receptor\n(proto-oncogene)", "RET TK receptor\n(proto-oncogene)", "p27/Kip1 (TSG)"],
    ["Mutation type", "Loss-of-function\n(2-hit model)", "Gain-of-function\n(constitutive RET)", "M918T codon\n(tyrosine kinase domain)", "Loss-of-function\n(p27 reduction)"],
    ["Inheritance", "AD", "AD", "AD", "AD"],
    ["Parathyroid\n(80–95%)", "Multiple adenomas\n→ PHPT (~100%)", "Hyperplasia\n(10–35%)", "ABSENT", "Adenoma\n(variable)"],
    ["Pancreas /\nGI NETs", "Gastrinoma, insulinoma,\nVIPoma, glucagonoma", "–", "GI ganglioneuroma\n(not NET)", "PNETs (variable)"],
    ["Pituitary", "Prolactinoma (most common),\nGH adenoma, ACTH adenoma", "–", "–", "Adenoma\n(variable)"],
    ["Thyroid", "–", "MTC (~100%)\nmultifocal, bilateral", "MTC (infancy)\nmost aggressive", "–"],
    ["Adrenal /\nPheochromocy-\ntoma", "Cortical adenoma (~20%)\nPheo rare", "Pheo (40–50%)\noften bilateral", "Pheo\n(bilateral)", "Pheo\n(some cases)"],
    ["Other\nfindings", "Thymic carcinoid, lipoma,\nangiofibroma, collagenoma,\nmeningioma", "Cutaneous lichen\namyloidosis (codon 634);\nHirschsprung Dx\n(codons 609/618/620)", "Mucosal neuromas\nMarfanoid habitus\nGI ganglioneuromatosis\nNo parathyroid Dx", "Pheo, paraganglioma\n(some cases)"],
    ["Key biomarker", "Calcium, PTH, gastrin,\nchromogranin A, prolactin,\nIGF-1", "Calcitonin, CEA", "Calcitonin, CEA", "Calcium, PTH,\nprolactin, IGF-1"],
    ["Mortality risk", "NETs (gastrinoma,\nthymic carcinoid)", "Medullary thyroid CA", "MTC (earliest onset,\nmost aggressive)", "Similar to MEN1\n(NETs, parathyroid)"],
]
cw3 = [3.0*cm, 3.7*cm, 3.7*cm, 3.7*cm, 2.2*cm]
comp_tbl = Table([[Paragraph(str(c), TBL_CELL if i > 0 else TBL_HDR) for c in r]
                  for i, r in enumerate(comp_data)],
                 colWidths=cw3, repeatRows=1)
comp_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#1a3a5c")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#f0f4f9"), colors.white]),
    ("BACKGROUND",    (0, 1), (0, -1),  HexColor("#c8d8ea")),
    ("FONTNAME",      (0, 1), (0, -1),  "Helvetica-Bold"),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#999999")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 5), ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5), ("FONTSIZE", (0, 0), (-1, -1), 8.5),
    ("FONTNAME",      (0, 0), (-1, 0),  "Helvetica-Bold"),
]))
story.append(comp_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: Comprehensive comparison of MEN syndromes — genetics, pathology, clinical features.", CAPTION))

story.append(PageBreak())

# ════════════════════════════════════════════════════════
# SECTION 6 – PATHOLOGICAL MECHANISMS
# ════════════════════════════════════════════════════════
story.append(Paragraph("6. Molecular Pathological Mechanisms", H1))

story.append(Paragraph("6.1 MEN1 — Two-Hit Tumor Suppressor Model", H2))
story.append(Paragraph(
    "Menin loss follows Knudson's two-hit hypothesis:", BODY))
for pt in [
    "<b>Hit 1:</b> Germline loss-of-function mutation in one MEN1 allele (inherited). All cells carry this first hit.",
    "<b>Hit 2:</b> Somatic mutation, deletion, or loss of heterozygosity (LOH) at 11q13 in a target endocrine cell.",
    "Complete loss of functional menin in that cell removes tumor suppression, enabling uncontrolled proliferation.",
    "Menin controls transcription by interacting with HDACs, mixed lineage leukemia (MLL) complexes, JunD, and other factors — loss leads to epigenetic deregulation.",
]:
    story.append(bul(pt))

story.append(Paragraph("6.2 MEN2 — Oncogenic Gain-of-Function Model", H2))
story.append(Paragraph(
    "Unlike MEN1, a single germline missense mutation in RET is sufficient for tumor predisposition "
    "(one-hit oncogene activation):", BODY))
for pt in [
    "<b>MEN2A mutations</b> typically occur in extracellular cysteine-rich codons (e.g., 634) — unpaired cysteine forms an intermolecular disulfide bond causing <b>ligand-independent RET dimerization</b> and constitutive activation.",
    "<b>MEN2B mutation (codon 918)</b> occurs in the intracellular tyrosine kinase domain — single amino acid change directly activates kinase activity without dimerization, causing the most aggressive phenotype.",
    "Activated RET signals through RAS-MAPK, PI3K-AKT, and JAK-STAT pathways — promoting cell survival, proliferation, and differentiation of neural crest derivatives.",
    "Loss-of-function RET mutations (Hirschsprung disease) demonstrate the opposite effect — absence of enteric neuron development.",
]:
    story.append(bul(pt))

story.append(Paragraph("6.3 C-Cell Hyperplasia — The Obligate Precursor in MEN2", H2))
story.append(Paragraph(
    "In hereditary MTC (MEN2), <b>C-cell hyperplasia (CCH)</b> is found in the thyroid "
    "parenchyma adjacent to the carcinoma in virtually all cases. It is considered the "
    "pre-neoplastic precursor lesion — confirming the multistep progression model for "
    "hereditary MTC. This contrasts with sporadic MTC, where CCH is rare or absent. "
    "Histologically, CCH shows clusters of C cells filling follicles without stromal invasion.", BODY))

story.append(Spacer(1, 0.25*cm))

# ════════════════════════════════════════════════════════
# SECTION 7 – HISTOPATHOLOGY DETAILS
# ════════════════════════════════════════════════════════
story.append(Paragraph("7. Histopathology of Key MEN Tumors", H1))

story.append(Paragraph("7.1 Medullary Thyroid Carcinoma (MTC)", H2))
histo_mtc = [
    bul("<b>Gross:</b> Gray-white, firm, multifocal (hereditary); unilateral, solitary (sporadic). May have areas of calcification."),
    bul("<b>Microscopy:</b> Polygonal to spindle-shaped cells in nests, sheets, trabeculae. No follicular formation."),
    bul("<b>Amyloid stroma:</b> Eosinophilic deposits between tumor cells; composed of calcitonin fibrils. Congo red stain → apple-green birefringence under polarized light."),
    bul("<b>C-cell hyperplasia:</b> Invariably present in adjacent thyroid in familial cases (MEN2); absent in sporadic."),
    bul("<b>IHC markers:</b> Calcitonin (+), CEA (+), chromogranin A (+), synaptophysin (+), TTF-1 (+). Thyroglobulin (−)."),
    bul("<b>EM:</b> Membrane-bound electron-dense secretory granules (calcitonin storage) in tumor cell cytoplasm."),
    bul("<b>Grading:</b> No formal WHO grading system; multifocality, extrathyroidal extension, and lymph node involvement determine staging."),
]
for item in histo_mtc:
    story.append(item)

story.append(Paragraph("7.2 Pheochromocytoma", H2))
histo_pheo = [
    bul("<b>Gross:</b> Well-encapsulated, reddish-brown mass within attenuated adrenal cortex; areas of hemorrhage and necrosis. Comma-shaped residual adrenal often visible."),
    bul("<b>Microscopy:</b> Classic <i>zellballen</i> pattern — nests/balls of large polygonal chief cells surrounded by sustentacular cells and rich vascular network. Cells have abundant granular cytoplasm."),
    bul("<b>Nuclear pleomorphism:</b> Not uncommon even in biologically benign tumors (not reliable for malignancy prediction)."),
    bul("<b>EM:</b> Large, membrane-bound, electron-dense secretory granules containing catecholamines (30,000× magnification characteristic)."),
    bul("<b>IHC:</b> Chromogranin A (+), synaptophysin (+), S100 (sustentacular cells) (+). Cytokeratin (−)."),
    bul("<b>Malignancy criteria:</b> No reliable histological criteria; malignancy defined by <b>metastases to non-chromaffin sites</b> (bone, liver, lymph nodes). PASS score (Pheochromocytoma of the Adrenal gland Scaled Score) and GAPP score used as risk-stratification tools."),
    bul("<b>In MEN2A:</b> Often bilateral; no more than 10% malignant."),
]
for item in histo_pheo:
    story.append(item)

story.append(Paragraph("7.3 Parathyroid Lesions in MEN Syndromes", H2))
for pt in [
    "<b>MEN1:</b> Multiple parathyroid adenomas in separate glands (not true four-gland hyperplasia). Chief cell adenomas most common. Gross: tan-yellow, enlarged glands.",
    "<b>MEN2A:</b> Parathyroid hyperplasia (chief cell); usually milder than MEN1.",
    "<b>Histology:</b> Adenomas — compressed rim of normal parathyroid; chief cells predominant. Hyperplasia — diffuse or nodular proliferation of chief cells with loss of stromal fat.",
]:
    story.append(bul(pt))

story.append(Paragraph("7.4 Pancreatic / Gastropancreatic NETs", H2))
for pt in [
    "<b>Gross:</b> Often multiple microadenomas (<0.5 cm) with one or two dominant lesions; well-demarcated, yellow-tan nodules.",
    "<b>Microscopy:</b> Uniform cells in ribbons, trabeculae, nests, or gyriform patterns (insulinoma); low mitotic rate.",
    "<b>IHC:</b> Chromogranin A (+), synaptophysin (+), CD56 (+); specific hormone markers (insulin, gastrin, VIP, glucagon) confirm functional type.",
    "<b>Grading (WHO 2022):</b> Grade 1 (<2 mitoses/2 mm², Ki-67 <3%); Grade 2 (2–20 mitoses, Ki-67 3–20%); Grade 3 (>20 mitoses, Ki-67 >20%). Poorly differentiated = neuroendocrine carcinoma (NEC).",
    "<b>Malignant behavior:</b> All pancreatic NETs have malignant potential; insulinomas least often malignant; gastrinomas frequently metastatic.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.25*cm))

# ════════════════════════════════════════════════════════
# SECTION 8 – DIFFERENTIAL DIAGNOSIS
# ════════════════════════════════════════════════════════
story.append(Paragraph("8. Differential Diagnosis", H1))
diff_data = [
    ["Condition", "Key Distinguishing Features from MEN"],
    ["Sporadic MTC", "Unilateral, solitary. No C-cell hyperplasia. No RET germline mutation (though ~25% of apparently sporadic MTC have germline RET)"],
    ["Sporadic pheochromocytoma", "Usually unilateral. No RET mutation. SDHx/VHL mutations may be found"],
    ["Sporadic parathyroid adenoma", "Single-gland disease. No MEN1 mutation. Later age of onset. Female predominance"],
    ["Von Hippel-Lindau (VHL) syndrome", "VHL gene mutation; hemangioblastomas (CNS/retina), clear cell RCC, pancreatic cysts/NETs, pheochromocytoma — NO MTC"],
    ["Hyperparathyroidism-Jaw Tumor (HPT-JT)", "CDC73/HRPT2 mutation; parathyroid carcinoma risk (not just adenoma); ossifying jaw fibromas"],
    ["Carney Complex", "PRKAR1A mutation; cardiac myxomas, skin pigmentation, pituitary/adrenal/thyroid tumors"],
    ["SDH-associated pheo/paraganglioma", "SDHB/C/D mutations; paragangliomas; RCC; GI stromal tumors; NO MTC"],
    ["MEN5", "MAX gene; bilateral pheochromocytoma; NO MTC — key distinction from MEN2"],
]
diff_cw = [5.0*cm, 11.3*cm]
diff_tbl = Table([[Paragraph(str(c), TBL_CELL if i > 0 else TBL_HDR) for c in r]
                  for i, r in enumerate(diff_data)],
                 colWidths=diff_cw, repeatRows=1)
diff_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#1a3a5c")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#f5f5f5"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 5), ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5), ("FONTSIZE", (0, 0), (-1, -1), 8.5),
]))
story.append(diff_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: Differential diagnosis of MEN syndromes.", CAPTION))

story.append(PageBreak())

# ════════════════════════════════════════════════════════
# SECTION 9 – MANAGEMENT OVERVIEW
# ════════════════════════════════════════════════════════
story.append(Paragraph("9. Management Overview", H1))

story.append(Paragraph("9.1 Genetic Testing — Who to Test?", H2))
for pt in [
    "All patients with MTC (sporadic or familial) — germline RET testing.",
    "All patients with suspected MEN1 (≥2 MEN1-associated tumors, or 1 tumor + family history).",
    "First-degree relatives of confirmed mutation carriers.",
    "Patients with bilateral/multiple pheochromocytomas, paragangliomas, or age <40 at pheochromocytoma diagnosis — test for SDHx, VHL, and RET.",
]:
    story.append(bul(pt))

story.append(Paragraph("9.2 MEN1 Treatment Principles", H2))
mgmt_data = [
    ["Manifestation", "Medical Management", "Surgical Management"],
    ["PHPT\n(Parathyroid)", "Cinacalcet (calcimimetic) for symptomatic but inoperable cases",
     "3.5-gland parathyroidectomy OR total parathyroidectomy with forearm autograft. Perform before gastrinoma surgery."],
    ["Gastrinoma / ZES", "PPIs (high-dose); H2 blockers as adjunct",
     "Controversial due to multifocality; low cure rate. Surgery for large or growing lesions. Distal pancreatectomy + duodenotomy."],
    ["Insulinoma", "Diazoxide; somatostatin analogues (octreotide)",
     "Enucleation (solitary); distal pancreatectomy (body/tail lesions); Whipple (head lesion)."],
    ["Pituitary", "Dopamine agonists (prolactinoma); somatostatin analogues (acromegaly)",
     "Transsphenoidal surgery if medical failure or mass effects."],
    ["Thymic carcinoid", "Somatostatin analogues for control",
     "Complete surgical resection; CT/MRI surveillance every 1–2 yrs. Thymectomy at parathyroid surgery not proven preventive."],
]
mgmt_cw = [3.5*cm, 5.6*cm, 7.2*cm]
mgmt_tbl = Table([[Paragraph(str(c), TBL_CELL if i > 0 else TBL_HDR) for c in r]
                  for i, r in enumerate(mgmt_data)],
                 colWidths=mgmt_cw, repeatRows=1)
mgmt_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0, 0), (-1, 0),  HexColor("#2e6fa3")),
    ("TEXTCOLOR",     (0, 0), (-1, 0),  colors.white),
    ("ROWBACKGROUNDS",(0, 1), (-1, -1), [HexColor("#eef2f7"), colors.white]),
    ("GRID",          (0, 0), (-1, -1), 0.4, HexColor("#aaaaaa")),
    ("VALIGN",        (0, 0), (-1, -1), "MIDDLE"),
    ("TOPPADDING",    (0, 0), (-1, -1), 5), ("BOTTOMPADDING", (0, 0), (-1, -1), 5),
    ("LEFTPADDING",   (0, 0), (-1, -1), 5), ("FONTSIZE", (0, 0), (-1, -1), 8.5),
]))
story.append(mgmt_tbl)
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("Table: MEN1 management by organ system.", CAPTION))

story.append(Spacer(1, 0.15*cm))

story.append(Paragraph("9.3 MEN2 Treatment Principles", H2))
story.append(Paragraph("<b>Order of surgical operations in MEN2A/2B with concurrent disease:</b>", H4))
for pt in [
    "<b>Step 1:</b> Treat pheochromocytoma FIRST — alpha blockade (phenoxybenzamine) for ≥10–14 days, then laparoscopic adrenalectomy. Do NOT proceed to thyroid surgery first.",
    "<b>Step 2:</b> Thyroidectomy (total thyroidectomy ± central neck dissection based on calcitonin level and nodal involvement).",
    "<b>Step 3:</b> Parathyroid (if applicable in MEN2A) — at time of thyroidectomy if hypercalcemic.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.1*cm))
story.append(Paragraph("<b>Post-operative monitoring:</b>", H4))
for pt in [
    "Serum calcitonin + CEA every 6 months.",
    "Undetectable calcitonin = biochemical cure. Rising calcitonin doubling time (CDT) predicts metastatic progression.",
    "Annual plasma metanephrines for pheochromocytoma surveillance.",
]:
    story.append(bul(pt))

story.append(Spacer(1, 0.25*cm))

# ════════════════════════════════════════════════════════
# SECTION 10 – KEY EXAM POINTS
# ════════════════════════════════════════════════════════
story.append(Paragraph("10. Key Points for Examinations", H1))

points = [
    "MEN1 = 3 Ps: <b>Parathyroid, Pancreas (NETs), Pituitary</b>. Gene = MEN1/menin on chromosome <b>11q13</b>.",
    "MEN2A = <b>MTC + Pheochromocytoma + Parathyroid hyperplasia</b>. MEN2B = MTC + Pheo + <b>Mucosal neuromas + Marfanoid habitus</b> (NO parathyroid disease).",
    "All MEN2 = <b>RET proto-oncogene</b> on chromosome <b>10q11</b>; gain-of-function; codon 918 = MEN2B (most aggressive).",
    "MEN1 gene mutation = <b>LOSS of function</b> (tumor suppressor). RET mutation = <b>GAIN of function</b> (proto-oncogene).",
    "<b>C-cell hyperplasia</b> is the precursor to MTC in MEN2 and is virtually always present in familial (but not sporadic) MTC — a key pathological distinguishing feature.",
    "MTC histology: <b>amyloid stroma</b> (calcitonin deposits; Congo red +). IHC: calcitonin +, CEA +, chromogranin +, thyroglobulin −.",
    "Pheochromocytoma histology: <b>zellballen</b> pattern; catecholamine-storing electron-dense granules on EM.",
    "In MEN2A with pheochromocytoma + MTC: <b>treat pheochromocytoma FIRST</b> (alpha-block, then adrenalectomy) before thyroid surgery.",
    "MEN4 = <b>CDKN1B/p27 mutation</b> — MEN1-like phenotype. MEN5 = <b>MAX mutation</b> — bilateral pheo, NO MTC.",
    "All patients with MTC (even apparently sporadic) should undergo <b>germline RET mutation testing</b> per 2015 ATA guidelines.",
    "The only curative treatment for MTC is <b>prophylactic/early thyroidectomy</b> guided by RET codon and calcitonin level.",
    "Gastrinoma in MEN1 — duodenum &gt; pancreas; ZES diagnosis = gastrin &gt;1000 pg/mL with acid present, OR secretin stimulation test &gt;200 pg/mL rise.",
]

for i, pt in enumerate(points, 1):
    story.append(Paragraph(f"<b>{i}.</b>  {pt}", BODY))

story.append(Spacer(1, 0.3*cm))
story.append(hline("#1a3a5c", 1.2))
story.append(Spacer(1, 0.1*cm))
story.append(Paragraph(
    "References: Robbins & Cotran Pathologic Basis of Disease, 10th Edition (Kumar, Abbas, Aster) | "
    "Robbins & Kumar Basic Pathology | Sabiston Textbook of Surgery, 21st Edition | "
    "Yamada's Textbook of Gastroenterology, 7th Edition | "
    "American Thyroid Association (ATA) Guidelines 2015",
    CAPTION))

# ─── BUILD ─────────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF written to: {OUTPUT}")
Running Command

python /tmp/workspace/men-syndromes/generate_detailed_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/men-syndromes/

Your detailed PDF is ready. Here is what it covers across its pages:

MEN Syndromes Detailed

PDF Document · PDF


What the Detailed PDF Contains (10 Full Sections)

Page 1 — Cover + Master Summary Table All 5 syndromes (MEN1, MEN2A, MEN2B, MEN4, MEN5) in a color-coded overview table with gene, locus, core tumors, inheritance.
Section 1 — Introduction Defining features of all MEN syndromes vs sporadic tumors; two-hit vs gain-of-function molecular logic.
Section 2 — MEN 1 (Werner Syndrome)
  • Epidemiology (1–3/100,000; 50% mortality by age 50 without treatment)
  • Menin structure, function, 1,600+ mutations, two-hit model
  • Organ-by-organ: Parathyroid (80–95%), Pancreatic NETs with a full table (gastrinoma, insulinoma, VIPoma, glucagonoma), Pituitary
  • ZES diagnosis criteria (gastrin >1000 + acid; secretin stimulation test)
  • Beyond the 3Ps: thymic carcinoid, adrenal, lipoma, angiofibromas
  • Full MEN1 surveillance schedule table (age to start, test, frequency)
Section 3 — MEN 2 (Sipple + MEN2B)
  • RET protein structure (extracellular/transmembrane/TK domains)
  • ATA risk stratification table (codons A–D, prophylactic thyroidectomy timing)
  • MEN2A: MTC (~100%), pheochromocytoma (40–50%), parathyroid (10–35%)
  • MEN2A subclassifications table (lichen amyloidosis, Hirschsprung, FMTC)
  • MEN2B: codon 918 M918T, mucosal neuromas, marfanoid habitus, NO parathyroid
  • Management: pheochromocytoma FIRST rule, alpha-blockade, post-op calcitonin surveillance
Section 4 — MEN4 and MEN5 CDKN1B/p27 and MAX gene mutations; phenocopies and key distinctions.
Section 5 — Comprehensive Comparison Table All 4 syndromes side-by-side across 13 features.
Section 6 — Molecular Mechanisms Two-hit model (MEN1), constitutive RET activation (MEN2A cysteine codons vs MEN2B kinase domain codon 918), C-cell hyperplasia as obligate precursor.
Section 7 — Histopathology Detailed microscopy/EM/IHC for MTC (amyloid stroma, Congo red, calcitonin IHC), pheochromocytoma (zellballen, PASS score), parathyroid lesions, and pancreatic NETs (WHO 2022 grading).
Section 8 — Differential Diagnosis Table MEN vs sporadic tumors vs VHL, HPT-JT, Carney complex, SDH syndromes, MEN5.
Section 9 — Management Tables MEN1 organ-by-organ surgical/medical management; MEN2 sequential surgery order.
Section 10 — 12 Key Exam Points High-yield summary of every testable fact.
This is a shared conversation. Sign in to Orris to start your own chat.