attachment
attachment
attachment
attachment
attachment
attachment
attachment
attachment

Interpret the case and provide differential along with management and prognosis

I'll analyze all four documents simultaneously while consulting the medical library for a thorough interpretation.
analyse_media
analyse_media
analyse_media
analyse_media
Reading File
Now let me search the medical library for relevant content on focal epilepsy in children and mitral valve prolapse.
Finding Sources
Finding Sources
Finding Sources
Searching PubMed

focal epilepsy children centroparietal EEG valproate

Finding Sources
Finding Sources
Searching PubMed

focal childhood epilepsy centroparietal valproate prognosis

Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Now I have enough to provide a thorough clinical interpretation. Let me synthesize all the data.

Case Summary

Patient: Miss Manvitha L, 12-year-old female, DOB 10/10/2015 Hospital: Kasturba Hospital, Manipal (Pediatric OPD, Team PED002) Visit date: 01-07-2026 (follow-up visit) Current medication: Tab. Valparin (Sodium Valproate) 500 mg, twice daily (1-0-1) at 18 mg/kg/day

Compiled Clinical Data

History

  • Chief complaints: Follow-up for seizure disorder + mitral valve prolapse (MVP)
  • No episode of seizures since last visit
  • Occasional episodic abdominal pain (lasting 15-30 min, occurring once every 15 days, relieving spontaneously)
  • No burning micturition
  • No easy fatigability, chest pain, or palpitations
  • No headache
  • Bowel and bladder habits normal; sleep and appetite normal
  • Last seizure in June 2023 (generalized tonic-clonic seizure)

Vitals

  • HR: 112/min (borderline tachycardic for age)
  • RR: 18/min
  • BP: 108/66 mmHg
  • SpO2: 98% on room air
  • Height: 147 cm, Weight: 33.48 kg (BMI slightly below average for 12-year-old)
  • Hyperpigmented macule on the eye and shoulder (noted in examination)

Systems Examination

  • RS: Bilateral air entry equal, normal vesicular breath sounds
  • CVS: Apex beat 4th ICS medial to MCL, S1 S2 split normal
  • P/A: Soft, non-tender

Previous Investigations

  • EEG 2023 (24/06/2023): Focal disturbance of electrical function over the left > right parieto-temporal region, with epileptiform abnormalities
  • ECHO (28/06/23): MVP, myxomatous mitral leaflets, Grade 2 AML, mild MR, TVR (Trace/mild), mild regurgitation
  • EEG 01/07/2026 (current):
    • Posterior activity 8 Hz, symmetric, responsive to eye opening
    • Frequent spike-wave discharges at 1 Hz over left > right centro-parietal region (C3, phase reversal at P3)
    • Hyperventilation and photic stimulation: no additional abnormalities
    • Clinical interpretation: Focal epileptiform abnormalities over the left > right centro-parietal region

Biochemistry (ordered this visit)

  • Liver function tests: Albumin, AST, ALT (monitoring for valproate hepatotoxicity)

Interpretation

This is a 12-year-old girl with focal epilepsy - currently well-controlled on sodium valproate (seizure-free since June 2023) - presenting for routine follow-up. Her EEG continues to show focal epileptiform discharges in the centro-parietal region (left predominant), which is consistent with her prior EEGs but the discharge frequency (1 Hz) is notable. She is clinically asymptomatic from a seizure standpoint.
The co-existing myxomatous MVP with mild MR is an incidental cardiac finding that is currently hemodynamically non-significant.
The episodic abdominal pain (15-30 min, every 2 weeks, self-resolving) is clinically important - it could represent abdominal epilepsy / autonomic auras or valproate-related GI effects.
The hyperpigmented macule on eye and shoulder warrants attention and could indicate a neurocutaneous syndrome.

Differential Diagnosis

1. Epilepsy - Primary Considerations

DiagnosisSupporting FeaturesAgainst
Childhood Epilepsy with Centroparietal/Rolandic spikes (BECTS variant)Age 12F, focal centro-parietal spikes on EEG, seizure-free on valproate, normal background EEGClassic BECTS has centrotemporal (C3/C4) spikes; here phase reversal at P3 (parietal) is slightly posterior; typically self-limiting by ~16 years
Structural focal epilepsy (e.g., cortical dysplasia, low-grade tumor, prior encephalitis)Focal EEG, persistent discharges despite treatmentNo structural lesion mentioned; no MRI documented
Self-limited childhood occipital epilepsy (Panayiotopoulos type)Age-appropriate, focal posterior EEG changesThis syndrome shows occipital/posterior temporal spikes; seizures are usually nocturnal with autonomic features
Symptomatic focal epilepsy (vascular/inflammatory etiology)Persistent EEG changesNo neurological deficit, normal development implied

