Can u give me 15 m essay about these 1. SLE 2. AIDS 3.Amyloidosis
| CD4 Count | Opportunistic Condition |
|---|---|
| <500 | Oral candidiasis (thrush), oral hairy leukoplakia (EBV), herpes zoster |
| <200 | Pneumocystis jirovecii pneumonia (PJP - formerly PCP), Toxoplasma encephalitis, Cryptosporidiosis |
| <100 | Cryptococcal meningitis, CMV retinitis/esophagitis, disseminated Mycobacterium avium complex (MAC) |
| Any count | Mycobacterium tuberculosis, Kaposi's sarcoma (HHV-8), aggressive B-cell lymphomas (EBV-driven) |
Can u make pdf
mkdir -p /tmp/workspace/medical-essays && ls /tmp/workspace/
~/medical-essays/generate_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os
output_path = "/tmp/workspace/medical-essays/Medical_Essays_SLE_AIDS_Amyloidosis.pdf"
doc = SimpleDocTemplate(
output_path,
pagesize=A4,
rightMargin=2.2*cm,
leftMargin=2.2*cm,
topMargin=2.5*cm,
bottomMargin=2.5*cm,
title="15-Mark Medical Essays: SLE, AIDS, Amyloidosis",
author="Orris Medical AI"
)
styles = getSampleStyleSheet()
# Custom styles
cover_title = ParagraphStyle(
'CoverTitle',
parent=styles['Title'],
fontSize=26,
textColor=colors.HexColor('#1a3a5c'),
spaceAfter=10,
alignment=TA_CENTER,
fontName='Helvetica-Bold',
leading=32,
)
cover_sub = ParagraphStyle(
'CoverSub',
parent=styles['Normal'],
fontSize=13,
textColor=colors.HexColor('#4a6fa5'),
spaceAfter=6,
alignment=TA_CENTER,
fontName='Helvetica',
)
essay_heading = ParagraphStyle(
'EssayHeading',
parent=styles['Heading1'],
fontSize=18,
textColor=colors.white,
backColor=colors.HexColor('#1a3a5c'),
spaceAfter=12,
spaceBefore=18,
fontName='Helvetica-Bold',
leftIndent=-8,
rightIndent=-8,
borderPad=8,
leading=24,
)
h2 = ParagraphStyle(
'H2',
parent=styles['Heading2'],
fontSize=13,
textColor=colors.HexColor('#1a3a5c'),
spaceBefore=14,
spaceAfter=4,
fontName='Helvetica-Bold',
borderPad=0,
)
h3 = ParagraphStyle(
'H3',
parent=styles['Heading3'],
fontSize=11,
textColor=colors.HexColor('#2c5f8a'),
spaceBefore=8,
spaceAfter=2,
fontName='Helvetica-Bold',
)
body = ParagraphStyle(
'Body',
parent=styles['Normal'],
fontSize=10,
leading=15,
spaceAfter=6,
alignment=TA_JUSTIFY,
fontName='Helvetica',
)
bullet_style = ParagraphStyle(
'Bullet',
parent=styles['Normal'],
fontSize=10,
leading=14,
spaceAfter=3,
leftIndent=16,
bulletIndent=4,
fontName='Helvetica',
)
source_style = ParagraphStyle(
'Source',
parent=styles['Normal'],
fontSize=8,
textColor=colors.HexColor('#666666'),
spaceAfter=4,
fontName='Helvetica-Oblique',
alignment=TA_CENTER,
)
story = []
# ── COVER PAGE ──────────────────────────────────────────────────────────────
story.append(Spacer(1, 3*cm))
story.append(Paragraph("15-Mark Medical Essays", cover_title))
story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width="80%", thickness=3, color=colors.HexColor('#4a6fa5'), spaceAfter=20))
story.append(Paragraph("1. Systemic Lupus Erythematosus (SLE)", cover_sub))
story.append(Paragraph("2. AIDS (Acquired Immunodeficiency Syndrome)", cover_sub))
story.append(Paragraph("3. Amyloidosis", cover_sub))
story.append(Spacer(1, 1*cm))
story.append(HRFlowable(width="80%", thickness=1, color=colors.HexColor('#4a6fa5'), spaceAfter=20))
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("Sources: Andrews' Diseases of the Skin | Janeway's Immunobiology 10e", source_style))
story.append(Paragraph("Rheumatology 2-Volume Set (Elsevier 2022) | Harrison's Principles of Internal Medicine 22E (2025)", source_style))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# ESSAY 1: SLE
# ════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("1. Systemic Lupus Erythematosus (SLE)", essay_heading))
story.append(Paragraph("Definition and Epidemiology", h2))
story.append(Paragraph(
"Systemic Lupus Erythematosus (SLE) is a chronic, multisystem autoimmune disease characterised by the "
"production of autoantibodies directed against nuclear and cytoplasmic antigens, leading to immune complex-mediated "
"tissue damage across multiple organ systems. SLE predominantly affects young to middle-aged women, with a "
"female-to-male ratio of approximately 9:1. It occurs across all ethnic groups but is more common and more severe "
"in people of African, Asian, and Hispanic descent. The disease follows a relapsing-remitting course and ranges "
"from mild mucocutaneous involvement to life-threatening renal or neurological disease.", body))
story.append(Paragraph("Etiology and Pathogenesis", h2))
story.append(Paragraph(
"SLE results from a complex interplay of genetic, hormonal, and environmental factors. Genetic susceptibility is "
"evidenced by concordance rates of 25-50% in identical twins and associations with HLA-DR2 and HLA-DR3 alleles, "
"as well as deficiencies in complement components (C1q, C2, C4). Hormonal influences explain the female "
"predominance - estrogens promote immune activation, while androgens are relatively protective. Environmental "
"triggers include UV radiation, certain drugs (procainamide, hydralazine, isoniazid - causing drug-induced lupus), "
"viral infections (particularly Epstein-Barr virus), and cigarette smoking.", body))
story.append(Paragraph(
"The central immunopathological event is a failure of tolerance to self-antigens, especially nuclear components. "
"Apoptotic cell debris is not cleared efficiently (due to defective DNase I or complement activity), exposing "
"intracellular antigens to the immune system. Dendritic cells produce large amounts of type I interferons "
"(interferon-alpha), amplifying autoreactive B-cell and T-cell responses. Autoreactive B cells produce autoantibodies "
"including anti-dsDNA, anti-Sm, anti-Ro/La, anti-histone, and antiphospholipid antibodies. Immune complexes deposit "
"in tissues (glomeruli, skin, joints), activate complement, and trigger local inflammation.", body))
story.append(Paragraph("Clinical Features", h2))
story.append(Paragraph(
"The clinical presentation is highly variable. Skin involvement occurs in 80% of cases.", body))
story.append(Paragraph("Mucocutaneous Manifestations", h3))
story.append(Paragraph(
"The classic butterfly (malar) rash is a photosensitive erythema spanning the cheeks and nasal bridge, "
"characteristically sparing the nasolabial folds. Discoid lupus erythematosus presents as scaly, hyperpigmented "
"plaques healing with scarring. Oral ulcers (21%), photosensitivity, diffuse non-scarring alopecia ('lupus hairs'), "
"and periungual telangiectasia are also common. Vascular lesions such as Raynaud's phenomenon occur in up to 50%.", body))
story.append(Paragraph("Musculoskeletal", h3))
story.append(Paragraph(
"Non-erosive arthritis and arthralgias affect nearly all patients at some point. Unlike rheumatoid arthritis, "
"the synovitis is non-destructive.", body))
story.append(Paragraph("Renal - Lupus Nephritis", h3))
story.append(Paragraph(
"Kidney involvement occurs in 50-70% of patients and is the primary determinant of morbidity and mortality. "
"The WHO/ISN classification describes six classes. Class III (focal) and Class IV (diffuse proliferative nephritis) "
"are most severe, presenting with nephrotic syndrome, hematuria, red cell casts, and hypertension. The pathology "
"shows 'wire-loop' lesions with full-house immunofluorescence (IgG, IgA, IgM, C3, C1q).", body))
story.append(Paragraph("Neuropsychiatric (NPSLE)", h3))
story.append(Paragraph(
"Manifestations range from cognitive dysfunction and headache to seizures, psychosis, stroke, and transverse "
"myelitis, resulting from vasculitis, antiphospholipid antibody-mediated thrombosis, or direct neuronal antibody injury.", body))
story.append(Paragraph("Cardiopulmonary", h3))
story.append(Paragraph(
"Pericarditis is the most common cardiac manifestation. Libman-Sacks endocarditis (sterile, verrucous vegetations "
"on both surfaces of the mitral valve) is characteristic and associated with antiphospholipid antibodies. Pleuritis "
"and pleural effusions are common. Pulmonary hypertension is a rare but serious complication.", body))
story.append(Paragraph("Haematological", h3))
story.append(Paragraph(
"Coombs-positive haemolytic anaemia, leukopenia, lymphopenia, and thrombocytopenia result from autoantibody-mediated "
"destruction or bone marrow suppression.", body))
story.append(Paragraph("Diagnosis and Criteria", h2))
story.append(Paragraph(
"The diagnosis is clinical and serological. The ACR criteria require 4 of 11 features:", body))
acr_data = [
["1. Malar rash", "7. Neurologic disorders (seizures/psychosis)"],
["2. Discoid rash", "8. Pleuritis/pericarditis"],
["3. Photosensitivity", "9. Haematological disorders"],
["4. Oral ulcers (21%)", "10. Immunologic disorders (anti-dsDNA, anti-Sm, APLAs)"],
["5. Arthritis", "11. Positive ANA"],
["6. Proteinuria >0.5 g/day or casts", ""],
]
acr_table = Table(acr_data, colWidths=[8.5*cm, 8.5*cm])
acr_table.setStyle(TableStyle([
('FONTNAME', (0,0), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 9),
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#d9e4f0')),
('ROWBACKGROUNDS', (0,0), (-1,-1), [colors.HexColor('#f0f5fa'), colors.white]),
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#aac4de')),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 6),
]))
story.append(acr_table)
story.append(Spacer(1, 6))
story.append(Paragraph(
"The SLICC criteria (2012) and EULAR/ACR criteria (2019) offer improved sensitivity. SLICC requires at least "
"4 criteria (one clinical + one immunological) or biopsy-proven lupus nephritis with positive ANA or anti-dsDNA.", body))
story.append(Paragraph(
"Key lab findings: ANA positive >95% (sensitive, not specific); anti-dsDNA highly specific (~70%), titres "
"correlate with renal activity; anti-Sm very specific (~99%) but present in only 25-30%; low C3/C4/CH50 in "
"active disease; anti-Ro/anti-La associated with neonatal lupus and SCLE.", body))
story.append(Paragraph("Management", h2))
story.append(Paragraph(
"<b>Mild disease:</b> Hydroxychloroquine (HCQ) is the cornerstone - reduces flares, prevents damage accrual, "
"reduces mortality, and is safe in pregnancy. NSAIDs and low-dose corticosteroids manage musculoskeletal and "
"serositis symptoms.", body))
story.append(Paragraph(
"<b>Moderate-to-severe disease:</b> Systemic corticosteroids (prednisolone 0.5-1 mg/kg/day). Steroid-sparing "
"immunosuppressants: azathioprine (maintenance), mycophenolate mofetil/MMF (preferred for lupus nephritis), "
"cyclophosphamide IV pulse (severe proliferative LN and NPSLE).", body))
story.append(Paragraph(
"<b>Biologics:</b> Belimumab (anti-BLyS/BAFF) approved for active autoantibody-positive SLE. Anifrolumab "
"(anti-type I interferon receptor) approved for moderate-to-severe SLE not controlled by standard therapy.", body))
story.append(Paragraph(
"<b>Monitoring:</b> Regular urinalysis, anti-dsDNA titres, complement levels, FBC. SLEDAI score quantifies "
"disease activity. Annual ophthalmologic screening for HCQ retinopathy after 5 years of use.", body))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# ESSAY 2: AIDS
# ════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("2. AIDS (Acquired Immunodeficiency Syndrome)", essay_heading))
story.append(Paragraph("Definition and Epidemiology", h2))
story.append(Paragraph(
"AIDS is the advanced clinical stage of infection with the Human Immunodeficiency Virus (HIV), defined by a "
"CD4+ T-cell count below 200 cells/microlitre and/or the development of an AIDS-defining illness in an "
"HIV-positive person. HIV is a retrovirus of the lentivirus family; HIV-1 is the predominant global pathogen "
"while HIV-2 is largely confined to West Africa and is less virulent.", body))
story.append(Paragraph(
"As of 2020, approximately 38 million people were living with HIV worldwide, with 1.5 million new infections "
"and 690,000 deaths from AIDS-related causes annually (Janeway's Immunobiology, p. 653). Sub-Saharan Africa "
"accounts for over two-thirds of global incidence. Combination antiretroviral therapy (cART) has dramatically "
"reduced mortality and new infections are declining globally since the peak in 1997.", body))
story.append(Paragraph("Virology and Structure", h2))
story.append(Paragraph(
"HIV-1 is a roughly spherical, enveloped retrovirus approximately 120 nm in diameter. Its lipid envelope is "
"studded with trimers of gp120:gp41 glycoprotein heterodimers (viral spikes). The capsid contains two copies "
"of positive-sense ssRNA genome with three critical viral enzymes: reverse transcriptase, integrase, and "
"protease. The genome encodes structural genes (gag, pol, env) and regulatory/accessory genes (tat, rev, vif, "
"vpr, vpu, nef).", body))
story.append(Paragraph("Transmission", h2))
for txt in [
"<b>1. Sexual contact</b> (most common globally) - mucosal exposure to semen, vaginal or rectal secretions.",
"<b>2. Parenteral</b> - contaminated needles (IV drug use), blood transfusions, needle-stick injuries.",
"<b>3. Vertical (mother-to-child)</b> - in utero, during delivery, or via breastfeeding. Risk 15-45% without "
"intervention; reduced to <1-2% with antiretroviral prophylaxis.",
]:
story.append(Paragraph(txt, bullet_style))
story.append(Spacer(1,4))
story.append(Paragraph("Pathogenesis", h2))
story.append(Paragraph("Entry and Initial Infection", h3))
story.append(Paragraph(
"HIV gp120 binds with high affinity to CD4 molecules on T cells, macrophages, and dendritic cells. A "
"conformational change exposes the co-receptor binding site; gp120 then binds either CCR5 (R5-tropic, "
"predominant in early infection) or CXCR4 (X4-tropic, more common in late-stage disease). gp41 then mediates "
"fusion of the viral envelope with the host cell membrane.", body))
story.append(Paragraph("Reverse Transcription and Integration", h3))
story.append(Paragraph(
"Viral reverse transcriptase converts the RNA genome into double-stranded DNA (cDNA), which is transported "
"into the nucleus where viral integrase inserts it into the host genome as the provirus. The integrated "
"provirus can remain latent or produce new virions that bud and mature after viral protease cleaves "
"polyproteins (Janeway's Immunobiology, p. 659).", body))
story.append(Paragraph("Phases of Disease", h3))
phases_data = [
["Phase", "Features", "CD4 / Viral Load"],
["Acute HIV Syndrome\n(2-4 weeks post-infection)",
"Mononucleosis-like: fever, pharyngitis, lymphadenopathy, rash, myalgia",
"CD4 drops acutely\nViral load >10 million/mL"],
["Asymptomatic/Chronic\n(months to years)",
"Clinically well; ongoing viral replication erodes CD4 T cells gradually",
"CD4 declining\nSet-point viremia"],
["AIDS\n(Advanced stage)",
"CD4 <200/µL; opportunistic infections and malignancies emerge",
"CD4 <200/µL\nHigh viral load"],
]
pt = Table(phases_data, colWidths=[4*cm, 8*cm, 5*cm])
pt.setStyle(TableStyle([
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 9),
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a3a5c')),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f5fa'), colors.white]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#aac4de')),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 6),
('WORDWRAP', (0,0), (-1,-1), True),
]))
story.append(pt)
story.append(Spacer(1, 8))
story.append(Paragraph("Opportunistic Infections and AIDS-Defining Illnesses", h2))
oi_data = [
["CD4 Count", "Opportunistic Condition"],
["< 500 cells/µL", "Oral candidiasis (thrush), oral hairy leukoplakia (EBV), herpes zoster"],
["< 200 cells/µL", "Pneumocystis jirovecii pneumonia (PJP), Toxoplasma encephalitis, Cryptosporidiosis"],
["< 100 cells/µL", "Cryptococcal meningitis, CMV retinitis/esophagitis, disseminated MAC"],
["Any CD4 count", "Mycobacterium tuberculosis, Kaposi's sarcoma (HHV-8), aggressive B-cell lymphomas (EBV)"],
]
oi_table = Table(oi_data, colWidths=[4.5*cm, 12.5*cm])
oi_table.setStyle(TableStyle([
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 9),
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a3a5c')),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f5fa'), colors.white]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#aac4de')),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 6),
]))
story.append(oi_table)
story.append(Spacer(1, 8))
story.append(Paragraph("Diagnosis", h2))
for txt in [
"<b>4th generation ELISA (Ag/Ab combo test):</b> Detects anti-HIV antibodies (appear 3-12 weeks post-infection) "
"and p24 antigen (detectable within 2 weeks). Standard screening test.",
"<b>Confirmatory:</b> Western blot or HIV-1/HIV-2 differentiation immunoassay.",
"<b>HIV RNA PCR (viral load):</b> Quantifies viral replication; undetectable (<50 copies/mL) confirms virologic suppression.",
"<b>CD4 count:</b> Indicates degree of immunosuppression; guides prophylaxis decisions.",
"<b>Resistance genotyping:</b> Done before initiating or switching ART to detect resistance mutations.",
]:
story.append(Paragraph("• " + txt, bullet_style))
story.append(Spacer(1, 4))
story.append(Paragraph("Management: Antiretroviral Therapy (ART)", h2))
story.append(Paragraph(
"The goal of ART is to suppress viral replication to undetectable levels, enabling immune reconstitution "
"(rising CD4 counts), preventing AIDS-defining illnesses, and preventing transmission (U=U: "
"Undetectable = Untransmittable).", body))
art_data = [
["Drug Class", "Key Agents", "Mechanism"],
["NRTIs", "Tenofovir, Emtricitabine, Abacavir, Lamivudine", "Chain termination of reverse transcription"],
["NNRTIs", "Efavirenz, Rilpivirine, Doravirine", "Allosteric inhibition of reverse transcriptase"],
["Protease Inhibitors (PIs)", "Darunavir (+ritonavir/cobicistat)", "Block viral polyprotein cleavage"],
["INSTIs (preferred)", "Dolutegravir, Bictegravir, Raltegravir", "Block proviral DNA integration"],
["Entry/Fusion Inhibitors", "Maraviroc (CCR5), Enfuvirtide (gp41)", "Block viral entry/fusion"],
]
art_table = Table(art_data, colWidths=[4.5*cm, 6*cm, 6.5*cm])
art_table.setStyle(TableStyle([
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 9),
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a3a5c')),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f5fa'), colors.white]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#aac4de')),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 6),
]))
story.append(art_table)
story.append(Spacer(1, 8))
story.append(Paragraph(
"<b>Current first-line regimen (WHO 2023):</b> Dolutegravir + Tenofovir + Lamivudine (or Emtricitabine) - "
"a single-tablet, once-daily regimen with a high genetic barrier to resistance.", body))
story.append(Paragraph(
"<b>Prevention:</b> PrEP (tenofovir/emtricitabine or injectable cabotegravir) reduces HIV acquisition by >99% "
"in high-risk individuals. PEP within 72 hours prevents transmission post-exposure. PMTCT programmes have "
"dramatically reduced pediatric HIV infections.", body))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# ESSAY 3: AMYLOIDOSIS
# ════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("3. Amyloidosis", essay_heading))
story.append(Paragraph("Definition and Nature of Amyloid", h2))
story.append(Paragraph(
"Amyloidosis refers to a group of disorders characterised by extracellular deposition of insoluble fibrillar "
"proteins in a characteristic beta-pleated sheet configuration, collectively called amyloid. This abnormal "
"protein conformation makes amyloid resistant to normal proteolytic degradation, leading to progressive "
"structural and functional disruption of affected organs.", body))
story.append(Paragraph(
"Histologically, amyloid is eosinophilic, homogeneous, and hyaline on H&E staining. It is definitively "
"identified by Congo red staining, showing salmon-pink deposits and, under polarised light, pathognomonic "
"apple-green birefringence (Andrews' Diseases of the Skin, p. 599). Other staining: weakly PAS-positive "
"(diastase-resistant), purple with crystal violet, positive with thioflavin T (fluorescent). "
"Ultrastructurally: straight, non-branching fibrils of 60-100 nm diameter.", body))
story.append(Paragraph("Classification", h2))
story.append(Paragraph("I. Systemic Amyloidosis", h3))
class_data = [
["Type", "Precursor Protein", "Associated Condition", "Main Organs"],
["AL (Primary)", "Immunoglobulin light chains (lambda)", "Plasma cell dyscrasia, myeloma", "Kidney, heart, liver, nerves, skin"],
["AA (Secondary)", "Serum Amyloid A (SAA)", "Chronic inflammation: RA, TB, IBD, FMF", "Kidney, liver, spleen"],
["Dialysis-related (Abeta2M)", "Beta-2 microglobulin", "Long-term haemodialysis", "Joints, carpal tunnel, bone"],
["Senile systemic (ATTR)", "Wild-type transthyretin (TTR)", "Elderly males (>70 years)", "Heart (restrictive CMP)"],
]
ct = Table(class_data, colWidths=[3.2*cm, 4.3*cm, 4.5*cm, 5*cm])
ct.setStyle(TableStyle([
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 8.5),
('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a3a5c')),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.HexColor('#f0f5fa'), colors.white]),
('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#aac4de')),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 5),
('WORDWRAP', (0,0), (-1,-1), True),
]))
story.append(ct)
story.append(Spacer(1, 8))
story.append(Paragraph("II. Cutaneous (Localised) Amyloidosis", h3))
for txt in [
"<b>Macular amyloidosis:</b> Rippled grey-brown hyperpigmentation on upper back; keratin-derived amyloid in papillary dermis. Common in Southeast Asia and Latin America.",
"<b>Lichen amyloidosis:</b> Pruritic, hyperkeratotic papules on the shins; same pathology as macular type.",
"<b>Nodular amyloidosis:</b> Rare; localised monoclonal light-chain amyloid in dermis/subcutis. Up to 50% later develop systemic AL amyloidosis.",
]:
story.append(Paragraph("• " + txt, bullet_style))
story.append(Spacer(1,4))
story.append(Paragraph("III. Heredofamilial Amyloidosis", h3))
story.append(Paragraph(
"Caused by point mutations in the transthyretin (ATTR) gene (most common: Val30Met). Familial amyloid "
"polyneuropathy (FAP) presents as progressive sensorimotor and autonomic neuropathy. Hereditary AA "
"amyloidosis accompanies periodic fever syndromes (FMF, TRAPS).", body))
story.append(Paragraph("Pathogenesis", h2))
story.append(Paragraph(
"In all forms, the underlying mechanism involves overproduction of a precursor protein exceeding the body's "
"clearance capacity. The excess protein misfolds or is proteolytically cleaved into amyloidogenic fragments "
"that: (1) form soluble toxic oligomers - primary mediators of cell injury; (2) interact with tissue "
"proteoglycans/glycosaminoglycans; (3) bind serum amyloid P component (SAP), stabilising fibril structure; "
"and (4) progressively deposit as insoluble fibrils causing direct mechanical disruption and pressure atrophy "
"of surrounding cells (Andrews' Diseases of the Skin, p. 599).", body))
story.append(Paragraph("Clinical Features by Organ System", h2))
story.append(Paragraph("Kidneys", h3))
story.append(Paragraph(
"Amyloid deposits in glomeruli, interstitium, and vessels. Dominant presentation: nephrotic syndrome "
"(proteinuria >3.5 g/day, hypoalbuminaemia, oedema, hyperlipidaemia) progressing to end-stage renal disease. "
"Biopsy shows acellular eosinophilic expansion of mesangium staining Congo red positive.", body))
story.append(Paragraph("Heart", h3))
story.append(Paragraph(
"Amyloid deposition in the myocardium produces restrictive cardiomyopathy with diastolic dysfunction. Features: "
"exertional dyspnoea, peripheral oedema, right heart failure, and arrhythmias. Echocardiography shows "
"concentric LV thickening with 'sparkling/granular' appearance. Low-voltage ECG with increased wall thickness "
"(voltage-to-mass mismatch) is a hallmark. Cardiac AL amyloidosis carries a median survival of 6-12 months "
"once heart failure develops if untreated.", body))
story.append(Paragraph("Nervous System", h3))
story.append(Paragraph(
"Peripheral neuropathy (painful sensorimotor with early loss of pain/temperature before "
"vibration/proprioception - 'small fibre' pattern) is classic in AL and familial ATTR. Autonomic neuropathy: "
"postural hypotension, impotence, GI dysmotility. Carpal tunnel syndrome is common.", body))
story.append(Paragraph("Skin and Soft Tissue", h3))
for txt in [
"<b>Periorbital purpura ('raccoon eyes'):</b> Pathognomonic; capillary fragility causes purpura after minor trauma or Valsalva (pinch purpura).",
"<b>Macroglossia:</b> Occurs in ~20% of AL amyloidosis; enlarged tongue with dental indentations, nodules, and dysphagia (Andrews' Diseases of the Skin, p. 600).",
"<b>Waxy, translucent papules and plaques</b> around the eyes, nose, mouth, and mucocutaneous junctions.",
"<b>Nail dystrophy:</b> Thin, fragile, ridged nails resembling ungual lichen planus in systemic disease.",
"<b>Shoulder pad sign:</b> Periarticular amyloid deposition in dialysis-related amyloidosis.",
]:
story.append(Paragraph("• " + txt, bullet_style))
story.append(Spacer(1,4))
story.append(Paragraph("Liver", h3))
story.append(Paragraph(
"Hepatomegaly is common; firm enlarged liver. Cholestatic jaundice and portal hypertension may develop in "
"advanced disease.", body))
story.append(Paragraph("Diagnosis", h2))
for txt in [
"<b>Tissue biopsy + Congo red staining (gold standard):</b> Common sites: subcutaneous abdominal fat pad (~80% sensitivity in AL), rectal mucosa, labial salivary gland, kidney.",
"<b>Amyloid typing:</b> Immunohistochemistry with anti-AL, anti-AA, anti-TTR antibodies. Mass spectrometry proteomics is the most accurate method.",
"<b>SAP scintigraphy:</b> Radiolabelled 123I-SAP binds all amyloid deposits; whole-body imaging for extent and organ involvement.",
"<b>SPEP + serum free light chain assay:</b> Identifies monoclonal paraprotein in AL amyloidosis.",
"<b>Echocardiography + Cardiac MRI:</b> Diffuse subendocardial late gadolinium enhancement on CMR is characteristic of cardiac amyloidosis.",
"<b>Tc-99m PYP scintigraphy:</b> Highly sensitive and specific for ATTR cardiac amyloidosis; grade 2-3 uptake without plasma cell dyscrasia is diagnostic without biopsy.",
"<b>Genetic testing:</b> For suspected hereditary ATTR amyloidosis.",
]:
story.append(Paragraph("• " + txt, bullet_style))
story.append(Spacer(1,4))
story.append(Paragraph("Treatment", h2))
story.append(Paragraph("AL Amyloidosis", h3))
story.append(Paragraph(
"Targeting the plasma cell clone is the cornerstone. Options include: (1) High-dose melphalan + autologous "
"stem cell transplantation (ASCT) for eligible patients - achieves haematologic CR in ~40%; (2) VCd "
"(Bortezomib + Cyclophosphamide + Dexamethasone) for transplant-ineligible patients; (3) Daratumumab "
"(anti-CD38) + VCd (ANDROMEDA regimen) - new standard of care with superior haematologic and organ responses.", body))
story.append(Paragraph("AA Amyloidosis", h3))
story.append(Paragraph(
"Suppress the underlying inflammatory disease to reduce SAA production. Biological DMARDs (IL-1 inhibitors "
"like anakinra, IL-6 inhibitors like tocilizumab) are effective in FMF and other autoinflammatory diseases.", body))
story.append(Paragraph("ATTR Amyloidosis", h3))
for txt in [
"<b>Tafamidis (TTR stabiliser):</b> Approved for ATTR cardiomyopathy; reduces mortality and CV hospitalisations (ATTR-ACT trial).",
"<b>Patisiran (siRNA) and Inotersen (antisense oligonucleotide):</b> Reduce hepatic TTR synthesis by >80%; approved for hereditary ATTR polyneuropathy. Vutrisiran and eplontersen are newer agents.",
"<b>Liver transplantation:</b> Removes the main source of mutant TTR; curative for familial ATTR polyneuropathy if performed early.",
"<b>CRISPR-based TTR gene editing:</b> Emerging therapy showing durable TTR reduction in clinical trials.",
]:
story.append(Paragraph("• " + txt, bullet_style))
story.append(Spacer(1,4))
story.append(Paragraph(
"Supportive care includes loop diuretics (cautiously) for cardiac failure, renal replacement therapy/transplant "
"for ESRD, and nutritional support for GI involvement.", body))
# Footer sources
story.append(Spacer(1, 1*cm))
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor('#4a6fa5'), spaceAfter=6))
story.append(Paragraph(
"Sources: Andrews' Diseases of the Skin, pp. 189, 599-600 | Janeway's Immunobiology 10e, pp. 653-659 | "
"Rheumatology 2-Volume Set (Elsevier 2022) | Harrison's Principles of Internal Medicine 22E (2025)", source_style))
# Build PDF
doc.build(story)
print(f"PDF created: {output_path}")
python /tmp/workspace/medical-essays/generate_pdf.py
Medical Essays SLE AIDS Amyloidosis
PDF Document · PDF
Is that patho
No i am asking about pathology
Can u make it now
~/medical-essays/generate_patho_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
output_path = "/tmp/workspace/medical-essays/Pathology_Essays_SLE_AIDS_Amyloidosis.pdf"
doc = SimpleDocTemplate(
output_path,
pagesize=A4,
rightMargin=2.2*cm, leftMargin=2.2*cm,
topMargin=2.5*cm, bottomMargin=2.5*cm,
title="Pathology Essays: SLE, AIDS, Amyloidosis",
author="Orris Medical AI"
)
styles = getSampleStyleSheet()
NAVY = colors.HexColor('#1a3a5c')
BLUE = colors.HexColor('#2c5f8a')
LBLUE = colors.HexColor('#d9e4f0')
ROW1 = colors.HexColor('#f0f5fa')
GREY = colors.HexColor('#666666')
cover_title = ParagraphStyle('CoverTitle', parent=styles['Title'],
fontSize=26, textColor=NAVY, spaceAfter=10, alignment=TA_CENTER,
fontName='Helvetica-Bold', leading=32)
cover_sub = ParagraphStyle('CoverSub', parent=styles['Normal'],
fontSize=13, textColor=BLUE, spaceAfter=6, alignment=TA_CENTER,
fontName='Helvetica')
badge = ParagraphStyle('Badge', parent=styles['Normal'],
fontSize=11, textColor=colors.white, backColor=colors.HexColor('#c0392b'),
spaceAfter=4, alignment=TA_CENTER, fontName='Helvetica-Bold',
borderPad=6, leading=16)
essay_h = ParagraphStyle('EssayH', parent=styles['Heading1'],
fontSize=17, textColor=colors.white, backColor=NAVY,
spaceAfter=10, spaceBefore=16, fontName='Helvetica-Bold',
leftIndent=-8, rightIndent=-8, borderPad=8, leading=22)
h2 = ParagraphStyle('H2', parent=styles['Heading2'],
fontSize=13, textColor=NAVY, spaceBefore=14, spaceAfter=4,
fontName='Helvetica-Bold')
h3 = ParagraphStyle('H3', parent=styles['Heading3'],
fontSize=11, textColor=BLUE, spaceBefore=8, spaceAfter=2,
fontName='Helvetica-Bold')
body = ParagraphStyle('Body', parent=styles['Normal'],
fontSize=10, leading=15, spaceAfter=6, alignment=TA_JUSTIFY,
fontName='Helvetica')
bul = ParagraphStyle('Bul', parent=styles['Normal'],
fontSize=10, leading=14, spaceAfter=3, leftIndent=16,
fontName='Helvetica')
src = ParagraphStyle('Src', parent=styles['Normal'],
fontSize=8, textColor=GREY, spaceAfter=4,
fontName='Helvetica-Oblique', alignment=TA_CENTER)
callout = ParagraphStyle('Callout', parent=styles['Normal'],
fontSize=9.5, leading=14, spaceAfter=4, leftIndent=12, rightIndent=12,
backColor=colors.HexColor('#fffbe6'), borderPad=6,
fontName='Helvetica-Oblique')
def tbl(data, widths, header_bg=NAVY):
t = Table(data, colWidths=widths)
style = [
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 9),
('BACKGROUND', (0,0), (-1,0), header_bg),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [ROW1, colors.white]),
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#aac4de')),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 6),
('WORDWRAP', (0,0), (-1,-1), True),
]
t.setStyle(TableStyle(style))
return t
story = []
# ── COVER ────────────────────────────────────────────────────────────────────
story.append(Spacer(1, 2.5*cm))
story.append(Paragraph("PATHOLOGY", badge))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("15-Mark Essays", cover_title))
story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="80%", thickness=3, color=BLUE, spaceAfter=18))
story.append(Paragraph("1. Systemic Lupus Erythematosus (SLE)", cover_sub))
story.append(Paragraph("2. AIDS — Acquired Immunodeficiency Syndrome", cover_sub))
story.append(Paragraph("3. Amyloidosis", cover_sub))
story.append(Spacer(1, 0.8*cm))
story.append(HRFlowable(width="80%", thickness=1, color=BLUE, spaceAfter=12))
story.append(Paragraph(
"Gross Morphology · Light Microscopy · Electron Microscopy · Immunofluorescence · Special Stains · Pathogenesis",
src))
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph(
"Sources: Robbins, Cotran & Kumar — Pathologic Basis of Disease (2023) | Robbins & Kumar Basic Pathology | "
"Firestein & Kelley's Textbook of Rheumatology | Janeway's Immunobiology 10e | Andrews' Diseases of the Skin",
src))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# ESSAY 1: SLE — PATHOLOGY
# ════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("1. Systemic Lupus Erythematosus (SLE)", essay_h))
story.append(Paragraph("Definition and Overview", h2))
story.append(Paragraph(
"Systemic Lupus Erythematosus (SLE) is a chronic, relapsing-remitting multisystem autoimmune disease "
"caused by a failure of immunological self-tolerance to nuclear antigens. The production of pathogenic "
"autoantibodies and immune complex deposition drives tissue injury across virtually every organ system. "
"Understanding its pathology requires examination at the level of each affected organ.", body))
story.append(Paragraph("Pathogenesis (Immunological Basis)", h2))
story.append(Paragraph(
"The central defect is impaired clearance of apoptotic cell debris. Nuclear antigens (dsDNA, histones, Sm "
"antigen, Ro/La) released from apoptotic cells are presented to autoreactive B and T lymphocytes. Deficiency "
"of complement components (C1q, C2, C4) and DNase I impairs clearance. Plasmacytoid dendritic cells produce "
"excess type I interferons (IFN-alpha) in response to nucleic acid-containing immune complexes via TLR7 and "
"TLR9 signalling - the 'interferon signature' of SLE. Autoreactive B cells produce four cardinal autoantibodies:", body))
for txt in [
"<b>Anti-dsDNA:</b> Highly specific (~70%); titres correlate with lupus nephritis activity; forms pathogenic glomerular immune complexes.",
"<b>Anti-Sm:</b> Very specific (~99%) but present in only 25-30%; directed against snRNP proteins.",
"<b>Anti-Ro/SS-A and anti-La/SS-B:</b> Associated with neonatal lupus (congenital heart block) and subacute cutaneous LE.",
"<b>Antiphospholipid antibodies (aPL):</b> Lupus anticoagulant, anticardiolipin, anti-beta2-glycoprotein I; cause thrombosis, pregnancy loss.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Pathological Changes — Organ by Organ", h2))
story.append(Paragraph("1. Kidney (Lupus Nephritis)", h3))
story.append(Paragraph(
"Up to 50% of SLE patients develop clinically significant renal involvement. The kidney virtually "
"always shows evidence of abnormality on electron microscopy and immunofluorescence even when "
"clinically silent. Glomerular lesions result from deposition of immune complexes on the GBM, "
"in the mesangium, and throughout the glomerulus — Robbins & Kumar Basic Pathology, p. 182.", body))
story.append(Paragraph("ISN/RPS Classification of Lupus Nephritis:", h3))
ln_data = [
["Class", "Name", "Light Microscopy", "Electron Microscopy", "IF / Clinical"],
["I", "Minimal Mesangial LN",
"Normal on LM", "Mesangial IC deposits only",
"Mesangial Ig+C3; Clinically silent"],
["II", "Mesangial Proliferative LN",
"Mesangial hypercellularity; mesangial matrix expansion",
"Mesangial IC deposits",
"Granular mesangial Ig/C; Mild haematuria/proteinuria"],
["III", "Focal LN (<50% glomeruli)",
"Segmental/global endocapillary proliferation; leukocyte infiltration; fibrinoid necrosis; hyaline thrombi; focal crescents",
"Subendothelial + mesangial IC deposits",
"Full-house IF; Haematuria, proteinuria, RBC casts"],
["IV", "Diffuse LN (>50% glomeruli)\n[Most severe & most common]",
"'Wire-loop' lesions (circumferential subendothelial IC deposits thickening capillary walls); endo+mesangial+epithelial proliferation; crescents; fibrinoid necrosis",
"Large subendothelial deposits (may show 'fingerprint' pattern in tubuloreticular inclusions)",
"Full-house IF (IgG+IgA+IgM+C3+C1q); Nephritic + nephrotic; hypertension; renal failure"],
["V", "Membranous LN",
"Diffuse GBM thickening; spike formation; subepithelial deposits",
"Subepithelial IC deposits",
"Granular capillary wall IgG; Nephrotic syndrome"],
["VI", "Advanced Sclerosing LN",
"Global sclerosis >90% glomeruli; end-stage",
"Non-specific scarring",
"Chronic renal failure; ESRD"],
]
story.append(tbl(ln_data, [1.2*cm, 2.5*cm, 4.5*cm, 3.5*cm, 4.3*cm]))
story.append(Spacer(1,6))
story.append(Paragraph(
"Tubulointerstitial changes: Immune complex deposits in tubular basement membranes in many cases. "
"Interstitial inflammation and fibrosis correlate with renal prognosis.", body))
story.append(Paragraph("2. Skin", h3))
story.append(Paragraph(
"<b>Gross:</b> Butterfly (malar) rash - erythema spanning the cheeks and nasal bridge, sparing nasolabial folds. "
"Discoid plaques with follicular plugging, scarring, and hyperpigmentation. Oral ulcers, photosensitive rashes.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Vacuolar (liquefactive) degeneration of basal layer of the epidermis (interface "
"dermatitis). Variable dermal oedema and perivascular lymphoid infiltrate. In active lesions: vasculitis with "
"fibrinoid necrosis of dermal vessels — Robbins & Kumar, p. 182.", body))
story.append(Paragraph(
"<b>Immunofluorescence (Lupus Band Test):</b> Granular deposits of IgG, IgM, IgA, and complement (C3, C1q) "
"along the dermoepidermal junction (DEJ) in a band-like pattern. Present in involved AND uninvolved (sun-protected) "
"skin in systemic lupus; in discoid lupus, only involved skin is positive. Note: also seen in scleroderma and "
"dermatomyositis, so it is not absolutely specific.", body))
story.append(Paragraph("3. Heart and Serosae", h3))
story.append(Paragraph(
"<b>Pericarditis (most common cardiac lesion, up to 50%):</b> Acute fibrinous pericarditis with mesothelial "
"surface exudate; later organises into thickened, opaque fibrous tissue, sometimes causing partial pericardial "
"obliteration. Pericardial effusion is common.", body))
story.append(Paragraph(
"<b>Libman-Sacks Endocarditis:</b> Sterile, verrucous vegetations of 1-3 mm, found on both surfaces "
"(atrial AND ventricular) of the mitral (and sometimes tricuspid) valve leaflets - a distinctive feature. "
"By comparison: infective endocarditis vegetations are larger and irregular; rheumatic fever vegetations are "
"smaller and confined to the line of closure — Robbins & Kumar, p. 182. Associated with antiphospholipid antibodies.", body))
story.append(Paragraph(
"<b>Myocarditis:</b> Less common; may cause resting tachycardia and ECG changes.", body))
story.append(Paragraph(
"<b>Pleuritis:</b> Fibrinous inflammation of pleural surfaces; pleural effusions common.", body))
story.append(Paragraph("4. Spleen", h3))
story.append(Paragraph(
"<b>Gross:</b> Splenomegaly, capsular thickening.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Follicular hyperplasia; "
"periarteriolar fibrosis of central penicilliary arteries producing characteristic concentric laminated "
"'onion-skin lesions' — Robbins & Kumar, p. 182. These onion-skin lesions are considered pathognomonic "
"of SLE in the spleen. Their exact pathogenesis is unclear but healed arteritis has been proposed.", body))
story.append(Paragraph("5. Joints", h3))
story.append(Paragraph(
"Non-erosive synovitis with little deformity. This contrasts with rheumatoid arthritis, where pannus "
"formation leads to progressive joint destruction. Biopsy shows mild synovial proliferation and "
"perivascular mononuclear infiltrate.", body))
story.append(Paragraph("6. Central Nervous System", h3))
story.append(Paragraph(
"Overt vasculitis is rare. More commonly, non-inflammatory small vessel occlusion by intimal "
"proliferation is seen — possibly mediated by endothelial autoantibody injury or antiphospholipid "
"antibody-mediated thrombosis. Bland microinfarcts and white matter changes result.", body))
story.append(Paragraph("7. Lymph Nodes", h3))
story.append(Paragraph(
"Generalised lymphadenopathy is common. Biopsy shows reactive follicular hyperplasia. Rarely, "
"a necrotising lymphadenitis due to vasculitis (similar to Kikuchi-Fujimoto disease) is found.", body))
story.append(Paragraph("Diagnosis", h2))
story.append(Paragraph(
"ACR criteria require 4/11: malar rash, discoid rash, photosensitivity, oral ulcers, arthritis, serositis, "
"renal disorder (proteinuria >0.5 g/day or casts), neurological disorder, haematological disorder "
"(haemolytic anaemia/leukopenia/thrombocytopenia), immunological disorder (anti-dsDNA, anti-Sm, aPL), "
"and positive ANA — Andrews' Diseases of the Skin, p. 189.", body))
story.append(Paragraph(
"Key labs: ANA >95% sensitive; anti-dsDNA specific (~70%), titres track renal activity; anti-Sm ~99% specific; "
"low C3/C4/CH50 in active disease; anti-Ro/La for neonatal lupus risk.", body))
story.append(Paragraph("Management", h2))
story.append(Paragraph(
"<b>All patients:</b> Hydroxychloroquine (HCQ) - reduces flares, organ damage, thrombosis, and mortality; safe "
"in pregnancy. Sun protection is mandatory.", body))
story.append(Paragraph(
"<b>Active disease:</b> Corticosteroids (prednisolone 0.5-1 mg/kg/day). Steroid-sparing agents: "
"azathioprine (maintenance), mycophenolate mofetil (MMF - preferred for lupus nephritis induction "
"and maintenance), cyclophosphamide IV pulse (severe proliferative nephritis Class III/IV, NPSLE).", body))
story.append(Paragraph(
"<b>Biologics:</b> Belimumab (anti-BLyS/BAFF) for autoantibody-positive SLE; anifrolumab (anti-IFN receptor) "
"for moderate-to-severe disease. Voclosporin + MMF + low-dose steroid now approved for lupus nephritis.", body))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# ESSAY 2: AIDS — PATHOLOGY
# ════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("2. AIDS — Acquired Immunodeficiency Syndrome", essay_h))
story.append(Paragraph("Definition and Overview", h2))
story.append(Paragraph(
"AIDS is the advanced stage of HIV infection, defined by CD4+ T-cell count <200 cells/µL and/or the "
"presence of an AIDS-defining illness. HIV-1 (a lentivirus retrovirus) selectively destroys CD4+ T helper "
"lymphocytes, dismantling cell-mediated immunity and rendering patients susceptible to opportunistic "
"infections and certain malignancies. Neuropathologic changes were demonstrable at autopsy in up to 80-90% "
"of pre-ART era AIDS patients — Robbins, Cotran & Kumar, p. 4301.", body))
story.append(Paragraph("Pathogenesis", h2))
story.append(Paragraph(
"<b>Viral entry:</b> HIV gp120 binds CD4 on T cells, macrophages, and dendritic cells. Co-receptor binding "
"(CCR5 for R5-tropic virus - early infection; CXCR4 for X4-tropic - late) triggers gp41-mediated membrane "
"fusion. Reverse transcriptase converts ssRNA to dsDNA; integrase inserts it as provirus into the host genome.", body))
story.append(Paragraph(
"<b>CD4 depletion mechanisms:</b> (1) Direct cytopathic viral killing; (2) CTL (CD8+) killing of infected "
"cells; (3) Apoptosis of uninfected bystander CD4 T cells via gp120/CD4 crosslinking; (4) Impaired "
"thymopoiesis reducing replenishment. The gut-associated lymphoid tissue (GALT) is devastated early - "
"TH17 cells maintaining gut barrier integrity are preferentially lost, promoting microbial translocation "
"and systemic immune activation.", body))
story.append(Paragraph("Pathological Changes — Organ by Organ", h2))
story.append(Paragraph("1. Lymph Nodes — Sequential Changes", h3))
story.append(Paragraph(
"The lymph node changes in HIV/AIDS follow a characteristic progressive pattern reflecting the evolution "
"of immunodeficiency:", body))
ln_aids_data = [
["Stage", "Histological Appearance", "Clinical Correlation"],
["Early (acute HIV / high CD4)",
"Florid follicular hyperplasia: enlarged reactive germinal centres with mantle zone thinning. "
"Paracortical expansion. Sinusoidal monocytoid B-cell hyperplasia. Free HIV virions within germinal centre "
"follicular dendritic cells (FDC network acts as reservoir).",
"Persistent generalised lymphadenopathy (PGL); CD4 still relatively preserved"],
["Intermediate",
"Follicular involution: germinal centres shrink; FDC network disrupted. "
"Paracortical depletion of CD4 T cells.",
"CD4 progressively falling; early immunodeficiency"],
["Late / AIDS",
"Complete lymphocyte depletion: lymph node architecture effaced; plasma cells and macrophages predominate. "
"Vascular proliferation. Opportunistic organisms (e.g. MAC, Cryptococcus, CMV) often found within nodes.",
"CD4 <200; profound immunodeficiency; OI and malignancy"],
]
story.append(tbl(ln_aids_data, [3.5*cm, 7.5*cm, 5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("2. Brain — HIV Encephalitis", h3))
story.append(Paragraph(
"<b>Gross:</b> Cerebral atrophy; white matter pallor and softening, especially in the subcortical regions, "
"diencephalon, and brainstem.", body))
story.append(Paragraph(
"<b>Light Microscopy (pathognomonic features):</b> Widely distributed microglial nodules — small clusters "
"of activated microglia. Macrophage-derived multinucleated giant cells (MGC) — pathognomonic of HIV "
"encephalitis; formed by HIV-induced fusion of infected macrophages/microglia. Some microglial nodules are "
"perivascular, with abnormally prominent endothelial cells and foamy or pigment-laden macrophages. Foci of "
"tissue necrosis and reactive gliosis may be present — Robbins, Cotran & Kumar, p. 4312.", body))
story.append(Paragraph(
"<b>White matter:</b> Multifocal or diffuse myelin pallor, axonal swelling, and gliosis (HIV "
"leukoencephalopathy). HIV antigen demonstrable in CD4+ microglia and perivascular macrophages.", body))
story.append(Paragraph(
"<b>Clinical:</b> HIV-associated neurocognitive disorders (HAND) - ranging from mild cognitive impairment "
"to HIV-associated dementia (HAD). The pathological correlate is inflammatory microglial activation "
"rather than one specific lesion.", body))
story.append(Paragraph("3. Lungs — Pneumocystis jirovecii Pneumonia (PJP)", h3))
story.append(Paragraph(
"<b>Gross:</b> Lungs appear consolidated, grey-pink, and rubbery; airspaces filled with exudate. "
"No cavitation unlike tuberculosis.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Characteristic 'foamy eosinophilic intra-alveolar exudate' filling alveolar "
"spaces. This frothy, honeycombed exudate represents masses of organisms and their debris. "
"Minimal inflammatory reaction (consistent with impaired immunity). Type II pneumocyte hyperplasia "
"and interstitial thickening in more chronic cases.", body))
story.append(Paragraph(
"<b>Special stain:</b> Gomori Methenamine Silver (GMS) stain reveals 5-8 µm cysts with characteristic "
"intracystic bodies (daughter cells). Also positive: toluidine blue O, Giemsa. The trophic forms are "
"seen on Giemsa stain. PAS stain shows cyst wall.", body))
story.append(Paragraph("4. Kaposi Sarcoma (HHV-8)", h3))
story.append(Paragraph(
"<b>Gross:</b> Violaceous (purple-red) macules, papules, plaques, and nodules on skin, mucous membranes, "
"and viscera. In AIDS-associated (epidemic) KS, lesions are widespread and disseminated.", body))
story.append(Paragraph(
"<b>Light Microscopy — Three Stages:</b>", body))
for txt in [
"<b>Patch stage:</b> Upper reticular dermis shows vascular proliferation with irregular, dilated, slit-like "
"vascular spaces lined by bland endothelial cells. Extravasated RBCs and haemosiderin deposits. Sparse "
"inflammatory infiltrate.",
"<b>Plaque stage:</b> More prominent spindle cell proliferation filling the dermis; jagged slit-like vascular "
"channels between spindle cells. PAS-positive hyaline globules (degraded RBCs) within and between cells.",
"<b>Nodular stage:</b> Well-circumscribed nodules of densely packed spindle cells with slit-like vascular "
"spaces; mitotic figures; extravasated RBCs. Spindle cells are HHV-8 LANA-1 positive on "
"immunohistochemistry — pathognomonic.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("5. Gastrointestinal Tract", h3))
story.append(Paragraph(
"The GI tract is the primary site of CD4 T-cell depletion. CMV colitis: mucosal ulceration with "
"characteristic 'owl eye' intranuclear inclusions in endothelial cells and macrophages. "
"Cryptosporidium causes villous atrophy and malabsorption — trophozoites visible on H&E as "
"small basophilic dots at the enterocyte brush border. MAC infection: macrophages stuffed with "
"organisms (resembling Whipple disease) in lamina propria; PAS-positive foamy macrophages.", body))
story.append(Paragraph("6. Systemic Opportunistic Pathology Summary", h3))
oi_path_data = [
["Organism / Condition", "Key Pathological Features", "Special Stain"],
["Pneumocystis jirovecii (PJP)", "Foamy eosinophilic intra-alveolar exudate; minimal inflammation", "GMS, Toluidine blue O"],
["Cryptococcus neoformans", "Meningitis: gelatinous exudate; 'soap bubble' lesions in brain (cryptococcomas); narrow-neck budding yeasts with thick capsule", "India ink (capsule), Mucicarmine, GMS"],
["CMV", "'Owl-eye' intranuclear inclusions (10x cell size); also cytoplasmic inclusions; affects lung, retina, GI, adrenal", "IHC anti-CMV; H&E"],
["Toxoplasma gondii", "Ring-enhancing brain abscesses; central necrosis with inflammatory rim; bradyzoites in tissue cysts (crescent-shaped)", "H&E, IHC"],
["Mycobacterium avium complex", "Non-caseating granulomas (unlike TB); sheets of foamy macrophages stuffed with AFB", "ZN / AFB stain; PAS"],
["Kaposi Sarcoma (HHV-8)", "Spindle cells, slit-like vascular channels, hyaline globules, extravasated RBCs", "LANA-1 IHC (HHV-8)"],
["EBV B-cell lymphoma / PML", "Large B-cell immunoblasts (CNS lymphoma); JC virus - enlarged oligodendrocyte nuclei, bizarre astrocytes (PML)", "IHC, in-situ hybridisation"],
]
story.append(tbl(oi_path_data, [4.5*cm, 8*cm, 4.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Diagnosis", h2))
for txt in [
"<b>4th generation Ag/Ab ELISA:</b> Detects anti-HIV Ab (window 3-12 weeks) + p24 Ag (detectable ~2 weeks); standard screen.",
"<b>Confirmatory:</b> Western blot or HIV-1/2 differentiation immunoassay.",
"<b>HIV RNA PCR (viral load):</b> Quantifies replication; <50 copies/mL = virologic suppression.",
"<b>CD4 count:</b> Stratifies immunosuppression; guides prophylaxis and ART initiation.",
"<b>Resistance genotyping:</b> Before initiating or switching ART.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Management", h2))
story.append(Paragraph(
"Combination antiretroviral therapy (cART) is the standard of care for all HIV-positive individuals "
"regardless of CD4 count (WHO 2023). First-line: <b>Dolutegravir (INSTI) + Tenofovir + "
"Lamivudine</b> - single tablet, once daily, high barrier to resistance.", body))
art_data = [
["Class", "Examples", "Target"],
["NRTIs", "Tenofovir, Emtricitabine, Lamivudine, Abacavir", "Chain-terminate reverse transcription"],
["NNRTIs", "Efavirenz, Rilpivirine, Doravirine", "Allosteric inhibition of reverse transcriptase"],
["INSTIs (preferred)", "Dolutegravir, Bictegravir, Raltegravir", "Block proviral DNA integration"],
["Protease Inhibitors", "Darunavir + ritonavir/cobicistat", "Block viral polyprotein cleavage"],
["Entry/Fusion Inhibitors", "Maraviroc (CCR5 antagonist), Enfuvirtide", "Block viral entry and fusion"],
]
story.append(tbl(art_data, [4*cm, 6.5*cm, 6.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph(
"<b>U=U (Undetectable = Untransmittable):</b> Patients on effective ART with sustained undetectable "
"viral load cannot sexually transmit HIV. <b>PrEP</b> with tenofovir/emtricitabine reduces acquisition "
"by >99% in high-risk individuals. <b>PMTCT</b> reduces vertical transmission to <1-2%.", body))
story.append(PageBreak())
# ════════════════════════════════════════════════════════════════════════════
# ESSAY 3: AMYLOIDOSIS — PATHOLOGY
# ════════════════════════════════════════════════════════════════════════════
story.append(Paragraph("3. Amyloidosis", essay_h))
story.append(Paragraph("Definition and Nature of Amyloid", h2))
story.append(Paragraph(
"Amyloidosis is a group of diseases characterised by extracellular deposition of insoluble protein "
"fibrils in a beta-pleated sheet configuration. Over 30 different proteins can form amyloid. The "
"shared cross-beta-pleated sheet architecture gives amyloid its characteristic staining and "
"biophysical properties, regardless of the precursor protein.", body))
story.append(Paragraph("Histological Characteristics of Amyloid (All Forms)", h2))
stain_data = [
["Technique", "Appearance", "Notes"],
["Haematoxylin & Eosin (H&E)", "Amorphous, homogeneous, eosinophilic extracellular deposits", "Not specific; resembles hyaline"],
["Congo Red (ordinary light)", "Salmon-pink / brick-red deposits", "Standard diagnostic stain"],
["Congo Red (polarised light)", "Pathognomonic APPLE-GREEN birefringence", "Caused by cross-beta-pleated sheet; AA loses birefringence after KMnO4"],
["Thioflavin T / S", "Yellow-green fluorescence", "Very sensitive; used for confirmation"],
["Crystal Violet", "Purple (metachromasia)", "Less specific"],
["PAS stain", "Weakly positive; diastase-resistant", "Distinguishes from fibrin"],
["Electron Microscopy", "Non-branching, non-anastomosing straight fibrils, 7.5-10 nm diameter, arranged in random meshwork", "Diagnostic EM appearance shared by ALL amyloid types"],
["Immunohistochemistry", "Type-specific staining with anti-AL (kappa/lambda), anti-AA, anti-TTR antibodies", "Required for amyloid typing"],
["Mass Spectrometry", "Definitive proteomic identification of amyloid protein type", "Gold standard for typing, especially AL"],
]
story.append(tbl(stain_data, [4.5*cm, 5.5*cm, 7*cm]))
story.append(Spacer(1,6))
story.append(Paragraph(
"KEY DISTINGUISHING STAIN: AA amyloid loses its Congo red birefringence after pretreatment with "
"potassium permanganate (KMnO4), while AL and ATTR amyloid maintain their birefringence — "
"Andrews' Diseases of the Skin, p. 599.", callout))
story.append(Spacer(1,4))
story.append(Paragraph("Classification and Pathogenesis", h2))
class_data = [
["Type", "Precursor Protein", "Source", "Pathogenesis", "Distribution"],
["AL (Primary)", "Immunoglobulin light chains (usually lambda)", "Clonal plasma cells (myeloma or MGUS)", "Excess monoclonal light chains cannot be fully degraded; fragments misfold into amyloidogenic fibrils", "Heart, kidney, liver, nerves, skin, GI"],
["AA (Secondary / Reactive)", "Serum Amyloid A (SAA - acute phase reactant)", "Liver (stimulated by IL-6, IL-1 from chronic inflammation)", "Sustained SAA elevation (TB, RA, FMF, IBD, osteomyelitis) overwhelms macrophage degradation; partial proteolysis yields AA amyloid fragments", "Kidney (dominant), liver, spleen, adrenals"],
["ATTR (Transthyretin)", "Transthyretin (formerly prealbumin)", "Liver (wild-type) or mutant TTR gene (hereditary)", "Age-related or mutation-driven TTR misfolding; fibrils deposit in heart, nerves, connective tissue", "Heart (ATTRwt), peripheral nerves (ATTRv-FAP)"],
["Abeta2M (Dialysis)", "Beta-2 microglobulin", "Not cleared by standard dialysis membranes", "Accumulation of beta-2M; misfolds into amyloid fibrils", "Joints, carpal tunnel, periarticular tissue"],
["Abeta (Alzheimer)", "Amyloid beta peptide (from APP)", "Neuronal APP cleavage by beta/gamma secretase", "Senile plaques and cerebrovascular amyloid in brain", "Brain (neuritic plaques, vessel walls)"],
]
story.append(tbl(class_data, [2.2*cm, 3.2*cm, 3.3*cm, 4.8*cm, 3.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Pathological Changes — Organ by Organ", h2))
story.append(Paragraph("1. Kidney (Most Common & Most Serious)", h3))
story.append(Paragraph(
"<b>Gross:</b> Kidneys may be of normal size and colour in early disease, or shrunken and pale in "
"advanced cases due to ischaemia from amyloid deposition in arterial/arteriolar walls.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Amyloid is deposited primarily in glomeruli, but also in interstitial "
"peritubular tissue, arteries, and arterioles. Early: subtle mesangial thickening with uneven widening "
"of GBM. Progressive: mesangial deposits and GBM deposits cause capillary narrowing and distortion "
"of the glomerular vascular tuft. Late: capillary lumens are obliterated; the obsolescent glomerulus "
"is 'flooded' by confluent masses and interacing broad ribbons of amyloid — Robbins, Cotran & Kumar, "
"p. 1331. These deposits are Congo red positive with apple-green birefringence.", body))
story.append(Paragraph(
"<b>Immunofluorescence:</b> In AL amyloidosis - monotypic lambda (or kappa) light chain staining of "
"glomerular deposits. In AA amyloidosis - AA-specific antibodies positive.", body))
story.append(Paragraph(
"<b>Clinical:</b> Nephrotic syndrome (proteinuria >3.5 g/day, hypoalbuminaemia, oedema, "
"hyperlipidaemia) is the hallmark presentation, progressing to end-stage renal disease.", body))
story.append(Paragraph("2. Spleen", h3))
story.append(Paragraph(
"<b>Gross and Light Microscopy — Two Patterns:</b>", body))
for txt in [
"<b>'Sago Spleen':</b> Amyloid deposits are largely limited to the splenic follicles (white pulp). "
"On gross inspection: tapioca-like wax granules scattered through the red pulp background. Microscopically: "
"amyloid replaces follicular lymphoid tissue.",
"<b>'Lardaceous Spleen':</b> Amyloid involves the walls of splenic sinuses and connective tissue "
"framework of the red pulp. Gross: diffuse, large map-like waxy areas throughout the spleen. "
"Microscopically: amyloid in sinus walls, trabecular framework, and interstitium. May cause marked "
"splenomegaly (up to 800 g) — Robbins, Cotran & Kumar, p. 1333.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("3. Liver", h3))
story.append(Paragraph(
"<b>Gross:</b> May be inapparent or cause moderate to marked hepatomegaly. Cut surface shows pale, "
"waxy, firm appearance in affected areas.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Amyloid first appears in the space of Disse (between sinusoidal endothelium "
"and hepatocytes), then progressively encroaches on adjacent hepatocytes and sinusoids. In time: "
"pressure atrophy and disappearance of hepatocytes; total replacement of large areas of parenchyma. "
"Vascular involvement is frequent — Robbins, Cotran & Kumar, p. 1335. Despite extensive involvement, "
"liver function is often surprisingly preserved.", body))
story.append(Paragraph("4. Heart", h3))
story.append(Paragraph(
"<b>Gross:</b> Heart may be enlarged and firm, but more often shows a rubbery, 'boiled meat' "
"appearance. The myocardium is pale and waxy. Subendocardial deposits may be visible.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Amyloid deposits begin between myocardial fibres and progressively expand "
"to form irregular masses, compressing and destroying myocytes. Perivascular deposits in intramyocardial "
"vessels. The conducting system is also affected (causing arrhythmias).", body))
story.append(Paragraph(
"<b>Echocardiography:</b> Concentric LV wall thickening with characteristic 'sparkling/granular' "
"myocardial echogenicity. <b>ECG paradox:</b> Low voltage despite increased wall thickness "
"(voltage-to-mass mismatch) — key diagnostic clue.", body))
story.append(Paragraph(
"<b>Cardiac MRI:</b> Diffuse subendocardial or transmural late gadolinium enhancement (LGE) - "
"characteristic pattern. <b>Tc-99m PYP scintigraphy:</b> Grade 2-3 cardiac uptake in the absence of "
"plasma cell dyscrasia is diagnostic of ATTR amyloid without biopsy.", body))
story.append(Paragraph(
"<b>Clinical:</b> Restrictive cardiomyopathy with diastolic dysfunction; exertional dyspnoea; "
"right heart failure; arrhythmias. AL cardiac amyloidosis: median survival 6-12 months without treatment.", body))
story.append(Paragraph("5. Skin (Cutaneous Manifestations)", h3))
skin_data = [
["Feature", "Description", "Amyloid Type"],
["Periorbital purpura ('raccoon eyes')", "Capillary amyloid infiltration causes fragility; purpura after minor trauma or Valsalva (coughing, proctoscopy, vomiting) - 'pinch purpura'", "AL (primary)"],
["Waxy papules/plaques", "Smooth, translucent, firm papules around eyes, nose, mouth, mucocutaneous junctions", "AL (primary)"],
["Macroglossia", "Enlarged tongue (~20% of AL); dental indentation margins; nodules; dysphagia", "AL (primary)"],
["Macular amyloidosis", "Rippled grey-brown hyperpigmentation upper back; keratin-derived amyloid in papillary dermis", "Localised cutaneous"],
["Lichen amyloidosis", "Pruritic hyperkeratotic papules on shins; same pathology as macular type", "Localised cutaneous"],
["Nail dystrophy", "Thin, fragile, ridged nails resembling late ungual lichen planus; subungual haemorrhage", "Systemic"],
["Shoulder pad sign", "Periarticular amyloid infiltration of shoulder soft tissue", "Abeta2M (dialysis)"],
]
story.append(tbl(skin_data, [4*cm, 7.5*cm, 5.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("6. Peripheral Nervous System", h3))
story.append(Paragraph(
"Peripheral neuropathy is a prominent feature of AL and hereditary ATTR (Val30Met) amyloidosis. "
"The neuropathy is predominantly 'small fibre' - early loss of pain and temperature sensation "
"before vibration/proprioception loss. Autonomic neuropathy causes postural hypotension, impotence, "
"and GI dysmotility. Carpal tunnel syndrome (compression at the carpal tunnel by amyloid) is common "
"in dialysis-related (Abeta2M) and ATTR amyloidosis.", body))
story.append(Paragraph("Diagnosis", h2))
dx_data = [
["Test", "Purpose", "Note"],
["Tissue biopsy + Congo red stain", "Gold standard; apple-green birefringence under polarised light", "Fat pad (~80%), rectum, labial gland, kidney"],
["Amyloid typing (IHC / mass spec)", "Identifies precursor protein type - mandatory before treatment", "Mass spectrometry most accurate, esp. for AL"],
["SPEP + serum free light chain assay", "Detects monoclonal paraprotein in AL amyloidosis", "SFL more sensitive than SPEP/UPEP"],
["SAP scintigraphy (123I-SAP)", "Whole-body imaging; quantifies amyloid load", "All forms; SAP binds all amyloid"],
["Echo + Cardiac MRI", "Cardiac assessment; diffuse LGE = cardiac amyloid", "CMR most sensitive for cardiac involvement"],
["Tc-99m PYP scan", "Specific for ATTR cardiac amyloid; grade 2-3 uptake diagnostic", "Negative in AL cardiac amyloid"],
["Genetic testing (TTR gene)", "Hereditary ATTR amyloidosis (Val30Met etc.)", "Autosomal dominant"],
["KMnO4 pretreatment", "AA amyloid loses Congo red birefringence; AL and ATTR do not", "Histochemical distinction of AA vs AL/ATTR"],
]
story.append(tbl(dx_data, [4.5*cm, 6*cm, 6.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Treatment", h2))
tx_data = [
["Type", "Treatment Strategy", "Key Agents"],
["AL Amyloidosis",
"Eliminate the plasma cell clone producing the amyloidogenic light chains",
"VCd (Bortezomib + Cyclophosphamide + Dexamethasone); "
"Daratumumab + VCd (ANDROMEDA - new standard); "
"High-dose melphalan + ASCT (eligible patients)"],
["AA Amyloidosis",
"Suppress the underlying chronic inflammatory disease to reduce SAA production",
"Treat underlying cause (RA, FMF, IBD); "
"Biologics: IL-1 inhibitors (anakinra), IL-6 inhibitors (tocilizumab); "
"Colchicine (FMF maintenance)"],
["ATTR Amyloidosis",
"Stabilise TTR tetramer or silence TTR gene expression",
"Tafamidis (TTR stabiliser) - approved for ATTR CMP (ATTR-ACT trial); "
"Patisiran (siRNA) / Inotersen (ASO) - reduce hepatic TTR by >80%; "
"Liver transplant - curative for hereditary ATTR polyneuropathy (early); "
"CRISPR TTR editing - emerging"],
["Abeta2M (Dialysis)",
"Switch to high-flux dialysis membranes or renal transplantation",
"High-flux / haemodiafiltration membranes; renal transplantation"],
["Supportive",
"Manage organ complications",
"Loop diuretics (cautiously) for cardiac failure; "
"RRT/transplant for ESRD; nutritional support; "
"Orthostatic hypotension management"],
]
story.append(tbl(tx_data, [2.5*cm, 5*cm, 9.5*cm]))
story.append(Spacer(1,8))
# Footer
story.append(HRFlowable(width="100%", thickness=0.5, color=BLUE, spaceAfter=6))
story.append(Paragraph(
"Sources: Robbins, Cotran & Kumar — Pathologic Basis of Disease (2023), pp. 182, 1324-1336, 4301-4318 | "
"Robbins & Kumar Basic Pathology | Firestein & Kelley's Textbook of Rheumatology | "
"Janeway's Immunobiology 10e | Andrews' Diseases of the Skin", src))
doc.build(story)
print(f"PDF created: {output_path}")
python /tmp/workspace/medical-essays/generate_patho_pdf.py
Pathology Essays SLE AIDS Amyloidosis
PDF Document · PDF
Thank u
Create more pathology essays on other topics
~/medical-essays/generate_patho2.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
output_path = "/tmp/workspace/medical-essays/Pathology_Essays_TB_Pneumonia_LungCancer_Atherosclerosis_MI_HeartFailure.pdf"
doc = SimpleDocTemplate(
output_path, pagesize=A4,
rightMargin=2.2*cm, leftMargin=2.2*cm,
topMargin=2.5*cm, bottomMargin=2.5*cm,
title="Pathology Essays: TB, Pneumonia, Lung Cancer, Atherosclerosis, MI, Heart Failure",
author="Orris Medical AI"
)
styles = getSampleStyleSheet()
NAVY = colors.HexColor('#1a3a5c')
BLUE = colors.HexColor('#2c5f8a')
ROW1 = colors.HexColor('#f0f5fa')
GREY = colors.HexColor('#666666')
GOLD = colors.HexColor('#b8860b')
GREEN = colors.HexColor('#1a5c3a')
RED = colors.HexColor('#7a1a1a')
cover_title = ParagraphStyle('CoverTitle', parent=styles['Title'],
fontSize=24, textColor=NAVY, spaceAfter=10, alignment=TA_CENTER,
fontName='Helvetica-Bold', leading=30)
cover_sub = ParagraphStyle('CoverSub', parent=styles['Normal'],
fontSize=12, textColor=BLUE, spaceAfter=5, alignment=TA_CENTER, fontName='Helvetica')
badge = ParagraphStyle('Badge', parent=styles['Normal'],
fontSize=11, textColor=colors.white, backColor=RED,
spaceAfter=4, alignment=TA_CENTER, fontName='Helvetica-Bold', borderPad=6, leading=16)
essay_h = ParagraphStyle('EssayH', parent=styles['Heading1'],
fontSize=16, textColor=colors.white, backColor=NAVY,
spaceAfter=10, spaceBefore=16, fontName='Helvetica-Bold',
leftIndent=-8, rightIndent=-8, borderPad=8, leading=22)
h2 = ParagraphStyle('H2', parent=styles['Heading2'],
fontSize=13, textColor=NAVY, spaceBefore=12, spaceAfter=4, fontName='Helvetica-Bold')
h3 = ParagraphStyle('H3', parent=styles['Heading3'],
fontSize=11, textColor=BLUE, spaceBefore=8, spaceAfter=2, fontName='Helvetica-Bold')
body = ParagraphStyle('Body', parent=styles['Normal'],
fontSize=10, leading=15, spaceAfter=6, alignment=TA_JUSTIFY, fontName='Helvetica')
bul = ParagraphStyle('Bul', parent=styles['Normal'],
fontSize=10, leading=14, spaceAfter=3, leftIndent=16, fontName='Helvetica')
src = ParagraphStyle('Src', parent=styles['Normal'],
fontSize=8, textColor=GREY, spaceAfter=4, fontName='Helvetica-Oblique', alignment=TA_CENTER)
callout = ParagraphStyle('Callout', parent=styles['Normal'],
fontSize=9.5, leading=14, spaceAfter=6, leftIndent=10, rightIndent=10,
backColor=colors.HexColor('#fffbe6'), borderPad=6, fontName='Helvetica-Oblique')
keybox = ParagraphStyle('KeyBox', parent=styles['Normal'],
fontSize=9.5, leading=14, spaceAfter=6, leftIndent=10, rightIndent=10,
backColor=colors.HexColor('#e8f4e8'), borderPad=6, fontName='Helvetica-Bold')
def mk_table(data, widths, hdr_bg=NAVY):
t = Table(data, colWidths=widths)
t.setStyle(TableStyle([
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTSIZE', (0,0), (-1,-1), 9),
('BACKGROUND', (0,0), (-1,0), hdr_bg),
('TEXTCOLOR', (0,0), (-1,0), colors.white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [ROW1, colors.white]),
('GRID', (0,0), (-1,-1), 0.4, colors.HexColor('#aac4de')),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 6),
('WORDWRAP', (0,0), (-1,-1), True),
]))
return t
story = []
# ── COVER ───────────────────────────────────────────────────────────────────
story.append(Spacer(1, 2*cm))
story.append(Paragraph("PATHOLOGY", badge))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("15-Mark Essays — Set 2", cover_title))
story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="80%", thickness=3, color=BLUE, spaceAfter=18))
topics = [
"1. Tuberculosis",
"2. Pneumonia",
"3. Lung Cancer",
"4. Atherosclerosis",
"5. Myocardial Infarction (MI)",
"6. Heart Failure",
]
for t in topics:
story.append(Paragraph(t, cover_sub))
story.append(Spacer(1, 0.8*cm))
story.append(HRFlowable(width="80%", thickness=1, color=BLUE, spaceAfter=12))
story.append(Paragraph(
"Gross Morphology · Light Microscopy · Electron Microscopy · Special Stains · Pathogenesis · Management",
src))
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"Sources: Robbins, Cotran & Kumar — Pathologic Basis of Disease (2023) | Robbins & Kumar Basic Pathology | "
"Harrison's Principles of Internal Medicine 22E | Janeway's Immunobiology 10e",
src))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════
# ESSAY 1: TUBERCULOSIS
# ═══════════════════════════════════════════════════════════════════════════
story.append(Paragraph("1. Tuberculosis (TB)", essay_h))
story.append(Paragraph("Definition and Epidemiology", h2))
story.append(Paragraph(
"Tuberculosis is a chronic granulomatous infectious disease caused by Mycobacterium tuberculosis (MTB), "
"an aerobic, acid-fast bacillus (AFB). It remains one of the leading infectious killers globally, with "
"approximately 10 million new cases and 1.6 million deaths annually (WHO 2022). The lungs are the primary "
"organ of involvement, but TB can affect virtually every organ (extrapulmonary TB). The hallmark "
"histopathological finding of tuberculosis is the caseating granuloma.", body))
story.append(Paragraph("Pathogenesis", h2))
story.append(Paragraph(
"MTB is transmitted via inhalation of infected aerosol droplets. The bacilli are engulfed by alveolar "
"macrophages but resist intracellular killing by inhibiting phagosome-lysosome fusion (via secreted "
"lipoarabinomannan). They survive and replicate within macrophages. T-lymphocytes (CD4+ TH1 cells) are "
"activated by mycobacterial antigens via MHC class II presentation; they produce IFN-gamma, which "
"activates macrophages to produce nitric oxide and reactive oxygen species - the primary bactericidal "
"mechanism. This interaction forms the granuloma - the pathological hallmark of TB.", body))
story.append(Paragraph("Pathological Changes — Types of TB", h2))
story.append(Paragraph("1. Primary Tuberculosis (First Infection)", h3))
story.append(Paragraph(
"Occurs in previously unexposed, non-sensitised individuals (typically children). The inhaled bacilli "
"implant in the lower part of the upper lobe or upper part of the lower lobe (where oxygen tension is "
"highest). Pathological sequence:", body))
for txt in [
"<b>Ghon Focus (Ghon lesion):</b> A 1-2 cm area of grey-white inflammatory consolidation in the lung parenchyma (subpleural, commonly right side). Histologically: central caseation necrosis surrounded by epithelioid macrophages and Langhans giant cells.",
"<b>Ghon Complex:</b> Ghon focus + draining hilar/paratracheal lymph node involvement (lymphangitis + lymphadenitis). The combination is also called the Primary Complex.",
"<b>Ranke Complex:</b> Calcified Ghon focus + calcified hilar lymph node = evidence of healed primary TB on chest X-ray.",
"<b>Fate of Primary Complex:</b> In 90-95% of immunocompetent individuals, the primary complex undergoes fibrosis and calcification (healing). In ~5% (infants, immunocompromised), progressive primary TB or systemic dissemination occurs.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("2. Secondary (Post-Primary / Reactivation) Tuberculosis", h3))
story.append(Paragraph(
"Occurs in previously sensitised individuals (adults) due to reactivation of dormant bacilli or "
"reinfection. Characteristically involves the apices of the upper lobes (where pO2 is highest and "
"lymphatic drainage is poor, favouring mycobacterial growth).", body))
story.append(Paragraph("Pathological progression:", body))
for txt in [
"<b>Apical focus:</b> Initial lesion in the apex (Simon foci - old haematogenous seeding from primary). Central caseation necrosis with surrounding granuloma.",
"<b>Cavitation:</b> Liquefaction of the caseous centre and erosion into a bronchus creates a fibrocavitary lesion - the hallmark of secondary TB. The cavity wall is lined by epithelioid cells and fibrous tissue. Contents drain via bronchi (infectious sputum). Cavities allow aerobic replication of bacilli.",
"<b>Satellite lesions:</b> Bronchogenic spread to other lung segments (acinar-nodose shadows on CXR).",
"<b>Healing:</b> Fibrosis, encapsulation, and calcification if controlled by immunity or treatment.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("3. Miliary Tuberculosis", h3))
story.append(Paragraph(
"Haematogenous dissemination of MTB seeds every organ. Gross: lung shows numerous small (1-2 mm) "
"grey-white granulomas resembling millet seeds (hence 'miliary'). Also seen in liver, spleen, bone marrow, "
"adrenals, meninges, kidneys, and eyes. Occurs in immunocompromised patients or when a Ghon focus or "
"caseous lymph node erodes into a blood vessel.", body))
story.append(Paragraph("Histological Features — The Granuloma", h2))
story.append(Paragraph(
"The TB granuloma (tubercle) has a characteristic structure that must be memorised:", body))
gran_data = [
["Zone", "Cell Type / Feature", "Significance"],
["Central", "Caseating necrosis — acellular, granular, 'cheesy' material (coagulative necrosis with ghost cell outlines)", "Zone of tissue destruction; bacilli may be present (ZN stain AFB+)"],
["Surrounding", "Epithelioid macrophages — activated macrophages with abundant pink cytoplasm and oval vesicular nuclei, arranged in palisading sheets", "Primary immune effectors; produce lysozyme and TNF-alpha"],
["Giant cells", "Langhans giant cells — multinucleated giant cells with nuclei arranged in a horseshoe/peripheral arc pattern (up to 40 nuclei)", "Formed by fusion of epithelioid macrophages; pathognomonic arrangement"],
["Outer zone", "Rim of CD4+ T lymphocytes (mainly TH1) + fibroblasts", "Immune sensitised T cells maintaining granuloma integrity"],
["Periphery", "Fibrous capsule (older lesions)", "Calcification may occur on healing"],
]
story.append(mk_table(gran_data, [3*cm, 6.5*cm, 7.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph(
"SPECIAL STAIN: Ziehl-Neelsen (ZN) stain — MTB stains red (acid-fast) against a blue background. "
"MTB is an acid-fast bacillus because its thick waxy mycolic acid-containing cell wall resists "
"decolourisation with acid-alcohol. Also: auramine-rhodamine fluorescent stain (more sensitive).", callout))
story.append(Spacer(1,4))
story.append(Paragraph("Extrapulmonary Tuberculosis", h2))
ep_data = [
["Site", "Pathological Features"],
["Lymph nodes (scrofula)", "Matted, caseating lymph nodes; collar-stud abscess (pus tracking through deep fascia into skin)"],
["Spine (Pott's disease)", "Vertebral body destruction; caseation forming psoas abscess; gibbus deformity"],
["Kidneys", "Caseating granulomas; papillary necrosis; 'putty kidney' (calcified); sterile pyuria"],
["GI tract", "Transverse ulcers in terminal ileum; 'napkin ring' stricture; hyperplastic (tumour-like) ileocaecal mass"],
["Meninges (TB meningitis)", "Gelatinous exudate at base of brain; basal exudate; communicating hydrocephalus; cranial nerve palsies"],
["Adrenals (Addison's disease)", "Bilateral caseating adrenalitis destroying cortex; primary adrenal insufficiency"],
["Pericardium", "Fibrinous then fibrocaseous pericarditis; 'bread-and-butter' pericardium; constrictive pericarditis (healed)"],
]
story.append(mk_table(ep_data, [4.5*cm, 12.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Diagnosis", h2))
for txt in [
"<b>Sputum smear (ZN stain):</b> Detects AFB; requires 5,000-10,000 bacilli/mL; 60-70% sensitive for smear-positive TB.",
"<b>Culture (Lowenstein-Jensen medium):</b> Gold standard; slow (4-8 weeks); buff, rough, raised 'cauliflower' colonies.",
"<b>Nucleic acid amplification (NAAT/GeneXpert MTB/RIF):</b> Rapid (2 hrs); detects MTB DNA + rifampicin resistance; WHO recommended first-line test.",
"<b>Tuberculin Skin Test (Mantoux):</b> PPD injected intradermally; induration ≥10 mm at 48-72 hrs = positive (≥5 mm in HIV/immunocompromised). Detects sensitisation, not active disease.",
"<b>IGRA (QuantiFERON-TB Gold):</b> Detects IFN-gamma release by sensitised T cells; not affected by BCG vaccination.",
"<b>CXR:</b> Apical/upper lobe infiltrates, cavitation, fibrosis, calcification; Ranke complex; miliary pattern.",
"<b>Biopsy:</b> Histological demonstration of caseating granuloma with ZN-positive AFB.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Management (RNTCP/WHO Standard Regimen)", h2))
story.append(Paragraph(
"<b>Initial (Intensive) Phase — 2 months:</b> HRZE — Isoniazid (H) + Rifampicin (R) + Pyrazinamide (Z) + "
"Ethambutol (E). Kills actively replicating bacilli rapidly.", body))
story.append(Paragraph(
"<b>Continuation Phase — 4 months:</b> HR — Isoniazid + Rifampicin. Eliminates dormant persisting bacilli.", body))
story.append(Paragraph(
"<b>MDR-TB (resistant to H + R):</b> Bedaquiline-based regimens (BPaL: Bedaquiline + Pretomanid + "
"Linezolid). 6-9 month WHO shorter MDR-TB regimen. <b>XDR-TB</b> additionally resistant to "
"fluoroquinolones + second-line injectables.", body))
story.append(Paragraph(
"<b>HIV-TB co-infection:</b> Start ART within 2-8 weeks of TB treatment initiation. Rifampicin interacts "
"with PIs (induces CYP3A4) — use efavirenz-based ART.", body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════
# ESSAY 2: PNEUMONIA
# ═══════════════════════════════════════════════════════════════════════════
story.append(Paragraph("2. Pneumonia", essay_h))
story.append(Paragraph("Definition and Classification", h2))
story.append(Paragraph(
"Pneumonia is an inflammation of the lung parenchyma (alveoli and/or interstitium) caused by "
"infectious agents. It is classified by anatomical distribution, causative agent, and clinical setting. "
"The two major anatomical patterns of bacterial pneumonia are lobar pneumonia and bronchopneumonia.", body))
story.append(Paragraph("Pathological Patterns", h2))
story.append(Paragraph("A. Lobar Pneumonia", h3))
story.append(Paragraph(
"Affects an entire lobe or large portion of a lobe. Most commonly caused by Streptococcus pneumoniae "
"(Pneumococcus). Progresses through four classical pathological stages — Robbins, Cotran & Kumar, p. 662:", body))
stage_data = [
["Stage", "Timing", "Gross Features", "Light Microscopy", "Key Features"],
["1. Congestion", "Day 1-2",
"Lobe heavy, boggy, red",
"Vascular engorgement; intra-alveolar oedema fluid with a few neutrophils; numerous bacteria",
"Pre-exudative stage; lobe sinks in water"],
["2. Red Hepatization", "Day 2-4",
"Lobe firm, airless, red-pink; liver-like consistency",
"Alveoli filled with massive exudate of neutrophils, red cells, and fibrin; fibrin strands connect alveoli via pores of Kohn",
"Consolidation at its peak; lobe floats in water but sinks if cut"],
["3. Grey Hepatization", "Day 4-8",
"Lobe grey-brown, firm, granular cut surface",
"Progressive RBC lysis and disintegration; persisting fibrinopurulent exudate; neutrophil debris (pus)",
"Colour change reflects RBC breakdown; bacterial numbers declining"],
["4. Resolution", "Day 8+",
"Returning to normal; airways reopen",
"Enzymatic digestion of fibrin; macrophages clear debris; exudate reabsorbed or expectorated",
"Complete recovery typical; occasionally organises into fibrous tissue (carnification)"],
]
story.append(mk_table(stage_data, [3*cm, 2*cm, 3.5*cm, 4.5*cm, 4*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("B. Bronchopneumonia (Lobular Pneumonia)", h3))
story.append(Paragraph(
"Patchy consolidation centred on bronchi/bronchioles, involving multiple lobules. Usually bilateral, "
"basal, and multifocal. Common organisms: Staphylococcus aureus, Klebsiella pneumoniae, Haemophilus "
"influenzae, Streptococcus pyogenes.", body))
story.append(Paragraph(
"<b>Gross:</b> Slightly elevated, dry, granular, grey-red to yellow poorly-demarcated patches, scattered "
"throughout lung. More common in lower lobes.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Neutrophil-rich exudate fills bronchi, bronchioles, and adjacent alveoli. "
"Surrounding alveoli may show oedema and early inflammatory change. Less uniform than lobar pneumonia.", body))
story.append(Paragraph("C. Interstitial (Atypical) Pneumonia", h3))
story.append(Paragraph(
"Primarily affects the interstitium rather than alveoli. Diffuse alveolar damage (DAD) pattern. "
"Caused by 'atypical' organisms: Mycoplasma pneumoniae, viral (Influenza, RSV, SARS-CoV-2), "
"Chlamydophila pneumoniae, Legionella pneumophila.", body))
story.append(Paragraph(
"<b>Light Microscopy:</b> Thickening of alveolar septa with lymphocytic and mononuclear cell "
"infiltration. Alveolar spaces relatively spared. Hyaline membranes may form (DAD pattern). No "
"frank pus. Type II pneumocyte hyperplasia and reactive atypia.", body))
story.append(Paragraph("Complications of Pneumonia", h2))
comp_data = [
["Complication", "Mechanism", "Features"],
["Lung abscess", "Tissue necrosis (especially Staphylococcus, Klebsiella, anaerobes)", "Cavity with pus; air-fluid level on CXR"],
["Empyema", "Spread of infection to pleural cavity", "Intrapleural fibrinopurulent exudate; pleural thickening; trapped lung"],
["Bacteraemia / Sepsis", "Haematogenous spread from lung", "Endocarditis, meningitis, brain abscess, septic arthritis"],
["Pleuritis / effusion", "Pleural surface inflammation", "Chest pain; friction rub; pleural effusion (parapneumonic)"],
["Carnification", "Failure of resolution; fibroblast organisation of exudate", "Solid, 'meat-like' lobe; permanent consolidation"],
["ARDS", "Massive diffuse alveolar damage", "Bilateral infiltrates; hypoxaemia; hyaline membranes"],
]
story.append(mk_table(comp_data, [4*cm, 5.5*cm, 7.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Causative Organisms by Setting", h2))
org_data = [
["Setting", "Common Pathogens", "Notes"],
["Community-Acquired Pneumonia (CAP)", "Streptococcus pneumoniae (most common overall), Mycoplasma, Haemophilus influenzae, Legionella, viruses", "Lobar or atypical pattern; CURB-65 score for severity"],
["Hospital-Acquired (HAP) >48h admission", "Gram negatives (Klebsiella, Pseudomonas, E. coli), Staphylococcus aureus (MRSA)", "More resistant organisms; higher mortality"],
["Aspiration Pneumonia", "Mixed oral anaerobes (Bacteroides, Prevotella)", "Right lower lobe (supine: right upper lobe posterior segment); putrid sputum; abscess formation"],
["Immunocompromised", "Pneumocystis jirovecii (PJP), Aspergillus, CMV, Nocardia", "PJP: foamy eosinophilic exudate; GMS stain"],
["Neonates", "Group B Streptococcus, E. coli, Listeria", "NICU setting; hyaline membrane disease overlap"],
]
story.append(mk_table(org_data, [4.5*cm, 5.5*cm, 7*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Diagnosis and Management", h2))
story.append(Paragraph(
"<b>Diagnosis:</b> CXR (lobar opacity, patchy infiltrates); sputum Gram stain and culture; "
"blood cultures; urinary antigen (Streptococcus pneumoniae, Legionella); "
"procalcitonin/CRP (bacterial vs viral); NAAT for atypicals.", body))
story.append(Paragraph(
"<b>Severity scoring:</b> CURB-65 (Confusion, Urea >7, RR >30, BP <90/60, Age ≥65). Score 0-1: "
"outpatient; 2: consider hospital; ≥3: ICU.", body))
story.append(Paragraph(
"<b>Treatment:</b> CAP — Amoxicillin ± macrolide (mild-moderate); beta-lactam + macrolide or "
"fluoroquinolone (severe). HAP/VAP — Piperacillin-tazobactam, carbapenems (± anti-MRSA cover with "
"vancomycin/linezolid). PJP — Cotrimoxazole (high-dose TMP-SMX) 21 days.", body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════
# ESSAY 3: LUNG CANCER
# ═══════════════════════════════════════════════════════════════════════════
story.append(Paragraph("3. Lung Cancer (Carcinoma of the Lung)", essay_h))
story.append(Paragraph("Definition and Epidemiology", h2))
story.append(Paragraph(
"Lung cancer is the leading cause of cancer-related mortality worldwide in both men and women, "
"responsible for ~1.8 million deaths annually. Smoking is by far the most important risk factor, "
"accounting for 85-90% of cases. The World Health Organization (WHO) classifies lung carcinomas "
"into four major cell types: small-cell lung cancer (SCLC), adenocarcinoma, squamous cell carcinoma, "
"and large-cell carcinoma — Harrison's Principles of Internal Medicine 22E, p. 1357.", body))
story.append(Paragraph("Risk Factors", h2))
for txt in [
"<b>Tobacco smoking:</b> Most important; risk proportional to pack-years; causes all four major types. Almost all SCLC is smoking-related.",
"<b>Radon gas:</b> Second most common cause in never-smokers; alpha-particle DNA damage.",
"<b>Asbestos:</b> Synergistic with smoking; causes mesothelioma (pleura) and lung carcinoma (especially adenocarcinoma).",
"<b>Occupational:</b> Arsenic, chromium, uranium, nickel, polycyclic aromatic hydrocarbons.",
"<b>Air pollution (PM2.5):</b> Growing cause of adenocarcinoma in never-smokers.",
"<b>Molecular drivers:</b> EGFR mutations (adenocarcinoma, never-smokers, Asian women), KRAS, ALK rearrangements, ROS1, BRAF.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Pathological Classification — Histological Types", h2))
hist_data = [
["Type", "Frequency", "Location", "Gross / LM Features", "Molecular / Special Features"],
["Adenocarcinoma",
"~40% (most common overall)",
"Peripheral; subpleural",
"Gross: grey-white nodule, often with pleural puckering; scar cancer. LM: glandular/acinar/papillary/micropapillary/lepidic (bronchioloalveolar) patterns; mucin production; TTF-1+, CK7+",
"Most common in non-smokers and women; EGFR mutations (exon 19/21), ALK rearrangements, ROS1, KRAS; Lepidic pattern (AIS) = non-invasive; TTF-1 + Napsin-A IHC"],
["Squamous Cell Carcinoma (SCC)",
"~30%",
"Central; hilar; main bronchi",
"Gross: grey-white, firm, hilar mass; often obstructs bronchus; central necrosis/cavitation. LM: nests of polygonal cells with intercellular bridges (desmosomes) and keratin pearl formation (concentric whorls of keratinised cells); dyskeratosis; p40+, p63+, CK5/6+",
"Strongly smoking-related; hypercalcaemia (PTHrP secretion) paraneoplastic; cavitation on CXR; p40/p63 IHC"],
["Small Cell Lung Cancer (SCLC)",
"~15%",
"Central; perihilar",
"Gross: soft, white, bulky hilar mass with extensive necrosis. LM: small cells (~2x lymphocyte size) with scant cytoplasm, round/oval hyperchromatic nuclei, fine ('salt-and-pepper') chromatin, no nucleoli; nuclear moulding; crush artefact on biopsy; high mitotic rate (Ki67 >80%)",
"Almost always metastatic at presentation (Stage IIIB-IV); neuroendocrine IHC (synaptophysin, chromogranin, CD56); paraneoplastic syndromes (SIADH, ACTH, Lambert-Eaton); extremely chemosensitive; surgery rarely indicated"],
["Large Cell Carcinoma",
"~10%",
"Peripheral or central",
"Large, bulky, peripheral mass; extensive necrosis. LM: large cells lacking glandular, squamous, or neuroendocrine differentiation; diagnosis of exclusion",
"Poor prognosis; aggressive; diagnosis requires full IHC panel + molecular testing"],
]
story.append(mk_table(hist_data, [3*cm, 2*cm, 3*cm, 5.5*cm, 5.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Spread and Staging", h2))
story.append(Paragraph(
"<b>Local extension:</b> Pancoast tumour (superior sulcus tumour - squamous cell or adenocarcinoma) invades "
"brachial plexus (C8/T1), sympathetic chain (Horner's syndrome: ptosis, miosis, anhidrosis), and ribs. "
"SVC syndrome: mediastinal compression of superior vena cava.", body))
story.append(Paragraph(
"<b>Lymphatic spread:</b> Hilar (N1) → mediastinal (N2) → supraclavicular (N3) lymph nodes.", body))
story.append(Paragraph(
"<b>Haematogenous metastasis:</b> Adrenals (most common), liver, bone (lytic), brain, skin.", body))
story.append(Paragraph(
"<b>Staging:</b> TNM system (AJCC 8th edition). SCLC: simplified as Limited Stage (LS) vs "
"Extensive Stage (ES). LS-SCLC confined to one hemithorax + ipsilateral nodes (can be encompassed "
"in one radiation field).", body))
story.append(Paragraph("Paraneoplastic Syndromes", h2))
pns_data = [
["Syndrome", "Cause / Mechanism", "Associated Tumour"],
["SIADH (hyponatraemia)", "Ectopic ADH secretion", "SCLC"],
["Ectopic ACTH (Cushing's)", "Ectopic ACTH; rapid onset, hypokalaemia > moon face", "SCLC"],
["Lambert-Eaton Myasthenic Syndrome", "Anti-VGCC antibodies; proximal muscle weakness; reflexes increase after repeated stimulation", "SCLC"],
["Hypercalcaemia", "PTHrP secretion (humoral hypercalcaemia of malignancy)", "Squamous cell carcinoma"],
["Hypertrophic pulmonary osteoarthropathy", "Periosteal new bone formation; clubbing + arthritis of ankles/wrists", "Adenocarcinoma, squamous cell"],
["Peripheral neuropathy", "Paraneoplastic anti-Hu antibodies", "SCLC"],
]
story.append(mk_table(pns_data, [5*cm, 7*cm, 5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Diagnosis and Management", h2))
story.append(Paragraph(
"<b>Diagnosis:</b> CXR/CT chest (mass, collapse, mediastinal widening); PET-CT (staging); "
"bronchoscopy + BAL + biopsy (central lesions); CT-guided percutaneous biopsy (peripheral); "
"EBUS-TBNA (mediastinal lymph nodes); liquid biopsy (ctDNA for EGFR, ALK, KRAS mutations).", body))
story.append(Paragraph(
"<b>NSCLC treatment:</b> Stage I-II: surgical resection (lobectomy preferred) ± adjuvant chemotherapy. "
"Stage III: concurrent chemoradiotherapy ± durvalumab (anti-PD-L1) consolidation. "
"Stage IV: targeted therapy (osimertinib for EGFR; alectinib for ALK; sotorasib/adagrasib for KRAS G12C) "
"or platinum-doublet chemotherapy ± immunotherapy (pembrolizumab if PD-L1 ≥50%).", body))
story.append(Paragraph(
"<b>SCLC treatment:</b> LS-SCLC: Etoposide + cisplatin + concurrent thoracic radiotherapy ± prophylactic "
"cranial irradiation (PCI). ES-SCLC: Etoposide + cisplatin/carboplatin + atezolizumab (anti-PD-L1). "
"SCLC is rarely surgical.", body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════
# ESSAY 4: ATHEROSCLEROSIS
# ═══════════════════════════════════════════════════════════════════════════
story.append(Paragraph("4. Atherosclerosis", essay_h))
story.append(Paragraph("Definition", h2))
story.append(Paragraph(
"Atherosclerosis is a chronic inflammatory disease of large and medium-sized elastic and muscular "
"arteries characterised by intimal plaques (atheromas) composed of lipid, inflammatory cells, smooth "
"muscle cells, and fibrous tissue. It is the leading cause of death in the developed world, "
"responsible for myocardial infarction, stroke, aortic aneurysm, and peripheral vascular disease.", body))
story.append(Paragraph("Pathogenesis — Response-to-Injury Hypothesis", h2))
story.append(Paragraph(
"The 'response-to-injury' hypothesis proposes that atherosclerosis begins with endothelial "
"dysfunction at haemodynamically stressed sites (vessel bifurcations, branch ostia, posterior "
"abdominal aorta) where turbulent/non-laminar flow occurs — Robbins, Cotran & Kumar, p. 472.", body))
story.append(Paragraph("Sequence of events:", body))
for txt in [
"<b>Step 1 — Endothelial injury/dysfunction:</b> Caused by hypercholesterolaemia (oxidised LDL), haemodynamic turbulence, toxins (smoking), hypertension, and inflammation. Loss of atheroprotective genes (KLF2) at turbulent sites.",
"<b>Step 2 — Lipoprotein accumulation:</b> LDL enters dysfunctional endothelium and accumulates in the intima; oxidised by reactive oxygen species. ox-LDL is chemotactic and activates endothelial cells to upregulate VCAM-1 and ICAM-1.",
"<b>Step 3 — Monocyte recruitment and foam cell formation:</b> Circulating monocytes adhere to activated endothelium via VCAM-1 and migrate into the intima, differentiating into macrophages. Macrophages avidly ingest ox-LDL via scavenger receptors (SR-A, CD36) — becoming lipid-laden foam cells. These are the initial fatty streak lesions.",
"<b>Step 4 — Smooth muscle cell (SMC) migration and proliferation:</b> Platelet-derived PDGF and FGF from activated macrophages and endothelium drive SMC migration from media to intima. SMCs produce extracellular matrix (collagen, elastin, proteoglycans) forming the fibrous cap.",
"<b>Step 5 — Advanced plaque formation:</b> The complex atheromatous plaque develops with a fibrous cap (SMCs + collagen), a necrotic lipid core (dead foam cells, extracellular cholesterol crystals), and calcification.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Pathological Lesions — Progressive Stages", h2))
lesion_data = [
["Lesion", "Timing", "Gross Appearance", "Light Microscopy", "Significance"],
["Fatty Streak",
"Childhood (from age 10)",
"Flat or slightly elevated yellow streaks/dots on intimal surface of aorta and coronaries; associated with branch vessel ostia",
"Intimal aggregates of lipid-laden macrophage foam cells and T lymphocytes; no fibrous tissue; no smooth muscle proliferation",
"Earliest visible lesion; potentially reversible; not clinically significant"],
["Fibrous (Atheromatous) Plaque",
"Adulthood",
"Elevated, irregular, yellow-white firm intimal plaques; may show calcification (hard/crunchy plaques)",
"Fibrous cap: SMCs in collagenous matrix + T cells; Necrotic core: extracellular lipid, cholesterol crystals, dead foam cells, cellular debris; Shoulder region: macrophages, T cells, foam cells (most vulnerable zone)",
"Primary lesion of atherosclerosis; may reduce luminal diameter >70% causing ischaemia"],
["Complicated Plaque",
"Middle age onward",
"Ulceration, haemorrhage, calcification, thrombosis visible on gross and imaging",
"Plaque rupture: thin fibrous cap with macrophage erosion; intraplaque haemorrhage from vasa vasorum; thrombus formation; dystrophic calcification",
"Causes acute coronary syndromes, stroke, limb ischaemia"],
]
story.append(mk_table(lesion_data, [2.8*cm, 2*cm, 3.7*cm, 4.5*cm, 4*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Vulnerable (High-Risk) Plaque Features", h2))
story.append(Paragraph(
"A plaque is 'vulnerable' (prone to rupture) when it has: (1) thin fibrous cap (<65 µm); "
"(2) large necrotic lipid core (>40% plaque volume); (3) dense macrophage infiltration at "
"the shoulder; (4) reduced SMC density; (5) active inflammation with metalloproteinase (MMP) "
"secretion degrading the cap. Paradoxically, vulnerable plaques may NOT cause significant "
"stenosis on angiography — they are 'eccentric' and outwardly remodel (Glagov phenomenon).", body))
story.append(Paragraph(
"PLAQUE RUPTURE exposes the thrombogenic subendothelial collagen and tissue factor in the "
"lipid core to flowing blood → platelet aggregation and thrombus formation → acute MI or stroke.", callout))
story.append(Spacer(1,4))
story.append(Paragraph("Consequences and Distribution", h2))
for txt in [
"<b>Myocardial infarction:</b> Coronary artery stenosis/occlusion (LAD most common, then RCA, then LCX).",
"<b>Stroke (cerebral infarction):</b> Carotid and vertebrobasilar atherosclerosis.",
"<b>Aortic aneurysm:</b> Abdominal aorta (infrarenal) — medial atrophy from ischaemia; rupture risk when >5.5 cm.",
"<b>Peripheral vascular disease:</b> Lower limb claudication, critical limb ischaemia, gangrene.",
"<b>Renal artery stenosis:</b> Renovascular hypertension; ischaemic nephropathy.",
"<b>Mesenteric ischaemia:</b> Intestinal angina; bowel infarction.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Prevention and Management", h2))
story.append(Paragraph(
"<b>Lifestyle:</b> Smoking cessation (reduces risk within months); Mediterranean diet; regular aerobic "
"exercise; weight reduction.", body))
story.append(Paragraph(
"<b>Statins (HMG-CoA reductase inhibitors):</b> Cornerstone of pharmacological prevention. "
"Reduce LDL by 30-50%; pleiotropic anti-inflammatory effects; slow or regress plaque. "
"High-intensity statins (atorvastatin 40-80 mg, rosuvastatin 20-40 mg) for high CV risk.", body))
story.append(Paragraph(
"<b>Antihypertensives:</b> ACE inhibitors/ARBs reduce CV events beyond BP lowering. "
"Target BP <130/80 in high-risk patients.", body))
story.append(Paragraph(
"<b>Antiplatelet therapy:</b> Aspirin 75-100 mg for secondary prevention. Dual antiplatelet "
"(aspirin + clopidogrel/ticagrelor) after ACS or PCI.", body))
story.append(Paragraph(
"<b>Novel agents:</b> PCSK9 inhibitors (evolocumab, alirocumab) - reduce LDL by 50-60% on top of "
"statins; proven mortality benefit in high-risk patients. Inclisiran (siRNA-based PCSK9 silencer) "
"- twice-yearly injection.", body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════
# ESSAY 5: MYOCARDIAL INFARCTION
# ═══════════════════════════════════════════════════════════════════════════
story.append(Paragraph("5. Myocardial Infarction (MI)", essay_h))
story.append(Paragraph("Definition and Pathogenesis", h2))
story.append(Paragraph(
"Myocardial infarction (MI) is ischaemic necrosis of myocardium resulting from sustained reduction "
"or cessation of coronary artery blood flow. In >90% of cases it is caused by rupture or erosion of "
"an atherosclerotic plaque with superimposed thrombosis. The left anterior descending (LAD) coronary "
"artery is involved in ~50% of MIs (anterior and anteroseptal infarcts), the right coronary artery "
"(RCA) in ~30% (inferior/posterior), and the left circumflex (LCX) in ~20% (lateral/posterior).", body))
story.append(Paragraph(
"<b>Types by extent:</b> STEMI (transmural, full-thickness infarct with plaque occlusion); "
"NSTEMI (subendocardial or partial thickness, partial/dynamic occlusion or microvascular disease). "
"The subendocardium is most vulnerable to ischaemia due to highest wall stress and lowest perfusion pressure.", body))
story.append(Paragraph("Morphological Changes — Time Course", h2))
story.append(Paragraph(
"The evolution of MI morphology follows a precise time-dependent sequence that is highly testable "
"— Robbins, Cotran & Kumar, p. 514:", body))
mi_data = [
["Time", "Gross Features", "Light Microscopy", "Electron Microscopy"],
["0-0.5 hr\n(Reversible injury)", "None visible", "None (normal)", "Relaxation of myofibrils; glycogen loss; mitochondrial swelling"],
["0.5-4 hr\n(Irreversible begins)", "None visible", "None or variable waviness of fibres at infarct border", "Sarcolemmal disruption; mitochondrial amorphous (flocculent) densities"],
["4-12 hr", "Dark mottling (occasional)", "Early coagulative necrosis; cytoplasmic hypereosinophilia; oedema; early neutrophilic infiltrate; wavy fibres", ""],
["12-24 hr", "Dark mottling visible", "Ongoing coagulative necrosis; pyknosis of nuclei; myocyte hypereosinophilia; marginal contraction band necrosis (irreversible reperfusion injury); brisk neutrophilic infiltrate", ""],
["1-3 days", "Mottling; yellow-tan centre", "Coagulative necrosis with loss of nuclei and striations; dense interstitial infiltrate of neutrophils", ""],
["3-7 days", "Hyperaemic border; yellow-tan softening", "Disintegration of dead myofibres; dying neutrophils; early macrophage phagocytosis at infarct border; early granulation tissue at rim", ""],
["7-10 days", "Maximally yellow-tan and soft; depressed red-tan margins", "Well-developed phagocytosis by macrophages; granulation tissue at margins (new capillaries, fibroblasts)", ""],
["10-14 days", "Red-grey depressed borders", "Well-established granulation tissue with new blood vessels and early collagen", ""],
["2-8 weeks", "Grey-white scar forming, from border to core", "Increased collagen; decreased cellularity; scar formation progressing", ""],
[">2 months", "Dense white fibrous scar", "Dense collagenous scar; no residual cardiomyocytes", ""],
]
story.append(mk_table(mi_data, [3*cm, 4.5*cm, 6.5*cm, 3*cm]))
story.append(Spacer(1,6))
story.append(Paragraph(
"KEY POINT: The earliest detectable change on light microscopy is wavy fibres at 0.5-4 hours. "
"Neutrophilic infiltrate peaks at 1-3 days. Granulation tissue peaks at 7-10 days. Scar "
"complete at >2 months. Cardiac myocytes are terminally differentiated — they cannot regenerate.", callout))
story.append(Spacer(1,4))
story.append(Paragraph("Complications of MI", h2))
comp_mi_data = [
["Complication", "Timing", "Mechanism / Pathology", "Clinical Features"],
["Arrhythmias", "Immediate (0-24 hr)", "Ischaemia disrupts electrical conduction; most common cause of death pre-hospital", "VF, VT, heart block, AF"],
["Cardiogenic shock", "Hours to days", "Loss of >40% LV mass; severe pump failure", "Hypotension, oliguria, cold peripheries; high mortality"],
["Cardiac tamponade", "3-14 days (free wall rupture)", "Transmural necrosis + haemopericardium; sudden death", "Beck's triad: hypotension, JVD, muffled heart sounds"],
["Ventricular septal defect (VSD)", "3-7 days", "Septal infarction + rupture; LAD territory", "New harsh systolic murmur; step-up in O2 at RV"],
["Papillary muscle rupture", "3-7 days", "Posteromedial papillary (single blood supply from RCA/LCX); acute MR", "Acute pulmonary oedema; new MR murmur"],
["Ventricular aneurysm", "Weeks-months", "Transmural scar replaced by thin fibrous wall; paradoxical bulge", "Persistent ST elevation; mural thrombus; arrhythmia; HF"],
["Mural thrombus", "Days-weeks", "Endocardial damage + stasis + hypercoagulability (Virchow's triad)", "Systemic emboli (stroke, limb ischaemia)"],
["Dressler's syndrome", "2-10 weeks", "Autoimmune pericarditis to released cardiac antigens", "Fever, pleuritis, pericarditis; anti-heart antibodies"],
["Infarct extension", "Days", "Renewed ischaemia due to coronary spasm or thrombus propagation", "Recurrent chest pain; new ECG changes"],
]
story.append(mk_table(comp_mi_data, [4*cm, 2.5*cm, 5*cm, 5.5*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Diagnosis", h2))
story.append(Paragraph(
"<b>ECG:</b> STEMI — ST elevation ≥1 mm in ≥2 contiguous leads or new LBBB. "
"NSTEMI — ST depression and/or T-wave inversion. Q waves (>0.04 sec, >25% QRS) indicate "
"completed transmural infarction.", body))
story.append(Paragraph(
"<b>Cardiac biomarkers:</b> Troponin I/T (high-sensitivity cTnI, cTnT) — most sensitive and specific; "
"rises 3-6 hrs, peaks 12-24 hrs, normalises 7-14 days. CK-MB: rises 4-8 hrs, peaks 18-24 hrs, "
"normalises 3-4 days — useful for reinfarction detection (returns to baseline earlier).", body))
story.append(Paragraph(
"<b>Echocardiography:</b> Regional wall motion abnormalities; EF assessment; complications "
"(VSD, MR, pericardial effusion, thrombus).", body))
story.append(Paragraph("Management", h2))
story.append(Paragraph(
"<b>STEMI:</b> Primary PCI (percutaneous coronary intervention) within 90 minutes of first "
"medical contact is the gold standard. Fibrinolysis (tenecteplase, alteplase) if PCI not available "
"within 120 minutes. Antiplatelet: aspirin + ticagrelor/prasugrel (DAPT).", body))
story.append(Paragraph(
"<b>NSTEMI/UA:</b> Risk-stratify with GRACE/TIMI score. Early invasive strategy (coronary "
"angiography ± PCI within 24-72 hrs) for high-risk. Medical: aspirin + P2Y12 inhibitor + "
"anticoagulant (LMWH/fondaparinux).", body))
story.append(Paragraph(
"<b>Secondary prevention (all MI):</b> Aspirin lifelong; DAPT for 12 months; high-intensity "
"statin; ACE inhibitor (especially with reduced EF); beta-blocker; aldosterone antagonist "
"(eplerenone/spironolactone if EF <35% + HF/diabetes).", body))
story.append(PageBreak())
# ═══════════════════════════════════════════════════════════════════════════
# ESSAY 6: HEART FAILURE
# ═══════════════════════════════════════════════════════════════════════════
story.append(Paragraph("6. Heart Failure", essay_h))
story.append(Paragraph("Definition and Classification", h2))
story.append(Paragraph(
"Heart failure (HF) is a clinical syndrome in which the heart cannot pump sufficient blood to meet "
"the metabolic demands of the body, or can do so only at elevated filling pressures. It affects "
"~64 million people worldwide and has a 5-year mortality of ~50%.", body))
hf_class_data = [
["Classification", "Types", "Key Features"],
["By EF", "HFrEF (EF <40%) — 'Systolic HF'\nHFmrEF (EF 40-49%) — 'Mildly reduced'\nHFpEF (EF ≥50%) — 'Diastolic HF'",
"HFrEF: dilated, poorly contracting ventricle; responds to neurohormonal blockade. HFpEF: stiff, hypertrophied ventricle; normal systole but impaired relaxation"],
["By Side", "Left HF: pulmonary congestion\nRight HF: systemic venous congestion\nBiventricular HF: both", "Most chronic HF is biventricular"],
["NYHA Functional Class", "I: No symptoms at normal activity\nII: Slight limitation on exertion\nIII: Marked limitation; comfortable at rest\nIV: Symptoms at rest; unable to do any activity", "Used for functional severity assessment"],
]
story.append(mk_table(hf_class_data, [4.5*cm, 6.5*cm, 6*cm]))
story.append(Spacer(1,6))
story.append(Paragraph("Aetiology", h2))
for txt in [
"<b>Left HF causes:</b> Ischaemic heart disease (most common, ~65%), hypertension (pressure overload → LVH → diastolic dysfunction), dilated cardiomyopathy (DCM), valvular disease (AS/AR/MR), myocarditis.",
"<b>Right HF causes:</b> Left HF (most common cause of right HF), cor pulmonale (secondary to COPD, pulmonary hypertension, pulmonary embolism), RV infarction, tricuspid/pulmonary valve disease.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Pathophysiology and Compensatory Mechanisms", h2))
story.append(Paragraph(
"When cardiac output falls, compensatory mechanisms activate to maintain perfusion:", body))
for txt in [
"<b>Frank-Starling mechanism:</b> Increased EDV (preload) stretches myocytes → increased force of contraction. Initially compensatory; leads to dilation.",
"<b>Neurohormonal activation (RAAS + SNS):</b> Reduced renal perfusion activates renin-angiotensin-aldosterone system → sodium and water retention → increased preload. Sympathetic activation → tachycardia, vasoconstriction, increased afterload. Chronic neurohormonal activation is harmful — drives adverse cardiac remodelling.",
"<b>Ventricular remodelling:</b> Eccentric hypertrophy (volume overload: LV dilates with sarcomere series addition) or concentric hypertrophy (pressure overload: LV wall thickens with sarcomere parallel addition → impaired relaxation → diastolic dysfunction). Progressive dilation leads to HFrEF.",
"<b>Natriuretic peptides (BNP/NT-proBNP):</b> Released by ventricular myocytes under wall stress → natriuresis, vasodilation, RAAS suppression. Elevated BNP/NT-proBNP is the best biomarker for diagnosing and monitoring HF severity.",
]:
story.append(Paragraph("• " + txt, bul))
story.append(Spacer(1,4))
story.append(Paragraph("Pathological Changes — Organ by Organ", h2))
story.append(Paragraph("Left Heart Failure", h3))
story.append(Paragraph(
"<b>Heart:</b> LV hypertrophy and/or dilation depending on aetiology. In pressure overload (hypertension, "
"AS): concentric LVH — thick walls, small cavity, heavy heart. In volume overload or post-MI: "
"eccentric hypertrophy/dilation — thin walls, large cavity.", body))
story.append(Paragraph(
"<b>Lungs:</b> Left heart failure raises pulmonary venous pressure → pulmonary congestion. "
"Gross: lungs heavy, wet, boggy, reddish-brown. "
"Light Microscopy (Acute): alveolar oedema — pink proteinaceous fluid in alveoli; perivascular oedema. "
"Light Microscopy (Chronic): 'Brown Induration of the Lung' — intraalveolar haemosiderin-laden macrophages "
"('heart failure cells') from phagocytosed extravasated RBCs; alveolar septal thickening and fibrosis. "
"Prussian blue stain confirms haemosiderin. Chronic oedema → secondary pulmonary hypertension → "
"right heart failure (cor pulmonale).", body))
story.append(Paragraph("Right Heart Failure", h3))
story.append(Paragraph(
"<b>Heart:</b> RV hypertrophy and dilation. Tricuspid annular dilation causing functional TR.", body))
story.append(Paragraph(
"<b>Liver — 'Nutmeg Liver':</b> Raised hepatic venous pressure → hepatic congestion. "
"Gross: 'nutmeg liver' — congested red-brown pericentral zones alternating with paler tan periportal "
"parenchyma, producing a mottled nutmeg pattern on the cut surface — Robbins, Cotran & Kumar, p. 501. "
"Light Microscopy: centrilobular (zone 3) sinusoidal congestion and hepatocyte necrosis/atrophy; "
"periportal hepatocytes relatively preserved. "
"Chronic: centrilobular fibrosis → 'cardiac sclerosis' → may progress to cardiac cirrhosis (bridging fibrosis + "
"regenerative nodules, but without the features of portal hypertension from intrinsic liver disease).", body))
story.append(Paragraph(
"<b>Spleen:</b> Congestive splenomegaly — enlarged firm spleen due to portal/splenic venous hypertension; "
"risk of hypersplenism (cytopenias from splenic sequestration).", body))
story.append(Paragraph(
"<b>Kidneys:</b> Renal congestion + reduced cardiac output → reduced GFR; sodium and water retention; "
"pre-renal uraemia; cardiorenal syndrome.", body))
story.append(Paragraph(
"<b>Subcutaneous tissues:</b> Peripheral pitting oedema (ankle/foot in ambulatory patients; sacral in "
"bedridden). Severe generalised oedema = anasarca.", body))
story.append(Paragraph(
"<b>Serosal spaces:</b> Pleural, pericardial, and peritoneal effusions (ascites) from raised venous "
"pressure. Large pleural effusions → atelectasis and dyspnoea. Massive ascites → restricted "
"diaphragmatic excursion.", body))
story.append(Paragraph("Diagnosis", h2))
story.append(Paragraph(
"<b>Clinical:</b> Dyspnoea, orthopnoea, PND, ankle oedema, fatigue, signs of low output. "
"Examination: raised JVP, S3 gallop, bilateral basal crackles, hepatomegaly, peripheral oedema.", body))
story.append(Paragraph(
"<b>BNP/NT-proBNP:</b> BNP >400 pg/mL or NT-proBNP >900 pg/mL (age-dependent) strongly supports HF. "
"Low BNP (<100 pg/mL) has high NPV to exclude HF.", body))
story.append(Paragraph(
"<b>Echocardiography:</b> Confirms diagnosis; measures EF; wall motion; valvular disease; filling "
"pressures (E/e' ratio for diastolic dysfunction). Essential for HFrEF vs HFpEF classification.", body))
story.append(Paragraph(
"<b>CXR:</b> Cardiomegaly; Kerley B lines (interstitial oedema); pulmonary vascular upper lobe diversion; "
"bilateral basal opacities; pleural effusions ('bat-wing' pulmonary oedema in severe acute LVF).", body))
story.append(Paragraph("Management", h2))
hf_tx_data = [
["Drug Class", "Examples", "Evidence / Indication"],
["ACE inhibitors / ARBs", "Ramipril, enalapril; losartan, candesartan", "Reduce morbidity/mortality in HFrEF; reduce preload + afterload; inhibit adverse remodelling"],
["ARNI (Angiotensin Receptor-Neprilysin Inhibitor)", "Sacubitril-valsartan (Entresto)", "Superior to enalapril in reducing HF mortality (PARADIGM-HF); now preferred over ACEi in HFrEF"],
["Beta-blockers", "Carvedilol, bisoprolol, metoprolol succinate", "Reduce mortality in stable HFrEF; counter SNS activation; anti-arrhythmic; reverse remodelling"],
["MRA (Mineralocorticoid Receptor Antagonist)", "Spironolactone, eplerenone", "Reduce mortality in HFrEF EF <35% (RALES, EMPHASIS-HF); anti-fibrotic; potassium-sparing"],
["SGLT2 inhibitors", "Dapagliflozin, empagliflozin", "Reduce HF hospitalisation and CV death in both HFrEF and HFpEF (DAPA-HF, EMPEROR trials); osmotic diuresis + cardioprotective effects"],
["Loop diuretics", "Furosemide, torasemide", "Symptom relief: reduce fluid overload; no mortality benefit"],
["Ivabradine", "Ivabradine", "Reduces HR via If current inhibition; reduces HF hospitalisation in HR >70 bpm on beta-blocker"],
["Device therapy", "ICD (EF <35%); CRT (EF <35% + LBBB + QRS >150 ms)", "ICD prevents sudden cardiac death; CRT improves synchrony, EF, and symptoms"],
["Advanced therapy", "LVAD; heart transplantation", "For Stage D (refractory) HF; LVAD as bridge or destination therapy"],
]
story.append(mk_table(hf_tx_data, [4.5*cm, 4.5*cm, 8*cm]))
story.append(Spacer(1,8))
# Footer
story.append(HRFlowable(width="100%", thickness=0.5, color=BLUE, spaceAfter=6))
story.append(Paragraph(
"Sources: Robbins, Cotran & Kumar — Pathologic Basis of Disease (2023) pp. 472, 501, 514, 662, 674 | "
"Robbins & Kumar Basic Pathology | Harrison's Principles of Internal Medicine 22E (2025) | "
"Janeway's Immunobiology 10e | Comprehensive Clinical Nephrology 7e",
src))
doc.build(story)
print(f"PDF saved: {output_path}")
python /tmp/workspace/medical-essays/generate_patho2.py
Pathology Essays TB Pneumonia LungCancer Atherosclerosis MI HeartFailure
PDF Document · PDF