Hie

Hey! How can I help you today?

Ahh heperine and warfrin nclex rn mst pdf bna

Asking for Preferences
Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Running Command

mkdir -p /home/daytona/workspace/heparin-warfarin-nclex && ls /home/daytona/work…

Writing File

~/heparin-warfarin-nclex/build_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, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak

OUTPUT = "/home/daytona/workspace/heparin-warfarin-nclex/Heparin_Warfarin_NCLEX_RN.pdf"

doc = SimpleDocTemplate(
    OUTPUT,
    pagesize=A4,
    rightMargin=1.8*cm,
    leftMargin=1.8*cm,
    topMargin=2*cm,
    bottomMargin=2*cm,
)

styles = getSampleStyleSheet()

# ── Custom styles ──────────────────────────────────────────────
NAVY   = colors.HexColor("#0D2B55")
TEAL   = colors.HexColor("#0077A8")
ORANGE = colors.HexColor("#E87722")
LBODY  = colors.HexColor("#2C2C2C")
LGRAY  = colors.HexColor("#F0F4F8")
RED    = colors.HexColor("#C0392B")
GREEN  = colors.HexColor("#1A7A4A")

title_style = ParagraphStyle(
    "TitleStyle", parent=styles["Title"],
    fontSize=22, textColor=colors.white, leading=28,
    alignment=TA_CENTER, fontName="Helvetica-Bold",
    spaceAfter=4
)
subtitle_style = ParagraphStyle(
    "SubtitleStyle", parent=styles["Normal"],
    fontSize=11, textColor=colors.HexColor("#AEDDF5"),
    alignment=TA_CENTER, fontName="Helvetica", spaceAfter=6
)
section_style = ParagraphStyle(
    "SectionStyle", parent=styles["Heading1"],
    fontSize=13, textColor=colors.white, leading=18,
    fontName="Helvetica-Bold", spaceAfter=4, spaceBefore=8,
    leftIndent=0
)
h2_style = ParagraphStyle(
    "H2Style", parent=styles["Heading2"],
    fontSize=11, textColor=NAVY, leading=15,
    fontName="Helvetica-Bold", spaceAfter=3, spaceBefore=6
)
body_style = ParagraphStyle(
    "BodyStyle", parent=styles["Normal"],
    fontSize=9.5, textColor=LBODY, leading=14,
    fontName="Helvetica", spaceAfter=4, leftIndent=6
)
bullet_style = ParagraphStyle(
    "BulletStyle", parent=styles["Normal"],
    fontSize=9.5, textColor=LBODY, leading=14,
    fontName="Helvetica", spaceAfter=3, leftIndent=14,
    bulletIndent=6
)
nclex_tip_style = ParagraphStyle(
    "NclexTip", parent=styles["Normal"],
    fontSize=9.5, textColor=colors.HexColor("#7B3600"), leading=13,
    fontName="Helvetica-BoldOblique", leftIndent=6
)
warning_style = ParagraphStyle(
    "WarningStyle", parent=styles["Normal"],
    fontSize=9.5, textColor=RED, leading=13,
    fontName="Helvetica-Bold", leftIndent=6
)
small_style = ParagraphStyle(
    "SmallStyle", parent=styles["Normal"],
    fontSize=8, textColor=colors.grey, leading=11,
    fontName="Helvetica", alignment=TA_CENTER
)

def section_header(text, color=NAVY):
    """Returns a coloured section header block."""
    data = [[Paragraph(text, section_style)]]
    tbl = Table(data, colWidths=[17.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND", (0,0), (-1,-1), color),
        ("ROUNDEDCORNERS", [6,6,6,6]),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
    ]))
    return tbl

def highlight_box(text, bg=LGRAY, border=TEAL):
    data = [[Paragraph(text, body_style)]]
    tbl = Table(data, colWidths=[17.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), bg),
        ("BOX",          (0,0), (-1,-1), 1.5, border),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
    ]))
    return tbl

def nclex_tip_box(text):
    tip_bg = colors.HexColor("#FFF3E0")
    data = [[Paragraph("⭐ NCLEX TIP: " + text, nclex_tip_style)]]
    tbl = Table(data, colWidths=[17.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), tip_bg),
        ("BOX",          (0,0), (-1,-1), 1.5, ORANGE),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
    ]))
    return tbl

def warning_box(text):
    warn_bg = colors.HexColor("#FDECEA")
    data = [[Paragraph("⚠ " + text, warning_style)]]
    tbl = Table(data, colWidths=[17.4*cm])
    tbl.setStyle(TableStyle([
        ("BACKGROUND",   (0,0), (-1,-1), warn_bg),
        ("BOX",          (0,0), (-1,-1), 1.5, RED),
        ("TOPPADDING",    (0,0), (-1,-1), 6),
        ("BOTTOMPADDING", (0,0), (-1,-1), 6),
        ("LEFTPADDING",   (0,0), (-1,-1), 10),
        ("RIGHTPADDING",  (0,0), (-1,-1), 10),
    ]))
    return tbl

def two_col_table(headers, rows, col_widths=None):
    if col_widths is None:
        col_widths = [5*cm, 12.4*cm]
    header_row = [Paragraph(h, ParagraphStyle("TH", fontName="Helvetica-Bold",
                  fontSize=9.5, textColor=colors.white, leading=13)) for h in headers]
    body_rows = []
    for row in rows:
        body_rows.append([Paragraph(str(c), body_style) for c in row])
    data = [header_row] + body_rows
    tbl = Table(data, colWidths=col_widths, repeatRows=1)
    ts = TableStyle([
        ("BACKGROUND",   (0,0), (-1,0), NAVY),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.white, LGRAY]),
        ("BOX",          (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
        ("INNERGRID",    (0,0), (-1,-1), 0.3, colors.HexColor("#DDDDDD")),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
    ])
    tbl.setStyle(ts)
    return tbl

def comparison_table(headers, rows, col_widths=None):
    if col_widths is None:
        col_widths = [5*cm, 6.2*cm, 6.2*cm]
    header_row = [Paragraph(h, ParagraphStyle("TH2", fontName="Helvetica-Bold",
                  fontSize=10, textColor=colors.white, leading=14)) for h in headers]
    body_rows = []
    for i, row in enumerate(rows):
        style = body_style
        body_rows.append([Paragraph(str(c), style) for c in row])
    data = [header_row] + body_rows
    tbl = Table(data, colWidths=col_widths, repeatRows=1)
    ts = TableStyle([
        ("BACKGROUND",    (0,0), (0,0), NAVY),
        ("BACKGROUND",    (1,0), (1,0), TEAL),
        ("BACKGROUND",    (2,0), (2,0), ORANGE),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.white, LGRAY]),
        ("BOX",           (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
        ("INNERGRID",     (0,0), (-1,-1), 0.3, colors.HexColor("#DDDDDD")),
        ("TOPPADDING",    (0,0), (-1,-1), 5),
        ("BOTTOMPADDING", (0,0), (-1,-1), 5),
        ("LEFTPADDING",   (0,0), (-1,-1), 6),
        ("RIGHTPADDING",  (0,0), (-1,-1), 6),
        ("VALIGN",        (0,0), (-1,-1), "TOP"),
        ("FONTNAME",      (0,1), (0,-1), "Helvetica-Bold"),
    ])
    tbl.setStyle(ts)
    return tbl

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

# ── TITLE BANNER ──────────────────────────────────────────────────
title_data = [[Paragraph("HEPARIN & WARFARIN", title_style)],
              [Paragraph("NCLEX-RN Master Study Notes", subtitle_style)],
              [Paragraph("Pharmacology | Anticoagulation Therapy | Nursing Care", subtitle_style)]]
title_tbl = Table(title_data, colWidths=[17.4*cm])
title_tbl.setStyle(TableStyle([
    ("BACKGROUND",   (0,0), (-1,-1), NAVY),
    ("TOPPADDING",    (0,0), (-1,-1), 10),
    ("BOTTOMPADDING", (0,0), (-1,-1), 10),
    ("LEFTPADDING",   (0,0), (-1,-1), 12),
    ("RIGHTPADDING",  (0,0), (-1,-1), 12),
    ("ROUNDEDCORNERS",[8,8,8,8]),
]))
story.append(title_tbl)
story.append(Spacer(1, 10))

