Atrial fibrillation · LIVE
ATRIA stroke risk score
Compute the Singer 2013 ATRIA stroke risk score from age, prior stroke, and caller-assigned female, diabetes, heart failure, hypertension, proteinuria, and eGFR <45 or ESRD flags.
Markdown: /docs/atria-stroke.md · Canonical: https://magentlab.com/docs/atria-stroke
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute the Singer 2013 ATRIA stroke risk score from age, prior stroke, and caller-assigned female, diabetes, heart failure, hypertension, proteinuria, and eGFR <45 or ESRD flags.
When to use
When an agent needs the published Singer 2013 ATRIA AF stroke-risk arithmetic (not CHA2DS2-VASc and not Fang 2011 ATRIA hemorrhage) and must not invent the point total from prose.
When not to use
- Not a medical device. magent does not diagnose stroke or atrial fibrillation.
- Not a stroke diagnosis and not an anticoagulation order or treatment recommendation.
- Not CHA2DS2-VASc. This tool is the Singer 2013 ATRIA stroke risk score only.
- Not the Fang 2011 ATRIA hemorrhage (bleed) score. That is a different tool.
- magent does not assay eGFR or urine. Proteinuria and eGFR <45 or ESRD are caller flags.
Formula
ATRIA stroke = age_prior_stroke (Singer 2013 Table 3: <65 0/8, 65-74 3/7, 75-84 5/7, >=85 6/9 without/with prior stroke) + female 1 + diabetes 1 + heart_failure 1 + hypertension 1 + proteinuria 1 + egfr_lt_45_or_esrd 1; max 15 (12 without prior stroke); 0-5 low, 6 moderate, 7-15 high
Citation
- Authors
- Singer DE, Chang Y, Borowsky LH, Fang MC, Pomernacki NK, Udaltsova N, Reynolds K, Go AS.
- Source
- J Am Heart Assoc. 2013;2(3):e000250
Worked example
Age 50, all flags false
Given:
age=50diabetes=falseegfr_lt_45_or_esrd=falsefemale=falseheart_failure=falsehypertension=falseprior_stroke=falseproteinuria=false
- Age 50 without prior stroke (Table 3 <65) → 0; remaining flags false → 0
- Score = 0 (max 15); atria_stroke_band low
Age 85 without other factors is moderate
Given:
age=85diabetes=falseegfr_lt_45_or_esrd=falsefemale=falseheart_failure=falsehypertension=falseprior_stroke=falseproteinuria=false
- Age ≥85 without prior stroke (Table 3) → 6
- Score = 6 (max 15); atria_stroke_band moderate
Age 75 plus female and hypertension is high
Given:
age=75diabetes=falseegfr_lt_45_or_esrd=falsefemale=trueheart_failure=falsehypertension=trueprior_stroke=falseproteinuria=false
- Age 75-84 without prior stroke → 5; female → 1; hypertension → 1
- Score = 7 (max 15); atria_stroke_band high
Also searched as
- ATRIA stroke score
- ATRIA stroke risk score
- Singer 2013 ATRIA
- ATRIA thromboembolism score
- AF ATRIA stroke
- ATRIA study stroke risk
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/atria_stroke?age=50&prior_stroke=false&female=false&diabetes=false&heart_failure=false&hypertension=false&proteinuria=false&egfr_lt_45_or_esrd=false
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/atria_stroke?age=50&prior_stroke=false&female=false&diabetes=false&heart_failure=false&hypertension=false&proteinuria=false&egfr_lt_45_or_esrd=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (18-120). Singer 2013 Table 3 without prior stroke: <65 scores 0, 65-74 scores 3, 75-84 scores 5, ≥85 scores 6. With prior stroke: <65 scores 8, 65-74 scores 7, 75-84 scores 7, ≥85 scores 9. |
prior_stroke |
boolean | required | Prior ischemic stroke as assigned by the caller. true or false. Selects the Table 3 age column. Not a stroke diagnosis. |
female |
boolean | required | Female sex as assigned by the caller. true or false. Scores 1. |
diabetes |
boolean | required | Diabetes as assigned by the caller. true or false. Scores 1. |
heart_failure |
boolean | required | Congestive heart failure as assigned by the caller (paper CHF). true or false. Scores 1. |
hypertension |
boolean | required | Diagnosed hypertension as assigned by the caller. true or false. Scores 1. |
proteinuria |
boolean | required | Proteinuria as assigned by the caller. true or false. Scores 1. magent does not assay urine. |
egfr_lt_45_or_esrd |
boolean | required | eGFR <45 or ESRD as assigned by the caller. true or false. Scores 1. magent does not assay eGFR. |
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": [
{
"age": "50",
"diabetes": "false",
"egfr_lt_45_or_esrd": "false",
"female": "false",
"heart_failure": "false",
"hypertension": "false",
"prior_stroke": "false",
"proteinuria": "false"
},
{
"age": "50",
"diabetes": "false",
"egfr_lt_45_or_esrd": "false",
"female": "false",
"heart_failure": "false",
"hypertension": "false",
"prior_stroke": "false",
"proteinuria": "false"
}
]
}
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/atria_stroke",
"items": [
{
"components": [
{
"value": 50,
"factor": "age_prior_stroke",
"points": 0,
"present": false
},
{
"factor": "female",
"points": 0,
"present": false
},
{
"factor": "diabetes",
"points": 0,
"present": false
},
{
"factor": "heart_failure",
"points": 0,
"present": false
},
{
"factor": "hypertension",
"points": 0,
"present": false
},
{
"factor": "proteinuria",
"points": 0,
"present": false
},
{
"factor": "egfr_lt_45_or_esrd",
"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": "Singer DE, Chang Y, Borowsky LH, Fang MC, Pomernacki NK, Udaltsova N, Reynolds K, Go AS.",
"doi": "10.1161/JAHA.113.000250",
"id": "singer-2013",
"pmid": "23782923",
"source": "J Am Heart Assoc. 2013;2(3):e000250",
"title": "A new risk scheme to predict ischemic stroke and other thromboembolism in atrial fibrillation: the ATRIA study stroke risk score"
},
"formula": "atria_stroke",
"formula_expression": "ATRIA stroke = age_prior_stroke (Singer 2013 Table 3: <65 0/8, 65-74 3/7, 75-84 5/7, >=85 6/9 without/with prior stroke) + female 1 + diabetes 1 + heart_failure 1 + hypertension 1 + proteinuria 1 + egfr_lt_45_or_esrd 1; max 15 (12 without prior stroke); 0-5 low, 6 moderate, 7-15 high",
"max_score": 15,
"score": 0,
"age_years": 50,
"atria_stroke_band": "low"
},
{
"components": [
{
"value": 50,
"factor": "age_prior_stroke",
"points": 0,
"present": false
},
{
"factor": "female",
"points": 0,
"present": false
},
{
"factor": "diabetes",
"points": 0,
"present": false
},
{
"factor": "heart_failure",
"points": 0,
"present": false
},
{
"factor": "hypertension",
"points": 0,
"present": false
},
{
"factor": "proteinuria",
"points": 0,
"present": false
},
{
"factor": "egfr_lt_45_or_esrd",
"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": "Singer DE, Chang Y, Borowsky LH, Fang MC, Pomernacki NK, Udaltsova N, Reynolds K, Go AS.",
"doi": "10.1161/JAHA.113.000250",
"id": "singer-2013",
"pmid": "23782923",
"source": "J Am Heart Assoc. 2013;2(3):e000250",
"title": "A new risk scheme to predict ischemic stroke and other thromboembolism in atrial fibrillation: the ATRIA study stroke risk score"
},
"formula": "atria_stroke",
"formula_expression": "ATRIA stroke = age_prior_stroke (Singer 2013 Table 3: <65 0/8, 65-74 3/7, 75-84 5/7, >=85 6/9 without/with prior stroke) + female 1 + diabetes 1 + heart_failure 1 + hypertension 1 + proteinuria 1 + egfr_lt_45_or_esrd 1; max 15 (12 without prior stroke); 0-5 low, 6 moderate, 7-15 high",
"max_score": 15,
"score": 0,
"age_years": 50,
"atria_stroke_band": "low"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | atria_stroke |
formula_expression |
string | Exact expression used |
score |
integer | Total points 0-15 |
max_score |
integer | Always 15 |
atria_stroke_band |
string | Singer 2013 three-category scheme: low when score is 0-5; moderate when 6; high when 7-15. Not a diagnosis. |
age_years |
integer | Age used for the Table 3 age column |
components |
array | Per-factor points |
citation |
object | Singer 2013 J Am Heart Assoc citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 50,
"factor": "age_prior_stroke",
"points": 0,
"present": false
},
{
"factor": "female",
"points": 0,
"present": false
},
{
"factor": "diabetes",
"points": 0,
"present": false
},
{
"factor": "heart_failure",
"points": 0,
"present": false
},
{
"factor": "hypertension",
"points": 0,
"present": false
},
{
"factor": "proteinuria",
"points": 0,
"present": false
},
{
"factor": "egfr_lt_45_or_esrd",
"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": "Singer DE, Chang Y, Borowsky LH, Fang MC, Pomernacki NK, Udaltsova N, Reynolds K, Go AS.",
"doi": "10.1161/JAHA.113.000250",
"id": "singer-2013",
"pmid": "23782923",
"source": "J Am Heart Assoc. 2013;2(3):e000250",
"title": "A new risk scheme to predict ischemic stroke and other thromboembolism in atrial fibrillation: the ATRIA study stroke risk score"
},
"formula": "atria_stroke",
"formula_expression": "ATRIA stroke = age_prior_stroke (Singer 2013 Table 3: <65 0/8, 65-74 3/7, 75-84 5/7, >=85 6/9 without/with prior stroke) + female 1 + diabetes 1 + heart_failure 1 + hypertension 1 + proteinuria 1 + egfr_lt_45_or_esrd 1; max 15 (12 without prior stroke); 0-5 low, 6 moderate, 7-15 high",
"max_score": 15,
"score": 0,
"age_years": 50,
"atria_stroke_band": "low"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_age |
age must be an integer from 18 to 120 Returned before settlement; you are not charged. |
| 400 | invalid_flag |
boolean clinical flags must be true or false 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
- ATRIA hemorrhage score — Compute the Fang 2011 ATRIA hemorrhage score from caller-assigned anemia, severe renal disease, age, prior hemorrhage, and hypertension flags.
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.
- 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.