write notes for topic of IBD therapeutics 3 it should include intro definition etiology pathophysiology in flowchart clinical features diagnosis treatment goals non pharmac treatment pharmacological treatment including drug short intro class short moa in flowchart drug interaction adr dose indication contraindication and summary chart for pharmacological treatment

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

IBD THERAPEUTICS 3 - COMPREHENSIVE NOTES


1. INTRODUCTION

Inflammatory Bowel Disease (IBD) represents a group of chronic, idiopathic, relapsing-remitting inflammatory disorders of the gastrointestinal tract. The two major forms are Crohn's Disease (CD) and Ulcerative Colitis (UC). IBD significantly impairs quality of life and carries risks of serious complications including colorectal cancer, strictures, fistulae, and need for surgery. Management has evolved dramatically over the past 25 years - from a "bottom-up" to a "top-down" approach with the advent of biologic therapies.

2. DEFINITION

FeatureUlcerative Colitis (UC)Crohn's Disease (CD)
LocationColon only; continuous from rectumAny GI tract (mouth to anus); skip lesions
Depth of inflammationMucosal/submucosal onlyTransmural (full thickness)
Rectal involvementAlwaysVariable
GranulomasAbsentPresent (non-caseating)
Fistulae/stricturesRareCommon
Colonoscopic patternDiffuse, continuousCobblestone, aphthous ulcers, "bear claw" ulcers

3. ETIOLOGY

IBD is multifactorial - no single cause. Four key domains:
┌─────────────────────────────────────────────────────────────┐
│                    ETIOLOGY OF IBD                          │
├──────────────┬──────────────┬──────────────┬────────────────┤
│  GENETIC     │ENVIRONMENTAL │  IMMUNE      │  MICROBIAL     │
│  FACTORS     │  FACTORS     │ DYSREGULATION│  FACTORS       │
├──────────────┼──────────────┼──────────────┼────────────────┤
│ • NOD2 gene  │ • Diet (high │ • Defective  │ • Dysbiosis    │
│  (chr 16)    │  fat/low     │  mucosal     │ • ↑ E. coli,   │
│ • ATG16L1    │  fiber)      │  barrier     │  Serratia      │
│  (chr 2)     │ • Tobacco    │ • Abnormal   │  marcescens    │
│ • IRGM       │  (CD risk)   │  T-cell      │ • ↑ Candida    │
│  (chr 5)     │ • Alcohol    │  activation  │  tropicalis    │
│ • Polygenic  │ • OCP use    │ • TH1/TH2    │ • Possible:    │
│ • 50% MZ     │ • NSAIDs     │  imbalance   │  M. paratuber- │
│  twin        │ • Hygiene    │ • Autoimmune │  culosis       │
│  concordance │  hypothesis  │  component   │  (CD)          │
│ • 10% DZ     │ • Western    │ • IL-12, IL- │                │
│  concordance │  lifestyle   │  23 excess   │                │
└──────────────┴──────────────┴──────────────┴────────────────┘
Genetic note: 10-30% of IBD patients have at least one affected family member. GWAS identified >200 loci; NOD2 is the most strongly associated with CD.

4. PATHOPHYSIOLOGY (FLOWCHART)

TRIGGER (Genetic susceptibility + Environmental factor + Dysbiosis)
          │
          ▼
IMPAIRED INTESTINAL EPITHELIAL BARRIER
(Tight junction breakdown, altered mucus layer)
          │
          ▼
BACTERIAL ANTIGENS PENETRATE INTO LAMINA PROPRIA
          │
          ▼
ANTIGEN-PRESENTING CELLS (Dendritic Cells/Macrophages) ACTIVATED
          │
   ┌──────┴──────┐
   ▼             ▼
 IL-12/IL-23   IL-4/IL-5
   │             │
   ▼             ▼
 TH1 Response  TH2 Response
(CD dominant)  (UC dominant)
   │
   ▼
IFN-γ + TNF-α released
          │
          ▼
MACROPHAGE ACTIVATION → MORE IFN-γ, TNF-α, IL-1, IL-6
          │
          ▼
NEUTROPHIL RECRUITMENT (via adhesion molecules / integrins α4β7)
          │
          ▼
CRYPT ABSCESSES + MUCOSAL ULCERATION
          │
    ┌─────┴─────┐
    ▼           ▼
  UC            CD
(Mucosal only)  (Transmural - granulomas, fistulae, strictures)
          │
          ▼
CHRONIC RELAPSING INFLAMMATION → Fibrosis → Complications
                                           → Colorectal cancer risk
Key cytokines: TNF-α, IL-12, IL-23, IL-6, IFN-γ Key pathways: NF-κB activation, JAK-STAT signaling, Integrin-mediated leukocyte trafficking

5. CLINICAL FEATURES

Ulcerative Colitis

SystemFeature
GIBloody diarrhea (hallmark), mucus in stool, tenesmus, urgency, cramping
ConstitutionalFatigue, weight loss, fever in severe disease
SeverityMild (<4 stools/day), Moderate (4-6 stools/day), Severe (>6 stools/day + systemic features)

Crohn's Disease

SystemFeature
GIAbdominal pain (RLQ), non-bloody or blood-tinged diarrhea, perianal disease (fistulae, abscesses)
ConstitutionalWeight loss, fever, malnutrition, growth failure in children
ComplicationsStrictures (obstruction), fistulae, abscesses, perianal disease

Extra-intestinal Manifestations (Both)

Joints:      Peripheral arthropathy, Ankylosing spondylitis, Sacroiliitis
Eyes:        Episcleritis, Uveitis, Iritis
Skin:        Erythema nodosum, Pyoderma gangrenosum
Liver/Biliary: Primary Sclerosing Cholangitis (especially UC)
Other:       Aphthous mouth ulcers, Venous thromboembolism

6. DIAGNOSIS

Diagnostic Approach

History + Physical Examination
          │
          ▼
LABORATORY TESTS
• CBC (anemia, leukocytosis)         • ESR, CRP (inflammation markers)
• Fecal calprotectin (sensitive IBD  • Albumin (nutritional status)
  marker; >50-150 μg/g)             • Fecal lactoferrin
• Stool culture (exclude infection)  • ANCA (UC+), ASCA (CD+)
          │
          ▼
ENDOSCOPY (Gold Standard)
• Colonoscopy + biopsy (both UC and CD)
• Upper GI endoscopy + small bowel capsule (CD)
          │
          ▼
HISTOLOGY
• UC: Crypt distortion, crypt abscesses, goblet cell depletion,
     mucosal infiltrate, NO granulomas
• CD: Non-caseating granulomas, transmural inflammation,
     fissuring ulcers
          │
          ▼
IMAGING (CD especially)
• CT enterography / MRI enterography (small bowel, fistulae, abscesses)
• Abdominal X-ray (toxic megacolon: colonic dilation >6 cm)
• Barium studies (string sign = ileal stricture in CD)

Activity Indices

  • UC: Mayo Score, Truelove & Witts criteria
  • CD: Crohn's Disease Activity Index (CDAI), Harvey-Bradshaw Index

7. TREATMENT GOALS

SHORT-TERM GOALS:
  1. Induce clinical remission (relief of symptoms)
  2. Reduce mucosal inflammation
  3. Avoid hospitalization and surgery

LONG-TERM GOALS:
  1. Maintain steroid-free remission
  2. Achieve mucosal healing (endoscopic + histologic)
  3. Achieve "DEEP REMISSION"
     = Clinical remission + Normalized CRP + Mucosal healing
  4. Prevent disease progression (strictures, fistulae, cancer)
  5. Improve health-related quality of life
  6. Minimize drug toxicity

8. NON-PHARMACOLOGICAL TREATMENT

ApproachDetails
Dietary ModificationLow-residue diet during flares; avoid trigger foods; adequate nutrition; ELEMENTAL diet (liquid formula) - effective as primary therapy in pediatric CD for inducing remission
Exclusive Enteral Nutrition (EEN)Especially in children with CD; induces remission; avoids steroids
Smoking CessationSmoking worsens CD; paradoxically may mildly protect UC, but cessation remains recommended overall
Stress ManagementPsychological stress is a trigger for flares; CBT and mindfulness supported
ExerciseRegular moderate exercise associated with reduced relapse rates
ProbioticsEvidence strongest for VSL#3 in UC maintenance; limited data in CD
Fecal Microbiota Transplantation (FMT)Emerging evidence in UC; not yet standard
SurgeryUC: Proctocolectomy is curative; CD: Resection - not curative, recurrence common; reserved for refractory disease, complications
Nutritional supportCorrect iron deficiency anemia, B12/folate (sulfasalazine inhibits folate), Vitamin D, calcium supplementation
Surveillance colonoscopyCRC surveillance: after 7-8 years of extensive colitis, every 1-3 years

9. PHARMACOLOGICAL TREATMENT

Drug Class Overview

CLASS 1: AMINOSALICYLATES (5-ASA)
CLASS 2: CORTICOSTEROIDS
CLASS 3: IMMUNOMODULATORS (Thiopurines + Methotrexate)
CLASS 4: CALCINEURIN INHIBITORS
CLASS 5: BIOLOGICS
   5a. Anti-TNF-α antibodies
   5b. Anti-integrin antibodies
   5c. Anti-IL-12/23 antibodies
CLASS 6: SMALL MOLECULE JAK INHIBITORS
CLASS 7: ANTIBIOTICS (adjunctive)

CLASS 1: AMINOSALICYLATES (5-ASA Agents)

Short Introduction: First-line agents for mild-moderate UC. Deliver 5-aminosalicylic acid (5-ASA) to the intestinal mucosa. The therapeutic moiety is 5-ASA; sulfapyridine in sulfasalazine is the carrier (and source of most side effects).
MOA Flowchart:
5-ASA delivered to intestinal mucosa
          │
  ┌───────┼──────────────┐
  ▼       ▼              ▼
Inhibits  Activates    Scavenges
NF-κB     PPAR-γ       free radicals
(↓ pro-   (anti-       & oxidants
inflam-   inflam-
matory    matory
cytokines)transcription)
          │
          ▼
Inhibits lipoxygenase → ↓ leukotriene synthesis
          │
          ▼
↓ IL-1, TNF-α production
↓ T-cell activation
↓ Mucosal inflammation
(Exact mechanism not fully elucidated)

DRUG SUMMARY TABLE - CLASS 1

DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
SulfasalazineInduction: 500-1000 mg q6-8h (max 5 g/day); Maintenance: 2 g/dayMild-moderate UC; UC maintenance; mild CD colitisSulfa allergy, G6PD deficiency, renal impairmentNausea, headache, male infertility (reversible), hemolytic anemia, agranulocytosis, Stevens-Johnson syndrome, hepatitis↓ Digoxin absorption; inhibits folate absorption (give folic acid supplement); ↑ Warfarin effect; avoid with methotrexate
Mesalamine (5-ASA)2.4-4.8 g/day oral; Topical: suppository 1 g/day, enema 4 g/dayMild-moderate UC; UC maintenance; proctitis (suppository); distal UC (enema)Salicylate hypersensitivity, severe renal impairmentHeadache, dyspepsia, skin rash; interstitial nephritis (rare but serious); pancreatitis (rare)Monitor renal function; avoid NSAIDs
Olsalazine500 mg bid-tidUC maintenanceSalicylate allergy, renal failureWatery diarrhea (10-20% - most notable ADR); secretory diarrhea mechanismSimilar to mesalamine
Balsalazide2.25 g tid (induction); 1.5 g bid (maintenance)Mild-moderate UCSalicylate allergyGenerally well tolerated; headache, GI upsetSimilar to mesalamine
Note: 5-ASA agents have no established role in small bowel-only CD and limited benefit in moderate-severe CD. Rectal mesalamine (suppository/enema) is more effective than oral for proctitis and distal colitis.

CLASS 2: CORTICOSTEROIDS

Short Introduction: Effective for induction of remission in moderate-severe IBD. NOT used for maintenance (high toxicity, no mucosal healing). Available as systemic (prednisolone/methylprednisolone/IV hydrocortisone) and topical (budesonide - high first-pass metabolism, reduced systemic effects).
MOA Flowchart:
Corticosteroid enters cell
          │
          ▼
Binds cytosolic GLUCOCORTICOID RECEPTOR (GR)
          │
          ▼
GR-steroid complex translocates to nucleus
          │
     ┌────┴────┐
     ▼         ▼
Transactivation  Transrepression
(anti-inflam     (inhibits NF-κB
genes upregulated) & AP-1)
     │              │
     ▼              ▼
↑ Lipocortin-1   ↓ COX-2, ↓ PLA2
(inhibits PLA2)  ↓ TNF-α, ↓ IL-1,
                 ↓ IL-6, ↓ IFN-γ
          │
          ▼
↓ Capillary permeability, ↓ leukocyte recruitment
↓ Mucosal inflammation → Symptomatic remission
(Does NOT heal mucosa long-term)

DRUG SUMMARY TABLE - CLASS 2

DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
PrednisoloneMild-moderate: 20-40 mg/day; Moderate-severe: 40-60 mg/day oral; taper over 8-12 weeksModerate-severe UC or CD flare; Bridge therapyActive infection, uncontrolled DM, active TB, psychosis, peptic ulcer, live vaccinesHyperglycemia, hypertension, osteoporosis, Cushingoid features, growth retardation, adrenal suppression, cataracts, glaucoma, psychosis, immunosuppressionNSAIDs → ↑ GI bleed; CYP3A4 inhibitors ↑ levels; Rifampicin ↓ levels; ↑ hyperglycemia with antidiabetics; ↓ vaccine response
MethylprednisoloneIV 40-60 mg/daySevere UC (IV therapy)Same as prednisoloneSame as prednisoloneSame as prednisolone
HydrocortisoneIV: 100-400 mg/day; Enema: 100 mg in 60 mL retention enemaSevere acute UC (IV); Distal colitis (enema)Active infectionSame as prednisolone; enema has significant systemic absorptionSame as prednisolone
BudesonideCD ileum: 9 mg/day x8-12 wk, then taper; UC (MMX): 9 mg/dayMild-moderate CD (ileocecal); Mild-moderate UC (budesonide MMX formulation)Active infectionMuch fewer systemic effects; growth restriction less; still possible adrenal suppression with prolonged useCYP3A4 inhibitors (azole antifungals, macrolides) ↑ budesonide levels significantly
Beclomethasone dipropionate5 mg/day oralMild-moderate UCActive infectionMinimal systemic effects (high first-pass)CYP3A4 inhibitors

CLASS 3: IMMUNOMODULATORS

3a. THIOPURINES

Short Introduction: Used for maintenance of remission in both UC and CD, and for steroid-sparing. Slow onset (3-6 months) - require concurrent bridging therapy. Require TPMT genotyping before initiation.
MOA Flowchart:
Azathioprine (prodrug)
          │
          ▼ (non-enzymatic)
6-Mercaptopurine (6-MP)
          │
   ┌──────┼──────┐
   ▼      ▼      ▼
HGPRT   TPMT   XO
   │      │      │
   ▼      ▼      ▼
6-TGN   6-MMP  6-Thiouric acid
(active  (inac-  (excreted)
 metab)  tive)
   │
   ▼
6-Thioguanine nucleotides
   │
   ▼
Incorporated into DNA → inhibit de novo purine synthesis
   │
   ▼
↓ T and B lymphocyte proliferation
   │
   ▼
↓ IL-2, IL-6 → ↓ Mucosal inflammation → Maintenance of remission

DRUG SUMMARY TABLE - CLASS 3a

DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
Azathioprine (AZA)2-2.5 mg/kg/day oralMaintenance remission UC & CD; steroid-sparing; combined with anti-TNF (reduce immunogenicity)Low TPMT activity, active infection, pregnancy (relative), lymphoma historyMyelosuppression (CBC monitoring!), hepatotoxicity, pancreatitis (5%), nausea, opportunistic infections, lymphoma (rare but ↑ risk esp. EBV+), NMSCAllopurinol - major interaction: blocks XO → ↑ 6-TGN toxicity (reduce AZA dose by 75%); Mesalamine/sulfasalazine inhibit TPMT → ↑ toxicity; Warfarin effect reduced
6-Mercaptopurine (6-MP)1-1.5 mg/kg/day oralSame as AZASame as AZASame as AZASame as AZA; Allopurinol - same major interaction

3b. METHOTREXATE

Short Introduction: Used in CD (primarily); limited evidence in UC. Folate antagonist. Useful for steroid-dependent or steroid-resistant CD. Also treats articular extra-intestinal manifestations.
MOA Flowchart:
Methotrexate
     │
     ▼
Inhibits DHFR (dihydrofolate reductase)
     │
     ▼
↓ THF (tetrahydrofolate)
     │
     ▼
↓ Purine synthesis & thymidylate synthesis
     │
     ▼
↓ Lymphocyte proliferation
     │
     ▼
Also: ↑ Adenosine release → anti-inflammatory effect
     │
     ▼
↓ IL-1, IL-2, IL-6 → ↓ Mucosal inflammation
DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
MethotrexateInduction: 25 mg IM/SC weekly x16 wk; Maintenance: 15 mg IM/SC weeklySteroid-dependent/refractory CD; CD maintenancePregnancy (teratogenic - absolute CI), breast-feeding, hepatic disease, renal failure, significant alcohol use, pulmonary fibrosisNausea, hepatotoxicity/fibrosis (folate supplementation mandatory), pulmonary toxicity (pneumonitis), myelosuppression, teratogenicity (men AND women - contraception essential), oral ulcersNSAIDs, aspirin, sulfasalazine → ↑ MTX toxicity; Trimethoprim → ↑ myelosuppression; Alcohol → ↑ hepatotoxicity; Folate supplementation reduces toxicity

CLASS 4: CALCINEURIN INHIBITORS

Short Introduction: Reserved for severe, steroid-refractory IBD (especially fulminant UC as "rescue therapy"). Short-term use due to significant toxicity.
MOA Flowchart:
Cyclosporine / Tacrolimus
          │
          ▼
Binds cyclophilin (CsA) or FKBP12 (Tacrolimus)
          │
          ▼
Complex inhibits CALCINEURIN (phosphatase)
          │
          ▼
↓ Dephosphorylation of NFAT (Nuclear Factor of Activated T cells)
          │
          ▼
NFAT remains in cytoplasm → Cannot enter nucleus
          │
          ▼
↓ Transcription of IL-2 gene
          │
          ▼
↓ IL-2 → ↓ T-cell proliferation and activation
          │
          ▼
↓ Inflammatory cascade → ↓ Acute mucosal inflammation
DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
CyclosporineIV: 2-4 mg/kg/day; Oral: switch after responseSevere steroid-refractory UC (rescue); Acute severe UC avoiding colectomyRenal insufficiency, uncontrolled hypertension, active infection, seizure disorderNephrotoxicity, hypertension, seizures, peripheral neuropathy, hirsutism, gingival hyperplasia, opportunistic infections (PCP prophylaxis needed)CYP3A4 inhibitors ↑ CsA levels; CYP3A4 inducers ↓ CsA levels; Nephrotoxic drugs ↑ renal toxicity; Statins → ↑ myopathy risk
TacrolimusOral: individualized dosingSevere acute steroid-resistant IBD; perianal CD (topical ointment)Similar to CsA; caution in renal impairmentSimilar to CsA; more neurotoxicity; diabetogenicSimilar to CsA; more interactions via CYP3A4/P-glycoprotein

CLASS 5: BIOLOGICAL THERAPIES

5a. Anti-TNF-α Monoclonal Antibodies

Short Introduction: First biologics approved for IBD. Highly effective for moderate-severe CD and UC, including fistulizing CD. Used for both induction AND maintenance. Most immunogenic - require monitoring for antibody formation.
MOA Flowchart:
TNF-α (key proinflammatory cytokine)
Secreted by macrophages, T cells
          │ binds
          ▼
p55 and p75 TNF receptors on immune cells
          │
          ▼
Releases: IL-1, IL-6, IL-8
Upregulates: Adhesion molecules, Collagen production
Recruits: Neutrophils, monocytes to mucosa
          │ ← BLOCKED BY Anti-TNF Antibody
          │
Anti-TNF-α mAb binds BOTH soluble AND membrane-bound TNF-α
          │
          ▼
Neutralization of TNF-α
+ Complement-mediated lysis of TNF-expressing cells
+ Induction of T-cell apoptosis
          │
          ▼
↓ TH1 cytokine cascade → ↓ Mucosal inflammation
Response in ~14 days; ~60% clinical response; ~30% remission

DRUG SUMMARY TABLE - CLASS 5a

DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
Infliximab (chimeric IgG1; 25% mouse/75% human)Induction: 5 mg/kg IV at wk 0, 2, 6; Maintenance: 5 mg/kg q8 weeksModerate-severe CD and UC; fistulizing CD; pediatric CD and UCActive infection (esp. TB, fungal), CHF (NYHA III-IV), demyelinating disease, malignancy, live vaccinesInfusion reactions (fever, chills, urticaria, hypotension), infections (TB reactivation - screen!), lymphoma, HACA formation, paradoxical psoriasis, drug-induced lupus, demyelinationMethotrexate/AZA - co-administration reduces immunogenicity; Live vaccines CI; Abatacept - avoid combination (↑ infection)
Adalimumab (fully human IgG1)Induction: 160 mg SC wk 0, 80 mg wk 2; Maintenance: 40 mg SC q2 weeksModerate-severe CD and UC; fistulizing CD; pediatric CDSame as infliximabInjection site reactions, infections, lymphoma, HACA rare (fully human)Same class; AZA/MTX reduce immunogenicity
Certolizumab pegol (PEGylated Fab' fragment)400 mg SC at wk 0, 2, 4; then 400 mg q4 weeksModerate-severe CDSame as infliximabInjection site reactions, infections; does NOT cross placenta (PEGylated) - preferred in pregnancySame class
Golimumab (fully human IgG1)200 mg SC wk 0, 100 mg wk 2; Maintenance: 100 mg SC q4 weeksModerate-severe UC (not approved for CD)Same as infliximabSimilar to other anti-TNFsSame class
Pre-biologic checklist: Screen for TB (Mantoux/IGRA), hepatitis B, HIV, varicella, update vaccines, rule out active infection.

5b. Anti-Integrin Antibodies (Gut-Selective)

Short Introduction: Block leukocyte trafficking specifically to the GUT by targeting α4β7 integrin - MAdCAM-1 interaction. More gut-selective = lower risk of systemic infections compared to anti-TNF agents.
MOA Flowchart:
α4β7 integrin expressed on activated T-lymphocytes
          │
          ▼
Binds MAdCAM-1 (mucosal addressin cell adhesion molecule-1)
on intestinal vascular endothelium
          │
          ▼
Lymphocyte trafficking INTO gut mucosa
          │ ← BLOCKED BY VEDOLIZUMAB
          │
Vedolizumab (humanized IgG1 anti-α4β7)
          │
          ▼
Prevents lymphocyte homing to gut
          │
          ▼
↓ Mucosal T-cell and B-cell infiltration
↓ Mucosal inflammation
(Gut-selective: does NOT block α4β1 → No CNS effects)
Slower onset than anti-TNF; used mainly for MAINTENANCE
DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
VedolizumabInduction: 300 mg IV at wk 0, 2, 6; Maintenance: 300 mg IV q8 weeksModerate-severe UC and CD (especially after anti-TNF failure or as first-line biologic)Active infection, active TB, prior natalizumab use (washout period)Nasopharyngitis, headache, arthralgia, infusion reactions; LOW systemic infection risk; No PML risk (gut-selective)Limited interactions; avoid live vaccines
Natalizumab (anti-α4 integrin - not gut selective)300 mg IV q4 weeksModerate-severe CD (reserved - rarely used)Prior PML, JC virus antibody positive, combining with immunosuppressantsProgressive Multifocal Leukoencephalopathy (PML) - serious CNS complication; JC virus reactivation; headache; fatigueAZA/MTX - avoid combination (↑ PML risk); Live vaccines CI

5c. Anti-IL-12/23 Antibodies

Short Introduction: Target p40 subunit shared by IL-12 and IL-23, both driving TH1 and TH17 inflammation. Favourable safety profile - no significant systemic immunosuppression.
MOA Flowchart:
IL-12 (drives TH1 differentiation → IFN-γ)
IL-23 (drives TH17 differentiation → IL-17)
Both share p40 subunit
          │ ← BLOCKED BY USTEKINUMAB
          │
Ustekinumab binds p40 subunit (IL-12 + IL-23)
          │
          ▼
↓ TH1 and TH17 cell differentiation
          │
          ▼
↓ IFN-γ, ↓ IL-17, ↓ TNF-α
          │
          ▼
↓ Mucosal inflammation in CD and UC
DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
UstekinumabInduction: IV dose based on weight (~260-520 mg single dose); Maintenance: 90 mg SC q8-12 weeksModerate-severe CD; UC (after anti-TNF failure)Active infection, active TBGenerally well-tolerated; nasopharyngitis, headache, injection site reactions; Low infection risk; Low immunogenicity (fully human)Avoid live vaccines; Limited drug interactions

CLASS 6: JAK INHIBITORS (Small Molecules)

Short Introduction: Oral small molecules targeting Janus Kinases (JAK1/JAK3), blocking cytokine signaling (including IL-2, IL-4, IL-6, IL-12, IL-23). Advantage: oral administration. Approved for UC; under investigation for CD.
MOA Flowchart:
Multiple cytokines (IL-2, IL-4, IL-6, IL-12, IL-23, IFN-γ)
bind their respective cell surface receptors
          │
          ▼
Receptor-associated JAK kinases (JAK1, JAK2, JAK3, TYK2) activated
          │
          ▼
JAK phosphorylates STAT proteins
          │
          ▼
pSTAT dimers enter nucleus → Transcription of pro-inflammatory genes
          │ ← BLOCKED BY JAK INHIBITORS
          │
Tofacitinib (JAK1/3 inhibitor)
Upadacitinib (selective JAK1)
Filgotinib (selective JAK1)
          │
          ▼
↓ STAT activation → ↓ Cytokine gene transcription
          │
          ▼
↓ T-cell activation, ↓ NK cell activation
↓ Mucosal inflammation → Remission in UC
DrugDoseIndicationContraindicationKey ADRKey Drug Interactions
Tofacitinib (JAK1/3)Induction: 10 mg bid x8 wk; Maintenance: 5 mg bidModerate-severe UCActive infection, TB, malignancy, pregnancy, age >65 (↑ MACE/VTE risk), current/prior smokers (cautious with 10 mg dose)Herpes zoster reactivation (important!), opportunistic infections, hyperlipidemia, MACE (cardiovascular events - black box warning), VTE (pulmonary embolism - black box warning), malignancyCYP3A4 inhibitors ↑ levels; CYP3A4 inducers ↓ levels; Avoid live vaccines; immunosuppressants ↑ infection risk
Upadacitinib (selective JAK1)Induction: 45 mg daily x8 wk; Maintenance: 15 mg dailyModerate-severe UC; moderate-severe CDSimilar to tofacitinibSimilar; herpes zoster; MACE/VTE riskCYP3A4 interactions
Filgotinib (selective JAK1)200 mg once dailyModerate-severe UCSimilarSimilar (lower VTE/MACE signal)CYP3A4

CLASS 7: ANTIBIOTICS (Adjunctive)

DrugDoseIndicationKey ADR
Metronidazole10-20 mg/kg/dayPerianal CD, fistulizing CD, pouchitisPeripheral neuropathy (long-term), metallic taste, disulfiram-like reaction with alcohol
Ciprofloxacin500 mg bidPerianal CD (often combined with metronidazole), pouchitisTendinopathy, C. difficile risk, QT prolongation
Rifaximin400 mg tidCD (induction, some evidence)Generally well tolerated

10. PHARMACOLOGICAL TREATMENT SUMMARY CHART

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
         IBD PHARMACOLOGICAL TREATMENT SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CLASS       │ DRUGS              │ UC  │ CD  │ INDUCE │ MAINTAIN
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
5-ASA       │ Sulfasalazine      │ ✓✓  │ ±   │ Yes    │ Yes
            │ Mesalamine         │ ✓✓  │ ±   │ Yes    │ Yes
            │ Olsalazine         │ ✓   │ -   │ No     │ Yes
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
STEROIDS    │ Prednisolone       │ ✓✓  │ ✓✓  │ Yes    │ NO
            │ Budesonide         │ ✓   │ ✓✓  │ Yes    │ NO
            │ Hydrocortisone IV  │ ✓✓  │ ✓   │ Yes    │ NO
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
THIOPURINES │ Azathioprine       │ ✓✓  │ ✓✓  │ NO     │ Yes
            │ 6-MP               │ ✓✓  │ ✓✓  │ NO     │ Yes
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
MTX         │ Methotrexate       │ ±   │ ✓✓  │ Yes    │ Yes
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
CALCINEURIN │ Cyclosporine       │ ✓✓  │ ±   │ Yes    │ NO (bridge)
            │ (rescue only)      │     │     │        │
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
ANTI-TNF    │ Infliximab         │ ✓✓  │ ✓✓  │ Yes    │ Yes
            │ Adalimumab         │ ✓✓  │ ✓✓  │ Yes    │ Yes
            │ Certolizumab       │ -   │ ✓✓  │ Yes    │ Yes
            │ Golimumab          │ ✓✓  │ -   │ Yes    │ Yes
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
ANTI-INTEGRIN│ Vedolizumab       │ ✓✓  │ ✓✓  │ Yes    │ Yes
             │ Natalizumab       │ -   │ ✓   │ Yes    │ Yes
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
ANTI-IL12/23│ Ustekinumab       │ ✓✓  │ ✓✓  │ Yes    │ Yes
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
JAK INHIBIT.│ Tofacitinib       │ ✓✓  │ ±   │ Yes    │ Yes
            │ Upadacitinib      │ ✓✓  │ ✓✓  │ Yes    │ Yes
            │ Filgotinib        │ ✓✓  │ -   │ Yes    │ Yes
━━━━━━━━━━━━┿━━━━━━━━━━━━━━━━━━━━┿━━━━━┿━━━━━┿━━━━━━━━┿━━━━━━━━
ANTIBIOTICS │ Metronidazole     │ -   │ ✓   │ Adj.   │ Adj.
            │ Ciprofloxacin     │ -   │ ✓   │ Adj.   │ Adj.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓✓ = Well established; ✓ = Used; ± = Limited/conflicting evidence
- = Not approved; Adj. = Adjunctive

KEY DRUG INTERACTIONS - QUICK REFERENCE

InteractionClinical ConsequenceAction
AZA/6-MP + Allopurinol↑ 6-TGN toxicity (bone marrow suppression)Reduce AZA/6-MP dose by 75%
AZA/6-MP + Mesalamine/SulfasalazineTPMT inhibition → ↑ 6-TGNMonitor CBC closely
MTX + NSAIDs↑ MTX toxicity (renal clearance reduced)Avoid or use caution
MTX + Alcohol↑ HepatotoxicityAvoid alcohol
Cyclosporine + Nephrotoxins↑ Renal failureAvoid combination
Budesonide + CYP3A4 inhibitors (azoles, macrolides)↑ Budesonide levels → systemic effectsReduce dose / avoid
Anti-TNF + Live vaccinesVaccine-related infectionCI - give vaccines before starting biologics
Tofacitinib + CYP3A4 inhibitors↑ Tofacitinib exposureDose reduce to 5 mg bid
Infliximab + AZA/MTXReduces immunogenicity (HACA)Beneficial combination for some patients

TREATMENT ALGORITHM (SIMPLIFIED)

MILD DISEASE (UC):
  5-ASA (topical if proctitis; oral if extensive) → Response? → Maintain
  If no response → Budesonide/Prednisolone → Induce, then taper
  If steroid-dependent → Add thiopurine/MTX

MODERATE-SEVERE DISEASE (UC or CD):
  Corticosteroids (induce) + Immunomodulator or Biologic
  "Top-down" approach preferred for high-risk patients:
  → Anti-TNF (infliximab/adalimumab) ± Immunomodulator (combo)
  → OR Vedolizumab (gut-selective, esp. UC)
  → OR Ustekinumab (esp. CD or anti-TNF failure)
  → OR JAK inhibitor (oral, UC)

REFRACTORY / SEVERE ACUTE UC:
  IV Methylprednisolone/Hydrocortisone
  If no response in 72 hours → Rescue:
    • Infliximab (5 mg/kg IV)
    • Cyclosporine (IV 2-4 mg/kg/day)
    • If rescue fails → COLECTOMY

PERIANAL CD:
  Antibiotics (metronidazole + ciprofloxacin)
  + Anti-TNF (infliximab preferred)
  + Surgical drainage if abscess

Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics; Yamada's Textbook of Gastroenterology 7th ed.; Sleisenger & Fordtran's Gastrointestinal and Liver Disease; Schwartz's Principles of Surgery 11th ed.; Sabiston Textbook of Surgery

Create a Word document version of these notes for easy sharing

Reading File
Running Command

ls -la /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace && echo "Created workspace"

Running Command

mkdir -p /tmp/workspace/ibd-notes && echo "Directory ready"

Writing File

~/ibd-notes/build_ibd_doc.py

from docx import Document
from docx.shared import Pt, Inches, RGBColor, Cm
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.table import WD_TABLE_ALIGNMENT, WD_ALIGN_VERTICAL
from docx.oxml.ns import qn
from docx.oxml import OxmlElement
import copy

doc = Document()

# ── Page margins ──────────────────────────────────────────────────────────────
for section in doc.sections:
    section.top_margin    = Cm(2.0)
    section.bottom_margin = Cm(2.0)
    section.left_margin   = Cm(2.2)
    section.right_margin  = Cm(2.2)

# ── Base font ─────────────────────────────────────────────────────────────────
normal = doc.styles["Normal"]
normal.font.name = "Calibri"
normal.font.size = Pt(11)

# ── Helper: set paragraph shading ────────────────────────────────────────────
def shade_paragraph(para, hex_color):
    pPr = para._p.get_or_add_pPr()
    shd = OxmlElement("w:shd")
    shd.set(qn("w:val"), "clear")
    shd.set(qn("w:color"), "auto")
    shd.set(qn("w:fill"), hex_color)
    pPr.append(shd)

# ── Helper: shade table cell ─────────────────────────────────────────────────
def shade_cell(cell, hex_color):
    tc   = cell._tc
    tcPr = tc.get_or_add_tcPr()
    shd  = OxmlElement("w:shd")
    shd.set(qn("w:val"),   "clear")
    shd.set(qn("w:color"), "auto")
    shd.set(qn("w:fill"),  hex_color)
    tcPr.append(shd)

# ── Helper: bold run ──────────────────────────────────────────────────────────
def add_bold(para, text):
    run = para.add_run(text)
    run.bold = True
    return run

# ── Helper: add a simple monospace block (for flowcharts) ────────────────────
def add_code_block(text):
    for line in text.strip("\n").split("\n"):
        p = doc.add_paragraph(style="Normal")
        p.paragraph_format.left_indent  = Inches(0.3)
        p.paragraph_format.space_before = Pt(0)
        p.paragraph_format.space_after  = Pt(0)
        run = p.add_run(line if line else " ")
        run.font.name = "Courier New"
        run.font.size = Pt(9)
    doc.add_paragraph()   # spacer

# ── Helper: section heading with coloured background ─────────────────────────
def add_section_heading(text, level=1, bg="1F4E79", fg="FFFFFF"):
    p = doc.add_heading(text, level=level)
    p.runs[0].font.color.rgb = RGBColor.from_string(fg)
    p.runs[0].font.bold = True
    if level == 1:
        p.runs[0].font.size = Pt(14)
    elif level == 2:
        p.runs[0].font.size = Pt(12)
    shade_paragraph(p, bg)
    return p

# ── Helper: key-value info paragraph ─────────────────────────────────────────
def kv(label, value):
    p = doc.add_paragraph(style="Normal")
    p.paragraph_format.space_after = Pt(2)
    add_bold(p, label + ": ")
    p.add_run(value)

# ── Helper: bullet ────────────────────────────────────────────────────────────
def bullet(text, bold_prefix=None):
    p = doc.add_paragraph(style="List Bullet")
    p.paragraph_format.space_after = Pt(2)
    if bold_prefix:
        add_bold(p, bold_prefix)
        p.add_run(text)
    else:
        p.add_run(text)

# ── Helper: add a table with headers ────────────────────────────────────────
def make_table(headers, rows, col_widths=None, header_bg="2E75B6"):
    tbl = doc.add_table(rows=1 + len(rows), cols=len(headers))
    tbl.style = "Table Grid"
    tbl.alignment = WD_TABLE_ALIGNMENT.LEFT

    # Header row
    for i, h in enumerate(headers):
        cell = tbl.cell(0, i)
        shade_cell(cell, header_bg)
        p = cell.paragraphs[0]
        run = p.add_run(h)
        run.bold = True
        run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF)
        run.font.size = Pt(9)
        p.alignment = WD_ALIGN_PARAGRAPH.CENTER
        cell.vertical_alignment = WD_ALIGN_VERTICAL.CENTER

    # Data rows
    for r_idx, row in enumerate(rows):
        bg = "DEEAF1" if r_idx % 2 == 0 else "FFFFFF"
        for c_idx, cell_text in enumerate(row):
            cell = tbl.cell(r_idx + 1, c_idx)
            shade_cell(cell, bg)
            p = cell.paragraphs[0]
            # Support **bold** inside cell_text
            parts = str(cell_text).split("**")
            for idx, part in enumerate(parts):
                if not part:
                    continue
                run = p.add_run(part)
                run.bold = (idx % 2 == 1)
                run.font.size = Pt(9)
            cell.vertical_alignment = WD_ALIGN_VERTICAL.CENTER

    # Column widths
    if col_widths:
        for r_idx in range(len(rows) + 1):
            for c_idx, w in enumerate(col_widths):
                tbl.cell(r_idx, c_idx).width = Inches(w)

    doc.add_paragraph()
    return tbl

