Covid 19 2nd yr mbbs microbiology refer apurba sastri cover definition morphology diagram of virus clinical manifestation virulence factor,pathogenesis symptoms suppurative complications, non suppurative complications, lab diagnosis treatment answer in details

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

COVID-19 (SARS-CoV-2) - Comprehensive 2nd MBBS Microbiology Notes

Sources: Sherris & Ryan's Medical Microbiology 8e | Goldman-Cecil Medicine | Robbins Pathology (Aligned with Apurba Sastri Microbiology syllabus topics)

1. DEFINITION

COVID-19 (Coronavirus Disease-2019) is an acute infectious disease caused by SARS-CoV-2 (Severe Acute Respiratory Syndrome Coronavirus-2), a novel beta-coronavirus that emerged in Wuhan, Hubei Province, China in December 2019. It was declared a global pandemic by the WHO on March 11, 2020. The disease primarily causes respiratory illness ranging from mild flu-like symptoms to severe pneumonia, acute respiratory distress syndrome (ARDS), and multi-organ failure.
  • As of October 2023: 770 million confirmed cases and 6.9 million reported deaths worldwide
  • The actual death toll is believed to be much higher due to underreporting

2. MORPHOLOGY OF SARS-CoV-2

Diagram

SARS-CoV-2 / Coronavirus virion structure showing Spike glycoprotein, Hemagglutinin-acetylesterase glycoprotein, Membrane glycoprotein, Small envelope glycoprotein, Nucleocapsid phosphoprotein, and RNA genome
Figure: Virion structure of a Coronavirus. The particle contains a single-stranded positive-sense RNA genome bound to a nucleoprotein (helical nucleocapsid) surrounded by a lipid bilayer envelope. Petal- or club-shaped spikes (Spike glycoprotein) project from the surface giving the appearance of a crown of thorns or solar corona. - Sherris & Ryan's Medical Microbiology 8e, p.357

Key Structural Features

FeatureDetail
FamilyCoronaviridae
GenusBetacoronavirus
TypeEnveloped, positive-sense single-stranded RNA virus
Size80-160 nm (large RNA virus)
GenomeLargest RNA genome among viruses (~30 kb)
CapsidHelical nucleocapsid
ReplicationIn the cytoplasm using RNA-dependent RNA polymerase (RdRp); acquires envelope from ER-Golgi membranes

Surface Proteins (4 major structural proteins)

  1. Spike (S) Glycoprotein - Club-shaped/petal projections; binds ACE2 receptor; responsible for the "crown" appearance (corona = crown in Latin); divided into S1 (receptor binding domain, RBD) and S2 (fusion domain)
  2. Membrane (M) Glycoprotein - Most abundant; maintains structural integrity of the envelope
  3. Envelope (E) Glycoprotein / Small Envelope Glycoprotein - Ion channel activity; involved in viral assembly and budding
  4. Nucleocapsid (N) Phosphoprotein - Binds RNA genome; forms helical nucleocapsid; important diagnostic antigen
Hemagglutinin-acetylesterase (HE) glycoprotein - Present in some coronaviruses; aids attachment

3. CLASSIFICATION OF HUMAN CORONAVIRUSES

TypeDisease
HuCoV-229E, NL63Common cold (Alpha-CoV)
HuCoV-OC43, HKU1Common cold (Beta-CoV)
SARS-CoV-1Severe Acute Respiratory Syndrome (2002-03), ~10% fatality
MERS-CoVMiddle East Respiratory Syndrome (2012), ~30-40% fatality
SARS-CoV-2COVID-19 pandemic

4. VIRULENCE FACTORS

The virulence of SARS-CoV-2 is attributed to several molecular mechanisms:
1. Spike (S) Glycoprotein - Receptor Binding Domain (RBD)
  • Binds ACE2 (Angiotensin Converting Enzyme 2) receptors with ~10x higher affinity than SARS-CoV-1
  • ACE2 is expressed on lung alveolar epithelium, heart, kidney, intestine, vascular endothelium - explaining multi-organ tropism
  • The D614G mutation in RBD increases binding affinity to ACE2, raising infectivity and transmissibility
2. TMPRSS2 (Transmembrane Protease Serine 2)
  • Host protease that cleaves S1/S2 junction, enabling viral membrane fusion and entry at the plasma membrane
  • Cathepsin L (endosomal pathway) also facilitates entry
3. Large RNA Genome with Proofreading
  • Exonuclease activity (ExoN protein) provides proofreading function - controls mutation rate but allows selective evolution
  • Leads to emergence of variants of concern (Alpha, Beta, Delta, Omicron)
4. IFN Antagonism
  • Nonstructural proteins of SARS-CoV-2 antagonize Type I Interferon (IFN-I α/β) genes
  • In severe COVID-19, very little IFN-1 is found in serum, yet very high levels of pro-inflammatory cytokines are present
  • This innate immune evasion allows unchecked viral replication
5. Asymptomatic Transmission
  • ~20-40% of infections are asymptomatic, yet infectious - a major virulence-related epidemiological factor
  • Peak viral shedding occurs at or shortly before symptom onset (unlike SARS-CoV-1 where peak shedding was after symptoms)
6. Cytokine Storm Induction
  • Dysregulated immune response with massive release of IL-1β, IL-6, IL-8, TNF-α, CCL2, MIP1-α
  • Leads to immunopathological lung injury, vascular permeability, and disseminated intravascular coagulation (DIC)
7. Variants of Concern
VariantOriginKey MutationEffect
Alpha (B.1.1.7)UKN501Y, D614G, P681HIncreased transmissibility
Beta (B.1.351)South AfricaK417N, E484K, N501YImmune evasion
Gamma (P.1)BrazilSimilar to BetaIncreased transmissibility
Delta (B.1.617.2)IndiaL452R, P681RHigher transmissibility, increased severity
Omicron (B.1.1.529)South Africa>30 spike mutationsHighest transmissibility, reduced severity

5. PATHOGENESIS

Step-by-Step Mechanism

Step 1 - Entry into Host (Upper Respiratory Tract)
  • SARS-CoV-2 enters via respiratory route; initial targets are nasopharyngeal and oropharyngeal cells
  • Spike S1 RBD binds ACE2 on ciliated epithelial cells
  • TMPRSS2 cleaves S1/S2 junction → S2 mediates viral-cell membrane fusion → endosomal uptake
  • Viral RNA released into cytoplasm
Step 2 - Viral Replication
  • Positive-sense RNA acts directly as mRNA
  • Translated into polyprotein → cleaved by host and viral proteases into:
    • RdRp (RNA-dependent RNA polymerase) - directs genomic RNA synthesis
    • Nonstructural proteins including ExoN (proofreading)
    • Structural proteins: Spike, Envelope, Membrane, Nucleocapsid
  • Viral assembly occurs in cytoplasm; budding from ER-Golgi membranes
Step 3 - Spread to Lower Respiratory Tract
  • After upper respiratory tract replication, virus migrates to airways and alveolar epithelial cells (type I and II pneumocytes)
  • Also infects vascular endothelial cells and alveolar macrophages
  • Viral RNA peaks in upper respiratory tract during early symptomatic phase, then declines within 7 days
Step 4 - Innate Immune Evasion and Early Cytokine Response
  • SARS-CoV-2 nonstructural proteins block IFN-I production (immune evasion)
  • This allows unchecked viral replication
  • Proinflammatory cytokines (IL-6, IL-1β, TNF-α) are simultaneously upregulated
Step 5 - Immunopathology (in severe disease)
  • Activation of T lymphocytes, monocytes, neutrophils → apoptosis of infected cells
  • Cytokine storm: massive release of IL-1β, IL-6, IL-8, TNF-α
  • Pulmonary endothelial injury → vascular leakage, tissue edema
  • Diffuse alveolar damage (DAD): hyaline membrane formation, alveolar flooding with exudates
  • Microangiopathy, microthrombosis, and aberrant vascular angiogenesis in lungs
  • Lymphocytic myocarditis and pericarditis may occur
  • Recruitment of inflammatory mononuclear cells in lung, heart, kidney, liver
  • Elevated D-dimer and prolonged prothrombin time (DIC pathway)
  • In late stage: ARDS (Acute Respiratory Distress Syndrome)
Step 6 - Extrapulmonary Spread
  • ACE2 is expressed in enterocytes, cholangiocytes, myocardial cells, kidney cells, bladder urothelial cells
  • Direct viral invasion causes gastrointestinal, cardiac, renal, and neurological manifestations
  • Anosmia/ageusia - consequence of viral replication in sustentacular cells of olfactory mucosa

