# Nama 2022 BRUE risk probabilities

BRUE 2.0

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

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

## What it computes

Compute the Nama 2022 Supplemental Table 7 logistic probabilities of a serious underlying diagnosis and of event recurrence from age in days, similar-event history, abnormal medical history, prematurity, event clusters, color change, abnormal respiratory pattern, and tone change.

## When to use

When an agent already has a brief resolved unexplained event and needs the published Nama 2022 probabilities. Do not invent an admission cutoff. magent does not examine the infant.

## When not to use

- Not a medical device. Not a diagnosis.
- Nama 2022 Supplemental Table 7 logistic models only. magent does not apply a definition box and does not invent an admission cutoff.
- The caller assigns that the infant already meets a brief resolved unexplained event and assigns every flag. magent does not examine the infant or take a history.
- Age is 0-364 days. Recurrence in the derivation cohort was during the index emergency or hospital visit.
- Abnormal respiratory pattern and tone change have negative recurrence coefficients as published. Nama 2022 publishes no low or high percent cutoff.

## Formula

```
Ls = -3.75 + 0.56*history_of_similar_event + 0.65*abnormal_medical_history + 0.0025*age_days; Lr = -2.44 + 0.46*prematurity + 0.58*history_of_similar_event + 1.17*history_of_event_clusters + 0.36*color_change - 0.32*abnormal_respiratory_pattern - 0.31*tone_change (Nama 2022 Supplemental Table 7); estimated_serious_diagnosis_percent = 100 * exp(Ls) / (1 + exp(Ls)); estimated_event_recurrence_percent = 100 * exp(Lr) / (1 + exp(Lr))
```

## Citation

