Make a ppt on csf analysis of medicine which u present in class for 20 mins

Reading File
Reading File
Finding Sources
Finding Sources
Searching PubMed

"cerebrospinal fluid" AND analysis

Searching the Web

CSF analysis interpretation bacterial viral tuberculous meningitis guideline

Searching Images

lumbar puncture anatomy procedure diagram cerebrospinal fluid collection

Browsing Directory

~/

Reading File
Reading File
Reading File
Reading Web Page

https://www.ncbi.nlm.nih.gov/books/NBK614844

Running Command

mkdir -p "/tmp/workspace/csf-analysis-presentation/src" "/tmp/workspace/csf-analysis-presentation/output"

Writing File

~/csf-analysis-presentation/src/create_csf_ppt.py

from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN, MSO_ANCHOR
from pptx.enum.shapes import MSO_SHAPE, MSO_CONNECTOR
from pptx.dml.color import RGBColor
from pptx.enum.dml import MSO_THEME_COLOR
from pptx.enum.text import MSO_AUTO_SIZE

OUT = '/tmp/workspace/csf-analysis-presentation/output/CSF_Analysis_20min_Class_Presentation.pptx'
prs = Presentation()
prs.slide_width = Inches(13.333)
prs.slide_height = Inches(7.5)
BLANK = prs.slide_layouts[6]

# Palette
NAVY=RGBColor(10,35,66); BLUE=RGBColor(23,93,150); TEAL=RGBColor(20,136,142)
AQUA=RGBColor(222,244,244); PALE=RGBColor(241,247,251); INK=RGBColor(27,42,58)
MUTED=RGBColor(93,113,130); RED=RGBColor(189,57,57); ORANGE=RGBColor(218,126,40)
GREEN=RGBColor(55,137,92); WHITE=RGBColor(255,255,255); LINE=RGBColor(196,213,226)


def rect(slide,x,y,w,h,fill, line=None, radius=False):
    shape=slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE if radius else MSO_SHAPE.RECTANGLE, Inches(x), Inches(y), Inches(w), Inches(h))
    shape.fill.solid(); shape.fill.fore_color.rgb=fill
    shape.line.color.rgb=line if line else fill
    if radius:
        shape.adjustments[0]=0.08
    return shape

def text(slide,s,x,y,w,h,size=18,color=INK,bold=False,align=PP_ALIGN.LEFT, font='Aptos', valign=MSO_ANCHOR.TOP):
    tb=slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h))
    tf=tb.text_frame; tf.clear(); tf.word_wrap=True
    tf.margin_left=tf.margin_right=Pt(0); tf.margin_top=tf.margin_bottom=Pt(0)
    tf.vertical_anchor=valign
    p=tf.paragraphs[0]; p.alignment=align
    r=p.add_run(); r.text=s; r.font.name=font; r.font.size=Pt(size); r.font.bold=bold; r.font.color.rgb=color
    return tb

def add_runs(slide, lines,x,y,w,h,size=18):
    tb=slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True
    tf.margin_left=tf.margin_right=Pt(0); tf.margin_top=tf.margin_bottom=Pt(0)
    for j,(s,c,b) in enumerate(lines):
        p=tf.paragraphs[0] if j==0 else tf.add_paragraph(); p.space_after=Pt(8)
        r=p.add_run(); r.text=s; r.font.name='Aptos'; r.font.size=Pt(size); r.font.color.rgb=c; r.font.bold=b
    return tb

def title(slide, num, heading, sub=None):
    rect(slide,0,0,13.333,0.38,NAVY)
    text(slide,heading,0.58,0.55,12.05,0.5,28,NAVY,True)
    if sub: text(slide,sub,0.6,1.07,11.9,0.32,12,MUTED)
    text(slide,str(num).zfill(2),12.25,0.60,0.5,0.28,11,TEAL,True,PP_ALIGN.RIGHT)
    rect(slide,0.58,1.42,12.15,0.02,TEAL)

