https://share.google/kDtoKqv57JRYA1097 Give me a notes on coagulation pathway from above link

Reading File
Reading Web Page

https://share.google/kDtoKqv57JRYA1097

Finding Sources
Reading Web Page

https://www.openanesthesia.org/keywords/coagulation-pathway/

Finding Sources
Loading Image
Reading File
Reading File
Reading File
Loading Image
Loading Image
Reading File
I now have comprehensive material from multiple authoritative textbooks plus the diagrams. Here are your detailed notes on the coagulation pathway, aligned with the OpenAnesthesia article structure.

Coagulation Pathway - Notes

Source: OpenAnesthesia - Coagulation Pathway | Supplemented from Sabiston Textbook of Surgery, Schwartz's Principles of Surgery, Rockwood & Green's Fractures, Harrison's Principles of Internal Medicine

1. Overview: Two Models of Coagulation

A. Classic Cascade Model (Older)

Divides coagulation into three pathways:
PathwayKey FactorsMeasured by
Intrinsic (Contact)XII → XI → IX → VIIIPTT (Partial Thromboplastin Time)
Extrinsic (TF-dependent)TF + VII → VIIaPT (Prothrombin Time)
CommonX → Xa → Prothrombin → Thrombin → Fibrinogen → FibrinBoth
  • All three pathways converge at Factor X activation
  • Factor Xa + Va (prothrombinase complex) converts prothrombin (II) to thrombin (IIa)
  • Thrombin then converts fibrinogen (I) to fibrin
  • Factor XIII cross-links fibrin monomers into a stable clot

B. Cell-Based Model (Modern, More Accurate)

Describes coagulation in 3 phases occurring on specific cell surfaces:
  1. Initiation - on tissue factor (TF)-bearing cells
  2. Amplification - on platelet surface
  3. Propagation - on activated platelet surface

2. Cell-Based Model: The Three Phases

Phase 1 - INITIATION (on TF-bearing cells)

Cell-based model showing initiation phase
  • Vascular injury exposes Tissue Factor (TF) on subendothelial fibroblasts and vascular smooth muscle cells
  • TF binds circulating Factor VIIa → forms the Extrinsic Tenase Complex (TF:FVIIa)
  • This complex activates:
    • FX → FXa
    • FIX → FIXa
  • FXa + FVa → Prothrombinase complex → converts prothrombin to a small amount of thrombin ("thrombin spark")
  • This initial thrombin is not enough for full clot; it serves to kick off the amplification phase
  • The TF:FVIIa complex is quickly inhibited by TFPI (Tissue Factor Pathway Inhibitor)

Phase 2 - AMPLIFICATION (on platelet surface)

  • The "thrombin spark" from initiation activates platelets
  • Activated platelets adhere to subendothelium via:
    • Glycoprotein Ia/IIa → binds collagen
    • Glycoprotein VI → activates integrins
    • vWF bridges damaged endothelium to platelet GP Ib/IX/V
  • Thrombin activates FV → FVa, FVIII → FVIIIa, and FXI → FXIa
  • Activated platelets change shape, release granule contents (ADP, TXA2, serotonin, coagulation factors) → amplifies platelet recruitment
  • The platelet surface provides a negatively charged phospholipid platform for clotting factor assembly

Phase 3 - PROPAGATION (on activated platelet surface)

  • Assembly of two key enzyme complexes on activated platelet membranes:
    1. Intrinsic Tenase Complex = FIXa + FVIIIa (Ca²⁺ dependent) → activates FX → FXa at high efficiency
      • This complex is 50x more effective than the extrinsic TF:FVIIa complex at FXa generation
    2. Prothrombinase Complex = FXa + FVa (Ca²⁺ dependent) → converts prothrombin → massive thrombin ("thrombin burst")
  • The thrombin burst cleaves fibrinogen via two steps:
    • Removal of fibrinopeptide A → end-to-end fibrin polymerization
    • Removal of fibrinopeptide B → side-to-side fibrin polymerization
  • Factor XIIIa cross-links fibrin monomers into a stable, insoluble clot

3. Hemostatic Plug Formation

  • Primary hemostasis = platelet plug (fast, unstable)
  • Secondary hemostasis = fibrin reinforcement via coagulation cascade (durable)
  • Both occur simultaneously, not sequentially
  • The final product: a stabilized fibrin-platelet plug sealing the vascular injury

4. Termination of Clotting

The coagulation response must be precisely regulated to prevent runaway thrombosis. Three main physiologic inhibitors:

A. TFPI (Tissue Factor Pathway Inhibitor)

  • Bound to glycosaminoglycans on uninjured endothelium
  • Inhibits the TF:FVIIa complex (extrinsic tenase)
  • Also directly inhibits FXa
  • Cofactor Protein S enhances TFPI's anti-FXa activity
  • Also released by activated platelets

B. Protein C / Protein S System

Inhibitors of coagulation including Protein C/S and Antithrombin III
  • Thrombin binds endothelial receptor Thrombomodulin → activates Protein C → Activated Protein C (APC)
  • APC + Protein S → inactivate FVa and FVIIIa (dismantles both the prothrombinase and intrinsic tenase complexes)
  • Protein S is a vitamin K-dependent protein; also acts as cofactor for TFPI and APC

C. Antithrombin III (AT-III)

  • Serine protease inhibitor synthesized in the liver (α and β isoforms; β has higher heparin affinity)
  • Activated by binding heparan sulfate proteoglycans on endothelial cells (or therapeutic heparin)
  • Undergoes conformational change → irreversibly binds and inactivates:
    • Thrombin (FIIa) - primary target
    • FXa, FIXa, FXIa, FXIIa, plasmin, kallikrein
  • Bound complexes are excreted via kidneys
  • Clinical note: Heparin works by 1000x accelerating AT-III activity
