# VTE-BLEED calculator

VTE-BLEED

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

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

## What it computes

Sum the Klok 2016 VTE-BLEED items for major bleeding on stable anticoagulation after VTE and return low (<2) or high (≥2).

## When to use

When an agent needs the published Klok 2016 VTE-BLEED point total and band and must not invent a treatment-duration or HAS-BLED decision.

## When not to use

- Not a medical device. magent does not diagnose VTE or bleeding and does not assay hemoglobin or eGFR.
- Not HAS-BLED. VTE-BLEED is the Klok 2016 six-item score after VTE on stable anticoagulation, not an atrial-fibrillation bleed score.
- Not a treatment-duration order, anticoagulation start/stop protocol, or bleed-treatment recommendation. Bands are low (<2) and high (≥2) only.
- Anemia, renal dysfunction, and uncontrolled hypertension (SBP ≥140) are caller-assigned booleans. magent does not take a hemoglobin, eGFR, creatinine, or blood-pressure number.

## Formula

```
VTE-BLEED = active_cancer 2 + (male AND uncontrolled_hypertension) 1 + anemia 1.5 + history_of_bleeding 1.5 + age_ge_60 1.5 + renal_dysfunction 1.5; Klok 2016; max 9; low <2, high >=2
```

## Citation

[Prediction of bleeding events in patients with venous thromboembolism on stable anticoagulation treatment](https://doi.org/10.1183/13993003.00280-2016)
Klok FA, Hösel V, Clemens A, Yollo WD, Tilke C, Schulman S, Lankeit M, Konstantinides SV
Eur Respir J. 2016;48(5):1369-1376
DOI: [10.1183/13993003.00280-2016](https://doi.org/10.1183/13993003.00280-2016)

## Worked example

### Age 70 male, no other items

Given: `active_cancer=false, age=70, anemia=false, history_of_bleeding=false, renal_dysfunction=false, sex=male, uncontrolled_hypertension=false`

1. Age ≥60 → 1.5; active_cancer, male hypertension, anemia, history_of_bleeding, and renal_dysfunction false → 0
2. Score = 1.5 (max 9); vte_bleed_band = low (<2)


### Active cancer alone

Given: `active_cancer=true, age=50, anemia=false, history_of_bleeding=false, renal_dysfunction=false, sex=male, uncontrolled_hypertension=false`

1. active_cancer → 2; age <60 and remaining flags false → 0
2. Score = 2 (max 9); vte_bleed_band = high (≥2)


## Also searched as

- VTE-BLEED
- VTE BLEED score
- Klok VTE-BLEED
- Klok 2016 bleed
- VTE anticoagulation bleeding
- XALIA bleeding score
- venous thromboembolism bleed

## Parameters

- `age` (integer, required): Age in years (18-120). Age ≥60 scores 1.5 (Klok 2016). magent does not assign age.
- `sex` (string, required): female or male. Uncontrolled hypertension scores 1 only when sex is male (Klok 2016 / XALIA SBP ≥140 item). Female never scores that item.
- `active_cancer` (boolean, required): Active cancer as assigned by the caller (Klok 2016). true scores 2. magent does not diagnose cancer.
- `uncontrolled_hypertension` (boolean, required): Uncontrolled hypertension (SBP ≥140 mmHg) as assigned by the caller (Klok 2016 / XALIA). true scores 1 only in males; females score 0 even when true. magent does not measure blood pressure.
- `anemia` (boolean, required): Anemia as assigned by the caller (Klok 2016: hemoglobin <130 g/L in men or <120 g/L in women). true scores 1.5. magent does not take a hemoglobin number.
- `history_of_bleeding` (boolean, required): History of bleeding as assigned by the caller (Klok 2016). true scores 1.5. magent does not grade bleeding.
- `renal_dysfunction` (boolean, required): Renal dysfunction (eGFR or CrCl <60) as assigned by the caller (Klok 2016). true scores 1.5. magent does not compute eGFR or creatinine clearance.

## 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/vte_bleed`
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": [
    {
      "active_cancer": "false",
      "age": "70",
      "anemia": "false",
      "history_of_bleeding": "false",
      "renal_dysfunction": "false",
      "sex": "male",
      "uncontrolled_hypertension": "false"
    },
    {
      "active_cancer": "false",
      "age": "70",
      "anemia": "false",
      "history_of_bleeding": "false",
      "renal_dysfunction": "false",
      "sex": "male",
      "uncontrolled_hypertension": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/vte_bleed",
  "items": [
    {
      "components": [
        {
          "factor": "active_cancer",
          "points": 0,
          "present": false
        },
        {
          "factor": "male_uncontrolled_hypertension",
          "points": 0,
          "present": false,
          "sex": "male",
          "uncontrolled_hypertension": false
        },
        {
          "factor": "anemia",
          "points": 0.0,
          "present": false
        },
        {
          "factor": "history_of_bleeding",
          "points": 0.0,
          "present": false
        },
        {
          "value": 70,
          "factor": "age_ge_60",
          "points": 1.5,
          "present": true
        },
        {
          "factor": "renal_dysfunction",
          "points": 0.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": "Klok FA, Hösel V, Clemens A, Yollo WD, Tilke C, Schulman S, Lankeit M, Konstantinides SV",
        "doi": "10.1183/13993003.00280-2016",
        "id": "klok-2016",
        "pmid": "27471209",
        "source": "Eur Respir J. 2016;48(5):1369-1376",
        "title": "Prediction of bleeding events in patients with venous thromboembolism on stable anticoagulation treatment"
      },
      "formula": "vte_bleed",
      "formula_expression": "VTE-BLEED = active_cancer 2 + (male AND uncontrolled_hypertension) 1 + anemia 1.5 + history_of_bleeding 1.5 + age_ge_60 1.5 + renal_dysfunction 1.5; Klok 2016; max 9; low <2, high >=2",
      "age_years": 70,
      "max_score": 9,
      "score": 1.5,
      "sex": "male",
      "vte_bleed_band": "low"
    },
    {
      "components": [
        {
          "factor": "active_cancer",
          "points": 0,
          "present": false
        },
        {
          "factor": "male_uncontrolled_hypertension",
          "points": 0,
          "present": false,
          "sex": "male",
          "uncontrolled_hypertension": false
        },
        {
          "factor": "anemia",
          "points": 0.0,
          "present": false
        },
        {
          "factor": "history_of_bleeding",
          "points": 0.0,
          "present": false
        },
        {
          "value": 70,
          "factor": "age_ge_60",
          "points": 1.5,
          "present": true
        },
        {
          "factor": "renal_dysfunction",
          "points": 0.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": "Klok FA, Hösel V, Clemens A, Yollo WD, Tilke C, Schulman S, Lankeit M, Konstantinides SV",
        "doi": "10.1183/13993003.00280-2016",
        "id": "klok-2016",
        "pmid": "27471209",
        "source": "Eur Respir J. 2016;48(5):1369-1376",
        "title": "Prediction of bleeding events in patients with venous thromboembolism on stable anticoagulation treatment"
      },
      "formula": "vte_bleed",
      "formula_expression": "VTE-BLEED = active_cancer 2 + (male AND uncontrolled_hypertension) 1 + anemia 1.5 + history_of_bleeding 1.5 + age_ge_60 1.5 + renal_dysfunction 1.5; Klok 2016; max 9; low <2, high >=2",
      "age_years": 70,
      "max_score": 9,
      "score": 1.5,
      "sex": "male",
      "vte_bleed_band": "low"
    }
  ]
}
```

## Response fields

- `formula` (string): vte_bleed
- `formula_expression` (string): Exact expression used
- `score` (number): VTE-BLEED points 0-9 (1.5 steps allowed; not integer-rounded)
- `max_score` (integer): Always 9
- `vte_bleed_band` (string): low when score is <2, high when score is ≥2 (Klok 2016). Not a treatment-duration order.
- `sex` (string): female or male used for the hypertension item
- `age_years` (integer): Age used for the ≥60 criterion
- `components` (array): Per-factor points
- `citation` (object): Klok 2016 Eur Respir J citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "active_cancer",
      "points": 0,
      "present": false
    },
    {
      "factor": "male_uncontrolled_hypertension",
      "points": 0,
      "present": false,
      "sex": "male",
      "uncontrolled_hypertension": false
    },
    {
      "factor": "anemia",
      "points": 0.0,
      "present": false
    },
    {
      "factor": "history_of_bleeding",
      "points": 0.0,
      "present": false
    },
    {
      "value": 70,
      "factor": "age_ge_60",
      "points": 1.5,
      "present": true
    },
    {
      "factor": "renal_dysfunction",
      "points": 0.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": "Klok FA, Hösel V, Clemens A, Yollo WD, Tilke C, Schulman S, Lankeit M, Konstantinides SV",
    "doi": "10.1183/13993003.00280-2016",
    "id": "klok-2016",
    "pmid": "27471209",
    "source": "Eur Respir J. 2016;48(5):1369-1376",
    "title": "Prediction of bleeding events in patients with venous thromboembolism on stable anticoagulation treatment"
  },
  "formula": "vte_bleed",
  "formula_expression": "VTE-BLEED = active_cancer 2 + (male AND uncontrolled_hypertension) 1 + anemia 1.5 + history_of_bleeding 1.5 + age_ge_60 1.5 + renal_dysfunction 1.5; Klok 2016; max 9; low <2, high >=2",
  "age_years": 70,
  "max_score": 9,
  "score": 1.5,
  "sex": "male",
  "vte_bleed_band": "low"
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_sex`: sex must be female or male 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

- [HAS-BLED](https://magentlab.com/docs/has-bled) — Compute the HAS-BLED bleeding-risk score from discrete clinical flags.
- [RIETE](https://magentlab.com/docs/riete) — Sum the Ruiz-Giménez 2008 RIETE adverse factors for 3-month major bleeding after documented acute VTE and return low (0), intermediate (1–4), or high (>4).

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