# THRIVE score

THRIVE

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

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

## What it computes

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).

## When to use

When an agent needs the published Flint 2010 THRIVE total and 90-day good-outcome and mortality strata after endovascular stroke treatment, and must not invent NIHSS or comorbidity points from a chart narrative.

## When not to use

- Not a medical device and not a treatment recommendation.
- Derived in MERCI and Multi MERCI endovascular cohorts (Flint 2010). It is not a recommendation for or against endovascular therapy.
- The caller assigns NIHSS and comorbidities (hypertension, diabetes mellitus, atrial fibrillation). magent does not examine the patient.

## Formula

```
THRIVE = trichotomized_age + trichotomized_nihss + CDS; age <=59 0, 60-79 1, >=80 2; NIHSS <=10 0, 11-20 2, >=21 4; hypertension, diabetes, atrial fibrillation 1 each (CDS 0-3); bands 0-2 / 3-5 / 6-9; max 9
```

## Citation

[Predicting long-term outcome after endovascular stroke treatment: the totaled health risks in vascular events score](https://doi.org/10.3174/ajnr.A2050)
Flint AC, Cullen SP, Faigeles BG, Rao VA
AJNR Am J Neuroradiol. 2010;31(7):1192-1196
DOI: [10.3174/ajnr.A2050](https://doi.org/10.3174/ajnr.A2050)

## Worked example

### Age 70, NIHSS 12, hypertension only

Given: `age=70, atrial_fibrillation=false, diabetes=false, hypertension=true, nihss=12`

1. Age 70 is 60-79 → 1; NIHSS 12 is 11-20 → 2; CDS hypertension only → 1
2. Score = 4 (max 9); thrive_band moderate; good outcome 43.5%; 90-day mortality 30.1%


## Also searched as

- THRIVE score
- Totaled Health Risks in Vascular Events
- Flint THRIVE
- endovascular stroke THRIVE
- THRIVE NIHSS age CDS
- 90-day mRS THRIVE
- chronic disease scale THRIVE
- Flint 2010 THRIVE

## Parameters

- `age` (integer, required): Age in years (18-120). Trichotomized: ≤59 scores 0; 60-79 scores 1; ≥80 scores 2 (1 point per age level).
- `nihss` (integer, required): Caller-assigned NIH Stroke Scale total (integer 0-42). Trichotomized: ≤10 scores 0; 11-20 scores 2; ≥21 scores 4 (2 points per NIHSS level). magent does not examine the patient.
- `hypertension` (boolean, required): Hypertension on the chronic disease scale (CDS). true scores 1; false scores 0.
- `diabetes` (boolean, required): Diabetes mellitus on the chronic disease scale (CDS). true scores 1; false scores 0.
- `atrial_fibrillation` (boolean, required): Atrial fibrillation on the chronic disease scale (CDS). true scores 1; false scores 0.

## 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/thrive`
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": [
    {
      "age": "70",
      "atrial_fibrillation": "false",
      "diabetes": "false",
      "hypertension": "true",
      "nihss": "12"
    },
    {
      "age": "70",
      "atrial_fibrillation": "false",
      "diabetes": "false",
      "hypertension": "true",
      "nihss": "12"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/thrive",
  "items": [
    {
      "components": [
        {
          "value": 70,
          "factor": "age",
          "points": 1,
          "present": true
        },
        {
          "value": 12,
          "factor": "nihss",
          "points": 2,
          "present": true
        },
        {
          "factor": "hypertension",
          "points": 1,
          "present": true
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "atrial_fibrillation",
          "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": "Flint AC, Cullen SP, Faigeles BG, Rao VA",
        "doi": "10.3174/ajnr.A2050",
        "id": "flint-2010",
        "pmid": "20223889",
        "source": "AJNR Am J Neuroradiol. 2010;31(7):1192-1196",
        "title": "Predicting long-term outcome after endovascular stroke treatment: the totaled health risks in vascular events score"
      },
      "formula": "thrive",
      "formula_expression": "THRIVE = trichotomized_age + trichotomized_nihss + CDS; age <=59 0, 60-79 1, >=80 2; NIHSS <=10 0, 11-20 2, >=21 4; hypertension, diabetes, atrial fibrillation 1 each (CDS 0-3); bands 0-2 / 3-5 / 6-9; max 9",
      "age_years": 70,
      "max_score": 9,
      "score": 4,
      "cds": 1,
      "good_outcome_percent": 43.5,
      "mortality_percent": 30.1,
      "nihss": 12,
      "thrive_band": "moderate"
    },
    {
      "components": [
        {
          "value": 70,
          "factor": "age",
          "points": 1,
          "present": true
        },
        {
          "value": 12,
          "factor": "nihss",
          "points": 2,
          "present": true
        },
        {
          "factor": "hypertension",
          "points": 1,
          "present": true
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "atrial_fibrillation",
          "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": "Flint AC, Cullen SP, Faigeles BG, Rao VA",
        "doi": "10.3174/ajnr.A2050",
        "id": "flint-2010",
        "pmid": "20223889",
        "source": "AJNR Am J Neuroradiol. 2010;31(7):1192-1196",
        "title": "Predicting long-term outcome after endovascular stroke treatment: the totaled health risks in vascular events score"
      },
      "formula": "thrive",
      "formula_expression": "THRIVE = trichotomized_age + trichotomized_nihss + CDS; age <=59 0, 60-79 1, >=80 2; NIHSS <=10 0, 11-20 2, >=21 4; hypertension, diabetes, atrial fibrillation 1 each (CDS 0-3); bands 0-2 / 3-5 / 6-9; max 9",
      "age_years": 70,
      "max_score": 9,
      "score": 4,
      "cds": 1,
      "good_outcome_percent": 43.5,
      "mortality_percent": 30.1,
      "nihss": 12,
      "thrive_band": "moderate"
    }
  ]
}
```

## Response fields

- `formula` (string): thrive
- `formula_expression` (string): Exact expression used
- `score` (integer): Total points 0-9
- `max_score` (integer): Always 9
- `thrive_band` (string): low (0-2), moderate (3-5), or high (6-9) from Flint 2010
- `good_outcome_percent` (number): Published 90-day mRS 0-2 percent for that band (Flint 2010)
- `mortality_percent` (number): Published 90-day mortality percent for that band (Flint 2010)
- `cds` (integer): Chronic disease scale 0-3
- `age_years` (integer): Age used for trichotomized age points
- `nihss` (integer): Caller-assigned NIHSS used for points
- `components` (array): Per-factor points
- `citation` (object): Flint 2010 AJNR citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 70,
      "factor": "age",
      "points": 1,
      "present": true
    },
    {
      "value": 12,
      "factor": "nihss",
      "points": 2,
      "present": true
    },
    {
      "factor": "hypertension",
      "points": 1,
      "present": true
    },
    {
      "factor": "diabetes",
      "points": 0,
      "present": false
    },
    {
      "factor": "atrial_fibrillation",
      "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": "Flint AC, Cullen SP, Faigeles BG, Rao VA",
    "doi": "10.3174/ajnr.A2050",
    "id": "flint-2010",
    "pmid": "20223889",
    "source": "AJNR Am J Neuroradiol. 2010;31(7):1192-1196",
    "title": "Predicting long-term outcome after endovascular stroke treatment: the totaled health risks in vascular events score"
  },
  "formula": "thrive",
  "formula_expression": "THRIVE = trichotomized_age + trichotomized_nihss + CDS; age <=59 0, 60-79 1, >=80 2; NIHSS <=10 0, 11-20 2, >=21 4; hypertension, diabetes, atrial fibrillation 1 each (CDS 0-3); bands 0-2 / 3-5 / 6-9; max 9",
  "age_years": 70,
  "max_score": 9,
  "score": 4,
  "cds": 1,
  "good_outcome_percent": 43.5,
  "mortality_percent": 30.1,
  "nihss": 12,
  "thrive_band": "moderate"
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_nihss`: nihss must be an integer from 0 to 42. Returned before settlement; you are not charged.
- 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

- [Glasgow Coma Scale](https://magentlab.com/docs/gcs) — Compute the Glasgow Coma Scale as the sum of caller-assigned eye, verbal, and motor integers. The 1974 or 1976 edition is required.
- [ABCD2 score](https://magentlab.com/docs/abcd2) — Compute the ABCD2 score as age, blood pressure, caller-assigned clinical features, symptom duration, and diabetes.
- [ICH Score](https://magentlab.com/docs/ich-score) — Compute the Hemphill 2001 ICH Score from caller-assigned GCS, age, infratentorial origin, ICH volume, and IVH.
- [Modified Rankin](https://magentlab.com/docs/modified-rankin) — Return the van Swieten 1988 modified Rankin handicap grade 0-5 from a caller-assigned integer, with the published grade wording.

## 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.
- 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.
