Topic - Preeclampsia management. anesthesia exam answer. in pdf format

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

mkdir -p /tmp/workspace/preeclampsia-pdf && ls /tmp/workspace/

Writing File

~/preeclampsia-pdf/generate_pdf.py

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

OUTPUT = "/tmp/workspace/preeclampsia-pdf/Preeclampsia_Management_Anesthesia.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    leftMargin=2*cm,
    rightMargin=2*cm,
    topMargin=2.5*cm,
    bottomMargin=2.5*cm,
    title="Preeclampsia Management - Anesthesia Exam Answer",
    author="Orris Medical AI"
)

styles = getSampleStyleSheet()

# Custom styles
BLUE_DARK = colors.HexColor("#1a237e")
BLUE_MED  = colors.HexColor("#283593")
BLUE_LIGHT= colors.HexColor("#e8eaf6")
BLUE_ACCENT = colors.HexColor("#3949ab")
TEAL      = colors.HexColor("#00695c")
RED_WARN  = colors.HexColor("#b71c1c")
ORANGE    = colors.HexColor("#e65100")
GREY_BG   = colors.HexColor("#f5f5f5")
GREY_LINE = colors.HexColor("#bdbdbd")
WHITE     = colors.white
BLACK     = colors.HexColor("#212121")

title_style = ParagraphStyle(
    "MainTitle",
    parent=styles["Title"],
    fontSize=20,
    textColor=WHITE,
    alignment=TA_CENTER,
    spaceAfter=4,
    fontName="Helvetica-Bold",
    leading=26,
)
subtitle_style = ParagraphStyle(
    "Subtitle",
    parent=styles["Normal"],
    fontSize=10,
    textColor=colors.HexColor("#c5cae9"),
    alignment=TA_CENTER,
    spaceAfter=2,
    fontName="Helvetica",
)
h1_style = ParagraphStyle(
    "H1",
    parent=styles["Heading1"],
    fontSize=13,
    textColor=WHITE,
    fontName="Helvetica-Bold",
    spaceBefore=14,
    spaceAfter=4,
    leading=18,
)
h2_style = ParagraphStyle(
    "H2",
    parent=styles["Heading2"],
    fontSize=11,
    textColor=BLUE_DARK,
    fontName="Helvetica-Bold",
    spaceBefore=10,
    spaceAfter=3,
    leading=15,
    borderPad=2,
)
h3_style = ParagraphStyle(
    "H3",
    parent=styles["Heading3"],
    fontSize=10,
    textColor=TEAL,
    fontName="Helvetica-Bold",
    spaceBefore=7,
    spaceAfter=2,
    leading=13,
)
body_style = ParagraphStyle(
    "Body",
    parent=styles["Normal"],
    fontSize=9.5,
    textColor=BLACK,
    fontName="Helvetica",
    spaceAfter=4,
    leading=14,
    alignment=TA_JUSTIFY,
)
bullet_style = ParagraphStyle(
    "Bullet",
    parent=styles["Normal"],
    fontSize=9.5,
    textColor=BLACK,
    fontName="Helvetica",
    spaceAfter=3,
    leading=13,
    leftIndent=14,
    bulletIndent=4,
)
note_style = ParagraphStyle(
    "Note",
    parent=styles["Normal"],
    fontSize=9,
    textColor=RED_WARN,
    fontName="Helvetica-BoldOblique",
    spaceAfter=3,
    leading=12,
    leftIndent=8,
)
key_style = ParagraphStyle(
    "Key",
    parent=styles["Normal"],
    fontSize=9.5,
    textColor=ORANGE,
    fontName="Helvetica-Bold",
    spaceAfter=3,
    leading=13,
)
ref_style = ParagraphStyle(
    "Ref",
    parent=styles["Normal"],
    fontSize=8,
    textColor=colors.HexColor("#546e7a"),
    fontName="Helvetica-Oblique",
    spaceAfter=2,
    leading=11,
)

def section_header(text):
    """Returns a colored section header block."""
    data = [[Paragraph(text, h1_style)]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), BLUE_MED),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ("TOPPADDING", (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("ROUNDEDCORNERS", [4,4,4,4]),
    ]))
    return t

def warning_box(text):
    data = [[Paragraph("⚠  " + text, ParagraphStyle("W", parent=body_style, textColor=RED_WARN, fontName="Helvetica-Bold", fontSize=9.5))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#fff3e0")),
        ("BOX", (0,0), (-1,-1), 1, colors.HexColor("#e65100")),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ]))
    return t

def tip_box(text):
    data = [[Paragraph("★  " + text, ParagraphStyle("T", parent=body_style, textColor=TEAL, fontName="Helvetica-Bold", fontSize=9.5))]]
    t = Table(data, colWidths=[17*cm])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#e8f5e9")),
        ("BOX", (0,0), (-1,-1), 1, TEAL),
        ("LEFTPADDING", (0,0), (-1,-1), 10),
        ("RIGHTPADDING", (0,0), (-1,-1), 10),
        ("TOPPADDING", (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ]))
    return t

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

def bp(text):
    return Paragraph(f"\u2022  {text}", bullet_style)

def p(text):
    return Paragraph(text, body_style)

def h2(text):
    return Paragraph(text, h2_style)

def h3(text):
    return Paragraph(text, h3_style)

def sp(n=4):
    return Spacer(1, n)

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

