Diagnosis and management
python3 -c " import pdfplumber with pdfplumber.open('/home/daytona/workspace/att…
| Test | Result | Reference | Flag |
|---|---|---|---|
| Absolute Monocyte Count | 190.41 /µL | 200-1000 | Low |
| Platelet Count | 150,000 /µL | 150-410k | Lower limit |
| MPV (Mean Platelet Volume) | 16.10 fL | 6.8-10.9 | HIGH |
| TSH (3rd Gen) | 4.670 µIU/mL | 0.27-4.20 | HIGH |
| Triglycerides | 178 mg/dL | <150 desirable | HIGH (Borderline High) |
| HDL Cholesterol | 34.2 mg/dL | >40 optimal | LOW |
| VLDL Cholesterol | 35.6 mg/dL | 10-35 desirable | HIGH |
| Total Chol/HDL Ratio | 4.59 | 3.3-4.4 low risk | Average Risk |
| Bilirubin Total | 1.37 mg/dL | <1.20 | HIGH |
| Bilirubin Direct | 0.46 mg/dL | <0.20 | HIGH |
| Bilirubin Indirect | 0.91 mg/dL | <0.90 | HIGH |
| SGOT/AST | 44.10 U/L | <40 | HIGH |
| SGPT/ALT | 57.30 U/L | <41 | HIGH |
| Potassium | 3.27 mmol/L | 3.5-5.1 | Low |
| Chloride | 96.90 mmol/L | 97-107 | Borderline Low |
| BUN | 7.80 mg/dL | 8.87-20.5 | Low |
| Criterion | This Patient |
|---|---|
| Waist circumference ≥102 cm | Not measured (needs assessment) |
| Fasting glucose >100 mg/dL | Not met (75.4 mg/dL) |
| BP >130/85 | Not measured |
| HDL <40 mg/dL | MET (34.2) |
| Triglycerides >150 mg/dL | MET (178) |
| Test | Reason |
|---|---|
| Free T4 + TSH (repeat in 3 months) | Confirm subclinical hypothyroidism |
| Anti-TPO antibodies | Hashimoto's thyroiditis screen |
| HBsAg, Anti-HCV | Viral hepatitis exclusion |
| Abdominal Ultrasound | Confirm hepatic steatosis |
| Blood pressure measurement | Metabolic syndrome assessment |
| Waist circumference | Metabolic syndrome assessment |
| Fasting glucose repeat if lifestyle changes made | Monitoring |
Disclaimer: This analysis is for informational and educational purposes. All management decisions should be made by a qualified physician who can assess this patient's full clinical history, symptoms, BMI, blood pressure, and examination findings.
Create a clinical summary document I can print for the patient
ls /home/daytona/workspace/ && ls /home/daytona/skills/docx/
mkdir -p /home/daytona/workspace/dina-clinical-summary
~/dina-clinical-summary/create_summary.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, HeadingLevel, BorderStyle, WidthType, ShadingType,
VerticalAlign, Header, Footer, PageNumber, NumberFormat,
UnderlineType
} = require('docx');
const fs = require('fs');
// Color palette
const TEAL = "1B7A8A";
const LIGHT_TEAL_BG = "E8F4F6";
const ORANGE = "D94F1E";
const ORANGE_BG = "FEF0EC";
const GREY_BG = "F5F5F5";
const WHITE = "FFFFFF";
const DARK = "1A1A2E";
const MID_GREY = "555555";
const LIGHT_BORDER = "CCCCCC";
const HEADER_BG = "1B7A8A";
// Helper: bold teal heading paragraph
function sectionHeader(text) {
return new Paragraph({
spacing: { before: 320, after: 80 },
children: [
new TextRun({
text: text.toUpperCase(),
bold: true,
size: 22,
color: TEAL,
font: "Calibri",
})
],
border: {
bottom: { style: BorderStyle.SINGLE, size: 4, color: TEAL }
}
});
}
function subHeader(text) {
return new Paragraph({
spacing: { before: 200, after: 60 },
children: [
new TextRun({
text,
bold: true,
size: 20,
color: DARK,
font: "Calibri",
})
]
});
}
function body(text, opts = {}) {
return new Paragraph({
spacing: { before: 40, after: 40 },
indent: opts.indent ? { left: 360 } : undefined,
children: [
new TextRun({
text,
size: 19,
color: opts.color || MID_GREY,
font: "Calibri",
bold: opts.bold || false,
italics: opts.italic || false,
})
]
});
}
function bullet(text, opts = {}) {
return new Paragraph({
spacing: { before: 30, after: 30 },
indent: { left: 360, hanging: 200 },
children: [
new TextRun({
text: "• " + text,
size: 19,
color: opts.color || MID_GREY,
font: "Calibri",
bold: opts.bold || false,
})
]
});
}
function spacer(lines = 1) {
return new Paragraph({
spacing: { before: 0, after: lines * 80 },
children: [new TextRun({ text: "", size: 18 })]
});
}
// Lab results table
function labTable(rows) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE },
bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE },
right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.SINGLE, size: 1, color: LIGHT_BORDER },
insideV: { style: BorderStyle.NONE },
},
rows: [
// Header row
new TableRow({
tableHeader: true,
children: [
tableHeaderCell("Test", 40),
tableHeaderCell("Result", 20),
tableHeaderCell("Reference Range", 25),
tableHeaderCell("Status", 15),
]
}),
...rows.map((r, i) => {
const isAbnormal = r[3] !== "Normal";
const bg = isAbnormal ? ORANGE_BG : (i % 2 === 0 ? WHITE : GREY_BG);
return new TableRow({
children: [
tableDataCell(r[0], 40, bg, false),
tableDataCell(r[1], 20, bg, isAbnormal),
tableDataCell(r[2], 25, bg, false),
tableDataCell(r[3], 15, bg, isAbnormal, isAbnormal ? ORANGE : (r[3] === "Normal" ? "2E7D32" : MID_GREY)),
]
});
})
]
});
}
function tableHeaderCell(text, widthPct) {
return new TableCell({
width: { size: widthPct, type: WidthType.PERCENTAGE },
shading: { fill: HEADER_BG, type: ShadingType.SOLID },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 80, bottom: 80, left: 120, right: 60 },
children: [new Paragraph({
children: [new TextRun({ text, bold: true, color: WHITE, size: 18, font: "Calibri" })]
})]
});
}
function tableDataCell(text, widthPct, bg, isBold = false, color = MID_GREY) {
return new TableCell({
width: { size: widthPct, type: WidthType.PERCENTAGE },
shading: { fill: bg, type: ShadingType.SOLID },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 120, right: 60 },
children: [new Paragraph({
children: [new TextRun({ text, bold: isBold, color, size: 18, font: "Calibri" })]
})]
});
}
// Info box (shaded paragraph)
function infoBox(label, text, bg = LIGHT_TEAL_BG, labelColor = TEAL) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 12, color: TEAL },
right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE },
},
rows: [
new TableRow({
children: [
new TableCell({
shading: { fill: bg, type: ShadingType.SOLID },
margins: { top: 100, bottom: 100, left: 160, right: 160 },
children: [
new Paragraph({
spacing: { before: 0, after: 40 },
children: [new TextRun({ text: label, bold: true, size: 19, color: labelColor, font: "Calibri" })]
}),
new Paragraph({
spacing: { before: 0, after: 0 },
children: [new TextRun({ text, size: 18, color: MID_GREY, font: "Calibri" })]
})
]
})
]
})
]
});
}
// Two-column action table
function actionTable(leftItems, rightItems) {
const maxLen = Math.max(leftItems.length, rightItems.length);
const rows = [];
// header
rows.push(new TableRow({
children: [
tableHeaderCell("Investigations Needed", 50),
tableHeaderCell("Lifestyle Actions", 50),
]
}));
for (let i = 0; i < maxLen; i++) {
const l = leftItems[i] || "";
const r = rightItems[i] || "";
rows.push(new TableRow({
children: [
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
shading: { fill: i % 2 === 0 ? WHITE : GREY_BG, type: ShadingType.SOLID },
margins: { top: 60, bottom: 60, left: 120, right: 60 },
children: [new Paragraph({
children: [new TextRun({ text: l ? "• " + l : "", size: 18, color: MID_GREY, font: "Calibri" })]
})]
}),
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
shading: { fill: i % 2 === 0 ? WHITE : GREY_BG, type: ShadingType.SOLID },
margins: { top: 60, bottom: 60, left: 120, right: 60 },
children: [new Paragraph({
children: [new TextRun({ text: r ? "• " + r : "", size: 18, color: MID_GREY, font: "Calibri" })]
})]
}),
]
}));
}
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.SINGLE, size: 1, color: LIGHT_BORDER },
insideV: { style: BorderStyle.SINGLE, size: 1, color: LIGHT_BORDER },
},
rows
});
}
// ─── DOCUMENT ────────────────────────────────────────────────────────────────
const doc = new Document({
creator: "Orris Clinical Assistant",
title: "Clinical Summary - Dina Krusna Dhal",
styles: {
paragraphStyles: [],
},
sections: [{
properties: {
page: {
margin: { top: 720, bottom: 720, left: 900, right: 900 }
}
},
headers: {
default: new Header({
children: [
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.SINGLE, size: 4, color: TEAL },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE },
},
rows: [new TableRow({
children: [
new TableCell({
width: { size: 70, type: WidthType.PERCENTAGE },
borders: { top: {style:BorderStyle.NONE}, bottom: {style:BorderStyle.NONE}, left: {style:BorderStyle.NONE}, right: {style:BorderStyle.NONE} },
children: [
new Paragraph({
children: [new TextRun({ text: "CLINICAL SUMMARY REPORT", bold: true, size: 26, color: TEAL, font: "Calibri" })]
}),
new Paragraph({
spacing: { before: 20 },
children: [new TextRun({ text: "Lab Investigation Review & Management Plan", size: 18, color: MID_GREY, font: "Calibri", italics: true })]
}),
]
}),
new TableCell({
width: { size: 30, type: WidthType.PERCENTAGE },
borders: { top: {style:BorderStyle.NONE}, bottom: {style:BorderStyle.NONE}, left: {style:BorderStyle.NONE}, right: {style:BorderStyle.NONE} },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: AlignmentType.RIGHT,
children: [new TextRun({ text: "Date of Report: 08 July 2026", size: 17, color: MID_GREY, font: "Calibri" })]
})]
})
]
})]
}),
spacer(0.5)
]
})
},
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 2, color: LIGHT_BORDER } },
spacing: { before: 60 },
children: [
new TextRun({ text: "This document is for informational purposes. All medical decisions should be made by a qualified physician. | Pathkind Labs, Bhubaneswar", size: 16, color: "999999", font: "Calibri", italics: true })
]
})
]
})
},
children: [
spacer(0.5),
// ── Patient Info Card ──────────────────────────────────────────────────
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE },
},
rows: [new TableRow({
children: [
new TableCell({
shading: { fill: LIGHT_TEAL_BG, type: ShadingType.SOLID },
margins: { top: 160, bottom: 160, left: 200, right: 200 },
borders: {
top: { style: BorderStyle.SINGLE, size: 2, color: TEAL },
bottom: { style: BorderStyle.SINGLE, size: 2, color: TEAL },
left: { style: BorderStyle.THICK, size: 16, color: TEAL },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({
children: [
new TextRun({ text: "Mr. Dina Krusna Dhal", bold: true, size: 28, color: DARK, font: "Calibri" }),
]
}),
new Paragraph({
spacing: { before: 60 },
children: [
new TextRun({ text: "Age: 36 Years | Gender: Male | Lab ID: 2000C245260708002385", size: 18, color: MID_GREY, font: "Calibri" }),
]
}),
new Paragraph({
spacing: { before: 40 },
children: [
new TextRun({ text: "Address: No-584/93, Plot No 886, Balasore, Baleshwar, Odisha 756002", size: 17, color: "888888", font: "Calibri", italics: true }),
]
}),
new Paragraph({
spacing: { before: 40 },
children: [
new TextRun({ text: "Sample Collected: 08/07/2026 | Reported: 08/07/2026 | Referred by: Self", size: 17, color: "888888", font: "Calibri" }),
]
}),
]
})
]
})]
}),
spacer(1),
// ── Section 1: Diagnoses ───────────────────────────────────────────────
sectionHeader("1. Diagnoses Based on Your Reports"),
spacer(0.5),
// Diagnosis cards
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.SINGLE, size: 2, color: "EEEEEE" },
insideV: { style: BorderStyle.NONE },
},
rows: [
// Diagnosis 1
new TableRow({
children: [new TableCell({
shading: { fill: ORANGE_BG, type: ShadingType.SOLID },
margins: { top: 120, bottom: 120, left: 180, right: 180 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: ORANGE },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [
new TextRun({ text: "1. Subclinical Hypothyroidism", bold: true, size: 21, color: ORANGE, font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 60 }, children: [
new TextRun({ text: "Your TSH level (4.67 µIU/mL) is slightly above the normal upper limit of 4.20. Your T3 and T4 hormones are normal. This means your thyroid gland is working harder than it should but is not yet failing. This is an early warning sign that needs monitoring and possibly treatment.", size: 18, color: MID_GREY, font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 40 }, children: [
new TextRun({ text: "Key test: TSH = 4.67 µIU/mL (Normal: 0.27-4.20)", bold: true, size: 17, color: ORANGE, font: "Calibri" })
]})
]
})]
}),
// Diagnosis 2
new TableRow({
children: [new TableCell({
shading: { fill: ORANGE_BG, type: ShadingType.SOLID },
margins: { top: 120, bottom: 120, left: 180, right: 180 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: ORANGE },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [
new TextRun({ text: "2. Dyslipidemia (Abnormal Blood Fats)", bold: true, size: 21, color: ORANGE, font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 60 }, children: [
new TextRun({ text: "Your triglycerides (blood fats) are high and your good cholesterol (HDL) is low. This combination increases your risk for heart disease, even though your total cholesterol and LDL (bad cholesterol) are normal. This pattern is often linked to excess sugar/carbohydrate intake and physical inactivity.", size: 18, color: MID_GREY, font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 40 }, children: [
new TextRun({ text: "Triglycerides = 178 mg/dL (High) | HDL = 34.2 mg/dL (Low, target >40)", bold: true, size: 17, color: ORANGE, font: "Calibri" })
]})
]
})]
}),
// Diagnosis 3
new TableRow({
children: [new TableCell({
shading: { fill: ORANGE_BG, type: ShadingType.SOLID },
margins: { top: 120, bottom: 120, left: 180, right: 180 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: ORANGE },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [
new TextRun({ text: "3. Mild Liver Stress (Possible Fatty Liver)", bold: true, size: 21, color: ORANGE, font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 60 }, children: [
new TextRun({ text: "Your liver enzymes (ALT and AST) are mildly elevated, and all three bilirubin values are slightly high. The pattern (ALT higher than AST, normal GGT) points toward a non-alcoholic cause, likely fat accumulation in the liver. This is reversible with lifestyle changes.", size: 18, color: MID_GREY, font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 40 }, children: [
new TextRun({ text: "ALT = 57.3 U/L (High) | AST = 44.1 U/L (High) | Bilirubin Total = 1.37 mg/dL (High)", bold: true, size: 17, color: ORANGE, font: "Calibri" })
]})
]
})]
}),
// Diagnosis 4
new TableRow({
children: [new TableCell({
shading: { fill: "FFFBF0", type: ShadingType.SOLID },
margins: { top: 120, bottom: 120, left: 180, right: 180 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: "E0A800" },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [
new TextRun({ text: "4. Mild Low Potassium (Hypokalemia)", bold: true, size: 21, color: "8B6914", font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 60 }, children: [
new TextRun({ text: "Your potassium level is slightly below normal. This is usually diet-related. Low potassium can cause mild fatigue, muscle cramps, or irregular heartbeat if severe. Your kidneys appear completely normal (eGFR = 115), so this is likely a nutritional issue.", size: 18, color: MID_GREY, font: "Calibri" })
]}),
new Paragraph({ spacing: { before: 40 }, children: [
new TextRun({ text: "Potassium = 3.27 mmol/L (Normal: 3.50-5.10)", bold: true, size: 17, color: "8B6914", font: "Calibri" })
]})
]
})]
}),
]
}),
spacer(1),
// ── Section 2: Complete Lab Results ───────────────────────────────────
sectionHeader("2. Complete Lab Results"),
spacer(0.3),
subHeader("Complete Blood Count (CBC)"),
labTable([
["Haemoglobin", "15.10 gm/dL", "13.0-17.0", "Normal"],
["Total WBC Count", "5.77 thou/µL", "4.0-10.0", "Normal"],
["Platelet Count", "150 thou/µL", "150-410", "Normal (Lower limit)"],
["Mean Platelet Volume (MPV)", "16.10 fL", "6.8-10.9", "HIGH"],
["RBC Count", "4.76 million/µL", "4.5-5.5", "Normal"],
["MCV / MCH / MCHC", "94.8 / 31.7 / 33.5", "Normal ranges", "Normal"],
["RDW", "13.70 %", "11.8-15.6", "Normal"],
]),
spacer(0.5),
subHeader("Diabetes & Sugar Tests"),
labTable([
["HbA1c (3-month avg sugar)", "5.10 %", "< 5.7 = Non-diabetic", "Normal"],
["Fasting Plasma Glucose", "75.40 mg/dL", "74-99", "Normal"],
["Mean Plasma Glucose", "99.67 mg/dL", "0-116", "Normal"],
]),
spacer(0.5),
subHeader("Lipid Profile (Cholesterol & Fats)"),
labTable([
["Total Cholesterol", "157 mg/dL", "< 200 = No risk", "Normal"],
["Triglycerides", "178 mg/dL", "< 150 desirable", "HIGH"],
["LDL Cholesterol (bad)", "87.2 mg/dL", "< 100", "Normal"],
["HDL Cholesterol (good)", "34.2 mg/dL", "> 40 optimal", "LOW"],
["VLDL Cholesterol", "35.6 mg/dL", "10-35 desirable", "HIGH"],
["Total Cholesterol / HDL Ratio", "4.59", "3.3-4.4 low risk", "Average risk"],
["LDL / HDL Ratio", "2.55", "0.5-3.0 low risk", "Normal"],
["Non-HDL Cholesterol", "122.8 mg/dL", "< 130", "Normal"],
]),
spacer(0.5),
subHeader("Liver Function Test (LFT)"),
labTable([
["Total Bilirubin", "1.37 mg/dL", "< 1.20", "HIGH"],
["Direct Bilirubin", "0.46 mg/dL", "< 0.20", "HIGH"],
["Indirect Bilirubin", "0.91 mg/dL", "< 0.90", "HIGH"],
["SGOT / AST", "44.10 U/L", "< 40", "HIGH"],
["SGPT / ALT", "57.30 U/L", "< 41", "HIGH"],
["AST/ALT Ratio", "0.77", "--", "Normal"],
["Alkaline Phosphatase (ALP)", "89.10 U/L", "40-129", "Normal"],
["GGT (Gamma-GT)", "18.00 U/L", "10-71", "Normal"],
["Total Protein", "7.82 gm/dL", "6.4-8.3", "Normal"],
["Albumin", "4.97 gm/dL", "3.97-4.94", "Normal"],
["A/G Ratio", "1.74", "1.0-2.1", "Normal"],
]),
spacer(0.5),
subHeader("Thyroid Profile"),
labTable([
["TSH (Thyroid Stimulating Hormone)", "4.670 µIU/mL", "0.27-4.20", "HIGH"],
["Total T3 (Triiodothyronine)", "1.62 ng/mL", "0.80-2.00", "Normal"],
["Total T4 (Thyroxine)", "11.30 µg/dL", "5.1-14.1", "Normal"],
]),
spacer(0.5),
subHeader("Kidney Function Test (KFT)"),
labTable([
["Creatinine", "0.86 mg/dL", "0.70-1.30", "Normal"],
["eGFR (kidney filtration rate)", "115.17 mL/min/1.73m²", "> 90 = Normal", "Normal"],
["Blood Urea Nitrogen (BUN)", "7.80 mg/dL", "8.87-20.5", "Low (minor)"],
["Uric Acid", "4.14 mg/dL", "3.4-7.0", "Normal"],
["Sodium", "140.30 mmol/L", "136-145", "Normal"],
["Potassium", "3.27 mmol/L", "3.50-5.10", "LOW"],
["Chloride", "96.90 mmol/L", "97-107", "Borderline low"],
["Calcium", "9.98 mg/dL", "8.6-10.0", "Normal"],
["Phosphorus", "3.53 mg/dL", "2.5-4.5", "Normal"],
]),
spacer(1),
// ── Section 3: Management Plan ────────────────────────────────────────
sectionHeader("3. Your Management Plan"),
spacer(0.5),
// Thyroid management
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE },
},
rows: [new TableRow({ children: [
new TableCell({
shading: { fill: LIGHT_TEAL_BG, type: ShadingType.SOLID },
margins: { top: 120, bottom: 140, left: 180, right: 180 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: TEAL },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [new TextRun({ text: "Thyroid (Subclinical Hypothyroidism)", bold: true, size: 20, color: TEAL, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 80 }, children: [new TextRun({ text: "• Repeat TSH + Free T4 test in 3 months to confirm the elevation is sustained", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• Get Anti-TPO antibody test to check for Hashimoto's thyroiditis", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• If confirmed elevated after 3 months AND you have symptoms (fatigue, weight gain, cold intolerance, brain fog): your doctor may start Levothyroxine 25-50 mcg/day", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• At present, your T3 and T4 are normal - this is not an emergency, but do not ignore it", size: 18, color: MID_GREY, font: "Calibri", bold: true })]}),
]
})
]})]
}),
spacer(0.5),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE },
},
rows: [new TableRow({ children: [
new TableCell({
shading: { fill: LIGHT_TEAL_BG, type: ShadingType.SOLID },
margins: { top: 120, bottom: 140, left: 180, right: 180 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: TEAL },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [new TextRun({ text: "Cholesterol & Liver (Dyslipidemia + Possible Fatty Liver)", bold: true, size: 20, color: TEAL, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 80 }, children: [new TextRun({ text: "• Get abdominal ultrasound scan to check for fatty liver (hepatic steatosis)", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• Get Hepatitis B (HBsAg) and Hepatitis C (Anti-HCV) blood tests to rule out viral hepatitis", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• Repeat liver enzymes (ALT, AST) and lipid profile in 3 months after lifestyle changes", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• No cholesterol medication is needed right now - lifestyle changes are the first step", size: 18, color: MID_GREY, font: "Calibri", bold: true })]}),
]
})
]})]
}),
spacer(0.5),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE },
},
rows: [new TableRow({ children: [
new TableCell({
shading: { fill: LIGHT_TEAL_BG, type: ShadingType.SOLID },
margins: { top: 120, bottom: 140, left: 180, right: 180 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: TEAL },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [new TextRun({ text: "Low Potassium", bold: true, size: 20, color: TEAL, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 80 }, children: [new TextRun({ text: "• Eat potassium-rich foods: bananas, oranges, coconut water, potatoes, dal (lentils), leafy greens, beans", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• Repeat electrolytes (potassium) test in 4-6 weeks", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "• If you have muscle cramps or weakness, inform your doctor - oral potassium supplements may be needed", size: 18, color: MID_GREY, font: "Calibri" })]}),
]
})
]})]
}),
spacer(1),
// ── Section 4: Lifestyle Advice ────────────────────────────────────────
sectionHeader("4. Lifestyle Advice"),
spacer(0.3),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.SINGLE, size: 2, color: "EEEEEE" },
insideV: { style: BorderStyle.SINGLE, size: 2, color: "EEEEEE" },
},
rows: [
new TableRow({
children: [
tableHeaderCell("DIET", 33),
tableHeaderCell("EXERCISE", 33),
tableHeaderCell("AVOID", 34),
]
}),
new TableRow({
children: [
new TableCell({
width: { size: 33, type: WidthType.PERCENTAGE },
shading: { fill: WHITE, type: ShadingType.SOLID },
margins: { top: 100, bottom: 100, left: 120, right: 100 },
children: [
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Reduce white rice, maida, bread, sweets, sugary drinks - these raise triglycerides", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Eat more vegetables, whole grains (oats, brown rice, millets)", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Include 2 servings of fish per week (omega-3 fats reduce triglycerides)", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Eat potassium-rich foods: banana, coconut water, dal, potatoes", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 0 }, children: [new TextRun({ text: "• Limit fried foods and trans fats", size: 17, color: MID_GREY, font: "Calibri" })]}),
]
}),
new TableCell({
width: { size: 33, type: WidthType.PERCENTAGE },
shading: { fill: GREY_BG, type: ShadingType.SOLID },
margins: { top: 100, bottom: 100, left: 120, right: 100 },
children: [
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• At least 150 minutes of moderate exercise per week (brisk walk, cycling, swimming)", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Exercise raises HDL (good cholesterol) and lowers triglycerides", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Daily 30-minute brisk walk is an excellent start", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 0 }, children: [new TextRun({ text: "• Even 5-10% body weight loss can normalize liver enzymes if overweight", size: 17, color: MID_GREY, font: "Calibri" })]}),
]
}),
new TableCell({
width: { size: 34, type: WidthType.PERCENTAGE },
shading: { fill: WHITE, type: ShadingType.SOLID },
margins: { top: 100, bottom: 100, left: 120, right: 100 },
children: [
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Avoid or strictly limit alcohol (worsens liver and triglycerides)", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Avoid smoking (lowers HDL and damages blood vessels)", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 60 }, children: [new TextRun({ text: "• Avoid sugary drinks, packed juices, sodas", size: 17, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 0, after: 0 }, children: [new TextRun({ text: "• Avoid unnecessary supplements without doctor advice (some can affect thyroid and liver)", size: 17, color: MID_GREY, font: "Calibri" })]}),
]
}),
]
})
]
}),
spacer(1),
// ── Section 5: Follow-Up Schedule ─────────────────────────────────────
sectionHeader("5. Follow-Up Schedule"),
spacer(0.3),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.SINGLE, size: 1, color: LIGHT_BORDER },
insideV: { style: BorderStyle.SINGLE, size: 1, color: LIGHT_BORDER },
},
rows: [
new TableRow({
children: [
tableHeaderCell("When", 20),
tableHeaderCell("Test / Action Required", 55),
tableHeaderCell("Reason", 25),
]
}),
new TableRow({ children: [
new TableCell({ width: {size:20, type:WidthType.PERCENTAGE}, shading:{fill:WHITE, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[new Paragraph({children:[new TextRun({text:"Within 2 weeks", bold:true, size:18, color:TEAL, font:"Calibri"})]})] }),
new TableCell({ width: {size:55, type:WidthType.PERCENTAGE}, shading:{fill:WHITE, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[
new Paragraph({children:[new TextRun({text:"• Abdominal Ultrasound (USG abdomen)", size:18, color:MID_GREY, font:"Calibri"})]}),
new Paragraph({children:[new TextRun({text:"• HBsAg (Hepatitis B antigen)", size:18, color:MID_GREY, font:"Calibri"})]}),
new Paragraph({children:[new TextRun({text:"• Anti-HCV (Hepatitis C antibody)", size:18, color:MID_GREY, font:"Calibri"})]}),
new Paragraph({children:[new TextRun({text:"• Anti-TPO antibodies (thyroid)", size:18, color:MID_GREY, font:"Calibri"})]}),
]}),
new TableCell({ width: {size:25, type:WidthType.PERCENTAGE}, shading:{fill:WHITE, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[new Paragraph({children:[new TextRun({text:"Rule out hepatitis, check liver, assess thyroid cause", size:17, color:"888888", font:"Calibri", italics:true})]})] }),
]}),
new TableRow({ children: [
new TableCell({ width: {size:20, type:WidthType.PERCENTAGE}, shading:{fill:GREY_BG, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[new Paragraph({children:[new TextRun({text:"4-6 weeks", bold:true, size:18, color:TEAL, font:"Calibri"})]})] }),
new TableCell({ width: {size:55, type:WidthType.PERCENTAGE}, shading:{fill:GREY_BG, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[
new Paragraph({children:[new TextRun({text:"• Repeat Serum Potassium (electrolytes)", size:18, color:MID_GREY, font:"Calibri"})]}),
]}),
new TableCell({ width: {size:25, type:WidthType.PERCENTAGE}, shading:{fill:GREY_BG, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[new Paragraph({children:[new TextRun({text:"Monitor potassium after diet changes", size:17, color:"888888", font:"Calibri", italics:true})]})] }),
]}),
new TableRow({ children: [
new TableCell({ width: {size:20, type:WidthType.PERCENTAGE}, shading:{fill:WHITE, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[new Paragraph({children:[new TextRun({text:"3 months", bold:true, size:18, color:TEAL, font:"Calibri"})]})] }),
new TableCell({ width: {size:55, type:WidthType.PERCENTAGE}, shading:{fill:WHITE, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[
new Paragraph({children:[new TextRun({text:"• TSH + Free T4 (thyroid recheck)", size:18, color:MID_GREY, font:"Calibri"})]}),
new Paragraph({children:[new TextRun({text:"• Lipid profile (triglycerides + HDL recheck)", size:18, color:MID_GREY, font:"Calibri"})]}),
new Paragraph({children:[new TextRun({text:"• LFT (liver enzymes ALT, AST recheck)", size:18, color:MID_GREY, font:"Calibri"})]}),
new Paragraph({children:[new TextRun({text:"• Blood pressure + waist circumference measurement", size:18, color:MID_GREY, font:"Calibri"})]}),
]}),
new TableCell({ width: {size:25, type:WidthType.PERCENTAGE}, shading:{fill:WHITE, type:ShadingType.SOLID}, margins:{top:60,bottom:60,left:120,right:60}, children:[new Paragraph({children:[new TextRun({text:"Confirm diagnoses, assess lifestyle response", size:17, color:"888888", font:"Calibri", italics:true})]})] }),
]}),
]
}),
spacer(1),
// ── Good news section ─────────────────────────────────────────────────
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE },
},
rows: [new TableRow({ children: [
new TableCell({
shading: { fill: "F0FAF0", type: ShadingType.SOLID },
margins: { top: 140, bottom: 140, left: 200, right: 200 },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 16, color: "2E7D32" },
right: { style: BorderStyle.NONE },
},
children: [
new Paragraph({ children: [new TextRun({ text: "What Is Normal & Reassuring", bold: true, size: 20, color: "2E7D32", font: "Calibri" })]}),
new Paragraph({ spacing: { before: 80 }, children: [new TextRun({ text: "Your blood sugar (HbA1c 5.1%) and fasting glucose (75.4 mg/dL) are completely normal - no diabetes.", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "Your kidneys are functioning excellently (eGFR = 115 mL/min - well above normal).", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "Your total and LDL cholesterol are normal. Your haemoglobin and CBC are healthy.", size: 18, color: MID_GREY, font: "Calibri" })]}),
new Paragraph({ spacing: { before: 40 }, children: [new TextRun({ text: "The problems identified are early, mild, and largely reversible with lifestyle changes. You are only 36 - this is a great time to take action.", size: 18, color: "2E7D32", font: "Calibri", bold: true })]}),
]
})
]})]
}),
spacer(0.5),
// Disclaimer
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 200 },
children: [
new TextRun({ text: "This clinical summary is based on your Pathkind Labs report dated 08/07/2026. It is for informational purposes only and does not replace a consultation with your physician. Please share this document with your doctor before making any changes to your medication or lifestyle.", size: 16, color: "999999", italics: true, font: "Calibri" })
]
}),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/dina-clinical-summary/Clinical_Summary_Dina_Krusna_Dhal.docx', buffer);
console.log("Document created successfully.");
});
cd /home/daytona/workspace/dina-clinical-summary && node create_summary.js 2>&1
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/works…
python3 -c " from pypdf import PdfReader # Just verify the docx is a valid zip (…
Clinical Summary Dina Krusna Dhal
Word Document · DOCX
Life style and treatment Management
"subclinical hypothyroidism"[MeSH Terms] AND "levothyroxine"[MeSH Terms] AND treatment
"nonalcoholic fatty liver disease"[MeSH Terms] AND "lifestyle intervention"[MeSH Terms]
"subclinical hypothyroidism" AND treatment AND levothyroxine
"metabolic syndrome" AND "lifestyle intervention" AND exercise AND diet
~/dina-clinical-summary/create_lifestyle_plan.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, BorderStyle, WidthType, ShadingType,
VerticalAlign, Header, Footer, PageBreak
} = require('docx');
const fs = require('fs');
// ── Palette ──────────────────────────────────────────────────────────────────
const TEAL = "1B7A8A";
const TEAL_LIGHT = "E8F4F6";
const TEAL_MID = "C5E4EA";
const ORANGE = "D94F1E";
const ORANGE_LIGHT= "FEF0EC";
const GREEN = "2E7D32";
const GREEN_LIGHT = "EDF7EE";
const AMBER = "B45309";
const AMBER_LIGHT = "FFFBF0";
const PURPLE = "5B2D8E";
const PURPLE_LIGHT= "F3EEF9";
const GREY_BG = "F7F7F7";
const WHITE = "FFFFFF";
const DARK = "1A1A2E";
const MID_GREY = "4A4A4A";
const LIGHT_GREY = "888888";
const BORDER_CLR = "DDDDDD";
const HEADER_BG = "1B7A8A";
// ── Helpers ──────────────────────────────────────────────────────────────────
function sp(n = 1) {
return new Paragraph({ spacing: { after: n * 80 }, children: [new TextRun({ text: "" })] });
}
function HR(color = TEAL) {
return new Paragraph({
spacing: { before: 60, after: 60 },
border: { bottom: { style: BorderStyle.SINGLE, size: 4, color } },
children: [new TextRun({ text: "" })]
});
}
function sectionTitle(text, color = TEAL, icon = "") {
return new Paragraph({
spacing: { before: 340, after: 100 },
children: [
new TextRun({ text: (icon ? icon + " " : "") + text.toUpperCase(), bold: true, size: 24, color, font: "Calibri" })
],
border: { bottom: { style: BorderStyle.THICK, size: 6, color } }
});
}
function diagnosisTitle(num, text, color = ORANGE) {
return new Paragraph({
spacing: { before: 220, after: 60 },
children: [
new TextRun({ text: `${num}. ${text}`, bold: true, size: 22, color, font: "Calibri" })
]
});
}
function h3(text, color = DARK) {
return new Paragraph({
spacing: { before: 180, after: 60 },
children: [new TextRun({ text, bold: true, size: 20, color, font: "Calibri" })]
});
}
function para(text, opts = {}) {
return new Paragraph({
spacing: { before: 30, after: 50 },
indent: opts.indent ? { left: 360 } : undefined,
alignment: opts.center ? AlignmentType.CENTER : undefined,
children: [new TextRun({
text, size: 18, color: opts.color || MID_GREY, font: "Calibri",
bold: opts.bold || false, italics: opts.italic || false
})]
});
}
function bullet(text, color = MID_GREY, bold = false) {
return new Paragraph({
spacing: { before: 35, after: 35 },
indent: { left: 400, hanging: 220 },
children: [
new TextRun({ text: "\u2022 " + text, size: 18, color, font: "Calibri", bold })
]
});
}
function subBullet(text) {
return new Paragraph({
spacing: { before: 20, after: 20 },
indent: { left: 720, hanging: 220 },
children: [
new TextRun({ text: "\u25E6 " + text, size: 17, color: LIGHT_GREY, font: "Calibri" })
]
});
}
// Banner box (coloured left-border card)
function card(titleText, bodyItems, bgColor, borderColor, titleColor) {
const children = [
new Paragraph({
spacing: { before: 0, after: 80 },
children: [new TextRun({ text: titleText, bold: true, size: 20, color: titleColor, font: "Calibri" })]
}),
...bodyItems
];
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 14, color: borderColor },
right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE }
},
rows: [new TableRow({ children: [new TableCell({
shading: { fill: bgColor, type: ShadingType.SOLID },
margins: { top: 120, bottom: 120, left: 200, right: 200 },
children
})]})]
});
}
function thCell(text, widthPct) {
return new TableCell({
width: { size: widthPct, type: WidthType.PERCENTAGE },
shading: { fill: HEADER_BG, type: ShadingType.SOLID },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 80, bottom: 80, left: 120, right: 80 },
children: [new Paragraph({ children: [new TextRun({ text, bold: true, color: WHITE, size: 18, font: "Calibri" })] })]
});
}
function tdCell(text, widthPct, bg = WHITE, bold = false, color = MID_GREY) {
return new TableCell({
width: { size: widthPct, type: WidthType.PERCENTAGE },
shading: { fill: bg, type: ShadingType.SOLID },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 120, right: 80 },
children: [new Paragraph({ children: [new TextRun({ text, bold, color, size: 18, font: "Calibri" })] })]
});
}
function grid(rows, widths, headerRow) {
const tRows = [
new TableRow({ children: headerRow.map((h, i) => thCell(h, widths[i])) }),
...rows.map((row, ri) => new TableRow({
children: row.map((cell, ci) => {
const bg = ri % 2 === 0 ? WHITE : GREY_BG;
if (typeof cell === "string") return tdCell(cell, widths[ci], bg);
return tdCell(cell.text, widths[ci], bg, cell.bold || false, cell.color || MID_GREY);
})
}))
];
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.SINGLE, size: 1, color: BORDER_CLR },
insideV: { style: BorderStyle.NONE }
},
rows: tRows
});
}
// ══════════════════════════════════════════════════════════════════════════════
// DOCUMENT
// ══════════════════════════════════════════════════════════════════════════════
const doc = new Document({
creator: "Orris Clinical Assistant",
title: "Lifestyle & Treatment Management Plan",
sections: [{
properties: { page: { margin: { top: 720, bottom: 720, left: 900, right: 900 } } },
headers: {
default: new Header({ children: [
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE },
bottom: { style: BorderStyle.THICK, size: 6, color: TEAL },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE }
},
rows: [new TableRow({ children: [
new TableCell({
width: { size: 65, type: WidthType.PERCENTAGE },
borders: { top:{style:BorderStyle.NONE}, bottom:{style:BorderStyle.NONE}, left:{style:BorderStyle.NONE}, right:{style:BorderStyle.NONE} },
children: [
new Paragraph({ children: [new TextRun({ text: "LIFESTYLE & TREATMENT MANAGEMENT PLAN", bold: true, size: 26, color: TEAL, font: "Calibri" })] }),
new Paragraph({ spacing:{before:20}, children: [new TextRun({ text: "Mr. Dina Krusna Dhal | 36 Yrs, Male | Lab Report: 08 July 2026", size: 17, color: LIGHT_GREY, font: "Calibri", italics: true })] })
]
}),
new TableCell({
width: { size: 35, type: WidthType.PERCENTAGE },
borders: { top:{style:BorderStyle.NONE}, bottom:{style:BorderStyle.NONE}, left:{style:BorderStyle.NONE}, right:{style:BorderStyle.NONE} },
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({
alignment: AlignmentType.RIGHT,
children: [new TextRun({ text: "Prepared: 11 July 2026", size: 17, color: LIGHT_GREY, font: "Calibri" })]
})]
})
]})]
}),
sp(0.3)
]})
},
footers: {
default: new Footer({ children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 2, color: BORDER_CLR } },
spacing: { before: 60 },
children: [new TextRun({
text: "For informational purposes only. All management decisions require physician supervision. | Pathkind Labs Report: 2000C245260708002385",
size: 15, color: "AAAAAA", italics: true, font: "Calibri"
})]
})
]})
},
children: [
sp(0.5),
// ── OVERVIEW BANNER ─────────────────────────────────────────────────
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE }
},
rows: [new TableRow({ children: [new TableCell({
shading: { fill: TEAL_LIGHT, type: ShadingType.SOLID },
margins: { top: 160, bottom: 160, left: 200, right: 200 },
borders: {
top: { style: BorderStyle.SINGLE, size: 2, color: TEAL },
bottom: { style: BorderStyle.SINGLE, size: 2, color: TEAL },
left: { style: BorderStyle.THICK, size: 18, color: TEAL },
right: { style: BorderStyle.NONE }
},
children: [
new Paragraph({ children: [new TextRun({ text: "Your Report in Brief", bold: true, size: 22, color: TEAL, font: "Calibri" })] }),
new Paragraph({ spacing: { before: 60 }, children: [new TextRun({ text: "Four conditions were identified from your lab results. None are emergencies. All are at an early stage and respond well to the steps outlined in this plan. The most important action is to start lifestyle changes immediately — they address ALL four conditions at once.", size: 18, color: MID_GREY, font: "Calibri" })] }),
new Paragraph({ spacing: { before: 60 }, children: [
new TextRun({ text: "Conditions: ", bold: true, size: 18, color: DARK, font: "Calibri" }),
new TextRun({ text: "1. Subclinical Hypothyroidism | 2. Dyslipidemia (High TG + Low HDL) | 3. Probable Fatty Liver (NAFLD) | 4. Mild Low Potassium", size: 18, color: MID_GREY, font: "Calibri" })
]}),
]
})]})
]),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// CONDITION 1 — THYROID
// ══════════════════════════════════════════════════════════════════════
sectionTitle("Condition 1: Subclinical Hypothyroidism", TEAL),
sp(0.3),
new Paragraph({ spacing:{before:0,after:60}, children:[new TextRun({ text: "TSH = 4.67 µIU/mL (Normal: 0.27-4.20) | T3 = 1.62 (Normal) | T4 = 11.30 (Normal)", bold:true, size:18, color:ORANGE, font:"Calibri" })] }),
para("Your thyroid gland is being overworked — it is producing slightly more TSH to force the thyroid to work harder. Your actual thyroid hormones (T3 and T4) are still normal. This is an early warning. At 36 years old, action now prevents progression to overt hypothyroidism.", { color: MID_GREY }),
sp(0.5),
h3("A. What To Expect & Watch For", TEAL),
bullet("Possible symptoms even at this early stage: unexplained fatigue, difficulty losing weight, feeling cold easily, constipation, brain fog, dry skin, low mood"),
bullet("Subclinical hypothyroidism is associated with elevated cardiovascular risk, especially when combined with your dyslipidemia"),
bullet("In ~40% of people, TSH normalises on its own within 1 year; in ~40%, it stays the same; in ~20%, it progresses to overt hypothyroidism"),
sp(0.5),
h3("B. Immediate Actions (No Medication Needed Yet)", GREEN),
bullet("Do NOT take iodine supplements or seaweed tablets — excess iodine can worsen hypothyroidism"),
bullet("Avoid raw cruciferous vegetables in large quantities on an empty stomach (cabbage, cauliflower, broccoli, kale) — cooking neutralises the goitrogenic effect"),
bullet("Take any future thyroid medication on an empty stomach (30-60 minutes before breakfast) — food, coffee, calcium, and iron supplements reduce absorption"),
bullet("Manage stress: chronic cortisol elevation suppresses thyroid function further"),
bullet("Get adequate sleep: thyroid hormone secretion peaks at night during deep sleep"),
sp(0.5),
h3("C. Treatment Decision (Based on Repeat TSH in 3 Months)", ORANGE),
sp(0.2),
card(
"When Levothyroxine (LT4) Should Be Started",
[
bullet("TSH remains >10 µIU/mL on recheck — treatment is clearly recommended", ORANGE, true),
bullet("TSH is 4.2-10 AND you have symptoms (fatigue, weight gain, cold intolerance, depression)", ORANGE),
bullet("TSH is 4.2-10 AND Anti-TPO antibodies are positive (Hashimoto's thyroiditis)"),
bullet("TSH is 4.2-10 AND you are planning pregnancy"),
para("If asymptomatic and Anti-TPO negative: recheck TSH every 6-12 months and monitor only", { italic: true })
],
ORANGE_LIGHT, ORANGE, ORANGE
),
sp(0.5),
h3("D. If Levothyroxine Is Prescribed", DARK),
bullet("Standard starting dose for a healthy 36-year-old: 25-50 mcg once daily"),
bullet("Take on an empty stomach — 30-60 minutes before breakfast, OR at bedtime (2 hours after last meal)"),
bullet("Average adult dose is 1.7 mcg/kg/day (approximately 85-100 mcg/day for a 50 kg person); dose is adjusted slowly"),
bullet("Steady-state levels take 6-8 weeks — do not change dose before this period"),
bullet("Avoid taking within 4 hours of: calcium tablets, iron supplements, antacids, or high-bran meals"),
bullet("Signs of too much thyroid hormone (overtreatment): palpitations, heat intolerance, weight loss, tremor, insomnia — report immediately"),
bullet("Monitor: TSH + Free T4 every 6-8 weeks after dose change, then every 6-12 months once stable"),
para("Goal TSH: 0.5 - 2.5 µIU/mL", { bold: true, color: TEAL }),
sp(0.3),
grid(
[
["Repeat TSH + Free T4", "3 months from now", "Confirm whether to treat"],
["Anti-TPO antibodies", "Within 2 weeks", "Identify Hashimoto's thyroiditis"],
["TSH recheck if on LT4", "6-8 weeks after starting", "Dose adequacy check"],
["Annual TSH once stable", "Every 12 months", "Long-term monitoring"],
],
[45, 25, 30],
["Test / Action", "When", "Purpose"]
),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// CONDITION 2 — DYSLIPIDEMIA
// ══════════════════════════════════════════════════════════════════════
sectionTitle("Condition 2: Dyslipidemia (High Triglycerides + Low HDL)", PURPLE),
sp(0.3),
new Paragraph({ spacing:{before:0,after:60}, children:[new TextRun({ text: "Triglycerides = 178 mg/dL (Borderline High, target <150) | HDL = 34.2 mg/dL (Low, target >40)", bold:true, size:18, color:ORANGE, font:"Calibri" })] }),
para("Your 'bad' cholesterol (LDL) and total cholesterol are normal. The abnormality is a combination of high triglycerides and low HDL — this is called atherogenic dyslipidemia and is driven by excess dietary carbohydrates, physical inactivity, and possibly subclinical insulin resistance. It increases heart disease risk."),
sp(0.5),
h3("A. Lifestyle Treatment — First-Line (Try for 3-6 Months Before Medication)", GREEN),
sp(0.2),
// Diet card
card(
"DIET — Most Important Driver of Triglycerides",
[
bullet("Dramatically reduce refined carbohydrates: white rice, maida (white flour), bread, biscuits, pastries, sugary drinks, fruit juices, alcohol", DARK, true),
bullet("Switch to: millets (ragi, bajra, jowar), oats, brown rice, whole wheat — these raise HDL and lower TG"),
bullet("Eat 2-3 servings of fatty fish per week: mackerel (bangda), sardines (pedvey), tuna, salmon — omega-3 fats directly lower triglycerides"),
bullet("Include nuts (walnuts, almonds) daily — 1 small handful; rich in healthy fats that raise HDL"),
bullet("Use olive oil or mustard oil for cooking; minimise palm oil and vanaspati (hydrogenated fats)"),
bullet("Eat more soluble fibre: oats, psyllium husk (isabgol), beans, lentils — lowers triglycerides and raises HDL"),
bullet("Reduce overall portion sizes of starch at each meal; fill half the plate with vegetables"),
bullet("AVOID completely: packaged juices, cold drinks, energy drinks — fructose is the most potent driver of hypertriglyceridaemia"),
],
GREEN_LIGHT, GREEN, GREEN
),
sp(0.5),
// Exercise card
card(
"EXERCISE — Single Best Tool to Raise HDL",
[
bullet("Target: 150 minutes of moderate-intensity aerobic exercise per week minimum (ideally 300 minutes)", DARK, true),
bullet("Moderate intensity = brisk walk (cannot sing, can speak in sentences), cycling, swimming, jogging"),
bullet("Even 30 minutes of brisk walking daily raises HDL by 3-5 mg/dL and lowers triglycerides by 20-30%"),
bullet("Add resistance training (weights, bodyweight squats, push-ups) 2 days per week — improves insulin sensitivity which lowers TG"),
bullet("Break prolonged sitting: stand up and walk for 5 minutes every 1 hour — reduces post-meal triglyceride spikes"),
bullet("Exercise effect on HDL is cumulative — consistent moderate exercise over months yields the greatest benefit"),
],
TEAL_LIGHT, TEAL, TEAL
),
sp(0.5),
h3("B. What to Strictly Avoid", ORANGE),
bullet("Alcohol: even moderate alcohol directly raises triglycerides — reduce to zero if possible, or strict <1 drink/week"),
bullet("Sugary beverages: soft drinks, packaged fruit juices, sweetened lassi, energy drinks"),
bullet("Trans fats: vanaspati, dalda, margarine, most bakery items — these lower HDL"),
bullet("High-carbohydrate night meals: eating large amounts of carbs at night spikes overnight triglycerides"),
bullet("Smoking: lowers HDL directly; avoid entirely"),
bullet("Beta-blockers (except carvedilol): lower HDL — inform your doctor if prescribed these for any other reason"),
sp(0.5),
h3("C. Pharmacologic Treatment — When It Is Needed", AMBER),
para("At current levels (TG 178 mg/dL), no medication is needed. Medications are considered if:", { italic: true }),
bullet("Triglycerides remain >200 mg/dL after 3-6 months of lifestyle change: consider fibrate (fenofibrate) or prescription omega-3"),
bullet("Triglycerides exceed 500 mg/dL: immediate treatment required (severe pancreatitis risk)"),
bullet("There is no proven drug for raising HDL — managing the underlying cause (TG, weight, inactivity) is the only strategy"),
sp(0.2),
grid(
[
[{ text: "Fenofibrate 145 mg/day", bold: true }, "TG >200 after lifestyle (3-6 months)", "Lowers TG 30-50%, modestly raises HDL", "Liver, renal monitoring required"],
[{ text: "Omega-3 (Rx) 4g/day", bold: true }, "TG >500 or cardiovascular disease", "Lowers TG 30-40%", "Generally well tolerated"],
[{ text: "Statin", bold: true }, "NOT needed now (LDL is normal)", "For elevated LDL primarily", "Not first-line for TG"],
],
[25, 25, 30, 20],
["Drug", "Indication", "Effect", "Notes"]
),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// CONDITION 3 — NAFLD
// ══════════════════════════════════════════════════════════════════════
sectionTitle("Condition 3: Probable Fatty Liver (NAFLD/MASLD)", AMBER),
sp(0.3),
new Paragraph({ spacing:{before:0,after:60}, children:[new TextRun({ text: "ALT = 57.3 U/L | AST = 44.1 U/L | AST/ALT ratio 0.77 (< 1) | GGT = 18 (Normal) | Bilirubin Total = 1.37 (mildly elevated)", bold:true, size:18, color:ORANGE, font:"Calibri" })] }),
para("Mildly elevated liver enzymes with ALT higher than AST and normal GGT is the classic pattern of non-alcoholic fatty liver disease (NAFLD) — now also called MASLD. In the context of your high triglycerides and low HDL, this is likely fat accumulation in the liver cells caused by metabolic dysfunction, not alcohol or infection. The good news: this stage is fully reversible."),
sp(0.5),
h3("A. Lifestyle Treatment — Most Effective Intervention Known", GREEN),
card(
"Weight Loss — The Single Most Effective Treatment for NAFLD",
[
bullet("Even 5% body weight loss significantly reduces liver fat and improves liver enzymes", DARK, true),
bullet("7-10% body weight loss can normalize ALT and reduce liver inflammation"),
bullet(">10% weight loss can reverse early liver fibrosis (scarring)"),
bullet("This does NOT require crash dieting — a sustainable 500 kcal/day deficit is enough"),
bullet("Target: lose 0.5 to 1 kg per week — rapid weight loss (>1.5 kg/week) can actually worsen fatty liver"),
],
GREEN_LIGHT, GREEN, GREEN
),
sp(0.5),
h3("Diet Specifics for Liver Health", AMBER),
bullet("Follow a Mediterranean-style diet: olive oil, fish, vegetables, legumes, whole grains, limited red meat"),
bullet("Completely avoid alcohol — even small amounts worsen liver inflammation when fat is already present"),
bullet("Eliminate fructose: avoid high-fructose corn syrup (in soft drinks, packaged sweets) — fructose is directly processed by the liver into fat"),
bullet("Increase coffee intake (plain black or with minimal milk, no sugar) — evidence shows 2-3 cups/day reduces liver enzyme levels"),
bullet("Add turmeric to cooking — curcumin has modest hepatoprotective effects in NAFLD"),
bullet("Stay well hydrated: 2-3 litres of water daily supports liver detoxification"),
sp(0.4),
h3("Exercise for Liver", AMBER),
bullet("150-300 minutes of aerobic exercise per week directly reduces liver fat — independent of weight loss"),
bullet("Resistance training (gym, yoga, bodyweight exercises) improves insulin sensitivity and reduces hepatic fat"),
bullet("Even walking 10,000 steps/day has been shown to improve liver enzymes in NAFLD studies"),
sp(0.5),
h3("B. Investigations First (Rule Out Other Causes)", TEAL),
bullet("Abdominal ultrasound: gold standard screening test for fatty liver — confirms diagnosis"),
bullet("HBsAg (Hepatitis B) and Anti-HCV (Hepatitis C): must be checked to exclude viral hepatitis as cause"),
bullet("If ALT remains >3× upper limit of normal (>123 U/L) after lifestyle: liver biopsy or FibroScan may be needed"),
bullet("Repeat LFT in 3 months after lifestyle changes — expect normalisation with 7-10% weight loss"),
sp(0.5),
h3("C. No Specific Medication Is Approved for Early NAFLD", DARK),
para("As of 2026, there is no approved pharmacological therapy for early-stage NAFLD. Treatment is entirely lifestyle-based. Medications like Vitamin E or pioglitazone are occasionally used in selected patients with biopsy-proven NASH — but these are NOT appropriate at your current stage."),
para("If Hepatitis B or C is found positive: specific antiviral treatment will be required.", { bold: true, color: ORANGE }),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// CONDITION 4 — HYPOKALEMIA
// ══════════════════════════════════════════════════════════════════════
sectionTitle("Condition 4: Mild Low Potassium (Hypokalemia)", TEAL),
sp(0.3),
new Paragraph({ spacing:{before:0,after:60}, children:[new TextRun({ text: "Potassium = 3.27 mmol/L (Normal: 3.50-5.10) | Kidneys Normal (eGFR 115, Creatinine 0.86)", bold:true, size:18, color:AMBER, font:"Calibri" })] }),
para("Your potassium is mildly low. Since your kidneys are functioning perfectly, this is most likely due to inadequate dietary potassium intake. Mild hypokalemia can cause fatigue, muscle cramps, constipation, or palpitations. Moderate to severe hypokalemia can cause muscle weakness and irregular heart rhythm."),
sp(0.5),
h3("A. Potassium-Rich Foods to Eat Daily", GREEN),
sp(0.2),
grid(
[
["Banana (1 medium)", "~422 mg", "Easily available, portable snack"],
["Coconut water (200 mL)", "~600 mg", "Ideal morning drink"],
["Dal/lentils (1 cup cooked)", "~731 mg", "Toor, moong, masoor dal"],
["Potato (1 medium, boiled)", "~926 mg", "Skin included — don't peel"],
["Spinach / palak (1 cup cooked)", "~839 mg", "Any leafy greens"],
["Orange / sweet lime", "~237 mg", "Excellent for daily use"],
["Beans / rajma / chana (1 cup)", "~600-900 mg", "Also great for fibre"],
["Curd / dahi (1 cup)", "~380 mg", "Also provides probiotics"],
["Avocado (half)", "~487 mg", "Rich in healthy fats too"],
["Tomato (1 cup)", "~427 mg", "Raw or cooked"],
],
[35, 20, 45],
["Food", "Potassium Content", "Notes"]
),
sp(0.3),
bullet("Daily potassium requirement: 3,500-4,700 mg/day — achievable through diet alone"),
bullet("Add a banana + coconut water to your daily routine — a simple and effective fix"),
bullet("Avoid excess processed and salty foods — high sodium increases potassium losses in urine"),
sp(0.5),
h3("B. If Symptoms Are Present", ORANGE),
bullet("If you have muscle cramps, weakness, palpitations, or constipation: inform your doctor"),
bullet("Oral potassium supplementation (potassium chloride 20-40 mEq/day) may be prescribed if diet alone is insufficient"),
bullet("Repeat potassium level in 4-6 weeks — if still low, further investigation (e.g. urine potassium) may be needed"),
bullet("Do NOT self-medicate with potassium supplements — excess potassium is dangerous to the heart"),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// MASTER LIFESTYLE PLAN
// ══════════════════════════════════════════════════════════════════════
sectionTitle("Your Daily Lifestyle Blueprint", GREEN),
sp(0.3),
para("The following daily routine addresses ALL four conditions simultaneously. Small, consistent actions compound over months into major health improvements.", { bold: true }),
sp(0.5),
grid(
[
[{ text: "Morning", bold: true, color: TEAL }, "Wake up, drink 1-2 glasses of warm water with lemon"],
[{ text: "", bold: false }, "200 mL coconut water OR 1 banana (potassium + energy)"],
[{ text: "", bold: false }, "Take thyroid medication if prescribed (empty stomach, 30 min before breakfast)"],
[{ text: "Breakfast", bold: true, color: TEAL }, "Oats porridge / poha (no excess oil) / idli with sambar / whole wheat upma"],
[{ text: "", bold: false }, "Avoid: paratha with excess butter, puri, white bread with jam"],
[{ text: "Mid-Morning", bold: true, color: TEAL }, "10-15 almonds or walnuts + 1 fruit (not mango/grapes in excess — high sugar)"],
[{ text: "Lunch", bold: true, color: TEAL }, "Half plate: vegetables (sabzi). Quarter plate: dal/lentils. Quarter plate: brown rice / 1-2 rotis"],
[{ text: "", bold: false }, "Add 1 tablespoon of flaxseeds or chia seeds to meal for omega-3"],
[{ text: "Exercise (5-6 days/week)", bold: true, color: GREEN }, "30-45 minutes brisk walk / cycling / swimming"],
[{ text: "", bold: false }, "Add 15-20 min bodyweight strength training (squats, push-ups, planks) 3x/week"],
[{ text: "Evening Snack", bold: true, color: TEAL }, "1 cup green tea (no sugar) + roasted chana / makhana — avoids biscuits and fried snacks"],
[{ text: "Dinner", bold: true, color: TEAL }, "Light meal: vegetable soup / khichdi / salad + 1-2 rotis + small portion of fish/chicken/egg"],
[{ text: "", bold: false }, "Eat dinner by 8:00 PM — late-night eating increases triglycerides"],
[{ text: "Before Bed", bold: true, color: TEAL }, "1 cup warm milk (no sugar) OR plain water. No screen time 30 min before bed. Target 7-8 hours sleep."],
],
[20, 80],
["Time / Phase", "Action"]
),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// FULL FOLLOW-UP SCHEDULE
// ══════════════════════════════════════════════════════════════════════
sectionTitle("Complete Follow-Up Schedule", TEAL),
sp(0.3),
grid(
[
[{ text: "Within 2 weeks", bold: true, color: TEAL }, "Abdominal Ultrasound (USG abdomen)\nHBsAg (Hepatitis B surface antigen)\nAnti-HCV (Hepatitis C antibody)\nAnti-TPO antibodies (thyroid)"],
[{ text: "4-6 weeks", bold: true, color: TEAL }, "Repeat Serum Potassium + Electrolytes\nClinical review of symptoms (fatigue, cramps, weight change)"],
[{ text: "3 months", bold: true, color: TEAL }, "TSH + Free T4 (thyroid recheck)\nLipid Profile (TG + HDL response to lifestyle)\nLFT (ALT, AST — liver enzyme response)\nFasting blood glucose\nBlood pressure + waist circumference measurement"],
[{ text: "6 months", bold: true, color: TEAL }, "If on Levothyroxine: TSH recheck 6-8 weeks after starting, then at 6 months\nFull metabolic panel\nClinical reassessment of all conditions"],
[{ text: "12 months", bold: true, color: TEAL }, "Full annual health review: CBC, LFT, KFT, Lipids, Thyroid, HbA1c, Fasting glucose\nContinue monitoring all conditions annually"],
],
[20, 80],
["When", "Tests / Actions Required"]
),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// URGENT WARNING SIGNS
// ══════════════════════════════════════════════════════════════════════
card(
"IMPORTANT: See a Doctor Immediately If You Experience:",
[
bullet("Severe muscle weakness or difficulty walking"),
bullet("Palpitations (fast or irregular heartbeat)"),
bullet("Yellowing of skin or eyes (jaundice)"),
bullet("Severe abdominal pain (upper right side — may indicate liver or gallbladder issue)"),
bullet("Extreme fatigue that is new or rapidly worsening"),
bullet("Chest pain or breathlessness"),
para("These may indicate worsening of an underlying condition and require urgent evaluation.", { italic: true, color: ORANGE }),
],
ORANGE_LIGHT, ORANGE, ORANGE
),
sp(1),
// ══════════════════════════════════════════════════════════════════════
// POSITIVE SUMMARY
// ══════════════════════════════════════════════════════════════════════
card(
"Why You Have Every Reason to Be Optimistic",
[
bullet("You are 36 years old — these conditions were caught early, before any organ damage has occurred"),
bullet("Your blood sugar (HbA1c 5.1%) and kidney function (eGFR 115) are completely normal — no diabetes, no kidney disease"),
bullet("Your haemoglobin, CBC, and total cholesterol are healthy"),
bullet("All four conditions identified are reversible — lifestyle changes alone can normalise your liver enzymes, triglycerides, potassium, and possibly stabilise your thyroid"),
bullet("The same lifestyle changes (diet, exercise, weight management) treat ALL conditions simultaneously", DARK, true),
bullet("Many people with these findings achieve normal lab values within 3-6 months of consistent effort"),
para("Small steps, taken consistently every day, produce lasting results. You do not need perfection — you need persistence.", { italic: true, bold: true, color: GREEN }),
],
GREEN_LIGHT, GREEN, GREEN
),
sp(0.5),
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 160 },
children: [new TextRun({
text: "This plan was generated based on Pathkind Labs report dated 08/07/2026 (ID: 2000C245260708002385). It does not replace a clinical consultation. All treatment decisions including whether to start Levothyroxine must be made by your physician after examination and review of your complete medical history.",
size: 15, color: "AAAAAA", italics: true, font: "Calibri"
})]
})
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/dina-clinical-summary/Lifestyle_Treatment_Plan_Dina_Krusna_Dhal.docx', buffer);
console.log("SUCCESS: Document written.");
});
cd /home/daytona/workspace/dina-clinical-summary && node create_lifestyle_plan.j…
~/dina-clinical-summary/create_lifestyle_plan.js
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/dina-clinical-summary/create_lifestyle_plan.js'
cd /home/daytona/workspace/dina-clinical-summary && node create_lifestyle_plan.j…
node --check /home/daytona/workspace/dina-clinical-summary/create_lifestyle_plan…
python3 -c " content = open('/home/daytona/workspace/dina-clinical-summary/creat…
cd /home/daytona/workspace/dina-clinical-summary && node create_lifestyle_plan.j…
python3 -c " lines = open('/home/daytona/workspace/dina-clinical-summary/create_…
python3 << 'PYEOF' from docx import Document from docx.shared import Pt, RGBColo…
# Fix the JS file using Python to strip problematic chars, then run node python3…
Can you make the management plan and write down how to get better with lifestyle
ls /home/daytona/workspace/dina-clinical-summary/
~/dina-clinical-summary/build_plan.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, BorderStyle, WidthType, ShadingType, VerticalAlign, Header, Footer
} = require('docx');
const fs = require('fs');
const C = {
teal: "1B7A8A", tealLt: "E8F4F6", tealMid: "C5E4EA",
orange: "D94F1E", orangeLt: "FEF0EC",
green: "2E7D32", greenLt: "EDF7EE",
amber: "B45309", amberLt: "FFFBF0",
purple: "5B2D8E", purpleLt: "F3EEF9",
dark: "1A1A2E", mid: "4A4A4A", light: "888888",
white: "FFFFFF", grey: "F5F5F5", border: "DDDDDD"
};
function run(text, opts) {
opts = opts || {};
return new TextRun({
text: text,
bold: opts.bold || false,
italics: opts.italic || false,
size: opts.size || 19,
color: opts.color || C.mid,
font: "Calibri"
});
}
function sp(n) {
return new Paragraph({ spacing: { after: (n || 1) * 80 }, children: [run("")] });
}
function secTitle(text, color) {
color = color || C.teal;
return new Paragraph({
spacing: { before: 300, after: 100 },
border: { bottom: { style: BorderStyle.THICK, size: 8, color: color } },
children: [run(text.toUpperCase(), { bold: true, size: 23, color: color })]
});
}
function h3(text, color) {
color = color || C.dark;
return new Paragraph({
spacing: { before: 180, after: 60 },
children: [run(text, { bold: true, size: 20, color: color })]
});
}
function p(text, opts) {
opts = opts || {};
return new Paragraph({
spacing: { before: 30, after: 50 },
children: [run(text, opts)]
});
}
function bul(text, color, bold) {
return new Paragraph({
spacing: { before: 30, after: 30 },
indent: { left: 360, hanging: 200 },
children: [run("\u2022 " + text, { color: color || C.mid, bold: bold || false })]
});
}
function cardCell(title, lines, bg, border, titleColor) {
var paras = [
new Paragraph({
spacing: { before: 0, after: 80 },
children: [run(title, { bold: true, size: 20, color: titleColor || border })]
})
];
for (var i = 0; i < lines.length; i++) {
paras.push(new Paragraph({
spacing: { before: 20, after: 30 },
indent: { left: 200 },
children: [run("\u2022 " + lines[i], { size: 18 })]
}));
}
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
right: { style: BorderStyle.NONE },
left: { style: BorderStyle.THICK, size: 14, color: border },
insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE }
},
rows: [new TableRow({ children: [new TableCell({
shading: { fill: bg, type: ShadingType.SOLID },
margins: { top: 100, bottom: 100, left: 180, right: 180 },
children: paras
})]})]
});
}
function tbl(headers, rows, widths) {
widths = widths || [];
var hcells = headers.map(function(h, i) {
var w = widths[i] || Math.floor(100 / headers.length);
return new TableCell({
width: { size: w, type: WidthType.PERCENTAGE },
shading: { fill: C.teal, type: ShadingType.SOLID },
margins: { top: 80, bottom: 80, left: 120, right: 80 },
children: [new Paragraph({ children: [run(h, { bold: true, color: C.white, size: 18 })] })]
});
});
var dataRows = rows.map(function(row, ri) {
var bg = ri % 2 === 0 ? C.white : C.grey;
var cells = row.map(function(cell, ci) {
var w = widths[ci] || Math.floor(100 / headers.length);
var txt = typeof cell === "object" ? cell.text : cell;
var bold = typeof cell === "object" ? cell.bold : false;
var color = typeof cell === "object" ? cell.color : C.mid;
return new TableCell({
width: { size: w, type: WidthType.PERCENTAGE },
shading: { fill: bg, type: ShadingType.SOLID },
margins: { top: 60, bottom: 60, left: 120, right: 80 },
children: [new Paragraph({ children: [run(txt, { bold: bold, color: color || C.mid, size: 18 })] })]
});
});
return new TableRow({ children: cells });
});
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.SINGLE, size: 1, color: C.border },
insideV: { style: BorderStyle.NONE }
},
rows: [new TableRow({ children: hcells })].concat(dataRows)
});
}
// ─── DOCUMENT ────────────────────────────────────────────────────────────────
var doc = new Document({
creator: "Orris Clinical Assistant",
title: "Lifestyle and Treatment Management Plan",
sections: [{
properties: { page: { margin: { top: 720, bottom: 720, left: 900, right: 900 } } },
headers: {
default: new Header({ children: [
new Paragraph({
border: { bottom: { style: BorderStyle.THICK, size: 6, color: C.teal } },
spacing: { after: 60 },
children: [
run("LIFESTYLE & TREATMENT MANAGEMENT PLAN ", { bold: true, size: 25, color: C.teal }),
run("| Mr. Dina Krusna Dhal | 36 Yrs, Male | Report: 08 Jul 2026", { size: 17, color: C.light, italic: true })
]
})
]})
},
footers: {
default: new Footer({ children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 2, color: C.border } },
spacing: { before: 60 },
children: [run("For informational purposes only. All treatment decisions require physician supervision. | Lab ID: 2000C245260708002385", { size: 15, color: "AAAAAA", italic: true })]
})
]})
},
children: [
sp(0.5),
// ── OVERVIEW ─────────────────────────────────────────────────────────
cardCell(
"Your Report in Brief",
[
"Four conditions found: all early-stage and reversible. None are emergencies.",
"Conditions: (1) Subclinical Hypothyroidism (2) Dyslipidemia: High Triglycerides + Low HDL (3) Probable Fatty Liver (NAFLD) (4) Mild Low Potassium",
"The most powerful action: start lifestyle changes TODAY - they treat ALL four conditions simultaneously.",
"Your blood sugar, kidneys, haemoglobin, and LDL cholesterol are completely normal."
],
C.tealLt, C.teal, C.teal
),
sp(1),
// ════════════════════════════════════════════════════════════════════
// CONDITION 1 - THYROID
// ════════════════════════════════════════════════════════════════════
secTitle("Condition 1: Subclinical Hypothyroidism", C.teal),
p("TSH = 4.67 uIU/mL (Normal: 0.27-4.20) | T3 = 1.62 (Normal) | T4 = 11.30 (Normal)", { bold: true, color: C.orange }),
p("Your thyroid gland is working harder than it should (elevated TSH), but your thyroid hormone levels are still normal. This is an early warning stage. At age 36, acting now prevents progression to overt hypothyroidism."),
sp(0.5),
h3("A. Symptoms to Watch For", C.teal),
bul("Unexplained fatigue, difficulty losing weight, feeling cold easily, constipation, brain fog, dry skin, low mood"),
bul("In 40% of people TSH normalises on its own in 1 year; in 20% it progresses to overt hypothyroidism"),
bul("Combined with your dyslipidemia, this pattern increases long-term cardiovascular risk"),
sp(0.5),
h3("B. Lifestyle Actions - Start Immediately", C.green),
bul("Do NOT take iodine supplements or seaweed tablets - excess iodine can worsen hypothyroidism"),
bul("Avoid large quantities of raw cabbage, cauliflower, broccoli, kale on empty stomach - cooking neutralises their goitrogenic effect"),
bul("Manage stress actively: chronic cortisol elevation suppresses thyroid function"),
bul("Prioritise 7-8 hours of quality sleep - thyroid hormone secretion peaks during deep sleep"),
bul("Ensure adequate selenium in diet: Brazil nuts (1-2/day), eggs, sunflower seeds, fish - selenium is essential for thyroid enzyme function"),
bul("Ensure adequate zinc: pumpkin seeds, chickpeas, cashews, meat - zinc deficiency worsens hypothyroidism"),
sp(0.5),
h3("C. Treatment Decision - After Repeat TSH in 3 Months", C.orange),
cardCell(
"When Levothyroxine (LT4) Should Be Started",
[
"TSH remains above 10 uIU/mL on recheck - treatment is clearly recommended",
"TSH is 4.2-10 AND you have symptoms (fatigue, weight gain, cold intolerance, depression)",
"TSH is 4.2-10 AND Anti-TPO antibodies are positive (Hashimoto's thyroiditis confirmed)",
"TSH is 4.2-10 AND you are planning pregnancy (target TSH < 2.5 before conception)",
"If asymptomatic and Anti-TPO negative: monitor TSH annually - no medication needed yet"
],
C.orangeLt, C.orange, C.orange
),
sp(0.5),
h3("D. If Levothyroxine Is Prescribed by Your Doctor", C.dark),
bul("Starting dose for a healthy 36-year-old: 25-50 mcg once daily (average adult dose ~1.7 mcg/kg/day)"),
bul("Take on an empty stomach - 30-60 minutes before breakfast, OR at bedtime 2 hours after last meal"),
bul("Steady-state blood levels take 6-8 weeks - never adjust dose before this period"),
bul("Keep at least 4 hours between LT4 and: calcium tablets, iron supplements, antacids, high-bran meals"),
bul("Signs of too much thyroid hormone: palpitations, heat intolerance, weight loss, tremor, insomnia - report to doctor immediately"),
bul("Goal TSH: 0.5 - 2.5 uIU/mL. Monitor TSH + Free T4 every 6-8 weeks after dose change, then every 6-12 months once stable"),
sp(0.5),
tbl(
["Test / Action", "When", "Purpose"],
[
["Repeat TSH + Free T4", "3 months from now", "Confirm whether to start treatment"],
["Anti-TPO antibodies", "Within 2 weeks", "Identify Hashimoto's thyroiditis"],
["TSH recheck if on LT4", "6-8 weeks after starting", "Dose adequacy check"],
["Annual TSH once stable", "Every 12 months", "Long-term monitoring"]
],
[40, 25, 35]
),
sp(1),
// ════════════════════════════════════════════════════════════════════
// CONDITION 2 - DYSLIPIDEMIA
// ════════════════════════════════════════════════════════════════════
secTitle("Condition 2: Dyslipidemia - High Triglycerides + Low HDL", C.purple),
p("Triglycerides = 178 mg/dL (Borderline High, target < 150) | HDL = 34.2 mg/dL (Low, target > 40 for men)", { bold: true, color: C.orange }),
p("Your total cholesterol (157) and LDL (87.2) are completely normal. The problem is high triglycerides combined with low HDL - called atherogenic dyslipidemia. This is driven by excess refined carbohydrates, physical inactivity, and mild insulin resistance. It raises heart disease risk but responds very well to lifestyle changes."),
sp(0.5),
h3("A. Diet - The Most Powerful Tool Against High Triglycerides", C.green),
cardCell(
"Foods to ADD to Lower Triglycerides and Raise HDL",
[
"Fatty fish 2-3 times/week: mackerel (bangda), sardines (pedvey), rohu, hilsa, tuna - omega-3 fats directly lower triglycerides by 20-30%",
"Millets: ragi, bajra, jowar, oats - replace white rice and maida with these whole grains",
"Walnuts and almonds: 1 small handful daily - healthy fats that raise HDL cholesterol",
"Olive oil or mustard oil for cooking - use instead of palm oil or vanaspati",
"Soluble fibre daily: oats, isabgol (psyllium husk), beans, lentils, flaxseeds - all lower triglycerides",
"Vegetables: fill half your plate at every meal - 5+ servings per day",
"2-3 cups of plain black or minimally sweetened coffee daily - reduces liver fat and enzyme levels"
],
C.greenLt, C.green, C.green
),
sp(0.5),
cardCell(
"Foods to REDUCE or ELIMINATE",
[
"White rice, maida (white flour), bread, biscuits, pastries, naan - these are the #1 dietary cause of high triglycerides",
"ALL packaged juices, cold drinks, energy drinks, sodas - fructose is the most potent dietary driver of hypertriglyceridaemia",
"Alcohol: even moderate amounts directly raise triglycerides - aim for zero or less than 1 drink per week",
"Vanaspati, dalda, margarine, most bakery products - trans fats lower HDL cholesterol",
"Large carbohydrate portions at night: eating heavy starch after 8 PM spikes overnight triglycerides",
"Fried snacks: samosa, bhujia, chips, fried puri - high in unhealthy fats"
],
C.orangeLt, C.orange, C.orange
),
sp(0.5),
h3("B. Exercise - Single Best Tool to Raise HDL Cholesterol", C.teal),
bul("Target: minimum 150 minutes of moderate aerobic exercise per week (ideally 300 minutes)"),
bul("Moderate intensity = brisk walk where you can speak but cannot sing comfortably"),
bul("30 minutes of brisk walking daily raises HDL by 3-5 mg/dL and lowers triglycerides by 20-30% within weeks"),
bul("Add resistance training 2-3 times per week: squats, push-ups, planks, weights or bodyweight exercises"),
bul("Resistance training improves insulin sensitivity - the root cause of your dyslipidemia pattern"),
bul("Break prolonged sitting: walk for 5 minutes every hour - reduces post-meal triglyceride spikes"),
sp(0.5),
h3("C. Medication - Not Needed Now, Threshold for Future", C.amber),
bul("At TG 178 mg/dL: lifestyle change is the ONLY recommended treatment for the next 3-6 months"),
bul("If TG remains above 200 mg/dL after lifestyle: fenofibrate 145 mg/day OR prescription omega-3 (4 g/day)"),
bul("If TG exceeds 500 mg/dL: immediate drug treatment required (risk of acute pancreatitis)"),
bul("No proven drug raises HDL - treating the root cause (high TG, weight, inactivity) is the only effective strategy"),
bul("Statin is NOT indicated (your LDL = 87.2 mg/dL is normal)"),
sp(1),
// ════════════════════════════════════════════════════════════════════
// CONDITION 3 - NAFLD
// ════════════════════════════════════════════════════════════════════
secTitle("Condition 3: Probable Fatty Liver (NAFLD/MASLD)", C.amber),
p("ALT = 57.3 U/L (High) | AST = 44.1 U/L (High) | AST/ALT ratio = 0.77 (less than 1) | GGT = 18 U/L (Normal) | Bilirubin Total = 1.37 (mildly elevated)", { bold: true, color: C.orange }),
p("Mildly elevated liver enzymes where ALT is higher than AST, with completely normal GGT = classic early NAFLD pattern. In the context of your high triglycerides and low HDL, this is likely fat accumulation in liver cells due to metabolic dysfunction. This stage is FULLY REVERSIBLE with lifestyle changes."),
sp(0.5),
h3("A. Investigations First - Rule Out Other Causes", C.teal),
bul("Abdominal ultrasound: confirms hepatic steatosis (fatty liver) - book this within 2 weeks"),
bul("HBsAg (Hepatitis B antigen) and Anti-HCV (Hepatitis C antibody): MUST be checked to rule out viral hepatitis"),
bul("If Hepatitis B or C found positive: specific antiviral treatment will be required - different management entirely"),
sp(0.5),
h3("B. Weight Loss - Most Effective NAFLD Treatment Known", C.green),
cardCell(
"How Much Weight Loss Is Needed",
[
"5% body weight loss: significantly reduces liver fat and starts improving ALT and AST",
"7-10% body weight loss: can fully NORMALISE liver enzymes and reduce inflammation",
"More than 10% body weight loss: can reverse early liver scarring (fibrosis)",
"Safe pace: lose 0.5 to 1 kg per week - a 500 calorie daily deficit is enough",
"CAUTION: Rapid weight loss more than 1.5 kg/week can actually WORSEN fatty liver - slow and steady"
],
C.greenLt, C.green, C.green
),
sp(0.5),
h3("C. Diet Specifically for Liver Health", C.amber),
bul("Follow Mediterranean-style diet: fish, olive oil, vegetables, legumes, whole grains, nuts, limited red meat"),
bul("Completely avoid alcohol - even small amounts worsen liver inflammation when fat is already present"),
bul("Eliminate all fructose sources: soft drinks, packaged sweets, fruit juices - fructose is metabolised ONLY by the liver and directly converted to fat"),
bul("Drink 2-3 plain black coffees daily (no sugar, minimal milk) - clinical evidence shows coffee reduces liver enzymes in NAFLD"),
bul("Add turmeric to all cooking - curcumin has proven hepatoprotective effects at everyday dietary doses"),
bul("Drink 2.5-3 litres of water daily"),
bul("Avoid eating after 8 PM - the liver does its repair and detoxification work overnight"),
sp(0.5),
h3("D. Exercise for Liver Health", C.amber),
bul("150-300 minutes of aerobic exercise per week directly reduces liver fat, independent of weight loss"),
bul("Even walking 10,000 steps per day has been shown to improve liver enzymes in NAFLD"),
bul("Resistance training further improves insulin sensitivity and reduces hepatic fat accumulation"),
sp(0.5),
h3("E. No Approved Medication for Early NAFLD", C.dark),
p("No medication is approved for early-stage NAFLD as of 2026. Treatment is entirely lifestyle-based. Repeat LFT in 3 months after starting lifestyle changes - expect ALT and AST to normalise with 7-10% weight loss and consistent exercise."),
sp(1),
// ════════════════════════════════════════════════════════════════════
// CONDITION 4 - POTASSIUM
// ════════════════════════════════════════════════════════════════════
secTitle("Condition 4: Mild Low Potassium (Hypokalemia)", C.teal),
p("Potassium = 3.27 mmol/L (Normal: 3.50-5.10) | Kidneys completely normal: eGFR 115, Creatinine 0.86", { bold: true, color: C.amber }),
p("Mild low potassium, most likely dietary. Your kidneys are perfect so this is not a kidney problem. Symptoms if potassium stays low: fatigue, muscle cramps, constipation, palpitations."),
sp(0.5),
h3("A. Potassium-Rich Foods to Eat Every Day", C.green),
sp(0.2),
tbl(
["Food", "Potassium Amount", "Practical Tip"],
[
["Coconut water - 200 mL", "600 mg", "Drink every morning instead of juice"],
["Banana - 1 medium", "422 mg", "Easy daily snack"],
["Dal/lentils - 1 cup cooked", "730 mg", "Eat 2 cups of dal daily (toor, moong, masoor)"],
["Potato - 1 medium boiled with skin", "925 mg", "Keep the skin on - most potassium is there"],
["Spinach/palak - 1 cup cooked", "840 mg", "Any cooked leafy greens"],
["Rajma/chana/beans - 1 cup cooked", "700-900 mg", "Great for fibre and protein too"],
["Orange or sweet lime - 1 fruit", "240 mg", "Good daily snack"],
["Curd/dahi - 1 cup", "380 mg", "Also provides probiotics for gut health"],
["Tomato - 1 cup", "427 mg", "Raw salad or cooked sabzi"]
],
[35, 20, 45]
),
sp(0.4),
bul("Daily target: 3,500-4,700 mg of potassium - easily achievable with the above foods"),
bul("Reduce excess salt and sodium: high sodium causes potassium to be lost in urine"),
bul("Repeat potassium blood test in 4-6 weeks to confirm it has normalised"),
bul("If muscle cramps or palpitations occur: see your doctor - oral supplements may be needed"),
bul("NEVER self-medicate with potassium supplement tablets - excess potassium is dangerous to the heart"),
sp(1),
// ════════════════════════════════════════════════════════════════════
// DAILY BLUEPRINT
// ════════════════════════════════════════════════════════════════════
secTitle("Your Daily Lifestyle Blueprint - Treats All 4 Conditions", C.green),
p("These daily habits simultaneously lower triglycerides, raise HDL, reduce liver fat, support thyroid, and correct potassium. Consistency over months is what creates results.", { bold: true }),
sp(0.4),
tbl(
["Time of Day", "What to Do"],
[
[{ text: "On Waking", bold: true, color: C.teal }, "1-2 glasses warm water + 200 mL coconut water (potassium + hydration)"],
[{ text: "Thyroid Medication (if prescribed)", bold: true, color: C.teal }, "Take LT4 on empty stomach, 30-60 min before breakfast. No coffee or calcium for 1 hour after."],
[{ text: "Breakfast", bold: true, color: C.teal }, "Oats porridge / idli + sambar / poha (light oil) / whole wheat upma. AVOID: white bread, paratha with butter, puri, sweetened cereals"],
[{ text: "Mid-Morning Snack", bold: true, color: C.teal }, "10-15 almonds or walnuts + 1 fruit (apple, orange, guava). AVOID: biscuits, chips, packaged snacks"],
[{ text: "Lunch", bold: true, color: C.teal }, "Half plate: vegetables (sabzi). Quarter plate: dal or lentils. Quarter plate: brown rice or 2 rotis. Add 1 tbsp flaxseeds or chia seeds for omega-3"],
[{ text: "Afternoon Coffee", bold: true, color: C.teal }, "1 cup plain black coffee or with a little milk, no sugar. Benefits liver."],
[{ text: "Exercise - 5 to 6 days per week", bold: true, color: C.green }, "30-45 min brisk walk OR cycling OR swimming. 3 days/week add 15-20 min: squats, push-ups, planks, lunges"],
[{ text: "Evening Snack", bold: true, color: C.teal }, "1 cup green tea (no sugar) + roasted chana or makhana. AVOID: biscuits, namkeen, fried snacks"],
[{ text: "Dinner - by 8 PM", bold: true, color: C.teal }, "Light meal: vegetable soup / khichdi / 1-2 rotis + sabzi + small portion of fish, egg, or dal. AVOID: large rice portions at night"],
[{ text: "After Dinner", bold: true, color: C.teal }, "10-minute walk if possible. Reduces post-meal blood sugar and triglyceride spikes."],
[{ text: "Bedtime", bold: true, color: C.teal }, "Plain water or warm milk (no sugar). No screens 30 min before bed. Target 7-8 hours of sleep."]
],
[28, 72]
),
sp(1),
// ════════════════════════════════════════════════════════════════════
// WHAT NOT TO DO
// ════════════════════════════════════════════════════════════════════
secTitle("What to Strictly Avoid", C.orange),
tbl(
["Category", "Avoid", "Why"],
[
["Drinks", "Cold drinks, packaged juices, energy drinks, alcohol", "Fructose and alcohol are the top causes of high triglycerides and fatty liver"],
["Foods", "White rice in large portions, maida, bread, biscuits, sweets, fried items", "Refined carbs spike triglycerides; fried items worsen liver"],
["Fats", "Vanaspati, dalda, margarine, palm oil", "Trans fats lower HDL cholesterol directly"],
["Supplements", "Iodine tablets, random herbal supplements without doctor advice", "Excess iodine worsens thyroid; some herbs are hepatotoxic"],
["Habits", "Late-night eating (after 9 PM), prolonged sitting, smoking", "Night eating raises overnight TG; smoking lowers HDL"],
["Self-medication", "Potassium tablets or thyroid supplements without prescription", "Both can be dangerous if overdosed"]
],
[20, 38, 42]
),
sp(1),
// ════════════════════════════════════════════════════════════════════
// FOLLOW-UP SCHEDULE
// ════════════════════════════════════════════════════════════════════
secTitle("Follow-Up Schedule", C.teal),
sp(0.3),
tbl(
["When", "Tests and Actions"],
[
[{ text: "Within 2 weeks", bold: true, color: C.teal }, "Abdominal Ultrasound (USG abdomen) | HBsAg (Hepatitis B) | Anti-HCV (Hepatitis C) | Anti-TPO antibodies (thyroid autoimmunity)"],
[{ text: "4-6 weeks", bold: true, color: C.teal }, "Repeat Serum Potassium and electrolytes. Review symptoms (cramps, fatigue, palpitations)."],
[{ text: "3 months", bold: true, color: C.teal }, "TSH + Free T4 | Lipid Profile (TG + HDL) | LFT (ALT, AST) | Fasting blood glucose | Blood pressure | Waist circumference measurement"],
[{ text: "6 months", bold: true, color: C.teal }, "If on Levothyroxine: TSH recheck. Full metabolic reassessment. Clinical review of all conditions."],
[{ text: "12 months", bold: true, color: C.teal }, "Full annual panel: CBC, LFT, KFT, Lipids, Thyroid, HbA1c, Fasting glucose. Continue all monitoring annually."]
],
[20, 80]
),
sp(1),
// WARNING
cardCell(
"See a Doctor Immediately If You Experience:",
[
"Severe muscle weakness or difficulty walking",
"Palpitations - fast, irregular, or pounding heartbeat",
"Yellowing of skin or eyes (jaundice)",
"Severe upper right abdominal pain",
"Extreme fatigue that is new or rapidly getting worse",
"Chest pain or breathlessness"
],
C.orangeLt, C.orange, C.orange
),
sp(0.8),
// POSITIVE
cardCell(
"Why You Have Every Reason to Be Positive",
[
"You are 36 years old - all four conditions were found early, before any organ damage",
"Blood sugar (HbA1c 5.1%), kidneys (eGFR 115), haemoglobin, and LDL cholesterol are all completely normal",
"Every single condition identified is reversible - especially with lifestyle changes started at this age",
"The same daily habits - better diet, regular exercise, adequate sleep - treat ALL four conditions at the same time",
"Most people with these findings achieve normal lab values within 3 to 6 months of consistent effort",
"You do not need perfection. You need persistence. Small daily actions compound into major health improvements."
],
C.greenLt, C.green, C.green
),
sp(0.5),
p("This plan is based on Pathkind Labs report dated 08/07/2026 (ID: 2000C245260708002385). It does not replace a clinical consultation. All treatment decisions, including whether to start Levothyroxine, must be made by your physician after physical examination and review of your full medical history.", { italic: true, color: "AAAAAA" })
]
}]
});
Packer.toBuffer(doc).then(function(buffer) {
var outPath = '/home/daytona/workspace/dina-clinical-summary/Lifestyle_Treatment_Plan_Dina_Krusna_Dhal.docx';
fs.writeFileSync(outPath, buffer);
console.log("SUCCESS: " + outPath);
});
cd /home/daytona/workspace/dina-clinical-summary && node build_plan.js 2>&1
python3 -c " import zipfile z = zipfile.ZipFile('/home/daytona/workspace/dina-cl…
Lifestyle Treatment Plan Dina Krusna Dhal
Word Document · DOCX
| Time | Action |
|---|---|
| Morning | Warm water + coconut water. LT4 if prescribed (empty stomach) |
| Breakfast | Oats / idli+sambar / poha. No white bread, no puri |
| Mid-morning | 10-15 almonds + 1 fruit |
| Lunch | Half-plate vegetables, quarter-plate dal, quarter-plate brown rice or 2 rotis + 1 tbsp flaxseeds |
| Afternoon | 1 plain coffee (no sugar) |
| Exercise | 30-45 min walk/cycling + 3x/week strength training |
| Evening | Green tea + roasted chana. No biscuits |
| Dinner (by 8 PM) | Light meal: soup / khichdi / 1-2 rotis + sabzi + fish/egg |
| Bedtime | Water or warm milk. 7-8 hours sleep |