Hypoxic pulmonary vasoconstriction

Reading File
Finding Sources
Finding Sources
Searching PubMed

"hypoxic pulmonary vasoconstriction" mechanism

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Loading Image
I now have everything needed for a comprehensive answer. Here it is:

Hypoxic Pulmonary Vasoconstriction (HPV)

Definition and Unique Nature

HPV is a compensatory reflex in which pulmonary vascular smooth muscle contracts in response to alveolar hypoxia, raising local vascular resistance and diverting blood flow away from poorly ventilated lung regions toward better-oxygenated ones. This optimizes ventilation-perfusion (V/Q) matching and arterial oxygenation.
What makes HPV unique: systemic vessels (coronary, cerebral, skeletal muscle) dilate in response to hypoxia, whereas the pulmonary vasculature constricts. This is the opposite response, serving an entirely different purpose - matching perfusion to ventilation rather than maximizing blood flow to hypoxic tissue.
  • Murray & Nadel's Textbook of Respiratory Medicine
  • Miller's Anesthesia, 10e

Stimulus

  • HPV is triggered when alveolar O₂ tension (PAO₂) falls below ~60 mmHg
  • The response is maximal when PAO₂ is approximately 30 mmHg
  • It is the alveolar PO₂, not pulmonary arterial blood PO₂, that primarily drives HPV - this has been proven by perfusing lungs with high-PO₂ blood while keeping alveolar PO₂ low: vasoconstriction still occurs
  • Mixed venous hypoxia is a weaker stimulus than alveolar hypoxia
  • HPV is more potent when it affects a smaller lung region - in global hypoxia (e.g., high altitude), the response is generalized and weaker

Site of Action

The primary site is the small pulmonary arteries and arterioles (precapillary). Both arteries and veins can constrict, but the small arteries show the greatest and most consistent response. This precapillary localization has been confirmed by demonstrating that HPV occurs with forward (pulmonary artery) perfusion but not retrograde (left atrial) perfusion of isolated lungs.

Cellular Mechanism

HPV is an intrinsic property of pulmonary vascular smooth muscle cells (VSMCs) - it does not require neural connections, as shown by its persistence in isolated excised lungs and in transplanted lungs lacking autonomic innervation.
Two major competing hypotheses exist, both placing the oxygen sensor in mitochondrial electron transport chain complex III:

1. Redox Hypothesis

  • Hypoxia → decreased ROS generation by mitochondria → less oxidized intracellular redox environment
  • Sulfhydryl groups on voltage-gated K⁺ channels (Kv1.5) become reduced → K⁺ channels close
  • Membrane depolarization → opening of voltage-dependent Ca²⁺ channels → Ca²⁺ influx → smooth muscle contraction

2. ROS Hypothesis

  • Hypoxia → increased ROS from mitochondrial complex III → released into cytosol
  • ROS stimulate Ca²⁺ influx through non-selective cation channels and Ca²⁺ release from the sarcoplasmic reticulum via ryanodine receptors
  • ROS also activate RhoA/Rho-kinase (ROCK) → phosphorylation of myosin light chain → increased Ca²⁺ sensitivity of myofilaments → augmented contraction even at baseline Ca²⁺ levels
Both hypotheses have experimental support; the controversy may partly reflect different methodologies. In practice, both K⁺ channel inhibition and Ca²⁺ sensitization contribute to the final contractile response.
Additional mediators identified:
  • Connexin 40-mediated retrograde endothelial signal conduction for O₂ sensing
  • Ca²⁺ influx at TRPV4 channels on pulmonary arterioles (required for HPV)

Endothelium-Derived Modulators

MediatorEffect on HPV
Nitric oxide (NO)Inhibits HPV (vasodilatory); NO synthesis inhibitors augment HPV; inhaled NO (~20 ppm) reduces HPV
Endothelins (from pulmonary endothelial cells)Vasoconstrictor peptides that augment HPV
ProstacyclinVasodilatory; modulates HPV

Modulating Factors

FactorEffect on HPV
Metabolic acidosisEnhances HPV
Metabolic alkalosisAttenuates HPV
Respiratory acidosis (CO₂)Little direct effect; acidosis component augments
Respiratory alkalosisBlunts HPV
HypercapniaAugments HPV (reduces NO, acidosis)
Sympathetic activationEnhances HPV
TemperatureModifies HPV
Size of hypoxic zoneLarger zone = stronger global HPV

Physiological Roles

1. V/Q optimization in diseased lung: HPV is most beneficial in patchy disease (pneumonia, atelectasis, ARDS, reactive airway disease). It diverts blood from underventilated alveoli to well-ventilated zones, limiting the fall in arterial PO₂. A clinical corollary: certain bronchodilators used in asthma can reduce HPV and paradoxically worsen arterial PO₂ by increasing blood flow to poorly ventilated areas.
2. Fetal circulation: HPV is particularly important in fetal life when the lungs do not exchange gas. It keeps pulmonary vascular resistance high, so that only ~15% of cardiac output traverses the lung before birth. At birth, oxygenation of alveoli reverses HPV, dramatically reducing pulmonary vascular resistance.
3. One-lung ventilation (OLV): During thoracic surgery, HPV in the collapsed (non-ventilated) lung reduces perfusion to ~30% of cardiac output, protecting arterial oxygenation.

Radiographic Demonstration of HPV

The image below (from Miller's Anesthesia) shows pulmonary angiography during one-lung ventilation:
Radiographic demonstration of HPV - Panel A shows absent microvascular perfusion to the right (non-ventilated) lung; Panel B shows restoration of symmetric bilateral perfusion after two-lung ventilation is resumed
(A) During isolated left-lung ventilation: selective microvascular perfusion to the ventilated left lung only; the right (hypoxic, non-ventilated) lung shows absent peripheral microvascular filling due to HPV. (B) After resuming two-lung ventilation: symmetric bilateral microvascular perfusion is restored as HPV is released.
  • Miller's Anesthesia, 10e, Fig. 19.10

HPV and Anesthesia

Volatile (inhaled) anesthetics attenuate HPV - this is clinically important because it worsens V/Q mismatch and can reduce arterial oxygenation, especially during OLV.
  • All volatile agents dilate pulmonary vasculature by reducing free cytosolic Ca²⁺ and inhibiting myofilament Ca²⁺ sensitivity
  • Mechanism of HPV inhibition: may involve arachidonic acid metabolites, endothelial vasodilators, inhibition of cGMP accumulation, and K⁺ channel modulation
  • Older agents (halothane, isoflurane, fluroxene, N₂O) were thought to significantly inhibit HPV
  • Newer volatile agents (sevoflurane, desflurane) have little clinically significant effect on HPV in vivo, making them preferred for thoracic procedures
  • Intravenous anesthetics (propofol, opioids) generally do not inhibit HPV
  • Ca²⁺ channel blockers combined with volatile anesthetics can reduce HPV by an additional 40%

Chronic HPV and Pulmonary Hypertension

Continuous or intermittent HPV - as in chronic obstructive pulmonary disease (COPD), interstitial pulmonary fibrosis (IPF), or high-altitude residence - drives vascular remodeling: medial hypertrophy of pulmonary arteries, intimal changes, and progressive pulmonary hypertension (PH). This is the most potent mechanism underlying PH in chronic lung disease.
Key points:
  • Even brief hypoxia (8 hours) in healthy volunteers raised PVR that did not normalize after 2 hours of normoxia
  • In high-altitude natives, structural vascular changes may persist even after 2 years at low altitude
  • Hypercapnia and acidemia (common in COPD) worsen HPV and PH, unlike high-altitude dwellers who hyperventilate and have hypocapnia, partially explaining why the latter group rarely develops severe PH
  • Individual responses to hypoxia vary widely - some show mPAP rise to 40 mmHg while others show minimal response, possibly reflecting heritable differences in O₂ sensing or vascular reactivity

Sources: Murray & Nadel's Textbook of Respiratory Medicine | Miller's Anesthesia, 10e

Create a clinical reference guide on HPV management in one-lung ventilation

Asking for Preferences
Finding Sources
Finding Sources
Searching PubMed

"one-lung ventilation" AND "hypoxic pulmonary vasoconstriction"

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/olv-hpv-guide && ls /home/daytona/workspace/olv-hpv-guide/

Writing File

~/olv-hpv-guide/generate_guide.py

#!/usr/bin/env python3
"""
Clinical Reference Guide: HPV Management in One-Lung Ventilation
Generated for Anesthesiologists / Residents
"""

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.units import cm
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 Flowable

OUTPUT = "/home/daytona/workspace/olv-hpv-guide/HPV_OLV_Clinical_Reference_Guide.pdf"

# ─── Color palette ───────────────────────────────────────────────────────────
NAVY      = colors.HexColor("#1A2E4A")
TEAL      = colors.HexColor("#0D7377")
LIGHT_TEAL = colors.HexColor("#E8F5F5")
AMBER     = colors.HexColor("#E8720C")
AMBER_BG  = colors.HexColor("#FEF3EC")
RED       = colors.HexColor("#C0392B")
RED_BG    = colors.HexColor("#FDEDEC")
GREEN     = colors.HexColor("#1E8449")
GREEN_BG  = colors.HexColor("#EAFAF1")
GREY      = colors.HexColor("#7F8C8D")
LIGHT_GREY = colors.HexColor("#F2F4F4")
DARK_TEXT  = colors.HexColor("#1C2833")
WHITE     = colors.white

W, H = A4  # 595.27 x 841.89

# ─── Document setup ───────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    topMargin=2.5*cm,
    bottomMargin=2.0*cm,
    leftMargin=2.0*cm,
    rightMargin=2.0*cm,
    title="HPV Management in One-Lung Ventilation – Clinical Reference Guide",
    author="Orris Medical Reference",
    subject="Thoracic Anesthesia",
)

# ─── Styles ──────────────────────────────────────────────────────────────────
base = getSampleStyleSheet()

def style(name, **kwargs):
    return ParagraphStyle(name, **kwargs)