# ─── TABLE HELPERS ───────────────────────────────────────────────────────────

def make_table(header_row, data_rows, col_widths=None, header_bg=BLUE_DARK):
    if col_widths is None:
        col_widths = [17*cm / len(header_row)] * len(header_row)
    header = [Paragraph(f"<b><font color='white'>{c}</font></b>", 
                         ParagraphStyle("TH", parent=styles["Normal"], fontSize=9, fontName="Helvetica-Bold",
                                        alignment=TA_CENTER, leading=12)) for c in header_row]
    table_data = [header]
    for i, row in enumerate(data_rows):
        bg = GREY_BG if i % 2 == 0 else WHITE
        table_data.append([
            Paragraph(str(cell), ParagraphStyle("TD", parent=styles["Normal"], fontSize=9, fontName="Helvetica",
                                                  leading=12, alignment=TA_LEFT)) for cell in row
        ])
    t = Table(table_data, colWidths=col_widths, repeatRows=1)
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,0), header_bg),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [GREY_BG, WHITE]),
        ("GRID", (0,0), (-1,-1), 0.4, GREY_LINE),
        ("LEFTPADDING", (0,0), (-1,-1), 6),
        ("RIGHTPADDING", (0,0), (-1,-1), 6),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING", (0,0), (-1,-1), 4),
        ("VALIGN", (0,0), (-1,-1), "TOP"),
    ]))
    return t

# ═══════════════════════════════════════════════════════════════════════════════
# CONTENT BUILD
# ═══════════════════════════════════════════════════════════════════════════════

story = []

# ─── COVER ───────────────────────────────────────────────────────────────────
cover_title = Paragraph("PREECLAMPSIA MANAGEMENT", title_style)
cover_sub1  = Paragraph("Anesthesia Exam Comprehensive Answer", subtitle_style)
cover_sub2  = Paragraph("Based on Barash's Clinical Anesthesia 9e · Miller's Anesthesia 10e · Creasy &amp; Resnik's MFM", subtitle_style)
cover_date  = Paragraph("August 2026", subtitle_style)

cover_data = [[cover_title], [sp(4)], [cover_sub1], [cover_sub2], [sp(2)], [cover_date]]
cover_table = Table(cover_data, colWidths=[17*cm])
cover_table.setStyle(TableStyle([
    ("BACKGROUND", (0,0), (-1,-1), BLUE_DARK),
    ("LEFTPADDING", (0,0), (-1,-1), 20),
    ("RIGHTPADDING", (0,0), (-1,-1), 20),
    ("TOPPADDING", (0,0), (0,0), 24),
    ("BOTTOMPADDING", (0,-1), (-1,-1), 20),
    ("TOPPADDING", (0,-1), (-1,-1), 0),
    ("TOPPADDING", (0,1), (-1,1), 0),
]))
story.append(cover_table)
story.append(sp(10))

# ─── DEFINITION & CLASSIFICATION ─────────────────────────────────────────────
story.append(section_header("1. DEFINITION & CLASSIFICATION"))
story.append(sp(6))
story.append(p("Preeclampsia is a pregnancy-specific syndrome defined by <b>hypertension (≥140/90 mmHg) after 20 weeks of gestation</b> accompanied by proteinuria (≥300 mg/24h or protein:creatinine ratio ≥0.3) or signs of end-organ involvement, in the absence of prior hypertension."))
story.append(sp(4))

class_data = [
    ["Type", "Definition / Criteria"],
    ["Chronic Hypertension", "Pre-existing HTN or HTN diagnosed before 20 weeks gestation"],
    ["Gestational HTN", "BP ≥140/90 after 20 weeks without proteinuria or end-organ signs"],
    ["Preeclampsia", "HTN + proteinuria OR end-organ damage after 20 weeks"],
    ["Preeclampsia with Severe Features", "SBP ≥160 or DBP ≥110 on two occasions 4h apart; or end-organ damage (see below)"],
    ["Superimposed Preeclampsia", "Preeclampsia developing in a patient with pre-existing chronic HTN"],
    ["Eclampsia", "New-onset convulsions in a preeclamptic patient with no other cause"],
    ["HELLP Syndrome", "Hemolysis + Elevated Liver enzymes + Low Platelets (severe variant)"],
]
story.append(make_table(class_data[0], class_data[1:], col_widths=[5*cm, 12*cm]))
story.append(sp(6))

story.append(h2("Severe Features of Preeclampsia (ANY one qualifies)"))
severe_features = [
    "SBP ≥160 mmHg or DBP ≥110 mmHg (on two readings, 4h apart, while at rest)",
    "Thrombocytopenia: platelet count <100,000/µL",
    "Renal insufficiency: serum creatinine >1.1 mg/dL or doubling of creatinine",
    "Impaired liver function: elevated transaminases (2× upper limit of normal), severe right upper quadrant/epigastric pain",
    "Pulmonary edema",
    "New-onset headache unresponsive to medication (not explained by other diagnoses)",
    "Visual disturbances (scotomata, cortical blindness, blurred vision)",
]
for f in severe_features:
    story.append(bp(f))
story.append(sp(6))

# ─── PATHOPHYSIOLOGY ──────────────────────────────────────────────────────────
story.append(section_header("2. PATHOPHYSIOLOGY (Anesthesia Relevance)"))
story.append(sp(6))
story.append(p("The underlying defect is <b>abnormal placentation</b> with impaired trophoblastic invasion of uterine spiral arteries, leading to placental ischemia. This triggers release of antiangiogenic factors (sFlt-1, soluble endoglin) that cause systemic endothelial dysfunction."))
story.append(sp(4))

