kindly interpret the VNg resulst with diagnosis and diffrential diagnosis
ls -la "/tmp/workspace/attachments/29a932e9-b2ef-4699-b7a9-c30b90b6addd/"
**/*.md in /skills
python3 -c " import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/29a932e9-b2ef-4699-b7a9-c30b90b6addd/COL AVINASH VERMA.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text) print() "
VNG videonystagmography interpretation abnormal gaze nystagmus positional nystagmus Dix-Hallpike smooth pursuit reduced gain
| Parameter | Right Eye | Left Eye | Normal |
|---|---|---|---|
| Horizontal Velocity | 528.27°/s | 686.73°/s | >400°/s |
| Horizontal Precision | 78.02 | 79.42 | >80% |
| Latency | 237.5 ms | 257.5 ms | <250 ms |
| Vertical Velocity | 220.94°/s | 297.83°/s | >200°/s |
| Vertical Precision | 37.67 | 40.51 | >70% |
| Direction | Right Eye Gain | Left Eye Gain | Normal |
|---|---|---|---|
| Rightward Horizontal | 0.53 | 0.61 | ≥0.7-0.8 |
| Leftward Horizontal | 0.76 | 0.73 | ≥0.7-0.8 |
| Upward Vertical | 0.54 | 0.44 | ≥0.6 |
| Downward Vertical | 0.41 | 0.42 | ≥0.6 |
| Condition | Right Eye Gain | Left Eye Gain |
|---|---|---|
| Left to Right (10°) | 1.17 | 1.12 |
| Right to Left (10°) | 0.92 | 1.06 |
| Top to Bottom | 0.74 | 0.76 |
| Bottom to Top | 1.13 | 0.99 |
| Gaze Direction | Findings |
|---|---|
| Center (with fixation) | Normal |
| Left (with fixation) | Right eye: SPV 5.33°/s, amplitude 2.64°, frequency 1.08 Hz - GAZE NYSTAGMUS PRESENT |
| Right (with fixation) | Normal |
| Up (with fixation) | Normal |
| Down (with fixation) | Normal |
| Down (without fixation) | Both eyes: SPV ~5-6°/s, frequency 0.88-0.60 Hz - NYSTAGMUS PRESENT |
| Position | Findings |
|---|---|
| Yaw Right | Negative |
| Yaw Left | Negative |
| Pitch Forward | Negative |
| Pitch Backward (head extension) | Right eye: Horizontal SPV 7.28°/s, Vertical SPV -8.85°/s, FPD 60°, Freq 2.64 Hz - NYSTAGMUS |
| Roll Right | Right eye: Horizontal SPV -2.68°/s, Freq 1.14 Hz - mild nystagmus |
| Roll Left | Negative |
| Maneuver | Position | Findings |
|---|---|---|
| Dix-Hallpike Right (sitting, head right) | Negative | |
| Dix-Hallpike Right (supine, head ext + right) | Negative | |
| Dix-Hallpike Left (sitting, head left) | Negative | |
| Dix-Hallpike Left (supine, head ext + left) | Right eye: Vertical SPV 12.57°/s, amp 3.58°, freq 1.09 Hz; Left eye: Horizontal SPV -16.96°/s, amp -2.08°, freq 1.18 Hz - NYSTAGMUS | |
| Dix-Hallpike Left (sit, return) | Left eye: Vertical SPV 3.51°/s, amp 3.46°, freq 1.05 Hz - residual nystagmus |
| Trial | Deviation |
|---|---|
| Clockwise Trial 1 | -88° (Left) - MARKEDLY ABNORMAL |
| Clockwise Trial 2 | 0° - Normal |
| Anticlockwise | -4° (Left) - within normal limits |
| Blank Background | -2° (Left) - within normal limits |
| Test Domain | Finding | Significance |
|---|---|---|
| Spontaneous nystagmus | Absent | Normal - no active peripheral lesion |
| Saccades | Vertical precision markedly reduced | Central (cerebellar) |
| Smooth pursuit | Bilaterally reduced, especially vertical | Central (cerebellar/brainstem) |
| Gaze nystagmus | Left gaze + downward gaze (without fixation) | Central |
| Head shake / hyperventilation | Negative | No unilateral peripheral UVH |
| Pitch backward nystagmus | Present (matches chief complaint) | Cervicogenic / central positional |
| Left Dix-Hallpike | Mixed horizontal + vertical nystagmus | Horizontal canal BPPV vs. central positional |
| SVV | Normal (excluding outlier trial) | No major otolith/brainstem tilt |
Important caveat: The VNG report contains no formal interpretation or "Impression" section from the performing clinician - that field is blank. The above is a structured clinical interpretation based on the numerical data and waveform descriptions extracted from the report, in the context of this patient's history. Final clinical decisions should rest with the treating neurologist and ENT specialist reviewing the tracings directly.
Generate a summary document of VNG findings and differential diagnosis to share with neurology
mkdir -p /tmp/workspace/col-avinash-vng && ls -la /tmp/workspace/col-avinash-vng/
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 import datetime doc = Document() # --- Page margins --- from docx.shared import Cm section = doc.sections[0] section.top_margin = Cm(2.0) section.bottom_margin = Cm(2.0) 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(10.5) # Helper: add a styled heading def add_heading(doc, text, level=1, color=None): h = doc.add_heading(text, level=level) h.alignment = WD_ALIGN_PARAGRAPH.LEFT for run in h.runs: run.font.name = 'Arial' if color: run.font.color.rgb = RGBColor(*color) return h # Helper: add a colored horizontal rule via border def add_rule(doc): p = doc.add_paragraph() p.paragraph_format.space_before = Pt(0) p.paragraph_format.space_after = Pt(0) pPr = p._p.get_or_add_pPr() pBdr = OxmlElement('w:pBdr') bottom = OxmlElement('w:bottom') bottom.set(qn('w:val'), 'single') bottom.set(qn('w:sz'), '6') bottom.set(qn('w:space'), '1') bottom.set(qn('w:color'), '2E4057') pBdr.append(bottom) pPr.append(pBdr) return p # ============================================= # HEADER BLOCK # ============================================= # Institution line inst = doc.add_paragraph() inst.alignment = WD_ALIGN_PARAGRAPH.CENTER r = inst.add_run('NEUROLOGY REFERRAL DOCUMENT') r.font.name = 'Arial' r.font.size = Pt(7) r.font.color.rgb = RGBColor(0x8B, 0x8B, 0x8B) # Title title = doc.add_paragraph() title.alignment = WD_ALIGN_PARAGRAPH.CENTER title.paragraph_format.space_before = Pt(2) title.paragraph_format.space_after = Pt(2) r = title.add_run('VNG FINDINGS & DIFFERENTIAL DIAGNOSIS SUMMARY') r.font.name = 'Arial' r.font.bold = True r.font.size = Pt(16) r.font.color.rgb = RGBColor(0x2E, 0x40, 0x57) subtitle = doc.add_paragraph() subtitle.alignment = WD_ALIGN_PARAGRAPH.CENTER subtitle.paragraph_format.space_before = Pt(0) subtitle.paragraph_format.space_after = Pt(4) r = subtitle.add_run('Prepared for Neurology Department Review') r.font.name = 'Arial' r.font.italic = True r.font.size = Pt(10) r.font.color.rgb = RGBColor(0x55, 0x55, 0x55) add_rule(doc) # ============================================= # PATIENT DEMOGRAPHICS TABLE # ============================================= doc.add_paragraph() tbl_head = doc.add_paragraph() r = tbl_head.add_run('PATIENT INFORMATION') r.font.name = 'Arial' r.font.bold = True r.font.size = Pt(10) r.font.color.rgb = RGBColor(0x2E, 0x40, 0x57) table = doc.add_table(rows=2, cols=4) table.style = 'Table Grid' table.autofit = True demo_data = [ ('Patient Name', 'Col Avinash Verma', 'Patient ID', 'CCDA00403 / EHPG.830955'), ('Age / Sex', '79 Years / Male', 'VNG Date', '15 July 2026'), ] header_color = RGBColor(0x2E, 0x40, 0x57) for row_idx, row_data in enumerate(demo_data): row = table.rows[row_idx] for col_idx, text in enumerate(row_data): cell = row.cells[col_idx] cell.text = '' p = cell.paragraphs[0] r = p.add_run(text) r.font.name = 'Arial' r.font.size = Pt(10) if col_idx % 2 == 0: r.font.bold = True r.font.color.rgb = header_color else: r.font.bold = False info_data = [ ('Referring Physician', 'Dr. K.M. Hassan, Senior Director Neurology, Max Noida 128', 'VNG Performed at', 'Priority Hearing Care'), ('Chief Complaint', 'Dizziness & blackouts on neck extension x 3 yrs; daytime sleepiness', 'Referred to', 'Neurology Department'), ] for row_data in info_data: row = table.add_row() for col_idx, text in enumerate(row_data): cell = row.cells[col_idx] cell.text = '' p = cell.paragraphs[0] r = p.add_run(text) r.font.name = 'Arial' r.font.size = Pt(10) if col_idx % 2 == 0: r.font.bold = True r.font.color.rgb = header_color doc.add_paragraph() # ============================================= # CLINICAL BACKGROUND # ============================================= add_heading(doc, '1. CLINICAL BACKGROUND', level=2, color=(0x2E, 0x40, 0x57)) add_rule(doc) bg_items = [ ('Chief Complaints:', 'Transient dizziness and occasional blackouts specifically on neck extension for 3 years. Dizziness while looking upward for 2-3 years. Excessive daytime sleepiness and snoring for several years.'), ('Past Medical History:', 'Hypertension (HTN), Diabetes Mellitus (DM), Benign Prostatic Hyperplasia (BPH), Cervical Spondylosis.'), ('No prior MRI:', 'Confirmed by patient.'), ('Relevant Labs:', 'BSF 147 mg/dL | HbA1c 6.8% | Vit B12 208 pg/mL (low-normal) | Vit D 67.8 | Creatinine 1.5 mg/dL'), ('Vitals at Neurology Visit:', 'BP 145/67 mmHg | Pulse 77/min | SpO2 98% | Weight 77.8 kg'), ('Neurological Examination:', 'No focal neurological deficit (NFD) recorded.'), ] for label, value in bg_items: p = doc.add_paragraph() p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(1) r = p.add_run(label + ' ') r.font.bold = True r.font.name = 'Arial' r.font.size = Pt(10.5) r2 = p.add_run(value) r2.font.name = 'Arial' r2.font.size = Pt(10.5) doc.add_paragraph() # ============================================= # VNG FINDINGS TABLE # ============================================= add_heading(doc, '2. VNG TEST RESULTS', level=2, color=(0x2E, 0x40, 0x57)) add_rule(doc) note_p = doc.add_paragraph() r = note_p.add_run('Test performed on 15 July 2026 at Priority Hearing Care (Patient ID: CCDA00403). The VNG report impression field was left blank by the performing clinician; this document provides clinical interpretation of the recorded data.') r.font.name = 'Arial' r.font.size = Pt(10) r.font.italic = True r.font.color.rgb = RGBColor(0x55, 0x55, 0x55) doc.add_paragraph() # Main VNG findings table vng_table = doc.add_table(rows=1, cols=4) vng_table.style = 'Table Grid' vng_table.autofit = False # Column widths col_widths = [Inches(1.6), Inches(2.4), Inches(1.2), Inches(2.2)] for i, w in enumerate(col_widths): for cell in vng_table.columns[i].cells: cell.width = w # Header row hdr = vng_table.rows[0] hdr_labels = ['Test', 'Key Parameters', 'Result', 'Clinical Significance'] hdr_fill_color = '2E4057' for i, label in enumerate(hdr_labels): cell = hdr.cells[i] # fill header 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'), hdr_fill_color) tcPr.append(shd) cell.text = '' p = cell.paragraphs[0] r = p.add_run(label) r.font.bold = True r.font.name = 'Arial' r.font.size = Pt(10) r.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) # Data rows: (Test, Parameters, Result [NORMAL/ABNORMAL/BORDERLINE], Significance) findings = [ ( 'Spontaneous Nystagmus\n(Light & Dark)', 'SPV: Absent\nAmplitude: Absent\nFrequency: Absent', 'NORMAL', 'No resting nystagmus. Argues against active uncompensated peripheral vestibular lesion.' ), ( 'Saccades\n(Horizontal)', 'Velocity: R 528°/s / L 687°/s\nPrecision: R 78% / L 79%\nLatency: R 237ms / L 258ms', 'BORDERLINE', 'Precision mildly reduced (normal >80%). Velocity adequate. Slight left latency prolongation.' ), ( 'Saccades\n(Vertical)', 'Velocity: R 221°/s / L 298°/s\nPrecision: R 37.7% / L 40.5%\nLatency: R 217ms / L 240ms', 'ABNORMAL', 'Vertical precision markedly reduced (<50%, normal >70%). Indicates cerebellar/central saccadic dysmetria.' ), ( 'Smooth Pursuit\n(Horizontal)', 'Rightward Gain: R 0.53 / L 0.61\nLeftward Gain: R 0.76 / L 0.73', 'ABNORMAL', 'Rightward pursuit gain significantly reduced bilaterally (normal ≥0.7). Asymmetric deficit suggests central (cerebellar hemisphere) lesion.' ), ( 'Smooth Pursuit\n(Vertical)', 'Upward Gain: R 0.54 / L 0.44\nDownward Gain: R 0.41 / L 0.42', 'ABNORMAL', 'Markedly reduced vertical pursuit bilaterally (normal ≥0.6). Reduced vertical smooth pursuit is a reliable central vestibular sign.' ), ( 'Optokinetic\nTest (OKN)', 'Horizontal: Gains 0.92–1.17\nVertical: Gains 0.74–1.13', 'NORMAL', 'Horizontal OKN within normal limits. Mild reduction in downward OKN consistent with smooth pursuit findings.' ), ( 'Head Shake\nNystagmus', 'SPV: Absent\nAll parameters negative', 'NORMAL', 'No post-head-shake nystagmus. No significant unilateral peripheral vestibular hypofunction at rest.' ), ( 'Hyperventilation\nNystagmus', 'SPV: Absent', 'NORMAL', 'Negative. No perilymphatic fistula or demyelinating lesion pattern.' ), ( 'Gaze Nystagmus\n(with fixation)', 'Left gaze – Right eye:\nSPV 5.33°/s | Amp 2.64° | Freq 1.08 Hz\nAll other gaze directions: Absent', 'ABNORMAL', 'LEFT GAZE-EVOKED NYSTAGMUS (GEN) with fixation. GEN with fixation = central sign (cerebellum/brainstem). Endpoint nystagmus excluded as it is unilateral (left only).' ), ( 'Gaze Nystagmus\n(without fixation)\nDown gaze', 'Both eyes:\nSPV: R -6.10°/s / L -5.09°/s\nAmp: R -4.40° / L -4.57°\nFreq: R 0.88 Hz / L 0.60 Hz', 'ABNORMAL', 'DOWN-GAZE NYSTAGMUS (without fixation) bilateral. Combined with reduced vertical smooth pursuit = strong central (brainstem/cerebellar) indicator.' ), ( 'Positional Test\nPitch Backward\n(Head Extension)', 'Right eye:\nHorizontal SPV 7.28°/s | Amp 1.60°\nVertical SPV -8.85°/s | Amp -2.78°\nFreq 2.64 Hz | FPD 60°', 'ABNORMAL\n★ KEY FINDING', 'NYSTAGMUS TRIGGERED BY HEAD EXTENSION. Directly correlates with chief complaint of dizziness on neck extension. Strongly supports vertebrobasilar/cervicogenic mechanism.' ), ( 'Dix-Hallpike\n(Right side)', 'All positions: Absent nystagmus', 'NORMAL', 'No BPPV on right side. Right posterior canal intact.' ), ( 'Dix-Hallpike\n(Left side – supine,\nhead ext + left)', 'Right eye: Vertical SPV 12.57°/s | Amp 3.58° | Freq 1.09 Hz\nLeft eye: Horizontal SPV -16.96°/s | Amp -2.08° | Freq 1.18 Hz', 'ABNORMAL', 'Mixed horizontal + vertical nystagmus. Atypical for posterior canal BPPV (which produces torsional-vertical). Suggests horizontal canal BPPV or central positional nystagmus.' ), ( 'Dix-Hallpike\n(Return to sit,\nLeft side)', 'Left eye: Vertical SPV 3.51°/s | Amp 3.46° | Freq 1.05 Hz', 'ABNORMAL', 'Residual nystagmus on return to upright. Persistence weakens classic peripheral BPPV pattern. Supports central or horizontal canal BPPV.' ), ( 'Positional Test\nRoll Right', 'Right eye: Horizontal SPV -2.68°/s\nFreq 1.14 Hz', 'BORDERLINE', 'Mild horizontal nystagmus on rightward roll. SPV <3°/s; borderline significance. May reflect early horizontal canal BPPV or central positional change.' ), ( 'Subjective Visual\nVertical (SVV)', 'Trial 1 CW: -88° (outlier/artifact)\nTrial 2 CW: 0°\nACW: -4°\nBlank: -2°', 'NORMAL\n(excl. outlier)', 'SVV essentially normal when outlier first trial excluded (likely patient error). Normal SVV argues against significant utricular dysfunction or major brainstem tilt lesion.' ), ] result_colors = { 'NORMAL': RGBColor(0x00, 0x70, 0x2F), 'BORDERLINE': RGBColor(0xB8, 0x86, 0x00), 'ABNORMAL': RGBColor(0xC0, 0x00, 0x00), 'ABNORMAL\n★ KEY FINDING': RGBColor(0xC0, 0x00, 0x00), 'NORMAL\n(excl. outlier)': RGBColor(0x00, 0x70, 0x2F), } for row_data in findings: row = vng_table.add_row() for i, text in enumerate(row_data): cell = row.cells[i] cell.text = '' p = cell.paragraphs[0] r = p.add_run(text) r.font.name = 'Arial' r.font.size = Pt(9.5) if i == 2: # Result column r.font.bold = True r.font.color.rgb = result_colors.get(text, RGBColor(0, 0, 0)) if i == 0: r.font.bold = True doc.add_paragraph() # ============================================= # OVERALL SUMMARY BOX # ============================================= add_heading(doc, '3. OVERALL VNG INTERPRETATION', level=2, color=(0x2E, 0x40, 0x57)) add_rule(doc) summary_table = doc.add_table(rows=1, cols=2) summary_table.style = 'Table Grid' summary_table.autofit = False summary_table.columns[0].width = Inches(2.5) summary_table.columns[1].width = Inches(5.0) sum_hdr = summary_table.rows[0] for lbl, cell in zip(['Domain', 'Interpretation'], sum_hdr.cells): cell.text = '' 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'), '2E4057') tcPr.append(shd) p = cell.paragraphs[0] r = p.add_run(lbl) r.font.bold = True r.font.name = 'Arial' r.font.size = Pt(10) r.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) summary_rows = [ ('Peripheral vestibular function', 'No spontaneous nystagmus; no head-shake nystagmus → No active peripheral lesion at rest'), ('Oculomotor (central)', 'Bilateral reduced vertical smooth pursuit + gaze-evoked nystagmus (left) + down-gaze nystagmus without fixation → CENTRAL VESTIBULAR INVOLVEMENT'), ('Positional (dynamic)', 'Pitch-backward nystagmus correlating with head extension complaints → Vertebrobasilar/cervicogenic mechanism likely'), ('BPPV assessment', 'Atypical left Dix-Hallpike (mixed H+V, persistent) → Central positional nystagmus preferred over classic BPPV'), ('Overall pattern', 'CENTRAL VESTIBULAR SYNDROME superimposed on possible cervicogenic contribution'), ] for d, interp in summary_rows: row = summary_table.add_row() c0, c1 = row.cells[0], row.cells[1] c0.text = '' p = c0.paragraphs[0] r = p.add_run(d) r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(10) c1.text = '' p2 = c1.paragraphs[0] r2 = p2.add_run(interp) r2.font.name = 'Arial'; r2.font.size = Pt(10) doc.add_paragraph() # ============================================= # PRIMARY DIAGNOSIS # ============================================= add_heading(doc, '4. PRIMARY DIAGNOSIS', level=2, color=(0x2E, 0x40, 0x57)) add_rule(doc) prim_box = doc.add_table(rows=1, cols=1) prim_box.style = 'Table Grid' prim_cell = prim_box.rows[0].cells[0] prim_cell.text = '' tc = prim_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'), 'FFF3CD') tcPr.append(shd) p = prim_cell.paragraphs[0] r = p.add_run('Central Vestibular Syndrome - Vertebrobasilar Insufficiency (VBI) / Cervicogenic Vestibular Disturbance') r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(11) r.font.color.rgb = RGBColor(0x85, 0x45, 0x00) doc.add_paragraph() rationale_items = [ 'Dizziness and blackouts specifically triggered by neck extension - hallmark of vertebrobasilar insufficiency with vertebral artery compromise at the level of cervical spondylosis.', 'VNG demonstrates gaze-evoked nystagmus (left, with fixation) and down-gaze nystagmus (without fixation) - both are central signs implicating brainstem or cerebellar pathway involvement.', 'Bilaterally reduced vertical smooth pursuit gain - not explained by age alone; a reliable indicator of central vestibular/cerebellar pathology.', 'Pitch-backward positional nystagmus on VNG directly mirrors the patient\'s positional complaint.', 'Multiple vascular risk factors: age 79, HTN (BP 145/67), DM (HbA1c 6.8, BSF 147), cervical spondylosis.', 'No spontaneous or head-shake nystagmus argues against active peripheral labyrinthine pathology as the primary cause.', ] p_rat = doc.add_paragraph() r = p_rat.add_run('Rationale:') r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(10.5) for item in rationale_items: p = doc.add_paragraph(style='List Bullet') p.paragraph_format.left_indent = Inches(0.3) p.paragraph_format.space_before = Pt(1) p.paragraph_format.space_after = Pt(1) r = p.add_run(item) r.font.name = 'Arial'; r.font.size = Pt(10.5) doc.add_paragraph() # ============================================= # DIFFERENTIAL DIAGNOSES # ============================================= add_heading(doc, '5. DIFFERENTIAL DIAGNOSES', level=2, color=(0x2E, 0x40, 0x57)) add_rule(doc) ddx_table = doc.add_table(rows=1, cols=4) ddx_table.style = 'Table Grid' ddx_table.autofit = False ddx_table.columns[0].width = Inches(0.4) ddx_table.columns[1].width = Inches(2.2) ddx_table.columns[2].width = Inches(2.3) ddx_table.columns[3].width = Inches(2.6) hdr_ddx = ddx_table.rows[0] for lbl, cell in zip(['#', 'Diagnosis', 'Supporting Evidence', 'Against / Notes'], hdr_ddx.cells): cell.text = '' 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'), '2E4057') tcPr.append(shd) p = cell.paragraphs[0] r = p.add_run(lbl) r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(10) r.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) ddx_data = [ ('1', 'Vertebrobasilar Insufficiency (VBI)\n[Most Likely - PRIMARY]', 'Extension-triggered symptoms; central VNG (GEN, reduced vertical SP); pitch-backward nystagmus; HTN, DM, age 79; cervical spondylosis', 'No caloric test data; MRI/MRA not yet done to confirm ischemia or vessel stenosis'), ('2', 'Central Positional Nystagmus\n(Cerebellar / Brainstem lesion)', 'Atypical Dix-Hallpike (mixed H+V, no torsion, persistent); central oculomotor signs on VNG; reduced vertical smooth pursuit', 'No structural MRI yet; SVV normal argues against large brainstem lesion. MRI brain mandatory'), ('3', 'Horizontal Canal BPPV\n(Left side)', 'Left Dix-Hallpike shows horizontal nystagmus component; roll-right borderline positive', 'Roll maneuver (supine roll) did not clearly elicit diagnostic geotropic/apogeotropic pattern; nystagmus persists on return to sit (atypical for peripheral BPPV)'), ('4', 'Cervicogenic Dizziness\n(Cervical proprioceptive dysfunction)', 'Confirmed cervical spondylosis; dizziness on neck extension/rotation; pitch-backward nystagmus on VNG', 'True nystagmus recorded (not purely proprioceptive). Cannot be sole explanation. Likely a contributing factor'), ('5', 'Age-related Multisensory Dizziness\n(Presbyvestibulopathy)', 'Age 79; bilateral reduced smooth pursuit (partially age-expected); multiple sensory deficits', 'GEN and positional nystagmus exceed normal aging pattern. Contributing factor, not primary diagnosis'), ('6', 'Obstructive Sleep Apnea (OSA)\nwith cerebrovascular consequences', 'Excessive daytime sleepiness, snoring for years; OSA accelerates vascular disease and hypertension', 'Indirect contributor. Requires formal sleep study (polysomnography) for confirmation'), ] for num, dx, for_, against in ddx_data: row = ddx_table.add_row() cells = row.cells # Num cells[0].text = '' r = cells[0].paragraphs[0].add_run(num) r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(10) # Dx cells[1].text = '' r = cells[1].paragraphs[0].add_run(dx) r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(9.5) if '1' in num and 'PRIMARY' in dx: r.font.color.rgb = RGBColor(0xC0, 0x00, 0x00) # For cells[2].text = '' r = cells[2].paragraphs[0].add_run(for_) r.font.name = 'Arial'; r.font.size = Pt(9.5) # Against cells[3].text = '' r = cells[3].paragraphs[0].add_run(against) r.font.name = 'Arial'; r.font.size = Pt(9.5) doc.add_paragraph() # ============================================= # RECOMMENDED INVESTIGATIONS # ============================================= add_heading(doc, '6. RECOMMENDED INVESTIGATIONS (URGENT)', level=2, color=(0x2E, 0x40, 0x57)) add_rule(doc) inv_table = doc.add_table(rows=1, cols=3) inv_table.style = 'Table Grid' inv_table.autofit = False inv_table.columns[0].width = Inches(0.5) inv_table.columns[1].width = Inches(3.0) inv_table.columns[2].width = Inches(4.0) for lbl, cell in zip(['#', 'Investigation', 'Rationale'], inv_table.rows[0].cells): cell.text = '' 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'), '2E4057') tcPr.append(shd) p = cell.paragraphs[0] r = p.add_run(lbl) r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(10) r.font.color.rgb = RGBColor(0xFF, 0xFF, 0xFF) investigations = [ ('1', 'MRI Brain + MRA Posterior Circulation\n[PRIORITY - not yet done]', 'Rule out cerebellar/brainstem infarct, demyelination, or mass. Assess vertebrobasilar artery stenosis. Most critical pending investigation.'), ('2', 'USG Doppler Neck Vessels\n[Already ordered]', 'Assess vertebral artery flow, especially during head extension/rotation. Look for dynamic compression by cervical spondylosis.'), ('3', 'Video Head Impulse Test (vHIT)', 'Quantify VOR gain per semicircular canal. Useful to detect canal-specific hypofunction not shown on VNG alone.'), ('4', 'Caloric Test\n(if available with VNG system)', 'Not recorded in this VNG study. Caloric testing quantifies unilateral canal paresis (UCP%) and directional preponderance.'), ('5', 'Polysomnography (Sleep Study)', 'Evaluate for OSA - high clinical suspicion given daytime sleepiness and snoring. OSA is a modifiable cerebrovascular risk factor.'), ('6', 'Cardiovascular workup\n(ECG, Holter, Echo)', 'Blackouts require exclusion of cardiogenic syncope (arrhythmia, aortic stenosis). ECG already ordered. Consider Holter if ECG unremarkable.'), ] for num, inv, rat in investigations: row = inv_table.add_row() cells = row.cells cells[0].text = '' r = cells[0].paragraphs[0].add_run(num) r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(10) cells[1].text = '' r = cells[1].paragraphs[0].add_run(inv) r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(9.5) cells[2].text = '' r = cells[2].paragraphs[0].add_run(rat) r.font.name = 'Arial'; r.font.size = Pt(9.5) doc.add_paragraph() # ============================================= # CLINICAL NOTES / CAUTION BOX # ============================================= add_heading(doc, '7. MANAGEMENT NOTES FOR NEUROLOGY', level=2, color=(0x2E, 0x40, 0x57)) add_rule(doc) mgmt_items = [ ('DO NOT perform Epley maneuver at this stage:', 'The Dix-Hallpike nystagmus is atypical (mixed H+V, no torsion, persistent on return). Central positional nystagmus must be excluded before canalith repositioning is attempted.'), ('Vascular risk factor optimization:', 'BP target <130/80 mmHg (patient has DM + HTN). HbA1c target <7%. Evaluate statin therapy. Consider antiplatelet therapy once structural lesion is excluded.'), ('Fall risk:', 'Patient has Fall Risk Assessment score of 1. Extension-triggered blackouts pose a significant fall risk. Activity restrictions and fall prevention advice required.'), ('Vitamin B12:', 'Level 208 pg/mL is low-normal. Given ongoing neurological symptoms, supplementation (Rejunex CD3 NF already started) is appropriate. Repeat in 3 months.'), ('OSA management:', 'High clinical suspicion. Untreated OSA worsens BP control, promotes cerebrovascular disease, and may contribute to dizziness via nocturnal hypoxia. Refer to sleep medicine.'), ] for label, value in mgmt_items: p = doc.add_paragraph() p.paragraph_format.space_before = Pt(2) p.paragraph_format.space_after = Pt(2) r = p.add_run(label + ' ') r.font.bold = True; r.font.name = 'Arial'; r.font.size = Pt(10.5) r2 = p.add_run(value) r2.font.name = 'Arial'; r2.font.size = Pt(10.5) doc.add_paragraph() # ============================================= # FOOTER DISCLAIMER # ============================================= add_rule(doc) disc_p = doc.add_paragraph() disc_p.alignment = WD_ALIGN_PARAGRAPH.CENTER r = disc_p.add_run( 'This document is a clinical interpretation of VNG data prepared for neurology review. ' 'The VNG report impression field was not completed by the performing clinician. ' 'All clinical decisions should be made by the treating neurologist after direct review of the original VNG tracings and examination findings. ' 'Prepared: 16 July 2026.' ) r.font.name = 'Arial'; r.font.size = Pt(8.5) r.font.italic = True; r.font.color.rgb = RGBColor(0x77, 0x77, 0x77) # Save out_path = '/tmp/workspace/col-avinash-vng/VNG_Summary_Col_Avinash_Verma_Neurology.docx' doc.save(out_path) print(f'Saved: {out_path}') EOF
python3 -c " from docx import Document doc = Document('/tmp/workspace/col-avinash-vng/VNG_Summary_Col_Avinash_Verma_Neurology.docx') print('Pages/sections:', len(doc.sections)) print('Paragraphs:', len(doc.paragraphs)) print('Tables:', len(doc.tables)) print('File size:', __import__('os').path.getsize('/tmp/workspace/col-avinash-vng/VNG_Summary_Col_Avinash_Verma_Neurology.docx'), 'bytes') print() print('--- First 20 paragraphs ---') for i, p in enumerate(doc.paragraphs[:20]): if p.text.strip(): print(f' [{p.style.name}] {p.text[:80]}') "
VNG Summary Col Avinash Verma Neurology
Word Document · DOCX