# HFA-ICOS HER2-targeted therapy baseline CV risk

HFA-ICOS HER2

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/hfa_icos_her2`
HTML: https://magentlab.com/docs/hfa-icos-her2
Markdown: https://magentlab.com/docs/hfa-icos-her2.md

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

## What it computes

Classify Lyon 2020 HFA-ICOS baseline cardiovascular risk before HER2-targeted therapy and return low, medium, high, or very high with the expert-opinion cardiotoxicity guide.

## When to use

When an agent already has age, LVEF, and the published HER2-table factors as assigned by the caller and needs the HFA-ICOS class. Not a treatment, hold, or monitoring order.

## When not to use

- Not a medical device.
- Not a treatment, hold, monitoring, or chemotherapy-order. The cardiotoxicity_guide strings are Lyon 2020 expert-opinion estimates of symptomatic CTRCD, not a patient-specific probability.
- magent does not measure LVEF, troponin, or natriuretic peptides and does not interpret the ECG. Age, LVEF, arrhythmia, biomarkers, and every yes/no factor are caller-assigned.
- Age bands are exclusive: ≥80 High; 65-79 Medium 2; younger than 65 none. LVEF <50 is High; 50-54 is Medium 2; ≥55 does not score.
- Concurrent anthracycline plus trastuzumab is High (Lyon 2020 footnote f). Sequential anthracycline before HER2-targeted therapy on the current regimen is Medium 1 and is not added when concurrent is true. Prior remote anthracycline for a previous malignancy is Medium 2 (footnote g).
- This tool is the HER2-targeted therapy proforma only. Not the anthracycline, VEGF-inhibitor, RAF-MEK, or BCR-ABL HFA-ICOS tables.

## Formula

```
HFA-ICOS HER2 (Lyon 2020): very_high if heart_failure_or_cardiomyopathy or prior_trastuzumab_cardiotoxicity; else high if mi_or_cabg or stable_angina or severe_valvular_heart_disease or lvef_percent<50 or age_years>=80 or concurrent_anthracycline_and_her2 or medium_points>=5; else medium if medium_points 2-4; else low; medium_points = Medium 2 (2) + Medium 1 (1); Medium 2 = lvef 50-54, arrhythmia, elevated_troponin, elevated_bnp, age 65-79, prior_remote_anthracycline, prior_left_chest_or_mediastinal_rt; Medium 1 = hypertension, diabetes, ckd, anthracycline_before_her2 (if not concurrent), current_or_significant_smoker, obesity; cardiotoxicity_guide low <2%, medium 2-9%, high 10-19%, very_high >=20%
```

## Citation

[Baseline cardiovascular risk assessment in cancer patients scheduled to receive cardiotoxic cancer therapies: a position statement and new risk assessment tools from the Cardio-Oncology Study Group of the Heart Failure Association of the European Society of Cardiology in collaboration with the International Cardio-Oncology Society](https://doi.org/10.1002/ejhf.1920)
Lyon AR, Dent S, Stanway S, et al.
Eur J Heart Fail. 2020;22(11):1945-1960
DOI: [10.1002/ejhf.1920](https://doi.org/10.1002/ejhf.1920)

## Worked example

### Age 50, LVEF 60, no factors

Given: `age_years=50, anthracycline_before_her2=false, arrhythmia=false, ckd=false, concurrent_anthracycline_and_her2=false, current_or_significant_smoker=false, diabetes=false, elevated_bnp=false, elevated_troponin=false, heart_failure_or_cardiomyopathy=false, hypertension=false, lvef_percent=60, mi_or_cabg=false, obesity=false, prior_left_chest_or_mediastinal_rt=false, prior_remote_anthracycline=false, prior_trastuzumab_cardiotoxicity=false, severe_valvular_heart_disease=false, stable_angina=false`

1. No Very high or High factors; medium_points = 0
2. risk_level = low; cardiotoxicity_guide = <2%


### Prior trastuzumab cardiotoxicity

Given: `age_years=50, anthracycline_before_her2=false, arrhythmia=false, ckd=false, concurrent_anthracycline_and_her2=false, current_or_significant_smoker=false, diabetes=false, elevated_bnp=false, elevated_troponin=false, heart_failure_or_cardiomyopathy=false, hypertension=false, lvef_percent=60, mi_or_cabg=false, obesity=false, prior_left_chest_or_mediastinal_rt=false, prior_remote_anthracycline=false, prior_trastuzumab_cardiotoxicity=true, severe_valvular_heart_disease=false, stable_angina=false`

1. prior_trastuzumab_cardiotoxicity is a Very high factor
2. risk_level = very_high; cardiotoxicity_guide = >=20%


### Concurrent anthracycline and trastuzumab

Given: `age_years=50, anthracycline_before_her2=false, arrhythmia=false, ckd=false, concurrent_anthracycline_and_her2=true, current_or_significant_smoker=false, diabetes=false, elevated_bnp=false, elevated_troponin=false, heart_failure_or_cardiomyopathy=false, hypertension=false, lvef_percent=60, mi_or_cabg=false, obesity=false, prior_left_chest_or_mediastinal_rt=false, prior_remote_anthracycline=false, prior_trastuzumab_cardiotoxicity=false, severe_valvular_heart_disease=false, stable_angina=false`

1. concurrent_anthracycline_and_her2 is High (footnote f)
2. risk_level = high; cardiotoxicity_guide = 10-19%


### Age 70 only

Given: `age_years=70, anthracycline_before_her2=false, arrhythmia=false, ckd=false, concurrent_anthracycline_and_her2=false, current_or_significant_smoker=false, diabetes=false, elevated_bnp=false, elevated_troponin=false, heart_failure_or_cardiomyopathy=false, hypertension=false, lvef_percent=60, mi_or_cabg=false, obesity=false, prior_left_chest_or_mediastinal_rt=false, prior_remote_anthracycline=false, prior_trastuzumab_cardiotoxicity=false, severe_valvular_heart_disease=false, stable_angina=false`

1. Age 70 is Medium 2 → medium_points = 2
2. risk_level = medium; cardiotoxicity_guide = 2-9%


## Also searched as

- HFA-ICOS HER2
- HER2 baseline CV risk
- trastuzumab cardiotoxicity risk
- HFA ICOS HER2-targeted
- cardio-oncology HER2
- Lyon 2020 HER2

## Parameters

- `age_years` (integer, required): Age in years (integer 18-100). Lyon 2020 exclusive bands: ≥80 is High; 65-79 is Medium 2 (2 points); younger than 65 does not score. Age 80 is High, not Medium 2.
- `lvef_percent` (integer, required): Left-ventricular ejection fraction percent (integer 10-80) as assigned by the caller. <50 is High; 50-54 is Medium 2 (2 points); ≥55 does not score. magent does not measure LVEF.
- `heart_failure_or_cardiomyopathy` (boolean, required): Heart failure or cardiomyopathy as assigned by the caller (Lyon 2020 HER2 table Very high). true or false.
- `prior_trastuzumab_cardiotoxicity` (boolean, required): Prior trastuzumab cardiotoxicity as assigned by the caller (Lyon 2020 HER2 table Very high). true or false. magent does not review prior exposure.
- `mi_or_cabg` (boolean, required): Prior myocardial infarction or CABG as assigned by the caller (Lyon 2020 HER2 table High). true or false.
- `stable_angina` (boolean, required): Stable angina as assigned by the caller (Lyon 2020 HER2 table High). true or false.
- `severe_valvular_heart_disease` (boolean, required): Severe valvular heart disease as assigned by the caller (Lyon 2020 HER2 table High). true or false.
- `concurrent_anthracycline_and_her2` (boolean, required): Anthracycline and trastuzumab delivered concurrently on the current protocol (Lyon 2020 HER2 table footnote f; High). true or false. When true, anthracycline_before_her2 does not add Medium 1 points.
- `arrhythmia` (boolean, required): Atrial fibrillation, atrial flutter, VT, or VF as assigned by the caller (Lyon 2020 HER2 table Medium 2). true or false. magent does not interpret the ECG.
- `elevated_troponin` (boolean, required): Elevated troponin as assigned by the caller (Lyon 2020 HER2 table Medium 2). true or false. magent does not assay troponin.
- `elevated_bnp` (boolean, required): Elevated BNP or NT-proBNP as assigned by the caller (Lyon 2020 HER2 table Medium 2). true or false. magent does not assay natriuretic peptides.
- `prior_remote_anthracycline` (boolean, required): Prior remote anthracycline for a previous malignancy, not the current protocol (Lyon 2020 HER2 table footnote g; Medium 2). true or false.
- `prior_left_chest_or_mediastinal_rt` (boolean, required): Prior left-chest or mediastinal radiotherapy as assigned by the caller (Lyon 2020 HER2 table Medium 2). true or false.
- `hypertension` (boolean, required): Hypertension as assigned by the caller (Lyon 2020 HER2 table Medium 1). true or false.
- `diabetes` (boolean, required): Diabetes mellitus as assigned by the caller (Lyon 2020 HER2 table Medium 1). true or false.
- `ckd` (boolean, required): Chronic kidney disease as assigned by the caller (Lyon 2020 HER2 table Medium 1). true or false.
- `anthracycline_before_her2` (boolean, required): Current regimen includes anthracycline before HER2-targeted therapy, sequential not concurrent (Lyon 2020 HER2 table Medium 1). true or false. Ignored for points when concurrent_anthracycline_and_her2 is true.
- `current_or_significant_smoker` (boolean, required): Current or significant smoking history as assigned by the caller (Lyon 2020 HER2 table Medium 1). true or false.
- `obesity` (boolean, required): Obesity as assigned by the caller (Lyon 2020 HER2 table Medium 1). true or false. magent does not compute BMI.

## 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/hfa_icos_her2`
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_years": "50",
      "anthracycline_before_her2": "false",
      "arrhythmia": "false",
      "ckd": "false",
      "concurrent_anthracycline_and_her2": "false",
      "current_or_significant_smoker": "false",
      "diabetes": "false",
      "elevated_bnp": "false",
      "elevated_troponin": "false",
      "heart_failure_or_cardiomyopathy": "false",
      "hypertension": "false",
      "lvef_percent": "60",
      "mi_or_cabg": "false",
      "obesity": "false",
      "prior_left_chest_or_mediastinal_rt": "false",
      "prior_remote_anthracycline": "false",
      "prior_trastuzumab_cardiotoxicity": "false",
      "severe_valvular_heart_disease": "false",
      "stable_angina": "false"
    },
    {
      "age_years": "50",
      "anthracycline_before_her2": "false",
      "arrhythmia": "false",
      "ckd": "false",
      "concurrent_anthracycline_and_her2": "false",
      "current_or_significant_smoker": "false",
      "diabetes": "false",
      "elevated_bnp": "false",
      "elevated_troponin": "false",
      "heart_failure_or_cardiomyopathy": "false",
      "hypertension": "false",
      "lvef_percent": "60",
      "mi_or_cabg": "false",
      "obesity": "false",
      "prior_left_chest_or_mediastinal_rt": "false",
      "prior_remote_anthracycline": "false",
      "prior_trastuzumab_cardiotoxicity": "false",
      "severe_valvular_heart_disease": "false",
      "stable_angina": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/hfa_icos_her2",
  "items": [
    {
      "components": [
        {
          "factor": "heart_failure_or_cardiomyopathy",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_trastuzumab_cardiotoxicity",
          "points": 0,
          "present": false
        },
        {
          "factor": "mi_or_cabg",
          "points": 0,
          "present": false
        },
        {
          "factor": "stable_angina",
          "points": 0,
          "present": false
        },
        {
          "factor": "severe_valvular_heart_disease",
          "points": 0,
          "present": false
        },
        {
          "value": 60,
          "factor": "lvef_lt_50",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age_ge_80",
          "points": 0,
          "present": false
        },
        {
          "factor": "concurrent_anthracycline_and_her2",
          "points": 0,
          "present": false
        },
        {
          "value": 60,
          "factor": "lvef_50_54",
          "points": 0,
          "present": false
        },
        {
          "factor": "arrhythmia",
          "points": 0,
          "present": false
        },
        {
          "factor": "elevated_troponin",
          "points": 0,
          "present": false
        },
        {
          "factor": "elevated_bnp",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age_65_79",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_remote_anthracycline",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_left_chest_or_mediastinal_rt",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypertension",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "ckd",
          "points": 0,
          "present": false
        },
        {
          "factor": "anthracycline_before_her2",
          "points": 0,
          "present": false
        },
        {
          "factor": "current_or_significant_smoker",
          "points": 0,
          "present": false
        },
        {
          "factor": "obesity",
          "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": "Lyon AR, Dent S, Stanway S, et al.",
        "doi": "10.1002/ejhf.1920",
        "id": "lyon-2020",
        "pmid": "32458582",
        "source": "Eur J Heart Fail. 2020;22(11):1945-1960",
        "title": "Baseline cardiovascular risk assessment in cancer patients scheduled to receive cardiotoxic cancer therapies: a position statement and new risk assessment tools from the Cardio-Oncology Study Group of the Heart Failure Association of the European Society of Cardiology in collaboration with the International Cardio-Oncology Society"
      },
      "formula": "hfa_icos_her2",
      "formula_expression": "HFA-ICOS HER2 (Lyon 2020): very_high if heart_failure_or_cardiomyopathy or prior_trastuzumab_cardiotoxicity; else high if mi_or_cabg or stable_angina or severe_valvular_heart_disease or lvef_percent<50 or age_years>=80 or concurrent_anthracycline_and_her2 or medium_points>=5; else medium if medium_points 2-4; else low; medium_points = Medium 2 (2) + Medium 1 (1); Medium 2 = lvef 50-54, arrhythmia, elevated_troponin, elevated_bnp, age 65-79, prior_remote_anthracycline, prior_left_chest_or_mediastinal_rt; Medium 1 = hypertension, diabetes, ckd, anthracycline_before_her2 (if not concurrent), current_or_significant_smoker, obesity; cardiotoxicity_guide low <2%, medium 2-9%, high 10-19%, very_high >=20%",
      "age_years": 50,
      "max_score": 20,
      "score": 0,
      "cardiotoxicity_guide": "<2%",
      "lvef_percent": 60,
      "medium_points": 0,
      "risk_level": "low",
      "anthracycline_before_her2": false,
      "concurrent_anthracycline_and_her2": false,
      "high_present": false,
      "very_high_present": false
    },
    {
      "components": [
        {
          "factor": "heart_failure_or_cardiomyopathy",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_trastuzumab_cardiotoxicity",
          "points": 0,
          "present": false
        },
        {
          "factor": "mi_or_cabg",
          "points": 0,
          "present": false
        },
        {
          "factor": "stable_angina",
          "points": 0,
          "present": false
        },
        {
          "factor": "severe_valvular_heart_disease",
          "points": 0,
          "present": false
        },
        {
          "value": 60,
          "factor": "lvef_lt_50",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age_ge_80",
          "points": 0,
          "present": false
        },
        {
          "factor": "concurrent_anthracycline_and_her2",
          "points": 0,
          "present": false
        },
        {
          "value": 60,
          "factor": "lvef_50_54",
          "points": 0,
          "present": false
        },
        {
          "factor": "arrhythmia",
          "points": 0,
          "present": false
        },
        {
          "factor": "elevated_troponin",
          "points": 0,
          "present": false
        },
        {
          "factor": "elevated_bnp",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age_65_79",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_remote_anthracycline",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_left_chest_or_mediastinal_rt",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypertension",
          "points": 0,
          "present": false
        },
        {
          "factor": "diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "ckd",
          "points": 0,
          "present": false
        },
        {
          "factor": "anthracycline_before_her2",
          "points": 0,
          "present": false
        },
        {
          "factor": "current_or_significant_smoker",
          "points": 0,
          "present": false
        },
        {
          "factor": "obesity",
          "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": "Lyon AR, Dent S, Stanway S, et al.",
        "doi": "10.1002/ejhf.1920",
        "id": "lyon-2020",
        "pmid": "32458582",
        "source": "Eur J Heart Fail. 2020;22(11):1945-1960",
        "title": "Baseline cardiovascular risk assessment in cancer patients scheduled to receive cardiotoxic cancer therapies: a position statement and new risk assessment tools from the Cardio-Oncology Study Group of the Heart Failure Association of the European Society of Cardiology in collaboration with the International Cardio-Oncology Society"
      },
      "formula": "hfa_icos_her2",
      "formula_expression": "HFA-ICOS HER2 (Lyon 2020): very_high if heart_failure_or_cardiomyopathy or prior_trastuzumab_cardiotoxicity; else high if mi_or_cabg or stable_angina or severe_valvular_heart_disease or lvef_percent<50 or age_years>=80 or concurrent_anthracycline_and_her2 or medium_points>=5; else medium if medium_points 2-4; else low; medium_points = Medium 2 (2) + Medium 1 (1); Medium 2 = lvef 50-54, arrhythmia, elevated_troponin, elevated_bnp, age 65-79, prior_remote_anthracycline, prior_left_chest_or_mediastinal_rt; Medium 1 = hypertension, diabetes, ckd, anthracycline_before_her2 (if not concurrent), current_or_significant_smoker, obesity; cardiotoxicity_guide low <2%, medium 2-9%, high 10-19%, very_high >=20%",
      "age_years": 50,
      "max_score": 20,
      "score": 0,
      "cardiotoxicity_guide": "<2%",
      "lvef_percent": 60,
      "medium_points": 0,
      "risk_level": "low",
      "anthracycline_before_her2": false,
      "concurrent_anthracycline_and_her2": false,
      "high_present": false,
      "very_high_present": false
    }
  ]
}
```

## Response fields

- `formula` (string): hfa_icos_her2
- `formula_expression` (string): Lyon 2020 HFA-ICOS HER2 classification expression
- `score` (integer): Same as medium_points (Medium 1 + Medium 2 only)
- `max_score` (integer): 20 (seven Medium 2 factors at 2 plus six Medium 1 factors at 1)
- `medium_points` (integer): Medium 1 (1 each) plus Medium 2 (2 each); High and Very high add 0
- `risk_level` (string): low, medium, high, or very_high from the Lyon 2020 HER2 table. A class, not a treatment order.
- `cardiotoxicity_guide` (string): Lyon 2020 expert-opinion symptomatic CTRCD guide: <2%, 2-9%, 10-19%, or >=20%. Not a patient-specific probability.
- `very_high_present` (boolean): True when any Very high table factor is present
- `high_present` (boolean): True when any High table factor is present (not medium_points >=5 alone)
- `age_years` (integer): Age used for the exclusive age bands
- `lvef_percent` (integer): LVEF percent used for the <50 / 50-54 / ≥55 bands
- `concurrent_anthracycline_and_her2` (boolean): Echo of the concurrent anthracycline-plus-trastuzumab flag
- `anthracycline_before_her2` (boolean): Echo of the sequential anthracycline-before-HER2 flag (points only when concurrent is false)
- `components` (array): Per-factor Medium points and present flags
- `citation` (object): Lyon et al. Eur J Heart Fail 2020 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "heart_failure_or_cardiomyopathy",
      "points": 0,
      "present": false
    },
    {
      "factor": "prior_trastuzumab_cardiotoxicity",
      "points": 0,
      "present": false
    },
    {
      "factor": "mi_or_cabg",
      "points": 0,
      "present": false
    },
    {
      "factor": "stable_angina",
      "points": 0,
      "present": false
    },
    {
      "factor": "severe_valvular_heart_disease",
      "points": 0,
      "present": false
    },
    {
      "value": 60,
      "factor": "lvef_lt_50",
      "points": 0,
      "present": false
    },
    {
      "value": 50,
      "factor": "age_ge_80",
      "points": 0,
      "present": false
    },
    {
      "factor": "concurrent_anthracycline_and_her2",
      "points": 0,
      "present": false
    },
    {
      "value": 60,
      "factor": "lvef_50_54",
      "points": 0,
      "present": false
    },
    {
      "factor": "arrhythmia",
      "points": 0,
      "present": false
    },
    {
      "factor": "elevated_troponin",
      "points": 0,
      "present": false
    },
    {
      "factor": "elevated_bnp",
      "points": 0,
      "present": false
    },
    {
      "value": 50,
      "factor": "age_65_79",
      "points": 0,
      "present": false
    },
    {
      "factor": "prior_remote_anthracycline",
      "points": 0,
      "present": false
    },
    {
      "factor": "prior_left_chest_or_mediastinal_rt",
      "points": 0,
      "present": false
    },
    {
      "factor": "hypertension",
      "points": 0,
      "present": false
    },
    {
      "factor": "diabetes",
      "points": 0,
      "present": false
    },
    {
      "factor": "ckd",
      "points": 0,
      "present": false
    },
    {
      "factor": "anthracycline_before_her2",
      "points": 0,
      "present": false
    },
    {
      "factor": "current_or_significant_smoker",
      "points": 0,
      "present": false
    },
    {
      "factor": "obesity",
      "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": "Lyon AR, Dent S, Stanway S, et al.",
    "doi": "10.1002/ejhf.1920",
    "id": "lyon-2020",
    "pmid": "32458582",
    "source": "Eur J Heart Fail. 2020;22(11):1945-1960",
    "title": "Baseline cardiovascular risk assessment in cancer patients scheduled to receive cardiotoxic cancer therapies: a position statement and new risk assessment tools from the Cardio-Oncology Study Group of the Heart Failure Association of the European Society of Cardiology in collaboration with the International Cardio-Oncology Society"
  },
  "formula": "hfa_icos_her2",
  "formula_expression": "HFA-ICOS HER2 (Lyon 2020): very_high if heart_failure_or_cardiomyopathy or prior_trastuzumab_cardiotoxicity; else high if mi_or_cabg or stable_angina or severe_valvular_heart_disease or lvef_percent<50 or age_years>=80 or concurrent_anthracycline_and_her2 or medium_points>=5; else medium if medium_points 2-4; else low; medium_points = Medium 2 (2) + Medium 1 (1); Medium 2 = lvef 50-54, arrhythmia, elevated_troponin, elevated_bnp, age 65-79, prior_remote_anthracycline, prior_left_chest_or_mediastinal_rt; Medium 1 = hypertension, diabetes, ckd, anthracycline_before_her2 (if not concurrent), current_or_significant_smoker, obesity; cardiotoxicity_guide low <2%, medium 2-9%, high 10-19%, very_high >=20%",
  "age_years": 50,
  "max_score": 20,
  "score": 0,
  "cardiotoxicity_guide": "<2%",
  "lvef_percent": 60,
  "medium_points": 0,
  "risk_level": "low",
  "anthracycline_before_her2": false,
  "concurrent_anthracycline_and_her2": false,
  "high_present": false,
  "very_high_present": false
}
```

## Errors

- HTTP 400 `invalid_hfa_icos_her2`: Lyon 2020 HFA-ICOS HER2-targeted therapy inputs must match that table's age, LVEF, anthracycline timing, and yes/no factors. 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

- [HFA-ICOS anthracycline baseline CV risk](https://magentlab.com/docs/hfa-icos-anthracycline) — Apply the Lyon 2020 HFA-ICOS anthracycline baseline cardiovascular risk proforma from caller-assigned age, LVEF, and published Very high, High, Medium 2, and Medium 1 factors. Returns risk_level, medium_points, and the paper's expert-opinion cardiotoxicity_guide.
- [NYHA](https://magentlab.com/docs/nyha) — Return the 1994 NYHA functional capacity class 1-4 from a caller-assigned integer, with the published class description.
- [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.
- [HCM Risk-SCD](https://magentlab.com/docs/hcm-risk-scd) — 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.

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