patho_data = [
    ["System", "Pathophysiologic Change", "Anesthesia Implication"],
    ["Cardiovascular", "Increased SVR, vasospasm, relative intravascular volume depletion", "Careful fluid management; avoid vasodilators that drop MAP abruptly"],
    ["CNS", "Cerebral vasospasm, edema, focal ischemia, seizures", "Magnesium sulfate seizure prophylaxis; beware airway edema"],
    ["Coagulation", "Thrombocytopenia, DIC (HELLP)", "Check platelet count before neuraxial; avoid if <70,000"],
    ["Renal", "Glomerular endotheliosis, proteinuria, oliguria", "Limit fluids; avoid nephrotoxic agents"],
    ["Hepatic", "Periportal necrosis, subcapsular hematoma (HELLP)", "Risk of hepatic rupture; coagulopathy"],
    ["Pulmonary", "Pulmonary edema (decreased oncotic pressure + capillary leak)", "Airway edema complicates intubation; oxygen therapy"],
    ["Uteroplacental", "Reduced placental perfusion, IUGR, fetal compromise", "Avoid hypotension; maintain uteroplacental flow"],
]
story.append(make_table(patho_data[0], patho_data[1:], col_widths=[3.2*cm, 7*cm, 6.8*cm]))
story.append(sp(6))

# ─── ANTENATAL MANAGEMENT ────────────────────────────────────────────────────
story.append(section_header("3. ANTENATAL MANAGEMENT"))
story.append(sp(6))

story.append(h2("3.1  Antihypertensive Therapy"))
story.append(p("The goal is to reduce <b>SBP to &lt;160 mmHg</b> and <b>DBP to &lt;110 mmHg</b> to prevent maternal stroke and end-organ damage, while maintaining uteroplacental perfusion. Overly aggressive reduction risks fetal compromise."))
story.append(sp(4))

ah_data = [
    ["Drug", "Dose", "Advantages", "Disadvantages / Risks"],
    ["Labetalol (IV)", "10–20 mg IV, then 20–80 mg every 10–30 min; max 300 mg", "Decreases HR + SVR; preserves placental flow; no significant neonatal sympathetic blockade; ACOG first-line", "Variable duration; contraindicated in asthma/severe bradycardia"],
    ["Hydralazine (IV)", "5 mg IV, then 5–10 mg every 20–40 min; max 20 mg", "Arteriolar vasodilator; increases uterine + renal blood flow; ACOG endorsed", "Unpredictable onset and duration; reflex tachycardia; ventricular arrhythmias"],
    ["Nifedipine (PO)", "10–20 mg orally; repeat in 20 min if needed", "Rapid, smooth BP reduction; increases renal perfusion and urine output; ACOG endorsed", "Headache (confounds clinical picture); uterine relaxation → PPH; possible adverse interaction with MgSO₄"],
    ["Nicardipine (IV)", "5 mg/hr infusion; max 30 mg/hr", "Smooth BP control; titratable; good in ICU setting", "Headache; less obstetric data than labetalol"],
    ["Sodium Nitroprusside (IV)", "0.3 µg/kg/min initial; titrate; max 10 µg/kg/min", "Fast onset; short duration; titratable", "Cyanide toxicity with prolonged use; requires arterial line; cerebral vasodilation; last-resort drug in pregnancy"],
    ["Hydralazine (PO)", "10–25 mg TID–QID (maintenance)", "Oral option for chronic use in pregnancy", "Variable response"],
    ["Methyldopa (PO)", "250–500 mg TID (maintenance)", "Long safety record in pregnancy", "Sedation; not for acute crisis"],
]
story.append(make_table(ah_data[0], ah_data[1:], col_widths=[2.8*cm, 3.5*cm, 5.5*cm, 5.2*cm]))
story.append(sp(4))
story.append(warning_box("ACOG 2019: A hypertensive emergency is defined as SBP ≥160 mmHg or DBP ≥110 mmHg sustained for ≥15 minutes. First-line: IV labetalol, IV hydralazine, or oral nifedipine. Target: SBP 140–150 / DBP 90–100 mmHg."))
story.append(sp(6))

story.append(h2("3.2  Magnesium Sulfate (MgSO₄) — Seizure Prophylaxis & Treatment"))
story.append(p("MgSO₄ is the drug of choice for seizure prophylaxis in preeclampsia with severe features and for treatment of eclampsia. It works by competing with calcium at the neuromuscular junction and vasodilating cerebral vasculature."))
story.append(sp(4))

mg_data = [
    ["Purpose", "Loading Dose", "Maintenance", "Target Level", "Key Monitoring"],
    ["Seizure Prophylaxis / Eclampsia Treatment", "4–6 g IV over 15–20 min", "1–2 g/hr IV infusion", "4–7 mEq/L (therapeutic)", "Urine output ≥25 mL/hr, respiratory rate ≥12/min, patellar reflexes present"],
]
story.append(make_table(mg_data[0], mg_data[1:], col_widths=[4*cm, 3*cm, 2.8*cm, 3.5*cm, 3.7*cm]))
story.append(sp(4))

