# Villalta post-thrombotic syndrome scale

Villalta

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

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

## What it computes

Sum five caller-assigned Villalta symptoms and six signs (each integer 0-3) and return the Kahn 2009 PTS band. Venous ulcer is a separate boolean and is not added as 15 points.

## When to use

When an agent has already assigned Kahn 2009 0-3 integers for the eleven items and a venous-ulcer flag and needs the published total and PTS band, not a limb exam, CEAP, VCSS, or Ginsberg PTS.

## When not to use

- Not a medical device and not a PTS diagnosis, anticoagulation, or compression order. magent does not examine the limb.
- Each of the eleven items is a caller-assigned integer 0-3 (0 none, 1 mild, 2 moderate, 3 severe). Venous ulcer is a separate boolean and is not added as 15 points to the numeric score.
- Kahn 2009 ISTH SSC bands: none 0-4 without ulcer; mild 5-9; moderate 10-14; severe if score ≥15 or ulcer is present even when the sum is <15.
- Not CEAP, not VCSS, and not Ginsberg PTS.

## Formula

```
Villalta = pain + cramps + heaviness + pruritus + paresthesia + pretibial_edema + skin_induration + hyperpigmentation + venous_ectasia + redness + pain_on_calf_compression; each caller-assigned 0-3; max 33; ulcer is a separate boolean and is not added to the score; PTS if score ≥5 or ulcer; none 0-4 (no ulcer); mild 5-9; moderate 10-14; severe if score ≥15 or ulcer
```

## Citation

