# TRiP(cast) VTE score

TRiP(cast)

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

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

## What it computes

Sum Nemeth 2020 Table 1 TRiP(cast) points from caller-assigned trauma and immobilization categories, age, sex, BMI, and nine clinical flags, and return high vs low risk at cutoff 7.

## When to use

When an agent needs the published TRiP(cast) point total after lower-limb trauma immobilization (Nemeth 2020) and must not invent a thromboprophylaxis order or classify the trauma radiograph.

## When not to use

- Not a medical device and not a diagnosis of VTE.
- Not a thromboprophylaxis order. This tool does not recommend a drug or start anticoagulation.
- magent does not classify the trauma radiograph; the caller assigns Nemeth 2020 Table 1 trauma and immobilization categories.
- High vs low uses cutoff 7 as in POT-CAST (Nemeth 2020). Not Caprini, Padua, or IMPROVE VTE.
- BMI is caller-supplied kg/m^2; magent does not compute BMI from height and weight.

## Formula

```
TRiP(cast) = trauma (high 3, intermediate 2, low 1) + immobilization (upper_leg 3, lower_leg 2, foot_cast 1, other_plantar 0) + age (<35: 0, 35-54: 1, 55-74: 2, >=75: 3) + male (1) + BMI (>=35: 2, >=25 and <35: 1, <25: 0) + family_history_vte (2) + personal_history_vte_or_major_thrombophilia (4) + hormonal_estrogenic_treatment (4) + cancer_within_5y (3) + pregnancy_or_puerperium (3) + other_immobilization_3mo (2) + surgery_within_3mo (2) + comorbidity (1) + chronic_venous_insufficiency (1); Nemeth 2020 Table 1; max 34; high_risk iff score >= 7
```

## Citation

