Chemotherapy induced vomiting DOC TSH LFT in umbilical hernia PAOD drugs Ovarian cyst size and surgery criteria Alcohol withdrawal Vit K in cholecystiti SR na SR k Sgot sgpt n value Acute pancreatitis Cephalexin metronidazole piptaz Linezolid ceftriazone moa Dog bite category Creat urea n value Why creat dec in dfs Scapula view Bioavailability of para metro Charcots joint EDH IDH SDH GCS Provide me best answer from best textbook for medicine and surgery

Reading File
This is a large multi-topic medical question set. I'll run parallel database searches across all topics simultaneously.
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
I've reached my query_library_db limit. Now I'll fetch the GCS image found and compile all answers from my knowledge base supplemented by what was retrieved.
Loading Image
Reading File
Reading File
Here is a complete, textbook-referenced answer to all your topics:

Complete Medical & Surgical Quick Reference


1. Chemotherapy-Induced Vomiting - DOC

DOC = Ondansetron (5-HT3 antagonist)
  • Rosen's Emergency Medicine states: "ondansetron is the drug of choice in chemotherapy-induced vomiting"
  • For highly emetogenic chemotherapy (e.g., cisplatin): Triple therapy = 5-HT3 antagonist (ondansetron/granisetron) + NK-1 antagonist (aprepitant) + Dexamethasone
  • NK-1 antagonist aprepitant is added for highly emetogenic regimens (Katzung's Pharmacology, 16th ed.)
  • Dexamethasone potentiates antiemetic effect
  • Lorazepam, haloperidol, olanzapine are adjuncts (Washington Manual)
EmetogenicityRegimen
High (Cisplatin)5-HT3 + NK-1 (aprepitant) + Dexamethasone
Moderate5-HT3 + Dexamethasone
LowDexamethasone or metoclopramide

2. TSH & LFT in Umbilical Hernia

Pre-operative workup for umbilical hernia repair includes:
  • TSH - Hypothyroidism causes myxedema, ascites, and abdominal distension - an important underlying cause of umbilical hernia especially in adults. Also affects wound healing and anesthetic risk.
  • LFT (Liver Function Tests) - Umbilical hernia is strongly associated with cirrhosis and portal hypertension (causing ascites). LFTs assess hepatic synthetic function (albumin, PT/INR), bilirubin, and transaminases. Cirrhotic patients have high operative risk and hernia recurrence rates.
  • Key association: Umbilical hernia in adults = think cirrhosis/ascites - LFT is mandatory pre-op.

3. PAOD (Peripheral Arterial Occlusive Disease) - Drugs

Medical management:
DrugClassMechanism
CilostazolPhosphodiesterase-3 inhibitorVasodilation + antiplatelet; DOC for intermittent claudication
PentoxifyllineHemorrheologic agentReduces blood viscosity, improves RBC flexibility
Aspirin / ClopidogrelAntiplateletReduces thrombotic events
StatinsHMG-CoA reductase inhibitorsPlaque stabilization, reduce CV events
ACE inhibitorsRAAS blockadeReduce cardiovascular mortality in PAOD
  • Cilostazol vs Pentoxifylline: Cilostazol is superior (Dawson et al., Am J Med - cited in Mulholland's Surgery)
  • Contraindication: Cilostazol is contraindicated in heart failure
  • Supervised exercise therapy is first-line non-pharmacologic treatment

4. Ovarian Cyst - Size & Surgery Criteria

Size-based management:
SizeManagement
< 5 cm, simple, premenopausalConservative - observe, repeat USS in 6-8 weeks
5-7 cmFollow-up imaging in 3-6 months (IOTA/RCOG guidelines)
> 5 cm persistingConsider surgery
> 7-10 cmSurgery generally recommended
Surgical indications (regardless of size):
  • Complex features (solid components, septations, papillary projections)
  • Persistent cyst > 3 months
  • Symptoms: pain, torsion, rupture
  • Postmenopausal cyst (any size >1 cm is suspicious)
  • CA-125 elevated
  • Bilateral cysts
  • Evidence of torsion on USS
Type determines urgency:
  • Dermoid (teratoma), endometrioma, hemorrhagic cyst: elective surgery
  • Torsion: emergency surgery

5. Alcohol Withdrawal

(Source: Tintinalli's Emergency Medicine)
Timeline:
TimeManifestation
6-24 hoursMinor: tremor, anxiety, nausea, insomnia, tachycardia, hypertension
24-48 hoursHallucinations (tactile > auditory > visual) - in 7-8%
36-60 hoursWithdrawal seizures (generalized tonic-clonic) - in 5-10%
60+ hoursDelirium Tremens (DT) - peaks at day 5, lasts up to 7 days
DT features: Agitation, disorientation, hallucinations, fever, diaphoresis, hypertension, tachycardia
Treatment:
  • DOC = Benzodiazepines (chlordiazepoxide / lorazepam / diazepam)
  • Symptom-triggered dosing using CIWA-Ar scale
  • Thiamine 100 mg IV BEFORE glucose (Wernicke's prevention)
  • Correct electrolytes: K+, Mg2+, phosphate
  • DT mortality: < 5% with early aggressive treatment (was 35% in early 20th century)

6. Vitamin K in Cholecystitis / Obstructive Jaundice

  • In obstructive jaundice (e.g., calculous cholecystitis with CBD obstruction, cholangitis), bile flow to the intestine is blocked.
  • Vitamin K is a fat-soluble vitamin - its absorption depends on bile salts for micelle formation.
  • Consequence: Vitamin K deficiency → reduced synthesis of clotting factors II, VII, IX, X (and Protein C, S) → coagulopathy → prolonged PT/INR.
  • Pre-operative Vit K (phytomenadione 10 mg IM/IV for 3 days) is given before surgery to correct coagulopathy.
  • Failure to respond to Vit K (PT doesn't correct) = suggests hepatocellular damage, not just obstructive cause.
  • Also: Vit K is given in acute cholangitis pre-operatively.

7. SR Na+ and SR K+ (Serum Sodium & Potassium Normal Values)

ElectrolyteNormal Range
Serum Sodium (Na+)135 - 145 mEq/L
Serum Potassium (K+)3.5 - 5.0 mEq/L
  • Hyponatremia: Na+ < 135 (SIADH, cirrhosis, heart failure)
  • Hypernatremia: Na+ > 145 (dehydration, DI)
  • Hypokalemia: K+ < 3.5 (diuretics, vomiting, diarrhea)
  • Hyperkalemia: K+ > 5.0 (renal failure, ACEi, Addison's)
  • Critical values: Na+ < 120 or > 160; K+ < 2.5 or > 6.5

8. SGOT (AST) & SGPT (ALT) Normal Values

EnzymeFull NameNormal Value
SGPT (ALT)Serum Glutamate Pyruvate Transaminase7 - 56 U/L (up to 40 U/L some labs)
SGOT (AST)Serum Glutamate Oxaloacetate Transaminase10 - 40 U/L
  • ALT is more liver-specific (also in kidney, heart)
  • AST is less specific (liver, heart, muscle, RBCs)
  • AST:ALT ratio >2:1 = alcoholic hepatitis (AST elevated disproportionately because alcohol damages mitochondria where AST is located)
  • ALT > AST: viral hepatitis, NAFLD
  • Markedly elevated (>1000 U/L): ischemic hepatitis ("shock liver"), acute viral hepatitis, drug toxicity (paracetamol)

9. Acute Pancreatitis

(Source: Schwartz's Principles of Surgery, 11th ed.)
Ranson's Criteria:
On Admission (5 criteria - mnemonic "GA LAW"):
CriterionValue
Glucose> 200 mg/dL
Age> 55 years
LDH> 350 IU/L
AST (SGOT)> 250 U/L
WBC> 16,000/mm³
At 48 hours (6 criteria - mnemonic "C HOBBS"):
CriterionValue
Calcium< 8 mg/dL
Hematocrit fall> 10%
Oxygen (PaO2)< 60 mmHg
BUN rise> 5 mg/dL
Base deficit> 4 mEq/L
Sequestration (fluid)> 6L
Scoring:
  • < 3 criteria: Mild (mortality <1%)
  • 3-4: Moderate (15-20%)
  • 5-6: Severe (40%)
  • 6: >50% mortality
BISAP Score (within 24h): BUN >25, Impaired mentation (GCS<15), SIRS, Age >60, Pleural effusion
Atlanta Classification (Revised 2012):
  • Mild: No organ failure, no local complications
  • Moderately severe: Transient organ failure (<48h) OR local complications
  • Severe: Persistent organ failure (>48h)

10. Cephalexin, Metronidazole, Piperacillin-Tazobactam (PipTaz)

DrugClassMOACoverage
Cephalexin1st generation cephalosporinInhibits bacterial cell wall synthesis (binds PBPs, blocks transpeptidation) - bactericidalGram +ve (MSSA, Strep); NOT MRSA
MetronidazoleNitroimidazoleProdrug - activated by anaerobic organisms; forms free radicals that cause DNA strand breaks - bactericidalAnaerobes (Bacteroides, Clostridium), H. pylori, Giardia, Entamoeba, Trichomonas
Piperacillin-TazobactamAntipseudomonal penicillin + beta-lactamase inhibitorPip: inhibits cell wall synthesis (PBP3, PBP1a); Taz: irreversibly inhibits beta-lactamasesBroad: Gram+ve, Gram-ve (including Pseudomonas), anaerobes

11. Linezolid & Ceftriaxone - MOA

DrugClassMOA
LinezolidOxazolidinoneBinds 23S rRNA of 50S ribosomal subunit (unique binding site, no cross-resistance). Prevents formation of 70S initiation complex - inhibits protein synthesis at initiation step. Bacteriostatic (bactericidal vs. streptococci). Active against MRSA, VRE, drug-resistant Strep
Ceftriaxone3rd generation cephalosporinBinds Penicillin-Binding Proteins (PBPs) on bacterial cell membrane → inhibits transpeptidation → prevents peptidoglycan cross-linking → cell wall lysis → bactericidal. Long half-life (8h), once daily dosing

12. Dog Bite - WHO Wound Category

CategoryWound TypeManagement
ITouching/feeding the animal; licks on intact skinNo treatment - wash with soap and water
IINibbling of uncovered skin; minor scratches/abrasions without bleedingWound washing + Vaccination immediately
IIISingle or multiple transdermal bites or scratches; licks on broken skin; contamination of mucous membranes; bat exposuresWound washing + Vaccination + Rabies Immunoglobulin (RIG) immediately
RIG dosing (Category III):
  • Human RIG (HRIG): 20 IU/kg
  • Equine RIG (ERIG): 40 IU/kg
  • Infiltrate as much as possible around wound; remainder IM at distant site
Vaccination schedule: Days 0, 3, 7, 14, 28 (5-dose IM) or Days 0, 3, 7 (3-dose Zagreb protocol)

13. Creatinine & Urea Normal Values

ParameterNormal Value
Serum Creatinine0.6 - 1.2 mg/dL (male); 0.5 - 1.1 mg/dL (female)
Blood Urea Nitrogen (BUN)7 - 20 mg/dL
Serum Urea15 - 40 mg/dL (BUN x 2.14)
BUN:Creatinine ratio10:1 to 20:1 (normal); >20:1 = pre-renal; <10:1 = muscle wasting/liver disease

14. Why Creatinine Decreases in DFS (Pregnancy)

DFS = Dilutional/gestational changes in pregnancy (assumed - "decreased creatinine in pregnancy / physiological dilution")
In pregnancy, creatinine falls because:
  1. Increased GFR by 40-60% due to increased cardiac output and renal blood flow (by end of 1st trimester)
  2. Increased renal plasma flow (up to 75-85% above non-pregnant values)
  3. Plasma volume expansion (dilution effect)
Therefore, the upper limit of normal for creatinine in pregnancy is ~0.8 mg/dL - values that appear "normal" in non-pregnant women may indicate renal insufficiency in pregnancy. (Source: Barash's Clinical Anesthesia, 9th ed.; Campbell-Walsh Urology)
Note: If "DFS" refers to "Dilated Failing kidney / Disease-Free Survival" in a specific context, please clarify. If it refers to pregnancy specifically, the above is correct.

15. Scapula View (Radiograph)

Scapular Y-view (True lateral view):
  • X-ray beam is parallel to the spine of the scapula
  • Scapula appears as a "Y" shape: body = vertical limb, acromion + coracoid = two upper limbs
  • Best view to diagnose:
    • Shoulder dislocation - humeral head should lie in the "cup" of the Y at the junction
    • Anterior dislocation: humeral head lies anterior to glenoid
    • Posterior dislocation: humeral head lies posterior to glenoid
  • Also used: Scapular AP view and Axillary view (the gold standard for dislocation)
  • Trauma series: AP + Scapular Y + Axillary view (3 views)

16. Bioavailability - Paracetamol & Metronidazole

DrugOral BioavailabilityNotes
Paracetamol (Acetaminophen)~88-100% (oral); rectal ~85%Rapid absorption; peak at 30-60 min; hepatic first-pass relatively low
Metronidazole~100% (oral and IV bioequivalent)Excellent oral bioavailability; IV not superior to oral in most situations
  • Metronidazole oral = IV (switch early in clinical practice)
  • Paracetamol IV has faster onset but similar overall bioavailability

17. Charcot's Joint (Neuropathic Arthropathy)

Definition: Progressive destruction of a joint due to impaired pain sensation and proprioception.
Causes (mnemonic "6 Ds"):
CauseMost Common Joint
Diabetes mellitus (most common cause today)Foot/ankle (tarsometatarsal)
Tabes dorsalis (syphilis)Knee, hip
SyringomyeliaShoulder, elbow
LeprosyFoot
Alcoholic neuropathyFoot
Spina bifida / meningomyeloceleAnkle, foot
Clinical features:
  • "Bag of bones" appearance on X-ray
  • Joint is hot, swollen, painless (despite severe destruction)
  • 4 D's on X-ray: Distension of joint, Density increase (sclerosis), Debris (loose bodies), Dislocation/Disorganization
Management:
  • Offloading, total contact cast
  • Treat underlying cause
  • Surgery (arthrodesis) in late stages

18. EDH, SDH, IDH

Extradural Hematoma (EDH)

  • Location: Between skull and dura mater
  • Source: Rupture of middle meningeal artery (pterion - thinnest part of skull)
  • CT: Biconvex (lens-shaped) hyperdense collection; does NOT cross suture lines
  • Classic presentation: Lucid interval → sudden deterioration
  • Management: Emergency evacuation (if >30 mL, >15mm thick, >5mm midline shift); temporal burr holes
  • Prognosis: Excellent if treated early (good prognosis = arterial, no brain contusion)

Subdural Hematoma (SDH)

  • Location: Between dura and arachnoid
  • Source: Rupture of bridging veins (venous - slower)
  • CT: Crescent-shaped collection following brain contour; CROSSES suture lines
  • Types: Acute (<3 days, hyperdense), Subacute (3-21 days, isodense), Chronic (>21 days, hypodense)
  • Risk factors: Elderly, alcoholics, anticoagulant use, trivial trauma
  • Management: Burr hole evacuation (chronic); craniotomy (acute)

IDH (Intracerebral/Intracerebral Hemorrhage)

  • Location: Within brain parenchyma
  • Contusion/hematoma: Coup or contrecoup injury, hypertensive hemorrhage
  • CT: Hyperdense intraparenchymal area, often with surrounding edema
  • Common sites: Basal ganglia, thalamus (hypertensive); frontal/temporal lobes (trauma)
  • Management: Conservative (ICP monitoring) vs surgical (cerebellar hematoma >3cm, accessible lobar hematoma with deterioration)
FeatureEDHSDH
ShapeBiconvex (lens)Crescent
Crosses suture?NOYES
SourceMiddle meningeal arteryBridging veins
Lucid intervalClassicLess common

19. Glasgow Coma Scale (GCS)

Glasgow Coma Scale
(Source: Rosen's Emergency Medicine)
ComponentResponseScore
Eye Opening (E)Spontaneous4
To speech3
To pain2
No response1
Verbal (V)Oriented5
Confused conversation4
Inappropriate words3
Incomprehensible sounds2
No response1
Motor (M)Obeys commands6
Localizes pain5
Withdraws4
Abnormal flexion (decorticate)3
Extensor response (decerebrate)2
No response1
Total = E + V + M = 3 to 15
ScoreSeverity
14-15Mild TBI
9-13Moderate TBI
≤ 8Severe TBI - intubate
3Deep coma / death
(Bradley & Daroff's Neurology in Clinical Practice; Harrison's Principles of Internal Medicine 22nd ed.)

Sources: Rosen's Emergency Medicine; Schwartz's Principles of Surgery 11th ed.; Katzung's Pharmacology 16th ed.; Washington Manual of Medical Therapeutics; Tintinalli's Emergency Medicine; Barash's Clinical Anesthesia 9th ed.; Harrison's Principles of Internal Medicine 22nd ed.; Bradley & Daroff's Neurology; Goldman-Cecil Medicine; Parikh's Forensic Medicine.All 19 topics covered. Here is a quick summary index for easy navigation:

#TopicKey Answer
1Chemo vomiting DOCOndansetron (5-HT3); add NK-1 (aprepitant) + Dex for high emetogenicity
2TSH/LFT in umbilical herniaTSH - hypothyroidism check; LFT - cirrhosis/ascites (portal HTN)
3PAOD drugsCilostazol (DOC for claudication), pentoxifylline, antiplatelet, statin
4Ovarian cyst surgery>5cm persisting, complex features, postmenopausal, symptoms
5Alcohol withdrawalBenzodiazepines (DOC); timeline: tremors → hallucinations → seizures → DT
6Vit K in cholecystitisObstructive jaundice → fat-soluble Vit K malabsorption → coagulopathy → give preop
7SR Na / KNa: 135-145 mEq/L; K: 3.5-5.0 mEq/L
8SGOT/SGPT normalAST: 10-40 U/L; ALT: 7-56 U/L
9Acute pancreatitisRanson's criteria; BISAP; Revised Atlanta Classification
10Cephalexin/Metro/PipTazCell wall inhibitor / DNA strand breaks / broad-spectrum cell wall + beta-lactamase inhibitor
11Linezolid/Ceftriaxone MOA23S rRNA 50S subunit (initiation block) / PBP binding (transpeptidation block)
12Dog bite categoryI: intact skin; II: scratch/abrasion + vaccine; III: bite/mucous + vaccine + RIG
13Creat/Urea normalCreat: 0.6-1.2 mg/dL; BUN: 7-20 mg/dL
14Creat decrease in pregnancyGFR increases 40-60% → creatinine falls (upper limit 0.8 mg/dL in pregnancy)
15Scapula viewScapular Y-view = lateral; best for shoulder dislocation diagnosis
16BioavailabilityParacetamol: ~88-100%; Metronidazole: ~100% (oral = IV)
17Charcot's jointDM (most common), tabes, syringomyelia; painless destruction; "bag of bones"
18EDH/SDH/IDHEDH = biconvex/MMA; SDH = crescent/bridging veins; IDH = parenchymal
19GCSE(4)+V(5)+M(6)=15; ≤8 = severe, intubate

Create a printable quick-reference card (PDF) for exam prep with all 19 topics

Reading File
Running Command

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

Running Command

mkdir -p /tmp/workspace/med-quickref && echo "dir created"

Writing File

~/med-quickref/generate_pdf.py

#!/usr/bin/env python3
"""
Medical Exam Quick-Reference Card Generator
19 topics — A4 printable PDF using ReportLab
"""

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

OUTPUT = "/tmp/workspace/med-quickref/Medical_Exam_QuickRef.pdf"

# ── Colour Palette ──────────────────────────────────────────────────────────
C_NAVY    = colors.HexColor("#1a2a4a")
C_BLUE    = colors.HexColor("#1e5fa8")
C_LBLUE   = colors.HexColor("#d6e8fa")
C_TEAL    = colors.HexColor("#0d7377")
C_LTEAL   = colors.HexColor("#d0f0ef")
C_RED     = colors.HexColor("#b02020")
C_LRED    = colors.HexColor("#fde8e8")
C_GOLD    = colors.HexColor("#c98a00")
C_LGOLD   = colors.HexColor("#fff3cc")
C_GREEN   = colors.HexColor("#1a6b2e")
C_LGREEN  = colors.HexColor("#dff5e3")
C_PURPLE  = colors.HexColor("#4a1a8a")
C_LPURPLE = colors.HexColor("#ece0ff")
C_GREY    = colors.HexColor("#f0f2f5")
C_DGREY   = colors.HexColor("#5a6472")
C_WHITE   = colors.white
C_BLACK   = colors.black

# Alternate row colors for tables
ROW_EVEN = colors.HexColor("#f7f9fc")
ROW_ODD  = C_WHITE

PAGE_W, PAGE_H = A4
MARGIN = 1.5 * cm

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=MARGIN, rightMargin=MARGIN,
    topMargin=1.8*cm, bottomMargin=1.5*cm,
    title="Medical Exam Quick Reference",
    author="Orris AI",
    subject="Medicine & Surgery Exam Prep"
)

styles = getSampleStyleSheet()

# ── Custom Paragraph Styles ─────────────────────────────────────────────────
def ps(name, **kw):
    return ParagraphStyle(name, **kw)

S_TITLE = ps("title",
    fontName="Helvetica-Bold", fontSize=22, textColor=C_WHITE,
    alignment=TA_CENTER, spaceAfter=2)

S_SUBTITLE = ps("subtitle",
    fontName="Helvetica", fontSize=10, textColor=C_LBLUE,
    alignment=TA_CENTER, spaceAfter=4)

S_TOPIC_HDR = ps("topichdr",
    fontName="Helvetica-Bold", fontSize=11, textColor=C_WHITE,
    alignment=TA_LEFT, leftIndent=4, spaceAfter=0, leading=14)

S_BODY = ps("body",
    fontName="Helvetica", fontSize=8.5, textColor=C_BLACK,
    alignment=TA_LEFT, leading=12, spaceAfter=2)

S_BODY_BOLD = ps("bodybold",
    fontName="Helvetica-Bold", fontSize=8.5, textColor=C_NAVY,
    alignment=TA_LEFT, leading=12, spaceAfter=2)

S_KEY = ps("key",
    fontName="Helvetica-Bold", fontSize=9, textColor=C_RED,
    alignment=TA_LEFT, leading=12, spaceAfter=1)

S_NOTE = ps("note",
    fontName="Helvetica-Oblique", fontSize=7.5, textColor=C_DGREY,
    alignment=TA_LEFT, leading=11, spaceAfter=1)

S_TH = ps("th",
    fontName="Helvetica-Bold", fontSize=8, textColor=C_WHITE,
    alignment=TA_CENTER, leading=10)

S_TD = ps("td",
    fontName="Helvetica", fontSize=8, textColor=C_BLACK,
    alignment=TA_LEFT, leading=10)

S_TD_C = ps("tdc",
    fontName="Helvetica", fontSize=8, textColor=C_BLACK,
    alignment=TA_CENTER, leading=10)

S_TD_BOLD = ps("tdbold",
    fontName="Helvetica-Bold", fontSize=8, textColor=C_NAVY,
    alignment=TA_LEFT, leading=10)

S_FOOTER = ps("footer",
    fontName="Helvetica-Oblique", fontSize=7, textColor=C_DGREY,
    alignment=TA_CENTER)

# ── Helper: coloured section header ─────────────────────────────────────────
def topic_header(num, title, bg=C_BLUE):
    label = f"  {num:02d}.  {title}"
    t = Table([[Paragraph(label, S_TOPIC_HDR)]], colWidths=[PAGE_W - 2*MARGIN])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [bg]),
        ("TOPPADDING",    (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS", [4]),
    ]))
    return t

# ── Helper: simple two-column data table ────────────────────────────────────
def data_table(headers, rows, col_widths, hdr_bg=C_BLUE, alt=True):
    TW = PAGE_W - 2*MARGIN
    if col_widths is None:
        col_widths = [TW/len(headers)] * len(headers)

    data = [[Paragraph(h, S_TH) for h in headers]]
    for i, row in enumerate(rows):
        bg = ROW_EVEN if (i % 2 == 0 and alt) else ROW_ODD
        data.append([Paragraph(str(c), S_TD) for c in row])

    style = [
        ("BACKGROUND",    (0, 0), (-1, 0),  hdr_bg),
        ("ROWBACKGROUNDS",(0, 1), (-1, -1), [ROW_EVEN, ROW_ODD]),
        ("GRID",          (0, 0), (-1, -1), 0.4, colors.HexColor("#c0c8d8")),
        ("TOPPADDING",    (0, 0), (-1, -1), 3),
        ("BOTTOMPADDING", (0, 0), (-1, -1), 3),
        ("LEFTPADDING",   (0, 0), (-1, -1), 5),
        ("RIGHTPADDING",  (0, 0), (-1, -1), 5),
        ("VALIGN",        (0, 0), (-1, -1), "TOP"),
    ]
    t = Table(data, colWidths=col_widths)
    t.setStyle(TableStyle(style))
    return t

# ── Helper: key-value bullet list ────────────────────────────────────────────
def kv(key, val):
    return Paragraph(f"<b>{key}:</b>  {val}", S_BODY)

def bullet(text, color=C_BLUE):
    return Paragraph(f"<font color='#{color.hexval()[2:]}'>&#x25CF;</font>  {text}", S_BODY)

def sp(h=3):
    return Spacer(1, h)

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

# ══════════════════════════════════════════════════════════════════════════════
# PAGE 1 HEADER BANNER
# ══════════════════════════════════════════════════════════════════════════════
TW = PAGE_W - 2 * MARGIN

def cover_banner():
    banner_data = [[
        Paragraph("MEDICINE &amp; SURGERY", S_TITLE),
        Paragraph("Quick Reference Card", S_SUBTITLE),
        Paragraph("19 High-Yield Exam Topics  |  Prepared with Orris AI  |  August 2026", S_SUBTITLE),
    ]]
    # Stack vertically in one cell
    inner = [
        Paragraph("MEDICINE &amp; SURGERY", S_TITLE),
        Spacer(1, 3),
        Paragraph("Quick Reference Card — 19 High-Yield Exam Topics", S_SUBTITLE),
        Spacer(1, 2),
        Paragraph("Sources: Schwartz's Surgery · Harrison's · Rosen's EM · Katzung's Pharmacology · Tintinalli's EM · Washington Manual", S_SUBTITLE),
    ]
    t = Table([[inner]], colWidths=[TW])
    t.setStyle(TableStyle([
        ("BACKGROUND",    (0,0), (-1,-1), C_NAVY),
        ("TOPPADDING",    (0,0), (-1,-1), 12),
        ("BOTTOMPADDING", (0,0), (-1,-1), 12),
        ("LEFTPADDING",   (0,0), (-1,-1), 12),
        ("RIGHTPADDING",  (0,0), (-1,-1), 12),
    ]))
    return t

# ══════════════════════════════════════════════════════════════════════════════
# BUILD CONTENT
# ══════════════════════════════════════════════════════════════════════════════
story = []

story.append(cover_banner())
story.append(sp(8))

# ── Topic colour cycling ──────────────────────────────────────────────────────
TOPIC_COLORS = [C_BLUE, C_TEAL, C_RED, C_PURPLE, C_GREEN, C_GOLD,
                C_BLUE, C_TEAL, C_RED, C_PURPLE, C_GREEN, C_GOLD,
                C_BLUE, C_TEAL, C_RED, C_PURPLE, C_GREEN, C_GOLD, C_BLUE]

def add_topic(n, title, content_fn):
    bg = TOPIC_COLORS[n - 1]
    block = [topic_header(n, title, bg=bg), sp(3)]
    block += content_fn()
    block.append(sp(6))
    story.append(KeepTogether(block))


# ── 01. Chemotherapy-Induced Vomiting ────────────────────────────────────────
def t01():
    items = [
        kv("DOC", "Ondansetron (5-HT₃ receptor antagonist)"),
        kv("High emetogenicity (Cisplatin)", "5-HT₃ + NK-1 (Aprepitant) + Dexamethasone — TRIPLE therapy"),
        kv("Moderate emetogenicity", "5-HT₃ + Dexamethasone"),
        kv("Low emetogenicity", "Dexamethasone or Metoclopramide"),
        Paragraph("<b><font color='#b02020'>KEY:</font></b>  Aprepitant = NK-1 antagonist (add for highly emetogenic chemo).  "
                  "Dexamethasone potentiates antiemetic effect.  "
                  "Lorazepam / Olanzapine = adjuncts.", S_NOTE),
    ]
    return items

add_topic(1, "Chemotherapy-Induced Vomiting — DOC", t01)

# ── 02. TSH & LFT in Umbilical Hernia ────────────────────────────────────────
def t02():
    rows = [
        ["TSH", "Rule out hypothyroidism → myxedema, ascites, poor wound healing, anesthetic risk"],
        ["LFT", "Rule out cirrhosis / portal hypertension → ascites (direct cause of umbilical hernia in adults)"],
        ["PT/INR", "Assess synthetic function pre-op (impaired in liver disease)"],
        ["S. Albumin", "Low albumin → poor healing, increased operative risk"],
    ]
    items = [
        Paragraph("<b>Pre-op workup:</b>  Umbilical hernia in adults = think cirrhosis/ascites first.", S_BODY),
        sp(2),
        data_table(["Test", "Reason"], rows, [2.5*cm, TW-2.5*cm], hdr_bg=C_TEAL),
        sp(2),
        Paragraph("<b><font color='#b02020'>Pearl:</font></b>  LFT non-correction after Vit K → hepatocellular damage (not obstructive).", S_NOTE),
    ]
    return items

add_topic(2, "TSH & LFT in Umbilical Hernia", t02)

# ── 03. PAOD Drugs ───────────────────────────────────────────────────────────
def t03():
    rows = [
        ["Cilostazol", "PDE-3 inhibitor", "Vasodilation + antiplatelet", "DOC for intermittent claudication; CI in HF"],
        ["Pentoxifylline", "Rheologic agent", "↓ blood viscosity, ↑ RBC flexibility", "Inferior to cilostazol"],
        ["Aspirin/Clopidogrel", "Antiplatelet", "↓ thrombotic events", "Lifelong; reduces CV mortality"],
        ["Statins", "HMG-CoA reductase inhibitor", "Plaque stabilisation", "Mandatory in all PAOD"],
        ["ACE inhibitors", "RAAS blockade", "↓ CV mortality", "e.g. Ramipril (HOPE trial)"],
    ]
    items = [
        data_table(["Drug", "Class", "MOA", "Note"],
                   rows, [3*cm, 3.5*cm, 5*cm, TW-11.5*cm], hdr_bg=C_RED),
        sp(2),
        Paragraph("<b><font color='#b02020'>First-line non-pharmacologic:</font></b>  Supervised exercise therapy.", S_NOTE),
    ]
    return items

add_topic(3, "PAOD (Peripheral Arterial Occlusive Disease) — Drugs", t03)

# ── 04. Ovarian Cyst — Surgery Criteria ──────────────────────────────────────
def t04():
    rows = [
        ["< 5 cm, simple, premenopausal", "Conservative — USS follow-up in 6-8 weeks"],
        ["5–7 cm, simple", "Repeat imaging in 3-6 months"],
        ["> 5 cm persisting / > 7-10 cm", "Surgery recommended"],
        ["Any size, postmenopausal (>1 cm)", "Surgery / refer — malignancy risk"],
        ["Complex features (solid, septae, papillae)", "Surgery regardless of size"],
        ["Symptoms (torsion, rupture, pain)", "Emergency / urgent surgery"],
    ]
    items = [
        data_table(["Size / Feature", "Management"], rows, [6*cm, TW-6*cm], hdr_bg=C_PURPLE),
        sp(2),
        Paragraph("<b>Investigations:</b>  USS (first-line), CA-125 (tumour marker), CT/MRI if malignancy suspected.", S_NOTE),
        Paragraph("<b>Dermoid / Endometrioma:</b>  Elective surgery.  <b>Torsion:</b>  Emergency surgery.", S_NOTE),
    ]
    return items

add_topic(4, "Ovarian Cyst — Size & Surgery Criteria", t04)

# ── 05. Alcohol Withdrawal ──────────────────────────────────────────────────
def t05():
    timeline_rows = [
        ["6–24 h",  "Minor: tremor, anxiety, nausea, tachycardia, hypertension, insomnia"],
        ["24–48 h", "Hallucinations (tactile > auditory > visual) — 7-8% of patients"],
        ["36–60 h", "Withdrawal seizures (generalised tonic-clonic) — 5-10%"],
        ["60+ h",   "Delirium Tremens (DT): agitation, disorientation, fever, diaphoresis — peaks day 5"],
    ]
    items = [
        data_table(["Time", "Manifestation"], timeline_rows, [2.5*cm, TW-2.5*cm], hdr_bg=C_GREEN),
        sp(3),
        kv("DOC", "Benzodiazepines (chlordiazepoxide / diazepam / lorazepam) — symptom-triggered (CIWA-Ar scale)"),
        kv("Thiamine", "100 mg IV BEFORE glucose (Wernicke's prevention)"),
        kv("Correct electrolytes", "K⁺, Mg²⁺, phosphate"),
        Paragraph("<b><font color='#b02020'>DT mortality:</font></b>  &lt;5% with treatment (was 35% in early 20th century)  "
                  "<i>[Tintinalli's EM]</i>", S_NOTE),
    ]
    return items

add_topic(5, "Alcohol Withdrawal — Timeline & Treatment", t05)

# ── 06. Vitamin K in Cholecystitis ──────────────────────────────────────────
def t06():
    items = [
        Paragraph("<b>Mechanism:</b>  Obstructive jaundice → blocked bile flow → ↓ bile salts in intestine → "
                  "impaired absorption of <b>fat-soluble vitamins (A, D, E, K)</b> → "
                  "Vit K deficiency → ↓ factors II, VII, IX, X → prolonged PT/INR → bleeding risk.", S_BODY),
        sp(3),
        kv("Pre-op Vit K", "Phytomenadione 10 mg IM/IV daily × 3 days before surgery"),
        kv("Monitor", "PT/INR — should correct within 24-48 h if obstructive cause"),
        Paragraph("<b><font color='#b02020'>Pearl:</font></b>  PT does NOT correct with Vit K → "
                  "hepatocellular damage (liver cannot synthesise factors even with Vit K substrate).", S_NOTE),
        Paragraph("<b>Also give:</b>  Prophylactic antibiotics (cefuroxime + metronidazole), IV fluids, "
                  "correct coagulopathy, ERCP if CBD stone present.", S_NOTE),
    ]
    return items

add_topic(6, "Vitamin K in Cholecystitis / Obstructive Jaundice", t06)

# ── 07. SR Na & SR K ────────────────────────────────────────────────────────
def t07():
    rows = [
        ["Serum Sodium (Na⁺)", "135–145 mEq/L", "< 135 = Hyponatremia | > 145 = Hypernatremia"],
        ["Serum Potassium (K⁺)", "3.5–5.0 mEq/L", "< 3.5 = Hypokalemia | > 5.0 = Hyperkalemia"],
        ["Critical Na⁺", "< 120 or > 160 mEq/L", "Immediate intervention required"],
        ["Critical K⁺", "< 2.5 or > 6.5 mEq/L", "Cardiac arrhythmia risk"],
    ]
    items = [
        data_table(["Electrolyte", "Normal Range", "Notes"], rows,
                   [4.5*cm, 3.5*cm, TW-8*cm], hdr_bg=C_GOLD),
        sp(3),
        kv("Hyponatremia causes", "SIADH, cirrhosis, heart failure, hypothyroidism"),
        kv("Hypokalemia causes", "Diuretics, vomiting, diarrhea, hyperaldosteronism"),
        kv("Hyperkalemia causes", "Renal failure, ACEi/ARB, Addison's, K⁺-sparing diuretics"),
    ]
    return items

add_topic(7, "Serum Na⁺ & K⁺ — Normal Values", t07)

# ── 08. SGOT / SGPT Normal Values ───────────────────────────────────────────
def t08():
    rows = [
        ["SGPT (ALT)", "Serum Glutamate Pyruvate Transaminase", "7–56 U/L", "Liver-specific; elevated in viral hepatitis, NAFLD"],
        ["SGOT (AST)", "Serum Glutamate Oxaloacetate Transaminase", "10–40 U/L", "Less specific; also in heart, muscle, RBCs"],
    ]
    items = [
        data_table(["Enzyme", "Full Name", "Normal", "Clinical Note"],
                   rows, [2.5*cm, 5.5*cm, 2*cm, TW-10*cm], hdr_bg=C_BLUE),
        sp(3),
        kv("AST:ALT > 2:1", "Alcoholic hepatitis (mitochondrial AST released)"),
        kv("ALT > AST", "Viral hepatitis, NAFLD, drug toxicity"),
        kv("> 1000 U/L (both)", "Ischemic hepatitis (shock liver), acute viral hepatitis, paracetamol toxicity"),
    ]
    return items

add_topic(8, "SGOT (AST) & SGPT (ALT) — Normal Values", t08)

story.append(PageBreak())

# ── 09. Acute Pancreatitis ───────────────────────────────────────────────────
def t09():
    r_adm = [
        ["Glucose", "> 200 mg/dL"],
        ["Age", "> 55 years"],
        ["LDH", "> 350 IU/L"],
        ["AST (SGOT)", "> 250 U/L"],
        ["WBC", "> 16,000/mm³"],
    ]
    r_48h = [
        ["Calcium", "< 8 mg/dL"],
        ["Hematocrit fall", "> 10%"],
        ["PaO₂", "< 60 mmHg"],
        ["BUN rise", "> 5 mg/dL"],
        ["Base deficit", "> 4 mEq/L"],
        ["Fluid sequestration", "> 6 L"],
    ]
    # Side-by-side tables
    t_adm = data_table(["On Admission (5)", "Value"], r_adm, [4*cm, 3*cm], hdr_bg=C_RED)
    t_48h = data_table(["At 48 Hours (6)", "Value"], r_48h, [4*cm, 3*cm], hdr_bg=C_TEAL)
    side = Table([[t_adm, sp(0.5), t_48h]], colWidths=[7.5*cm, 0.5*cm, 7.5*cm])
    side.setStyle(TableStyle([("VALIGN", (0,0), (-1,-1), "TOP")]))

    items = [
        Paragraph("<b>Ranson's Criteria</b>  (mnemonic: Admission = GA LAW; 48h = C HOBBS)", S_BODY_BOLD),
        sp(2),
        side,
        sp(3),
        Paragraph("<b>Scoring:</b>  &lt;3 = Mild (&lt;1% mortality) | 3-4 = Moderate (15-20%) | "
                  "5-6 = Severe (40%) | &gt;6 = &gt;50% mortality", S_BODY),
        sp(2),
        Paragraph("<b>BISAP Score</b> (within 24h):  BUN &gt;25 | GCS &lt;15 | SIRS | Age &gt;60 | Pleural effusion", S_BODY),
        sp(2),
        Paragraph("<b>Revised Atlanta Classification:</b>  "
                  "Mild (no organ failure) → Moderately severe (transient OF &lt;48h or local complication) → "
                  "Severe (persistent OF &gt;48h)", S_NOTE),
    ]
    return items

add_topic(9, "Acute Pancreatitis — Ranson's Criteria & Severity", t09)

# ── 10. Cephalexin / Metronidazole / Piperacillin-Tazobactam ─────────────────
def t10():
    rows = [
        ["Cephalexin", "1st-gen Cephalosporin",
         "Binds PBPs → blocks transpeptidation → ↓ peptidoglycan cross-linking → bactericidal",
         "Gram +ve (MSSA, Strep). NOT MRSA"],
        ["Metronidazole", "Nitroimidazole",
         "Prodrug — activated by anaerobes → free radicals → DNA strand breaks → bactericidal",
         "Anaerobes, H. pylori, Giardia, Entamoeba, Trichomonas"],
        ["Piperacillin-Tazobactam", "Antipseudomonal PCN + β-lactamase inhibitor",
         "Pip: inhibits PBP3/PBP1a (cell wall); Taz: irreversibly inhibits β-lactamases",
         "Broad: Gram+ve, Gram-ve (incl. Pseudomonas), anaerobes"],
    ]
    items = [
        data_table(["Drug", "Class", "Mechanism of Action", "Coverage/Notes"],
                   rows, [3.5*cm, 3.5*cm, 5.5*cm, TW-12.5*cm], hdr_bg=C_PURPLE),
    ]
    return items

add_topic(10, "Cephalexin · Metronidazole · Piperacillin-Tazobactam", t10)

# ── 11. Linezolid & Ceftriaxone MOA ─────────────────────────────────────────
def t11():
    rows = [
        ["Linezolid", "Oxazolidinone",
         "Binds 23S rRNA of <b>50S ribosomal subunit</b> → prevents 70S initiation complex formation → "
         "blocks protein synthesis at <b>initiation step</b>",
         "Bacteriostatic (bactericidal vs streptococci). "
         "Active: MRSA, VRE, drug-resistant Strep. Unique MOA — no cross-resistance."],
        ["Ceftriaxone", "3rd-gen Cephalosporin",
         "Binds <b>Penicillin-Binding Proteins (PBPs)</b> → inhibits transpeptidation → "
         "prevents peptidoglycan cross-linking → cell wall lysis → <b>bactericidal</b>",
         "Long t½ (8h) — once daily. Gram +ve &amp; -ve. CNS penetration (meningitis). "
         "Biliary excretion (risk biliary sludge)."],
    ]
    items = [
        data_table(["Drug", "Class", "MOA", "Clinical Notes"],
                   rows, [2.5*cm, 3*cm, 6*cm, TW-11.5*cm], hdr_bg=C_GREEN),
    ]
    return items

add_topic(11, "Linezolid & Ceftriaxone — Mechanism of Action", t11)

# ── 12. Dog Bite — WHO Category ─────────────────────────────────────────────
def t12():
    rows = [
        ["I", "Touching/feeding animal; licks on INTACT skin",
         "Wash with soap &amp; water. No vaccine/RIG needed."],
        ["II", "Nibbling uncovered skin; minor scratch/abrasion WITHOUT bleeding",
         "Wound washing + <b>Vaccination immediately</b>"],
        ["III", "Transdermal bite; licks on broken skin; mucous membrane contamination; bat exposure",
         "Wound washing + <b>Vaccination + RIG immediately</b>"],
    ]
    items = [
        data_table(["Category", "Wound Description", "Management"],
                   rows, [2*cm, 6*cm, TW-8*cm], hdr_bg=C_RED),
        sp(3),
        kv("RIG dose (Cat III)", "HRIG: 20 IU/kg | ERIG: 40 IU/kg — infiltrate max into wound, rest IM"),
        kv("Vaccine schedule", "Days 0, 3, 7, 14, 28 (5-dose) OR Days 0, 3, 7 (Zagreb 3-dose)"),
        Paragraph("<b><font color='#b02020'>Pearl:</font></b>  RIG and first vaccine dose given at SAME visit; "
                  "at DIFFERENT sites.", S_NOTE),
    ]
    return items

add_topic(12, "Dog Bite — WHO Wound Category & Management", t12)

# ── 13. Creatinine & Urea Normal Values ────────────────────────────────────
def t13():
    rows = [
        ["Serum Creatinine (male)", "0.6–1.2 mg/dL", "Muscle mass dependent; less affected by diet"],
        ["Serum Creatinine (female)", "0.5–1.1 mg/dL", "Lower due to less muscle mass"],
        ["Blood Urea Nitrogen (BUN)", "7–20 mg/dL", "Affected by protein intake, catabolism"],
        ["Serum Urea", "15–40 mg/dL", "BUN × 2.14"],
        ["BUN:Creatinine ratio", "10:1 to 20:1", "> 20:1 = pre-renal | < 10:1 = liver disease/malnutrition"],
    ]
    items = [
        data_table(["Parameter", "Normal Range", "Notes"], rows,
                   [5*cm, 3.5*cm, TW-8.5*cm], hdr_bg=C_GOLD),
    ]
    return items

add_topic(13, "Creatinine & Urea — Normal Values", t13)

# ── 14. Why Creatinine Decreases in Pregnancy (DFS) ────────────────────────
def t14():
    items = [
        Paragraph("<b>DFS = Diluted / Physiologically reduced in pregnancy</b>", S_BODY_BOLD),
        sp(2),
        kv("Reason 1", "GFR increases 40–60% (due to ↑ cardiac output + ↑ renal blood flow) by end of 1st trimester"),
        kv("Reason 2", "Renal plasma flow increases up to 75–85% above non-pregnant values"),
        kv("Reason 3", "Plasma volume expansion (dilution effect)"),
        sp(2),
        Paragraph("<b>Result:</b>  Serum creatinine, BUN, uric acid ALL fall in pregnancy.", S_BODY),
        Paragraph("<b><font color='#b02020'>Clinical Pearl:</font></b>  Normal non-pregnant creatinine "
                  "may represent RENAL INSUFFICIENCY in pregnancy. "
                  "Upper limit in pregnancy = 0.8 mg/dL.  "
                  "<i>[Barash's Clinical Anesthesia, 9th ed.; Campbell-Walsh Urology]</i>", S_NOTE),
    ]
    return items

add_topic(14, "Why Creatinine Decreases in Pregnancy (DFS)", t14)

story.append(PageBreak())

# ── 15. Scapula View (Radiology) ─────────────────────────────────────────────
def t15():
    rows = [
        ["Scapular Y-view (True lateral)", "Beam parallel to spine of scapula; scapula forms 'Y' shape",
         "BEST for diagnosing shoulder dislocation; anterior (head anterior to Y) vs posterior (head posterior to Y)"],
        ["Scapular AP view", "True AP of scapula", "Body/spine of scapula, AC joint"],
        ["Axillary view", "Arm abducted; beam inferior to superior", "GOLD STANDARD for shoulder dislocation; glenoid fractures"],
    ]
    items = [
        Paragraph("<b>Shoulder Trauma Series:</b>  AP view + Scapular Y-view + Axillary view (3 views mandatory)", S_BODY_BOLD),
        sp(2),
        data_table(["View", "Technique", "Best For"], rows,
                   [4*cm, 4.5*cm, TW-8.5*cm], hdr_bg=C_TEAL),
        sp(2),
        Paragraph("<b>Normal Y-view:</b>  Humeral head sits at junction (cup) of the Y = centred in glenoid.", S_NOTE),
    ]
    return items

add_topic(15, "Scapula View — Radiology", t15)

# ── 16. Bioavailability of Paracetamol & Metronidazole ──────────────────────
def t16():
    rows = [
        ["Paracetamol (Acetaminophen)", "~88–100% (oral)", "~85% (rectal)", "Peak in 30-60 min; hepatic first-pass low; IV faster onset but similar F"],
        ["Metronidazole", "~100% (oral)", "~100% (IV = oral)", "Switch oral early — bioequivalent; excellent tissue penetration"],
    ]
    items = [
        data_table(["Drug", "Oral Bioavailability", "Other Route", "Clinical Notes"],
                   rows, [4*cm, 3*cm, 3*cm, TW-10*cm], hdr_bg=C_PURPLE),
        sp(3),
        Paragraph("<b><font color='#b02020'>Key Point:</font></b>  Metronidazole oral = IV (no need to continue IV once tolerating oral).  "
                  "Paracetamol IV has <b>faster onset</b> but not better total bioavailability.", S_NOTE),
    ]
    return items

add_topic(16, "Bioavailability — Paracetamol & Metronidazole", t16)

# ── 17. Charcot's Joint ──────────────────────────────────────────────────────
def t17():
    cause_rows = [
        ["Diabetes mellitus", "Foot/ankle (tarsometatarsal)", "Most common cause today"],
        ["Tabes dorsalis (syphilis)", "Knee, hip", "Classic historical cause"],
        ["Syringomyelia", "Shoulder, elbow", "Upper limb involvement"],
        ["Leprosy", "Foot", "Peripheral neuropathy"],
        ["Alcoholic neuropathy", "Foot", "Chronic alcohol misuse"],
    ]
    items = [
        Paragraph("<b>Definition:</b>  Progressive painless joint destruction due to impaired pain sensation / proprioception.", S_BODY),
        sp(2),
        data_table(["Cause", "Joint Affected", "Note"], cause_rows,
                   [4*cm, 4*cm, TW-8*cm], hdr_bg=C_GREEN),
        sp(3),
        kv("Clinical", "Hot, swollen, PAINLESS joint despite severe destruction"),
        kv("X-ray (4 Ds)", "Distension | Density increase (sclerosis) | Debris (loose bodies) | Dislocation/Disorganisation"),
        kv("'Bag of bones'", "Radiological appearance of advanced Charcot's joint"),
        kv("Management", "Offloading, total contact cast, treat underlying cause; arthrodesis (late)"),
    ]
    return items

add_topic(17, "Charcot's Joint — Neuropathic Arthropathy", t17)

# ── 18. EDH / SDH / IDH ──────────────────────────────────────────────────────
def t18():
    rows = [
        ["Location", "Between skull &amp; dura", "Between dura &amp; arachnoid", "Within brain parenchyma"],
        ["Source", "Middle meningeal artery (pterion)", "Bridging veins (venous)", "Cortical artery / hypertensive"],
        ["CT shape", "<b>Biconvex (lens-shaped)</b>", "<b>Crescent-shaped</b>", "Irregular hyperdense area"],
        ["Crosses suture?", "<b>NO</b>", "<b>YES</b>", "N/A"],
        ["Lucid interval", "Classic feature", "Less common", "Absent"],
        ["Common in", "Young adults, trauma (pterion)", "Elderly, alcoholics, anticoagulants", "Elderly, hypertension"],
        ["Management", "Burr holes / craniotomy; &gt;30mL evacuate", "Burr hole (chronic); craniotomy (acute)", "Conservative vs surgical (cerebellar &gt;3cm)"],
    ]
    items = [
        data_table(["Feature", "EDH", "SDH", "IDH"],
                   rows, [3.5*cm, (TW-3.5*cm)/3, (TW-3.5*cm)/3, (TW-3.5*cm)/3], hdr_bg=C_RED),
        sp(2),
        Paragraph("<b><font color='#b02020'>SDH types:</font></b>  "
                  "Acute (&lt;3d, hyperdense) | Subacute (3-21d, isodense) | Chronic (&gt;21d, hypodense)", S_NOTE),
    ]
    return items

add_topic(18, "EDH · SDH · IDH — Intracranial Hemorrhage", t18)

# ── 19. GCS ───────────────────────────────────────────────────────────────────
def t19():
    eye_rows = [
        ["4", "Spontaneous"],
        ["3", "To speech"],
        ["2", "To pain"],
        ["1", "No response"],
    ]
    verbal_rows = [
        ["5", "Oriented"],
        ["4", "Confused conversation"],
        ["3", "Inappropriate words"],
        ["2", "Incomprehensible sounds"],
        ["1", "No response"],
    ]
    motor_rows = [
        ["6", "Obeys commands"],
        ["5", "Localizes pain"],
        ["4", "Withdraws"],
        ["3", "Abnormal flexion (decorticate)"],
        ["2", "Extensor response (decerebrate)"],
        ["1", "No response"],
    ]
    sev_rows = [
        ["14–15", "Mild TBI"],
        ["9–13",  "Moderate TBI"],
        ["≤ 8",   "Severe TBI — INTUBATE"],
        ["3",     "Deep coma / brain death"],
    ]
    te = data_table(["Score", "Eye Opening (E)"], eye_rows, [1.5*cm, 4.5*cm], hdr_bg=C_BLUE)
    tv = data_table(["Score", "Verbal Response (V)"], verbal_rows, [1.5*cm, 4.5*cm], hdr_bg=C_TEAL)
    tm = data_table(["Score", "Motor Response (M)"], motor_rows, [1.5*cm, 5*cm], hdr_bg=C_RED)
    ts = data_table(["Total", "Severity"], sev_rows, [2*cm, 4*cm], hdr_bg=C_NAVY)

    col_w = (TW - 1*cm) / 4
    side = Table([[te, tv, tm, ts]], colWidths=[col_w]*4)
    side.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "TOP"),
        ("LEFTPADDING",  (0,0), (-1,-1), 2),
        ("RIGHTPADDING", (0,0), (-1,-1), 2),
    ]))

    items = [
        Paragraph("<b>Total = E + V + M = 3 (minimum) to 15 (normal)</b>  "
                  "<i>[Rosen's EM | Harrison's 22nd ed. | Bradley & Daroff's Neurology]</i>", S_BODY_BOLD),
        sp(3),
        side,
        sp(3),
        Paragraph("<b><font color='#b02020'>GCS ≤ 8 = Intubate.</font></b>  "
                  "GCS is used for TBI severity classification, ICU triage, and prognostication.", S_NOTE),
    ]
    return items

add_topic(19, "Glasgow Coma Scale (GCS)", t19)

# ── Footer note ──────────────────────────────────────────────────────────────
story.append(sp(6))
story.append(hr(C_NAVY))
story.append(Paragraph(
    "Sources: Schwartz's Principles of Surgery 11e · Harrison's Principles of Internal Medicine 22e · "
    "Rosen's Emergency Medicine · Katzung's Basic & Clinical Pharmacology 16e · "
    "Tintinalli's Emergency Medicine · Washington Manual of Medical Therapeutics · "
    "Barash's Clinical Anesthesia 9e · Bradley & Daroff's Neurology · Goldman-Cecil Medicine · "
    "WHO Rabies Guidelines  |  Prepared with Orris AI — August 2026",
    S_FOOTER))

# ── Page numbering ───────────────────────────────────────────────────────────
def on_page(canvas, doc):
    canvas.saveState()
    canvas.setFont("Helvetica", 7)
    canvas.setFillColor(C_DGREY)
    canvas.drawCentredString(PAGE_W / 2, 0.8*cm,
        f"Medical Exam Quick Reference  |  Page {doc.page}")
    canvas.restoreState()

# ── Build ────────────────────────────────────────────────────────────────────
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF saved to: {OUTPUT}")
Running Command

cd /tmp/workspace/med-quickref && python3 generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/med-quickref/Medical_Exam_QuickRef.pdf

Your quick-reference card is ready:

Medical Exam QuickRef

PDF Document · PDF


What's inside (3-page A4 printable):
PagesTopics
Page 1Topics 1-8: Chemo vomiting, Umbilical hernia TSH/LFT, PAOD drugs, Ovarian cyst criteria, Alcohol withdrawal, Vit K, SR Na/K, SGOT/SGPT
Page 2Topics 9-14: Acute pancreatitis (Ranson's full table), Cephalexin/Metro/PipTaz, Linezolid/Ceftriaxone MOA, Dog bite WHO categories, Creat/Urea values, Creatinine in pregnancy
Page 3Topics 15-19: Scapula views, Bioavailability, Charcot's joint, EDH/SDH/IDH comparison table, GCS (all 3 components with scoring)
Design features:
  • Color-coded topic headers (each topic has a distinct color band)
  • All key data in structured tables with alternating row shading
  • Red "Pearl/Key" callouts for high-yield exam traps
  • Full source citations in footer
  • Page numbers on every page
  • Print-ready A4 format
This is a shared conversation. Sign in to Orris to start your own chat.