6. TRANSMISSION

RouteDetails
PrimaryRespiratory droplets (coughing, sneezing, speaking within 6 feet/2 meters)
AirborneAerosol/droplet nuclei in poorly ventilated enclosed spaces (up to >100 feet)
Fomite/ContactLess significant; hand-to-face transfer from contaminated surfaces
Fecal-oralMinimal role
Stability on surfaces: 2-4 hours (aerosol) | 72 hours (plastic) | 48 hours (steel) | 24 hours (cardboard) | 8 hours (copper)
Incubation period: 2-14 days (average 5 days)

7. CLINICAL MANIFESTATIONS & SYMPTOMS

Classification of Severity

SeverityDescription% of Cases (unvaccinated)
AsymptomaticNo symptoms; still contagious~40%
MildSymptoms present, no hypoxia (SpO2 >94%), no pneumonia~40%
ModerateLower respiratory tract disease on imaging, no hypoxia~15%
SevereSpO2 <94%, respiratory rate >30, bilateral infiltrates~15%
CriticalRespiratory failure, shock, multi-organ dysfunction~5%

Common Symptoms (in order of frequency)

Typical triad: Fever + Dry cough + Fatigue
Full symptom spectrum:
  • Fever (most common)
  • Dry cough
  • Anosmia (loss of smell) - distinctive feature
  • Ageusia (loss of taste) - distinctive feature
  • Fatigue / Myalgia
  • Headache
  • Sore throat
  • Nasal congestion / Rhinorrhea
  • Shortness of breath / Dyspnea
  • Chest pain or tightness
  • Nausea, Vomiting, Diarrhea (GI symptoms more prominent with Omicron)

Severe/Critical Symptoms (warning signs)

  • Severe shortness of breath / Dyspnea at rest
  • Persistent chest pain/pressure
  • Confusion / altered mental status
  • Bluish lips or face (cyanosis)
  • Oxygen saturation <90%

Risk Factors for Severe Disease

Older age (>65 years), obesity, cardiovascular disease, diabetes, hypertension, chronic lung disease, cancer, chronic kidney disease, immunocompromised states, sickle cell disease

8. COMPLICATIONS

8A. SUPPURATIVE COMPLICATIONS (Direct/Infectious)

These are complications primarily from direct viral infection, bacterial superinfection, or secondary bacterial pneumonia:
ComplicationDetails
Bacterial SuperinfectionSecondary bacterial pneumonia (Staph. aureus, Strep. pneumoniae, Klebsiella) in hospitalized/ventilated patients
Ventilator-Associated Pneumonia (VAP)In ICU patients requiring mechanical ventilation
Septic ShockSevere sepsis from bacterial superinfection leading to multiorgan failure
Lung AbscessRare; from bacterial superinfection

8B. NON-SUPPURATIVE / IMMUNE-MEDIATED COMPLICATIONS

These are complications from dysregulated immune response, cytokine storm, or post-infectious mechanisms:
Pulmonary:
  • ARDS (Acute Respiratory Distress Syndrome) - diffuse alveolar damage, hyaline membranes, respiratory failure (most severe complication)
  • Pulmonary fibrosis (post-COVID)
  • Pulmonary embolism / Venous thromboembolism (due to hypercoagulable state)
Cardiovascular:
  • Lymphocytic Myocarditis and Pericarditis - direct viral invasion + immune-mediated
  • Microvascular thrombosis and microangiopathy
  • Arrhythmias
  • Heart failure
Hematological:
  • Disseminated Intravascular Coagulation (DIC) - elevated D-dimer, prolonged PT
  • Microthrombosis throughout organs
Neurological:
  • Guillain-Barré Syndrome (GBS) - post-infectious, immune-mediated polyneuropathy
  • Acute flaccid myelitis
  • Encephalopathy / Delirium
  • Cerebral venous sinus thrombosis
  • Anosmia (persistent)
  • Stroke (from hypercoagulable state)
Pediatric - Special:
  • MIS-C (Multisystem Inflammatory Syndrome in Children) - post-COVID immune-mediated syndrome
    • Myocarditis, shock
    • Features similar to Kawasaki disease, including coronary artery aneurysms
    • Fever + involvement of 2+ organ systems + elevated inflammatory markers
Renal:
  • Acute Kidney Injury (AKI) - direct ACE2-mediated viral injury + cytokine storm
Long COVID / PASC (Post-Acute Sequelae of SARS-CoV-2 Infection):
  • Fatigue, body aches, shortness of breath, brain fog (difficulty concentrating), headache, difficulty sleeping
  • Lasting weeks to months after acute illness
  • Also called "Long Haulers"
  • Possible chronic lung, heart, kidney, brain damage

9. LABORATORY DIAGNOSIS

A. Direct/Virological Tests

1. RT-PCR (Reverse Transcriptase PCR) - GOLD STANDARD
  • Detects SARS-CoV-2 viral RNA from nasopharyngeal or oropharyngeal swabs
  • Highly sensitive and specific
  • Nucleic Acid Amplification Test (NAAT)
  • Test of choice for diagnosis of current infection
2. Rapid Antigen Detection Test (RAT)
  • Detects viral antigen (mainly Nucleocapsid protein N) using nasal swab
  • Faster (15-30 minutes), less sensitive than RT-PCR
  • Positive results: reliable; Negative results: may need confirmation by RT-PCR
  • Widely used for mass screening
3. BioFire Respiratory Panel 2.1 (RP2.1)
  • Nucleic acid-based multiplex panel
  • Detects 15 viral + 4 bacterial respiratory pathogens simultaneously
  • Includes common cold coronaviruses AND SARS-CoV-2
  • Emergency Use Authorization (EUA) from FDA

B. Serological Tests

4. Antibody Tests (IgM/IgG against SARS-CoV-2)
  • Detects past infection / immune status
  • NOT recommended for diagnosing current infection (appears 1-3 weeks after infection)
  • Used for epidemiological surveillance

C. Other Supportive Laboratory Findings in Severe COVID-19

TestFinding in Severe COVID-19
CBCLymphopenia (reduced CD4+/CD8+ T cells), neutrophilia
D-dimerMarkedly elevated (DIC/thrombosis)
CRP, Ferritin, IL-6Elevated (cytokine storm markers)
ProcalcitoninMay be elevated (bacterial superinfection)
LDHElevated (tissue damage)
Liver enzymes (AST/ALT)May be mildly elevated
TroponinElevated in myocarditis
Prothrombin time (PT)Prolonged (DIC)
Chest X-ray / CTBilateral ground-glass opacities; consolidations
Pulse oximetrySpO2 <90% in severe disease

D. Wastewater Surveillance

  • SARS-CoV-2 is shed in stool; monitoring wastewater can track community prevalence

10. TREATMENT

A. Antiviral Therapy

DrugMechanismUse
RemdesivirRdRp inhibitor (blocks viral RNA synthesis)Hospitalized patients requiring oxygen; given IV for 5 days
Nirmatrelvir/ritonavir (Paxlovid)Viral protease inhibitorHigh-risk outpatients within 5 days of symptoms
MolnupiravirViral mutagenic agent (RdRp)Alternative for high-risk outpatients

B. Anti-inflammatory/Immunomodulatory

DrugMechanismUse
DexamethasoneCorticosteroid - reduces cytokine stormHospitalized patients requiring supplemental oxygen or ventilation (6 mg/day x 10 days)
Baricitinib / TocilizumabJAK inhibitor / Anti-IL-6 receptorSevere/critical disease with cytokine storm

C. Monoclonal Antibodies

DrugTargetUse
BamlanivimabSARS-CoV-2 Spike glycoproteinHigh-risk patients, early disease (FDA EUA)
Casirivimab + Imdevimab (REGEN-COV)Spike glycoprotein (cocktail)High-risk patients (prevents progression to severe disease)
Note: Efficacy of monoclonal antibodies varies by variant; many earlier monoclonals have reduced activity against Omicron subvariants.

D. Supportive Care (Severe/Critical Disease)

  • Supplemental oxygen (low-flow → high-flow → non-invasive ventilation)
  • Prone positioning - improves oxygenation in ARDS
  • Mechanical ventilation / Intubation for respiratory failure
  • ICU care for hemodynamic monitoring
  • Anticoagulation (prophylactic/therapeutic heparin) for thrombosis prevention
  • Vasopressors for septic shock

E. Prevention

