# Cardiac Arrest Risk Triage (CART)

CART

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

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

## What it computes

Compute the Churpek 2012 Cardiac Arrest Risk Triage (CART) integer score from caller-assigned maximum respiratory rate, maximum heart rate, minimum diastolic blood pressure, and age.

## When to use

When an agent needs the published Churpek 2012 Table 3 CART point total and must not invent a cardiac-arrest diagnosis, RRT order, or risk-band percents.

## When not to use

- Not a medical device and not a cardiac-arrest diagnosis, RRT activation, or code-blue order. magent does not measure vitals; the caller assigns maximum RR, maximum HR, minimum DBP, and age.
- Churpek 2012 Table 3 integer CART (beta x 9) only. Score range 0-57. Does not return risk-band percents or a three-band enum.
- The paper's operational cut-off for comparison with MEWS is not emitted as a required band or RRT threshold.
- This is not MEWS. Related MEWS is a different published score.

## Formula

```
CART = rr_points + hr_points + dbp_points + age_points; Churpek 2012 Table 3 integer score (beta x 9); max 57
```

## Citation

[Derivation of a Cardiac Arrest Prediction Model Using Ward Vital Signs](https://doi.org/10.1097/CCM.0b013e318250aa5a)
Churpek MM, Yuen TC, Park SY, Meltzer DO, Hall JB, Edelson DP
Crit Care Med. 2012;40(7):2102-2108
DOI: [10.1097/CCM.0b013e318250aa5a](https://doi.org/10.1097/CCM.0b013e318250aa5a)

## Worked example

### RR 20, HR 80, DBP 80, age 40

Given: `age=40, diastolic_mm_hg=80, heart_rate_bpm=80, respiratory_rate=20`

1. RR 20 → 0; HR 80 → 0; DBP 80 → 0; age 40 → 0
2. Score = 0 (max 57)


### Highest Table 3 bands

Given: `age=70, diastolic_mm_hg=34, heart_rate_bpm=140, respiratory_rate=30`

1. RR 30 → 22; HR 140 → 13; DBP 34 → 13; age 70 → 9
2. Score = 57 (max 57)


## Also searched as

- cardiac arrest risk triage
- CART score
- CART
- Churpek CART
- ward vital signs cardiac arrest
- cardiac arrest triage score

## Parameters

- `respiratory_rate` (integer, required): Maximum respiratory rate in breaths/min (integer 0-80). Churpek 2012 Table 3: <21 → 0, 21-23 → 8, 24-25 → 12, 26-29 → 15, >29 → 22. magent does not measure vitals; the caller assigns the number.
- `heart_rate_bpm` (integer, required): Maximum heart rate in beats/min (integer 30-220). Churpek 2012 Table 3: <110 → 0, 110-139 → 4, >139 → 13. magent does not measure vitals; the caller assigns the number.
- `diastolic_mm_hg` (integer, required): Minimum diastolic blood pressure in mm Hg (integer 20-160). Churpek 2012 Table 3: >49 → 0, 40-49 → 4, 35-39 → 6, <35 → 13. magent does not measure vitals; the caller assigns the number.
- `age` (integer, required): Age in years (integer 18-120). Churpek 2012 Table 3: <55 → 0, 55-69 → 4, >69 → 9. magent does not assign age.

## 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/cart`
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": "40",
      "diastolic_mm_hg": "80",
      "heart_rate_bpm": "80",
      "respiratory_rate": "20"
    },
    {
      "age": "40",
      "diastolic_mm_hg": "80",
      "heart_rate_bpm": "80",
      "respiratory_rate": "20"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/cart",
  "items": [
    {
      "components": [
        {
          "value": 20,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate_bpm",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "diastolic_mm_hg",
          "points": 0,
          "present": false
        },
        {
          "value": 40,
          "factor": "age",
          "points": 0,
          "present": false
        }
      ],
      "age": 40,
      "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": "Churpek MM, Yuen TC, Park SY, Meltzer DO, Hall JB, Edelson DP",
        "doi": "10.1097/CCM.0b013e318250aa5a",
        "id": "churpek-2012",
        "pmid": "22584764",
        "source": "Crit Care Med. 2012;40(7):2102-2108",
        "title": "Derivation of a Cardiac Arrest Prediction Model Using Ward Vital Signs"
      },
      "formula": "cart",
      "formula_expression": "CART = rr_points + hr_points + dbp_points + age_points; Churpek 2012 Table 3 integer score (beta x 9); max 57",
      "max_score": 57,
      "score": 0,
      "diastolic_mm_hg": 80,
      "heart_rate_bpm": 80,
      "respiratory_rate": 20
    },
    {
      "components": [
        {
          "value": 20,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate_bpm",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "diastolic_mm_hg",
          "points": 0,
          "present": false
        },
        {
          "value": 40,
          "factor": "age",
          "points": 0,
          "present": false
        }
      ],
      "age": 40,
      "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": "Churpek MM, Yuen TC, Park SY, Meltzer DO, Hall JB, Edelson DP",
        "doi": "10.1097/CCM.0b013e318250aa5a",
        "id": "churpek-2012",
        "pmid": "22584764",
        "source": "Crit Care Med. 2012;40(7):2102-2108",
        "title": "Derivation of a Cardiac Arrest Prediction Model Using Ward Vital Signs"
      },
      "formula": "cart",
      "formula_expression": "CART = rr_points + hr_points + dbp_points + age_points; Churpek 2012 Table 3 integer score (beta x 9); max 57",
      "max_score": 57,
      "score": 0,
      "diastolic_mm_hg": 80,
      "heart_rate_bpm": 80,
      "respiratory_rate": 20
    }
  ]
}
```

## Response fields

- `formula` (string): cart
- `formula_expression` (string): Exact expression used
- `score` (integer): CART points 0-57
- `max_score` (integer): Always 57 (22+13+13+9)
- `respiratory_rate` (integer): Maximum respiratory rate used, breaths/min
- `heart_rate_bpm` (integer): Maximum heart rate used, bpm
- `diastolic_mm_hg` (integer): Minimum diastolic BP used, mm Hg
- `age` (integer): Age in years used
- `components` (array): Per-vital and age points
- `citation` (object): Churpek 2012 Crit Care Med citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 20,
      "factor": "respiratory_rate",
      "points": 0,
      "present": false
    },
    {
      "value": 80,
      "factor": "heart_rate_bpm",
      "points": 0,
      "present": false
    },
    {
      "value": 80,
      "factor": "diastolic_mm_hg",
      "points": 0,
      "present": false
    },
    {
      "value": 40,
      "factor": "age",
      "points": 0,
      "present": false
    }
  ],
  "age": 40,
  "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": "Churpek MM, Yuen TC, Park SY, Meltzer DO, Hall JB, Edelson DP",
    "doi": "10.1097/CCM.0b013e318250aa5a",
    "id": "churpek-2012",
    "pmid": "22584764",
    "source": "Crit Care Med. 2012;40(7):2102-2108",
    "title": "Derivation of a Cardiac Arrest Prediction Model Using Ward Vital Signs"
  },
  "formula": "cart",
  "formula_expression": "CART = rr_points + hr_points + dbp_points + age_points; Churpek 2012 Table 3 integer score (beta x 9); max 57",
  "max_score": 57,
  "score": 0,
  "diastolic_mm_hg": 80,
  "heart_rate_bpm": 80,
  "respiratory_rate": 20
}
```

## Errors

- HTTP 400 `invalid_rts_respiratory_rate`: respiratory_rate must be an integer from 0 to 80. Returned before settlement; you are not charged.
- HTTP 400 `invalid_heart_rate`: heart_rate_bpm must be an integer from 30 to 220 Returned before settlement; you are not charged.
- HTTP 400 `invalid_diastolic_bp`: diastolic_mm_hg must be a number from 20 to 160. Returned before settlement; you are not charged.
- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_cart`: each CART 2012 vital or age must be a published Table 3 category. 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

- [MEWS](https://magentlab.com/docs/mews) — Compute the Subbe 2001 modified Early Warning Score from systolic BP, heart rate, respiratory rate, temperature, and caller-assigned AVPU.

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