def footer(slide, source='Class presentation | CSF analysis'):
    rect(slide,0.58,7.08,12.15,0.012,LINE)
    text(slide,source,0.58,7.16,8.8,0.18,8,MUTED)
    text(slide,'Medicine',11.25,7.16,1.48,0.18,8,MUTED,False,PP_ALIGN.RIGHT)

def bullets(slide, items,x,y,w,h,size=17, color=INK, gap=7):
    tb=slide.shapes.add_textbox(Inches(x), Inches(y), Inches(w), Inches(h)); tf=tb.text_frame; tf.clear(); tf.word_wrap=True
    tf.margin_left=Pt(0); tf.margin_right=Pt(0); tf.margin_top=Pt(0); tf.margin_bottom=Pt(0)
    for i,item in enumerate(items):
        p=tf.paragraphs[0] if i==0 else tf.add_paragraph(); p.text=item; p.level=0
        p.font.name='Aptos'; p.font.size=Pt(size); p.font.color.rgb=color; p.space_after=Pt(gap)
        p.text='• '+item
    return tb

def note(slide, s):
    notes=slide.notes_slide.notes_text_frame
    notes.text=s

def arrow(slide,x1,y1,x2,y2,color=BLUE,width=2):
    ln=slide.shapes.add_connector(MSO_CONNECTOR.STRAIGHT, Inches(x1), Inches(y1), Inches(x2), Inches(y2))
    ln.line.color.rgb=color; ln.line.width=Pt(width); ln.line.end_arrowhead=True
    return ln

def add_table(slide, headers, rows, x,y,widths, rowh=0.55, fs=12):
    cx=x
    for head,w in zip(headers,widths):
        rect(slide,cx,y,w,rowh,NAVY)
        text(slide,head,cx+0.08,y+0.11,w-0.16,rowh-0.12,fs,WHITE,True,PP_ALIGN.CENTER)
        cx+=w
    for ri,row in enumerate(rows):
        yy=y+rowh*(ri+1); cx=x
        fill=PALE if ri%2==0 else WHITE
        for cell,w in zip(row,widths):
            rect(slide,cx,yy,w,rowh,fill,LINE)
            text(slide,cell,cx+0.08,yy+0.09,w-0.16,rowh-0.12,fs,INK,False,PP_ALIGN.CENTER, valign=MSO_ANCHOR.MIDDLE)
            cx+=w

# 1
s=prs.slides.add_slide(BLANK); rect(s,0,0,13.333,7.5,NAVY); rect(s,0,0,13.333,0.18,TEAL)
text(s,'CSF ANALYSIS',0.75,1.22,8.8,0.75,40,WHITE,True)
text(s,'A practical approach to lumbar puncture, interpretation, and clinical patterns',0.78,2.05,8.7,0.42,18,RGBColor(201,224,241))
# CSF tube art
for i,c in enumerate([AQUA,RGBColor(231,243,255),RGBColor(216,239,238)]):
    x=9.75+i*0.62; rect(s,x,1.2,0.42,3.15,WHITE,RGBColor(172,208,224),True); rect(s,x+0.04,3.12,0.34,1.14,c,c,True); rect(s,x+0.03,1.08,0.36,0.25,TEAL,TEAL,True)
text(s,'20-minute classroom presentation',0.78,5.38,5.2,0.3,16,WHITE,True)
text(s,'Name: ____________________   |   MBBS / Medicine',0.78,5.78,6.2,0.26,13,RGBColor(201,224,241))
text(s,'Learning focus: recognize patterns, do not interpret a single value alone.',0.78,6.46,8.5,0.23,12,RGBColor(176,211,231))
note(s,'Time: 0.5 min. Introduce the topic and state that CSF analysis is pattern recognition integrated with the clinical picture, not a standalone test.')

# 2 objectives
s=prs.slides.add_slide(BLANK); title(s,2,'Learning objectives','By the end, learners should be able to approach a CSF report safely.')
objs=[('1','Recognize','the indications and safety checks before lumbar puncture.'),('2','Order','the essential CSF tests and handle specimens logically.'),('3','Interpret','pressure, cells, glucose, protein, and microbiology together.'),('4','Differentiate','common infectious, hemorrhagic, inflammatory, and malignant patterns.')]
for i,(n,a,b) in enumerate(objs):
    y=1.8+i*1.15; rect(s,0.82,y,0.64,0.64,TEAL,TEAL,True); text(s,n,0.82,y+0.14,0.64,0.3,18,WHITE,True,PP_ALIGN.CENTER)
    text(s,a,1.72,y+0.05,1.6,0.3,18,NAVY,True); text(s,b,3.25,y+0.06,8.55,0.35,17,INK)