S = {
    "cover_title": style("cover_title",
        fontSize=28, textColor=WHITE, fontName="Helvetica-Bold",
        leading=34, alignment=TA_CENTER, spaceAfter=6),
    "cover_sub": style("cover_sub",
        fontSize=13, textColor=colors.HexColor("#BDE3E4"), fontName="Helvetica",
        alignment=TA_CENTER, leading=18),
    "cover_meta": style("cover_meta",
        fontSize=10, textColor=colors.HexColor("#BDE3E4"), fontName="Helvetica",
        alignment=TA_CENTER, leading=14),

    "h1": style("h1",
        fontSize=16, textColor=WHITE, fontName="Helvetica-Bold",
        leading=20, spaceBefore=0, spaceAfter=0),
    "h2": style("h2",
        fontSize=12, textColor=NAVY, fontName="Helvetica-Bold",
        leading=16, spaceBefore=10, spaceAfter=4),
    "h3": style("h3",
        fontSize=10.5, textColor=TEAL, fontName="Helvetica-Bold",
        leading=14, spaceBefore=8, spaceAfter=3),
    "body": style("body",
        fontSize=9.5, textColor=DARK_TEXT, fontName="Helvetica",
        leading=14, spaceAfter=4, alignment=TA_JUSTIFY),
    "body_sm": style("body_sm",
        fontSize=8.5, textColor=DARK_TEXT, fontName="Helvetica",
        leading=12, spaceAfter=3),
    "bullet": style("bullet",
        fontSize=9.5, textColor=DARK_TEXT, fontName="Helvetica",
        leading=14, spaceAfter=3, leftIndent=14, firstLineIndent=-10),
    "bullet_sm": style("bullet_sm",
        fontSize=8.5, textColor=DARK_TEXT, fontName="Helvetica",
        leading=12, spaceAfter=2, leftIndent=14, firstLineIndent=-10),
    "table_hdr": style("table_hdr",
        fontSize=9, textColor=WHITE, fontName="Helvetica-Bold",
        leading=12, alignment=TA_CENTER),
    "table_cell": style("table_cell",
        fontSize=8.8, textColor=DARK_TEXT, fontName="Helvetica",
        leading=12, alignment=TA_LEFT),
    "table_cell_c": style("table_cell_c",
        fontSize=8.8, textColor=DARK_TEXT, fontName="Helvetica",
        leading=12, alignment=TA_CENTER),
    "caption": style("caption",
        fontSize=7.5, textColor=GREY, fontName="Helvetica-Oblique",
        leading=10, alignment=TA_CENTER),
    "footer": style("footer",
        fontSize=7.5, textColor=GREY, fontName="Helvetica",
        alignment=TA_CENTER, leading=10),
    "alert_title": style("alert_title",
        fontSize=10, fontName="Helvetica-Bold", leading=14),
    "alert_body": style("alert_body",
        fontSize=9, fontName="Helvetica", leading=13),
    "source": style("source",
        fontSize=7.5, textColor=GREY, fontName="Helvetica-Oblique",
        leading=10, alignment=TA_LEFT),
}

# ─── Helper flowables ─────────────────────────────────────────────────────────
def section_header(text, color=NAVY):
    """Full-width colored header bar."""
    data = [[Paragraph(text, S["h1"])]]
    t = Table(data, colWidths=[doc.width])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("TOPPADDING", (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING", (0,0), (-1,-1), 12),
        ("RIGHTPADDING", (0,0), (-1,-1), 12),
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [color]),
    ]))
    return t

def alert_box(title, items, bg=AMBER_BG, border=AMBER, title_color=AMBER):
    """Colored alert / info box."""
    body_lines = "".join(f"<bullet>&#8226;</bullet> {i}<br/>" for i in items)
    data = [[
        Paragraph(f'<font color="{title_color.hexval()}">{title}</font>', S["alert_title"]),
    ],[
        Paragraph(body_lines, S["alert_body"]),
    ]]
    t = Table(data, colWidths=[doc.width])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), bg),
        ("LINEABOVE", (0,0), (-1,0), 2, border),
        ("TOPPADDING", (0,0), (-1,0), 8),
        ("BOTTOMPADDING", (0,-1), (-1,-1), 8),
        ("LEFTPADDING", (0,0), (-1,-1), 12),
        ("RIGHTPADDING", (0,0), (-1,-1), 12),
    ]))
    return t

def info_box(title, items, bg=LIGHT_TEAL, border=TEAL, title_color=TEAL):
    return alert_box(title, items, bg, border, title_color)

def two_col(left_items, right_items, left_title="", right_title=""):
    """Two-column layout using a 2-cell table."""
    col_w = (doc.width - 0.3*cm) / 2

    def build_cell(title, items):
        paras = []
        if title:
            paras.append(Paragraph(title, S["h3"]))
        for item in items:
            paras.append(item)
        return paras

    lc = build_cell(left_title, left_items)
    rc = build_cell(right_title, right_items)

    data = [[lc, rc]]
    t = Table(data, colWidths=[col_w, col_w], spaceBefore=4, spaceAfter=6)
    t.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "TOP"),
        ("LEFTPADDING", (0,0), (-1,-1), 0),
        ("RIGHTPADDING", (0,0), (-1,-1), 4),
        ("TOPPADDING", (0,0), (-1,-1), 0),
        ("BOTTOMPADDING", (0,0), (-1,-1), 0),
    ]))
    return t

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

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

def b(text):
    return f"<b>{text}</b>"

def bullet(text):
    return Paragraph(f"&#8226; {text}", S["bullet"])

def bullet_sm(text):
    return Paragraph(f"&#8226; {text}", S["bullet_sm"])

def subbullet(text):
    return Paragraph(f"  &#8212; {text}", S["bullet_sm"])

# ─── Cover page ───────────────────────────────────────────────────────────────
def cover_page():
    els = []

    # Top banner
    banner_data = [[
        Paragraph("CLINICAL REFERENCE GUIDE", S["cover_sub"]),
        Paragraph("HPV Management in One-Lung Ventilation", S["cover_title"]),
        Paragraph("For Anesthesiologists &amp; Residents · Thoracic Surgery", S["cover_sub"]),
        Spacer(1, 0.4*cm),
        Paragraph("Miller's Anesthesia 10e · Murray &amp; Nadel · Barash Clinical Anesthesia 9e · Morgan &amp; Mikhail 7e", S["cover_meta"]),
        Spacer(1, 0.2*cm),
        Paragraph("July 2026", S["cover_meta"]),
    ]]
    banner = Table(banner_data, colWidths=[doc.width + 4*cm])
    banner.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), NAVY),
        ("TOPPADDING", (0,0), (-1,-1), 32),
        ("BOTTOMPADDING", (0,0), (-1,-1), 32),
        ("LEFTPADDING", (0,0), (-1,-1), 20),
        ("RIGHTPADDING", (0,0), (-1,-1), 20),
        ("ALIGN", (0,0), (-1,-1), "CENTER"),
    ]))
    els.append(banner)
    els.append(sp(16))

    # "At a glance" boxes
    els.append(Paragraph("GUIDE AT A GLANCE", ParagraphStyle("glance_hdr",
        fontSize=10, textColor=GREY, fontName="Helvetica-Bold",
        alignment=TA_CENTER, spaceAfter=8)))

    at_glance = [
        ("01", "Physiology", "HPV mechanism, stimulus, magnitude, time course"),
        ("02", "Predictors", "Risk factors for OLV hypoxemia"),
        ("03", "Prevention", "Anaesthetic choice, lung denitrogenation, positioning"),
        ("04", "Ventilation", "Protective strategy: VT, PEEP, DP, PCV vs VCV"),
        ("05", "Step-Up Rx", "Structured treatment ladder for intraoperative hypoxemia"),
        ("06", "Drug Guide", "Agents that inhibit vs preserve HPV"),
        ("07", "Cardiac Output", "CO-HPV interaction and hemodynamic targets"),
        ("08", "Special Cases", "COPD, right-sided thoracotomy, post-pneumonectomy"),
    ]

    rows = []
    for num, title, desc in at_glance:
        rows.append([
            Paragraph(f'<font color="{TEAL.hexval()}" size="18"><b>{num}</b></font>',
                      ParagraphStyle("gn", fontSize=18, textColor=TEAL,
                                     fontName="Helvetica-Bold", alignment=TA_CENTER)),
            Paragraph(f'<b>{title}</b><br/><font size="8" color="{GREY.hexval()}">{desc}</font>',
                      ParagraphStyle("gt", fontSize=9.5, textColor=DARK_TEXT,
                                     fontName="Helvetica", leading=13)),
        ])

    col_w = (doc.width - 0.4*cm) / 2
    paired_rows = []
    for i in range(0, len(rows), 2):
        if i+1 < len(rows):
            paired_rows.append([rows[i][0], rows[i][1], rows[i+1][0], rows[i+1][1]])
        else:
            paired_rows.append([rows[i][0], rows[i][1], "", ""])

    glance_t = Table(paired_rows,
                     colWidths=[1.2*cm, col_w - 1.2*cm, 1.2*cm, col_w - 1.2*cm],
                     rowHeights=1.4*cm)
    glance_t.setStyle(TableStyle([
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("ROWBACKGROUNDS", (0,0), (-1,-1), [LIGHT_GREY, WHITE]),
        ("LINEBELOW", (0,0), (-1,-2), 0.5, colors.HexColor("#D5D8DC")),
    ]))
    els.append(glance_t)
    els.append(sp(16))

    # Disclaimer
    disc = Table([[Paragraph(
        "<b>DISCLAIMER:</b> This guide is intended as an educational reference for "
        "qualified healthcare professionals. Clinical decisions must always be individualised "
        "based on patient status, institutional protocols, and current guidelines. "
        "Drug doses and thresholds are approximate; verify with primary sources before use.",
        ParagraphStyle("disc", fontSize=8, textColor=GREY, fontName="Helvetica",
                       leading=11, alignment=TA_JUSTIFY)
    )]], colWidths=[doc.width])
    disc.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), LIGHT_GREY),
        ("TOPPADDING", (0,0), (-1,-1), 8),
        ("BOTTOMPADDING", (0,0), (-1,-1), 8),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
    ]))
    els.append(disc)
    els.append(PageBreak())
    return els

