# VExUS C (venous excess ultrasound)

VExUS C

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

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

## What it computes

Apply Beaubien-Souligny 2020 VExUS prototype C and return vexus_grade 0-3 from a caller-assigned IVC dilatation flag and hepatic, portal, and intra-renal venous Doppler grades.

## When to use

When an agent already has a caller-assigned IVC dilatation flag (maximal diameter ≥2 cm) and hepatic, portal, and intra-renal venous Doppler grades (normal, mild, or severe) and needs the published VExUS C grade. magent does not perform ultrasound.

## When not to use

- Not a medical device.
- VExUS C only. Does not implement prototypes A, B, D, or E.
- The caller assigns ivc_dilated and the three Doppler grades. magent does not perform ultrasound or measure IVC.
- Not an AKI diagnosis. Does not report AKI probability percents.
- Not a fluid-order.

## Formula

```
VExUS C grade 0 if ivc_dilated is false (regardless of Doppler); else 1 if zero of hepatic/portal/renal are severe; 2 if exactly one is severe; 3 if two or more are severe (Beaubien-Souligny 2020 prototype C). Hepatic: normal (triphasic S>D toward liver), mild (S<D toward liver), severe (S reversed toward heart). Portal: mild pulsatility 30 to <50%, severe ≥50%. Renal: mild discontinuous S and D, severe only D. IVC dilated iff maximal diameter ≥2 cm as assigned. Not prototypes A, B, D, E
```

## Citation