footer(s); note(s,'Time: 1 min. Use these objectives to signpost the presentation. Tell the audience that the main take-home is integration of findings.')

# 3 CSF basics
s=prs.slides.add_slide(BLANK); title(s,3,'Why CSF analysis matters','CSF provides a direct window into central nervous system pathology.')
rect(s,0.72,1.8,3.25,3.7,PALE,LINE,True); text(s,'Major diagnostic roles',0.98,2.05,2.8,0.3,20,NAVY,True)
bullets(s,['Acute and chronic meningitis','Subarachnoid hemorrhage','Inflammatory demyelination','Malignancy and leptomeningeal disease','Selected autoimmune / encephalitic syndromes'],1.02,2.58,2.65,2.5,15)
# flow
for i,(lab,col) in enumerate([('Production\nchoroid plexus',BLUE),('Circulation\nventricles → subarachnoid space',TEAL),('Sampling\nlumbar cistern',ORANGE)]):
    x=4.65+i*2.6; rect(s,x,2.55,2.05,1.12,col,col,True); text(s,lab,x+0.14,2.82,1.77,0.56,15,WHITE,True,PP_ALIGN.CENTER,valign=MSO_ANCHOR.MIDDLE)
    if i<2: arrow(s,x+2.05,3.1,x+2.5,3.1,BLUE)
text(s,'Normal CSF is clear and colorless. A change in appearance is a clue, not a diagnosis.',4.55,4.37,7.5,0.45,18,INK,True)
rect(s,4.55,5.05,7.1,0.55,AQUA,AQUA,True); text(s,'Clinical context + neuroimaging + CSF pattern + targeted testing = diagnosis',4.75,5.19,6.7,0.2,15,NAVY,True,PP_ALIGN.CENTER)
footer(s); note(s,'Time: 1 min. Explain that CSF communicates with the subarachnoid space and is sampled in the lumbar cistern. Mention the main diagnostic roles.')

# 4 LP safety
s=prs.slides.add_slide(BLANK); title(s,4,'Lumbar puncture: safety comes first','Do not delay lifesaving treatment for a procedure when bacterial meningitis is strongly suspected.')
rect(s,0.75,1.75,5.8,4.75,PALE,LINE,True); text(s,'Before the needle',1.03,2.0,2.6,0.32,21,NAVY,True)
bullets(s,['Check history, examination, platelets and coagulation risk when indicated.','Consider neuroimaging before LP if focal neurologic deficit, papilledema, new seizure, markedly altered consciousness, or severe immunocompromise.','If LP or imaging will delay antibiotics in suspected bacterial meningitis: obtain blood cultures and start empiric therapy promptly.','Use sterile technique and measure opening pressure with the patient in lateral decubitus position.'],1.03,2.48,5.12,3.45,15)
rect(s,6.95,1.75,5.45,4.75,RGBColor(254,244,239),RGBColor(244,196,177),True); text(s,'Urgent stop / reconsider',7.23,2.0,3.4,0.32,21,RED,True)
bullets(s,['Local infection at puncture site','Suspected spinal epidural mass or cord compression','Uncorrected major bleeding risk','Signs suggesting impending herniation: stabilize and image first'],7.23,2.5,4.65,2.3,16,INK)
text(s,'Principle: CT does not “clear” every patient. Use clinical risk assessment.',7.23,5.43,4.55,0.45,15,RED,True)
footer(s,'Sources: WHO meningitis guideline (2025); Harrison’s 22e, CSF analysis'); note(s,'Time: 2 min. Stress the distinction between performing LP safely and treating suspected bacterial meningitis rapidly. Do not give a rigid universal CT rule: use local protocol and clinical risk assessment.')

