~/rheumignite-gpa/src/generate_case_presentation.js
const pptxgen = require('pptxgenjs');
const pptx = new pptxgen();
pptx.layout = 'LAYOUT_WIDE'; // 13.333 x 7.5
pptx.author = 'Dr. Ayushi Agrawal';
pptx.company = 'SVP Hospital, Ahmedabad';
pptx.subject = 'RHEUMIGNITE GPA Case';
pptx.title = 'Granulomatosis with Polyangiitis (GPA) - Clinical Case';
pptx.lang = 'en-US';
const C = {
bg: '0B1F2A',
primary: '0E7490',
accent: '06B6D4',
textDark: '0F172A',
textLight: 'E2E8F0',
white: 'FFFFFF',
muted: '475569',
red: 'B91C1C',
green: '166534'
};
function addHeader(slide, title, subtitle='') {
slide.background = { color: C.bg };
slide.addShape(pptx.ShapeType.rect, {
x: 0, y: 0, w: 13.333, h: 0.9,
fill: { color: C.primary },
line: { color: C.primary }
});
slide.addText(title, {
x: 0.4, y: 0.2, w: 9.5, h: 0.45,
fontSize: 22, bold: true, color: C.white, fontFace: 'Calibri'
});
if (subtitle) {
slide.addText(subtitle, {
x: 0.4, y: 0.62, w: 11.8, h: 0.2,
fontSize: 11, color: 'BAE6FD', fontFace: 'Calibri'
});
}
}
function card(slide, x, y, w, h, title) {
slide.addShape(pptx.ShapeType.roundRect, {
x, y, w, h,
rectRadius: 0.08,
fill: { color: C.white },
line: { color: 'CBD5E1', pt: 1 }
});
if (title) {
slide.addText(title, {
x: x + 0.2, y: y + 0.12, w: w - 0.4, h: 0.28,
fontSize: 13, bold: true, color: C.primary
});
}
}
// Slide 1: Title
{
const s = pptx.addSlide();
s.background = { color: C.bg };
s.addShape(pptx.ShapeType.rect, { x: 0, y: 0, w: 13.333, h: 7.5, fill: { color: C.bg }, line: { color: C.bg } });
s.addShape(pptx.ShapeType.roundRect, {
x: 0.7, y: 1.1, w: 11.9, h: 5.2, rectRadius: 0.08,
fill: { color: '0F2D3A' }, line: { color: C.accent, pt: 1.5 }
});
s.addText('RHEUMIGNITE Clinical Case Presentation', {
x: 1.1, y: 1.7, w: 11, h: 0.5, align: 'center',
fontSize: 30, bold: true, color: C.white
});
s.addText('Granulomatosis with Polyangiitis (GPA)\nC-ANCA / PR3 Positive Multisystem Disease', {
x: 1.2, y: 2.45, w: 10.8, h: 1.0, align: 'center',
fontSize: 20, color: 'CFFAFE', bold: true
});
s.addText('Presented by: Dr. Ayushi Agrawal\n2nd Year Resident, Department of General Medicine\nSVP Hospital, Ahmedabad', {
x: 1.2, y: 4.2, w: 10.8, h: 1.2, align: 'center',
fontSize: 16, color: C.textLight
});
}
// Slide 2: Patient profile & timeline
{
const s = pptx.addSlide();
addHeader(s, 'Patient Profile and Clinical Timeline');
card(s, 0.5, 1.2, 5.9, 5.9, 'Patient Details');
s.addText([
{ text: 'Name: Mr. Ashifbhai Ganibhai Kureshi\n', options: { breakLine: true } },
{ text: 'Age/Sex: 29 years / Male\n', options: { breakLine: true } },
{ text: 'Occupation: Auto driver\n', options: { breakLine: true } },
{ text: 'MRN: 26000422128 | IP: IP2603007540\n', options: { breakLine: true } },
{ text: 'Addiction: Tobacco chewing\n', options: { breakLine: true } },
{ text: 'Admission: 21/03/2026\n', options: { breakLine: true } },
{ text: 'Discharge: 03/04/2026', options: {} }
], { x: 0.8, y: 1.7, w: 5.3, h: 2.7, fontSize: 14, color: C.textDark });
card(s, 6.7, 1.2, 6.1, 5.9, 'Illness Timeline');
s.addText([
{ text: '• Private hospital: treated as LRTI\n', options: { breakLine: true } },
{ text: '• Zydus: bilateral consolidation + ?septic arthritis\n', options: { breakLine: true } },
{ text: '• SVP Emergency -> Pulmonology ICU\n', options: { breakLine: true } },
{ text: '• Type 1 respiratory failure at presentation\n', options: { breakLine: true } },
{ text: '• Rheumatology referral after C-ANCA positivity\n', options: { breakLine: true } },
{ text: '• Managed as GPA with vascular involvement', options: {} }
], { x: 7.0, y: 1.7, w: 5.5, h: 3.0, fontSize: 14, color: C.textDark });
s.addShape(pptx.ShapeType.roundRect, {
x: 7.0, y: 5.0, w: 5.5, h: 1.6, rectRadius: 0.05,
fill: { color: 'ECFEFF' }, line: { color: C.accent, pt: 1 }
});
s.addText('Final working diagnosis was reached through clinico-radiological correlation and strongly positive PR3-ANCA.', {
x: 7.2, y: 5.25, w: 5.1, h: 1.1, fontSize: 13, color: '0C4A6E'
});
}
// Slide 3: Presenting complaints
{
const s = pptx.addSlide();
addHeader(s, 'Presenting Complaints and Multisystem Clues');
card(s, 0.7, 1.3, 12.0, 5.7, 'Chief Complaints (duration)');
s.addText([
{ text: '• Dry cough - 20 days\n', options: { breakLine: true } },
{ text: '• Hemoptysis - 15 days\n', options: { breakLine: true } },
{ text: '• Weight loss ~2-3 kg - 10 days\n', options: { breakLine: true } },
{ text: '• Left nasal blockage - 20 days\n', options: { breakLine: true } },
{ text: '• Left knee pain - 2 days\n', options: { breakLine: true } },
{ text: '• Bilateral eye redness - 3 days', options: {} }
], { x: 1.1, y: 1.9, w: 5.8, h: 3.3, fontSize: 18, color: C.textDark });
s.addShape(pptx.ShapeType.line, { x: 6.8, y: 1.8, w: 0, h: 4.8, line: { color: '94A3B8', pt: 1 } });
s.addText('Suggestive systemic pattern', { x: 7.2, y: 1.9, w: 4.8, h: 0.4, fontSize: 16, bold: true, color: C.primary });
s.addText([
{ text: '• ENT involvement: nasal crusting + epistaxis focus\n', options: { breakLine: true } },
{ text: '• Pulmonary involvement: nodules/consolidation + hemoptysis\n', options: { breakLine: true } },
{ text: '• Ocular inflammation: bilateral redness\n', options: { breakLine: true } },
{ text: '• Renal clue: microscopic hematuria + elevated ACR\n', options: { breakLine: true } },
{ text: '• Inflammatory syndrome: ESR 85, thrombocytosis', options: {} }
], { x: 7.2, y: 2.4, w: 5.1, h: 3.2, fontSize: 14, color: C.textDark });
}
// Slide 4: Key investigations
{
const s = pptx.addSlide();
addHeader(s, 'Key Investigations');
card(s, 0.5, 1.2, 4.2, 5.9, 'Inflammatory / Hematology');
s.addText([
{ text: '• Hb nadir: 8.8 g/dL\n', options: { breakLine: true } },
{ text: '• Leukocytosis (neutrophilic)\n', options: { breakLine: true } },
{ text: '• Platelets up to 858 x10⁹/L\n', options: { breakLine: true } },
{ text: '• ESR: 85 mm/hr\n', options: { breakLine: true } },
{ text: '• Ferritin: >1650 ng/mL', options: {} }
], { x: 0.8, y: 1.8, w: 3.6, h: 3.4, fontSize: 13, color: C.textDark });
card(s, 4.9, 1.2, 4.2, 5.9, 'Renal / Urine');
s.addText([
{ text: '• Creatinine preserved\n', options: { breakLine: true } },
{ text: ' (0.58-0.76 mg/dL)\n', options: { breakLine: true } },
{ text: '• Microscopic hematuria\n', options: { breakLine: true } },
{ text: ' (RBC 4-12/HPF)\n', options: { breakLine: true } },
{ text: '• Urine ACR: 40.7 mg/g Cr\n', options: { breakLine: true } },
{ text: '• Renal biopsy deferred', options: {} }
], { x: 5.2, y: 1.8, w: 3.6, h: 3.4, fontSize: 13, color: C.textDark });
card(s, 9.3, 1.2, 3.5, 5.9, 'Serology Highlight');
s.addShape(pptx.ShapeType.roundRect, {
x: 9.7, y: 2.2, w: 2.7, h: 1.9, rectRadius: 0.08,
fill: { color: 'ECFDF5' }, line: { color: '22C55E', pt: 1.2 }
});
s.addText('PR3 (C-ANCA)\n72 IU/mL', {
x: 9.9, y: 2.6, w: 2.3, h: 0.9, align: 'center',
fontSize: 20, bold: true, color: C.green
});
s.addText('Lab cut-off:\n>3 = Positive\n(Strongly positive)', {
x: 9.9, y: 3.55, w: 2.3, h: 1.2, align: 'center',
fontSize: 12, color: C.textDark
});
}
// Slide 5: Imaging findings (without embedded images as files unavailable)
{
const s = pptx.addSlide();
addHeader(s, 'Imaging Findings (CT Thorax and ENT Evaluation)');
card(s, 0.6, 1.2, 6.2, 5.9, 'CT Thorax (CECT findings)');
s.addText([
{ text: '• Bilateral nodular infiltrates\n', options: { breakLine: true } },
{ text: '• Necrotic consolidations\n', options: { breakLine: true } },
{ text: '• Partial thrombosis of left\n', options: { breakLine: true } },
{ text: ' posterobasal segmental artery\n', options: { breakLine: true } },
{ text: '• Radiology supported pulmonary\n', options: { breakLine: true } },
{ text: ' vasculitic process in context', options: {} }
], { x: 1.0, y: 1.9, w: 5.4, h: 3.5, fontSize: 15, color: C.textDark });
card(s, 6.9, 1.2, 5.8, 5.9, 'ENT / PNS');
s.addText([
{ text: '• CT PNS: no frank sinusitis\n', options: { breakLine: true } },
{ text: ' (DNS noted)\n', options: { breakLine: true } },
{ text: '• ENT endoscopy:\n', options: { breakLine: true } },
{ text: ' DNS, crusting, blood clots\n', options: { breakLine: true } },
{ text: ' in left Little’s area\n', options: { breakLine: true } },
{ text: '• ?Right ear cholesteatoma', options: {} }
], { x: 7.3, y: 1.9, w: 5.0, h: 3.5, fontSize: 15, color: C.textDark });
s.addShape(pptx.ShapeType.roundRect, {
x: 0.8, y: 5.8, w: 11.9, h: 0.9, rectRadius: 0.05,
fill: { color: 'FEF2F2' }, line: { color: 'FCA5A5', pt: 1 }
});
s.addText('Note: Shared CT image snapshots can be inserted in final version once files are available in workspace.', {
x: 1.1, y: 6.08, w: 11.3, h: 0.35, fontSize: 12, color: C.red
});
}
// Slide 6: Diagnosis and differential narrowing
{
const s = pptx.addSlide();
addHeader(s, 'Diagnostic Reasoning and Final Diagnosis');
card(s, 0.6, 1.2, 6.3, 5.9, 'Why GPA was favored');
s.addText([
{ text: '• Compatible multisystem phenotype (ENT + lung + eye + renal urinary abnormalities)\n', options: { breakLine: true } },
{ text: '• Hemoptysis with necrotic pulmonary lesions\n', options: { breakLine: true } },
{ text: '• Strong serologic support: C-ANCA/PR3 strongly positive\n', options: { breakLine: true } },
{ text: '• Alternative causes less convincing after workup', options: {} }
], { x: 1.0, y: 1.9, w: 5.6, h: 3.7, fontSize: 14, color: C.textDark });
card(s, 7.1, 1.2, 5.6, 5.9, 'Final Diagnoses');
s.addText([
{ text: '1) Granulomatosis with Polyangiitis\n', options: { breakLine: true } },
{ text: ' (C-ANCA/PR3 positive, multisystem)\n', options: { breakLine: true } },
{ text: '2) Partial thrombosis - left\n', options: { breakLine: true } },
{ text: ' posterobasal segmental artery\n', options: { breakLine: true } },
{ text: '3) Incidental HEV positivity\n', options: { breakLine: true } },
{ text: '4) Mixed anxiety-depression', options: {} }
], { x: 7.5, y: 1.9, w: 4.9, h: 3.8, fontSize: 14, color: C.textDark });
}
// Slide 7: Treatment and hospital course
{
const s = pptx.addSlide();
addHeader(s, 'Treatment Strategy and In-Hospital Course');
card(s, 0.6, 1.2, 6.2, 5.9, 'Immunosuppressive Therapy');
s.addText([
{ text: '• Pulse methylprednisolone\n', options: { breakLine: true } },
{ text: ' 750 mg IV OD for 3-5 days\n', options: { breakLine: true } },
{ text: '• Cyclophosphamide 900 mg IV\n', options: { breakLine: true } },
{ text: ' single pulse (31/03/2026)\n', options: { breakLine: true } },
{ text: '• Discharge steroid:\n', options: { breakLine: true } },
{ text: ' Prednisolone 40 mg OD', options: {} }
], { x: 1.0, y: 1.9, w: 5.4, h: 3.8, fontSize: 14, color: C.textDark });
card(s, 6.9, 1.2, 5.8, 5.9, 'Adjunctive / Supportive Care');
s.addText([
{ text: '• Apixaban 2.5 mg for thrombosis\n', options: { breakLine: true } },
{ text: '• PPI, calcium, vitamin D\n', options: { breakLine: true } },
{ text: '• Eye and ear supportive medications\n', options: { breakLine: true } },
{ text: '• Psychiatry: sertraline 25 mg HS, meloset 3 mg HS\n', options: { breakLine: true } },
{ text: '• Multidisciplinary specialty inputs obtained', options: {} }
], { x: 7.3, y: 1.9, w: 5.0, h: 3.8, fontSize: 14, color: C.textDark });
}
// Slide 8: Outcome and follow-up
{
const s = pptx.addSlide();
addHeader(s, 'Outcome, Follow-up, and Learning Points');
card(s, 0.6, 1.2, 6.2, 5.9, 'Early Outcome');
s.addText([
{ text: '• Clinical stabilization achieved\n', options: { breakLine: true } },
{ text: '• Respiratory status improved\n', options: { breakLine: true } },
{ text: '• Discharged on 03/04/2026 with planned rheumatology follow-up\n', options: { breakLine: true } },
{ text: '• OPD CBC (15/04/2026):\n', options: { breakLine: true } },
{ text: ' Hb 11.3, WBC 12.15, Platelets 776, ESR 38\n', options: { breakLine: true } },
{ text: ' -> trend toward improvement', options: {} }
], { x: 1.0, y: 1.9, w: 5.4, h: 4.1, fontSize: 14, color: C.textDark });
card(s, 6.9, 1.2, 5.8, 5.9, 'Teaching Messages');
s.addText([
{ text: '• Suspect ANCA vasculitis in hemoptysis + ENT features + inflammatory markers\n', options: { breakLine: true } },
{ text: '• Strong PR3 positivity can expedite diagnosis when biopsy is not feasible\n', options: { breakLine: true } },
{ text: '• Evaluate vascular complications (thrombosis) early\n', options: { breakLine: true } },
{ text: '• Multidisciplinary care improves outcomes in systemic vasculitis', options: {} }
], { x: 7.3, y: 1.9, w: 5.0, h: 4.1, fontSize: 14, color: C.textDark });
s.addText('Thank you', {
x: 11.2, y: 6.8, w: 1.6, h: 0.3, fontSize: 12, bold: true, color: C.accent, align: 'right'
});
}
pptx.writeFile({ fileName: '/home/daytona/workspace/rheumignite-gpa/output/RHEUMIGNITE_GPA_Case_Dr_Ayushi_Agrawal.pptx' });