attachment
attachment

Make me a structured concise exam ready format answer of all the questions attached in the picture above, designed to be written in 15minutes each , covering all key scoring points for answering my MS General Surgery exam from Bailey and love textbook of general surgery.Give me Pdf I xa

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Running Command

mkdir -p /home/daytona/workspace/ms-surgery-exam && echo "Directory ready"

Writing File

~/ms-surgery-exam/generate_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import mm
from reportlab.lib.colors import HexColor, black, white
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY
from reportlab.pdfgen import canvas

OUTPUT = "/home/daytona/workspace/ms-surgery-exam/MS_Surgery_Exam_Answers_Q62-81.pdf"

# ─── Colours ───────────────────────────────────────────────────────────────────
NAVY    = HexColor("#1a2d4f")
TEAL    = HexColor("#0d7377")
GOLD    = HexColor("#c9a84c")
LTBLUE  = HexColor("#e8f4f8")
LTYELLOW= HexColor("#fffbf0")
LTGREEN = HexColor("#f0f8f0")
RED     = HexColor("#c0392b")
GREY    = HexColor("#f5f5f5")
DGREY   = HexColor("#555555")

W, H = A4

def make_styles():
    ss = getSampleStyleSheet()

    title = ParagraphStyle('DocTitle',
        fontName='Helvetica-Bold', fontSize=20, textColor=white,
        alignment=TA_CENTER, spaceAfter=4)

    subtitle = ParagraphStyle('DocSubtitle',
        fontName='Helvetica', fontSize=11, textColor=HexColor("#cfe8ff"),
        alignment=TA_CENTER, spaceAfter=2)

    qtitle = ParagraphStyle('QTitle',
        fontName='Helvetica-Bold', fontSize=13, textColor=white,
        alignment=TA_LEFT, leftIndent=4, spaceBefore=0, spaceAfter=0)

    h2 = ParagraphStyle('H2',
        fontName='Helvetica-Bold', fontSize=10, textColor=TEAL,
        spaceBefore=6, spaceAfter=2)

    body = ParagraphStyle('Body',
        fontName='Helvetica', fontSize=9.5, textColor=HexColor("#222222"),
        leading=14, spaceAfter=2, alignment=TA_JUSTIFY)

    bullet = ParagraphStyle('Bullet',
        fontName='Helvetica', fontSize=9.5, textColor=HexColor("#222222"),
        leading=13, leftIndent=12, firstLineIndent=-10, spaceAfter=1)

    mnemonic = ParagraphStyle('Mnemonic',
        fontName='Helvetica-BoldOblique', fontSize=9.5, textColor=NAVY,
        leading=13, leftIndent=12, spaceAfter=2, backColor=LTYELLOW)

    keypoint = ParagraphStyle('KeyPoint',
        fontName='Helvetica-Bold', fontSize=9, textColor=RED,
        leading=12, leftIndent=8, spaceAfter=1)

    note = ParagraphStyle('Note',
        fontName='Helvetica-Oblique', fontSize=8.5, textColor=DGREY,
        leading=11, spaceAfter=2)

    return dict(title=title, subtitle=subtitle, qtitle=qtitle, h2=h2,
                body=body, bullet=bullet, mnemonic=mnemonic,
                keypoint=keypoint, note=note)

S = make_styles()

def B(txt): return f"<b>{txt}</b>"
def I(txt): return f"<i>{txt}</i>"
def RED_TXT(txt): return f'<font color="#c0392b"><b>{txt}</b></font>'

def p(text, style='body'):
    return Paragraph(text, S[style])

def h2(text):
    return Paragraph(text, S['h2'])

def bullet(text):
    return Paragraph(f"• {text}", S['bullet'])

def keypoint(text):
    return Paragraph(f"★ {text}", S['keypoint'])

def note(text):
    return Paragraph(text, S['note'])

def mnemonic(text):
    return Paragraph(text, S['mnemonic'])

def spacer(h=4):
    return Spacer(1, h*mm)

def hr():
    return HRFlowable(width="100%", thickness=0.5, color=HexColor("#cccccc"), spaceAfter=3)

def q_header(num, title, years=""):
    year_txt = f'  <font color="#aaddff" size="9">[{years}]</font>' if years else ""
    title_para = Paragraph(f"Q{num}. {title}{year_txt}", S['qtitle'])
    tbl = Table([[title_para]], colWidths=[W - 40*mm])
    tbl.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), NAVY),
        ('TOPPADDING', (0,0), (-1,-1), 6),
        ('BOTTOMPADDING', (0,0), (-1,-1), 6),
        ('LEFTPADDING', (0,0), (-1,-1), 8),
        ('RIGHTPADDING', (0,0), (-1,-1), 8),
        ('ROUNDEDCORNERS', [4,4,4,4]),
    ]))
    return tbl

def info_box(items, color=LTBLUE):
    rows = [[Paragraph(f"<b>{k}:</b> {v}", S['body'])] for k,v in items]
    tbl = Table(rows, colWidths=[W - 44*mm])
    tbl.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), color),
        ('TOPPADDING', (0,0), (-1,-1), 3),
        ('BOTTOMPADDING', (0,0), (-1,-1), 3),
        ('LEFTPADDING', (0,0), (-1,-1), 8),
        ('RIGHTPADDING', (0,0), (-1,-1), 8),
        ('BOX', (0,0), (-1,-1), 0.5, TEAL),
        ('LINEBELOW', (0,0), (-1,-2), 0.3, HexColor("#ccddee")),
    ]))
    return tbl

def two_col_table(left_items, right_items, header_left="", header_right=""):
    rows = []
    if header_left:
        rows.append([
            Paragraph(f"<b>{header_left}</b>", S['h2']),
            Paragraph(f"<b>{header_right}</b>", S['h2'])
        ])
    max_len = max(len(left_items), len(right_items))
    for i in range(max_len):
        l = Paragraph(f"• {left_items[i]}", S['bullet']) if i < len(left_items) else Paragraph("", S['body'])
        r = Paragraph(f"• {right_items[i]}", S['bullet']) if i < len(right_items) else Paragraph("", S['body'])
        rows.append([l, r])
    col_w = (W - 44*mm) / 2
    tbl = Table(rows, colWidths=[col_w, col_w])
    tbl.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,0), LTBLUE) if header_left else ('BACKGROUND', (0,0), (-1,-1), GREY),
        ('TOPPADDING', (0,0), (-1,-1), 2),
        ('BOTTOMPADDING', (0,0), (-1,-1), 2),
        ('LEFTPADDING', (0,0), (-1,-1), 4),
        ('RIGHTPADDING', (0,0), (-1,-1), 4),
        ('BOX', (0,0), (-1,-1), 0.5, HexColor("#aaaaaa")),
        ('INNERGRID', (0,0), (-1,-1), 0.3, HexColor("#dddddd")),
        ('VALIGN', (0,0), (-1,-1), 'TOP'),
    ]))
    return tbl

# ─────────────────────────────────────────────────────────────────────────────
#  QUESTION CONTENT
# ─────────────────────────────────────────────────────────────────────────────