2. Regarding Abdominal Pain Episodes

  • Abdominal epilepsy / epileptic autonomic aura - recurrent, self-limiting, no GI cause found; can occur with focal parietal/temporal epilepsy
  • Valproate-related GI adverse effects - nausea, abdominal cramping are common side effects
  • Functional abdominal pain (coincidental)

3. Cardiac

  • Myxomatous MVP - established by ECHO; mild MR is non-hemodynamically significant currently
  • Co-occurrence with epilepsy may suggest an underlying connective tissue disorder (Marfan syndrome, Ehlers-Danlos) - especially given the body habitus

4. Neurocutaneous Syndromes (given hyperpigmented macules)

  • Neurofibromatosis type 1 (NF1) - café-au-lait spots, seizures, cardiac lesions possible
  • LEOPARD syndrome / Carney complex - lentigines, cardiac abnormalities

Management

Immediate Plan (as per treating consultant)

  • Continue Tab. Valparin Chrono 800 mg (1-0-1) - dose appears to have been escalated from 500 mg (18 mg/kg/day) to Chrono 800 mg (1-0-1), i.e., ~24 mg/kg/day - within therapeutic range (10-40 mg/kg/day)
  • Continue for 2 more years (target discontinuation around 2027) - consistent with standard practice of maintaining seizure-free status for 2+ years before attempting withdrawal
  • LFTs and Albumin monitoring ordered (routine valproate safety monitoring - hepatotoxicity surveillance)

Additional Recommended Investigations

Neurological:
  • MRI brain with FLAIR/T2 sequences - strongly recommended given persistent focal EEG abnormalities; important to exclude structural lesion (cortical dysplasia, focal cortical lesion, low-grade tumor)
  • Repeat EEG in 6-12 months (or sooner if seizures recur)
  • Sleep EEG if not already obtained (sleep record was absent from current EEG)
Cardiac:
  • Repeat ECHO in 12 months (monitor MR progression)
  • ECG: currently normal sinus rhythm (HR 80 on EEG report ECG lead), continue monitoring given MVP
  • Cardiology follow-up as scheduled
Other:
  • Evaluate hyperpigmented macules - Wood's lamp examination, ophthalmology slit lamp (Lisch nodules for NF1)
  • Screen for connective tissue disorder if MVP + other features
  • Valproate drug level if seizure recurrence or toxicity suspected
  • Valproate CBC and coagulation profile (thrombocytopenia risk at higher levels)

Long-term AED Management

If seizure-free for 2 full years (by 2027):
  • Gradual valproate taper over 3-6 months (do NOT abrupt stop)
  • Higher chance of successful withdrawal if EEG normalizes before taper
  • Decisions based on seizure recurrence risk, EEG status, MRI findings
Note on valproate in adolescent females: Valproate carries risk of polycystic ovary syndrome (PCOS), weight gain, and teratogenicity. As Manvitha approaches puberty, counsel the family about these risks. If seizures are well-controlled after 2027 and EEG normalizes, transitioning to alternative (levetiracetam, lamotrigine, oxcarbazepine) may be considered.

Prognosis

Seizure Prognosis

  • Favorable indicators: Seizure-free for >3 years (since June 2023), normal neurological examination, no structural lesion identified, good compliance on valproate, normal developmental trajectory
  • If this is a benign self-limited focal epilepsy of childhood (BECTS/Rolandic variant), spontaneous remission is expected by mid-to-late adolescence (typically by age 16)
  • Approximately 60-70% of children with focal epilepsy who are seizure-free for 2 years on medication achieve long-term remission after drug withdrawal

Risk factors requiring vigilance:

  • Persistent 1 Hz spike-wave discharges on current EEG (despite being seizure-free) - indicates ongoing epileptiform tendency
  • No MRI done yet (structural etiology not excluded)
  • Parietal (rather than purely centrotemporal) localization is slightly atypical for classic BECTS - prognosis may differ

Cardiac Prognosis

  • MVP with mild MR: Generally benign in childhood; most patients remain asymptomatic for decades
  • Annual/biannual ECHO follow-up; risk of progression to moderate/severe MR is low but not zero
  • No current indication for antibiotic prophylaxis or activity restriction

Overall

With continued monitoring, compliance with medication, and appropriate workup (especially MRI brain and ongoing ECHO surveillance), the long-term outlook for Manvitha is good. The primary risk is unplanned medication withdrawal or an undetected structural lesion driving the focal EEG changes.

Key Pending Action: MRI brain has not been documented in the available records - this is the most important missing investigation. An MRI should be done to rule out structural epilepsy before attributing this to a benign self-limited syndrome. - Bradley and Daroff's Neurology in Clinical Practice; Harriet Lane Handbook, p.744

Generate a clinical summary document for the patient's family and follow-up referral

Reading File
Running Command

mkdir -p /home/daytona/workspace/manvitha-clinical-docs && ls /home/daytona/workspace/manvitha-clinical-docs/

Writing File