Clinical relevance of deficiencies:
  • Factor V Leiden mutation → FVa resistant to APC → hypercoagulable
  • Protein C or S deficiency → hypercoagulable (also causes warfarin-induced skin necrosis)
  • Antithrombin III deficiency → heparin resistance, thrombosis

5. Fibrinolysis

The process of clot dissolution:
  • Plasminogen (glycoprotein, circulates in blood) is activated by:
    • t-PA (tissue plasminogen activator) - released by endothelium
    • u-PA (urokinase-type plasminogen activator)
  • Activation: plasminogen binds fibrin → conformation change exposes cleavage sites → t-PA/u-PA converts it to plasmin
  • Plasmin is the active fibrinolytic protease:
    • Degrades FV and FVIII (disrupts prothrombinase and intrinsic tenase)
    • Cleaves cross-linked fibrin → releases FDPs (fibrin degradation products) and D-dimers

Antifibrinolytic Inhibitors (regulate plasmin)

InhibitorMechanism
PAI-1, PAI-2Inhibit t-PA and u-PA
α₂-antiplasminDirectly inhibits plasmin
TAFI (Thrombin-Activatable Fibrinolysis Inhibitor)Activated by thrombin; stabilizes clot from lysis
α₂-macroglobulinBroad protease inhibitor
C1 inhibitorInhibits plasmin and contact pathway
Clinical note: Drugs like tranexamic acid and epsilon-aminocaproic acid work by blocking plasminogen binding to fibrin, thereby inhibiting fibrinolysis.

6. Key Summary Table

PhaseLocationKey PlayersProduct
InitiationTF-bearing cellsTF, FVIIa, FIXa, FXa, FVaThrombin spark
AmplificationPlatelet surfaceThrombin, FVa, FVIIIa, FXIaActivated platelets
PropagationActivated plateletFIXa:FVIIIa (tenase), FXa:FVa (prothrombinase)Thrombin burst → fibrin
TerminationEndotheliumTFPI, Protein C/S, AT-IIIClot limitation
FibrinolysisFibrin surfacePlasminogen, t-PA/u-PA, plasminClot dissolution

7. Lab Tests That Map to Pathways

TestPathway AssessedFactors Measured
PT / INRExtrinsic + CommonVII, X, V, II, I
aPTTIntrinsic + CommonXII, XI, IX, VIII, X, V, II, I
Thrombin timeCommon (fibrinogen)Fibrinogen → Fibrin
Fibrinogen level-Quantitative
D-dimerFibrinolysisCross-linked fibrin breakdown

Put it into flow charts for md anaesthesia exams

Reading File
Running Command

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

Writing File

~/coagulation_pptx.py

from pptx import Presentation
from pptx.util import Inches, Pt, Emu
from pptx.dml.color import RGBColor
from pptx.enum.text import PP_ALIGN
from pptx.util import Inches, Pt
import copy

# ── Colour palette ──────────────────────────────────────────────
DARK_BLUE   = RGBColor(0x1A, 0x37, 0x6C)   # slide background / title bar
MID_BLUE    = RGBColor(0x21, 0x5F, 0xAA)   # box border / accent
LIGHT_BLUE  = RGBColor(0xD6, 0xE4, 0xF5)   # box fill (light)
ORANGE      = RGBColor(0xE8, 0x6E, 0x1A)   # inhibitor / warning boxes
GREEN       = RGBColor(0x1A, 0x7A, 0x4A)   # product / output boxes
RED         = RGBColor(0xC0, 0x30, 0x30)   # key enzyme burst
YELLOW_BG   = RGBColor(0xFF, 0xF8, 0xDC)   # lab test box background
WHITE       = RGBColor(0xFF, 0xFF, 0xFF)
BLACK       = RGBColor(0x10, 0x10, 0x10)
LIGHT_GRAY  = RGBColor(0xF0, 0xF4, 0xFA)

prs = Presentation()
prs.slide_width  = Inches(13.33)
prs.slide_height = Inches(7.5)

BLANK_LAYOUT = prs.slide_layouts[6]   # completely blank

# ═══════════════════════════════════════════════════════════════
#  HELPER FUNCTIONS
# ═══════════════════════════════════════════════════════════════

def add_rect(slide, x, y, w, h, fill=LIGHT_BLUE, border=MID_BLUE,
             border_pt=1.5, radius=False):
    """Add a filled rectangle with optional border."""
    shape = slide.shapes.add_shape(
        1,  # MSO_SHAPE_TYPE.RECTANGLE = 1  (rounded = 5)
        Inches(x), Inches(y), Inches(w), Inches(h)
    )
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill
    line = shape.line
    line.color.rgb = border
    line.width = Pt(border_pt)
    return shape


def add_rounded(slide, x, y, w, h, fill=LIGHT_BLUE, border=MID_BLUE, border_pt=1.5):
    from pptx.enum.shapes import MSO_SHAPE_TYPE
    shape = slide.shapes.add_shape(
        5,  # rounded rectangle
        Inches(x), Inches(y), Inches(w), Inches(h)
    )
    shape.fill.solid()
    shape.fill.fore_color.rgb = fill
    shape.line.color.rgb = border
    shape.line.width = Pt(border_pt)
    return shape


