# Risk score for exacerbations (Bateman)

RSE

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

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

## What it computes

Sum Bateman 2015 Table II normalized RSE points from caller-assigned BMI >=30, ACQ-5, FEV1 percent predicted, daily rescue occasions, and GINA treatment step 3 or 4, and return the 0-100 total.

## When to use

When an agent has caller-assigned Bateman 2015 RSE inputs and needs the published 0-100 point total. magent does not administer ACQ-5 or spirometry and does not change GINA step or order an inhaler.

## When not to use

- Not a medical device and not a diagnosis of asthma or of an impending exacerbation.
- Not a GINA step change or inhaler order. GINA step 3 or 4 is the derivation-population treatment step as assigned by the caller.
- magent does not administer ACQ-5 or spirometry. BMI >=30, ACQ-5, FEV1 percent predicted, and daily rescue occasions are caller-assigned.
- Table II normalized points only (0-100). The paper plots approximate 6-month exacerbation risk from score 0 to 100; this tool does not emit named low/mid/high strata or a fitted probability.

## Formula

```
RSE = bmi_ge_30 + acq5 + fev1_percent_predicted + rescue_occasions_per_day + gina_step; Bateman 2015 Table II normalized points; BMI >=30 -> 14 else 0; ACQ-5 <1.5 -> 0, 1.5 <= ACQ-5 < 2.5 -> 7, >=2.5 -> 13; FEV1 % predicted >=90 -> 0, 80 <= FEV1 < 90 -> 13, <80 -> 20; rescue occasions/day <2 -> 0, 2 <= x < 4 -> 11, >=4 -> 26; GINA step 3 -> 0, 4 -> 27; max 100
```

## Citation