~/manvitha-clinical-docs/generate_docs.js

const {
  Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
  Header, Footer, AlignmentType, HeadingLevel, BorderStyle, WidthType,
  VerticalAlign, PageNumber, ShadingType, UnderlineType, PageBreak
} = require('docx');
const fs = require('fs');

// ─── Helpers ────────────────────────────────────────────────────────────────
const bold = (text, size = 22) => new TextRun({ text, bold: true, size });
const normal = (text, size = 20) => new TextRun({ text, size });
const italic = (text, size = 20) => new TextRun({ text, italics: true, size });
const small = (text, size = 18) => new TextRun({ text, size, color: '444444' });

const h1 = (text) => new Paragraph({
  heading: HeadingLevel.HEADING_1,
  children: [new TextRun({ text, bold: true, size: 28, color: '1F3864' })],
  spacing: { before: 280, after: 120 },
});

const h2 = (text) => new Paragraph({
  heading: HeadingLevel.HEADING_2,
  children: [new TextRun({ text, bold: true, size: 22, color: '2E4D7B' })],
  spacing: { before: 200, after: 80 },
  border: { bottom: { style: BorderStyle.SINGLE, size: 4, color: '2E4D7B' } },
});

const h3 = (text) => new Paragraph({
  heading: HeadingLevel.HEADING_3,
  children: [new TextRun({ text, bold: true, size: 21, color: '154360' })],
  spacing: { before: 160, after: 60 },
});

const p = (text, center = false) => new Paragraph({
  alignment: center ? AlignmentType.CENTER : AlignmentType.LEFT,
  children: [new TextRun({ text, size: 20 })],
  spacing: { after: 60 },
});

const bullet = (text) => new Paragraph({
  bullet: { level: 0 },
  children: [new TextRun({ text, size: 20 })],
  spacing: { after: 40 },
});

const subbullet = (text) => new Paragraph({
  bullet: { level: 1 },
  children: [new TextRun({ text, size: 19, color: '333333' })],
  spacing: { after: 30 },
});

const keyval = (key, value) => new Paragraph({
  children: [
    new TextRun({ text: `${key}: `, bold: true, size: 20 }),
    new TextRun({ text: value, size: 20 }),
  ],
  spacing: { after: 50 },
});

const divider = () => new Paragraph({
  border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: 'AAAAAA' } },
  spacing: { before: 160, after: 160 },
  children: [],
});

const space = (lines = 1) => new Paragraph({
  children: [new TextRun({ text: '', size: 20 })],
  spacing: { after: lines * 80 },
});

// Shaded info box paragraph
const infoBox = (text, bgColor = 'EBF5FB') => new Paragraph({
  children: [new TextRun({ text, size: 20, color: '154360' })],
  shading: { type: ShadingType.CLEAR, fill: bgColor },
  spacing: { before: 80, after: 80 },
  indent: { left: 200, right: 200 },
});

// Two-column table row helper
const twoCol = (label, value, shade = false) => new TableRow({
  children: [
    new TableCell({
      width: { size: 3500, type: WidthType.DXA },
      shading: shade ? { type: ShadingType.CLEAR, fill: 'EBF5FB' } : undefined,
      children: [new Paragraph({ children: [bold(label, 19)], spacing: { before: 60, after: 60 }, indent: { left: 100 } })],
    }),
    new TableCell({
      width: { size: 6000, type: WidthType.DXA },
      shading: shade ? { type: ShadingType.CLEAR, fill: 'FFFFFF' } : undefined,
      children: [new Paragraph({ children: [normal(value, 19)], spacing: { before: 60, after: 60 }, indent: { left: 100 } })],
    }),
  ],
});

const tableHeader = (col1, col2) => new TableRow({
  tableHeader: true,
  children: [
    new TableCell({
      width: { size: 3500, type: WidthType.DXA },
      shading: { type: ShadingType.CLEAR, fill: '1F3864' },
      verticalAlign: VerticalAlign.CENTER,
      children: [new Paragraph({ children: [new TextRun({ text: col1, bold: true, size: 19, color: 'FFFFFF' })], spacing: { before: 60, after: 60 }, indent: { left: 100 } })],
    }),
    new TableCell({
      width: { size: 6000, type: WidthType.DXA },
      shading: { type: ShadingType.CLEAR, fill: '1F3864' },
      verticalAlign: VerticalAlign.CENTER,
      children: [new Paragraph({ children: [new TextRun({ text: col2, bold: true, size: 19, color: 'FFFFFF' })], spacing: { before: 60, after: 60 }, indent: { left: 100 } })],
    }),
  ],
});