def set_text(shape, text, font_size=11, bold=False, color=BLACK,
             align=PP_ALIGN.CENTER, wrap=True):
    tf = shape.text_frame
    tf.word_wrap = wrap
    tf.auto_size = None
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(font_size)
    run.font.bold = bold
    run.font.color.rgb = color


def add_textbox(slide, x, y, w, h, text, font_size=11, bold=False,
                color=BLACK, align=PP_ALIGN.CENTER):
    txBox = slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf = txBox.text_frame
    tf.word_wrap = True
    p = tf.paragraphs[0]
    p.alignment = align
    run = p.add_run()
    run.text = text
    run.font.size = Pt(font_size)
    run.font.bold = bold
    run.font.color.rgb = color
    return txBox


def add_arrow(slide, x1, y1, x2, y2, color=MID_BLUE, width_pt=2.0):
    """Draw a connector line with arrowhead."""
    from pptx.util import Emu
    connector = slide.shapes.add_connector(
        1,  # straight connector
        Inches(x1), Inches(y1), Inches(x2), Inches(y2)
    )
    connector.line.color.rgb = color
    connector.line.width = Pt(width_pt)
    # end arrow
    from pptx.oxml.ns import qn
    from lxml import etree
    ln = connector.line._ln
    tailEnd = ln.find(qn('a:tailEnd'))
    headEnd = ln.find(qn('a:headEnd'))
    if headEnd is None:
        headEnd = etree.SubElement(ln, qn('a:headEnd'))
    headEnd.set('type', 'none')
    if tailEnd is None:
        tailEnd = etree.SubElement(ln, qn('a:tailEnd'))
    tailEnd.set('type', 'arrow')
    tailEnd.set('w', 'med')
    tailEnd.set('len', 'med')


def add_slide_bg(slide, color=DARK_BLUE):
    bg = slide.background
    fill = bg.fill
    fill.solid()
    fill.fore_color.rgb = color


def title_bar(slide, title, subtitle=""):
    bar = add_rect(slide, 0, 0, 13.33, 0.7, fill=DARK_BLUE, border=DARK_BLUE)
    add_textbox(slide, 0.2, 0.05, 10, 0.6, title,
                font_size=22, bold=True, color=WHITE, align=PP_ALIGN.LEFT)
    if subtitle:
        add_textbox(slide, 0.2, 0.55, 13, 0.35, subtitle,
                    font_size=12, bold=False, color=RGBColor(0xCC, 0xDD, 0xFF),
                    align=PP_ALIGN.LEFT)


def footer(slide, text="MD Anaesthesia Exam Notes | Coagulation Pathway"):
    bar = add_rect(slide, 0, 7.2, 13.33, 0.3, fill=DARK_BLUE, border=DARK_BLUE)
    add_textbox(slide, 0.2, 7.22, 13, 0.25, text,
                font_size=9, color=RGBColor(0xAA, 0xBB, 0xDD), align=PP_ALIGN.LEFT)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 1 – Title Slide
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, DARK_BLUE)

# Big title box
tb = add_rect(sl, 1.2, 1.5, 10.9, 1.5, fill=MID_BLUE, border=WHITE, border_pt=2)
set_text(tb, "COAGULATION PATHWAY", font_size=36, bold=True, color=WHITE)

sub = add_rect(sl, 1.2, 3.1, 10.9, 0.7, fill=RGBColor(0x0E, 0x25, 0x50), border=WHITE, border_pt=1)
set_text(sub, "Flowchart Notes for MD Anaesthesia Examinations", font_size=18, color=RGBColor(0xCC, 0xEE, 0xFF))

# Bullet points
lines = [
    "• Cell-Based Model: Initiation → Amplification → Propagation",
    "• Termination of Clotting: TFPI | Protein C/S | Antithrombin III",
    "• Fibrinolysis Pathway",
    "• Lab Correlation: PT / aPTT / D-dimer",
]
for i, line in enumerate(lines):
    add_textbox(sl, 1.5, 4.0 + i*0.38, 10, 0.38, line,
                font_size=14, color=RGBColor(0xDD, 0xEE, 0xFF), align=PP_ALIGN.LEFT)

add_textbox(sl, 0.2, 7.0, 13, 0.3,
            "Source: OpenAnesthesia | Sabiston / Schwartz / Rockwood & Green / Harrison's",
            font_size=9, color=RGBColor(0x88, 0x99, 0xBB), align=PP_ALIGN.LEFT)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 2 – Classic Cascade Model (Intrinsic / Extrinsic / Common)
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Classic Cascade Model", "Intrinsic & Extrinsic Pathways — Lab Correlates")
footer(sl)

# ── Intrinsic pathway (left column) ──
ix_boxes = [
    ("XII (Hageman Factor)", 0.4, 0.9),
    ("XIa", 0.4, 1.7),
    ("XIa → IXa", 0.4, 2.5),
    ("IXa + VIIIa\n(Intrinsic Tenase)", 0.4, 3.3),
]

add_textbox(sl, 0.2, 0.78, 3.5, 0.35, "INTRINSIC PATHWAY", font_size=13, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER)
add_textbox(sl, 0.2, 1.0, 3.5, 0.35, "Contact activation (XII)", font_size=10, color=MID_BLUE, align=PP_ALIGN.CENTER)

