curl -X POST http://localhost:8000/api/emergency \ -H "Content-Type: application/json" \ -d '{ "text": "58 yo F sudden severe headache, worst headache of life, started 30 min ago. BP 180/110, alert but nauseated. No trauma." }'
{ "emergency": { "top_differentials": [ { "diagnosis": "Subarachnoid hemorrhage (SAH)", "likelihood": "most likely", "reasoning": "Classic thunderclap headache presentation with hypertension. SAH is the most critical diagnosis to rule out.", "confidence": "high", "supporting_evidence": [ "Sudden onset worst headache of life (thunderclap)", "No trauma history", "Hypertensive (180/110)", "Nausea/vomiting common with SAH" ] }, { "diagnosis": "Hypertensive emergency", "likelihood": "possible", "reasoning": "Severely elevated BP could cause headache, but thunderclap presentation more concerning for SAH.", "confidence": "medium", "supporting_evidence": [ "BP 180/110 mmHg (hypertensive urgency/emergency range)" ] }, { "diagnosis": "Posterior reversible encephalopathy syndrome (PRES)", "likelihood": "possible", "reasoning": "Hypertension-related, but typically has seizures or visual changes.", "confidence": "low", "supporting_evidence": [ "Severe hypertension" ] } ], "red_flags": [ "Thunderclap headache (sudden, severe, peak intensity within seconds) — SUBARACHNOID HEMORRHAGE UNTIL PROVEN OTHERWISE", "Severe hypertension (BP 180/110) — risk of hypertensive emergency or secondary to intracranial pathology", "Nausea/vomiting with severe headache — concerning for increased intracranial pressure" ], "call_to_action": "IMMEDIATE: Non-contrast CT head STAT to rule out SAH. If CT negative and high suspicion, proceed to lumbar puncture. Neurosurgery consultation. Do NOT give BP medications until imaging complete (could worsen cerebral perfusion if mass lesion present).", "esi_score": 1, "safety_flags": [ "Do NOT lower BP aggressively before CT head — if SAH or stroke present, rapid BP lowering can worsen cerebral perfusion.", "If CT shows SAH, activate neurosurgery immediately — time-critical for aneurysm securing." ], "latency_ms": 3240 }}
Emergency mode uses a streamlined prompt optimized for speed and red flag detection. It does not perform literature review, multi-agent debate, or medication safety panels.
ESI scores generated by the AI should be validated by clinical judgment. ClinicalPilot is a decision-support tool, not a replacement for clinical assessment.