patient with ef 20 % management
"heart failure" AND "reduced ejection fraction" AND management
| Drug | Indication |
|---|---|
| Ivabradine | Heart rate >70 bpm despite maximum beta-blocker, sinus rhythm; reduces hospitalizations |
| Hydralazine + Isosorbide dinitrate (BiDil) | Self-identified Black patients; alternative when ARNI/ACE inhibitor/ARB not tolerated |
| Digoxin | HF with atrial fibrillation (rate control); can reduce symptoms/hospitalizations when added to diuretic + ACE inhibitor, but does NOT reduce mortality |
| Vericiguat | Recent HF hospitalization or IV diuretics despite optimal quadruple therapy; 2.5 mg OD starting, target 10 mg OD; reduces HF hospitalizations (but not mortality) |
| Option | Notes |
|---|---|
| Left Ventricular Assist Device (LVAD) | Destination therapy or bridge to transplant; significantly improves survival and quality of life in end-stage HF |
| Heart Transplantation | Gold standard for eligible patients (<65-70 yr, no comorbidities excluding transplant); 1-year survival ~85%, 5-year ~75% |
| Chronic inotropes (dobutamine, milrinone) | Bridge to transplant/LVAD or palliative intent only; NOT for long-term use |
| Palliative/Hospice care | For patients not transplant/LVAD candidates; focus on symptom relief and quality of life |
EF 20% (HFrEF)
│
├── CONGESTION? → Loop diuretic (furosemide)
│
├── START QUADRUPLE THERAPY (uptitrate all):
│ 1. ARNI (sacubitril/valsartan) or ACE-I/ARB
│ 2. Beta-blocker (bisoprolol/carvedilol/metoprolol)
│ 3. MRA (spironolactone/eplerenone)
│ 4. SGLT2i (dapagliflozin/empagliflozin)
│
├── DEVICE ASSESSMENT at 3 months (if EF still ≤35%):
│ • QRS ≥150 ms + LBBB → CRT-D
│ • No CRT indication → ICD alone
│
├── STILL SYMPTOMATIC?
│ • Ivabradine (if HR >70, sinus rhythm)
│ • Vericiguat (post-hospitalization)
│ • Hydralazine/nitrate (Black patients, or ARNI/ACE intolerant)
│ • Digoxin (AF or persistent symptoms)
│
└── REFRACTORY (Stage D):
• LVAD (destination therapy or bridge to transplant)
• Heart transplantation
• Chronic inotropes (palliative only)
• Hospice/palliative care
Create a patient education handout on HFrEF management and diet
ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/hfref-handout
~/hfref-handout/create_handout.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, TableLayoutType
} = require('docx');
const fs = require('fs');
// Color palette
const DARK_BLUE = "1A3C6E";
const MED_BLUE = "2E6DA4";
const LIGHT_BLUE = "D6E8FA";
const RED_WARN = "C0392B";
const GREEN_OK = "1E7E34";
const YELLOW_BG = "FFF9C4";
const ORANGE_BG = "FFE0B2";
const GREY_RULE = "CCCCCC";
const WHITE = "FFFFFF";
function heading1(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, size: 32, color: WHITE, font: "Calibri" })],
heading: HeadingLevel.HEADING_1,
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
spacing: { before: 240, after: 120 },
indent: { left: 120, right: 120 },
});
}
function heading2(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, size: 26, color: WHITE, font: "Calibri" })],
shading: { type: ShadingType.SOLID, color: MED_BLUE },
spacing: { before: 200, after: 80 },
indent: { left: 100, right: 100 },
});
}
function heading3(text) {
return new Paragraph({
children: [new TextRun({ text, bold: true, size: 22, color: DARK_BLUE, font: "Calibri" })],
spacing: { before: 160, after: 60 },
border: { bottom: { style: BorderStyle.SINGLE, size: 4, color: MED_BLUE } },
});
}
function body(text, options = {}) {
return new Paragraph({
children: [new TextRun({ text, size: 20, font: "Calibri", ...options })],
spacing: { before: 60, after: 60 },
});
}
function bullet(text, bold_prefix = "") {
return new Paragraph({
children: [
bold_prefix ? new TextRun({ text: bold_prefix + " ", bold: true, size: 20, font: "Calibri" }) : new TextRun(""),
new TextRun({ text, size: 20, font: "Calibri" }),
],
bullet: { level: 0 },
spacing: { before: 40, after: 40 },
});
}
function subbullet(text) {
return new Paragraph({
children: [new TextRun({ text, size: 19, font: "Calibri", color: "444444" })],
bullet: { level: 1 },
spacing: { before: 30, after: 30 },
});
}
function warningBox(lines) {
const children = lines.map(l =>
new Paragraph({
children: [new TextRun({ text: l, size: 20, font: "Calibri", color: RED_WARN, bold: true })],
spacing: { before: 40, after: 40 },
indent: { left: 120, right: 120 },
})
);
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [new TableRow({ children: [new TableCell({
shading: { type: ShadingType.SOLID, color: "FDECEA" },
borders: { top: { style: BorderStyle.SINGLE, size: 8, color: RED_WARN },
bottom: { style: BorderStyle.SINGLE, size: 8, color: RED_WARN },
left: { style: BorderStyle.SINGLE, size: 8, color: RED_WARN },
right: { style: BorderStyle.SINGLE, size: 8, color: RED_WARN } },
children,
})]})],
});
}
function infoBox(lines, bgColor = LIGHT_BLUE) {
const children = lines.map(l =>
new Paragraph({
children: [new TextRun({ text: l, size: 20, font: "Calibri" })],
spacing: { before: 40, after: 40 },
indent: { left: 120, right: 120 },
})
);
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [new TableRow({ children: [new TableCell({
shading: { type: ShadingType.SOLID, color: bgColor },
borders: { top: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE },
bottom: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE },
left: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE },
right: { style: BorderStyle.SINGLE, size: 6, color: MED_BLUE } },
children,
})]})],
});
}
function spacer() {
return new Paragraph({ children: [new TextRun("")], spacing: { before: 80, after: 80 } });
}
function twoColRow(left, right, leftBold = false) {
return new TableRow({
children: [
new TableCell({
width: { size: 40, type: WidthType.PERCENTAGE },
shading: { type: ShadingType.SOLID, color: LIGHT_BLUE },
children: [new Paragraph({
children: [new TextRun({ text: left, size: 19, font: "Calibri", bold: leftBold })],
spacing: { before: 40, after: 40 },
indent: { left: 80 },
})],
}),
new TableCell({
width: { size: 60, type: WidthType.PERCENTAGE },
children: [new Paragraph({
children: [new TextRun({ text: right, size: 19, font: "Calibri" })],
spacing: { before: 40, after: 40 },
indent: { left: 80 },
})],
}),
],
});
}
function foodRow(food, reason, good = true) {
return new TableRow({
children: [
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
shading: { type: ShadingType.SOLID, color: good ? "E8F5E9" : "FDECEA" },
children: [new Paragraph({
children: [new TextRun({ text: food, size: 19, font: "Calibri", bold: true, color: good ? GREEN_OK : RED_WARN })],
spacing: { before: 40, after: 40 },
indent: { left: 80 },
})],
}),
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
children: [new Paragraph({
children: [new TextRun({ text: reason, size: 19, font: "Calibri" })],
spacing: { before: 40, after: 40 },
indent: { left: 80 },
})],
}),
],
});
}
// ─── Document ───────────────────────────────────────────────────────────────
const doc = new Document({
styles: {
default: { document: { run: { font: "Calibri", size: 20 } } }
},
sections: [{
properties: { page: { margin: { top: 720, bottom: 720, left: 800, right: 800 } } },
children: [
// ── TITLE BANNER ──────────────────────────────────────────────────────
new Paragraph({
children: [new TextRun({ text: "❤ YOUR HEART HEALTH GUIDE", bold: true, size: 40, color: WHITE, font: "Calibri" })],
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
spacing: { before: 0, after: 0 },
indent: { left: 0, right: 0 },
}),
new Paragraph({
children: [new TextRun({ text: "Managing Heart Failure with Reduced Ejection Fraction (HFrEF)", bold: true, size: 24, color: LIGHT_BLUE, font: "Calibri" })],
alignment: AlignmentType.CENTER,
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
spacing: { before: 0, after: 160 },
}),
spacer(),
// ── WHAT IS HFrEF ─────────────────────────────────────────────────────
heading1("UNDERSTANDING YOUR CONDITION"),
spacer(),
body("Your doctor has told you that you have Heart Failure with Reduced Ejection Fraction, or HFrEF. Here is what this means:"),
spacer(),
infoBox([
"💓 Your heart is a pump. A normal heart pumps out about 55–70% of its blood with each beat.",
"",
"📉 Your ejection fraction (EF) is lower than normal — meaning your heart muscle is weaker",
" and not pumping as efficiently as it should.",
"",
"✅ The GOOD NEWS: With the right medicines, diet, and lifestyle, you CAN live better and longer.",
]),
spacer(),
heading2("COMMON SYMPTOMS TO KNOW"),
spacer(),
bullet("Shortness of breath — especially lying flat or with activity", "😮💨"),
bullet("Swollen feet, ankles, or legs (fluid build-up)", "🦵"),
bullet("Feeling very tired or weak even at rest", "😴"),
bullet("Rapid or irregular heartbeat", "💗"),
bullet("Persistent cough or wheezing (sometimes with pink/frothy mucus)", "😮"),
bullet("Sudden weight gain (>2 kg / ~4.5 lbs in 2 days = call your doctor!)", "⚖️"),
spacer(),
// ── MEDICATIONS ───────────────────────────────────────────────────────
heading1("YOUR MEDICINES"),
spacer(),
body("You will likely be prescribed medicines from 4 key groups. All 4 work together — do NOT stop any of them without talking to your doctor first.", { bold: true }),
spacer(),
// Medicine table
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
tableHeader: true,
children: [
new TableCell({
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
children: [new Paragraph({ children: [new TextRun({ text: "Medicine Type", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })],
}),
new TableCell({
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
children: [new Paragraph({ children: [new TextRun({ text: "Common Examples", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })],
}),
new TableCell({
shading: { type: ShadingType.SOLID, color: DARK_BLUE },
children: [new Paragraph({ children: [new TextRun({ text: "What It Does", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })],
}),
],
}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "1. ARNI / ACE Inhibitor / ARB", bold: true, size: 19, font: "Calibri", color: DARK_BLUE })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Sacubitril/valsartan (Entresto), Enalapril, Lisinopril, Ramipril, Candesartan", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Reduces strain on the heart, helps it pump better, and lowers risk of death", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
]}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "2. Beta-Blocker", bold: true, size: 19, font: "Calibri", color: DARK_BLUE })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Bisoprolol, Carvedilol, Metoprolol", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Slows the heart rate, protects the heart from stress hormones, reduces risk of sudden death", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
]}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "3. Water Pill (MRA)", bold: true, size: 19, font: "Calibri", color: DARK_BLUE })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Spironolactone, Eplerenone", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Removes extra fluid and salt from the body, lowers blood pressure, reduces swelling", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
]}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "4. SGLT2 Inhibitor", bold: true, size: 19, font: "Calibri", color: DARK_BLUE })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Dapagliflozin (Farxiga), Empagliflozin (Jardiance)", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Reduces heart failure hospitalizations, protects kidneys, improves survival — works even without diabetes", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
]}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "5. Loop Diuretic", bold: true, size: 19, font: "Calibri", color: DARK_BLUE })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Furosemide (Lasix), Torasemide", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Relieves fluid build-up (swelling, breathlessness) quickly — controls symptoms", size: 19, font: "Calibri" })], spacing: { before: 60, after: 60 }, indent: { left: 80 } })] }),
]}),
],
}),
spacer(),
warningBox([
"⚠️ IMPORTANT MEDICINE RULES:",
"",
"• Never stop or skip your heart medicines without talking to your doctor — even if you feel fine.",
"• Do NOT take NSAIDs (ibuprofen, naproxen, diclofenac) — they can worsen heart failure.",
"• Avoid calcium channel blockers like verapamil or diltiazem unless your doctor specifically prescribes them.",
"• Tell ALL your doctors (including dentists) that you have heart failure.",
]),
spacer(),
// ── DIET ──────────────────────────────────────────────────────────────
heading1("DIET — WHAT TO EAT & AVOID"),
spacer(),
heading2("🧂 SALT (SODIUM) — YOUR #1 PRIORITY"),
spacer(),
body("Too much salt causes your body to hold extra water, which forces your heart to work harder and makes you swell and feel breathless."),
spacer(),
infoBox([
"🎯 TARGET: Less than 2,000 mg (2 grams) of sodium per day.",
"",
"📌 For reference: 1 teaspoon of table salt = about 2,300 mg sodium — already over your daily limit!",
"📌 Most processed and packaged foods are very high in hidden salt.",
], YELLOW_BG),
spacer(),
heading3("Foods HIGH in Salt — LIMIT OR AVOID"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ tableHeader: true, children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: RED_WARN }, children: [new Paragraph({ children: [new TextRun({ text: "❌ High-Salt Foods", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })] }),
new TableCell({ shading: { type: ShadingType.SOLID, color: RED_WARN }, children: [new Paragraph({ children: [new TextRun({ text: "Why to Avoid", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })] }),
]}),
foodRow("Table salt, soy sauce, fish sauce, pickles", "Pure sodium — add directly to fluid load", false),
foodRow("Processed meats (sausage, bacon, ham, canned meat)", "Very high hidden salt — even small portions can exceed limits", false),
foodRow("Canned soups, canned vegetables, instant noodles", "1 can of soup can contain 800–1,200 mg sodium alone", false),
foodRow("Cheese, salted butter, most fast foods", "High sodium; fast foods often exceed 1,500 mg per meal", false),
foodRow("Chips, crackers, salted nuts, packaged snacks", "Loaded with sodium and may cause water retention quickly", false),
foodRow("Bread (some loaves), breakfast cereals", "Often surprisingly high — always check the label", false),
],
}),
spacer(),
heading3("Better Choices — EAT MORE OF THESE"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ tableHeader: true, children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: GREEN_OK }, children: [new Paragraph({ children: [new TextRun({ text: "✅ Heart-Friendly Foods", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })] }),
new TableCell({ shading: { type: ShadingType.SOLID, color: GREEN_OK }, children: [new Paragraph({ children: [new TextRun({ text: "Why They Help", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })] }),
]}),
foodRow("Fresh fruits (apples, pears, berries, mangoes)", "Natural, low in sodium, rich in potassium and antioxidants", true),
foodRow("Fresh or frozen vegetables (no added salt)", "High fibre, potassium, low sodium — support heart health", true),
foodRow("Lean proteins (skinless chicken, fish, tofu, eggs)", "Low saturated fat; fish provides omega-3 fatty acids", true),
foodRow("Whole grains (oats, brown rice, wholegrain bread)", "High fibre, steady energy, lower blood pressure", true),
foodRow("Legumes (lentils, chickpeas, kidney beans — rinse canned ones)", "Good protein, low fat, high potassium", true),
foodRow("Olive oil (in moderation)", "Healthier fat; used in Mediterranean diet shown to help the heart", true),
foodRow("Herbs and spices (pepper, cumin, turmeric, garlic)", "Flavour without sodium — great salt replacer", true),
],
}),
spacer(),
heading2("💧 FLUID INTAKE"),
spacer(),
body("If you have significant swelling or breathlessness, your doctor may recommend limiting fluids:"),
spacer(),
bullet("General target: 1.5 to 2 litres of total fluid per day (includes soups, juice, tea, coffee)", ""),
bullet("All liquids count — water, juice, milk, ice cream, jelly/gelatin", ""),
bullet("If your fluid restriction is strict, use small cups; spread intake throughout the day", ""),
bullet("Ice chips (a small amount) can help with thirst without adding large fluid volumes", ""),
spacer(),
heading2("⚖️ POTASSIUM — KNOW YOUR LEVEL"),
spacer(),
body("Some heart failure medicines (MRAs like spironolactone, ACE inhibitors, ARBs) raise your potassium level. High potassium can cause dangerous heart rhythms. Your doctor will check this with blood tests."),
spacer(),
bullet("If your potassium is HIGH: avoid bananas, oranges, potatoes, tomatoes, coconut water, dried fruits"),
bullet("If your potassium is LOW: your doctor may recommend supplements or potassium-rich foods"),
bullet("ALWAYS confirm with your doctor before making changes to potassium intake"),
spacer(),
heading2("🍺 ALCOHOL"),
spacer(),
body("Alcohol weakens the heart muscle directly. If alcohol caused or contributed to your heart failure, it must be completely avoided. Even in other causes, it is best to strictly limit or stop alcohol entirely."),
spacer(),
heading2("☕ CAFFEINE"),
spacer(),
body("Moderate caffeine (1–2 cups of coffee or tea per day) is generally acceptable. Avoid energy drinks — they contain large amounts of caffeine and stimulants that can trigger abnormal heart rhythms."),
spacer(),
// ── DAILY MONITORING ──────────────────────────────────────────────────
heading1("DAILY MONITORING — YOUR HOME CHECKS"),
spacer(),
infoBox([
"Every morning BEFORE eating and AFTER urinating, weigh yourself on the same scale.",
"",
"📓 Keep a diary of: your weight, blood pressure (if you have a home monitor), how you feel,",
" any swelling, and how many times you woke up at night to urinate.",
"",
"🚨 Call your doctor or go to emergency if you notice:",
" • Weight gain of more than 2 kg (about 4–5 lbs) in 2 days",
" • Sudden increase in shortness of breath",
" • New or worsening swelling in legs or abdomen",
" • Dizziness, fainting, or rapid heartbeat",
" • Chest pain",
], ORANGE_BG),
spacer(),
// ── LIFESTYLE ─────────────────────────────────────────────────────────
heading1("LIFESTYLE TIPS"),
spacer(),
heading3("Exercise"),
bullet("Light regular activity (walking, gentle cycling) improves how you feel and your heart's strength"),
bullet("Start slow — even 5–10 minutes a day — and build up gradually"),
bullet("Stop if you feel very breathless, dizzy, or have chest pain — rest and tell your doctor"),
bullet("Cardiac rehabilitation programs (supervised exercise) are strongly recommended — ask your doctor"),
spacer(),
heading3("Sleep Position"),
bullet("If you feel breathless lying flat, try sleeping with the head of the bed raised (extra pillow or wedge)"),
spacer(),
heading3("Smoking"),
body("If you smoke, stopping is one of the most important things you can do for your heart. Ask your doctor or nurse about stop-smoking programmes.", { bold: false }),
spacer(),
heading3("Stress and Mental Health"),
bullet("Stress and anxiety can worsen heart failure symptoms"),
bullet("Talk to your doctor if you feel low, anxious, or overwhelmed — support is available"),
spacer(),
// ── WHEN TO SEEK HELP ──────────────────────────────────────────────────
heading1("WHEN TO SEEK HELP IMMEDIATELY"),
spacer(),
warningBox([
"🚨 GO TO EMERGENCY or CALL YOUR DOCTOR RIGHT AWAY if you have:",
"",
"• Sudden severe shortness of breath (especially at rest or waking you from sleep)",
"• Chest pain or pressure",
"• Coughing up pink or frothy phlegm",
"• Fainting or near-fainting",
"• Very fast or irregular heartbeat",
"• Weight gain >2 kg in 2 days",
"• Extreme tiredness with confusion",
]),
spacer(),
// ── FOLLOW UP ─────────────────────────────────────────────────────────
heading1("YOUR FOLLOW-UP PLAN"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ tableHeader: true, children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: MED_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "Appointment / Test", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })] }),
new TableCell({ shading: { type: ShadingType.SOLID, color: MED_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "How Often", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })] }),
new TableCell({ shading: { type: ShadingType.SOLID, color: MED_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "Notes", bold: true, size: 20, color: WHITE, font: "Calibri" })], indent: { left: 80 } })] }),
]}),
twoColRow && new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "Cardiology clinic", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Every 3–6 months", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Medicine review, echo if needed", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
]}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "Blood tests (kidney function, potassium)", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Every 1–3 months initially", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "More frequent when medicines are started or changed", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
]}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "Echocardiogram (heart ultrasound)", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "3–6 months after optimising medicines", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Checks if EF is improving", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
]}),
new TableRow({ children: [
new TableCell({ shading: { type: ShadingType.SOLID, color: LIGHT_BLUE }, children: [new Paragraph({ children: [new TextRun({ text: "Influenza & Pneumonia vaccines", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Yearly (flu) / Once (pneumonia)", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: "Infections can trigger heart failure flares", size: 19, font: "Calibri" })], indent: { left: 80 }, spacing: { before: 60, after: 60 } })] }),
]}),
],
}),
spacer(),
// ── QUICK REFERENCE CARD ──────────────────────────────────────────────
heading1("QUICK REFERENCE — AT A GLANCE"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [
new TableCell({
shading: { type: ShadingType.SOLID, color: "E8F5E9" },
children: [
new Paragraph({ children: [new TextRun({ text: "✅ DO", bold: true, size: 22, color: GREEN_OK, font: "Calibri" })], alignment: AlignmentType.CENTER, spacing: { before: 60, after: 60 } }),
new Paragraph({ children: [new TextRun({ text: "• Take ALL medicines every day", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Weigh yourself every morning", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Limit salt to <2,000 mg/day", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Stay active with light exercise", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Attend all appointments", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Get annual flu vaccine", size: 19, font: "Calibri" })], spacing: { before: 40, after: 60 }, indent: { left: 100 } }),
],
}),
new TableCell({
shading: { type: ShadingType.SOLID, color: "FDECEA" },
children: [
new Paragraph({ children: [new TextRun({ text: "❌ DO NOT", bold: true, size: 22, color: RED_WARN, font: "Calibri" })], alignment: AlignmentType.CENTER, spacing: { before: 60, after: 60 } }),
new Paragraph({ children: [new TextRun({ text: "• Stop medicines without advice", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Eat salty/processed foods", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Drink alcohol", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Take ibuprofen/naproxen", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Smoke", size: 19, font: "Calibri" })], spacing: { before: 40, after: 40 }, indent: { left: 100 } }),
new Paragraph({ children: [new TextRun({ text: "• Ignore worsening symptoms", size: 19, font: "Calibri" })], spacing: { before: 40, after: 60 }, indent: { left: 100 } }),
],
}),
]}),
],
}),
spacer(),
// ── FOOTER NOTE ───────────────────────────────────────────────────────
new Paragraph({
children: [new TextRun({ text: "This handout is for educational purposes and does not replace advice from your doctor or healthcare team. Always follow your personalised care plan.", size: 17, font: "Calibri", italics: true, color: "666666" })],
alignment: AlignmentType.CENTER,
spacing: { before: 200 },
border: { top: { style: BorderStyle.SINGLE, size: 4, color: GREY_RULE } },
}),
],
}],
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/hfref-handout/HFrEF_Patient_Education_Handout.docx", buffer);
console.log("SUCCESS: File written.");
}).catch(err => {
console.error("ERROR:", err);
process.exit(1);
});
cd /home/daytona/workspace/hfref-handout && node create_handout.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/works…
ls -lh /home/daytona/workspace/hfref-handout/ && python3 -c "import zipfile; z=z…
HFrEF Patient Education Handout
Word Document · DOCX