int_steps = [
    ("FXII", LIGHT_BLUE), ("FXI → FXIa", LIGHT_BLUE),
    ("FIX → FIXa", LIGHT_BLUE), ("IXa + VIIIa\n(Intrinsic Tenase)", MID_BLUE),
]
ys = [1.35, 1.95, 2.55, 3.15]
for (lbl, col), y in zip(int_steps, ys):
    b = add_rounded(sl, 0.3, y, 3.2, 0.52, fill=col, border=DARK_BLUE)
    set_text(b, lbl, font_size=11, bold=(col==MID_BLUE), color=WHITE if col==MID_BLUE else BLACK)
    if y < 3.15:
        add_arrow(sl, 1.9, y+0.52, 1.9, y+0.62)

# Lab label
lb = add_rounded(sl, 0.3, 3.75, 3.2, 0.55, fill=YELLOW_BG, border=ORANGE)
set_text(lb, "⚗ aPTT measures\nIntrinsic + Common", font_size=10, color=RGBColor(0x80, 0x40, 0x00))

# ── Extrinsic pathway (right column) ──
add_textbox(sl, 5.5, 0.78, 3.5, 0.35, "EXTRINSIC PATHWAY", font_size=13, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER)
add_textbox(sl, 5.5, 1.0, 3.5, 0.35, "Tissue Factor dependent", font_size=10, color=MID_BLUE, align=PP_ALIGN.CENTER)

ext_steps = [
    ("Vascular Injury\n→ TF exposed", LIGHT_BLUE),
    ("TF + FVII → FVIIa\n(Extrinsic Tenase)", MID_BLUE),
]
ys2 = [1.35, 1.95]
for (lbl, col), y in zip(ext_steps, ys2):
    b = add_rounded(sl, 5.5, y, 3.2, 0.52, fill=col, border=DARK_BLUE)
    set_text(b, lbl, font_size=11, bold=(col==MID_BLUE), color=WHITE if col==MID_BLUE else BLACK)
    if y < 1.95:
        add_arrow(sl, 7.1, y+0.52, 7.1, y+0.62)

lb2 = add_rounded(sl, 5.5, 2.6, 3.2, 0.55, fill=YELLOW_BG, border=ORANGE)
set_text(lb2, "⚗ PT/INR measures\nExtrinsic + Common", font_size=10, color=RGBColor(0x80, 0x40, 0x00))

# ── Common pathway (centre-bottom) ──
add_textbox(sl, 3.5, 3.7, 6.5, 0.35, "COMMON PATHWAY", font_size=13, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER)

# arrows converging
add_arrow(sl, 1.9, 3.67, 5.1, 4.15, color=MID_BLUE)   # intrinsic → common
add_arrow(sl, 7.1, 3.15, 5.9, 4.15, color=MID_BLUE)   # extrinsic → common

com_steps = [
    ("FX → FXa", LIGHT_BLUE),
    ("FXa + FVa\n(Prothrombinase complex)", MID_BLUE),
    ("Prothrombin (II) → Thrombin (IIa)", RED),
    ("Fibrinogen (I) → Fibrin\n+ FXIIIa cross-links", GREEN),
    ("Stable Fibrin Clot ✓", GREEN),
]
ys3 = [4.1, 4.7, 5.35, 6.0, 6.65]
for (lbl, col), y in zip(com_steps, ys3):
    b = add_rounded(sl, 3.8, y, 5.8, 0.52, fill=col, border=DARK_BLUE)
    fc = WHITE if col in (MID_BLUE, RED, GREEN) else BLACK
    set_text(b, lbl, font_size=11, bold=(col in (RED, GREEN)), color=fc)
    if y < 6.65:
        add_arrow(sl, 6.7, y+0.52, 6.7, y+0.62)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 3 – Cell-Based Model: INITIATION
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Cell-Based Model: Phase 1 — INITIATION", "Occurs on Tissue Factor (TF)-bearing cells: fibroblasts / VSMC")
footer(sl)

# Main flow (vertical centre)
init_steps = [
    ("Vascular Injury", DARK_BLUE, WHITE),
    ("Subendothelial TF Exposed\n(fibroblasts & VSMC)", MID_BLUE, WHITE),
    ("TF binds Factor VIIa\n→ TF:FVIIa Complex\n(Extrinsic Tenase Complex)", MID_BLUE, WHITE),
    ("FX → FXa\nFIX → FIXa", LIGHT_BLUE, BLACK),
    ("FXa + FVa + Ca²⁺ + Phospholipid\n(Prothrombinase Complex)", MID_BLUE, WHITE),
    ("Prothrombin → THROMBIN SPARK\n(small amount)", RED, WHITE),
]
x0, w0 = 3.9, 5.5
ys = [0.85, 1.55, 2.35, 3.35, 4.15, 5.05]
heights = [0.52, 0.62, 0.8, 0.62, 0.72, 0.72]
for i, ((lbl, fc, tc), y, h) in enumerate(zip(init_steps, ys, heights)):
    b = add_rounded(sl, x0, y, w0, h, fill=fc, border=DARK_BLUE)
    set_text(b, lbl, font_size=12, bold=(fc in (RED, DARK_BLUE)), color=tc)
    if i < len(ys)-1:
        add_arrow(sl, x0+w0/2, y+h, x0+w0/2, ys[i+1]-0.05)

# TFPI inhibitor callout (right side)
tfpi = add_rounded(sl, 9.8, 2.35, 3.1, 0.72, fill=ORANGE, border=RED, border_pt=2)
set_text(tfpi, "🛑 TFPI inhibits\nTF:FVIIa complex\n(+ FXa directly)", font_size=10, bold=True, color=WHITE)
add_arrow(sl, 9.8, 2.71, 9.4, 2.71, color=RED)