story.append(h3("Magnesium Toxicity Levels"))
mg_tox_data = [
    ["Serum Mg Level", "Clinical Effect"],
    ["4–7 mEq/L", "Therapeutic (seizure prophylaxis)"],
    ["7–10 mEq/L", "Loss of deep tendon reflexes (earliest sign of toxicity)"],
    ["10–13 mEq/L", "Respiratory depression/arrest"],
    ["15+ mEq/L", "Cardiac arrest"],
]
story.append(make_table(mg_tox_data[0], mg_tox_data[1:], col_widths=[5*cm, 12*cm]))
story.append(sp(4))
story.append(warning_box("Antidote for MgSO₄ toxicity: Calcium gluconate 1 g IV (10 mL of 10% solution) over 2–3 minutes. Stop MgSO₄ infusion immediately."))
story.append(sp(4))
story.append(tip_box("KEY EXAM POINT: MgSO₄ potentiates both depolarizing (succinylcholine) and non-depolarizing (rocuronium, vecuronium) neuromuscular blockers. Reduce NMB doses by 30–50% and use neuromuscular monitoring (TOF) intraoperatively."))
story.append(sp(6))

story.append(h2("3.3  Fluid Management"))
story.append(p("Fluid management is controversial and must be balanced carefully. Although patients are often relatively volume-depleted due to vasospasm, they are at high risk for pulmonary edema due to:"))
for item in ["Decreased colloid oncotic pressure (hypoalbuminemia, proteinuria)", "Endothelial capillary leak", "Impaired renal function", "Risk of iatrogenic fluid overload"]:
    story.append(bp(item))
story.append(sp(4))
story.append(p("<b>General principle:</b> Restrict maintenance IV fluids to 80–100 mL/hr total. Avoid aggressive volume loading. CVP is unreliable as a guide in preeclampsia. Pulmonary artery catheters increase complication risk and are not routinely recommended."))
story.append(sp(6))

# ─── ANESTHESIA MANAGEMENT ───────────────────────────────────────────────────
story.append(PageBreak())
story.append(section_header("4. ANESTHESIA MANAGEMENT IN PREECLAMPSIA"))
story.append(sp(6))

story.append(h2("4.1  Preanesthetic Assessment"))
story.append(p("A thorough assessment is mandatory before any anesthetic intervention. Key elements include:"))
pre_items = [
    "<b>Airway examination:</b> Preeclamptic patients are at high risk for difficult airway due to laryngeal/pharyngeal edema and mucosal edema from capillary leak. Mallampati scoring and neck circumference assessment are essential.",
    "<b>Blood pressure:</b> Confirm current BP control and medications; review response to antihypertensives.",
    "<b>Platelet count:</b> Essential before neuraxial block. Serial counts in HELLP — obtain count as close to procedure time as possible.",
    "<b>Coagulation studies (PT, aPTT, fibrinogen):</b> Especially if HELLP syndrome or DIC is suspected.",
    "<b>Renal function:</b> Creatinine, urine output (monitor for oliguria ≤0.5 mL/kg/hr).",
    "<b>Liver enzymes:</b> AST, ALT — elevated 2× ULN suggests severe disease.",
    "<b>Fetal assessment:</b> CTG, biophysical profile, Doppler studies — IUGR and fetal compromise common.",
    "<b>MgSO₄ infusion status:</b> Note dose and duration — important for NMB dosing.",
    "<b>IV access:</b> Ensure at least two large-bore peripheral IVs. Arterial line may be appropriate for severe disease.",
]
for item in pre_items:
    story.append(bp(item))
story.append(sp(6))

story.append(h2("4.2  Neuraxial Anesthesia — PREFERRED Technique"))
story.append(p("Neuraxial anesthesia (epidural, spinal, or combined spinal-epidural) is the <b>preferred anesthetic technique</b> for labor analgesia and cesarean delivery in preeclampsia for several reasons:"))
for reason in [
    "Reduces the hypertensive response to pain and surgical stimulation",
    "Avoids the risks of difficult airway associated with general anesthesia",
    "Provides controllable sympathectomy that decreases SVR (beneficial in high SVR state)",
    "Maintains maternal consciousness, protecting airway reflexes",
    "Allows adequate surgical anesthesia while preserving uteroplacental flow when hypotension is carefully avoided",
]:
    story.append(bp(reason))
story.append(sp(4))

story.append(h3("Platelet Count Thresholds for Neuraxial Block"))
plat_data = [
    ["Platelet Count", "Recommendation"],
    [">100,000/µL", "Neuraxial block safe to proceed"],
    ["70,000–100,000/µL", "Consider on individual risk-benefit basis; anesthesiologist's judgment; consider coagulation tests"],
    ["<70,000/µL", "Neuraxial block generally contraindicated; consider general anesthesia"],
    ["Rapidly falling count (HELLP)", "Repeat count close to procedure; trend matters as much as single value"],
]
story.append(make_table(plat_data[0], plat_data[1:], col_widths=[5*cm, 12*cm]))
story.append(sp(4))

story.append(h3("Epidural for Labor Analgesia — Key Points"))
for pt in [
    "Early epidural placement is strongly recommended in preeclampsia — provides labor analgesia and can be used for emergency cesarean delivery, avoiding need for GA",
    "Use low-concentration local anesthetic (bupivacaine 0.0625–0.1% with fentanyl 2 µg/mL) for labor — gradual onset limits hypotension",
    "Epidural preferred over spinal for labor analgesia as it allows titrated dosing",
    "Maintain BP within 20% of baseline; treat hypotension with vasopressors (phenylephrine preferred)",
    "Avoid large fluid boluses — use vasopressors instead to treat hypotension (reduces pulmonary edema risk)",
]:
    story.append(bp(pt))