# ─── Section 1: Physiology ────────────────────────────────────────────────────
def section_physiology():
    els = []
    els.append(section_header("01  PHYSIOLOGY OF HPV IN ONE-LUNG VENTILATION"))
    els.append(sp(8))

    els.append(Paragraph("What is HPV?", S["h2"]))
    els.append(Paragraph(
        "Hypoxic pulmonary vasoconstriction (HPV) is an intrinsic reflex of pulmonary "
        "vascular smooth muscle cells (VSMCs) that constricts small pulmonary arteries and "
        "arterioles when alveolar O&#8322; tension (P<sub>A</sub>O&#8322;) falls. "
        "Unlike systemic vessels - which dilate under hypoxia to maximise tissue O&#8322; "
        "delivery - the pulmonary vasculature constricts, thereby diverting blood away from "
        "hypoventilated zones toward well-ventilated alveoli. This unique behaviour optimises "
        "ventilation-perfusion (V/Q) matching and is the principal physiological defence "
        "against intraoperative hypoxaemia during OLV.",
        S["body"]))

    # Stimulus / Magnitude two-col
    left = [
        Paragraph("Stimulus &amp; Threshold", S["h3"]),
        bullet(f"{b('Primary trigger:')} Alveolar PO&#8322; (P<sub>A</sub>O&#8322;) &lt; 60 mmHg"),
        bullet(f"{b('Maximal response:')} P<sub>A</sub>O&#8322; &#8776; 30 mmHg"),
        bullet(f"{b('Secondary trigger:')} Mixed venous PO&#8322; (weaker signal)"),
        bullet(f"{b('HPV begins within seconds')} of alveolar O&#8322; reduction"),
        bullet("Two-phase time course: rapid initial rise then slower sustained phase"),
        bullet("After 8 h of hypoxia, PVR may not normalise for hours post-exposure"),
    ]

    right = [
        Paragraph("Magnitude During OLV", S["h3"]),
        bullet("HPV can reduce blood flow to the non-ventilated lung by up to <b>50%</b>"),
        bullet("Without HPV, non-ventilated lung receives ~35-45% of CO (obligatory shunt)"),
        bullet("With HPV active, this falls to ~20-25%"),
        bullet("Lung collapse itself also raises PVR in the non-ventilated lung (mechanical effect)"),
        bullet("Net shunt during OLV is typically <b>20-30%</b> with modern anaesthetic management"),
        bullet(f"{b('Right thoracotomy:')} larger shunt (right lung = 55% normal perfusion vs 45% left)"),
    ]

    els.append(two_col(left, right))

    els.append(Paragraph("Cellular Mechanism", S["h2"]))
    mech_data = [
        [Paragraph(b("Step"), S["table_hdr"]),
         Paragraph(b("Event"), S["table_hdr"]),
         Paragraph(b("Key Mediators"), S["table_hdr"])],
        [Paragraph("1", S["table_cell_c"]),
         Paragraph("Alveolar O&#8322; falls → mitochondrial O&#8322; sensing", S["table_cell"]),
         Paragraph("Complex III of electron transport chain", S["table_cell"])],
        [Paragraph("2a", S["table_cell_c"]),
         Paragraph("<b>Redox hypothesis:</b> ↓ ROS → reduced sulfhydryl groups on Kv1.5", S["table_cell"]),
         Paragraph("Kv1.5 voltage-gated K&#8314; channel", S["table_cell"])],
        [Paragraph("2b", S["table_cell_c"]),
         Paragraph("<b>ROS hypothesis:</b> ↑ ROS from complex III → Ca&#178;&#8314; release from SR + influx", S["table_cell"]),
         Paragraph("Ryanodine receptors, non-selective cation channels", S["table_cell"])],
        [Paragraph("3", S["table_cell_c"]),
         Paragraph("K&#8314; channel closure → membrane depolarisation → voltage-gated Ca&#178;&#8314; channel opening", S["table_cell"]),
         Paragraph("L-type Ca&#178;&#8314; channels", S["table_cell"])],
        [Paragraph("4", S["table_cell_c"]),
         Paragraph("↑ intracellular Ca&#178;&#8314; → smooth muscle contraction", S["table_cell"]),
         Paragraph("Myosin light chain kinase", S["table_cell"])],
        [Paragraph("5", S["table_cell_c"]),
         Paragraph("RhoA/ROCK pathway → ↑ Ca&#178;&#8314; sensitisation of myofilaments", S["table_cell"]),
         Paragraph("RhoA, Rho-kinase (ROCK)", S["table_cell"])],
        [Paragraph("6", S["table_cell_c"]),
         Paragraph("Connexin-40 retrograde endothelial signal + TRPV4 Ca&#178;&#8314; influx (arterioles)", S["table_cell"]),
         Paragraph("Connexin-40, TRPV4", S["table_cell"])],
    ]
    mech_t = Table(mech_data, colWidths=[1.0*cm, 9.0*cm, 5.2*cm],
                   repeatRows=1, spaceBefore=4, spaceAfter=6)
    mech_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ]))
    els.append(mech_t)

    # Endothelial modulators
    els.append(Paragraph("Endothelial Modulators of HPV", S["h2"]))
    mod_data = [
        [Paragraph(b("Mediator"), S["table_hdr"]),
         Paragraph(b("Origin"), S["table_hdr"]),
         Paragraph(b("Effect on HPV"), S["table_hdr"]),
         Paragraph(b("Clinical Relevance"), S["table_hdr"])],
        [Paragraph("Nitric oxide (NO)", S["table_cell"]),
         Paragraph("Endothelium (eNOS)", S["table_cell"]),
         Paragraph('<font color="#C0392B">↓ Inhibits</font>', S["table_cell_c"]),
         Paragraph("Inhaled NO (20 ppm) reduces HPV; vasodilators ↓ NO → worsen V/Q", S["table_cell"])],
        [Paragraph("Endothelin-1 (ET-1)", S["table_cell"]),
         Paragraph("Pulmonary endothelium", S["table_cell"]),
         Paragraph('<font color="#1E8449">↑ Augments</font>', S["table_cell_c"]),
         Paragraph("ET receptor antagonists used in PAH; relevant in chronic hypoxia", S["table_cell"])],
        [Paragraph("Prostacyclin (PGI&#8322;)", S["table_cell"]),
         Paragraph("Endothelium", S["table_cell"]),
         Paragraph('<font color="#C0392B">↓ Inhibits</font>', S["table_cell_c"]),
         Paragraph("Bronchodilators releasing PGI&#8322; may worsen PaO&#8322; in asthma", S["table_cell"])],
    ]
    mod_t = Table(mod_data,
                  colWidths=[3.2*cm, 3.2*cm, 2.8*cm, 6.0*cm],
                  repeatRows=1, spaceBefore=4, spaceAfter=6)
    mod_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), TEAL),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ]))
    els.append(mod_t)
    els.append(sp(4))
    els.append(Paragraph(
        "Sources: Miller's Anesthesia 10e (Ch. 19, 49) · Murray &amp; Nadel Respiratory Medicine · "
        "Barash Clinical Anesthesia 9e (Ch. 38)",
        S["source"]))
    return els

# ─── Section 2: Predictors ────────────────────────────────────────────────────
def section_predictors():
    els = []
    els.append(PageBreak())
    els.append(section_header("02  PREDICTORS OF HYPOXAEMIA DURING OLV"))
    els.append(sp(8))

    els.append(Paragraph(
        "Intraoperative hypoxaemia (SpO&#8322; &lt; 90%, PaO&#8322; &lt; 60 mmHg) during OLV is "
        "predictable in the majority of cases. Historical incidence was 20-25%; modern practice "
        "achieves &lt;5% with optimised technique. Key risk factors are listed below.",
        S["body"]))
    els.append(sp(4))

    pred_data = [
        [Paragraph(b("Risk Factor"), S["table_hdr"]),
         Paragraph(b("Direction"), S["table_hdr"]),
         Paragraph(b("Mechanism"), S["table_hdr"])],
        [Paragraph("Right-sided thoracotomy", S["table_cell"]),
         Paragraph('<font color="#C0392B">Higher risk</font>', S["table_cell_c"]),
         Paragraph("Right lung normally ~55% of total perfusion → larger obligatory shunt; mean PaO&#8322; ~100 mmHg lower vs left", S["table_cell"])],
        [Paragraph("Normal preop PFTs", S["table_cell"]),
         Paragraph('<font color="#C0392B">Higher risk</font>', S["table_cell_c"]),
         Paragraph("No pre-existing redistribution; operative lung has near-normal perfusion that must be overcome by HPV", S["table_cell"])],
        [Paragraph("Supine position during OLV", S["table_cell"]),
         Paragraph('<font color="#C0392B">Higher risk</font>', S["table_cell_c"]),
         Paragraph("Lateral position provides gravity-assisted redistribution to dependent (ventilated) lung", S["table_cell"])],
        [Paragraph("Low PaO&#8322; on two-lung ventilation", S["table_cell"]),
         Paragraph('<font color="#C0392B">Higher risk</font>', S["table_cell_c"]),
         Paragraph("Reduced reserve; baseline V/Q mismatch", S["table_cell"])],
        [Paragraph("Low preop FEV&#8321; (if operative lung)", S["table_cell"]),
         Paragraph('<font color="#1E8449">Lower risk</font>', S["table_cell_c"]),
         Paragraph("Pre-existing hypoperfusion of diseased operative lung → less shunt during OLV", S["table_cell"])],
        [Paragraph("V/Q scan: high perfusion to operative lung", S["table_cell"]),
         Paragraph('<font color="#C0392B">Higher risk</font>', S["table_cell_c"]),
         Paragraph("Greater shunt fraction when that lung is collapsed; shunt correlates with fractional perfusion of ventilated lung", S["table_cell"])],
        [Paragraph("COPD (dependent lung)", S["table_cell"]),
         Paragraph('<font color="#E8720C">Variable</font>', S["table_cell_c"]),
         Paragraph("Faster desaturation during isovolemic haemodilution; gas trapping may impair oxygenation", S["table_cell"])],
        [Paragraph("High cardiac output / vasodilator use", S["table_cell"]),
         Paragraph('<font color="#C0392B">Higher risk</font>', S["table_cell_c"]),
         Paragraph("Passive distension of non-ventilated lung vasculature overcomes HPV; vasodilators (GTN, SNP) attenuate HPV", S["table_cell"])],
    ]
    pred_t = Table(pred_data, colWidths=[4.5*cm, 2.5*cm, 8.2*cm],
                   repeatRows=1, spaceBefore=4, spaceAfter=6)
    pred_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ]))
    els.append(pred_t)

    els.append(info_box(
        "PREOPERATIVE RISK ASSESSMENT",
        [
            "Order a preoperative V/Q perfusion scan for borderline candidates: "
            "fractional perfusion of the ventilated lung strongly predicts intraoperative PaO&#8322;",
            "Note baseline SpO&#8322;, FEV&#8321;/FVC, side of operation and comorbidities before the case",
            "Higher-risk patients (right-sided, normal PFTs, low baseline PaO&#8322;) warrant arterial line for continuous monitoring",
            "Consider TIVA as baseline anaesthetic in high-risk cases to preserve HPV",
        ]
    ))
    els.append(sp(4))
    els.append(Paragraph("Sources: Miller's Anesthesia 10e (Ch. 49) · Barash Clinical Anesthesia 9e", S["source"]))
    return els