# Note bottom
note = add_rounded(sl, 0.3, 5.5, 3.3, 0.8, fill=YELLOW_BG, border=ORANGE)
set_text(note, "⚠ Thrombin spark is\nINSUFFICIENT for full clot\n→ triggers Amplification", font_size=10, color=RGBColor(0x80, 0x30, 0x00))

# Ca2+ note
add_textbox(sl, 9.8, 4.0, 3.1, 0.5, "All steps require\nCa²⁺ & phospholipids",
            font_size=10, color=MID_BLUE, align=PP_ALIGN.LEFT)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 4 – Cell-Based Model: AMPLIFICATION
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Cell-Based Model: Phase 2 — AMPLIFICATION", "Thrombin spark activates platelets & co-factors")
footer(sl)

# Central "Thrombin Spark" box
ts = add_rounded(sl, 4.9, 0.85, 3.5, 0.65, fill=RED, border=DARK_BLUE, border_pt=2)
set_text(ts, "THROMBIN SPARK (FIIa)", font_size=13, bold=True, color=WHITE)

# Three branches from thrombin spark
branches = [
    (1.0, 2.0, "Platelet Activation\n(shape change,\ngranule release)", LIGHT_BLUE, BLACK),
    (4.9, 2.0, "FV → FVa\nFVIII → FVIIIa\nFXI → FXIa", MID_BLUE, WHITE),
    (8.8, 2.0, "ADP, TXA₂, PAF\nreleased\n→ more platelet\nrecruitment", LIGHT_BLUE, BLACK),
]
for bx, by, lbl, fc, tc in branches:
    b = add_rounded(sl, bx, by, 3.2, 0.9, fill=fc, border=DARK_BLUE)
    set_text(b, lbl, font_size=11, color=tc)
    add_arrow(sl, 6.65, 1.5, bx+1.6, by, color=RED)

# Platelet adhesion detail
add_textbox(sl, 0.3, 3.1, 4.0, 0.3, "Platelet Adhesion Receptors:", font_size=11, bold=True,
            color=DARK_BLUE, align=PP_ALIGN.LEFT)
adh = [
    "GP Ia/IIa → Collagen (direct)",
    "GP Ib/IX/V → vWF bridge",
    "GP VI → activates integrins",
    "Activated platelets: provide negatively\ncharged phospholipid surface",
]
for i, line in enumerate(adh):
    add_textbox(sl, 0.3, 3.45+i*0.4, 4.0, 0.4, f"  • {line}", font_size=10,
                color=BLACK, align=PP_ALIGN.LEFT)

# Activated platelet = platform
plat = add_rounded(sl, 4.7, 3.05, 4.0, 0.65, fill=MID_BLUE, border=DARK_BLUE, border_pt=2)
set_text(plat, "ACTIVATED PLATELET\n= Platform for clotting factor assembly",
         font_size=12, bold=True, color=WHITE)
add_arrow(sl, 6.65, 2.9, 6.65, 3.05)

# Result
res = add_rounded(sl, 4.7, 3.85, 4.0, 0.6, fill=GREEN, border=DARK_BLUE)
set_text(res, "Ready for PROPAGATION →", font_size=13, bold=True, color=WHITE)
add_arrow(sl, 6.65, 3.7, 6.65, 3.85)

# Granule contents note
gran = add_rounded(sl, 8.8, 3.1, 4.2, 1.2, fill=YELLOW_BG, border=ORANGE)
set_text(gran, "Platelet Granule Contents:\n• α-granules: FV, vWF, fibrinogen\n• Dense granules: ADP, ATP, serotonin\n• Lysosomal granules: enzymes",
         font_size=10, color=RGBColor(0x40, 0x20, 0x00), align=PP_ALIGN.LEFT)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 5 – Cell-Based Model: PROPAGATION
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Cell-Based Model: Phase 3 — PROPAGATION", "Massive thrombin burst on activated platelet surface")
footer(sl)

# Left column: Intrinsic Tenase
add_textbox(sl, 0.3, 0.78, 4.5, 0.35, "INTRINSIC TENASE COMPLEX", font_size=13, bold=True, color=DARK_BLUE)
it_steps = [
    ("FXIa → FIXa", LIGHT_BLUE, BLACK),
    ("FIXa + FVIIIa + Ca²⁺\n+ Phospholipid", MID_BLUE, WHITE),
    ("FX → FXa\n(50× more effective\nthan extrinsic tenase)", GREEN, WHITE),
]
for i, (lbl, fc, tc) in enumerate(it_steps):
    b = add_rounded(sl, 0.3, 1.2 + i*1.0, 4.4, 0.8, fill=fc, border=DARK_BLUE)
    set_text(b, lbl, font_size=11, bold=(fc==GREEN), color=tc)
    if i < 2:
        add_arrow(sl, 2.5, 1.2+i*1.0+0.8, 2.5, 1.2+(i+1)*1.0)

# Right column: Prothrombinase
add_textbox(sl, 8.6, 0.78, 4.4, 0.35, "PROTHROMBINASE COMPLEX", font_size=13, bold=True, color=DARK_BLUE)
pt_steps = [
    ("FXa + FVa + Ca²⁺\n+ Phospholipid", MID_BLUE, WHITE),
    ("Prothrombin (II)\n→ Thrombin (IIa)", RED, WHITE),
    ("⚡ THROMBIN BURST\n(massive generation)", RED, WHITE),
]
for i, (lbl, fc, tc) in enumerate(pt_steps):
    b = add_rounded(sl, 8.6, 1.2 + i*1.0, 4.4, 0.8, fill=fc, border=DARK_BLUE)
    set_text(b, lbl, font_size=11, bold=(i==2), color=tc)
    if i < 2:
        add_arrow(sl, 10.8, 1.2+i*1.0+0.8, 10.8, 1.2+(i+1)*1.0)

