# Ottawa Heart Failure Risk Scale

OHFRS

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

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

## What it computes

Sum the ten Stiell 2013 Ottawa Heart Failure Risk Scale flags and return the integer point total (max 15).

## When to use

When an agent needs the published Stiell 2013 OHFRS point total from caller-assigned flags and must not invent ECG, walk-test, or laboratory findings or a discharge decision.

## When not to use

- Not a medical device.
- Not a disposition or discharge order. Not EHMRG.
- Apply after ED intervention as in Stiell 2013. magent does not walk the patient or interpret the ECG.
- The caller assigns all ten flags after applying the published cutoffs. magent does not assay labs.

## Formula

```
OHFRS = history_stroke_or_tia(1) + intubation_respiratory_distress(2) + hr_arrival_ge_110(2) + sao2_lt_90_arrival(1) + walk_test_hr_ge_110_or_unable(1) + new_ischemic_ecg(2) + urea_ge_12_mmol_l(1) + co2_ge_35_mmol_l(2) + troponin_mi_level(2) + ntprobnp_ge_5000(1); Stiell 2013 derivation; max 15; SAE risk varied from 2.8% to 89.0%; admission thresholds of total score 1, 2, or 3 had sensitivities 95.2 / 80.6 / 64.5%
```

## Citation