[Quantifying systemic congestion with Point-Of-Care ultrasound: development of the venous excess ultrasound grading system](https://doi.org/10.1186/s13089-020-00163-w)
Beaubien-Souligny W, Rola P, Haycock K, Bouchard J, Lamarche Y, Spiegel R, Denault AY
Ultrasound J. 2020;12(1):16
DOI: [10.1186/s13089-020-00163-w](https://doi.org/10.1186/s13089-020-00163-w)

## Worked example

### IVC not dilated, all Doppler normal (grade 0)

Given: `hepatic=normal, ivc_dilated=false, portal=normal, renal=normal`

1. ivc_dilated is false (maximal IVC diameter not ≥2 cm as assigned)
2. hepatic, portal, and renal are normal
3. Grade is 0 regardless of Doppler; severe_doppler_count is 0


### Dilated IVC, all Doppler normal (grade 1)

Given: `hepatic=normal, ivc_dilated=true, portal=normal, renal=normal`

1. ivc_dilated is true (maximal IVC diameter ≥2 cm as assigned)
2. hepatic is normal (triphasic S > D toward the liver)
3. portal is normal (non-pulsatile portal flow)
4. renal is normal (continuous intra-renal venous flow)
5. Zero severe Doppler patterns; vexus_grade is 1


### Dilated IVC, one severe Doppler (grade 2)

Given: `hepatic=severe, ivc_dilated=true, portal=normal, renal=normal`

1. ivc_dilated is true
2. hepatic is severe (S reversed toward the heart)
3. portal and renal are not severe
4. Exactly one severe Doppler pattern; vexus_grade is 2


### Dilated IVC, three severe Doppler patterns (grade 3)

Given: `hepatic=severe, ivc_dilated=true, portal=severe, renal=severe`

1. ivc_dilated is true
2. hepatic is severe (systolic reversal)
3. portal is severe (pulsatility ≥50%)
4. renal is severe (only a diastolic phase)
5. Two or more severe Doppler patterns with a dilated IVC; vexus_grade is 3


## Also searched as

- VExUS C
- venous excess ultrasound
- VExUS grading system
- Beaubien-Souligny 2020
- hepatic portal renal Doppler
- IVC dilatation VExUS
- venous congestion ultrasound
- VExUS grade 0-3

## Parameters

- `ivc_dilated` (boolean, required): Whether the IVC is dilated as assigned by the caller. Dilated iff maximal IVC diameter ≥2 cm (Beaubien-Souligny 2020). true or false. Grade 0 whenever this is false, regardless of Doppler. magent does not measure IVC.
- `hepatic` (string, required): Hepatic-vein Doppler grade as assigned by the caller (Beaubien-Souligny 2020 Figure 1): normal (not mild and not severe; triphasic S > D toward the liver); mild (S component lower in magnitude than D but still toward the liver); severe (S component reversed, toward the heart). magent does not perform ultrasound.
- `portal` (string, required): Portal-vein Doppler grade as assigned by the caller (Beaubien-Souligny 2020 Figure 1 caption): normal (pulsatility fraction not in the mild or severe bands); mild (velocity variation 30 to <50%); severe (variation ≥50%). magent does not perform ultrasound.
- `renal` (string, required): Intra-renal venous Doppler grade as assigned by the caller (Beaubien-Souligny 2020 Figure 1): normal (continuous flow); mild (discontinuous with a systolic and a diastolic phase); severe (discontinuous with only a diastolic phase during the cardiac cycle). magent does not perform ultrasound.

## 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/vexus`
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": [
    {
      "hepatic": "normal",
      "ivc_dilated": "false",
      "portal": "normal",
      "renal": "normal"
    },
    {
      "hepatic": "normal",
      "ivc_dilated": "false",
      "portal": "normal",
      "renal": "normal"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/vexus",
  "items": [
    {
      "components": [
        {
          "factor": "ivc_dilated",
          "met": false
        },
        {
          "value": "normal",
          "factor": "hepatic_severe",
          "met": false
        },
        {
          "value": "normal",
          "factor": "portal_severe",
          "met": false
        },
        {
          "value": "normal",
          "factor": "renal_severe",
          "met": false
        },
        {
          "factor": "grade_0",
          "met": true
        },
        {
          "factor": "grade_1",
          "met": false
        },
        {
          "factor": "grade_2",
          "met": false
        },
        {
          "factor": "grade_3",
          "met": false
        }
      ],
      "portal": "normal",
      "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": "Beaubien-Souligny W, Rola P, Haycock K, Bouchard J, Lamarche Y, Spiegel R, Denault AY",
        "doi": "10.1186/s13089-020-00163-w",
        "id": "beaubien-souligny-2020",
        "pmid": "32270297",
        "source": "Ultrasound J. 2020;12(1):16",
        "title": "Quantifying systemic congestion with Point-Of-Care ultrasound: development of the venous excess ultrasound grading system"
      },
      "formula": "vexus",
      "formula_expression": "VExUS C grade 0 if ivc_dilated is false (regardless of Doppler); else 1 if zero of hepatic/portal/renal are severe; 2 if exactly one is severe; 3 if two or more are severe (Beaubien-Souligny 2020 prototype C). Hepatic: normal (triphasic S>D toward liver), mild (S<D toward liver), severe (S reversed toward heart). Portal: mild pulsatility 30 to <50%, severe ≥50%. Renal: mild discontinuous S and D, severe only D. IVC dilated iff maximal diameter ≥2 cm as assigned. Not prototypes A, B, D, E",
      "hepatic": "normal",
      "ivc_dilated": false,
      "renal": "normal",
      "severe_doppler_count": 0,
      "vexus_grade": 0
    },
    {
      "components": [
        {
          "factor": "ivc_dilated",
          "met": false
        },
        {
          "value": "normal",
          "factor": "hepatic_severe",
          "met": false
        },
        {
          "value": "normal",
          "factor": "portal_severe",
          "met": false
        },
        {
          "value": "normal",
          "factor": "renal_severe",
          "met": false
        },
        {
          "factor": "grade_0",
          "met": true
        },
        {
          "factor": "grade_1",
          "met": false
        },
        {
          "factor": "grade_2",
          "met": false
        },
        {
          "factor": "grade_3",
          "met": false
        }
      ],
      "portal": "normal",
      "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": "Beaubien-Souligny W, Rola P, Haycock K, Bouchard J, Lamarche Y, Spiegel R, Denault AY",
        "doi": "10.1186/s13089-020-00163-w",
        "id": "beaubien-souligny-2020",
        "pmid": "32270297",
        "source": "Ultrasound J. 2020;12(1):16",
        "title": "Quantifying systemic congestion with Point-Of-Care ultrasound: development of the venous excess ultrasound grading system"
      },
      "formula": "vexus",
      "formula_expression": "VExUS C grade 0 if ivc_dilated is false (regardless of Doppler); else 1 if zero of hepatic/portal/renal are severe; 2 if exactly one is severe; 3 if two or more are severe (Beaubien-Souligny 2020 prototype C). Hepatic: normal (triphasic S>D toward liver), mild (S<D toward liver), severe (S reversed toward heart). Portal: mild pulsatility 30 to <50%, severe ≥50%. Renal: mild discontinuous S and D, severe only D. IVC dilated iff maximal diameter ≥2 cm as assigned. Not prototypes A, B, D, E",
      "hepatic": "normal",
      "ivc_dilated": false,
      "renal": "normal",
      "severe_doppler_count": 0,
      "vexus_grade": 0
    }
  ]
}
```

## Response fields

- `formula` (string): vexus
- `formula_expression` (string): Published Beaubien-Souligny 2020 VExUS C grade rule
- `vexus_grade` (integer): VExUS C grade 0-3. 0 if the IVC is not dilated; 1 if dilated with zero severe Doppler patterns; 2 if dilated with exactly one severe; 3 if dilated with two or more severe. Not an AKI diagnosis.
- `severe_doppler_count` (integer): Count of hepatic, portal, and renal that are severe (0-3), independent of IVC dilatation
- `ivc_dilated` (boolean): Echo of the caller-assigned IVC dilatation flag
- `hepatic` (string): Echo of the caller-assigned hepatic-vein Doppler grade
- `portal` (string): Echo of the caller-assigned portal-vein Doppler grade
- `renal` (string): Echo of the caller-assigned intra-renal venous Doppler grade
- `components` (array): Rows for ivc_dilated, hepatic_severe, portal_severe, renal_severe, and exclusive grades grade_0 through grade_3 with factor, met, and value where assigned
- `citation` (object): Beaubien-Souligny 2020 Ultrasound J citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "ivc_dilated",
      "met": false
    },
    {
      "value": "normal",
      "factor": "hepatic_severe",
      "met": false
    },
    {
      "value": "normal",
      "factor": "portal_severe",
      "met": false
    },
    {
      "value": "normal",
      "factor": "renal_severe",
      "met": false
    },
    {
      "factor": "grade_0",
      "met": true
    },
    {
      "factor": "grade_1",
      "met": false
    },
    {
      "factor": "grade_2",
      "met": false
    },
    {
      "factor": "grade_3",
      "met": false
    }
  ],
  "portal": "normal",
  "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": "Beaubien-Souligny W, Rola P, Haycock K, Bouchard J, Lamarche Y, Spiegel R, Denault AY",
    "doi": "10.1186/s13089-020-00163-w",
    "id": "beaubien-souligny-2020",
    "pmid": "32270297",
    "source": "Ultrasound J. 2020;12(1):16",
    "title": "Quantifying systemic congestion with Point-Of-Care ultrasound: development of the venous excess ultrasound grading system"
  },
  "formula": "vexus",
  "formula_expression": "VExUS C grade 0 if ivc_dilated is false (regardless of Doppler); else 1 if zero of hepatic/portal/renal are severe; 2 if exactly one is severe; 3 if two or more are severe (Beaubien-Souligny 2020 prototype C). Hepatic: normal (triphasic S>D toward liver), mild (S<D toward liver), severe (S reversed toward heart). Portal: mild pulsatility 30 to <50%, severe ≥50%. Renal: mild discontinuous S and D, severe only D. IVC dilated iff maximal diameter ≥2 cm as assigned. Not prototypes A, B, D, E",
  "hepatic": "normal",
  "ivc_dilated": false,
  "renal": "normal",
  "severe_doppler_count": 0,
  "vexus_grade": 0
}
```

## Errors

- HTTP 400 `invalid_vexus`: hepatic, portal, and renal must each be normal, mild, or severe (Beaubien-Souligny 2020 VExUS C Doppler grades). 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

- [PAPi](https://magentlab.com/docs/papi) — Compute Korabathina 2012 pulmonary artery pulsatility index from PA systolic, PA diastolic, and right atrial pressure.
- [AKIN](https://magentlab.com/docs/akin) — Apply Mehta 2007 Table 2 AKIN staging and return stage 0-3 as the worse of the creatinine and urine-output limbs, with initiated renal replacement therapy mapping to stage 3.

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