const dataTable = (rows) => new Table({
  width: { size: 9500, type: WidthType.DXA },
  rows,
  borders: {
    top: { style: BorderStyle.SINGLE, size: 4, color: '2E4D7B' },
    bottom: { style: BorderStyle.SINGLE, size: 4, color: '2E4D7B' },
    left: { style: BorderStyle.SINGLE, size: 4, color: '2E4D7B' },
    right: { style: BorderStyle.SINGLE, size: 4, color: '2E4D7B' },
    insideH: { style: BorderStyle.SINGLE, size: 2, color: 'CCCCCC' },
    insideV: { style: BorderStyle.SINGLE, size: 2, color: 'CCCCCC' },
  },
});

// ─── HEADER / FOOTER ────────────────────────────────────────────────────────
const docHeader = new Header({
  children: [
    new Paragraph({
      alignment: AlignmentType.CENTER,
      children: [
        new TextRun({ text: 'KASTURBA HOSPITAL, MANIPAL', bold: true, size: 22, color: '1F3864' }),
      ],
    }),
    new Paragraph({
      alignment: AlignmentType.CENTER,
      children: [new TextRun({ text: 'Department of Paediatrics & Neurology  |  Udupi District, Karnataka - 576 104', size: 18, color: '555555' })],
      border: { bottom: { style: BorderStyle.SINGLE, size: 4, color: '2E4D7B' } },
      spacing: { after: 100 },
    }),
  ],
});

const docFooter = new Footer({
  children: [
    new Paragraph({
      alignment: AlignmentType.CENTER,
      border: { top: { style: BorderStyle.SINGLE, size: 4, color: 'AAAAAA' } },
      spacing: { before: 80 },
      children: [
        new TextRun({ text: 'CONFIDENTIAL - FOR PATIENT/FAMILY USE AND REFERRAL ONLY  |  Page ', size: 17, color: '777777' }),
        new TextRun({ children: [PageNumber.CURRENT], size: 17, color: '777777' }),
        new TextRun({ text: ' of ', size: 17, color: '777777' }),
        new TextRun({ children: [PageNumber.TOTAL_PAGES], size: 17, color: '777777' }),
      ],
    }),
  ],
});

