My report
| Medication | Dose | Frequency | Duration |
|---|---|---|---|
| Mexidol (antioxidant/neuroprotective) | 125 mg | 1 tablet, 3 times/day | 2-4 weeks |
| Meloxicam (NSAID/anti-inflammatory) | 7.5 mg | 1 time/day | 7-10 days |
| Omez (omeprazole - stomach protector) | 1 capsule | Once daily, morning, 30 min before meals | During meloxicam intake (handwritten note) |
| Afobazole (anxiolytic) | 10 mg | 1 tablet, 3 times/day | 1 month |
Create a summary document of this diagnosis and medications
mkdir -p /tmp/workspace/sunil-medical && ls /tmp/workspace/sunil-medical/
python3 << 'EOF' from docx import Document from docx.shared import Pt, Inches, RGBColor from docx.enum.text import WD_ALIGN_PARAGRAPH from docx.oxml.ns import qn from docx.oxml import OxmlElement doc = Document() # Set margins from docx.shared import Cm section = doc.sections[0] section.top_margin = Cm(2) section.bottom_margin = Cm(2) section.left_margin = Cm(2.5) section.right_margin = Cm(2.5) # Default style normal_style = doc.styles['Normal'] normal_style.font.name = 'Arial' normal_style.font.size = Pt(11) # Helper: add a shaded table row header def add_section_header(doc, text, color="1F4E79"): p = doc.add_paragraph() p.paragraph_format.space_before = Pt(10) p.paragraph_format.space_after = Pt(4) run = p.add_run(text) run.bold = True run.font.size = Pt(13) run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) # shade the paragraph pPr = p._p.get_or_add_pPr() shd = OxmlElement('w:shd') shd.set(qn('w:val'), 'clear') shd.set(qn('w:color'), 'auto') shd.set(qn('w:fill'), color) pPr.append(shd) return p def add_info_row(doc, label, value): p = doc.add_paragraph() p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(1) label_run = p.add_run(f"{label}: ") label_run.bold = True label_run.font.size = Pt(11) val_run = p.add_run(value) val_run.font.size = Pt(11) def add_bullet(doc, text): p = doc.add_paragraph(style='List Bullet') p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(2) run = p.add_run(text) run.font.size = Pt(11) # ─── TITLE ─────────────────────────────────────────────────────────────────── title = doc.add_paragraph() title.alignment = WD_ALIGN_PARAGRAPH.CENTER title_run = title.add_run("Medical Consultation Summary") title_run.bold = True title_run.font.size = Pt(20) title_run.font.color.rgb = RGBColor(0x1F, 0x4E, 0x79) subtitle = doc.add_paragraph() subtitle.alignment = WD_ALIGN_PARAGRAPH.CENTER sub_run = subtitle.add_run("Neurology Department - RZD-Medicine Hospital, Pskov") sub_run.font.size = Pt(11) sub_run.font.color.rgb = RGBColor(0x44, 0x72, 0xC4) sub_run.italic = True doc.add_paragraph() # spacer # ─── PATIENT INFO ───────────────────────────────────────────────────────────── add_section_header(doc, " Patient Information") add_info_row(doc, "Patient Name", "Sunil Kumar") add_info_row(doc, "Date of Birth", "12 July 2005") add_info_row(doc, "Chart Number", "101000000007531") add_info_row(doc, "Date of Appointment", "09 June 2026") add_info_row(doc, "Attending Doctor", "Dr. Dubrovskaya Dina Vladimirovna") add_info_row(doc, "Specialty", "Neurology") add_info_row(doc, "Work Capacity", "Fit for work") # ─── DIAGNOSES ─────────────────────────────────────────────────────────────── add_section_header(doc, " Clinical Diagnoses") diagnoses = [ ("Autonomic Dysfunction", "Disruption of the autonomic nervous system which regulates involuntary functions such as heart rate, blood pressure, and digestion."), ("Cephalgic Syndrome", "A pattern of recurring headaches (cephalgia = head pain)."), ("Degenerative-Dystrophic Disease of the Cervical Spine (DDZP)", "Wear and tear changes in the cervical (neck) vertebrae and discs, which can cause pain and nerve irritation."), ("Astheno-Vegetative Syndrome", "A condition characterized by fatigue, weakness, sleep disturbance, and blood pressure fluctuations linked to nervous system dysfunction."), ] for name, desc in diagnoses: p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.2) p.paragraph_format.space_before = Pt(4) p.paragraph_format.space_after = Pt(2) name_run = p.add_run(f"{name}: ") name_run.bold = True name_run.font.size = Pt(11) desc_run = p.add_run(desc) desc_run.font.size = Pt(11) # ─── INVESTIGATIONS ────────────────────────────────────────────────────────── add_section_header(doc, " Further Investigations Ordered") add_bullet(doc, "X-ray of the cervical spine - to assess structural changes in the neck vertebrae.") add_bullet(doc, "Duplex ultrasound (USDS) of the brachiocephalic vessels - to check blood flow to the brain and neck.") # ─── MEDICATIONS ───────────────────────────────────────────────────────────── add_section_header(doc, " Prescribed Medications") # Table for medications table = doc.add_table(rows=1, cols=4) table.style = 'Table Grid' # Header row hdr_cells = table.rows[0].cells headers = ['Medication', 'Dose', 'Frequency', 'Duration'] for i, h in enumerate(headers): cell = hdr_cells[i] cell.text = '' p = cell.paragraphs[0] run = p.add_run(h) run.bold = True run.font.size = Pt(10) run.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) # shade header cells tc = cell._tc tcPr = tc.get_or_add_tcPr() shd = OxmlElement('w:shd') shd.set(qn('w:val'), 'clear') shd.set(qn('w:color'), 'auto') shd.set(qn('w:fill'), '2E75B6') tcPr.append(shd) # Data rows meds = [ ("Mexidol\n(Antioxidant / Neuroprotective)", "125 mg", "1 tablet, 3 times a day", "2-4 weeks"), ("Meloxicam\n(NSAID / Anti-inflammatory)", "7.5 mg", "1 time a day", "7-10 days"), ("Omez (Omeprazole)\n(Stomach protector)", "1 capsule", "Once daily, morning\n30 min before meals", "During Meloxicam course"), ("Afobazole\n(Mild Anxiolytic)", "10 mg", "1 tablet, 3 times a day", "1 month"), ] row_colors = ['D9E2F3', 'FFFFFF', 'D9E2F3', 'FFFFFF'] for idx, (med, dose, freq, dur) in enumerate(meds): row = table.add_row() data = [med, dose, freq, dur] for j, val in enumerate(data): cell = row.cells[j] cell.text = '' p = cell.paragraphs[0] run = p.add_run(val) run.font.size = Pt(10) if j == 0: run.bold = True # row shading tc = cell._tc tcPr = tc.get_or_add_tcPr() shd = OxmlElement('w:shd') shd.set(qn('w:val'), 'clear') shd.set(qn('w:color'), 'auto') shd.set(qn('w:fill'), row_colors[idx]) tcPr.append(shd) # Set column widths from docx.shared import Cm col_widths = [Cm(5), Cm(2.5), Cm(5), Cm(4.5)] for row in table.rows: for i, cell in enumerate(row.cells): cell.width = col_widths[i] doc.add_paragraph() # spacer # ─── GENERAL RECOMMENDATIONS ───────────────────────────────────────────────── add_section_header(doc, " General Recommendations") add_bullet(doc, "Monitor blood pressure regularly (at least 3 times per day).") add_bullet(doc, "Follow up with a general practitioner for ongoing blood pressure management.") add_bullet(doc, "Return for a follow-up appointment after completing the diagnostic tests (X-ray and ultrasound), or sooner if symptoms worsen.") # ─── NOTES ─────────────────────────────────────────────────────────────────── add_section_header(doc, " Important Notes") p = doc.add_paragraph() p.paragraph_format.left_indent = Inches(0.2) note_run = p.add_run( "Omez (omeprazole) is prescribed alongside Meloxicam to protect the stomach lining, " "as NSAIDs like Meloxicam can cause gastric irritation or ulcers. " "Take Omez every morning 30 minutes before your first meal for the entire duration of the Meloxicam course." ) note_run.font.size = Pt(11) note_run.italic = True # ─── FOOTER NOTE ───────────────────────────────────────────────────────────── doc.add_paragraph() footer_p = doc.add_paragraph() footer_p.alignment = WD_ALIGN_PARAGRAPH.CENTER footer_run = footer_p.add_run("This document is a translated summary of the original Russian-language medical report issued by RZD-Medicine Hospital, Pskov | Appointment date: 09.06.2026") footer_run.font.size = Pt(9) footer_run.font.color.rgb = RGBColor(0x80, 0x80, 0x80) footer_run.italic = True # Save out_path = "/tmp/workspace/sunil-medical/Sunil_Kumar_Medical_Summary.docx" doc.save(out_path) print(f"Saved: {out_path}") EOF
Sunil Kumar Medical Summary
Word Document · DOCX