# RISK-E score (Olmos 2017)

RISK-E

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

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

## What it computes

Compute the Olmos 2017 RISK-E (Risk-Endocarditis) score from age and seven caller-assigned flags for active left-sided infective endocarditis undergoing cardiac surgery, and return the integer score and max_score 68.

## When to use

When an agent already has Olmos 2017 inputs (age and caller-assigned prosthetic infection, periannular complications, Staphylococcus aureus or fungi, acute renal failure, septic shock, cardiogenic shock, and thrombocytopenia) and needs the published RISK-E point total, not a mortality percent, diagnosis, or surgery decision.

## When not to use

- Not a medical device. Not a diagnosis of infective endocarditis.
- magent does not examine the valve, read echocardiography, or decide surgery. Flags are caller-assigned.
- Returns score and max_score 68 only. The paper estimated predicted mortality over score combinations; magent does not return a mortality percent or risk band.
- Not Park 2016 ICE IE 6-month mortality (ie-mortality). Not Durack 1994 Duke diagnostic criteria.
- Age 18-120 is the magent adult clamp via Params.age/1, not a published Olmos 2017 age range.

## Formula

```
RISK-E = age (<=51: 0, 52-63: 9, 64-72: 13, >=73: 14) + prosthetic_infection 6 + periannular_complications 5 + staphylococcus_aureus_or_fungi 9 + acute_renal_failure 5 + septic_shock 7 + cardiogenic_shock 15 + thrombocytopenia 7; max 68. Score and max_score only; not a mortality percent. Olmos 2017 Table 2 and Table 3. Not Park 2016. Not Duke
```

## Citation