def build_content():
    els = []

    # ── COVER HEADER ──────────────────────────────────────────────────────────
    cover_data = [[
        Paragraph("MS GENERAL SURGERY", S['title']),
        Paragraph("EXAM-READY STRUCTURED ANSWERS", S['subtitle']),
        Paragraph("Questions 62–81 | Trauma Section | Bailey &amp; Love", S['subtitle']),
        Paragraph("15 minutes per answer · All key scoring points covered", S['subtitle']),
    ]]
    cover = Table(cover_data, colWidths=[W - 20*mm])
    cover.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), NAVY),
        ('TOPPADDING', (0,0), (-1,-1), 10),
        ('BOTTOMPADDING', (0,0), (-1,-1), 10),
        ('LEFTPADDING', (0,0), (-1,-1), 10),
        ('RIGHTPADDING', (0,0), (-1,-1), 10),
        ('BOX', (0,0), (-1,-1), 2, GOLD),
    ]))
    els += [cover, spacer(6)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q62 – Postoperative Ventilatory Support
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(62, "Post-operative Ventilatory Support", "2010"), spacer(2)]
    els += [h2("Definition & Indications")]
    els += [p("Mechanical ventilatory support provided after surgery to maintain adequate gas exchange when spontaneous breathing is insufficient.")]
    els += [h2("Indications for Postoperative Ventilation")]
    rows_ind = [
        ["Pre-existing respiratory disease (COPD, ILD)", "Prolonged/complex thoracic surgery"],
        ["Haemodynamic instability / shock", "Hypothermia (&lt;35°C on table)"],
        ["Massive blood transfusion (&gt;10 units)", "Incomplete reversal of muscle relaxants"],
        ["GCS &lt;8 / neurological compromise", "Expected airway oedema"],
    ]
    tbl = Table([[Paragraph(f"• {a}", S['bullet']), Paragraph(f"• {b}", S['bullet'])] for a,b in rows_ind],
                colWidths=[(W-44*mm)/2]*2)
    tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1),GREY),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,HexColor("#aaaaaa")),
        ('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#dddddd")),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [tbl, spacer(2)]
    els += [h2("Modes of Ventilation")]
    els += [
        bullet(f"{B('CMV')} (Controlled Mandatory Ventilation) – fully controlled, used immediately post-op"),
        bullet(f"{B('SIMV')} (Synchronized Intermittent Mandatory Ventilation) – weaning mode"),
        bullet(f"{B('PSV')} (Pressure Support Ventilation) – patient-triggered, for weaning"),
        bullet(f"{B('CPAP')} – continuous positive airway pressure; used in non-intubated patients"),
        bullet(f"{B('BiPAP')} – non-invasive; useful in mild/moderate respiratory failure"),
    ]
    els += [h2("Key Ventilator Settings")]
    els += [info_box([
        ("Tidal Volume", "6–8 mL/kg IBW (lung-protective strategy)"),
        ("RR", "12–16 breaths/min"),
        ("PEEP", "5–8 cmH₂O (prevents atelectasis)"),
        ("FiO₂", "Start 1.0; titrate to SpO₂ ≥ 95%"),
        ("I:E ratio", "1:2 (normal); 1:3 in obstructive disease"),
    ])]
    els += [h2("Weaning Criteria (SBT = Spontaneous Breathing Trial)")]
    els += [
        bullet("Haemodynamically stable, no vasopressors"),
        bullet("FiO₂ ≤ 0.4, PEEP ≤ 5 cmH₂O, SpO₂ ≥ 95%"),
        bullet("Adequate cough, GCS ≥ 10, follows commands"),
        bullet("Pass 30–120 min T-piece or PSV trial"),
        bullet("RSBI (f/Vt) &lt; 105 predicts successful extubation"),
    ]
    els += [keypoint("Lung-protective ventilation (low tidal volume 6 mL/kg) reduces ARDS risk - always cite this")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q63 – Triage in Disaster and Polytrauma (START, SALT)
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(63, "Triage in Disaster & Principles of Polytrauma Patient Management", "2019"), spacer(2)]
    els += [h2("Definition of Triage")]
    els += [p("Systematic sorting of casualties to maximize benefit and efficient use of limited resources during mass casualty incidents (MCI).")]
    els += [h2("START Triage (Simple Triage And Rapid Treatment)")]
    els += [info_box([
        ("Step 1 – Walk?", "If ambulatory → MINOR (Green tag)"),
        ("Step 2 – Respirations?", "None after airway opening → DEAD (Black). &gt;30/min → IMMEDIATE (Red). &lt;30/min → next step"),
        ("Step 3 – Perfusion?", "Radial pulse absent / cap refill &gt;2s → IMMEDIATE (Red). Present → next step"),
        ("Step 4 – Mental Status?", "Cannot follow commands → IMMEDIATE (Red). Can follow → DELAYED (Yellow)"),
    ], color=LTBLUE)]
    els += [h2("SALT Triage (Sort, Assess, Life-saving Interventions, Treatment/Transport)")]
    els += [
        bullet(f"{B('S')} – Sort: global sorting by ability to walk → wave to walk, purposeful movement, still/obvious life threat"),
        bullet(f"{B('A')} – Assess: in order: still/obvious life threat → purposeful movement → walking"),
        bullet(f"{B('L')} – Life-saving interventions: control haemorrhage, open airway, needle decompression, antidotes"),
        bullet(f"{B('T')} – Treatment/Transport: Immediate (can survive with resources) / Delayed / Minimal / Expectant"),
    ]
    els += [h2("Colour Code Summary")]
    color_rows = [
        [B("Red - Immediate"), "Life-threatening; first priority; survivable with intervention"],
        [B("Yellow - Delayed"), "Serious but stable; can wait 30–60 min"],
        [B("Green - Minor"), "Walking wounded; treat last"],
        [B("Black - Expectant/Dead"), "Unsurvivable or dead; expectant in MCI"],
    ]
    tbl = Table(color_rows, colWidths=[55*mm, (W-44*mm)-55*mm])
    tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(0,0),HexColor("#ffcccc")),
        ('BACKGROUND',(0,1),(0,1),HexColor("#ffffcc")),
        ('BACKGROUND',(0,2),(0,2),HexColor("#ccffcc")),
        ('BACKGROUND',(0,3),(0,3),HexColor("#cccccc")),
        ('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('BOX',(0,0),(-1,-1),0.5,HexColor("#aaaaaa")),
        ('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('FONTNAME',(1,0),(1,-1),'Helvetica'),('FONTSIZE',(0,0),(-1,-1),9),
        ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
    ]))
    els += [tbl, spacer(2)]
    els += [h2("Principles of Polytrauma Management (ATLS)")]
    els += [
        bullet(f"{B('Primary Survey')} – ABCDE: Airway (C-spine), Breathing, Circulation, Disability, Exposure"),
        bullet(f"{B('Resuscitation')} – simultaneous with primary survey"),
        bullet(f"{B('Secondary Survey')} – Head-to-toe after stabilization"),
        bullet(f"{B('Definitive Care')} – surgery, ICU, subspecialty"),
    ]
    els += [keypoint("Polytrauma = ISS >15 or AIS ≥3 in ≥2 body regions")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q64 – Coagulopathy of Trauma & Damage Control Resuscitation
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(64, "Coagulopathy of Trauma & Damage Control Resuscitation in Civilian Trauma", "2021"), spacer(2)]
    els += [h2("Acute Traumatic Coagulopathy (ATC) – Definition")]
    els += [p("An endogenous coagulopathy occurring EARLY (&lt;30 min) after severe trauma and haemorrhage, independent of dilution or hypothermia. Affects 25–35% of major trauma patients.")]
    els += [h2("Lethal Triad of Trauma")]
    mnem_tbl = Table([[
        Paragraph(f"{B('HYPOTHERMIA')} (&lt;35°C)<br/>Impairs clotting factors, platelet function", S['body']),
        Paragraph(f"{B('ACIDOSIS')} (pH &lt;7.35)<br/>Inhibits coagulation cascade enzymes", S['body']),
        Paragraph(f"{B('COAGULOPATHY')}<br/>Dilution, consumption, ATC", S['body']),
    ]], colWidths=[(W-44*mm)/3]*3)
    mnem_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1),HexColor("#fff0f0")),
        ('BOX',(0,0),(-1,-1),1,RED),
        ('INNERGRID',(0,0),(-1,-1),0.5,RED),
        ('TOPPADDING',(0,0),(-1,-1),5),('BOTTOMPADDING',(0,0),(-1,-1),5),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('ALIGN',(0,0),(-1,-1),'CENTER'),('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [mnem_tbl, spacer(2)]
    els += [h2("Mechanisms of ATC")]
    els += [
        bullet("Tissue factor release → thrombin generation → protein C activation → anticoagulation"),
        bullet("Hypoperfusion activates thrombomodulin → fibrinolysis"),
        bullet("Catecholamine surge → endotheliopathy of trauma"),
        bullet("Platelet dysfunction and consumption"),
    ]
    els += [h2("Damage Control Resuscitation (DCR)")]
    els += [info_box([
        ("Goal", "Permissive hypotension + haemostatic resuscitation + surgical haemostasis"),
        ("Target BP", "Systolic 80–90 mmHg (50–65 mmHg if TBI) until surgical haemostasis"),
        ("MTP (Massive Transfusion Protocol)", "pRBC : FFP : Platelets = 1:1:1 ratio"),
        ("TXA (Tranexamic Acid)", "1g IV over 10 min within 3 hours of injury, then 1g over 8h (CRASH-2 trial)"),
        ("Fibrinogen", "Target &gt;2 g/L; use cryoprecipitate or fibrinogen concentrate"),
        ("Avoid", "Crystalloid excess – causes dilutional coagulopathy, abdominal compartment syndrome"),
        ("Calcium", "10 mL 10% CaCl₂ for every 4 units pRBC (chelated by citrate)"),
    ], color=LTGREEN)]
    els += [h2("3-Phase Damage Control Surgery")]
    els += [
        bullet(f"{B('Phase 1')} – Abbreviated surgery: control haemorrhage and contamination; pack and close"),
        bullet(f"{B('Phase 2')} – ICU resuscitation: correct lethal triad, ventilation, monitoring"),
        bullet(f"{B('Phase 3')} – Re-look and definitive repair (48–72 hours later)"),
    ]
    els += [keypoint("TXA within 3 hours saves lives – CRASH-2 trial key evidence (cite in exam)")]
    els += [keypoint("Ratio 1:1:1 is the standard for massive transfusion protocol (PROPPR trial)")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q65+66 – Head Trauma & Glasgow Coma Scale
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(65, "Head Trauma – Glasgow Coma Scale (GCS)", "2009"), spacer(2)]
    els += [q_header(66, "GCS in Adults & Children – Significance & Failovers", "2021"), spacer(2)]
    els += [h2("Glasgow Coma Scale (Adults)")]
    gcs_rows = [
        [B("Component"), B("Response"), B("Score")],
        ["Eye Opening (E)", "Spontaneous / To voice / To pain / None", "4 / 3 / 2 / 1"],
        ["Verbal (V)", "Oriented / Confused / Words / Sounds / None", "5 / 4 / 3 / 2 / 1"],
        ["Motor (M)", "Obeys / Localises / Withdraws / Flexion / Extension / None", "6 / 5 / 4 / 3 / 2 / 1"],
    ]
    gcs_tbl = Table(gcs_rows, colWidths=[45*mm, 90*mm, (W-44*mm)-135*mm])
    gcs_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),NAVY),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),9),
        ('TOPPADDING',(0,0),(-1,-1),3),('BOTTOMPADDING',(0,0),(-1,-1),3),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('BOX',(0,0),(-1,-1),0.5,NAVY),
        ('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white, LTBLUE]),
        ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
    ]))
    els += [gcs_tbl, spacer(2)]
    els += [h2("GCS Scoring Range & Interpretation")]
    els += [info_box([
        ("Maximum", "15 (normal)"),
        ("Minimum", "3 (deepest coma)"),
        ("Mild TBI", "GCS 13–15"),
        ("Moderate TBI", "GCS 9–12"),
        ("Severe TBI", "GCS ≤8 → INTUBATE"),
    ])]
    els += [h2("Paediatric GCS Modifications (Children &lt;5 years)")]
    els += [
        bullet(f"{B('Verbal')} – Oriented→Words+Babble (5); Confused→Cries consolable (4); Words→Cries inconsolable (3); Sounds→Grunts (2); None (1)"),
        bullet(f"{B('Motor')} – Same as adult scale"),
        bullet(f"{B('Eye')} – Same as adult scale"),
    ]
    els += [h2("Clinical Significance")]
    els += [
        bullet("Best predictor of outcome in head injury"),
        bullet("GCS ≤8: intubate to protect airway (rule: 'less than or equal to 8, intubate'"),
        bullet("Serial GCS: falling GCS by ≥2 points = deterioration → urgent CT"),
        bullet("Baseline GCS essential before paralysis/sedation"),
        bullet("Used in APACHE II, Trauma Score, RTS scoring systems"),
    ]
    els += [h2("Failovers (Limitations of GCS)")]
    els += [
        bullet("Intubated patients: verbal = 1T (not true 1; add T suffix)"),
        bullet("Periorbital oedema: eye opening unreliable"),
        bullet("Alcohol/drug intoxication: falsely low GCS"),
        bullet("Spinal cord injury: motor falsely low"),
        bullet("Modified GCS used for infants; FOUR score as alternative"),
    ]
    els += [keypoint("GCS ≤8 = severe TBI = intubate. Motor component is most prognostic.")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q67 – Transient Loss of Consciousness after RTA
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(67, "Transient Loss of Consciousness (LOC) after RTA – Presentation & Management", "2021, 2023"), spacer(2)]
    els += [h2("Definition")]
    els += [p("Transient LOC following RTA implies concussion/mild TBI. GCS 13–15 on presentation.")]
    els += [h2("Mechanism")]
    els += [bullet("Diffuse axonal injury from shear forces"),
            bullet("Transient disruption of RAS (reticular activating system)"),
            bullet("No structural lesion on CT in pure concussion")]
    els += [h2("Clinical Features")]
    els += [
        bullet("LOC typically &lt;30 minutes"),
        bullet("Post-traumatic amnesia (PTA) &lt;24 hours"),
        bullet("Headache, dizziness, confusion, nausea"),
        bullet("No focal neurological deficit"),
        bullet("Normal CT scan (by definition in concussion)"),
    ]
    els += [h2("Assessment")]
    els += [info_box([
        ("History", "Duration of LOC, PTA, amnesia, headache, vomiting"),
        ("Examination", "GCS, pupils, focal neuro deficits, scalp injury, C-spine"),
        ("CT Head Indications (NICE)", "GCS &lt;13 at any point; ≥2 vomiting episodes; age &gt;65; coagulopathy; dangerous mechanism; focal neuro deficit; amnesia &gt;30 min"),
        ("CT C-spine", "High-energy mechanism, neck pain, focal neuro deficit"),
    ], color=LTBLUE)]
    els += [h2("Management")]
    els += [
        bullet("Airway protection if GCS ≤8"),
        bullet("IV access, O₂, monitoring"),
        bullet("C-spine immobilisation until cleared"),
        bullet("CT head + C-spine as per indications"),
        bullet("Observe minimum 4–6 hours in ED"),
        bullet("Neurosurgical referral if CT abnormal or GCS deteriorates"),
        bullet("Discharge with head injury instructions if CT normal and GCS 15"),
    ]
    els += [h2("Features Suggesting Intracranial Bleed")]
    els += [
        bullet("Lucid interval then deterioration → Extradural Haematoma (EDH)"),
        bullet("Gradual deterioration, elderly, on anticoagulants → Subdural Haematoma (SDH)"),
        bullet("Worst headache of life, neck stiffness → SAH"),
    ]
    els += [keypoint("Lucid interval = extradural haematoma (middle meningeal artery) until proven otherwise")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q68 – Chest Trauma: Complications & Management
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(68, "Chest Trauma – Complications & Management", "2010, 2020"), spacer(2)]
    els += [h2("Classification of Chest Trauma")]
    els += [
        bullet(f"{B('Blunt')} – RTA, fall, crush (70% of chest injuries)"),
        bullet(f"{B('Penetrating')} – stab, gunshot"),
    ]
    els += [h2("Immediately Life-Threatening Conditions (ATOM-FC)")]
    els += [mnemonic("A – Airway obstruction | T – Tension pneumothorax | O – Open chest wound | M – Massive haemothorax | F – Flail chest | C – Cardiac tamponade")]
    els += [h2("Potentially Life-Threatening (The Other 6)")]
    els += [
        bullet("Simple pneumothorax / Haemothorax"),
        bullet("Pulmonary contusion"),
        bullet("Myocardial contusion"),
        bullet("Aortic disruption"),
        bullet("Diaphragmatic rupture"),
        bullet("Oesophageal injury"),
    ]
    els += [h2("Complications of Chest Trauma")]
    comp_rows = [
        [B("Early"), B("Late")],
        ["Tension pneumothorax", "Empyema thoracis"],
        ["Haemothorax", "Chronic haemothorax/fibrothorax"],
        ["Rib fractures / flail chest", "ARDS / respiratory failure"],
        ["Pulmonary contusion", "Pneumonia"],
        ["Cardiac tamponade", "Post-traumatic empyema"],
        ["Aortic rupture", "Constrictive pericarditis"],
    ]
    comp_tbl = Table(comp_rows, colWidths=[(W-44*mm)/2]*2)
    comp_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),TEAL),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),9),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),5),('RIGHTPADDING',(0,0),(-1,-1),5),
        ('BOX',(0,0),(-1,-1),0.5,TEAL),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white,GREY]),
        ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
    ]))
    els += [comp_tbl, spacer(2)]
    els += [h2("Management Principles")]
    els += [
        bullet("Primary survey: ABCDE; decompress tension pneumothorax IMMEDIATELY (2nd ICS MCL)"),
        bullet("High-flow O₂, IV access x2, monitoring, blood transfusion if required"),
        bullet("Chest drain (ICC) 5th ICS AAL for haemothorax/pneumothorax"),
        bullet("Analgesia: epidural/nerve blocks – crucial for rib fractures (prevents respiratory failure)"),
        bullet("Surgical intervention: thoracotomy if ICC output &gt;1500 mL immediately or &gt;200 mL/h for 4 hours"),
        bullet("Beck's triad (JVD, muffled heart sounds, hypotension) → pericardiocentesis/pericardial window for tamponade"),
    ]
    els += [keypoint("Tension pneumothorax: CLINICAL diagnosis, treat immediately with needle decompression – do NOT wait for CXR")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q69 – Dangerous Dozen of Thoracic Trauma
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(69, "The 'Dangerous Dozen' of Thoracic Trauma & Immediate Life-Threatening Conditions", "2021"), spacer(2)]
    els += [h2("The Dangerous Dozen (ATLS Framework)")]
    els += [p(f"6 {B('Immediately Life-Threatening')} (diagnose/treat during Primary Survey) + 6 {B('Potentially Life-Threatening')} (diagnose during Secondary Survey)")]
    els += [h2("6 Immediately Life-Threatening (ATOM-FC)")]
    immediate_rows = [
        [B("Condition"), B("Diagnosis"), B("Treatment")],
        ["Airway Obstruction", "Stridor, cyanosis, accessory muscles", "Jaw thrust, suction, intubation/cric"],
        ["Tension Pneumothorax", "Resp distress, absent breath sounds, tracheal deviation, JVD, shock", "Needle decom 2nd ICS MCL; ICC"],
        ["Open Pneumothorax", "Sucking chest wound, air bubbling", "3-sided occlusive dressing; ICC"],
        ["Massive Haemothorax", "Dullness on percussion, shock, &gt;1500 mL blood", "ICC + fluid; thoracotomy if continuing"],
        ["Flail Chest", "Paradoxical chest movement, severe pain, hypoxia", "Analgesia, O₂, IPPV if severe"],
        ["Cardiac Tamponade", "Beck's triad: JVD, muffled HS, hypotension; pulsus paradoxus", "Pericardiocentesis/window/thoracotomy"],
    ]
    imm_tbl = Table(immediate_rows, colWidths=[45*mm, 65*mm, (W-44*mm)-110*mm])
    imm_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),RED),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),8.5),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,RED),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[HexColor("#fff5f5"),white]),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [imm_tbl, spacer(2)]
    els += [h2("6 Potentially Life-Threatening (Secondary Survey)")]
    els += [
        bullet(f"{B('Pulmonary contusion')} – hypoxia 24–48h post; CXR/CT; treat with O₂, analgesia, fluid restriction"),
        bullet(f"{B('Myocardial contusion')} – ECG changes, troponin rise; monitor for arrhythmias"),
        bullet(f"{B('Aortic disruption')} – widened mediastinum on CXR; CT angiography; endovascular/open repair"),
        bullet(f"{B('Diaphragmatic rupture')} – bowel in chest on CXR; higher on left (90%); surgical repair"),
        bullet(f"{B('Tracheobronchial injury')} – persistent pneumothorax despite ICC; bronchoscopy + surgical repair"),
        bullet(f"{B('Oesophageal injury')} – mediastinitis, pneumomediastinum; Gastrografin swallow; urgent repair"),
    ]
    els += [keypoint("Tension PTX = clinical diagnosis. Treat with needle then ICC. Never wait for imaging.")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q70 – Flail Chest
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(70, "Flail Chest – Definition, Physiology, Types & Management", "2009, 2015"), spacer(2)]
    els += [h2("Definition")]
    els += [p("Flail chest occurs when ≥3 consecutive ribs are fractured in ≥2 places, creating a free-floating 'flail' segment that moves paradoxically with respiration.")]
    els += [h2("Physiological Consequences")]
    els += [
        bullet(f"{B('Paradoxical movement')}: flail segment moves IN on inspiration (due to negative intrathoracic pressure) and OUT on expiration"),
        bullet(f"{B('Pendelluft')}: air moves between lungs rather than in/out – reduces effective ventilation"),
        bullet(f"{B('Pulmonary contusion')}: almost always present; principal cause of hypoxia"),
        bullet("Impaired cough → retained secretions → pneumonia"),
        bullet("Pain → splinting → atelectasis → V/Q mismatch → hypoxia"),
    ]
    els += [h2("Types")]
    els += [
        bullet(f"{B('Anterior flail chest')}: involves sternum/bilateral anterior rib fractures; most severe; paradoxical movement most prominent"),
        bullet(f"{B('Lateral flail chest')}: unilateral rib fractures; moderate severity"),
        bullet(f"{B('Posterior flail chest')}: least common; paradox less due to muscle splinting"),
    ]
    els += [h2("Management")]
    els += [info_box([
        ("Immediate", "High-flow O₂, analgesia, IV access"),
        ("Analgesia", "EPIDURAL analgesia – gold standard for rib fractures; also intercostal nerve blocks, IV PCA"),
        ("Oxygen therapy", "Target SpO₂ ≥95%; CPAP/BiPAP for mild-moderate"),
        ("Ventilation (IPPV)", "Indicated if: SpO₂ &lt;90% on O₂, RR &gt;30, PaO₂ &lt;8kPa, PaCO₂ &gt;6kPa, GCS &lt;9, associated shock"),
        ("Anterior flail chest", "May require IPPV + surgical rib fixation with ORIF plates"),
        ("Surgical fixation (ORIF)", "Increasing evidence for anterior/lateral flail; reduces ICU stay, ventilation days, mortality"),
        ("Fluid management", "Restrict IV fluids (worsens pulmonary contusion)"),
    ], color=LTGREEN)]
    els += [keypoint("Pulmonary contusion (not paradoxical movement) is the main cause of hypoxia in flail chest")]
    els += [keypoint("Anterior flail chest: consider surgical rib fixation (ORIF) – increasingly preferred over prolonged ventilation")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q71+72 – Haemopneumothorax & Underwater Seal Drainage
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(71, "Haemopneumothorax", "2007"), spacer(2)]
    els += [q_header(72, "Underwater Seal Drainage", "2021"), spacer(2)]
    els += [h2("Haemopneumothorax – Definition")]
    els += [p("Presence of both blood and air in the pleural cavity, usually following penetrating or blunt thoracic trauma.")]
    els += [h2("Clinical Features")]
    els += [
        bullet("Reduced/absent breath sounds + dullness to percussion (blood) + hyper-resonance (air)"),
        bullet("Respiratory distress, tachycardia, hypoxia"),
        bullet("CXR: fluid level + collapsed lung; CT: more sensitive"),
    ]
    els += [h2("Management")]
    els += [
        bullet("Large-bore ICC (intercostal chest drain) – 28–32 Fr; 5th ICS anterior axillary line"),
        bullet("Drainage of blood + lung re-expansion simultaneously"),
        bullet("Thoracotomy if: initial output &gt;1500 mL; continuing &gt;200 mL/h for 3–4 hours; haemodynamic instability"),
        bullet("Video-Assisted Thoracoscopic Surgery (VATS) – for retained haemothorax"),
    ]
    els += [h2("Underwater Seal Drain (UWSD)")]
    els += [info_box([
        ("Principle", "One-way valve mechanism: air/fluid drains OUT but atmosphere cannot enter pleural space"),
        ("Components", "Chest tube → long tube under water (2 cm below surface) → air vent tube"),
        ("Position", "Drain bottle must ALWAYS be BELOW the patient (gravity drainage)"),
        ("Monitoring", "Swinging with respiration confirms patency; bubbling = air leak"),
        ("Cessation of swinging", "Lung re-expanded (good) OR tube kinked/blocked (bad) – distinguish clinically"),
        ("Clamping", "NOT routine; may cause tension pneumothorax; only clamp to check for air leak"),
        ("Removal", "When drainage &lt;100–150 mL/24h, no air leak, lung fully expanded on CXR"),
    ], color=LTBLUE)]
    els += [keypoint("Never clamp ICC routinely – risk of tension pneumothorax. Never lift bottle above patient.")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q73 – NOMAT (Non-Operative Management of Abdominal Trauma)
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(73, "NOMAT – Non-Operative Management of Solid Organ Injuries in Blunt Abdominal Trauma", ""), spacer(2)]
    els += [h2("Definition")]
    els += [p("Non-operative management (NOM) of solid organ injuries (liver, spleen, kidney) avoids immediate laparotomy in haemodynamically stable patients with blunt abdominal trauma.")]
    els += [h2("Common Solid Organs Injured (Blunt)")]
    els += [
        bullet(f"{B('Spleen')} – most commonly injured solid organ in blunt abdominal trauma (40–45%)"),
        bullet(f"{B('Liver')} – second most common (35–40%)"),
        bullet(f"{B('Kidney')} – third (10–15%)"),
    ]
    els += [h2("Pre-hospital & Initial Assessment")]
    els += [
        bullet("ATLS resuscitation: 2 large IV cannulae, crystalloid boluses"),
        bullet(f"{B('FAST scan')} (Focused Abdominal Sonography for Trauma) – rapidly detects free fluid"),
        bullet("CT abdomen/pelvis with IV contrast – gold standard for injury grading"),
        bullet("Serial abdominal examination"),
    ]
    els += [h2("Criteria for NOM (All must be met)")]
    els += [
        bullet("Haemodynamically STABLE (SBP &gt;90 mmHg, HR &lt;120)"),
        bullet("No peritonitis or evisceration"),
        bullet("No other abdominal injury requiring surgery"),
        bullet("CT grade injury suitable for NOM (usually Grade I–III liver/spleen)"),
        bullet("ICU monitoring available"),
    ]
    els += [h2("NOM Success Rates")]
    els += [info_box([
        ("Spleen", "85–95% success in Grade I–III; 50–75% in Grade IV–V with angioembolization"),
        ("Liver", "80–90% success in Grade I–III; high-grade needs angioembolization/surgery"),
        ("Kidney", "&gt;90% for Grade I–III; ureteric injury needs intervention"),
    ])]
    els += [h2("Failure of NOM (Indications for Emergency Laparotomy)")]
    els += [
        bullet("Haemodynamic instability despite resuscitation"),
        bullet("Peritonitis developing"),
        bullet("Transfusion requirement &gt;4 units pRBC/24h"),
        bullet("CT showing active contrast extravasation or high-grade injury"),
        bullet("Falling Hb with continuing transfusion requirement"),
    ]
    els += [keypoint("FAST scan: 5 windows – pericardial, hepatorenal (Morrison's pouch), splenorenal, pelvis, subcostal")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q74 – Splenic Injury
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(74, "Splenic Injury – AAST Grading & Management", ""), spacer(2)]
    els += [h2("AAST Grading of Splenic Injury")]
    spleen_rows = [
        [B("Grade"), B("Description"), B("Management")],
        ["I", "Subcapsular haematoma &lt;10%; laceration &lt;1 cm depth", "NOM; observation"],
        ["II", "Subcapsular haematoma 10–50%; laceration 1–3 cm", "NOM; close monitoring"],
        ["III", "Subcapsular haematoma &gt;50% / expanding; laceration &gt;3 cm or trabecular vessel", "NOM with angioembolization"],
        ["IV", "Laceration involving segmental/hilar vessels; devascularisation &gt;25%", "Angioembolization or splenectomy"],
        ["V", "Shattered spleen; hilar vascular injury; total devascularisation", "Splenectomy"],
    ]
    spl_tbl = Table(spleen_rows, colWidths=[15*mm, 90*mm, (W-44*mm)-105*mm])
    spl_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),TEAL),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),9),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,TEAL),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white,GREY]),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [spl_tbl, spacer(2)]
    els += [h2("Management of Splenic Injury with Active Bleed")]
    els += [
        bullet("Haemodynamically UNSTABLE → Emergency splenectomy"),
        bullet(f"Haemodynamically STABLE with contrast blush on CT → {B('Angioembolization')} (proximal or selective)"),
        bullet("Post-splenectomy: OPSI (Overwhelming Post-Splenectomy Infection) risk"),
    ]
    els += [h2("Post-Splenectomy Management (OPSI Prevention)")]
    els += [
        bullet("Vaccinations: Pneumococcal, Meningococcal, HIb, Influenza (2 weeks post-op if elective)"),
        bullet("Prophylactic penicillin (phenoxymethylpenicillin) lifelong or minimum 2 years"),
        bullet("Patient education: seek immediate medical care for fever/infection"),
        bullet("Medical alert card/bracelet"),
    ]
    els += [keypoint("OPSI – rapidly fatal sepsis (Strep. pneumoniae most common) – vaccinate before elective splenectomy")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q75 – Management of Shocked Patient with Blunt Abdominal Trauma
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(75, "Management of Blunt Abdominal Trauma Patient in Shock", "2023"), spacer(2)]
    els += [h2("Initial Resuscitation (ATLS)")]
    els += [info_box([
        ("Airway", "Secure airway; C-spine protection; high-flow O₂"),
        ("Breathing", "Assess bilateral air entry; treat pneumo/haemothorax"),
        ("Circulation", "2 large-bore IV (antecubital); bloods (FBC, U&E, LFT, coag, crossmatch, lactate); 1L crystalloid bolus; MTP if Class III/IV haemorrhage"),
        ("Disability", "GCS, pupils, glucose"),
        ("Exposure", "Log roll, assess for posterior injuries"),
    ], color=LTBLUE)]
    els += [h2("Haemorrhage Classification (ATLS)")]
    hclass = [
        [B("Class"), B("Blood Loss"), B("HR"), B("SBP"), B("Response")],
        ["I", "&lt;750 mL (&lt;15%)", "&lt;100", "Normal", "Crystalloid"],
        ["II", "750–1500 mL (15–30%)", "100–120", "Normal", "Crystalloid + blood"],
        ["III", "1500–2000 mL (30–40%)", "120–140", "Decreased", "Blood + surgery"],
        ["IV", "&gt;2000 mL (&gt;40%)", "&gt;140", "Very low", "Immediate surgery"],
    ]
    hcl_tbl = Table(hclass, colWidths=[15*mm,45*mm,20*mm,20*mm,(W-44*mm)-100*mm])
    hcl_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),NAVY),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),9),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,NAVY),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white,GREY]),
        ('VALIGN',(0,0),(-1,-1),'MIDDLE'),
    ]))
    els += [hcl_tbl, spacer(2)]
    els += [h2("Investigations")]
    els += [
        bullet("FAST scan – immediate; detect free fluid"),
        bullet("CT abdomen/pelvis with IV contrast – haemodynamically STABLE only"),
        bullet("DPL (Diagnostic Peritoneal Lavage) – historical; replaced by FAST/CT"),
        bullet("Bloods: FBC, coag, BG&X, LFT, amylase, ABG"),
        bullet("Urine dipstick (haematuria → renal/bladder injury)"),
    ]
    els += [h2("Decision Algorithm for Shocked Patient")]
    els += [
        bullet(f"{B('FAST +ve + unstable')} → Emergency laparotomy (do NOT delay for CT)"),
        bullet(f"{B('FAST +ve + stable')} → CT abdomen → NOM or selective surgery"),
        bullet(f"{B('FAST -ve + unstable')} → Repeat FAST; look for extraabdominal source (chest, pelvis, long bones)"),
        bullet(f"{B('FAST -ve + stable')} → CT for full evaluation"),
    ]
    els += [keypoint("In haemodynamically UNSTABLE patient: FAST + straight to theatre. No time for CT.")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q76 – Diagnostic Modalities in Blunt Abdominal Trauma
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(76, "Diagnostic Modalities of Blunt Abdominal Trauma", "2016"), spacer(2)]
    diag_rows = [
        [B("Modality"), B("Advantages"), B("Disadvantages / Indications")],
        ["FAST Scan", "Bedside; fast; no radiation; repeatable; 96% specificity for haemoperitoneum", "Operator-dependent; misses bowel/solid organ injury; poor for retroperitoneum"],
        ["CT Abdomen/ Pelvis (IV contrast)", "Gold standard; grades injury; detects active bleeding (blush); retroperitoneum; STABLE patients", "Radiation; requires contrast; time-consuming; patient must be stable"],
        ["DPL (Diagnostic Peritoneal Lavage)", "+ve if &gt;10 mL blood; &gt;100K RBC/mm³; bile/food; highly sensitive (98%)", "Invasive; non-specific; does not grade injury; now largely replaced"],
        ["Plain X-ray (CXR, Pelvis)", "Rapid; identifies pneumothorax, fractures, free air", "Low sensitivity for abdominal injury; misses solid organ injury"],
        ["Diagnostic Laparoscopy", "Therapeutic; no laparotomy incision; direct visualisation", "General anaesthesia required; misses retroperitoneal injuries"],
        ["Angiography + Embolization", "Therapeutic as well as diagnostic; controls active haemorrhage", "Invasive; time; IR expertise needed"],
        ["Urinalysis/ IVU", "Detects haematuria; renal injury", "Indirect; IVU largely replaced by CT urogram"],
    ]
    diag_tbl = Table(diag_rows, colWidths=[30*mm, 65*mm, (W-44*mm)-95*mm])
    diag_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),NAVY),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),8.5),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,NAVY),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white,GREY]),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [diag_tbl, spacer(2)]
    els += [keypoint("FAST = first-line in ED. CT = gold standard for stable patients. DPL now historical.")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q77 – Approaches & Indications for Laparotomy in Blunt Abdominal Trauma
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(77, "Approaches & Indications for Laparotomy in Blunt Abdominal Trauma", ""), spacer(2)]
    els += [h2("Indications for Emergency Laparotomy")]
    els += [
        bullet("Haemodynamic instability despite resuscitation"),
        bullet("FAST positive + unstable patient"),
        bullet("Peritonitis (involuntary guarding, rigidity)"),
        bullet("Evisceration"),
        bullet("Free air on imaging (hollow viscus perforation)"),
        bullet("Failure of NOM (continued bleeding, transfusion requirement)"),
        bullet("Diaphragmatic rupture"),
        bullet("Rectal bleeding suggesting colorectal injury"),
    ]
    els += [h2("Surgical Approach")]
    els += [
        bullet(f"{B('Incision')}: midline laparotomy (most common) – from xiphisternum to pubic symphysis"),
        bullet(f"{B('Damage Control Surgery approach')}: abbreviated; control haemorrhage first (packing), then contamination (staple bowel ends), then close temporarily (Bogota bag / vacuum pack)"),
        bullet(f"{B('Packing')}: perihepatic/perisplenic packing for coagulopathic bleeding"),
        bullet(f"{B('Pringle manoeuvre')}: manual compression of hepatoduodenal ligament to control liver bleeding"),
    ]
    els += [h2("Approaches for Specific Injuries")]
    els += [info_box([
        ("Liver", "Right subcostal/Kocher extension; Pringle manoeuvre; packing"),
        ("Spleen", "Midline or left subcostal; splenorrhaphy or splenectomy"),
        ("Pancreas", "Kocher manoeuvre to expose; distal pancreatectomy vs. drainage"),
        ("Duodenum", "Extensive Kocher; Whipple if necessary"),
        ("Retroperitoneum (Zone I central)", "Must explore if pulsatile/expanding – risk of aortic/IVC injury"),
        ("Retroperitoneum (Zone II lateral)", "May observe if stable (renal haematoma)"),
    ])]
    els += [keypoint("Temporary abdominal closure (TAC) is standard after damage control laparotomy – plan for re-look at 48 hours")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q78 – Liver Injury – Grades & Management
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(78, "Grades of Liver Injury & Management Algorithm with Active Bleeding", ""), spacer(2)]
    els += [h2("AAST Grading of Liver Injury")]
    liver_rows = [
        [B("Grade"), B("Description"), B("Management")],
        ["I", "Haematoma &lt;10% surface; laceration &lt;1 cm depth", "NOM; observation; hospital admission"],
        ["II", "Haematoma 10–50%; laceration 1–3 cm, &lt;10 cm length", "NOM; close monitoring; serial CT"],
        ["III", "Haematoma &gt;50%/expanding; laceration &gt;3 cm depth; ruptured central haematoma", "NOM with angioembolization if stable"],
        ["IV", "Parenchymal disruption 25–75% of lobe; 1–3 Couinaud segments", "Angioembolization or surgery"],
        ["V", "Disruption &gt;75% of lobe; juxtahepatic venous injury", "Damage control surgery; packing"],
        ["VI", "Hepatic avulsion", "Transplantation / inevitable death"],
    ]
    liv_tbl = Table(liver_rows, colWidths=[13*mm, 90*mm, (W-44*mm)-103*mm])
    liv_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),HexColor("#7b3f00")),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),9),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,HexColor("#7b3f00")),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white,HexColor("#fff8f0")]),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [liv_tbl, spacer(2)]
    els += [h2("Management Algorithm with Active Bleeding")]
    els += [info_box([
        ("Haemodynamically Unstable", "→ Emergency laparotomy → Pringle manoeuvre → Perihepatic packing → ICU → Re-look 48–72h"),
        ("Haemodynamically Stable + CT blush", "→ Angiography + Embolization (TAE) – first choice for active extravasation"),
        ("Stable without blush", "→ NOM: ICU monitoring, serial Hb/CT, bed rest, no anticoagulation"),
        ("Biliary injury", "Bile leak → ERCP + stenting or biliary drainage"),
        ("Hepatic artery injury", "Selective TAE; formal resection in Grade V"),
    ], color=LTGREEN)]
    els += [h2("Complications of Liver Trauma")]
    els += [
        bullet("Haemobilia (blood in biliary tree → melena + RUQ pain + jaundice = Quincke's triad)"),
        bullet("Biloma / bile leak – treated by ERCP + stenting"),
        bullet("Hepatic abscess"),
        bullet("Delayed haemorrhage (most common in Grade IV–V)"),
        bullet("Hepatic necrosis"),
    ]
    els += [keypoint("Pringle manoeuvre: compress hepatoduodenal ligament; controls inflow only. Max 60 min warm ischaemia.")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q79 – Duodenal Injuries
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(79, "Duodenal Injuries – Classification, Grading & Management", "2015, 2021, 2014"), spacer(2)]
    els += [h2("AAST Grading of Duodenal Injury")]
    doud_rows = [
        [B("Grade"), B("Description")],
        ["I", "Haematoma involving single portion; laceration partial thickness, no perforation"],
        ["II", "Haematoma involving multiple portions; laceration &lt;50% of circumference"],
        ["III", "Laceration 50–75% of D2; or 50–100% of D1, D3, D4"],
        ["IV", "Laceration &gt;75% of D2; involving ampulla or distal CBD"],
        ["V", "Massive disruption of duodeno-pancreatic complex; devascularisation of duodenum"],
    ]
    doud_tbl = Table(doud_rows, colWidths=[15*mm, (W-44*mm)-15*mm])
    doud_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),TEAL),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),9),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,TEAL),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white,GREY]),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [doud_tbl, spacer(2)]
    els += [h2("Management")]
    els += [info_box([
        ("Grade I–II Haematoma", "Conservative – NG decompression, TPN/enteral nutrition; resolves in 7–14 days; serial imaging"),
        ("Grade I–II Laceration", "Primary repair (transverse closure to avoid stenosis) + drain"),
        ("Grade III", "Primary repair + pyloric exclusion + gastrojejunostomy"),
        ("Grade IV", "Complex repair; biliary stenting; possible Whipple if CBD involved"),
        ("Grade V", "Pancreaticoduodenectomy (Whipple) – high mortality"),
    ], color=LTBLUE)]
    els += [h2("Pyloric Exclusion Technique")]
    els += [
        bullet("Repair duodenal injury"),
        bullet("Gastrotomy → oversew pylorus (non-absorbable) OR staple pylorus"),
        bullet("Gastrojejunostomy for gastric drainage"),
        bullet("Tube duodenostomy for decompression"),
        bullet("Pylorus spontaneously re-opens in 3–6 weeks"),
    ]
    els += [h2("Signs of Missed Duodenal Injury")]
    els += [
        bullet("Retroperitoneal duodenal perforation – minimal peritoneal signs"),
        bullet("Bile staining, retroperitoneal air on CT (right para-renal region)"),
        bullet("Late: sepsis, fever, right flank ecchymosis (Grey Turner's sign)"),
    ]
    els += [keypoint("Kocher manoeuvre essential to fully expose all 4 parts of duodenum at laparotomy")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q80 – Pancreatic Trauma
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(80, "Pancreatic Trauma – Classification & Management Algorithm", "2021"), spacer(2)]
    els += [h2("AAST Grading of Pancreatic Injury")]
    panc_rows = [
        [B("Grade"), B("Description")],
        ["I", "Minor contusion/laceration without duct injury"],
        ["II", "Major contusion/laceration without duct injury; no tissue loss"],
        ["III", "Distal transaction or parenchymal injury with duct injury"],
        ["IV", "Proximal transaction (to right of SMV) or ampullary injury"],
        ["V", "Massive disruption of pancreatic head"],
    ]
    panc_tbl = Table(panc_rows, colWidths=[15*mm, (W-44*mm)-15*mm])
    panc_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,0),HexColor("#4a5568")),('TEXTCOLOR',(0,0),(-1,0),white),
        ('FONTNAME',(0,0),(-1,0),'Helvetica-Bold'),('FONTSIZE',(0,0),(-1,-1),9),
        ('TOPPADDING',(0,0),(-1,-1),2),('BOTTOMPADDING',(0,0),(-1,-1),2),
        ('LEFTPADDING',(0,0),(-1,-1),4),('RIGHTPADDING',(0,0),(-1,-1),4),
        ('BOX',(0,0),(-1,-1),0.5,HexColor("#4a5568")),('INNERGRID',(0,0),(-1,-1),0.3,HexColor("#cccccc")),
        ('ROWBACKGROUNDS',(0,1),(-1,-1),[white,GREY]),
        ('VALIGN',(0,0),(-1,-1),'TOP'),
    ]))
    els += [panc_tbl, spacer(2)]
    els += [h2("Diagnosis of Pancreatic Trauma")]
    els += [
        bullet(f"{B('Serum amylase')} – raised in &lt;50%; NOT reliable alone; serial measurements more useful"),
        bullet(f"{B('CT abdomen with IV contrast')} – primary modality; look for peripancreatic fluid, laceration"),
        bullet(f"{B('MRCP')} – best for ductal integrity assessment"),
        bullet(f"{B('ERCP')} – therapeutic and diagnostic for suspected duct injury"),
    ]
    els += [h2("Management Algorithm")]
    els += [info_box([
        ("Grade I–II (no duct injury)", "Conservative: IV fluids, NBM, nutritional support, drainage only; observe for pseudocyst"),
        ("Grade III (distal duct injury)", "Distal pancreatectomy ± splenectomy; damage control with drain only if coagulopathic"),
        ("Grade IV (proximal/ampullary)", "Damage control drainage → ICU → definitive ERCP stenting or Whipple at re-look"),
        ("Grade V (pancreatic head)", "Pancreaticoduodenectomy (Whipple) – high mortality 30–50%; staged approach preferred"),
        ("All grades", "Wide closed suction drainage; TPN or jejunal feeding; octreotide (controversial)"),
    ], color=LTYELLOW)]
    els += [h2("Complications")]
    els += [
        bullet("Pancreatic fistula (most common) – defined as drain amylase &gt;3x serum on day 3"),
        bullet("Pancreatic pseudocyst – observe; drain if symptomatic"),
        bullet("Haemorrhage (pseudoaneurysm)"),
        bullet("ARDS, DIC in severe injury"),
        bullet("Diabetes mellitus (if major resection)"),
    ]
    els += [keypoint("The KEY decision: is the MAIN PANCREATIC DUCT injured? MRCP/ERCP to assess. Duct injury = surgery.")]
    els += [spacer(3), hr(), spacer(2)]

    # ═══════════════════════════════════════════════════════════════════════════
    # Q81 – Pancreaticoduodenal Injury
    # ═══════════════════════════════════════════════════════════════════════════
    els += [q_header(81, "Management of Pancreaticoduodenal Injury", "2007, 2025"), spacer(2)]
    els += [h2("Overview")]
    els += [p("Combined pancreaticoduodenal injury is uncommon (5% of abdominal trauma) but carries very high mortality (25–30%). Most due to high-energy blunt or penetrating trauma.")]
    els += [h2("Mechanism & Anatomy")]
    els += [
        bullet("Handlebar/steering wheel injury → crushing against spine at L1–L2"),
        bullet("All 4 parts of duodenum share blood supply with pancreas via pancreaticoduodenal vessels"),
        bullet("Disruption of ampulla of Vater most complex – combined biliary + pancreatic + duodenal injury"),
    ]
    els += [h2("Investigations")]
    els += [
        bullet("CT with IV contrast – free retroperitoneal air, peripancreatic fluid, mesenteric fat stranding"),
        bullet("ERCP/MRCP – ductal injury assessment"),
        bullet("Amylase, LFT, bilirubin"),
        bullet("At laparotomy: Kocher manoeuvre + extensive duodenal mobilisation"),
    ]
    els += [h2("Damage Control Approach (First Operation)")]
    els += [
        bullet("Control haemorrhage: ligate/suture vessels, pack"),
        bullet("Control contamination: ligate bile duct, staple duodenum, drain"),
        bullet("External biliary drainage (T-tube or tube duodenostomy)"),
        bullet("Nasojejunal feeding tube placement"),
        bullet("Close abdomen temporarily"),
    ]
    els += [h2("Definitive Reconstruction Options")]
    els += [info_box([
        ("Simple Laceration", "Primary repair + pyloric exclusion + gastrojejunostomy + drainage"),
        ("Ampullary injury", "Sphincteroplasty or ampullary re-implantation"),
        ("Combined + destroys head", "Pancreaticoduodenectomy (Whipple) – rarely done acutely; staged preferred"),
        ("Child's procedure", "Distal pancreatectomy + pancreatic head drainage for Grade III–IV"),
        ("Roux-en-Y", "Pancreaticojejunostomy for proximal duct injury"),
    ], color=LTBLUE)]
    els += [h2("Complications")]
    els += [
        bullet("Pancreatic fistula / leak"),
        bullet("Duodenal fistula (commonest serious complication)"),
        bullet("Delayed haemorrhage (pseudoaneurysm)"),
        bullet("Intra-abdominal abscess"),
        bullet("Endocrine / exocrine insufficiency after major resection"),
    ]
    els += [keypoint("Pancreaticoduodenectomy (Whipple) acutely carries &gt;50% mortality – prefer staged damage control approach")]
    els += [spacer(3), hr(), spacer(2)]

    # ── FOOTER NOTE ───────────────────────────────────────────────────────────
    els += [spacer(4)]
    footer_tbl = Table([[
        Paragraph(
            f"<b>Reference:</b> Bailey &amp; Love's Short Practice of Surgery, 27th Ed. | "
            f"<b>ATLS</b> 10th Edition | <b>CRASH-2 trial</b> | <b>PROPPR trial</b> | "
            f"<i>All content structured for MS General Surgery examinations. "
            f"For 15-minute exam answer technique: state definition → classify → "
            f"investigations → management → complications → prognosis.</i>",
            S['note'])
    ]], colWidths=[W - 20*mm])
    footer_tbl.setStyle(TableStyle([
        ('BACKGROUND',(0,0),(-1,-1),HexColor("#f0f4f8")),
        ('BOX',(0,0),(-1,-1),0.5,TEAL),
        ('TOPPADDING',(0,0),(-1,-1),6),('BOTTOMPADDING',(0,0),(-1,-1),6),
        ('LEFTPADDING',(0,0),(-1,-1),8),('RIGHTPADDING',(0,0),(-1,-1),8),
    ]))
    els += [footer_tbl]

    return els