# ─────────────────────────────────────────────────────────────────────────────
#  TITLE PAGE
# ─────────────────────────────────────────────────────────────────────────────
title = doc.add_heading("IBD THERAPEUTICS 3", level=0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
title.runs[0].font.color.rgb = RGBColor(0x1F, 0x4E, 0x79)
title.runs[0].font.size = Pt(22)
shade_paragraph(title, "D6E4F0")

sub = doc.add_paragraph("Comprehensive Study Notes")
sub.alignment = WD_ALIGN_PARAGRAPH.CENTER
sub.runs[0].font.size = Pt(13)
sub.runs[0].font.italic = True
sub.runs[0].font.color.rgb = RGBColor(0x2E, 0x75, 0xB6)

sub2 = doc.add_paragraph("Sources: Goodman & Gilman's | Yamada's Gastroenterology | Sleisenger & Fordtran's | Schwartz's Surgery | Sabiston Surgery")
sub2.alignment = WD_ALIGN_PARAGRAPH.CENTER
sub2.runs[0].font.size = Pt(9)
sub2.runs[0].font.color.rgb = RGBColor(0x60, 0x60, 0x60)

doc.add_paragraph()

# ─────────────────────────────────────────────────────────────────────────────
#  1. INTRODUCTION
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("1. INTRODUCTION", level=1)
p = doc.add_paragraph(
    "Inflammatory Bowel Disease (IBD) represents a group of chronic, idiopathic, relapsing-remitting "
    "inflammatory disorders of the gastrointestinal tract. The two major forms are Crohn's Disease (CD) "
    "and Ulcerative Colitis (UC). IBD significantly impairs quality of life and carries risks of serious "
    "complications including colorectal cancer, strictures, fistulae, and need for surgery. Management has "
    "evolved dramatically over the past 25 years — from a 'bottom-up' to a 'top-down' approach with the "
    "advent of biologic therapies."
)
p.paragraph_format.space_after = Pt(6)

# ─────────────────────────────────────────────────────────────────────────────
#  2. DEFINITION
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("2. DEFINITION", level=1)
make_table(
    headers=["Feature", "Ulcerative Colitis (UC)", "Crohn's Disease (CD)"],
    rows=[
        ["Location", "Colon only; continuous from rectum", "Any GI tract (mouth to anus); skip lesions"],
        ["Depth of inflammation", "Mucosal/submucosal only", "Transmural (full thickness)"],
        ["Rectal involvement", "Always", "Variable"],
        ["Granulomas", "Absent", "Present (non-caseating)"],
        ["Fistulae/strictures", "Rare", "Common"],
        ["Colonoscopic pattern", "Diffuse, continuous", "Cobblestone, aphthous ulcers, bear claw ulcers"],
    ],
    col_widths=[1.8, 2.4, 2.4],
)

# ─────────────────────────────────────────────────────────────────────────────
#  3. ETIOLOGY
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("3. ETIOLOGY", level=1)
p = doc.add_paragraph("IBD is ")
add_bold(p, "multifactorial")
p.add_run(" — no single cause. Four key domains:")
p.paragraph_format.space_after = Pt(4)

etiology_domains = [
    ("GENETIC FACTORS",
     ["NOD2 gene (chr 16) — strongest CD association",
      "ATG16L1 (chr 2) — muramyl dipeptide response",
      "IRGM (chr 5) — intracellular pathogen clearance",
      "Polygenic; 50% MZ twin concordance; 10% DZ concordance",
      "10–30% of patients have ≥1 affected family member"]),
    ("ENVIRONMENTAL FACTORS",
     ["High-fat/low-fibre Western diet",
      "Tobacco use (worsens CD; may mildly protect UC)",
      "Alcohol and OCP use",
      "NSAIDs (exacerbate IBD)",
      "Hygiene hypothesis — reduced microbial exposure"]),
    ("IMMUNE DYSREGULATION",
     ["Defective mucosal epithelial barrier",
      "Abnormal TH1/TH2 T-cell activation balance",
      "Excess IL-12, IL-23 from dendritic cells",
      "Autoimmune component postulated",
      "Chronic immune dysregulation + gut microbes"]),
    ("MICROBIAL FACTORS",
     ["Gut dysbiosis — altered microbiome composition",
      "↑ E. coli, Serratia marcescens, Candida tropicalis in CD",
      "Possible role of M. paratuberculosis in CD",
      "Veillonella enrichment in UC + PSC patients",
      "Impaired pathogen clearance (IRGM mutations)"]),
]

for domain, items in etiology_domains:
    p = doc.add_paragraph()
    shade_paragraph(p, "EBF3FF")
    add_bold(p, domain)
    p.paragraph_format.space_before = Pt(4)
    p.paragraph_format.space_after = Pt(2)
    for item in items:
        bullet(item)
    doc.add_paragraph().paragraph_format.space_after = Pt(2)

# ─────────────────────────────────────────────────────────────────────────────
#  4. PATHOPHYSIOLOGY FLOWCHART
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("4. PATHOPHYSIOLOGY (FLOWCHART)", level=1)
add_code_block("""
TRIGGER  (Genetic susceptibility + Environmental factor + Dysbiosis)
          │
          ▼
IMPAIRED INTESTINAL EPITHELIAL BARRIER
(Tight junction breakdown, altered mucus layer)
          │
          ▼
BACTERIAL ANTIGENS PENETRATE INTO LAMINA PROPRIA
          │
          ▼
ANTIGEN-PRESENTING CELLS (Dendritic Cells / Macrophages) ACTIVATED
Secrete: IL-12 and IL-23
          │
   ┌──────┴──────┐
   ▼             ▼
 TH1 Response  TH2 Response
 (CD dominant) (UC dominant)
   │
   ▼
IFN-γ + TNF-α released
          │
          ▼
MACROPHAGE ACTIVATION  →  MORE IFN-γ, TNF-α, IL-1, IL-6
          │
          ▼
NEUTROPHIL RECRUITMENT (via adhesion molecules / integrins α4β7)
          │
          ▼
CRYPT ABSCESSES + MUCOSAL ULCERATION
          │
    ┌─────┴─────┐
    ▼           ▼
  UC            CD
(Mucosal only)  (Transmural → granulomas, fistulae, strictures)
          │
          ▼
CHRONIC RELAPSING INFLAMMATION → Fibrosis → CRC risk

Key cytokines: TNF-α, IL-12, IL-23, IL-6, IFN-γ
Key pathways:  NF-κB activation | JAK-STAT signalling | Integrin-mediated leukocyte trafficking
""")

# ─────────────────────────────────────────────────────────────────────────────
#  5. CLINICAL FEATURES
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("5. CLINICAL FEATURES", level=1)

add_section_heading("5a. Ulcerative Colitis", level=2, bg="2E75B6")
make_table(
    headers=["System", "Feature"],
    rows=[
        ["GI (hallmark)", "Bloody diarrhoea, mucus in stool, tenesmus, urgency, crampy abdominal pain"],
        ["Constitutional", "Fatigue, weight loss, fever in severe disease"],
        ["Severity: Mild", "< 4 stools/day, no systemic features"],
        ["Severity: Moderate", "4–6 stools/day, mild systemic features"],
        ["Severity: Severe", "> 6 stools/day + systemic features (tachycardia, fever, anaemia)"],
    ],
    col_widths=[1.8, 4.8],
)

add_section_heading("5b. Crohn's Disease", level=2, bg="2E75B6")
make_table(
    headers=["System", "Feature"],
    rows=[
        ["GI", "Abdominal pain (RLQ most common), non-bloody or blood-tinged diarrhoea, nausea, vomiting"],
        ["Perianal", "Fistulae, abscesses, skin tags, anal fissures — hallmark of CD"],
        ["Constitutional", "Weight loss, fever, malnutrition, growth failure in children"],
        ["Complications", "Strictures (bowel obstruction), fistulae, intra-abdominal abscesses, perianal disease"],
    ],
    col_widths=[1.8, 4.8],
)

add_section_heading("5c. Extra-intestinal Manifestations (Both)", level=2, bg="2E75B6")
make_table(
    headers=["System", "Manifestation"],
    rows=[
        ["Joints", "Peripheral arthropathy, Ankylosing spondylitis, Sacroiliitis"],
        ["Eyes", "Episcleritis, Uveitis, Iritis"],
        ["Skin", "Erythema nodosum, Pyoderma gangrenosum"],
        ["Liver/Biliary", "Primary Sclerosing Cholangitis (especially UC)"],
        ["Other", "Aphthous mouth ulcers, Venous thromboembolism, Anaemia"],
    ],
    col_widths=[1.8, 4.8],
)

# ─────────────────────────────────────────────────────────────────────────────
#  6. DIAGNOSIS
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("6. DIAGNOSIS", level=1)
add_code_block("""
History + Physical Examination
          │
          ▼
LABORATORY TESTS
  • CBC (anaemia, leukocytosis)          • ESR, CRP (inflammation markers)
  • Fecal calprotectin (> 50–150 µg/g)   • Albumin (nutritional status)
  • Stool culture (exclude infection)    • ANCA (UC+), ASCA (CD+)
          │
          ▼
ENDOSCOPY (Gold Standard)
  • Colonoscopy + biopsy (both UC and CD)
  • Upper GI endoscopy + small bowel capsule (CD)
          │
          ▼
HISTOLOGY
  • UC: Crypt distortion, crypt abscesses, goblet cell depletion,
        mucosal infiltrate — NO granulomas
  • CD: Non-caseating granulomas, transmural inflammation, fissuring ulcers
          │
          ▼
IMAGING (CD especially)
  • CT/MRI enterography (small bowel, fistulae, abscesses)
  • Abdominal X-ray (toxic megacolon: colonic dilation > 6 cm)
  • Barium studies (string sign = ileal stricture in CD)
""")

p = doc.add_paragraph()
add_bold(p, "Activity Indices: ")
p.add_run("UC: Mayo Score, Truelove & Witts criteria   |   CD: CDAI, Harvey-Bradshaw Index")
p.paragraph_format.space_after = Pt(6)

# ─────────────────────────────────────────────────────────────────────────────
#  7. TREATMENT GOALS
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("7. TREATMENT GOALS", level=1)

short_goals = [
    "Induce clinical remission (relief of symptoms)",
    "Reduce mucosal inflammation",
    "Avoid hospitalisation and surgery",
]
long_goals = [
    "Maintain steroid-free remission",
    'Achieve mucosal healing (endoscopic + histologic) — associated with reduced surgery, hospitalisation, CRC risk',
    'Achieve "DEEP REMISSION" = Clinical remission + Normalised CRP + Mucosal healing',
    "Prevent disease progression (strictures, fistulae, cancer)",
    "Improve health-related quality of life",
    "Minimise drug toxicity",
]

p = doc.add_paragraph()
add_bold(p, "Short-Term Goals:")
for g in short_goals:
    bullet(g)

p = doc.add_paragraph()
add_bold(p, "Long-Term Goals:")
for g in long_goals:
    bullet(g)

doc.add_paragraph()

# ─────────────────────────────────────────────────────────────────────────────
#  8. NON-PHARMACOLOGICAL TREATMENT
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("8. NON-PHARMACOLOGICAL TREATMENT", level=1)
make_table(
    headers=["Approach", "Details"],
    rows=[
        ["**Dietary Modification**",
         "Low-residue diet during flares; avoid trigger foods; adequate nutrition; elemental diet in paediatric CD"],
        ["**Exclusive Enteral Nutrition (EEN)**",
         "Especially in children with CD; induces remission; avoids steroids. Liquid formula diet."],
        ["**Smoking Cessation**",
         "Smoking worsens CD; paradoxically may mildly protect UC, but cessation is always recommended"],
        ["**Stress Management**",
         "Psychological stress triggers flares; CBT and mindfulness-based therapy are supported"],
        ["**Exercise**",
         "Regular moderate exercise associated with reduced relapse rates"],
        ["**Probiotics**",
         "Strongest evidence for VSL#3 in UC maintenance; limited data in CD"],
        ["**Fecal Microbiota Transplantation**",
         "Emerging evidence in UC; not yet standard of care"],
        ["**Surgery**",
         "UC: Proctocolectomy is curative. CD: Resection is NOT curative; reserved for refractory disease and complications (fistulae, obstruction, abscess)"],
        ["**Nutritional Support**",
         "Correct iron deficiency anaemia; supplement B12, folate (note: sulfasalazine inhibits folate absorption), Vitamin D, Calcium"],
        ["**CRC Surveillance**",
         "Colonoscopy after 7–8 years of extensive colitis, then every 1–3 years depending on risk"],
    ],
    col_widths=[2.0, 4.6],
)

# ─────────────────────────────────────────────────────────────────────────────
#  9. PHARMACOLOGICAL TREATMENT
# ─────────────────────────────────────────────────────────────────────────────
add_section_heading("9. PHARMACOLOGICAL TREATMENT", level=1)

p = doc.add_paragraph()
add_bold(p, "Drug Class Overview:")
p.paragraph_format.space_after = Pt(4)

classes = [
    "CLASS 1: AMINOSALICYLATES (5-ASA Agents)",
    "CLASS 2: CORTICOSTEROIDS",
    "CLASS 3: IMMUNOMODULATORS (Thiopurines + Methotrexate)",
    "CLASS 4: CALCINEURIN INHIBITORS",
    "CLASS 5: BIOLOGICS",
    "         5a. Anti-TNF-α Antibodies",
    "         5b. Anti-Integrin Antibodies",
    "         5c. Anti-IL-12/23 Antibodies",
    "CLASS 6: JAK INHIBITORS (Small Molecules)",
    "CLASS 7: ANTIBIOTICS (Adjunctive)",
]
for c in classes:
    bullet(c)

doc.add_paragraph()

# ──────────────────────────────────────────────────────────────────────────────
# CLASS 1: AMINOSALICYLATES
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("CLASS 1: AMINOSALICYLATES (5-ASA Agents)", level=2, bg="1A6B3C", fg="FFFFFF")

p = doc.add_paragraph(
    "First-line agents for mild-to-moderate UC. Deliver 5-aminosalicylic acid (5-ASA) to the intestinal "
    "mucosa. The therapeutic moiety is 5-ASA; sulfapyridine in sulfasalazine is the carrier (and source "
    "of most side effects). Newer 5-ASA formulations (mesalamine, olsalazine, balsalazide) reduce "
    "sulfapyridine-related toxicity."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Aminosalicylates", level=2, bg="4CAF7D", fg="FFFFFF")
add_code_block("""
5-ASA delivered to intestinal mucosa
          │
   ┌──────┼────────────────┐
   ▼      ▼                ▼
Inhibits  Activates     Scavenges
NF-κB     PPAR-γ        free radicals
(↓ pro-   (anti-         & oxidants
 inflam-   inflam-
 matory    matory
 cytokines) transcription)
          │
          ▼
Inhibits lipoxygenase → ↓ leukotriene synthesis
          │
          ▼
↓ IL-1, TNF-α production | ↓ T-cell activation
          │
          ▼
↓ Mucosal inflammation
(Exact mechanism not fully elucidated)
""")

add_section_heading("Drug Summary — CLASS 1", level=2, bg="1A6B3C", fg="FFFFFF")
make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Sulfasalazine**",
         "Induction: 500–1000 mg q6–8h (max 5 g/day)\nMaintenance: 2 g/day",
         "Mild–moderate UC; UC maintenance; mild CD colitis; articular EIMs",
         "Sulfa allergy, G6PD deficiency, renal impairment",
         "Nausea, headache, male infertility (reversible), haemolytic anaemia, agranulocytosis, Stevens-Johnson syndrome, hepatitis",
         "↓ Digoxin absorption; inhibits folate (give folic acid); ↑ Warfarin; avoid MTX; inhibits TPMT"],
        ["**Mesalamine (5-ASA)**",
         "Oral: 2.4–4.8 g/day\nSuppository: 1 g/night\nEnema: 4 g/day",
         "Mild–moderate UC; UC maintenance; proctitis (suppository); distal UC (enema)",
         "Salicylate hypersensitivity, severe renal impairment",
         "Headache, dyspepsia, skin rash; interstitial nephritis (rare but serious); pancreatitis (rare)",
         "Monitor renal function; avoid NSAIDs"],
        ["**Olsalazine**",
         "500 mg bid–tid maintenance",
         "UC maintenance",
         "Salicylate allergy, renal failure",
         "Watery secretory diarrhoea (10–20%) — most notable ADR; GI upset",
         "Similar to mesalamine"],
        ["**Balsalazide**",
         "Induction: 2.25 g tid\nMaintenance: 1.5 g bid",
         "Mild–moderate UC",
         "Salicylate allergy",
         "Generally well tolerated; headache, GI upset",
         "Similar to mesalamine"],
    ],
    col_widths=[1.2, 1.4, 1.4, 1.2, 1.5, 1.5],
)

