# ESUS

ESUS

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/esus`
HTML: https://magentlab.com/docs/esus
Markdown: https://magentlab.com/docs/esus.md

Not a medical device. Not a diagnosis, dose, or listing recommendation.

## What it computes

Apply the Hart 2014 ESUS construct (Panel 2 criteria plus Panel 3 minimum diagnostic assessment) and return whether caller-assigned flags meet embolic stroke of undetermined source.

## When to use

When an agent has caller-assigned imaging and workup flags after ischaemic stroke and needs the Hart 2014 ESUS construct, not TOAST cryptogenic stroke and not an anticoagulation recommendation.

## When not to use

- Not a medical device. Not a stroke diagnosis. magent does not read imaging or examine the patient.
- This tool is the Hart 2014 ESUS construct only (Panel 2 plus Panel 3 minimum diagnostic assessment). It is not TOAST cryptogenic stroke, which includes incomplete workup and multiple causes.
- Incomplete workup (minimum_workup false) means the construct is not met (esus false). It is not an HTTP 400.
- Not a recommendation for anticoagulation. Later NAVIGATE ESUS and RESPECT ESUS trials did not show a uniform DOAC benefit; those trials are not the formula.
- The caller assigns all five booleans. magent does not enumerate each major-risk cardioembolic source as a separate required param and does not classify infarct size from raw imaging.

## Formula

```
esus iff non_lacunar_infarct and no_stenosis_ge_50 and no_major_risk_cardioembolic and no_other_specific_cause and minimum_workup (Hart 2014 Panel 2 + Panel 3)
```

## Citation

[Embolic strokes of undetermined source: the case for a new clinical construct](https://doi.org/10.1016/S1474-4422(13)70310-7)
Hart RG, Diener HC, Coutts SB, Easton JD, Granger CB, O'Donnell MJ, Sacco RL, Connolly SJ, Cryptogenic Stroke/ESUS International Working Group
Lancet Neurol. 2014;13(4):429-438
DOI: [10.1016/S1474-4422(13)70310-7](https://doi.org/10.1016/S1474-4422(13)70310-7)

## Worked example

### All five criteria met

Given: `minimum_workup=true, no_major_risk_cardioembolic=true, no_other_specific_cause=true, no_stenosis_ge_50=true, non_lacunar_infarct=true`

1. Non-lacunar infarct on CT or MRI
2. No ≥50% stenosis in arteries supplying the ischaemia
3. No major-risk cardioembolic source
4. No other specific cause
5. Panel 3 minimum workup done
6. esus is true


### Incomplete workup is not ESUS

Given: `minimum_workup=false, no_major_risk_cardioembolic=true, no_other_specific_cause=true, no_stenosis_ge_50=true, non_lacunar_infarct=true`

1. Panel 2 flags remain true
2. minimum_workup is false (Panel 3 assessment incomplete)
3. esus is false; incomplete workup is not a 400


## Also searched as

- embolic stroke of undetermined source
- ESUS Hart 2014
- cryptogenic embolic stroke
- Hart ESUS construct
- non-lacunar cryptogenic stroke
- ESUS diagnostic criteria
- Panel 2 ESUS

## Parameters

- `non_lacunar_infarct` (boolean, required): Stroke detected by CT or MRI that is not lacunar, as assigned by the caller (Hart 2014 Panel 2). Lacunar = subcortical infarct ≤1.5 cm (≤2.0 cm on MRI diffusion images) in largest dimension, in the distribution of the small penetrating cerebral arteries. true or false. magent does not read imaging.
- `no_stenosis_ge_50` (boolean, required): Absence of extracranial or intracranial atherosclerosis causing ≥50% luminal stenosis in arteries supplying the area of ischaemia, as assigned by the caller (Hart 2014 Panel 2). true means no such stenosis. true or false. magent does not read vascular imaging.
- `no_major_risk_cardioembolic` (boolean, required): No major-risk cardioembolic source, as assigned by the caller (Hart 2014 Panel 2). Major-risk sources (paper footnote): permanent or paroxysmal atrial fibrillation, sustained atrial flutter, intracardiac thrombus, prosthetic cardiac valve, atrial myxoma or other cardiac tumours, mitral stenosis, recent (<4 weeks) myocardial infarction, left ventricular ejection fraction less than 30%, valvular vegetations, or infective endocarditis. true or false. The caller assigns this boolean; magent does not enumerate each source as a separate required param.
- `no_other_specific_cause` (boolean, required): No other specific cause identified, as assigned by the caller (Hart 2014 Panel 2). Paper examples: arteritis, dissection, migraine/vasospasm, drug misuse. true or false. magent does not diagnose an alternative aetiology.
- `minimum_workup` (boolean, required): Hart 2014 Panel 3 minimum diagnostic assessment, as assigned by the caller. true only if brain CT or MRI, 12-lead ECG, precordial echocardiography, cardiac monitoring for ≥24 h with automated rhythm detection (telemetry is not sufficient), and imaging of both extracranial and intracranial arteries supplying the ischaemic territory have been done. Incomplete workup returns esus false (not HTTP 400). true or false. magent does not read imaging.

## Bulk (POST)

POST the same path with a JSON items array. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.

Method: `POST /api/calc/esus`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: PREVIEW

- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- POST of 1 item costs the same as GET. Lists longer than 25: chunk into multiple POSTs. Extra items still execute; do not pad dummy rows.
- The first invalid item fails the whole request (index in the 400 JSON). You are not charged.
- HTTP 200 is {count, path, items}. Each items[i] is the GET 200 body for that row.
- Catalog misses (empty matches, found=false) stay paid 200s inside that slot.
- x402 resource URL is this path plus n and body_sha256. Browsers that prefer text/html get the same paywall as GET; Pay retries POST with the same items.

Example request:

```json
{
  "items": [
    {
      "minimum_workup": "true",
      "no_major_risk_cardioembolic": "true",
      "no_other_specific_cause": "true",
      "no_stenosis_ge_50": "true",
      "non_lacunar_infarct": "true"
    },
    {
      "minimum_workup": "true",
      "no_major_risk_cardioembolic": "true",
      "no_other_specific_cause": "true",
      "no_stenosis_ge_50": "true",
      "non_lacunar_infarct": "true"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/esus

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/esus",
  "items": [
    {
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Hart RG, Diener HC, Coutts SB, Easton JD, Granger CB, O'Donnell MJ, Sacco RL, Connolly SJ, Cryptogenic Stroke/ESUS International Working Group",
        "doi": "10.1016/S1474-4422(13)70310-7",
        "id": "hart-2014",
        "pmid": "24646875",
        "source": "Lancet Neurol. 2014;13(4):429-438",
        "title": "Embolic strokes of undetermined source: the case for a new clinical construct"
      },
      "formula": "esus",
      "formula_expression": "esus iff non_lacunar_infarct and no_stenosis_ge_50 and no_major_risk_cardioembolic and no_other_specific_cause and minimum_workup (Hart 2014 Panel 2 + Panel 3)",
      "criteria": [
        {
          "factor": "non_lacunar_infarct",
          "met": true
        },
        {
          "factor": "no_stenosis_ge_50",
          "met": true
        },
        {
          "factor": "no_major_risk_cardioembolic",
          "met": true
        },
        {
          "factor": "no_other_specific_cause",
          "met": true
        },
        {
          "factor": "minimum_workup",
          "met": true
        }
      ],
      "esus": true
    },
    {
      "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Hart RG, Diener HC, Coutts SB, Easton JD, Granger CB, O'Donnell MJ, Sacco RL, Connolly SJ, Cryptogenic Stroke/ESUS International Working Group",
        "doi": "10.1016/S1474-4422(13)70310-7",
        "id": "hart-2014",
        "pmid": "24646875",
        "source": "Lancet Neurol. 2014;13(4):429-438",
        "title": "Embolic strokes of undetermined source: the case for a new clinical construct"
      },
      "formula": "esus",
      "formula_expression": "esus iff non_lacunar_infarct and no_stenosis_ge_50 and no_major_risk_cardioembolic and no_other_specific_cause and minimum_workup (Hart 2014 Panel 2 + Panel 3)",
      "criteria": [
        {
          "factor": "non_lacunar_infarct",
          "met": true
        },
        {
          "factor": "no_stenosis_ge_50",
          "met": true
        },
        {
          "factor": "no_major_risk_cardioembolic",
          "met": true
        },
        {
          "factor": "no_other_specific_cause",
          "met": true
        },
        {
          "factor": "minimum_workup",
          "met": true
        }
      ],
      "esus": true
    }
  ]
}
```

## Response fields

- `formula` (string): esus
- `formula_expression` (string): Hart 2014 Panel 2 plus Panel 3 ESUS construct (all five flags required)
- `esus` (boolean): true only when all five caller-assigned flags hold. Classification, not a score. Incomplete workup is false, not a 400. Not a stroke diagnosis and not an anticoagulation recommendation.
- `criteria` (array): Per-factor rows with factor and met for non_lacunar_infarct, no_stenosis_ge_50, no_major_risk_cardioembolic, no_other_specific_cause, and minimum_workup. esus iff all are met.
- `citation` (object): Hart 2014 Lancet Neurol citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "disclaimer": "Not a medical device. Deterministic published-formula or published-code output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "Hart RG, Diener HC, Coutts SB, Easton JD, Granger CB, O'Donnell MJ, Sacco RL, Connolly SJ, Cryptogenic Stroke/ESUS International Working Group",
    "doi": "10.1016/S1474-4422(13)70310-7",
    "id": "hart-2014",
    "pmid": "24646875",
    "source": "Lancet Neurol. 2014;13(4):429-438",
    "title": "Embolic strokes of undetermined source: the case for a new clinical construct"
  },
  "formula": "esus",
  "formula_expression": "esus iff non_lacunar_infarct and no_stenosis_ge_50 and no_major_risk_cardioembolic and no_other_specific_cause and minimum_workup (Hart 2014 Panel 2 + Panel 3)",
  "criteria": [
    {
      "factor": "non_lacunar_infarct",
      "met": true
    },
    {
      "factor": "no_stenosis_ge_50",
      "met": true
    },
    {
      "factor": "no_major_risk_cardioembolic",
      "met": true
    },
    {
      "factor": "no_other_specific_cause",
      "met": true
    },
    {
      "factor": "minimum_workup",
      "met": true
    }
  ],
  "esus": true
}
```