story.append(sp(4))

story.append(h3("Spinal / CSE for Cesarean Delivery — Key Points"))
for pt in [
    "Spinal anesthesia is acceptable for cesarean delivery in preeclampsia — studies show it does NOT cause greater hypotension in preeclamptic vs. normotensive patients",
    "Standard spinal dose: heavy bupivacaine 10–12.5 mg + fentanyl 10–25 µg + morphine 100–200 µg intrathecally",
    "Pre-load or co-load with crystalloid (500–1000 mL) — although less important than in normotensive patients",
    "Phenylephrine infusion (100 µg/min, titrate) is first-line vasopressor for spinal hypotension; prevents fetal acidosis",
    "CSE offers flexibility: spinal for speed + epidural for extension/top-up if needed",
]:
    story.append(bp(pt))
story.append(sp(6))

story.append(h2("4.3  General Anesthesia — Indications & Management"))
story.append(p("General anesthesia may be required when neuraxial is contraindicated (coagulopathy, severe thrombocytopenia, patient refusal, urgent/emergent situation, failed neuraxial block). It carries higher risk in preeclampsia due to airway edema."))
story.append(sp(4))

story.append(h3("Indications for General Anesthesia in Preeclampsia"))
for ind in [
    "Thrombocytopenia <70,000/µL or coagulopathy (DIC)",
    "Maternal hemorrhage with hemodynamic instability",
    "Emergency cesarean where neuraxial is not feasible in time",
    "Patient refusal of neuraxial technique",
    "Failed neuraxial block requiring conversion",
    "Severe fetal bradycardia requiring immediate delivery",
]:
    story.append(bp(ind))
story.append(sp(4))

story.append(h3("Airway Management — Critical Considerations"))
story.append(warning_box("The preeclamptic airway is at HIGH RISK: Laryngeal/pharyngeal edema from capillary leak can cause Mallampati grade to worsen over time. A detailed airway exam must be performed close to the time of intubation, not at initial assessment hours earlier."))
story.append(sp(4))

airway_items = [
    "<b>Difficult airway preparation is MANDATORY</b> — have video laryngoscope, smaller ETT (6.0–6.5 mm), LMA as rescue, and surgical airway kit immediately available",
    "<b>Pre-oxygenation:</b> 3–5 min of 100% O₂ by tight-fitting mask; or 8 vital capacity breaths at 100% O₂",
    "<b>Rapid Sequence Induction (RSI):</b> Preoxygenation → cricoid pressure → induction agent + succinylcholine or high-dose rocuronium",
    "<b>Induction agents:</b> Propofol 1–2 mg/kg IV most commonly used. Ketamine (1–1.5 mg/kg IV) acceptable if hemodynamically unstable — note: may cause further BP rise, so pre-treat with antihypertensives",
    "<b>Attenuate pressor response to laryngoscopy</b> — critical in preeclampsia: use remifentanil 1–2 µg/kg IV OR labetalol 5–10 mg IV OR esmolol 1–2 mg/kg IV before laryngoscopy",
    "<b>Succinylcholine dose:</b> 1.5 mg/kg IV (standard RSI); note MgSO₄ prolongs duration — monitor TOF",
    "<b>Rocuronium:</b> 1.2 mg/kg IV for RSI if succinylcholine contraindicated; sugammadex for reversal; MgSO₄ potentiates — use TOF monitoring",
    "<b>Avoid</b> ketamine if severe hypertension is uncontrolled — may exacerbate",
    "<b>LMA</b> can be used as a rescue device if intubation fails — but does NOT protect against aspiration; use only temporarily",
    "<b>Video laryngoscopy</b> (GlideScope, C-MAC) — recommended as first-line or rescue device in all obstetric GAs",
]
for item in airway_items:
    story.append(bp(item))
story.append(sp(4))

story.append(h3("Intraoperative Management — General Anesthesia"))
for item in [
    "Maintenance: volatile agent (sevoflurane or desflurane) titrated to depth; avoid awareness (risk ~1:256 in cesarean GA)",
    "MgSO₄ potentiates NMBs — reduce rocuronium/vecuronium doses by 30–50%; use TOF monitoring throughout",
    "Antihypertensive infusion during GA: labetalol or nicardipine infusion to maintain target BP",
    "Uterine displacement: left lateral tilt 15–30° to relieve aortocaval compression",
    "After delivery: oxytocin 5 IU slow IV push (do NOT bolus rapidly — causes hypotension); ergometrine CONTRAINDICATED in preeclampsia (causes severe vasoconstriction and HTN crisis)",
    "Carboprost (PGF2α) use with caution — can cause bronchoconstriction and pulmonary HTN",
    "Extubation: extubate awake when fully reversed and protective reflexes intact; beware re-intubation difficulty if airway edema progresses",
]:
    story.append(bp(item))
story.append(sp(6))

# ─── SPECIFIC SCENARIOS ──────────────────────────────────────────────────────
story.append(section_header("5. SPECIFIC ANESTHESIA SCENARIOS"))
story.append(sp(6))

