final year resident practicing Ent . As each year goes by, I'll be progressing in my education and Scott brown,Cummings,Baileys and standard journals, case reports, textbooks, guidelines and articles like the British Journal of Anaesthesia, PubMed, NCBI, Cochrane Reviews, etc. Give me highly reliable, evidence-backed answers from guidelines, research papers and journals. Use real-time searchto obtain information from reputable databases and institutional bodies such as FDA, CDC, AHA and WHO. Lead directly with verified data without conversational filler. Cite the specific studies, journals or clinical guidelines where the evidence comes from. Use exact biomedical terminology and structured formats (tables, differential diagnoses, mechanism breakdowns). If literature is conflicting or evidence is insufficient, explicitly state the conflict instead of simplifying it. Include: * Clinical Decision Support System (CDSS) * Point-of-care clinical decision support * Rigidly cited evidence-backed medical data * Alignment with current medical and healthcare standards Save this format for future medical questions. PDF Preferences Whenever I ask for a PDF: * Cross-check for dark square symbols replacing numerals. * Use plain ASCII text instead of Unicode superscripts. * Example: * Write N2O * Never write N□O or Unicode superscripts. Use: * Coloured headings * Pleasant, subtle colour themes * Different colour palettes for different PDFs * Highlight doses, cautions and important exam pearls in different colours * Flowcharts and tables wherever useful Important sentences or exam pearls should be highlighted. PDF length: * Maximum 5–6 pages * Detailed but concise * Cover all important concepts within those pages. Drug Questions Whenever I ask about a drug, include: * Drug group * Chemical structure * Formulation * Available preparations in the market * Routes of administration * Dosage * Mechanism of action * Pharmacokinetics * Pharmacodynamics * Indications * Contraindications * Adverse effects * Special points Formatting Preferences * Use safe ASCII equivalents instead of Unicode superscripts. * Avoid large empty spaces between sections. * Check for missing or corrupted symbols before generating PDFs. * Tables should: * Allow multiple lines within cells. * Automatically increase row height. * Wrap text inside cells. * Prevent text overflow. * Avoid overlapping text. * Avoid compressed unreadable layouts. * Split large tables across pages if necessary. * Prioritise readability over compactness. Page Layout * Avoid unnecessary blank spaces just to increase page count. * Use only enough spacing to clearly separate sections. * Maintain: * Continuous flow * Minimal forced page breaks * Larger font and comfortable spacing * Liberation Sans font * ASCII-only chemical and numeric notation * Readable wrap-safe tables with adjusted column widths * Colour-coded headings, doses, cautions and exam pearls * Automatic colour palette changes for different PDFs * Flowcharts and tables wherever appropriate Save these preferences and use them whenever I ask for a PDF.
I need points for a 10 mark long answer. Only from standard university textbooks like Scott Brown's, Cummins. Belize. Uh, it should include... From introduction to conclusion, give me flowcharts... When needed, give me diagrams... Uh, in the end of the topic. Summarize with key points. Uh, this is for, uh, a 10 marks long answer. For an exam. Of KNRU, which is university? Uh, I need it in, um... Points and not big, big paragraphs. Easy to memorize. Easy to understand. I need you to add definition. Uh, applied anatomy, embryology, physiology, etiology, risk factors, classification, clinical features, history, physical examination, investigations, imaging, diagnosis, differential diagnosis. As to path, if there are any staging systems, keep that. Management, divide it into medical and surgical, if it's divided. Complications, prognosis, follow-up, recent advances, Viva questions, clinical pulse. And summarize the entire thing in few points, like key points. Give, uh, all the answers in, uh, similar direction, whatever I ask for from now. And give it in PDF format, which ha- which has to be printable. I need you to add content from Scott Brown Cummings. And are those standard ENT textbooks, or you can use information from standard ENT articles from PubMed, NCBI? Hello? I don't want long answers. I want answers for, for just five to six pages. Don't give me unwanted matter. Whatever is there in textbook, like, just don't dump here. Give me important points straight. But in detail. 5-6 pages only not more
| # | Section |
|---|---|
| 1 | Definition |
| 2 | Applied Anatomy |
| 3 | Embryology (if relevant) |
| 4 | Physiology (if relevant) |
| 5 | Etiology & Risk Factors |
| 6 | Classification |
| 7 | Clinical Features |
| 8 | History |
| 9 | Physical Examination |
| 10 | Investigations |
| 11 | Imaging |
| 12 | Diagnosis |
| 13 | Differential Diagnosis |
| 14 | Pathology / Histopathology (if relevant) |
| 15 | Staging (if applicable) |
| 16 | Management - Medical |
| 17 | Management - Surgical |
| 18 | Complications |
| 19 | Prognosis & Follow-up |
| 20 | Recent Advances |
| 21 | Viva Questions |
| 22 | Clinical Pearls |
| 23 | Key Points Summary |
Immunoglobulins
"immunoglobulin" AND "head and neck" OR "otolaryngology"
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"
mkdir -p /home/daytona/workspace/ent-exam && echo "created"
~/ent-exam/immunoglobulins.py
#!/usr/bin/env python3
"""
Immunoglobulins - ENT Long Answer PDF
KNRUHS Final Year ENT Exam
Sources: Cummings Otolaryngology (7th Ed), Scott-Brown's ORL HNS,
Basic Medical Biochemistry (Lieberman), Medical Microbiology
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.platypus.flowables import HRFlowable
OUTPUT = "/home/daytona/workspace/ent-exam/Immunoglobulins_ENT_Exam.pdf"
# ─── COLOUR PALETTE (teal/gold/ivory theme) ────────────────────────────────
C_BG = colors.HexColor("#F5F7FA") # page background (not used in RL)
C_HEAD1 = colors.HexColor("#1A5276") # dark blue - H1 titles
C_HEAD2 = colors.HexColor("#117A65") # teal - H2 section headings
C_HEAD3 = colors.HexColor("#B7950B") # gold - H3 sub-headings
C_DOSE = colors.HexColor("#922B21") # red - doses / cautions
C_PEARL = colors.HexColor("#1A5276") # dark blue - exam pearls box text
C_PEARL_BG = colors.HexColor("#D6EAF8") # pearl box background
C_CAUTION = colors.HexColor("#784212") # brown - caution text
C_CAUTION_BG= colors.HexColor("#FDEBD0") # caution box background
C_TABLE_HDR = colors.HexColor("#1A5276") # table header bg
C_TABLE_ALT = colors.HexColor("#EBF5FB") # table alt row
C_RULE = colors.HexColor("#1A5276") # horizontal rule
C_BLACK = colors.HexColor("#1C2833")
C_WHITE = colors.white
C_FLOW_BG = colors.HexColor("#E8F8F5") # flowchart box bg
C_FLOW_BRD = colors.HexColor("#117A65") # flowchart border
W, H = A4
def build_styles():
base = getSampleStyleSheet()
styles = {}
styles['title'] = ParagraphStyle(
'title', fontName='Helvetica-Bold', fontSize=18,
textColor=C_HEAD1, alignment=TA_CENTER,
spaceAfter=4, spaceBefore=0, leading=22
)
styles['subtitle'] = ParagraphStyle(
'subtitle', fontName='Helvetica', fontSize=10,
textColor=C_HEAD2, alignment=TA_CENTER,
spaceAfter=8, spaceBefore=0
)
styles['h1'] = ParagraphStyle(
'h1', fontName='Helvetica-Bold', fontSize=13,
textColor=C_WHITE, alignment=TA_LEFT,
spaceAfter=4, spaceBefore=10, leading=16,
backColor=C_HEAD1,
leftIndent=-8, rightIndent=-8, borderPad=4
)
styles['h2'] = ParagraphStyle(
'h2', fontName='Helvetica-Bold', fontSize=11,
textColor=C_HEAD2, alignment=TA_LEFT,
spaceAfter=3, spaceBefore=7, leading=14,
borderPad=2
)
styles['h3'] = ParagraphStyle(
'h3', fontName='Helvetica-Bold', fontSize=10,
textColor=C_HEAD3, alignment=TA_LEFT,
spaceAfter=2, spaceBefore=5, leading=13
)
styles['body'] = ParagraphStyle(
'body', fontName='Helvetica', fontSize=9,
textColor=C_BLACK, alignment=TA_JUSTIFY,
spaceAfter=2, spaceBefore=0, leading=13
)
styles['bullet'] = ParagraphStyle(
'bullet', fontName='Helvetica', fontSize=9,
textColor=C_BLACK, alignment=TA_LEFT,
spaceAfter=1, spaceBefore=0, leading=12,
leftIndent=14, bulletIndent=4
)
styles['subbullet'] = ParagraphStyle(
'subbullet', fontName='Helvetica', fontSize=8.5,
textColor=C_BLACK, alignment=TA_LEFT,
spaceAfter=1, spaceBefore=0, leading=11,
leftIndent=28, bulletIndent=18
)
styles['dose'] = ParagraphStyle(
'dose', fontName='Helvetica-Bold', fontSize=9,
textColor=C_DOSE, alignment=TA_LEFT,
spaceAfter=1, spaceBefore=1, leading=12
)
styles['pearl'] = ParagraphStyle(
'pearl', fontName='Helvetica-Bold', fontSize=9,
textColor=C_PEARL, alignment=TA_LEFT,
spaceAfter=1, spaceBefore=1, leading=12
)
styles['caption'] = ParagraphStyle(
'caption', fontName='Helvetica-Oblique', fontSize=8,
textColor=colors.HexColor("#555555"), alignment=TA_CENTER,
spaceAfter=4, spaceBefore=2
)
styles['tbl_hdr'] = ParagraphStyle(
'tbl_hdr', fontName='Helvetica-Bold', fontSize=8.5,
textColor=C_WHITE, alignment=TA_CENTER, leading=11
)
styles['tbl_cell'] = ParagraphStyle(
'tbl_cell', fontName='Helvetica', fontSize=8.5,
textColor=C_BLACK, alignment=TA_LEFT, leading=11
)
styles['tbl_cell_bold'] = ParagraphStyle(
'tbl_cell_bold', fontName='Helvetica-Bold', fontSize=8.5,
textColor=C_HEAD1, alignment=TA_LEFT, leading=11
)
styles['source'] = ParagraphStyle(
'source', fontName='Helvetica-Oblique', fontSize=7.5,
textColor=colors.HexColor("#666666"), alignment=TA_LEFT,
spaceAfter=1, spaceBefore=0, leading=10
)
return styles
def H(text, style):
return Paragraph(text, style)
def B(text, style):
return Paragraph(u"\u2022 " + text, style)
def SB(text, style):
return Paragraph(u" \u25e6 " + text, style)
def rule(s):
return HRFlowable(width="100%", thickness=1.5, color=C_RULE, spaceAfter=4, spaceBefore=4)
def pearl_box(text, s):
data = [[Paragraph("<b>EXAM PEARL:</b> " + text, s['pearl'])]]
t = Table(data, colWidths=[17.5*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_PEARL_BG),
('BOX', (0,0), (-1,-1), 1.2, C_HEAD1),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
]))
return t
def caution_box(text, s):
data = [[Paragraph("<b>CAUTION:</b> " + text, s['dose'])]]
t = Table(data, colWidths=[17.5*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_CAUTION_BG),
('BOX', (0,0), (-1,-1), 1.2, C_DOSE),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
]))
return t
def make_table(headers, rows, s, col_widths=None):
hdr = [Paragraph(h, s['tbl_hdr']) for h in headers]
body_rows = []
for row in rows:
br = [Paragraph(str(c), s['tbl_cell']) for c in row]
body_rows.append(br)
data = [hdr] + body_rows
if col_widths is None:
col_widths = [17.5*cm / len(headers)] * len(headers)
t = Table(data, colWidths=col_widths, repeatRows=1)
ts = TableStyle([
('BACKGROUND', (0,0), (-1,0), C_TABLE_HDR),
('TEXTCOLOR', (0,0), (-1,0), C_WHITE),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('ALIGN', (0,0), (-1,0), 'CENTER'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
('ROWBACKGROUNDS', (0,1), (-1,-1), [C_WHITE, C_TABLE_ALT]),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('WORDWRAP', (0,0), (-1,-1), True),
])
t.setStyle(ts)
return t
def flowchart_box(steps, s, title=""):
"""Build a simple vertical flowchart as nested table"""
rows = []
if title:
rows.append([Paragraph("<b>" + title + "</b>", s['h3'])])
for i, step in enumerate(steps):
rows.append([Paragraph(step, s['body'])])
if i < len(steps)-1:
rows.append([Paragraph("<b>▼</b>", ParagraphStyle('arr', fontName='Helvetica-Bold',
fontSize=10, alignment=TA_CENTER, textColor=C_HEAD2))])
t = Table([[r[0]] for r in rows], colWidths=[15*cm])
ts = TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_FLOW_BG),
('BOX', (0,0), (-1,-1), 1.5, C_FLOW_BRD),
('LINEBELOW', (0,0), (-1,-2), 0.5, colors.HexColor("#A9DFBF")),
('LEFTPADDING', (0,0), (-1,-1), 10),
('RIGHTPADDING', (0,0), (-1,-1), 10),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
])
t.setStyle(ts)
return t
# ═══════════════════════════════════════════════════════════════════════════
# CONTENT BUILD
# ═══════════════════════════════════════════════════════════════════════════
def build(s):
story = []
SP = lambda n: Spacer(1, n*mm)
# ── TITLE PAGE HEADER ─────────────────────────────────────────────────
story += [
SP(4),
H("IMMUNOGLOBULINS", s['title']),
H("KNRUHS Final Year ENT | 10-Mark Long Answer", s['subtitle']),
H("Sources: Cummings Otolaryngology 7th Ed | Scott-Brown's ORL HNS 8th Ed | Basic Medical Biochemistry (Lieberman) | Medical Microbiology (Murray)", s['source']),
rule(s), SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 1. DEFINITION
# ══════════════════════════════════════════════════════════════════════
story.append(H("1. DEFINITION", s['h1']))
story += [
B("Immunoglobulins (Ig) = glycoproteins produced by plasma cells (activated B lymphocytes) that function as antibodies.", s['bullet']),
B("Composed of 82-96% polypeptide + 4-18% carbohydrate.", s['bullet']),
B("Basic unit: 2 heavy chains (50 kDa each) + 2 light chains (25 kDa each) = Y-shaped tetrameric structure.", s['bullet']),
pearl_box("Immunoglobulins = antibodies. All antibodies are Ig, but the term Ig includes both membrane-bound and secreted forms. [Cummings, Ch. 35]", s),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 2. STRUCTURE / APPLIED ANATOMY
# ══════════════════════════════════════════════════════════════════════
story.append(H("2. STRUCTURE (Applied Anatomy of the Molecule)", s['h1']))
story.append(H("2.1 Basic Structure", s['h2']))
story += [
B("Two identical HEAVY chains (50 kDa each) - define class/subclass.", s['bullet']),
B("Two identical LIGHT chains (25 kDa each) - kappa (kappa) or lambda (lambda).", s['bullet']),
B("Chains held by inter-chain disulfide bonds.", s['bullet']),
B("HINGE REGION: between CH1 and CH2 - allows flexibility for antigen binding.", s['bullet']),
]
story.append(H("2.2 Functional Domains", s['h2']))
dom_headers = ["Domain", "Location", "Function"]
dom_rows = [
["Fab (Fragment antigen-binding)", "VH + VL + CH1 + CL", "Antigen recognition and binding"],
["Fc (Fragment crystallizable)", "CH2 + CH3 (heavy chains)", "Effector functions: complement activation, Fc receptor binding, placental transfer"],
["VH / VL (Variable regions)", "N-terminal of H and L chains", "Antigen-binding specificity; CDRs located here"],
["CH / CL (Constant regions)", "C-terminal of H and L chains", "Define isotype; mediate effector functions"],
["Hinge region", "Between CH1 and CH2", "Flexibility; site of pepsin/papain cleavage"],
["J chain", "Joins polymers (IgM/IgA)", "Polymerisation of IgM pentamer and IgA dimer"],
["Secretory component (SC)", "IgA only (in secretions)", "Protects IgA from proteolytic degradation; facilitates transcytosis"],
]
story.append(make_table(dom_headers, dom_rows, s, [4*cm, 4.5*cm, 9*cm]))
story += [SP(2),
pearl_box("Papain cleaves Ig into 2 Fab + 1 Fc. Pepsin cleaves into F(ab')2 + pFc'. CDR = Complementarity Determining Region (hypervariable loops that actually touch antigen).", s),
SP(2),
]
story.append(H("2.3 Light and Heavy Chain Isotypes", s['h2']))
story += [
B("Light chain isotypes: kappa (kappa) or lambda (lambda) - present in ALL classes.", s['bullet']),
B("Heavy chain isotypes define class: gamma(g)=IgG | mu(m)=IgM | alpha(a)=IgA | delta(d)=IgD | epsilon(e)=IgE", s['bullet']),
B("9 heavy chain constant region genes = 9 isotypes: IgG1, G2, G3, G4, IgM, IgA1, IgA2, IgD, IgE.", s['bullet']),
]
# ══════════════════════════════════════════════════════════════════════
# 3. CLASSIFICATION
# ══════════════════════════════════════════════════════════════════════
story.append(H("3. CLASSIFICATION", s['h1']))
class_headers = ["Class", "Heavy Chain", "MW (Da)", "% of Total Serum Ig", "Structure", "Key Property"]
class_rows = [
["IgG", "gamma (gamma)", "150,000", "~75%", "Monomer", "Main secondary response Ab; only Ig crossing placenta; fixes complement; opsonin"],
["IgM", "mu (mu)", "900,000", "~10%", "Pentamer (5 units + J chain)", "First Ig in primary response; most efficient complement fixer; membrane receptor on naive B cells"],
["IgA", "alpha (alpha)", "160,000 (monomer)", "~15%", "Monomer (serum) / Dimer (secretory)", "Predominant mucosal/secretory Ig; protects mucosal surfaces (nose, throat, GIT, lung)"],
["IgE", "epsilon (epsilon)", "200,000", "0.004%", "Monomer", "Mediates Type I hypersensitivity; binds FcepsilonRI on mast cells/basophils; anti-helminthic"],
["IgD", "delta (delta)", "180,000", "0.2%", "Monomer", "B-cell surface antigen receptor; minimal serum function"],
]
story.append(make_table(class_headers, class_rows, s, [1.8*cm, 2.2*cm, 2.2*cm, 2.5*cm, 3*cm, 5.8*cm]))
story += [SP(2),
pearl_box("Mnemonic for serum concentration: IgG > IgA > IgM > IgD > IgE (GAMED). IgG most in serum; IgA most produced overall (by quantity); IgE lowest serum level.", s),
SP(2),
]
# Subclasses
story.append(H("3.1 IgG Subclasses (Clinically Important)", s['h2']))
igg_headers = ["Subclass", "Concentration (mg/dL)", "Antigen Response", "Complement Fixation", "ENT Relevance"]
igg_rows = [
["IgG1", "500-700", "Protein antigens", "+++", "Most common; anti-viral Ab"],
["IgG2", "300-400", "Polysaccharide antigens (capsulated bacteria)", "++", "Deficiency = recurrent sinusitis, otitis, pneumonia (MOST COMMON subclass deficiency in ENT)"],
["IgG3", "25-80", "Protein antigens", "++++", "Shortest half-life (7 days); most potent complement fixer"],
["IgG4", "6-125", "Chronic antigen exposure", "-", "IgG4-Related Disease (IgG4-RD): affects salivary glands, orbits, H&N; elevated IgG4 + storiform fibrosis"],
]
story.append(make_table(igg_headers, igg_rows, s, [2*cm, 3*cm, 3.5*cm, 2.5*cm, 6.5*cm]))
story += [SP(2),
caution_box("IgG2 subclass deficiency is the most common immunoglobulin deficiency presenting with recurrent ENT infections (otitis media, sinusitis, pneumonia). Check IgG subclasses even when total IgG is normal. [Cummings, Ch. 35]", s),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 4. PHYSIOLOGY / FUNCTIONS
# ══════════════════════════════════════════════════════════════════════
story.append(H("4. PHYSIOLOGY AND FUNCTIONS", s['h1']))
story.append(H("4.1 B Cell Activation and Ig Production", s['h2']))
fc_steps = [
"Naive B cell: surface IgM + IgD as antigen receptors",
"Antigen binds BCR --> B cell activation + T cell help (CD40L-CD40)",
"Germinal centre: somatic hypermutation + class switch recombination",
"Differentiation into plasma cells --> secrete specific Ig isotype",
"Memory B cells formed --> rapid secondary (recall) response",
]
story.append(flowchart_box(fc_steps, s, "B Cell Activation -> Ig Production"))
story += [SP(3),
B("Class switching: IgM --> IgG, IgA, or IgE depending on cytokine milieu (IL-4=IgE, TGF-beta=IgA, etc.)", s['bullet']),
B("Affinity maturation: somatic hypermutation in germinal centres increases antigen affinity.", s['bullet']),
SP(2),
]
story.append(H("4.2 Effector Functions Summary", s['h2']))
eff_headers = ["Function", "Ig Classes", "Mechanism"]
eff_rows = [
["Neutralisation", "IgG, IgA, IgM", "Binding blocks pathogen from attaching to host cells"],
["Opsonisation", "IgG (all subclasses)", "Fc binds FcgammaRIII on phagocytes; enhances phagocytosis"],
["Complement activation", "IgM > IgG3 > IgG1 > IgG2 > IgG4", "Classical pathway: C1q binds Fc region of IgM/IgG"],
["ADCC (Antibody-Dependent Cellular Cytotoxicity)", "IgG", "Fc binds CD16 (FcgammaRIII) on NK cells; kills target"],
["Mucosal immunity", "Secretory IgA", "Secreted into saliva, tears, nasal secretions, breast milk; first-line barrier"],
["Mast cell degranulation", "IgE", "Cross-linking of FcepsilonRI-bound IgE on mast cells/basophils"],
["Placental transfer", "IgG only", "Active transport via FcRn (neonatal Fc receptor) across placenta"],
["B cell activation receptor", "IgM, IgD", "Membrane-bound form; BCR signalling"],
]
story.append(make_table(eff_headers, eff_rows, s, [4*cm, 3.5*cm, 10*cm]))
story += [SP(2),
pearl_box("Only IgG crosses the placenta (via FcRn). IgA is present in breast milk (secretory IgA). IgM is the primary response antibody. IgE is the allergy antibody.", s),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 5. ENT RELEVANCE - SECRETORY IgA (MUCOSAL IMMUNITY)
# ══════════════════════════════════════════════════════════════════════
story.append(H("5. SECRETORY IgA AND ENT MUCOSAL IMMUNITY", s['h1']))
story += [
B("Secretory IgA (sIgA) = IgA dimer + J chain + secretory component (SC).", s['bullet']),
B("Produced by plasma cells in lamina propria of mucosal surfaces.", s['bullet']),
B("Synthesis: IgA monomers + J chain --> IgA2-J dimer --> binds poly-Ig receptor (pIgR) on epithelial basolateral surface --> transcytosis --> SC cleaved --> sIgA secreted into lumen.", s['bullet']),
B("SC protects sIgA from proteolytic enzymes in secretions.", s['bullet']),
B("Functions in ENT mucosal surfaces:", s['bullet']),
SB("Nasal mucosa: first-line defense against inhaled pathogens/allergens.", s['subbullet']),
SB("Saliva: sIgA prevents bacterial colonisation (Streptococcus mutans, etc.).", s['subbullet']),
SB("Middle ear: sIgA in middle ear fluid during otitis media with effusion (OME).", s['subbullet']),
SB("Tonsils/adenoids: IgE-containing lymphoid follicles detected in tonsils and adenoids (local IgE production - relevant to ENT allergy).", s['subbullet']),
B("Selective IgA deficiency (most common primary immunodeficiency): recurrent sinopulmonary infections, allergies, autoimmune disease.", s['bullet']),
SP(2),
pearl_box("Local IgE production in nasal mucosa explains 'entopy' (local allergic rhinitis): patients have allergen-specific IgE in nasal secretions but negative skin prick tests and normal serum IgE. [Cummings Ch.35, citing Platts-Mills et al.]", s),
SP(2),
]
# IgE and Allergy Flowchart
story.append(H("5.1 IgE and Allergic Response (Type I Hypersensitivity) in ENT", s['h2']))
allergy_steps = [
"SENSITISATION: Allergen exposure --> APC presents peptide to Th2 cells",
"Th2 cytokines (IL-4, IL-13) --> B cell class switching --> IgE production",
"IgE binds FcepsilonRI on mast cells (high affinity) in nasal mucosa, tonsils, middle ear",
"RE-EXPOSURE: Allergen cross-links IgE on mast cell surface",
"Mast cell degranulation: Histamine, prostaglandins, leukotrienes released",
"EARLY PHASE (0-1 hr): Sneezing, rhinorrhoea, nasal obstruction, laryngeal oedema",
"LATE PHASE (4-8 hr): Eosinophil infiltration, tissue remodelling, nasal polyps",
]
story.append(flowchart_box(allergy_steps, s, "IgE-Mediated Allergic Response in ENT"))
story += [SP(3)]
# ══════════════════════════════════════════════════════════════════════
# 6. IMMUNOGLOBULIN DEFICIENCIES - ENT PERSPECTIVE
# ══════════════════════════════════════════════════════════════════════
story.append(H("6. IMMUNOGLOBULIN DEFICIENCIES - ENT MANIFESTATIONS", s['h1']))
def_headers = ["Deficiency", "Serum Ig Pattern", "Key ENT Manifestations", "Other Features"]
def_rows = [
["Selective IgA deficiency", "IgA low/absent; IgG, IgM normal", "Recurrent sinusitis, otitis media, pharyngitis", "Most common PID (1:600); anaphylaxis with blood products (anti-IgA Ab)"],
["IgG subclass deficiency\n(esp. IgG2)", "Total IgG normal; IgG2 low", "Recurrent sinusitis, OM, pneumonia (esp. encapsulated organisms)", "May coexist with IgA deficiency; check subclasses in recurrent ENT infections"],
["Common Variable Immunodeficiency (CVID)", "Low IgG, IgA, IgM; poor vaccine response", "Chronic sinusitis, OM, bronchiectasis; lymphoid hyperplasia of Waldeyer ring", "Most common symptomatic PID in adults; increased risk lymphoma"],
["X-linked agammaglobulinaemia (XLA / Bruton)", "All Ig absent; no B cells", "Recurrent bacterial sinusitis, OM, meningitis; normal viral immunity", "Mutation in BTK gene; presents after 6 months (maternal IgG wanes)"],
["IgG4-Related Disease", "Elevated IgG4 (>135 mg/dL)", "Sialadenitis (Kuttner tumour), dacryoadenitis, orbital pseudotumour, subglottic stenosis", "Storiform fibrosis + IgG4+ plasma cells >10/HPF on biopsy; responds to steroids"],
["Hyper-IgM syndrome", "High IgM; absent IgG, IgA, IgE", "Recurrent sinopulmonary infections; Pneumocystis jirovecii", "CD40L mutation; failure of class switching"],
]
story.append(make_table(def_headers, def_rows, s, [3.5*cm, 3.5*cm, 5.5*cm, 5*cm]))
story += [SP(2),
caution_box("Do NOT transfuse blood products to patients with selective IgA deficiency without checking for anti-IgA antibodies - risk of severe anaphylaxis.", s),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 7. INVESTIGATIONS
# ══════════════════════════════════════════════════════════════════════
story.append(H("7. INVESTIGATIONS", s['h1']))
story.append(H("7.1 Serum Immunoglobulin Measurement", s['h2']))
inv_headers = ["Test", "Method", "Normal Range (Adult)", "Indication"]
inv_rows = [
["Total IgG", "Nephelometry / Turbidimetry", "700-1600 mg/dL", "Screening for hypogammaglobulinaemia"],
["Total IgA", "Nephelometry", "70-400 mg/dL", "IgA deficiency screen; IgA nephropathy; coeliac"],
["Total IgM", "Nephelometry", "40-230 mg/dL", "Primary vs secondary response; Waldenstrom macroglobulinaemia"],
["Total IgE", "ELISA / FEIA", "< 100 IU/mL (varies with age)", "Atopy, allergic rhinitis, helminth infection, ABPA"],
["IgG subclasses (IgG1-4)", "Nephelometry", "IgG1: 350-900; IgG2: 100-350; IgG3: 15-90; IgG4: 1-130 (mg/dL)", "Recurrent sinopulmonary infections with normal total IgG"],
["Specific IgE (RAST/ImmunoCAP)", "ELISA / Fluorescence", "< 0.35 kU/L = negative", "Identify specific allergen (pollen, dust mite, mould) in ENT allergy"],
["Serum protein electrophoresis (SPEP)", "Electrophoresis", "Gamma fraction: 0.6-1.6 g/dL", "Monoclonal paraprotein (multiple myeloma, MGUS, IgG4-RD)"],
["Vaccine response (anti-Pneumococcal IgG)", "Serology pre/post vaccination", "4-fold rise expected", "Assess functional antibody production (CVID vs IgG subclass deficiency)"],
]
story.append(make_table(inv_headers, inv_rows, s, [3*cm, 3.5*cm, 3.5*cm, 7.5*cm]))
story.append(H("7.2 Other Relevant Tests in Immunodeficiency", s['h2']))
story += [
B("CBC with differential: lymphopenia (combined immunodeficiency), neutrophilia (bacterial infection).", s['bullet']),
B("Flow cytometry: B-cell count (CD19/CD20) - absent in XLA; T-cell subsets.", s['bullet']),
B("Nasal cytology / smear: eosinophils (allergic rhinitis), neutrophils (infection).", s['bullet']),
B("Nasal allergen provocation + local IgE in nasal lavage: for entopy (local allergic rhinitis).", s['bullet']),
B("CT PNS / Temporal bone CT: extent of sinusitis/mastoiditis in immunodeficiency.", s['bullet']),
B("Biopsy (IgG4-RD): storiform fibrosis + IgG4+ plasma cell count >10/HPF.", s['bullet']),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 8. DIFFERENTIAL DIAGNOSIS (when evaluating Ig abnormality in ENT)
# ══════════════════════════════════════════════════════════════════════
story.append(H("8. DIFFERENTIAL DIAGNOSIS", s['h1']))
story.append(H("8.1 Raised IgE in ENT", s['h2']))
story += [
B("Allergic rhinitis (most common in ENT practice).", s['bullet']),
B("Allergic fungal sinusitis (AFS): markedly elevated total IgE.", s['bullet']),
B("Nasal polyps (often with elevated IgE and eosinophilia).", s['bullet']),
B("Parasitic / helminth infection.", s['bullet']),
B("Hyper-IgE syndrome (Job syndrome): recurrent skin/pulmonary infections, eczema, skeletal anomalies.", s['bullet']),
SP(2),
]
story.append(H("8.2 Low Immunoglobulins in Recurrent ENT Infections", s['h2']))
story += [
B("Selective IgA deficiency.", s['bullet']),
B("IgG subclass deficiency (IgG2 most common).", s['bullet']),
B("CVID.", s['bullet']),
B("XLA (Bruton agammaglobulinaemia) in male children.", s['bullet']),
B("Secondary: HIV, lymphoma, chemotherapy, nephrotic syndrome, protein-losing enteropathy.", s['bullet']),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 9. MANAGEMENT
# ══════════════════════════════════════════════════════════════════════
story.append(H("9. MANAGEMENT", s['h1']))
story.append(H("9.1 Medical Management", s['h2']))
story += [
B("IgG deficiency / CVID / XLA: Intravenous Immunoglobulin (IVIG) or Subcutaneous Immunoglobulin (SCIG).", s['bullet']),
SB("IVIG dose: 400-600 mg/kg every 3-4 weeks IV. Maintain trough IgG > 500 mg/dL.", s['subbullet']),
SB("SCIG: 100-150 mg/kg/week SC - preferred for home therapy; smaller, more frequent doses.", s['subbullet']),
B("IgA deficiency: NO Ig replacement available (no IgA product); treat infections with antibiotics; avoid blood products or use IgA-depleted products.", s['bullet']),
B("Hyper-IgM syndrome: IVIG + prophylactic cotrimoxazole (anti-Pneumocystis).", s['bullet']),
B("IgG4-RD: Prednisolone 30-40 mg/day tapering over 3-6 months. Second-line: Rituximab (anti-CD20).", s['bullet']),
B("Allergic rhinitis (IgE-mediated):", s['bullet']),
SB("Intranasal corticosteroids (INCS): first-line (mometasone, fluticasone, budesonide).", s['subbullet']),
SB("Antihistamines (cetirizine, fexofenadine): symptom control.", s['subbullet']),
SB("Anti-IgE therapy: Omalizumab (recombinant humanised anti-IgE monoclonal Ab) for severe allergic rhinitis/asthma.", s['subbullet']),
SB("Allergen immunotherapy (AIT/SCIT/SLIT): desensitisation - reduces allergen-specific IgE, increases IgG4 (blocking Ab).", s['subbullet']),
SP(2),
pearl_box("Omalizumab binds free IgE (not IgE on mast cells), preventing cross-linking. Used in severe allergic rhinitis, chronic urticaria, and allergic asthma. Dose based on body weight AND baseline IgE level.", s),
SP(2),
]
story.append(H("9.2 Surgical Management", s['h2']))
story += [
B("Recurrent sinusitis in immunodeficiency: Functional Endoscopic Sinus Surgery (FESS) after optimising Ig replacement - improves drainage, reduces infection load.", s['bullet']),
B("Grommets (ventilation tubes): for recurrent OME in IgA deficiency / IgG2 subclass deficiency.", s['bullet']),
B("Tonsillectomy/adenoidectomy: in select cases of recurrent tonsillitis (note: Waldeyer ring is a major lymphoid/Ig production site - weigh risks).", s['bullet']),
B("IgG4-RD orbital/salivary disease: surgery for debulking if steroid-refractory or diagnostic biopsy.", s['bullet']),
B("Nasal polypectomy / ESS: in allergic fungal sinusitis (AFS) - surgery + systemic antifungal + steroids + may add anti-IgE (omalizumab) post-op.", s['bullet']),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 10. COMPLICATIONS
# ══════════════════════════════════════════════════════════════════════
story.append(H("10. COMPLICATIONS", s['h1']))
story += [
B("Untreated Ig deficiency: bronchiectasis, sensorineural hearing loss, meningitis, sepsis.", s['bullet']),
B("IVIG infusion reactions: headache, fever, rigors, anaphylaxis (rare). Pre-medicate with paracetamol + antihistamine.", s['bullet']),
B("CVID: increased risk of non-Hodgkin lymphoma and autoimmune disease.", s['bullet']),
B("Hyper-IgE syndrome: coronary artery aneurysm, osteopenia, scoliosis.", s['bullet']),
B("IgG4-RD: fibrosis can cause permanent organ damage (salivary gland destruction, orbital compression, subglottic stenosis).", s['bullet']),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 11. RECENT ADVANCES
# ══════════════════════════════════════════════════════════════════════
story.append(H("11. RECENT ADVANCES", s['h1']))
story += [
B("Omalizumab (anti-IgE): FDA-approved for chronic idiopathic urticaria and allergic asthma; evidence for nasal polyps (with IL-5 pathway drugs).", s['bullet']),
B("Dupilumab (anti-IL-4Ralpha): reduces IgE production; approved for chronic rhinosinusitis with nasal polyps (CRSwNP) and atopic dermatitis.", s['bullet']),
B("Local IgE / 'Entopy': Emerging concept that nasal mucosa produces IgE locally without systemic sensitisation - explains skin-prick-test-negative allergic rhinitis. [Rondón et al., JACI 2012]", s['bullet']),
B("SCIG (subcutaneous Ig): Improved QoL vs IVIG; equivalent efficacy in CVID.", s['bullet']),
B("Rituximab for IgG4-RD: B-cell depletion is first-line steroid-sparing agent in relapsing IgG4-RD.", s['bullet']),
B("Next-generation sequencing: molecular diagnosis of primary immunodeficiency with Ig pathway mutations (BTK, CD40L, AID, UNG).", s['bullet']),
SP(2),
]
# ══════════════════════════════════════════════════════════════════════
# 12. VIVA QUESTIONS
# ══════════════════════════════════════════════════════════════════════
story.append(H("12. VIVA QUESTIONS", s['h1']))
viva_data = [
["Q", "Model Answer"],
["What is the only Ig that crosses the placenta?", "IgG - via FcRn (neonatal Fc receptor) active transport."],
["Which Ig is most efficient at fixing complement?", "IgM (pentamer activates C1q most efficiently due to multiple Fc domains close together)."],
["What is the predominant Ig in nasal secretions?", "Secretory IgA (sIgA)."],
["Name the Ig involved in Type I hypersensitivity.", "IgE - cross-links FcepsilonRI on mast cells/basophils."],
["Which IgG subclass deficiency causes recurrent ENT infections?", "IgG2 - deficiency impairs response to polysaccharide antigens (Haemophilus, Pneumococcus)."],
["What is IgG4-related disease in ENT?", "Immune-mediated fibroinflammatory condition with storiform fibrosis, IgG4+ plasma cells (>10/HPF), elevated serum IgG4 (>135 mg/dL); affects salivary glands (Kuttner tumour), orbits, subglottis."],
["What is entopy / local allergic rhinitis?", "Local IgE production in nasal mucosa causing allergic rhinitis with negative skin prick test and normal serum IgE; detected by nasal allergen provocation and local IgE assay."],
["How does omalizumab work?", "Humanised anti-IgE monoclonal Ab; binds free IgE preventing binding to mast cell FcepsilonRI."],
["What is the function of the J chain?", "Links IgM monomers into pentamer and IgA monomers into dimer; required for polymeric Ig secretion."],
["What is ADCC?", "Antibody-Dependent Cellular Cytotoxicity: IgG Fc binds CD16 (FcgammaRIII) on NK cells --> NK cell kills antibody-coated target cell (virus-infected or tumour cell)."],
]
viva_table_data = [[Paragraph(r[0], s['tbl_cell_bold']), Paragraph(r[1], s['tbl_cell'])] for r in viva_data[1:]]
viva_table = Table([[Paragraph("Question", s['tbl_hdr']), Paragraph("Model Answer", s['tbl_hdr'])]] + viva_table_data,
colWidths=[5.5*cm, 12*cm], repeatRows=1)
viva_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), C_HEAD1),
('TEXTCOLOR', (0,0), (-1,0), C_WHITE),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
('ROWBACKGROUNDS', (0,1), (-1,-1), [C_WHITE, C_TABLE_ALT]),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
]))
story.append(viva_table)
story.append(SP(2))
# ══════════════════════════════════════════════════════════════════════
# 13. CLINICAL PEARLS
# ══════════════════════════════════════════════════════════════════════
story.append(H("13. CLINICAL PEARLS", s['h1']))
pearls = [
"IgA is the most PRODUCED Ig in the body; IgG is the most abundant in SERUM.",
"IgG2 subclass deficiency: recurrent sinopulmonary infections with NORMAL total IgG - always check subclasses.",
"IgM = primary response (early); IgG = secondary/memory response (late).",
"Secretory IgA protects ENT mucosa; deficiency = recurrent sinusitis, OM, pharyngitis.",
"IgE on tonsillar/adenoidal follicles = local IgE production; explains entopy in ENT.",
"IgG4-RD mimics malignancy; Kuttner tumour (submandibular) and orbital pseudotumour are classic H&N manifestations.",
"Only IgG crosses placenta (FcRn); maternal IgG protects neonate for first 6 months.",
"Allergen immunotherapy works by increasing IgG4 (blocking Ab) and reducing IgE.",
"Anti-IgE (omalizumab) dose depends on BOTH body weight AND baseline IgE level.",
"XLA (Bruton): all Ig absent, no B cells; recurrent bacterial infections starting after 6 months of age.",
]
for i, p in enumerate(pearls):
story.append(pearl_box(f"{i+1}. {p}", s))
story.append(SP(1))
story.append(SP(2))
# ══════════════════════════════════════════════════════════════════════
# 14. KEY POINTS SUMMARY
# ══════════════════════════════════════════════════════════════════════
story.append(H("14. KEY POINTS SUMMARY", s['h1']))
kp_data = [
["1", "Immunoglobulins = glycoproteins (antibodies) produced by plasma cells; basic unit = 2H + 2L chains; 5 classes: IgG, IgA, IgM, IgD, IgE."],
["2", "IgG: 75% serum Ig; 4 subclasses; only Ig crossing placenta; main secondary response Ab; opsonin + complement fixer."],
["3", "IgM: 10%; pentamer; FIRST Ig in primary response; most efficient complement fixer; B-cell receptor on naive B cells."],
["4", "IgA: 15% serum; secretory IgA (dimer + SC) = dominant mucosal Ig in nose, throat, saliva, middle ear, GIT - first-line ENT defense."],
["5", "IgE: 0.004% serum; monomer; binds FcepsilonRI on mast cells/basophils; mediates Type I hypersensitivity (allergic rhinitis, AFS)."],
["6", "IgD: 0.2%; B-cell surface receptor; minimal serum function."],
["7", "IgG2 subclass deficiency: most common ENT-relevant immunodeficiency; recurrent sinusitis/OM with normal total IgG."],
["8", "Selective IgA deficiency: most common primary immunodeficiency (1:600); recurrent sinopulmonary infections; anaphylaxis risk with blood products."],
["9", "IgG4-RD: fibro-inflammatory disorder affecting H&N (Kuttner tumour, orbital pseudotumour, subglottic stenosis); Rx = prednisolone + rituximab."],
["10", "Omalizumab (anti-IgE): binds free IgE; used in severe allergic rhinitis, CRSwNP, asthma; dupilumab (anti-IL-4Ralpha) reduces IgE production."],
]
kp_table = Table(
[[Paragraph(r[0], s['tbl_cell_bold']), Paragraph(r[1], s['tbl_cell'])] for r in kp_data],
colWidths=[1*cm, 16.5*cm]
)
kp_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), C_PEARL_BG),
('ROWBACKGROUNDS', (0,0), (-1,-1), [C_PEARL_BG, C_WHITE]),
('BOX', (0,0), (-1,-1), 1.5, C_HEAD1),
('LINEBELOW', (0,0), (-1,-2), 0.5, colors.HexColor("#AED6F1")),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('LEFTPADDING', (0,0), (-1,-1), 6),
('RIGHTPADDING', (0,0), (-1,-1), 6),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('FONTNAME', (0,0), (0,-1), 'Helvetica-Bold'),
('TEXTCOLOR', (0,0), (0,-1), C_HEAD1),
]))
story.append(kp_table)
story.append(SP(3))
# REFERENCES
story.append(H("REFERENCES", s['h2']))
refs = [
"1. Cummings CW, et al. Cummings Otolaryngology Head and Neck Surgery. 7th Ed. Elsevier; 2021. Chapter 35: Immunology.",
"2. Scott-Brown WG. Scott-Brown's Otorhinolaryngology Head & Neck Surgery. 8th Ed. CRC Press; 2018.",
"3. Lieberman M, Peet A. Basic Medical Biochemistry: A Clinical Approach. 6th Ed. Wolters Kluwer; 2021. Chapter 7.",
"4. Murray PR, Rosenthal KS. Medical Microbiology. 9th Ed. Elsevier; 2021.",
"5. Rondon C, et al. Local allergic rhinitis: concept, pathophysiology, and management. J Allergy Clin Immunol. 2012;129(6):1460-7. PMID: 22502439.",
"6. Muller R, et al. Thoracic manifestations of IgG4-related disease. Respirology. 2023;28(2):133-146. PMID: 36437514.",
"7. Bartha I, et al. A comprehensive review of food allergy 2021-2023. J Allergy Clin Immunol. 2024;153(3):689-704. PMID: 38101757.",
]
for r in refs:
story.append(Paragraph(r, s['source']))
story.append(SP(2))
return story
# ═══════════════════════════════════════════════════════════════════════════
# BUILD PDF
# ═══════════════════════════════════════════════════════════════════════════
def main():
s = build_styles()
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm,
rightMargin=1.8*cm,
topMargin=1.8*cm,
bottomMargin=1.8*cm,
title="Immunoglobulins - ENT Long Answer",
author="Orris AI | KNRUHS ENT Exam Prep"
)
story = build(s)
doc.build(story)
print(f"PDF saved: {OUTPUT}")
if __name__ == "__main__":
main()
cd /home/daytona/workspace/ent-exam && python3 immunoglobulins.py 2>&1
ls -lh /home/daytona/workspace/ent-exam/Immunoglobulins_ENT_Exam.pdf && python3 …
~/ent-exam/immunoglobulins.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ent-exam/immunoglobulins.py'
~/ent-exam/immunoglobulins.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/ent-exam/immunoglobulins.py'
cd /home/daytona/workspace/ent-exam && python3 immunoglobulins.py 2>&1 && python…
Immunoglobulins ENT Exam
PDF Document · PDF
| Section | Content |
|---|---|
| 1 | Definition |
| 2 | Structure - domains table (Fab, Fc, VH, VL, hinge, J chain, SC) |
| 3 | Classification table - all 5 classes + IgG subclass table |
| 4 | Physiology - B cell activation flowchart + effector functions table |
| 5 | Secretory IgA + IgE/allergy flowchart (ENT focus) |
| 6 | Immunodeficiency table (IgA def, IgG2, CVID, XLA, IgG4-RD, Hyper-IgM) |
| 7 | Investigations table (nephelometry, RAST, SPEP, vaccine response) |
| 8 | Differential diagnosis (raised IgE vs low Ig in ENT) |
| 9 | Management - IVIG/SCIG doses, omalizumab, dupilumab, FESS, grommets |
| 10 | Complications |
| 11 | Recent advances (omalizumab, dupilumab, entopy, rituximab) |
| 12 | 10 Viva Q&A table |
| 13 | 10 Exam pearl boxes (highlighted in blue) |
| 14 | 10-point Key Points Summary |
I need points for a 10 mark long answer. Only from standard university textbooks like Scott Brown's, Cummins.. Uh, it should include... From introduction to conclusion, give me flowcharts... When needed, give me diagrams... Uh, in the end of the topic. Summarize with key points. Uh, this is for, uh, a 10 marks long answer. For an exam. Of KNRU, which is university? Uh, I need it in, um... Points and not big, big paragraphs. Easy to memorize. Easy to understand. I need you to add definition. Uh, applied anatomy, embryology, physiology, etiology, risk factors, classification, clinical features, history, physical examination, investigations, imaging, diagnosis, differential diagnosis. As to path, if there are any staging systems, keep that. Management, divide it into medical and surgical, if it's divided. Complications, prognosis, follow-up, recent advances, Viva questions, clinical pulse. And summarize the entire thing in few points, like key points. Give, uh, all the answers in, uh, similar direction, whatever I ask for from now. And give it in PDF format, which ha- which has to be printable. I need you to add content from Scott Brown Cummings. And are those standard ENT textbooks, or you can use information from standard ENT articles from PubMed, NCBI? Hello? I don't want long answers. I want answers for, for just five to six pages. Don't give me unwanted matter. Whatever is there in textbook, like, just don't dump here. Give me important points straight. But in detail. 5-6 pages only not more And i don’t want so many tables I want point easy to understand also Give me in notes If I like it generate into pdf
KNRUHS is a university And I’m appearing for that university final ent exams So I want you to give answer not more than 5-6 pages Only important points for pg level No paragraphs No too many tables Only give when required Easy to understand
I want from standard ent text books like Scott brown Cummings Bailey only I don’t want random matter
Immunoglobulins
Exam Pearl: Papain cleaves into 2 Fab + 1 Fc. Pepsin cleaves into F(ab')2 + pFc'
| Class | Heavy Chain | MW (Da) | % Serum | Structure |
|---|---|---|---|---|
| IgG | gamma | 150,000 | 75% | Monomer |
| IgA | alpha | 160,000 | 15% | Monomer/Dimer |
| IgM | mu | 900,000 | 10% | Pentamer |
| IgD | delta | 180,000 | 0.2% | Monomer |
| IgE | epsilon | 200,000 | 0.004% | Monomer |
Mnemonic: GAMED (G > A > M > E > D) = order of serum concentration
Plasma cells in lamina propria
↓
IgA monomer + J chain = IgA dimer
↓
Binds poly-Ig receptor (pIgR) on basolateral epithelium
↓
Transcytosis across epithelial cell
↓
Secretory component added (protects from proteolysis)
↓
Secretory IgA released into nasal/oral secretions
| Condition | Ig Pattern | Key ENT Features |
|---|---|---|
| Selective IgA deficiency | IgA absent, IgG/IgM normal | Recurrent sinusitis, OM; anaphylaxis with blood products (anti-IgA Ab) |
| IgG2 subclass deficiency | Total IgG normal; IgG2 low | Recurrent sinusitis, OM (esp. Pneumococcus, H.flu) |
| CVID | Low IgG, IgA, IgM | Chronic sinusitis, OM, bronchiectasis; lymphoid hyperplasia |
| XLA (Bruton) | All Ig absent; no B cells | Recurrent bacterial sinusitis, OM after 6 months of age |
| IgG4-RD | Elevated IgG4 (>135 mg/dL) | Kuttner tumour (submandibular), orbital pseudotumour, subglottic stenosis |
| Hyper-IgM syndrome | High IgM; absent IgG/IgA | Recurrent sinopulmonary; Pneumocystis infection |
Ok
mkdir -p /home/daytona/workspace/ent-exam && echo "ready"
~/ent-exam/immunoglobulins_notes.py
#!/usr/bin/env python3
"""
IMMUNOGLOBULINS - KNRUHS Final Year ENT
Notes-style PDF | Max 6 pages
Sources: Cummings Ch.35 | Scott-Brown Vol.1
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER
OUTPUT = "/home/daytona/workspace/ent-exam/Immunoglobulins_KNRUHS_ENT.pdf"
# ── PALETTE: navy / teal / amber ─────────────────────────────────────────
NAVY = colors.HexColor("#1B2A4A")
TEAL = colors.HexColor("#0E7C7B")
AMBER = colors.HexColor("#C87941")
RED = colors.HexColor("#9B2335")
BG_HEAD = colors.HexColor("#1B2A4A")
BG_SUB = colors.HexColor("#E8F4F8")
BG_PEARL= colors.HexColor("#FFF8E1")
BG_CAUT = colors.HexColor("#FDECEA")
BG_FLOW = colors.HexColor("#E9F7EF")
BG_ALT = colors.HexColor("#F0F4F8")
WHITE = colors.white
GRAY = colors.HexColor("#444444")
LGRAY = colors.HexColor("#888888")
W, H = A4
CW = W - 3.4*cm # usable content width
# ── STYLES ────────────────────────────────────────────────────────────────
def S():
d = {}
d['title'] = ParagraphStyle('title', fontName='Helvetica-Bold', fontSize=17,
textColor=WHITE, alignment=TA_CENTER, leading=21, spaceAfter=2)
d['subtitle'] = ParagraphStyle('subtitle', fontName='Helvetica', fontSize=9,
textColor=colors.HexColor("#BBDEFB"), alignment=TA_CENTER, leading=12, spaceAfter=0)
d['source'] = ParagraphStyle('source', fontName='Helvetica-Oblique', fontSize=7.5,
textColor=colors.HexColor("#90CAF9"), alignment=TA_CENTER, leading=10)
d['h1'] = ParagraphStyle('h1', fontName='Helvetica-Bold', fontSize=10.5,
textColor=WHITE, leading=14, spaceAfter=3, spaceBefore=7,
leftIndent=0, rightIndent=0, borderPad=3, backColor=BG_HEAD)
d['h2'] = ParagraphStyle('h2', fontName='Helvetica-Bold', fontSize=9.5,
textColor=TEAL, leading=13, spaceAfter=2, spaceBefore=5)
d['h3'] = ParagraphStyle('h3', fontName='Helvetica-Bold', fontSize=9,
textColor=AMBER, leading=12, spaceAfter=1, spaceBefore=3)
d['b'] = ParagraphStyle('b', fontName='Helvetica', fontSize=8.5,
textColor=GRAY, leading=11.5, spaceAfter=1, spaceBefore=0,
leftIndent=12, bulletIndent=2)
d['sb'] = ParagraphStyle('sb', fontName='Helvetica', fontSize=8,
textColor=GRAY, leading=11, spaceAfter=1, spaceBefore=0,
leftIndent=24, bulletIndent=14)
d['bold_b'] = ParagraphStyle('bold_b', fontName='Helvetica-Bold', fontSize=8.5,
textColor=NAVY, leading=11.5, spaceAfter=1, spaceBefore=0,
leftIndent=12, bulletIndent=2)
d['pearl'] = ParagraphStyle('pearl', fontName='Helvetica-Bold', fontSize=8.5,
textColor=colors.HexColor("#7B5E00"), leading=12)
d['caut'] = ParagraphStyle('caut', fontName='Helvetica-Bold', fontSize=8.5,
textColor=RED, leading=12)
d['flow'] = ParagraphStyle('flow', fontName='Helvetica', fontSize=8.5,
textColor=colors.HexColor("#145A32"), alignment=TA_CENTER, leading=12)
d['flow_arr'] = ParagraphStyle('flow_arr', fontName='Helvetica-Bold', fontSize=11,
textColor=TEAL, alignment=TA_CENTER, leading=12)
d['tbl_h'] = ParagraphStyle('tbl_h', fontName='Helvetica-Bold', fontSize=8,
textColor=WHITE, alignment=TA_CENTER, leading=10)
d['tbl_c'] = ParagraphStyle('tbl_c', fontName='Helvetica', fontSize=8,
textColor=GRAY, alignment=TA_LEFT, leading=10)
d['tbl_cb'] = ParagraphStyle('tbl_cb', fontName='Helvetica-Bold', fontSize=8,
textColor=NAVY, alignment=TA_LEFT, leading=10)
d['viva_q'] = ParagraphStyle('viva_q', fontName='Helvetica-Bold', fontSize=8.5,
textColor=NAVY, leading=12)
d['viva_a'] = ParagraphStyle('viva_a', fontName='Helvetica', fontSize=8.5,
textColor=GRAY, leading=11.5)
d['key'] = ParagraphStyle('key', fontName='Helvetica', fontSize=8.5,
textColor=GRAY, leading=11.5, spaceAfter=1,
leftIndent=14, bulletIndent=4)
d['key_b'] = ParagraphStyle('key_b', fontName='Helvetica-Bold', fontSize=8.5,
textColor=NAVY, leading=11.5, spaceAfter=1,
leftIndent=14, bulletIndent=4)
d['ref'] = ParagraphStyle('ref', fontName='Helvetica-Oblique', fontSize=7,
textColor=LGRAY, leading=9.5, spaceAfter=0)
return d
def sp(n): return Spacer(1, n*mm)
def rule(): return HRFlowable(width="100%", thickness=0.8, color=TEAL, spaceAfter=3, spaceBefore=2)
def B(txt, s): return Paragraph(u"\u2022 " + txt, s['b'])
def Bb(txt, s): return Paragraph(u"\u2022 " + txt, s['bold_b'])
def SB(txt, s): return Paragraph(u"\u25e6 " + txt, s['sb'])
def pearl(txt, s):
t = Table([[Paragraph("<b>EXAM PEARL:</b> " + txt, s['pearl'])]], colWidths=[CW])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), BG_PEARL),
('BOX', (0,0), (-1,-1), 1, AMBER),
('LEFTPADDING',(0,0),(-1,-1),7),('RIGHTPADDING',(0,0),(-1,-1),7),
('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
]))
return t
def caution(txt, s):
t = Table([[Paragraph("<b>CAUTION:</b> " + txt, s['caut'])]], colWidths=[CW])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), BG_CAUT),
('BOX', (0,0), (-1,-1), 1, RED),
('LEFTPADDING',(0,0),(-1,-1),7),('RIGHTPADDING',(0,0),(-1,-1),7),
('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
]))
return t
def heading(txt, s):
return Table([[Paragraph(" " + txt, s['h1'])]], colWidths=[CW],
style=TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_HEAD),
('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0),
]))
def simple_table(headers, rows, s, cw=None):
if cw is None:
cw = [CW/len(headers)]*len(headers)
hrow = [Paragraph(h, s['tbl_h']) for h in headers]
body = [[Paragraph(str(c), s['tbl_c']) for c in r] for r in rows]
t = Table([hrow]+body, colWidths=cw, repeatRows=1)
ts = TableStyle([
('BACKGROUND',(0,0),(-1,0), BG_HEAD),
('ROWBACKGROUNDS',(0,1),(-1,-1),[WHITE, BG_ALT]),
('GRID',(0,0),(-1,-1),0.4,colors.HexColor("#C0C0C0")),
('VALIGN',(0,0),(-1,-1),'TOP'),
('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
])
t.setStyle(ts)
return t
def flowchart(steps, s):
rows = []
for i, step in enumerate(steps):
rows.append(Table([[Paragraph(step, s['flow'])]], colWidths=[14*cm],
style=TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_FLOW),
('BOX',(0,0),(-1,-1),1,TEAL),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
])))
if i < len(steps)-1:
rows.append(Paragraph("▼", s['flow_arr']))
outer = [[r] for r in rows]
t = Table(outer, colWidths=[14*cm])
t.setStyle(TableStyle([
('ALIGN',(0,0),(-1,-1),'CENTER'),
('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0),
('TOPPADDING',(0,0),(-1,-1),1),('BOTTOMPADDING',(0,0),(-1,-1),1),
]))
return t
# ═════════════════════════════════════════════════════════════════════
def build_story(s):
story = []
# ── TITLE BANNER ─────────────────────────────────────────────────
title_tbl = Table([
[Paragraph("IMMUNOGLOBULINS", s['title'])],
[Paragraph("KNRUHS Final Year ENT | 10-Mark Long Answer", s['subtitle'])],
[Paragraph("Cummings Otolaryngology Ch.35 | Scott-Brown's ORL HNS Vol.1", s['source'])],
], colWidths=[CW])
title_tbl.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_HEAD),
('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),4),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
]))
story += [title_tbl, sp(3)]
# ══════════════════════════════════════════════════════════════════
# 1. DEFINITION
# ══════════════════════════════════════════════════════════════════
story += [heading("1. DEFINITION", s), sp(1)]
story += [
B("Immunoglobulins (Ig) = <b>glycoproteins produced by plasma cells</b> (activated B cells) functioning as antibodies", s),
B("Composed of <b>82-96% polypeptide</b> + 4-18% carbohydrate", s),
B("Effector molecules of <b>humoral immunity</b>", s),
sp(2),
]
# ══════════════════════════════════════════════════════════════════
# 2. STRUCTURE
# ══════════════════════════════════════════════════════════════════
story += [heading("2. STRUCTURE", s), sp(1),
Paragraph(s['h2'].name, s['h2']),
]
story += [
B("Basic unit = <b>2 heavy chains (50 kDa)</b> + <b>2 light chains (25 kDa)</b> = Y-shaped tetramer", s),
B("<b>Light chains:</b> kappa or lambda - present in ALL classes", s),
B("<b>Heavy chains:</b> define the class (gamma, mu, alpha, delta, epsilon)", s),
B("<b>Variable region (V):</b> N-terminal - determines antigen specificity (CDRs here)", s),
B("<b>Constant region (C):</b> C-terminal - determines effector function", s),
sp(2),
]
story += [Paragraph("Key Fragments:", s['h3'])]
frag_rows = [
["Fab", "VH + VL + CH1 + CL", "Antigen binding (2 identical sites per Ig)"],
["Fc", "CH2 + CH3 (heavy chains)", "Effector functions: complement, Fc receptors"],
["Hinge region", "Between CH1-CH2", "Flexibility; papain/pepsin cleavage site"],
["J chain", "Joins polymer subunits", "Polymerises IgM pentamer and IgA dimer"],
["Secretory component (SC)", "IgA only", "Protects sIgA from proteolysis; assists transcytosis"],
]
story += [simple_table(["Fragment","Location","Function"], frag_rows, s, [2.5*cm, 4*cm, 10*cm]),
sp(2),
pearl("Papain --> 2 Fab + 1 Fc. Pepsin --> F(ab')2 + pFc'. CDR = hypervariable loops that contact antigen.", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 3. CLASSIFICATION
# ══════════════════════════════════════════════════════════════════
story += [heading("3. CLASSIFICATION (5 Classes)", s), sp(1)]
cls_rows = [
["IgG", "gamma", "150,000", "~75%", "Monomer", "Main secondary response; only Ig crossing placenta; opsonin"],
["IgA", "alpha", "160,000", "~15%", "Monomer/Dimer", "Predominant mucosal Ig; 70% of nasal secretion proteins"],
["IgM", "mu", "900,000", "~10%", "Pentamer", "First in primary response; most efficient complement fixer"],
["IgD", "delta", "180,000", "0.2%", "Monomer", "B-cell surface receptor; minimal serum function"],
["IgE", "epsilon", "200,000", "0.004%", "Monomer", "Type I hypersensitivity; anti-helminthic"],
]
story += [simple_table(["Class","Heavy Chain","MW (Da)","% Serum","Structure","Key Role"], cls_rows, s,
[1.5*cm, 2.2*cm, 2.2*cm, 1.8*cm, 2.2*cm, 6.6*cm]),
sp(1),
pearl("Mnemonic GAMED = IgG > IgA > IgM > IgD > IgE (order of serum concentration)", s),
sp(2),
]
story += [Paragraph("IgG Subclasses (Important for ENT):", s['h3']),
Bb("IgG1 - protein antigens; anti-viral antibodies", s),
Bb("IgG2 - polysaccharide antigens (Pneumococcus, H. influenzae); <b>IgG2 deficiency = recurrent sinusitis + OM</b>", s),
Bb("IgG3 - most potent complement fixer; shortest half-life (7 days)", s),
Bb("IgG4 - chronic antigen exposure; elevated in <b>IgG4-Related Disease (IgG4-RD)</b>", s),
caution("IgG2 subclass deficiency causes recurrent ENT infections even when TOTAL IgG is normal. Always check subclasses.", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 4. PHYSIOLOGY / FUNCTIONS
# ══════════════════════════════════════════════════════════════════
story += [heading("4. PHYSIOLOGY & FUNCTIONS", s), sp(1),
Paragraph("B Cell Activation --> Ig Production:", s['h3']),
]
story += [
flowchart([
"Naive B cell (surface IgM + IgD as antigen receptors)",
"Antigen binds BCR + T cell help (CD40L-CD40)",
"Germinal centre: somatic hypermutation + class switch recombination",
"Differentiation into plasma cells --> secrete specific Ig isotype",
"Memory B cells formed --> rapid secondary (recall) response",
], s),
sp(3),
]
story += [Paragraph("Effector Functions:", s['h3']),
B("<b>Neutralisation</b> - IgG, IgA, IgM block pathogen attachment to host cells", s),
B("<b>Opsonisation</b> - IgG Fc binds FcgRIII on macrophages / neutrophils; enhances phagocytosis", s),
B("<b>Complement activation</b> - IgM > IgG (classical pathway via C1q binding Fc)", s),
B("<b>ADCC</b> - IgG Fc binds CD16 on NK cells; NK cell kills antibody-coated target", s),
B("<b>Mast cell degranulation</b> - IgE cross-links FceRI on mast cells/basophils --> histamine, leukotrienes", s),
B("<b>Placental transfer</b> - IgG ONLY (via FcRn - neonatal Fc receptor); protects neonate for 6 months", s),
B("<b>Mucosal protection</b> - Secretory IgA (sIgA)", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 5. INDIVIDUAL CLASSES - ENT FOCUS
# ══════════════════════════════════════════════════════════════════
story += [heading("5. INDIVIDUAL CLASSES - ENT FOCUS", s), sp(1)]
story += [Paragraph("IgG (75% of serum Ig):", s['h2']),
B("Only Ig crossing placenta - neonatal protection for first 6 months", s),
B("Opsonin + complement fixer; main <b>secondary/recall response</b> antibody", s),
B("IgG2 deficiency: recurrent sinopulmonary infections with <b>normal total IgG</b>", s),
sp(1),
]
story += [Paragraph("IgM (10%):", s['h2']),
B("Pentamer - MW 900,000 Da - largest Ig", s),
B("<b>First antibody in primary response</b> (rises early, replaced by IgG quickly)", s),
B("Most efficient complement fixer", s),
B("B cell surface receptor on naive B cells (with IgD)", s),
sp(1),
]
story += [Paragraph("IgA (15%) - Most Important for ENT:", s['h2']),
B("<b>Most produced Ig in the body</b> by total quantity", s),
B("<b>IgA = 70% of total proteins in nasal secretions</b> (Scott-Brown Vol.1)", s),
B("IgA1 (monomer) = predominant in serum; IgA2 (dimer) = predominant in <b>nasal secretions</b>", s),
B("Secreted into: saliva, tears, nasal mucus, colostrum, breast milk, GIT secretions", s),
B("Main function: neutralise pathogens; prevent systemic access through mucosa", s),
sp(1),
]
story += [Paragraph("IgE (0.004%):", s['h2']),
B("Lowest serum Ig but <b>mediates allergy</b> (Type I hypersensitivity) + anti-helminthic", s),
B("<b>High-affinity FceRI</b> on mast cells + basophils; low-affinity on eosinophils, neutrophils", s),
B("Allergen cross-links IgE on mast cell --> degranulation --> histamine, leukotrienes, prostaglandins", s),
B("<b>IgE produced locally</b> in tonsils, adenoids, nasal mucosa", s),
B("<b>Entopy / Local Allergic Rhinitis:</b> local nasal IgE without systemic sensitisation; <b>negative skin prick test + normal serum IgE</b>", s),
sp(1),
]
story += [Paragraph("IgD (0.2%):", s['h2']),
B("Primarily a <b>B cell membrane receptor</b> (with IgM on naive B cells)", s),
B("Minimal serum function", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 6. SECRETORY IgA - ENT IMPORTANCE
# ══════════════════════════════════════════════════════════════════
story += [heading("6. SECRETORY IgA - ENT IMPORTANCE", s), sp(1),
flowchart([
"Plasma cells in lamina propria produce IgA monomers + J chain",
"IgA monomer + J chain = IgA2-J dimer",
"Dimer binds poly-Ig receptor (pIgR) on basolateral epithelial surface",
"Transcytosis across epithelial cell",
"Secretory component (SC) added during transport - protects from proteolysis",
"Secretory IgA (sIgA) released into nasal / oral secretions",
], s),
sp(3),
B("<b>First line of mucosal defence</b> in nose, throat, middle ear, sinuses", s),
B("Neutralises pathogens BEFORE they invade the epithelium", s),
B("Present in middle ear fluid during Otitis Media with Effusion (OME)", s),
B("IgA deficiency --> recurrent sinusitis, OM, pharyngitis", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 7. Ig IN ENT IMMUNOPATHOLOGY
# ══════════════════════════════════════════════════════════════════
story += [heading("7. Ig IN ENT IMMUNOPATHOLOGY (Hypersensitivity)", s), sp(1),
Bb("Type I (IgE-mediated) - Allergic rhinitis, anaphylaxis, AFS, angioedema", s),
Bb("Type II (IgG/IgM cytotoxic) - Autoimmune conditions; Ab binds cell surface Ag", s),
Bb("Type III (IgG immune complex) - Vasculitis, serum sickness", s),
Bb("Type IV (Cell-mediated, NO Ig) - Contact dermatitis, TB, transplant rejection", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 8. INVESTIGATIONS
# ══════════════════════════════════════════════════════════════════
story += [heading("8. INVESTIGATIONS", s), sp(1)]
inv_rows = [
["Serum Ig levels (nephelometry)", "IgG 700-1600 | IgA 70-400 | IgM 40-230 mg/dL | IgE <100 IU/mL", "Screening for deficiency / excess"],
["IgG subclasses (IgG1-4)", "IgG1 350-900 | IgG2 100-350 | IgG3 15-90 | IgG4 1-130 mg/dL", "Recurrent ENT infections with normal total IgG"],
["Specific IgE (RAST/ImmunoCAP)", "<0.35 kU/L = negative", "Identify specific allergen in ENT allergy"],
["Nasal lavage IgE", "Detects local IgE", "Entopy / Local Allergic Rhinitis diagnosis"],
["SPEP (protein electrophoresis)", "Monoclonal band in gamma region", "IgG4-RD, multiple myeloma, MGUS"],
["Flow cytometry (CD19/CD20)", "B cell count", "Absent in XLA (Bruton); lymphoma staging"],
["Vaccine response (anti-pneumococcal IgG)", "4-fold rise expected", "Functional Ab production - CVID vs IgG2 def"],
]
story += [simple_table(["Test","Normal Range / Result","Indication"], inv_rows, s,
[4*cm, 6*cm, 6.5*cm]),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 9. IMMUNODEFICIENCY - ENT RELEVANCE
# ══════════════════════════════════════════════════════════════════
story += [heading("9. IMMUNODEFICIENCY - ENT RELEVANCE", s), sp(1)]
def_rows = [
["Selective IgA deficiency", "IgA absent; IgG/IgM normal", "Recurrent sinusitis, OM, pharyngitis; anaphylaxis with blood products"],
["IgG2 subclass deficiency", "Total IgG normal; IgG2 low", "Recurrent sinusitis + OM (Pneumococcus, H.flu)"],
["CVID", "Low IgG, IgA, IgM", "Chronic sinusitis, OM, bronchiectasis; lymphoid hyperplasia Waldeyer ring"],
["XLA (Bruton)", "All Ig absent; no B cells", "Recurrent bacterial sinusitis, OM after 6 months (maternal IgG wanes)"],
["IgG4-RD", "Elevated IgG4 >135 mg/dL", "Kuttner tumour (submandibular), orbital pseudotumour, subglottic stenosis"],
["Hyper-IgM syndrome", "High IgM; absent IgG/IgA", "Recurrent sinopulmonary; Pneumocystis jirovecii pneumonia"],
]
story += [simple_table(["Condition","Ig Pattern","ENT Features"], def_rows, s,
[3.5*cm, 4.5*cm, 8.5*cm]),
sp(1),
caution("Never give blood products to IgA-deficient patients without checking for anti-IgA antibodies - risk of severe anaphylaxis.", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 10. MANAGEMENT
# ══════════════════════════════════════════════════════════════════
story += [heading("10. MANAGEMENT", s), sp(1),
Paragraph("Medical:", s['h2']),
Bb("IgG deficiency / CVID / XLA: <b>IVIG</b> 400-600 mg/kg IV every 3-4 weeks; or <b>SCIG</b> 100-150 mg/kg/week SC", s),
SB("Target trough IgG >500 mg/dL", s),
Bb("IgA deficiency: No IgA product available; antibiotics for infections; use IgA-depleted blood products", s),
Bb("IgG4-RD: <b>Prednisolone</b> 30-40 mg/day tapering over 3-6 months; second line = <b>Rituximab</b>", s),
Bb("Allergic rhinitis (IgE-mediated):", s),
SB("<b>Intranasal corticosteroids</b> (mometasone, fluticasone) - FIRST LINE", s),
SB("Antihistamines (cetirizine, fexofenadine) - symptom control", s),
SB("<b>Omalizumab</b> (anti-IgE monoclonal Ab) - binds free IgE; for severe AR + CRSwNP + asthma", s),
SB("<b>Allergen Immunotherapy (AIT)</b> - reduces specific IgE; increases blocking IgG4", s),
sp(2),
Paragraph("Surgical:", s['h2']),
Bb("Recurrent sinusitis in immunodeficiency: <b>FESS</b> after optimising Ig replacement", s),
Bb("Recurrent OME in IgA / IgG2 deficiency: <b>Ventilation tubes (Grommets)</b>", s),
Bb("IgG4-RD: <b>Biopsy</b> for diagnosis (storiform fibrosis + IgG4+ plasma cells >10/HPF); surgery if steroid-refractory", s),
Bb("Nasal polypectomy + ESS in AFS (allergic fungal sinusitis - very high total IgE)", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 11. RECENT ADVANCES
# ══════════════════════════════════════════════════════════════════
story += [heading("11. RECENT ADVANCES", s), sp(1),
B("<b>Omalizumab</b> (anti-IgE): FDA-approved for CRSwNP, severe AR, chronic urticaria", s),
B("<b>Dupilumab</b> (anti-IL-4Ra): reduces IgE production; approved for CRSwNP + atopic dermatitis", s),
B("<b>Entopy / Local Allergic Rhinitis:</b> local nasal IgE with negative skin prick test + normal serum IgE - important diagnostic entity in ENT", s),
B("<b>SCIG:</b> subcutaneous Ig replacement - better QoL than IVIG; home therapy; equivalent efficacy in CVID", s),
B("<b>Rituximab</b> (anti-CD20): first-line steroid-sparing agent in relapsing IgG4-RD", s),
B("Next-gen sequencing: molecular diagnosis of primary immunodeficiencies (BTK, CD40L, AID mutations)", s),
sp(3),
]
# ══════════════════════════════════════════════════════════════════
# 12. VIVA QUESTIONS
# ══════════════════════════════════════════════════════════════════
story += [heading("12. VIVA QUESTIONS", s), sp(1)]
vivas = [
("Which Ig crosses the placenta?", "IgG only - via FcRn (neonatal Fc receptor)"),
("Most efficient complement fixer?", "IgM (pentamer; multiple Fc domains activate C1q simultaneously)"),
("Predominant Ig in nasal secretions?", "Secretory IgA (IgA2 dimer + SC) = 70% of nasal secretion proteins (Scott-Brown)"),
("Ig mediating Type I hypersensitivity?", "IgE - cross-links FceRI on mast cells/basophils"),
("IgG subclass causing recurrent ENT infections?", "IgG2 - deficiency impairs response to polysaccharide antigens (Pneumococcus, H.flu)"),
("What is entopy?", "Local IgE production in nasal mucosa; AR with negative skin prick test + normal serum IgE"),
("IgG4-RD in head and neck?", "Kuttner tumour (submandibular), orbital pseudotumour, subglottic stenosis; Rx = prednisolone"),
("How does omalizumab work?", "Binds free IgE; prevents cross-linking of FceRI-bound IgE on mast cells"),
("Most produced Ig in the body?", "IgA (by total quantity, not serum concentration)"),
("First Ig in primary immune response?", "IgM (rises early, then replaced by IgG of same specificity)"),
]
for q, a in vivas:
viva_tbl = Table([
[Paragraph("Q: " + q, s['viva_q'])],
[Paragraph("A: " + a, s['viva_a'])],
], colWidths=[CW])
viva_tbl.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,0), colors.HexColor("#E8F4F8")),
('BACKGROUND',(0,1),(-1,1), WHITE),
('BOX',(0,0),(-1,-1),0.5,colors.HexColor("#AAAAAA")),
('LEFTPADDING',(0,0),(-1,-1),7),('RIGHTPADDING',(0,0),(-1,-1),7),
('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
]))
story += [viva_tbl, sp(1)]
story.append(sp(3))
# ══════════════════════════════════════════════════════════════════
# 13. KEY POINTS SUMMARY
# ══════════════════════════════════════════════════════════════════
story += [heading("KEY POINTS SUMMARY", s), sp(1)]
keypoints = [
("1.", "5 classes: IgG (75%) > IgA (15%) > IgM (10%) > IgD (0.2%) > IgE (0.004%) - GAMED"),
("2.", "IgG = only Ig crossing placenta (FcRn); main secondary response antibody; opsonin + complement fixer"),
("3.", "IgM = first in primary response; most efficient complement fixer; pentamer"),
("4.", "IgA = MOST PRODUCED Ig overall; sIgA = 70% of nasal secretion proteins (Scott-Brown); first mucosal defense"),
("5.", "IgA2 (dimer) predominant in nasal secretions; IgA1 (monomer) predominant in serum"),
("6.", "IgE mediates Type I hypersensitivity; produced locally in tonsils, adenoids, nasal mucosa (entopy)"),
("7.", "IgG2 deficiency = recurrent sinusitis/OM; total IgG may be NORMAL - always check subclasses"),
("8.", "Selective IgA deficiency = most common PID; anaphylaxis risk with blood products"),
("9.", "IgG4-RD in H&N: Kuttner tumour, orbital pseudotumour, subglottic stenosis; Rx = steroids + rituximab"),
("10.", "Biologics: Omalizumab (anti-IgE) for severe AR/CRSwNP; Dupilumab (anti-IL-4Ra) for CRSwNP"),
]
kp_data = [[Paragraph(num, s['key_b']), Paragraph(pt, s['key'])] for num, pt in keypoints]
kp_tbl = Table(kp_data, colWidths=[1*cm, 15.5*cm])
kp_tbl.setStyle(TableStyle([
('ROWBACKGROUNDS',(0,0),(-1,-1),[BG_PEARL, WHITE]),
('BOX',(0,0),(-1,-1),1,AMBER),
('LINEBELOW',(0,0),(-1,-2),0.3,colors.HexColor("#E0C060")),
('VALIGN',(0,0),(-1,-1),'TOP'),
('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
]))
story += [kp_tbl, sp(3), rule()]
# REFERENCES
story += [
Paragraph("References:", ParagraphStyle('rh', fontName='Helvetica-Bold', fontSize=7.5,
textColor=LGRAY, leading=10)),
Paragraph("1. Cummings Otolaryngology Head and Neck Surgery, 7th Ed. Ch.35 - Immunology. Elsevier 2021.", s['ref']),
Paragraph("2. Scott-Brown's Otorhinolaryngology Head & Neck Surgery Vol.1. Ch. on Nasal Physiology. CRC Press 2018.", s['ref']),
sp(2),
]
return story
# ═════════════════════════════════════════════════════════════════════
def main():
s = S()
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
leftMargin=1.7*cm, rightMargin=1.7*cm,
topMargin=1.5*cm, bottomMargin=1.5*cm,
title="Immunoglobulins - KNRUHS ENT",
author="Orris AI"
)
doc.build(build_story(s))
print(f"Done: {OUTPUT}")
if __name__ == "__main__":
main()
cd /home/daytona/workspace/ent-exam && python3 immunoglobulins_notes.py 2>&1
python3 -c "from pypdf import PdfReader; r=PdfReader('/home/daytona/workspace/en…
Immunoglobulins KNRUHS ENT
PDF Document · PDF
| Section | Content |
|---|---|
| 1 | Definition |
| 2 | Structure - fragments table (Fab, Fc, hinge, J chain, SC) |
| 3 | Classification table - 5 classes + IgG subclasses |
| 4 | Physiology - B cell activation flowchart + effector functions |
| 5 | Individual classes with ENT focus |
| 6 | Secretory IgA flowchart - transcytosis pathway |
| 7 | Immunopathology - 4 types of hypersensitivity |
| 8 | Investigations table |
| 9 | Immunodeficiency + ENT features table |
| 10 | Management - medical + surgical |
| 11 | Recent advances |
| 12 | 10 Viva Q&A |
| Key Points | 10-point amber summary box |
Management of medullary ca thyroid
| Type | Features |
|---|---|
| MEN-2A (Sipple syndrome) | MTC + Phaeochromocytoma + Hyperparathyroidism |
| MEN-2B | MTC + Phaeochromocytoma + Mucosal neuromas + Marfanoid habitus; most aggressive |
| Familial MTC (FMTC) | MTC only; no other endocrinopathy; best prognosis |
Exam Pearl: MEN-2B is the most aggressive form. MEN-2A presents in adolescence/young adults. MEN-2B presents in infancy/childhood.
| Stage | T | N | M |
|---|---|---|---|
| I | T1a, T1b | N0 | M0 |
| II | T2, T3 | N0 | M0 |
| III | T1, T2, T3 | N1a | M0 |
| IVA | T1-T3 / T4a | N1b / Any N | M0 |
| IVB | T4b | Any N | M0 |
| IVC | Any T | Any N | M1 |
Diagnose MTC (FNAC + serum calcitonin)
↓
RET gene mutation testing (ALL patients)
↓
Screen for Phaeochromocytoma (24-hr urine catecholamines + metanephrines + abdominal MRI)
↓
Screen for Hyperparathyroidism (serum calcium) - if MEN-2A
↓
TREAT PHAEOCHROMOCYTOMA FIRST (before thyroid surgery)
↓
Proceed to surgical management
Exam Pearl / Critical Point: An undiagnosed phaeochromocytoma can cause intraoperative hypertensive crisis and death. ALWAYS screen and treat before thyroidectomy. (Cummings Ch.136)
2 years = favourable prognosis
Makr
Okay But make the font to 20
No the previous generated pdf The font looks too small
cd /home/daytona/workspace/ent-exam && sed \ -e "s/fontSize=17/fontSize=20/" \…
cd /home/daytona/workspace/ent-exam && python3 immunoglobulins_v2.py 2>&1 && pyt…
Immunoglobulins KNRUHS ENT v2
PDF Document · PDF
Okay This looks fine Generate the other pdf also
~/ent-exam/mtc_management.py
#!/usr/bin/env python3
"""
Management of Medullary Carcinoma Thyroid (MTC)
KNRUHS Final Year ENT | 10-Mark Long Answer
Sources: Cummings Otolaryngology Ch.136 | Scott-Brown's ORL HNS Vol.1 Ch.58
"""
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER
OUTPUT = "/home/daytona/workspace/ent-exam/MTC_Management_KNRUHS_ENT.pdf"
# ── PALETTE: deep green / gold / burgundy ────────────────────────────────
DKGREEN = colors.HexColor("#1B4332")
GREEN2 = colors.HexColor("#2D6A4F")
GOLD = colors.HexColor("#B7860B")
BURG = colors.HexColor("#7B1D1D")
BG_HEAD = colors.HexColor("#1B4332")
BG_PEARL = colors.HexColor("#FEF9E7")
BG_CAUT = colors.HexColor("#FDECEA")
BG_FLOW = colors.HexColor("#E8F5E9")
BG_ALT = colors.HexColor("#F1F8F4")
WHITE = colors.white
GRAY = colors.HexColor("#333333")
LGRAY = colors.HexColor("#888888")
W, H = A4
CW = W - 3.4*cm
def S():
d = {}
d['title'] = ParagraphStyle('title', fontName='Helvetica-Bold', fontSize=20, textColor=WHITE, alignment=TA_CENTER, leading=25, spaceAfter=2)
d['subtitle'] = ParagraphStyle('subtitle', fontName='Helvetica', fontSize=11, textColor=colors.HexColor("#A8D5B5"), alignment=TA_CENTER, leading=15, spaceAfter=0)
d['source'] = ParagraphStyle('source', fontName='Helvetica-Oblique', fontSize=9, textColor=colors.HexColor("#74C69D"), alignment=TA_CENTER, leading=12)
d['h1'] = ParagraphStyle('h1', fontName='Helvetica-Bold', fontSize=13, textColor=WHITE, leading=17, spaceAfter=3, spaceBefore=7, backColor=BG_HEAD)
d['h2'] = ParagraphStyle('h2', fontName='Helvetica-Bold', fontSize=12, textColor=GREEN2, leading=16, spaceAfter=2, spaceBefore=5)
d['h3'] = ParagraphStyle('h3', fontName='Helvetica-Bold', fontSize=11, textColor=GOLD, leading=15, spaceAfter=1, spaceBefore=3)
d['b'] = ParagraphStyle('b', fontName='Helvetica', fontSize=11, textColor=GRAY, leading=14.5, spaceAfter=1, spaceBefore=0, leftIndent=14, bulletIndent=2)
d['sb'] = ParagraphStyle('sb', fontName='Helvetica', fontSize=10.5, textColor=GRAY, leading=14, spaceAfter=1, spaceBefore=0, leftIndent=28, bulletIndent=16)
d['bold_b'] = ParagraphStyle('bold_b', fontName='Helvetica-Bold', fontSize=11, textColor=DKGREEN, leading=14.5, spaceAfter=1, spaceBefore=0, leftIndent=14, bulletIndent=2)
d['pearl'] = ParagraphStyle('pearl', fontName='Helvetica-Bold', fontSize=11, textColor=colors.HexColor("#7D6608"), leading=14)
d['caut'] = ParagraphStyle('caut', fontName='Helvetica-Bold', fontSize=11, textColor=BURG, leading=14)
d['flow'] = ParagraphStyle('flow', fontName='Helvetica', fontSize=11, textColor=colors.HexColor("#1B4332"), alignment=TA_CENTER, leading=14)
d['flow_arr'] = ParagraphStyle('flow_arr', fontName='Helvetica-Bold', fontSize=13, textColor=GREEN2, alignment=TA_CENTER, leading=14)
d['tbl_h'] = ParagraphStyle('tbl_h', fontName='Helvetica-Bold', fontSize=10, textColor=WHITE, alignment=TA_CENTER, leading=12)
d['tbl_c'] = ParagraphStyle('tbl_c', fontName='Helvetica', fontSize=10, textColor=GRAY, alignment=TA_LEFT, leading=12)
d['tbl_cb'] = ParagraphStyle('tbl_cb', fontName='Helvetica-Bold', fontSize=10, textColor=DKGREEN, alignment=TA_LEFT, leading=12)
d['viva_q'] = ParagraphStyle('viva_q', fontName='Helvetica-Bold', fontSize=11, textColor=DKGREEN, leading=14)
d['viva_a'] = ParagraphStyle('viva_a', fontName='Helvetica', fontSize=11, textColor=GRAY, leading=13.5)
d['key'] = ParagraphStyle('key', fontName='Helvetica', fontSize=11, textColor=GRAY, leading=14, spaceAfter=1, leftIndent=14, bulletIndent=4)
d['key_b'] = ParagraphStyle('key_b', fontName='Helvetica-Bold', fontSize=11, textColor=DKGREEN, leading=14, spaceAfter=1, leftIndent=14, bulletIndent=4)
d['ref'] = ParagraphStyle('ref', fontName='Helvetica-Oblique', fontSize=8.5, textColor=LGRAY, leading=11, spaceAfter=0)
return d
def sp(n): return Spacer(1, n*mm)
def rule(): return HRFlowable(width="100%", thickness=0.8, color=GREEN2, spaceAfter=3, spaceBefore=2)
def B(t, s): return Paragraph(u"\u2022 " + t, s['b'])
def Bb(t, s): return Paragraph(u"\u2022 " + t, s['bold_b'])
def SB(t, s): return Paragraph(u" \u25e6 " + t, s['sb'])
def pearl(txt, s):
t = Table([[Paragraph("<b>EXAM PEARL:</b> " + txt, s['pearl'])]], colWidths=[CW])
t.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_PEARL), ('BOX',(0,0),(-1,-1),1,GOLD),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
]))
return t
def caution(txt, s):
t = Table([[Paragraph("<b>CAUTION:</b> " + txt, s['caut'])]], colWidths=[CW])
t.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_CAUT), ('BOX',(0,0),(-1,-1),1,BURG),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
]))
return t
def heading(txt, s):
return Table([[Paragraph(" " + txt, s['h1'])]], colWidths=[CW],
style=TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_HEAD),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0),
]))
def simple_table(headers, rows, s, cw=None):
if cw is None:
cw = [CW/len(headers)]*len(headers)
hrow = [Paragraph(h, s['tbl_h']) for h in headers]
body = [[Paragraph(str(c), s['tbl_c']) for c in r] for r in rows]
t = Table([hrow]+body, colWidths=cw, repeatRows=1)
t.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,0),BG_HEAD),
('ROWBACKGROUNDS',(0,1),(-1,-1),[WHITE,BG_ALT]),
('GRID',(0,0),(-1,-1),0.4,colors.HexColor("#BBBBBB")),
('VALIGN',(0,0),(-1,-1),'TOP'),
('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
]))
return t
def flowchart(steps, s):
rows = []
for i, step in enumerate(steps):
rows.append(Table([[Paragraph(step, s['flow'])]], colWidths=[14.5*cm],
style=TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_FLOW),('BOX',(0,0),(-1,-1),1,GREEN2),
('LEFTPADDING',(0,0),(-1,-1),10),('RIGHTPADDING',(0,0),(-1,-1),10),
('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
])))
if i < len(steps)-1:
rows.append(Paragraph("▼", s['flow_arr']))
t = Table([[r] for r in rows], colWidths=[14.5*cm])
t.setStyle(TableStyle([
('ALIGN',(0,0),(-1,-1),'CENTER'),
('LEFTPADDING',(0,0),(-1,-1),0),('RIGHTPADDING',(0,0),(-1,-1),0),
('TOPPADDING',(0,0),(-1,-1),1),('BOTTOMPADDING',(0,0),(-1,-1),1),
]))
return t
# ═══════════════════════════════════════════════════════════════════════
def build_story(s):
story = []
# TITLE
title_tbl = Table([
[Paragraph("MANAGEMENT OF MEDULLARY CARCINOMA THYROID", s['title'])],
[Paragraph("KNRUHS Final Year ENT | 10-Mark Long Answer", s['subtitle'])],
[Paragraph("Cummings Otolaryngology Ch.136 | Scott-Brown's ORL HNS Vol.1 Ch.58 | ATA Guidelines", s['source'])],
], colWidths=[CW])
title_tbl.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,-1),BG_HEAD),
('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),5),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
]))
story += [title_tbl, sp(3)]
# 1. DEFINITION
story += [heading("1. DEFINITION", s), sp(1),
B("MTC = malignant tumour arising from <b>parafollicular C cells</b> (neuroectodermal origin) of the thyroid", s),
B("Secretes <b>calcitonin</b> + CEA, serotonin, prostaglandins, histaminase, ACTH, somatostatin", s),
B("<b>3-5%</b> of all thyroid cancers", s),
B("Behaviour: intermediate between well-differentiated thyroid cancers and anaplastic carcinoma", s),
sp(2),
]
# 2. APPLIED ANATOMY
story += [heading("2. APPLIED ANATOMY", s), sp(1),
B("C cells concentrated in the <b>middle and upper thirds of the lateral thyroid lobes</b> - hence MTC arises here", s),
B("C cells are of <b>neuroectodermal</b> (ultimobranchial body) origin - NOT from thyroid follicular cells", s),
B("Lymphatic drainage: <b>central compartment (Level VI) first</b> --> lateral neck (Levels II-V) --> superior mediastinum (Level VII)", s),
sp(2),
]
# 3. EMBRYOLOGY
story += [heading("3. EMBRYOLOGY", s), sp(1),
B("C cells derive from <b>neural crest cells</b> via the ultimobranchial body (4th pharyngeal pouch)", s),
B("Ultimobranchial body fuses with thyroid; C cells disperse into lateral superior poles", s),
B("MTC precursor = <b>C-cell hyperplasia</b> - identified histologically in hereditary forms", s),
sp(2),
]
# 4. ETIOLOGY & RISK FACTORS
story += [heading("4. ETIOLOGY & RISK FACTORS", s), sp(1),
Paragraph("Sporadic (70%):", s['h2']),
B("No associated endocrinopathy; age 50-60 years; equal sex distribution", s),
B("Single, <b>unifocal</b> lesion; <b>somatic RET mutation</b> (acquired)", s),
sp(1),
Paragraph("Hereditary / Familial (30%):", s['h2']),
B("<b>Autosomal dominant</b>; germline <b>RET proto-oncogene mutation</b>; nearly 100% penetrance", s),
B("Preceded by multicentric C-cell hyperplasia; bilateral + multicentric in 90%", s),
sp(1),
]
men_rows = [
["MEN-2A (Sipple syndrome)", "MTC + Phaeochromocytoma + Hyperparathyroidism", "Adolescence / young adults"],
["MEN-2B", "MTC + Phaeochromocytoma + Mucosal neuromas + Marfanoid habitus", "Infancy / childhood; MOST AGGRESSIVE"],
["Familial MTC (FMTC)", "MTC only; no other endocrinopathy", "BEST prognosis of hereditary forms"],
]
story += [simple_table(["Type","Features","Age / Note"], men_rows, s, [3.5*cm, 8.5*cm, 5.5*cm]),
sp(1),
pearl("MEN-2B is the most aggressive form. Order of prognosis (best to worst): FMTC > MEN-2A > Sporadic > MEN-2B", s),
sp(2),
]
# 5. PATHOLOGY
story += [heading("5. PATHOLOGY / HISTOPATHOLOGY", s), sp(1),
Paragraph("Gross:", s['h3']),
B("Solid, firm, grey cut surface; non-encapsulated but well circumscribed", s),
B("Located in middle/upper poles; multifocal in hereditary forms", s),
sp(1),
Paragraph("Microscopy:", s['h3']),
B("Sheets / nests / trabeculae of cells separated by collagen + <b>amyloid</b> + calcification", s),
B("<b>Amyloid in ~80% of cases</b> - polymerised calcitonin - <b>virtually pathognomonic</b> for MTC", s),
B("Congo red stain: red/green colouration under polarised light", s),
B("Modest nuclear pleomorphism; necrosis in aggressive tumours", s),
sp(1),
Paragraph("Immunohistochemistry (IHC):", s['h3']),
B("Positive: <b>calcitonin, CEA (CD66e), TTF-1, CK, chromogranin A, synaptophysin</b>", s),
B("Electron microscopy: membrane-bound neurosecretory granules (100-300 nm)", s),
sp(1),
pearl("IHC calcitonin + CEA confirms MTC. Calcitonin-depleted tumours may behave more aggressively but almost always stain positive for CEA. (Scott-Brown)", s),
sp(2),
]
# 6. CLASSIFICATION / STAGING
story += [heading("6. CLASSIFICATION & STAGING", s), sp(1),
Paragraph("By Origin:", s['h3']),
B("Sporadic (70%) - unifocal; Hereditary (30%) - MEN-2A, MEN-2B, FMTC - multicentric, bilateral", s),
sp(1),
Paragraph("TNM Staging - AJCC 8th Ed (Scott-Brown):", s['h3']),
]
stage_rows = [
["Stage I", "T1a, T1b", "N0", "M0"],
["Stage II", "T2, T3", "N0", "M0"],
["Stage III", "T1, T2, T3", "N1a", "M0"],
["Stage IVA", "T1-T3 / T4a", "N1b / Any N", "M0"],
["Stage IVB", "T4b", "Any N", "M0"],
["Stage IVC", "Any T", "Any N", "M1"],
]
story += [simple_table(["Stage","T","N","M"], stage_rows, s, [2.8*cm, 4*cm, 5*cm, 4.7*cm]),
sp(2),
]
# 7. CLINICAL FEATURES
story += [heading("7. CLINICAL FEATURES", s), sp(1),
B("<b>Neck mass</b> - most common presentation; firm, hard, lower/mid neck", s),
B("Palpable cervical lymphadenopathy in up to <b>20%</b> at presentation", s),
Paragraph("Local invasion signs:", s['h3']),
SB("Dysphagia, dysphonia (RLN involvement), dyspnoea, local pain", s),
Paragraph("Paraneoplastic / hormonal symptoms (calcitonin, serotonin, prostaglandins):", s['h3']),
SB("<b>Watery diarrhoea</b> - most common systemic symptom", s),
SB("<b>Flushing</b> - serotonin + prostaglandins", s),
SB("Cushing syndrome - if ACTH secretion", s),
Paragraph("MEN-specific:", s['h3']),
SB("MEN-2A: hypertension/palpitations (phaeochromocytoma), hypercalcaemia (HPT)", s),
SB("MEN-2B: mucosal neuromas on lips/tongue, GIT ganglioneuromatosis, Marfanoid habitus", s),
B("<b>Distant metastases in 50% at diagnosis</b>: cervical nodes --> mediastinum --> lung, liver, bone", s),
sp(2),
]
# 8. INVESTIGATIONS
story += [heading("8. INVESTIGATIONS", s), sp(1),
Paragraph("Biochemical:", s['h2']),
Bb("<b>Serum calcitonin</b> - diagnostic marker + post-op surveillance (most sensitive)", s),
Bb("<b>Serum CEA</b> - correlates with prognosis / survival", s),
Bb("Serum calcium - screen for hyperparathyroidism (MEN-2A)", s),
Bb("<b>24-hr urine catecholamines + metanephrines</b> - screen for phaeochromocytoma - <b>MANDATORY before surgery</b>", s),
sp(1),
Paragraph("Genetic:", s['h2']),
Bb("<b>RET proto-oncogene mutation testing</b> - ALL patients with MTC (Cummings)", s),
SB("Germline mutation = hereditary; somatic mutation = sporadic", s),
SB("Hereditary MTC identified --> <b>first-degree family screening</b>", s),
sp(1),
Paragraph("Cytology:", s['h2']),
Bb("<b>FNAC</b> - confirms MTC; diagnosis supported by elevated serum calcitonin", s),
sp(1),
Paragraph("Imaging:", s['h2']),
Bb("<b>USG neck</b> - primary imaging; assess cervical nodes", s),
Bb("<b>CT chest + mediastinum</b> - mediastinal nodes + lung metastases", s),
Bb("<b>Abdominal MRI</b> - screen for phaeochromocytoma (adrenal glands)", s),
Bb("Bone scan / FDG-PET - distant metastases in advanced disease", s),
sp(2),
]
# 9. MANAGEMENT
story += [heading("9. MANAGEMENT", s), sp(1),
Paragraph("Pre-operative Workup (MANDATORY sequence):", s['h2']),
flowchart([
"Diagnose MTC (FNAC + serum calcitonin)",
"RET gene mutation testing (ALL patients)",
"Screen for Phaeochromocytoma (24-hr urine catecholamines + metanephrines + abdominal MRI)",
"Screen for Hyperparathyroidism (serum calcium) - if MEN-2A suspected",
"TREAT PHAEOCHROMOCYTOMA FIRST (before thyroid surgery)",
"Proceed to thyroid surgery",
], s),
sp(2),
caution("Undiagnosed phaeochromocytoma can cause FATAL intraoperative hypertensive crisis. ALWAYS screen and treat BEFORE thyroidectomy. (Cummings Ch.136)", s),
sp(2),
]
story += [Paragraph("Surgical Management (Mainstay of Treatment):", s['h2']),
Bb("<b>Total thyroidectomy</b> - treatment of choice in ALL MTC patients", s),
SB("Reason: high multicentricity; aggressive course; hereditary forms bilateral", s),
SB("Even if NO palpable mass in hereditary/familial MTC - entire gland removed", s),
sp(1),
Bb("<b>Bilateral central compartment neck dissection (Level VI + Level VII)</b> - routine in all MTC", s),
SB("Superior mediastinal nodes (Level VII) routinely removed", s),
sp(1),
Bb("<b>Lateral neck dissection (Levels II-V):</b>", s),
SB("Ipsilateral - palpable lateral nodes present OR central node metastases confirmed", s),
SB("Consider ipsilateral when calcitonin <b>>20 pg/mL</b>", s),
SB("Consider bilateral when calcitonin <b>>200 pg/mL</b> (ATA guidelines)", s),
SB("Recent data (Zafereo et al., MD Anderson): observation of lateral neck acceptable if pre-op high-definition USG negative - ATA guidelines may overtreat", s),
sp(1),
Bb("Parathyroid glands in MEN-2A: identify all glands; remove abnormal ones; mark normal ones", s),
sp(2),
]
story += [Paragraph("Prophylactic Thyroidectomy in Children (Hereditary MTC):", s['h2']),
]
proph_rows = [
["Highest risk\n(MEN-2B / codon 918)", "Within 6 months of birth or as soon as diagnosed"],
["High risk\n(codons 634, 883)", "By age 5 years"],
["Moderate risk\n(other codons)", "Guided by calcitonin levels + family preference; typically by age 5-10"],
]
story += [simple_table(["ATA Risk Category","Timing of Prophylactic Thyroidectomy"], proph_rows, s, [4.5*cm, 13*cm]),
sp(2),
]
story += [Paragraph("Medical / Adjuvant Management:", s['h2']),
Bb("<b>Radioiodine (RAI) - NOT effective</b> in MTC (C cells do not take up iodine; no TSH receptors)", s),
Bb("<b>TSH suppression - NOT effective</b> in MTC (same reason)", s),
Bb("<b>External beam radiotherapy (EBRT):</b> controversial; no proven survival benefit; used for positive margins / unresectable disease / bone mets (palliation)", s),
Bb("<b>Chemotherapy:</b> no effective standard regimen", s),
sp(1),
Paragraph("Targeted Therapy (Advanced / Metastatic / Recurrent MTC):", s['h3']),
Bb("<b>Vandetanib</b> (RET + VEGFR + EGFR inhibitor) - FDA-approved; oral TKI", s),
Bb("<b>Cabozantinib</b> (RET + MET + VEGFR2 inhibitor) - FDA-approved; oral TKI", s),
Bb("<b>Selpercatinib</b> + <b>Pralsetinib</b> - highly selective RET inhibitors; newer; better response + fewer side effects (FDA approved 2020)", s),
sp(1),
Bb("<b>Tumour debulking</b> (metastatic disease): reduces flushing + diarrhoea; may reduce central neck disease risk", s),
sp(2),
]
# 10. POST-OP FOLLOW-UP
story += [heading("10. POST-OPERATIVE FOLLOW-UP", s), sp(1),
Bb("<b>Serum calcitonin</b> - most sensitive marker for residual / recurrent disease", s),
SB("Undetectable post-op = biochemical cure", s),
SB("Rising calcitonin = residual / recurrent disease --> localisation imaging", s),
Bb("<b>Serum CEA</b> - predictive of long-term survival (better prognostic indicator)", s),
Bb("<b>Calcitonin doubling time</b> - KEY prognostic tool:", s),
SB("<b><6 months</b> = poor prognosis", s),
SB("<b>>2 years</b> = favourable prognosis", s),
Bb("USG neck 6-monthly initially, then annually", s),
Bb("If calcitonin rises: CT neck/chest + MRI abdomen/liver + bone scan", s),
sp(2),
]
# 11. COMPLICATIONS
story += [heading("11. COMPLICATIONS", s), sp(1),
Paragraph("Surgical:", s['h3']),
B("<b>RLN injury</b> - dysphonia, aspiration", s),
B("<b>Hypoparathyroidism</b> - hypocalcaemia (transient or permanent)", s),
B("SLN injury - pitch change; chyle leak after lateral neck dissection", s),
Paragraph("Disease-related:", s['h3']),
B("Distant metastases (lung, liver, bone) - 50% at diagnosis", s),
B("Refractory diarrhoea + flushing (paraneoplastic)", s),
B("Tracheal / oesophageal compression from local invasion", s),
sp(2),
]
# 12. PROGNOSIS
story += [heading("12. PROGNOSIS", s), sp(1),
Bb("Overall 10-year survival: <b>61-75%</b> (Cummings)", s),
Bb("With cervical nodal involvement: drops to <b>45%</b> at 10 years", s),
Bb("Disease confined to thyroid: survival <b>approaches 95%</b> (Scott-Brown)", s),
Bb("Micro-MTC (<1 cm): better outcome (Scott-Brown)", s),
Bb("<b>Best to worst:</b> FMTC > MEN-2A > Sporadic > MEN-2B", s),
sp(2),
]
# 13. RECENT ADVANCES
story += [heading("13. RECENT ADVANCES", s), sp(1),
B("<b>Selpercatinib (LOXO-292)</b> and <b>Pralsetinib (BLU-667)</b> - highly selective RET inhibitors; FDA approved 2020; superior to vandetanib/cabozantinib", s),
B("Molecular ATA risk stratification by RET codon guides timing of prophylactic thyroidectomy in children", s),
B("Elective lateral neck dissection being reconsidered - MD Anderson data (Zafereo et al.) supports observation with high-definition USG", s),
B("<b>Calcitonin doubling time</b> - now standard prognostic tool in post-op surveillance", s),
B("Ongoing trials: RET inhibitors + checkpoint inhibitors (anti-PD-1/PD-L1) in combination", s),
sp(2),
]
# 14. VIVA QUESTIONS
story += [heading("14. VIVA QUESTIONS", s), sp(1)]
vivas = [
("Cell of origin of MTC?", "Parafollicular C cells - neuroectodermal / ultimobranchial body origin"),
("Tumour markers for MTC?", "Calcitonin (diagnosis + surveillance); CEA (prognosis / survival)"),
("Why is RAI not used in MTC?", "C cells do not take up iodine; no TSH receptors - unlike papillary/follicular carcinoma"),
("Most important pre-op step?", "Screen for phaeochromocytoma (24-hr urine catecholamines + MRI abdomen); treat it BEFORE thyroid surgery"),
("Most aggressive MEN type?", "MEN-2B - presents in infancy; worst prognosis"),
("Gene mutated in MTC?", "RET proto-oncogene (germline = hereditary; somatic = sporadic)"),
("Surgery of choice?", "Total thyroidectomy + bilateral central compartment neck dissection (Level VI + VII)"),
("Pathognomonic histological finding?", "Amyloid deposits (polymerised calcitonin) - Congo red positive - present in ~80%"),
("Approved targeted therapies?", "Vandetanib + Cabozantinib (TKIs); Selpercatinib + Pralsetinib (selective RET inhibitors)"),
("Key follow-up marker?", "Calcitonin doubling time (<6 months = poor; >2 years = favourable)"),
]
for q, a in vivas:
vt = Table([
[Paragraph("Q: " + q, s['viva_q'])],
[Paragraph("A: " + a, s['viva_a'])],
], colWidths=[CW])
vt.setStyle(TableStyle([
('BACKGROUND',(0,0),(-1,0),colors.HexColor("#E8F5E9")),
('BACKGROUND',(0,1),(-1,1),WHITE),
('BOX',(0,0),(-1,-1),0.5,colors.HexColor("#AAAAAA")),
('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
]))
story += [vt, sp(1.5)]
story.append(sp(2))
# KEY POINTS
story += [heading("KEY POINTS SUMMARY", s), sp(1)]
keypoints = [
("1.", "MTC = C cell tumour; 3-5% of thyroid cancers; secretes calcitonin + CEA"),
("2.", "70% sporadic (unifocal, age 50-60); 30% hereditary (RET mutation; multicentric, bilateral)"),
("3.", "MEN-2A = MTC + Phaeochromocytoma + HPT; MEN-2B = MTC + Phaeo + Marfanoid + mucosal neuromas"),
("4.", "ALWAYS screen for phaeochromocytoma before surgery; treat it FIRST - prevents intraoperative hypertensive crisis"),
("5.", "ALL patients need RET mutation testing; hereditary MTC identified = screen all first-degree relatives"),
("6.", "Surgery = Total thyroidectomy + bilateral central neck dissection (Level VI + VII)"),
("7.", "Lateral neck dissection: ipsilateral if calcitonin >20 pg/mL; bilateral if >200 pg/mL (ATA)"),
("8.", "RAI and TSH suppression have NO role in MTC - unlike papillary/follicular thyroid cancer"),
("9.", "Advanced MTC: Vandetanib or Cabozantinib (TKIs); Selpercatinib/Pralsetinib (selective RET inhibitors, newer)"),
("10.", "Prognosis: 10-yr survival 61-75%; calcitonin doubling time is KEY follow-up marker"),
]
kp = Table([[Paragraph(n, s['key_b']), Paragraph(p, s['key'])] for n,p in keypoints],
colWidths=[1*cm, 16*cm])
kp.setStyle(TableStyle([
('ROWBACKGROUNDS',(0,0),(-1,-1),[BG_PEARL,WHITE]),
('BOX',(0,0),(-1,-1),1.2,GOLD),
('LINEBELOW',(0,0),(-1,-2),0.3,colors.HexColor("#DCA917")),
('VALIGN',(0,0),(-1,-1),'TOP'),
('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4),
]))
story += [kp, sp(3), rule(),
Paragraph("References:", ParagraphStyle('rh', fontName='Helvetica-Bold', fontSize=8.5, textColor=LGRAY, leading=11)),
Paragraph("1. Cummings Otolaryngology Head and Neck Surgery, 7th Ed. Ch.136 - Thyroid. Elsevier 2021.", s['ref']),
Paragraph("2. Scott-Brown's Otorhinolaryngology Head & Neck Surgery Vol.1 Ch.58. CRC Press 2018.", s['ref']),
Paragraph("3. Scott-Brown's Otorhinolaryngology Head & Neck Surgery (staging tables). CRC Press 2018.", s['ref']),
Paragraph("4. ATA Guidelines - Management of Medullary Thyroid Carcinoma. Thyroid 2015.", s['ref']),
sp(2),
]
return story
def main():
s = S()
doc = SimpleDocTemplate(
OUTPUT, pagesize=A4,
leftMargin=1.7*cm, rightMargin=1.7*cm,
topMargin=1.5*cm, bottomMargin=1.5*cm,
title="Management of Medullary Carcinoma Thyroid - KNRUHS ENT",
author="Orris AI"
)
doc.build(build_story(s))
print(f"Done: {OUTPUT}")
if __name__ == "__main__":
main()
cd /home/daytona/workspace/ent-exam && python3 mtc_management.py 2>&1 && python3…
MTC Management KNRUHS ENT
PDF Document · PDF
| Section | Content |
|---|---|
| 1-3 | Definition, Applied Anatomy, Embryology |
| 4 | Etiology - Sporadic vs Hereditary + MEN types table |
| 5 | Pathology - gross, micro, IHC, amyloid |
| 6 | Staging - TNM AJCC 8th Ed table |
| 7 | Clinical features - neck mass, diarrhoea, flushing, MEN symptoms |
| 8 | Investigations - calcitonin, CEA, RET gene, FNAC, imaging |
| 9 | Management - Pre-op flowchart + surgical algorithm + targeted therapy |
| 10 | Post-op follow-up + calcitonin doubling time |
| 11-12 | Complications + Prognosis |
| 13 | Recent advances - selpercatinib, pralsetinib |
| 14 | 10 Viva Q&A |
| Key Points | 10-point gold summary box |