Please explain in a clinical way chron's disease and ulcerative colitis and their relationship. And some differences in clinical way. I am a doctor intern in a hospital. I need short compact PDF on this, short and compact handbook PDF with pictures to compare , classification,diagnosis and treatment.
mkdir -p /home/daytona/workspace/ibd-handbook && ls /home/daytona/workspace/ibd-handbook/
cd /home/daytona/workspace/ibd-handbook && python3 -c " import urllib.request urls = { 'uc_phenotypes.png': 'https://cdn.orris.care/cdss_images/cac54a3a0c24530ae4ca4341d2a3f644e79dfdf1e6f69771ae866923acabe172.png', 'cd_histology.png': 'https://cdn.orris.care/cdss_images/62fa6f415d16466c366337db8ebac4b02e26312feda4e513e27ff1bb76a5acbd.png', 'uc_colonoscopy.png': 'https://cdn.orris.care/cdss_images/9bc6863451dcc91fc0fde2143dca656dcaf1c3a623399b049a99a9a9ad370142.png', 'toxic_megacolon.png': 'https://cdn.orris.care/cdss_images/3696cc94246cdeb3c4751e13fc41b70ae8d64efefadf9e834d2ba5cb902ea975.png', 'cd_mri.png': 'https://cdn.orris.care/cdss_images/bb034e8d154caa6ade8d0e936899d138fd947e427fd03875585bc58d52c37af1.png', } for fname, url in urls.items(): urllib.request.urlretrieve(url, fname) print(f'Downloaded {fname}') print('Done') "
~/ibd-handbook/build_pdf.py
#!/usr/bin/env python3
"""IBD Clinical Handbook PDF Generator - Crohn's Disease vs Ulcerative Colitis"""
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.lib.colors import (HexColor, white, black, Color,
darkblue, lightblue, orange, red)
from reportlab.platypus import (SimpleDocTemplate, Paragraph, Spacer, Table,
TableStyle, Image, PageBreak, HRFlowable,
KeepTogether)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY, TA_RIGHT
from reportlab.platypus import Flowable
import os
# ---- Color Palette ----
CD_COLOR = HexColor('#1A5276') # dark blue for Crohn's
UC_COLOR = HexColor('#922B21') # dark red for UC
HEADER_BG = HexColor('#1B2631') # near-black header
SECTION_BG = HexColor('#EBF5FB') # very light blue sections
CD_LIGHT = HexColor('#D6EAF8')
UC_LIGHT = HexColor('#FADBD8')
ACCENT = HexColor('#F39C12') # amber accent
GRID_COLOR = HexColor('#AEB6BF')
BOTH_COLOR = HexColor('#1E8449') # green for shared features
LIGHT_GRAY = HexColor('#F2F3F4')
MED_GRAY = HexColor('#D5D8DC')
W, H = A4
def make_doc(path):
doc = SimpleDocTemplate(
path, pagesize=A4,
topMargin=1.5*cm, bottomMargin=1.8*cm,
leftMargin=1.8*cm, rightMargin=1.8*cm,
title="IBD Clinical Handbook",
author="Orris AI • Medical Library"
)
styles = getSampleStyleSheet()
# Custom styles
cover_title = ParagraphStyle('CoverTitle', fontSize=28, fontName='Helvetica-Bold',
textColor=white, alignment=TA_CENTER, leading=34)
cover_sub = ParagraphStyle('CoverSub', fontSize=13, fontName='Helvetica',
textColor=HexColor('#AED6F1'), alignment=TA_CENTER, leading=18)
cover_auth = ParagraphStyle('CoverAuth', fontSize=9, fontName='Helvetica',
textColor=HexColor('#7FB3D3'), alignment=TA_CENTER)
sec_head = ParagraphStyle('SecHead', fontSize=13, fontName='Helvetica-Bold',
textColor=white, alignment=TA_LEFT,
backColor=HEADER_BG, leading=18,
spaceAfter=4, spaceBefore=10,
leftIndent=6, rightIndent=6,
borderPad=5)
sub_head = ParagraphStyle('SubHead', fontSize=10.5, fontName='Helvetica-Bold',
textColor=CD_COLOR, spaceBefore=8, spaceAfter=3)
cd_head = ParagraphStyle('CDHead', fontSize=10, fontName='Helvetica-Bold',
textColor=white, backColor=CD_COLOR, alignment=TA_LEFT,
leading=14, borderPad=4, leftIndent=4)
uc_head = ParagraphStyle('UCHead', fontSize=10, fontName='Helvetica-Bold',
textColor=white, backColor=UC_COLOR, alignment=TA_LEFT,
leading=14, borderPad=4, leftIndent=4)
body = ParagraphStyle('Body', fontSize=8.5, fontName='Helvetica',
leading=13, spaceAfter=4, alignment=TA_JUSTIFY)
body_sm = ParagraphStyle('BodySm', fontSize=7.5, fontName='Helvetica',
leading=11.5, spaceAfter=3, alignment=TA_JUSTIFY)
caption = ParagraphStyle('Caption', fontSize=7, fontName='Helvetica-Oblique',
textColor=HexColor('#555555'), alignment=TA_CENTER,
spaceAfter=6)
bullet = ParagraphStyle('Bullet', fontSize=8.5, fontName='Helvetica',
leading=13, leftIndent=12, firstLineIndent=-8,
spaceAfter=2)
bold_b = ParagraphStyle('BoldBullet', fontSize=8.5, fontName='Helvetica-Bold',
leading=13, leftIndent=12, firstLineIndent=-8,
spaceAfter=2)
note = ParagraphStyle('Note', fontSize=7.5, fontName='Helvetica-Oblique',
textColor=HexColor('#555555'), leading=11, spaceAfter=4,
leftIndent=6)
tbl_hdr = ParagraphStyle('TblHdr', fontSize=8, fontName='Helvetica-Bold',
textColor=white, alignment=TA_CENTER, leading=10)
tbl_cell = ParagraphStyle('TblCell', fontSize=7.5, fontName='Helvetica',
alignment=TA_LEFT, leading=10)
tbl_center = ParagraphStyle('TblCenter', fontSize=7.5, fontName='Helvetica',
alignment=TA_CENTER, leading=10)
story = []
page_w = W - 3.6*cm # usable width
# =========================================================
# COVER PAGE
# =========================================================
cover_data = [[Paragraph(
'<br/><br/><br/>'
'IBD CLINICAL HANDBOOK<br/>',
cover_title),
]]
cover_table = Table(cover_data, colWidths=[page_w])
cover_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), HEADER_BG),
('TOPPADDING', (0,0), (-1,-1), 40),
('BOTTOMPADDING', (0,0), (-1,-1), 20),
('LEFTPADDING', (0,0), (-1,-1), 20),
('RIGHTPADDING', (0,0), (-1,-1), 20),
]))
story.append(cover_table)
story.append(Spacer(1, 0.3*cm))
sub_data = [[
Paragraph("CROHN'S DISEASE", ParagraphStyle('CD', fontSize=15,
fontName='Helvetica-Bold', textColor=white,
alignment=TA_CENTER, backColor=CD_COLOR, borderPad=8, leading=20)),
Paragraph("vs", ParagraphStyle('VS', fontSize=14, fontName='Helvetica-Bold',
textColor=HEADER_BG, alignment=TA_CENTER)),
Paragraph("ULCERATIVE COLITIS", ParagraphStyle('UC', fontSize=15,
fontName='Helvetica-Bold', textColor=white,
alignment=TA_CENTER, backColor=UC_COLOR, borderPad=8, leading=20)),
]]
sub_table = Table(sub_data, colWidths=[page_w*0.44, page_w*0.12, page_w*0.44])
sub_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,0), CD_COLOR),
('BACKGROUND', (2,0), (2,0), UC_COLOR),
('TOPPADDING', (0,0), (-1,-1), 12),
('BOTTOMPADDING', (0,0), (-1,-1), 12),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
]))
story.append(sub_table)
story.append(Spacer(1, 0.4*cm))
story.append(Paragraph(
"Inflammatory Bowel Disease • Classification • Diagnosis • Treatment",
ParagraphStyle('SubLine', fontSize=10, fontName='Helvetica',
textColor=HexColor('#555555'), alignment=TA_CENTER)
))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph(
"For Hospital Interns & Junior Doctors | Compiled from Sleisenger & Fordtran, Harrison's, Goldman-Cecil Medicine",
ParagraphStyle('Auth', fontSize=7.5, fontName='Helvetica-Oblique',
textColor=HexColor('#888888'), alignment=TA_CENTER)
))
story.append(HRFlowable(width=page_w, thickness=2, color=ACCENT, spaceAfter=6))
# =========================================================
# SECTION 1 - OVERVIEW & RELATIONSHIP
# =========================================================
story.append(Paragraph(" 1. OVERVIEW & RELATIONSHIP", sec_head))
story.append(Spacer(1, 3))
overview_cols = [
[
Paragraph("CROHN'S DISEASE (CD)", cd_head),
Spacer(1,4),
Paragraph("• Any part of the GI tract (mouth to anus)", bullet),
Paragraph("• Transmural (full-thickness) inflammation", bullet),
Paragraph("• Skip lesions - discontinuous involvement", bullet),
Paragraph("• Terminal ileum + proximal colon most common", bullet),
Paragraph("• Granulomas on biopsy (~30% of cases)", bullet),
Paragraph("• Fistulae, abscesses, strictures common", bullet),
Paragraph("• Surgery is NOT curative; 50% need surgery within 10 years", bullet),
],
[
Paragraph("ULCERATIVE COLITIS (UC)", uc_head),
Spacer(1,4),
Paragraph("• Colon only (rectum to proximal colon)", bullet),
Paragraph("• Mucosal & submucosal inflammation only", bullet),
Paragraph("• Continuous lesion - starts in rectum, extends proximally", bullet),
Paragraph("• Always involves rectum (except post-treatment)", bullet),
Paragraph("• No granulomas; crypt abscesses + cryptitis", bullet),
Paragraph("• Toxic megacolon, massive hemorrhage key complications", bullet),
Paragraph("• Colectomy is CURATIVE", bullet),
],
]
ov_table = Table([overview_cols], colWidths=[page_w*0.49, page_w*0.49],
hAlign='LEFT', spaceBefore=2)
ov_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,0), CD_LIGHT),
('BACKGROUND', (1,0), (1,0), UC_LIGHT),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('BOX', (0,0), (0,0), 1, CD_COLOR),
('BOX', (1,0), (1,0), 1, UC_COLOR),
('INNERGRID', (0,0), (-1,-1), 0, white),
]))
story.append(ov_table)
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph(
"<b>Shared biology (IBD umbrella):</b> Both are chronic, relapsing-remitting immune-mediated conditions "
"of the gut. Both involve dysregulated mucosal immunity, genetic susceptibility (NOD2, HLA loci), "
"and microbial triggers. Both carry elevated risk of colorectal cancer with long-standing disease "
"(UC >> CD colonic disease). ~10-15% of colitis cases cannot be definitively classified = "
"<b>Indeterminate Colitis</b>.",
ParagraphStyle('SharedBox', fontSize=8.5, fontName='Helvetica',
leading=13, backColor=HexColor('#EAFAF1'),
borderColor=BOTH_COLOR, borderWidth=1, borderPad=8,
spaceAfter=6, alignment=TA_JUSTIFY)
))
# =========================================================
# SECTION 2 - CLINICAL COMPARISON TABLE
# =========================================================
story.append(Paragraph(" 2. CLINICAL COMPARISON AT A GLANCE", sec_head))
story.append(Spacer(1,3))
comp_headers = [
Paragraph("FEATURE", tbl_hdr),
Paragraph("CROHN'S DISEASE", tbl_hdr),
Paragraph("ULCERATIVE COLITIS", tbl_hdr),
]
comp_data = [
["Location", "Mouth to anus; often terminal ileum + proximal colon", "Colon only; always starts in rectum"],
["Pattern", "Skip lesions (discontinuous)", "Continuous, confluent lesion"],
["Depth", "Transmural (all layers)", "Mucosal + submucosal only"],
["Rectal involvement", "Spared in ~50% cases", "Almost always involved (95%)"],
["Bleeding", "Less common, mild", "Hallmark - bloody diarrhea"],
["Diarrhea", "Non-bloody, often nocturnal", "Bloody, with urgency & tenesmus"],
["Abdominal pain", "RLQ pain (mimics appendicitis)", "Left-sided cramping, post-prandial"],
["Perianal disease", "Common: fissures, fistulae, skin tags", "Rare"],
["Fistulae / Abscesses", "Yes - entero-enteric, entero-vesical", "No (except toxic megacolon perf.)"],
["Strictures", "Common (fibrosis)", "Rare; if present suspect malignancy"],
["Granulomas (biopsy)", "Yes (~30%)", "No"],
["Crypt abscesses", "Less prominent", "Hallmark histological finding"],
["Cobblestone mucosa", "Yes (endoscopy)", "No"],
["Pseudopolyps", "Occasional", "Common (chronic disease)"],
["Lead pipe colon", "No", "Yes (loss of haustra on X-ray)"],
["Peak age onset", "15-30 yrs; 2nd peak 7th decade", "20-40 yrs; 2nd smaller peak 7th decade"],
["Sex ratio", "F > M (1.2:1)", "M = F (1:1)"],
["EIMs (joints, eyes, skin)", "More frequent (35%)", "Less frequent (27%)"],
["PSC association", "Less common", "More common (3-5%)"],
["Cancer risk", "4-20x general population (colonic CD)", "Rises after 7-8 years; up to 18-34% at 30 yrs"],
["Surgery curability", "Not curative - disease recurs", "Colectomy = curative"],
]
full_data = [comp_headers]
for row in comp_data:
full_data.append([
Paragraph(row[0], ParagraphStyle('CellB', fontSize=7.5, fontName='Helvetica-Bold', leading=10)),
Paragraph(row[1], tbl_cell),
Paragraph(row[2], tbl_cell),
])
col_ws = [page_w*0.22, page_w*0.39, page_w*0.39]
comp_table = Table(full_data, colWidths=col_ws, repeatRows=1, hAlign='LEFT')
ts = TableStyle([
# Header row
('BACKGROUND', (0,0), (0,0), HEADER_BG),
('BACKGROUND', (1,0), (1,0), CD_COLOR),
('BACKGROUND', (2,0), (2,0), UC_COLOR),
('TEXTCOLOR', (0,0), (-1,0), white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 8),
('TOPPADDING', (0,0), (-1,0), 5),
('BOTTOMPADDING', (0,0), (-1,0), 5),
# Alternating rows
('ROWBACKGROUNDS', (0,1), (-1,-1), [white, LIGHT_GRAY]),
# Grids
('GRID', (0,0), (-1,-1), 0.4, GRID_COLOR),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,1), (-1,-1), 3),
('BOTTOMPADDING', (0,1), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 4),
('RIGHTPADDING', (0,0), (-1,-1), 4),
])
comp_table.setStyle(ts)
story.append(comp_table)
story.append(Spacer(1,0.15*cm))
story.append(Paragraph(
"EIMs = extraintestinal manifestations; PSC = primary sclerosing cholangitis; RLQ = right lower quadrant",
note
))
# =========================================================
# PAGE BREAK - SECTION 3 IMAGES
# =========================================================
story.append(PageBreak())
# =========================================================
# SECTION 3 - IMAGES
# =========================================================
story.append(Paragraph(" 3. VISUAL COMPARISON", sec_head))
story.append(Spacer(1,4))
img_dir = "/home/daytona/workspace/ibd-handbook/"
# UC Phenotypes diagram
try:
img_uc_pheno = Image(img_dir + "uc_phenotypes.png", width=page_w*0.98, height=5.5*cm)
story.append(img_uc_pheno)
story.append(Paragraph(
"Fig. 1 — Ulcerative Colitis Phenotypes (Montreal Classification). Left: Proctitis (E1, 30-60% of patients). "
"Middle: Left-sided colitis (E2, 16-45%). Right: Extensive colitis/pancolitis (E3, 15-35%). "
"[Yamada's Textbook of Gastroenterology]",
caption
))
except Exception as e:
story.append(Paragraph(f"[UC phenotype image unavailable: {e}]", note))
story.append(Spacer(1,0.3*cm))
# Side by side: UC colonoscopy + CD histology
img_cols = []
try:
img_uc_endo = Image(img_dir + "uc_colonoscopy.png", width=page_w*0.47, height=5*cm)
img_cols.append([
img_uc_endo,
Paragraph(
"Fig. 2 — Colonoscopy: Severe UC showing diffuse erythema, "
"friability, loss of vascular pattern, and exudates. "
"[Harrison's 22e]",
caption
)
])
except:
img_cols.append([Paragraph("[UC colonoscopy image]", note)])
try:
img_cd_histo = Image(img_dir + "cd_histology.png", width=page_w*0.47, height=5*cm)
img_cols.append([
img_cd_histo,
Paragraph(
"Fig. 3 — Histology: Crohn's colitis (H&E). Mixed acute/chronic "
"inflammation, crypt atrophy, and epithelioid granulomas in the "
"mucosa (key distinguishing feature from UC). [Harrison's 22e]",
caption
)
])
except:
img_cols.append([Paragraph("[CD histology image]", note)])
img_2col = Table(
[[img_cols[0][0], img_cols[1][0]],
[img_cols[0][1], img_cols[1][1]]],
colWidths=[page_w*0.49, page_w*0.49]
)
img_2col.setStyle(TableStyle([
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('TOPPADDING', (0,0), (-1,-1), 2),
('BOTTOMPADDING', (0,0), (-1,-1), 2),
]))
story.append(img_2col)
story.append(Spacer(1,0.2*cm))
# Toxic megacolon + CD MRI
img_cols2 = []
try:
img_tox = Image(img_dir + "toxic_megacolon.png", width=page_w*0.47, height=5*cm)
img_cols2.append([
img_tox,
Paragraph(
"Fig. 4 — Plain abdominal X-ray: Toxic megacolon (UC complication). "
"Markedly dilated transverse colon (>6 cm) with loss of haustra. "
"Emergency colectomy required if no improvement within 24-72 h. [Rosen's EM]",
caption
)
])
except:
img_cols2.append([Paragraph("[Toxic megacolon image]", note)])
try:
img_mri = Image(img_dir + "cd_mri.png", width=page_w*0.47, height=5*cm)
img_cols2.append([
img_mri,
Paragraph(
"Fig. 5 — MR Enterography (CD): Coronal gadolinium-enhanced view showing "
"mural hyperenhancement, mural thickening, and the 'comb sign' (engorged "
"peri-enteric vasculature) in the terminal ileum. [Sleisenger & Fordtran]",
caption
)
])
except:
img_cols2.append([Paragraph("[CD MRI image]", note)])
img_2col2 = Table(
[[img_cols2[0][0], img_cols2[1][0]],
[img_cols2[0][1], img_cols2[1][1]]],
colWidths=[page_w*0.49, page_w*0.49]
)
img_2col2.setStyle(TableStyle([
('VALIGN', (0,0), (-1,-1), 'TOP'),
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('TOPPADDING', (0,0), (-1,-1), 2),
('BOTTOMPADDING', (0,0), (-1,-1), 2),
]))
story.append(img_2col2)
# =========================================================
# PAGE BREAK - SECTION 4 CLASSIFICATION
# =========================================================
story.append(PageBreak())
# =========================================================
# SECTION 4 - CLASSIFICATION
# =========================================================
story.append(Paragraph(" 4. CLASSIFICATION SYSTEMS", sec_head))
story.append(Spacer(1,4))
# ---- Montreal Classification for UC ----
story.append(Paragraph("4A. Montreal Classification — Ulcerative Colitis", sub_head))
uc_class_data = [
[Paragraph("EXTENT", tbl_hdr), Paragraph("CODE", tbl_hdr), Paragraph("ANATOMY", tbl_hdr)],
["Ulcerative Proctitis", "E1", "Involvement limited to the rectum"],
["Left-sided UC (Distal UC)", "E2", "Colorectum distal to splenic flexure"],
["Extensive UC (Pancolitis)", "E3", "Extends proximal to splenic flexure"],
]
uc_sev_data = [
[Paragraph("SEVERITY", tbl_hdr), Paragraph("CODE", tbl_hdr), Paragraph("DEFINITION", tbl_hdr)],
["Clinical remission", "S0", "Absence of symptoms"],
["Mild activity", "S1", "≤4 stools/day, no systemic illness, normal ESR"],
["Moderate activity", "S2", "≥4 stools/day, minimal signs of systemic toxicity"],
["Severe activity", "S3", "≥6 bloody stools/day, pulse ≥90, temp ≥37.5°C, Hb <10.5 g/dL, ESR ≥30 mm/h"],
]
def make_class_table(data, header_bg, col_ws):
t = Table(data, colWidths=col_ws, hAlign='LEFT')
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), header_bg),
('TEXTCOLOR', (0,0), (-1,0), white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 7.5),
('ROWBACKGROUNDS', (0,1), (-1,-1), [white, LIGHT_GRAY]),
('GRID', (0,0), (-1,-1), 0.4, GRID_COLOR),
('FONTSIZE', (0,1), (-1,-1), 7.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 5),
('RIGHTPADDING', (0,0), (-1,-1), 5),
]))
return t
uc_ext_t = make_class_table(uc_class_data, UC_COLOR, [page_w*0.33, page_w*0.10, page_w*0.55])
uc_sev_t = make_class_table(uc_sev_data, HexColor('#6E2F24'), [page_w*0.25, page_w*0.10, page_w*0.63])
story.append(uc_ext_t)
story.append(Spacer(1, 4))
story.append(uc_sev_t)
story.append(Spacer(1, 0.3*cm))
# ---- Montreal Classification for CD ----
story.append(Paragraph("4B. Montreal Classification — Crohn's Disease (A-L-B)", sub_head))
cd_age_data = [
[Paragraph("AGE AT DIAGNOSIS", tbl_hdr), Paragraph("CODE", tbl_hdr), Paragraph("DEFINITION", tbl_hdr)],
["Pediatric/young", "A1", "≤16 years"],
["Young adult", "A2", "17-40 years"],
["Older adult", "A3", ">40 years"],
]
cd_loc_data = [
[Paragraph("LOCATION", tbl_hdr), Paragraph("CODE", tbl_hdr), Paragraph("DEFINITION", tbl_hdr)],
["Terminal ileum", "L1", "Ileal ± limited cecal disease"],
["Colonic", "L2", "Colonic (any site, excluding ileum/upper GI)"],
["Ileocolonic", "L3", "Both ileal and colonic involvement"],
["Upper GI", "L4", "Any disease proximal to terminal ileum (add to L1-L3)"],
]
cd_beh_data = [
[Paragraph("BEHAVIOR", tbl_hdr), Paragraph("CODE", tbl_hdr), Paragraph("DEFINITION", tbl_hdr)],
["Inflammatory (non-stricturing, non-penetrating)", "B1", "No stricture or fistula"],
["Stricturing / Fibrostenotic", "B2", "Luminal narrowing ± obstruction"],
["Penetrating / Fistulizing", "B3", "Fistula, abscess, or inflammatory mass"],
["Perianal modifier", "p", "Add 'p' to any B category if perianal disease present"],
]
story.append(Paragraph("Note: Disease behavior often progresses B1 → B2 → B3 over time.", note))
cd_tables = Table(
[[make_class_table(cd_age_data, CD_COLOR, [page_w*0.35, page_w*0.10, page_w*0.40]),
Paragraph(""),
make_class_table(cd_loc_data, CD_COLOR, [page_w*0.22, page_w*0.08, page_w*0.55])]],
colWidths=[page_w*0.42, page_w*0.04, page_w*0.54],
hAlign='LEFT'
)
cd_tables.setStyle(TableStyle([('VALIGN', (0,0), (-1,-1), 'TOP')]))
story.append(cd_tables)
story.append(Spacer(1, 4))
story.append(make_class_table(cd_beh_data, HexColor('#1F618D'), [page_w*0.45, page_w*0.08, page_w*0.45]))
story.append(Spacer(1, 0.2*cm))
# =========================================================
# SECTION 5 - DIAGNOSIS
# =========================================================
story.append(Paragraph(" 5. DIAGNOSIS", sec_head))
story.append(Spacer(1,4))
diag_data = [
[
Paragraph("INVESTIGATION", ParagraphStyle('DH', fontSize=8, fontName='Helvetica-Bold',
textColor=white, alignment=TA_CENTER)),
Paragraph("CROHN'S DISEASE", ParagraphStyle('DH2', fontSize=8, fontName='Helvetica-Bold',
textColor=white, alignment=TA_CENTER)),
Paragraph("ULCERATIVE COLITIS", ParagraphStyle('DH3', fontSize=8, fontName='Helvetica-Bold',
textColor=white, alignment=TA_CENTER)),
],
["Labs (CBC, CRP, ESR, Alb)",
"Elevated CRP/ESR; anemia (chronic disease, blood loss, B12 deficiency if ileal disease); hypoalbuminemia",
"Elevated CRP/ESR; anemia (blood loss); leukocytosis; hypoalbuminemia in severe disease"],
["Fecal Calprotectin",
"Elevated in active disease (sensitivity ~88%); less specific than in UC (sensitivity 67%)",
"Elevated in active disease; higher specificity (~79%); used to monitor response"],
["Stool Culture",
"Rule out Salmonella, Campylobacter, C. difficile, Giardia before diagnosis",
"Same - mandatory to exclude infectious colitis before IBD therapy"],
["Serology (ASCA/pANCA)",
"ASCA+ (40-70%), pANCA- pattern → supports CD diagnosis",
"pANCA+ (55%), ASCA- pattern → supports UC diagnosis"],
["Colonoscopy + biopsy",
"Skip lesions, cobblestone mucosa, linear ulcers, aphthous ulcers; rectal sparing; granulomas on biopsy",
"Continuous inflammation from rectum; granular/friable mucosa; crypt abscesses; NO granulomas"],
["CT/MR Enterography",
"Gold standard for small bowel assessment; mural thickening, comb sign, strictures, fistulae, abscesses",
"Not first-line; useful if severe disease, toxic megacolon, or perforation suspected"],
["Small bowel capsule endoscopy",
"Useful when CTE negative but CD suspected; CONTRAINDICATED if stricture present",
"Not typically used (colon disease only)"],
["Plain abdominal X-ray",
"Dilated loops in obstruction; free air in perforation",
"Toxic megacolon: transverse colon >6 cm with loss of haustration"],
["Barium enema / SBFT",
"String sign (ileal stricture); rose-thorn ulcers; skip areas",
"Lead pipe colon (loss of haustra); backwash ileitis (pancolitis)"],
]
diag_table = Table(diag_data, colWidths=[page_w*0.22, page_w*0.39, page_w*0.39],
repeatRows=1, hAlign='LEFT')
diag_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,0), HEADER_BG),
('BACKGROUND', (1,0), (1,0), CD_COLOR),
('BACKGROUND', (2,0), (2,0), UC_COLOR),
('TEXTCOLOR', (0,0), (-1,0), white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [white, LIGHT_GRAY]),
('GRID', (0,0), (-1,-1), 0.4, GRID_COLOR),
('FONTSIZE', (0,1), (-1,-1), 7.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 4),
('RIGHTPADDING', (0,0), (-1,-1), 4),
]))
story.append(diag_table)
story.append(Spacer(1,0.1*cm))
story.append(Paragraph(
"Key principle: Diagnosis requires clinical + endoscopic + histologic correlation. "
"Stool cultures must exclude infection BEFORE starting immunosuppression. "
"If diagnosis remains unclear after full workup = 'Indeterminate Colitis'.",
ParagraphStyle('KeyBox', fontSize=8, fontName='Helvetica-Oblique',
leading=12, backColor=HexColor('#FEF9E7'),
borderColor=ACCENT, borderWidth=1, borderPad=6,
spaceAfter=6, alignment=TA_JUSTIFY)
))
# =========================================================
# PAGE BREAK - SECTION 6 TREATMENT
# =========================================================
story.append(PageBreak())
# =========================================================
# SECTION 6 - TREATMENT
# =========================================================
story.append(Paragraph(" 6. TREATMENT OVERVIEW", sec_head))
story.append(Spacer(1,4))
story.append(Paragraph(
"Goal: Induce and maintain mucosal healing (not just symptom control). "
"Therapeutic targets = clinical remission + endoscopic remission + normalization of CRP/calprotectin. "
"Therapy is step-up (mild disease) or top-down (high-risk disease) based on disease severity and phenotype.",
ParagraphStyle('GoalBox', fontSize=8.5, fontName='Helvetica',
leading=13, backColor=LIGHT_GRAY, borderColor=MED_GRAY,
borderWidth=1, borderPad=7, spaceAfter=6, alignment=TA_JUSTIFY)
))
story.append(Paragraph("6A. Drug Classes", sub_head))
drug_data = [
[
Paragraph("DRUG CLASS", tbl_hdr),
Paragraph("AGENTS", tbl_hdr),
Paragraph("CROHN'S DISEASE", tbl_hdr),
Paragraph("ULCERATIVE COLITIS", tbl_hdr),
],
["5-Aminosalicylates\n(5-ASA)",
"Mesalamine, sulfasalazine, olsalazine, balsalazide",
"Limited benefit in CD; NOT recommended routinely",
"FIRST-LINE for mild-moderate UC; induction + maintenance; rectal formulations for distal disease"],
["Corticosteroids",
"Prednisone 40-60 mg/d PO; IV methylprednisolone 40-60 mg/d; Budesonide (MMX/enteric-coated)",
"Active flares (NOT for maintenance); Budesonide for mild-moderate ileocecal CD",
"Active flares (NOT for maintenance); Budesonide MMX for mild-moderate UC"],
["Immunomodulators",
"Azathioprine (AZA) 2-3 mg/kg; 6-Mercaptopurine (6-MP) 1-1.5 mg/kg; Methotrexate 25 mg/wk IM",
"Maintenance therapy; steroid-sparing; often combined with biologics",
"Maintenance therapy (AZA/6-MP); steroid-sparing; methotrexate less used in UC"],
["Anti-TNF Biologics",
"Infliximab (IVq8w), Adalimumab (SC q2w), Certolizumab pegol (CD), Golimumab (UC only)",
"Moderate-severe CD; fistulizing disease; steroid-dependent/refractory",
"Moderate-severe UC; steroid-refractory acute severe UC (IV infliximab)"],
["Anti-integrin",
"Vedolizumab (IV/SC); Natalizumab (CD only; PML risk)",
"Moderate-severe CD (gut-selective, safer for EIMs)",
"Moderate-severe UC; good safety profile"],
["Anti-IL-12/23",
"Ustekinumab (IV induction, then SC q8-12w)",
"Moderate-severe CD; refractory to anti-TNF",
"Moderate-severe UC"],
["JAK Inhibitors",
"Tofacitinib, Upadacitinib, Ozanimod (S1P modulator)",
"Upadacitinib (moderate-severe CD)",
"Tofacitinib, upadacitinib, ozanimod for moderate-severe UC"],
["Antibiotics",
"Metronidazole, Ciprofloxacin, Rifaximin",
"Perianal disease, abscesses, small bowel bacterial overgrowth; NOT primary IBD therapy",
"Pouchitis after ileal pouch-anal anastomosis; NOT primary UC therapy"],
]
drug_table = Table(drug_data, colWidths=[page_w*0.17, page_w*0.22, page_w*0.30, page_w*0.30],
repeatRows=1, hAlign='LEFT')
drug_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,0), HEADER_BG),
('BACKGROUND', (1,0), (1,0), HEADER_BG),
('BACKGROUND', (2,0), (2,0), CD_COLOR),
('BACKGROUND', (3,0), (3,0), UC_COLOR),
('TEXTCOLOR', (0,0), (-1,0), white),
('ROWBACKGROUNDS', (0,1), (-1,-1), [white, LIGHT_GRAY]),
('GRID', (0,0), (-1,-1), 0.4, GRID_COLOR),
('FONTSIZE', (0,0), (-1,0), 7.5),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,1), (-1,-1), 7),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('FONTNAME', (0,1), (0,-1), 'Helvetica-Bold'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 4),
('RIGHTPADDING', (0,0), (-1,-1), 4),
]))
story.append(drug_table)
story.append(Spacer(1,0.2*cm))
story.append(Paragraph("6B. Disease-Specific Treatment Algorithms", sub_head))
algo_cols = [
[
Paragraph("CROHN'S DISEASE", cd_head),
Spacer(1,4),
Paragraph("<b>Mild-Moderate Ileocecal CD:</b>", body_sm),
Paragraph("• Budesonide 9 mg/day x 8-12 wk (induction)", bullet),
Paragraph("• Add AZA/6-MP for steroid-dependent disease", bullet),
Spacer(1,3),
Paragraph("<b>Moderate-Severe CD:</b>", body_sm),
Paragraph("• Anti-TNF (infliximab or adalimumab) ± AZA (combo more effective)", bullet),
Paragraph("• Ustekinumab or vedolizumab if anti-TNF failure", bullet),
Paragraph("• Upadacitinib (JAK-1) for refractory disease", bullet),
Spacer(1,3),
Paragraph("<b>Fistulizing/Perianal CD:</b>", body_sm),
Paragraph("• Antibiotics (metro/cipro) + exam under anesthesia (EUA)", bullet),
Paragraph("• IV infliximab + surgical drainage of abscess", bullet),
Paragraph("• Seton placement for complex fistulae", bullet),
Spacer(1,3),
Paragraph("<b>Surgery (not curative):</b>", body_sm),
Paragraph("• Stricturoplasty or resection for obstruction", bullet),
Paragraph("• Bowel-sparing approach is key", bullet),
],
[
Paragraph("ULCERATIVE COLITIS", uc_head),
Spacer(1,4),
Paragraph("<b>Mild-Moderate UC (proctitis/left-sided):</b>", body_sm),
Paragraph("• Mesalamine suppository/enema + oral 5-ASA", bullet),
Paragraph("• Topical 5-ASA more effective than topical steroids for distal disease", bullet),
Spacer(1,3),
Paragraph("<b>Mild-Moderate Extensive UC:</b>", body_sm),
Paragraph("• Oral 5-ASA (mesalamine) 2-4.8 g/day", bullet),
Paragraph("• Prednisone for induction if 5-ASA fails", bullet),
Paragraph("• AZA/6-MP for steroid-dependent disease", bullet),
Spacer(1,3),
Paragraph("<b>Moderate-Severe UC:</b>", body_sm),
Paragraph("• Anti-TNF (infliximab or adalimumab/golimumab)", bullet),
Paragraph("• Vedolizumab (preferred in elderly, comorbidities)", bullet),
Paragraph("• Tofacitinib or upadacitinib as alternatives", bullet),
Spacer(1,3),
Paragraph("<b>Acute Severe UC (hospital):</b>", body_sm),
Paragraph("• IV hydrocortisone 100 mg q6h or methylprednisolone 60 mg/day", bullet),
Paragraph("• If no improvement in 3-5 days → rescue: IV infliximab or cyclosporine", bullet),
Paragraph("• Toxic megacolon: emergency subtotal colectomy", bullet),
Spacer(1,3),
Paragraph("<b>Surgery (CURATIVE):</b>", body_sm),
Paragraph("• Proctocolectomy + ileal pouch-anal anastomosis (IPAA/J-pouch)", bullet),
Paragraph("• Indicated in: refractory disease, dysplasia/cancer, toxic megacolon", bullet),
],
]
algo_table = Table([algo_cols], colWidths=[page_w*0.49, page_w*0.49], hAlign='LEFT')
algo_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,0), CD_LIGHT),
('BACKGROUND', (1,0), (1,0), UC_LIGHT),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('BOX', (0,0), (0,0), 1, CD_COLOR),
('BOX', (1,0), (1,0), 1, UC_COLOR),
]))
story.append(algo_table)
story.append(Spacer(1,0.2*cm))
# =========================================================
# SECTION 7 - EXTRAINTESTINAL MANIFESTATIONS & COMPLICATIONS
# =========================================================
story.append(Paragraph(" 7. EXTRAINTESTINAL MANIFESTATIONS & COMPLICATIONS", sec_head))
story.append(Spacer(1,4))
eim_data = [
[Paragraph("CATEGORY", tbl_hdr),
Paragraph("MANIFESTATION", tbl_hdr),
Paragraph("DISEASE ASSOCIATION", tbl_hdr),
Paragraph("NOTES", tbl_hdr)],
["Joints", "Peripheral arthritis (type 1 & 2)", "Both (CD > UC)", "Type 1 parallels bowel activity; Type 2 independent"],
["Joints", "Axial arthropathy / Ankylosing spondylitis", "Both; HLA-B27+", "Course independent of bowel disease"],
["Joints", "Sacroiliitis", "Both", "Often asymptomatic; detected on MRI"],
["Skin", "Erythema nodosum", "Both (CD > UC)", "Parallels bowel activity; tender red nodules on shins"],
["Skin", "Pyoderma gangrenosum", "Both (UC > CD)", "Ulcerating lesion; independent of bowel activity"],
["Eyes", "Episcleritis / Scleritis", "Both", "Correlates with bowel activity"],
["Eyes", "Uveitis / Iritis", "Both (CD > UC)", "Needs ophthalmology; independent of bowel activity"],
["Liver/Biliary", "Primary Sclerosing Cholangitis (PSC)", "UC >> CD (3-5%)", "Ongoing liver damage; elevated ALP; cancer risk"],
["Liver/Biliary", "Cholelithiasis", "CD (ileal disease)", "Ileal disease → bile salt malabsorption → cholesterol stones"],
["Metabolic", "Osteoporosis", "Both (steroid use, malabsorption)", "DEXA scan; calcium + vitamin D supplementation"],
["Metabolic", "Iron/B12/Folate deficiency anemia", "Both (CD ileal > UC)", "B12 deficiency specific to ileal CD/resection"],
["Renal", "Nephrolithiasis (oxalate stones)", "CD (ileal disease)", "Fatty acid-oxalate binding; hyperoxaluria"],
["Vascular", "Venous thromboembolism (DVT/PE)", "Both (especially flares)", "IBD is prothrombotic; anticoagulate appropriately"],
]
eim_table = Table(eim_data,
colWidths=[page_w*0.12, page_w*0.26, page_w*0.20, page_w*0.42],
repeatRows=1, hAlign='LEFT')
eim_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), HEADER_BG),
('TEXTCOLOR', (0,0), (-1,0), white),
('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'),
('FONTSIZE', (0,0), (-1,0), 7.5),
('ROWBACKGROUNDS', (0,1), (-1,-1), [white, LIGHT_GRAY]),
('GRID', (0,0), (-1,-1), 0.4, GRID_COLOR),
('FONTSIZE', (0,1), (-1,-1), 7),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 3),
('BOTTOMPADDING', (0,0), (-1,-1), 3),
('LEFTPADDING', (0,0), (-1,-1), 4),
('RIGHTPADDING', (0,0), (-1,-1), 4),
]))
story.append(eim_table)
story.append(Spacer(1,0.2*cm))
# =========================================================
# SECTION 8 - MONITORING & CANCER SURVEILLANCE
# =========================================================
story.append(Paragraph(" 8. MONITORING & CANCER SURVEILLANCE", sec_head))
story.append(Spacer(1,4))
mon_cols = [
[
Paragraph("<b>Routine Monitoring (all IBD patients):</b>", body_sm),
Paragraph("• CBC, CRP, ESR, LFTs, albumin every 3-6 months (active) or 6-12 months (remission)", bullet),
Paragraph("• Fecal calprotectin to assess mucosal activity non-invasively", bullet),
Paragraph("• TPMT/NUDT15 genotyping before starting AZA/6-MP", bullet),
Paragraph("• Vaccinations: Flu (annual), Pneumococcal, Hepatitis B, HPV before immunosuppression", bullet),
Paragraph("• DEXA scan if on corticosteroids >3 months", bullet),
Paragraph("• Vitamin B12, folate, iron, 25-OH Vitamin D levels", bullet),
],
[
Paragraph("<b>Cancer Surveillance Colonoscopy:</b>", body_sm),
Paragraph("• UC: Start surveillance 8-10 years after diagnosis (extensive disease)", bullet),
Paragraph("• UC proctitis only: no increased risk - standard population screening", bullet),
Paragraph("• Colonoscopy every 1-2 years with systematic biopsies (4 quadrant q10 cm)", bullet),
Paragraph("• CD colitis: Same surveillance protocol as UC", bullet),
Paragraph("• PSC + UC: Annual colonoscopy from time of PSC diagnosis", bullet),
Paragraph("<b>Red flag: Stricture in UC</b> → presume malignant until proven otherwise", bullet),
],
]
mon_table = Table([mon_cols], colWidths=[page_w*0.49, page_w*0.49], hAlign='LEFT')
mon_table.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,-1), LIGHT_GRAY),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 8),
('BOTTOMPADDING', (0,0), (-1,-1), 8),
('LEFTPADDING', (0,0), (-1,-1), 8),
('RIGHTPADDING', (0,0), (-1,-1), 8),
('BOX', (0,0), (-1,-1), 1, MED_GRAY),
('INNERGRID', (0,0), (-1,-1), 0.5, MED_GRAY),
]))
story.append(mon_table)
# =========================================================
# FOOTER NOTE
# =========================================================
story.append(Spacer(1,0.4*cm))
story.append(HRFlowable(width=page_w, thickness=1, color=MED_GRAY))
story.append(Spacer(1,0.1*cm))
story.append(Paragraph(
"Sources: Sleisenger & Fordtran's GI and Liver Disease (10e) | Harrison's Principles of Internal Medicine (22e) | "
"Goldman-Cecil Medicine | Rosen's Emergency Medicine | Sabiston Textbook of Surgery. "
"This handbook is intended as a clinical aide-memoire for qualified medical professionals. "
"Always refer to current institutional guidelines and specialist input for individual patient management.",
ParagraphStyle('Footer', fontSize=6.5, fontName='Helvetica-Oblique',
textColor=HexColor('#777777'), leading=9, alignment=TA_CENTER)
))
doc.build(story)
print(f"PDF generated: {path}")
if __name__ == "__main__":
out = "/home/daytona/workspace/ibd-handbook/IBD_Clinical_Handbook.pdf"
make_doc(out)
cd /home/daytona/workspace/ibd-handbook && python3 build_pdf.py 2>&1
ls -lh /home/daytona/workspace/ibd-handbook/IBD_Clinical_Handbook.pdf
IBD Clinical Handbook
PDF Document · PDF
I am unable to download the pdf
ls -lh /home/daytona/workspace/ibd-handbook/ && echo "---" && file /home/daytona/workspace/ibd-handbook/IBD_Clinical_Handbook.pdf
IBD Clinical Handbook
PDF Document · PDF
It's showing error while downloading
~/ibd-handbook/IBD_Handbook.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IBD Clinical Handbook — Crohn's Disease vs Ulcerative Colitis</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Arial, sans-serif; font-size: 13px; color: #222; background: #f5f5f5; }
.page { max-width: 1050px; margin: 0 auto; background: white; padding: 30px 36px 40px; }
/* COVER */
.cover-header { background: #1B2631; color: white; text-align: center; padding: 30px 20px 20px; border-radius: 6px 6px 0 0; }
.cover-header h1 { font-size: 32px; letter-spacing: 2px; margin-bottom: 6px; }
.cover-sub-bar { display: flex; align-items: stretch; margin-top: 12px; border-radius: 4px; overflow: hidden; }
.cover-cd { background: #1A5276; color: white; flex: 1; text-align: center; padding: 12px 10px; font-size: 16px; font-weight: bold; }
.cover-vs { background: #eee; color: #333; padding: 12px 16px; font-size: 16px; font-weight: bold; display: flex; align-items: center; }
.cover-uc { background: #922B21; color: white; flex: 1; text-align: center; padding: 12px 10px; font-size: 16px; font-weight: bold; }
.cover-line { text-align: center; color: #555; margin: 10px 0 4px; font-size: 12px; }
.cover-auth { text-align: center; color: #888; font-style: italic; font-size: 11px; margin-bottom: 8px; }
.cover-rule { border: none; border-top: 3px solid #F39C12; margin: 10px 0 18px; }
/* SECTION HEADERS */
.sec-head { background: #1B2631; color: white; padding: 7px 12px; font-size: 14px; font-weight: bold; margin: 22px 0 8px; border-radius: 3px; }
/* SUB HEADERS */
.sub-head { color: #1A5276; font-size: 11.5px; font-weight: bold; margin: 14px 0 6px; }
/* OVERVIEW BOXES */
.overview-row { display: flex; gap: 10px; margin-bottom: 12px; }
.cd-box { flex: 1; background: #D6EAF8; border: 1.5px solid #1A5276; border-radius: 4px; padding: 12px; }
.uc-box { flex: 1; background: #FADBD8; border: 1.5px solid #922B21; border-radius: 4px; padding: 12px; }
.cd-box-head { background: #1A5276; color: white; margin: -12px -12px 8px; padding: 6px 10px; font-weight: bold; font-size: 12px; border-radius: 3px 3px 0 0; }
.uc-box-head { background: #922B21; color: white; margin: -12px -12px 8px; padding: 6px 10px; font-weight: bold; font-size: 12px; border-radius: 3px 3px 0 0; }
.overview-row ul { padding-left: 14px; }
.overview-row li { margin: 3px 0; font-size: 12px; line-height: 1.5; }
/* SHARED BOX */
.shared-box { background: #EAFAF1; border: 1.5px solid #1E8449; border-radius: 4px; padding: 10px 14px; margin: 8px 0 16px; font-size: 12px; line-height: 1.6; }
/* KEY/NOTE BOXES */
.key-box { background: #FEF9E7; border: 1.5px solid #F39C12; border-radius: 4px; padding: 8px 12px; margin: 8px 0; font-size: 11.5px; font-style: italic; line-height: 1.5; }
.goal-box { background: #F2F3F4; border: 1.5px solid #D5D8DC; border-radius: 4px; padding: 8px 12px; margin: 8px 0; font-size: 12px; line-height: 1.6; }
/* TABLES */
table { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 12px; }
th { padding: 6px 7px; text-align: left; color: white; font-size: 11px; }
td { padding: 5px 7px; vertical-align: top; border: 0.5px solid #AEB6BF; line-height: 1.4; }
tr:nth-child(even) td { background: #F2F3F4; }
tr:nth-child(odd) td { background: white; }
.th-dark { background: #1B2631; }
.th-cd { background: #1A5276; }
.th-uc { background: #922B21; }
.th-cd2 { background: #1F618D; }
.td-label { font-weight: bold; }
/* NOTE TEXT */
.note { font-size: 10.5px; color: #555; font-style: italic; margin: 2px 0 8px; }
/* IMAGES */
.img-section { margin: 14px 0; }
.img-full { width: 100%; border-radius: 4px; border: 1px solid #ddd; display: block; }
.img-half-row { display: flex; gap: 14px; margin: 10px 0; }
.img-half { flex: 1; text-align: center; }
.img-half img { width: 100%; border-radius: 4px; border: 1px solid #ddd; max-height: 220px; object-fit: cover; }
.caption { font-size: 10.5px; color: #555; font-style: italic; text-align: center; margin-top: 4px; line-height: 1.4; }
/* ALGO BOXES */
.algo-row { display: flex; gap: 10px; margin: 10px 0; }
.algo-cd { flex: 1; background: #D6EAF8; border: 1.5px solid #1A5276; border-radius: 4px; padding: 12px; }
.algo-uc { flex: 1; background: #FADBD8; border: 1.5px solid #922B21; border-radius: 4px; padding: 12px; }
.algo-cd-head { background: #1A5276; color: white; margin: -12px -12px 8px; padding: 6px 10px; font-weight: bold; font-size: 12px; border-radius: 3px 3px 0 0; }
.algo-uc-head { background: #922B21; color: white; margin: -12px -12px 8px; padding: 6px 10px; font-weight: bold; font-size: 12px; border-radius: 3px 3px 0 0; }
.algo-cd ul, .algo-uc ul { padding-left: 14px; }
.algo-cd li, .algo-uc li { margin: 3px 0; font-size: 12px; line-height: 1.5; }
.algo-subhead { font-size: 11.5px; font-weight: bold; margin: 10px 0 3px; }
/* MONITORING ROW */
.mon-row { display: flex; gap: 10px; margin: 8px 0; }
.mon-box { flex: 1; background: #F2F3F4; border: 1px solid #D5D8DC; border-radius: 4px; padding: 12px; }
.mon-box ul { padding-left: 14px; }
.mon-box li { margin: 3px 0; font-size: 12px; line-height: 1.5; }
/* FOOTER */
.footer { margin-top: 24px; border-top: 1px solid #D5D8DC; padding-top: 8px; font-size: 10px; color: #777; font-style: italic; text-align: center; line-height: 1.5; }
/* PRINT */
@media print {
body { background: white; font-size: 11px; }
.page { padding: 10px 16px; max-width: 100%; }
.sec-head { font-size: 12px; }
th, td { font-size: 10px; padding: 3px 5px; }
.img-half img { max-height: 180px; }
h1 { font-size: 26px; }
.cover-cd, .cover-uc { font-size: 14px; }
.page-break { page-break-before: always; }
}
</style>
</head>
<body>
<div class="page">
<!-- ===== COVER ===== -->
<div class="cover-header">
<h1>IBD CLINICAL HANDBOOK</h1>
<p style="color:#AED6F1; font-size:13px; margin-top:4px;">Inflammatory Bowel Disease — Hospital Intern Edition</p>
</div>
<div class="cover-sub-bar">
<div class="cover-cd">CROHN'S DISEASE</div>
<div class="cover-vs">vs</div>
<div class="cover-uc">ULCERATIVE COLITIS</div>
</div>
<p class="cover-line">Classification • Diagnosis • Treatment • Extraintestinal Manifestations</p>
<p class="cover-auth">Compiled from: Sleisenger & Fordtran's GI Disease • Harrison's 22e • Goldman-Cecil Medicine • Rosen's EM • Sabiston Surgery</p>
<hr class="cover-rule">
<!-- ===== SECTION 1 ===== -->
<div class="sec-head">1. OVERVIEW & RELATIONSHIP</div>
<div class="overview-row">
<div class="cd-box">
<div class="cd-box-head">CROHN'S DISEASE (CD)</div>
<ul>
<li>Any part of the GI tract (mouth to anus)</li>
<li><strong>Transmural</strong> (full-thickness) inflammation</li>
<li><strong>Skip lesions</strong> — discontinuous involvement</li>
<li>Terminal ileum + proximal colon most common (70%)</li>
<li>Granulomas on biopsy (~30% of cases)</li>
<li>Fistulae, abscesses, strictures are common</li>
<li>Surgery is <strong>NOT curative</strong>; 50% need surgery within 10 years</li>
</ul>
</div>
<div class="uc-box">
<div class="uc-box-head">ULCERATIVE COLITIS (UC)</div>
<ul>
<li>Colon only — always starts in rectum</li>
<li><strong>Mucosal & submucosal</strong> inflammation only</li>
<li><strong>Continuous</strong> lesion — starts in rectum, extends proximally</li>
<li>Rectum almost always involved (95%)</li>
<li>No granulomas; crypt abscesses + cryptitis (hallmark)</li>
<li>Toxic megacolon, massive hemorrhage — key complications</li>
<li>Proctocolectomy is <strong>CURATIVE</strong></li>
</ul>
</div>
</div>
<div class="shared-box">
<strong>Shared biology (IBD umbrella):</strong> Both are chronic relapsing-remitting immune-mediated conditions. Both involve dysregulated mucosal immunity, genetic susceptibility (NOD2, HLA loci), and microbial triggers. Both carry elevated colorectal cancer (CRC) risk with long-standing disease. ~10–15% of colitis cases cannot be definitively classified = <strong>Indeterminate Colitis</strong>.
</div>
<!-- ===== SECTION 2 ===== -->
<div class="sec-head">2. CLINICAL COMPARISON AT A GLANCE</div>
<table>
<thead>
<tr>
<th class="th-dark" style="width:22%">FEATURE</th>
<th class="th-cd" style="width:39%">CROHN'S DISEASE</th>
<th class="th-uc" style="width:39%">ULCERATIVE COLITIS</th>
</tr>
</thead>
<tbody>
<tr><td class="td-label">Location</td><td>Mouth to anus; often terminal ileum + proximal colon</td><td>Colon only; always starts in rectum</td></tr>
<tr><td class="td-label">Pattern</td><td>Skip lesions (discontinuous)</td><td>Continuous, confluent lesion</td></tr>
<tr><td class="td-label">Depth of inflammation</td><td>Transmural (all layers)</td><td>Mucosal + submucosal only</td></tr>
<tr><td class="td-label">Rectal involvement</td><td>Spared in ~50% of cases</td><td>Almost always involved (95%)</td></tr>
<tr><td class="td-label">Bleeding</td><td>Less common, mild</td><td>Hallmark — bloody diarrhea</td></tr>
<tr><td class="td-label">Diarrhea</td><td>Non-bloody, often nocturnal</td><td>Bloody, with urgency & tenesmus</td></tr>
<tr><td class="td-label">Abdominal pain</td><td>RLQ pain (can mimic appendicitis)</td><td>Left-sided cramping, post-prandial</td></tr>
<tr><td class="td-label">Perianal disease</td><td>Common: fissures, fistulae, skin tags (~25–30%)</td><td>Rare; if extensive → suspect CD</td></tr>
<tr><td class="td-label">Fistulae / Abscesses</td><td>Yes — entero-enteric, entero-vesical, perianal</td><td>No (except toxic megacolon perforation)</td></tr>
<tr><td class="td-label">Strictures</td><td>Common (fibrosis/stenosis)</td><td>Rare; if present presume malignancy</td></tr>
<tr><td class="td-label">Granulomas (biopsy)</td><td>Yes (~30%) — key distinguishing feature</td><td>No</td></tr>
<tr><td class="td-label">Crypt abscesses</td><td>Less prominent</td><td>Hallmark histological finding</td></tr>
<tr><td class="td-label">Cobblestone mucosa</td><td>Yes (endoscopy)</td><td>No</td></tr>
<tr><td class="td-label">Pseudopolyps</td><td>Occasional</td><td>Common (chronic disease)</td></tr>
<tr><td class="td-label">Lead pipe colon</td><td>No</td><td>Yes — loss of haustra on X-ray</td></tr>
<tr><td class="td-label">Peak age of onset</td><td>15–30 yrs; 2nd peak 7th decade</td><td>20–40 yrs; smaller 2nd peak 7th decade</td></tr>
<tr><td class="td-label">Sex ratio</td><td>F > M (1.2:1)</td><td>M = F (1:1)</td></tr>
<tr><td class="td-label">EIMs (joints, eyes, skin)</td><td>More frequent (~35%)</td><td>Less frequent (~27%)</td></tr>
<tr><td class="td-label">PSC association</td><td>Less common</td><td>More common (3–5%)</td></tr>
<tr><td class="td-label">CRC risk</td><td>4–20× general population (colonic CD)</td><td>Rises after 7–8 yrs; up to 18–34% at 30 yrs (pancolitis)</td></tr>
<tr><td class="td-label">Surgery curability</td><td>NOT curative — disease recurs at anastomosis</td><td>Proctocolectomy = CURATIVE</td></tr>
</tbody>
</table>
<p class="note">EIMs = extraintestinal manifestations; PSC = primary sclerosing cholangitis; RLQ = right lower quadrant; CRC = colorectal cancer</p>
<!-- ===== SECTION 3 IMAGES ===== -->
<div class="page-break"></div>
<div class="sec-head">3. VISUAL COMPARISON</div>
<div class="img-section">
<img class="img-full" src="https://cdn.orris.care/cdss_images/cac54a3a0c24530ae4ca4341d2a3f644e79dfdf1e6f69771ae866923acabe172.png" alt="UC Phenotypes Montreal Classification">
<p class="caption"><strong>Fig. 1</strong> — Ulcerative Colitis Phenotypes by Montreal Classification. <em>Left:</em> Proctitis (E1, 30–60% of patients) — rectal bleeding, tenesmus. <em>Middle:</em> Left-sided colitis (E2, 16–45%) — plus diarrhea & cramping. <em>Right:</em> Extensive/pancolitis (E3, 15–35%) — constitutional symptoms, fever, fatigue. [Yamada's Textbook of Gastroenterology]</p>
</div>
<div class="img-half-row">
<div class="img-half">
<img src="https://cdn.orris.care/cdss_images/9bc6863451dcc91fc0fde2143dca656dcaf1c3a623399b049a99a9a9ad370142.png" alt="UC Colonoscopy">
<p class="caption"><strong>Fig. 2</strong> — Colonoscopy: Severe UC showing diffuse erythema, friability, loss of vascular pattern, and mucopurulent exudates. Continuous involvement starting from rectum. [Harrison's 22e]</p>
</div>
<div class="img-half">
<img src="https://cdn.orris.care/cdss_images/62fa6f415d16466c366337db8ebac4b02e26312feda4e513e27ff1bb76a5acbd.png" alt="Crohn's Histology">
<p class="caption"><strong>Fig. 3</strong> — Histology: Crohn's colitis (H&E, medium power). Mixed acute & chronic inflammation, crypt atrophy, and epithelioid granulomas in the mucosa — the key distinguishing histological feature from UC. [Harrison's 22e]</p>
</div>
</div>
<div class="img-half-row">
<div class="img-half">
<img src="https://cdn.orris.care/cdss_images/3696cc94246cdeb3c4751e13fc41b70ae8d64efefadf9e834d2ba5cb902ea975.png" alt="Toxic Megacolon X-ray">
<p class="caption"><strong>Fig. 4</strong> — Plain AXR: Toxic megacolon (UC complication). Markedly dilated transverse colon (>6 cm) with loss of haustration. A systemic toxicity + colonic dilation = surgical emergency. [Rosen's EM]</p>
</div>
<div class="img-half">
<img src="https://cdn.orris.care/cdss_images/bb034e8d154caa6ade8d0e936899d138fd947e427fd03875585bc58d52c37af1.png" alt="CD MR Enterography">
<p class="caption"><strong>Fig. 5</strong> — MR Enterography (CD): Coronal gadolinium-enhanced view showing mural hyperenhancement, mural thickening, and the <em>"comb sign"</em> (engorged peri-enteric vasculature) in the terminal ileum. [Sleisenger & Fordtran]</p>
</div>
</div>
<!-- ===== SECTION 4 CLASSIFICATION ===== -->
<div class="page-break"></div>
<div class="sec-head">4. CLASSIFICATION SYSTEMS</div>
<div class="sub-head">4A. Montreal Classification — Ulcerative Colitis (Extent + Severity)</div>
<table>
<thead>
<tr>
<th class="th-uc" style="width:30%">EXTENT</th>
<th class="th-uc" style="width:8%">CODE</th>
<th class="th-uc">ANATOMY</th>
</tr>
</thead>
<tbody>
<tr><td>Ulcerative Proctitis</td><td><strong>E1</strong></td><td>Involvement limited to the rectum</td></tr>
<tr><td>Left-sided UC (Distal UC)</td><td><strong>E2</strong></td><td>Colorectum distal to the splenic flexure</td></tr>
<tr><td>Extensive UC (Pancolitis)</td><td><strong>E3</strong></td><td>Extends proximal to the splenic flexure</td></tr>
</tbody>
</table>
<table style="margin-top:6px;">
<thead>
<tr>
<th class="th-uc" style="width:22%">SEVERITY</th>
<th class="th-uc" style="width:8%">CODE</th>
<th class="th-uc">DEFINITION (Truelove-Witts / Montreal criteria)</th>
</tr>
</thead>
<tbody>
<tr><td>Clinical remission</td><td><strong>S0</strong></td><td>Absence of symptoms</td></tr>
<tr><td>Mild activity</td><td><strong>S1</strong></td><td>≤4 stools/day (with or without blood), no systemic illness, normal ESR</td></tr>
<tr><td>Moderate activity</td><td><strong>S2</strong></td><td>≥4 stools/day, minimal signs of systemic toxicity</td></tr>
<tr><td>Severe activity</td><td><strong>S3</strong></td><td>≥6 bloody stools/day, pulse ≥90/min, temp ≥37.5°C, Hb <10.5 g/dL, ESR ≥30 mm/h</td></tr>
</tbody>
</table>
<div class="sub-head" style="margin-top:14px;">4B. Montreal Classification — Crohn's Disease (A-L-B System)</div>
<p class="note" style="margin-bottom:6px;">Disease behavior typically progresses over time: B1 (inflammatory) → B2 (stricturing) → B3 (penetrating/fistulizing). Add 'p' if perianal disease present (e.g., B3p).</p>
<table>
<thead>
<tr>
<th class="th-cd" style="width:18%">AGE (A)</th>
<th class="th-cd" style="width:8%">CODE</th>
<th class="th-cd" style="width:24%">DEFINITION</th>
<th class="th-cd" style="width:18%">LOCATION (L)</th>
<th class="th-cd" style="width:8%">CODE</th>
<th class="th-cd">DEFINITION</th>
</tr>
</thead>
<tbody>
<tr><td>Pediatric/young</td><td><strong>A1</strong></td><td>≤16 years</td><td>Terminal ileum</td><td><strong>L1</strong></td><td>Ileal ± limited cecal disease</td></tr>
<tr><td>Young adult</td><td><strong>A2</strong></td><td>17–40 years</td><td>Colonic</td><td><strong>L2</strong></td><td>Any colonic site, excluding ileum/upper GI</td></tr>
<tr><td>Older adult</td><td><strong>A3</strong></td><td>>40 years</td><td>Ileocolonic</td><td><strong>L3</strong></td><td>Both ileal and colonic involvement</td></tr>
<tr><td></td><td></td><td></td><td>Upper GI modifier</td><td><strong>L4</strong></td><td>Any disease proximal to terminal ileum (added to L1–L3)</td></tr>
</tbody>
</table>
<table style="margin-top:6px;">
<thead>
<tr>
<th class="th-cd2" style="width:35%">BEHAVIOR (B)</th>
<th class="th-cd2" style="width:8%">CODE</th>
<th class="th-cd2">DEFINITION & CLINICAL IMPLICATION</th>
</tr>
</thead>
<tbody>
<tr><td>Inflammatory (non-stricturing, non-penetrating)</td><td><strong>B1</strong></td><td>No structurally complicating features; often early disease</td></tr>
<tr><td>Stricturing / Fibrostenotic</td><td><strong>B2</strong></td><td>Luminal narrowing ± obstruction; may require dilation or stricturoplasty</td></tr>
<tr><td>Penetrating / Fistulizing</td><td><strong>B3</strong></td><td>Fistula, abscess, or inflammatory mass; often requires surgical or combined medical-surgical management</td></tr>
<tr><td>Perianal modifier</td><td><strong>p</strong></td><td>Add 'p' to any B category if perianal disease is present (e.g., B1p, B3p)</td></tr>
</tbody>
</table>
<!-- ===== SECTION 5 DIAGNOSIS ===== -->
<div class="page-break"></div>
<div class="sec-head">5. DIAGNOSIS</div>
<table>
<thead>
<tr>
<th class="th-dark" style="width:20%">INVESTIGATION</th>
<th class="th-cd" style="width:40%">CROHN'S DISEASE</th>
<th class="th-uc" style="width:40%">ULCERATIVE COLITIS</th>
</tr>
</thead>
<tbody>
<tr>
<td class="td-label">Labs (CBC, CRP, ESR, albumin)</td>
<td>Elevated CRP/ESR; anemia (chronic disease, blood loss, B12 deficiency if ileal disease); hypoalbuminemia in severe disease</td>
<td>Elevated CRP/ESR; anemia (blood loss); leukocytosis; hypoalbuminemia in severe disease</td>
</tr>
<tr>
<td class="td-label">Fecal Calprotectin</td>
<td>Elevated in active disease (pooled sensitivity ~88%); lower specificity in CD (~67%) vs UC</td>
<td>Elevated in active disease; higher specificity (~79%); valuable for monitoring mucosal healing</td>
</tr>
<tr>
<td class="td-label">Stool Cultures</td>
<td colspan="2" style="background:#FEF9E7;"><strong>MANDATORY for both:</strong> Exclude Salmonella, Campylobacter, E. coli O157, Giardia, and <em>C. difficile</em> toxin before starting immunosuppression</td>
</tr>
<tr>
<td class="td-label">Serology (ASCA / pANCA)</td>
<td>ASCA+ (40–70%), pANCA− → supports CD. ASCA IgA+IgG+/pANCA−: sensitivity 55%, specificity 93% for CD</td>
<td>pANCA+ (55%), ASCA− → supports UC. Useful when colonoscopy/histology inconclusive</td>
</tr>
<tr>
<td class="td-label">Colonoscopy + Biopsy</td>
<td>Skip lesions, cobblestone mucosa, linear/aphthous ulcers, rectal sparing; <strong>granulomas on biopsy</strong></td>
<td>Continuous inflammation from rectum; granular/friable mucosa, pseudopolyps; <strong>crypt abscesses, NO granulomas</strong></td>
</tr>
<tr>
<td class="td-label">CT/MR Enterography</td>
<td>Gold standard for small bowel: mural thickening, comb sign, strictures, fistulae, abscesses. MRE preferred (no radiation)</td>
<td>Not first-line; use for suspected toxic megacolon, perforation, or when colonoscopy incomplete</td>
</tr>
<tr>
<td class="td-label">Capsule Endoscopy</td>
<td>Use when CTE negative but CD suspected. <strong>Contraindicated if stricture present</strong></td>
<td>Not typically used</td>
</tr>
<tr>
<td class="td-label">Plain Abdominal X-ray</td>
<td>Dilated loops (obstruction); free air (perforation)</td>
<td><strong>Toxic megacolon:</strong> transverse colon >6 cm, loss of haustration</td>
</tr>
<tr>
<td class="td-label">Barium studies</td>
<td>String sign (ileal stricture); rose-thorn ulcers; skip areas (largely superseded by MRE)</td>
<td>Lead-pipe colon (loss of haustra); backwash ileitis in pancolitis (largely superseded)</td>
</tr>
</tbody>
</table>
<div class="key-box">
<strong>Key principle:</strong> Diagnosis requires clinical + endoscopic + histologic correlation. Stool cultures must exclude infection BEFORE starting immunosuppression. Symptoms alone should not guide therapy — mucosal healing (endoscopy + calprotectin normalization) is the therapeutic target. If the diagnosis remains unclear after full workup = <strong>Indeterminate Colitis</strong>.
</div>
<!-- ===== SECTION 6 TREATMENT ===== -->
<div class="page-break"></div>
<div class="sec-head">6. TREATMENT</div>
<div class="goal-box">
<strong>Goal:</strong> Induce AND maintain <em>mucosal healing</em> — not just symptom control. Therapeutic targets = clinical remission + endoscopic remission + normalization of CRP/calprotectin. Approach: <strong>step-up</strong> (mild disease, start with 5-ASA/budesonide) or <strong>top-down</strong> (high-risk/severe disease, start with biologics early).
</div>
<div class="sub-head">6A. Drug Classes</div>
<table>
<thead>
<tr>
<th class="th-dark" style="width:16%">DRUG CLASS</th>
<th class="th-dark" style="width:22%">AGENTS & DOSING</th>
<th class="th-cd" style="width:31%">CROHN'S DISEASE</th>
<th class="th-uc" style="width:31%">ULCERATIVE COLITIS</th>
</tr>
</thead>
<tbody>
<tr>
<td class="td-label">5-ASA</td>
<td>Mesalamine, sulfasalazine, olsalazine; rectal suppositories/enemas</td>
<td>Limited benefit in CD; <strong>NOT routinely recommended</strong></td>
<td><strong>FIRST-LINE</strong> for mild-moderate UC; induction + maintenance. Rectal formulations for distal disease</td>
</tr>
<tr>
<td class="td-label">Corticosteroids</td>
<td>Prednisone 40–60 mg/d PO; IV methylprednisolone 40–60 mg/d; Budesonide (enteric/MMX)</td>
<td>Flares only (NOT maintenance); Budesonide for mild-moderate ileocecal CD</td>
<td>Flares only (NOT maintenance); Budesonide MMX for mild-moderate UC; IV for severe disease</td>
</tr>
<tr>
<td class="td-label">Immunomodulators</td>
<td>Azathioprine 2–3 mg/kg; 6-MP 1–1.5 mg/kg; Methotrexate 25 mg/wk IM (CD)</td>
<td>Maintenance; steroid-sparing; often combined with anti-TNF (combo therapy)</td>
<td>Maintenance (AZA/6-MP); steroid-sparing. MTX less used in UC</td>
</tr>
<tr>
<td class="td-label">Anti-TNF Biologics</td>
<td>Infliximab (IV q8w); Adalimumab (SC q2w); Certolizumab (CD); Golimumab (UC only)</td>
<td>Moderate-severe CD; fistulizing disease; steroid-dependent/refractory. Combo with AZA most effective</td>
<td>Moderate-severe UC; IV infliximab for acute severe UC (steroid-refractory, rescue therapy)</td>
</tr>
<tr>
<td class="td-label">Anti-integrin</td>
<td>Vedolizumab (IV/SC); Natalizumab (CD; PML risk — rarely used)</td>
<td>Moderate-severe CD; gut-selective, good safety profile</td>
<td>Moderate-severe UC; preferred in elderly or patients with significant comorbidities</td>
</tr>
<tr>
<td class="td-label">Anti-IL-12/23</td>
<td>Ustekinumab (IV induction, then SC q8–12w)</td>
<td>Moderate-severe CD; refractory to anti-TNF</td>
<td>Moderate-severe UC (approved)</td>
</tr>
<tr>
<td class="td-label">JAK Inhibitors</td>
<td>Tofacitinib (UC); Upadacitinib (UC+CD); Ozanimod/Etrasimod (UC)</td>
<td>Upadacitinib for moderate-severe CD</td>
<td>Tofacitinib, upadacitinib for moderate-severe UC; rapid onset useful in acute setting</td>
</tr>
<tr>
<td class="td-label">Antibiotics</td>
<td>Metronidazole, Ciprofloxacin, Rifaximin</td>
<td>Perianal disease, abscesses, bacterial overgrowth. NOT primary IBD therapy</td>
<td>Pouchitis after IPAA. NOT primary UC therapy</td>
</tr>
</tbody>
</table>
<div class="sub-head" style="margin-top:14px;">6B. Disease-Specific Treatment Algorithms</div>
<div class="algo-row">
<div class="algo-cd">
<div class="algo-cd-head">CROHN'S DISEASE</div>
<p class="algo-subhead">Mild-Moderate Ileocecal CD:</p>
<ul>
<li>Budesonide 9 mg/day × 8–12 weeks (induction)</li>
<li>Add AZA/6-MP for steroid-dependent disease</li>
</ul>
<p class="algo-subhead">Moderate-Severe CD:</p>
<ul>
<li>Anti-TNF (infliximab or adalimumab) ± AZA (combo more effective)</li>
<li>Ustekinumab or vedolizumab if anti-TNF failure/intolerance</li>
<li>Upadacitinib (JAK-1) for refractory disease</li>
</ul>
<p class="algo-subhead">Fistulizing / Perianal CD:</p>
<ul>
<li>Exam under anesthesia (EUA) + surgical drainage of abscess first</li>
<li>Antibiotics (metronidazole/ciprofloxacin) as bridge</li>
<li>IV infliximab for induction; seton placement for complex fistulae</li>
</ul>
<p class="algo-subhead">Surgery (NOT curative):</p>
<ul>
<li>Stricturoplasty or resection for obstruction</li>
<li>Bowel-sparing approach — disease recurs at anastomosis</li>
<li>Postoperative prophylaxis with anti-TNF/immunomodulator</li>
</ul>
</div>
<div class="algo-uc">
<div class="algo-uc-head">ULCERATIVE COLITIS</div>
<p class="algo-subhead">Mild-Moderate Proctitis/Left-sided:</p>
<ul>
<li>Mesalamine suppository/enema (topical 5-ASA) + oral 5-ASA</li>
<li>Topical 5-ASA > topical steroids for distal disease</li>
</ul>
<p class="algo-subhead">Mild-Moderate Extensive UC:</p>
<ul>
<li>Oral mesalamine 2–4.8 g/day</li>
<li>Prednisone for induction if 5-ASA fails</li>
<li>AZA/6-MP for steroid-dependent disease</li>
</ul>
<p class="algo-subhead">Moderate-Severe UC:</p>
<ul>
<li>Anti-TNF (infliximab, adalimumab, or golimumab)</li>
<li>Vedolizumab (preferred in elderly/comorbidities)</li>
<li>Tofacitinib or upadacitinib as alternatives</li>
</ul>
<p class="algo-subhead">Acute Severe UC (hospital admission):</p>
<ul>
<li>IV hydrocortisone 100 mg q6h or methylprednisolone 60 mg/day</li>
<li>No improvement in 3–5 days → rescue: IV infliximab or IV cyclosporine</li>
<li>Toxic megacolon: emergency subtotal colectomy</li>
</ul>
<p class="algo-subhead">Surgery (CURATIVE):</p>
<ul>
<li>Proctocolectomy + IPAA (J-pouch) — standard procedure</li>
<li>Indications: refractory disease, dysplasia/cancer, toxic megacolon, perforation</li>
</ul>
</div>
</div>
<!-- ===== SECTION 7 EIMs ===== -->
<div class="page-break"></div>
<div class="sec-head">7. EXTRAINTESTINAL MANIFESTATIONS (EIMs) & COMPLICATIONS</div>
<table>
<thead>
<tr>
<th class="th-dark" style="width:11%">CATEGORY</th>
<th class="th-dark" style="width:26%">MANIFESTATION</th>
<th class="th-dark" style="width:18%">DISEASE ASSOCIATION</th>
<th class="th-dark">CLINICAL NOTES</th>
</tr>
</thead>
<tbody>
<tr><td class="td-label">Joints</td><td>Peripheral arthritis (Type 1 & 2)</td><td>Both (CD > UC)</td><td>Type 1: large joints, parallels bowel activity. Type 2: small joints, course independent</td></tr>
<tr><td class="td-label">Joints</td><td>Ankylosing spondylitis</td><td>Both; HLA-B27+</td><td>Course independent of bowel disease; may require fiberoptic intubation if severe</td></tr>
<tr><td class="td-label">Joints</td><td>Sacroiliitis</td><td>Both</td><td>Often asymptomatic; detected on MRI pelvis</td></tr>
<tr><td class="td-label">Skin</td><td>Erythema nodosum</td><td>Both (CD > UC)</td><td>Tender red nodules on shins; parallels bowel activity; treat the IBD</td></tr>
<tr><td class="td-label">Skin</td><td>Pyoderma gangrenosum</td><td>Both (UC > CD)</td><td>Ulcerating lesion, usually on legs; course independent; avoid debridement</td></tr>
<tr><td class="td-label">Eyes</td><td>Episcleritis / Scleritis</td><td>Both</td><td>Correlates with bowel activity; treat the IBD ± topical steroids</td></tr>
<tr><td class="td-label">Eyes</td><td>Uveitis / Iritis</td><td>Both (CD > UC)</td><td>Urgent ophthalmology; course independent of bowel disease</td></tr>
<tr><td class="td-label">Liver</td><td>Primary Sclerosing Cholangitis (PSC)</td><td>UC >> CD (3–5% of UC)</td><td>Progressive biliary fibrosis; elevated ALP; annual colonoscopy from diagnosis; CRC + cholangiocarcinoma risk</td></tr>
<tr><td class="td-label">Liver</td><td>Cholelithiasis (gallstones)</td><td>CD (ileal disease)</td><td>Bile salt malabsorption → cholesterol stone formation</td></tr>
<tr><td class="td-label">Metabolic</td><td>Osteoporosis / Osteopenia</td><td>Both (steroid use)</td><td>DEXA scan; calcium + Vitamin D supplementation; bisphosphonates if needed</td></tr>
<tr><td class="td-label">Metabolic</td><td>B12 / Iron / Folate deficiency anemia</td><td>CD ileal > UC</td><td>B12 deficiency specific to ileal CD or after ileal resection >100 cm</td></tr>
<tr><td class="td-label">Renal</td><td>Nephrolithiasis (oxalate stones)</td><td>CD (ileal disease)</td><td>Fatty acid-oxalate binding → hyperoxaluria → calcium oxalate stones</td></tr>
<tr><td class="td-label">Vascular</td><td>DVT / Pulmonary embolism</td><td>Both (especially flares)</td><td>IBD is prothrombotic; VTE prophylaxis during hospitalizations; anticoagulate appropriately</td></tr>
</tbody>
</table>
<!-- ===== SECTION 8 MONITORING ===== -->
<div class="sec-head">8. MONITORING & CANCER SURVEILLANCE</div>
<div class="mon-row">
<div class="mon-box">
<p style="font-weight:bold; margin-bottom:6px;">Routine Monitoring (all IBD patients):</p>
<ul>
<li>CBC, CRP, ESR, LFTs, albumin every 3–6 months (active) or 6–12 months (remission)</li>
<li>Fecal calprotectin to assess mucosal activity non-invasively</li>
<li>TPMT / NUDT15 genotyping before starting AZA or 6-MP (thiopurine toxicity risk)</li>
<li>Vaccinations before immunosuppression: Flu (annual), Pneumococcal, Hep B, HPV, Varicella</li>
<li>DEXA scan if on corticosteroids >3 months</li>
<li>Vitamin B12, folate, iron, 25-OH Vitamin D levels annually</li>
<li>TB screening (Quantiferon/IGRA) before biologics</li>
</ul>
</div>
<div class="mon-box">
<p style="font-weight:bold; margin-bottom:6px;">Cancer Surveillance Colonoscopy:</p>
<ul>
<li>UC extensive disease: Start surveillance 8–10 years after symptom onset</li>
<li>UC proctitis only: No increased CRC risk — standard population screening</li>
<li>Colonoscopy every 1–2 years with systematic biopsies (4 quadrant every 10 cm)</li>
<li>Crohn's colitis: Same surveillance protocol as UC pancolitis</li>
<li>PSC + UC: Annual colonoscopy from time of PSC diagnosis (very high risk)</li>
<li><strong>Red flag:</strong> Stricture in UC → presume malignant until proven otherwise; surgery if colonoscope impassable</li>
</ul>
</div>
</div>
<!-- ===== FOOTER ===== -->
<div class="footer">
Sources: Sleisenger & Fordtran's Gastrointestinal and Liver Disease (10e) • Harrison's Principles of Internal Medicine (22e, 2025) • Goldman-Cecil Medicine (International Edition) • Rosen's Emergency Medicine • Sabiston Textbook of Surgery (21e)<br>
This handbook is an aide-memoire for qualified medical professionals. Always refer to current institutional guidelines and specialist input for individual patient management.
</div>
</div><!-- end .page -->
</body>
</html>
ls -lh /home/daytona/workspace/ibd-handbook/IBD_Handbook.html
IBD Handbook
HTML File · HTML
Ctrl+P (or Cmd+P) → Change destination to "Save as PDF" → SaveIt's showing 0.05kB file and no information is mentioned inside the file , it's empty.
wc -c /home/daytona/workspace/ibd-handbook/IBD_Handbook.html && head -5 /home/daytona/workspace/ibd-handbook/IBD_Handbook.html
which wkhtmltopdf; which chromium-browser; which google-chrome; which chromium; python3 -c "import weasyprint; print('weasyprint ok')" 2>/dev/null; python3 -c "import pdfkit; print('pdfkit ok')" 2>/dev/null
chromium --headless --no-sandbox --disable-gpu --print-to-pdf=/home/daytona/workspace/ibd-handbook/IBD_Handbook_chrome.pdf --print-to-pdf-no-header file:///home/daytona/workspace/ibd-handbook/IBD_Handbook.html 2>&1 | tail -5
ls -lh /home/daytona/workspace/ibd-handbook/IBD_Handbook_chrome.pdf && file /home/daytona/workspace/ibd-handbook/IBD_Handbook_chrome.pdf
IBD Handbook chrome
PDF Document · PDF
Still showing same problem.I am giving you last chance ,I don't have extra time to waste.
| CROHN'S DISEASE | ULCERATIVE COLITIS | |
|---|---|---|
| GI involvement | Mouth to anus (any segment) | Colon ONLY |
| Inflammation depth | Transmural (all layers) | Mucosal + submucosal only |
| Pattern | Skip lesions (discontinuous) | Continuous from rectum proximally |
| Rectum | Spared in ~50% | Almost always involved (95%) |
| Surgery | NOT curative - disease recurs | Proctocolectomy = CURATIVE |
| FEATURE | CROHN'S DISEASE | ULCERATIVE COLITIS |
|---|---|---|
| Location | Mouth to anus; terminal ileum + proximal colon most common | Colon only; starts in rectum |
| Pattern | Skip lesions | Continuous lesion |
| Depth | Transmural | Mucosal/submucosal |
| Rectal involvement | Spared ~50% | Present ~95% |
| Bleeding | Less common, mild | Hallmark — bloody diarrhea |
| Diarrhea | Non-bloody, nocturnal | Bloody + urgency + tenesmus |
| Abdominal pain | RLQ pain (mimics appendicitis) | Left-sided cramping, post-prandial |
| Perianal disease | Common — fissures, fistulae, skin tags (~25-30%) | Rare |
| Fistulae / Abscesses | Yes — entero-enteric, entero-vesical | No |
| Strictures | Common (fibrosis) | Rare — if present, presume malignancy |
| Granulomas (biopsy) | Yes ~30% (key feature) | No |
| Crypt abscesses | Less prominent | Hallmark histology |
| Cobblestone mucosa | Yes (endoscopy) | No |
| Pseudopolyps | Occasional | Common (chronic disease) |
| Lead pipe colon (X-ray) | No | Yes (loss of haustra) |
| Peak age onset | 15-30 yrs; 2nd peak 7th decade | 20-40 yrs; smaller 2nd peak |
| Sex ratio | F > M (1.2:1) | M = F (1:1) |
| EIMs | More frequent (~35%) | Less frequent (~27%) |
| PSC association | Less common | More common (3-5%) |
| CRC risk | 4-20× general population | Rises after 7-8 yrs; up to 34% at 30 yrs |
| Surgery | NOT curative | CURATIVE (colectomy) |





| Code | Name | Anatomy |
|---|---|---|
| E1 | Ulcerative Proctitis | Rectum only |
| E2 | Left-sided UC | Distal to splenic flexure |
| E3 | Extensive UC / Pancolitis | Proximal to splenic flexure |
| Code | Severity | Definition |
|---|---|---|
| S0 | Remission | No symptoms |
| S1 | Mild | ≤4 stools/day, no systemic illness, normal ESR |
| S2 | Moderate | ≥4 stools/day, minimal systemic toxicity |
| S3 | Severe | ≥6 bloody stools/day + pulse ≥90 + temp ≥37.5°C + Hb <10.5 g/dL + ESR ≥30 mm/h |
| Code | Definition |
|---|---|
| A1 | ≤16 years |
| A2 | 17-40 years |
| A3 | >40 years |
| Code | Definition |
|---|---|
| L1 | Terminal ileum (±limited cecal disease) |
| L2 | Colonic only |
| L3 | Ileocolonic |
| L4 | Upper GI modifier (add to L1-L3) |
| Code | Definition |
|---|---|
| B1 | Inflammatory (non-stricturing, non-penetrating) |
| B2 | Stricturing / Fibrostenotic |
| B3 | Penetrating / Fistulizing |
| +p | Perianal disease modifier (add to any B, e.g. B3p) |
| Investigation | Crohn's Disease | Ulcerative Colitis |
|---|---|---|
| Labs | Elevated CRP/ESR; anemia (chronic disease, B12 deficiency if ileal); hypoalbuminemia | Elevated CRP/ESR; anemia (blood loss); leukocytosis |
| Fecal Calprotectin | Elevated; sensitivity ~88%, specificity ~67% | Elevated; sensitivity ~88%, specificity ~79% |
| Stool cultures | MANDATORY FIRST — exclude C. diff, Salmonella, Campylobacter, Giardia before immunosuppression | Same — mandatory before starting therapy |
| Serology | ASCA+ (40-70%) / pANCA− → CD | pANCA+ (55%) / ASCA− → UC |
| Colonoscopy + biopsy | Skip lesions, cobblestone, linear ulcers, rectal sparing; granulomas | Continuous inflammation from rectum; friability; crypt abscesses, NO granulomas |
| CT/MR Enterography | Gold standard for small bowel; mural thickening, comb sign, strictures, fistulae, abscesses | Not first-line; use for toxic megacolon/perforation |
| Capsule endoscopy | If CTE negative but CD suspected. CONTRAINDICATED if stricture present | Not used |
| Plain AXR | Dilated loops (obstruction); free air (perforation) | Toxic megacolon: transverse colon >6 cm + loss of haustra |
Key: Diagnosis = clinical + endoscopic + histologic correlation. Always exclude infection first. Mucosal healing (not just symptoms) is the therapeutic target.
| Drug Class | Agents | Crohn's | Ulcerative Colitis |
|---|---|---|---|
| 5-ASA | Mesalamine, sulfasalazine | NOT recommended routinely in CD | FIRST-LINE mild-moderate UC; induction + maintenance |
| Corticosteroids | Prednisone 40-60 mg/d; IV methylprednisolone; Budesonide | Flares only (NOT maintenance); Budesonide for mild-moderate ileocecal CD | Flares only; IV steroids for severe UC |
| Immunomodulators | AZA 2-3 mg/kg; 6-MP 1-1.5 mg/kg; MTX 25 mg/wk IM | Maintenance; steroid-sparing; combine with biologics | Maintenance; steroid-sparing (AZA/6-MP) |
| Anti-TNF | Infliximab (IV q8w); Adalimumab (SC q2w); Certolizumab (CD); Golimumab (UC) | Moderate-severe CD; fistulizing disease | Moderate-severe UC; IV infliximab = rescue for acute severe UC |
| Anti-integrin | Vedolizumab (IV/SC) | Moderate-severe CD | Moderate-severe UC; preferred in elderly |
| Anti-IL-12/23 | Ustekinumab (IV induction → SC q8-12w) | Moderate-severe CD; anti-TNF failure | Moderate-severe UC |
| JAK inhibitors | Tofacitinib; Upadacitinib; Ozanimod | Upadacitinib for CD | Tofacitinib/upadacitinib for UC |
| Antibiotics | Metronidazole, Ciprofloxacin | Perianal disease, abscesses (NOT primary therapy) | Pouchitis post-IPAA (NOT primary therapy) |
| Category | Manifestation | Association | Notes |
|---|---|---|---|
| Joints | Peripheral arthritis (Type 1 & 2) | Both (CD > UC) | Type 1 parallels bowel activity; Type 2 independent |
| Joints | Ankylosing spondylitis | Both; HLA-B27+ | Course independent of bowel disease |
| Joints | Sacroiliitis | Both | Often silent; MRI pelvis |
| Skin | Erythema nodosum | Both (CD > UC) | Tender shin nodules; parallels bowel activity |
| Skin | Pyoderma gangrenosum | Both (UC > CD) | Ulcerating; independent; avoid debridement |
| Eyes | Episcleritis / Scleritis | Both | Parallels bowel activity |
| Eyes | Uveitis / Iritis | Both (CD > UC) | Independent; urgent ophthalmology |
| Liver | Primary Sclerosing Cholangitis | UC >> CD (3-5%) | Elevated ALP; annual colonoscopy; CRC + cholangiocarcinoma risk |
| Liver | Cholelithiasis | CD (ileal) | Bile salt malabsorption → cholesterol stones |
| Metabolic | Osteoporosis | Both (steroids) | DEXA scan; Ca²⁺ + Vit D |
| Metabolic | B12/Iron/Folate anemia | CD ileal > UC | B12 deficiency specific to ileal CD/resection |
| Renal | Oxalate nephrolithiasis | CD (ileal) | Hyperoxaluria; fatty acid-oxalate binding |
| Vascular | DVT / PE | Both (flares) | IBD is prothrombotic; VTE prophylaxis in hospital |