story.append(h2("5.1  Eclampsia (Seizures) — Anesthesia Management"))
story.append(p("Eclampsia is new-onset convulsions in a preeclamptic patient. Requires immediate multidisciplinary management."))
story.append(sp(4))

seizure_steps = [
    ("Airway & Oxygenation", "Position patient in left lateral decubitus; administer 100% O₂ by mask; suction airway; protect from injury; DO NOT insert airway during tonic phase (risk of dental/bite injury)"),
    ("Stop seizure", "MgSO₄ 4–6 g IV over 5–10 min (bolus); if already on MgSO₄, re-bolus 2 g IV. If MgSO₄ fails: benzodiazepines (lorazepam 2–4 mg IV or diazepam 5–10 mg IV)"),
    ("Prevent recurrence", "MgSO₄ maintenance infusion 1–2 g/hr; continue for 24–48h postpartum"),
    ("Control BP", "IV labetalol or hydralazine to target SBP <160 mmHg; avoid abrupt drops"),
    ("Delivery", "Once maternal condition is stabilized, delivery is indicated regardless of gestational age; mode depends on obstetric assessment"),
    ("Monitoring", "Continuous pulse oximetry, ECG, NIBP every 5–15 min; Foley catheter; consider arterial line + ICU admission for severe cases"),
    ("Intubation considerations", "If intubation is required (persistent status epilepticus, respiratory failure, aspiration): RSI with full difficult airway preparation; blunt pressor response to laryngoscopy"),
]
for step, detail in seizure_steps:
    story.append(bp(f"<b>{step}:</b> {detail}"))
story.append(sp(6))

story.append(h2("5.2  HELLP Syndrome — Anesthesia Considerations"))
story.append(p("<b>HELLP = Hemolysis + Elevated Liver Enzymes + Low Platelets.</b> A severe form of preeclampsia with significant implications for anesthetic choice."))
story.append(sp(4))

for item in [
    "<b>Platelet count</b> may be critically low and can fall rapidly — obtain count as close to procedure as possible; trend is important",
    "<b>Neuraxial block</b>: avoid if platelets <70,000/µL; consider risks vs. benefits at 70,000–100,000/µL",
    "<b>Coagulopathy (DIC)</b>: check PT, aPTT, fibrinogen, D-dimer; if DIC present, neuraxial contraindicated",
    "<b>Hepatic involvement</b>: elevated transaminases; risk of subcapsular hematoma — avoid abdominal trauma; careful patient positioning",
    "<b>Hemolysis</b>: may cause rapid decline in hemoglobin — type and cross, keep blood products available",
    "<b>General anesthesia</b> often required due to coagulopathy — prepare for difficult airway",
    "<b>Postoperative</b>: HELLP may worsen postpartum; continue close monitoring for 24–48h in ICU; platelet nadir typically 24–48h postpartum",
]:
    story.append(bp(item))
story.append(sp(6))

story.append(h2("5.3  Pulmonary Edema in Preeclampsia"))
for item in [
    "Incidence ~3% in preeclampsia; higher postpartum due to fluid mobilization",
    "Etiology: capillary leak + decreased oncotic pressure + excessive fluids + reduced LV function",
    "Treatment: oxygen (high-flow or CPAP/BiPAP), furosemide 20–40 mg IV, fluid restriction; consider morphine 2–4 mg IV (vasodilation + anxiolysis)",
    "Endotracheal intubation and mechanical ventilation if severe (SpO₂ <90% despite O₂); use PEEP 5–8 cmH₂O; protective ventilation (tidal volume 6–8 mL/kg IBW)",
    "Avoid epidural top-up for cesarean until pulmonary edema is treated — sympathectomy from high block may worsen hemodynamics",
]:
    story.append(bp(item))
story.append(sp(6))

# ─── POSTPARTUM MANAGEMENT ───────────────────────────────────────────────────
story.append(section_header("6. POSTPARTUM ANESTHESIA & ICU CARE"))
story.append(sp(6))
story.append(p("Preeclampsia does not resolve immediately after delivery. Hypertension and end-organ dysfunction can persist or worsen in the first 24–72 hours postpartum."))
story.append(sp(4))

postpartum = [
    "<b>BP monitoring:</b> Continue for at least 72h postpartum; HTN can develop or worsen postpartum",
    "<b>MgSO₄:</b> Continue infusion for 24–48h postpartum for seizure prophylaxis in severe preeclampsia/eclampsia",
    "<b>Antihypertensives:</b> Oral antihypertensives (labetalol, nifedipine, amlodipine) — avoid ACE inhibitors and ARBs if breastfeeding",
    "<b>Fluid management:</b> Restrict IV fluids; mobilization phase may unmask latent pulmonary edema",
    "<b>Analgesia:</b> NSAIDs (ibuprofen, ketorolac) generally safe for postpartum analgesia but caution if renal impairment or thrombocytopenia; paracetamol + opioids as backup",
    "<b>DVT prophylaxis:</b> LMWH once platelet count >75,000 and no active bleeding; early ambulation",
    "<b>ICU criteria:</b> Admission to HDU/ICU for: eclampsia, HELLP, pulmonary edema, oliguria/AKI, continuous antihypertensive infusion, GCS <15",
    "<b>NSAIDs caution:</b> Avoid if creatinine elevated or platelet count low",
]
for item in postpartum:
    story.append(bp(item))
story.append(sp(6))

