# RESCUE-IHCA score (Tonna 2022)

RESCUE-IHCA

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

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

## What it computes

Sum Tonna 2022 Table 2 RESCUE-IHCA integer cells for in-hospital death after adult ECPR and return the published point total, not a cannulation or ECPR order.

## When to use

When an agent has caller-assigned Tonna 2022 Table 2 predictors (age, preexisting renal insufficiency, time of day, illness category, presenting rhythm, arrest duration) and needs the integer score, not a percent read from a website curve and not an ECPR order.

## When not to use

- Not a medical device. magent does not cannulate, does not order ECPR, and does not examine the patient.
- Not an ECPR or cannulation order, not a futility determination, and not a code-status order. Derivation is adult IHCA treated with ECPR (excluded age <18 and OHCA preceding admission).
- Tonna 2022 Table 2 integer cells only. Race appeared in univariate Table 1 but is not in the score (the paper excluded race from the prediction model).
- Figure 3 is a continuous probability curve (about 0.22-0.99). The paper does not print a numeric points-to-mortality lookup table; this tool returns the integer score only and does not invent tertiles or percents.
- Time of day follows Table 2: 07:00-14:59 (0), 15:00-22:59 (+4), 23:00-06:59 (+13). Medical noncardiac illness and asystole are the 0-point reference cells.
- Duration is caller-assigned integer minutes (0-180). Each complete 10 minutes scores +2. magent does not time the arrest.

## Formula

```
RESCUE-IHCA = age(2 + 2 * max(0, floor((age-20)/10))) + preexisting_renal_insufficiency(yes 8) + time_of_day(day_0700_1459 0, evening_1500_2259 4, night_2300_0659 13) + illness_category(medical_noncardiac 0, medical_cardiac -2, surgical_noncardiac -6, surgical_cardiac -11) + presenting_rhythm(asystole 0, pea -1, pvt -5, vf -8, palpable_pulse_initially -5) + duration_min(2 * floor(duration_min/10)); Tonna 2022 Table 2; theoretical min -17; paper text about -15 to >40; higher score → higher probability of in-hospital death (Figure 3 curve 0.22-0.99); integer score only
```

## Citation

