Make an ncp on hypertension
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or does not exist"
mkdir -p /home/daytona/workspace/ncp-hypertension && node -e "require('docx'); console.log('docx ok');"
~/ncp-hypertension/generate_ncp.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, HeadingLevel, BorderStyle, WidthType, VerticalAlign,
ShadingType, PageBreak, LevelFormat
} = require('docx');
const fs = require('fs');
// ─── Helpers ─────────────────────────────────────────────────────────────────
const CONTENT_WIDTH = 9360; // US Letter 1" margins
// Column widths for landscape NCP table (total = content width for landscape)
// Landscape content width = 15840 - 2880 = 12960
const LCOL = [1600, 1700, 2200, 2200, 2000, 1500, 1760]; // sum = 12960
function shade(hex) {
return { type: ShadingType.CLEAR, color: "auto", fill: hex };
}
function cell(text, opts = {}) {
const {
bold = false, color = "000000", bg = "FFFFFF", width = null,
colspan = 1, rowspan = 1, fontSize = 18, italic = false,
align = AlignmentType.LEFT, vAlign = VerticalAlign.CENTER,
wrap = true
} = opts;
return new TableCell({
columnSpan: colspan,
rowSpan: rowspan,
verticalAlign: vAlign,
shading: shade(bg),
width: width ? { size: width, type: WidthType.DXA } : undefined,
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: [new Paragraph({
alignment: align,
children: [new TextRun({
text: String(text), bold, color, size: fontSize, font: "Arial", italic
})]
})]
});
}
function headerCell(text, width, colspan = 1) {
return cell(text, { bold: true, color: "FFFFFF", bg: "1F3864", width, colspan, fontSize: 18 });
}
function subHeaderCell(text, width, bg = "BDD7EE") {
return cell(text, { bold: true, color: "1F3864", bg, width, fontSize: 18 });
}
function dataCell(text, width, bg = "FFFFFF") {
return cell(text, { width, bg, fontSize: 17 });
}
function makeNCPTable(dx) {
const {
ndx, related, aeb, goal, outcomes, interventions, rationale, evaluation
} = dx;
const rows = [];
// Row 1: headers
rows.push(new TableRow({
tableHeader: true,
children: [
headerCell("NURSING DIAGNOSIS", LCOL[0]),
headerCell("RELATED TO", LCOL[1]),
headerCell("AS EVIDENCED BY", LCOL[2]),
headerCell("GOAL / EXPECTED OUTCOMES", LCOL[3]),
headerCell("NURSING INTERVENTIONS", LCOL[4]),
headerCell("RATIONALE", LCOL[5]),
headerCell("EVALUATION", LCOL[6]),
]
}));
// Determine max rows
const maxRows = Math.max(
outcomes.length, interventions.length, rationale.length, 1
);
for (let i = 0; i < maxRows; i++) {
const isFirst = i === 0;
rows.push(new TableRow({
children: [
// NURSING DX - rowspan entire block on first row
...(isFirst ? [new TableCell({
rowSpan: maxRows,
verticalAlign: VerticalAlign.TOP,
shading: shade("EBF3FB"),
width: { size: LCOL[0], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: [
new Paragraph({ children: [new TextRun({ text: ndx, bold: true, size: 18, font: "Arial", color: "1F3864" })] })
]
})] : []),
// RELATED TO - rowspan
...(isFirst ? [new TableCell({
rowSpan: maxRows,
verticalAlign: VerticalAlign.TOP,
shading: shade("FFF2CC"),
width: { size: LCOL[1], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: related.map(r => new Paragraph({
children: [new TextRun({ text: "- " + r, size: 17, font: "Arial" })]
}))
})] : []),
// AS EVIDENCED BY - rowspan
...(isFirst ? [new TableCell({
rowSpan: maxRows,
verticalAlign: VerticalAlign.TOP,
shading: shade("FFF2CC"),
width: { size: LCOL[2], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: aeb.map(a => new Paragraph({
children: [new TextRun({ text: "- " + a, size: 17, font: "Arial" })]
}))
})] : []),
// GOAL + OUTCOMES - rowspan
...(isFirst ? [new TableCell({
rowSpan: maxRows,
verticalAlign: VerticalAlign.TOP,
shading: shade("E2EFDA"),
width: { size: LCOL[3], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: [
new Paragraph({ children: [new TextRun({ text: "GOAL: " + goal, bold: true, size: 17, font: "Arial", color: "375623" })] }),
new Paragraph({ children: [new TextRun({ text: " ", size: 10, font: "Arial" })] }),
new Paragraph({ children: [new TextRun({ text: "OUTCOMES:", bold: true, size: 17, font: "Arial" })] }),
...outcomes.map(o => new Paragraph({
children: [new TextRun({ text: "- " + o, size: 17, font: "Arial" })]
}))
]
})] : []),
// INTERVENTIONS - one per row
new TableCell({
verticalAlign: VerticalAlign.TOP,
shading: shade("FFFFFF"),
width: { size: LCOL[4], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: interventions[i] ? [new Paragraph({
children: [new TextRun({ text: interventions[i], size: 17, font: "Arial" })]
})] : [new Paragraph({ children: [new TextRun({ text: "", size: 17, font: "Arial" })] })]
}),
// RATIONALE - one per row
new TableCell({
verticalAlign: VerticalAlign.TOP,
shading: shade("F4EEFC"),
width: { size: LCOL[5], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: rationale[i] ? [new Paragraph({
children: [new TextRun({ text: rationale[i], size: 17, font: "Arial" })]
})] : [new Paragraph({ children: [new TextRun({ text: "", size: 17, font: "Arial" })] })]
}),
// EVALUATION - rowspan
...(isFirst ? [new TableCell({
rowSpan: maxRows,
verticalAlign: VerticalAlign.TOP,
shading: shade("FCE4EC"),
width: { size: LCOL[6], type: WidthType.DXA },
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: [new Paragraph({
children: [new TextRun({ text: evaluation, size: 17, font: "Arial" })]
})]
})] : []),
]
}));
}
return new Table({
width: { size: 12960, type: WidthType.DXA },
columnWidths: LCOL,
rows
});
}
// ─── NCP DATA ─────────────────────────────────────────────────────────────────
const diagnoses = [
{
ndx: "Risk for Decreased Cardiac Output",
related: [
"Increased systemic vascular resistance",
"Prolonged elevated blood pressure",
"Left ventricular hypertrophy",
"Alterations in cardiac rate/rhythm"
],
aeb: [
"BP consistently >140/90 mmHg",
"Reports of palpitations",
"Dyspnea on exertion",
"Fatigue",
"Tachycardia or bradycardia on assessment",
"ECG changes (LVH)"
],
goal: "Patient will maintain adequate cardiac output as evidenced by stable vital signs and absence of signs of heart failure.",
outcomes: [
"BP maintained at <130/80 mmHg by discharge",
"HR within 60-100 bpm",
"Absence of edema and dyspnea",
"Patient verbalizes understanding of antihypertensive therapy"
],
interventions: [
"Monitor BP in both arms every 4 hours or per protocol; note changes in pulse quality, rate, and rhythm",
"Assess for signs of decreased CO: pallor, cyanosis, cool extremities, decreased urine output (<30 mL/hr)",
"Administer antihypertensives as ordered (ACE inhibitors, ARBs, calcium channel blockers, diuretics); monitor response",
"Maintain a quiet, restful environment; limit stressful stimuli; encourage relaxation techniques",
"Monitor daily weight, I&O, and presence of peripheral edema; report weight gain >2 lbs/day",
"Obtain 12-lead ECG as ordered; report dysrhythmias immediately",
"Position patient in semi-Fowler's if dyspneic; administer O2 as ordered"
],
rationale: [
"Bilateral BP comparison detects vascular abnormalities; HR and rhythm changes indicate cardiac compromise",
"Early signs of decreased CO allow prompt intervention before decompensation",
"Antihypertensives reduce afterload and preload, lowering cardiac workload",
"Stress activates the sympathetic nervous system, elevating BP and HR further",
"Weight gain indicates fluid retention increasing cardiac preload",
"ECG detects LVH and dysrhythmias associated with chronic hypertension",
"Elevated HOB reduces venous return; O2 supports myocardial oxygenation"
],
evaluation: "Goal met if BP <130/80 mmHg, HR 60-100 bpm, no edema/dyspnea, and patient demonstrates understanding of medications. Reassess every shift."
},
{
ndx: "Ineffective Tissue Perfusion (Cerebral, Peripheral)",
related: [
"Decreased arterial blood flow",
"Interruption of cerebral/peripheral circulation secondary to elevated BP",
"Vasospasm and arteriosclerotic changes"
],
aeb: [
"Headache (occipital, especially in the morning)",
"Visual disturbances (blurred vision, diplopia)",
"Dizziness / vertigo",
"Numbness/tingling of extremities",
"Altered level of consciousness",
"Diminished peripheral pulses"
],
goal: "Patient will demonstrate improved tissue perfusion as evidenced by orientation to person/place/time, absence of neurological deficits, and palpable peripheral pulses.",
outcomes: [
"Patient is alert and oriented x3",
"Headache resolved or reduced to </=2/10",
"Peripheral pulses 2+ bilaterally",
"No new neurological deficits noted"
],
interventions: [
"Perform neuro checks every 2-4 hours: LOC, pupil response, motor/sensory function, speech, orientation",
"Monitor BP closely; report sudden severe rise (hypertensive urgency/emergency criteria: SBP >180 mmHg)",
"Assess peripheral circulation: skin color, temperature, capillary refill, pedal pulses",
"Instruct patient to change positions slowly to prevent orthostatic hypotension from antihypertensives",
"Administer IV antihypertensives (e.g., labetalol, nicardipine) as ordered for hypertensive crisis; titrate per protocol",
"Maintain calm environment; minimize sudden stimuli that may trigger BP spikes",
"Monitor CBC, BMP, creatinine; report abnormal renal function indicative of end-organ damage"
],
rationale: [
"Frequent neuro checks detect early signs of hypertensive encephalopathy or stroke",
"Rapid BP elevation can lead to hypertensive emergency with target organ damage",
"Peripheral vascular assessment identifies circulatory compromise",
"Antihypertensives cause vasodilation; positional changes can cause falls",
"IV agents allow controlled, titratable BP reduction in emergencies (goal: reduce MAP by 10-25% in first hour)",
"Stimuli trigger sympathetic response, elevating BP acutely",
"Hypertension is a leading cause of renal failure; monitoring allows early detection"
],
evaluation: "Goal met if patient remains neurologically intact, oriented x3, headache resolves, and peripheral pulses are palpable. Document any new deficits immediately."
},
{
ndx: "Activity Intolerance",
related: [
"Imbalance between oxygen supply and demand",
"Generalized weakness and fatigue",
"Dyspnea on exertion secondary to elevated BP",
"Side effects of antihypertensive medications"
],
aeb: [
"Reports of fatigue and weakness",
"Dyspnea with mild activity",
"Elevated BP/HR with minimal exertion",
"Verbalizes inability to perform ADLs without tiring",
"Pallor or diaphoresis with activity"
],
goal: "Patient will tolerate progressive activity with BP, HR, and SpO2 remaining within acceptable parameters.",
outcomes: [
"Patient performs ADLs without significant dyspnea or fatigue",
"HR increase with activity does not exceed 20 bpm above resting",
"SpO2 remains >/=94% during activity",
"Patient identifies energy conservation techniques"
],
interventions: [
"Assess baseline activity tolerance; use dyspnea/fatigue scale before and after activities",
"Monitor vital signs (BP, HR, SpO2, RR) before, during, and after activity; hold activity if SBP >180 or <90 mmHg",
"Plan activities during periods of lowest fatigue; schedule rest periods between activities",
"Assist patient with ADLs as needed; progress activity gradually (bed rest -> sitting -> ambulation)",
"Teach energy conservation techniques: pacing, sitting while doing tasks, prioritizing activities",
"Collaborate with physical therapy for a structured, supervised exercise program appropriate for hypertensive patients",
"Educate on DASH diet principles and weight management to reduce cardiac workload"
],
rationale: [
"Baseline data allows comparison and detection of deterioration with activity",
"Vital sign monitoring ensures activity remains safe; stopping prevents cardiovascular events",
"Rest periods balance energy expenditure with available reserve",
"Gradual progression prevents overexertion while improving functional capacity",
"Energy conservation reduces oxygen demand and cardiac strain",
"Supervised aerobic exercise has been shown to reduce systolic BP by 5-8 mmHg in hypertensive patients",
"Weight loss of 1 kg reduces SBP by ~1 mmHg; DASH diet reduces BP by 8-14 mmHg"
],
evaluation: "Goal met if patient performs ADLs without dyspnea/fatigue, vital signs remain stable during activity, and patient demonstrates energy conservation techniques."
},
{
ndx: "Deficient Knowledge",
related: [
"Lack of information regarding hypertension management",
"Misunderstanding of disease process",
"First-time diagnosis",
"Low health literacy"
],
aeb: [
"Verbalization of lack of understanding about hypertension",
"Non-adherence to antihypertensive medications",
"Unhealthy lifestyle (high-sodium diet, sedentary, smoking, alcohol use)",
"Inability to identify signs/symptoms requiring medical attention",
"Incorrect medication administration"
],
goal: "Patient will verbalize understanding of hypertension, treatment plan, and lifestyle modifications prior to discharge.",
outcomes: [
"Patient accurately describes what hypertension is and its complications",
"Patient demonstrates correct technique for home BP monitoring",
"Patient lists prescribed medications, doses, timing, and side effects",
"Patient identifies DASH diet principles and 3 lifestyle modifications",
"Patient states when to seek emergency care (severe headache, chest pain, vision changes, BP >180/120)"
],
interventions: [
"Assess patient's current knowledge of hypertension, medications, and lifestyle; identify barriers to learning",
"Educate on pathophysiology of hypertension: 'silent killer,' long-term complications (stroke, MI, renal failure, retinopathy)",
"Teach correct home BP monitoring technique; provide a log and target range (<130/80 mmHg per JNC/AHA 2017 guidelines)",
"Review each medication: name, purpose, dose, timing, side effects, importance of NOT stopping without consulting MD",
"Instruct on DASH diet: reduce sodium (<2,300 mg/day, ideally <1,500 mg), increase fruits/vegetables, low-fat dairy, reduce saturated fats",
"Counsel on lifestyle modifications: weight loss, regular aerobic exercise (150 min/week), smoking cessation, limit alcohol (<2 drinks/day men, <1 women)",
"Provide written discharge instructions; involve family/caregiver in education; use teach-back method to confirm understanding"
],
rationale: [
"Identifying knowledge gaps allows targeted, individualized teaching",
"Understanding complications motivates adherence to treatment",
"Home BP monitoring improves BP control and treatment adherence; target provides a clear goal",
"Knowledge of medications reduces errors and increases adherence",
"Sodium restriction reduces extracellular fluid volume and BP",
"Lifestyle modifications can reduce BP equivalent to single-drug therapy",
"Written materials reinforce verbal teaching; teach-back confirms retention"
],
evaluation: "Goal met if patient passes teach-back on hypertension management, demonstrates BP monitoring technique, and verbalizes lifestyle modifications and medication regimen."
},
{
ndx: "Risk for Noncompliance with Therapeutic Regimen",
related: [
"Side effects of antihypertensive medications",
"Asymptomatic nature of hypertension (no symptoms = feels no need for treatment)",
"Financial barriers to medications",
"Complex medication regimen",
"Lack of social support"
],
aeb: [
"Hypertension is asymptomatic - patient states 'I feel fine'",
"History of missed doses or stopping medications on own",
"Expressed concerns about cost of medications",
"States difficulty remembering multiple medications",
"Limited support at home"
],
goal: "Patient will demonstrate commitment to the antihypertensive regimen and lifestyle modifications.",
outcomes: [
"Patient states reasons why adherence is important even when asymptomatic",
"Patient identifies strategies to remember medications",
"Patient is connected with resources for medication assistance if needed",
"Follow-up appointment scheduled before discharge"
],
interventions: [
"Explore patient's beliefs and attitudes about hypertension and medications; address misconceptions (e.g., 'I only need it when I feel bad')",
"Educate that hypertension is asymptomatic but causes silent organ damage; use visual aids (complications chart)",
"Simplify medication regimen when possible (collaborating with MD); provide pill organizer and alarm/app reminders",
"Assess financial barriers; refer to social work, patient assistance programs, generic medication alternatives",
"Schedule and confirm follow-up appointment before discharge; provide contact information for questions",
"Encourage family involvement; discuss social support strategies",
"Provide positive reinforcement for adherence behaviors; set realistic, patient-centered goals"
],
rationale: [
"Understanding patient's health beliefs is foundational to behavior change",
"Visible evidence of consequences increases motivation for adherence",
"Simplifying regimens and using reminders reduces cognitive burden",
"Financial barriers are a top reason for non-adherence; assistance programs bridge gaps",
"Continuity of care is key to long-term BP control",
"Social support is a strong predictor of medication adherence",
"Positive reinforcement and goal-setting improve self-efficacy"
],
evaluation: "Goal met if patient verbalizes importance of adherence, has a plan for medication reminders, has follow-up scheduled, and any financial barriers are addressed before discharge."
},
{
ndx: "Anxiety",
related: [
"New or worsening diagnosis of hypertension",
"Fear of complications (stroke, heart attack)",
"Lifestyle changes required",
"Uncertainty about treatment effectiveness"
],
aeb: [
"Patient expresses worry and fear about diagnosis",
"Increased BP in context of emotional distress",
"Restlessness, inability to sleep",
"Sympathetic activation: palpitations, diaphoresis, trembling"
],
goal: "Patient will report reduced anxiety and demonstrate use of coping strategies.",
outcomes: [
"Patient rates anxiety </=3/10 by end of shift",
"Patient identifies at least 2 coping strategies",
"Patient sleeps 6-8 hours without interruption",
"Vital signs reflect decreased sympathetic tone"
],
interventions: [
"Acknowledge patient's concerns; establish a therapeutic relationship through active listening and empathy",
"Provide clear, simple, honest information about hypertension; avoid information overload",
"Teach relaxation techniques: deep breathing, progressive muscle relaxation, guided imagery",
"Maintain calm, quiet environment; reduce unnecessary interruptions",
"Collaborate with physician/psychologist if anxiety is severe or co-existing anxiety disorder is suspected",
"Encourage expression of feelings; involve patient in care decisions to increase sense of control",
"Refer to support groups or cardiac rehabilitation programs if appropriate"
],
rationale: [
"Therapeutic relationship reduces feelings of isolation and fear",
"Accurate information reduces fear of the unknown",
"Relaxation techniques activate parasympathetic response, lowering HR and BP",
"Environmental stimuli trigger sympathetic activation, worsening anxiety and BP",
"Pharmacological or psychotherapeutic intervention may be required for clinical anxiety",
"Sense of control reduces helplessness, a major contributor to anxiety",
"Peer support normalizes experience and provides practical coping models"
],
evaluation: "Goal met if patient rates anxiety </=3/10, identifies and uses coping strategies, and vital signs show decreased sympathetic activation."
}
];
// ─── DOCUMENT CONSTRUCTION ────────────────────────────────────────────────────
function titlePara(text) {
return new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200, after: 100 },
children: [new TextRun({ text, bold: true, size: 36, font: "Arial", color: "1F3864" })]
});
}
function subTitlePara(text) {
return new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 24, font: "Arial", color: "2E74B5" })]
});
}
function sectionHeading(text) {
return new Paragraph({
pageBreakBefore: true,
spacing: { before: 200, after: 120 },
children: [
new TextRun({ text, bold: true, size: 26, font: "Arial", color: "1F3864" })
]
});
}
function bodyPara(text) {
return new Paragraph({
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 19, font: "Arial" })]
});
}
function bulletPara(text) {
return new Paragraph({
spacing: { before: 40, after: 40 },
indent: { left: 360 },
children: [new TextRun({ text: "\u2022 " + text, size: 19, font: "Arial" })]
});
}
function spacer() {
return new Paragraph({ children: [new TextRun({ text: " ", size: 10, font: "Arial" })] });
}
function divider() {
return new Paragraph({
border: { bottom: { color: "2E74B5", size: 4, value: BorderStyle.SINGLE, space: 1 } },
children: [new TextRun({ text: " " })]
});
}
// Patient Information Table
function patientInfoTable() {
const labelStyle = { bold: true, size: 18, font: "Arial", color: "1F3864" };
const valStyle = { size: 18, font: "Arial" };
function infoCell(text, isLabel = false) {
return new TableCell({
shading: shade(isLabel ? "D6E4F7" : "FFFFFF"),
margins: { top: 60, bottom: 60, left: 80, right: 80 },
children: [new Paragraph({
children: [new TextRun({ text, ...(isLabel ? labelStyle : valStyle) })]
})]
});
}
return new Table({
width: { size: CONTENT_WIDTH, type: WidthType.DXA },
columnWidths: [1560, 1800, 1560, 1800, 1560, 1080],
rows: [
new TableRow({ children: [
infoCell("Patient Name:", true), infoCell("_______________________"),
infoCell("Date:", true), infoCell("_____________"),
infoCell("Ward/Room:", true), infoCell("_______"),
]}),
new TableRow({ children: [
infoCell("Age/Sex:", true), infoCell("_______________________"),
infoCell("Attending Physician:", true), infoCell("_____________"),
infoCell("Nurse:", true), infoCell("_______"),
]}),
new TableRow({ children: [
infoCell("Medical Diagnosis:", true), infoCell("Hypertension"),
infoCell("Admitting BP:", true), infoCell("_____________"),
infoCell("Chief Complaint:", true), infoCell("_______"),
]}),
]
});
}
// Overview table: Hypertension Classification
function classificationTable() {
const H = (t, w) => headerCell(t, w);
const D = (t, w, bg = "FFFFFF") => dataCell(t, w, bg);
return new Table({
width: { size: CONTENT_WIDTH, type: WidthType.DXA },
columnWidths: [2000, 2000, 2000, 3360],
rows: [
new TableRow({ tableHeader: true, children: [
H("Classification", 2000), H("Systolic BP (mmHg)", 2000),
H("Diastolic BP (mmHg)", 2000), H("Recommended Action", 3360)
]}),
new TableRow({ children: [
D("Normal", 2000, "E2EFDA"), D("<120", 2000, "E2EFDA"),
D("<80", 2000, "E2EFDA"), D("Healthy lifestyle", 3360, "E2EFDA")
]}),
new TableRow({ children: [
D("Elevated", 2000, "FFF2CC"), D("120-129", 2000, "FFF2CC"),
D("<80", 2000, "FFF2CC"), D("Lifestyle modifications", 3360, "FFF2CC")
]}),
new TableRow({ children: [
D("Stage 1 HTN", 2000, "FCE4EC"), D("130-139", 2000, "FCE4EC"),
D("80-89", 2000, "FCE4EC"), D("Lifestyle +/- 1 antihypertensive", 3360, "FCE4EC")
]}),
new TableRow({ children: [
D("Stage 2 HTN", 2000, "FFCCCC"), D(">= 140", 2000, "FFCCCC"),
D(">= 90", 2000, "FFCCCC"), D("2 antihypertensives + lifestyle", 3360, "FFCCCC")
]}),
new TableRow({ children: [
D("Hypertensive Crisis", 2000, "FF9999"), D("> 180", 2000, "FF9999"),
D("> 120", 2000, "FF9999"), D("Immediate medical attention", 3360, "FF9999")
]}),
]
});
}
// ─── ASSEMBLE DOCUMENT (PORTRAIT for cover + tables on landscape sections) ───
// We'll put everything in a portrait section with landscape NCP tables
const children = [];
// COVER / HEADER
children.push(titlePara("NURSING CARE PLAN"));
children.push(subTitlePara("Medical Diagnosis: Hypertension (Essential/Primary)"));
children.push(subTitlePara("Based on NANDA-I Nursing Diagnoses | AHA/ACC 2017 Guidelines"));
children.push(spacer());
children.push(divider());
children.push(spacer());
// Patient Info
children.push(new Paragraph({ spacing: { before: 100, after: 60 },
children: [new TextRun({ text: "PATIENT INFORMATION", bold: true, size: 22, font: "Arial", color: "1F3864" })] }));
children.push(patientInfoTable());
children.push(spacer());
children.push(divider());
// Background
children.push(new Paragraph({ spacing: { before: 180, after: 80 },
children: [new TextRun({ text: "BACKGROUND: HYPERTENSION", bold: true, size: 24, font: "Arial", color: "1F3864" })] }));
children.push(bodyPara("Hypertension (HTN) is defined as a persistently elevated arterial blood pressure >= 130/80 mmHg (AHA/ACC 2017) or >= 140/90 mmHg (WHO/JNC 7). It is the most prevalent modifiable cardiovascular risk factor worldwide, affecting approximately 1.28 billion adults. Hypertension is classified as primary (essential, ~95% of cases, multifactorial) or secondary (~5%, due to identifiable cause such as renal artery stenosis, primary aldosteronism, or pheochromocytoma)."));
children.push(spacer());
children.push(new Paragraph({ spacing: { before: 80, after: 60 },
children: [new TextRun({ text: "Pathophysiology:", bold: true, size: 20, font: "Arial", color: "2E74B5" })] }));
children.push(bodyPara("Elevated BP results from increased cardiac output and/or increased systemic vascular resistance (SVR). Mechanisms include: overactivation of the renin-angiotensin-aldosterone system (RAAS), sympathetic nervous system overactivity, endothelial dysfunction, sodium retention, structural vascular changes, and genetic factors. Chronic HTN leads to left ventricular hypertrophy (LVH), accelerated atherosclerosis, and end-organ damage."));
children.push(spacer());
children.push(new Paragraph({ spacing: { before: 80, after: 60 },
children: [new TextRun({ text: "Common Signs & Symptoms:", bold: true, size: 20, font: "Arial", color: "2E74B5" })] }));
children.push(bodyPara("Hypertension is often asymptomatic ('the silent killer'). When symptomatic, patients may report:"));
["Occipital headache (especially upon waking)", "Dizziness or vertigo", "Visual disturbances (blurred/double vision)", "Palpitations, chest pain", "Dyspnea on exertion", "Nocturia, epistaxis (less common)", "In hypertensive emergency: severe headache, altered mental status, chest pain, acute kidney injury"].forEach(s => children.push(bulletPara(s)));
children.push(spacer());
children.push(new Paragraph({ spacing: { before: 80, after: 60 },
children: [new TextRun({ text: "Complications (Target Organ Damage):", bold: true, size: 20, font: "Arial", color: "2E74B5" })] }));
["Cardiovascular: LVH, coronary artery disease, heart failure, myocardial infarction", "Cerebrovascular: ischemic/hemorrhagic stroke, hypertensive encephalopathy", "Renal: hypertensive nephropathy, chronic kidney disease, renal failure", "Ocular: hypertensive retinopathy, vision loss", "Peripheral vascular: peripheral artery disease"].forEach(c => children.push(bulletPara(c)));
children.push(spacer());
children.push(new Paragraph({ spacing: { before: 80, after: 60 },
children: [new TextRun({ text: "BP Classification (AHA/ACC 2017):", bold: true, size: 20, font: "Arial", color: "2E74B5" })] }));
children.push(classificationTable());
children.push(spacer());
children.push(new Paragraph({ spacing: { before: 80, after: 60 },
children: [new TextRun({ text: "Common Antihypertensive Drug Classes:", bold: true, size: 20, font: "Arial", color: "2E74B5" })] }));
children.push(bodyPara("First-line agents (JNC 8 / AHA): ACE inhibitors (e.g., lisinopril, enalapril), ARBs (e.g., losartan, valsartan), Thiazide diuretics (e.g., hydrochlorothiazide, chlorthalidone), Calcium channel blockers (e.g., amlodipine, nifedipine). Beta-blockers (e.g., metoprolol, carvedilol) are used for specific indications (post-MI, HF, angina). Monitoring: renal function, electrolytes, BP response, side effects."));
children.push(spacer());
children.push(divider());
// NCP tables - one per nursing diagnosis
diagnoses.forEach((dx, idx) => {
children.push(new Paragraph({ pageBreakBefore: true, spacing: { before: 180, after: 80 },
children: [new TextRun({ text: `NURSING DIAGNOSIS ${idx + 1}: ${dx.ndx.toUpperCase()}`, bold: true, size: 22, font: "Arial", color: "1F3864" })] }));
children.push(makeNCPTable(dx));
children.push(spacer());
});
// References
children.push(new Paragraph({ pageBreakBefore: true, spacing: { before: 180, after: 80 },
children: [new TextRun({ text: "REFERENCES", bold: true, size: 24, font: "Arial", color: "1F3864" })] }));
[
"Whelton PK, et al. (2018). 2017 ACC/AHA/AAPA/ABC/ACPM/AGS/APhA/ASH/ASPC/NMA/PCNA Guideline for the Prevention, Detection, Evaluation, and Management of High Blood Pressure in Adults. Journal of the American College of Cardiology, 71(19), e127-e248.",
"Doenges ME, Moorhouse MF, Murr AC. (2019). Nurse's Pocket Guide: Diagnoses, Prioritized Interventions, and Rationales (15th ed.). F.A. Davis Company.",
"NANDA International. (2021). Nursing Diagnoses: Definitions and Classification 2021-2023 (12th ed.). Thieme.",
"Brunner & Suddarth's Textbook of Medical-Surgical Nursing (15th ed.). (2021). Wolters Kluwer.",
"World Health Organization. (2023). Hypertension Fact Sheet. WHO.",
"James PA, et al. (2014). 2014 Evidence-Based Guideline for the Management of High Blood Pressure in Adults (JNC 8). JAMA, 311(5), 507-520.",
"Smeltzer SC, Bare BG. (2019). Textbook of Medical-Surgical Nursing. Lippincott Williams & Wilkins."
].forEach(ref => {
children.push(new Paragraph({
spacing: { before: 60, after: 40 },
children: [new TextRun({ text: ref, size: 17, font: "Arial" })]
}));
});
// ─── BUILD ────────────────────────────────────────────────────────────────────
const doc = new Document({
styles: {
default: { document: { run: { font: "Arial", size: 20 } } }
},
sections: [{
properties: {
page: {
size: { width: 15840, height: 12240, orientation: "landscape" },
margin: { top: 720, bottom: 720, left: 720, right: 720 }
}
},
children
}]
});
Packer.toBuffer(doc).then(buf => {
fs.writeFileSync("/home/daytona/workspace/ncp-hypertension/NCP_Hypertension.docx", buf);
console.log("SUCCESS: NCP_Hypertension.docx created");
}).catch(err => {
console.error("ERROR:", err.message);
process.exit(1);
});
cd /home/daytona/workspace/ncp-hypertension && node generate_ncp.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/ncp-hypertension/NCP_Hypertension.docx 2>&1
ls -lh /home/daytona/workspace/ncp-hypertension/NCP_Hypertension.docx && python3 -c " import zipfile, os path = '/home/daytona/workspace/ncp-hypertension/NCP_Hypertension.docx' with zipfile.ZipFile(path, 'r') as z: names = z.namelist() print('Files in docx:', len(names)) for n in names[:10]: print(' ', n) # check document.xml exists if 'word/document.xml' in names: print('document.xml: OK') xml = z.read('word/document.xml') print('document.xml size:', len(xml), 'bytes') "
NCP Hypertension
Word Document · DOCX
| # | Nursing Diagnosis |
|---|---|
| 1 | Risk for Decreased Cardiac Output |
| 2 | Ineffective Tissue Perfusion (Cerebral/Peripheral) |
| 3 | Activity Intolerance |
| 4 | Deficient Knowledge |
| 5 | Risk for Noncompliance with Therapeutic Regimen |
| 6 | Anxiety |