# ── QUICK REFERENCE COMPARISON ────────────────────────────────────
story.append(section_header("QUICK COMPARISON: HEPARIN vs WARFARIN", NAVY))
story.append(Spacer(1, 6))

comp_rows = [
    ["Drug Class",      "Parenteral anticoagulant (UFH / LMWH)", "Oral anticoagulant (Vitamin K antagonist)"],
    ["Route",           "IV or Subcutaneous (SC) ONLY — never oral", "Oral (tablet)"],
    ["Onset of Action", "IV: minutes | SC: 1-2 hours", "Slow: 2-5 days (needs bridging)"],
    ["Mechanism",       "Activates antithrombin III → inactivates thrombin (IIa) and factor Xa", "Inhibits synthesis of Vitamin K-dependent clotting factors (II, VII, IX, X) and proteins C & S"],
    ["Lab Monitoring",  "aPTT (activated partial thromboplastin time)\nTherapeutic: 1.5-2.5x normal (60-100 sec)", "PT/INR\nTherapeutic: INR 2-3 (most indications)\nMechanical valves: INR 2.5-3.5"],
    ["Antidote",        "Protamine Sulfate (IV)", "Vitamin K (phytonadione)\n+ FFP / 4-Factor PCC for emergency reversal"],
    ["Use in Pregnancy","SAFE — does not cross placenta", "CONTRAINDICATED — teratogenic"],
    ["Onset Reversal",  "Immediate with protamine sulfate", "Oral Vit K: 12-24 h | IV Vit K: 6-12 h"],
    ["Storage",         "Hospital/IV setting", "Home use — patient education required"],
    ["Interactions",    "Minimal (mainly other anticoagulants)", "Many: NSAIDs, aspirin, antibiotics, foods rich in Vitamin K"],
]
story.append(comparison_table(["Feature", "HEPARIN (UFH/LMWH)", "WARFARIN (Coumadin)"], comp_rows))
story.append(Spacer(1, 8))
story.append(nclex_tip_box(
    "Remember: Heparin = aPTT (aPTT has the letter 'P' like Parenteral). "
    "Warfarin = PT/INR (Warfarin = Oral = INR). This distinction is extremely common on NCLEX!"
))
story.append(Spacer(1, 10))

# ══════════════════════════════════════════════════════════════════
# SECTION 1: HEPARIN
# ══════════════════════════════════════════════════════════════════
story.append(section_header("SECTION 1: HEPARIN (Unfractionated & LMWH)", TEAL))
story.append(Spacer(1, 6))

story.append(Paragraph("Mechanism of Action", h2_style))
story.append(Paragraph(
    "Heparin binds to <b>antithrombin III</b> (AT-III), a naturally occurring coagulation inhibitor. "
    "This binding causes a conformational change that accelerates AT-III's ability to inactivate <b>thrombin (factor IIa)</b> "
    "and <b>factor Xa</b> by approximately <b>1,000-fold</b>. "
    "The end result is prevention of fibrin clot formation.",
    body_style
))
story.append(Paragraph(
    "<b>LMWH (e.g., Enoxaparin/Lovenox, Dalteparin/Fragmin)</b>: preferentially inactivates <b>factor Xa only</b> "
    "(does not bind thrombin as avidly). More predictable pharmacokinetics.",
    body_style
))
story.append(Spacer(1, 6))

story.append(Paragraph("Indications (Therapeutic Uses)", h2_style))
indications_hep = [
    ["DVT / Pulmonary Embolism (PE) — treatment and prophylaxis"],
    ["Acute MI (myocardial infarction)"],
    ["Atrial fibrillation (with cardioversion risk)"],
    ["Bridge therapy when starting warfarin (until therapeutic INR)"],
    ["Post-operative DVT prophylaxis (hip/knee replacement, major surgery)"],
    ["Anticoagulant of choice in PREGNANCY (does not cross placenta)"],
    ["Hemodialysis and cardiac surgery (extracorporeal circuits)"],
]
for row in indications_hep:
    story.append(Paragraph("• " + row[0], bullet_style))
story.append(Spacer(1, 6))

story.append(Paragraph("Route & Administration", h2_style))
admin_hep_rows = [
    ["IV Infusion (UFH)", "Continuous IV drip — most common for acute treatment\nLoading bolus then maintenance infusion\nMonitor aPTT every 6 hours until stable, then daily"],
    ["Subcutaneous (SC/SQ)", "For prophylaxis — abdomen (2 inches from umbilicus)\nDo NOT aspirate; do NOT rub the site after injection\nAlternate sites; rotate injection sites"],
    ["LMWH (Enoxaparin)", "SC injection — abdomen preferred\nDose: 1 mg/kg SC every 12h (treatment) OR 40 mg SC daily (prophylaxis)\nMonitor anti-Xa levels in renal impairment, pregnancy, obesity"],
]
story.append(two_col_table(["Route", "Key Points"], admin_hep_rows, [4.5*cm, 12.9*cm]))
story.append(Spacer(1, 6))

story.append(Paragraph("Monitoring — aPTT", h2_style))
story.append(highlight_box(
    "<b>Normal aPTT:</b> 25-35 seconds | "
    "<b>Therapeutic aPTT (on heparin):</b> 60-100 seconds (1.5 to 2.5 x normal)<br/>"
    "Check aPTT 6 hours after any dose change. Once stable, check daily.<br/>"
    "<b>LMWH monitoring:</b> Usually NOT required — but check <b>anti-Xa levels</b> in renal impairment, pregnancy, obesity, extremes of body weight."
))
story.append(Spacer(1, 6))

story.append(Paragraph("Adverse Effects", h2_style))
ae_hep_rows = [
    ["Bleeding (major risk)", "Most common/serious. Monitor all injection/IV sites, urine (hematuria), stool (melena), neurological changes (intracranial bleed). Have PROTAMINE SULFATE ready."],
    ["HIT — Heparin-Induced Thrombocytopenia (Type I)", "Mild, non-immune, transient drop in platelets. Occurs within 2 days of starting heparin. Resolves even with continued therapy. NOT dangerous."],
    ["HIT — Type II (HITT)", "Immune-mediated! Occurs 5-10 days after heparin. Platelet count drops >50% from baseline. PARADOXICALLY causes THROMBOSIS (not just bleeding). STOP all heparin immediately — including heparin flushes! Switch to direct thrombin inhibitor (argatroban, bivalirudin)."],
    ["Osteoporosis", "With long-term use (>6 months)"],
    ["Hyperkalemia", "Aldosterone suppression — monitor potassium"],
]
story.append(two_col_table(["Adverse Effect", "Nursing Considerations"], ae_hep_rows, [4.5*cm, 12.9*cm]))
story.append(Spacer(1, 6))

story.append(warning_box(
    "HIT Type II is HIGH-YIELD NCLEX! Platelets DROP but patient gets CLOTS (HITT). "
    "Stop ALL heparin — including heparin flushes and heparin-coated catheters. NEVER give warfarin until platelet count recovers."
))
story.append(Spacer(1, 6))

story.append(Paragraph("Antidote: Protamine Sulfate", h2_style))
story.append(highlight_box(
    "<b>Protamine Sulfate</b> — binds and neutralizes heparin<br/>"
    "• Given IV slowly (over 10 min — rapid infusion causes hypotension/bradycardia)<br/>"
    "• 1 mg protamine neutralizes 100 units of heparin<br/>"
    "• LMWH: protamine only partially reverses (neutralizes ~60% anti-Xa activity)<br/>"
    "• Monitor for anaphylaxis — especially in patients with fish allergy or prior protamine exposure"
))
story.append(Spacer(1, 6))

story.append(Paragraph("Contraindications", h2_style))
contra_hep = [
    "Active bleeding or uncontrolled hemorrhage",
    "Thrombocytopenia (low platelets < 100,000) — especially HIT",
    "Recent neurosurgery, eye surgery, or spinal procedures",
    "Hypersensitivity to heparin or pork products",
    "Severe hepatic disease (heparin is metabolized in liver)",
]
for c in contra_hep:
    story.append(Paragraph("• " + c, bullet_style))
story.append(Spacer(1, 6))

story.append(nclex_tip_box(
    "NEVER give heparin IM (intramuscular) — causes hematomas. Only IV or SC routes are appropriate."
))
story.append(Spacer(1, 10))

