# Wells DVT

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

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

## What it computes

Compute the Wells deep-vein thrombosis probability score and return three-tier and two-tier bands.

## When to use

When an agent needs the published Wells DVT arithmetic and must not invent a probability from prose.

## When not to use

- Not a diagnosis. Bands are published cut-points, not a DVT rule-out.
- alternative_diagnosis_as_likely subtracts 2. Flags are caller-supplied booleans.

## Formula

```
Wells DVT = +1 each of 9 findings; −2 if alternative_diagnosis_as_likely
```

## Citation

Evaluation of D-dimer in the diagnosis of suspected deep-vein thrombosis
Wells PS, Anderson DR, Rodger M, et al.
N Engl J Med. 2003;349(13):1227-1235
DOI: [10.1056/NEJMoa023153](https://doi.org/10.1056/NEJMoa023153)

## Worked example

### Active cancer + calf swelling

Given: `active_cancer=true, alternative_diagnosis_as_likely=false, bedridden_or_surgery=false, calf_swelling_gt_3cm=true, collateral_veins=false, entire_leg_swollen=false, paralysis_or_cast=false, pitting_edema=false, previous_dvt=false, tenderness=false`

1. active_cancer → +1; calf_swelling_gt_3cm → +1
2. Score = 2 → three-tier moderate, two-tier likely (≥2)


## Parameters

- `active_cancer` (boolean, required): Active cancer (treatment ongoing, within 6 months, or palliative). +1.
- `paralysis_or_cast` (boolean, required): Paralysis, paresis, or recent plaster immobilization of the legs. +1.
- `bedridden_or_surgery` (boolean, required): Recently bedridden ≥3 days or major surgery within 12 weeks. +1.
- `tenderness` (boolean, required): Localized tenderness along the deep venous system. +1.
- `entire_leg_swollen` (boolean, required): Entire leg swollen. +1.
- `calf_swelling_gt_3cm` (boolean, required): Calf swelling >3 cm compared with the asymptomatic side. +1.
- `pitting_edema` (boolean, required): Pitting edema confined to the symptomatic leg. +1.
- `collateral_veins` (boolean, required): Collateral superficial veins (nonvaricose). +1.
- `previous_dvt` (boolean, required): Previously documented DVT. +1.
- `alternative_diagnosis_as_likely` (boolean, required): Alternative diagnosis at least as likely as DVT. −2.

## Bulk (POST)

POST the same path with a JSON items array. Price is n times the GET unit. Invalid items return HTTP 400 before settlement.

Method: `POST /api/calc/wells_dvt`
Max items: 25
Price: unit_amount * n (unit 5000 atomic)
Status: PREVIEW

- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- 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. HTML paywall is GET only.

Example request:

```json
{
  "items": [
    {
      "active_cancer": "true",
      "alternative_diagnosis_as_likely": "false",
      "bedridden_or_surgery": "false",
      "calf_swelling_gt_3cm": "true",
      "collateral_veins": "false",
      "entire_leg_swollen": "false",
      "paralysis_or_cast": "false",
      "pitting_edema": "false",
      "previous_dvt": "false",
      "tenderness": "false"
    },
    {
      "active_cancer": "true",
      "alternative_diagnosis_as_likely": "false",
      "bedridden_or_surgery": "false",
      "calf_swelling_gt_3cm": "true",
      "collateral_veins": "false",
      "entire_leg_swollen": "false",
      "paralysis_or_cast": "false",
      "pitting_edema": "false",
      "previous_dvt": "false",
      "tenderness": "false"
    }
  ]
}
```

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/wells_dvt",
  "items": [
    {
      "components": [
        {
          "factor": "active_cancer",
          "points": 1,
          "present": true
        },
        {
          "factor": "paralysis_or_cast",
          "points": 0,
          "present": false
        },
        {
          "factor": "bedridden_or_surgery",
          "points": 0,
          "present": false
        },
        {
          "factor": "tenderness",
          "points": 0,
          "present": false
        },
        {
          "factor": "entire_leg_swollen",
          "points": 0,
          "present": false
        },
        {
          "factor": "calf_swelling_gt_3cm",
          "points": 1,
          "present": true
        },
        {
          "factor": "pitting_edema",
          "points": 0,
          "present": false
        },
        {
          "factor": "collateral_veins",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_dvt",
          "points": 0,
          "present": false
        },
        {
          "factor": "alternative_diagnosis_as_likely",
          "points": 0,
          "present": false
        }
      ],
      "disclaimer": "Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Wells PS, Anderson DR, Rodger M, et al.",
        "doi": "10.1056/NEJMoa023153",
        "id": "wells-dvt-2003",
        "source": "N Engl J Med. 2003;349(13):1227-1235",
        "title": "Evaluation of D-dimer in the diagnosis of suspected deep-vein thrombosis"
      },
      "formula": "wells_dvt",
      "formula_expression": "Wells DVT = +1 each of 9 findings; −2 if alternative_diagnosis_as_likely",
      "max_score": 9,
      "score": 2,
      "three_tier": "moderate",
      "two_tier": "likely"
    },
    {
      "components": [
        {
          "factor": "active_cancer",
          "points": 1,
          "present": true
        },
        {
          "factor": "paralysis_or_cast",
          "points": 0,
          "present": false
        },
        {
          "factor": "bedridden_or_surgery",
          "points": 0,
          "present": false
        },
        {
          "factor": "tenderness",
          "points": 0,
          "present": false
        },
        {
          "factor": "entire_leg_swollen",
          "points": 0,
          "present": false
        },
        {
          "factor": "calf_swelling_gt_3cm",
          "points": 1,
          "present": true
        },
        {
          "factor": "pitting_edema",
          "points": 0,
          "present": false
        },
        {
          "factor": "collateral_veins",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_dvt",
          "points": 0,
          "present": false
        },
        {
          "factor": "alternative_diagnosis_as_likely",
          "points": 0,
          "present": false
        }
      ],
      "disclaimer": "Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
      "citation": {
        "authors": "Wells PS, Anderson DR, Rodger M, et al.",
        "doi": "10.1056/NEJMoa023153",
        "id": "wells-dvt-2003",
        "source": "N Engl J Med. 2003;349(13):1227-1235",
        "title": "Evaluation of D-dimer in the diagnosis of suspected deep-vein thrombosis"
      },
      "formula": "wells_dvt",
      "formula_expression": "Wells DVT = +1 each of 9 findings; −2 if alternative_diagnosis_as_likely",
      "max_score": 9,
      "score": 2,
      "three_tier": "moderate",
      "two_tier": "likely"
    }
  ]
}
```

## Response fields

- `formula` (string): wells_dvt
- `formula_expression` (string): Exact expression used
- `score` (integer): Total points (−2 to 9)
- `max_score` (integer): Always 9
- `three_tier` (string): low (≤0), moderate (1-2), high (≥3). Not a diagnosis.
- `two_tier` (string): likely (≥2) or unlikely (<2). Not a diagnosis.
- `components` (array): Per-factor points
- `citation` (object): NEJM 2003 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "active_cancer",
      "points": 1,
      "present": true
    },
    {
      "factor": "paralysis_or_cast",
      "points": 0,
      "present": false
    },
    {
      "factor": "bedridden_or_surgery",
      "points": 0,
      "present": false
    },
    {
      "factor": "tenderness",
      "points": 0,
      "present": false
    },
    {
      "factor": "entire_leg_swollen",
      "points": 0,
      "present": false
    },
    {
      "factor": "calf_swelling_gt_3cm",
      "points": 1,
      "present": true
    },
    {
      "factor": "pitting_edema",
      "points": 0,
      "present": false
    },
    {
      "factor": "collateral_veins",
      "points": 0,
      "present": false
    },
    {
      "factor": "previous_dvt",
      "points": 0,
      "present": false
    },
    {
      "factor": "alternative_diagnosis_as_likely",
      "points": 0,
      "present": false
    }
  ],
  "disclaimer": "Not a medical device. Deterministic published-formula or coded-ontology output for autonomous agents. A licensed clinician remains responsible for patient care and billing submissions.",
  "citation": {
    "authors": "Wells PS, Anderson DR, Rodger M, et al.",
    "doi": "10.1056/NEJMoa023153",
    "id": "wells-dvt-2003",
    "source": "N Engl J Med. 2003;349(13):1227-1235",
    "title": "Evaluation of D-dimer in the diagnosis of suspected deep-vein thrombosis"
  },
  "formula": "wells_dvt",
  "formula_expression": "Wells DVT = +1 each of 9 findings; −2 if alternative_diagnosis_as_likely",
  "max_score": 9,
  "score": 2,
  "three_tier": "moderate",
  "two_tier": "likely"
}
```