# ─── Section 3: Prevention ────────────────────────────────────────────────────
def section_prevention():
    els = []
    els.append(PageBreak())
    els.append(section_header("03  PREVENTION OF HYPOXAEMIA"))
    els.append(sp(8))

    left = [
        Paragraph("Pre-OLV Optimisation", S["h3"]),
        bullet(f"{b('Denitrogenation:')} Ventilate operative lung with FiO&#8322; 1.0 immediately before collapsing it. Nitrogen delays collapse due to low blood-gas solubility - particularly problematic in VATS and emphysema."),
        sp(3),
        bullet(f"{b('Recruitment of dependent lung:')} Apply sustained inflation (20 cmH&#8322;O for 15-20 s) to the dependent lung immediately after initiating OLV to clear pre-existing atelectasis."),
        sp(3),
        bullet(f"{b('Position:')} Lateral decubitus is standard. Gravity assists redistribution of cardiac output to dependent (ventilated) lung. Avoid supine OLV when possible."),
        sp(3),
        bullet(f"{b('DLT position:')} Confirm with fiberoptic bronchoscopy after placement and again after lateral positioning - surgical manipulation displaces tubes."),
    ]

    right = [
        Paragraph("Anaesthetic Choice", S["h3"]),
        bullet(f"{b('TIVA preferred in high-risk cases:')} Propofol + remifentanil/fentanyl does not inhibit HPV; provides better oxygenation in some studies."),
        sp(3),
        bullet(f"{b('Modern volatile agents (≤1 MAC):')} Isoflurane, sevoflurane, desflurane cause only ~20% inhibition of HPV at 1 MAC - a net ~4% increase in shunt, which is rarely clinically detectable."),
        sp(3),
        bullet(f"{b('Avoid N&#8322;O:')} Inhibits HPV, increases postoperative atelectasis (51% vs 24% with air/O&#8322;), and raises PA pressure in pulmonary hypertension."),
        sp(3),
        bullet(f"{b('Avoid vasodilators when possible:')} GTN, nitroprusside, dobutamine blunt HPV - avoid or minimise during OLV."),
        sp(3),
        bullet(f"{b('Dexmedetomidine adjunct:')} Reduces volatile anaesthetic requirement and has been shown to improve oxygenation during OLV."),
    ]
    els.append(two_col(left, right))

    els.append(alert_box(
        "AVOID DURING OLV - HPV INHIBITORS",
        [
            "Nitrous oxide (N&#8322;O) - inhibits HPV + raises PA pressures + increases postop atelectasis",
            "Nitroglycerin (GTN) and sodium nitroprusside (SNP) - direct pulmonary vasodilators",
            "High-dose volatile anaesthetics (>1 MAC) - dose-dependent HPV inhibition",
            "Dobutamine / high-dose inotropes - ↑ CO → passive distension overrides HPV",
            "Certain bronchodilators (PGI&#8322; releasers) in asthma - may increase flow to poorly ventilated zones",
        ],
        bg=RED_BG, border=RED, title_color=RED
    ))
    els.append(sp(4))
    els.append(Paragraph("Sources: Miller's Anesthesia 10e (Ch. 49) · Morgan &amp; Mikhail 7e · Barash 9e", S["source"]))
    return els

# ─── Section 4: Protective Ventilation ───────────────────────────────────────
def section_ventilation():
    els = []
    els.append(PageBreak())
    els.append(section_header("04  PROTECTIVE VENTILATION STRATEGY DURING OLV"))
    els.append(sp(8))

    els.append(Paragraph(
        "The anesthesiologist's dual goal during OLV is to: (1) maintain the ventilated "
        "(dependent) lung near its functional residual capacity (FRC) to minimise its PVR, "
        "and (2) maximise PVR in the non-ventilated lung by facilitating collapse and preserving HPV. "
        "PVR is a U-shaped function of lung volume - it is lowest at FRC and rises at both "
        "extremes (RV and TLC).",
        S["body"]))
    els.append(sp(4))

    param_data = [
        [Paragraph(b("Parameter"), S["table_hdr"]),
         Paragraph(b("Target"), S["table_hdr"]),
         Paragraph(b("Rationale / Evidence"), S["table_hdr"])],
        [Paragraph("Tidal Volume (VT)", S["table_cell"]),
         Paragraph("<b>4-6 mL/kg IBW</b>", S["table_cell_c"]),
         Paragraph("Low VT reduces VILI. &lt;3 mL/kg may cause lung derecruitment and hypoxaemia from atelectasis. Aim for the range that avoids both over-distension and derecruitment.", S["table_cell"])],
        [Paragraph("FiO&#8322;", S["table_cell"]),
         Paragraph("<b>1.0 standard</b><br/>0.5-0.8 in protective protocols", S["table_cell_c"]),
         Paragraph("FiO&#8322; 1.0 provides safety margin but may cause absorption atelectasis. Some centres use 80-100% targeting SpO&#8322; ≥ 94%.", S["table_cell"])],
        [Paragraph("PEEP (dependent lung)", S["table_cell"]),
         Paragraph("<b>5 cmH&#8322;O</b> baseline<br/>Titrated to DP", S["table_cell_c"]),
         Paragraph("Maintains alveolar recruitment. Individualised PEEP guided by driving pressure (DP) is superior to fixed PEEP in reducing postoperative pneumonia/ARDS (Barash RCT, n=292).", S["table_cell"])],
        [Paragraph("Plateau Pressure", S["table_cell"]),
         Paragraph("<b>&lt; 25 cmH&#8322;O</b>", S["table_cell_c"]),
         Paragraph("Limiting plateau pressure reduces barotrauma and VILI.", S["table_cell"])],
        [Paragraph("Peak Airway Pressure", S["table_cell"]),
         Paragraph("<b>&lt; 35 cmH&#8322;O</b>", S["table_cell_c"]),
         Paragraph("PCV may lower peak pressures vs VCV (but similar distal airway pressures); PCV preferred post-transplant, post-pneumonectomy, or with bronchial blocker.", S["table_cell"])],
        [Paragraph("Driving Pressure (DP = Pplat - PEEP)", S["table_cell"]),
         Paragraph("<b>Minimise DP</b><br/>Individualise PEEP", S["table_cell_c"]),
         Paragraph("DP most strongly associated with survival in ARDS (Amato meta-analysis, 3,562 pts). DP-guided PEEP during OLV reduces postoperative pulmonary complications vs fixed PEEP strategy.", S["table_cell"])],
        [Paragraph("Respiratory Rate", S["table_cell"]),
         Paragraph("<b>10-14 /min</b>", S["table_cell_c"]),
         Paragraph("Titrate to achieve acceptable PaCO&#8322;. Permissive hypercapnia acceptable in patients with normal SpO&#8322; and adequate minute ventilation.", S["table_cell"])],
        [Paragraph("PCV vs VCV", S["table_cell"]),
         Paragraph("<b>Either acceptable</b>", S["table_cell_c"]),
         Paragraph("PCV does not improve oxygenation vs VCV in most studies. PCV limits peak pressures but delivered VT varies with compliance changes - requires close monitoring.", S["table_cell"])],
    ]
    param_t = Table(param_data, colWidths=[3.8*cm, 3.8*cm, 7.6*cm],
                    repeatRows=1, spaceBefore=4, spaceAfter=6)
    param_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ]))
    els.append(param_t)

    els.append(info_box(
        "DRIVING PRESSURE - KEY CONCEPT",
        [
            "DP = Plateau pressure - PEEP = VT / Respiratory system compliance",
            "DP reflects the 'functional lung size' exposed to each tidal breath",
            "Goal: select PEEP level that produces the <b>lowest DP</b> - this avoids both atelectasis (too little PEEP) and overdistension (too much PEEP)",
            "Evidence: DP-guided PEEP during OLV (RCT, n=292) reduced postoperative pneumonia and ARDS vs conventional protective ventilation (Park et al.)",
        ]
    ))
    els.append(sp(4))
    els.append(Paragraph("Sources: Barash Clinical Anesthesia 9e (Ch. 38) · Miller's Anesthesia 10e (Ch. 49) · Morgan &amp; Mikhail 7e", S["source"]))
    return els