// ═══════════════════════════════════════════════════════════════════════════
//  SECTION 1 — PATIENT FAMILY SUMMARY
// ═══════════════════════════════════════════════════════════════════════════
const section1 = [

  // Title block
  new Paragraph({
    alignment: AlignmentType.CENTER,
    children: [new TextRun({ text: 'CLINICAL SUMMARY & PATIENT CARE GUIDE', bold: true, size: 32, color: '1F3864' })],
    spacing: { before: 200, after: 60 },
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    children: [new TextRun({ text: 'For Patient and Family', italics: true, size: 22, color: '2E4D7B' })],
    spacing: { after: 60 },
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    children: [new TextRun({ text: 'Date of Visit: 01 July 2026  |  Prepared: 02 July 2026', size: 19, color: '555555' })],
    spacing: { after: 200 },
  }),

  divider(),

  // Patient details
  h2('PATIENT IDENTIFICATION'),
  dataTable([
    twoCol('Full Name', 'Miss Manvitha L', true),
    twoCol('Date of Birth', '10 October 2015  (Age 12 years)', false),
    twoCol('Gender', 'Female', true),
    twoCol('Hospital Number', '03788276', false),
    twoCol('Address', 'Kurki Post, Davanagere Talq, Davanagere Dist., Karnataka', true),
    twoCol('Team / Speciality', 'PED002 - Paediatrics, Kasturba Hospital Manipal', false),
    twoCol('Consultant', 'Dr. Sharath Adiga M, Dept. of Neurology', true),
  ]),
  space(),

  // Diagnosis banner
  h2('ESTABLISHED DIAGNOSES'),
  infoBox('Primary Diagnosis: Focal Epilepsy — Left > Right Centro-Parietal Region (on Sodium Valproate, seizure-free since June 2023)', 'D6EAF8'),
  infoBox('Secondary Diagnosis: Mitral Valve Prolapse (MVP) with mild Mitral Regurgitation — Myxomatous leaflets, Grade 2 AML (Echocardiogram June 2023)', 'D5F5E3'),
  space(),

  // Clinical history
  h2('CLINICAL HISTORY'),
  p('Manvitha was diagnosed with a seizure disorder after her first generalized tonic-clonic seizure in June 2023. She has been on Sodium Valproate (Valparin) since then and has had NO further seizures.'),
  p('Her EEG in 2023 showed focal electrical disturbance over the left > right parieto-temporal region. Her ECHO in June 2023 revealed mitral valve prolapse (MVP), a structural variation of the heart valve, with only mild leakage — this is currently non-significant.'),
  p('She presented for routine follow-up on 01 July 2026, reporting no new seizures, no chest pain, no palpitations, and no fatigability. She does experience occasional episodic abdominal pain lasting 15-30 minutes once every two weeks, which settles on its own.'),
  space(),

  // Vitals
  h2('VITALS ON VISIT (01 July 2026)'),
  dataTable([
    tableHeader('Parameter', 'Value / Findings'),
    twoCol('Height', '147 cm', true),
    twoCol('Weight', '33.48 kg', false),
    twoCol('Heart Rate', '112 beats/min', true),
    twoCol('Respiratory Rate', '18 breaths/min (normal)', false),
    twoCol('Blood Pressure', '108/66 mmHg (normal for age)', true),
    twoCol('SpO2 (Oxygen saturation)', '98% on room air (normal)', false),
    twoCol('Chest Auscultation', 'Normal breath sounds bilaterally', true),
    twoCol('Heart Sounds', 'S1 S2 — normal split, no significant murmur noted clinically', false),
    twoCol('Abdomen', 'Soft, non-tender', true),
  ]),
  space(),

  // EEG findings
  h2('EEG REPORT — 01 July 2026'),
  p('An EEG (brain electrical activity recording) was performed at Kasturba Medical College, Manipal. The findings are described below in simple terms:'),
  bullet('Background brain activity was normal (8 Hz posterior rhythm, symmetric, responsive to eye opening — this is reassuring).'),
  bullet('Abnormal electrical "spikes" were detected over the left side of the brain (centro-parietal area — C3/P3 region), more on the left than right.'),
  bullet('These spikes occurred at 1 Hz (once per second in bursts) — this indicates there is still electrical irritability in that region of the brain even though she has no seizures clinically.'),
  bullet('Hyperventilation (deep breathing) and flashing lights did NOT trigger additional abnormalities — this is a reassuring finding.'),
  bullet('No sleep recording was available during this session.'),
  space(),
  infoBox('EEG Conclusion: Focal epileptiform abnormalities over the LEFT > RIGHT centro-parietal region. Clinical seizures are well-controlled.', 'FDEBD0'),
  space(),

  // Medications
  h2('CURRENT MEDICATIONS'),
  dataTable([
    tableHeader('Medicine', 'Dose / Instructions'),
    twoCol('Tab. Valparin Chrono 800 mg', '1 tablet in morning — 0 at noon — 1 tablet at night (twice daily)', true),
    twoCol('Duration', 'Continue for 2 more years (until ~2027), then review with neurologist', false),
  ]),
  space(),
  infoBox('IMPORTANT: Do NOT stop or reduce the medicine on your own. Stopping suddenly can trigger seizures. Always consult the doctor before any changes.', 'FADBD8'),
  space(),

  // Medication safety monitoring
  h2('WHY BLOOD TESTS WERE ORDERED'),
  p('Sodium Valproate (Valparin) is a safe and effective medicine for seizures. However, it can rarely affect the liver. The following blood tests have been ordered to make sure the liver is working normally:'),
  bullet('ALT (Liver enzyme test)'),
  bullet('AST (Liver enzyme test)'),
  bullet('Albumin (protein made by the liver)'),
  p('These are routine safety checks — not because anything is wrong, but to monitor long-term health on this medication.'),
  space(),

  // What to watch for
  h2('WARNING SIGNS — WHEN TO SEEK IMMEDIATE CARE'),
  infoBox('Go to the Emergency Room immediately if any of the following occur:', 'FADBD8'),
  bullet('A seizure (shaking, jerking, loss of consciousness, staring spell, or any unusual episode)'),
  bullet('Severe vomiting, abdominal pain, or jaundice (yellow skin/eyes) — may indicate liver side effects'),
  bullet('Unusual bruising or bleeding without injury'),
  bullet('Sudden severe headache'),
  bullet('Chest pain or fainting'),
  bullet('Extreme drowsiness or difficulty waking up'),
  space(),

  // MVP information
  h2('ABOUT MITRAL VALVE PROLAPSE (MVP)'),
  p('Manvitha has a condition called Mitral Valve Prolapse (MVP). This means one of her heart valves is slightly floppy. Here is what this means for her:'),
  bullet('In most children with MVP, the condition is benign (not dangerous) and does not affect daily life.'),
  bullet('There is a small amount of backward blood leakage (mild Mitral Regurgitation) — this is currently minor and does not need treatment.'),
  bullet('She does NOT need to restrict her physical activity or sports at this stage.'),
  bullet('She does NOT need any special heart medicines currently.'),
  bullet('A repeat heart scan (ECHO) should be done every 12 months to monitor the valve.'),
  space(),

  // Upcoming follow-up plan
  h2('FOLLOW-UP PLAN'),
  dataTable([
    tableHeader('Investigation / Action', 'Due / Details'),
    twoCol('Blood tests (ALT, AST, Albumin)', 'Ordered this visit — complete as soon as possible', true),
    twoCol('Repeat EEG', 'In 6-12 months, or earlier if seizures return', false),
    twoCol('MRI Brain (STRONGLY RECOMMENDED)', 'Not yet done — please arrange with neurologist urgently to rule out structural causes', true),
    twoCol('Repeat ECHO (Heart Scan)', 'In 12 months to monitor mitral valve', false),
    twoCol('Paediatric Neurology Review', 'Next visit as advised (with EEG report)', true),
    twoCol('Cardiology Review', 'Annual follow-up', false),
    twoCol('Skin assessment', 'Hyperpigmented macule noted on eye/shoulder — dermatology or ophthalmology evaluation advised', true),
  ]),
  space(),

  // Lifestyle
  h2('LIFESTYLE & DAILY CARE ADVICE'),
  bullet('Maintain regular sleep schedule — sleep deprivation can lower seizure threshold.'),
  bullet('No prolonged unsupervised swimming or bathing alone (precaution for seizure safety).'),
  bullet('Helmet recommended for cycling.'),
  bullet('School: Inform class teacher/school nurse about her condition confidentially.'),
  bullet('Continue normal schooling and activities — no restrictions unless seizures return.'),
  bullet('Avoid known seizure triggers: excessive screen time, sleep deprivation, missed doses.'),
  bullet('Ensure she takes medicine at the SAME TIME every day.'),
  bullet('Balanced nutritious diet; adequate hydration.'),
  space(),

  infoBox('For appointments: Kasturba Hospital Manipal — Phone: 0820-2571967 | Email: helpdesk.kh@manipal.edu', 'EBF5FB'),
  space(2),
];