# Arrow: tenase feeds prothrombinase
add_arrow(sl, 4.7, 3.2, 8.6, 1.6, color=GREEN, width_pt=2)
add_textbox(sl, 5.5, 2.3, 3.1, 0.4, "FXa feeds →", font_size=10, color=GREEN, align=PP_ALIGN.CENTER)

# Fibrin formation (bottom centre)
add_textbox(sl, 3.5, 4.2, 6.4, 0.35, "FIBRIN FORMATION", font_size=13, bold=True, color=DARK_BLUE, align=PP_ALIGN.CENTER)
fib_steps = [
    ("Fibrinogen cleaved by Thrombin\n→ Fibrinopeptide A & B removed", LIGHT_BLUE, BLACK),
    ("FPA removed → end-to-end polymerisation\nFPB removed → side-to-side polymerisation", LIGHT_BLUE, BLACK),
    ("FXIIIa cross-links fibrin monomers\n→ STABLE INSOLUBLE FIBRIN CLOT ✓", GREEN, WHITE),
]
ys5 = [4.6, 5.3, 6.0]
for i, ((lbl, fc, tc), y) in enumerate(zip(fib_steps, ys5)):
    b = add_rounded(sl, 3.5, y, 6.4, 0.6, fill=fc, border=DARK_BLUE)
    set_text(b, lbl, font_size=11, bold=(fc==GREEN), color=tc)
    if i < 2:
        add_arrow(sl, 6.7, y+0.6, 6.7, ys5[i+1])

add_arrow(sl, 10.8, 4.0, 7.5, 4.55, color=RED, width_pt=2)
add_textbox(sl, 8.6, 4.1, 2.2, 0.35, "Thrombin burst →", font_size=10, color=RED)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 6 – Termination of Clotting (3 inhibitor systems)
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Termination of Clotting — Physiologic Anticoagulants", "Prevents runaway thrombosis")
footer(sl)

cols = [
    {
        "title": "1. TFPI",
        "subtitle": "(Tissue Factor Pathway Inhibitor)",
        "steps": [
            "Bound to glycosaminoglycans\non normal endothelium",
            "Inhibits TF:FVIIa complex\n(Extrinsic Tenase)",
            "Directly inhibits FXa",
            "Protein S enhances\nanti-FXa activity",
            "Also released by\nactivated platelets",
        ],
        "note": "Inhibits INITIATION\nphase",
        "x": 0.2,
    },
    {
        "title": "2. Protein C/S System",
        "subtitle": "(Vitamin K-dependent)",
        "steps": [
            "Thrombin + Thrombomodulin\n(endothelial receptor)",
            "→ Activated Protein C (APC)",
            "APC + Protein S\n(cofactor)",
            "Inactivate FVa & FVIIIa\n(dismantles Tenase &\nProthrombinase)",
            "Stops AMPLIFICATION\n& PROPAGATION",
        ],
        "note": "Deficiency → Warfarin-\ninduced skin necrosis",
        "x": 4.6,
    },
    {
        "title": "3. Antithrombin III",
        "subtitle": "(AT-III, synthesized in liver)",
        "steps": [
            "Binds heparan sulfate\nproteoglycans on EC\n(or therapeutic heparin)",
            "Conformational change\n→ reactive loop exposed",
            "Irreversibly inactivates:\nThrombin (main target),\nFXa, FIXa, FXIa, FXIIa",
            "Bound complexes\nexcreted by kidney",
            "Heparin accelerates\nAT-III activity 1000×",
        ],
        "note": "Deficiency → heparin\nresistance + thrombosis",
        "x": 9.0,
    },
]

for col in cols:
    x = col["x"]
    # Title
    th = add_rounded(sl, x, 0.78, 4.0, 0.52, fill=MID_BLUE, border=DARK_BLUE, border_pt=2)
    set_text(th, col["title"], font_size=13, bold=True, color=WHITE)
    add_textbox(sl, x, 1.3, 4.0, 0.35, col["subtitle"], font_size=10, color=MID_BLUE, align=PP_ALIGN.CENTER)

    ys = [1.7, 2.3, 2.9, 3.5, 4.1]
    for i, (step, y) in enumerate(zip(col["steps"], ys)):
        b = add_rounded(sl, x, y, 4.0, 0.52, fill=LIGHT_BLUE, border=MID_BLUE)
        set_text(b, step, font_size=10, color=BLACK)
        if i < len(col["steps"])-1:
            add_arrow(sl, x+2.0, y+0.52, x+2.0, ys[i+1])

    # Note
    nb = add_rounded(sl, x, 4.75, 4.0, 0.55, fill=ORANGE, border=RED, border_pt=1.5)
    set_text(nb, col["note"], font_size=10, bold=True, color=WHITE)

# Clinical implications box
ci = add_rounded(sl, 0.3, 5.5, 12.7, 0.88, fill=YELLOW_BG, border=ORANGE, border_pt=2)
set_text(ci,
    "Clinical Implications: Factor V Leiden (FVa resistant to APC) | Protein C/S Deficiency | AT-III Deficiency → ALL cause HYPERCOAGULABLE STATE\n"
    "Heparin → activates AT-III   |   Warfarin → inhibits Vit-K dependent factors (II, VII, IX, X, Protein C & S)",
    font_size=10.5, color=RGBColor(0x50, 0x20, 0x00))