# ─── Section 5: Step-Up Treatment Ladder ─────────────────────────────────────
def section_stepup():
    els = []
    els.append(PageBreak())
    els.append(section_header("05  STEP-UP TREATMENT LADDER FOR INTRAOPERATIVE HYPOXAEMIA"))
    els.append(sp(8))

    els.append(Paragraph(
        "Acceptable SpO&#8322; during OLV: <b>&#8805; 90% (PaO&#8322; &gt; 60 mmHg)</b> in most patients. "
        "Higher targets required in coronary/cerebrovascular disease or anaemia. "
        "Brief periods of SpO&#8322; in the high 80s may be tolerated in otherwise healthy patients. "
        "Follow the step-up ladder below - initiate Step 1 first and escalate as needed.",
        S["body"]))
    els.append(sp(6))

    steps = [
        ("STEP 1", TEAL, "Verify DLT / Blocker Position",
         [
             "Fiberoptic bronchoscopy through the tracheal lumen - confirm cuff position relative to carina",
             "Suction both lumens to exclude secretion obstruction",
             "Reposition tube if displaced (common after surgical manipulation or lateral positioning)",
         ]),
        ("STEP 2", TEAL, "Increase FiO&#8322; to 1.0",
         [
             "Provides immediate reserve and partial relief",
             "May worsen absorption atelectasis in dependent lung (monitor closely)",
         ]),
        ("STEP 3", TEAL, "Recruitment Manoeuvre - Dependent (Ventilated) Lung",
         [
             "Sustained inflation: hold at 20 cmH&#8322;O for 15-20 seconds",
             "OR stepwise PEEP increments: +5 cmH&#8322;O q5 breaths until PEEP 20 cmH&#8322;O, plateau 40 cmH&#8322;O",
             "Caution: impaired venous return during RM may worsen CO and PaO&#8322; - monitor BP",
             "Follow RM with appropriate PEEP to sustain recruitment",
         ]),
        ("STEP 4", TEAL, "Optimise PEEP on Ventilated Lung",
         [
             "Titrate PEEP to achieve lowest driving pressure (DP = Pplat - PEEP)",
             "Insufficient PEEP: atelectasis and shunt in dependent lung",
             "Excessive PEEP: overdistension, raised PVR in dependent lung redirecting blood to non-ventilated lung",
         ]),
        ("STEP 5", AMBER, "CPAP 5-10 cmH&#8322;O to Non-Ventilated (Operative) Lung",
         [
             "Single most effective rescue manoeuvre for OLV hypoxaemia",
             "Apply 5-10 cmH&#8322;O CPAP with oxygen after a small inflation VT to the non-ventilated lung",
             "Maintains partial alveolar patency → allows O&#8322; uptake without full ventilation",
             "Caution in VATS: inflated operative lung impairs surgical visualisation - discuss with surgeon",
             "Insufflation of O&#8322; alone (without positive pressure) does NOT reliably improve PaO&#8322;",
             "Intermittent re-inflation of collapsed lung with O&#8322; also improves PaO&#8322;",
         ]),
        ("STEP 6", AMBER, "Clamp Pulmonary Artery (Pneumonectomy Cases)",
         [
             "During pneumonectomy: deliberate PA clamping eliminates shunt through operative lung",
             "Highly effective - essentially converts to single-lung physiology with zero operative lung flow",
         ]),
        ("STEP 7", RED, "Resume Two-Lung Ventilation",
         [
             "For severe refractory hypoxaemia - always an option in extremis",
             "Communicate with surgeon: intermittent bilateral inflation may be feasible",
             "Consider brief periods of 2-LV for recovery of SpO&#8322; before resuming OLV",
         ]),
    ]

    for step_label, color, title, points in steps:
        points_text = "".join(f"&#8226; {p}<br/>" for p in points)
        row_data = [[
            Paragraph(f'<font color="{WHITE.hexval()}"><b>{step_label}</b></font>',
                      ParagraphStyle("sl", fontSize=9, fontName="Helvetica-Bold",
                                     textColor=WHITE, alignment=TA_CENTER, leading=12)),
            [
                Paragraph(f'<b>{title}</b>',
                          ParagraphStyle("st", fontSize=9.5, fontName="Helvetica-Bold",
                                         textColor=DARK_TEXT, leading=13)),
                Paragraph(points_text,
                          ParagraphStyle("sp", fontSize=8.8, fontName="Helvetica",
                                         textColor=DARK_TEXT, leading=13, leftIndent=2)),
            ]
        ]]
        row_t = Table(row_data, colWidths=[1.4*cm, doc.width - 1.4*cm],
                      spaceBefore=2, spaceAfter=2)
        row_t.setStyle(TableStyle([
            ("BACKGROUND", (0,0), (0,-1), color),
            ("BACKGROUND", (1,0), (1,-1), LIGHT_GREY if color == TEAL else AMBER_BG if color == AMBER else RED_BG),
            ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
            ("TOPPADDING", (0,0), (-1,-1), 6),
            ("BOTTOMPADDING", (0,0), (-1,-1), 6),
            ("LEFTPADDING", (0,0), (0,0), 4),
            ("RIGHTPADDING", (0,0), (0,0), 4),
            ("LEFTPADDING", (1,0), (1,0), 8),
            ("LINEBELOW", (0,0), (-1,-1), 1, WHITE),
        ]))
        els.append(row_t)

    els.append(sp(8))
    els.append(alert_box(
        "EMERGENCY PROTOCOL - SpO&#8322; &lt; 85% NOT RESPONDING",
        [
            "Immediately resume two-lung ventilation",
            "FiO&#8322; 1.0 - confirm circuit connections and airway patency",
            "Bolus phenylephrine or vasopressor if haemodynamically unstable",
            "Rule out tension pneumothorax, endobronchial tube displacement, secretion plug",
            "Consider arterial blood gas for PaO&#8322;/PaCO&#8322; trend",
            "Alert surgeon and reassess urgency/feasibility of OLV continuation",
        ],
        bg=RED_BG, border=RED, title_color=RED
    ))
    els.append(sp(4))
    els.append(Paragraph("Sources: Miller's Anesthesia 10e (Ch. 49) · Morgan &amp; Mikhail 7e · Barash Clinical Anesthesia 9e (Ch. 38)", S["source"]))
    return els

# ─── Section 6: Drug Guide ────────────────────────────────────────────────────
def section_drugs():
    els = []
    els.append(PageBreak())
    els.append(section_header("06  DRUG REFERENCE: EFFECTS ON HPV"))
    els.append(sp(8))

    drug_data = [
        [Paragraph(b("Drug / Agent"), S["table_hdr"]),
         Paragraph(b("Class"), S["table_hdr"]),
         Paragraph(b("HPV Effect"), S["table_hdr"]),
         Paragraph(b("Magnitude"), S["table_hdr"]),
         Paragraph(b("Clinical Notes"), S["table_hdr"])],
        # Inhibitors
        [Paragraph("Halothane", S["table_cell"]),
         Paragraph("Volatile (old)", S["table_cell"]),
         Paragraph('<font color="#C0392B">Strong inhibition</font>', S["table_cell_c"]),
         Paragraph("Dose-dependent +++", S["table_cell_c"]),
         Paragraph("Historically contributed to high OLV hypoxaemia rates (1960-80s). Rarely used.", S["table_cell"])],
        [Paragraph("Enflurane", S["table_cell"]),
         Paragraph("Volatile (old)", S["table_cell"]),
         Paragraph('<font color="#C0392B">Moderate inhibition</font>', S["table_cell_c"]),
         Paragraph("++", S["table_cell_c"]),
         Paragraph("Greater inhibition than modern agents. Not in routine use.", S["table_cell"])],
        [Paragraph("Isoflurane ≤1 MAC", S["table_cell"]),
         Paragraph("Volatile (modern)", S["table_cell"]),
         Paragraph('<font color="#E8720C">Mild inhibition</font>', S["table_cell_c"]),
         Paragraph("~20% inhibition at 1 MAC", S["table_cell_c"]),
         Paragraph("Net shunt increase ~4% during OLV - below detection threshold in most studies. Acceptable for OLV.", S["table_cell"])],
        [Paragraph("Sevoflurane ≤1 MAC", S["table_cell"]),
         Paragraph("Volatile (modern)", S["table_cell"]),
         Paragraph('<font color="#E8720C">Mild inhibition</font>', S["table_cell_c"]),
         Paragraph("Equipotent to isoflurane", S["table_cell_c"]),
         Paragraph("Preferred agent for thoracic anaesthesia in many centres. Anti-inflammatory cytokine profile may reduce postoperative complications.", S["table_cell"])],
        [Paragraph("Desflurane ≤1 MAC", S["table_cell"]),
         Paragraph("Volatile (modern)", S["table_cell"]),
         Paragraph('<font color="#E8720C">Mild inhibition</font>', S["table_cell_c"]),
         Paragraph("Equipotent to isoflurane", S["table_cell_c"]),
         Paragraph("No significant difference from sevoflurane in OLV studies. Avoid in reactive airway disease.", S["table_cell"])],
        [Paragraph("Nitrous oxide (N&#8322;O)", S["table_cell"]),
         Paragraph("Inhalational", S["table_cell"]),
         Paragraph('<font color="#C0392B">Inhibits HPV</font>', S["table_cell_c"]),
         Paragraph("++", S["table_cell_c"]),
         Paragraph("<b>Avoid in thoracic surgery.</b> Also ↑ PA pressure, ↑ postop atelectasis (51% vs 24%), contraindicated in blebs/bullae.", S["table_cell"])],
        [Paragraph("Propofol (TIVA)", S["table_cell"]),
         Paragraph("IV anaesthetic", S["table_cell"]),
         Paragraph('<font color="#1E8449">No inhibition</font>', S["table_cell_c"]),
         Paragraph("Neutral", S["table_cell_c"]),
         Paragraph("Preferred in high-risk OLV patients, patients who received bleomycin (limit FiO&#8322;), right-sided or expected difficult OLV.", S["table_cell"])],
        [Paragraph("Ketamine", S["table_cell"]),
         Paragraph("IV dissociative", S["table_cell"]),
         Paragraph('<font color="#1E8449">Preserves HPV</font>', S["table_cell_c"]),
         Paragraph("Neutral / mild augmentation", S["table_cell_c"]),
         Paragraph("May increase PVR via sympathomimetic effect. Acceptable for OLV.", S["table_cell"])],
        [Paragraph("Dexmedetomidine", S["table_cell"]),
         Paragraph("&#945;&#8322;-agonist adjunct", S["table_cell"]),
         Paragraph('<font color="#1E8449">Improves OLV oxygenation</font>', S["table_cell_c"]),
         Paragraph("Reduces volatile need", S["table_cell_c"]),
         Paragraph("Decreasing volatile anaesthetic dose with dex has been shown to improve PaO&#8322; during OLV.", S["table_cell"])],
        [Paragraph("Opioids (remifentanil, fentanyl)", S["table_cell"]),
         Paragraph("IV opioids", S["table_cell"]),
         Paragraph('<font color="#1E8449">No inhibition</font>', S["table_cell_c"]),
         Paragraph("Neutral", S["table_cell_c"]),
         Paragraph("Standard components of TIVA for OLV.", S["table_cell"])],
        [Paragraph("Nitroglycerin (GTN)", S["table_cell"]),
         Paragraph("Vasodilator", S["table_cell"]),
         Paragraph('<font color="#C0392B">Inhibits HPV</font>', S["table_cell_c"]),
         Paragraph("++ (dose-dependent)", S["table_cell_c"]),
         Paragraph("Avoid or minimise dose during OLV. Worsens PaO&#8322; through pulmonary vasodilation.", S["table_cell"])],
        [Paragraph("Sodium nitroprusside (SNP)", S["table_cell"]),
         Paragraph("Vasodilator", S["table_cell"]),
         Paragraph('<font color="#C0392B">Inhibits HPV</font>', S["table_cell_c"]),
         Paragraph("++", S["table_cell_c"]),
         Paragraph("Potent pulmonary vasodilator. Avoid during OLV if possible.", S["table_cell"])],
        [Paragraph("Ca&#178;&#8314; channel blockers", S["table_cell"]),
         Paragraph("Antihypertensive", S["table_cell"]),
         Paragraph('<font color="#C0392B">Inhibits HPV</font>', S["table_cell_c"]),
         Paragraph("+ to ++", S["table_cell_c"]),
         Paragraph("Combined with volatile agent can reduce HPV by up to 40% vs either drug alone.", S["table_cell"])],
        [Paragraph("Dobutamine (high dose)", S["table_cell"]),
         Paragraph("Inotrope", S["table_cell"]),
         Paragraph('<font color="#C0392B">Indirect inhibition</font>', S["table_cell_c"]),
         Paragraph("Via ↑ CO", S["table_cell_c"]),
         Paragraph("↑ CO → passive distension of non-ventilated lung vasculature → overrides HPV. Negative net effect on PaO&#8322;.", S["table_cell"])],
        [Paragraph("Inhaled NO", S["table_cell"]),
         Paragraph("Selective vasodilator", S["table_cell"]),
         Paragraph('<font color="#1E8449">Selective vasodilation (ventilated lung)</font>', S["table_cell_c"]),
         Paragraph("Effective at ~20 ppm", S["table_cell_c"]),
         Paragraph("Inhaled NO reaches only ventilated areas → dilates ventilated lung vasculature → redistributes flow to ventilated lung → may improve V/Q.", S["table_cell"])],
    ]
    drug_t = Table(drug_data,
                   colWidths=[3.2*cm, 2.6*cm, 3.0*cm, 2.4*cm, 4.0*cm],
                   repeatRows=1, spaceBefore=4, spaceAfter=6)
    drug_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
    ]))
    els.append(drug_t)
    els.append(sp(4))
    els.append(Paragraph("Sources: Miller's Anesthesia 10e (Ch. 19, 49) · Murray &amp; Nadel · Barash Clinical Anesthesia 9e", S["source"]))
    return els