# ─── DRUG INTERACTIONS ───────────────────────────────────────────────────────
story.append(section_header("7. KEY DRUG INTERACTIONS — ANESTHESIA EXAM"))
story.append(sp(6))

di_data = [
    ["Interaction", "Mechanism", "Clinical Significance"],
    ["MgSO₄ + Succinylcholine", "Mg blocks presynaptic ACh release + stabilizes postjunctional membrane", "Prolonged neuromuscular blockade; reduce dose by 30%, use TOF monitoring"],
    ["MgSO₄ + Non-depolarizing NMBs (rocuronium, vecuronium, atracurium)", "Potentiates via Ca²⁺ antagonism at NMJ", "Significant prolongation; reduce dose by 30–50%; TOF monitoring mandatory"],
    ["MgSO₄ + Nifedipine", "Combined vasodilation + myocardial depression", "Additive hypotension; neuromuscular blockade has been reported; monitor BP closely"],
    ["MgSO₄ + Oxytocin", "Both vasodilatory; combined cardiovascular depression", "Avoid rapid oxytocin bolus; use slow infusion"],
    ["Ergometrine + HTN", "Potent vasoconstrictor", "CONTRAINDICATED in preeclampsia — causes severe hypertensive crisis and pulmonary HTN"],
    ["Labetalol + Volatile Agents", "Additive cardiac depression", "Monitor BP; adjust volatile agent concentration"],
    ["Ketamine + Severe HTN", "Sympathomimetic — increases BP, HR", "Avoid or use with caution; if used, give antihypertensive pretreatment"],
]
story.append(make_table(di_data[0], di_data[1:], col_widths=[4*cm, 6*cm, 7*cm]))
story.append(sp(6))

# ─── MONITORING ──────────────────────────────────────────────────────────────
story.append(section_header("8. MONITORING IN PREECLAMPSIA"))
story.append(sp(6))

story.append(h2("Standard (All Cases)"))
for m in ["Non-invasive BP (every 5 min intraoperatively)", "Continuous pulse oximetry (SpO₂)", "ECG", "Capnography (if intubated)", "Temperature", "Urine output via Foley catheter (target ≥0.5 mL/kg/hr)", "TOF monitoring if MgSO₄ on board and NMBs used"]:
    story.append(bp(m))
story.append(sp(4))

story.append(h2("Invasive (Severe Cases / ICU)"))
for m in [
    "Arterial line: for continuous BP monitoring; indicated in: continuous antihypertensive infusion, hemodynamic instability, severe HELLP, GA for cesarean in high-risk patient",
    "Central venous catheter: for vasoactive drug administration; CVP unreliable as fluid guide in preeclampsia — use for drug delivery, not fluid status",
    "Pulmonary artery catheter (PAC): NOT routinely recommended; high complication risk; use only in rare cases of refractory pulmonary edema or severe LV dysfunction",
    "Point-of-care ultrasound (POCUS): assess volume status, LV function, IVC collapsibility; increasingly preferred over invasive monitoring",
    "Fetal monitoring: continuous CTG throughout labor; note effects of maternal position and epidural on fetal HR patterns",
]:
    story.append(bp(m))
story.append(sp(6))

# ─── QUICK REFERENCE BOXES ───────────────────────────────────────────────────
story.append(PageBreak())
story.append(section_header("9. EXAM QUICK REFERENCE SUMMARY"))
story.append(sp(6))

story.append(h2("Definitive Treatment"))
story.append(warning_box("The ONLY definitive treatment for preeclampsia is DELIVERY. All other management is supportive and to prevent/treat complications until delivery is feasible."))
story.append(sp(6))

story.append(h2("Timing of Delivery (ACOG Guidelines)"))
timing_data = [
    ["Condition", "Recommended Delivery Timing"],
    ["Preeclampsia without severe features", "≥37 weeks gestation (induction or cesarean as indicated)"],
    ["Preeclampsia with severe features", "≥34 weeks; if <34 weeks, consider steroids (betamethasone) for fetal lung maturity and then deliver; if <24 weeks, delivery recommended"],
    ["Eclampsia", "Immediate delivery after maternal stabilization, regardless of gestational age"],
    ["HELLP Syndrome", "Delivery at ≥34 weeks; steroids + delivery if <34 weeks; immediate delivery if DIC, abruption, renal failure, or fetal compromise"],
]
story.append(make_table(timing_data[0], timing_data[1:], col_widths=[6*cm, 11*cm]))
story.append(sp(6))

story.append(h2("Neuraxial vs. General Anesthesia — Decision Summary"))
ne_data = [
    ["Factor", "Favors Neuraxial", "Favors General Anesthesia"],
    ["Platelets", ">100,000/µL — safe; 70–100k — discuss", "<70,000/µL or DIC"],
    ["Airway", "Edematous airway = AVOID GA", "If neuraxial fails or contraindicated"],
    ["Speed", "Pre-placed epidural: fastest for cesarean", "De novo spinal if epidural not in place"],
    ["Hemodynamics", "Gradual BP reduction is beneficial in high SVR state", "Need for controlled ventilation in resp. failure"],
    ["BP control", "Epidural reduces catecholamine surges from pain", "GA still requires strict antihypertensive therapy"],
]
story.append(make_table(ne_data[0], ne_data[1:], col_widths=[4*cm, 6.5*cm, 6.5*cm]))
story.append(sp(6))