def add_page_number(canvas, doc):
    canvas.saveState()
    canvas.setFont('Helvetica', 8)
    canvas.setFillColor(DGREY)
    canvas.drawString(20*mm, 10*mm, "MS General Surgery Exam Answers | Q62–81 | Bailey & Love")
    canvas.drawRightString(W - 20*mm, 10*mm, f"Page {doc.page}")
    canvas.restoreState()


def main():
    doc = SimpleDocTemplate(
        OUTPUT,
        pagesize=A4,
        leftMargin=10*mm,
        rightMargin=10*mm,
        topMargin=10*mm,
        bottomMargin=18*mm,
        title="MS General Surgery – Exam Answers Q62-81",
        author="Orris AI",
    )
    content = build_content()
    doc.build(content, onFirstPage=add_page_number, onLaterPages=add_page_number)
    print(f"PDF generated: {OUTPUT}")

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

cd /home/daytona/workspace/ms-surgery-exam && python generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/ms-surgery-exam/MS_Surgery_Exam_Answers_Q62-81.pdf

Your PDF is ready! Download it here:

MS Surgery Exam Answers Q62 81

PDF Document · PDF


Here's what's inside for each of your 20 questions (Q62–81):
Q#TopicKey Scoring Points Covered
62Post-op Ventilatory SupportIndications, modes (CMV/SIMV/PSV/CPAP), settings (6 mL/kg), weaning (RSBI <105)
63Triage in Disaster / START / SALTStep-by-step START algorithm, colour codes, SALT phases, polytrauma definition
64Coagulopathy of Trauma & DCRLethal triad, ATC mechanism, 1:1:1 MTP, TXA (CRASH-2), permissive hypotension, 3-phase DCS
65+66GCS in Adults & ChildrenFull GCS table, paediatric modifications, severity classification, failovers/limitations
67Transient LOC after RTAConcussion vs EDH/SDH, NICE CT criteria, C-spine, management algorithm
68Chest Trauma ComplicationsATOM-FC mnemonic, early vs late complications, ICC criteria, thoracotomy indications
69Dangerous Dozen6 Immediate (table with Dx & Rx) + 6 Potential life-threatening injuries
70Flail ChestParadox + pendelluft physiology, 3 types, epidural analgesia, IPPV criteria, ORIF
71+72Haemopneumothorax & UWSDICC insertion, thoracotomy criteria, UWSD principle, swinging, clamping rules
73NOMAT Blunt Abdominal TraumaFAST scan, NOM criteria, success rates by organ, failure indicators
74Splenic InjuryAAST Grades I–V, angioembolization, splenectomy, OPSI vaccines/prophylaxis
75Shocked Blunt Abdominal TraumaATLS resuscitation, Class I–IV haemorrhage table, FAST algorithm, decision tree
76Diagnostic ModalitiesFAST, CT, DPL, CXR, laparoscopy, angiography - advantages/disadvantages table
77Laparotomy ApproachesIndications, midline incision, damage control, Pringle manoeuvre, retroperitoneal zones
78Liver Injury GradesAAST I–VI table, NOM/angioembolization/surgery algorithm, Quincke's triad
79Duodenal InjuriesAAST grading, pyloric exclusion technique, Kocher manoeuvre, missed injury signs
80Pancreatic TraumaAAST grading, amylase limitations, MRCP/ERCP, duct injury = key decision
81Pancreaticoduodenal InjuryStaged damage control, Whipple, pyloric exclusion, complication profile
Each answer is formatted with:
  • Navy question header with exam year tags
  • Colour-coded tables for grading systems
  • Red star key points (★) highlighting the highest-scoring facts
  • Mnemonics (ATOM-FC, START steps, etc.)
  • Reference footer: Bailey & Love 27th Ed, ATLS 10th Ed, CRASH-2, PROPPR trial
This is a shared conversation. Sign in to Orris to start your own chat.