p = doc.add_paragraph()
p.add_run("Note: ").bold = True
p = doc.add_paragraph(style="Normal")
p.paragraph_format.left_indent = Inches(0.2)
p.add_run(
    "5-ASA agents have no established role in small bowel-only CD and limited benefit in moderate-severe CD. "
    "Rectal mesalamine (suppository/enema) is MORE effective than oral therapy for proctitis and distal colitis."
)
p.runs[0].font.italic = True
p.paragraph_format.space_after = Pt(6)

# ──────────────────────────────────────────────────────────────────────────────
# CLASS 2: CORTICOSTEROIDS
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("CLASS 2: CORTICOSTEROIDS", level=2, bg="8B0000", fg="FFFFFF")

p = doc.add_paragraph(
    "Effective for INDUCTION of remission in moderate-severe IBD. NOT used for maintenance (high toxicity, "
    "no mucosal healing). Available as systemic (prednisolone/methylprednisolone/hydrocortisone IV) and "
    "topical/gut-selective (budesonide — high first-pass metabolism, reduced systemic effects)."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Corticosteroids", level=2, bg="C0392B", fg="FFFFFF")
add_code_block("""
Corticosteroid enters cell
          │
          ▼
Binds cytosolic GLUCOCORTICOID RECEPTOR (GR)
          │
          ▼
GR-steroid complex translocates to nucleus
          │
     ┌────┴────┐
     ▼         ▼
Transactivation  Transrepression
(anti-inflam.    (inhibits NF-κB
 genes ↑)         & AP-1)
     │               │
     ▼               ▼
↑ Lipocortin-1    ↓ COX-2, ↓ PLA2
(inhibits PLA2)   ↓ TNF-α, ↓ IL-1
                  ↓ IL-6, ↓ IFN-γ
          │
          ▼
↓ Capillary permeability | ↓ Leukocyte recruitment
→ Symptomatic remission  (Does NOT achieve mucosal healing long-term)
""")

add_section_heading("Drug Summary — CLASS 2", level=2, bg="8B0000", fg="FFFFFF")
make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Prednisolone**",
         "Mild-moderate: 20–40 mg/day oral\nModerate-severe: 40–60 mg/day\nTaper over 8–12 weeks",
         "Moderate-severe UC or CD flare; bridge therapy",
         "Active infection, uncontrolled DM, active TB, psychosis, active peptic ulcer, live vaccines",
         "Hyperglycaemia, hypertension, osteoporosis, Cushingoid features, growth retardation, adrenal suppression, cataracts, glaucoma, psychosis",
         "NSAIDs → ↑ GI bleed; CYP3A4 inhibitors ↑ levels; Rifampicin ↓ levels; ↑ hyperglycaemia; ↓ vaccine response"],
        ["**Methylprednisolone**",
         "IV: 40–60 mg/day",
         "Severe acute UC (IV therapy)",
         "Same as prednisolone",
         "Same as prednisolone",
         "Same as prednisolone"],
        ["**Hydrocortisone**",
         "IV: 100–400 mg/day\nEnema: 100 mg in 60 mL retention enema",
         "Severe acute UC (IV); distal colitis (enema)",
         "Active infection",
         "Same as prednisolone; enema has significant systemic absorption",
         "Same as prednisolone"],
        ["**Budesonide**",
         "CD ileum: 9 mg/day × 8–12 wk then taper\nUC (MMX): 9 mg/day",
         "Mild-moderate CD (ileocaecal); mild-moderate UC (MMX formulation)",
         "Active infection",
         "Much fewer systemic effects; still possible adrenal suppression with prolonged use",
         "CYP3A4 inhibitors (azole antifungals, macrolides) ↑ budesonide levels significantly"],
        ["**Beclomethasone dipropionate**",
         "5 mg/day oral",
         "Mild-moderate UC",
         "Active infection",
         "Minimal systemic effects (high first-pass metabolism)",
         "CYP3A4 inhibitors"],
    ],
    col_widths=[1.2, 1.3, 1.3, 1.3, 1.5, 1.6],
)