# ══════════════════════════════════════════════════════════════════
# SECTION 2: WARFARIN
# ══════════════════════════════════════════════════════════════════
story.append(PageBreak())
story.append(section_header("SECTION 2: WARFARIN (Coumadin)", ORANGE))
story.append(Spacer(1, 6))

story.append(Paragraph("Mechanism of Action", h2_style))
story.append(Paragraph(
    "Warfarin inhibits <b>Vitamin K epoxide reductase</b>, blocking the regeneration of active Vitamin K. "
    "This prevents the synthesis (carboxylation) of <b>Vitamin K-dependent clotting factors: II, VII, IX, X</b> "
    "(remember: <b>\"1972\"</b>), and anticoagulant proteins <b>C and S</b>.",
    body_style
))
story.append(Paragraph(
    "<b>Key point:</b> Warfarin does NOT destroy existing clotting factors — it prevents NEW ones from being made. "
    "This is why onset takes 2-5 days (time for existing factors to be cleared from the blood).",
    body_style
))
story.append(Spacer(1, 6))

story.append(Paragraph("Indications", h2_style))
indications_war = [
    "Atrial fibrillation — stroke prevention",
    "DVT / Pulmonary Embolism (PE) — long-term treatment (3-6 months)",
    "Mechanical heart valves — lifelong anticoagulation",
    "Dilated cardiomyopathy / ventricular thrombus",
    "After initial heparin therapy (bridging)",
]
for i in indications_war:
    story.append(Paragraph("• " + i, bullet_style))
story.append(Spacer(1, 6))

story.append(Paragraph("Monitoring — PT/INR", h2_style))
story.append(highlight_box(
    "<b>PT (Prothrombin Time):</b> Normal = 11-13.5 seconds<br/>"
    "<b>INR (International Normalized Ratio):</b> Normal = 0.8-1.2<br/><br/>"
    "<b>Therapeutic INR ranges:</b><br/>"
    "• Most indications (DVT, AF, PE): <b>INR 2.0-3.0</b><br/>"
    "• Mechanical heart valves, recurrent thromboembolism: <b>INR 2.5-3.5</b><br/><br/>"
    "Monitor INR daily initially, then weekly, then monthly once stable."
))
story.append(Spacer(1, 6))

story.append(Paragraph("Adverse Effects", h2_style))
ae_war_rows = [
    ["Bleeding", "Most serious adverse effect. Minor: bruising, nosebleeds, prolonged bleeding from cuts. Major: hematuria, melena, intracranial hemorrhage. Antidote = Vitamin K."],
    ["Warfarin-Induced Skin Necrosis", "Rare. Occurs 3-5 days after starting warfarin. Caused by early drop in protein C (short half-life) before coagulation factors decline — causing paradoxical hypercoagulable state. Risk increased in protein C or S deficiency."],
    ["Purple Toe Syndrome", "Rare. Painful blue-tinged discoloration of toes. Caused by cholesterol emboli from plaques."],
    ["Teratogenicity", "CONTRAINDICATED in pregnancy — crosses the placenta. Causes warfarin embryopathy, fetal hemorrhage. Use heparin instead."],
]
story.append(two_col_table(["Adverse Effect", "Details"], ae_war_rows, [4.5*cm, 12.9*cm]))
story.append(Spacer(1, 6))

story.append(Paragraph("Antidote: Vitamin K (Phytonadione)", h2_style))
story.append(highlight_box(
    "<b>Vitamin K (phytonadione)</b> — reverses warfarin effect<br/>"
    "• <b>Oral Vit K</b>: onset 12-24 hours (minor over-anticoagulation)<br/>"
    "• <b>IV Vit K</b>: onset 6-12 hours (give slowly — risk of anaphylaxis)<br/>"
    "• <b>Emergency reversal</b>: Fresh Frozen Plasma (FFP) or 4-Factor PCC (Prothrombin Complex Concentrate) for immediate reversal<br/>"
    "• IM route — AVOID in anticoagulated patients (hematoma risk)"
))
story.append(Spacer(1, 6))

story.append(Paragraph("Drug & Food Interactions (HIGH YIELD)", h2_style))
story.append(Paragraph("<b>Foods that INCREASE INR (increase bleeding risk) — decrease Vitamin K:</b>", h2_style))
increase_inr = [
    "Alcohol (acute use), grapefruit juice",
    "Antibiotics — kill gut bacteria that produce Vitamin K",
    "Aspirin/NSAIDs — displace warfarin from protein binding, inhibit platelets",
    "Amiodarone, fluconazole, metronidazole (Flagyl) — inhibit warfarin metabolism (CYP2C9)",
    "Fish oil, garlic, ginger supplements",
]
for item in increase_inr:
    story.append(Paragraph("• " + item, bullet_style))

story.append(Spacer(1, 4))
story.append(Paragraph("<b>Foods that DECREASE INR (decrease anticoagulant effect) — increase Vitamin K:</b>", h2_style))
decrease_inr = [
    "Foods HIGH in Vitamin K: leafy greens (spinach, kale, broccoli, Brussels sprouts, cabbage)",
    "Vitamin K supplements",
    "Rifampin, carbamazepine, phenytoin, phenobarbital — induce CYP2C9 → speed warfarin metabolism",
    "St. John's Wort (herbal supplement)",
]
for item in decrease_inr:
    story.append(Paragraph("• " + item, bullet_style))

story.append(Spacer(1, 6))
story.append(nclex_tip_box(
    "Tell patients: Do NOT dramatically change Vitamin K intake. They CAN eat greens but must "
    "keep their intake CONSISTENT. Do not avoid greens entirely — just be consistent!"
))
story.append(Spacer(1, 10))

# ══════════════════════════════════════════════════════════════════
# SECTION 3: NURSING CARE & PATIENT EDUCATION
# ══════════════════════════════════════════════════════════════════
story.append(section_header("SECTION 3: NURSING CARE & PATIENT EDUCATION", colors.HexColor("#1A7A4A")))
story.append(Spacer(1, 6))

story.append(Paragraph("Nursing Assessment (Both Drugs)", h2_style))
assessment_rows = [
    ["Before Administration", "Check lab values (aPTT for heparin; INR for warfarin) BEFORE giving dose\nCheck for active bleeding: assess urine (pink/red), stool (black/tarry), skin (petechiae, ecchymosis)\nCheck baseline platelet count\nReview medication list for interactions\nAssess allergy history"],
    ["During Therapy", "Continuous IV heparin: check infusion pump rate hourly\nMonitor for signs of bleeding: BP drop, HR increase, change in neuro status\nFor heparin SQ: inspect injection sites for hematoma\nFor warfarin: assess skin (rash, purple toes, skin necrosis)\nMonitor platelet count q2-3 days for heparin (HIT surveillance)"],
    ["Fall Prevention", "Anticoagulated patients bleed easily — high fall-risk protocol\nPad side rails; ensure call light is in reach; non-slip footwear\nAvoid IM injections whenever possible"],
    ["Bleeding Precautions", "Soft toothbrush and electric razor\nApply firm pressure to venipuncture sites for 5 minutes\nAvoid contact sports; report unusual bruising or bleeding immediately\nWear medical alert bracelet"],
]
story.append(two_col_table(["Assessment Area", "Key Nursing Actions"], assessment_rows, [4*cm, 13.4*cm]))
story.append(Spacer(1, 6))

story.append(Paragraph("Patient Education: Warfarin", h2_style))
war_edu = [
    "Take warfarin at the SAME TIME every day — missed dose: take as soon as remembered if same day; skip if close to next dose",
    "Keep ALL follow-up appointments for INR monitoring",
    "Maintain CONSISTENT Vitamin K intake — don't start or stop eating leafy greens",
    "Avoid OTC drugs without checking: aspirin, ibuprofen, Naproxen increase bleeding risk",
    "Report immediately: unusual/prolonged bleeding, blood in urine or stool, severe headache, vision changes (signs of intracranial bleed)",
    "Wear medical alert identification (bracelet or card)",
    "Avoid alcohol (interferes with warfarin metabolism)",
    "Tell ALL healthcare providers (dentist, surgeons) you are on warfarin",
    "AVOID pregnancy — use reliable contraception",
    "Use soft bristle toothbrush; electric razor; avoid sharp objects",
]
for item in war_edu:
    story.append(Paragraph("• " + item, bullet_style))