# ─── Section 7: Cardiac Output ────────────────────────────────────────────────
def section_cardiac_output():
    els = []
    els.append(PageBreak())
    els.append(section_header("07  CARDIAC OUTPUT, HAEMODYNAMICS AND HPV"))
    els.append(sp(8))

    els.append(Paragraph(
        "The relationship between cardiac output (CO) and PaO&#8322; during OLV is complex "
        "and non-linear. Both extremes of CO impair oxygenation through different mechanisms. "
        "Maintaining a normal cardiac output is critical to optimising PaO&#8322; during OLV.",
        S["body"]))
    els.append(sp(4))

    co_data = [
        [Paragraph(b("CO State"), S["table_hdr"]),
         Paragraph(b("Effect on Shunt (Qs/Qt)"), S["table_hdr"]),
         Paragraph(b("Effect on SvO&#8322;"), S["table_hdr"]),
         Paragraph(b("Net Effect on PaO&#8322;"), S["table_hdr"]),
         Paragraph(b("Mechanism"), S["table_hdr"])],
        [Paragraph("High / Supranormal CO\n(e.g., dopamine)", S["table_cell_c"]),
         Paragraph("↑ Shunt", S["table_cell_c"]),
         Paragraph("↑ SvO&#8322;", S["table_cell_c"]),
         Paragraph('<font color="#C0392B">↓ PaO&#8322; (net negative)</font>', S["table_cell_c"]),
         Paragraph("Passive distension of non-ventilated lung vasculature overcomes HPV; shunt effect dominates", S["table_cell"])],
        [Paragraph("Normal CO\n(target range)", S["table_cell_c"]),
         Paragraph("Baseline shunt 20-30%", S["table_cell_c"]),
         Paragraph("Normal", S["table_cell_c"]),
         Paragraph('<font color="#1E8449">Optimal PaO&#8322;</font>', S["table_cell_c"]),
         Paragraph("HPV intact; V/Q maintained; SvO&#8322; adequate for shunted blood", S["table_cell"])],
        [Paragraph("Low CO\n(hypotension, hypovolaemia)", S["table_cell_c"]),
         Paragraph("↓ Shunt", S["table_cell_c"]),
         Paragraph("↓ SvO&#8322;", S["table_cell_c"]),
         Paragraph('<font color="#C0392B">↓ PaO&#8322; (net negative)</font>', S["table_cell_c"]),
         Paragraph("Low SvO&#8322; means even small shunt fraction markedly depresses PaO&#8322;; vasoconstriction may also impair ventilated lung perfusion", S["table_cell"])],
    ]
    co_t = Table(co_data, colWidths=[2.8*cm, 2.8*cm, 2.8*cm, 2.8*cm, 4.0*cm],
                 repeatRows=1, spaceBefore=4, spaceAfter=6)
    co_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 5),
        ("RIGHTPADDING", (0,0), (-1,-1), 5),
    ]))
    els.append(co_t)

    els.append(info_box(
        "HAEMODYNAMIC TARGETS DURING OLV",
        [
            "Maintain cardiac output within normal range - avoid both extremes",
            "Avoid supranormal CO from inotropes (dopamine, dobutamine) - worsens HPV and shunt",
            "Keep SvO&#8322; ≥ 65% - low mixed venous O&#8322; markedly amplifies the effect of any shunt on PaO&#8322;",
            "Thoracic epidural analgesia: no direct HPV effect, but hypotension from sympathectomy can ↓ CO → ↓ PaO&#8322; - maintain BP actively",
            "Surgical trauma may release vasoactive metabolites → can oppose HPV in operative lung",
            "Surgical manipulation (PA traction/clamping) dramatically alters non-ventilated lung perfusion - communicate with surgeon",
        ]
    ))

    els.append(Paragraph("Additional Modulating Factors", S["h2"]))
    mod_data2 = [
        [Paragraph(b("Factor"), S["table_hdr"]),
         Paragraph(b("Effect on HPV"), S["table_hdr"])],
        [Paragraph("Metabolic acidosis", S["table_cell"]),
         Paragraph('<font color="#1E8449">↑ Enhances HPV</font>', S["table_cell_c"])],
        [Paragraph("Metabolic alkalosis", S["table_cell"]),
         Paragraph('<font color="#C0392B">↓ Attenuates HPV</font>', S["table_cell_c"])],
        [Paragraph("Hypercapnia / respiratory acidosis", S["table_cell"]),
         Paragraph('<font color="#1E8449">↑ Augments HPV (via acidosis + ↓ NO)</font>', S["table_cell_c"])],
        [Paragraph("Respiratory alkalosis", S["table_cell"]),
         Paragraph('<font color="#C0392B">↓ Blunts HPV</font>', S["table_cell_c"])],
        [Paragraph("Hypothermia", S["table_cell"]),
         Paragraph("Modifies HPV response", S["table_cell_c"])],
        [Paragraph("Increased sympathetic tone / obesity", S["table_cell"]),
         Paragraph('<font color="#1E8449">↑ Enhanced HPV (via ↑ sympathetic + ↓ &#946;&#8322;-AR)', S["table_cell_c"])],
        [Paragraph("Thoracic epidural (direct)", S["table_cell"]),
         Paragraph("Minimal direct effect (HPV is a local chemical response)", S["table_cell_c"])],
    ]
    mod_t2 = Table(mod_data2, colWidths=[9.0*cm, 6.2*cm],
                   repeatRows=1, spaceBefore=4, spaceAfter=6)
    mod_t2.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), TEAL),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ]))
    els.append(mod_t2)
    els.append(sp(4))
    els.append(Paragraph("Sources: Miller's Anesthesia 10e (Ch. 49) · Murray &amp; Nadel", S["source"]))
    return els