MeasureDetails
VaccinationmRNA vaccines (Pfizer-BioNTech, Moderna) - encode Spike glycoprotein; Viral vector vaccine (J&J Ad26) - single dose; Highly efficacious against severe disease and death
MaskingWell-fitted masks (N95 > surgical > cloth)
Social distancingMinimum 6 feet / 2 meters from others
Hand hygieneSoap and water or hand sanitizer with ≥60% alcohol
VentilationAvoid poorly ventilated, crowded indoor spaces
DisinfectionFrequent disinfection of high-touch surfaces

Quick Summary Table (Exam Memory Aid)

FeatureKey Point
AgentSARS-CoV-2 (Beta-coronavirus)
GenomePositive-sense ssRNA, largest RNA genome
Size80-160 nm
Key receptorACE2 (+ TMPRSS2 co-factor)
Incubation2-14 days (average 5 days)
Cardinal symptomsFever, dry cough, anosmia, ageusia
Gold standard diagnosisRT-PCR (nasopharyngeal swab)
Key antiviralRemdesivir + Dexamethasone
Worst complicationARDS / DIC / Cytokine storm
Pediatric complicationMIS-C (Kawasaki-like)
Post-infectious complicationGuillain-Barré Syndrome (GBS)
Long-term sequelaePASC / Long COVID

Sources: Sherris & Ryan's Medical Microbiology 8e (pp. 355-368) | Goldman-Cecil Medicine 27e (Ch. 336) | Robbins & Cotran Pathologic Basis of Disease 10e | Harrison's Principles of Internal Medicine 22e

Generate a study guide PDF for MBBS exams on this topic

Reading File
Running Command

ls -la /home/daytona/workspace/ 2>/dev/null || echo "workspace doesn't exist"

Running Command

mkdir -p /home/daytona/workspace/covid19-study-guide && python3 -c "import repor…

Writing File

~/covid19-study-guide/generate_pdf.py

#!/usr/bin/env python3
"""
COVID-19 MBBS Study Guide PDF Generator
Uses ReportLab for a professional, exam-ready study guide.
"""

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm, mm
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.platypus.flowables import HRFlowable
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os

OUTPUT_PATH = "/home/daytona/workspace/covid19-study-guide/COVID19_MBBS_Study_Guide.pdf"

# ── Colour palette ─────────────────────────────────────────────────────────────
DEEP_BLUE   = colors.HexColor("#1a3a5c")
MID_BLUE    = colors.HexColor("#2563A8")
ACCENT_TEAL = colors.HexColor("#0e7490")
LIGHT_BLUE  = colors.HexColor("#dbeafe")
LIGHT_TEAL  = colors.HexColor("#e0f7fa")
YELLOW_HL   = colors.HexColor("#fef9c3")
RED_WARN    = colors.HexColor("#dc2626")
RED_LIGHT   = colors.HexColor("#fee2e2")
GREEN_OK    = colors.HexColor("#166534")
GREEN_LIGHT = colors.HexColor("#dcfce7")
ORANGE      = colors.HexColor("#ea580c")
ORANGE_LIGHT= colors.HexColor("#fff7ed")
GREY_BG     = colors.HexColor("#f1f5f9")
DARK_TEXT   = colors.HexColor("#1e293b")
WHITE       = colors.white
TABLE_HEADER= colors.HexColor("#1e40af")

# ── Page template ──────────────────────────────────────────────────────────────
def add_page_number(canvas, doc):
    canvas.saveState()
    # Header bar
    canvas.setFillColor(DEEP_BLUE)
    canvas.rect(0, A4[1] - 1.4*cm, A4[0], 1.4*cm, fill=1, stroke=0)
    canvas.setFillColor(WHITE)
    canvas.setFont("Helvetica-Bold", 9)
    canvas.drawString(1*cm, A4[1] - 0.9*cm, "COVID-19 (SARS-CoV-2)")
    canvas.drawRightString(A4[0] - 1*cm, A4[1] - 0.9*cm, "2nd MBBS Microbiology | Exam Study Guide")
    # Footer bar
    canvas.setFillColor(DEEP_BLUE)
    canvas.rect(0, 0, A4[0], 1.0*cm, fill=1, stroke=0)
    canvas.setFillColor(WHITE)
    canvas.setFont("Helvetica", 8)
    canvas.drawString(1*cm, 0.35*cm, "Based on Apurba Sastri Microbiology | Sherris & Ryan | Goldman-Cecil")
    canvas.drawRightString(A4[0] - 1*cm, 0.35*cm, f"Page {doc.page}")
    canvas.restoreState()

# ── Style definitions ──────────────────────────────────────────────────────────
styles = getSampleStyleSheet()

def S(name, **kw):
    return ParagraphStyle(name, **kw)

COVER_TITLE = S("CoverTitle",
    fontSize=32, textColor=WHITE, fontName="Helvetica-Bold",
    alignment=TA_CENTER, spaceAfter=6, leading=38)

COVER_SUBTITLE = S("CoverSub",
    fontSize=16, textColor=colors.HexColor("#bfdbfe"),
    fontName="Helvetica", alignment=TA_CENTER, spaceAfter=4)

COVER_DETAIL = S("CoverDetail",
    fontSize=12, textColor=colors.HexColor("#e0f2fe"),
    fontName="Helvetica", alignment=TA_CENTER, spaceAfter=3)

H1 = S("H1",
    fontSize=16, textColor=WHITE, fontName="Helvetica-Bold",
    alignment=TA_LEFT, spaceAfter=2, leading=20,
    backColor=MID_BLUE, leftIndent=-0.5*cm, borderPad=6)

H2 = S("H2",
    fontSize=13, textColor=DEEP_BLUE, fontName="Helvetica-Bold",
    spaceBefore=10, spaceAfter=4, borderPadding=(0, 0, 2, 0))

H3 = S("H3",
    fontSize=11, textColor=ACCENT_TEAL, fontName="Helvetica-Bold",
    spaceBefore=6, spaceAfter=3)

BODY = S("Body",
    fontSize=9.5, textColor=DARK_TEXT, fontName="Helvetica",
    leading=14, spaceAfter=4, alignment=TA_JUSTIFY)

BULLET = S("Bullet",
    fontSize=9.5, textColor=DARK_TEXT, fontName="Helvetica",
    leading=13, spaceAfter=2, leftIndent=14, bulletIndent=0,
    bulletText="•")

SUBBULLET = S("SubBullet",
    fontSize=9, textColor=DARK_TEXT, fontName="Helvetica",
    leading=12, spaceAfter=1, leftIndent=28, bulletIndent=14,
    bulletText="–")

BOLD_BODY = S("BoldBody",
    fontSize=9.5, textColor=DARK_TEXT, fontName="Helvetica-Bold",
    leading=14, spaceAfter=2)

EXAM_TIP = S("ExamTip",
    fontSize=9, textColor=colors.HexColor("#7c2d12"),
    fontName="Helvetica-BoldOblique",
    backColor=ORANGE_LIGHT, leftIndent=8, rightIndent=8,
    borderPad=5, spaceBefore=4, spaceAfter=4, leading=13)

WARN = S("Warn",
    fontSize=9, textColor=RED_WARN, fontName="Helvetica-Bold",
    backColor=RED_LIGHT, leftIndent=8, rightIndent=8,
    borderPad=4, spaceBefore=3, spaceAfter=3, leading=13)

MNEMONIC = S("Mnemonic",
    fontSize=10, textColor=GREEN_OK, fontName="Helvetica-Bold",
    backColor=GREEN_LIGHT, leftIndent=8, rightIndent=8,
    borderPad=6, spaceBefore=4, spaceAfter=4, leading=15, alignment=TA_CENTER)

NOTE = S("Note",
    fontSize=8.5, textColor=colors.HexColor("#374151"),
    fontName="Helvetica-Oblique", leading=12, spaceAfter=3,
    leftIndent=10)

# ── Helper: section header ──────────────────────────────────────────────────────
def section_header(num, title, color=MID_BLUE):
    tbl = Table(
        [[f"  {num}. {title}  "]],
        colWidths=[17.6*cm]
    )
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("TEXTCOLOR",  (0,0), (-1,-1), WHITE),
        ("FONTNAME",   (0,0), (-1,-1), "Helvetica-Bold"),
        ("FONTSIZE",   (0,0), (-1,-1), 13),
        ("TOPPADDING", (0,0), (-1,-1), 7),
        ("BOTTOMPADDING",(0,0),(-1,-1), 7),
        ("LEFTPADDING", (0,0), (-1,-1), 8),
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [color]),
    ]))
    return tbl