# ──────────────────────────────────────────────────────────────────────────────
# CLASS 3: IMMUNOMODULATORS
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("CLASS 3: IMMUNOMODULATORS", level=2, bg="4A235A", fg="FFFFFF")

add_section_heading("3a. Thiopurines", level=2, bg="7D3C98", fg="FFFFFF")
p = doc.add_paragraph(
    "Used for MAINTENANCE of remission in both UC and CD, and for steroid-sparing. "
    "Slow onset (3–6 months) — require concurrent bridging therapy. "
    "TPMT genotyping is mandatory before initiation to predict toxicity risk."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Thiopurines", level=2, bg="9B59B6", fg="FFFFFF")
add_code_block("""
Azathioprine (prodrug)
          │
          ▼  (non-enzymatic)
6-Mercaptopurine (6-MP)
          │
   ┌──────┼──────┐
   ▼      ▼      ▼
HGPRT   TPMT    XO
   │      │       │
   ▼      ▼       ▼
6-TGN  6-MMP  6-Thiouric acid
(active (inactive)  (excreted)
 metabolite)
   │
   ▼
6-Thioguanine nucleotides
incorporated into DNA
→ Inhibit de novo purine synthesis
   │
   ▼
↓ T and B lymphocyte proliferation
   │
   ▼
↓ IL-2, IL-6 → ↓ Mucosal inflammation → Maintenance of remission

CRITICAL INTERACTION: Allopurinol inhibits XO
→ ↑ 6-TGN → Severe myelosuppression if dose not reduced by 75%
""")

make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Azathioprine (AZA)**",
         "2–2.5 mg/kg/day oral",
         "Maintenance remission UC & CD; steroid-sparing; combined with anti-TNF to reduce immunogenicity",
         "Low TPMT activity, active infection, pregnancy (relative CI), lymphoma history",
         "Myelosuppression (CBC monitoring essential!), hepatotoxicity, pancreatitis (5%), nausea, opportunistic infections, lymphoma (rare, especially with EBV+), NMSC",
         "ALLOPURINOL: reduce AZA dose by 75% (blocks XO); Mesalamine/sulfasalazine inhibit TPMT → ↑ toxicity; Warfarin effect reduced"],
        ["**6-Mercaptopurine (6-MP)**",
         "1–1.5 mg/kg/day oral",
         "Same as AZA",
         "Same as AZA",
         "Same as AZA",
         "Same as AZA — ALLOPURINOL interaction critical"],
    ],
    col_widths=[1.2, 1.0, 1.3, 1.3, 1.6, 1.8],
)

add_section_heading("3b. Methotrexate", level=2, bg="7D3C98", fg="FFFFFF")
p = doc.add_paragraph(
    "Used primarily in CD (limited evidence in UC). Folate antagonist. Useful for steroid-dependent or "
    "steroid-resistant CD. Also effective for articular extra-intestinal manifestations."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Methotrexate", level=2, bg="9B59B6", fg="FFFFFF")
add_code_block("""
Methotrexate
     │
     ▼
Inhibits DHFR (dihydrofolate reductase)
     │
     ▼
↓ THF (tetrahydrofolate)
     │
     ▼
↓ Purine synthesis & thymidylate synthesis
     │
     ▼
↓ Lymphocyte proliferation
     │
     ▼
Also: ↑ Adenosine release → additional anti-inflammatory effect
     │
     ▼
↓ IL-1, IL-2, IL-6 → ↓ Mucosal inflammation
""")

make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Methotrexate**",
         "Induction: 25 mg IM/SC weekly × 16 wk\nMaintenance: 15 mg IM/SC weekly\n+ Folic acid 5 mg weekly",
         "Steroid-dependent/refractory CD; CD maintenance; articular EIMs",
         "Pregnancy (ABSOLUTE CI — teratogenic), breastfeeding, hepatic disease, renal failure, significant alcohol use, pulmonary fibrosis",
         "Nausea, hepatotoxicity/fibrosis, pulmonary toxicity (pneumonitis), myelosuppression, teratogenicity (men AND women — contraception essential), oral ulcers",
         "NSAIDs/aspirin → ↑ MTX toxicity; Trimethoprim → ↑ myelosuppression; Alcohol → ↑ hepatotoxicity; Sulfasalazine → ↑ toxicity; Folate supplementation reduces mucosal toxicity"],
    ],
    col_widths=[1.2, 1.3, 1.3, 1.3, 1.6, 1.5],
)