# ═══════════════════════════════════════════════════════════════
#  SLIDE 7 – Fibrinolysis Pathway
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Fibrinolysis Pathway", "Clot dissolution by plasmin")
footer(sl)

# Main fibrinolysis flow (left/centre)
fib = [
    ("Endothelium releases t-PA\nInjury releases u-PA", LIGHT_BLUE, BLACK, 0.85, 0.62),
    ("Plasminogen\n(circulating glycoprotein)", LIGHT_BLUE, BLACK, 1.6, 0.62),
    ("Plasminogen binds Fibrin\n→ conformation change exposes cleavage sites", MID_BLUE, WHITE, 2.35, 0.72),
    ("t-PA / u-PA cleave plasminogen\n→ PLASMIN", RED, WHITE, 3.2, 0.62),
    ("PLASMIN (active fibrinolytic protease)", RED, WHITE, 3.95, 0.62),
]

x0f, w0f = 2.8, 7.7
for i, (lbl, fc, tc, y, h) in enumerate(fib):
    b = add_rounded(sl, x0f, y, w0f, h, fill=fc, border=DARK_BLUE)
    set_text(b, lbl, font_size=12, bold=(fc==RED), color=tc)
    if i < len(fib)-1:
        nxt_y = fib[i+1][3]
        add_arrow(sl, x0f+w0f/2, y+h, x0f+w0f/2, nxt_y)

# Plasmin actions (fan out)
add_textbox(sl, 0.3, 4.7, 12.8, 0.35, "PLASMIN ACTIONS:", font_size=13, bold=True, color=DARK_BLUE, align=PP_ALIGN.LEFT)
pa = [
    ("Degrades FV & FVIII\n(dismantles Prothrombinase\n& Intrinsic Tenase)", RED, WHITE),
    ("Cleaves cross-linked Fibrin\n→ FDPs (Fibrin Degradation Products)\n+ D-dimers", RED, WHITE),
    ("→ Fibrin Clot\nDissolved ✓", GREEN, WHITE),
]
xs_pa = [0.3, 4.6, 8.9]
for (lbl, fc, tc), x in zip(pa, xs_pa):
    b = add_rounded(sl, x, 5.1, 4.0, 0.9, fill=fc, border=DARK_BLUE)
    set_text(b, lbl, font_size=11, bold=(fc==GREEN), color=tc)
    add_arrow(sl, x0f+w0f/2, 4.57, x+2.0, 5.1, color=RED)

# Antifibrinolytic inhibitors (bottom)
add_textbox(sl, 0.2, 6.15, 13, 0.3, "ANTIFIBRINOLYTIC INHIBITORS (limit excess plasmin):",
            font_size=11, bold=True, color=DARK_BLUE, align=PP_ALIGN.LEFT)
inh_list = [
    "PAI-1 / PAI-2\n(inhibit t-PA & u-PA)",
    "α₂-antiplasmin\n(directly inhibits plasmin)",
    "TAFI\n(stabilizes clot from lysis)",
    "α₂-macroglobulin",
]
for i, lbl in enumerate(inh_list):
    b = add_rounded(sl, 0.2 + i*3.3, 6.5, 3.1, 0.65, fill=ORANGE, border=RED)
    set_text(b, lbl, font_size=10, bold=False, color=WHITE)

add_textbox(sl, 0.2, 7.1, 10, 0.22,
            "Drugs: Tranexamic Acid / ε-Aminocaproic Acid → block plasminogen-fibrin binding → antifibrinolysis",
            font_size=9, color=RGBColor(0x60, 0x20, 0x00), align=PP_ALIGN.LEFT)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 8 – Lab Tests & Drug Targets Summary
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Lab Tests & Drug Targets — Quick Reference", "MD Anaesthesia Exam One-Pager")
footer(sl)

# Lab tests table
add_textbox(sl, 0.3, 0.78, 5.8, 0.35, "LAB TESTS", font_size=13, bold=True, color=DARK_BLUE)
lab_rows = [
    ("PT / INR",       "Extrinsic + Common",    "VII, X, V, II, Fibrinogen"),
    ("aPTT",           "Intrinsic + Common",     "XII, XI, IX, VIII, X, V, II"),
    ("Thrombin Time",  "Common (fibrinogen)",    "Fibrinogen → Fibrin"),
    ("Fibrinogen",     "Quantitative",           "< 1.5 g/L → bleeding risk"),
    ("D-dimer",        "Fibrinolysis",           "Cross-linked fibrin products"),
    ("Anti-Xa level",  "Common pathway",         "Monitor LMWH / Fondaparinux"),
]
headers = ("Test", "Pathway", "Factors / Notes")
hx = [0.3, 2.5, 5.2]
hw = [2.1, 2.6, 3.3]
# header row
for j, (h, x, w) in enumerate(zip(headers, hx, hw)):
    hb = add_rect(sl, x, 1.15, w, 0.38, fill=DARK_BLUE, border=DARK_BLUE)
    set_text(hb, h, font_size=10, bold=True, color=WHITE)
for i, row in enumerate(lab_rows):
    fc = LIGHT_BLUE if i % 2 == 0 else WHITE
    for j, (cell, x, w) in enumerate(zip(row, hx, hw)):
        rb = add_rect(sl, x, 1.53 + i*0.38, w, 0.38, fill=fc, border=MID_BLUE, border_pt=0.5)
        set_text(rb, cell, font_size=9.5, color=BLACK)