[Risk score for cardiac surgery in active left-sided infective endocarditis](https://doi.org/10.1136/heartjnl-2016-311093)
Olmos C, Vilacosta I, Fernández C, et al.
Heart. 2017;103(18):1435-1442
DOI: [10.1136/heartjnl-2016-311093](https://doi.org/10.1136/heartjnl-2016-311093)

## Worked example

### Age 50, all flags false

Given: `acute_renal_failure=false, age=50, cardiogenic_shock=false, periannular_complications=false, prosthetic_infection=false, septic_shock=false, staphylococcus_aureus_or_fungi=false, thrombocytopenia=false`

1. Age <=51 -> 0; all flags false -> 0
2. Score = 0; max_score = 68


### Olmos 2017 Table 3: age 60, prosthetic, S. aureus, acute renal failure

Given: `acute_renal_failure=true, age=60, cardiogenic_shock=false, periannular_complications=false, prosthetic_infection=true, septic_shock=false, staphylococcus_aureus_or_fungi=true, thrombocytopenia=false`

1. Age 52-63 -> 9; prosthetic_infection +6; staphylococcus_aureus_or_fungi +9; acute_renal_failure +5
2. Score = 29; max_score = 68. Not the paper's predicted-mortality percent.


## Also searched as

- RISK-E score
- Risk-Endocarditis score
- Olmos endocarditis surgery score
- left-sided IE surgical risk
- cardiac surgery infective endocarditis score
- Olmos 2017 RISK-E
- IE perioperative mortality score

## Parameters

- `age` (integer, required): Age in years (integer 18-120). Olmos 2017: <=51 scores 0; 52-63 scores 9; 64-72 scores 13; >=73 scores 14. Age 51 scores 0; 52 scores 9; 63 scores 9; 64 scores 13; 72 scores 13; 73 scores 14. magent does not examine the patient.
- `prosthetic_infection` (boolean, required): Prosthetic-valve infection as assigned by the caller (Olmos 2017). true or false. +6 if true. magent does not examine the valve.
- `periannular_complications` (boolean, required): Periannular complications (abscess, pseudoaneurysm, fistula, or prosthetic dehiscence) as assigned by the caller (Olmos 2017). true or false. +5 if true. magent does not read echocardiography.
- `staphylococcus_aureus_or_fungi` (boolean, required): Staphylococcus aureus or fungi as assigned by the caller (Olmos 2017 virulent microorganism). true or false. +9 if true. magent does not interpret cultures.
- `acute_renal_failure` (boolean, required): Acute renal failure as assigned by the caller (Olmos 2017; GFR <60 mL/min/1.73 m2 in the derivation). true or false. +5 if true. magent does not compute GFR.
- `septic_shock` (boolean, required): Septic shock as assigned by the caller (Olmos 2017). true or false. +7 if true. magent does not diagnose shock.
- `cardiogenic_shock` (boolean, required): Cardiogenic shock as assigned by the caller (Olmos 2017). true or false. +15 if true. magent does not diagnose shock or decide surgery.
- `thrombocytopenia` (boolean, required): Thrombocytopenia as assigned by the caller (Olmos 2017 thrombocytopaenia, <150000 platelets/mm3). true or false. +7 if true. magent does not interpret a platelet count.

## 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/riske`
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": [
    {
      "acute_renal_failure": "false",
      "age": "50",
      "cardiogenic_shock": "false",
      "periannular_complications": "false",
      "prosthetic_infection": "false",
      "septic_shock": "false",
      "staphylococcus_aureus_or_fungi": "false",
      "thrombocytopenia": "false"
    },
    {
      "acute_renal_failure": "false",
      "age": "50",
      "cardiogenic_shock": "false",
      "periannular_complications": "false",
      "prosthetic_infection": "false",
      "septic_shock": "false",
      "staphylococcus_aureus_or_fungi": "false",
      "thrombocytopenia": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/riske",
  "items": [
    {
      "components": [
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": true
        },
        {
          "factor": "prosthetic_infection",
          "points": 0,
          "present": false
        },
        {
          "factor": "periannular_complications",
          "points": 0,
          "present": false
        },
        {
          "factor": "staphylococcus_aureus_or_fungi",
          "points": 0,
          "present": false
        },
        {
          "factor": "acute_renal_failure",
          "points": 0,
          "present": false
        },
        {
          "factor": "septic_shock",
          "points": 0,
          "present": false
        },
        {
          "factor": "cardiogenic_shock",
          "points": 0,
          "present": false
        },
        {
          "factor": "thrombocytopenia",
          "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": "Olmos C, Vilacosta I, Fernández C, et al.",
        "doi": "10.1136/heartjnl-2016-311093",
        "id": "olmos-2017",
        "pmid": "28432158",
        "source": "Heart. 2017;103(18):1435-1442",
        "title": "Risk score for cardiac surgery in active left-sided infective endocarditis"
      },
      "formula": "riske",
      "formula_expression": "RISK-E = age (<=51: 0, 52-63: 9, 64-72: 13, >=73: 14) + prosthetic_infection 6 + periannular_complications 5 + staphylococcus_aureus_or_fungi 9 + acute_renal_failure 5 + septic_shock 7 + cardiogenic_shock 15 + thrombocytopenia 7; max 68. Score and max_score only; not a mortality percent. Olmos 2017 Table 2 and Table 3. Not Park 2016. Not Duke",
      "max_score": 68,
      "score": 0,
      "age_years": 50
    },
    {
      "components": [
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": true
        },
        {
          "factor": "prosthetic_infection",
          "points": 0,
          "present": false
        },
        {
          "factor": "periannular_complications",
          "points": 0,
          "present": false
        },
        {
          "factor": "staphylococcus_aureus_or_fungi",
          "points": 0,
          "present": false
        },
        {
          "factor": "acute_renal_failure",
          "points": 0,
          "present": false
        },
        {
          "factor": "septic_shock",
          "points": 0,
          "present": false
        },
        {
          "factor": "cardiogenic_shock",
          "points": 0,
          "present": false
        },
        {
          "factor": "thrombocytopenia",
          "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": "Olmos C, Vilacosta I, Fernández C, et al.",
        "doi": "10.1136/heartjnl-2016-311093",
        "id": "olmos-2017",
        "pmid": "28432158",
        "source": "Heart. 2017;103(18):1435-1442",
        "title": "Risk score for cardiac surgery in active left-sided infective endocarditis"
      },
      "formula": "riske",
      "formula_expression": "RISK-E = age (<=51: 0, 52-63: 9, 64-72: 13, >=73: 14) + prosthetic_infection 6 + periannular_complications 5 + staphylococcus_aureus_or_fungi 9 + acute_renal_failure 5 + septic_shock 7 + cardiogenic_shock 15 + thrombocytopenia 7; max 68. Score and max_score only; not a mortality percent. Olmos 2017 Table 2 and Table 3. Not Park 2016. Not Duke",
      "max_score": 68,
      "score": 0,
      "age_years": 50
    }
  ]
}
```

## Response fields

- `formula` (string): riske
- `formula_expression` (string): Exact expression used
- `score` (integer): Olmos 2017 RISK-E points 0-68. Not a mortality percent and not a risk band.
- `max_score` (integer): Always 68
- `age_years` (integer): Age used for the Olmos 2017 age term
- `components` (array): Per-factor points
- `citation` (object): Olmos et al. Heart 2017 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 50,
      "factor": "age",
      "points": 0,
      "present": true
    },
    {
      "factor": "prosthetic_infection",
      "points": 0,
      "present": false
    },
    {
      "factor": "periannular_complications",
      "points": 0,
      "present": false
    },
    {
      "factor": "staphylococcus_aureus_or_fungi",
      "points": 0,
      "present": false
    },
    {
      "factor": "acute_renal_failure",
      "points": 0,
      "present": false
    },
    {
      "factor": "septic_shock",
      "points": 0,
      "present": false
    },
    {
      "factor": "cardiogenic_shock",
      "points": 0,
      "present": false
    },
    {
      "factor": "thrombocytopenia",
      "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": "Olmos C, Vilacosta I, Fernández C, et al.",
    "doi": "10.1136/heartjnl-2016-311093",
    "id": "olmos-2017",
    "pmid": "28432158",
    "source": "Heart. 2017;103(18):1435-1442",
    "title": "Risk score for cardiac surgery in active left-sided infective endocarditis"
  },
  "formula": "riske",
  "formula_expression": "RISK-E = age (<=51: 0, 52-63: 9, 64-72: 13, >=73: 14) + prosthetic_infection 6 + periannular_complications 5 + staphylococcus_aureus_or_fungi 9 + acute_renal_failure 5 + septic_shock 7 + cardiogenic_shock 15 + thrombocytopenia 7; max 68. Score and max_score only; not a mortality percent. Olmos 2017 Table 2 and Table 3. Not Park 2016. Not Duke",
  "max_score": 68,
  "score": 0,
  "age_years": 50
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 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

- [Duke](https://magentlab.com/docs/duke) — Apply the Durack 1994 original Duke criteria for infective endocarditis and return definite, possible, or rejected from caller-assigned pathologic, major, minor, and rejected flags.
- [IE mortality](https://magentlab.com/docs/ie-mortality) — Compute the Park 2016 ICE simplified risk score for 6-month mortality in infective endocarditis from age and caller-assigned Table 5 flags, and return the score, quadratic 6-month mortality percent, and whether score >= 8.
- [EuroSCORE II](https://magentlab.com/docs/euroscore-ii) — Compute the Nashef 2012 Table 6 logistic estimated in-hospital mortality after adult cardiac surgery from the published multivariable coefficients.

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