[Measurement properties of the Villalta scale to define and classify the severity of the post-thrombotic syndrome](https://doi.org/10.1111/j.1538-7836.2009.03339.x)
Kahn SR
J Thromb Haemost. 2009;7(5):884-888
DOI: [10.1111/j.1538-7836.2009.03339.x](https://doi.org/10.1111/j.1538-7836.2009.03339.x)

## Worked example

### All items 0, no ulcer

Given: `cramps=0, heaviness=0, hyperpigmentation=0, pain=0, pain_on_calf_compression=0, paresthesia=0, pretibial_edema=0, pruritus=0, redness=0, skin_induration=0, ulcer=false, venous_ectasia=0`

1. Five symptoms 0 + six signs 0; ulcer false is not added to the score
2. Score = 0 (max 33); pts = false; pts_band none


### All items 0, ulcer present

Given: `cramps=0, heaviness=0, hyperpigmentation=0, pain=0, pain_on_calf_compression=0, paresthesia=0, pretibial_edema=0, pruritus=0, redness=0, skin_induration=0, ulcer=true, venous_ectasia=0`

1. Score remains 0; ulcer does not add 15
2. pts = true; pts_band severe because ulcer is present


## Also searched as

- Villalta scale
- Villalta PTS
- post-thrombotic syndrome
- Kahn Villalta
- Villalta score
- ISTH Villalta
- venous PTS scale
- postthrombotic syndrome Villalta

## Parameters

- `pain` (integer, required): Caller-assigned Kahn 2009 Villalta symptom pain (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `cramps` (integer, required): Caller-assigned Kahn 2009 Villalta symptom cramps (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `heaviness` (integer, required): Caller-assigned Kahn 2009 Villalta symptom heaviness (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `pruritus` (integer, required): Caller-assigned Kahn 2009 Villalta symptom pruritus (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `paresthesia` (integer, required): Caller-assigned Kahn 2009 Villalta symptom paresthesia (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `pretibial_edema` (integer, required): Caller-assigned Kahn 2009 Villalta sign pretibial edema (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `skin_induration` (integer, required): Caller-assigned Kahn 2009 Villalta sign skin induration (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `hyperpigmentation` (integer, required): Caller-assigned Kahn 2009 Villalta sign hyperpigmentation (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `venous_ectasia` (integer, required): Caller-assigned Kahn 2009 Villalta sign venous ectasia (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `redness` (integer, required): Caller-assigned Kahn 2009 Villalta sign redness (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `pain_on_calf_compression` (integer, required): Caller-assigned Kahn 2009 Villalta sign pain on calf compression (integer 0-3: 0 none, 1 mild, 2 moderate, 3 severe). magent does not examine the limb.
- `ulcer` (boolean, required): Caller-assigned venous ulcer (true or false). Presence classifies PTS as severe (Kahn 2009) and does not add 15 to the numeric score. magent does not examine the limb.

## 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/villalta`
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": [
    {
      "cramps": "0",
      "heaviness": "0",
      "hyperpigmentation": "0",
      "pain": "0",
      "pain_on_calf_compression": "0",
      "paresthesia": "0",
      "pretibial_edema": "0",
      "pruritus": "0",
      "redness": "0",
      "skin_induration": "0",
      "ulcer": "false",
      "venous_ectasia": "0"
    },
    {
      "cramps": "0",
      "heaviness": "0",
      "hyperpigmentation": "0",
      "pain": "0",
      "pain_on_calf_compression": "0",
      "paresthesia": "0",
      "pretibial_edema": "0",
      "pruritus": "0",
      "redness": "0",
      "skin_induration": "0",
      "ulcer": "false",
      "venous_ectasia": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/villalta",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "pain",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "cramps",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "heaviness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pruritus",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "paresthesia",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pretibial_edema",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "skin_induration",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "hyperpigmentation",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "venous_ectasia",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "redness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pain_on_calf_compression",
          "points": 0,
          "present": true
        }
      ],
      "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": "Kahn SR",
        "doi": "10.1111/j.1538-7836.2009.03339.x",
        "id": "kahn-2009",
        "pmid": "19320818",
        "source": "J Thromb Haemost. 2009;7(5):884-888",
        "title": "Measurement properties of the Villalta scale to define and classify the severity of the post-thrombotic syndrome"
      },
      "formula": "villalta",
      "formula_expression": "Villalta = pain + cramps + heaviness + pruritus + paresthesia + pretibial_edema + skin_induration + hyperpigmentation + venous_ectasia + redness + pain_on_calf_compression; each caller-assigned 0-3; max 33; ulcer is a separate boolean and is not added to the score; PTS if score ≥5 or ulcer; none 0-4 (no ulcer); mild 5-9; moderate 10-14; severe if score ≥15 or ulcer",
      "max_score": 33,
      "score": 0,
      "pts": false,
      "pts_band": "none",
      "ulcer": false
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "pain",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "cramps",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "heaviness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pruritus",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "paresthesia",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pretibial_edema",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "skin_induration",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "hyperpigmentation",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "venous_ectasia",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "redness",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "pain_on_calf_compression",
          "points": 0,
          "present": true
        }
      ],
      "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": "Kahn SR",
        "doi": "10.1111/j.1538-7836.2009.03339.x",
        "id": "kahn-2009",
        "pmid": "19320818",
        "source": "J Thromb Haemost. 2009;7(5):884-888",
        "title": "Measurement properties of the Villalta scale to define and classify the severity of the post-thrombotic syndrome"
      },
      "formula": "villalta",
      "formula_expression": "Villalta = pain + cramps + heaviness + pruritus + paresthesia + pretibial_edema + skin_induration + hyperpigmentation + venous_ectasia + redness + pain_on_calf_compression; each caller-assigned 0-3; max 33; ulcer is a separate boolean and is not added to the score; PTS if score ≥5 or ulcer; none 0-4 (no ulcer); mild 5-9; moderate 10-14; severe if score ≥15 or ulcer",
      "max_score": 33,
      "score": 0,
      "pts": false,
      "pts_band": "none",
      "ulcer": false
    }
  ]
}
```

## Response fields

- `formula` (string): villalta
- `formula_expression` (string): Exact expression used
- `score` (integer): Sum of the eleven Kahn 2009 items (0-33). Venous ulcer is not added as 15 points.
- `max_score` (integer): Always 33
- `pts` (boolean): true when score ≥5 or ulcer is true (Kahn 2009 PTS definition)
- `pts_band` (string): Kahn 2009 band: none (0-4 and no ulcer), mild (5-9), moderate (10-14), or severe (score ≥15 or ulcer). Not a treatment order.
- `ulcer` (boolean): Caller-assigned venous ulcer used. Presence classifies severe PTS and does not change score.
- `components` (array): Per-item caller-assigned points
- `citation` (object): Kahn 2009 J Thromb Haemost citation (ISTH SSC supporting review)
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "pain",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "cramps",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "heaviness",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "pruritus",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "paresthesia",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "pretibial_edema",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "skin_induration",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "hyperpigmentation",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "venous_ectasia",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "redness",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "pain_on_calf_compression",
      "points": 0,
      "present": true
    }
  ],
  "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": "Kahn SR",
    "doi": "10.1111/j.1538-7836.2009.03339.x",
    "id": "kahn-2009",
    "pmid": "19320818",
    "source": "J Thromb Haemost. 2009;7(5):884-888",
    "title": "Measurement properties of the Villalta scale to define and classify the severity of the post-thrombotic syndrome"
  },
  "formula": "villalta",
  "formula_expression": "Villalta = pain + cramps + heaviness + pruritus + paresthesia + pretibial_edema + skin_induration + hyperpigmentation + venous_ectasia + redness + pain_on_calf_compression; each caller-assigned 0-3; max 33; ulcer is a separate boolean and is not added to the score; PTS if score ≥5 or ulcer; none 0-4 (no ulcer); mild 5-9; moderate 10-14; severe if score ≥15 or ulcer",
  "max_score": 33,
  "score": 0,
  "pts": false,
  "pts_band": "none",
  "ulcer": false
}
```

## Errors

- HTTP 400 `invalid_villalta`: each Villalta symptom and sign must be an integer 0-3 (Kahn 2009 ISTH; 0 none, 1 mild, 2 moderate, 3 severe). 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

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

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