# ─── Section 8: Special Cases ─────────────────────────────────────────────────
def section_special():
    els = []
    els.append(PageBreak())
    els.append(section_header("08  SPECIAL CLINICAL SCENARIOS"))
    els.append(sp(8))

    scenarios = [
        ("COPD Patient Undergoing OLV",
         GREEN, GREEN_BG,
         [
             "COPD patients desaturate faster during isovolemic haemodilution - monitor Hb preoperatively",
             "Gas trapping in dependent lung may impair PEEP effectiveness - use longer expiratory time (I:E 1:3 or 1:4)",
             "Auto-PEEP common: measure intrinsic PEEP before adding extrinsic PEEP",
             "Better HPV response in some COPD patients due to pre-existing vasoconstriction of emphysematous zones",
             "Lower plateau pressure targets important - fragile lung parenchyma",
             "Variable PaO&#8322; outcomes: patients with extensive emphysema on the operative side may have naturally low perfusion → paradoxically better OLV oxygenation",
         ]),
        ("Right-Sided Thoracotomy",
         AMBER, AMBER_BG,
         [
             "Right lung = ~55% of total pulmonary blood flow (vs ~45% left) → larger obligatory shunt",
             "Expected mean PaO&#8322; ~100 mmHg lower than equivalent left-sided procedure",
             "Higher pre-operative risk: consider preop V/Q scan",
             "Have CPAP circuit ready earlier in the case",
             "More likely to need TIVA as baseline anaesthetic",
         ]),
        ("Post-Pneumonectomy Space / Contralateral Surgery",
         RED, RED_BG,
         [
             "Only one functional lung - zero tolerance for HPV inhibition or barotrauma",
             "Mandatory TIVA (propofol-based)",
             "PCV preferred to limit peak pressures on the single remaining lung",
             "Strict VT 4-5 mL/kg, plateau &lt;25 cmH&#8322;O, PEEP 5 cmH&#8322;O",
             "Avoid N&#8322;O and all systemic vasodilators",
             "Early escalation to two-lung ventilation (if possible) if SpO&#8322; falls",
         ]),
        ("Bleomycin-Treated Patients",
         AMBER, AMBER_BG,
         [
             "Bleomycin lung toxicity is O&#8322;-dependent - high FiO&#8322; accelerates pulmonary fibrosis",
             "Target FiO&#8322; 0.21-0.30 intraoperatively (lowest that maintains SpO&#8322; ≥ 93%)",
             "TIVA is preferred to allow reduced FiO&#8322; without requiring higher volatile MAC",
             "Monitor SpO&#8322; and PaO&#8322; closely - the reduced FiO&#8322; leaves less reserve",
             "HPV preservation (via TIVA) is especially important to maintain oxygenation at low FiO&#8322;",
         ]),
        ("Chronic Hypoxia / High-Altitude Pulmonary Hypertension",
         TEAL, LIGHT_TEAL,
         [
             "Sustained HPV from chronic hypoxia leads to vascular remodelling and fixed PH",
             "Increased baseline PVR: right heart may be impaired (cor pulmonale)",
             "HPV response may be attenuated (suppressed by chronic exposure) but structural changes persist",
             "Avoid agents that further raise PVR (N&#8322;O, vasoconstrictors)",
             "Consider pulmonary vasodilators (inhaled NO, sildenafil) perioperatively if significant pre-existing PH",
             "Right heart function monitoring is important",
         ]),
    ]

    for title, color, bg, points in scenarios:
        pts_text = "".join(f"&#8226; {p}<br/>" for p in points)
        data = [[
            Paragraph(f'<font color="{WHITE.hexval()}"><b>{title}</b></font>',
                      ParagraphStyle("sh", fontSize=10, fontName="Helvetica-Bold",
                                     textColor=WHITE, leading=14))
        ],[
            Paragraph(pts_text,
                      ParagraphStyle("sb", fontSize=9, fontName="Helvetica",
                                     textColor=DARK_TEXT, leading=13))
        ]]
        sc_t = Table(data, colWidths=[doc.width], spaceBefore=4, spaceAfter=2)
        sc_t.setStyle(TableStyle([
            ("BACKGROUND", (0,0), (-1,0), color),
            ("BACKGROUND", (0,1), (-1,-1), bg),
            ("TOPPADDING", (0,0), (-1,0), 7),
            ("BOTTOMPADDING", (0,0), (-1,0), 7),
            ("TOPPADDING", (0,1), (-1,-1), 7),
            ("BOTTOMPADDING", (0,1), (-1,-1), 7),
            ("LEFTPADDING", (0,0), (-1,-1), 10),
            ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ]))
        els.append(sc_t)

    els.append(sp(8))

    # Quick Reference Card
    els.append(Paragraph("QUICK REFERENCE: OLV AT A GLANCE", S["h2"]))
    qr_data = [
        [Paragraph(b("Parameter"), S["table_hdr"]),
         Paragraph(b("Value / Action"), S["table_hdr"])],
        [Paragraph("Acceptable SpO&#8322; floor", S["table_cell"]),
         Paragraph("&#8805; 90% (high 80s briefly in healthy patients without organ risk)", S["table_cell"])],
        [Paragraph("PaO&#8322; target", S["table_cell"]),
         Paragraph("&gt; 60 mmHg (adjust upward for coronary/cerebrovascular disease, anaemia)", S["table_cell"])],
        [Paragraph("HPV onset PAO&#8322; threshold", S["table_cell"]),
         Paragraph("&lt; 60 mmHg; maximal at ~30 mmHg", S["table_cell"])],
        [Paragraph("HPV flow reduction", S["table_cell"]),
         Paragraph("Up to 50% ↓ blood flow to non-ventilated lung", S["table_cell"])],
        [Paragraph("Typical OLV shunt", S["table_cell"]),
         Paragraph("20-30% with modern management (&lt;5% hypoxaemia incidence)", S["table_cell"])],
        [Paragraph("VT (protective)", S["table_cell"]),
         Paragraph("4-6 mL/kg IBW", S["table_cell"])],
        [Paragraph("PEEP strategy", S["table_cell"]),
         Paragraph("5 cmH&#8322;O baseline; titrate to lowest driving pressure (Pplat - PEEP)", S["table_cell"])],
        [Paragraph("First-line hypoxaemia rescue", S["table_cell"]),
         Paragraph("Verify DLT position → FiO&#8322; 1.0 → Recruitment → PEEP optimisation → CPAP to operative lung", S["table_cell"])],
        [Paragraph("Preferred anaesthetic (high-risk)", S["table_cell"]),
         Paragraph("TIVA (propofol + remifentanil) - no HPV inhibition", S["table_cell"])],
        [Paragraph("Avoid", S["table_cell"]),
         Paragraph("N&#8322;O, vasodilators (GTN, SNP), supranormal CO, high volatile MAC", S["table_cell"])],
    ]
    qr_t = Table(qr_data, colWidths=[5.5*cm, 9.7*cm],
                 repeatRows=1, spaceBefore=4, spaceAfter=6)
    qr_t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, LIGHT_GREY]),
        ("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#BDC3C7")),
        ("VALIGN", (0,0), (-1,-1), "MIDDLE"),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
    ]))
    els.append(qr_t)
    els.append(sp(4))
    els.append(Paragraph(
        "Sources: Miller's Anesthesia 10e (Ch. 49) · Murray &amp; Nadel Respiratory Medicine · "
        "Barash Clinical Anesthesia 9e (Ch. 38) · Morgan &amp; Mikhail Clinical Anesthesiology 7e",
        S["source"]))
    return els

# ─── Page numbering ───────────────────────────────────────────────────────────
def on_page(canvas, doc):
    canvas.saveState()
    canvas.setFont("Helvetica", 7.5)
    canvas.setFillColor(GREY)
    canvas.drawCentredString(
        W / 2, 1.2*cm,
        f"HPV Management in One-Lung Ventilation  |  Clinical Reference Guide  |  Page {doc.page}"
    )
    canvas.restoreState()

# ─── Build ────────────────────────────────────────────────────────────────────
story = []
story += cover_page()
story += section_physiology()
story += section_predictors()
story += section_prevention()
story += section_ventilation()
story += section_stepup()
story += section_drugs()
story += section_cardiac_output()
story += section_special()

doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF written to {OUTPUT}")
Running Command

cd /home/daytona/workspace/olv-hpv-guide && python3 generate_guide.py 2>&1

Editing File

~/olv-hpv-guide/generate_guide.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/olv-hpv-guide/generate_guide.py'
Running Command

cd /home/daytona/workspace/olv-hpv-guide && python3 generate_guide.py 2>&1

Editing File

~/olv-hpv-guide/generate_guide.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/olv-hpv-guide/generate_guide.py'
Running Command

cd /home/daytona/workspace/olv-hpv-guide && python3 generate_guide.py 2>&1

Running Command

ls -lh /home/daytona/workspace/olv-hpv-guide/HPV_OLV_Clinical_Reference_Guide.pdf

Your clinical reference guide is ready:

HPV OLV Clinical Reference Guide

PDF Document · PDF


What's inside the guide (8 sections, A4 format):
SectionContents
01 - PhysiologyHPV stimulus/threshold, magnitude during OLV, cellular mechanism table (K⁺ channels → Ca²⁺ → ROCK pathway), endothelial modulators (NO, ET-1, PGI₂)
02 - PredictorsRisk factor table with direction and mechanism for each (right-sided surgery, normal PFTs, V/Q scan findings, supine position, CO state)
03 - PreventionPre-OLV lung denitrogenation, recruitment, positioning, anaesthetic choice; red-flag box listing all HPV inhibitors to avoid
04 - Protective VentilationVT, FiO₂, PEEP, plateau pressure, driving pressure, PCV vs VCV - with evidence base; driving pressure concept box
05 - Step-Up Treatment Ladder7-step colour-coded escalation from DLT position check → FiO₂ → recruitment → PEEP → CPAP → PA clamp → 2-LV; emergency protocol box
06 - Drug ReferenceFull table of 14 agents (volatile agents, TIVA, vasodilators, dexmedetomidine, inhaled NO) with HPV effect, magnitude, and clinical notes
07 - Cardiac Output & HaemodynamicsCO-HPV interaction (low/normal/supranormal CO effects), haemodynamic targets, modulating factors table (pH, CO₂, sympathetic tone)
08 - Special ScenariosCOPD, right-sided thoracotomy, post-pneumonectomy, bleomycin-treated patients, chronic hypoxia/PH - plus a one-page quick reference card
Sources: Miller's Anesthesia 10e (Ch. 19, 49), Murray & Nadel's Respiratory Medicine, Barash Clinical Anesthesia 9e (Ch. 38), Morgan & Mikhail 7e

