Based on these reports please come to the diagnosis.
| Test | Result | Reference | Status |
|---|---|---|---|
| Hemoglobin | 16.60 g/dL | Normal for male | Normal |
| PCV | 48.80% | Normal | Normal |
| RBC | 4.83 mill/mm³ | Normal | Normal |
| MCV | 101.00 fL | 80-100 fL | HIGH (Macrocytosis) |
| Mentzer Index | 20.9 | >13 = IDA likely | Elevated |
| MCH | 34.40 pg | 27-33 pg | HIGH |
| MCHC | 34.00 g/dL | Normal | Normal |
| RDW | 14.80% | 11.5-14.5% | Slightly elevated |
| TLC | 8.24 thou/mm³ | Normal | Normal |
| Platelet Count | 115 thou/mm³ | 150-400 | LOW (Thrombocytopenia) |
| MPV | 11.8 fL | Slightly high | Mild elevation |
| Vitamin B12 | <105 pg/mL | 200-900 pg/mL | SEVERELY LOW |
| Vitamin D | 23.26 nmol/L | >50 nmol/L | DEFICIENT |
| Fasting Glucose | 107 mg/dL | <100 normal | Impaired (Pre-diabetes) |
| Uric Acid | 7.99 mg/dL | <7.0 mg/dL males | HIGH (Hyperuricemia) |
| HDL Cholesterol | 38.50 mg/dL | >40 mg/dL | LOW |
| Triglycerides | 176 mg/dL | <150 mg/dL | HIGH |
| LDL | 107.30 mg/dL | Borderline | Borderline |
| Non-HDL | 143 mg/dL | Borderline-High | Elevated |
| Creatinine | 0.89 mg/dL | Normal | Normal |
| eGFR | 102 mL/min | G1 | Normal |
| Uric Acid | 7.99 mg/dL | <6.8 = hyperuricemia | HYPERURICEMIA |
| AST/ALT | 30/35 U/L | Normal | Normal |
| ALP | 114 U/L | Normal | Normal |
| Total Protein | 8.20 g/dL | Normal | Normal |
| Globulin | 3.90 g/dL | Slightly elevated | Note |
| TSH | 3.33 µIU/mL | Normal | Normal |
| T3 | 1.11 ng/mL | Normal | Normal |
| T4 | 5.33 µg/dL | Normal | Normal |
| Criterion | Value | Threshold | Met? |
|---|---|---|---|
| Triglycerides | 176 mg/dL | ≥150 | YES |
| HDL (male) | 38.5 mg/dL | <40 | YES |
| Fasting glucose | 107 mg/dL | ≥100 | YES |
| Blood pressure | Not reported | - | Unknown |
| Waist circumference | Not reported | - | Unknown |
Important note: This analysis is based solely on the lab reports provided. A complete clinical evaluation including history, symptoms, physical examination, and additional investigations is required for definitive clinical management. Please consult a physician.
Please ask me relevant questions for the diagnosis
Warning: The peripheral neuropathy is currently reversible. Without treatment, it can progress to subacute combined degeneration of the spinal cord (posterior + lateral columns), which is irreversible. This must be treated urgently.
| Criterion | His Value | Cut-off |
|---|---|---|
| Triglycerides | 176 mg/dL | ≥150 |
| HDL (male) | 38.5 mg/dL | <40 |
| Fasting glucose | 107 mg/dL | ≥100 (IFG) |
| Priority | Action |
|---|---|
| URGENT | Vitamin B12 IM injections - 1000 µg daily x 7 days, then weekly x 4 weeks, then monthly lifelong (strict vegetarian cannot correct this through diet alone) |
| HIGH | Vitamin D3 - 60,000 IU/week x 8-12 weeks, then 1000-2000 IU/day maintenance |
| HIGH | Peripheral blood smear - confirm hypersegmented neutrophils, macro-ovalocytes |
| HIGH | Serum folate - rule out concurrent deficiency |
| MODERATE | HbA1c - confirm pre-diabetes, rule out overt T2DM |
| MODERATE | Uric acid: low-purine diet (limit dals/legumes, spinach, cauliflower), increase water intake; if gout flares - colchicine/NSAIDs acutely, allopurinol for long-term control |
| MODERATE | Lifestyle: daily 30-minute walk, weight management, reduce refined carbs and fried foods for metabolic syndrome and TG |
| FOLLOW-UP | Repeat B12 and CBC after 6-8 weeks to confirm response |
This analysis is for informational purposes. Please consult a physician for formal diagnosis, prescription, and ongoing monitoring.
Create a clinical summary document for the physician's records
ls /home/daytona/workspace/ 2>/dev/null && ls /home/daytona/skills/docx/scripts/…
mkdir -p /home/daytona/workspace/dharmendra-clinical-summary
~/dharmendra-clinical-summary/create_summary.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, HeadingLevel, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, Header, Footer, PageBreak, UnderlineType
} = require('docx');
const fs = require('fs');
// ─── Helpers ────────────────────────────────────────────────────────────────
const BRAND_BLUE = "1A3A5C";
const ACCENT_RED = "C0392B";
const LIGHT_BLUE = "D6E4F0";
const LIGHT_GRAY = "F2F2F2";
const MID_GRAY = "BDC3C7";
const WHITE = "FFFFFF";
const DARK_TEXT = "1C1C1C";
function hdr(text, lvl = HeadingLevel.HEADING_1, color = BRAND_BLUE) {
return new Paragraph({
heading: lvl,
spacing: { before: 240, after: 120 },
children: [new TextRun({ text, bold: true, color, size: lvl === HeadingLevel.HEADING_1 ? 26 : 22, font: "Calibri" })]
});
}
function body(text, opts = {}) {
return new Paragraph({
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, size: 20, font: "Calibri", color: DARK_TEXT, ...opts })]
});
}
function bullet(text, bold_prefix = "") {
return new Paragraph({
bullet: { level: 0 },
spacing: { before: 40, after: 40 },
children: [
...(bold_prefix ? [new TextRun({ text: bold_prefix + " ", bold: true, size: 20, font: "Calibri", color: DARK_TEXT })] : []),
new TextRun({ text, size: 20, font: "Calibri", color: DARK_TEXT })
]
});
}
function divider() {
return new Paragraph({
spacing: { before: 80, after: 80 },
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: MID_GRAY } },
children: []
});
}
function spacer() {
return new Paragraph({ spacing: { before: 80, after: 80 }, children: [] });
}
// Shaded section header bar
function sectionBar(text) {
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children: [
new TableCell({
shading: { fill: BRAND_BLUE, type: ShadingType.CLEAR },
margins: { top: 80, bottom: 80, left: 160, right: 160 },
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [new Paragraph({ children: [new TextRun({ text, bold: true, color: WHITE, size: 22, font: "Calibri" })] })]
})
]
})
]
});
}
// Urgency badge cell
function urgencyCell(text, fillColor) {
return new TableCell({
shading: { fill: fillColor, type: ShadingType.CLEAR },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 120, right: 120 },
width: { size: 15, type: WidthType.PERCENTAGE },
children: [new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text, bold: true, color: WHITE, size: 18, font: "Calibri" })] })]
});
}
function dataCell(text, shade = WHITE, bold = false, color = DARK_TEXT, widthPct = 28) {
return new TableCell({
shading: { fill: shade, type: ShadingType.CLEAR },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 120, right: 120 },
width: { size: widthPct, type: WidthType.PERCENTAGE },
children: [new Paragraph({ children: [new TextRun({ text, bold, size: 19, font: "Calibri", color })] })]
});
}
// ─── Lab Results Table ───────────────────────────────────────────────────────
function labRow(test, result, reference, status, flag = false) {
const statusColor = status === "HIGH" || status === "LOW" || status === "DEFICIENT" || status === "CRITICAL" ? ACCENT_RED :
status === "BORDERLINE" ? "E67E22" : "1E8449";
const rowShade = flag ? "FEF9E7" : WHITE;
return new TableRow({
children: [
dataCell(test, rowShade, flag, DARK_TEXT, 35),
dataCell(result, rowShade, flag, flag ? ACCENT_RED : DARK_TEXT, 20),
dataCell(reference, rowShade, false, DARK_TEXT, 25),
new TableCell({
shading: { fill: rowShade, type: ShadingType.CLEAR },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 120, right: 120 },
width: { size: 20, type: WidthType.PERCENTAGE },
children: [new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: status, bold: true, size: 18, font: "Calibri", color: statusColor })] })]
})
]
});
}
function labTableHeader() {
return new TableRow({
tableHeader: true,
children: [
dataCell("TEST", BRAND_BLUE, true, WHITE, 35),
dataCell("RESULT", BRAND_BLUE, true, WHITE, 20),
dataCell("REFERENCE", BRAND_BLUE, true, WHITE, 25),
dataCell("STATUS", BRAND_BLUE, true, WHITE, 20),
]
});
}
// ─── Dx Table ────────────────────────────────────────────────────────────────
function dxRow(num, diagnosis, urgency, urgColor) {
return new TableRow({
children: [
dataCell(num, LIGHT_GRAY, true, BRAND_BLUE, 8),
dataCell(diagnosis, WHITE, false, DARK_TEXT, 72),
urgencyCell(urgency, urgColor),
]
});
}
// ─── Action Plan Table ────────────────────────────────────────────────────────
function actionRow(priority, action, details, pColor) {
return new TableRow({
children: [
new TableCell({
shading: { fill: pColor, type: ShadingType.CLEAR },
verticalAlign: VerticalAlign.CENTER,
margins: { top: 60, bottom: 60, left: 120, right: 120 },
width: { size: 15, type: WidthType.PERCENTAGE },
children: [new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: priority, bold: true, color: WHITE, size: 18, font: "Calibri" })] })]
}),
dataCell(action, WHITE, true, DARK_TEXT, 30),
dataCell(details, WHITE, false, DARK_TEXT, 55),
]
});
}
// ─── Build Document ──────────────────────────────────────────────────────────
const doc = new Document({
styles: {
default: {
document: { run: { font: "Calibri", size: 20, color: DARK_TEXT } }
}
},
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 },
rows: [new TableRow({
children: [
new TableCell({
shading: { fill: BRAND_BLUE, type: ShadingType.CLEAR },
margins: { top: 100, bottom: 100, left: 200, right: 200 },
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, color: WHITE, size: 24, font: "Calibri" })] }),
new Paragraph({ children: [new TextRun({ text: "Confidential - For Physician Use Only", color: "A8C5E0", size: 16, font: "Calibri" })] }),
]
}),
new TableCell({
shading: { fill: BRAND_BLUE, type: ShadingType.CLEAR },
margins: { top: 100, bottom: 100, left: 200, right: 200 },
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: "Dr. Lal PathLabs", color: WHITE, size: 20, font: "Calibri" })] }),
new Paragraph({ alignment: AlignmentType.RIGHT, children: [new TextRun({ text: "Lab No: 510057837", color: "A8C5E0", size: 16, font: "Calibri" })] }),
]
})
]
})]
})
]
})
},
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
border: { top: { style: BorderStyle.SINGLE, size: 4, color: MID_GRAY } },
spacing: { before: 80 },
children: [
new TextRun({ text: "This document is auto-generated for clinical reference. Physician review and clinical correlation required. | Page ", size: 16, color: "888888", font: "Calibri" }),
new TextRun({ children: [PageNumber.CURRENT], size: 16, color: "888888", font: "Calibri" }),
]
})
]
})
},
children: [
spacer(),
// ── Patient Demographics ──
sectionBar("PATIENT INFORMATION"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [
dataCell("Name", LIGHT_BLUE, true, BRAND_BLUE, 20),
dataCell("Mr. Dharmendra", WHITE, false, DARK_TEXT, 30),
dataCell("Age / Gender", LIGHT_BLUE, true, BRAND_BLUE, 20),
dataCell("53 Years / Male", WHITE, false, DARK_TEXT, 30),
]}),
new TableRow({ children: [
dataCell("Lab Number", LIGHT_BLUE, true, BRAND_BLUE, 20),
dataCell("510057837", WHITE, false, DARK_TEXT, 30),
dataCell("Collection Date", LIGHT_BLUE, true, BRAND_BLUE, 20),
dataCell("17/05/2026, 11:37 AM", WHITE, false, DARK_TEXT, 30),
]}),
new TableRow({ children: [
dataCell("Referral", LIGHT_BLUE, true, BRAND_BLUE, 20),
dataCell("Self", WHITE, false, DARK_TEXT, 30),
dataCell("Report Date", LIGHT_BLUE, true, BRAND_BLUE, 20),
dataCell("17/05/2026, 3:47 PM", WHITE, false, DARK_TEXT, 30),
]}),
new TableRow({ children: [
dataCell("Lab", LIGHT_BLUE, true, BRAND_BLUE, 20),
dataCell("Dr. Lal PathLabs, Near Bus Stand, Azamgarh", WHITE, false, DARK_TEXT, 80),
]}),
]
}),
spacer(),
// ── Clinical History ──
sectionBar("CLINICAL HISTORY (PATIENT-REPORTED)"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [
dataCell("Chief Complaints", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("Fatigue / weakness, tingling & numbness in feet, joint pain and swelling (big toe, ankle/knee) - duration 6-12 months", WHITE, false, DARK_TEXT, 75),
]}),
new TableRow({ children: [
dataCell("Diet", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("Strict vegetarian (no meat, eggs, or dairy products)", WHITE, false, DARK_TEXT, 75),
]}),
new TableRow({ children: [
dataCell("Occupation", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("Sedentary / office-based work", WHITE, false, DARK_TEXT, 75),
]}),
new TableRow({ children: [
dataCell("Sun Exposure", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("Occasional (weekends only)", WHITE, false, DARK_TEXT, 75),
]}),
new TableRow({ children: [
dataCell("Alcohol", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("None", WHITE, false, DARK_TEXT, 75),
]}),
new TableRow({ children: [
dataCell("Known Co-morbidities", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("None known", WHITE, false, DARK_TEXT, 75),
]}),
new TableRow({ children: [
dataCell("Current Medications", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("None", WHITE, false, DARK_TEXT, 75),
]}),
new TableRow({ children: [
dataCell("Weight Change", LIGHT_BLUE, true, BRAND_BLUE, 25),
dataCell("Stable", WHITE, false, DARK_TEXT, 75),
]}),
]
}),
spacer(),
// ── Lab Results ──
sectionBar("LABORATORY RESULTS SUMMARY"),
spacer(),
// CBC
new Paragraph({ spacing: { before: 100, after: 60 }, children: [new TextRun({ text: "Complete Blood Count", bold: true, size: 21, color: BRAND_BLUE, font: "Calibri", underline: { type: UnderlineType.SINGLE } })] }),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
labTableHeader(),
labRow("Hemoglobin", "16.60 g/dL", "13.0-17.0 g/dL", "NORMAL"),
labRow("Packed Cell Volume (PCV)", "48.80%", "40-54%", "NORMAL"),
labRow("RBC Count", "4.83 mill/mm³", "4.5-5.5 mill/mm³", "NORMAL"),
labRow("MCV", "101.00 fL", "80-100 fL", "HIGH", true),
labRow("MCH", "34.40 pg", "27-33 pg", "HIGH", true),
labRow("MCHC", "34.00 g/dL", "31.5-35 g/dL", "NORMAL"),
labRow("RDW", "14.80%", "11.5-14.5%", "HIGH", true),
labRow("Mentzer Index", "20.9", ">13 = IDA likely", "ELEVATED", true),
labRow("TLC", "8.24 thou/mm³", "4.0-11.0 thou/mm³", "NORMAL"),
labRow("Neutrophils", "77% (6.34 abs)", "40-80%", "NORMAL"),
labRow("Lymphocytes", "16% (1.32 abs)", "20-45%", "LOW", true),
labRow("Platelet Count", "115 thou/mm³", "150-400 thou/mm³", "LOW", true),
labRow("MPV", "11.8 fL", "7.5-12.5 fL", "NORMAL"),
]
}),
spacer(),
// Vitamins & Glucose
new Paragraph({ spacing: { before: 100, after: 60 }, children: [new TextRun({ text: "Vitamins & Metabolic", bold: true, size: 21, color: BRAND_BLUE, font: "Calibri", underline: { type: UnderlineType.SINGLE } })] }),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
labTableHeader(),
labRow("Vitamin B12 (Cyanocobalamin)", "<105 pg/mL", "200-900 pg/mL", "CRITICAL", true),
labRow("Vitamin D, 25-Hydroxy", "23.26 nmol/L", ">50 nmol/L sufficient", "DEFICIENT", true),
labRow("Fasting Plasma Glucose", "107 mg/dL", "<100 mg/dL normal", "BORDERLINE", true),
]
}),
spacer(),
// Lipid Profile
new Paragraph({ spacing: { before: 100, after: 60 }, children: [new TextRun({ text: "Lipid Profile", bold: true, size: 21, color: BRAND_BLUE, font: "Calibri", underline: { type: UnderlineType.SINGLE } })] }),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
labTableHeader(),
labRow("Total Cholesterol", "181 mg/dL", "<200 mg/dL", "NORMAL"),
labRow("Triglycerides", "176 mg/dL", "<150 mg/dL", "HIGH", true),
labRow("HDL Cholesterol", "38.50 mg/dL", ">40 mg/dL (male)", "LOW", true),
labRow("LDL Cholesterol (Calc.)", "107.30 mg/dL", "<100 mg/dL optimal", "BORDERLINE", true),
labRow("VLDL Cholesterol", "35.20 mg/dL", "<30 mg/dL", "HIGH", true),
labRow("Non-HDL Cholesterol", "143 mg/dL", "<130 mg/dL", "HIGH", true),
]
}),
spacer(),
// Liver & Kidney
new Paragraph({ spacing: { before: 100, after: 60 }, children: [new TextRun({ text: "Liver & Kidney Function", bold: true, size: 21, color: BRAND_BLUE, font: "Calibri", underline: { type: UnderlineType.SINGLE } })] }),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
labTableHeader(),
labRow("Creatinine", "0.89 mg/dL", "0.7-1.2 mg/dL", "NORMAL"),
labRow("eGFR", "102 mL/min/1.73m²", ">90 (G1)", "NORMAL"),
labRow("Uric Acid", "7.99 mg/dL", "<7.0 mg/dL", "HIGH", true),
labRow("AST (SGOT)", "30 U/L", "10-40 U/L", "NORMAL"),
labRow("ALT (SGPT)", "35 U/L", "7-56 U/L", "NORMAL"),
labRow("ALP", "114 U/L", "44-147 U/L", "NORMAL"),
labRow("Total Bilirubin", "0.80 mg/dL", "0.2-1.2 mg/dL", "NORMAL"),
labRow("Total Protein", "8.20 g/dL", "6.0-8.3 g/dL", "NORMAL"),
labRow("Albumin", "4.30 g/dL", "3.5-5.0 g/dL", "NORMAL"),
labRow("Globulin", "3.90 g/dL", "2.0-3.5 g/dL", "HIGH", true),
labRow("Urea", "22.16 mg/dL", "15-45 mg/dL", "NORMAL"),
labRow("BUN", "10.35 mg/dL", "7-25 mg/dL", "NORMAL"),
]
}),
spacer(),
// Thyroid
new Paragraph({ spacing: { before: 100, after: 60 }, children: [new TextRun({ text: "Thyroid Profile", bold: true, size: 21, color: BRAND_BLUE, font: "Calibri", underline: { type: UnderlineType.SINGLE } })] }),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
labTableHeader(),
labRow("T3 Total", "1.11 ng/mL", "0.87-1.78 ng/mL", "NORMAL"),
labRow("T4 Total", "5.33 µg/dL", "4.5-12.5 µg/dL", "NORMAL"),
labRow("TSH", "3.33 µIU/mL", "0.35-4.94 µIU/mL", "NORMAL"),
]
}),
spacer(),
// Page break before diagnoses
new Paragraph({ children: [new PageBreak()] }),
// ── Diagnoses ──
sectionBar("CLINICAL DIAGNOSES"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ tableHeader: true, children: [
dataCell("#", BRAND_BLUE, true, WHITE, 8),
dataCell("DIAGNOSIS", BRAND_BLUE, true, WHITE, 72),
dataCell("URGENCY", BRAND_BLUE, true, WHITE, 20),
]}),
dxRow("1", "Severe Vitamin B12 (Cobalamin) Deficiency with Peripheral Neuropathy", "URGENT", "C0392B"),
dxRow("2", "Vitamin D Deficiency (Deficient; 23.26 nmol/L)", "HIGH", "D35400"),
dxRow("3", "Hyperuricemia / Early Gout (Uric Acid 7.99 mg/dL; big toe & ankle joint pain)", "MODERATE", "1A5276"),
dxRow("4", "Metabolic Syndrome (High TG + Low HDL + Impaired Fasting Glucose - 3/5 criteria met)", "MODERATE", "1A5276"),
dxRow("5", "Impaired Fasting Glucose / Pre-Diabetes (FBG 107 mg/dL)", "MODERATE", "1A5276"),
dxRow("6", "Mixed Atherogenic Dyslipidemia (High TG, Low HDL, Elevated Non-HDL)", "MODERATE", "1A5276"),
dxRow("7", "Thrombocytopenia - likely megaloblastic (Platelets 115; from B12 deficiency)", "HIGH", "D35400"),
]
}),
spacer(),
// ── Key Clinical Reasoning ──
sectionBar("KEY CLINICAL REASONING"),
spacer(),
hdr("1. Vitamin B12 Deficiency + Peripheral Neuropathy (MOST URGENT)", HeadingLevel.HEADING_2, ACCENT_RED),
bullet("B12 critically low at <105 pg/mL (normal 200-900 pg/mL) - strict vegetarian diet with zero dietary cobalamin intake.", ""),
bullet("MCV 101 fL (macrocytosis), MCH 34.4 pg, RDW 14.8% - classic early megaloblastic CBC changes.", ""),
bullet("Platelet count 115 (low) - impaired DNA synthesis affecting megakaryocyte line; thrombocytopenia in megaloblastic state.", ""),
bullet("Tingling/numbness isolated to feet (length-dependent peripheral neuropathy) - earliest neurological sign of B12 deficiency, currently REVERSIBLE.", ""),
bullet("Duration 6-12 months - consistent with gradual hepatic B12 store depletion (stores normally last 3-5 years).", ""),
bullet("WARNING: Without prompt treatment, may progress to subacute combined degeneration of the spinal cord (posterior and lateral columns) - IRREVERSIBLE.", "", ),
spacer(),
hdr("2. Vitamin D Deficiency", HeadingLevel.HEADING_2, BRAND_BLUE),
bullet("25-OH Vitamin D 23.26 nmol/L - well within the deficient range (<50 nmol/L).", ""),
bullet("Risk factors: sedentary indoor lifestyle, strict vegetarian diet (no fatty fish/eggs), only occasional sun exposure.", ""),
bullet("Contributes to fatigue, muscle weakness, and bone pain reported by patient.", ""),
spacer(),
hdr("3. Hyperuricemia / Early Gout", HeadingLevel.HEADING_2, BRAND_BLUE),
bullet("Uric acid 7.99 mg/dL - above monosodium urate crystal saturation threshold of 6.8 mg/dL.", ""),
bullet("Joint pain pattern (big toe + ankle) matches classic podagra and peri-talar gout distribution.", ""),
bullet("No acute flares described (gradual ache) - may represent intercritical gout or early tophaceous phase.", ""),
bullet("Hyperuricemia compounded by metabolic syndrome (insulin resistance reduces renal urate excretion).", ""),
spacer(),
hdr("4. Metabolic Syndrome", HeadingLevel.HEADING_2, BRAND_BLUE),
bullet("3 of 5 IDF/AHA criteria confirmed: Triglycerides >=150 (176), HDL <40 in male (38.5), Fasting glucose >=100 (107).", ""),
bullet("BP and waist circumference not measured - if central obesity confirmed, would meet 4/5 criteria.", ""),
bullet("Sedentary occupation is the primary driver.", ""),
spacer(),
hdr("5. Thyroid Status - NORMAL", HeadingLevel.HEADING_2, "1E8449"),
bullet("TSH 3.33, T3 1.11, T4 5.33 - all within normal range. Hypothyroidism excluded as cause of macrocytosis or dyslipidemia.", ""),
spacer(),
hdr("6. Kidney & Liver Function - NORMAL", HeadingLevel.HEADING_2, "1E8449"),
bullet("eGFR 102 mL/min (G1 - normal), creatinine 0.89, liver enzymes normal. No end-organ damage currently.", ""),
bullet("Mildly elevated globulin (3.90 g/dL) - non-specific, may reflect chronic inflammatory state; monitor.", ""),
spacer(),
// ── Action Plan ──
new Paragraph({ children: [new PageBreak()] }),
sectionBar("INVESTIGATION & MANAGEMENT PLAN"),
spacer(),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ tableHeader: true, children: [
dataCell("PRIORITY", BRAND_BLUE, true, WHITE, 15),
dataCell("INVESTIGATION / INTERVENTION", BRAND_BLUE, true, WHITE, 30),
dataCell("DETAILS", BRAND_BLUE, true, WHITE, 55),
]}),
actionRow("URGENT", "Vitamin B12 IM Injection", "Cyanocobalamin 1000 mcg IM daily x 7 days, then weekly x 4 weeks, then monthly lifelong (strict vegetarian cannot replete via diet)", "C0392B"),
actionRow("URGENT", "Peripheral Blood Smear", "Look for hypersegmented neutrophils (>=5 lobes), macro-ovalocytes - confirms megaloblastic etiology", "C0392B"),
actionRow("HIGH", "Serum Folate Level", "Rule out concurrent folate deficiency (both B12 and folate cause macrocytosis)", "D35400"),
actionRow("HIGH", "Anti-Intrinsic Factor & Anti-Parietal Cell Antibodies", "Rule out pernicious anemia (autoimmune B12 malabsorption) as underlying cause", "D35400"),
actionRow("HIGH", "Serum Homocysteine & Methylmalonic Acid (MMA)", "More sensitive markers; elevated MMA is specific for B12 deficiency; helps confirm tissue-level deficiency", "D35400"),
actionRow("HIGH", "Vitamin D3 Supplementation", "Cholecalciferol 60,000 IU/week x 8-12 weeks loading, then 1000-2000 IU/day maintenance. Recheck 25-OH-D after 12 weeks.", "D35400"),
actionRow("MODERATE", "HbA1c", "Confirm pre-diabetes, rule out overt Type 2 DM. If HbA1c 5.7-6.4% = pre-diabetes. Lifestyle modification counselling.", "1A5276"),
actionRow("MODERATE", "Uric Acid Management", "Dietary: reduce high-purine foods (spinach, cauliflower, dals). Increase hydration (>2.5L/day). If gout flare: colchicine 0.5mg BD. Long-term: consider allopurinol 100-300mg if recurrent.", "1A5276"),
actionRow("MODERATE", "Lipid / Metabolic Syndrome", "Dietary: reduce refined carbs, fried foods, trans fats. Daily 30-minute brisk walk. Recheck lipids in 3 months. If LDL/TG persist - consider statin +/- fenofibrate.", "1A5276"),
actionRow("FOLLOW-UP", "CBC + B12 + Platelet Count", "Repeat at 6-8 weeks post-B12 supplementation to confirm response (expect MCV to normalize, platelets to rise)", "2E86C1"),
actionRow("FOLLOW-UP", "Fasting Glucose / HbA1c", "Recheck in 3 months with lifestyle modification. If no improvement, consider metformin per physician discretion.", "2E86C1"),
actionRow("FOLLOW-UP", "Lipid Profile", "Repeat at 3 months after dietary and lifestyle intervention", "2E86C1"),
]
}),
spacer(),
spacer(),
// ── Disclaimer ──
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [new TableRow({ children: [
new TableCell({
shading: { fill: "FEF9E7", type: ShadingType.CLEAR },
margins: { top: 120, bottom: 120, left: 200, right: 200 },
borders: {
top: { style: BorderStyle.SINGLE, size: 6, color: "F39C12" },
bottom: { style: BorderStyle.SINGLE, size: 6, color: "F39C12" },
left: { style: BorderStyle.SINGLE, size: 6, color: "F39C12" },
right: { style: BorderStyle.SINGLE, size: 6, color: "F39C12" }
},
children: [
new Paragraph({ children: [new TextRun({ text: "IMPORTANT NOTICE", bold: true, color: "C0392B", size: 20, font: "Calibri" })] }),
new Paragraph({ spacing: { before: 60 }, children: [new TextRun({ text: "This clinical summary was prepared using AI-assisted analysis of laboratory reports and patient-reported history. It is intended as a decision-support tool only. All diagnoses, treatment decisions, and prescriptions must be confirmed and authorised by a qualified and registered medical practitioner. Clinical correlation with full physical examination and additional investigations is mandatory before initiating therapy.", size: 18, color: "7D6608", font: "Calibri" })] }),
new Paragraph({ spacing: { before: 60 }, children: [new TextRun({ text: "Prepared: 23 May 2026 | Source: Dr. Lal PathLabs Report No. 510057837 | Analysed by: Orris AI Clinical Assistant", size: 16, color: "7D6608", font: "Calibri", italics: true })] }),
]
})
]})]
}),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/dharmendra-clinical-summary/Clinical_Summary_Dharmendra.docx", buffer);
console.log("Document created successfully.");
}).catch(err => {
console.error("Error:", err);
process.exit(1);
});
cd /home/daytona/workspace/dharmendra-clinical-summary && node create_summary.js
python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/worksp…
python3 -c " import zipfile, os path = '/home/daytona/workspace/dharmendra-clini…
Clinical Summary Dharmendra
Word Document · DOCX