# 5 collection
s=prs.slides.add_slide(BLANK); title(s,5,'Collection and specimen handling','Good pre-analytical practice protects diagnostic yield.')
for i,(head,body,col) in enumerate([('1. Opening pressure','Manometer, lateral decubitus, legs not tightly flexed.',BLUE),('2. Tubes','Sequential sterile tubes, labeled at bedside.',TEAL),('3. Send urgently','Cells deteriorate; process microbiology promptly.',ORANGE),('4. Pair the glucose','Obtain blood glucose near the time of LP.',GREEN)]):
    x=0.76+(i%2)*6.2; y=1.78+(i//2)*2.2
    rect(s,x,y,5.65,1.65,PALE,LINE,True); rect(s,x+0.2,y+0.23,0.48,1.16,col,col,True)
    text(s,head,x+0.92,y+0.32,4.25,0.28,18,NAVY,True); text(s,body,x+0.92,y+0.82,4.35,0.43,15,INK)
rect(s,0.78,6.15,11.72,0.48,AQUA,AQUA,True); text(s,'Suggested orders: cell count + differential, glucose + paired serum glucose, protein, Gram stain and culture. Add targeted tests based on the clinical syndrome.',0.98,6.29,11.3,0.18,13,NAVY,True,PP_ALIGN.CENTER)
footer(s,'Source: Harrison’s 22e, CSF analysis'); note(s,'Time: 1 min. Explain that tube allocation varies by laboratory. In an emergency, the core tests and prompt transport matter more than a fixed tube-number rule.')

# 6 core tests
s=prs.slides.add_slide(BLANK); title(s,6,'The core CSF report: read it in a fixed sequence','A repeatable sequence prevents missed signals.')
items=[('1','Appearance','Clear, turbid, bloody, or xanthochromic'),('2','Opening pressure','Raised pressure changes urgency and differential'),('3','Cells','WBC count + differential; RBC trend across tubes'),('4','Biochemistry','Glucose with serum ratio, protein, and sometimes lactate'),('5','Etiology tests','Gram stain, culture, PCR, antigen tests, AFB / fungal studies'),('6','Special studies','Oligoclonal bands, cytology, flow cytometry, autoimmune tests')]
for i,(n,h,b) in enumerate(items):
    x=0.75+(i%3)*4.18; y=1.75+(i//3)*2.2; rect(s,x,y,3.7,1.6,WHITE,LINE,True); rect(s,x+0.16,y+0.19,0.48,0.48,TEAL,TEAL,True); text(s,n,x+0.16,y+0.29,0.48,0.17,14,WHITE,True,PP_ALIGN.CENTER)
    text(s,h,x+0.82,y+0.2,2.65,0.25,16,NAVY,True); text(s,b,x+0.82,y+0.62,2.62,0.55,13,INK)
footer(s,'Source: Harrison’s Principles of Internal Medicine 22e, CSF analysis'); note(s,'Time: 1 min. Present this as your reading algorithm. In every suspected meningitis report, start with opening pressure and cells, then integrate glucose, protein and microbiology.')

# 7 normal
s=prs.slides.add_slide(BLANK); title(s,7,'Typical adult reference values','Always interpret against your local laboratory range and the patient’s age and context.')
headers=['Parameter','Typical adult reference / expectation','Interpretive note']
rows=[['Appearance','Clear, colorless','Turbidity can reflect cells, organisms, or protein.'],['Opening pressure','About 10-20 cm H₂O*','Measure correctly in lateral decubitus.'],['WBC','0-5 cells/µL','A pleocytosis is abnormal.'],['RBC','None','May reflect traumatic tap or hemorrhage.'],['Glucose','~50-80 mg/dL; ratio ~0.6','Compare with simultaneous serum glucose.'],['Protein','~15-45 mg/dL','May increase with inflammation or barrier dysfunction.']]
add_table(s,headers,rows,0.7,1.72,[2.05,3.75,5.95],0.67,12)
text(s,'*Opening pressure is affected by posture, obesity, sedation, Valsalva and technique. Reference limits vary.',0.8,6.02,11.5,0.24,12,MUTED)
rect(s,0.8,6.42,11.65,0.42,AQUA,AQUA,True); text(s,'The CSF:serum glucose ratio is often more useful than CSF glucose alone.',1.0,6.53,11.2,0.16,14,NAVY,True,PP_ALIGN.CENTER)
footer(s,'Sources: Harrison’s 22e; local laboratory reference ranges'); note(s,'Time: 1.5 min. These are teaching ranges, not absolute cutoffs. Focus on paired serum glucose and the fact that a normal single value does not exclude disease.')

# 8 pattern matrix
s=prs.slides.add_slide(BLANK); title(s,8,'Meningitis pattern matrix','Use the whole pattern. Early disease and prior therapy can produce overlap.')
headers=['Feature','Pyogenic bacterial','Viral','Tuberculous','Fungal / cryptococcal']
rows=[['Opening pressure','Often high','Normal or mildly high','Often high','Often high'],['Predominant cells','Usually neutrophils','Usually lymphocytes','Usually lymphocytes','Usually lymphocytes'],['Glucose / ratio','Low','Usually normal','Low, often <50% serum','Low or normal'],['Protein','High','Normal to mildly high','High','High'],['Useful tests','Gram stain, culture, PCR','PCR / NAAT','NAAT, AFB smear/culture','Cryptococcal Ag, fungal culture'],['Important caveat','Partially treated may be atypical','Early neutrophils possible','No single CSF test confirms','Immunocompromise alters profile']]
add_table(s,headers,rows,0.43,1.62,[1.65,2.75,2.35,2.7,3.0],0.68,10)
rect(s,0.67,6.2,12.0,0.48,RGBColor(255,248,231),RGBColor(248,220,160),True); text(s,'Do not use a pattern table to rule out meningitis or delay empirical treatment in an unstable patient.',0.9,6.34,11.55,0.17,13,RED,True,PP_ALIGN.CENTER)
footer(s,'Sources: WHO meningitis guideline (2025); Tuberculous meningitis clinical practice guideline (2025)'); note(s,'Time: 2 min. Walk across a single row at a time. State that bacterial disease can be lymphocytic after partial treatment and early viral disease can be neutrophilic. TBM typically has lymphocytes, high protein, low glucose and lactate 5-10 mmol/L, but these are not definitive alone.')

# 9 infectious microbiology
s=prs.slides.add_slide(BLANK); title(s,9,'Microbiology and molecular tests','Order targeted testing rather than an indiscriminate panel.')
left=[('Gram stain + bacterial culture','Rapid clue and organism recovery. Yield can fall after antibiotics.'),('PCR / NAAT','Rapid pathogen detection. Interpret with syndrome and pretest probability.'),('TB testing','NAAT, AFB smear and mycobacterial culture. Larger volumes and good processing improve yield.'),('Fungal work-up','Cryptococcal antigen, fungal stain/culture. Consider β-D-glucan selectively.')]
for i,(h,b) in enumerate(left):
    y=1.7+i*1.15; rect(s,0.72,y,7.05,0.9,PALE,LINE,True); text(s,h,0.96,y+0.14,2.5,0.21,15,NAVY,True); text(s,b,3.25,y+0.14,4.1,0.46,13,INK)
rect(s,8.35,1.7,3.95,4.85,RGBColor(235,248,244),RGBColor(174,220,202),True); text(s,'Interpretation guardrails',8.65,2.02,3.1,0.27,18,GREEN,True)
bullets(s,['A negative test does not always exclude infection.','Prior antimicrobial therapy reduces culture yield.','Positive PCR can occasionally reflect contamination or latent reactivation.','Always correlate with CSF pattern, blood tests, imaging and exposure risks.'],8.65,2.58,3.05,2.7,14)
footer(s,'Source: Harrison’s 22e, CSF analysis; WHO meningitis guideline (2025)'); note(s,'Time: 1.5 min. Harrison notes broad-range 16S bacterial PCR and fungal rRNA PCR can assist in partially treated or challenging cases. Do not list every test: demonstrate clinical targeting.')

# 10 RBC and SAH
s=prs.slides.add_slide(BLANK); title(s,10,'RBCs in CSF: traumatic tap or subarachnoid hemorrhage?','Interpret sample appearance, tube sequence, timing, and brain imaging together.')
# tubes
for i,(lab,fluid) in enumerate([('Tube 1\ntraumatic tap','pink'),('Tube 4\nclearing','pale'),('SAH\npersistent RBCs','red')]):
 x=1.0+i*2.1
 rect(s,x,1.8,0.8,3.1,WHITE,LINE,True); rect(s,x+0.08,3.05,0.64,1.65,RGBColor(238,170,170) if i==0 else (RGBColor(249,225,225) if i==1 else RGBColor(193,68,68)),LINE,True); rect(s,x+0.12,1.65,0.56,0.25,TEAL,TEAL,True); text(s,lab,x-0.25,5.13,1.32,0.52,13,NAVY,True,PP_ALIGN.CENTER)
text(s,'Compare the clinical scenario',7.35,1.9,4.1,0.32,22,NAVY,True)
bullets(s,['Thunderclap headache, meningism, reduced consciousness and imaging findings drive SAH evaluation.','A falling RBC count across tubes supports but does not prove a traumatic tap.','Xanthochromia assessment depends on timing and laboratory method.','RBCs may also occur with hemorrhagic encephalitis or other pathology.'],7.35,2.5,4.65,2.6,16)
rect(s,7.35,5.5,4.55,0.62,RGBColor(254,244,239),RGBColor(244,196,177),True); text(s,'Never diagnose or exclude SAH from RBC count alone.',7.58,5.69,4.05,0.18,14,RED,True,PP_ALIGN.CENTER)
footer(s,'Source: WHO meningitis guideline (2025)'); note(s,'Time: 1 min. Make the central point: RBCs are not a diagnosis. WHO notes that RBCs may signal traumatic LP or acute SAH and should be investigated in context.')

# 11 noninfectious
s=prs.slides.add_slide(BLANK); title(s,11,'Noninfectious uses of CSF','The added test should answer a clinical question.')
items=[('Multiple sclerosis','Oligoclonal bands and increased intrathecal IgG production support diagnosis in the right clinical and MRI context.'),('Autoimmune encephalitis','Mild pleocytosis or protein rise may occur; send validated antibody tests when phenotype suggests it.'),('Leptomeningeal malignancy','Cytology and flow cytometry. Repeated, adequately volumed specimens can improve detection.'),('Neurosyphilis','CSF VDRL is highly specific but not highly sensitive; use risk profile, serology and CSF inflammation together.')]
for i,(h,b) in enumerate(items):
 x=0.75+(i%2)*6.25; y=1.75+(i//2)*2.15; rect(s,x,y,5.65,1.62,PALE,LINE,True); text(s,h,x+0.24,y+0.24,5.1,0.25,17,NAVY,True); text(s,b,x+0.24,y+0.68,5.0,0.57,14,INK)
footer(s,'Sources: Bradley & Daroff, CSF analysis in MS; Harrison’s 22e, CSF analysis'); note(s,'Time: 1.5 min. In MS, CSF alone neither makes nor excludes the diagnosis. Bradley & Daroff describes oligoclonal bands as the most important CSF test in atypical or nondiagnostic cases. Harrison emphasizes large-volume repeated CSF, cytology and flow cytometry in suspected malignant meningitis.')

# 12 diagnostic algorithm
s=prs.slides.add_slide(BLANK); title(s,12,'A practical CSF interpretation algorithm','A simple workflow for a patient with suspected CNS infection.')
steps=[('1','Syndrome + stability','Meningitis / encephalitis / SAH / chronic process? Treat first if unstable.'),('2','Safety assessment','Need imaging first? Correctable bleeding risk? Obtain blood cultures when indicated.'),('3','Core CSF pattern','Pressure → appearance → cells/differential → glucose ratio → protein.'),('4','Targeted etiologic test','Gram/culture/PCR; TB or fungal work-up; special studies when indicated.'),('5','Reassess','Reconcile discordant results with imaging, blood results and clinical course.')]
for i,(n,h,b) in enumerate(steps):
 y=1.55+i*1.0; rect(s,0.92,y,0.62,0.62,TEAL,TEAL,True); text(s,n,0.92,y+0.17,0.62,0.2,15,WHITE,True,PP_ALIGN.CENTER); rect(s,1.76,y,9.8,0.62,PALE,LINE,True); text(s,h,2.0,y+0.15,2.0,0.22,15,NAVY,True); text(s,b,4.0,y+0.15,7.1,0.22,13,INK)
 if i<4: arrow(s,1.24,y+0.64,1.24,y+0.94,TEAL,1.5)
footer(s); note(s,'Time: 1.5 min. This is the practical synthesis slide. Point out that the test is not linear in reality: results can trigger repeat imaging, alternative tests or repeat sampling.')

# 13 case
s=prs.slides.add_slide(BLANK); title(s,13,'Mini case: interpret the pattern','A 24-year-old with fever, headache, neck stiffness and confusion.')
rect(s,0.75,1.75,4.0,4.55,NAVY,NAVY,True); text(s,'CSF report',1.05,2.05,2.2,0.3,22,WHITE,True)
for i,v in enumerate(['Opening pressure: 32 cm H₂O','Appearance: turbid','WBC: 2,400/µL, 88% neutrophils','Glucose: 22 mg/dL; serum 110 mg/dL','Protein: 220 mg/dL','Gram stain: Gram-positive diplococci']): text(s,v,1.05,2.65+i*0.48,3.2,0.26,14,RGBColor(222,239,250))
rect(s,5.25,1.75,6.9,1.1,RGBColor(254,244,239),RGBColor(244,196,177),True); text(s,'What is the dominant syndrome?',5.58,2.02,4.0,0.26,17,RED,True); text(s,'Acute pyogenic bacterial meningitis',5.58,2.37,4.7,0.22,16,INK)
for i,(h,b) in enumerate([('Why?','Raised pressure + neutrophilic pleocytosis + very low glucose ratio + high protein + Gram stain.'),('Next actions','Blood cultures if not done, immediate empiric therapy per local protocol, organism-directed therapy when identified.'),('Teaching point','A concordant pattern strengthens urgency. Treatment must not await final culture.')]):
 y=3.25+i*0.95; text(s,h,5.5,y,1.35,0.24,15,NAVY,True); text(s,b,6.8,y,5.0,0.43,14,INK)
footer(s,'Clinical pattern adapted from WHO meningitis diagnostic principles'); note(s,'Time: 1.5 min. Ask the class to name the syndrome before revealing it. Do not ask for an antibiotic regimen, since that depends on age, risk factors and local policy.')

# 14 pitfalls
s=prs.slides.add_slide(BLANK); title(s,14,'Common pitfalls and how to avoid them','Most errors arise from over-reliance on a single result.')
pit=[('“Normal glucose excludes bacterial meningitis.”','No. Use the entire pattern and paired serum glucose.'),('“Lymphocytes always mean viral infection.”','No. TB, fungal, malignancy, autoimmune disease and partially treated bacterial disease can be lymphocytic.'),('“Negative PCR or culture rules it out.”','No. Yield depends on timing, volume, antibiotics and assay performance.'),('“Any RBCs prove subarachnoid hemorrhage.”','No. Traumatic LP is common. Evaluate timing, trend, appearance and imaging.'),('“CSF findings alone give the diagnosis.”','No. Integrate with the patient, imaging, blood tests and epidemiology.')]
for i,(a,b) in enumerate(pit):
 y=1.63+i*0.98; rect(s,0.77,y,11.85,0.74,WHITE,LINE,True); text(s,'✕  '+a,1.0,y+0.12,5.3,0.22,14,RED,True); text(s,'→  '+b,6.05,y+0.12,6.1,0.33,14,INK)
footer(s); note(s,'Time: 1.5 min. Use this as a rapid recap. Invite the audience to identify which pitfall they have seen in reports or case discussions.')

# 15 recap
s=prs.slides.add_slide(BLANK); title(s,15,'Take-home messages','Five things to remember in the ward or examination.')
msgs=[('Safety first','Assess risk of herniation and bleeding, but do not delay emergency treatment.'),('Measure and pair','Opening pressure and paired serum glucose add major interpretive value.'),('Pattern, not a value','Cells, glucose, protein and microbiology are interpreted together.'),('Target the tests','Choose microbiology, cytology and immune studies from the clinical syndrome.'),('Reassess discordance','When findings and patient disagree, reconsider differential, sampling and timing.')]
for i,(h,b) in enumerate(msgs):
 y=1.55+i*0.94; rect(s,0.84,y,2.5,0.62,TEAL,TEAL,True); text(s,h,0.99,y+0.18,2.18,0.2,14,WHITE,True,PP_ALIGN.CENTER); text(s,b,3.7,y+0.16,7.85,0.28,15,INK)
text(s,'Questions?',0.85,6.35,3.0,0.42,25,NAVY,True)
footer(s); note(s,'Time: 1 min. Read the five messages, then open the floor for questions. This completes approximately 19-20 minutes including the mini case interaction.')

# 16 refs
s=prs.slides.add_slide(BLANK); title(s,16,'References and further reading','Use local institutional guidance for procedural and antimicrobial decisions.')
refs=[
'Harrison’s Principles of Internal Medicine, 22nd ed. “Cerebrospinal Fluid Analysis.” McGraw Hill, 2025.',
'Bradley and Daroff’s Neurology in Clinical Practice. “Cerebrospinal Fluid Analysis” in multiple sclerosis assessment.',
'World Health Organization. WHO guidelines on meningitis diagnosis, treatment and care. 2025.',
'Tuberculous meningitis International Research Consortium. A clinical practice guideline for tuberculous meningitis. 2025.',
'IDSA / local hospital protocol for empirical management of suspected bacterial meningitis.'
]
bullets(s,refs,0.86,1.72,11.4,3.55,15,gap=12)
rect(s,0.86,5.63,11.55,0.7,AQUA,AQUA,True); text(s,'Educational note: values and patterns in this deck are for classroom learning. Clinical decisions require the full patient context, local laboratory ranges and local protocols.',1.15,5.84,11.0,0.27,14,NAVY,True,PP_ALIGN.CENTER)
footer(s); note(s,'Keep this slide available during discussion. Time: optional, 0.5 min.')

# set metadata
prs.core_properties.title='CSF Analysis - 20 Minute Class Presentation'
prs.core_properties.subject='Medicine'
prs.core_properties.author='Orris'
prs.core_properties.keywords='CSF, cerebrospinal fluid, lumbar puncture, meningitis'
prs.save(OUT)
print(OUT)
Running Command

python "/tmp/workspace/csf-analysis-presentation/src/create_csf_ppt.py"

Running Command

python - <<'PY' from pptx import Presentation p='/tmp/workspace/csf-analysis-presentation/output/CSF_Analysis_20min_Class_Presentation.pptx' prs=Presentation(p) print('slides', len(prs.slides)) for i,s in enumerate(prs.slides,1): texts=[sh.text.strip().replace('\n',' | ') for sh in s.shapes if getattr(sh,'has_text_frame',False) and sh.text.strip()] print(i, len(texts), texts[0][:60] if texts else 'EMPTY') print('notes',sum(1 for s in prs.slides if s.notes_slide.notes_text_frame.text.strip())) PY python - <<'PY' from zipfile import ZipFile p='/tmp/workspace/csf-analysis-presentation/output/CSF_Analysis_20min_Class_Presentation.pptx' with ZipFile(p) as z: print('pptx bytes',sum(i.file_size for i in z.infolist())) PY

Created a 16-slide PowerPoint for a 20-minute Medicine class presentation on CSF analysis. It includes:
  • Learning objectives and CSF basics
  • Lumbar puncture safety and sample handling
  • Normal CSF values
  • Bacterial, viral, TB, and fungal meningitis pattern table
  • Microbiology, molecular tests, SAH versus traumatic tap
  • Noninfectious indications, diagnostic algorithm, mini case
  • Take-home points, references, and speaker notes for every slide
This is a shared conversation. Sign in to Orris to start your own chat.