Translate in English
pandoc --track-changes=all "/home/daytona/workspace/attachments/36470acf-7dee-43…
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Hemoglobin | 135 | g/L | 130-164 |
| Leukocytes | 13.8 | ×10⁹/L | 4-9 |
| Erythrocytes | 4.89 | ×10¹²/L | 4.3-5.7 |
| Hematocrit | 40.45 | % | 40-48 |
| Mean Hb content per RBC | 27.6 | pg | 27.0-33.3 |
| Mean Hb concentration per RBC | 334 | g/L | 330-370 |
| Mean RBC volume | 83 | fL | 80-95 |
| Platelets | 329 | ×10⁹/L | 150-400 |
| ESR | 31 | mm/h | 1-10 |
| Band neutrophils | 3 | % | 0-6 |
| Segmented neutrophils | 85.2 | % | 45-72 |
| Lymphocytes | 7.6 | % | 18-40 |
| Monocytes | 7.2 | % | 2-9 |
| Eosinophils | 0 | % | 0-5 |
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Hemoglobin | 138 | g/L | 130-164 |
| Leukocytes | 5.2 | ×10⁹/L | 4-9 |
| Erythrocytes | 4.34 | ×10¹²/L | 4.3-5.7 |
| Hematocrit | 34.9 | % | 40-48 |
| Mean Hb content per RBC | 27.6 | pg | 27.0-33.3 |
| Mean Hb concentration per RBC | 334 | g/L | 330-370 |
| Mean RBC volume | 83 | fL | 80-95 |
| Platelets | 304 | ×10⁹/L | 150-400 |
| ESR | 28 | mm/h | 1-10 |
| Band neutrophils | 0 | % | 0-6 |
| Segmented neutrophils | 71 | % | 45-72 |
| Lymphocytes | 23 | % | 18-40 |
| Monocytes | 3 | % | 2-9 |
| Eosinophils | 3 | % | 0-5 |
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Color | Straw-yellow | - | Straw-yellow |
| Odor | Mild | - | Mild |
| Clarity | Clear | - | Clear |
| Specific gravity | 1025 | - | 1010-1025 |
| pH | Acidic (6.0) | - | Acidic |
| Glucose | Absent | mmol/L | Absent |
| Protein | 0.9 | g/L | Up to 0.3 |
| Bilirubin | Absent | mmol/L | Absent |
| Erythrocytes | 5-6 | per HPF | 0-2 |
| Leukocytes | 2-3 | per HPF | 0-5 |
| Squamous epithelium | Occasional | per HPF | Occasional |
| Casts | Absent | per HPF | Absent (except 1-2 hyaline) |
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Color | Straw-yellow | - | Straw-yellow |
| Odor | Mild | - | Mild |
| Clarity | Clear | - | Clear |
| Specific gravity | 1025 | - | 1010-1025 |
| pH | Acidic (5.5) | - | Acidic |
| Glucose | Absent | mmol/L | Absent |
| Protein | Absent | g/L | Absent |
| Erythrocytes | Absent | per HPF | 0-2 |
| Leukocytes | Occasional | per HPF | 0-5 |
| Squamous epithelium | Occasional | per HPF | Occasional |
| Casts | Absent | per HPF | Absent |
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Glucose | 8.1 | mmol/L | 4.0-6.1 |
| Serum alpha-amylase | 41.1 | U/L | 40-100 |
| Total bilirubin | 12.1 | µmol/L | 5-21 |
| Urea | 2.4 | mmol/L | 2.7-7.5 |
| Creatinine | 76.8 | µmol/L | 35-110 |
| AST | 45.8 | U/L | Up to 31 |
| ALT | 24.9 | U/L | Up to 31 |
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Glucose | 4.8 | mmol/L | 4.0-6.1 |
| Serum alpha-amylase | 32.3 | U/L | 40-100 |
| Total bilirubin | 22.5 | µmol/L | 8.5-20.5 |
| Direct bilirubin | 2.4 | µmol/L | 2.2-5.1 |
| Indirect bilirubin | 20.1 | µmol/L | 3.4-18.3 |
| Urea | 3 | mmol/L | 2.7-7.5 |
| Creatinine | 59.4 | µmol/L | 35-110 |
| AST | 16.7 | U/L | Up to 31 |
| ALT | 41.4 | U/L | Up to 31 |
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Potassium | 3.97 | mmol/L | 3.4-5.3 |
| Sodium | 136.2 | mmol/L | 130.0-156.0 |
| Chlorides | 105.1 | mmol/L | 95.0-108.0 |
| Parameter | Patient Value | Unit | Reference Range |
|---|---|---|---|
| Potassium | 3.65 | mmol/L | 3.4-5.3 |
| Sodium | 130.8 | mmol/L | 130.0-156.0 |
| Chlorides | 99.5 | mmol/L | 95.0-108.0 |
| Parameter | Result | Reference |
|---|---|---|
| Antibodies to HIV-1 (incl. group "O"), HIV-2, and p24 antigen of HIV-1 by ELISA | Negative | - |
| Parameter | Result |
|---|---|
| HBs-Ag | Negative |
| aHCV (IgM, IgG) | Negative |
| aHCV IgM | Negative |
| aHCV IgG | Negative |
| Parameter | Result |
|---|---|
| SARS-CoV-2 antigen | Negative |
| Parameter | Result |
|---|---|
| Consistency | Liquid |
| pH | Alkaline |
| Leukocytes | 50-60, covering entire field |
| Protozoa | Negative |
| Helminth eggs | Absent |
| Scraping (perianal) | Negative |
| Parameter | Result |
|---|---|
| Rotavirus type 2 antigen | Negative |
| Parameter | Result |
|---|---|
| Rotavirus Group A RNA | Not detected |
| Norovirus Genotype 2 RNA | DETECTED |
| Astrovirus RNA | Not detected |
| Date | Progress Note | Treatment |
|---|---|---|
| 22.04.2025 | Complaints: general weakness, abdominal discomfort, loose stools. Condition: moderate severity. Consciousness clear, GCS 15. Temperature: 37.0°C. No meningeal or focal CNS signs. Skin and sclerae normal, no rash. Musculoskeletal system without pathological changes. Oropharynx not hyperemic; tonsils not enlarged; no coatings. Tongue moist, coated white. Peripheral lymph nodes not enlarged. Breathing vesicular, conducted in all areas, no wheezing. RR: 16/min; SpO₂: 98%. Heart sounds rhythmic and clear; HR: 89/min; BP: 120/80 mmHg. Abdomen soft on palpation, tender in periumbilical area. Stool: 5 times/day, loose. CVA tenderness negative. Adequate diuresis, urine light-colored. | See prescription sheet |
| 23.04.2025 | Complaints: general weakness, loose stools. Condition: moderate severity. Consciousness clear, GCS 15. Position active. Nutrition adequate. Temperature: 36.5°C. No meningeal or focal CNS signs. Skin and sclerae normal, no rash; tissue turgor preserved. Musculoskeletal system without pathological changes. Oropharynx not hyperemic; tonsils not enlarged; no coatings. Tongue moist, coated white. Peripheral lymph nodes not enlarged. Breathing vesicular, conducted in all areas, no wheezing. RR: 16/min; SpO₂: 98%. Heart sounds rhythmic and clear; HR: 80/min; BP: 110/70 mmHg. Abdomen soft on palpation, tender in periumbilical area. No peritoneal irritation signs. Stool loose. CVA tenderness negative. Adequate diuresis, urine light-colored. | See prescription sheet |
| 24.04.2025 | Complaints: none actively presented. Condition: satisfactory. Consciousness clear, GCS 15. Position active. Nutrition adequate. Temperature: 36.8°C. No meningeal or focal CNS signs. Skin and sclerae normal, no rash; tissue turgor preserved. Musculoskeletal system without pathological changes. Oropharynx not hyperemic; tonsils not enlarged; no coatings. Tongue moist, clean. Peripheral lymph nodes not enlarged. Breathing vesicular, conducted in all areas, no wheezing. RR: 16/min; SpO₂: 98%. Heart sounds rhythmic and clear; HR: 72/min; BP: 110/70 mmHg. Abdomen soft and non-tender on palpation. No peritoneal irritation signs. Stool: semi-formed, 1 time, no admixtures. CVA tenderness negative. Adequate diuresis, urine normal color. | See prescription sheet |
Make it in a Ms word document
ls /home/daytona/workspace/attachments/36470acf-7dee-438f-9263-ffb0d22002a7/ && …
mkdir -p /home/daytona/workspace/medical-history && ls /home/daytona/workspace/m…
~/medical-history/create_doc.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, HeadingLevel, BorderStyle, WidthType, VerticalAlign,
PageBreak, UnderlineType
} = require('docx');
const fs = require('fs');
function h1(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_1,
children: [new TextRun({ text, bold: true, size: 28 })]
});
}
function h2(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_2,
children: [new TextRun({ text, bold: true, size: 24 })]
});
}
function h3(text) {
return new Paragraph({
heading: HeadingLevel.HEADING_3,
children: [new TextRun({ text, bold: true, size: 22 })]
});
}
function p(text, opts = {}) {
return new Paragraph({
alignment: opts.center ? AlignmentType.CENTER : AlignmentType.LEFT,
children: [new TextRun({ text, bold: opts.bold || false, size: 22, underline: opts.underline ? { type: UnderlineType.SINGLE } : undefined })]
});
}
function bold(text) { return p(text, { bold: true }); }
function empty() { return new Paragraph({ children: [new TextRun('')] }); }
function makeTable(headers, rows, colWidths) {
const borderStyle = {
style: BorderStyle.SINGLE,
size: 1,
color: '000000'
};
const cellBorders = {
top: borderStyle, bottom: borderStyle, left: borderStyle, right: borderStyle
};
const headerRow = new TableRow({
children: headers.map((h, i) => new TableCell({
borders: cellBorders,
width: { size: colWidths ? colWidths[i] : Math.floor(9000 / headers.length), type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: h, bold: true, size: 20 })] })]
}))
});
const dataRows = rows.map(row => new TableRow({
children: row.map((cell, i) => new TableCell({
borders: cellBorders,
width: { size: colWidths ? colWidths[i] : Math.floor(9000 / headers.length), type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: cell || '', bold: cell && cell.startsWith('**') && cell.endsWith('**') ? true : false, size: 20 })] })]
}))
}));
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [headerRow, ...dataRows]
});
}
// Helper to make a table row with bold first col
function cbcTable(headers, rows) {
const borderStyle = { style: BorderStyle.SINGLE, size: 1, color: '000000' };
const cellBorders = { top: borderStyle, bottom: borderStyle, left: borderStyle, right: borderStyle };
const colWidths = [2800, 1800, 1800, 2600];
const headerRow = new TableRow({
children: headers.map((h, i) => new TableCell({
borders: cellBorders,
width: { size: colWidths[i], type: WidthType.DXA },
shading: { fill: 'D0E4F7' },
children: [new Paragraph({ children: [new TextRun({ text: h, bold: true, size: 19 })] })]
}))
});
const dataRows = rows.map(row => new TableRow({
children: row.map((cell, i) => {
const isAbnormal = cell.startsWith('!');
const displayText = isAbnormal ? cell.slice(1) : cell;
return new TableCell({
borders: cellBorders,
width: { size: colWidths[i], type: WidthType.DXA },
shading: isAbnormal ? { fill: 'FFE0E0' } : undefined,
children: [new Paragraph({ children: [new TextRun({ text: displayText, bold: isAbnormal, size: 19 })] })]
});
})
}));
return new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [headerRow, ...dataRows]
});
}
const children = [
// Title block
new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: 'Department of Phthisiology, Pulmonology and Infectious Diseases', bold: true, size: 26 })] }),
empty(),
new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: 'Head of Department: Doctor of Medical Sciences, Professor Mordyk A.V.', size: 22 })] }),
new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: 'Instructor: Assistant Musin M.A.', size: 22 })] }),
empty(),
new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: 'EDUCATIONAL CASE HISTORY', bold: true, size: 32 })] }),
empty(),
new Paragraph({ alignment: AlignmentType.CENTER, children: [new TextRun({ text: 'BUZOO "Infectious Clinical Hospital No. 1 named after Dalmatov D.M."', bold: true, size: 22, underline: { type: UnderlineType.SINGLE } })] }),
empty(),
// Medical record header
h1('MEDICAL RECORD No. 2165 — Inpatient Record'),
new Paragraph({ children: [new TextRun({ text: 'Medical Documentation, Form No. 003/u | Approved by Ministry of Health RF, 05.08.2022, No. 530n', size: 20, italics: true })] }),
empty(),
// Admin info table
new Paragraph({ children: [new TextRun({ text: 'Administrative Information', bold: true, size: 24 })] }),
empty(),
cbcTable(
['Field', 'Details', 'Field', 'Details'],
[
['Date of illness onset', '18.04.2025', 'Date of first visit', '21.04.2025'],
['Date & time of admission', '21.04.2025, 12:30', 'Date & time of discharge', '25.04.2025, 14:00'],
['Department', 'Infectious Disease Ward No. 1', 'Room No.', '14'],
['Bed-days', '4', 'Mode of transport', 'Ambulatory'],
['Blood type', 'II (A)', 'Rh factor', 'Rh+'],
['Adverse drug reactions', 'None', '', ''],
]
),
empty(),
// Patient details
h2('Patient Details'),
p('1. Name: (confidential)'),
p('2. Sex: Female'),
p('3. Age: 24 years (03.07.2000)'),
p('4. Permanent residence: Russia, Omsk Region, Omsk, Vzletnaya St., 13, Apt. 154'),
p('5. Occupation: Unemployed'),
p('6. Referred by: BUZOO "Emergency Medical Services Station"'),
p('7. Admitted as emergency: YES'),
p('8. Referring institution\'s diagnosis: A04.9. Bacterial intestinal infection, unspecified.'),
p('9. Diagnosis on admission: A04.9. Bacterial intestinal infection, unspecified. Acute gastroenteritis.'),
empty(),
// Diagnoses
h2('Diagnoses'),
bold('10. Preliminary Clinical Diagnosis:'),
p('A04.9. Bacterial intestinal infection, unspecified. Acute gastroenteritis. (Date: 21.04.2025)'),
empty(),
bold('11. Final Clinical Diagnosis:'),
p('a) Primary: A08.1. Norovirus infection (Norovirus RNA in stool +), gastroenterocolitis, moderate severity. Dehydration grade II (2b).'),
p('b) Complication of primary: None'),
p('c) Concurrent diagnosis: None'),
empty(),
p('12. Hospitalized this year for this condition: FIRST TIME (1 time total)'),
p('13. Surgical operations: None'),
p('14. Other types of treatment: None'),
p('15. Sick leave certificate: Not required'),
p('16. Outcome: Discharged with improvement'),
p('17. Work capacity: Fully restored'),
empty(),
// Complaints
h2('COMPLAINTS'),
bold('On admission:'),
p('General weakness, nausea, vomiting, loose stools, abdominal rumbling, body temperature up to 39°C.'),
bold('At the time of supervision:'),
p('General weakness, nausea, vomiting, loose stools, abdominal rumbling, body temperature up to 39°C.'),
empty(),
// History of present illness
h2('HISTORY OF PRESENT ILLNESS'),
p('The patient considers herself ill since 18.04.2025, when general weakness, nausea, loose stools 5-6 times per day without abnormal admixtures, and abdominal rumbling first appeared. Temperature rose to 39°C. She self-medicated with antipyretics and sorbents (names not remembered). No improvement occurred: weakness and loose stools persisted. On 21.04.2025, she called an ambulance and was brought to the emergency department of BUZOO "ICH No. 1 named after Dalmatov D.M."'),
empty(),
// Past medical history
h2('PAST MEDICAL HISTORY'),
p('Denies chronic diseases, injuries, and surgeries. Denies HIV infection, hepatitis, and tuberculosis. Denies sexually transmitted diseases. No allergic history. No hereditary history. Last chest X-ray: 2 years ago. Pregnancies: 2; deliveries: 2 (both vaginal); abortions: 0. Menarche at age 13; irregular menstruation due to breastfeeding; last menstruation 12.02.2025. Denies current pregnancy. Denies bad habits (smoking, alcohol use, substance use).'),
empty(),
// Epidemiological history
h2('EPIDEMIOLOGICAL HISTORY'),
p('Maintains personal hygiene. Drinks boiled water. Eats at home. Denies contact with patients with acute intestinal infections. Does not associate her illness with any specific cause. Contacts: 1 (1 adult, 0 children). Has not traveled outside the city in the past month. Does not consume carp-family river fish.'),
empty(),
bold('Epidemiological History Conclusion:'),
p('1. Presumed source of infection: a sick individual or a virus shedder.'),
p('2. Presumed mechanism of infection: fecal-oral.'),
p('3. Presumed route of infection: contact-household, food-borne, waterborne.'),
p('4. Susceptibility: high.'),
empty(),
// Objective status
h2('OBJECTIVE STATUS (Physical Examination)'),
p('Condition of moderate severity. Consciousness clear. Glasgow Coma Scale: 15 points. Body temperature: 38.4°C. Height: 165 cm; weight: 71 kg; BMI: 26.1 kg/m² (normal body weight). Skin pale-pink; sclerae white. No pathological rashes. Oropharyngeal mucosa calm; tonsils not hypertrophied; no coatings. Visible mucous membranes pink, without pathological rashes. Tongue moist, coated with white film. Skin turgor preserved, age-appropriate. No peripheral edema. Subcutaneous fat moderately developed, evenly distributed.'),
p('Regional lymph nodes not enlarged, non-tender on palpation. Musculoskeletal system without pathological changes. Lung auscultation: vesicular breathing, conducted in all areas, no wheezing. RR: 17/min. SpO₂: 98% on room air. Cardiac percussion and auscultation: borders of relative cardiac dullness unchanged; heart sounds clear, rhythmic; no pathological murmurs. HR: 118/min. BP: 134/82 mmHg.'),
p('Abdominal palpation and percussion: liver and spleen not enlarged. Abdomen soft, tender in epigastrium, periumbilical area, and iliac regions; rumbling noted. No signs of peritoneal irritation. Urogenital examination: no pathological changes; CVA tenderness negative. Urination free, voluntary, painless. No meningeal or focal neurological signs.'),
empty(),
bold('Dehydration Assessment:'),
p('Appearance (thirst, restlessness, irritability): 1 pt | Eyes (slightly sunken): 1 pt | Mucous membranes (moist): 0 pts | Tears (normal): 0 pts'),
bold('Total: 2 points — Grade II Dehydration.'),
empty(),
// Preliminary diagnosis
h2('PRELIMINARY CLINICAL DIAGNOSIS'),
p('A04.9. Bacterial intestinal infection, unspecified. Acute gastroenteritis.'),
empty(),
// Lab results
h1('LABORATORY AND INSTRUMENTAL FINDINGS'),
empty(),
h3('1. Complete Blood Count — 21.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['Hemoglobin', '135', 'g/L', '130-164'],
['!Leukocytes', '!13.8', '!×10⁹/L', '!4-9'],
['Erythrocytes', '4.89', '×10¹²/L', '4.3-5.7'],
['Hematocrit', '40.45', '%', '40-48'],
['Mean Hb per RBC', '27.6', 'pg', '27.0-33.3'],
['Mean Hb conc. in RBC', '334', 'g/L', '330-370'],
['Mean RBC volume', '83', 'fL', '80-95'],
['Platelets', '329', '×10⁹/L', '150-400'],
['!ESR', '!31', '!mm/h', '!1-10'],
['Band neutrophils', '3', '%', '0-6'],
['!Segmented neutrophils', '!85.2', '!%', '!45-72'],
['!Lymphocytes', '!7.6', '!%', '!18-40'],
['Monocytes', '7.2', '%', '2-9'],
['Eosinophils', '0', '%', '0-5'],
]
),
p('Conclusion: Neutrophilic leukocytosis, relative lymphopenia, elevated ESR.', { bold: false }),
empty(),
h3('2. Complete Blood Count — 25.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['Hemoglobin', '138', 'g/L', '130-164'],
['Leukocytes', '5.2', '×10⁹/L', '4-9'],
['Erythrocytes', '4.34', '×10¹²/L', '4.3-5.7'],
['!Hematocrit', '!34.9', '!%', '!40-48'],
['Mean Hb per RBC', '27.6', 'pg', '27.0-33.3'],
['Mean Hb conc. in RBC', '334', 'g/L', '330-370'],
['Mean RBC volume', '83', 'fL', '80-95'],
['Platelets', '304', '×10⁹/L', '150-400'],
['!ESR', '!28', '!mm/h', '!1-10'],
['Band neutrophils', '0', '%', '0-6'],
['Segmented neutrophils', '71', '%', '45-72'],
['Lymphocytes', '23', '%', '18-40'],
['Monocytes', '3', '%', '2-9'],
['Eosinophils', '3', '%', '0-5'],
]
),
p('Conclusion: Elevated ESR, reduced hematocrit.'),
empty(),
h3('3. Urinalysis — 21.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['Color', 'Straw-yellow', '-', 'Straw-yellow'],
['Odor', 'Mild', '-', 'Mild'],
['Clarity', 'Clear', '-', 'Clear'],
['Specific gravity', '1025', '-', '1010-1025'],
['pH', 'Acidic (6.0)', '-', 'Acidic'],
['Glucose', 'Absent', 'mmol/L', 'Absent'],
['!Protein', '!0.9', '!g/L', '!Up to 0.3'],
['Bilirubin', 'Absent', 'mmol/L', 'Absent'],
['!Erythrocytes', '!5-6', '!per HPF', '!0-2'],
['Leukocytes', '2-3', 'per HPF', '0-5'],
['Squamous epithelium', 'Occasional', 'per HPF', 'Occasional'],
['Casts', 'Absent', 'per HPF', 'Absent'],
]
),
p('Conclusion: Proteinuria, microhematuria.'),
empty(),
h3('4. Urinalysis — 25.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['Color', 'Straw-yellow', '-', 'Straw-yellow'],
['Odor', 'Mild', '-', 'Mild'],
['Clarity', 'Clear', '-', 'Clear'],
['Specific gravity', '1025', '-', '1010-1025'],
['pH', 'Acidic (5.5)', '-', 'Acidic'],
['Glucose', 'Absent', 'mmol/L', 'Absent'],
['Protein', 'Absent', 'g/L', 'Absent'],
['Erythrocytes', 'Absent', 'per HPF', '0-2'],
['Leukocytes', 'Occasional', 'per HPF', '0-5'],
['Squamous epithelium', 'Occasional', 'per HPF', 'Occasional'],
['Casts', 'Absent', 'per HPF', 'Absent'],
]
),
p('Conclusion: Urinalysis within normal limits.'),
empty(),
h3('5. Biochemical Blood Panel — 21.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['!Glucose', '!8.1', '!mmol/L', '!4.0-6.1'],
['Serum alpha-amylase', '41.1', 'U/L', '40-100'],
['Total bilirubin', '12.1', 'µmol/L', '5-21'],
['Urea', '2.4', 'mmol/L', '2.7-7.5'],
['Creatinine', '76.8', 'µmol/L', '35-110'],
['!AST', '!45.8', '!U/L', '!Up to 31'],
['ALT', '24.9', 'U/L', 'Up to 31'],
]
),
p('Conclusion: Hyperglycemia, elevated AST.'),
empty(),
h3('6. Biochemical Blood Panel — 25.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['Glucose', '4.8', 'mmol/L', '4.0-6.1'],
['Serum alpha-amylase', '32.3', 'U/L', '40-100'],
['!Total bilirubin', '!22.5', '!µmol/L', '!8.5-20.5'],
['Direct bilirubin', '2.4', 'µmol/L', '2.2-5.1'],
['!Indirect bilirubin', '!20.1', '!µmol/L', '!3.4-18.3'],
['Urea', '3', 'mmol/L', '2.7-7.5'],
['Creatinine', '59.4', 'µmol/L', '35-110'],
['AST', '16.7', 'U/L', 'Up to 31'],
['!ALT', '!41.4', '!U/L', '!Up to 31'],
]
),
p('Conclusion: Hyperbilirubinemia (indirect bilirubin elevated), elevated ALT.'),
empty(),
h3('7. Blood Electrolytes — 21.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['Potassium', '3.97', 'mmol/L', '3.4-5.3'],
['Sodium', '136.2', 'mmol/L', '130.0-156.0'],
['Chlorides', '105.1', 'mmol/L', '95.0-108.0'],
]
),
p('Conclusion: No pathological changes.'),
empty(),
h3('8. Blood Electrolytes — 25.04.2025'),
cbcTable(
['Parameter', 'Patient Value', 'Unit', 'Reference Range'],
[
['Potassium', '3.65', 'mmol/L', '3.4-5.3'],
['Sodium', '130.8', 'mmol/L', '130.0-156.0'],
['Chlorides', '99.5', 'mmol/L', '95.0-108.0'],
]
),
p('Conclusion: No pathological changes.'),
empty(),
h3('9. HIV Antibody Test (ELISA) — 21.04.2025'),
cbcTable(
['Parameter', 'Result', 'Reference', ''],
[
['Antibodies to HIV-1 (incl. group "O"), HIV-2, and p24 antigen by ELISA', 'Negative', '-', ''],
]
),
p('Conclusion: No HIV antibodies or p24 antigen detected.'),
empty(),
h3('10. Viral Hepatitis Markers (B, C) — 21.04.2025'),
cbcTable(
['Parameter', 'Result', '', ''],
[
['HBs-Ag', 'Negative', '', ''],
['aHCV (IgM, IgG)', 'Negative', '', ''],
['aHCV IgM', 'Negative', '', ''],
['aHCV IgG', 'Negative', '', ''],
]
),
p('Conclusion: HBs-Ag, aHCV IgM/IgG - all not detected.'),
empty(),
h3('11. Bacteriological Stool Culture — 22.04.2025'),
p('Conclusion: No causative agents of salmonellosis, dysentery, or coli-infection isolated.'),
empty(),
h3('12. SARS-CoV-2 Rapid Antigen Test — 21.04.2025'),
cbcTable(
['Parameter', 'Result', '', ''],
[['SARS-CoV-2 antigen', 'Negative', '', '']]
),
p('Conclusion: SARS-CoV-2 antigen not detected.'),
empty(),
h3('13. Stool Microscopy (Coprogram) — 22.04.2025'),
cbcTable(
['Parameter', 'Result', '', ''],
[
['!Consistency', '!Liquid', '', ''],
['!pH', '!Alkaline', '', ''],
['!Leukocytes', '!50-60, covering entire field', '', ''],
['Protozoa', 'Negative', '', ''],
['Helminth eggs', 'Absent', '', ''],
['Perianal scraping', 'Negative', '', ''],
]
),
p('Conclusion: Leukocytes in stool, liquid consistency, alkaline pH.'),
empty(),
h3('14. ELISA for Rotavirus Type 2 Antigen — 23.04.2025'),
cbcTable(
['Parameter', 'Result', '', ''],
[['Rotavirus type 2 antigen', 'Negative', '', '']]
),
p('Conclusion: Rotavirus type 2 antigen not detected.'),
empty(),
h3('15. PCR — Rotavirus A RNA, Norovirus Genotype 2 RNA, Astrovirus RNA (Stool) — 23.04.2025'),
cbcTable(
['Parameter', 'Result', '', ''],
[
['Rotavirus Group A RNA', 'Not detected', '', ''],
['!Norovirus Genotype 2 RNA', '!DETECTED', '', ''],
['Astrovirus RNA', 'Not detected', '', ''],
]
),
p('Conclusion: Norovirus Genotype 2 RNA DETECTED.'),
empty(),
h3('16. ECG — 21.04.2025'),
p('Conclusion: Sinus rhythm, regular. HR: 69/min. Electrical axis not deviated. Shortened PQ interval.'),
empty(),
// Differential diagnosis
h1('DIFFERENTIAL DIAGNOSIS'),
p('Norovirus infection must be differentiated from: salmonellosis, intestinal yersiniosis, and chronic pancreatitis.'),
empty(),
bold('1. Salmonellosis, localized form, gastroenterocolitis:'),
p('Similar features: acute onset; dyspeptic syndrome (nausea, vomiting); fever; intoxication syndrome; loose stools; moderate dehydration.'),
p('Distinguishing features: cramping abdominal pain (epigastrium and right iliac region); characteristic stool — profuse, foul-smelling, foamy, greenish ("swamp slime"); tenesmus in colitic form; colitic stool with blood and mucus admixtures.'),
p('To clarify: bacteriological stool culture; stool PCR.'),
empty(),
bold('2. Intestinal yersiniosis, gastrointestinal form, gastroenterocolitis:'),
p('Similar features: acute onset; dyspeptic syndrome; fever; intoxication; loose stools; moderate dehydration.'),
p('Distinguishing features: abdominal pain (constant or cramping, periumbilical/epigastric); profuse, foul-smelling stool (sometimes with blood/mucus); "gloves and socks" symptom — punctate/maculopapular/urticarial rash on hands, palms, feet, chest, thighs on days 2-6 with subsequent desquamation; possible hepatomegaly; facial hyperemia or pallor; scleritis; conjunctival hyperemia; polyadenopathy.'),
p('To clarify: bacteriological stool culture; stool PCR.'),
empty(),
bold('3. Chronic pancreatitis:'),
p('Similar features: dyspeptic syndrome (nausea, vomiting); loose stools.'),
p('Distinguishing features: connection with alcohol, NSAIDs, hereditary factors; dull epigastric pain radiating to back, worsened after meals, relieved by forward bending; steatorrhea; tenderness at Mayo-Robson points 1 and 2; tenderness in Chauffard\'s zone; long disease history; subsequent nutritional deficiency and diabetes mellitus.'),
p('To clarify: bacteriological stool culture and PCR; abdominal ultrasound (or CT/MRI if needed); fecal pancreatic elastase-1; serum amylase and lipase.'),
empty(),
// Final diagnosis
h1('FINAL CLINICAL DIAGNOSIS'),
p('a) Primary: A08.1. Norovirus infection (Norovirus RNA in stool +), gastroenterocolitis, moderate severity. Dehydration grade II (2b).', { bold: false }),
p('b) Complication of primary: None'),
p('c) Concurrent diagnosis: None'),
empty(),
// Justification
h2('JUSTIFICATION'),
p('The clinical diagnosis was established based on:'),
p('- Characteristic complaints: general weakness, nausea, vomiting, loose stools, abdominal rumbling, fever up to 39°C;'),
p('- Typical disease progression: acute onset;'),
p('- Anamnestic and epidemiological data: ill for 3 days, no travel outside city in past month, no contact with intestinal infection patients;'),
p('- Physical examination findings: signs of gastroenterocolitis (tongue coated white; abdomen tender in epigastrium, periumbilical area, and iliac regions; rumbling; loose watery stools; dyspeptic syndrome); moderate dehydration — 2 points on dehydration scale;'),
p('- Laboratory findings: Norovirus Genotype 2 RNA detected in stool by PCR; coprogram — liquid stool, alkaline pH, leukocytes in stool.'),
empty(),
// Progress notes
h1('PROGRESS NOTES'),
empty(),
// Progress notes table
new Table({
width: { size: 9000, type: WidthType.DXA },
rows: [
new TableRow({
children: [
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1200, type: WidthType.DXA },
shading: { fill: 'D0E4F7' },
children: [new Paragraph({ children: [new TextRun({ text: 'Date', bold: true, size: 20 })] })]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 6200, type: WidthType.DXA },
shading: { fill: 'D0E4F7' },
children: [new Paragraph({ children: [new TextRun({ text: 'Progress Note', bold: true, size: 20 })] })]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1600, type: WidthType.DXA },
shading: { fill: 'D0E4F7' },
children: [new Paragraph({ children: [new TextRun({ text: 'Treatment', bold: true, size: 20 })] })]
}),
]
}),
new TableRow({
children: [
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1200, type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: '22.04.2025', bold: true, size: 19 })] })]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 6200, type: WidthType.DXA },
children: [
new Paragraph({ children: [new TextRun({ text: 'Complaints: general weakness, abdominal discomfort, loose stools.', size: 19 })] }),
new Paragraph({ children: [new TextRun({ text: 'Condition: moderate severity. Consciousness clear, GCS 15. Temperature: 37.0°C. No meningeal or focal CNS signs. Skin and sclerae normal, no rash. Musculoskeletal system intact. Oropharynx not hyperemic; tonsils not enlarged; no coatings. Tongue moist, coated white. Peripheral lymph nodes not enlarged. Breathing vesicular, no wheezing. RR: 16/min; SpO₂: 98%. HR: 89/min; BP: 120/80 mmHg. Abdomen soft, tender in periumbilical area. Stool: 5×/day, loose. CVA tenderness negative. Adequate diuresis.', size: 19 })] }),
]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1600, type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: 'See prescription sheet', size: 19 })] })]
}),
]
}),
new TableRow({
children: [
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1200, type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: '23.04.2025', bold: true, size: 19 })] })]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 6200, type: WidthType.DXA },
children: [
new Paragraph({ children: [new TextRun({ text: 'Complaints: general weakness, loose stools.', size: 19 })] }),
new Paragraph({ children: [new TextRun({ text: 'Condition: moderate severity. Consciousness clear, GCS 15. Position active. Temperature: 36.5°C. No meningeal or focal CNS signs. Skin and sclerae normal, no rash; turgor preserved. Oropharynx not hyperemic; no coatings. Tongue moist, coated white. Breathing vesicular, no wheezing. RR: 16/min; SpO₂: 98%. HR: 80/min; BP: 110/70 mmHg. Abdomen soft, tender periumbilically. No peritoneal irritation signs. Stool loose. CVA tenderness negative. Adequate diuresis.', size: 19 })] }),
]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1600, type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: 'See prescription sheet', size: 19 })] })]
}),
]
}),
new TableRow({
children: [
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1200, type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: '24.04.2025', bold: true, size: 19 })] })]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 6200, type: WidthType.DXA },
children: [
new Paragraph({ children: [new TextRun({ text: 'Complaints: none actively presented.', size: 19 })] }),
new Paragraph({ children: [new TextRun({ text: 'Condition: satisfactory. Consciousness clear, GCS 15. Position active. Temperature: 36.8°C. No meningeal or focal CNS signs. Skin and sclerae normal, no rash; turgor preserved. Oropharynx not hyperemic; no coatings. Tongue moist, clean. Breathing vesicular, no wheezing. RR: 16/min; SpO₂: 98%. HR: 72/min; BP: 110/70 mmHg. Abdomen soft, non-tender. No peritoneal irritation signs. Stool: semi-formed, 1×/day, no admixtures. CVA tenderness negative. Adequate diuresis.', size: 19 })] }),
]
}),
new TableCell({
borders: { top: { style: BorderStyle.SINGLE, size: 1 }, bottom: { style: BorderStyle.SINGLE, size: 1 }, left: { style: BorderStyle.SINGLE, size: 1 }, right: { style: BorderStyle.SINGLE, size: 1 } },
width: { size: 1600, type: WidthType.DXA },
children: [new Paragraph({ children: [new TextRun({ text: 'See prescription sheet', size: 19 })] })]
}),
]
}),
]
}),
empty(),
// Treatment
h1('TREATMENT'),
empty(),
new Paragraph({ children: [new TextRun({ text: 'General Treatment (Base Therapy):', bold: true, underline: { type: UnderlineType.SINGLE }, size: 22 })] }),
p('Regimen: Semi-bed rest.'),
p('Dietary principles: Bland diet — meals 5-6×/day in small portions. Exclude spicy, fatty, fried, smoked, pickled foods, and fresh fruits/vegetables. Recommended: milk, thin grain-milk soups with butter, thin pureed milk porridges, soft-boiled eggs or steamed omelets, steamed soufflé of lean fish and meat, unsalted butter or olive oil, cream, berry/fruit/milk jellies, carrot and fruit juices, rosehip decoction, weak tea with milk.'),
empty(),
new Paragraph({ children: [new TextRun({ text: 'Etiotropic Therapy:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 22 })] }),
p('None.'),
empty(),
new Paragraph({ children: [new TextRun({ text: 'Pathogenetic Therapy:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 22 })] }),
p('- Rehydration (IV): Sodium chloride + Potassium chloride + Sodium acetate (Acesol) — 400 mL IV, once daily — 4 days.'),
p('- Rehydration (oral): Sodium chloride + Potassium chloride + Sodium citrate + Dextrose (Rehydron) — 1000 mL orally, once daily — 5 days.'),
p('- Enzyme therapy: Pancreatin — 10,000 U (1 capsule) 3× daily orally before meals — 5 days.'),
p('- Probiotics: Bifidumbacterin — 5 doses (1 sachet) 2× daily orally — 5 days.'),
p('- Adsorbents: Dioctahedral smectite — 3.0 g (1 sachet) 3× daily orally — 5 days.'),
empty(),
new Paragraph({ children: [new TextRun({ text: 'Symptomatic Therapy:', bold: true, underline: { type: UnderlineType.SINGLE }, size: 22 })] }),
p('- Antispasmodics: Drotaverine — 40 mg (1 tablet) 3× daily orally — 5 days.'),
p('- Antidiarrheal therapy: Calcium gluconate — 0.5 g (1 tablet) 3× daily orally — 3 days.'),
empty(),
// Epicrisis
h1('DISCHARGE SUMMARY (EPICRISIS)'),
p('Patient: (confidential) 24 years old (03.07.2000)'),
p('Treated at BUZOO "ICH No. 1 named after Dalmatov D.M." from 21.04.2025 to 25.04.2025.'),
empty(),
bold('Diagnosis:'),
p('Primary: A08.1. Norovirus infection (Norovirus RNA in stool +), gastroenterocolitis, moderate severity. Dehydration grade II (2b).'),
p('Complication: None | Concurrent: None'),
empty(),
bold('Basis for diagnosis:'),
p('Complaints (general weakness, nausea, vomiting, loose stools, abdominal rumbling, fever up to 39°C); typical acute onset; anamnestic and epidemiological data; physical findings (signs of gastroenterocolitis, moderate dehydration — 2 points); laboratory findings (Norovirus Genotype 2 RNA detected by PCR in stool; coprogram — liquid stool, alkaline pH, leukocytes in stool).'),
empty(),
bold('Summary of laboratory/instrumental results:'),
p('- CBC 21.04.2025: neutrophilic leukocytosis, relative lymphopenia, elevated ESR.'),
p('- CBC 25.04.2025: elevated ESR, reduced hematocrit.'),
p('- Urinalysis 21.04.2025: proteinuria, microhematuria.'),
p('- Urinalysis 25.04.2025: within normal limits.'),
p('- Biochemistry 21.04.2025: hyperglycemia, elevated AST.'),
p('- Biochemistry 25.04.2025: hyperbilirubinemia (indirect fraction), elevated ALT.'),
p('- Electrolytes 21.04.2025 & 25.04.2025: no pathological changes.'),
p('- HIV ELISA 21.04.2025: negative.'),
p('- Hepatitis B/C markers 21.04.2025: all negative.'),
p('- Stool bacteriology 22.04.2025: no salmonella, shigella, or coli-infection pathogens isolated.'),
p('- SARS-CoV-2 rapid antigen 21.04.2025: negative.'),
p('- Coprogram 22.04.2025: leukocytes 50-60/HPF, liquid stool, alkaline pH.'),
p('- Rotavirus type 2 ELISA 23.04.2025: negative.'),
p('- PCR (stool) 23.04.2025: Norovirus Genotype 2 RNA DETECTED.'),
p('- ECG 21.04.2025: sinus rhythm, regular; HR 69/min; no axis deviation; shortened PQ interval.'),
empty(),
bold('Treatment received:'),
p('Rehydration (Rehydron, Acesol); antispasmodics (drotaverine 40 mg 3×/day); enzymes (pancreatin 10,000 U 3×/day); adsorbents (dioctahedral smectite 3.0 g 3×/day); antidiarrheal therapy (calcium gluconate 0.5 g 3×/day); probiotics (Bifidumbacterin 5 doses 2×/day).'),
empty(),
p('The patient showed improvement with resolution of complaints and symptoms during treatment.'),
bold('Discharged in satisfactory condition.'),
empty(),
// Recommendations
h1('DISCHARGE RECOMMENDATIONS (Outpatient Follow-up)'),
p('1. Bland diet for 7-10 days.'),
p('2. Pancreatin — 1 capsule (10,000 U) 3× daily before meals for 10-14 days.'),
p('3. Bifidumbacterin — 5 doses (1 sachet) 2× daily for 2-3 weeks.'),
p('4. Multivitamins — 1 tablet once daily for 1 month.'),
p('5. Repeat CBC, urinalysis, biochemistry, and blood glucose at outpatient clinic in 7 days.'),
p('6. Follow-up with general practitioner at place of residence.'),
empty(),
empty(),
p('Physician\'s signature: ___________________________'),
];
const doc = new Document({
sections: [{
properties: {
page: {
margin: { top: 1000, right: 900, bottom: 1000, left: 1000 }
}
},
children
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/medical-history/Medical_History_English.docx', buffer);
console.log('Done!');
}).catch(err => {
console.error(err);
process.exit(1);
});
cd /home/daytona/workspace/medical-history && node create_doc.js 2>&1
python /home/daytona/skills/docx/validate.py /home/daytona/workspace/medical-his…
ls /home/daytona/workspace/medical-history/ && python3 -c " import zipfile path …
Medical History English
Word Document · DOCX
Make a temperature graphics of this patient
cd /home/daytona/workspace/medical-history && python3 -c " import matplotlib mat…
temperature chart
Image · PNG
| Date | Setting | Temperature |
|---|---|---|
| 18.04.2025 | Illness onset (home) | 39.0°C |
| 21.04.2025 | Hospital admission | 38.4°C |
| 22.04.2025 | Day 1 (inpatient) | 37.0°C |
| 23.04.2025 | Day 2 (inpatient) | 36.5°C |
| 24.04.2025 | Day 3 (inpatient) | 36.8°C |
| 25.04.2025 | Discharge | 36.6°C |
Make a temperature pulse and oxygen graphics without Saturday and Sunday
cd /home/daytona/workspace/medical-history && python3 << 'EOF' import matplotlib…
vitals chart
Image · PNG