// ═══════════════════════════════════════════════════════════════════════════
//  PAGE BREAK before referral letter
// ═══════════════════════════════════════════════════════════════════════════
const pageBreakPara = new Paragraph({ children: [new PageBreak()] });

// ═══════════════════════════════════════════════════════════════════════════
//  SECTION 2 — REFERRAL LETTER
// ═══════════════════════════════════════════════════════════════════════════
const section2 = [

  new Paragraph({
    alignment: AlignmentType.CENTER,
    children: [new TextRun({ text: 'REFERRAL LETTER', bold: true, size: 32, color: '1F3864' })],
    spacing: { before: 200, after: 60 },
  }),
  new Paragraph({
    alignment: AlignmentType.CENTER,
    children: [new TextRun({ text: 'For Specialist Review — Neurology / Paediatric Neurology', italics: true, size: 22, color: '2E4D7B' })],
    spacing: { after: 200 },
  }),

  divider(),

  // From / To
  dataTable([
    tableHeader('Referring Details', 'Receiving Details'),
    new TableRow({
      children: [
        new TableCell({
          width: { size: 4750, type: WidthType.DXA },
          shading: { type: ShadingType.CLEAR, fill: 'EBF5FB' },
          children: [
            new Paragraph({ children: [bold('From:', 19)], spacing: { before: 60 }, indent: { left: 100 } }),
            new Paragraph({ children: [normal('Dept. of Paediatrics (PED002)', 19)], indent: { left: 100 } }),
            new Paragraph({ children: [normal('Kasturba Hospital, Manipal', 19)], indent: { left: 100 } }),
            new Paragraph({ children: [normal('Manipal - 576 104, Karnataka', 19)], indent: { left: 100 } }),
            new Paragraph({ children: [normal('Date: 02 July 2026', 19)], spacing: { after: 60 }, indent: { left: 100 } }),
          ],
        }),
        new TableCell({
          width: { size: 4750, type: WidthType.DXA },
          shading: { type: ShadingType.CLEAR, fill: 'F9F9F9' },
          children: [
            new Paragraph({ children: [bold('To:', 19)], spacing: { before: 60 }, indent: { left: 100 } }),
            new Paragraph({ children: [normal('The Consultant', 19)], indent: { left: 100 } }),
            new Paragraph({ children: [italic('Dept. of Paediatric Neurology / Neurology', 19)], indent: { left: 100 } }),
            new Paragraph({ children: [normal('(Nearest Tertiary Centre)', 19)], indent: { left: 100 } }),
            new Paragraph({ children: [normal('RE: Manvitha L, 12F, MRD 03788276', 19)], spacing: { after: 60 }, indent: { left: 100 } }),
          ],
        }),
      ],
    }),
  ]),
  space(2),

  // Salutation
  p('Dear Colleague,'),
  space(),
  p('I am writing to refer Miss Manvitha L, a 12-year-old female, for further specialist evaluation and ongoing neurological management. Details of her clinical status are summarised below.'),
  space(),

  h2('REASON FOR REFERRAL'),
  bullet('Ongoing management of focal epilepsy with persistent EEG abnormalities (focal epileptiform discharges, left > right centro-parietal) despite clinical seizure freedom for >3 years.'),
  bullet('MRI brain has not been performed — urgent neuroimaging is required to exclude structural etiology (cortical dysplasia, focal lesion, low-grade neoplasm).'),
  bullet('Atypical centro-PARIETAL (rather than purely centrotemporal) spike localization — this warrants expert re-evaluation of the epilepsy syndrome classification.'),
  bullet('Evaluation of episodic abdominal pain (possible autonomic aura vs. valproate side effect).'),
  bullet('Guidance on long-term AED management, planned valproate taper (target 2027), and transition to adolescent care.'),
  space(),

  h2('CLINICAL SUMMARY'),

  h3('Demographics'),
  keyval('Name', 'Miss Manvitha L'),
  keyval('DOB', '10 October 2015 (Age 12Y)'),
  keyval('Gender', 'Female'),
  keyval('MRD No.', '03788276'),
  keyval('Address', 'Kurki Post, Davanagere Talq, Davanagere Dist., Karnataka'),
  keyval('Contact', '9035120469'),
  space(),

  h3('Presenting History'),
  p('Manvitha first presented with generalized tonic-clonic seizures in June 2023. She has been maintained on Sodium Valproate since then and has achieved complete clinical seizure freedom. She currently reports no seizure recurrence, but has episodic abdominal pain lasting 15-30 minutes, occurring approximately once every 15 days, self-resolving, with no associated vomiting, diarrhea, or urinary symptoms.'),
  space(),

  h3('Past Medical & Investigative History'),
  dataTable([
    tableHeader('Investigation / Event', 'Date & Findings'),
    twoCol('First Seizure (GTCS)', 'June 2023', true),
    twoCol('EEG (Jun 2023)', 'Focal disturbance of electrical function, left > right parieto-temporal region; epileptiform abnormalities', false),
    twoCol('ECHO (28 Jun 2023)', 'MVP, myxomatous mitral leaflets, Grade 2 AML, mild MR, trace TVR, mild prolapse; no significant hemodynamic compromise', true),
    twoCol('EEG (01 Jul 2026 — current)', 'Posterior activity 8 Hz, symmetric. Frequent spike-wave discharges 1 Hz, left > right centro-parietal (C3, phase reversal at P3). No response to hyperventilation/photic stimulation. INTERPRETATION: Focal epileptiform abnormalities, left > right centro-parietal.', false),
    twoCol('MRI Brain', 'NOT YET PERFORMED', true),
  ]),
  space(),

  h3('Current Medications'),
  p('Tab. Valparin Chrono 800 mg — 1-0-1 (twice daily) | ~24 mg/kg/day | to be continued until 2027'),
  space(),

  h3('Examination Findings (01 Jul 2026)'),
  dataTable([
    tableHeader('System', 'Findings'),
    twoCol('Vitals', 'HR 112/min, RR 18/min, BP 108/66 mmHg, SpO2 98% RA', true),
    twoCol('Anthropometry', 'Ht 147 cm, Wt 33.48 kg', false),
    twoCol('Respiratory', 'B/L AE equal, NVBS', true),
    twoCol('CVS', 'Apex beat 4th ICS medial to MCL, S1 S2 split normal, no significant murmur', false),
    twoCol('Abdomen', 'Soft, non-tender', true),
    twoCol('Skin', 'Hyperpigmented macule noted on eye and shoulder region (significance unknown — please evaluate)', false),
    twoCol('Neurology', 'No focal neurological deficit documented', true),
  ]),
  space(),

  h2('DIFFERENTIAL DIAGNOSIS (FOR YOUR CONSIDERATION)'),
  bullet('Benign Childhood Epilepsy with Centrotemporal/Centroparietal Spikes (BECTS/Rolandic variant) — most likely given age and EEG pattern; however, parietal predominance is atypical'),
  bullet('Structural focal epilepsy — cortical dysplasia, low-grade glioma, prior encephalomalacia (MRI brain mandatory to exclude)'),
  bullet('Panayiotopoulos syndrome / childhood occipital epilepsy — possible given posterior EEG involvement'),
  bullet('Symptomatic focal epilepsy secondary to prior CNS insult'),
  bullet('Neurocutaneous syndrome (NF1 / other) — given hyperpigmented skin lesions + epilepsy; requires evaluation'),
  space(),

  h2('SPECIFIC REQUESTS FROM REFERRING TEAM'),
  bullet('MRI Brain (with FLAIR, T2, DWI, Gadolinium contrast sequences) — to exclude structural epilepsy'),
  bullet('Sleep EEG (absent in current study) — to better characterise epileptiform discharges'),
  bullet('Evaluation of hyperpigmented macule (Wood\'s lamp, ophthalmology referral for Lisch nodules if NF1 suspected)'),
  bullet('Evaluation and classification of episodic abdominal pain — abdominal aura vs. functional vs. valproate GI side effect'),
  bullet('Assessment of valproate — ongoing monitoring (LFTs, CBC, valproate levels), and guidance on planned 2027 taper'),
  bullet('Consideration of alternative AED (lamotrigine, levetiracetam, oxcarbazepine) in view of valproate risks in adolescent female (PCOS, weight gain, teratogenicity)'),
  bullet('Cardiology liaison for MVP/MR follow-up (annual ECHO recommended)'),
  space(),

  h2('SUMMARY IMPRESSION'),
  infoBox('A 12-year-old girl with focal epilepsy (left > right centro-parietal EEG focus), clinically seizure-free for >3 years on Sodium Valproate, with co-existing mild MVP. Persistent focal epileptiform discharges on recent EEG. MRI brain is outstanding and must be performed. Skin lesions require evaluation for neurocutaneous syndrome. Long-term AED planning and safe transition of care to adolescent/adult neurology needed.', 'D6EAF8'),
  space(2),

  // Sign-off
  new Paragraph({
    children: [normal('Yours sincerely,', 20)],
    spacing: { after: 200 },
  }),
  new Paragraph({
    children: [normal('_______________________________', 20)],
    spacing: { after: 60 },
  }),
  keyval('Department', 'Paediatrics (PED002), Kasturba Hospital, Manipal'),
  keyval('Consultant', 'Dr. Sharath Adiga M, Dept. of Neurology'),
  keyval('Date', '02 July 2026'),
  keyval('Hospital Contact', '0820-2571967 | helpdesk.kh@manipal.edu'),
  space(),
  infoBox('This document is prepared based on clinical records dated 01 July 2026. For queries, contact the issuing department. All clinical decisions should be made by a qualified medical professional after direct patient assessment.', 'F5F5F5'),
];