[Resuscitation Using ECPR During In-Hospital Cardiac Arrest (RESCUE-IHCA) Mortality Prediction Score and External Validation](https://doi.org/10.1016/j.jcin.2021.09.032)
Tonna JE, Selzman CH, Girotra S, et al.
JACC Cardiovasc Interv. 2022;15(3):237-247
DOI: [10.1016/j.jcin.2021.09.032](https://doi.org/10.1016/j.jcin.2021.09.032)

## Worked example

### Table 2 theoretical minimum (age 20, surgical cardiac, VF)

Given: `age=20, duration_min=0, illness_category=surgical_cardiac, preexisting_renal_insufficiency=false, presenting_rhythm=vf, time_of_day=day_0700_1459`

1. Age 20 → 2; renal false → 0; day_0700_1459 → 0
2. surgical_cardiac → -11; vf → -8; duration 0 → 0
3. Score = 2 + 0 + 0 - 11 - 8 + 0 = -17 (Table 2 cell minimum). Integer score only.


### Older age, renal insufficiency, night arrest, 30 min duration

Given: `age=80, duration_min=30, illness_category=medical_noncardiac, preexisting_renal_insufficiency=true, presenting_rhythm=asystole, time_of_day=night_2300_0659`

1. Age 80 → 2 + 2 * floor(60/10) = 14; renal true → +8; night_2300_0659 → +13
2. medical_noncardiac → 0; asystole → 0; duration 30 → +6
3. Score = 14 + 8 + 13 + 0 + 0 + 6 = 41 (paper text about -15 to >40)


## Also searched as

- RESCUE-IHCA score
- Tonna ECPR mortality
- in-hospital cardiac arrest ECPR score
- extracorporeal CPR IHCA
- RESCUE IHCA 2022
- ECPR mortality prediction
- GWTG-R ECPR score

## Parameters

- `age` (integer, required): Age in years (18-120). Tonna 2022 Table 2: ≤20 → 2; each additional 10 years → +2, implemented as 2 + 2 * max(0, floor((age-20)/10)) so 20 → 2, 29 → 2, 30 → 4, 40 → 6. Adult derivation (excluded age <18). Caller-supplied; magent does not examine the patient.
- `preexisting_renal_insufficiency` (boolean, required): Preexisting renal insufficiency as assigned by the caller (Tonna 2022 Table 2). true → +8. false → 0. magent does not grade creatinine.
- `time_of_day` (string, required): Time of day of arrest (Tonna 2022 Table 2). day_0700_1459 (07:00-14:59, reference) → 0; evening_1500_2259 (15:00-22:59) → +4; night_2300_0659 (23:00-06:59) → +13. Caller-assigned; magent does not read a clock.
- `illness_category` (string, required): Illness category (Tonna 2022 Table 2). medical_noncardiac (reference) → 0; medical_cardiac → -2; surgical_noncardiac → -6; surgical_cardiac → -11. Caller-assigned; magent does not classify the admission.
- `presenting_rhythm` (string, required): Presenting rhythm (Tonna 2022 Table 2). asystole (reference) → 0; pea → -1; pvt → -5; vf → -8; palpable_pulse_initially → -5. Caller-assigned; magent does not interpret a monitor.
- `duration_min` (integer, required): Duration of cardiac arrest in integer minutes (0-180). Tonna 2022 Table 2: +2 per complete 10 minutes (2 * floor(duration_min/10)). 0-9 → 0; 10-19 → +2; 20-29 → +4. Caller-supplied; magent does not time the arrest.

## 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/rescue_ihca`
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": "20",
      "duration_min": "0",
      "illness_category": "surgical_cardiac",
      "preexisting_renal_insufficiency": "false",
      "presenting_rhythm": "vf",
      "time_of_day": "day_0700_1459"
    },
    {
      "age": "20",
      "duration_min": "0",
      "illness_category": "surgical_cardiac",
      "preexisting_renal_insufficiency": "false",
      "presenting_rhythm": "vf",
      "time_of_day": "day_0700_1459"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/rescue_ihca",
  "items": [
    {
      "components": [
        {
          "value": 20,
          "factor": "age",
          "points": 2,
          "present": true
        },
        {
          "factor": "preexisting_renal_insufficiency",
          "points": 0,
          "present": false
        },
        {
          "value": "day_0700_1459",
          "factor": "time_of_day",
          "points": 0,
          "present": false
        },
        {
          "value": "surgical_cardiac",
          "factor": "illness_category",
          "points": -11,
          "present": true
        },
        {
          "value": "vf",
          "factor": "presenting_rhythm",
          "points": -8,
          "present": true
        },
        {
          "value": 0,
          "factor": "duration_min",
          "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": "Tonna JE, Selzman CH, Girotra S, et al.",
        "doi": "10.1016/j.jcin.2021.09.032",
        "id": "tonna-2022",
        "pmid": "35033471",
        "source": "JACC Cardiovasc Interv. 2022;15(3):237-247",
        "title": "Resuscitation Using ECPR During In-Hospital Cardiac Arrest (RESCUE-IHCA) Mortality Prediction Score and External Validation"
      },
      "formula": "rescue_ihca",
      "formula_expression": "RESCUE-IHCA = age(2 + 2 * max(0, floor((age-20)/10))) + preexisting_renal_insufficiency(yes 8) + time_of_day(day_0700_1459 0, evening_1500_2259 4, night_2300_0659 13) + illness_category(medical_noncardiac 0, medical_cardiac -2, surgical_noncardiac -6, surgical_cardiac -11) + presenting_rhythm(asystole 0, pea -1, pvt -5, vf -8, palpable_pulse_initially -5) + duration_min(2 * floor(duration_min/10)); Tonna 2022 Table 2; theoretical min -17; paper text about -15 to >40; higher score → higher probability of in-hospital death (Figure 3 curve 0.22-0.99); integer score only",
      "score": -17,
      "min_score": -17
    },
    {
      "components": [
        {
          "value": 20,
          "factor": "age",
          "points": 2,
          "present": true
        },
        {
          "factor": "preexisting_renal_insufficiency",
          "points": 0,
          "present": false
        },
        {
          "value": "day_0700_1459",
          "factor": "time_of_day",
          "points": 0,
          "present": false
        },
        {
          "value": "surgical_cardiac",
          "factor": "illness_category",
          "points": -11,
          "present": true
        },
        {
          "value": "vf",
          "factor": "presenting_rhythm",
          "points": -8,
          "present": true
        },
        {
          "value": 0,
          "factor": "duration_min",
          "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": "Tonna JE, Selzman CH, Girotra S, et al.",
        "doi": "10.1016/j.jcin.2021.09.032",
        "id": "tonna-2022",
        "pmid": "35033471",
        "source": "JACC Cardiovasc Interv. 2022;15(3):237-247",
        "title": "Resuscitation Using ECPR During In-Hospital Cardiac Arrest (RESCUE-IHCA) Mortality Prediction Score and External Validation"
      },
      "formula": "rescue_ihca",
      "formula_expression": "RESCUE-IHCA = age(2 + 2 * max(0, floor((age-20)/10))) + preexisting_renal_insufficiency(yes 8) + time_of_day(day_0700_1459 0, evening_1500_2259 4, night_2300_0659 13) + illness_category(medical_noncardiac 0, medical_cardiac -2, surgical_noncardiac -6, surgical_cardiac -11) + presenting_rhythm(asystole 0, pea -1, pvt -5, vf -8, palpable_pulse_initially -5) + duration_min(2 * floor(duration_min/10)); Tonna 2022 Table 2; theoretical min -17; paper text about -15 to >40; higher score → higher probability of in-hospital death (Figure 3 curve 0.22-0.99); integer score only",
      "score": -17,
      "min_score": -17
    }
  ]
}
```

## Response fields

- `formula` (string): rescue_ihca
- `formula_expression` (string): Exact expression used
- `score` (integer): Tonna 2022 Table 2 RESCUE-IHCA points. Table 2 theoretical min -17; paper text about -15 to >40. Integer total only; not a mortality percent.
- `min_score` (integer): -17 (Table 2 cell minimum: age ≤20, surgical cardiac, VF, duration 0)
- `components` (array): Per-cell Table 2 points
- `citation` (object): Tonna et al. JACC Cardiovasc Interv 2022 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 20,
      "factor": "age",
      "points": 2,
      "present": true
    },
    {
      "factor": "preexisting_renal_insufficiency",
      "points": 0,
      "present": false
    },
    {
      "value": "day_0700_1459",
      "factor": "time_of_day",
      "points": 0,
      "present": false
    },
    {
      "value": "surgical_cardiac",
      "factor": "illness_category",
      "points": -11,
      "present": true
    },
    {
      "value": "vf",
      "factor": "presenting_rhythm",
      "points": -8,
      "present": true
    },
    {
      "value": 0,
      "factor": "duration_min",
      "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": "Tonna JE, Selzman CH, Girotra S, et al.",
    "doi": "10.1016/j.jcin.2021.09.032",
    "id": "tonna-2022",
    "pmid": "35033471",
    "source": "JACC Cardiovasc Interv. 2022;15(3):237-247",
    "title": "Resuscitation Using ECPR During In-Hospital Cardiac Arrest (RESCUE-IHCA) Mortality Prediction Score and External Validation"
  },
  "formula": "rescue_ihca",
  "formula_expression": "RESCUE-IHCA = age(2 + 2 * max(0, floor((age-20)/10))) + preexisting_renal_insufficiency(yes 8) + time_of_day(day_0700_1459 0, evening_1500_2259 4, night_2300_0659 13) + illness_category(medical_noncardiac 0, medical_cardiac -2, surgical_noncardiac -6, surgical_cardiac -11) + presenting_rhythm(asystole 0, pea -1, pvt -5, vf -8, palpable_pulse_initially -5) + duration_min(2 * floor(duration_min/10)); Tonna 2022 Table 2; theoretical min -17; paper text about -15 to >40; higher score → higher probability of in-hospital death (Figure 3 curve 0.22-0.99); integer score only",
  "score": -17,
  "min_score": -17
}
```

## Errors

- HTTP 400 `invalid_rescue_ihca`: RESCUE-IHCA needs Tonna 2022 age, renal history, time of day, illness category, rhythm, and arrest duration in published ranges. 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

- [SAVE-score](https://magentlab.com/docs/save) — Sum Schmidt 2015 Table 4 SAVE-score cells including the published constant −6 and return class I–V with hospital survival percents.
- [GO-FAR](https://magentlab.com/docs/go-far) — Sum the Ebell 2013 GO-FAR Table 3 integer score (beta × 10 rounded) from exclusive age and 12 caller-assigned prearrest flags, and return the published likelihood band for CPC 1 after in-hospital CPR.

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