# Drug targets
add_textbox(sl, 7.0, 0.78, 6.0, 0.35, "DRUG TARGETS ON COAGULATION", font_size=13, bold=True, color=DARK_BLUE)
drugs = [
    ("Heparin (UFH)", "Activates AT-III (1000×)\n→ inhibits Thrombin, FXa, IXa", LIGHT_BLUE),
    ("LMWH\n(e.g. Enoxaparin)", "AT-III activation\n→ mainly anti-FXa", LIGHT_BLUE),
    ("Warfarin", "Inhibits Vit-K dependent factors:\nII, VII, IX, X + Protein C & S", LIGHT_BLUE),
    ("Fondaparinux", "Indirect FXa inhibitor\n(via AT-III)", LIGHT_BLUE),
    ("Dabigatran", "Direct Thrombin (IIa) inhibitor", MID_BLUE),
    ("Rivaroxaban\nApixaban", "Direct FXa inhibitor", MID_BLUE),
    ("Tranexamic Acid", "Antifibrinolytic\n(blocks plasminogen binding)", ORANGE),
    ("Protamine", "Reverses UFH/LMWH", GREEN),
]
for i, (drug, mech, fc) in enumerate(drugs):
    row = i // 2
    col = i % 2
    b = add_rounded(sl, 7.0 + col*3.1, 1.15 + row*0.88, 2.9, 0.78, fill=fc, border=DARK_BLUE)
    tc = WHITE if fc in (MID_BLUE, ORANGE, GREEN) else BLACK
    set_text(b, f"{drug}\n{mech}", font_size=9, color=tc)


# ═══════════════════════════════════════════════════════════════
#  SLIDE 9 – Master Flowchart (Summary: all phases on one slide)
# ═══════════════════════════════════════════════════════════════
sl = prs.slides.add_slide(BLANK_LAYOUT)
add_slide_bg(sl, LIGHT_GRAY)
title_bar(sl, "Master Flowchart — Cell-Based Coagulation Model", "One-slide summary for exam revision")
footer(sl)

# 5 horizontal phase lanes
phases = [
    ("INITIATION", MID_BLUE,
     "TF:FVIIa (Extrinsic Tenase)\n→ FIXa + FXa\n→ Prothrombinase (FXa:FVa)\n→ Thrombin SPARK"),
    ("AMPLIFICATION", MID_BLUE,
     "Thrombin spark activates:\nPlatelets (granule release, shape change)\nFV→FVa | FVIII→FVIIIa | FXI→FXIa"),
    ("PROPAGATION", RED,
     "Intrinsic Tenase (FIXa:FVIIIa) → FXa\nProthrombinase (FXa:FVa)\n→ THROMBIN BURST\n→ Fibrin clot"),
    ("TERMINATION", ORANGE,
     "TFPI: inhibits TF:FVIIa + FXa\nProtein C/S: inactivates FVa, FVIIIa\nAT-III: inactivates Thrombin, FXa, FIXa"),
    ("FIBRINOLYSIS", GREEN,
     "t-PA/u-PA → Plasminogen → Plasmin\nPlasmin: degrades Fibrin → FDPs + D-dimers\nInhibited by: PAI-1, α₂-antiplasmin, TAFI"),
]

for i, (phase, fc, text) in enumerate(phases):
    y = 0.78 + i * 1.2
    # Phase label
    ph = add_rounded(sl, 0.2, y, 1.8, 0.55, fill=fc, border=DARK_BLUE, border_pt=2)
    set_text(ph, phase, font_size=11, bold=True, color=WHITE)
    # Content box
    cb = add_rounded(sl, 2.2, y, 10.9, 1.05, fill=LIGHT_BLUE if fc!=ORANGE else YELLOW_BG, border=fc, border_pt=1.5)
    set_text(cb, text, font_size=11, color=BLACK if fc==ORANGE else BLACK, align=PP_ALIGN.LEFT, wrap=True)
    cb.text_frame.paragraphs[0].alignment = PP_ALIGN.LEFT

    if i < len(phases)-1:
        add_arrow(sl, 1.1, y+0.55, 1.1, y+1.2, color=DARK_BLUE, width_pt=2)


# Save
out = "/tmp/workspace/Coagulation_Pathway_MD_Anaesthesia.pptx"
prs.save(out)
print(f"Saved: {out}")
Running Command

cd /tmp/workspace && python coagulation_pptx.py 2>&1

Running Command

ls -lh /tmp/workspace/Coagulation_Pathway_MD_Anaesthesia.pptx

Your PPTX is ready:

Coagulation Pathway MD Anaesthesia

Presentation · PPTX


What's inside (9 slides):
SlideContent
1Title slide with topic overview
2Classic Cascade Model - Intrinsic / Extrinsic / Common pathway with PT & aPTT labels
3Cell-Based Model: Initiation - TF:FVIIa → thrombin spark (with TFPI callout)
4Cell-Based Model: Amplification - platelet activation, granule release, co-factor activation
5Cell-Based Model: Propagation - Intrinsic Tenase + Prothrombinase → thrombin burst → fibrin
6Termination - TFPI / Protein C/S / AT-III flowcharts side by side + clinical implications
7Fibrinolysis - plasminogen → plasmin pathway + antifibrinolytics
8Lab tests & Drug targets quick reference table (heparin, warfarin, DOACs, TXA)
9Master summary flowchart - all 5 phases on one slide for last-minute revision
Color coding throughout: Blue = pathway steps, Red = key enzymes/thrombin, Green = final products, Orange = inhibitors/terminators, Yellow = clinical notes.
This is a shared conversation. Sign in to Orris to start your own chat.