~/chau-bich-diep-record/generate.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
HeadingLevel, AlignmentType, BorderStyle, WidthType, VerticalAlign,
PageBreak, ShadingType
} = require('docx');
const fs = require('fs');
// ─── helpers ──────────────────────────────────────────────────────────────────
const bold = (t, sz=22) => new TextRun({ text: t, bold: true, size: sz });
const reg = (t, sz=22) => new TextRun({ text: t, bold: false, size: sz });
const italic= (t, sz=22) => new TextRun({ text: t, italics: true, size: sz });
const h1 = (text) => new Paragraph({
heading: HeadingLevel.HEADING_1,
children: [new TextRun({ text, bold: true, size: 28, color: '1F3864' })],
spacing: { before: 300, after: 100 },
});
const h2 = (text) => new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [new TextRun({ text, bold: true, size: 24, color: '2E74B5' })],
spacing: { before: 240, after: 80 },
});
const h3 = (text) => new Paragraph({
heading: HeadingLevel.HEADING_3,
children: [new TextRun({ text, bold: true, size: 22, underline: {} })],
spacing: { before: 200, after: 60 },
});
const p = (runs, opts={}) => new Paragraph({ children: Array.isArray(runs) ? runs : [reg(runs)], spacing:{after:80}, ...opts });
const bullet = (text, lvl=0) => new Paragraph({
children: [reg(text)],
bullet: { level: lvl },
spacing: { after: 60 },
});
const emptyLine = () => new Paragraph({ children: [reg('')], spacing:{after:60}});
// table with header row shaded blue
function makeTable(headers, rows) {
const shade = { type: ShadingType.SOLID, color: '2E74B5', fill: '2E74B5' };
const headerCells = headers.map(h =>
new TableCell({
shading: shade,
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({ children: [new TextRun({ text: h, bold: true, color: 'FFFFFF', size: 20 })], alignment: AlignmentType.CENTER })],
})
);
const headerRow = new TableRow({ children: headerCells, tableHeader: true });
const dataRows = rows.map(row =>
new TableRow({
children: row.map((cell, i) =>
new TableCell({
verticalAlign: VerticalAlign.CENTER,
children: [new Paragraph({ children: [new TextRun({ text: String(cell), size: 20 })], alignment: i === 0 ? AlignmentType.LEFT : AlignmentType.CENTER })],
})
),
})
);
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
rows: [headerRow, ...dataRows],
margins: { top: 60, bottom: 60, left: 80, right: 80 },
});
}
// ─── DOCUMENT ─────────────────────────────────────────────────────────────────
const doc = new Document({
styles: {
paragraphStyles: [
{ id: 'Normal', name: 'Normal', run: { font: 'Calibri', size: 22 } }
]
},
sections: [{
properties: { page: { margin: { top: 1080, bottom: 1080, left: 1080, right: 1080 } } },
children: [
// ══════════════════════════════════════════════
// TITLE BLOCK
// ══════════════════════════════════════════════
new Paragraph({
alignment: AlignmentType.CENTER,
children: [bold('INTERNAL MEDICINE MEDICAL RECORD', 32)],
spacing: { after: 60 },
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [italic('Internal Medicine / Endocrinology Department — Trung Vuong Hospital, Ho Chi Minh City', 22)],
spacing: { after: 60 },
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [reg('266 Ly Thuong Kiet St., Ward 14, District 10, HCMC | Tel: (028) 38656744', 20)],
spacing: { after: 300 },
}),
// ══════════════════════════════════════════════
// SECTION I – ADMINISTRATIVE
// ══════════════════════════════════════════════
h1('I. ADMINISTRATIVE SECTION'),
makeTable(['Field','Details'],[
['Full Name','CHAU THI BICH DIEP'],
['Date of Birth','16 May 1971'],
['Age','55 years'],
['Gender','Female'],
['Ethnicity','Vietnamese (Kinh)'],
['Occupation','Farmer (Gia)'],
['Address','Hamlet 1 (Ap 1), Vinh Loc Commune, Hoc Mon District, Ho Chi Minh City'],
['Health Insurance No.','GD479793671770379026'],
['Phone','0931710000904 / 0966483728'],
['Hospital PID','70131126012722'],
['Admission Number','26/014363'],
['Date & Time of Admission','22 June 2026 at 07:18'],
['Admission Route','Emergency Department (Khoa Cap Cuu)'],
['Treating Department','Endocrinology & General Medicine (Noi Tiet – Tong Hop)'],
['Ward / Room / Bed','Room 8 / Bed 33'],
['Treating Physician','Dr. Cao Thi Minh'],
['Date of Medical Record','22–24 June 2026'],
]),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION II – MEDICAL INQUIRY
// ══════════════════════════════════════════════
h1('II. MEDICAL INQUIRY SECTION'),
h2('1. Reason for Hospitalization (Chief Complaint)'),
p([bold('Fatigue (Met) '), reg('— the patient presented to the Emergency Department on 22 June 2026 complaining of generalized tiredness and weakness. She was classified as a fall risk (Nguy co te nga) upon triage. Triage level: 5 (low urgency). Admitted to Endocrinology ward at 07:18.')]),
emptyLine(),
h2('2. History of Present Illness (HPI)'),
h3('Onset and Progression (as reported by patient on 23/06/2026):'),
p([bold('Polyuria (Increased urination):')]),
bullet('Frequency: 3–4 times during the day and once at night.'),
bullet('Urine output depends on fluid intake — more fluids results in more urination.'),
bullet('Urine color: DARK (notably abnormal; may suggest dehydration or concentrated urine).'),
bullet('Patient states urination feels "normal" in nature.'),
emptyLine(),
p([bold('Polydipsia (Increased thirst):')]),
bullet('Patient reports feeling persistently thirsty.'),
bullet('She drinks approximately 2 litres of water per day.'),
emptyLine(),
p([bold('Polyphagia (Increased appetite/eating):')]),
bullet('Eats 3 meals per day.'),
bullet('Diet consists predominantly of rice, fish, meat, and sweet potato.'),
bullet('She does NOT feel hungry after completing a meal — appetite is satisfied.'),
emptyLine(),
p([bold('Weight Change:')]),
bullet('Unintentional weight loss of approximately 10 kg over the past 2 years.'),
bullet('This is clinically significant and consistent with uncontrolled T2DM (glucosuria, protein catabolism).'),
emptyLine(),
p([bold('Fatigue and Weakness:')]),
bullet('Feels generally tired (fatigue).'),
bullet('Weakness noted in both arms and legs.'),
emptyLine(),
p([bold('Sweating and Shakiness:')]),
bullet('Experiences sweating and shakiness if she misses a meal or delays eating — consistent with hypoglycemic episodes related to insulin use.'),
emptyLine(),
p([bold('Lower Limb Swelling:')]),
bullet('Bilateral leg swelling from the lower half of the leg down to the toes.'),
bullet('Swelling occurs after prolonged walking/standing — positional/dependent edema; may suggest early venous insufficiency or diabetic microvascular disease.'),
emptyLine(),
p([bold('Peripheral Neuropathy Symptoms:')]),
bullet('Numbness and tingling on the plantar surface (sole) of both feet.'),
bullet('Pain in legs with prolonged walking (claudication pattern — rule out peripheral arterial disease).'),
bullet('Loss of balance on some occasions — may indicate proprioceptive deficit from peripheral neuropathy.'),
emptyLine(),
p([bold('Skin Symptoms:')]),
bullet('Intermittent itching in the arms; sometimes generalized whole-body itching.'),
bullet('Skin appears normal with mild dehydration.'),
bullet('No acanthosis nigricans noted.'),
emptyLine(),
p([bold('Negative / Absent Symptoms (Review of Systems):')]),
bullet('No blurred vision (no current diabetic retinopathy symptoms).'),
bullet('No recurrent infections.'),
bullet('Normal wound healing.'),
bullet('No nausea or vomiting.'),
bullet('No abdominal pain.'),
bullet('No gestational diabetes history.'),
bullet('No smoking or alcohol use.'),
bullet('Functional status: Normal to mildly limited in daily activities.'),
emptyLine(),
p([bold('Thyroid Disease:')]),
bullet('Known thyroid disease (hyperthyroidism) — currently being managed.'),
emptyLine(),
h2('3. Past Medical History'),
bullet('Type 2 Diabetes Mellitus (E11.9) — duration not explicitly documented; currently managed with insulin (Mixtard 30) and Metformin.'),
bullet('Ischemic Cardiomyopathy (I25.5) — pre-existing diagnosis (carried forward from prior records; no cardiac workup performed during this admission).'),
bullet('Essential Hypertension (I10) — pre-existing, on Irbesartan.'),
bullet('Hyperthyroidism / Thyrotoxicosis (E05) — pre-existing, on Thiamazole.'),
bullet('Mixed Hyperlipidemia (E78.2) — pre-existing, on Rosuvastatin.'),
emptyLine(),
h2('4. Family History'),
bullet('Sister has Diabetes Mellitus — positive first-degree family history of T2DM.'),
bullet('No other family history documented.'),
emptyLine(),
h2('5. Social History'),
bullet('Smoking: None.'),
bullet('Alcohol: None.'),
bullet('Occupation: Farmer.'),
bullet('Lives in Hoc Mon, HCMC.'),
emptyLine(),
h2('6. Medication History (Prior to Admission)'),
bullet('Insulin (Mixtard 30) — subcutaneous injection (dosing not specified prior to admission).'),
bullet('Irbesartan (antihypertensive).'),
bullet('Thiamazole (anti-thyroid).'),
bullet('Rosuvastatin (lipid-lowering).'),
bullet('Clopidogrel (antiplatelet — for ischemic cardiomyopathy).'),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION III – PHYSICAL EXAMINATION
// ══════════════════════════════════════════════
h1('III. PHYSICAL EXAMINATION'),
h2('Vital Signs on Admission (22/06/2026 at 07:18)'),
makeTable(['Parameter','Value','Reference Range','Status'],[
['Temperature','37.0 °C','36.5–37.5 °C','Normal'],
['Pulse / Heart Rate','100 bpm','60–100 bpm','Upper limit of normal (tachycardia borderline)'],
['Blood Pressure','130/60 mmHg','<130/80 mmHg','Borderline (on ARB treatment)'],
['Respiratory Rate','20 breaths/min','12–20/min','Normal'],
['SpO2','98%','>95%','Normal'],
['Weight','55 kg','–','–'],
['BMI','21.48 kg/m²','18.5–24.9','Normal weight'],
['Glasgow Coma Scale','15/15','15 = fully alert','Normal'],
]),
emptyLine(),
h2('Vital Signs Day 2 (23/06/2026 at 08:00)'),
makeTable(['Parameter','Value','Trend'],[
['Pulse','78 bpm','Improved (was 100 on admission)'],
['Blood Pressure','120/60 mmHg','Improved'],
['Temperature','37.0 °C','Stable'],
['SpO2','99%','Improved'],
['BMI','55 kg / 21.5','Stable'],
]),
emptyLine(),
h2('Systemic Examination'),
h3('General Appearance'),
bullet('Alert and oriented to time, place, and person.'),
bullet('No acute distress.'),
bullet('Skin: Normal color, mild dehydration; no jaundice, no cyanosis, no acanthosis nigricans.'),
bullet('Mild generalized itching reported.'),
h3('Musculoskeletal / Diabetic Hand Examination'),
makeTable(['Test','Finding','Interpretation'],[
["Prayer's Sign (Limited Joint Mobility test)",'Normal (hands can be fully apposed)','No limited joint mobility syndrome'],
['Shoulder Range of Motion','Normal (full ROM bilaterally)','No diabetic periarthritis/frozen shoulder'],
['Tabletop Sign (Dupuytren\'s test)','Normal (hand lies flat)','No Dupuytren\'s contracture'],
['Dupuytren\'s Contracture','Negative','No palmar fibromatosis'],
["Charcot's Foot",'Absent','No neuropathic osteoarthropathy'],
]),
h3('Cardiovascular'),
bullet('Heart sounds regular, no murmurs documented.'),
bullet('Lower limb bilateral pitting edema from mid-leg to toes — worsened by prolonged walking (dependent edema).'),
bullet('No JVP elevation noted.'),
h3('Respiratory'),
bullet('Normal vesicular breath sounds bilaterally.'),
bullet('No cough, no accessory muscle use.'),
bullet('No oxygen required.'),
h3('Abdomen'),
bullet('Soft, non-tender, no organomegaly.'),
bullet('Normal bowel sounds.'),
h3('Neurological (Lower Limbs — Peripheral Neuropathy)'),
bullet('Bilateral numbness and tingling: plantar surface of both feet.'),
bullet('Pain in legs on prolonged walking (rule out peripheral arterial disease vs. painful neuropathy).'),
bullet('Loss of balance on some occasions — proprioceptive deficit suspected.'),
bullet('GCS 15/15. Cranial nerves intact.'),
h3('Thyroid'),
bullet('Patient has known thyroid disease. Thyroid gland examination findings not separately documented in these records.'),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION IV – INVESTIGATIONS
// ══════════════════════════════════════════════
h1('IV. INVESTIGATIONS'),
h2('A. Glycemic Markers'),
makeTable(['Test','Result','Reference Range','Interpretation'],[
['HbA1c','12.6%','< 5.7% (normal)\n< 7.0% (T2DM target)','SEVERELY ELEVATED — indicates 3-month average blood glucose ~300 mg/dL'],
['Fasting Plasma Glucose (DMMM)','251 mg/dL (13.9 mmol/L)','70–100 mg/dL fasting','SEVERELY ELEVATED — overt hyperglycemia'],
['Capillary Glucose (23/06 at 06:00)','211 mg/dL (11.7 mmol/L)','80–130 mg/dL (pre-meal target)','ELEVATED — above ADA 2026 target'],
['Urine Glucose','111 µmol/L (dipstick)','< 34 µmol/L','ELEVATED — glucosuria (confirms hyperglycemia spilling into urine)'],
]),
emptyLine(),
h2('B. Complete Blood Count (22/06/2026)'),
makeTable(['Test','Result','Reference','Interpretation'],[
['WBC','9.69 K/µL','4.4–10.8','Normal'],
['Neutrophils%','27.80%','20.0–42.2','Normal'],
['Lymphocytes%','63.00%','49.0–72.0','Normal'],
['RBC','4.74 M/µL','3.8–5.4','Normal'],
['Hemoglobin','14.20 g/dL','12.0–14.5','Normal'],
['Hematocrit','43.60%','35–48','Normal'],
['MCV','92.00 fL','80–97','Normal'],
['MCHC','32.70 g/dL','31.8–35.4','Normal'],
['Platelets','212 K/µL','150–450','Normal'],
]),
p([italic('Conclusion: Normal CBC. No anemia, no leukocytosis, no thrombocytopenia.')]),
emptyLine(),
h2('C. Biochemistry (22/06/2026)'),
makeTable(['Test','Result','Reference','Interpretation'],[
['Creatinine (blood)','61 µmol/L','45–84','Normal'],
['eGFR','94 mL/min/1.73m²','>90','Normal — CKD G1 (no CKD)'],
['Sodium (Na+)','135 mmol/L','135–145','Normal'],
['Potassium (K+)','4.0 mmol/L','3.5–5.1','Normal'],
['Chloride (Cl-)','102 mmol/L','98–108','Normal'],
['AST (GOT)','10 U/L','< 35','Normal'],
['ALT (GPT)','4 U/L','< 35','Normal'],
]),
p([italic('Conclusion: Normal renal function. Normal electrolytes. Normal liver enzymes. No hepatotoxicity.')]),
emptyLine(),
h2('D. Thyroid Function (22/06/2026)'),
makeTable(['Test','Result','Reference Range','Interpretation'],[
['TSH (Thyroid Stimulating Hormone)','0.0027 µIU/mL','0.35–4.94 µIU/mL','CRITICALLY SUPPRESSED (~130× below lower limit)'],
['Free T4 (FT4)','1.02 ng/dL','0.70–1.48 ng/dL','Normal (mid-range)'],
]),
p([bold('Clinical Significance: '), reg('Suppressed TSH + Normal FT4 = SUBCLINICAL HYPERTHYROIDISM. The pituitary detects excess thyroid hormone and shuts down TSH. FT3 was not measured and may be elevated (T3-toxicosis pattern). Subclinical hyperthyroidism worsens diabetes control (increases insulin resistance and hepatic glucose output) and increases atrial fibrillation risk — particularly relevant given her ischemic cardiomyopathy.')]),
emptyLine(),
h2('E. Urinalysis (22/06/2026 — Automated)'),
makeTable(['Test','Result','Reference','Interpretation'],[
['Glucose (urine)','111 µmol/L','< 34','ELEVATED — glucosuria (hyperglycemia spillover)'],
['Protein (dipstick)','Negative','Negative','No proteinuria (no diabetic nephropathy at this stage)'],
['Ketones','Negative','Negative','No diabetic ketoacidosis'],
['Bilirubin','Negative','Negative','Normal'],
['Blood','Negative','Negative','Normal'],
['Specific Gravity','1.032','1.003–1.040','Normal'],
['Leukocytes','Negative','Negative','No urinary tract infection'],
['RBC (urine)','Negative','Negative','Normal'],
]),
p([italic('Note: Urine protein negative on dipstick. However, ADA 2026 recommends annual urine albumin-to-creatinine ratio (ACR) to detect microalbuminuria — NOT done this admission. Should be ordered at follow-up.')]),
emptyLine(),
h2('F. Abdominal Ultrasound (22/06/2026 at 14:16)'),
p([italic('Performed by Dr. Tran Huu Hang. Reported by Dr. Nguyen Thi Nhu Niem.')]),
makeTable(['Organ / Structure','Finding'],[
['Liver','Normal size, smooth surface, homogeneous echogenicity — no focal lesions'],
['Gallbladder (Right)','No stones, not dilated, normal wall thickness'],
['Gallbladder (Left)','No stones'],
['Bile ducts','Wall 3 mm, normal caliber, no stones'],
['Pancreas','Normal echogenicity and size'],
['Spleen','Normal'],
['Urinary Bladder','No stones, no free fluid'],
['Uterus','Small / atrophied — consistent with post-menopausal status'],
]),
p([bold('Conclusion: '), reg('No acute or abnormal abdominal findings.')]),
emptyLine(),
h2('G. Pending / Recommended Tests Not Yet Done'),
bullet('HbA1c — NOT measured during this admission (values sourced from clinical record supplement).'),
bullet('Lipid Panel (Total Cholesterol, LDL, HDL, Triglycerides) — NOT done; needed for E78.2 management.'),
bullet('Urine Albumin-to-Creatinine Ratio (ACR) — NOT done; needed for diabetic nephropathy screening.'),
bullet('ECG — NOT documented in available records; needed given ischemic cardiomyopathy history.'),
bullet('HbA1c recheck in 3 months to assess response to treatment.'),
bullet('FT3 (Free Triiodothyronine) — NOT done; would clarify if T3-toxicosis is contributing to TSH suppression.'),
bullet('Diabetic retinopathy screening (fundoscopy) — NOT documented.'),
bullet('Peripheral arterial disease screening (ABI — Ankle-Brachial Index) — given leg pain on walking.'),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION V – DIAGNOSES
// ══════════════════════════════════════════════
h1('V. DIAGNOSES'),
h2('Primary Diagnosis'),
makeTable(['ICD-10','Diagnosis','Basis'],[
['E11.9','Type 2 Diabetes Mellitus, without complications\n(Insulin-requiring, poorly controlled)','HbA1c 12.6%, FPG 251 mg/dL, glucosuria, classic symptoms (polyuria, polydipsia, weight loss), family history, insulin on admission'],
]),
emptyLine(),
h2('Secondary / Comorbid Diagnoses'),
makeTable(['ICD-10','Diagnosis','Basis'],[
['E05','Hyperthyroidism / Subclinical Thyrotoxicosis','TSH 0.0027 µIU/mL (critically suppressed), FT4 1.02 ng/dL (normal) — confirmed by this admission labs'],
['I10','Essential Hypertension','Pre-existing diagnosis; BP 130/60 on Irbesartan; listed on admission ICD codes'],
['I25.5','Ischemic Cardiomyopathy','Pre-existing diagnosis carried forward; no cardiac workup performed this admission (no ECG/echo/troponins in available records)'],
['E78.2','Mixed Hyperlipidemia','Pre-existing diagnosis; no lipid panel done this admission; on Rosuvastatin'],
['G63.2 / E11.4','Diabetic Peripheral Neuropathy (probable)','Bilateral plantar numbness/tingling, leg pain on walking, loss of balance — clinical features strongly suggest diabetic sensorimotor neuropathy'],
]),
emptyLine(),
h2('Differential Diagnoses (for Chief Complaint: Fatigue)'),
makeTable(['Differential','For','Against'],[
['Hypoglycemic episode','Shakiness/sweating when meals are missed; on insulin','Glucose was 211 mg/dL on arrival — not low; no documented episode'],
['Uncontrolled hyperglycemia causing fatigue','HbA1c 12.6%, FPG 251 mg/dL, symptoms of polyuria/polydipsia','Consistent and most likely'],
['Hyperthyroidism-related fatigue','TSH suppressed; thyrotoxicosis can cause muscle weakness and fatigue','FT4 still normal; subclinical stage'],
['Anemia','Fatigue is classical presentation','HGB 14.2 g/dL — NORMAL; anemia excluded'],
['Renal failure','Can cause fatigue and leg edema','eGFR 94 — NORMAL; renal failure excluded'],
['Depression / Psychosocial','Common co-morbidity in diabetics','Not assessed in these records'],
]),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION VI – PROBLEM STATEMENT
// ══════════════════════════════════════════════
h1('VI. PROBLEM STATEMENT'),
bullet('Type 2 Diabetes Mellitus — severely uncontrolled (HbA1c 12.6%, FPG 251 mg/dL). Requires urgent intensification of therapy.'),
bullet('Subclinical Hyperthyroidism — TSH suppressed; actively being treated with Thiamazole; contributes to poor glycemic control.'),
bullet('Probable Diabetic Peripheral Neuropathy — bilateral plantar numbness, tingling, leg pain, balance disturbance; not yet formally assessed with monofilament/nerve conduction.'),
bullet('Hypertension — pre-existing, partially controlled; on Irbesartan (ARB).'),
bullet('Ischemic Cardiomyopathy — pre-existing; on Clopidogrel; no current cardiac events documented.'),
bullet('Mixed Hyperlipidemia — pre-existing; on Rosuvastatin; no lipid panel to confirm target attainment.'),
bullet('Dependent Lower Limb Edema — bilateral, positional; likely multifactorial (venous insufficiency ± early microvascular disease).'),
bullet('Generalized pruritis (itching) — may be related to uncontrolled diabetes (hyperglycemia-related dry skin/neuropathic itch) or dehydration.'),
bullet('Significant unintentional weight loss (10 kg over 2 years) — in context of poorly controlled T2DM (caloric loss via glucosuria).'),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION VII – IN-HOSPITAL TREATMENT
// ══════════════════════════════════════════════
h1('VII. IN-HOSPITAL TREATMENT (22–24 June 2026)'),
h2('A. Pharmacological Treatment'),
makeTable(['#','Medication','Class','Dose & Timing','Indication'],[
['1','Ringer Lactate 500 mL (with CaCl2, KCl, NaCl, Na-Lactate)','IV Crystalloid Fluid','1 bag IV drip (23/06)','Hydration / electrolyte support'],
['2','Mixtard 30 — Insulin Human rDNA 700 IU/10 mL (70% isophane NPH + 30% soluble)','Premixed Insulin 70/30','14 IU SC injection, once daily, Morning 09:00','T2DM glycemic control (basal+prandial coverage)'],
['3','Glucophage XR 750 mg (Metformin hydrochloride extended-release)','Biguanide — oral antidiabetic (first-line)','1 tablet orally, once daily at Noon (11:00) — started 23/06','T2DM — first-line oral agent; reduces hepatic glucose output'],
['4','Thyrozol 5 mg (Thiamazole / Methimazole)','Anti-thyroid agent','2 tablets orally, once daily, Morning 09:00','Hyperthyroidism (E05) — blocks thyroid hormone synthesis'],
['5','Irbesartan 150 mg','ARB — Angiotensin Receptor Blocker','1 tablet orally, once daily, Morning 09:00','Hypertension + renoprotection in T2DM'],
['6','Clopalvix 75 mg (Clopidogrel bisulfate 97.86 mg)','Antiplatelet — P2Y12 inhibitor','1 tablet orally, once daily, Morning 09:00','Ischemic cardiomyopathy — secondary ASCVD prevention'],
['7','Sterolow 20 mg (Rosuvastatin)','Statin — HMG-CoA reductase inhibitor','1 tablet orally, once daily, Evening 18:00','Mixed hyperlipidemia + ASCVD risk reduction'],
]),
emptyLine(),
h2('B. Monitoring Orders'),
bullet('Blood pressure, pulse, temperature — continuous during admission.'),
bullet('Capillary blood glucose (POCT) — fasting morning, once daily.'),
bullet('Laboratory: Electrolytes (Na, K, Cl), FT4, TSH, AST, ALT, CBC — once.'),
bullet('Urine output: color and frequency documented by nursing.'),
emptyLine(),
h2('C. Diet Prescription'),
bullet('DD01-Com: Diabetic diet — cooked rice/meals, calorie-controlled, low simple sugars, high fiber.'),
bullet('3 structured meals per day. Small frequent meals encouraged to prevent hypoglycemia on insulin.'),
emptyLine(),
h2('D. Nursing Care Level'),
bullet('Grade III (Cap 3) — standard nursing care with monitoring every 12 hours.'),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION VIII – ADA 2026 MANAGEMENT GUIDELINES
// ══════════════════════════════════════════════
h1('VIII. MANAGEMENT ACCORDING TO ADA STANDARDS OF CARE IN DIABETES 2026'),
p([italic('Reference: ADA. Diabetes Care. 2026 Jan 1;49(Supplement_1). Sections 6 [PMID: 41358894] & 9 [PMID: 41358900]')]),
emptyLine(),
h2('A. Glycemic Goals (ADA 2026 — Section 6)'),
makeTable(['Target','ADA 2026 Goal','This Patient\'s Current Status'],[
['HbA1c','< 7.0% for most adults','12.6% — FAR ABOVE TARGET. Requires urgent intensification.'],
['Fasting / Pre-meal Glucose','80–130 mg/dL (4.4–7.2 mmol/L)','211–251 mg/dL — WELL ABOVE TARGET'],
['Post-meal Glucose (2h)','< 180 mg/dL (< 10.0 mmol/L)','Not measured'],
['Time in Range (CGM, 70–180)','> 70% of time','Not monitored — CGM should be initiated'],
['Time Below Range (< 70 mg/dL)','< 4%','Episodic hypoglycemia suspected (shakiness when meals missed)'],
]),
emptyLine(),
h2('B. Pharmacological Management Algorithm (ADA 2026 — Section 9)'),
h3('Step 1: Assess Complications and Comorbidities'),
p([reg('This patient has '), bold('established ASCVD (Ischemic Cardiomyopathy I25.5)'), reg('. This triggers the left branch of the ADA 2026 treatment algorithm — complication-focused care.')]),
emptyLine(),
h3('Step 2: First-Line Agent — Metformin'),
p([bold('ADA 2026 Recommendation 9.1: '), reg('Metformin is recommended as first-line pharmacotherapy for T2DM if tolerated and not contraindicated. (Evidence Grade: A)')]),
bullet('This patient: eGFR 94 — SAFE to use Metformin. Glucophage XR 750 mg prescribed. ✓'),
bullet('Target dose: 1500–2000 mg/day. Current dose (750 mg) should be titrated up over 4–8 weeks as tolerated.'),
bullet('Benefit: Reduces hepatic glucose production; weight-neutral; cardioprotective in T2DM.'),
emptyLine(),
h3('Step 3: Add GLP-1 RA or SGLT2 Inhibitor for Established ASCVD'),
p([bold('ADA 2026 Recommendation 9.5a: '), reg('In adults with T2DM and established ASCVD, a GLP-1 RA with demonstrated CV benefit (semaglutide, liraglutide) OR an SGLT2 inhibitor (empagliflozin, dapagliflozin) should be added regardless of HbA1c level. (Evidence Grade: A — HIGHEST LEVEL)')]),
emptyLine(),
makeTable(['Agent Class','Examples','CV Benefit Proven','Relevant Trial','Notes'],[
['GLP-1 RA (preferred in ASCVD)','Semaglutide (Ozempic/Rybelsus)\nLiraglutide (Victoza)','Yes — MACE reduction ~14–26%','LEADER, SUSTAIN-6','Also promotes weight loss; preferred if obesity present; reduces appetite'],
['SGLT2 Inhibitor','Empagliflozin (Jardiance)\nDapagliflozin (Farxiga)','Yes — HF + renal protection','EMPA-REG, DAPA-HF','Preferred if HF or CKD; causes glucosuria (caution in UTI)'],
['GIP/GLP-1 Dual Agonist','Tirzepatide (Mounjaro)','Emerging CV data','SURPASS trials','Greatest weight reduction; newly added to ADA 2026 algorithm'],
]),
p([bold('RECOMMENDATION FOR THIS PATIENT: '), reg('A GLP-1 RA (e.g., oral semaglutide) OR SGLT2 inhibitor (e.g., empagliflozin) should be strongly considered at the earliest opportunity, given established ischemic cardiomyopathy. This is a Class A recommendation — currently NOT prescribed and represents a treatment gap.')]),
emptyLine(),
h3('Step 4: Insulin Therapy'),
p([bold('ADA 2026 Recommendation 9.20: '), reg('Insulin should be initiated in T2DM if symptoms of hyperglycemia are present OR if HbA1c > 10% OR blood glucose ≥ 300 mg/dL. (Evidence Grade: E)')]),
bullet('This patient meets MULTIPLE criteria: HbA1c 12.6% (> 10%), FPG 251 mg/dL, symptoms of hyperglycemia (polyuria, polydipsia, weight loss, fatigue).'),
bullet('Mixtard 30 Insulin (14 IU SC morning) is appropriately prescribed. ✓'),
bullet('Current 14 IU/day is a low-moderate starting dose (0.25 units/kg). Requires titration upward by 2 IU every 3 days until fasting glucose 80–130 mg/dL.'),
bullet('NOTE: ADA 2026 Recommendation 9.21 states GLP-1 RA is PREFERRED over insulin in T2DM without hyperglycemic crisis — however, with HbA1c 12.6%, insulin initiation is appropriate here.'),
bullet('ADA 2026 Recommendation 9.22: If insulin is used, COMBINE with GLP-1 RA or GIP/GLP-1 dual agonist for better glycemic control + weight benefit + reduced hypoglycemia.'),
emptyLine(),
h3('Step 5: Titration & Monitoring'),
makeTable(['Medication','Current Dose','ADA 2026 Target Dose','Action Required'],[
['Metformin XR','750 mg/day','1500–2000 mg/day','Titrate up over 4–8 weeks'],
['Mixtard 30 Insulin','14 IU/day SC','Titrate to FPG 80–130 mg/dL','Increase by 2 IU every 3 days if fasting glucose > 130'],
['GLP-1 RA (not yet started)','Not prescribed','Add per ADA 2026 Class A for ASCVD','STRONGLY RECOMMENDED — discuss with team/cardiologist'],
['Irbesartan','150 mg/day','BP target < 130/80 mmHg','Adequate — monitor BP; titrate if needed'],
['Rosuvastatin','20 mg/day','LDL < 70 mg/dL (ASCVD target)','Check lipid panel — no result available yet'],
['Clopidogrel','75 mg/day','Ongoing antiplatelet for ASCVD','Appropriate — continue'],
['Thiamazole','10 mg/day (2 × 5 mg)','Restore TSH to 0.35–4.94','Recheck TSH/FT4 in 4–6 weeks; dose adjust accordingly'],
]),
emptyLine(),
h2('C. Non-Pharmacological Management (ADA 2026)'),
h3('1. Medical Nutrition Therapy (MNT)'),
p([bold('ADA 2026 Recommendation: '), reg('Individualized meal planning by a registered dietitian. Focus on:')]),
bullet('Reduce simple carbohydrates and sugary drinks.'),
bullet('Choose low glycemic index foods (replace white rice with brown rice, sweet potato portion-controlled).'),
bullet('Increase dietary fiber (vegetables, legumes, whole grains).'),
bullet('Consistent carbohydrate intake at each meal (important with premixed insulin — Mixtard 30 timing depends on food).'),
bullet('Reduce sodium intake for blood pressure control.'),
bullet('Target caloric balance to maintain healthy BMI (21.5 — already normal).'),
p([italic('Current hospital diet: DD01-Com (Diabetic diet). This patient eats rice, fish, meat, sweet potato — reasonable but carbohydrate portions need structuring.')]),
emptyLine(),
h3('2. Physical Activity'),
p([bold('ADA 2026 Recommendation: ')]),
bullet('Target: ≥150 minutes/week of moderate-intensity aerobic exercise (brisk walking, cycling, swimming).'),
bullet('Add resistance training 2–3 times/week.'),
bullet('Break prolonged sitting every 30 minutes with light movement.'),
bullet('CAUTION for this patient: She has leg pain on walking, edema, and balance disturbance — a supervised physiotherapy assessment is recommended before initiating exercise.'),
bullet('Start with gentle chair exercises, pool walking, or light ambulation within pain tolerance.'),
bullet('Avoid barefoot walking given neuropathy (risk of unnoticed foot injury).'),
emptyLine(),
h3('3. Diabetes Self-Management Education & Support (DSMES)'),
p([bold('ADA 2026: '), reg('DSMES is recommended at diagnosis, annually, and at transitions of care. Topics include:')]),
bullet('SMBG (Self-Monitoring of Blood Glucose) — how to check capillary glucose and record results.'),
bullet('Insulin injection technique — correct site rotation, storage, dosing.'),
bullet('Recognizing and treating hypoglycemia — carry fast-acting glucose (dextrose tablet/juice) at all times given shakiness/sweating episodes.'),
bullet('Foot care — daily inspection of feet, nail care, appropriate footwear (wide-toed, cushioned shoes), no walking barefoot.'),
bullet('Medication adherence — importance of taking all prescribed medications consistently.'),
bullet('Sick day rules — monitor glucose more frequently during illness; never skip insulin when sick.'),
emptyLine(),
h3('4. Weight Management'),
bullet('Current BMI 21.5 — normal weight; weight loss should NOT be a primary target.'),
bullet('Address the 10 kg unintentional weight loss over 2 years — this should resolve with improved glycemic control (less caloric loss from glucosuria).'),
emptyLine(),
h3('5. Monitoring Schedule (ADA 2026)'),
makeTable(['Test','Frequency','Rationale'],[
['HbA1c','Every 3 months until at goal; every 6 months once stable','Primary measure of glycemic control'],
['SMBG / CGM','Daily (fasting + 2h post-meal) — CGM preferred','ADA 2026 now recommends CGM at diagnosis for insulin users'],
['Urine ACR (albumin:creatinine ratio)','Annually','Screen for diabetic nephropathy (microalbuminuria)'],
['Creatinine + eGFR','Annually','Renal function monitoring'],
['Lipid Panel','Annually','LDL target < 70 mg/dL for ASCVD'],
['TSH + FT4','Every 3–6 months while on Thiamazole','Titrate anti-thyroid therapy'],
['Liver enzymes (on statin)','At baseline, then as clinically indicated','Monitor for statin-induced hepatotoxicity'],
['Blood Pressure','Every visit','Target < 130/80 mmHg'],
['Foot Examination','Every visit','Assess neuropathy: monofilament, vibration, reflexes, ABI'],
['Eye Exam (Fundoscopy)','Annually','Diabetic retinopathy screening — not yet done'],
['Dental Exam','Twice yearly','Diabetic periodontitis'],
]),
emptyLine(),
h3('6. Peripheral Neuropathy Assessment & Foot Care (ADA 2026)'),
p([bold('ADA 2026: '), reg('Comprehensive foot exam annually (or more frequently with symptoms). Includes:')]),
bullet('10-g monofilament test (protective sensation).'),
bullet('128-Hz tuning fork (vibration perception — early neuropathy).'),
bullet('Ankle reflex testing.'),
bullet('Ankle-Brachial Index (ABI) for peripheral arterial disease.'),
p([bold('This patient: '), reg('Bilateral plantar numbness and tingling + pain on walking + balance loss strongly suggest diabetic sensorimotor peripheral neuropathy. Formal neurological examination and nerve conduction study should be arranged.')]),
bullet('Refer to podiatry for foot care education.'),
bullet('Prescription footwear if neuropathy confirmed.'),
bullet('Treat neuropathic pain if present: Pregabalin or Duloxetine (ADA 2026 first-line for diabetic neuropathic pain).'),
emptyLine(),
h3('7. Psychosocial Care'),
bullet('Screen for diabetes distress, depression, and anxiety (PHQ-9 and diabetes distress scale).'),
bullet('Chronic disease education and psychological support.'),
emptyLine(),
h3('8. Cardiovascular Risk Reduction'),
bullet('BP target < 130/80 mmHg — Irbesartan (ARB) appropriate. ✓'),
bullet('LDL target < 70 mg/dL — Rosuvastatin 20 mg prescribed; check lipid panel to confirm target met.'),
bullet('Antiplatelet (Clopidogrel 75 mg) — appropriate for secondary prevention in ASCVD. ✓'),
bullet('Add GLP-1 RA (semaglutide) or SGLT2 inhibitor — Class A ADA 2026 recommendation for T2DM + ASCVD (currently not prescribed).'),
bullet('Cardiology referral recommended to formally evaluate ischemic cardiomyopathy (echo, ECG, stress test).'),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION IX – CLINICAL PROGRESS NOTES
// ══════════════════════════════════════════════
h1('IX. CLINICAL PROGRESS NOTES'),
makeTable(['Date / Time','Progress'],[
['22/06/2026 07:18','Admitted via ED with fatigue. Triage Level 5. Alert, GCS 15. HR 100, BP 130/60, RR 20, SpO2 98%, Temp 37, BMI 21.5. IV fluids, Mixtard 30 14 IU SC, Thiamazole 10 mg, Irbesartan 150 mg, Clopidogrel 75 mg started. Labs sent.'],
['22/06/2026 13:22','Lab results received: TSH 0.0027 (suppressed), FT4 1.02 (normal). Urine — glucosuria, no proteinuria. CBC, electrolytes, renal function, LFTs all normal.'],
['22/06/2026 14:16','Abdominal ultrasound — no acute findings. Uterus atrophied (post-menopausal).'],
['23/06/2026 06:00','Fasting capillary glucose: 211 mg/dL. Still significantly above target (80–130 mg/dL).'],
['23/06/2026 08:00','Patient stable. HR improved to 78. BP 120/60. Alert. Metformin XR 750 mg added. Rosuvastatin 20 mg added. Nursing education provided (diet, medication, exercise, foot care, hypoglycemia recognition).'],
['23/06/2026 08:15','Low fall risk (score 23). Good appetite. Lungs clear. Bowel normal. Edema bilateral lower limbs present. Neuropathy symptoms ongoing.'],
['23/06/2026 22:00','Stable overnight. BP 120/80. Alert. Good sleep. No adverse events.'],
['24/06/2026','All medications continued. Ongoing monitoring. Planning discharge/follow-up arrangements.'],
]),
emptyLine(),
// ══════════════════════════════════════════════
// SECTION X – PRIORITY ACTIONS SUMMARY
// ══════════════════════════════════════════════
h1('X. PRIORITY ACTIONS & FOLLOW-UP PLAN'),
makeTable(['Priority','Action','Timeline'],[
['URGENT','Titrate Mixtard 30 insulin: increase by 2 IU every 3 days until fasting glucose 80–130 mg/dL','Immediate (in-hospital)'],
['URGENT','Titrate Metformin from 750 mg to 1500–2000 mg/day (in divided doses, with meals)','Over 4–8 weeks after discharge'],
['HIGH','Add GLP-1 RA (e.g., semaglutide) or SGLT2 inhibitor (e.g., empagliflozin) — ADA 2026 Class A for ASCVD','At next cardiology/endocrinology review'],
['HIGH','Check Urine Albumin-to-Creatinine Ratio (ACR) — diabetic nephropathy screening','Next outpatient visit'],
['HIGH','Check Lipid Panel (LDL, HDL, TC, TG) — confirm LDL < 70 mg/dL on Rosuvastatin','Next outpatient visit'],
['HIGH','Peripheral neuropathy formal assessment: 10-g monofilament, tuning fork, ABI','Next outpatient visit / neurology referral'],
['MODERATE','Cardiology referral — ECG, echocardiogram, confirm ischemic cardiomyopathy status','Within 4 weeks'],
['MODERATE','Recheck TSH + FT4 in 4–6 weeks on Thiamazole — adjust dose to restore euthyroidism','4–6 weeks after discharge'],
['MODERATE','Ophthalmology referral — diabetic retinopathy screening (fundoscopy)','Within 3 months'],
['MODERATE','HbA1c recheck — assess 3-month treatment response','3 months after discharge'],
['ROUTINE','Diabetic foot care education and podiatry referral','At discharge/next visit'],
['ROUTINE','Initiate CGM (Continuous Glucose Monitoring) — ADA 2026 recommends at diagnosis for insulin users','Discuss at discharge'],
]),
emptyLine(),
// ══════════════════════════════════════════════
// REFERENCES
// ══════════════════════════════════════════════
h1('REFERENCES'),
p([bold('1. '), reg('American Diabetes Association Professional Practice Committee. Section 9: Pharmacologic Approaches to Glycemic Treatment. Standards of Care in Diabetes—2026. Diabetes Care. 2026 Jan;49(Suppl 1):S183–S215. PMID: 41358900.')]),
p([bold('2. '), reg('American Diabetes Association Professional Practice Committee. Section 6: Glycemic Goals, Hypoglycemia, and Hyperglycemic Crises. Standards of Care in Diabetes—2026. Diabetes Care. 2026 Jan;49(Suppl 1):S132–S149. PMID: 41358894.')]),
p([bold('3. '), reg('Samson SL, et al. AACE Consensus Statement: Algorithm for Management of Adults with Type 2 Diabetes – 2026 Update. Endocr Pract. 2026 Apr. PMID: 41842862.')]),
emptyLine(),
p([italic('Medical record compiled by: Gokhulnath Akash Babu Sathaiah and team'), ]),
p([italic('Based on clinical records from Trung Vuong Hospital, HCMC, dated 22–24 June 2026.')]),
],
}],
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/chau-bich-diep-record/Chau_Thi_Bich_Diep_Medical_Record.docx', buffer);
console.log('SUCCESS');
}).catch(err => {
console.error('ERROR:', err.message);
process.exit(1);
});