story.append(h2("MgSO₄ Monitoring — Exam Mnemonic"))
story.append(tip_box('Mnemonic "RRUP" — 4 signs to monitor when on MgSO₄: Reflexes (patellar), Respirations (>12/min), Urine output (>25 mL/hr), Plasma levels. Reversal = Calcium gluconate 1g IV.'))
story.append(sp(6))

story.append(h2("Top 10 Anesthesia Exam Points"))
top10 = [
    "Preeclampsia = HTN (≥140/90) after 20 weeks + proteinuria or end-organ damage",
    "Definitive treatment = delivery; all management is bridging",
    "Neuraxial anesthesia is PREFERRED in preeclampsia (avoid difficult airway risks of GA)",
    "MgSO₄ is drug of choice for eclampsia seizures — antidote is calcium gluconate",
    "MgSO₄ potentiates ALL neuromuscular blockers — reduce NMB doses and monitor TOF",
    "Ergometrine is CONTRAINDICATED in preeclampsia (causes hypertensive crisis)",
    "Phenylephrine is preferred vasopressor for spinal hypotension in preeclampsia",
    "Platelet count <70,000/µL: neuraxial contraindicated → use GA with full difficult airway prep",
    "Blunt pressor response to laryngoscopy in GA: use remifentanil, labetalol, or esmolol",
    "Nifedipine + MgSO₄: additive hypotension and risk of neuromuscular blockade — monitor closely",
]
for i, pt in enumerate(top10, 1):
    story.append(Paragraph(f"<b>{i}.</b>  {pt}", bullet_style))
story.append(sp(8))

# ─── REFERENCES ──────────────────────────────────────────────────────────────
story.append(hr())
story.append(h2("References"))
refs = [
    "Barash PG, Cullen BF, Stoelting RK, et al. Barash, Cullen, and Stoelting's Clinical Anesthesia, 9th ed. Wolters Kluwer; 2022. Chapter 41: Obstetric Anesthesia.",
    "Miller RD, et al. Miller's Anesthesia, 2-Volume Set, 10th ed. Elsevier; 2024. Chapter 58: Anesthesia for Cesarean Delivery.",
    "Creasy RK, Resnik R, et al. Creasy & Resnik's Maternal-Fetal Medicine: Principles and Practice, 9th ed. Elsevier; 2022. Chapters 45 and 76.",
    "ACOG Practice Bulletin No. 222: Gestational Hypertension and Preeclampsia. Obstet Gynecol. 2020;135(6):e237–e260.",
    "ACOG Committee Opinion No. 767: Emergent Therapy for Acute-Onset, Severe Hypertension During Pregnancy and the Postpartum Period. 2019.",
    "Society for Obstetric Anesthesia and Perinatology (SOAP). Consensus Statement on the Management of Cardiac Arrest in Pregnancy, 2020.",
]
for ref in refs:
    story.append(Paragraph(ref, ref_style))

# ─── BUILD PDF ────────────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF generated: {OUTPUT}")
Running Command

cd /tmp/workspace/preeclampsia-pdf && python generate_pdf.py 2>&1

Running Command

ls -lh /tmp/workspace/preeclampsia-pdf/

Your PDF is ready for download:

Preeclampsia Management Anesthesia

PDF Document · PDF


What's Inside the PDF

The document is structured as a complete anesthesia exam answer across 9 sections, sourced from Barash's Clinical Anesthesia 9e, Miller's Anesthesia 10e, and Creasy & Resnik's MFM:

Section Breakdown

1. Definition & Classification
  • Full ACOG 4-category classification table (chronic HTN, gestational HTN, preeclampsia, severe features, superimposed, eclampsia, HELLP)
  • All 7 severe feature criteria listed
2. Pathophysiology (Anesthesia Relevance)
  • System-by-system table: cardiovascular, CNS, coagulation, renal, hepatic, pulmonary, uteroplacental - each with specific anesthesia implication
3. Antihypertensive Therapy
  • Full drug table: Labetalol, Hydralazine, Nifedipine, Nicardipine, Nitroprusside with doses, benefits, risks
  • ACOG 2019 hypertensive emergency protocol
  • MgSO₄ dosing, toxicity levels, antidote (calcium gluconate)
  • Fluid management principles
4. Anesthesia Management (Core Section)
  • Pre-anesthetic assessment checklist
  • Neuraxial anesthesia: why it is preferred, platelet thresholds table, epidural for labor, spinal/CSE for cesarean
  • General anesthesia: indications, RSI protocol, airway management (edema warning), pressor response attenuation, NMB modifications with MgSO₄, ergometrine contraindication
5. Specific Scenarios
  • Eclampsia seizure management step-by-step
  • HELLP syndrome anesthesia considerations
  • Pulmonary edema management and ventilation
6. Postpartum ICU Care
  • MgSO₄ continuation, oral antihypertensives, DVT prophylaxis, ICU admission criteria
7. Drug Interactions Table
  • MgSO₄ + succinylcholine, NDNMBs, nifedipine, oxytocin; ergometrine contraindication; ketamine warning
8. Monitoring
  • Standard vs. invasive monitoring criteria; TOF monitoring; POCUS
9. Exam Quick Reference
  • Delivery timing table by severity
  • Neuraxial vs. GA decision table
  • MgSO₄ "RRUP" monitoring mnemonic
  • Top 10 anesthesia exam bullet points
This is a shared conversation. Sign in to Orris to start your own chat.