Neurology · LIVE
HAT score
HAT
Compute the Lou 2008 HAT (Hemorrhage After Thrombolysis) score for symptomatic intracranial hemorrhage after stroke thrombolysis from diabetes or baseline glucose >200 mg/dL, pretreatment NIHSS, and easily visible hypodensity on initial CT.
Markdown: /docs/hat.md · Canonical: https://magentlab.com/docs/hat
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute the Lou 2008 HAT (Hemorrhage After Thrombolysis) score for symptomatic intracranial hemorrhage after stroke thrombolysis from diabetes or baseline glucose >200 mg/dL, pretreatment NIHSS, and easily visible hypodensity on initial CT.
When to use
When an agent has caller-assigned diabetes, baseline glucose, NIHSS, and CT hypodensity and needs the published HAT total and collective symptomatic ICH percents, without inventing NIHSS, CT findings, an equals-1/3 hypodensity band, or unofficial percents.
When not to use
- Not a medical device and not a tPA withhold, thrombolysis, or treatment decision.
- Derived in intravenous thrombolysis (Lou 2008). It is not a recommendation for or against alteplase.
- The caller assigns diabetes mellitus, baseline glucose, NIHSS (0-42), and easily visible hypodensity on initial CT. magent does not examine the patient, assign NIHSS, or read CT.
- History of diabetes mellitus OR baseline glucose >200 mg/dL scores 1 (not additive if both). 200.0 mg/dL does not score; 201 does. Glucose is scored in mg/dL; mmol/L converts as mg/dL = mmol/L × 18.
- Pretreatment NIHSS <15 scores 0; 15-20 scores 1; >20 scores 2.
- Hypodensity is none (0), less_than_third (<1/3 MCA, 1), or greater_than_third (>1/3 MCA, 2). There is no published equals-1/3 category.
- Collective symptomatic ICH percents are 2% (0), 5% (1), 10% (2), 15% (3), 44% (>3). Scores 4 and 5 both return 44. magent does not invent other percents.
Formula
HAT = (diabetes OR baseline glucose >200 mg/dL) 1 (not additive) + NIHSS (<15 0, 15-20 1, >20 2) + hypodensity (none 0, <1/3 MCA 1, >1/3 MCA 2); Lou 2008; max 5; collective sICH 2/5/10/15/44% for scores 0/1/2/3/>3
Citation
- Authors
- Lou M, Safdar A, Mehdiratta M, Kumar S, Schlaug G, Caplan L, Searls D, Selim M
- Source
- Neurology. 2008;71(18):1417-1423
Worked example
No diabetes, glucose 6.0 mmol/L, NIHSS 10, no hypodensity
Given:
diabetes=falseglucose_mmol_l=6.0hypodensity=nonenihss=10
- Diabetes false; glucose 6.0 mmol/L → 108.0 mg/dL (not >200) → 0; NIHSS 10 <15 → 0; hypodensity none → 0
- Score = 0 (max 5); collective sICH 2%
All items (score 5)
Given:
diabetes=trueglucose_mmol_l=20.0hypodensity=greater_than_thirdnihss=42
- Diabetes true (glucose 20.0 mmol/L → 360 mg/dL also >200; not additive) → 1; NIHSS 42 >20 → 2; greater_than_third → 2
- Score = 5 (max 5); collective sICH 44%
Also searched as
- HAT score
- Hemorrhage After Thrombolysis
- Lou HAT
- HAT thrombolysis hemorrhage
- symptomatic ICH HAT
- Lou 2008 HAT
- post-tPA hemorrhage HAT
- HAT NIHSS hypodensity
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/hat?diabetes=false&glucose_mmol_l=6.0&nihss=10&hypodensity=none
Full URL: https://api.magentlab.com/api/calc/hat?diabetes=false&glucose_mmol_l=6.0&nihss=10&hypodensity=none
Call
Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params
return HTTP 400 before any quote or charge.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/hat?diabetes=false&glucose_mmol_l=6.0&nihss=10&hypodensity=none"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
diabetes |
boolean | required | History of diabetes mellitus (Lou 2008). true scores 1 on the diabetes-or-glucose item; not additive with glucose >200 mg/dL. |
glucose_mmol_l |
number | optional | Baseline glucose in mmol/L (2.8-55.5). Provide this or glucose_mg_dl, not both. Converted as mg/dL = mmol/L × 18. Scores 1 on the diabetes-or-glucose item if >200 mg/dL after conversion (200.0 does not). |
glucose_mg_dl |
number | optional | Baseline glucose in mg/dL (50-1000). Provide this or glucose_mmol_l, not both. >200 scores 1 on the diabetes-or-glucose item if diabetes is false; 200.0 does not (Lou 2008). |
nihss |
integer | required | Caller-assigned pretreatment NIH Stroke Scale total (integer 0-42). <15 scores 0; 15-20 scores 1; >20 scores 2 (Lou 2008). magent does not compute NIHSS or examine the patient. |
hypodensity |
string | required · none, less_than_third, greater_than_third | Easily visible hypodensity on initial CT as assigned by the caller (Lou 2008). none scores 0; less_than_third (<1/3 MCA) scores 1; greater_than_third (>1/3 MCA) scores 2. No published equals-1/3 category. magent does not read the CT. |
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.
- 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 (fixture)
{
"items": [
{
"diabetes": "false",
"glucose_mmol_l": "6.0",
"hypodensity": "none",
"nihss": "10"
},
{
"diabetes": "false",
"glucose_mmol_l": "6.0",
"hypodensity": "none",
"nihss": "10"
}
]
}
Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.
Example 200 (fixture)
{
"count": 2,
"path": "/api/calc/hat",
"items": [
{
"components": [
{
"value": 108.0,
"factor": "diabetes_or_glucose",
"points": 0,
"present": false,
"diabetes": false
},
{
"value": 10,
"factor": "nihss",
"points": 0,
"present": false
},
{
"value": "none",
"factor": "hypodensity",
"points": 0,
"present": false
}
],
"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": "Lou M, Safdar A, Mehdiratta M, Kumar S, Schlaug G, Caplan L, Searls D, Selim M",
"doi": "10.1212/01.wnl.0000330297.58334.dd",
"id": "lou-2008",
"pmid": "18955684",
"source": "Neurology. 2008;71(18):1417-1423",
"title": "The HAT Score: a simple grading scale for predicting hemorrhage after thrombolysis"
},
"formula": "hat",
"formula_expression": "HAT = (diabetes OR baseline glucose >200 mg/dL) 1 (not additive) + NIHSS (<15 0, 15-20 1, >20 2) + hypodensity (none 0, <1/3 MCA 1, >1/3 MCA 2); Lou 2008; max 5; collective sICH 2/5/10/15/44% for scores 0/1/2/3/>3",
"max_score": 5,
"score": 0,
"nihss": 10,
"diabetes": false,
"glucose_mg_dl": 108.0,
"hypodensity": "none",
"sich_percent": 2
},
{
"components": [
{
"value": 108.0,
"factor": "diabetes_or_glucose",
"points": 0,
"present": false,
"diabetes": false
},
{
"value": 10,
"factor": "nihss",
"points": 0,
"present": false
},
{
"value": "none",
"factor": "hypodensity",
"points": 0,
"present": false
}
],
"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": "Lou M, Safdar A, Mehdiratta M, Kumar S, Schlaug G, Caplan L, Searls D, Selim M",
"doi": "10.1212/01.wnl.0000330297.58334.dd",
"id": "lou-2008",
"pmid": "18955684",
"source": "Neurology. 2008;71(18):1417-1423",
"title": "The HAT Score: a simple grading scale for predicting hemorrhage after thrombolysis"
},
"formula": "hat",
"formula_expression": "HAT = (diabetes OR baseline glucose >200 mg/dL) 1 (not additive) + NIHSS (<15 0, 15-20 1, >20 2) + hypodensity (none 0, <1/3 MCA 1, >1/3 MCA 2); Lou 2008; max 5; collective sICH 2/5/10/15/44% for scores 0/1/2/3/>3",
"max_score": 5,
"score": 0,
"nihss": 10,
"diabetes": false,
"glucose_mg_dl": 108.0,
"hypodensity": "none",
"sich_percent": 2
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | hat |
formula_expression |
string | Exact expression used |
score |
integer | HAT points 0-5 |
max_score |
integer | Always 5 |
sich_percent |
number | Lou 2008 collective symptomatic ICH percent: 2 (0), 5 (1), 10 (2), 15 (3), 44 (>3). Scores 4 and 5 both 44. |
diabetes |
boolean | Whether history of diabetes mellitus was assigned |
glucose_mg_dl |
number | Baseline glucose in mg/dL (mmol/L inputs converted ×18) |
nihss |
integer | Caller-assigned NIHSS used for the <15 / 15-20 / >20 points |
hypodensity |
string | none, less_than_third, or greater_than_third |
components |
array | Per-item Lou 2008 points |
citation |
object | Lou 2008 Neurology citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 108.0,
"factor": "diabetes_or_glucose",
"points": 0,
"present": false,
"diabetes": false
},
{
"value": 10,
"factor": "nihss",
"points": 0,
"present": false
},
{
"value": "none",
"factor": "hypodensity",
"points": 0,
"present": false
}
],
"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": "Lou M, Safdar A, Mehdiratta M, Kumar S, Schlaug G, Caplan L, Searls D, Selim M",
"doi": "10.1212/01.wnl.0000330297.58334.dd",
"id": "lou-2008",
"pmid": "18955684",
"source": "Neurology. 2008;71(18):1417-1423",
"title": "The HAT Score: a simple grading scale for predicting hemorrhage after thrombolysis"
},
"formula": "hat",
"formula_expression": "HAT = (diabetes OR baseline glucose >200 mg/dL) 1 (not additive) + NIHSS (<15 0, 15-20 1, >20 2) + hypodensity (none 0, <1/3 MCA 1, >1/3 MCA 2); Lou 2008; max 5; collective sICH 2/5/10/15/44% for scores 0/1/2/3/>3",
"max_score": 5,
"score": 0,
"nihss": 10,
"diabetes": false,
"glucose_mg_dl": 108.0,
"hypodensity": "none",
"sich_percent": 2
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_flag |
boolean clinical flags must be true or false Returned before settlement; you are not charged. |
| 400 | invalid_glucose |
glucose_mg_dl (50-1000) or glucose_mmol_l (2.8-55.5) is required Returned before settlement; you are not charged. |
| 400 | invalid_nihss |
nihss must be an integer from 0 to 42. Returned before settlement; you are not charged. |
| 400 | invalid_hat_hypodensity |
hypodensity must be none, less_than_third, or greater_than_third (Lou 2008). Returned before settlement; you are not charged. |
| 400 | invalid_items |
POST body must be a JSON object with only an items array Returned before settlement; you are not charged. |
| 400 | invalid_item_count |
items must be an array of 1 to 25 objects Returned before settlement; you are not charged. |
| 400 | invalid_item |
each items entry must be a JSON object Returned before settlement; you are not charged. |
Related tools
- SEDAN — Compute the Strbian 2012 SEDAN score (Sugar, Early infarct signs, (hyper)Dense artery, Age, NIHSS) for symptomatic intracranial hemorrhage after stroke thrombolysis.
- DRAGON — Compute the Strbian 2012 DRAGON score (Dense artery / early infarct signs, prestroke mRS, Age, Glucose, Onset-to-treatment, NIHSS) for 3-month outcome after IV thrombolysis-treated ischemic stroke.
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. Unpaid valid requests return HTTP 402 with a base64
PAYMENT-REQUIRED
header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake
and shared payment errors: Payments.
Stdio MCP: /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.