story.append(Spacer(1, 6))

story.append(Paragraph("Patient Education: Heparin SC (Home/Outpatient)", h2_style))
hep_edu = [
    "Inject into the abdomen (2 inches away from umbilicus) — most common and recommended site",
    "Do NOT aspirate before injecting",
    "Do NOT rub the site after injection — increases bruising",
    "Rotate injection sites — keep track with a chart",
    "Store prefilled syringes per manufacturer instructions",
    "Report bruising, prolonged bleeding, or any signs of blood in urine/stool",
]
for item in hep_edu:
    story.append(Paragraph("• " + item, bullet_style))
story.append(Spacer(1, 10))

# ══════════════════════════════════════════════════════════════════
# SECTION 4: HIGH-YIELD NCLEX PRACTICE POINTS
# ══════════════════════════════════════════════════════════════════
story.append(section_header("SECTION 4: HIGH-YIELD NCLEX PRACTICE POINTS", NAVY))
story.append(Spacer(1, 6))

nclex_points = [
    ("Lab values", "Heparin → aPTT (goal: 60-100 sec, or 1.5-2.5x normal). Warfarin → INR (goal: 2-3 for most; 2.5-3.5 for mechanical valves)."),
    ("Antidotes", "Heparin antidote = Protamine Sulfate. Warfarin antidote = Vitamin K (phytonadione)."),
    ("HIT Type II", "Paradox: platelets DROP but patient CLOTS. Stop ALL heparin immediately. Never give warfarin during active HIT. Switch to argatroban or bivalirudin."),
    ("Warfarin + Pregnancy", "CONTRAINDICATED. Use heparin instead (safe — does not cross placenta)."),
    ("Warfarin onset", "Slow onset (2-5 days). Bridge with heparin until INR is therapeutic."),
    ("Skin Necrosis", "Can occur 3-5 days after starting warfarin — especially with protein C/S deficiency. Occurs because protein C falls first (short half-life), creating transient hypercoagulable state."),
    ("INR Too High (>3-4)", "Hold warfarin. Administer Vitamin K. Monitor closely. If actively bleeding → FFP or PCC."),
    ("aPTT Too High", "Reduce heparin infusion rate per protocol. Have protamine sulfate available."),
    ("Injection technique", "SQ heparin: NO aspiration, NO rubbing post-injection. 90-degree angle. Abdomen preferred."),
    ("Food interactions (Warfarin)", "Consistent Vitamin K intake is key. Leafy greens (spinach, kale) are high in Vit K. Antibiotics can raise INR by killing gut bacteria."),
    ("Priority nursing action", "If patient on heparin develops sudden drop in platelets AND new blood clot → STOP heparin IMMEDIATELY. This is HIT Type II."),
    ("Safe drug in pregnancy", "Heparin (UFH and LMWH) — large molecule, negative charge, does NOT cross placenta."),
]
nclex_data = [[Paragraph("Point", ParagraphStyle("TH3", fontName="Helvetica-Bold", fontSize=9.5, textColor=colors.white, leading=13)),
               Paragraph("Key Fact", ParagraphStyle("TH3", fontName="Helvetica-Bold", fontSize=9.5, textColor=colors.white, leading=13))]]
for topic, fact in nclex_points:
    nclex_data.append([
        Paragraph(topic, ParagraphStyle("NP", fontName="Helvetica-Bold", fontSize=9.5, textColor=NAVY, leading=13)),
        Paragraph(fact, body_style)
    ])
nclex_tbl = Table(nclex_data, colWidths=[4.5*cm, 12.9*cm], repeatRows=1)
nclex_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), NAVY),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.white, LGRAY]),
    ("BOX",           (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
    ("INNERGRID",     (0,0), (-1,-1), 0.3, colors.HexColor("#DDDDDD")),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
    ("RIGHTPADDING",  (0,0), (-1,-1), 6),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(nclex_tbl)
story.append(Spacer(1, 10))

# ══════════════════════════════════════════════════════════════════
# SECTION 5: MEMORY MNEMONICS
# ══════════════════════════════════════════════════════════════════
story.append(section_header("SECTION 5: MEMORY MNEMONICS", colors.HexColor("#5B2D8E")))
story.append(Spacer(1, 6))

mnem_rows = [
    ["Heparin lab = aPTT", '"H-aPTT" — Both have the letter A and P. Heparin is given IV/SC (Parenteral), aPTT monitors it.'],
    ["Warfarin lab = INR/PT", '"W-INR" — Warfarin = Oral = INR. W and I are close in alphabet.'],
    ["Vitamin K factors", '"1972" — Factors II, VII, IX, X are Vit K-dependent. Or: "Ten Ninety-Seven Two" (X, IX, VII, II).'],
    ["Warfarin antidote", '"War K" — WARfarin antidote = Vitamin K.'],
    ["Heparin antidote", '"Heparin-Pro" — HEParin antidote = PROtamine sulfate.'],
    ["HIT Type II memory", '"HIT = CLOT not bleed" — In HIT II, platelets are consumed into clots. Paradoxical thrombosis.'],
    ["Pregnancy safety", '"Heparin is BIG — too big to cross the placenta."'],
    ["Warfarin onset",  '"W-AIT 2-5 days" — Warfarin takes WAIT time (2-5 days) to work.'],
]
mnem_tbl = Table(
    [[Paragraph("Mnemonic / Concept", ParagraphStyle("TH4", fontName="Helvetica-Bold", fontSize=9.5, textColor=colors.white, leading=13)),
      Paragraph("How to Remember", ParagraphStyle("TH4", fontName="Helvetica-Bold", fontSize=9.5, textColor=colors.white, leading=13))]] +
    [[Paragraph(r[0], ParagraphStyle("MN", fontName="Helvetica-Bold", fontSize=9.5, textColor=colors.HexColor("#5B2D8E"), leading=13)),
      Paragraph(r[1], body_style)] for r in mnem_rows],
    colWidths=[5*cm, 12.4*cm], repeatRows=1
)
mnem_tbl.setStyle(TableStyle([
    ("BACKGROUND",    (0,0), (-1,0), colors.HexColor("#5B2D8E")),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.white, colors.HexColor("#F5F0FF")]),
    ("BOX",           (0,0), (-1,-1), 0.5, colors.HexColor("#CCCCCC")),
    ("INNERGRID",     (0,0), (-1,-1), 0.3, colors.HexColor("#DDDDDD")),
    ("TOPPADDING",    (0,0), (-1,-1), 5),
    ("BOTTOMPADDING", (0,0), (-1,-1), 5),
    ("LEFTPADDING",   (0,0), (-1,-1), 6),
    ("RIGHTPADDING",  (0,0), (-1,-1), 6),
    ("VALIGN",        (0,0), (-1,-1), "TOP"),
]))
story.append(mnem_tbl)
story.append(Spacer(1, 10))

# ── FOOTER NOTE ───────────────────────────────────────────────────
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CCCCCC")))
story.append(Spacer(1, 4))
story.append(Paragraph(
    "Content compiled from: Lippincott Illustrated Reviews: Pharmacology | Miller's Anesthesia | Braunwald's Heart Disease | Goldman-Cecil Medicine | Berek & Novak's Gynecology. "
    "For NCLEX-RN preparation only. Always follow institutional protocols in clinical practice.",
    small_style
))

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

cd /home/daytona/workspace/heparin-warfarin-nclex && python build_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/heparin-warfarin-nclex/Heparin_Warfarin_NCLEX_RN.…

Your NCLEX-RN PDF is ready! Here's your download link:

Heparin Warfarin NCLEX RN

PDF Document · PDF


What's inside the PDF (5 sections):
Section 1 - Quick Comparison Table
  • Heparin vs Warfarin side by side: route, onset, mechanism, lab monitoring, antidote, pregnancy safety
Section 2 - Heparin (UFH & LMWH)
  • Mechanism (Antithrombin III activation)
  • aPTT monitoring (goal: 60-100 sec)
  • HIT Type I vs Type II (HIGH YIELD!)
  • Antidote: Protamine Sulfate
  • SC injection technique: no aspiration, no rubbing