[Risk Prediction After a Brief Resolved Unexplained Event](https://doi.org/10.1542/hpeds.2022-006637)
Nama N, Hall M, Neuman M, et al.
Hosp Pediatr. 2022;12(9):772-785
DOI: [10.1542/hpeds.2022-006637](https://doi.org/10.1542/hpeds.2022-006637)

## Worked example

### Age 90 days, all flags false

Given: `abnormal_medical_history=false, abnormal_respiratory_pattern=false, age_days=90, color_change=false, history_of_event_clusters=false, history_of_similar_event=false, prematurity=false, tone_change=false`

1. Ls = -3.75 + 0.0025×90 = -3.525
2. estimated_serious_diagnosis_percent = 100 × e^(-3.525) / (1 + e^(-3.525))
3. Lr = -2.44 with all recurrence flags false
4. estimated_event_recurrence_percent from the unrounded logit


### Age 0 days, all flags false

Given: `abnormal_medical_history=false, abnormal_respiratory_pattern=false, age_days=0, color_change=false, history_of_event_clusters=false, history_of_similar_event=false, prematurity=false, tone_change=false`

1. Ls = -3.75 + 0.0025×0 = -3.75
2. Lr = -2.44


### Age 90 days, prior similar event

Given: `abnormal_medical_history=false, abnormal_respiratory_pattern=false, age_days=90, color_change=false, history_of_event_clusters=false, history_of_similar_event=true, prematurity=false, tone_change=false`

1. Ls = -3.75 + 0.56 + 0.0025×90 = -2.965
2. Lr = -2.44 + 0.58 = -1.86


### Age 90 days, abnormal medical history

Given: `abnormal_medical_history=true, abnormal_respiratory_pattern=false, age_days=90, color_change=false, history_of_event_clusters=false, history_of_similar_event=false, prematurity=false, tone_change=false`

1. Ls = -3.75 + 0.65 + 0.0025×90 = -2.875
2. Lr = -2.44; abnormal medical history is not in the recurrence model


### Age 90 days, event clusters

Given: `abnormal_medical_history=false, abnormal_respiratory_pattern=false, age_days=90, color_change=false, history_of_event_clusters=true, history_of_similar_event=false, prematurity=false, tone_change=false`

1. Ls is unchanged from age 90 with other flags false
2. Lr = -2.44 + 1.17 = -1.27


## Also searched as

- BRUE 2.0
- Nama 2022 BRUE
- brief resolved unexplained event risk
- serious diagnosis after BRUE
- BRUE recurrence probability
- Nama Hospital Pediatrics BRUE
- infant BRUE logistic risk
- BRUE event recurrence

## Parameters

- `age_days` (integer, required): Age in days (0-364). Nama 2022 Supplemental Table 7 serious-diagnosis model: +0.0025 per day. Recurrence model does not use age. magent does not examine the infant.
- `history_of_similar_event` (boolean, required): History of a similar event before the index presentation (Nama 2022 Supplemental Table 7). true or false as assigned by the caller. Serious-diagnosis +0.56; recurrence +0.58. magent does not examine the infant.
- `abnormal_medical_history` (boolean, required): Abnormal medical history such as previous hospitalization or an underlying medical condition (Nama 2022 Supplemental Table 7). true or false as assigned by the caller. Serious-diagnosis +0.65. Recurrence model does not use this flag.
- `prematurity` (boolean, required): Prematurity as published: born <32 weeks, or born between 32 and 38 weeks and corrected to <45 weeks (Nama 2022 Supplemental Table 7). true or false as assigned by the caller. Recurrence +0.46.
- `history_of_event_clusters` (boolean, required): History of multiple events or event clusters before presentation (Nama 2022 Supplemental Table 7). true or false as assigned by the caller. Recurrence +1.17.
- `color_change` (boolean, required): Color change (cyanosis or pallor) during the event (Nama 2022 Supplemental Table 7). true or false as assigned by the caller. Recurrence +0.36. magent does not examine the infant.
- `abnormal_respiratory_pattern` (boolean, required): Abnormal respiratory pattern (absent, decreased, or irregular breathing) during the event (Nama 2022 Supplemental Table 7). true or false as assigned by the caller. Recurrence -0.32.
- `tone_change` (boolean, required): Marked change in tone (hypertonia or hypotonia) during the event (Nama 2022 Supplemental Table 7). true or false as assigned by the caller. Recurrence -0.31.

## 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/brue_2`
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": [
    {
      "abnormal_medical_history": "false",
      "abnormal_respiratory_pattern": "false",
      "age_days": "90",
      "color_change": "false",
      "history_of_event_clusters": "false",
      "history_of_similar_event": "false",
      "prematurity": "false",
      "tone_change": "false"
    },
    {
      "abnormal_medical_history": "false",
      "abnormal_respiratory_pattern": "false",
      "age_days": "90",
      "color_change": "false",
      "history_of_event_clusters": "false",
      "history_of_similar_event": "false",
      "prematurity": "false",
      "tone_change": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/brue_2",
  "items": [
    {
      "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": "Nama N, Hall M, Neuman M, et al.",
        "doi": "10.1542/hpeds.2022-006637",
        "id": "nama-2022",
        "pmid": "35965279",
        "source": "Hosp Pediatr. 2022;12(9):772-785",
        "title": "Risk Prediction After a Brief Resolved Unexplained Event"
      },
      "formula": "brue_2",
      "formula_expression": "Ls = -3.75 + 0.56*history_of_similar_event + 0.65*abnormal_medical_history + 0.0025*age_days; Lr = -2.44 + 0.46*prematurity + 0.58*history_of_similar_event + 1.17*history_of_event_clusters + 0.36*color_change - 0.32*abnormal_respiratory_pattern - 0.31*tone_change (Nama 2022 Supplemental Table 7); estimated_serious_diagnosis_percent = 100 * exp(Ls) / (1 + exp(Ls)); estimated_event_recurrence_percent = 100 * exp(Lr) / (1 + exp(Lr))",
      "abnormal_medical_history": false,
      "abnormal_respiratory_pattern": false,
      "age_days": 90,
      "color_change": false,
      "estimated_event_recurrence_percent": 8.02,
      "estimated_serious_diagnosis_percent": 2.86,
      "event_recurrence_logit": -2.44,
      "history_of_event_clusters": false,
      "history_of_similar_event": false,
      "prematurity": false,
      "serious_diagnosis_logit": -3.525,
      "tone_change": 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": "Nama N, Hall M, Neuman M, et al.",
        "doi": "10.1542/hpeds.2022-006637",
        "id": "nama-2022",
        "pmid": "35965279",
        "source": "Hosp Pediatr. 2022;12(9):772-785",
        "title": "Risk Prediction After a Brief Resolved Unexplained Event"
      },
      "formula": "brue_2",
      "formula_expression": "Ls = -3.75 + 0.56*history_of_similar_event + 0.65*abnormal_medical_history + 0.0025*age_days; Lr = -2.44 + 0.46*prematurity + 0.58*history_of_similar_event + 1.17*history_of_event_clusters + 0.36*color_change - 0.32*abnormal_respiratory_pattern - 0.31*tone_change (Nama 2022 Supplemental Table 7); estimated_serious_diagnosis_percent = 100 * exp(Ls) / (1 + exp(Ls)); estimated_event_recurrence_percent = 100 * exp(Lr) / (1 + exp(Lr))",
      "abnormal_medical_history": false,
      "abnormal_respiratory_pattern": false,
      "age_days": 90,
      "color_change": false,
      "estimated_event_recurrence_percent": 8.02,
      "estimated_serious_diagnosis_percent": 2.86,
      "event_recurrence_logit": -2.44,
      "history_of_event_clusters": false,
      "history_of_similar_event": false,
      "prematurity": false,
      "serious_diagnosis_logit": -3.525,
      "tone_change": false
    }
  ]
}
```

## Response fields

- `formula` (string): brue_2
- `formula_expression` (string): Nama 2022 Supplemental Table 7 logistic expressions
- `age_days` (integer): Input age in days (0-364)
- `history_of_similar_event` (boolean): Caller-assigned similar-event history before the index presentation
- `abnormal_medical_history` (boolean): Caller-assigned abnormal medical history
- `prematurity` (boolean): Caller-assigned published prematurity flag
- `history_of_event_clusters` (boolean): Caller-assigned history of multiple events or event clusters
- `color_change` (boolean): Caller-assigned cyanosis or pallor during the event
- `abnormal_respiratory_pattern` (boolean): Caller-assigned absent, decreased, or irregular breathing during the event
- `tone_change` (boolean): Caller-assigned marked tone change during the event
- `serious_diagnosis_logit` (number): Nama 2022 Supplemental Table 7 serious-diagnosis linear predictor Ls, 4 decimal places
- `estimated_serious_diagnosis_percent` (number): 100 * exp(Ls) / (1 + exp(Ls)) from the unrounded logit, 2 decimal places. A probability, not an admission cutoff.
- `event_recurrence_logit` (number): Nama 2022 Supplemental Table 7 event-recurrence linear predictor Lr, 4 decimal places
- `estimated_event_recurrence_percent` (number): 100 * exp(Lr) / (1 + exp(Lr)) from the unrounded logit, 2 decimal places. Recurrence in the derivation cohort was during the index visit. A probability, not an admission cutoff.
- `citation` (object): Nama et al. Hosp Pediatr 2022 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Nama N, Hall M, Neuman M, et al.",
    "doi": "10.1542/hpeds.2022-006637",
    "id": "nama-2022",
    "pmid": "35965279",
    "source": "Hosp Pediatr. 2022;12(9):772-785",
    "title": "Risk Prediction After a Brief Resolved Unexplained Event"
  },
  "formula": "brue_2",
  "formula_expression": "Ls = -3.75 + 0.56*history_of_similar_event + 0.65*abnormal_medical_history + 0.0025*age_days; Lr = -2.44 + 0.46*prematurity + 0.58*history_of_similar_event + 1.17*history_of_event_clusters + 0.36*color_change - 0.32*abnormal_respiratory_pattern - 0.31*tone_change (Nama 2022 Supplemental Table 7); estimated_serious_diagnosis_percent = 100 * exp(Ls) / (1 + exp(Ls)); estimated_event_recurrence_percent = 100 * exp(Lr) / (1 + exp(Lr))",
  "abnormal_medical_history": false,
  "abnormal_respiratory_pattern": false,
  "age_days": 90,
  "color_change": false,
  "estimated_event_recurrence_percent": 8.02,
  "estimated_serious_diagnosis_percent": 2.86,
  "event_recurrence_logit": -2.44,
  "history_of_event_clusters": false,
  "history_of_similar_event": false,
  "prematurity": false,
  "serious_diagnosis_logit": -3.525,
  "tone_change": false
}
```

## Errors

- HTTP 400 `invalid_brue_2`: BRUE 2.0 needs the published infant event criteria as true or false or the paper's tokens. 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

- [BRUE](https://magentlab.com/docs/brue) — Apply the Tieder 2016 AAP BRUE definition and return feature_count (0-4) and whether the published definition box holds (brue).

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