Infection / VTE · LIVE
Wells DVT probability score
Wells DVT
Compute the Wells deep-vein thrombosis probability score and return three-tier and two-tier bands.
Markdown: /docs/wells-dvt.md · Canonical: https://magentlab.com/docs/wells-dvt
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
- Authors
- Wells PS, Anderson DR, Rodger M, et al.
- Source
- N Engl J Med. 2003;349(13):1227-1235
Worked example
Active cancer + calf swelling
Given:
active_cancer=truealternative_diagnosis_as_likely=falsebedridden_or_surgery=falsecalf_swelling_gt_3cm=truecollateral_veins=falseentire_leg_swollen=falseparalysis_or_cast=falsepitting_edema=falseprevious_dvt=falsetenderness=false
- active_cancer → +1; calf_swelling_gt_3cm → +1
- Score = 2 → three-tier moderate, two-tier likely (≥2)
Also searched as
- Wells DVT score
- Wells deep vein thrombosis
- DVT likely unlikely
- Wells DVT two-tier
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/wells_dvt?active_cancer=true¶lysis_or_cast=false&bedridden_or_surgery=false&tenderness=false&entire_leg_swollen=false&calf_swelling_gt_3cm=true&pitting_edema=false&collateral_veins=false&previous_dvt=false&alternative_diagnosis_as_likely=false
Call
Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params
return HTTP 400 before any quote or charge.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/wells_dvt?active_cancer=true¶lysis_or_cast=false&bedridden_or_surgery=false&tenderness=false&entire_leg_swollen=false&calf_swelling_gt_3cm=true&pitting_edema=false&collateral_veins=false&previous_dvt=false&alternative_diagnosis_as_likely=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
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. The first item is the GET unit; each additional item is $0.002. Invalid items return HTTP 400 before settlement.
- 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 (fixture)
{
"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"
}
]
}
Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.
Example 200 (fixture)
{
"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 published-code 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 published-code 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
| Field | Type | Description |
|---|---|---|
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
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"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 published-code 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"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_flag |
boolean clinical flags must be true or false Returned before settlement; you are not charged. |
| 400 | invalid_items |
POST body must be a JSON object with only an items array Returned before settlement; you are not charged. |
| 400 | invalid_item_count |
items must be an array of 1 to 25 objects Returned before settlement; you are not charged. |
| 400 | invalid_item |
each items entry must be a JSON object Returned before settlement; you are not charged. |
Related tools
- Wells PE — Compute the Wells pulmonary-embolism probability score and return three-tier and two-tier bands.
- CURB-65 — Compute the CURB-65 community-acquired pneumonia severity score from age and discrete flags.
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. Unpaid valid requests return HTTP 402 with a base64
PAYMENT-REQUIRED
header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake
and shared payment errors: Payments.
Stdio MCP: /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.