# HCM Risk-SCD

HCM Risk-SCD

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/hcm_risk_scd`
HTML: https://magentlab.com/docs/hcm-risk-scd
Markdown: https://magentlab.com/docs/hcm-risk-scd.md

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

## What it computes

Compute the O'Mahony 2014 HCM Risk-SCD 5-year sudden cardiac death probability from maximal wall thickness, left-atrial diameter, maximal LVOT gradient, family history of SCD, NSVT, unexplained syncope, and age.

## When to use

When an agent already has those seven caller-assigned O'Mahony 2014 predictors and needs that paper's 5-year SCD probability and 4%/6% operating-point band. Not an ICD indication or device order.

## When not to use

- Not a medical device. Not a diagnosis of hypertrophic cardiomyopathy. Not an ICD indication, implant order, or device-programming recommendation.
- O'Mahony 2014 HCM Risk-SCD only (Eur Heart J 2014; S0 at 5 years = 0.998). magent does not apply later extensions or other society SCD algorithms.
- Caller assigns echo measurements and history flags. magent does not examine the patient, take a family history, interpret Holter monitoring, or read an echocardiogram.
- Age 16-80, maximal wall thickness 10-35 mm, left-atrial diameter 20-70 mm, and maximal LVOT gradient 0-154 mm Hg are the modelled range. Extreme values were underrepresented in the derivation cohort.
- risk_band uses that paper's 4% and 6% 5-year operating points (<4 lower, 4 to <6 intermediate, >=6 higher). It is not an ICD class.

## Formula

```
P_5y = 1 - 0.998^exp(PI); PI = 0.15939858*max_wall_thickness_mm - 0.00294271*max_wall_thickness_mm^2 + 0.0259082*la_diameter_mm + 0.00446131*max_lvot_gradient_mm_hg + 0.4583082*family_history_scd + 0.82639195*nsvt + 0.71650361*unexplained_syncope - 0.01799934*age; flags 1 if true else 0; O'Mahony 2014; risk_band <4 lower, 4 to <6 intermediate, >=6 higher
```

## Citation

[A novel clinical risk prediction model for sudden cardiac death in hypertrophic cardiomyopathy (HCM Risk-SCD)](https://doi.org/10.1093/eurheartj/eht439)
O'Mahony C, Jichi F, Pavlou M, et al.
Eur Heart J. 2014;35(30):2010-2020
DOI: [10.1093/eurheartj/eht439](https://doi.org/10.1093/eurheartj/eht439)

## Worked example

### Age 40, wall 20 mm, LA 40 mm, LVOT 20 mm Hg, no family history, NSVT, or syncope

Given: `age=40, family_history_scd=false, la_diameter_mm=40, max_lvot_gradient_mm_hg=20, max_wall_thickness_mm=20, nsvt=false, unexplained_syncope=false`

1. MWT term = 0.15939858*20 - 0.00294271*20^2 = 3.1879716 - 1.177084
2. LA term = 0.0259082*40 = 1.036328; LVOT term = 0.00446131*20 = 0.0892262
3. flags 0; age term = -0.01799934*40 = -0.7199736
4. PI = 2.4164682 → 2.416468
5. P_5y = 1 - 0.998^exp(PI) → 2.2%; risk_band lower (<4)


### Same row with NSVT (4% to <6% operating point)

Given: `age=40, family_history_scd=false, la_diameter_mm=40, max_lvot_gradient_mm_hg=20, max_wall_thickness_mm=20, nsvt=true, unexplained_syncope=false`

1. NSVT true adds 0.82639195 to PI
2. five_year_scd_risk_percent 5.0; risk_band intermediate (4 to <6)
3. Not an ICD indication


## Also searched as

- HCM Risk-SCD
- O'Mahony 2014
- hypertrophic cardiomyopathy SCD
- HCM sudden cardiac death risk
- ESC HCM Risk-SCD
- NSVT HCM SCD
- HCM 5-year SCD probability

## Parameters

- `age` (integer, required): Age at clinical evaluation in years (integer 16-80). O'Mahony 2014 continuous predictor (coefficient -0.01799934). Derivation was HCM evaluated at 16 years or older. magent does not examine the patient.
- `max_wall_thickness_mm` (number, required): Maximal left-ventricular wall thickness in mm (10.0-35.0). Enters as linear and squared terms. magent does not read an echocardiogram.
- `la_diameter_mm` (number, required): Left-atrial diameter in mm (20.0-70.0). O'Mahony 2014 continuous predictor. magent does not measure the atrium.
- `max_lvot_gradient_mm_hg` (number, required): Maximal left-ventricular outflow-tract gradient in mm Hg (0.0-154.0). magent does not measure the gradient.
- `family_history_scd` (boolean, required): Family history of sudden cardiac death as assigned by the caller (true=1, false=0). magent does not take a family history.
- `nsvt` (boolean, required): Non-sustained ventricular tachycardia as assigned by the caller (true=1, false=0). magent does not interpret Holter monitoring.
- `unexplained_syncope` (boolean, required): Unexplained syncope as assigned by the caller (true=1, false=0). magent does not adjudicate syncope.

## 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/hcm_risk_scd`
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",
      "family_history_scd": "false",
      "la_diameter_mm": "40",
      "max_lvot_gradient_mm_hg": "20",
      "max_wall_thickness_mm": "20",
      "nsvt": "false",
      "unexplained_syncope": "false"
    },
    {
      "age": "40",
      "family_history_scd": "false",
      "la_diameter_mm": "40",
      "max_lvot_gradient_mm_hg": "20",
      "max_wall_thickness_mm": "20",
      "nsvt": "false",
      "unexplained_syncope": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/hcm_risk_scd",
  "items": [
    {
      "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": "O'Mahony C, Jichi F, Pavlou M, et al.",
        "doi": "10.1093/eurheartj/eht439",
        "id": "omahony-2014",
        "pmid": "24126876",
        "source": "Eur Heart J. 2014;35(30):2010-2020",
        "title": "A novel clinical risk prediction model for sudden cardiac death in hypertrophic cardiomyopathy (HCM Risk-SCD)"
      },
      "formula": "hcm_risk_scd",
      "formula_expression": "P_5y = 1 - 0.998^exp(PI); PI = 0.15939858*max_wall_thickness_mm - 0.00294271*max_wall_thickness_mm^2 + 0.0259082*la_diameter_mm + 0.00446131*max_lvot_gradient_mm_hg + 0.4583082*family_history_scd + 0.82639195*nsvt + 0.71650361*unexplained_syncope - 0.01799934*age; flags 1 if true else 0; O'Mahony 2014; risk_band <4 lower, 4 to <6 intermediate, >=6 higher",
      "risk_band": "lower",
      "family_history_scd": false,
      "five_year_scd_risk_percent": 2.2,
      "la_diameter_mm": 40.0,
      "max_lvot_gradient_mm_hg": 20.0,
      "max_wall_thickness_mm": 20.0,
      "nsvt": false,
      "prognostic_index": 2.416468,
      "unexplained_syncope": 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": "O'Mahony C, Jichi F, Pavlou M, et al.",
        "doi": "10.1093/eurheartj/eht439",
        "id": "omahony-2014",
        "pmid": "24126876",
        "source": "Eur Heart J. 2014;35(30):2010-2020",
        "title": "A novel clinical risk prediction model for sudden cardiac death in hypertrophic cardiomyopathy (HCM Risk-SCD)"
      },
      "formula": "hcm_risk_scd",
      "formula_expression": "P_5y = 1 - 0.998^exp(PI); PI = 0.15939858*max_wall_thickness_mm - 0.00294271*max_wall_thickness_mm^2 + 0.0259082*la_diameter_mm + 0.00446131*max_lvot_gradient_mm_hg + 0.4583082*family_history_scd + 0.82639195*nsvt + 0.71650361*unexplained_syncope - 0.01799934*age; flags 1 if true else 0; O'Mahony 2014; risk_band <4 lower, 4 to <6 intermediate, >=6 higher",
      "risk_band": "lower",
      "family_history_scd": false,
      "five_year_scd_risk_percent": 2.2,
      "la_diameter_mm": 40.0,
      "max_lvot_gradient_mm_hg": 20.0,
      "max_wall_thickness_mm": 20.0,
      "nsvt": false,
      "prognostic_index": 2.416468,
      "unexplained_syncope": false
    }
  ]
}
```

## Response fields

- `formula` (string): hcm_risk_scd
- `formula_expression` (string): O'Mahony 2014 PI and 5-year SCD probability
- `age` (integer): Age in years used (16-80)
- `max_wall_thickness_mm` (number): Maximal wall thickness used, mm
- `la_diameter_mm` (number): Left-atrial diameter used, mm
- `max_lvot_gradient_mm_hg` (number): Maximal LVOT gradient used, mm Hg
- `family_history_scd` (boolean): Caller-assigned family history of SCD used
- `nsvt` (boolean): Caller-assigned NSVT used
- `unexplained_syncope` (boolean): Caller-assigned unexplained syncope used
- `prognostic_index` (number): O'Mahony 2014 prognostic index, 6 decimals
- `five_year_scd_risk_percent` (number): 5-year SCD probability percent, 1 decimal (100 * (1 - 0.998^exp(PI)))
- `risk_band` (string): O'Mahony 2014 5-year operating points: lower (<4), intermediate (4 to <6), higher (>=6). Not an ICD indication or device order.
- `citation` (object): O'Mahony et al. Eur Heart J 2014 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "O'Mahony C, Jichi F, Pavlou M, et al.",
    "doi": "10.1093/eurheartj/eht439",
    "id": "omahony-2014",
    "pmid": "24126876",
    "source": "Eur Heart J. 2014;35(30):2010-2020",
    "title": "A novel clinical risk prediction model for sudden cardiac death in hypertrophic cardiomyopathy (HCM Risk-SCD)"
  },
  "formula": "hcm_risk_scd",
  "formula_expression": "P_5y = 1 - 0.998^exp(PI); PI = 0.15939858*max_wall_thickness_mm - 0.00294271*max_wall_thickness_mm^2 + 0.0259082*la_diameter_mm + 0.00446131*max_lvot_gradient_mm_hg + 0.4583082*family_history_scd + 0.82639195*nsvt + 0.71650361*unexplained_syncope - 0.01799934*age; flags 1 if true else 0; O'Mahony 2014; risk_band <4 lower, 4 to <6 intermediate, >=6 higher",
  "risk_band": "lower",
  "family_history_scd": false,
  "five_year_scd_risk_percent": 2.2,
  "la_diameter_mm": 40.0,
  "max_lvot_gradient_mm_hg": 20.0,
  "max_wall_thickness_mm": 20.0,
  "nsvt": false,
  "prognostic_index": 2.416468,
  "unexplained_syncope": false
}
```

## Errors

- HTTP 400 `invalid_hcm_age`: age must be an integer from 16 to 80 (O'Mahony 2014 HCM Risk-SCD). Returned before settlement; you are not charged.
- HTTP 400 `invalid_wall_thickness`: max_wall_thickness_mm must be a number from 10.0 to 35.0 (O'Mahony 2014). Returned before settlement; you are not charged.
- HTTP 400 `invalid_la_diameter`: la_diameter_mm must be a number from 20.0 to 70.0 (O'Mahony 2014). Returned before settlement; you are not charged.
- HTTP 400 `invalid_lvot_gradient`: max_lvot_gradient_mm_hg must be a number from 0.0 to 154.0 (O'Mahony 2014). 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

- [MAGGIC](https://magentlab.com/docs/maggic) — Sum the Pocock 2013 MAGGIC integer chart from thirteen caller-supplied heart-failure predictors and return the published Table 4 1-year and 3-year death probabilities for scores 0-50.
- [SAVE-score](https://magentlab.com/docs/save) — Sum Schmidt 2015 Table 4 SAVE-score cells including the published constant −6 and return class I–V with hospital survival percents.

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