[Clinical risk assessment model to predict venous thromboembolism risk after immobilization for lower-limb trauma](https://doi.org/10.1016/j.eclinm.2020.100270)
Nemeth B, Douillet D, le Cessie S, Penaloza A, Moumneh T, Roy PM, Cannegieter S
EClinicalMedicine. 2020;20:100270
DOI: [10.1016/j.eclinm.2020.100270](https://doi.org/10.1016/j.eclinm.2020.100270)

## Worked example

### Paper example: age 50 male BMI 30, intermediate trauma, lower-leg cast

Given: `age=50, bmi_kg_m2=30, cancer_within_5y=false, chronic_venous_insufficiency=false, comorbidity=false, family_history_vte=false, hormonal_estrogenic_treatment=false, immobilization=lower_leg, other_immobilization_3mo=false, personal_history_vte_or_major_thrombophilia=false, pregnancy_or_puerperium=false, sex=male, surgery_within_3mo=false, trauma=intermediate`

1. Age 50 is ≥35 and <55 → 1; male → 1; BMI 30 is ≥25 and <35 → 1
2. Intermediate trauma → 2; lower-leg cast → 2; all flags false → 0
3. Score = 7 (max 34); high_risk true (cutoff 7)


### Same inputs except female is score 6 low_risk

Given: `age=50, bmi_kg_m2=30, cancer_within_5y=false, chronic_venous_insufficiency=false, comorbidity=false, family_history_vte=false, hormonal_estrogenic_treatment=false, immobilization=lower_leg, other_immobilization_3mo=false, personal_history_vte_or_major_thrombophilia=false, pregnancy_or_puerperium=false, sex=female, surgery_within_3mo=false, trauma=intermediate`

1. Age 50 → 1; female → 0; BMI 30 → 1; intermediate → 2; lower-leg → 2
2. Score = 6 (max 34); high_risk false; risk_band low_risk


## Also searched as

- TRiP(cast)
- TRiP cast score
- Nemeth 2020 VTE
- thrombosis risk prediction cast
- lower-limb trauma VTE
- cast immobilization VTE
- TRiP(cast) score

## Parameters

- `trauma` (string, required): Mutually exclusive Nemeth 2020 Table 1 trauma category as assigned by the caller (choose the most severe). high scores 3 (paper examples: fibula/tibia shaft, tibial plateau, Achilles rupture). intermediate scores 2 (bi/tri-malleolar ankle, patellar fracture, ankle dislocation/Lisfranc, severe knee sprain with edema/haemarthrosis, grade 3 ankle sprain). low scores 1 (single malleolar, patellar dislocation, (meta)tarsal/forefoot fracture, grade 1-2 sprain, significant muscle injury). magent does not classify the trauma radiograph.
- `immobilization` (string, required): Mutually exclusive Nemeth 2020 Table 1 immobilization category as assigned by the caller. upper_leg scores 3. lower_leg scores 2. foot_cast scores 1 (foot cast ankle-free or any semi-rigid without plantar support). other_plantar scores 0 (other cast or bracing with plantar support).
- `age` (integer, required): Age in years (integer 1-120). Nemeth 2020: <35 scores 0; ≥35 and <55 scores 1; ≥55 and <75 scores 2; ≥75 scores 3. Age 35 scores 1; 55 scores 2; 75 scores 3.
- `sex` (string, required): female or male. Male scores 1; female scores 0 (Nemeth 2020 Table 1).
- `bmi_kg_m2` (number, required): Body-mass index in kg/m^2 (10-80). Caller-supplied; magent does not compute BMI from height and weight. Nemeth 2020: <25 scores 0; ≥25 and <35 scores 1; ≥35 scores 2. 25.0 scores 1; 35.0 scores 2.
- `family_history_vte` (boolean, required): First-degree family history of VTE as assigned by the caller (Nemeth 2020 Table 1). true scores 2. magent does not take a family history.
- `personal_history_vte_or_major_thrombophilia` (boolean, required): Personal history of VTE or major thrombophilia as assigned by the caller (Nemeth 2020 Table 1). true scores 4. magent does not diagnose VTE or interpret a thrombophilia panel.
- `hormonal_estrogenic_treatment` (boolean, required): Current oral contraceptives or estrogenic hormone therapy as assigned by the caller (Nemeth 2020 Table 1). true scores 4.
- `cancer_within_5y` (boolean, required): Cancer within 5 years as assigned by the caller (Nemeth 2020 Table 1). true scores 3. magent does not diagnose cancer.
- `pregnancy_or_puerperium` (boolean, required): Pregnancy or puerperium as assigned by the caller (Nemeth 2020 Table 1). true scores 3. magent does not confirm pregnancy.
- `other_immobilization_3mo` (boolean, required): Hospital admission, bedridden, flight >6 h, or lower-limb paralysis other than the cast, within 3 months, as assigned by the caller (Nemeth 2020 Table 1). true scores 2. Independent of the exclusive immobilization category.
- `surgery_within_3mo` (boolean, required): Surgery within 3 months as assigned by the caller (Nemeth 2020 Table 1). true scores 2. magent does not classify an operation.
- `comorbidity` (boolean, required): Heart failure, rheumatoid arthritis, CKD, COPD, or IBD as one caller-assigned flag (Nemeth 2020 Table 1). true scores 1. magent does not examine the patient.
- `chronic_venous_insufficiency` (boolean, required): Chronic venous insufficiency (varicose veins) as assigned by the caller (Nemeth 2020 Table 1). true scores 1. magent does not examine the patient.

## 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/trip_cast`
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": "50",
      "bmi_kg_m2": "30",
      "cancer_within_5y": "false",
      "chronic_venous_insufficiency": "false",
      "comorbidity": "false",
      "family_history_vte": "false",
      "hormonal_estrogenic_treatment": "false",
      "immobilization": "lower_leg",
      "other_immobilization_3mo": "false",
      "personal_history_vte_or_major_thrombophilia": "false",
      "pregnancy_or_puerperium": "false",
      "sex": "male",
      "surgery_within_3mo": "false",
      "trauma": "intermediate"
    },
    {
      "age": "50",
      "bmi_kg_m2": "30",
      "cancer_within_5y": "false",
      "chronic_venous_insufficiency": "false",
      "comorbidity": "false",
      "family_history_vte": "false",
      "hormonal_estrogenic_treatment": "false",
      "immobilization": "lower_leg",
      "other_immobilization_3mo": "false",
      "personal_history_vte_or_major_thrombophilia": "false",
      "pregnancy_or_puerperium": "false",
      "sex": "male",
      "surgery_within_3mo": "false",
      "trauma": "intermediate"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/trip_cast",
  "items": [
    {
      "components": [
        {
          "value": "intermediate",
          "factor": "trauma",
          "points": 2,
          "present": true
        },
        {
          "value": "lower_leg",
          "factor": "immobilization",
          "points": 2,
          "present": true
        },
        {
          "value": 50,
          "factor": "age",
          "points": 1,
          "present": true
        },
        {
          "value": "male",
          "factor": "male",
          "points": 1,
          "present": true
        },
        {
          "value": 30.0,
          "factor": "bmi",
          "points": 1,
          "present": true
        },
        {
          "factor": "family_history_vte",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_history_vte_or_major_thrombophilia",
          "points": 0,
          "present": false
        },
        {
          "factor": "hormonal_estrogenic_treatment",
          "points": 0,
          "present": false
        },
        {
          "factor": "cancer_within_5y",
          "points": 0,
          "present": false
        },
        {
          "factor": "pregnancy_or_puerperium",
          "points": 0,
          "present": false
        },
        {
          "factor": "other_immobilization_3mo",
          "points": 0,
          "present": false
        },
        {
          "factor": "surgery_within_3mo",
          "points": 0,
          "present": false
        },
        {
          "factor": "comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_venous_insufficiency",
          "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": "Nemeth B, Douillet D, le Cessie S, Penaloza A, Moumneh T, Roy PM, Cannegieter S",
        "doi": "10.1016/j.eclinm.2020.100270",
        "id": "nemeth-2020",
        "pmid": "32300734",
        "source": "EClinicalMedicine. 2020;20:100270",
        "title": "Clinical risk assessment model to predict venous thromboembolism risk after immobilization for lower-limb trauma"
      },
      "formula": "trip_cast",
      "formula_expression": "TRiP(cast) = trauma (high 3, intermediate 2, low 1) + immobilization (upper_leg 3, lower_leg 2, foot_cast 1, other_plantar 0) + age (<35: 0, 35-54: 1, 55-74: 2, >=75: 3) + male (1) + BMI (>=35: 2, >=25 and <35: 1, <25: 0) + family_history_vte (2) + personal_history_vte_or_major_thrombophilia (4) + hormonal_estrogenic_treatment (4) + cancer_within_5y (3) + pregnancy_or_puerperium (3) + other_immobilization_3mo (2) + surgery_within_3mo (2) + comorbidity (1) + chronic_venous_insufficiency (1); Nemeth 2020 Table 1; max 34; high_risk iff score >= 7",
      "age_years": 50,
      "max_score": 34,
      "score": 7,
      "risk_band": "high_risk",
      "sex": "male",
      "high_risk": true,
      "bmi_kg_m2": 30.0,
      "immobilization": "lower_leg",
      "trauma": "intermediate"
    },
    {
      "components": [
        {
          "value": "intermediate",
          "factor": "trauma",
          "points": 2,
          "present": true
        },
        {
          "value": "lower_leg",
          "factor": "immobilization",
          "points": 2,
          "present": true
        },
        {
          "value": 50,
          "factor": "age",
          "points": 1,
          "present": true
        },
        {
          "value": "male",
          "factor": "male",
          "points": 1,
          "present": true
        },
        {
          "value": 30.0,
          "factor": "bmi",
          "points": 1,
          "present": true
        },
        {
          "factor": "family_history_vte",
          "points": 0,
          "present": false
        },
        {
          "factor": "personal_history_vte_or_major_thrombophilia",
          "points": 0,
          "present": false
        },
        {
          "factor": "hormonal_estrogenic_treatment",
          "points": 0,
          "present": false
        },
        {
          "factor": "cancer_within_5y",
          "points": 0,
          "present": false
        },
        {
          "factor": "pregnancy_or_puerperium",
          "points": 0,
          "present": false
        },
        {
          "factor": "other_immobilization_3mo",
          "points": 0,
          "present": false
        },
        {
          "factor": "surgery_within_3mo",
          "points": 0,
          "present": false
        },
        {
          "factor": "comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_venous_insufficiency",
          "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": "Nemeth B, Douillet D, le Cessie S, Penaloza A, Moumneh T, Roy PM, Cannegieter S",
        "doi": "10.1016/j.eclinm.2020.100270",
        "id": "nemeth-2020",
        "pmid": "32300734",
        "source": "EClinicalMedicine. 2020;20:100270",
        "title": "Clinical risk assessment model to predict venous thromboembolism risk after immobilization for lower-limb trauma"
      },
      "formula": "trip_cast",
      "formula_expression": "TRiP(cast) = trauma (high 3, intermediate 2, low 1) + immobilization (upper_leg 3, lower_leg 2, foot_cast 1, other_plantar 0) + age (<35: 0, 35-54: 1, 55-74: 2, >=75: 3) + male (1) + BMI (>=35: 2, >=25 and <35: 1, <25: 0) + family_history_vte (2) + personal_history_vte_or_major_thrombophilia (4) + hormonal_estrogenic_treatment (4) + cancer_within_5y (3) + pregnancy_or_puerperium (3) + other_immobilization_3mo (2) + surgery_within_3mo (2) + comorbidity (1) + chronic_venous_insufficiency (1); Nemeth 2020 Table 1; max 34; high_risk iff score >= 7",
      "age_years": 50,
      "max_score": 34,
      "score": 7,
      "risk_band": "high_risk",
      "sex": "male",
      "high_risk": true,
      "bmi_kg_m2": 30.0,
      "immobilization": "lower_leg",
      "trauma": "intermediate"
    }
  ]
}
```

## Response fields

- `formula` (string): trip_cast
- `formula_expression` (string): Exact expression used
- `score` (integer): TRiP(cast) points 0-34
- `max_score` (integer): 34 (Nemeth 2020 Table 1 maximum)
- `high_risk` (boolean): true iff score ≥7 (Nemeth 2020 / POT-CAST cutoff). Not a VTE diagnosis and not a thromboprophylaxis order.
- `risk_band` (string): high_risk when score ≥7; low_risk when score <7 (Nemeth 2020 cutoff 7). A band, not a diagnosis or order.
- `age_years` (integer): Age used for the exclusive age band
- `sex` (string): female or male used for the sex points
- `bmi_kg_m2` (number): BMI in kg/m^2 used for the exclusive BMI band
- `trauma` (string): Exclusive trauma category used (high, intermediate, or low)
- `immobilization` (string): Exclusive immobilization category used (upper_leg, lower_leg, foot_cast, or other_plantar)
- `components` (array): Per-factor points
- `citation` (object): Nemeth 2020 eClinicalMedicine citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": "intermediate",
      "factor": "trauma",
      "points": 2,
      "present": true
    },
    {
      "value": "lower_leg",
      "factor": "immobilization",
      "points": 2,
      "present": true
    },
    {
      "value": 50,
      "factor": "age",
      "points": 1,
      "present": true
    },
    {
      "value": "male",
      "factor": "male",
      "points": 1,
      "present": true
    },
    {
      "value": 30.0,
      "factor": "bmi",
      "points": 1,
      "present": true
    },
    {
      "factor": "family_history_vte",
      "points": 0,
      "present": false
    },
    {
      "factor": "personal_history_vte_or_major_thrombophilia",
      "points": 0,
      "present": false
    },
    {
      "factor": "hormonal_estrogenic_treatment",
      "points": 0,
      "present": false
    },
    {
      "factor": "cancer_within_5y",
      "points": 0,
      "present": false
    },
    {
      "factor": "pregnancy_or_puerperium",
      "points": 0,
      "present": false
    },
    {
      "factor": "other_immobilization_3mo",
      "points": 0,
      "present": false
    },
    {
      "factor": "surgery_within_3mo",
      "points": 0,
      "present": false
    },
    {
      "factor": "comorbidity",
      "points": 0,
      "present": false
    },
    {
      "factor": "chronic_venous_insufficiency",
      "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": "Nemeth B, Douillet D, le Cessie S, Penaloza A, Moumneh T, Roy PM, Cannegieter S",
    "doi": "10.1016/j.eclinm.2020.100270",
    "id": "nemeth-2020",
    "pmid": "32300734",
    "source": "EClinicalMedicine. 2020;20:100270",
    "title": "Clinical risk assessment model to predict venous thromboembolism risk after immobilization for lower-limb trauma"
  },
  "formula": "trip_cast",
  "formula_expression": "TRiP(cast) = trauma (high 3, intermediate 2, low 1) + immobilization (upper_leg 3, lower_leg 2, foot_cast 1, other_plantar 0) + age (<35: 0, 35-54: 1, 55-74: 2, >=75: 3) + male (1) + BMI (>=35: 2, >=25 and <35: 1, <25: 0) + family_history_vte (2) + personal_history_vte_or_major_thrombophilia (4) + hormonal_estrogenic_treatment (4) + cancer_within_5y (3) + pregnancy_or_puerperium (3) + other_immobilization_3mo (2) + surgery_within_3mo (2) + comorbidity (1) + chronic_venous_insufficiency (1); Nemeth 2020 Table 1; max 34; high_risk iff score >= 7",
  "age_years": 50,
  "max_score": 34,
  "score": 7,
  "risk_band": "high_risk",
  "sex": "male",
  "high_risk": true,
  "bmi_kg_m2": 30.0,
  "immobilization": "lower_leg",
  "trauma": "intermediate"
}
```

## Errors

- HTTP 400 `invalid_trip_trauma`: trauma must be high, intermediate, or low (Nemeth 2020 Table 1; caller assigns the highest trauma category). Returned before settlement; you are not charged.
- HTTP 400 `invalid_trip_immobilization`: immobilization must be upper_leg, lower_leg, foot_cast, or other_plantar (Nemeth 2020 Table 1). Returned before settlement; you are not charged.
- HTTP 400 `invalid_trip_age`: age must be an integer from 1 to 120 (Nemeth 2020 TRiP(cast); not the adult 18-120 clamp). 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_bmi_kg_m2`: bmi_kg_m2 must be a number from 10 to 80. 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

- [Caprini score](https://magentlab.com/docs/caprini) — Sum Caprini 2005 Table 3 thrombosis risk factors with exclusive age and surgery weights and return the Table 2 band (low / moderate / high / highest).
- [IMPROVE VTE](https://magentlab.com/docs/improve-vte) — Compute the Spyropoulos 2011 7-factor associative IMPROVE VTE score during hospitalization from age and six caller-assigned flags.
- [Padua score](https://magentlab.com/docs/padua) — Compute the Barbar 2010 Padua Prediction Score for VTE risk in hospitalized medical patients from age and ten caller-assigned findings.

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