Neurology · LIVE
PLAN score
PLAN
Compute the O'Donnell 2012 PLAN score (preadmission comorbidities, level of consciousness, age, and neurologic deficit) for death and severe disability after acute ischemic stroke from the published Table 4 items.
Markdown: /docs/plan.md · Canonical: https://magentlab.com/docs/plan
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute the O'Donnell 2012 PLAN score (preadmission comorbidities, level of consciousness, age, and neurologic deficit) for death and severe disability after acute ischemic stroke from the published Table 4 items.
When to use
When an agent needs the published PLAN total and <10 / 10-15 / >15 grouping after acute ischemic stroke, and must not invent NIHSS-total points or iScore items from a chart narrative.
When not to use
- Not a medical device and not a tPA decision.
- This is the PLAN score (O'Donnell 2012), not iScore.
- Derived in the Registry of the Canadian Stroke Network in patients 18 years or older with acute ischemic stroke. Thrombolysis, TIA, and intracerebral hemorrhage were excluded from the primary analysis. The paper reports lower discrimination after thrombolysis and in lacunar stroke.
- The caller assigns published items (preadmission dependence, cancer, heart failure, atrial fibrillation, reduced level of consciousness, significant or total arm and leg weakness, aphasia or neglect). magent does not examine the patient.
Formula
PLAN = preadmission_dependence 1.5 + cancer 1.5 + congestive_heart_failure 1 + atrial_fibrillation 1 + reduced_loc 5 + min(floor(age/10), 10) + arm_weakness 2 + leg_weakness 2 + aphasia_or_neglect 1; O'Donnell 2012 Table 4; max 25; bands <10 / 10-15 / >15
Citation
- Authors
- O'Donnell MJ, Fang J, D'Uva C, et al.
- Source
- Arch Intern Med. 2012;172(20):1548-1556
Worked example
Age 18, all Table 4 items absent
Given:
age=18aphasia_or_neglect=falsearm_weakness=falseatrial_fibrillation=falsecancer=falsecongestive_heart_failure=falseleg_weakness=falsepreadmission_dependence=falsereduced_loc=false
- Age 18 → 1 point per decade (floor 18/10 = 1), maximum 10
- Preadmission dependence, cancer, heart failure, and atrial fibrillation absent → 0
- Alert; no significant/total arm or leg weakness; no aphasia or neglect → 0
- Score = 1 (max 25); plan_band <10
Also searched as
- PLAN score
- O'Donnell PLAN
- preadmission comorbidities LOC age deficit
- PLAN ischemic stroke
- PLAN 2012
- death severe disability after stroke PLAN
- reduced level of consciousness PLAN
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/plan?age=18&preadmission_dependence=false&cancer=false&congestive_heart_failure=false&atrial_fibrillation=false&reduced_loc=false&arm_weakness=false&leg_weakness=false&aphasia_or_neglect=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/plan?age=18&preadmission_dependence=false&cancer=false&congestive_heart_failure=false&atrial_fibrillation=false&reduced_loc=false&arm_weakness=false&leg_weakness=false&aphasia_or_neglect=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
age |
integer | required | Age in years (18-120). O'Donnell 2012 Table 4: 1 point per decade (floor age/10), maximum 10. The derivation excluded patients younger than 18. |
preadmission_dependence |
boolean | required | Preadmission dependence (O'Donnell 2012 Table 4). true scores 1.5; false scores 0. The caller assigns the item. |
cancer |
boolean | required | History of cancer on the admission notes (O'Donnell 2012 Table 4; not a diagnosis made during the incident hospitalization). true scores 1.5; false scores 0. The caller assigns the item. |
congestive_heart_failure |
boolean | required | Congestive heart failure (O'Donnell 2012 Table 4). true scores 1; false scores 0. The caller assigns the item. |
atrial_fibrillation |
boolean | required | Atrial fibrillation (O'Donnell 2012 Table 4). true scores 1; false scores 0. The caller assigns the item. |
reduced_loc |
boolean | required | Caller-assigned reduced level of consciousness (O'Donnell 2012 Table 4). true scores 5; false (alert) scores 0. magent does not examine the patient. |
arm_weakness |
boolean | required | Caller-assigned significant or total arm weakness (O'Donnell 2012 Table 4). true scores 2. Mild or no weakness scores 0. magent does not examine the patient. |
leg_weakness |
boolean | required | Caller-assigned significant or total leg weakness (O'Donnell 2012 Table 4). true scores 2. Mild or no weakness scores 0. magent does not examine the patient. |
aphasia_or_neglect |
boolean | required | Caller-assigned aphasia or neglect (O'Donnell 2012 Table 4 combined item). true scores 1 whether one or both are present; false scores 0. magent does not examine the patient. |
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": "18",
"aphasia_or_neglect": "false",
"arm_weakness": "false",
"atrial_fibrillation": "false",
"cancer": "false",
"congestive_heart_failure": "false",
"leg_weakness": "false",
"preadmission_dependence": "false",
"reduced_loc": "false"
},
{
"age": "18",
"aphasia_or_neglect": "false",
"arm_weakness": "false",
"atrial_fibrillation": "false",
"cancer": "false",
"congestive_heart_failure": "false",
"leg_weakness": "false",
"preadmission_dependence": "false",
"reduced_loc": "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/plan",
"items": [
{
"components": [
{
"value": 18,
"factor": "age",
"points": 1,
"present": true
},
{
"factor": "preadmission_dependence",
"points": 0.0,
"present": false
},
{
"factor": "cancer",
"points": 0.0,
"present": false
},
{
"factor": "congestive_heart_failure",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"points": 0,
"present": false
},
{
"factor": "reduced_loc",
"points": 0,
"present": false
},
{
"factor": "arm_weakness",
"points": 0,
"present": false
},
{
"factor": "leg_weakness",
"points": 0,
"present": false
},
{
"factor": "aphasia_or_neglect",
"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": "O'Donnell MJ, Fang J, D'Uva C, et al.",
"doi": "10.1001/2013.jamainternmed.30",
"id": "odonnell-2012",
"pmid": "23147454",
"source": "Arch Intern Med. 2012;172(20):1548-1556",
"title": "The PLAN score: a bedside prediction rule for death and severe disability following acute ischemic stroke"
},
"formula": "plan",
"formula_expression": "PLAN = preadmission_dependence 1.5 + cancer 1.5 + congestive_heart_failure 1 + atrial_fibrillation 1 + reduced_loc 5 + min(floor(age/10), 10) + arm_weakness 2 + leg_weakness 2 + aphasia_or_neglect 1; O'Donnell 2012 Table 4; max 25; bands <10 / 10-15 / >15",
"age_years": 18,
"max_score": 25,
"score": 1.0,
"age_points": 1,
"plan_band": "<10"
},
{
"components": [
{
"value": 18,
"factor": "age",
"points": 1,
"present": true
},
{
"factor": "preadmission_dependence",
"points": 0.0,
"present": false
},
{
"factor": "cancer",
"points": 0.0,
"present": false
},
{
"factor": "congestive_heart_failure",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"points": 0,
"present": false
},
{
"factor": "reduced_loc",
"points": 0,
"present": false
},
{
"factor": "arm_weakness",
"points": 0,
"present": false
},
{
"factor": "leg_weakness",
"points": 0,
"present": false
},
{
"factor": "aphasia_or_neglect",
"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": "O'Donnell MJ, Fang J, D'Uva C, et al.",
"doi": "10.1001/2013.jamainternmed.30",
"id": "odonnell-2012",
"pmid": "23147454",
"source": "Arch Intern Med. 2012;172(20):1548-1556",
"title": "The PLAN score: a bedside prediction rule for death and severe disability following acute ischemic stroke"
},
"formula": "plan",
"formula_expression": "PLAN = preadmission_dependence 1.5 + cancer 1.5 + congestive_heart_failure 1 + atrial_fibrillation 1 + reduced_loc 5 + min(floor(age/10), 10) + arm_weakness 2 + leg_weakness 2 + aphasia_or_neglect 1; O'Donnell 2012 Table 4; max 25; bands <10 / 10-15 / >15",
"age_years": 18,
"max_score": 25,
"score": 1.0,
"age_points": 1,
"plan_band": "<10"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | plan |
formula_expression |
string | Exact expression used |
score |
number | PLAN points 1-25 (half-points from dependence and cancer) |
max_score |
integer | Always 25 |
plan_band |
string | O'Donnell 2012 Results grouping: <10, 10-15, or >15 (death or severe disability strata). Not a mortality percent. |
age_years |
integer | Age used for 1 point per decade |
age_points |
integer | min(floor(age/10), 10) from O'Donnell 2012 Table 4 |
components |
array | Per-factor points |
citation |
object | O'Donnell 2012 Arch Intern Med citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 18,
"factor": "age",
"points": 1,
"present": true
},
{
"factor": "preadmission_dependence",
"points": 0.0,
"present": false
},
{
"factor": "cancer",
"points": 0.0,
"present": false
},
{
"factor": "congestive_heart_failure",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"points": 0,
"present": false
},
{
"factor": "reduced_loc",
"points": 0,
"present": false
},
{
"factor": "arm_weakness",
"points": 0,
"present": false
},
{
"factor": "leg_weakness",
"points": 0,
"present": false
},
{
"factor": "aphasia_or_neglect",
"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": "O'Donnell MJ, Fang J, D'Uva C, et al.",
"doi": "10.1001/2013.jamainternmed.30",
"id": "odonnell-2012",
"pmid": "23147454",
"source": "Arch Intern Med. 2012;172(20):1548-1556",
"title": "The PLAN score: a bedside prediction rule for death and severe disability following acute ischemic stroke"
},
"formula": "plan",
"formula_expression": "PLAN = preadmission_dependence 1.5 + cancer 1.5 + congestive_heart_failure 1 + atrial_fibrillation 1 + reduced_loc 5 + min(floor(age/10), 10) + arm_weakness 2 + leg_weakness 2 + aphasia_or_neglect 1; O'Donnell 2012 Table 4; max 25; bands <10 / 10-15 / >15",
"age_years": 18,
"max_score": 25,
"score": 1.0,
"age_points": 1,
"plan_band": "<10"
}
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_plan |
each PLAN 2012 stroke item must be a published value. 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
- THRIVE — Compute the Flint 2010 THRIVE (Totaled Health Risks in Vascular Events) score from trichotomized age, trichotomized NIHSS, and the chronic disease scale (hypertension, diabetes mellitus, atrial fibrillation).
- ABCD2 score — 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. 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.