## Errors

- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [CHA2DS2-VASc](https://magentlab.com/docs/cha2ds2-vasc) — Compute the CHA2DS2-VASc stroke-risk score from discrete clinical flags.
- [HAS-BLED](https://magentlab.com/docs/has-bled) — Compute the HAS-BLED bleeding-risk score from discrete clinical flags.
- [Canadian TIA Score](https://magentlab.com/docs/canadian-tia) — Compute the Perry 2021 Canadian TIA Score from caller-assigned clinical findings and investigations for subsequent 7-day stroke or carotid revascularization risk after TIA.
- [ABCD2 score](https://magentlab.com/docs/abcd2) — Compute the ABCD2 score as age, blood pressure, caller-assigned clinical features, symptom duration, and diabetes.

## Payment

Unpaid requests return HTTP 402 even if query parameters or POST items are missing or invalid, so CDP and agents can index the path. After a PAYMENT-SIGNATURE, invalid params return HTTP 400 JSON before settlement. magent does not charge. Fix the params, then request a new 402 quote for that complete URL. Catalog misses (empty matches, found=false) are valid paid 200s.

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/docs/mcp

## Guarantees

- HTTP 402 is unpaid, including a missing query. After PAYMENT-SIGNATURE, invalid parameters return HTTP 400 before settlement. You are not charged. HTTP 402 never includes the tool JSON.
- exact: settlement finishes before the tool (paymentFlow upfront). batch-settlement: verify/deposit before the tool; chargedCumulativeAmount commits after HTTP 2xx. Uncertain or failed settlement fails closed (HTTP 503). Retry the same PAYMENT-SIGNATURE.
- HTTP 402 is unpaid only. Do not sign a second authorization because of a 503.
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are stored encrypted for allowlisted operators (Magent Console). They are not in public logs, SSH lookups, catalog, or rollups. Request logs store path without query.