## Errors

- 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.
- HTTP 402 `payment_required`: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header
- HTTP 409 `payment_in_progress`: The same authorization nonce is already being settled; retry shortly
- HTTP 429 `rate_limited`: Too many requests from this client
- HTTP 503 `settlement_uncertain`: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE
- HTTP 503 `facilitator_unavailable`: Payment facilitator unavailable
- HTTP 503 `facilitator_misconfigured`: Payment facilitator is not configured
- HTTP 503 `facilitator_unauthorized`: Payment facilitator rejected credentials
- HTTP 503 `ledger_unavailable`: Payment ledger unavailable
- HTTP 503 `payment_unavailable`: Payment processing unavailable

## Related tools

- [Wells PE](https://magentlab.com/docs/wells-pe) — Compute the Wells pulmonary-embolism probability score and return three-tier and two-tier bands.
- [CURB-65](https://magentlab.com/docs/curb65) — Compute the CURB-65 community-acquired pneumonia severity score from age and discrete flags.

## Also searched as

- Wells DVT score
- Wells deep vein thrombosis
- DVT likely unlikely
- Wells DVT two-tier

## Payment

Required query parameters must be present and valid. 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.

## Guarantees

- Invalid query parameters return HTTP 400 before settlement. You are not charged.
- Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are not persisted. Request logs store path without query.
