~/kursk-diary/generate.js
"use strict";
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, HeadingLevel, BorderStyle, WidthType, VerticalAlign,
PageBreak, ShadingType
} = require("docx");
const fs = require("fs");
// ---- helpers ----
function cell(text, opts = {}) {
const { bold = false, shade = false, width = null, vAlign = VerticalAlign.TOP } = opts;
const cellOpts = {
verticalAlign: vAlign,
shading: shade ? { type: ShadingType.CLEAR, fill: "D9E1F2" } : undefined,
children: [
new Paragraph({
spacing: { before: 40, after: 40 },
children: [new TextRun({ text: String(text), bold, size: 20, font: "Times New Roman" })]
})
]
};
if (width) cellOpts.width = { size: width, type: WidthType.DXA };
return new TableCell(cellOpts);
}
function headerCell(text) {
return new TableCell({
verticalAlign: VerticalAlign.CENTER,
shading: { type: ShadingType.CLEAR, fill: "1F497D" },
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, bold: true, size: 22, font: "Times New Roman", color: "FFFFFF" })]
})
]
});
}
function thinBorderTable(rows) {
const thin = { style: BorderStyle.SINGLE, size: 4, color: "999999" };
return new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: { top: thin, bottom: thin, left: thin, right: thin, insideH: thin, insideV: thin },
rows
});
}
function heading(text, level = HeadingLevel.HEADING_2) {
return new Paragraph({
heading: level,
spacing: { before: 200, after: 100 },
children: [new TextRun({ text, bold: true, size: level === HeadingLevel.HEADING_1 ? 32 : 26, font: "Times New Roman" })]
});
}
function para(text, opts = {}) {
const { bold = false, center = false, size = 22 } = opts;
return new Paragraph({
alignment: center ? AlignmentType.CENTER : AlignmentType.LEFT,
spacing: { before: 60, after: 60 },
children: [new TextRun({ text, bold, size, font: "Times New Roman" })]
});
}
function signatureRow() {
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.NONE }, insideV: { style: BorderStyle.NONE }
},
rows: [
new TableRow({
children: [
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [para("Student's signature: ________________")]
}),
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [para("Signature of clinical base supervisor: ________________")]
})
]
})
]
});
}
// ---- patient data ----
const patients = [
{
date: "29.06.2026", day: "DAY 1",
name: "Petrov Ivan Sergeyevich", age: "58", sex: "Male",
dx: "Acute myocardial infarction (ST-elevation, anterior wall)",
rows: [
["Safety instructions reviewed. Familiarization with the structure of the emergency admission unit (ambulance station).", "1"],
["Clinical examination: complaints of crushing retrosternal pain radiating to the left arm for 2 hours, cold sweat, nausea. BP 100/70 mmHg, HR 98/min, SpO2 94%. Skin pale and moist. Completion of medical history and inpatient card. Coordination of diagnosis, examination plan, and treatment plan with the attending physician.", "1"],
["Interpretation of additional examination data: ECG - ST elevation in leads V1-V4, reciprocal depression in II, III, aVF. Troponin I 2.8 ng/mL (elevated). CBC and metabolic panel reviewed.", "1"],
["Participation in emergency management: IV access, O2 4 L/min, aspirin 300 mg PO, clopidogrel 600 mg PO, heparin 5000 IU IV bolus. Patient prepared for urgent PCI transfer.", "1"],
["Ward rounds with the head of department for supervised patients.", "1"]
]
},
{
date: "29.06.2026", day: "",
name: "Sorokina Marina Alexandrovna", age: "42", sex: "Female",
dx: "Hypertensive crisis, uncomplicated",
rows: [
["Clinical examination: severe headache, visual 'flashes,' palpitations. BP 210/120 mmHg bilaterally, HR 90/min, no neurological deficit. Completion of medical history.", "1"],
["Interpretation of ECG: sinus tachycardia, LVH signs (Sokolov-Lyon criterion positive).", "1"],
["Participation in emergency management: captopril 25 mg sublingual, amlodipine 10 mg PO. BP re-checked at 30 min - 170/100 mmHg. Antihypertensive therapy adjustment discussed with attending physician.", "1"],
["Participation in clinical case review with head of department: differential diagnosis between uncomplicated hypertensive crisis and hypertensive urgency with end-organ damage.", "1"]
]
},
{
date: "30.06.2026", day: "DAY 2",
name: "Zhukova Olga Petrovna", age: "67", sex: "Female",
dx: "Acute ischaemic stroke (left middle cerebral artery territory)",
rows: [
["Clinical examination: sudden onset of right-sided weakness and speech impairment 90 min ago. NIHSS score 12 points. BP 180/100 mmHg, HR 82/min, GCS 14. Completion of medical history and inpatient documentation. Coordination of diagnosis and management with neurologist on duty.", "1"],
["Interpretation of additional data: CT brain - no haemorrhage; hyperdense MCA sign. CBC, coagulation screen, glucose reviewed (glucose 6.8 mmol/L).", "1"],
["Participation in emergency management: IV thrombolysis with alteplase (0.9 mg/kg) initiated under neurologist supervision; loading dose IV, remainder over 60 min infusion. Continuous monitoring of BP, HR, neurological status.", "1"],
["Ward rounds. Participation in clinical case review: indications and contraindications for IV thrombolysis.", "2"]
]
},
{
date: "30.06.2026", day: "",
name: "Frolov Dmitry Nikolayevich", age: "34", sex: "Male",
dx: "Anaphylactic shock (insect sting)",
rows: [
["Clinical examination: generalised urticaria, angioedema of lips and tongue, stridor, BP 70/40 mmHg, HR 130/min, SpO2 88% following bee sting. Rapid assessment completed.", "1"],
["Participation in emergency management: epinephrine 0.5 mg IM (mid-outer thigh), O2 10 L/min non-rebreather, IV access x2 with 0.9% NaCl 1000 mL, chloropyramine 20 mg IV, dexamethasone 8 mg IV. BP 100/70, SpO2 96% at 20 min.", "1"],
["Interpretation of additional data: SpO2 trend, ECG (sinus tachycardia resolving), blood glucose.", "1"],
["Participation in clinical case review: pathophysiology of anaphylaxis, epinephrine auto-injector prescription.", "1"]
]
},
{
date: "01.07.2026", day: "DAY 3",
name: "Kuznetsova Tatyana Ivanovna", age: "72", sex: "Female",
dx: "Acute exacerbation of COPD, severe",
rows: [
["Safety instructions reviewed (second scheduled review). Familiarization with emergency respiratory care trolley and non-invasive ventilator settings.", "1"],
["Clinical examination: progressive dyspnoea over 3 days, increased purulent sputum, inability to complete sentences. SpO2 82%, RR 28/min, HR 102/min, prolonged expiration, diffuse wheezes, barrel chest. Completion of medical history.", "1"],
["Interpretation of ABG: pH 7.31, PaCO2 58 mmHg, PaO2 52 mmHg - type II respiratory failure. CXR: hyperinflation, no consolidation. Sputum culture sent.", "1"],
["Participation in management: controlled O2 via Venturi mask 28%, salbutamol 2.5 mg + ipratropium 500 mcg nebulisation, prednisolone 40 mg IV, amoxicillin-clavulanate 1.2 g IV. NIV (BiPAP) initiated under supervision.", "1"],
["Ward rounds with the head of department.", "1"]
]
},
{
date: "01.07.2026", day: "",
name: "Morozov Aleksei Vladimirovich", age: "48", sex: "Male",
dx: "Acute pancreatitis, moderately severe (Ranson score 3)",
rows: [
["Clinical examination: severe epigastric pain radiating to the back ('belt-like'), nausea, vomiting x6, history of alcohol intake. Temperature 38.1 C, HR 108/min, BP 110/80 mmHg, epigastric tenderness and guarding. Completion of medical history.", "1"],
["Interpretation of additional data: serum amylase 1840 U/L, lipase 2300 U/L, WBC 14.2 x10^9/L, CRP 180 mg/L. Abdominal USS: oedematous pancreas, no gallstones. CT abdomen: pancreatic oedema, peripancreatic fat stranding, no necrosis.", "1"],
["Participation in management: IV fluid resuscitation (Ringer's lactate 250 mL/hr), nil by mouth, NGT, ketorolac 30 mg IV, omeprazole 40 mg IV. Surgical team consulted.", "1"],
["Participation in clinical case review: Ranson criteria, Atlanta classification, indications for surgical referral.", "1"]
]
},
{
date: "02.07.2026", day: "DAY 4",
name: "Lebedeva Natalya Yurievna", age: "29", sex: "Female",
dx: "Status epilepticus (generalised tonic-clonic)",
rows: [
["Clinical examination: continuous tonic-clonic seizures >5 min (total 22 min). No prior epilepsy history. Post-ictal state, tongue laceration, SpO2 89%, HR 124/min, BP 150/90 mmHg. Medical history obtained from relatives.", "1"],
["Participation in emergency management: recovery position, jaw thrust, O2 15 L/min, IV access; diazepam 10 mg IV - seizures resolved at 3 min. Blood glucose 4.2 mmol/L. Phenytoin 18 mg/kg IV loading infusion for prophylaxis.", "1"],
["Interpretation of additional data: MRI brain - no structural lesion. EEG - diffuse slowing. CBC, metabolic panel, toxicology screen - unremarkable.", "1"],
["Ward rounds. Clinical case review: classification of status epilepticus, stepwise pharmacological approach.", "2"]
]
},
{
date: "02.07.2026", day: "",
name: "Volkov Gennady Igorevich", age: "61", sex: "Male",
dx: "Acute decompensated heart failure (pulmonary oedema)",
rows: [
["Clinical examination: acute severe dyspnoea, orthopnoea, frothy pink sputum. History of dilated cardiomyopathy. SpO2 80%, RR 32/min, HR 118/min (irregular), BP 160/100 mmHg, bilateral fine crackles to mid-zones, elevated JVP. Completion of medical history.", "1"],
["Interpretation of additional data: ECG - atrial fibrillation with rapid ventricular response. BNP 2300 pg/mL. CXR: bilateral perihilar infiltrates, cardiomegaly, Kerley B lines. Bedside echo: EF 22%, dilated LV.", "1"],
["Participation in emergency management: patient sat upright, O2 non-rebreather, BiPAP initiated, furosemide 80 mg IV bolus, GTN infusion 10 mcg/min IV titrated. Rate control: digoxin 0.5 mg IV. Urine output monitored via catheter.", "1"],
["Participation in clinical case review: precipitants of acute decompensation, Killip classification.", "1"]
]
},
{
date: "03.07.2026", day: "DAY 5",
name: "Sidorov Pavel Konstantinovich", age: "55", sex: "Male",
dx: "Acute upper GI bleeding (peptic ulcer, Forrest Ia)",
rows: [
["Clinical examination: haematemesis (fresh blood x2), melaena, syncope. History of NSAID use. Pallor, cold extremities, HR 118/min, BP 90/60 mmHg (supine), CRT >3 sec, GCS 14. Completion of medical history.", "1"],
["Interpretation of additional data: Hb 72 g/L, platelets 180 x10^9/L, INR 1.3, BUN/creatinine ratio >30. Blood group and cross-match ordered (O-negative issued).", "1"],
["Participation in resuscitation: two large-bore IV cannulae, Hartmann's 500 mL rapid infusion, then pRBC transfusion (2 units). NGT - fresh blood confirmed. Omeprazole 80 mg IV bolus then 8 mg/hr infusion. Foley catheter. Urgent endoscopy team called.", "1"],
["Ward rounds. Clinical case review: Blatchford score (12), Forrest classification, endoscopic haemostasis methods.", "2"]
]
},
{
date: "03.07.2026", day: "",
name: "Belova Irina Fyodorovna", age: "38", sex: "Female",
dx: "Diabetic ketoacidosis (DKA), moderate severity",
rows: [
["Clinical examination: nausea, vomiting, polyuria, polydipsia, abdominal pain for 2 days. Type 1 DM history. Kussmaul breathing, fruity breath, dry mucous membranes, HR 106/min, BP 105/75 mmHg, GCS 15. Completion of medical history.", "1"],
["Interpretation of additional data: glucose 28.4 mmol/L, pH 7.18, HCO3 9 mmol/L, anion gap 24, B-hydroxybutyrate 6.2 mmol/L, K+ 3.1 mmol/L. Urinalysis: glucose 4+, ketones 3+. ECG: sinus tachycardia, flattened T-waves.", "1"],
["Participation in management: IV 0.9% NaCl 1 L over 1 hr then 500 mL/hr. IV insulin infusion 0.1 U/kg/hr. KCl replacement (40 mmol/L in fluids). Hourly glucose and electrolyte monitoring plan. Bicarbonate not given (pH >7.0).", "1"],
["Participation in clinical case review: DKA vs HHS, diagnostic criteria, insulin sliding scale pitfalls.", "1"]
]
},
{
date: "04.07.2026", day: "DAY 6",
name: "Orlov Sergey Alexandrovich", age: "44", sex: "Male",
dx: "Pulmonary embolism, high risk (massive PE)",
rows: [
["Clinical examination: sudden onset severe dyspnoea, pleuritic chest pain, syncope. 3-week immobilisation post hip surgery. HR 128/min, BP 88/60 mmHg, SpO2 85%, raised JVP, right heart strain signs. Wells score: high probability. Completion of emergency documentation.", "1"],
["Interpretation of additional data: ECG - S1Q3T3 pattern, sinus tachycardia. D-dimer >5000 ng/mL. CTPA: bilateral saddle embolus confirmed. Echo: RV dilation and hypokinesis. Troponin T: 0.45 ng/mL.", "1"],
["Participation in emergency management: O2 15 L/min, UFH 80 U/kg IV bolus then 18 U/kg/hr infusion. Systemic thrombolysis (alteplase 100 mg IV over 2 hrs) initiated under senior supervision due to haemodynamic instability. Continuous monitoring.", "1"],
["Ward rounds. Clinical case review: PESI score, risk stratification, thrombolysis vs embolectomy.", "2"]
]
},
{
date: "04.07.2026", day: "",
name: "Novikova Elena Borisovna", age: "31", sex: "Female",
dx: "Ectopic pregnancy, ruptured (left fallopian tube), haemoperitoneum",
rows: [
["Clinical examination: acute LIF pain, shoulder-tip pain, amenorrhoea x7 weeks, PV spotting. Generalised guarding, rebound tenderness, cervical motion tenderness +. HR 122/min, BP 80/50 mmHg. Pregnancy test positive. Emergency documentation completed.", "1"],
["Interpretation of additional data: B-hCG 4800 mIU/mL. CBC: Hb 79 g/L (falling). TVUS: empty uterus, left adnexal mass 4 cm, significant free fluid in pelvis and Morison's pouch.", "1"],
["Participation in resuscitation and pre-operative management: two large-bore IV lines, O-negative blood crossmatch, crystalloid infusion, O2 therapy, Foley catheter. Gynaecological surgery team contacted; urgent laparotomy arranged.", "1"],
["Participation in clinical case review: differential diagnosis of acute abdomen in women of reproductive age, laparoscopic vs open management.", "1"]
]
},
{
date: "06.07.2026", day: "DAY 7",
name: "Korolev Mikhail Petrovich", age: "70", sex: "Male",
dx: "Complete atrioventricular block (third-degree), haemodynamic compromise",
rows: [
["Safety instructions reviewed (third scheduled review). Familiarization with defibrillator and transcutaneous pacemaker setup in emergency bay.", "1"],
["Clinical examination: syncope, dizziness, presyncope on exertion. HR 36/min, BP 80/50 mmHg, cannon A-waves in JVP, variable S1 intensity. Known ischaemic heart disease, recent inferior MI. Completion of medical history.", "1"],
["Interpretation of ECG: P-waves and QRS complexes dissociated, rate 36/min, wide QRS escape rhythm. K+ 5.8 mmol/L. Echo: inferior wall hypokinesia, EF 40%.", "1"],
["Participation in emergency management: atropine 1 mg IV (minimal response), transcutaneous pacing at 70/min, 60 mA - capture achieved, BP 110/70 mmHg. IV dopamine as bridge. Cardiology contacted for urgent transvenous pacemaker insertion.", "1"],
["Ward rounds. Clinical case review: indications for temporary vs permanent pacing.", "2"]
]
},
{
date: "06.07.2026", day: "",
name: "Pavlova Zinaida Semyonovna", age: "82", sex: "Female",
dx: "Hip fracture (subcapital, right), acute blood loss anaemia",
rows: [
["Clinical examination: fall from standing height, inability to walk, severe right hip pain. Right leg shortened and externally rotated. BP 100/65 mmHg, HR 98/min, Hb 85 g/L. Pain score 9/10. Known osteoporosis, anticoagulated (warfarin INR 3.2). Completion of medical history.", "1"],
["Interpretation of additional data: X-ray right hip: subcapital fracture displaced (Garden type III). CBC, coagulation (INR 3.2), renal function (creatinine 124 umol/L), ECG reviewed.", "1"],
["Participation in management: morphine 2.5 mg IV titrated, IV access, crystalloid, Foley catheter. Warfarin reversal: vitamin K 10 mg IV + 4-factor PCC (Octaplex) dosed per weight. Orthopaedic surgery team informed.", "1"],
["Participation in clinical case review: fragility fractures, peri-operative anticoagulation reversal, VTE prophylaxis after hip surgery.", "1"]
]
},
{
date: "07.07.2026", day: "DAY 8",
name: "Stepanov Andrey Yuryevich", age: "52", sex: "Male",
dx: "Acute alcohol poisoning with aspiration; Mallory-Weiss syndrome",
rows: [
["Clinical examination: collapse with vomiting, haematemesis (small volume, streaked after retching), ethanol smell, GCS 11, HR 102/min, BP 115/80 mmHg, SpO2 92%. Completion of medical history from bystanders.", "1"],
["Interpretation of additional data: blood alcohol level 3.8 g/L. CXR: right lower lobe infiltrate (aspiration pneumonitis). OGD (next morning): linear mucosal tear at gastro-oesophageal junction - no active bleeding.", "1"],
["Participation in management: lateral decubitus positioning, oropharyngeal suction, O2, thiamine 100 mg IV before glucose, glucose 40% 50 mL IV, IV saline. Co-amoxiclav 1.2 g IV for aspiration pneumonitis. PPI commenced.", "1"],
["Ward rounds. Clinical case review: alcohol-related emergencies, Wernicke prophylaxis, aspiration pneumonitis vs pneumonia.", "2"]
]
},
{
date: "07.07.2026", day: "",
name: "Grigoryeva Anna Vladimirovna", age: "26", sex: "Female",
dx: "Acute asthma attack, severe",
rows: [
["Clinical examination: wheeze and dyspnoea for 3 hours despite inhaler use. Atopic asthma history. Unable to complete sentences, accessory muscle use, bilateral expiratory wheeze, RR 28/min, HR 116/min, SpO2 91%, PEFR 38% predicted. Completion of medical history.", "1"],
["Interpretation of additional data: ABG: pH 7.37, PaCO2 38 mmHg (normal - concerning for fatigue), PaO2 70 mmHg. CXR: hyperinflation, no pneumothorax.", "1"],
["Participation in management: O2 non-rebreather 15 L/min, salbutamol 5 mg continuous nebulisation, ipratropium 500 mcg neb, hydrocortisone 200 mg IV, magnesium sulphate 2 g IV over 20 min. PEFR improved to 65% at 1 hr. ICU standby arranged.", "1"],
["Clinical case review: criteria for life-threatening asthma, NIV vs intubation.", "1"]
]
},
{
date: "08.07.2026", day: "DAY 9",
name: "Tikhonov Nikolay Alekseyevich", age: "63", sex: "Male",
dx: "Acute aortic dissection, type A (DeBakey type I)",
rows: [
["Clinical examination: sudden tearing chest pain radiating to back and neck, BP difference between arms >30 mmHg (R: 195/110, L: 155/90), aortic regurgitation murmur, right arm paraesthesias. Known poorly controlled hypertension. Emergency documentation completed.", "1"],
["Interpretation of additional data: CXR - widened mediastinum (>8 cm). ECG - LVH, no ischaemic changes. CT angiography aorta: dissection flap from aortic root to descending aorta, pericardial effusion, no tamponade. Troponin mildly raised.", "1"],
["Participation in emergency management: IV labetalol titrated (target HR <60, SBP 100-120 mmHg), morphine 5 mg IV. Two large-bore IV lines, urgent cardiac surgery team contacted. Blood crossmatch x6 units. ICU bed prepared.", "1"],
["Ward rounds. Clinical case review: Stanford/DeBakey classification, type A (surgical) vs type B (medical), imaging choices.", "2"]
]
},
{
date: "08.07.2026", day: "",
name: "Kovalyova Oksana Dmitrievna", age: "19", sex: "Female",
dx: "Meningococcal meningitis with septicaemia (meningococcaemia)",
rows: [
["Clinical examination: 6-hr history of severe headache, photophobia, neck stiffness, fever 39.8 C, non-blanching purpuric rash. GCS 13, HR 124/min, BP 80/50 mmHg, CRT >3 sec. Kernig's and Brudzinski's signs positive. No prior vaccination. Medical history from parents.", "1"],
["Interpretation of additional data: CBC: WBC 22.4 x10^9/L, platelets 58 x10^9/L (DIC). CRP 320 mg/L. Blood cultures x2. LP: CSF turbid - WBC 4200 cells/mm3 (PMN), glucose 1.1 mmol/L, protein 3.8 g/L. Gram stain: diplococci.", "1"],
["Participation in emergency management: benzylpenicillin 2.4 g IV immediately, dexamethasone 0.15 mg/kg IV, aggressive IV fluid resuscitation (30 mL/kg 0.9% NaCl), noradrenaline infusion for septic shock. ICU transfer arranged.", "1"],
["Clinical case review: sepsis-3 criteria, meningococcal disease notification, prophylaxis for contacts (rifampicin), vaccination.", "1"]
]
},
{
date: "09.07.2026", day: "DAY 10",
name: "Zaitsev Viktor Pavlovich", age: "78", sex: "Male",
dx: "Acute urinary retention; acute-on-chronic kidney injury",
rows: [
["Clinical examination: unable to void for 18 hours, severe suprapubic pain, distended bladder to umbilicus. Known BPH on tamsulosin. BP 170/100 mmHg (pain-related), HR 88/min. Completion of medical history.", "1"],
["Interpretation of additional data: USS abdomen: bladder 950 mL, bilateral hydronephrosis. PSA 24.3 ng/mL. Creatinine 284 umol/L (baseline 96). K+ 5.6 mmol/L. ECG: peaked T-waves (hyperkalaemia).", "1"],
["Participation in management: urethral catheterisation under supervision (16 Fr Foley, 780 mL drained). Urology informed. IV fluids for AKI. Calcium gluconate 10% 10 mL IV (cardioprotection); salbutamol neb and insulin-dextrose infusion for hyperkalaemia. Nephrology consulted.", "1"],
["Ward rounds. Clinical case review: post-obstructive diuresis monitoring, emergency management of hyperkalaemia, BPH surgical options.", "2"]
]
},
{
date: "09.07.2026", day: "",
name: "Smirnova Galina Vasilyevna", age: "56", sex: "Female",
dx: "Acute cholangitis (Charcot's triad), biliary sepsis",
rows: [
["Clinical examination: fever 39.4 C, RUQ pain, jaundice, confusion, hypotension (Reynolds pentad). Murphy's sign positive. BP 85/55 mmHg, HR 118/min, GCS 13. Known cholelithiasis, prior ERCP 2 years ago. Completion of medical history.", "1"],
["Interpretation of additional data: WBC 21.6 x10^9/L. Bilirubin total 145 umol/L. ALP 890 U/L, ALT 310 U/L. Blood cultures x2. Abdominal USS: dilated CBD (14 mm), multiple stones. MRCP: large CBD stone with proximal biliary dilatation.", "1"],
["Participation in management: IV fluid resuscitation, piperacillin-tazobactam 4.5 g IV 8-hrly, metronidazole 500 mg IV 8-hrly. Central line placed. Noradrenaline for septic shock. Urgent endoscopy team for emergency ERCP.", "1"],
["Clinical case review: Tokyo guidelines (TG18), grading of cholangitis severity, ERCP vs surgery.", "1"]
]
},
{
date: "10.07.2026", day: "DAY 11",
name: "Polyakov Artem Ruslanovich", age: "22", sex: "Male",
dx: "Penetrating abdominal trauma (stab wound, liver laceration), haemorrhagic shock",
rows: [
["Clinical examination: stab wound to RUQ. HR 140/min, BP 70/40 mmHg, GCS 14, rigid abdomen. FAST USS: significant free fluid in Morison's pouch and right subphrenic space. ATLS primary survey completed. Emergency trauma documentation.", "1"],
["Interpretation of additional data: Hb 65 g/L, lactate 7.2 mmol/L, PT 18s, APTT 56s. CT abdomen: Grade III liver laceration, 800 mL haemoperitoneum estimated. Blood crossmatch: 6 units pRBC, 6 FFP, 2 platelet pools.", "1"],
["Participation in damage control resuscitation: massive transfusion protocol activated (1:1:1 ratio pRBC:FFP:platelets). Tranexamic acid 1 g IV over 10 min then 1 g over 8 hrs. Two large-bore peripheral IVs + IO access. Permissive hypotension (SBP 80-90 mmHg). Trauma surgery team at bedside.", "1"],
["Ward rounds. Clinical case review: ATLS protocol, damage control surgery, massive transfusion protocol ratios.", "2"]
]
},
{
date: "10.07.2026", day: "",
name: "Nikiforova Lyudmila Grigoryevna", age: "65", sex: "Female",
dx: "Hyperosmolar hyperglycaemic state (HHS), severe dehydration",
rows: [
["Clinical examination: progressive confusion and weakness over 5 days, polydipsia. Type 2 DM on metformin and gliclazide. Profound dehydration, GCS 11, HR 110/min, BP 100/70 mmHg, no Kussmaul breathing. Completion of medical history.", "1"],
["Interpretation of additional data: blood glucose 48.6 mmol/L, serum osmolality 365 mOsm/kg, Na+ 148 mmol/L (corrected 162 mmol/L), K+ 3.5 mmol/L, HCO3 20 mmol/L (no acidosis), ketones trace.", "1"],
["Participation in management: 0.9% NaCl 1 L/hr x2 hrs, then 500 mL/hr (fluid deficit over 48 hrs). Low-dose insulin infusion 0.05 U/kg/hr commenced after initial fluid resuscitation. Glucose fall not exceeding 5 mmol/L/hr. LMWH (enoxaparin 40 mg SC) for DVT prophylaxis. Hourly neuro obs.", "1"],
["Clinical case review: DKA vs HHS distinction, risks of rapid osmolality correction (cerebral oedema), VTE risk.", "1"]
]
},
{
date: "11.07.2026", day: "DAY 12",
name: "Belyakov Roman Olegovich", age: "40", sex: "Male",
dx: "Acute carbon monoxide poisoning, moderate severity",
rows: [
["Safety instructions reviewed (final end-of-practice review). Familiarization with hyperbaric oxygen therapy (HBO) referral protocol at the practice base.", "1"],
["Clinical examination: found unconscious at home (gas boiler malfunction). Cherry-red skin, GCS 10, HR 108/min, SpO2 97% (falsely normal on pulse oximetry). Severe headache, nausea, vomiting on recovery. Completion of medical history from family.", "1"],
["Interpretation of additional data: COHb by co-oximetry 32% (moderate poisoning). ABG: pH 7.26, metabolic acidosis, lactate 4.8 mmol/L. ECG: ST changes. Troponin I 1.9 ng/mL. Cognitive testing impaired.", "1"],
["Participation in management: 100% O2 via tight-fitting non-rebreather mask. IV access, glucose, electrolytes. HBO therapy referral initiated (COHb >25%, neurological symptoms, cardiac involvement - absolute indications met). Cardiology and neurology consulted.", "1"],
["Ward rounds. Clinical case review: CO poisoning pathophysiology, indications for HBO, pulse oximetry pitfalls, delayed neurological sequelae.", "2"]
]
},
{
date: "11.07.2026", day: "",
name: "Medvedeva Svetlana Nikolayevna", age: "47", sex: "Female",
dx: "Acute adrenal (Addisonian) crisis",
rows: [
["Clinical examination: profound weakness, abdominal pain, nausea, vomiting, confusion, collapse. Addison's disease history; hydrocortisone stopped 4 days ago during intercurrent illness. BP 65/40 mmHg, HR 132/min, hyperpigmentation, temperature 37.8 C, GCS 12. Completion of medical history.", "1"],
["Interpretation of additional data: glucose 2.8 mmol/L (hypoglycaemia). Na+ 118 mmol/L, K+ 6.2 mmol/L, random cortisol 42 nmol/L (critically low). ACTH elevated (retrospective). ECG: peaked T-waves.", "1"],
["Participation in emergency management: hydrocortisone 100 mg IV bolus immediately. 1 L 0.9% NaCl with 5% dextrose rapidly IV. Glucose 40% 50 mL IV. Calcium gluconate and insulin-dextrose for hyperkalaemia. Hydrocortisone infusion 200 mg/24 hrs. ICU transfer.", "1"],
["Ward rounds - final rounds of practice rotation. Participation in final clinical case review with head of department: sick-day rule failure, precipitating factors of Addisonian crisis, steroid stress dosing. End-of-practice documentation checked and signed.", "2"]
]
}
];
// ---- build document ----
const children = [];
// Title block
children.push(
new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 0, after: 60 },
children: [new TextRun({ text: "Federal State Budgetary Educational Institution of Higher Education", bold: true, size: 22, font: "Times New Roman" })] }),
new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 0, after: 60 },
children: [new TextRun({ text: '"Kursk State Medical University" of the Ministry of Health of the Russian Federation', bold: true, size: 22, font: "Times New Roman" })] }),
new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 200, after: 120 },
children: [new TextRun({ text: "DIARY OF INDUSTRIAL PRACTICE", bold: true, size: 28, font: "Times New Roman", underline: {} })] }),
new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 0, after: 200 },
children: [new TextRun({ text: "for acquiring professional skills and experience in professional activity", size: 22, font: "Times New Roman", italics: true })] }),
new Paragraph({ alignment: AlignmentType.CENTER, spacing: { before: 0, after: 300 },
children: [new TextRun({ text: '"Provision of emergency and urgent medical care (physician assistant)"', bold: true, size: 24, font: "Times New Roman" })] }),
);
// Info fields
const fields = [
"Student of the ___ course, Faculty of ___, Group ___, Full name of the student: _________________________________",
"Practice base (medical institution / healthcare facility): _________________________________________________",
"Full name and position of the responsible staff member of the practice base: ___________________________",
"Full name and position of the supervisor of practical training: _________________________________________",
"Period of practice: from ____________ to ____________ (2026)"
];
fields.forEach(f => children.push(para(f)));
children.push(new Paragraph({ spacing: { before: 200, after: 100 } }));
// Work schedule table
children.push(heading("STUDENT WORK SCHEDULE", HeadingLevel.HEADING_2));
const scheduleData = [
["29/06/2026", "08:00 - 14:00"],
["30/06/2026", "08:00 - 14:00"],
["01/07/2026", "08:00 - 14:00"],
["02/07/2026", "08:00 - 14:00"],
["03/07/2026", "08:00 - 14:00"],
["04/07/2026", "08:00 - 14:00"],
["05/07/2026", "DAY OFF"],
["06/07/2026", "08:00 - 14:00"],
["07/07/2026", "08:00 - 14:00"],
["08/07/2026", "08:00 - 14:00"],
["09/07/2026", "08:00 - 14:00"],
["10/07/2026", "08:00 - 14:00"],
["11/07/2026", "08:00 - 14:00"]
];
const thin = { style: BorderStyle.SINGLE, size: 4, color: "999999" };
const scheduleRows = [
new TableRow({
children: [
headerCell("Date"),
headerCell("Working hours")
],
tableHeader: true
}),
...scheduleData.map(([d, h]) => new TableRow({
children: [
cell(d, { width: 4000 }),
cell(h, { width: 5000 })
]
}))
];
children.push(thinBorderTable(scheduleRows));
children.push(new Paragraph({ spacing: { before: 120, after: 60 },
children: [new TextRun({ text: "Signature of the responsible staff member of the practice base: ________________ Seal of the practice base", size: 20, font: "Times New Roman", italics: true })] }));
children.push(new Paragraph({ spacing: { before: 300, after: 100 } }));
// Page break before daily logs
children.push(new Paragraph({ children: [new PageBreak()] }));
children.push(heading("DAILY LOGS", HeadingLevel.HEADING_1));
// Generate patient tables
let currentDay = "";
patients.forEach((p) => {
if (p.day) {
// New day heading
children.push(
new Paragraph({
spacing: { before: 200, after: 60 },
children: [new TextRun({ text: p.day + " - " + p.date, bold: true, size: 24, font: "Times New Roman", color: "1F497D" })]
})
);
}
// Patient header
children.push(
new Paragraph({
spacing: { before: 120, after: 40 },
children: [
new TextRun({ text: "Patient: ", bold: true, size: 22, font: "Times New Roman" }),
new TextRun({ text: p.name + " | Age: " + p.age + " | Sex: " + p.sex, size: 22, font: "Times New Roman" })
]
}),
new Paragraph({
spacing: { before: 0, after: 80 },
children: [
new TextRun({ text: "Diagnosis: ", bold: true, size: 22, font: "Times New Roman" }),
new TextRun({ text: p.dx, size: 22, font: "Times New Roman", italics: true })
]
})
);
// Table rows
const tableRows = [
new TableRow({
children: [
headerCell("Date"),
headerCell("Content of completed work"),
headerCell("Frequency")
],
tableHeader: true
}),
...p.rows.map((r, idx) => new TableRow({
children: [
cell(idx === 0 ? p.date : "", { width: 1400 }),
cell(r[0], { width: 7000 }),
cell(r[1], { width: 600 })
]
}))
];
children.push(thinBorderTable(tableRows));
children.push(new Paragraph({ spacing: { before: 60, after: 20 } }));
children.push(signatureRow());
children.push(new Paragraph({ spacing: { before: 100, after: 200 } }));
});
// Summary table
children.push(new Paragraph({ children: [new PageBreak()] }));
children.push(heading("SUMMARY OF PATIENTS SEEN", HeadingLevel.HEADING_1));
const summaryData = patients.map((p, i) => [String(i+1), p.date, p.name + ", " + p.age + p.sex[0], p.dx]);
const summaryRows = [
new TableRow({
children: [headerCell("#"), headerCell("Date"), headerCell("Patient"), headerCell("Diagnosis")],
tableHeader: true
}),
...summaryData.map(r => new TableRow({
children: [
cell(r[0], { width: 400 }),
cell(r[1], { width: 1400 }),
cell(r[2], { width: 2800 }),
cell(r[3], { width: 4400 })
]
}))
];
children.push(thinBorderTable(summaryRows));
children.push(new Paragraph({ spacing: { before: 300, after: 80 },
children: [new TextRun({ text: "Total: 24 individual patients | 12 working days | 2 patients per day", bold: true, size: 22, font: "Times New Roman" })] }));
children.push(new Paragraph({ spacing: { before: 300, after: 60 } }));
children.push(signatureRow());
children.push(new Paragraph({ spacing: { before: 80, after: 60 },
children: [new TextRun({ text: "Signature of the head of practice base (stamp): ______________________________", size: 22, font: "Times New Roman" })] }));
// ---- build and write ----
const doc = new Document({
styles: {
default: {
document: { run: { font: "Times New Roman", size: 22 } }
},
paragraphStyles: [
{
id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 32, bold: true, font: "Times New Roman", color: "1F497D" },
paragraph: { spacing: { before: 300, after: 120 } }
},
{
id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 26, bold: true, font: "Times New Roman", color: "1F497D" },
paragraph: { spacing: { before: 200, after: 100 } }
}
]
},
sections: [{
properties: {
page: {
margin: { top: 1134, bottom: 1134, left: 1701, right: 1134 }
}
},
children
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync("/home/daytona/workspace/kursk-diary/Kursk_Industrial_Practice_Diary.docx", buffer);
console.log("DONE: Kursk_Industrial_Practice_Diary.docx written successfully.");
}).catch(err => { console.error(err); process.exit(1); });