def sub_header(title, color=ACCENT_TEAL):
    tbl = Table([[f"  {title}  "]], colWidths=[17.6*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("TEXTCOLOR",  (0,0), (-1,-1), WHITE),
        ("FONTNAME",   (0,0), (-1,-1), "Helvetica-Bold"),
        ("FONTSIZE",   (0,0), (-1,-1), 11),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING",(0,0),(-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 8),
    ]))
    return tbl

def make_table(headers, rows, col_widths=None, header_color=TABLE_HEADER, alt_color=LIGHT_BLUE):
    data = [headers] + rows
    tbl = Table(data, colWidths=col_widths)
    style = [
        ("BACKGROUND",   (0,0), (-1,0), header_color),
        ("TEXTCOLOR",    (0,0), (-1,0), WHITE),
        ("FONTNAME",     (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",     (0,0), (-1,-1), 8.5),
        ("FONTNAME",     (0,1), (-1,-1), "Helvetica"),
        ("GRID",         (0,0), (-1,-1), 0.4, colors.HexColor("#cbd5e1")),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("LEFTPADDING",  (0,0), (-1,-1), 5),
        ("VALIGN",       (0,0), (-1,-1), "MIDDLE"),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, alt_color]),
    ]
    tbl.setStyle(TableStyle(style))
    return tbl

def box_table(content_rows, bg=LIGHT_BLUE, border=MID_BLUE):
    tbl = Table(content_rows, colWidths=[17.6*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), bg),
        ("BOX",          (0,0), (-1,-1), 1.2, border),
        ("TOPPADDING",   (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
        ("LEFTPADDING",  (0,0), (-1,-1), 10),
        ("FONTNAME",     (0,0), (-1,-1), "Helvetica"),
        ("FONTSIZE",     (0,0), (-1,-1), 9),
    ]))
    return tbl

def hr(color=MID_BLUE, thickness=0.8):
    return HRFlowable(width="100%", thickness=thickness, color=color, spaceAfter=4, spaceBefore=4)

def sp(h=0.2):
    return Spacer(1, h*cm)

def P(text, style=BODY):
    return Paragraph(text, style)

def B(text):
    return Paragraph(text, BULLET)

def SB(text):
    return Paragraph(text, SUBBULLET)