[Development and validation of a novel risk score for asthma exacerbations: The risk score for exacerbations](https://doi.org/10.1016/j.jaci.2014.08.015)
Bateman ED, Buhl R, O'Byrne PM, Humbert M, Reddel HK, Sears MR, Jenkins C, Harrison TW, Quirce S, Peterson S, Eriksson G
J Allergy Clin Immunol. 2015;135(6):1457-1464.e4
DOI: [10.1016/j.jaci.2014.08.015](https://doi.org/10.1016/j.jaci.2014.08.015)

## Worked example

### All lowest Table II bands (score 0)

Given: `acq5=1.0, bmi_ge_30=false, fev1_percent_predicted=95, gina_step=3, rescue_occasions_per_day=0`

1. BMI <30 -> 0; ACQ-5 1.0 (<1.5) -> 0; FEV1 95% (>=90) -> 0; rescue 0/day (<2) -> 0; GINA step 3 -> 0
2. Score = 0 (max 100)


### All Table II maxima (score 100)

Given: `acq5=6, bmi_ge_30=true, fev1_percent_predicted=10, gina_step=4, rescue_occasions_per_day=30`

1. BMI >=30 -> 14; ACQ-5 6 (>=2.5) -> 13; FEV1 10% (<80) -> 20; rescue 30/day (>=4) -> 26; GINA step 4 -> 27
2. Score = 100 (max 100)


## Also searched as

- risk score for exacerbations
- RSE asthma
- Bateman RSE
- asthma exacerbation risk score
- Bateman 2015 RSE
- RSE score

## Parameters

- `bmi_ge_30` (boolean, required): Caller-assigned BMI >= 30 kg/m2 (Bateman 2015 Table II). true scores 14; false scores 0. magent does not compute BMI.
- `acq5` (number, required): Caller-assigned 5-item Asthma Control Questionnaire mean (0-6). Table II: <1.5 scores 0; 1.5 <= ACQ-5 < 2.5 scores 7; >=2.5 scores 13. magent does not administer ACQ-5.
- `fev1_percent_predicted` (number, required): Caller-assigned FEV1 as percent of predicted (10-150). Table II: >=90 scores 0; 80 <= FEV1 < 90 scores 13; <80 scores 20. magent does not perform spirometry.
- `rescue_occasions_per_day` (number, required): Caller-assigned daily reliever occasions (0-30). Table II: <2 scores 0; 2 <= occasions < 4 scores 11; >=4 scores 26. magent does not count inhaler actuations.
- `gina_step` (integer, required): Caller-assigned GINA treatment step in the Bateman 2015 derivation population. Must be 3 (0 points) or 4 (27 points). Other steps are invalid_gina_step. Not a step-change or inhaler order.

## 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/rse`
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": [
    {
      "acq5": "1.0",
      "bmi_ge_30": "false",
      "fev1_percent_predicted": "95",
      "gina_step": "3",
      "rescue_occasions_per_day": "0"
    },
    {
      "acq5": "1.0",
      "bmi_ge_30": "false",
      "fev1_percent_predicted": "95",
      "gina_step": "3",
      "rescue_occasions_per_day": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/rse",
  "items": [
    {
      "components": [
        {
          "factor": "bmi_ge_30",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "acq5",
          "points": 0,
          "present": false
        },
        {
          "value": 95.0,
          "factor": "fev1_percent_predicted",
          "points": 0,
          "present": false
        },
        {
          "value": 0.0,
          "factor": "rescue_occasions_per_day",
          "points": 0,
          "present": false
        },
        {
          "value": 3,
          "factor": "gina_step",
          "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": "Bateman ED, Buhl R, O'Byrne PM, Humbert M, Reddel HK, Sears MR, Jenkins C, Harrison TW, Quirce S, Peterson S, Eriksson G",
        "doi": "10.1016/j.jaci.2014.08.015",
        "id": "bateman-2015",
        "pmid": "25258144",
        "source": "J Allergy Clin Immunol. 2015;135(6):1457-1464.e4",
        "title": "Development and validation of a novel risk score for asthma exacerbations: The risk score for exacerbations"
      },
      "formula": "rse",
      "formula_expression": "RSE = bmi_ge_30 + acq5 + fev1_percent_predicted + rescue_occasions_per_day + gina_step; Bateman 2015 Table II normalized points; BMI >=30 -> 14 else 0; ACQ-5 <1.5 -> 0, 1.5 <= ACQ-5 < 2.5 -> 7, >=2.5 -> 13; FEV1 % predicted >=90 -> 0, 80 <= FEV1 < 90 -> 13, <80 -> 20; rescue occasions/day <2 -> 0, 2 <= x < 4 -> 11, >=4 -> 26; GINA step 3 -> 0, 4 -> 27; max 100",
      "max_score": 100,
      "score": 0,
      "fev1_percent_predicted": 95.0,
      "acq5": 1.0,
      "bmi_ge_30": false,
      "gina_step": 3,
      "rescue_occasions_per_day": 0.0
    },
    {
      "components": [
        {
          "factor": "bmi_ge_30",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "acq5",
          "points": 0,
          "present": false
        },
        {
          "value": 95.0,
          "factor": "fev1_percent_predicted",
          "points": 0,
          "present": false
        },
        {
          "value": 0.0,
          "factor": "rescue_occasions_per_day",
          "points": 0,
          "present": false
        },
        {
          "value": 3,
          "factor": "gina_step",
          "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": "Bateman ED, Buhl R, O'Byrne PM, Humbert M, Reddel HK, Sears MR, Jenkins C, Harrison TW, Quirce S, Peterson S, Eriksson G",
        "doi": "10.1016/j.jaci.2014.08.015",
        "id": "bateman-2015",
        "pmid": "25258144",
        "source": "J Allergy Clin Immunol. 2015;135(6):1457-1464.e4",
        "title": "Development and validation of a novel risk score for asthma exacerbations: The risk score for exacerbations"
      },
      "formula": "rse",
      "formula_expression": "RSE = bmi_ge_30 + acq5 + fev1_percent_predicted + rescue_occasions_per_day + gina_step; Bateman 2015 Table II normalized points; BMI >=30 -> 14 else 0; ACQ-5 <1.5 -> 0, 1.5 <= ACQ-5 < 2.5 -> 7, >=2.5 -> 13; FEV1 % predicted >=90 -> 0, 80 <= FEV1 < 90 -> 13, <80 -> 20; rescue occasions/day <2 -> 0, 2 <= x < 4 -> 11, >=4 -> 26; GINA step 3 -> 0, 4 -> 27; max 100",
      "max_score": 100,
      "score": 0,
      "fev1_percent_predicted": 95.0,
      "acq5": 1.0,
      "bmi_ge_30": false,
      "gina_step": 3,
      "rescue_occasions_per_day": 0.0
    }
  ]
}
```

## Response fields

- `formula` (string): rse
- `formula_expression` (string): Bateman 2015 Table II normalized RSE expression
- `score` (integer): Table II normalized points 0-100. Score only; no invented risk labels.
- `max_score` (integer): 100
- `bmi_ge_30` (boolean): Echo of caller-assigned BMI >= 30 flag
- `acq5` (number): Echo of caller-assigned ACQ-5
- `fev1_percent_predicted` (number): Echo of caller-assigned FEV1 percent predicted
- `rescue_occasions_per_day` (number): Echo of caller-assigned daily rescue occasions
- `gina_step` (integer): Echo of caller-assigned GINA step 3 or 4
- `components` (array): Per-factor Table II points
- `citation` (object): Bateman et al. J Allergy Clin Immunol 2015 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "bmi_ge_30",
      "points": 0,
      "present": false
    },
    {
      "value": 1.0,
      "factor": "acq5",
      "points": 0,
      "present": false
    },
    {
      "value": 95.0,
      "factor": "fev1_percent_predicted",
      "points": 0,
      "present": false
    },
    {
      "value": 0.0,
      "factor": "rescue_occasions_per_day",
      "points": 0,
      "present": false
    },
    {
      "value": 3,
      "factor": "gina_step",
      "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": "Bateman ED, Buhl R, O'Byrne PM, Humbert M, Reddel HK, Sears MR, Jenkins C, Harrison TW, Quirce S, Peterson S, Eriksson G",
    "doi": "10.1016/j.jaci.2014.08.015",
    "id": "bateman-2015",
    "pmid": "25258144",
    "source": "J Allergy Clin Immunol. 2015;135(6):1457-1464.e4",
    "title": "Development and validation of a novel risk score for asthma exacerbations: The risk score for exacerbations"
  },
  "formula": "rse",
  "formula_expression": "RSE = bmi_ge_30 + acq5 + fev1_percent_predicted + rescue_occasions_per_day + gina_step; Bateman 2015 Table II normalized points; BMI >=30 -> 14 else 0; ACQ-5 <1.5 -> 0, 1.5 <= ACQ-5 < 2.5 -> 7, >=2.5 -> 13; FEV1 % predicted >=90 -> 0, 80 <= FEV1 < 90 -> 13, <80 -> 20; rescue occasions/day <2 -> 0, 2 <= x < 4 -> 11, >=4 -> 26; GINA step 3 -> 0, 4 -> 27; max 100",
  "max_score": 100,
  "score": 0,
  "fev1_percent_predicted": 95.0,
  "acq5": 1.0,
  "bmi_ge_30": false,
  "gina_step": 3,
  "rescue_occasions_per_day": 0.0
}
```

## Errors

- HTTP 400 `invalid_acq5`: acq5 must be a number from 0 to 6 (Bateman 2015 RSE 5-item Asthma Control Questionnaire). Returned before settlement; you are not charged.
- HTTP 400 `invalid_rescue_occasions`: rescue_occasions_per_day must be a number from 0 to 30 (Bateman 2015 RSE daily reliever occasions). Returned before settlement; you are not charged.
- HTTP 400 `invalid_gina_step`: gina_step must be 3 or 4 (Bateman 2015 RSE derivation population GINA treatment step). Returned before settlement; you are not charged.
- HTTP 400 `invalid_fev1_percent`: fev1_percent_predicted must be a number from 10 to 150. 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

- [PASS](https://magentlab.com/docs/pass) — Sum three caller-assigned Gorelick 2004 PASS item points and return the published 0-6 total.
- [Asthma Predictive Index](https://magentlab.com/docs/asthma-api) — Apply Castro-Rodriguez 2000 Table 1 and return stringent and loose Asthma Predictive Index flags from caller-assigned early-wheeze class and five major/minor criteria.

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