Section 3 - Warfarin (Coumadin)
  • Mechanism (Vitamin K antagonist - factors II, VII, IX, X)
  • INR monitoring (goal: 2-3 most cases; 2.5-3.5 mechanical valves)
  • Drug & food interactions (Vitamin K foods, antibiotics, NSAIDs)
  • Antidote: Vitamin K + FFP/PCC
  • Skin necrosis, teratogenicity
Section 4 - Nursing Care & Patient Education
  • Assessment checklist, fall prevention, bleeding precautions
  • Warfarin and heparin patient teaching points
Section 5 - NCLEX High-Yield Points + Mnemonics
  • "Heparin = aPTT, Warfarin = INR" memory tricks
  • "1972" for Vitamin K factors
  • "HIT = CLOT not bleed"
  • "Warfarin WAIT 2-5 days"

Ethics and law pdf esy explains

Asking for Preferences
Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Writing File

~/heparin-warfarin-nclex/build_ethics_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
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY

OUTPUT = "/home/daytona/workspace/heparin-warfarin-nclex/Ethics_Law_NCLEX_RN.pdf"

doc = SimpleDocTemplate(
    OUTPUT, pagesize=A4,
    rightMargin=1.8*cm, leftMargin=1.8*cm,
    topMargin=2*cm, bottomMargin=2*cm,
)

# ── Colour Palette ──
NAVY    = colors.HexColor("#0D2B55")
TEAL    = colors.HexColor("#007B8A")
PURPLE  = colors.HexColor("#5B2D8E")
ORANGE  = colors.HexColor("#D95F02")
GREEN   = colors.HexColor("#1A7A4A")
RED     = colors.HexColor("#B91C1C")
LGRAY   = colors.HexColor("#F0F4F8")
LBODY   = colors.HexColor("#1C1C1C")
LPURPLE = colors.HexColor("#F5F0FF")
LGREEN  = colors.HexColor("#F0FFF4")
LORANGE = colors.HexColor("#FFF3E0")
LRED    = colors.HexColor("#FEF2F2")

styles = getSampleStyleSheet()

def ps(name, **kw):
    base = kw.pop("parent", styles["Normal"])
    return ParagraphStyle(name, parent=base, **kw)

title_s   = ps("T", fontSize=24, textColor=colors.white, fontName="Helvetica-Bold", alignment=TA_CENTER, leading=30, spaceAfter=4)
sub_s     = ps("S", fontSize=10, textColor=colors.HexColor("#AEDDF5"), fontName="Helvetica", alignment=TA_CENTER, spaceAfter=4)
sec_s     = ps("Sec", fontSize=12, textColor=colors.white, fontName="Helvetica-Bold", leading=17)
h2_s      = ps("H2", fontSize=11, textColor=NAVY, fontName="Helvetica-Bold", leading=15, spaceBefore=6, spaceAfter=3)
h3_s      = ps("H3", fontSize=10, textColor=TEAL, fontName="Helvetica-Bold", leading=14, spaceBefore=4, spaceAfter=2)
body_s    = ps("B", fontSize=9.5, textColor=LBODY, fontName="Helvetica", leading=14, spaceAfter=3, leftIndent=4)
bullet_s  = ps("BL", fontSize=9.5, textColor=LBODY, fontName="Helvetica", leading=14, spaceAfter=3, leftIndent=14)
tip_s     = ps("TIP", fontSize=9.5, textColor=colors.HexColor("#7B3600"), fontName="Helvetica-BoldOblique", leading=13, leftIndent=6)
warn_s    = ps("W", fontSize=9.5, textColor=RED, fontName="Helvetica-Bold", leading=13, leftIndent=6)
easy_s    = ps("E", fontSize=9.5, textColor=GREEN, fontName="Helvetica-Bold", leading=13, leftIndent=6)
small_s   = ps("SM", fontSize=8, textColor=colors.grey, fontName="Helvetica", alignment=TA_CENTER, leading=11)
th_s      = ps("TH", fontSize=9.5, textColor=colors.white, fontName="Helvetica-Bold", leading=13)
th_s2     = ps("TH2", fontSize=10, textColor=colors.white, fontName="Helvetica-Bold", leading=14)
cell_bold = ps("CB", fontSize=9.5, textColor=NAVY, fontName="Helvetica-Bold", leading=13, spaceAfter=1)
cell_body = ps("CBB", fontSize=9.5, textColor=LBODY, fontName="Helvetica", leading=13, spaceAfter=1, leftIndent=2)

W = 17.4*cm

def sec_hdr(text, color=NAVY):
    d = [[Paragraph(text, sec_s)]]
    t = Table(d, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND", (0,0),(-1,-1), color),
        ("TOPPADDING",(0,0),(-1,-1),7), ("BOTTOMPADDING",(0,0),(-1,-1),7),
        ("LEFTPADDING",(0,0),(-1,-1),12), ("RIGHTPADDING",(0,0),(-1,-1),12),
    ]))
    return t

def box(text, bg=LGRAY, border=TEAL, style=body_s):
    d = [[Paragraph(text, style)]]
    t = Table(d, colWidths=[W])
    t.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,-1),bg),
        ("BOX",(0,0),(-1,-1),1.5,border),
        ("TOPPADDING",(0,0),(-1,-1),6), ("BOTTOMPADDING",(0,0),(-1,-1),6),
        ("LEFTPADDING",(0,0),(-1,-1),10), ("RIGHTPADDING",(0,0),(-1,-1),10),
    ]))
    return t

def tip(text):  return box("⭐ NCLEX TIP: " + text, LORANGE, ORANGE, tip_s)
def warn(text): return box("⚠ " + text, LRED, RED, warn_s)
def easy(text): return box("💡 EASY EXPLAIN: " + text, LGREEN, GREEN, easy_s)

def tbl(headers, rows, widths=None, hdr_color=NAVY):
    if widths is None: widths = [W/len(headers)]*len(headers)
    hdr  = [Paragraph(h, th_s) for h in headers]
    data = [hdr] + [[Paragraph(str(c), cell_body) for c in r] for r in rows]
    t = Table(data, colWidths=widths, repeatRows=1)
    t.setStyle(TableStyle([
        ("BACKGROUND",(0,0),(-1,0), hdr_color),
        ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.white, LGRAY]),
        ("BOX",(0,0),(-1,-1),0.5,colors.HexColor("#CCCCCC")),
        ("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#DDDDDD")),
        ("TOPPADDING",(0,0),(-1,-1),5), ("BOTTOMPADDING",(0,0),(-1,-1),5),
        ("LEFTPADDING",(0,0),(-1,-1),6), ("RIGHTPADDING",(0,0),(-1,-1),6),
        ("VALIGN",(0,0),(-1,-1),"TOP"),
    ]))
    return t

sp = lambda n=6: Spacer(1, n)

# ══════════════════════════════════════════════════════════════
story = []

# ── TITLE ──
title_data = [
    [Paragraph("NURSING ETHICS &amp; LAW", title_s)],
    [Paragraph("NCLEX-RN Easy Study Notes", sub_s)],
    [Paragraph("Ethical Principles  |  Legal Concepts  |  Patient Rights  |  Nursing Practice", sub_s)],
]
title_tbl = Table(title_data, colWidths=[W])
title_tbl.setStyle(TableStyle([
    ("BACKGROUND",(0,0),(-1,-1), NAVY),
    ("TOPPADDING",(0,0),(-1,-1),10), ("BOTTOMPADDING",(0,0),(-1,-1),10),
    ("LEFTPADDING",(0,0),(-1,-1),12),
]))
story += [title_tbl, sp(10)]

# ══════════════════════════════════════════════════════════════
# SECTION 1 — 4 CORE ETHICAL PRINCIPLES
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 1: THE 4 CORE ETHICAL PRINCIPLES (HIGH YIELD!)", NAVY), sp(6)]

story.append(easy(
    "Think of a nurse caring for a patient. FOUR big values guide every decision: "
    "AUTONOMY (patient chooses), BENEFICENCE (do good), NON-MALEFICENCE (do no harm), JUSTICE (be fair). "
    "Memory trick: 'A BNJ' — like A Beautiful New Journey!"
))
story.append(sp(6))