# ═══════════════════════════════════════════════════════════════════════════════
# BUILD DOCUMENT
# ═══════════════════════════════════════════════════════════════════════════════
def build():
    doc = SimpleDocTemplate(
        OUTPUT_PATH,
        pagesize=A4,
        topMargin=1.8*cm,
        bottomMargin=1.4*cm,
        leftMargin=1.5*cm,
        rightMargin=1.5*cm,
        title="COVID-19 MBBS Study Guide",
        author="Orris AI | Medical Education",
    )

    story = []

    # ──────────────────────────────────────────────────────────────────────────
    # COVER PAGE
    # ──────────────────────────────────────────────────────────────────────────
    # Blue gradient cover block via table
    cover_data = [
        [Paragraph("COVID-19", S("ct", fontSize=42, textColor=WHITE,
            fontName="Helvetica-Bold", alignment=TA_CENTER, leading=48))],
        [Paragraph("SARS-CoV-2", S("cs", fontSize=22, textColor=colors.HexColor("#93c5fd"),
            fontName="Helvetica-Bold", alignment=TA_CENTER))],
        [Spacer(1, 0.3*cm)],
        [Paragraph("Comprehensive MBBS Exam Study Guide", S("x1", fontSize=16,
            textColor=colors.HexColor("#e0f2fe"), fontName="Helvetica",
            alignment=TA_CENTER))],
        [Paragraph("2nd Year | Microbiology", S("x2", fontSize=13,
            textColor=colors.HexColor("#bfdbfe"), fontName="Helvetica",
            alignment=TA_CENTER))],
        [Spacer(1, 0.5*cm)],
        [Paragraph("Definition · Morphology · Virulence Factors · Pathogenesis<br/>"
                   "Clinical Manifestations · Complications · Lab Diagnosis · Treatment",
            S("x3", fontSize=10, textColor=colors.HexColor("#cbd5e1"),
            fontName="Helvetica-Oblique", alignment=TA_CENTER, leading=16))],
        [Spacer(1, 0.6*cm)],
        [Paragraph("Reference: Apurba Sastri Microbiology | Sherris &amp; Ryan 8e | Goldman-Cecil Medicine",
            S("x4", fontSize=9, textColor=colors.HexColor("#94a3b8"),
            fontName="Helvetica", alignment=TA_CENTER))],
    ]
    cover = Table(cover_data, colWidths=[17.6*cm])
    cover.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), DEEP_BLUE),
        ("TOPPADDING",   (0,0), (-1,-1), 8),
        ("BOTTOMPADDING",(0,0), (-1,-1), 8),
        ("LEFTPADDING",  (0,0), (-1,-1), 20),
        ("RIGHTPADDING", (0,0), (-1,-1), 20),
        ("BOX",          (0,0), (-1,-1), 2, MID_BLUE),
    ]))
    story += [sp(1.5), cover, sp(0.8)]

    # Quick-ref badge
    badge = make_table(
        ["📌 EXAM QUICK REFERENCE", "", "", ""],
        [
            ["Agent", "SARS-CoV-2 (Beta-coronavirus)", "Gold Std Diagnosis", "RT-PCR (NP swab)"],
            ["Genome", "+ve sense ssRNA (~30 kb)", "Key Receptor", "ACE2 + TMPRSS2"],
            ["Size", "80–160 nm; Enveloped", "Incubation", "2–14 days (avg 5 days)"],
            ["Key Symptoms", "Fever, Dry cough, Anosmia, Ageusia", "Treatment", "Remdesivir + Dexamethasone"],
            ["Worst Complication", "ARDS / Cytokine Storm / DIC", "Pediatric Complication", "MIS-C (Kawasaki-like)"],
        ],
        col_widths=[3.5*cm, 5.3*cm, 4.3*cm, 4.5*cm],
        header_color=DEEP_BLUE
    )
    story += [badge, PageBreak()]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 1 — DEFINITION
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("1", "DEFINITION"), sp(0.2),
    P("<b>COVID-19</b> (Coronavirus Disease-2019) is an <b>acute infectious respiratory illness</b> caused by "
      "<b>SARS-CoV-2</b> (Severe Acute Respiratory Syndrome Coronavirus-2), a novel <b>beta-coronavirus</b> "
      "that emerged in Wuhan, Hubei Province, China in <b>December 2019</b>."),
    sp(0.1),
    P("It was declared a <b>global pandemic by WHO on March 11, 2020</b>. The disease ranges from mild "
      "flu-like illness to severe pneumonia, ARDS, and multi-organ dysfunction syndrome (MODS)."),
    sp(0.2),
    make_table(
        ["Feature", "Detail"],
        [
            ["Disease name", "Coronavirus Disease-2019 (COVID-19)"],
            ["Causative agent", "SARS-CoV-2 (Severe Acute Respiratory Syndrome Coronavirus-2)"],
            ["Family / Genus", "Coronaviridae / Betacoronavirus"],
            ["Pandemic declared", "WHO — March 11, 2020"],
            ["Origin", "Wuhan, Hubei Province, China (December 2019)"],
            ["Global cases (Oct 2023)", "~770 million confirmed cases; ~6.9 million deaths"],
        ],
        col_widths=[5*cm, 12.6*cm]
    ),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 2 — MORPHOLOGY
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("2", "MORPHOLOGY OF SARS-CoV-2"), sp(0.2),
    sub_header("2A. Basic Virion Properties"), sp(0.1),
    make_table(
        ["Property", "Description"],
        [
            ["Type", "Enveloped, positive-sense single-stranded RNA virus (+ssRNA)"],
            ["Size", "80–160 nm (one of the largest RNA viruses)"],
            ["Shape", "Roughly spherical/pleomorphic with crown-like spike projections"],
            ["Genome", "~30 kb — largest RNA genome of any known virus"],
            ["Capsid symmetry", "Helical nucleocapsid"],
            ["Envelope", "Lipid bilayer envelope derived from ER-Golgi membranes"],
            ["Replication site", "Cytoplasm"],
            ["Replication enzyme", "RNA-dependent RNA Polymerase (RdRp) — viral-encoded"],
        ],
        col_widths=[4.5*cm, 13.1*cm]
    ),
    sp(0.25),
    sub_header("2B. Structural Proteins (4 Major)"), sp(0.1),
    make_table(
        ["Protein", "Location", "Function / Significance"],
        [
            ["Spike (S) Glycoprotein",
             "Surface — club/petal projections",
             "Binds ACE2 receptor (S1 = RBD); S2 = fusion domain; gives corona appearance; primary vaccine target; mutates to form variants"],
            ["Membrane (M) Glycoprotein",
             "Embedded in envelope",
             "Most abundant structural protein; maintains envelope shape and integrity; involved in budding"],
            ["Envelope (E) Glycoprotein\n(Small Envelope)",
             "Embedded in envelope",
             "Ion channel (viroporin); essential for viral assembly and release; virulence factor"],
            ["Nucleocapsid (N) Phosphoprotein",
             "Internal — bound to RNA",
             "Packages viral RNA into helical nucleocapsid; important diagnostic antigen (detected in rapid antigen tests); involved in immune evasion"],
            ["Hemagglutinin-Esterase (HE)",
             "Surface (some beta-CoV)",
             "Aids attachment; less prominent in SARS-CoV-2 vs. other betacoronaviruses"],
        ],
        col_widths=[4*cm, 4.2*cm, 9.4*cm]
    ),
    sp(0.2),
    P("🔬 <b>Diagram note:</b> The corona (crown) appearance under electron microscopy is due to the "
      "Spike glycoproteins projecting from the lipid envelope like a solar corona or crown of thorns. "
      "The name 'Coronavirus' derives from this appearance.", NOTE),
    sp(0.2),
    sub_header("2C. Replication Cycle Summary"), sp(0.1),
    make_table(
        ["Step", "Event"],
        [
            ["1. Attachment", "Spike S1 RBD binds ACE2 receptor on host cell"],
            ["2. Priming", "TMPRSS2 (host serine protease) cleaves S1/S2 junction → enables fusion"],
            ["3. Fusion/Entry", "S2 mediates viral envelope-cell membrane fusion → endocytosis"],
            ["4. Uncoating", "Viral RNA (+ssRNA) released into cytoplasm"],
            ["5. Translation", "+ssRNA acts directly as mRNA → polyprotein synthesis → cleavage by proteases"],
            ["6. Replication", "RdRp synthesizes genomic RNA + subgenomic RNAs"],
            ["7. Assembly", "Structural proteins + RNA assemble in cytoplasm"],
            ["8. Budding", "Virus acquires envelope from ER-Golgi membrane; released by exocytosis"],
        ],
        col_widths=[3.5*cm, 14.1*cm]
    ),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 3 — VIRULENCE FACTORS
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("3", "VIRULENCE FACTORS"), sp(0.2),
    make_table(
        ["Virulence Factor", "Mechanism / Significance"],
        [
            ["Spike (S) Glycoprotein — RBD",
             "Binds ACE2 with ~10× higher affinity than SARS-CoV-1. High ACE2 affinity = high infectivity. "
             "D614G mutation in RBD increases ACE2 binding affinity → ↑transmissibility"],
            ["TMPRSS2 Co-receptor",
             "Host transmembrane serine protease 2 primes Spike for entry; co-expressed with ACE2 in lung "
             "epithelium, gut, kidney → enhances cell-to-cell spread"],
            ["ACE2 Multi-organ Expression",
             "ACE2 present on: lung alveolar cells, heart myocytes, kidney tubular cells, intestinal "
             "enterocytes, vascular endothelium, olfactory sustentacular cells → explains multi-organ tropism"],
            ["IFN-I Antagonism (Immune Evasion)",
             "Nonstructural proteins (NSPs) of SARS-CoV-2 antagonize Type I Interferon (IFN-α/β) genes. "
             "Very little IFN-1 in serum of severe patients → unchecked viral replication"],
            ["Exonuclease (ExoN) Proofreading",
             "Unique proofreading ability → limits random mutations → allows controlled, selective "
             "evolution of adaptive variants (unlike influenza which mutates randomly)"],
            ["Cytokine Storm Induction",
             "Massive dysregulated release of IL-1β, IL-6, IL-8, TNF-α, CCL2, MIP1-α → "
             "immunopathological lung injury, vascular permeability, ARDS, DIC"],
            ["Asymptomatic Transmission",
             "~20–40% infections asymptomatic; peak viral shedding at/before symptom onset "
             "(unlike SARS-CoV-1 where shedding peaked after symptoms) → facilitates widespread spread"],
            ["Furin Cleavage Site",
             "SARS-CoV-2 has a unique furin cleavage site at S1/S2 junction (absent in SARS-CoV-1) → "
             "enhanced entry into broad range of cell types"],
            ["Variants of Concern (VoC)",
             "Mutations in Spike RBD increase transmissibility, pathogenicity, and immune evasion. "
             "Delta (India): ↑transmissibility + virulence. Omicron: highest transmissibility, partial immune escape"],
        ],
        col_widths=[5*cm, 12.6*cm]
    ),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 4 — PATHOGENESIS
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("4", "PATHOGENESIS"), sp(0.2),
    sub_header("4A. Step-by-Step Pathogenesis"), sp(0.1)]

    steps = [
        ("STEP 1", "Entry & Upper Respiratory Tract Infection",
         "Virus enters via respiratory route → infects nasopharyngeal/oropharyngeal ciliated epithelial cells. "
         "Spike S1 RBD binds ACE2. TMPRSS2 cleaves S protein → S2 mediates membrane fusion → "
         "viral RNA released into cytoplasm."),
        ("STEP 2", "Viral Replication (Cytoplasm)",
         "+ssRNA translated into polyprotein → cleaved into RdRp, ExoN, and other NSPs. "
         "RdRp directs RNA synthesis. Structural proteins (S, M, E, N) synthesized from subgenomic RNAs. "
         "Assembly in cytoplasm; budding from ER-Golgi membranes."),
        ("STEP 3", "Lower Respiratory Spread",
         "Virus migrates from upper airways down to alveolar epithelial cells (Type I & II pneumocytes), "
         "vascular endothelial cells, alveolar macrophages. Viral load in upper tract peaks early then "
         "declines within 7 days."),
        ("STEP 4", "Innate Immune Evasion",
         "NSPs block IFN-I production (anti-IFN strategy). Low IFN-I → unchecked viral replication. "
         "Simultaneously, pro-inflammatory cytokines IL-6, IL-1β, TNF-α elevated. This 'decoupling' of "
         "antiviral vs. inflammatory response is a key immunopathological mechanism."),
        ("STEP 5", "Cytokine Storm (Severe Disease)",
         "Massive dysregulated immune activation: T lymphocytes, monocytes, neutrophils recruited → "
         "apoptosis of infected cells. Cytokine storm: IL-1β, IL-6, IL-8, TNF-α, CCL2, MIP1-α. "
         "Older patients show higher lymphocytopenia + neutrophilia + elevated inflammatory markers."),
        ("STEP 6", "Pulmonary Injury",
         "Diffuse Alveolar Damage (DAD): hyaline membrane formation, alveolar flooding with exudates. "
         "Endothelial injury → microangiopathy, microthrombosis, aberrant angiogenesis. "
         "Pulmonary edema fills alveolar spaces → early-phase ARDS. "
         "Lymphocytic myocarditis and pericarditis can also occur."),
        ("STEP 7", "Systemic Spread & DIC",
         "ACE2 expression in heart, kidney, intestine, liver → multi-organ infection. "
         "Activated neutrophils/monocytes accumulate in lung, heart, kidney, liver. "
         "Elevated D-dimer + prolonged PT → DIC pathway. Hypercoagulable state → thromboembolism."),
    ]
    for code, title, desc in steps:
        row_data = [[
            Paragraph(f"<b>{code}</b>", S("sc", fontSize=9, textColor=WHITE,
                fontName="Helvetica-Bold", alignment=TA_CENTER)),
            Paragraph(f"<b>{title}</b><br/><font size='9'>{desc}</font>",
                S("sd", fontSize=9, textColor=DARK_TEXT, fontName="Helvetica", leading=13))
        ]]
        t = Table(row_data, colWidths=[2.2*cm, 15.4*cm])
        t.setStyle(TableStyle([
            ("BACKGROUND",   (0,0),(0,0), DEEP_BLUE),
            ("BACKGROUND",   (1,0),(1,0), GREY_BG),
            ("VALIGN",       (0,0),(-1,-1), "TOP"),
            ("TOPPADDING",   (0,0),(-1,-1), 5),
            ("BOTTOMPADDING",(0,0),(-1,-1), 5),
            ("LEFTPADDING",  (0,0),(-1,-1), 6),
            ("BOX",          (0,0),(-1,-1), 0.5, colors.HexColor("#cbd5e1")),
            ("TEXTCOLOR",    (0,0),(0,0), WHITE),
        ]))
        story += [t, sp(0.05)]

    story += [sp(0.2),
    P("⚡ <b>Key Immunological Concept:</b> Cell-mediated immunity (T cells) controls acute infection "
      "and reduces disease severity. Humoral immunity (antibodies) provides longer-lasting protection. "
      "Severe disease = high antibody but impaired T cell response.", EXAM_TIP),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 5 — CLINICAL MANIFESTATIONS
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("5", "CLINICAL MANIFESTATIONS & SYMPTOMS"), sp(0.2),
    sub_header("5A. Severity Classification"), sp(0.1),
    make_table(
        ["Severity", "Clinical Definition", "% Cases\n(unvaccinated)"],
        [
            ["Asymptomatic", "SARS-CoV-2 detected; no symptoms; still infectious", "~40%"],
            ["Mild", "Symptoms present; no hypoxia (SpO₂ >94%); no pneumonia", "~40%"],
            ["Moderate", "Lower respiratory tract disease on imaging; SpO₂ >94%", "~15%"],
            ["Severe", "SpO₂ <94%; RR >30/min; bilateral infiltrates on imaging", "~15%"],
            ["Critical", "Respiratory failure + shock + multi-organ dysfunction", "~5%"],
        ],
        col_widths=[3*cm, 11.5*cm, 3.1*cm]
    ),
    sp(0.2),
    sub_header("5B. Symptoms — From Common to Severe"), sp(0.1),
    make_table(
        ["Category", "Symptoms"],
        [
            ["Cardinal Triad\n(most common)", "Fever | Dry Cough | Fatigue"],
            ["Distinctive Features\n(COVID-specific)", "Anosmia (loss of smell) | Ageusia (loss of taste)"],
            ["General", "Myalgia | Headache | Sore throat | Nasal congestion | Rhinorrhea"],
            ["Respiratory", "Shortness of breath / Dyspnea | Chest tightness | Low SpO₂"],
            ["GI Symptoms\n(esp. Omicron)", "Nausea | Vomiting | Diarrhea | Abdominal pain"],
            ["Neurological", "Confusion | Delirium | Cerebral symptoms (severe disease)"],
            ["Warning Signs\n(Emergency)", "Severe dyspnea at rest | Persistent chest pain | Cyanosis (bluish lips/face) | SpO₂ <90% | Confusion"],
        ],
        col_widths=[4*cm, 13.6*cm]
    ),
    sp(0.2),
    P("🧪 <b>Incubation Period:</b> 2–14 days (average <b>5 days</b>). Viral shedding begins 2–3 days "
      "before symptom onset. Peak transmission at or just before symptom onset.", EXAM_TIP),
    sp(0.2),
    sub_header("5C. Risk Factors for Severe Disease"), sp(0.1),
    P("Age >65 years (strongest risk factor) | Obesity | Diabetes | Hypertension | Cardiovascular disease | "
      "Chronic lung disease (COPD, asthma) | Chronic kidney disease | Cancer | Immunocompromised states | "
      "Sickle cell disease | Transplant recipients | Severe obesity", BODY),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 6 — COMPLICATIONS
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("6", "COMPLICATIONS"), sp(0.2),
    sub_header("6A. Suppurative Complications (Infectious / Direct)"), sp(0.1),
    P("These arise from direct viral cytopathology, secondary bacterial superinfection, or "
      "healthcare-associated infection in hospitalized patients.", BODY),
    make_table(
        ["Complication", "Pathogenesis / Details"],
        [
            ["Secondary Bacterial Pneumonia",
             "Most common suppurative complication. Organisms: S. aureus (MRSA), S. pneumoniae, "
             "Klebsiella pneumoniae, P. aeruginosa. Occurs in ventilated/ICU patients."],
            ["Ventilator-Associated Pneumonia (VAP)",
             "Complication of mechanical ventilation in critically ill COVID-19 patients. "
             "Multi-drug resistant organisms common."],
            ["Septic Shock",
             "Overwhelming bacterial sepsis from secondary superinfection → multi-organ failure. "
             "Elevated procalcitonin, fever, hemodynamic instability."],
            ["Lung Abscess",
             "Rare; caused by bacterial superinfection of necrotic COVID-19 lung tissue."],
            ["Empyema",
             "Pus in pleural cavity; rare secondary bacterial complication."],
        ],
        col_widths=[5*cm, 12.6*cm],
        header_color=RED_WARN,
        alt_color=RED_LIGHT
    ),
    sp(0.2),
    sub_header("6B. Non-Suppurative Complications (Immune-Mediated / Systemic)"), sp(0.1),
    P("These result from the dysregulated immune response, cytokine storm, hypercoagulable state, "
      "or post-infectious immune mechanisms — not direct bacterial infection.", BODY),
    make_table(
        ["System", "Complication", "Mechanism"],
        [
            ["Pulmonary", "ARDS (Acute Respiratory Distress Syndrome)",
             "Cytokine storm → diffuse alveolar damage → hyaline membranes, alveolar flooding"],
            ["Pulmonary", "Pulmonary Embolism / DVT",
             "Hypercoagulable state (elevated D-dimer, fibrinogen, factor VIII)"],
            ["Pulmonary", "Post-COVID Pulmonary Fibrosis",
             "Residual scarring from severe DAD"],
            ["Cardiovascular", "Myocarditis & Pericarditis",
             "Direct viral (ACE2-mediated) + immune-mediated lymphocytic inflammation"],
            ["Cardiovascular", "Arrhythmias",
             "Cardiac inflammation, electrolyte disturbances, autonomic dysfunction"],
            ["Haematological", "DIC (Disseminated Intravascular Coagulation)",
             "Cytokine-driven endothelial activation → microvascular thrombosis; ↑D-dimer, ↑PT"],
            ["Neurological", "Guillain-Barré Syndrome (GBS)",
             "Post-infectious molecular mimicry → immune-mediated polyneuropathy (demyelinating)"],
            ["Neurological", "Acute Flaccid Myelitis",
             "Post-infectious immune-mediated spinal cord inflammation"],
            ["Neurological", "Encephalopathy / Delirium",
             "Cytokine-mediated neuroinflammation; hypoxia in severe disease"],
            ["Neurological", "Stroke / Cerebral Venous Sinus Thrombosis",
             "Hypercoagulable state → arterial/venous thrombosis"],
            ["Renal", "Acute Kidney Injury (AKI)",
             "ACE2-mediated direct viral tubular injury + cytokine storm"],
            ["Paediatric\n(Special)", "MIS-C — Multisystem Inflammatory Syndrome in Children",
             "Post-COVID immune-mediated; Kawasaki-like features: fever, myocarditis, shock, "
             "CORONARY ARTERY ANEURYSMS; Tx: IVIG + aspirin"],
            ["Long-term", "Long-COVID / PASC",
             "Fatigue, brain fog, dyspnea, myalgia >4 weeks after acute illness; "
             "Possible chronic organ damage (lung, heart, kidney, brain)"],
        ],
        col_widths=[3*cm, 5.2*cm, 9.4*cm],
        header_color=ACCENT_TEAL,
        alt_color=LIGHT_TEAL
    ),
    sp(0.2),
    P("⚠️ <b>Exam Favourite:</b> GBS is the post-infectious non-suppurative neurological complication. "
      "MIS-C is the paediatric post-COVID complication (Kawasaki-like, <b>coronary artery aneurysm</b> is key). "
      "ARDS is the most severe acute complication.", WARN),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 7 — LAB DIAGNOSIS
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("7", "LABORATORY DIAGNOSIS"), sp(0.2),
    sub_header("7A. Virological / Direct Tests"), sp(0.1),
    make_table(
        ["Test", "Target", "Specimen", "Sensitivity", "Use"],
        [
            ["RT-PCR (NAAT)\n★ GOLD STANDARD",
             "Viral RNA (ORF1, N gene, E gene)",
             "Nasopharyngeal / Oropharyngeal swab",
             "Very High (>95%)",
             "Definitive diagnosis of CURRENT infection"],
            ["Rapid Antigen Test (RAT)",
             "Viral Nucleocapsid (N) protein antigen",
             "Nasal swab",
             "Moderate (70–85%)",
             "Rapid screening; (+)ve reliable; (-)ve needs RT-PCR confirmation"],
            ["BioFire Respiratory Panel 2.1",
             "Nucleic acids of 15 viruses + 4 bacteria",
             "NP swab",
             "High",
             "Multiplex — differentiates COVID-19 from other respiratory pathogens simultaneously"],
            ["Viral Culture",
             "Live virus isolation",
             "NP swab (BSL-3)",
             "N/A",
             "Research only; not for routine clinical diagnosis"],
        ],
        col_widths=[3.5*cm, 3.8*cm, 3.2*cm, 2.4*cm, 4.7*cm]
    ),
    sp(0.2),
    sub_header("7B. Serological Tests"), sp(0.1),
    make_table(
        ["Test", "Target", "Timing", "Use"],
        [
            ["IgM Antibody", "Anti-SARS-CoV-2 IgM", "Appears: 5–7 days after infection",
             "Early infection marker (less specific)"],
            ["IgG Antibody", "Anti-SARS-CoV-2 IgG (esp. anti-Spike, anti-N)",
             "Appears: 10–14 days; peaks 3–4 weeks",
             "Past infection, immune surveillance — NOT for acute diagnosis"],
            ["Neutralising Antibody", "Inhibits Spike-ACE2 binding", "Post-infection/vaccination",
             "Research; assessing protective immunity"],
        ],
        col_widths=[3.5*cm, 5*cm, 4.5*cm, 4.6*cm]
    ),
    sp(0.2),
    sub_header("7C. Supportive Lab Findings in Severe COVID-19"), sp(0.1),
    make_table(
        ["Investigation", "Finding in Severe COVID-19", "Significance"],
        [
            ["CBC", "Lymphopenia (↓CD4/CD8 T cells) + Neutrophilia", "Hallmark of severe disease; marker of cytokine storm"],
            ["D-dimer", "Markedly elevated", "DIC / venous thromboembolism risk"],
            ["CRP", "Very high (>100 mg/L in severe)", "Systemic inflammation marker"],
            ["IL-6", "Highly elevated", "Key cytokine storm mediator; targets for tocilizumab"],
            ["Ferritin", "Elevated (hyperferritinaemia)", "Macrophage activation; inflammation"],
            ["LDH", "Elevated", "Tissue necrosis, widespread damage"],
            ["Procalcitonin", "Elevated if bacterial superinfection", "Differentiates bacterial from viral"],
            ["Troponin / BNP", "Elevated", "Myocarditis / cardiac injury"],
            ["Prothrombin Time", "Prolonged", "DIC; coagulation pathway activation"],
            ["Creatinine / BUN", "Elevated", "AKI involvement"],
            ["Chest X-ray / CT", "Bilateral ground-glass opacities, consolidation, 'crazy-paving' pattern",
             "Viral pneumonia / ARDS pattern — peripheral, bilateral"],
            ["SpO₂ / ABG", "SpO₂ <90%; PaO₂ <60 mmHg; type 1 respiratory failure", "Hypoxaemia, ARDS"],
        ],
        col_widths=[3.8*cm, 7*cm, 6.8*cm]
    ),
    sp(0.2),
    P("📌 <b>Key Diagnostic Principle:</b> Antibody tests detect PAST infection/immunity only. "
      "For CURRENT infection diagnosis: always use RT-PCR or RAT. "
      "Wastewater surveillance of SARS-CoV-2 RNA helps track community-level prevalence.", EXAM_TIP),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 8 — TREATMENT
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("8", "TREATMENT"), sp(0.2),
    sub_header("8A. Antiviral Therapy"), sp(0.1),
    make_table(
        ["Drug", "Class / Mechanism", "Indication", "Route"],
        [
            ["Remdesivir", "Nucleotide analogue; inhibits RdRp → blocks viral RNA synthesis",
             "Hospitalized patients requiring O₂; given for 5 days", "IV infusion"],
            ["Nirmatrelvir/Ritonavir\n(Paxlovid)", "Viral 3CL-protease inhibitor (Nirmatrelvir);\nRitonavir boosts levels",
             "High-risk outpatients within 5 days of symptom onset", "Oral"],
            ["Molnupiravir", "Mutagenic nucleoside analogue; induces viral RNA errors",
             "Alternative for high-risk outpatients (if Paxlovid not available)", "Oral"],
        ],
        col_widths=[3.8*cm, 6*cm, 5.3*cm, 2.5*cm]
    ),
    sp(0.2),
    sub_header("8B. Anti-Inflammatory / Immunomodulatory Therapy"), sp(0.1),
    make_table(
        ["Drug", "Class / Mechanism", "Indication"],
        [
            ["Dexamethasone ★",
             "Corticosteroid; suppresses cytokine storm; reduces inflammation-mediated lung injury",
             "Hospitalised patients requiring supplemental O₂ or ventilation. 6 mg/day × 10 days. "
             "DO NOT use in mild disease (may worsen outcome)."],
            ["Tocilizumab",
             "Anti-IL-6 receptor monoclonal antibody; blocks IL-6 signalling",
             "Severe/critical COVID-19 with cytokine storm and elevated CRP; used with dexamethasone"],
            ["Baricitinib",
             "JAK1/JAK2 inhibitor; blocks cytokine signalling pathway",
             "Hospitalised adults requiring O₂, NIV, or mechanical ventilation; alternative to tocilizumab"],
        ],
        col_widths=[4*cm, 6.5*cm, 7.1*cm]
    ),
    sp(0.2),
    sub_header("8C. Monoclonal Antibodies (mAbs)"), sp(0.1),
    make_table(
        ["Drug", "Target", "Use"],
        [
            ["Bamlanivimab", "SARS-CoV-2 Spike glycoprotein", "High-risk outpatients; prevents progression (FDA EUA)"],
            ["Casirivimab + Imdevimab (REGEN-COV)", "Spike RBD (cocktail — two mAbs)", "High-risk patients; prevents hospitalisation"],
            ["Bebtelovimab / Sotrovimab", "Spike protein (different epitopes)", "Omicron-active; replacing earlier mAbs"],
        ],
        col_widths=[5*cm, 6.5*cm, 6.1*cm]
    ),
    sp(0.1),
    P("⚠️ Note: Efficacy of monoclonal antibodies varies by variant. Many early mAbs (bamlanivimab, "
      "casirivimab+imdevimab) have reduced activity against Omicron subvariants.", NOTE),
    sp(0.2),
    sub_header("8D. Supportive Care (Severe / Critical Disease)"), sp(0.1),
    make_table(
        ["Intervention", "Details"],
        [
            ["Supplemental Oxygen", "Low-flow (nasal cannula) → High-flow nasal O₂ (HFNO) → Non-invasive ventilation (NIV) → Invasive mechanical ventilation"],
            ["Prone Positioning", "Improves oxygenation in ARDS by recruiting posterior lung segments; ≥16 hours/day recommended"],
            ["Mechanical Ventilation", "For respiratory failure (PaO₂/FiO₂ <150 mmHg); lung-protective strategy: low tidal volume 6 mL/kg, PEEP titration"],
            ["Anticoagulation", "Prophylactic / therapeutic heparin for VTE prevention/treatment; guided by D-dimer and clinical risk"],
            ["Vasopressors", "Noradrenaline for septic shock maintaining MAP ≥65 mmHg"],
            ["ICU Care", "Continuous monitoring, multi-organ support, nutritional support, prevention of secondary infections"],
        ],
        col_widths=[4.5*cm, 13.1*cm]
    ),
    sp(0.2),
    sub_header("8E. Prevention & Vaccines"), sp(0.1),
    make_table(
        ["Vaccine / Measure", "Type / Details", "Efficacy"],
        [
            ["Pfizer-BioNTech (Comirnaty)", "mRNA — encodes Spike glycoprotein; 2 doses, 3 weeks apart",
             "~95% vs. severe disease (original strain)"],
            ["Moderna (Spikevax)", "mRNA — encodes Spike glycoprotein; 2 doses, 4 weeks apart",
             "~94% vs. severe disease"],
            ["Johnson & Johnson (Janssen)", "Replication-incompetent human adenovirus vector (Ad26); single dose",
             "~66–72% vs. symptomatic disease"],
            ["Covishield / AstraZeneca", "ChAdOx1 adenovirus vector encoding Spike; 2 doses", "~70–90% vs. severe disease"],
            ["Covaxin (Bharat Biotech)", "Whole-inactivated virus; 2 doses; widely used in India",
             "~77% vs. symptomatic disease"],
            ["Non-pharmacological", "Masking (N95 > surgical > cloth) | Social distancing ≥6 feet | "
             "Hand hygiene (≥60% alcohol sanitiser) | Ventilation | Quarantine/Isolation", "Additive protection"],
        ],
        col_widths=[4.5*cm, 7.5*cm, 5.6*cm]
    ),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 9 — MNEMONICS & EXAM TIPS
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("9", "MNEMONICS & EXAM TIPS", color=colors.HexColor("#065f46")), sp(0.2),
    P("📝 <b>MNEMONIC — Structural Proteins of Coronavirus: S.M.E.N</b>", BOLD_BODY),
    P("  <b>S</b> — Spike glycoprotein (binds ACE2; vaccine target)<br/>"
      "  <b>M</b> — Membrane glycoprotein (most abundant)<br/>"
      "  <b>E</b> — Envelope glycoprotein (ion channel; virulence)<br/>"
      "  <b>N</b> — Nucleocapsid phosphoprotein (packages RNA; diagnostic antigen)", BODY),
    sp(0.1),
    P("📝 <b>MNEMONIC — Symptoms of COVID-19: FACT-CAD</b>", BOLD_BODY),
    P("  <b>F</b> — Fever<br/>"
      "  <b>A</b> — Anosmia / Ageusia<br/>"
      "  <b>C</b> — Cough (dry)<br/>"
      "  <b>T</b> — Tiredness / Fatigue<br/>"
      "  <b>C</b> — Chest pain<br/>"
      "  <b>A</b> — Aches (myalgia, headache)<br/>"
      "  <b>D</b> — Dyspnea (shortness of breath)", BODY),
    sp(0.1),
    P("📝 <b>MNEMONIC — Cytokines in Cytokine Storm: IL-6 = I Let-6 go</b>", BOLD_BODY),
    P("Key cytokines: <b>IL-1β, IL-6, IL-8, TNF-α, CCL2</b> — all elevated in severe COVID-19. "
      "IL-6 is THE most important → targeted by Tocilizumab.", BODY),
    sp(0.2),
    make_table(
        ["Exam Question Type", "Key Answer"],
        [
            ["Gold standard diagnosis of COVID-19", "RT-PCR of nasopharyngeal swab"],
            ["Unique feature distinguishing COVID-19 from other respiratory viruses", "Anosmia + Ageusia (loss of smell and taste)"],
            ["Receptor used by SARS-CoV-2 for cell entry", "ACE2 (+ TMPRSS2 for priming)"],
            ["Most severe acute complication of COVID-19", "ARDS (Acute Respiratory Distress Syndrome)"],
            ["Post-infectious neurological complication", "Guillain-Barré Syndrome (GBS)"],
            ["Paediatric post-COVID complication", "MIS-C — features of Kawasaki disease including coronary artery aneurysms"],
            ["Treatment of severe COVID-19 (drug of choice for hospitalised)", "Dexamethasone 6 mg/day × 10 days + Remdesivir"],
            ["Why SARS-CoV-2 is more contagious than SARS-CoV-1", "Asymptomatic transmission; peak viral shedding BEFORE symptom onset (vs. after in SARS-CoV-1)"],
            ["Component detected by rapid antigen test", "Nucleocapsid (N) protein antigen"],
            ["Which vaccine platform is used by Pfizer/Moderna", "mRNA vaccine encoding Spike glycoprotein"],
            ["Severity classification: critical illness", "Respiratory failure + shock + multi-organ dysfunction (~5% of cases)"],
            ["What gives coronavirus its name?", "Crown-like spike projections visible on EM (corona = crown in Latin)"],
        ],
        col_widths=[7.5*cm, 10.1*cm],
        header_color=colors.HexColor("#065f46"),
        alt_color=GREEN_LIGHT
    ),
    sp(0.3)]

    # ──────────────────────────────────────────────────────────────────────────
    # SECTION 10 — QUICK SUMMARY TABLE
    # ──────────────────────────────────────────────────────────────────────────
    story += [section_header("10", "QUICK SUMMARY — ONE-PAGE REVISION"), sp(0.2),
    make_table(
        ["Category", "Key Points"],
        [
            ["Agent", "SARS-CoV-2 | Family: Coronaviridae | Genus: Betacoronavirus"],
            ["Genome", "+ssRNA, ~30 kb, largest RNA genome, helical nucleocapsid, enveloped"],
            ["Size", "80–160 nm"],
            ["Key Receptor", "ACE2 (Angiotensin-Converting Enzyme 2) + TMPRSS2"],
            ["Transmission", "Respiratory droplets (primary) | Aerosol | Contact (minor)"],
            ["Incubation", "2–14 days (average 5 days)"],
            ["Key Structural Proteins", "Spike (S), Membrane (M), Envelope (E), Nucleocapsid (N)"],
            ["Virulence Factors", "Spike RBD–ACE2 binding | TMPRSS2 | IFN-I antagonism | Cytokine storm | Asymptomatic transmission | Furin cleavage site"],
            ["Pathogenesis", "URT entry → ACE2 binding → replication → cytokine storm → DAD → ARDS/DIC"],
            ["Cardinal Symptoms", "Fever | Dry Cough | Anosmia | Ageusia | Fatigue"],
            ["Severity Spectrum", "40% asymptomatic | 40% mild | 15% moderate | 15% severe | 5% critical"],
            ["Lab Diagnosis", "RT-PCR (gold std) | RAT (rapid) | BioFire panel | Antibody (past exposure only)"],
            ["Suppurative Complications", "Bacterial superinfection | VAP | Septic shock | Lung abscess"],
            ["Non-Suppurative Complications", "ARDS | DIC | Myocarditis | GBS | MIS-C | Stroke | AKI | Long COVID"],
            ["Treatment", "Remdesivir (antiviral) + Dexamethasone (anti-inflammatory) + Supportive care"],
            ["Prevention", "mRNA vaccines (Pfizer, Moderna) | Masking | Social distancing | Hand hygiene"],
            ["Most Severe Acute Complication", "ARDS with respiratory failure"],
            ["Paediatric Complication", "MIS-C — Kawasaki-like, coronary artery aneurysms, myocarditis"],
            ["Post-Infectious Neurological", "Guillain-Barré Syndrome (GBS) — acute inflammatory demyelinating polyneuropathy"],
            ["Long-term Sequelae", "Long-COVID / PASC — fatigue, brain fog, dyspnea >4 weeks"],
        ],
        col_widths=[5*cm, 12.6*cm]
    ),
    sp(0.4),
    P("Sources: <b>Sherris &amp; Ryan's Medical Microbiology 8e</b> (pp. 355–368) | "
      "<b>Goldman-Cecil Medicine 27e</b> (Chapter 336) | "
      "<b>Robbins &amp; Cotran Pathologic Basis of Disease 10e</b> | "
      "<b>Harrison's Principles of Internal Medicine 22e</b> | "
      "Aligned with Apurba Sastri Microbiology syllabus", NOTE)]

    doc.build(story, onFirstPage=add_page_number, onLaterPages=add_page_number)
    print(f"PDF generated: {OUTPUT_PATH}")
    return OUTPUT_PATH

