hi
Who are you
Are you gpt or claude
What is headache?
"Headache Disorders"[MeSH Terms]
headache definition International Classification of Headache Disorders ICHD-3
Create ppt on it
headache types distribution of pain migraine tension cluster
ls -la /tmp/workspace/
mkdir -p /tmp/workspace/headache-ppt && cat > /tmp/workspace/headache-ppt/build.py <<'EOF' from pptx import Presentation from pptx.util import Inches, Pt from pptx.dml.color import RGBColor from pptx.enum.text import PP_ALIGN, MSO_ANCHOR from pptx.enum.shapes import MSO_SHAPE NAVY=RGBColor(0x12,0x2B,0x3A); TEAL=RGBColor(0x1F,0x8A,0x8A); LIGHT=RGBColor(0xEA,0xF4,0xF4) CORAL=RGBColor(0xD9,0x5D,0x39); GREY=RGBColor(0x44,0x4B,0x52); WHITE=RGBColor(255,255,255) prs=Presentation(); prs.slide_width=Inches(13.333); prs.slide_height=Inches(7.5) blank=prs.slide_layouts[6] def rect(s,x,y,w,h,fill,shape=MSO_SHAPE.RECTANGLE): r=s.shapes.add_shape(shape,Inches(x),Inches(y),Inches(w),Inches(h)) r.fill.solid(); r.fill.fore_color.rgb=fill; r.line.fill.background(); return r def text(s,x,y,w,h,t,size=18,bold=False,color=GREY,align=PP_ALIGN.LEFT,anchor=MSO_ANCHOR.TOP): tb=s.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h)); tf=tb.text_frame tf.word_wrap=True; tf.vertical_anchor=anchor p=tf.paragraphs[0]; p.alignment=align; r=p.add_run(); r.text=t r.font.size=Pt(size); r.font.bold=bold; r.font.color.rgb=color; r.font.name="Calibri"; return tb def bullets(s,x,y,w,h,items,size=18,color=GREY): tb=s.shapes.add_textbox(Inches(x),Inches(y),Inches(w),Inches(h)); tf=tb.text_frame; tf.word_wrap=True for i,it in enumerate(items): p=tf.paragraphs[0] if i==0 else tf.add_paragraph() p.space_after=Pt(8) r=p.add_run(); r.text="\u2022 "+it; r.font.size=Pt(size); r.font.color.rgb=color; r.font.name="Calibri" def header(s,title,n): rect(s,0,0,13.333,1.1,NAVY); rect(s,0,1.1,13.333,0.07,TEAL) text(s,0.6,0.15,12,0.8,title,30,True,WHITE,anchor=MSO_ANCHOR.MIDDLE) text(s,12.3,7.0,0.8,0.4,str(n),12,False,GREY,PP_ALIGN.RIGHT) def notes(s,t): s.notes_slide.notes_text_frame.text=t # 1 Title s=prs.slides.add_slide(blank); rect(s,0,0,13.333,7.5,NAVY); rect(s,0.8,3.35,2.2,0.08,CORAL) text(s,0.8,1.8,11.5,1.5,"Headache",60,True,WHITE) text(s,0.8,3.6,11.5,1,"Definition, classification, red flags and management",24,False,RGBColor(0xBF,0xE3,0xE3)) text(s,0.8,6.3,11.5,0.5,"Based on ICHD-3 and standard neurology and emergency medicine texts",14,False,RGBColor(0x9F,0xB8,0xC2)) # 2 Definition s=prs.slides.add_slide(blank); header(s,"What is a headache?",2) rect(s,0.6,1.6,12.1,1.5,LIGHT) text(s,0.9,1.7,11.5,1.3,"Pain located in the head, above the orbitomeatal line and/or nuchal ridge (ICHD-3).",24,True,NAVY,anchor=MSO_ANCHOR.MIDDLE) bullets(s,0.6,3.5,12,3.4,[ "One of the most common reasons for primary care, neurology and emergency visits", "Can be a disorder in its own right (primary) or a symptom of another disease (secondary)", "An attack builds up, stays at a level for minutes to days, then resolves completely", "Key task for the clinician: separate benign primary headaches from dangerous secondary causes"],20) notes(s,"Definition from ICHD-3 Definition of Terms (ichd-3.org).") # 3 Classification s=prs.slides.add_slide(blank); header(s,"Classification (ICHD-3)",3) cols=[("1. Primary headaches",TEAL,["Migraine","Tension-type headache","Trigeminal autonomic cephalalgias (cluster headache, paroxysmal hemicrania, SUNCT/SUNA, hemicrania continua)","Other primary: cough, exercise, thunderclap, hypnic, new daily persistent"]), ("2. Secondary headaches",CORAL,["Trauma or injury to head/neck","Cranial or cervical vascular disorder","Nonvascular intracranial disorder","Substance use or withdrawal","Infection","Disorder of homeostasis","Cranium, neck, eyes, ears, nose, sinuses"]), ("3. Cranial neuropathies and other facial pain",NAVY,["Trigeminal neuralgia","Occipital neuralgia","Other painful lesions of cranial nerves","Other headache disorders"])] for i,(t,c,items) in enumerate(cols): x=0.6+i*4.15 rect(s,x,1.6,3.9,0.8,c); text(s,x+0.1,1.6,3.7,0.8,t,17,True,WHITE,anchor=MSO_ANCHOR.MIDDLE) rect(s,x,2.4,3.9,4.4,LIGHT); bullets(s,x+0.1,2.5,3.7,4.2,items,14) notes(s,"Source: Bradley and Daroff's Neurology in Clinical Practice, primary and secondary headache classification; Rosen's Emergency Medicine.") # 4 Primary comparison table s=prs.slides.add_slide(blank); header(s,"The three main primary headaches",4) rows=[["","Migraine","Tension-type","Cluster"], ["Location","Often one-sided","Both sides","Strictly one-sided, around/behind eye"], ["Quality","Throbbing","Pressing, band-like","Severe, boring or stabbing"], ["Intensity","Moderate to severe","Mild to moderate","Very severe"], ["Duration","4 to 72 hours","30 min to 7 days","15 to 180 minutes"], ["Associated","Nausea, light and sound sensitivity, aura in some","Usually none; no vomiting","Tearing, red eye, runny nose, ptosis; restlessness"], ["Effect of activity","Worse","Not worse","Patient paces or rocks"]] tbl=s.shapes.add_table(len(rows),4,Inches(0.6),Inches(1.5),Inches(12.1),Inches(5.2)).table widths=[2.0,3.4,3.1,3.6] for j,w in enumerate(widths): tbl.columns[j].width=Inches(w) for i,r in enumerate(rows): for j,v in enumerate(r): c=tbl.cell(i,j); c.text=v; p=c.text_frame.paragraphs[0] p.runs[0].font.size=Pt(15); p.runs[0].font.name="Calibri" c.vertical_anchor=MSO_ANCHOR.MIDDLE if i==0: c.fill.solid(); c.fill.fore_color.rgb=TEAL; p.runs[0].font.color.rgb=WHITE; p.runs[0].font.bold=True else: c.fill.solid(); c.fill.fore_color.rgb=LIGHT if i%2 else WHITE p.runs[0].font.color.rgb=NAVY if j==0 else GREY; p.runs[0].font.bold=(j==0) notes(s,"Typical ICHD-3 features, simplified for teaching.") # 5 Epidemiology s=prs.slides.add_slide(blank); header(s,"How common is it?",5) stats=[("~30%","Lifetime prevalence of tension-type headache in reviews cited in Kaplan & Sadock"), ("40%","One-year prevalence of tension-type headache in the US population (Rosen's)"), ("#1","Tension-type is the most frequent primary headache, though rarely the cause of ED visits")] for i,(big,small) in enumerate(stats): x=0.6+i*4.15 rect(s,x,1.7,3.9,3.2,LIGHT); text(s,x,1.9,3.9,1.2,big,54,True,TEAL,PP_ALIGN.CENTER) text(s,x+0.2,3.2,3.5,1.6,small,16,False,GREY,PP_ALIGN.CENTER) bullets(s,0.6,5.2,12,1.8,[ "Peak prevalence in the fourth decade; women are slightly more affected", "Headache disorders remain a major global burden (Global Burden of Disease Study 2023, Lancet Neurology 2025)"],18) notes(s,"Sources: Kaplan & Sadock's Comprehensive Textbook of Psychiatry; Rosen's Emergency Medicine; Lancet Neurol 2025 (PMID 41240916).") # 6 Secondary causes s=prs.slides.add_slide(blank); header(s,"Secondary headache: causes not to miss",6) cause=[("Vascular","Subarachnoid haemorrhage, stroke, cervical artery dissection, cerebral venous thrombosis, giant cell arteritis"), ("Infection","Meningitis, encephalitis, brain abscess"), ("Mass or pressure","Brain tumour, raised or low intracranial pressure, hydrocephalus"), ("Trauma","Concussion, subdural haematoma"), ("Metabolic and toxic","Carbon monoxide, hypertensive crisis, medication overuse, withdrawal"), ("Local causes","Sinusitis, glaucoma, dental and ear disease")] for i,(t,d) in enumerate(cause): x=0.6+(i%2)*6.15; y=1.5+(i//2)*1.8 rect(s,x,y,0.12,1.55,CORAL); rect(s,x+0.12,y,5.8,1.55,LIGHT) text(s,x+0.35,y+0.08,5.5,0.45,t,19,True,NAVY); text(s,x+0.35,y+0.55,5.5,1.0,d,15) notes(s,"Cause list is a teaching summary based on ICHD-3 secondary headache categories.") # 7 Red flags s=prs.slides.add_slide(blank); header(s,"Red flags: when to suspect a serious cause",7) flags=[("Sudden onset","Thunderclap, peaks within seconds to a minute"),("New or changed pattern","First severe headache, or new headache after age 50"), ("Systemic features","Fever, weight loss, cancer, HIV or immunosuppression"),("Neurological signs","Confusion, weakness, seizure, papilloedema, neck stiffness"), ("Positional or provoked","Worse lying down, on straining, coughing or exertion"),("Context","Head injury, pregnancy, anticoagulation")] for i,(t,d) in enumerate(flags): x=0.6+(i%3)*4.15; y=1.6+(i//3)*2.6 rect(s,x,y,3.9,2.3,NAVY); text(s,x+0.2,y+0.15,3.5,0.6,t,19,True,RGBColor(0xFF,0xB8,0x9E)) text(s,x+0.2,y+0.8,3.5,1.4,d,16,False,WHITE) text(s,0.6,6.8,11.5,0.5,"Red flags raise the likelihood of a secondary headache and call for further testing.",15,False,GREY) notes(s,"Goldman-Cecil and Bradley and Daroff both describe red or warning flags suggesting a secondary headache. Common mnemonic: SNOOP.") # 8 Evaluation s=prs.slides.add_slide(blank); header(s,"Evaluation",8) steps=[("History","Onset, site, quality, duration, frequency, triggers, aura, associated symptoms, medication use"), ("Examination","Vital signs, neurological exam, fundi, neck stiffness, temporal arteries, sinuses, eyes"), ("Testing if red flags","CT or MRI brain; CT or lumbar puncture for suspected subarachnoid haemorrhage; ESR/CRP if giant cell arteritis suspected"), ("Diagnosis","Migraine, tension-type and cluster can usually be diagnosed clinically with high certainty")] for i,(t,d) in enumerate(steps): y=1.55+i*1.35 c=rect(s,0.6,y,0.9,1.1,TEAL,MSO_SHAPE.OVAL); text(s,0.6,y,0.9,1.1,str(i+1),28,True,WHITE,PP_ALIGN.CENTER,MSO_ANCHOR.MIDDLE) text(s,1.8,y,3.0,1.1,t,22,True,NAVY,anchor=MSO_ANCHOR.MIDDLE) text(s,4.8,y,8,1.1,d,17,anchor=MSO_ANCHOR.MIDDLE) notes(s,"Bradley and Daroff: migraine, tension-type and cluster headaches can usually be diagnosed with a high degree of certainty.") # 9 Management s=prs.slides.add_slide(blank); header(s,"Management overview",9) m=[("Migraine",["Acute: NSAIDs, triptans, gepants, antiemetics","Prevent: beta-blockers, topiramate, amitriptyline, CGRP antibodies","Avoid triggers; regular sleep and meals"]), ("Tension-type",["Acute: paracetamol or NSAIDs","Prevent (frequent): amitriptyline","Stress management, exercise, posture"]), ("Cluster",["Acute: 100% oxygen by high-flow mask, subcutaneous sumatriptan","Prevent: verapamil","Avoid alcohol during a cluster period"])] for i,(t,items) in enumerate(m): x=0.6+i*4.15 rect(s,x,1.6,3.9,0.75,TEAL); text(s,x,1.6,3.9,0.75,t,21,True,WHITE,PP_ALIGN.CENTER,MSO_ANCHOR.MIDDLE) rect(s,x,2.35,3.9,3.3,LIGHT); bullets(s,x+0.1,2.45,3.7,3.2,items,15) rect(s,0.6,5.9,12.1,1.0,RGBColor(0xFD,0xEC,0xE5)) text(s,0.8,5.9,11.7,1.0,"Medication overuse headache: limit acute drugs. Simple analgesics on 15 or more days a month, or triptans and opioids on 10 or more days, can worsen headache.",16,False,NAVY,anchor=MSO_ANCHOR.MIDDLE) notes(s,"Drug choices are general teaching points. Dosing and selection depend on patient factors and local guidelines.") # 10 Urgent care s=prs.slides.add_slide(blank); header(s,"When to seek urgent care",10) rect(s,0.6,1.6,12.1,1.0,CORAL) text(s,0.8,1.6,11.7,1.0,"Go to the emergency department if headache is sudden, extreme or different from usual.",22,True,WHITE,anchor=MSO_ANCHOR.MIDDLE) bullets(s,0.6,3.0,6,4,["Worst headache of your life, peaking within a minute","Follows a head injury","Fever with stiff neck or rash","Fainting, confusion or seizure"],19) bullets(s,6.9,3.0,6,4,["Weakness, numbness or trouble speaking","Vision loss or double vision","New headache in pregnancy or after age 50","Headache that keeps worsening over days"],19) # 11 Takeaways s=prs.slides.add_slide(blank); header(s,"Key takeaways",11) bullets(s,0.6,1.6,12,3.5,[ "Headache is pain in the head; most are primary and benign", "Tension-type is the most common; migraine causes the most disability", "Always screen for red flags to find secondary causes", "Match treatment to the headache type and limit acute medication use", "Refer or escalate early when features are atypical"],22) text(s,0.6,5.3,12,0.4,"References",16,True,NAVY) text(s,0.6,5.7,12,1.3,"ICHD-3, ichd-3.org. Bradley and Daroff's Neurology in Clinical Practice. Rosen's Emergency Medicine. Goldman-Cecil Medicine. Kaplan & Sadock's Comprehensive Textbook of Psychiatry. GBD 2023 headache disorders, Lancet Neurol 2025 (PMID 41240916).",13) prs.save("/tmp/workspace/headache-ppt/Headache.pptx") EOF cd /tmp/workspace/headache-ppt && python build.py && ls -la
cd /tmp/workspace/headache-ppt && python - <<'EOF' s=open('build.py').read() s=s.replace('c=tbl.cell(i,j); c.text=v; p=c.text_frame.paragraphs[0]','c=tbl.cell(i,j); c.text=v if v else " "; p=c.text_frame.paragraphs[0]') open('build.py','w').write(s) EOF python build.py && ls -la && python - <<'EOF' from pptx import Presentation p=Presentation('/tmp/workspace/headache-ppt/Headache.pptx') print(len(p.slides)) EOF
Headache
Presentation · PPTX