principles = [
    ["AUTONOMY\n(self-rule)",
     "The patient's right to make their own decisions about their own body and health care.\n"
     "Includes: informed consent, refusing treatment, privacy, confidentiality.",
     "A Jehovah's Witness refuses a blood transfusion. Even if it puts them at risk, the nurse must RESPECT this decision (as long as the patient is competent)."],
    ["BENEFICENCE\n(do good)",
     "The nurse/provider's duty to act in the BEST INTEREST of the patient.\n"
     "Going beyond avoiding harm — actively promoting the patient's well-being.",
     "Giving pain medication to a post-op patient before pain becomes severe. Acting proactively to promote comfort."],
    ["NON-MALEFICENCE\n(do no harm)",
     "The obligation to AVOID causing harm to the patient.\n"
     "This means weighing risks vs. benefits of any intervention.",
     "If a medication has severe side effects that outweigh the benefit for a particular patient — withholding it is non-maleficent."],
    ["JUSTICE\n(fairness)",
     "Fair and equal distribution of resources and treatment to ALL patients.\n"
     "Every patient deserves the same quality of care regardless of race, gender, income, religion, or background.",
     "Triage in the ED — giving the sickest patient priority regardless of their insurance status."],
]
story.append(tbl(
    ["PRINCIPLE", "DEFINITION (EASY)", "REAL NURSING EXAMPLE"],
    principles, [3.5*cm, 7*cm, 6.9*cm]
))
story.append(sp(6))
story.append(tip(
    "NCLEX often tests CONFLICT between principles. "
    "Usually AUTONOMY wins — respect patient's right to choose, even if you disagree. "
    "Exception: if patient lacks decision-making capacity → then beneficence may override."
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 2 — INFORMED CONSENT
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 2: INFORMED CONSENT", TEAL), sp(6)]
story.append(easy(
    "Informed consent = the patient says 'YES' to a procedure AFTER being fully taught about it. "
    "It is a PROCESS — not just a signature on a form!"
))
story.append(sp(6))

story.append(Paragraph("What Must Be Explained to the Patient (PARQ):", h2_s))
parq = [
    ["Procedure / Nature of treatment", "What exactly will be done"],
    ["Alternatives", "Other options available, including doing nothing"],
    ["Risks & Benefits", "What could go wrong AND what the benefits are"],
    ["Questions", "Patient must have opportunity to ask questions and get answers"],
]
story.append(tbl(["Element", "Meaning"], parq, [6*cm, 11.4*cm]))
story.append(sp(6))

story.append(Paragraph("Informed Consent Requirements:", h2_s))
for item in [
    "Patient must be a <b>competent adult</b> (has decision-making capacity)",
    "Information must be given in a language the patient <b>understands</b> (use interpreter if needed)",
    "Consent must be <b>voluntary</b> — no coercion or pressure",
    "Consent is specific — patient can consent to one procedure but <b>refuse another</b>",
    "Patient can <b>withdraw consent</b> at any time, even mid-procedure",
    "The <b>PHYSICIAN/surgeon</b> is responsible for obtaining consent — NOT the nurse",
    "The <b>nurse's role</b>: witness the signature, assess patient understanding, and notify the doctor if patient has questions or doubts",
]:
    story.append(Paragraph("• " + item, bullet_s))
story.append(sp(6))

story.append(Paragraph("Exceptions to Informed Consent:", h2_s))
exceptions = [
    ["Emergency", "If patient is unconscious/unable to consent and life is in danger — treatment proceeds without consent (implied consent)"],
    ["Waiver",    "Patient voluntarily says 'I don't want to know — just do what you think is best'"],
    ["Therapeutic Privilege", "Doctor withholds information if disclosing it would cause serious harm to patient (rarely used, controversial)"],
    ["Incompetent Patient", "Surrogate/proxy decision maker gives consent (family, legal guardian, healthcare power of attorney)"],
]
story.append(tbl(["Exception", "Explanation"], exceptions, [4*cm, 13.4*cm]))
story.append(sp(6))
story.append(tip(
    "If a patient says 'I don't understand what I'm signing' — the nurse must STOP the consent process and notify the physician. Never witness a signature if the patient doesn't understand!"
))
story.append(warn(
    "It is NOT the nurse's responsibility to obtain informed consent. The doctor/surgeon must explain the procedure. "
    "The nurse only WITNESSES the signature and checks that the patient understands."
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 3 — PATIENT RIGHTS
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 3: PATIENT RIGHTS", PURPLE), sp(6)]
story.append(easy(
    "Patients are NOT just bodies to be treated — they are PEOPLE with legal and ethical rights. "
    "Every hospitalized patient has a 'Patient Bill of Rights' which the nurse must protect."
))
story.append(sp(6))

rights = [
    ["Right to Information",        "Be fully informed about diagnosis, treatment plan, and prognosis in a way they can understand"],
    ["Right to Informed Consent",   "Give or refuse consent before any procedure or treatment"],
    ["Right to Refuse Treatment",   "EVEN life-saving treatment — a competent adult can say NO"],
    ["Right to Privacy & Confidentiality", "Medical info stays private — HIPAA law protects this (Health Insurance Portability and Accountability Act)"],
    ["Right to Dignity & Respect",  "Treated with courtesy and respect regardless of background; privacy during exams/procedures"],
    ["Right to a Safe Environment", "Free from abuse, neglect, exploitation, and unnecessary restraint"],
    ["Right to Participate in Care","Involved in care planning and decision-making; can ask questions anytime"],
    ["Right to Know Care Providers","Know the names and roles of the healthcare team members providing care"],
    ["Right to Continuity of Care", "Safe handoff/transfer of care; access to care after discharge"],
    ["Right to Complain",           "File grievances/complaints without fear of retaliation"],
]
story.append(tbl(["Patient Right", "What It Means in Nursing Practice"], rights, [5.5*cm, 11.9*cm]))
story.append(sp(6))
story.append(tip(
    "HIPAA is HIGH YIELD on NCLEX! Never discuss patient info in public spaces (elevator, cafeteria). "
    "Never share info with family unless the patient has authorized it. Chart information belongs to the patient."
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 4 — ADVANCE DIRECTIVES
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 4: ADVANCE DIRECTIVES", GREEN), sp(6)]
story.append(easy(
    "Advance Directives = legal documents that tell healthcare providers WHAT TO DO if the patient "
    "becomes unable to speak for themselves. Written while the patient is still competent."
))
story.append(sp(6))

directives = [
    ["Living Will",
     "A written document stating the patient's wishes for end-of-life care if they become unable to communicate.\n"
     "Specifies what treatments they DO or DO NOT want (e.g., CPR, ventilator, tube feeding).",
     "Written by patient. Takes effect when patient cannot make decisions."],
    ["Durable Power of Attorney for Health Care (DPOA-HC) / Healthcare Proxy",
     "The patient appoints a trusted person (agent/proxy) to make healthcare decisions on their behalf when they are incapacitated.",
     "The proxy does NOT make decisions based on their own wishes — they decide based on what the PATIENT would have wanted (substituted judgment)."],
    ["DNR — Do Not Resuscitate Order",
     "A physician's ORDER (not just a patient form) that says: do NOT perform CPR if the patient's heart stops.\n"
     "Must be documented in the medical chart by a physician.",
     "A nurse CANNOT write a DNR order. If no DNR in chart → full resuscitation efforts must be made."],
    ["DNI — Do Not Intubate",
     "Do not place a breathing tube (intubate) — but other treatments may continue.",
     "Often paired with DNR. Must also be a physician order."],
    ["POLST / MOLST",
     "Physician Orders for Life-Sustaining Treatment — a portable medical order (not just a directive) covering CPR, hospitalization, artificial nutrition.\n"
     "Signed by physician AND patient.",
     "Used for seriously ill patients. More detailed and immediately actionable than a living will."],
]
story.append(tbl(["Type", "What It Is", "Key Nursing Point"], directives, [3.5*cm, 8*cm, 5.9*cm]))
story.append(sp(6))
story.append(tip(
    "If a patient has a DNR and their heart stops — do NOT perform CPR. "
    "If a patient with a DNR is going to surgery — the DNR is usually SUSPENDED during the procedure (discuss with surgeon and patient beforehand)."
))
story.append(warn(
    "A nurse who ignores a valid DNR order and performs CPR may face legal consequences for battery (performing a procedure without consent)."
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 5 — LEGAL CONCEPTS IN NURSING
# ══════════════════════════════════════════════════════════════
story += [PageBreak(), sec_hdr("SECTION 5: LEGAL CONCEPTS IN NURSING", RED), sp(6)]

story.append(easy(
    "Law governs what nurses CAN and CANNOT do. Nurses can face legal trouble if they act outside their role, "
    "fail to meet standards of care, or violate patient rights. Know these terms cold for NCLEX!"
))
story.append(sp(6))

legal = [
    ["Negligence",
     "Failure to provide the standard of care that a reasonable nurse would provide in the same situation.\n"
     "There is NO intent to harm — it is carelessness or omission.",
     "Forgetting to raise bed rails for a fall-risk patient who then falls and is injured."],
    ["Malpractice",
     "Professional negligence — negligence by a licensed healthcare professional in the course of their professional duties.\n"
     "4 elements must be proven: Duty, Breach, Causation, Damages (DBCD).",
     "A nurse gives 10x the ordered dose of insulin → patient goes into hypoglycemic coma → malpractice."],
    ["Assault",
     "Threatening or causing someone to fear imminent harm (no physical contact needed).\n"
     "Example in nursing: 'If you don't take this pill, I'll restrain you.'",
     "Verbal threat that makes patient fear harm = assault even without touching."],
    ["Battery",
     "Unauthorized physical contact — touching without consent.\n"
     "Performing a procedure after patient refuses = BATTERY even if medically necessary.",
     "Drawing blood after patient said 'NO' = battery."],
    ["False Imprisonment",
     "Restraining or confining a person without legal authority or consent.\n"
     "Applies to: illegal use of restraints, locking psychiatric patients without proper orders.",
     "Using physical restraints without a physician's order = false imprisonment."],
    ["Defamation",
     "Making false statements that damage someone's reputation.\n"
     "Slander = spoken. Libel = written.",
     "Writing false negative comments about a patient in the chart = libel."],
    ["Invasion of Privacy",
     "Sharing private patient information without the patient's consent.",
     "Discussing patient diagnosis with their neighbor = invasion of privacy (HIPAA violation)."],
    ["Duty to Report",
     "Nurses are MANDATORY REPORTERS — legally required to report suspected abuse (child, elderly, domestic), communicable diseases, and certain injuries (gunshot wounds).",
     "Seeing signs of child abuse and NOT reporting = legal violation."],
]
story.append(tbl(
    ["Legal Term", "Definition (Easy Language)", "Nursing Example"],
    legal, [3.5*cm, 7*cm, 6.9*cm]
))
story.append(sp(6))

story.append(Paragraph("4 Elements of Malpractice (DBCD — remember this!):", h2_s))
for el in [
    "<b>D — Duty:</b> The nurse had a professional responsibility to the patient (nurse-patient relationship existed)",
    "<b>B — Breach:</b> The nurse failed to meet the standard of care (did something wrong OR failed to do something)",
    "<b>C — Causation:</b> The breach DIRECTLY caused the patient's injury",
    "<b>D — Damages:</b> The patient suffered actual harm (physical, emotional, financial)",
]:
    story.append(Paragraph("• " + el, bullet_s))
story.append(sp(6))
story.append(tip(
    "ALL 4 elements must be present for malpractice. If the patient suffered no harm, there is no malpractice even if the nurse made a mistake."
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 6 — SCOPE OF PRACTICE & DELEGATION
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 6: SCOPE OF PRACTICE & DELEGATION", colors.HexColor("#B45309")), sp(6)]

story.append(easy(
    "Every nurse has a defined 'scope of practice' — what they are legally allowed to do. "
    "Nurses can delegate tasks to others but CANNOT delegate RESPONSIBILITY. "
    "Think: you can hand off the task but you keep the accountability!"
))
story.append(sp(6))

scope = [
    ["RN (Registered Nurse)",
     "Full nursing assessment, care planning, medication administration, patient education, delegation, IV insertion, complex procedures.",
     "Cannot diagnose (that is medical diagnosis) but CAN make nursing diagnoses."],
    ["LPN/LVN (Licensed Practical/Vocational Nurse)",
     "Administer medications (stable patients), wound care, collect data, assist with ADLs, report changes to RN.",
     "Cannot perform initial nursing assessment or care planning. Works under RN supervision."],
    ["CNA/UAP (Unlicensed Assistive Personnel)",
     "ADLs (bathing, feeding, ambulation), vital signs on stable patients, I&O measurement, specimen collection.",
     "CANNOT perform nursing assessments, administer medications, or interpret data. Must report observations to RN."],
]
story.append(tbl(
    ["Role", "What They CAN Do", "What They CANNOT Do"],
    scope, [3*cm, 7.5*cm, 6.9*cm]
))
story.append(sp(6))

story.append(Paragraph("5 Rights of Delegation (TASK-C):", h2_s))
for right in [
    "<b>Right Task</b> — Is this task appropriate to delegate? (Routine, non-complex, stable patient)",
    "<b>Right Circumstance</b> — Is the patient stable? Is the setting appropriate?",
    "<b>Right Person</b> — Is the delegate trained and competent for this task?",
    "<b>Right Direction/Communication</b> — Clear instructions given, expected outcome explained",
    "<b>Right Supervision</b> — RN provides follow-up and evaluates the outcome",
]:
    story.append(Paragraph("• " + right, bullet_s))
story.append(sp(6))
story.append(tip(
    "NEVER delegate: nursing assessment, nursing diagnosis, care planning, patient teaching, evaluation of care, or any unstable/complex patient task to LPN or UAP."
))
story.append(warn(
    "Delegating a task that is outside someone's scope of practice = the RN is legally liable if harm occurs!"
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 7 — CONFIDENTIALITY & HIPAA
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 7: CONFIDENTIALITY & HIPAA", TEAL), sp(6)]

story.append(easy(
    "HIPAA (Health Insurance Portability and Accountability Act) is a US federal law that protects patient health information (PHI). "
    "Every nurse must know what they CAN and CANNOT share about patients."
))
story.append(sp(6))

hipaa_do = [
    "Share patient info with other members of the healthcare TEAM directly involved in care",
    "Discuss patient info in private, appropriate clinical settings",
    "Share info with patient themselves (they own their records)",
    "Share with legally authorized representatives (e.g., power of attorney with correct documentation)",
    "Report to public health authorities as required by law (e.g., TB, HIV in some states, gunshot wounds)",
]
hipaa_dont = [
    "Discuss patient info in public areas (hallways, elevator, cafeteria)",
    "Share with family/friends without patient's explicit permission",
    "Post anything about patients on social media — EVER",
    "Leave computer screens with patient data visible to others",
    "Take photos of patients without written consent",
    "Share info with the patient's employer, insurance (without consent), or clergy without permission",
]

story.append(Paragraph("✅ CAN share patient information:", h2_s))
for d in hipaa_do:
    story.append(Paragraph("• " + d, bullet_s))
story.append(sp(4))
story.append(Paragraph("❌ CANNOT share patient information:", h2_s))
for d in hipaa_dont:
    story.append(Paragraph("• " + d, bullet_s))
story.append(sp(6))

story.append(Paragraph("Special Protections (Extra Confidential):", h2_s))
special = [
    ["HIV/AIDS status",        "Extra-strict confidentiality; specific consent required in most states"],
    ["Mental Health records",  "Stronger protections than general medical records"],
    ["Substance abuse records","Stricter federal rules (42 CFR Part 2)"],
    ["Genetic information",    "Protected by GINA (Genetic Information Nondiscrimination Act)"],
    ["Minor reproductive care","Many states allow minors to consent/keep confidential STI, contraception, pregnancy care"],
]
story.append(tbl(["Special Category", "Rule"], special, [5*cm, 12.4*cm]))
story.append(sp(6))
story.append(tip(
    "Even if a patient's family calls asking for information — NEVER confirm or deny anything without patient's written permission. "
    "A nurse can say 'I am unable to confirm or deny that your family member is a patient here.'"
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 8 — ETHICAL DILEMMAS & DECISION MAKING
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 8: ETHICAL DILEMMAS & DECISION MAKING", PURPLE), sp(6)]

story.append(easy(
    "An ethical dilemma occurs when TWO or more ethical principles conflict — and there is no easy right answer. "
    "Nurses use a structured process to navigate these situations."
))
story.append(sp(6))

story.append(Paragraph("Common Ethical Dilemmas in Nursing:", h2_s))
dilemmas = [
    ["Competent patient refuses life-saving treatment",
     "Autonomy vs. Beneficence/Non-maleficence",
     "Respect the patient's decision. Ensure they are truly informed. Document carefully. Involve ethics committee if needed."],
    ["Family wants to withhold diagnosis from patient",
     "Autonomy vs. Family wishes (cultural considerations)",
     "Patient has the right to know their diagnosis. Discuss with the healthcare team and involve a cultural liaison if helpful."],
    ["Limited resources — who gets the ICU bed?",
     "Justice — fairness in allocation",
     "Follow hospital triage protocol. Ethics committee guidance. Clinical need takes priority, not personal characteristics."],
    ["Surrogate decision maker appears to NOT be acting in patient's best interest",
     "Patient autonomy (substituted judgment) vs. Beneficence",
     "Notify charge nurse and physician. Involve social work and ethics committee. Document all actions taken."],
    ["Patient asks nurse to keep information from spouse",
     "Autonomy/Confidentiality vs. Family communication",
     "Honor the patient's confidentiality. Cannot disclose without consent unless safety is at risk."],
    ["Colleague observed making a medication error and covering it up",
     "Accountability vs. Loyalty",
     "Nurses have a legal and ethical duty to report unsafe practices. Failure to report can make you liable too."],
]
story.append(tbl(
    ["Dilemma", "Conflict", "Nursing Action"],
    dilemmas, [4.5*cm, 5*cm, 7.9*cm]
))
story.append(sp(6))
story.append(tip(
    "NCLEX approach: When in doubt — FIRST assess the patient, THEN protect autonomy, THEN notify the physician/charge nurse. ALWAYS document."
))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 9 — HIGH-YIELD NCLEX MEMORY SHEET
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 9: HIGH-YIELD NCLEX QUICK REFERENCE", NAVY), sp(6)]

quick = [
    ["Obtain informed consent", "PHYSICIAN — nurse only witnesses and advocates"],
    ["Who signs the DNR order", "PHYSICIAN — patient/family expresses wishes, doctor writes the order"],
    ["Mandatory reporter", "Nurse MUST report suspected abuse (child, elder, domestic violence) regardless of certainty"],
    ["Autonomy beats all?", "YES — competent adult can refuse ANY treatment, including life-saving ones"],
    ["Unconscious patient in ER", "Implied consent — proceed with emergency treatment"],
    ["Minor refusing blood transfusion", "Parents (surrogate) decide — court order may override if child's life at risk"],
    ["Patient asks nurse not to tell family", "Nurse CANNOT disclose — patient's confidentiality is protected"],
    ["Restraints without order", "FALSE IMPRISONMENT — always need MD order and ongoing reassessment"],
    ["HIPAA violation example", "Discussing patient in hallway; sharing info with family without consent; social media posts"],
    ["Advance directive not in chart", "Follow full resuscitation protocol until one is located or new one created"],
    ["Ethics committee", "Consult when there is conflict between patient/family wishes and medical recommendations"],
    ["Nurse disagrees with MD order", "FIRST clarify with MD, if still unsafe → refuse and report to charge nurse/supervisor"],
    ["Malpractice 4 elements", "Duty + Breach + Causation + Damages — ALL 4 must be present"],
    ["Delegation — never to UAP", "Assessment, care planning, teaching, complex/unstable patients, IV meds"],
    ["Beneficence vs Autonomy", "Autonomy usually wins for COMPETENT adults; beneficence may win if patient lacks capacity"],
]
story.append(tbl(["NCLEX Topic", "Key Answer"], quick, [6*cm, 11.4*cm]))
story.append(sp(10))

# ══════════════════════════════════════════════════════════════
# SECTION 10 — MNEMONICS
# ══════════════════════════════════════════════════════════════
story += [sec_hdr("SECTION 10: MNEMONICS — EASY TO REMEMBER!", colors.HexColor("#5B2D8E")), sp(6)]

mnems = [
    ["4 Ethical Principles",  "A BNJ",           "Autonomy, Beneficence, Non-maleficence, Justice"],
    ["Malpractice Elements",  "DBCD",             "Duty, Breach, Causation, Damages"],
    ["5 Rights of Delegation","TASK-C",           "Task, Circumstance, Person (right person), Communication, Supervision"],
    ["Informed Consent",      "PARQ",             "Procedure, Alternatives, Risks/Benefits, Questions answered"],
    ["Advance Directives",    "'Living WILL I be DNR'd?'", "Living will, Will (DPOA), DNR"],
    ["HIPAA Protection",      "'HIPAA = Keep it PRIVATE'", "Never share PHI without patient consent"],
    ["Ethics priority",       "'AUTONOMY is the BOSS'",    "Competent patient's decision comes first, always"],
    ["Mandatory reporting",   "'SEE something, SAY something'", "Any suspicion of abuse = must report"],
]
mnem_tbl = Table(
    [[Paragraph(h, th_s2) for h in ["Topic", "Mnemonic / Trick", "Meaning"]]] +
    [[Paragraph(r[0], cell_bold), Paragraph(r[1], ps("MN", fontSize=9.5, textColor=PURPLE, fontName="Helvetica-Bold", leading=13)), Paragraph(r[2], cell_body)] for r in mnems],
    colWidths=[4.5*cm, 5.5*cm, 7.4*cm], repeatRows=1
)
mnem_tbl.setStyle(TableStyle([
    ("BACKGROUND",(0,0),(-1,0), PURPLE),
    ("ROWBACKGROUNDS",(0,1),(-1,-1),[colors.white, LPURPLE]),
    ("BOX",(0,0),(-1,-1),0.5,colors.HexColor("#CCCCCC")),
    ("INNERGRID",(0,0),(-1,-1),0.3,colors.HexColor("#DDDDDD")),
    ("TOPPADDING",(0,0),(-1,-1),5), ("BOTTOMPADDING",(0,0),(-1,-1),5),
    ("LEFTPADDING",(0,0),(-1,-1),6), ("RIGHTPADDING",(0,0),(-1,-1),6),
    ("VALIGN",(0,0),(-1,-1),"TOP"),
]))
story.append(mnem_tbl)
story.append(sp(10))

# ── FOOTER ──
story.append(HRFlowable(width="100%", thickness=0.5, color=colors.HexColor("#CCCCCC")))
story.append(sp(4))
story.append(Paragraph(
    "Sources: Berek & Novak's Gynecology | Goldman-Cecil Medicine | Kaplan & Sadock's Psychiatry | Rosen's Emergency Medicine | Campbell-Walsh Urology. "
    "Prepared for NCLEX-RN examination preparation. Always follow institutional policies in clinical settings. | July 2026",
    small_s
))

doc.build(story)
print(f"PDF created: {OUTPUT}")
Running Command

cd /home/daytona/workspace/heparin-warfarin-nclex && python build_ethics_pdf.py …

Running Command

ls -lh /home/daytona/workspace/heparin-warfarin-nclex/Ethics_Law_NCLEX_RN.pdf

Your PDF is ready! Download it here:

Ethics Law NCLEX RN

PDF Document · PDF


What's inside (10 Sections, easy language throughout):
SectionTopic
14 Core Ethical Principles — Autonomy, Beneficence, Non-maleficence, Justice (with real examples)
2Informed Consent — what it is, who gets it, exceptions, nurse's role
3Patient Rights — full Bill of Rights explained simply
4Advance Directives — Living Will, DPOA, DNR, DNI, POLST
5Legal Concepts — Negligence, Malpractice, Assault, Battery, False Imprisonment, HIPAA
6Scope of Practice & Delegation — RN vs LPN vs CNA, 5 Rights of Delegation
7Confidentiality & HIPAA — what you CAN and CANNOT share
8Ethical Dilemmas — 6 common scenarios with nursing actions
9High-Yield NCLEX Quick Reference — 15 must-know answers
10Mnemonics — ABNJD, DBCD, TASK-C, PARQ and more
Every section has 💡 Easy Explain, ⭐ NCLEX Tips, and ⚠ Warning boxes so nothing is confusing. All language is simple and exam-focused!
This is a shared conversation. Sign in to Orris to start your own chat.