if __name__ == "__main__":
    build()
Running Command

cd /home/daytona/workspace/covid19-study-guide && python3 generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/covid19-study-guide/COVID19_MBBS_Study_Guide.pdf

Your study guide PDF is ready for download:

COVID19 MBBS Study Guide

PDF Document · PDF


Here's what's included in the PDF:
Cover Page - Title card with quick-reference badge showing the most exam-critical facts at a glance.
10 Sections covering every topic you asked for:
  1. Definition - Full definition with epidemiological data table
  2. Morphology - Virion properties, all 4 structural proteins (S.M.E.N), replication cycle steps
  3. Virulence Factors - 9 factors in a detailed table: ACE2 binding, TMPRSS2, IFN antagonism, cytokine storm, furin cleavage site, variants, etc.
  4. Pathogenesis - 7-step colour-coded flow from viral entry to DIC
  5. Clinical Manifestations - Severity classification table (asymptomatic to critical), full symptom list, risk factors
  6. Complications - Separate tables for suppurative (bacterial superinfection, VAP, septic shock) and non-suppurative (ARDS, DIC, GBS, MIS-C, myocarditis, Long COVID)
  7. Lab Diagnosis - RT-PCR vs RAT vs BioFire vs serology, plus supportive CBC/D-dimer/CT findings
  8. Treatment - Antivirals (Remdesivir, Paxlovid), Dexamethasone, Monoclonal antibodies, Supportive care, Vaccines (including Covaxin/Covishield for India)
  9. Mnemonics & Exam Q&A - SHEN mnemonic, FACT-CAD symptoms, 12 common exam questions with answers
  10. One-Page Summary Table - Rapid revision of all 20 key points before exam
This is a shared conversation. Sign in to Orris to start your own chat.