[A risk scoring system to identify emergency department patients with heart failure at high risk for serious adverse events](https://doi.org/10.1111/acem.12056)
Stiell IG, Clement CM, Brison RJ, et al.
Acad Emerg Med. 2013;20(1):17-26
DOI: [10.1111/acem.12056](https://doi.org/10.1111/acem.12056)

## Worked example

### All ten flags false

Given: `co2_ge_35_mmol_l=false, history_stroke_or_tia=false, hr_arrival_ge_110=false, intubation_respiratory_distress=false, new_ischemic_ecg=false, ntprobnp_ge_5000=false, sao2_lt_90_arrival=false, troponin_mi_level=false, urea_ge_12_mmol_l=false, walk_test_hr_ge_110_or_unable=false`

1. Ten findings absent → 0 each
2. Score = 0 (max 15)


### All ten flags true

Given: `co2_ge_35_mmol_l=true, history_stroke_or_tia=true, hr_arrival_ge_110=true, intubation_respiratory_distress=true, new_ischemic_ecg=true, ntprobnp_ge_5000=true, sao2_lt_90_arrival=true, troponin_mi_level=true, urea_ge_12_mmol_l=true, walk_test_hr_ge_110_or_unable=true`

1. 1+2+2+1+1+2+1+2+2+1
2. Score = 15 (max 15)


## Also searched as

- Ottawa Heart Failure Risk Scale
- OHFRS
- Stiell heart failure risk
- Ottawa HF risk scale
- Stiell 2013 OHFRS
- emergency heart failure SAE
- Ottawa Heart Failure Risk Score
- NT-proBNP heart failure ED score

## Parameters

- `history_stroke_or_tia` (boolean, required): History of stroke or TIA as assigned by the caller (Stiell 2013; 1 point if true). true or false. magent does not take the history.
- `intubation_respiratory_distress` (boolean, required): Intubation for respiratory distress as assigned by the caller (Stiell 2013; 2 points if true). true or false.
- `hr_arrival_ge_110` (boolean, required): Heart rate on ED arrival >=110 as assigned by the caller after applying the Stiell 2013 cutoff (2 points if true). true or false. magent does not measure heart rate.
- `sao2_lt_90_arrival` (boolean, required): Oxygen saturation <90% on ED arrival as assigned by the caller after applying the Stiell 2013 cutoff (1 point if true). true or false. magent does not measure saturation.
- `walk_test_hr_ge_110_or_unable` (boolean, required): Heart rate >=110 during the 3-minute walk test, or unable to perform the walk test, as assigned by the caller after ED intervention (Stiell 2013; 1 point if true). true or false. magent does not walk the patient.
- `new_ischemic_ecg` (boolean, required): New ischemic ECG changes as assigned by the caller (Stiell 2013 derivation; 2 points if true). true or false. magent does not interpret the ECG.
- `urea_ge_12_mmol_l` (boolean, required): Urea >=12 mmol/L as assigned by the caller after applying the Stiell 2013 cutoff (1 point if true). true or false. magent does not assay urea.
- `co2_ge_35_mmol_l` (boolean, required): Serum CO2 >=35 mmol/L as assigned by the caller after applying the Stiell 2013 cutoff (2 points if true). true or false. magent does not assay CO2.
- `troponin_mi_level` (boolean, required): Troponin I or T elevated to MI level as assigned by the caller (Stiell 2013; 2 points if true). true or false. magent does not assay troponin.
- `ntprobnp_ge_5000` (boolean, required): NT-proBNP >=5000 ng/L as assigned by the caller after applying the Stiell 2013 cutoff (1 point if true). true or false. magent does not assay NT-proBNP.

## 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/ohfrs`
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": [
    {
      "co2_ge_35_mmol_l": "false",
      "history_stroke_or_tia": "false",
      "hr_arrival_ge_110": "false",
      "intubation_respiratory_distress": "false",
      "new_ischemic_ecg": "false",
      "ntprobnp_ge_5000": "false",
      "sao2_lt_90_arrival": "false",
      "troponin_mi_level": "false",
      "urea_ge_12_mmol_l": "false",
      "walk_test_hr_ge_110_or_unable": "false"
    },
    {
      "co2_ge_35_mmol_l": "false",
      "history_stroke_or_tia": "false",
      "hr_arrival_ge_110": "false",
      "intubation_respiratory_distress": "false",
      "new_ischemic_ecg": "false",
      "ntprobnp_ge_5000": "false",
      "sao2_lt_90_arrival": "false",
      "troponin_mi_level": "false",
      "urea_ge_12_mmol_l": "false",
      "walk_test_hr_ge_110_or_unable": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/ohfrs",
  "items": [
    {
      "components": [
        {
          "factor": "history_stroke_or_tia",
          "points": 0,
          "present": false
        },
        {
          "factor": "intubation_respiratory_distress",
          "points": 0,
          "present": false
        },
        {
          "factor": "hr_arrival_ge_110",
          "points": 0,
          "present": false
        },
        {
          "factor": "sao2_lt_90_arrival",
          "points": 0,
          "present": false
        },
        {
          "factor": "walk_test_hr_ge_110_or_unable",
          "points": 0,
          "present": false
        },
        {
          "factor": "new_ischemic_ecg",
          "points": 0,
          "present": false
        },
        {
          "factor": "urea_ge_12_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "factor": "co2_ge_35_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "factor": "troponin_mi_level",
          "points": 0,
          "present": false
        },
        {
          "factor": "ntprobnp_ge_5000",
          "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": "Stiell IG, Clement CM, Brison RJ, et al.",
        "doi": "10.1111/acem.12056",
        "id": "stiell-2013",
        "pmid": "23570474",
        "source": "Acad Emerg Med. 2013;20(1):17-26",
        "title": "A risk scoring system to identify emergency department patients with heart failure at high risk for serious adverse events"
      },
      "formula": "ohfrs",
      "formula_expression": "OHFRS = history_stroke_or_tia(1) + intubation_respiratory_distress(2) + hr_arrival_ge_110(2) + sao2_lt_90_arrival(1) + walk_test_hr_ge_110_or_unable(1) + new_ischemic_ecg(2) + urea_ge_12_mmol_l(1) + co2_ge_35_mmol_l(2) + troponin_mi_level(2) + ntprobnp_ge_5000(1); Stiell 2013 derivation; max 15; SAE risk varied from 2.8% to 89.0%; admission thresholds of total score 1, 2, or 3 had sensitivities 95.2 / 80.6 / 64.5%",
      "max_score": 15,
      "score": 0
    },
    {
      "components": [
        {
          "factor": "history_stroke_or_tia",
          "points": 0,
          "present": false
        },
        {
          "factor": "intubation_respiratory_distress",
          "points": 0,
          "present": false
        },
        {
          "factor": "hr_arrival_ge_110",
          "points": 0,
          "present": false
        },
        {
          "factor": "sao2_lt_90_arrival",
          "points": 0,
          "present": false
        },
        {
          "factor": "walk_test_hr_ge_110_or_unable",
          "points": 0,
          "present": false
        },
        {
          "factor": "new_ischemic_ecg",
          "points": 0,
          "present": false
        },
        {
          "factor": "urea_ge_12_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "factor": "co2_ge_35_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "factor": "troponin_mi_level",
          "points": 0,
          "present": false
        },
        {
          "factor": "ntprobnp_ge_5000",
          "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": "Stiell IG, Clement CM, Brison RJ, et al.",
        "doi": "10.1111/acem.12056",
        "id": "stiell-2013",
        "pmid": "23570474",
        "source": "Acad Emerg Med. 2013;20(1):17-26",
        "title": "A risk scoring system to identify emergency department patients with heart failure at high risk for serious adverse events"
      },
      "formula": "ohfrs",
      "formula_expression": "OHFRS = history_stroke_or_tia(1) + intubation_respiratory_distress(2) + hr_arrival_ge_110(2) + sao2_lt_90_arrival(1) + walk_test_hr_ge_110_or_unable(1) + new_ischemic_ecg(2) + urea_ge_12_mmol_l(1) + co2_ge_35_mmol_l(2) + troponin_mi_level(2) + ntprobnp_ge_5000(1); Stiell 2013 derivation; max 15; SAE risk varied from 2.8% to 89.0%; admission thresholds of total score 1, 2, or 3 had sensitivities 95.2 / 80.6 / 64.5%",
      "max_score": 15,
      "score": 0
    }
  ]
}
```

## Response fields

- `formula` (string): ohfrs
- `formula_expression` (string): Exact expression used
- `score` (integer): OHFRS points 0-15 (Stiell 2013)
- `max_score` (integer): 15
- `components` (array): Per-flag points
- `citation` (object): Stiell et al. Acad Emerg Med 2013 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "history_stroke_or_tia",
      "points": 0,
      "present": false
    },
    {
      "factor": "intubation_respiratory_distress",
      "points": 0,
      "present": false
    },
    {
      "factor": "hr_arrival_ge_110",
      "points": 0,
      "present": false
    },
    {
      "factor": "sao2_lt_90_arrival",
      "points": 0,
      "present": false
    },
    {
      "factor": "walk_test_hr_ge_110_or_unable",
      "points": 0,
      "present": false
    },
    {
      "factor": "new_ischemic_ecg",
      "points": 0,
      "present": false
    },
    {
      "factor": "urea_ge_12_mmol_l",
      "points": 0,
      "present": false
    },
    {
      "factor": "co2_ge_35_mmol_l",
      "points": 0,
      "present": false
    },
    {
      "factor": "troponin_mi_level",
      "points": 0,
      "present": false
    },
    {
      "factor": "ntprobnp_ge_5000",
      "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": "Stiell IG, Clement CM, Brison RJ, et al.",
    "doi": "10.1111/acem.12056",
    "id": "stiell-2013",
    "pmid": "23570474",
    "source": "Acad Emerg Med. 2013;20(1):17-26",
    "title": "A risk scoring system to identify emergency department patients with heart failure at high risk for serious adverse events"
  },
  "formula": "ohfrs",
  "formula_expression": "OHFRS = history_stroke_or_tia(1) + intubation_respiratory_distress(2) + hr_arrival_ge_110(2) + sao2_lt_90_arrival(1) + walk_test_hr_ge_110_or_unable(1) + new_ischemic_ecg(2) + urea_ge_12_mmol_l(1) + co2_ge_35_mmol_l(2) + troponin_mi_level(2) + ntprobnp_ge_5000(1); Stiell 2013 derivation; max 15; SAE risk varied from 2.8% to 89.0%; admission thresholds of total score 1, 2, or 3 had sensitivities 95.2 / 80.6 / 64.5%",
  "max_score": 15,
  "score": 0
}
```

## Errors

- 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

- [NEWS](https://magentlab.com/docs/news) — Compute the RCP 2012 National Early Warning Score from respiratory rate, SpO2, supplemental oxygen, temperature, systolic BP, heart rate, and caller-assigned AVPU.
- [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.
- [Killip](https://magentlab.com/docs/killip) — Return the Killip and Kimball 1967 myocardial-infarction heart-failure class 1-4 from a caller-assigned integer, with the published class description and 1967 CCU hospital mortality.

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