// ═══════════════════════════════════════════════════════════════════════════
//  BUILD DOCUMENT
// ═══════════════════════════════════════════════════════════════════════════
const doc = new Document({
  title: 'Clinical Summary - Manvitha L',
  description: 'Focal Epilepsy - Patient Summary and Referral Letter',
  styles: {
    default: {
      document: {
        run: { font: 'Calibri', size: 20 },
      },
    },
  },
  sections: [
    {
      properties: {
        page: {
          margin: { top: 900, bottom: 900, left: 1000, right: 900 },
        },
      },
      headers: { default: docHeader },
      footers: { default: docFooter },
      children: [
        ...section1,
        pageBreakPara,
        ...section2,
      ],
    },
  ],
});

Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync('/home/daytona/workspace/manvitha-clinical-docs/Manvitha_Clinical_Summary_Referral.docx', buffer);
  console.log('SUCCESS: Document written.');
}).catch(err => {
  console.error('ERROR:', err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/manvitha-clinical-docs && node generate_docs.js 2>&1

Running Command

python /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/workspace/manvitha-clinical-docs/Manvitha_Clinical_Summary_Referral.docx 2>&1

Running Command

cd /home/daytona/workspace/manvitha-clinical-docs && python3 -c " import zipfile, os fname = 'Manvitha_Clinical_Summary_Referral.docx' size = os.path.getsize(fname) print(f'File size: {size} bytes ({size/1024:.1f} KB)') with zipfile.ZipFile(fname) as z: names = z.namelist() print('ZIP contents:', names) # Check document.xml is valid XML import xml.etree.ElementTree as ET xml_data = z.read('word/document.xml') ET.fromstring(xml_data) print('document.xml: valid XML') print('DOCX structure looks good.') "

The document is ready. Here is your download link:

Manvitha Clinical Summary Referral

Word Document · DOCX


What's Inside the Document

The file contains two sections in a single professionally formatted Word document (17.7 KB, valid DOCX):

Part 1 - Patient & Family Clinical Summary

A plain-language, easy-to-read guide covering:
  • Patient identification and confirmed diagnoses (focal epilepsy + MVP)
  • Simplified explanation of EEG findings (current and prior)
  • Vitals recorded on 01 July 2026
  • Current medication table (Valparin Chrono 800 mg, 1-0-1, until 2027)
  • Why the blood tests (LFTs) were ordered
  • Clear red-flag warning signs with instructions to go to ER
  • What MVP means for Manvitha in everyday life
  • Upcoming follow-up checklist (MRI, ECHO, EEG, skin review)
  • Lifestyle and daily care advice (sleep, school, activity precautions)

Part 2 - Specialist Referral Letter

A formal letter addressed to the receiving neurologist/paediatric neurology team covering:
  • Full clinical summary and investigative history
  • Reason for referral (persistent EEG discharges, outstanding MRI, atypical parietal spike localization, episodic abdominal pain, AED planning)
  • Tabulated examination findings
  • Differential diagnosis list
  • Specific investigation requests (MRI brain with contrast, sleep EEG, neurocutaneous workup, abdominal aura evaluation)
  • Note on valproate risks in adolescent females and consideration of alternative AEDs
  • Formal sign-off with department and contact details

Key point flagged in both sections: MRI brain has not yet been performed - this is the most important pending investigation and has been marked with urgency throughout the document.
This is a shared conversation. Sign in to Orris to start your own chat.