# ──────────────────────────────────────────────────────────────────────────────
# CLASS 4: CALCINEURIN INHIBITORS
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("CLASS 4: CALCINEURIN INHIBITORS", level=2, bg="1A4A6B", fg="FFFFFF")
p = doc.add_paragraph(
    "Reserved for severe, steroid-refractory IBD (especially fulminant UC as 'rescue therapy'). "
    "Short-term use only due to significant toxicity profile. Bridge to colectomy or biologic therapy."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Calcineurin Inhibitors", level=2, bg="2980B9", fg="FFFFFF")
add_code_block("""
Cyclosporine → binds Cyclophilin
Tacrolimus   → binds FKBP12
          │
          ▼
Complex INHIBITS CALCINEURIN (phosphatase enzyme)
          │
          ▼
↓ Dephosphorylation of NFAT (Nuclear Factor of Activated T cells)
          │
          ▼
NFAT remains in cytoplasm → Cannot translocate to nucleus
          │
          ▼
↓ Transcription of IL-2 gene
          │
          ▼
↓ IL-2 → ↓ T-cell proliferation and activation
          │
          ▼
↓ Inflammatory cascade → ↓ Acute mucosal inflammation (rescue effect)
""")

make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Cyclosporine**",
         "IV: 2–4 mg/kg/day\nSwitch to oral after response",
         "Severe steroid-refractory UC (rescue); acute severe UC to avoid colectomy",
         "Renal insufficiency, uncontrolled hypertension, active infection, seizure disorder",
         "Nephrotoxicity (main limiting toxicity), hypertension, seizures, peripheral neuropathy, hirsutism, gingival hyperplasia, opportunistic infections (PCP prophylaxis needed)",
         "CYP3A4 inhibitors ↑ CsA levels; CYP3A4 inducers ↓ CsA levels; Nephrotoxic drugs ↑ renal toxicity; Statins → ↑ myopathy risk"],
        ["**Tacrolimus**",
         "Oral: individualised dosing (target levels)\nTopical ointment for perianal CD",
         "Severe acute steroid-resistant IBD; perianal CD",
         "Similar to CsA; caution in renal impairment; caution in diabetes",
         "Similar to CsA; more neurotoxicity; more diabetogenic",
         "Similar to CsA; extensive CYP3A4/P-glycoprotein interactions"],
    ],
    col_widths=[1.2, 1.2, 1.3, 1.3, 1.7, 1.5],
)

# ──────────────────────────────────────────────────────────────────────────────
# CLASS 5: BIOLOGICS
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("CLASS 5: BIOLOGICAL THERAPIES", level=2, bg="7D1B00", fg="FFFFFF")

# 5a Anti-TNF
add_section_heading("5a. Anti-TNF-α Monoclonal Antibodies", level=2, bg="C0392B", fg="FFFFFF")
p = doc.add_paragraph(
    "First biologics approved for IBD. Highly effective for moderate-severe CD and UC, including fistulising CD. "
    "Used for both INDUCTION and MAINTENANCE. Most immunogenic — require monitoring for anti-drug antibodies."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Anti-TNF-α", level=2, bg="E74C3C", fg="FFFFFF")
add_code_block("""
TNF-α (key proinflammatory cytokine)
Secreted by macrophages and T cells
          │ binds
          ▼
p55 and p75 TNF receptors on immune cells
→ Releases: IL-1, IL-6, IL-8
→ Upregulates: adhesion molecules, collagen production
→ Recruits: neutrophils, monocytes to mucosa
          │
          │ ← BLOCKED BY Anti-TNF-α Antibody
          │
Anti-TNF-α mAb binds BOTH soluble AND membrane-bound TNF-α
          │
          ▼
Neutralisation of TNF-α
+ Complement-mediated lysis of TNF-expressing cells
+ Induction of T-cell apoptosis
          │
          ▼
↓ TH1 cytokine cascade → ↓ Mucosal inflammation
Clinical response: ~60% at 14 days | Remission: ~30%
""")

p = doc.add_paragraph()
add_bold(p, "Pre-biologic checklist (mandatory): ")
p.add_run("Screen for TB (Mantoux/IGRA), Hepatitis B, HIV, varicella; update vaccines; rule out active infection; assess for malignancy; baseline labs.")
p.paragraph_format.space_after = Pt(4)

make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Infliximab**\n(chimeric IgG1;\n25% mouse/75% human)",
         "Induction: 5 mg/kg IV at wk 0, 2, 6\nMaintenance: 5 mg/kg IV q8 weeks",
         "Moderate-severe CD and UC; fistulising CD; paediatric CD and UC",
         "Active infection (esp. TB, fungal), CHF (NYHA III-IV), demyelinating disease, malignancy, live vaccines",
         "Infusion reactions (fever, chills, urticaria, hypotension), infections (TB reactivation), lymphoma, HACA formation, paradoxical psoriasis, drug-induced lupus, demyelination",
         "MTX/AZA — reduces immunogenicity (HACA); live vaccines CI; abatacept — avoid (↑ infection)"],
        ["**Adalimumab**\n(fully human IgG1)",
         "Induction: 160 mg SC wk 0, 80 mg wk 2\nMaintenance: 40 mg SC q2 weeks",
         "Moderate-severe CD and UC; fistulising CD; paediatric CD",
         "Same as infliximab",
         "Injection site reactions, infections, lymphoma; HACA rare (fully human)",
         "Same class; AZA/MTX reduce immunogenicity"],
        ["**Certolizumab pegol**\n(PEGylated Fab' fragment)",
         "400 mg SC at wk 0, 2, 4;\nthen 400 mg q4 weeks",
         "Moderate-severe CD (not approved for UC)",
         "Same as infliximab",
         "Injection site reactions, infections; does NOT cross placenta — preferred in pregnancy",
         "Same class"],
        ["**Golimumab**\n(fully human IgG1)",
         "200 mg SC wk 0, 100 mg wk 2;\nMaintenance: 100 mg SC q4 weeks",
         "Moderate-severe UC (NOT approved for CD)",
         "Same as infliximab",
         "Similar to other anti-TNFs; injection site reactions",
         "Same class"],
    ],
    col_widths=[1.3, 1.3, 1.3, 1.3, 1.6, 1.4],
)

# 5b Anti-integrin
add_section_heading("5b. Anti-Integrin Antibodies (Gut-Selective)", level=2, bg="1A6B3C", fg="FFFFFF")
p = doc.add_paragraph(
    "Block leukocyte trafficking specifically to the GUT by targeting α4β7 integrin - MAdCAM-1 interaction. "
    "More gut-selective = lower risk of systemic infections compared to anti-TNF agents. "
    "Slower onset (used mainly for maintenance or in patients with infection risk)."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Anti-Integrin", level=2, bg="27AE60", fg="FFFFFF")
add_code_block("""
α4β7 integrin expressed on activated T-lymphocytes
          │
          ▼
Binds MAdCAM-1 (mucosal addressin cell adhesion molecule-1)
on intestinal vascular endothelium
          │
          ▼
Lymphocyte trafficking INTO gut mucosa
          │
          │ ← BLOCKED BY VEDOLIZUMAB
          │
Vedolizumab (humanised IgG1 anti-α4β7)
Prevents lymphocyte homing to gut
          │
          ▼
↓ Mucosal T-cell and B-cell infiltration
↓ Mucosal inflammation (GUT-SELECTIVE effect)
No blockade of α4β1 → No CNS effects → No PML risk
""")

make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Vedolizumab**\n(humanised IgG1 anti-α4β7)",
         "Induction: 300 mg IV at wk 0, 2, 6\nMaintenance: 300 mg IV q8 weeks",
         "Moderate-severe UC and CD (especially after anti-TNF failure or as 1st-line biologic in patients with high infection risk)",
         "Active infection, active TB, prior natalizumab (washout period required)",
         "Nasopharyngitis, headache, arthralgia, infusion reactions; LOW systemic infection risk; NO PML risk",
         "Limited interactions; avoid live vaccines"],
        ["**Natalizumab**\n(anti-α4 integrin; NOT gut-selective)",
         "300 mg IV q4 weeks",
         "Moderate-severe CD (reserved — rarely used due to PML risk)",
         "Prior PML, JC virus antibody positive, concurrent immunosuppressants",
         "PROGRESSIVE MULTIFOCAL LEUKOENCEPHALOPATHY (PML) — serious CNS complication (JC virus reactivation); headache; fatigue; infusion reactions",
         "AZA/MTX — avoid combination (↑ PML risk); live vaccines CI"],
    ],
    col_widths=[1.5, 1.3, 1.4, 1.3, 1.7, 1.0],
)

# 5c Anti-IL-12/23
add_section_heading("5c. Anti-IL-12/23 Antibodies", level=2, bg="1A4A6B", fg="FFFFFF")
p = doc.add_paragraph(
    "Target the p40 subunit shared by IL-12 and IL-23, both driving TH1 and TH17 inflammation. "
    "Favourable safety profile — no significant systemic immunosuppression. "
    "Fully human antibody with low immunogenicity."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — Anti-IL-12/23", level=2, bg="2E86C1", fg="FFFFFF")
add_code_block("""
IL-12 (drives TH1 differentiation → IFN-γ production)
IL-23 (drives TH17 differentiation → IL-17 production)
Both share the p40 subunit
          │
          │ ← BLOCKED BY USTEKINUMAB
          │
Ustekinumab binds p40 subunit (blocks IL-12 + IL-23)
          │
          ▼
↓ TH1 and TH17 cell differentiation
          │
          ▼
↓ IFN-γ, ↓ IL-17, ↓ TNF-α
          │
          ▼
↓ Mucosal inflammation in CD and UC
""")

make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Ustekinumab**\n(fully human IgG1 anti-p40)",
         "Induction: Single IV dose (weight-based: 260–520 mg)\nMaintenance: 90 mg SC q8–12 weeks",
         "Moderate-severe CD (1st or 2nd line); moderate-severe UC (especially after anti-TNF failure)",
         "Active infection, active TB",
         "Generally well tolerated; nasopharyngitis, headache, injection site reactions; Low infection risk; Low immunogenicity",
         "Avoid live vaccines; CYP450 enzymes may be normalised after initiation (monitor drugs with narrow therapeutic index)"],
    ],
    col_widths=[1.5, 1.5, 1.5, 1.2, 1.6, 1.4],
)

# ──────────────────────────────────────────────────────────────────────────────
# CLASS 6: JAK INHIBITORS
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("CLASS 6: JAK INHIBITORS (Small Molecules)", level=2, bg="4A4A00", fg="FFFFFF")
p = doc.add_paragraph(
    "Oral small molecules targeting Janus Kinases (JAK1/JAK3), blocking intracellular cytokine signalling "
    "(IL-2, IL-4, IL-6, IL-12, IL-23, IFN-γ). Key advantage: oral administration. Approved for UC; "
    "upadacitinib also approved for CD. No immunogenicity (not a biologic)."
)
p.paragraph_format.space_after = Pt(4)

add_section_heading("MOA Flowchart — JAK Inhibitors", level=2, bg="7D7D00", fg="FFFFFF")
add_code_block("""
Multiple cytokines (IL-2, IL-4, IL-6, IL-12, IL-23, IFN-γ)
bind cell surface receptors
          │
          ▼
Receptor-associated JAK kinases activated
(JAK1, JAK2, JAK3, TYK2)
          │
          ▼
JAK phosphorylates STAT proteins
          │
          ▼
pSTAT dimers enter nucleus → Transcription of pro-inflammatory genes
          │
          │ ← BLOCKED BY JAK INHIBITORS
          │
Tofacitinib (JAK1/3) | Upadacitinib (JAK1) | Filgotinib (JAK1)
          │
          ▼
↓ STAT activation → ↓ Cytokine gene transcription
↓ T-cell activation | ↓ NK cell activation
↓ Mucosal inflammation → Remission
""")