Hyperbaric oxygen therapy

Reading File
Finding Sources
Searching PubMed

"hyperbaric oxygen therapy"

Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
Reading File
I now have comprehensive content from five textbooks. Let me compile the full answer.

Hyperbaric Oxygen Therapy (HBOT)

Definition

HBOT is the administration of 100% oxygen at barometric pressures greater than 1 atmosphere absolute (ATA). It uses the hyperbaric chamber as a drug delivery system, with oxygen itself as the drug. The central principle is dramatically increasing dissolved O₂ in plasma - bypassing the hemoglobin-dependent delivery system entirely.
  • Guyton & Hall Medical Physiology
  • Sabiston Textbook of Surgery

Types of Chambers

Chamber TypePressurizationOxygen DeliveryNotes
Monoplace (single-person)100% O₂ pressurizes chamberPatient breathes ambient 100% O₂Most common; no personnel inside
Multiplace (large)Compressed air pressurizes chamber100% O₂ by mask, hood, or ET tubeMultiple patients + medical staff inside simultaneously
  • Morgan & Mikhail's Clinical Anesthesiology, 7e

Physiology: How HBOT Works

Boyle's Law and Henry's Law

  • Increasing pressure compresses gas volumes (Boyle's Law)
  • Increasing partial pressure of O₂ forces more O₂ into solution in plasma (Henry's Law)
  • At 3 ATA breathing 100% O₂: dissolved plasma O₂ rises to ~6 mL/dL - sufficient to meet resting tissue O₂ requirements even without hemoglobin

Quantitative Effects

ConditionPaO₂ (mmHg)Dissolved O₂ (mL/dL)
Breathing air at sea level (1 ATA)~100~0.3
100% O₂ at 1 ATA~673~2.0
100% O₂ at 2-2.5 ATA~1,400-1,600~4-5
100% O₂ at 3 ATA~2,193~6.6
Tissue PO₂ is raised 10-fold above baseline during HBOT (1.9-2.5 ATA), and this elevated level persists for 2-4 hours after the session ends.

Wound Hypoxia Threshold

  • Tissue PO₂ < 30 mmHg: significantly impairs fibroblast proliferation, collagen synthesis, and epithelialization
  • Wound transcutaneous PO₂ (TcPO₂) < 35 mmHg in room air = hypoxic wound (HBOT candidate)
  • In-chamber TcPO₂ ≥ 200 mmHg = suggests likely benefit from HBOT

Mechanisms of Action

HBOT is not simply a passive O₂ supplementation - it acts as a biological modulator:
Wound Healing / Angiogenesis
  • Stimulates synthesis of endothelial cell NO synthase (eNOS)
  • Promotes angiogenesis and granulation tissue formation
  • Enhances fibroblast proliferation and collagen synthesis
  • Normalises cutaneous microvascular reflexes
  • Increases stem cell proliferation
  • Upregulates matrix metalloproteinases for remodelling
  • Promotes leukocyte function (oxidative burst against bacteria)
Anti-infective
  • High PO₂ is directly bactericidal/bacteriostatic against obligate anaerobes - Clostridium species stop growing at O₂ pressures > ~70 mmHg, making HBOT curative in gas gangrene (formerly ~100% fatal, now curable in most cases)
  • Enhances leukocyte killing capacity
  • Generates reactive oxygen species (ROS) with direct bactericidal effects
Decompression / Gas Embolism
  • Reduces bubble size by increasing ambient pressure (Boyle's Law)
  • Accelerates elimination of inert gas (nitrogen) from tissues and bloodstream
  • Reduces ischaemia-reperfusion injury in affected tissues
Carbon Monoxide Poisoning
  • Displaces CO from hemoglobin: half-life of COHb drops from ~5 h (room air) to ~80 min (100% O₂ at 1 ATA) to ~20-25 min (3 ATA HBOT)
  • Also displaces CO from cytochrome c oxidase, restoring mitochondrial function
  • Reduces lipid peroxidation and delayed neurological sequelae
Vasoconstriction Effect
  • HBOT causes mild vasoconstriction via increased O₂ tension, which paradoxically reduces oedema without compromising O₂ delivery (because dissolved O₂ is dramatically elevated)

Approved Indications

Emergency / Acute (highest evidence)

IndicationRationale
Decompression sickness ("the bends")Reduces bubble size, promotes nitrogen elimination; first-line treatment
Arterial gas embolismBubble compression + oxygenation; life-saving
Carbon monoxide poisoningRapidly displaces CO from hemoglobin + cytochrome oxidase
Gas gangrene (clostridial myonecrosis)Direct bacteriostasis of anaerobes; once ~100% fatal, now largely curable
Cyanide poisoningSupports aerobic metabolism while antidotes act
Acute peripheral ischaemia / crush injuryOxygenates borderline viable tissue in the "zone of injury"

Chronic / Subacute (CMS-reimbursed in USA)

IndicationEvidence Summary
Diabetic foot ulcers (Wagner 3-4, failed standard care)RCTs show 54% healing with HBOT vs 25% standard; wound healing rate 56% → 60-75% (Ennis, n=25,562)
Osteoradionecrosis (mandible and other sites)Cochrane review: improved outcomes in head/neck, anorectal radiation injury; reduces ORN after dental extraction
Soft tissue radionecrosisRadiation cystitis, proctitis, soft tissue injuries - good evidence
Chronic refractory osteomyelitisAdjunct when unresponsive to antibiotics
Necrotising fasciitisAdjunct to surgical debridement
Preservation of skin grafts / flap salvageImproves graft take and flap survival by oxygenating ischaemic zones
Thermal burnsReduces depth of injury, accelerates healing

Investigational / Emerging Areas

  • Traumatic brain injury and stroke
  • COVID-19 / Long COVID brain fog (systematic reviews ongoing, PMID 38695969)
  • Sudden sensorineural hearing loss (SSNHL): Cochrane review shows modest benefit (NNT=5 for 2.5 dB improvement); not superior to steroids alone
  • Femoral head avascular necrosis
  • Cancer treatment (radiosensitisation of hypoxic tumours)
  • Fibromyalgia (limited evidence)

Treatment Protocol

ParameterStandard Range
Pressure1.9 - 3.0 ATA (most wound protocols: 2.0-2.5 ATA; decompression sickness: 2.8-3.0 ATA)
Session duration90-120 minutes
FrequencyOnce daily (emergencies: multiple daily), 5-6 days/week
Total sessions20-40 sessions (wound indications); acute conditions vary widely
Minimum to assess responseImprovement expected by sessions 15-20
FiO₂100% throughout session
Pre-treatment assessment: Revascularisation must be performed before HBOT in ischaemic wounds - HBOT cannot substitute for patent vascular supply. TcPO₂ measurement confirms wound hypoxia and predicts response.

Contraindications

Absolute

  1. Untreated/uncontrolled pneumothorax - pressure changes will cause life-threatening tension pneumothorax
  2. Concurrent bleomycin or doxorubicin treatment - dramatically potentiates pulmonary and cardiac toxicity of these agents
  3. Disulfiram (Antabuse) use - increases risk of oxygen toxicity (inhibits superoxide dismutase)

Relative

  • Severe COPD with CO₂ retention (risk of removing hypoxic drive)
  • Claustrophobia
  • Active ear/sinus disease (barotrauma risk)
  • Uncontrolled seizure disorders
  • Pregnancy (theoretical concerns about fetal O₂ toxicity)
  • Optic neuritis

Complications

Barotrauma (most common category)

  • Middle ear barotrauma - most common overall complication; ranges from tympanic membrane hyperaemia to perforation
  • Sinus squeeze - frontal/maxillary sinus pain during pressurisation/depressurisation
  • Pulmonary barotrauma - rare but serious; patients with bullae/blebs at greatest risk
  • Tension pneumothorax - rare, life-threatening; absolute contraindication to HBOT

Oxygen Toxicity

TypeManifestationNotes
CNS (Paul Bert effect)Tonic-clonic seizures resembling grand malMost feared acute complication; prevented by air breaks (breathing air for 5 min/hour during session)
Pulmonary (Lorrain Smith effect)Substernal burning → tracheobronchitis → ARDS-like injury from O₂ free radical damage to alveoliOccurs with prolonged exposure (>12-16 h at 1 ATA); clinical sessions are short enough to be safe
OcularTransient myopiaLens changes; usually reversible within weeks of completing treatment

Other

  • Claustrophobia / anxiety
  • Cataracts (after many sessions)
  • Fire hazard in monoplace O₂-filled chambers (strict no-flammable-materials policy)

Key Physiological Principles Summarised

Normal: PaO₂ ~100 mmHg → O₂ carried mainly by Hb (98%) + tiny dissolved fraction

HBOT at 3 ATA: PaO₂ ~2,193 mmHg
  → Dissolved O₂ = ~6.6 mL/dL
  → Sufficient to meet resting metabolic needs WITHOUT hemoglobin
  → ROS generated act as:
       ✓ Bactericidal
       ✓ Trigger for angiogenesis (eNOS, VEGF)
       ✓ Stimulant for collagen synthesis
       ✓ Vasoconstriction (reduces oedema)
       ✗ Cause of toxicity (seizures, lung injury) if excessive
The same oxidising free radicals responsible for O₂ toxicity are also believed to be responsible for the therapeutic benefits - making dosing precision critical. - Guyton & Hall Medical Physiology

Sources: Sabiston Textbook of Surgery | Guyton & Hall Medical Physiology | Morgan & Mikhail's Clinical Anesthesiology 7e | Campbell's Operative Orthopaedics 15e | Scott-Brown's Otorhinolaryngology Vol. 2 | Rockwood & Green's Fractures in Adults 10e
This is a shared conversation. Sign in to Orris to start your own chat.