make_table(
    headers=["Drug", "Dose", "Indication", "Contraindication", "Key ADR", "Drug Interactions"],
    rows=[
        ["**Tofacitinib**\n(JAK1/3 inhibitor)",
         "Induction: 10 mg bid × 8 wk\nMaintenance: 5 mg bid",
         "Moderate-severe UC",
         "Active infection, TB, malignancy, pregnancy, age > 65 + CV risk factors",
         "Herpes zoster reactivation (important!), opportunistic infections, hyperlipidaemia, MACE (black box warning), VTE — pulmonary embolism (black box warning), malignancy",
         "CYP3A4 inhibitors ↑ levels; CYP3A4 inducers ↓ levels; avoid live vaccines; immunosuppressants ↑ infection risk"],
        ["**Upadacitinib**\n(selective JAK1)",
         "Induction: 45 mg daily × 8 wk\nMaintenance: 15 mg daily",
         "Moderate-severe UC; moderate-severe CD",
         "Similar to tofacitinib",
         "Herpes zoster, acne, MACE/VTE risk (lower than tofacitinib), anaemia",
         "CYP3A4 interactions"],
        ["**Filgotinib**\n(selective JAK1)",
         "200 mg once daily",
         "Moderate-severe UC",
         "Similar",
         "Similar; lower VTE/MACE signal vs tofacitinib",
         "CYP3A4 interactions"],
    ],
    col_widths=[1.3, 1.2, 1.2, 1.3, 1.8, 1.4],
)

# ──────────────────────────────────────────────────────────────────────────────
# CLASS 7: ANTIBIOTICS
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("CLASS 7: ANTIBIOTICS (Adjunctive)", level=2, bg="3D3D3D", fg="FFFFFF")
make_table(
    headers=["Drug", "Dose", "Indication", "Key ADR"],
    rows=[
        ["**Metronidazole**",
         "10–20 mg/kg/day in divided doses",
         "Perianal CD, fistulising CD, pouchitis",
         "Peripheral neuropathy (long-term use), metallic taste, disulfiram-like reaction with alcohol, nausea"],
        ["**Ciprofloxacin**",
         "500 mg bid",
         "Perianal CD (often combined with metronidazole), pouchitis",
         "Tendinopathy/tendon rupture, C. difficile risk, QT prolongation, photosensitivity"],
        ["**Rifaximin**",
         "400 mg tid",
         "CD induction (some evidence), prevention of pouchitis",
         "Generally well tolerated; minimal systemic absorption"],
    ],
    col_widths=[1.5, 1.3, 2.5, 2.4],
)

# ──────────────────────────────────────────────────────────────────────────────
# DRUG INTERACTIONS QUICK REFERENCE
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("KEY DRUG INTERACTIONS — QUICK REFERENCE", level=1)
make_table(
    headers=["Interaction", "Clinical Consequence", "Action Required"],
    rows=[
        ["AZA/6-MP + **Allopurinol**",
         "↑ 6-TGN → Severe myelosuppression (bone marrow suppression)",
         "Reduce AZA/6-MP dose by 75%; monitor CBC closely"],
        ["AZA/6-MP + Mesalamine/Sulfasalazine",
         "TPMT inhibition → ↑ 6-TGN → ↑ toxicity",
         "Monitor CBC; consider dose adjustment"],
        ["MTX + NSAIDs/Aspirin",
         "↑ MTX toxicity (reduced renal clearance)",
         "Avoid combination or use with extreme caution"],
        ["MTX + Alcohol",
         "↑ Hepatotoxicity",
         "Strict alcohol avoidance during therapy"],
        ["MTX + Trimethoprim",
         "↑ Myelosuppression (dual folate antagonism)",
         "Avoid combination"],
        ["Cyclosporine + Nephrotoxins (NSAIDs, aminoglycosides)",
         "↑ Acute renal failure risk",
         "Avoid combination; monitor renal function closely"],
        ["Budesonide + CYP3A4 inhibitors (azoles, macrolides)",
         "↑ Budesonide levels → Systemic steroid effects",
         "Reduce dose or avoid azole antifungals"],
        ["Anti-TNF biologics + Live vaccines",
         "Risk of vaccine-related infection/disease",
         "Administer all vaccines before starting biologics; CI when on biologic"],
        ["Tofacitinib + CYP3A4 inhibitors",
         "↑ Tofacitinib exposure → ↑ toxicity",
         "Reduce maintenance dose to 5 mg bid"],
        ["Infliximab/Adalimumab + AZA/MTX",
         "Reduces anti-drug antibody formation (HACA/ADA)",
         "Beneficial combination for selected patients"],
    ],
    col_widths=[2.0, 2.8, 2.4],
)

# ──────────────────────────────────────────────────────────────────────────────
# MASTER SUMMARY CHART
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("PHARMACOLOGICAL TREATMENT — MASTER SUMMARY CHART", level=1)
make_table(
    headers=["Class", "Drugs", "UC", "CD", "Induction", "Maintenance", "Key Monitoring"],
    rows=[
        ["**5-ASA**",
         "Sulfasalazine\nMesalamine\nOlsalazine\nBalsalazide",
         "✓✓", "± (colitis only)", "Yes", "Yes",
         "Renal function (mesalamine); CBC (sulfasalazine); folate supplementation"],
        ["**Corticosteroids**",
         "Prednisolone\nMethylprednisolone\nHydrocortisone IV\nBudesonide",
         "✓✓", "✓✓", "Yes", "NO (never)",
         "Blood glucose, BP, bone density; taper carefully to avoid adrenal crisis"],
        ["**Thiopurines**",
         "Azathioprine\n6-Mercaptopurine",
         "✓✓", "✓✓", "NO (slow onset)", "Yes",
         "TPMT genotyping before start; CBC every 1–3 months; LFTs"],
        ["**Methotrexate**",
         "Methotrexate (IM/SC)",
         "±", "✓✓", "Yes (25 mg/wk)", "Yes (15 mg/wk)",
         "LFTs, CBC, renal function; folate supplementation; pregnancy test (women)"],
        ["**Calcineurin Inhibitors**",
         "Cyclosporine\nTacrolimus",
         "✓✓ (rescue only)", "±", "Yes (short-term rescue)", "NO (bridge only)",
         "Renal function, BP, drug levels, glucose (tacrolimus); PCP prophylaxis"],
        ["**Anti-TNF-α**",
         "Infliximab\nAdalimumab\nCertolizumab\nGolimumab",
         "✓✓", "✓✓", "Yes", "Yes",
         "TB/hep B screening before start; anti-drug antibodies; CBC; infection signs"],
        ["**Anti-Integrin**",
         "Vedolizumab\nNatalizumab",
         "✓✓", "✓✓", "Yes", "Yes",
         "Vedolizumab: infusion reactions; Natalizumab: JC virus antibody titre (PML risk)"],
        ["**Anti-IL-12/23**",
         "Ustekinumab",
         "✓✓", "✓✓", "Yes (IV induction)", "Yes (SC)",
         "TB screening; infection signs; low immunogenicity (minimal monitoring)"],
        ["**JAK Inhibitors**",
         "Tofacitinib\nUpadacitinib\nFilgotinib",
         "✓✓", "± / ✓✓", "Yes", "Yes",
         "Lipids, CBC, herpes zoster vaccination; cardiovascular risk assessment; VTE risk"],
        ["**Antibiotics**",
         "Metronidazole\nCiprofloxacin",
         "- (pouchitis)", "✓ (perianal)", "Adjunctive", "Adjunctive",
         "Peripheral neuropathy (metronidazole); tendon function (ciprofloxacin)"],
    ],
    col_widths=[1.2, 1.4, 0.6, 0.6, 0.8, 0.9, 2.2],
    header_bg="1F4E79",
)

# ──────────────────────────────────────────────────────────────────────────────
# TREATMENT ALGORITHM
# ──────────────────────────────────────────────────────────────────────────────
add_section_heading("TREATMENT ALGORITHM (SIMPLIFIED)", level=1)
add_code_block("""
──────────────────────────────────────────────────────
MILD DISEASE (UC):
  5-ASA (topical if proctitis; oral if extensive)
  → Response? → Maintain on 5-ASA
  → No response → Budesonide/Prednisolone (induce, then taper)
  → Steroid-dependent → Add thiopurine or MTX (steroid-sparing)
──────────────────────────────────────────────────────
MODERATE-SEVERE DISEASE (UC or CD):
  Corticosteroids (INDUCE) + Immunomodulator or Biologic
  "Top-down" preferred for high-risk patients:
    → Anti-TNF (infliximab/adalimumab) ± Immunomodulator (combo therapy)
    → OR Vedolizumab (gut-selective; especially UC, or high infection risk)
    → OR Ustekinumab (especially CD, or anti-TNF failure)
    → OR JAK inhibitor (oral; UC)
──────────────────────────────────────────────────────
REFRACTORY / SEVERE ACUTE UC:
  IV Methylprednisolone / Hydrocortisone
  → No response in 72 hours → RESCUE THERAPY:
      • Infliximab (5 mg/kg IV)
      • OR Cyclosporine IV (2–4 mg/kg/day)
  → Rescue fails → COLECTOMY (proctocolectomy is curative for UC)
──────────────────────────────────────────────────────
PERIANAL CD:
  Antibiotics (metronidazole + ciprofloxacin)
  + Anti-TNF (infliximab preferred)
  + Surgical drainage if abscess present
──────────────────────────────────────────────────────
""")

# ──────────────────────────────────────────────────────────────────────────────
# FOOTER
# ──────────────────────────────────────────────────────────────────────────────
doc.add_paragraph()
footer_p = doc.add_paragraph(
    "Sources: Goodman & Gilman's Pharmacological Basis of Therapeutics (14e) | "
    "Yamada's Textbook of Gastroenterology (7e) | "
    "Sleisenger & Fordtran's Gastrointestinal and Liver Disease | "
    "Schwartz's Principles of Surgery (11e) | "
    "Sabiston Textbook of Surgery"
)
footer_p.runs[0].font.size = Pt(8)
footer_p.runs[0].font.italic = True
footer_p.runs[0].font.color.rgb = RGBColor(0x60, 0x60, 0x60)
footer_p.alignment = WD_ALIGN_PARAGRAPH.CENTER

# ── SAVE ──────────────────────────────────────────────────────────────────────
out_path = "/tmp/workspace/ibd-notes/IBD_Therapeutics_3_Notes.docx"
doc.save(out_path)
print(f"Saved: {out_path}")
Your credits are exhausted. You can purchase a top-up or subscribe to a plan to continue using Orris. If you're already subscribed, your daily credits will reset tomorrow.
This is a shared conversation. Sign in to Orris to start your own chat.