# VIRSTA score

VIRSTA

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

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

## What it computes

Sum the Tubiana 2016 VIRSTA items from caller-assigned Staphylococcus aureus bacteremia flags and CRP, and return high_risk when the total is 3 or more.

## When to use

When an agent has already assigned the Tubiana 2016 VIRSTA flags and a CRP in mg/L for Staphylococcus aureus bacteremia and needs the published 0-30 total and ≥3 high_risk flag, not a Duke classification, PREDICT/POSITIVE score, or an endocarditis diagnosis. magent does not examine the patient or assay CRP.

## When not to use

- Not a medical device and not a diagnosis or treatment recommendation. magent does not diagnose infective endocarditis.
- Nine clinical flags are caller-assigned. magent does not examine the patient, interpret cultures, or assay CRP.
- Permanent intracardiac device or previous IE is one Tubiana 2016 item (4 points if either is present). The two are not added separately.
- CRP scores 1 only when crp_mg_l is above 190 mg/L (Tubiana 2016: above 190 mg/L). Exactly 190 scores 0. Range 0-500.
- high_risk is true iff score ≥ 3 (paper: ≤2 low IE-risk, ≥3 higher risk / echocardiography priority). magent does not invent extra strata and does not order TTE or TEE. Not the modified Duke criteria.

## Formula

```
VIRSTA = cerebral_or_peripheral_emboli (5 if present) + meningitis (5) + intracardiac_device_or_previous_ie (4) + iv_drug_use (4) + native_valve_disease (3) + persistent_bacteremia (3) + vertebral_osteomyelitis (2) + community_or_non_nosocomial (2) + severe_sepsis_or_shock (1) + (crp_mg_l > 190 → 1); Tubiana 2016 caller-assigned items; CRP cutoff is above 190 mg/L (not ≥190); intracardiac device or previous IE is one 4-point item; max 30; high_risk iff score ≥ 3
```

## Citation

[The VIRSTA score, a prediction score to estimate risk of infective endocarditis and determine priority for echocardiography in patients with Staphylococcus aureus bacteremia](https://doi.org/10.1016/j.jinf.2016.02.003)
Tubiana S, Duval X, Alla F, Selton-Suty C, Tattevin P, Delahaye F, Piroth L, Chirouze C, Lavigne JP, Erpelding ML, Hoen B, Vandenesch F, Iung B, Le Moing V
J Infect. 2016;72(5):544-553
DOI: [10.1016/j.jinf.2016.02.003](https://doi.org/10.1016/j.jinf.2016.02.003)

## Worked example

### All flags absent, CRP below cutoff

Given: `cerebral_or_peripheral_emboli=false, community_or_non_nosocomial=false, crp_mg_l=50, intracardiac_device_or_previous_ie=false, iv_drug_use=false, meningitis=false, native_valve_disease=false, persistent_bacteremia=false, severe_sepsis_or_shock=false, vertebral_osteomyelitis=false`

1. All nine flags false → 0; CRP 50 mg/L is not above 190 → 0
2. Score = 0 (max 30); high_risk false


### Native valve disease only (published ≥3 cutoff)

Given: `cerebral_or_peripheral_emboli=false, community_or_non_nosocomial=false, crp_mg_l=50, intracardiac_device_or_previous_ie=false, iv_drug_use=false, meningitis=false, native_valve_disease=true, persistent_bacteremia=false, severe_sepsis_or_shock=false, vertebral_osteomyelitis=false`

1. native_valve_disease true → 3; remaining flags false → 0; CRP 50 → 0
2. Score = 3 (max 30); high_risk true (threshold is ≥3)


### All items present

Given: `cerebral_or_peripheral_emboli=true, community_or_non_nosocomial=true, crp_mg_l=250, intracardiac_device_or_previous_ie=true, iv_drug_use=true, meningitis=true, native_valve_disease=true, persistent_bacteremia=true, severe_sepsis_or_shock=true, vertebral_osteomyelitis=true`

1. 5+5+4+4+3+3+2+2+1 + CRP 250 > 190 → 1
2. Score = 30 (max 30); high_risk true


## Also searched as

- VIRSTA score
- Tubiana VIRSTA
- S aureus bacteremia endocarditis score
- Staphylococcus aureus bacteremia IE score
- VIRSTA echocardiography priority
- infective endocarditis SAB score

## Parameters

- `cerebral_or_peripheral_emboli` (boolean, required): Caller-assigned cerebral or peripheral (extracerebral) emboli (Tubiana 2016). true scores 5. magent does not diagnose emboli or endocarditis.
- `meningitis` (boolean, required): Caller-assigned meningitis (Tubiana 2016). true scores 5. magent does not diagnose meningitis or endocarditis.
- `intracardiac_device_or_previous_ie` (boolean, required): Permanent intracardiac device or previous infective endocarditis as one Tubiana 2016 item. true scores 4 if either is present; the two are not added separately. magent does not diagnose IE.
- `iv_drug_use` (boolean, required): Caller-assigned intravenous drug use (Tubiana 2016). true scores 4. magent does not take a social history.
- `native_valve_disease` (boolean, required): Caller-assigned preexisting native valve disease (Tubiana 2016). true scores 3. magent does not diagnose valve disease.
- `persistent_bacteremia` (boolean, required): H48-persistent bacteremia (positive blood culture after 48 hours) as assigned by the caller (Tubiana 2016). true scores 3. magent does not interpret cultures.
- `vertebral_osteomyelitis` (boolean, required): Caller-assigned vertebral osteomyelitis / spondylodiscitis (Tubiana 2016). true scores 2. magent does not diagnose osteomyelitis.
- `community_or_non_nosocomial` (boolean, required): Community-acquired or non-nosocomial healthcare-associated Staphylococcus aureus bacteremia (Tubiana 2016), as assigned by the caller. true scores 2; nosocomial is false (0). magent does not classify acquisition.
- `severe_sepsis_or_shock` (boolean, required): Caller-assigned severe sepsis or septic shock (Tubiana 2016). true scores 1. magent does not diagnose sepsis.
- `crp_mg_l` (number, required): C-reactive protein in mg/L (0-500). Tubiana 2016 scores 1 if CRP is above 190 mg/L (not ≥190). magent does not assay CRP.

## 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/virsta`
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": [
    {
      "cerebral_or_peripheral_emboli": "false",
      "community_or_non_nosocomial": "false",
      "crp_mg_l": "50",
      "intracardiac_device_or_previous_ie": "false",
      "iv_drug_use": "false",
      "meningitis": "false",
      "native_valve_disease": "false",
      "persistent_bacteremia": "false",
      "severe_sepsis_or_shock": "false",
      "vertebral_osteomyelitis": "false"
    },
    {
      "cerebral_or_peripheral_emboli": "false",
      "community_or_non_nosocomial": "false",
      "crp_mg_l": "50",
      "intracardiac_device_or_previous_ie": "false",
      "iv_drug_use": "false",
      "meningitis": "false",
      "native_valve_disease": "false",
      "persistent_bacteremia": "false",
      "severe_sepsis_or_shock": "false",
      "vertebral_osteomyelitis": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/virsta",
  "items": [
    {
      "components": [
        {
          "factor": "cerebral_or_peripheral_emboli",
          "points": 0,
          "present": false
        },
        {
          "factor": "meningitis",
          "points": 0,
          "present": false
        },
        {
          "factor": "intracardiac_device_or_previous_ie",
          "points": 0,
          "present": false
        },
        {
          "factor": "iv_drug_use",
          "points": 0,
          "present": false
        },
        {
          "factor": "native_valve_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "persistent_bacteremia",
          "points": 0,
          "present": false
        },
        {
          "factor": "vertebral_osteomyelitis",
          "points": 0,
          "present": false
        },
        {
          "factor": "community_or_non_nosocomial",
          "points": 0,
          "present": false
        },
        {
          "factor": "severe_sepsis_or_shock",
          "points": 0,
          "present": false
        },
        {
          "value": 50.0,
          "factor": "crp_gt_190",
          "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": "Tubiana S, Duval X, Alla F, Selton-Suty C, Tattevin P, Delahaye F, Piroth L, Chirouze C, Lavigne JP, Erpelding ML, Hoen B, Vandenesch F, Iung B, Le Moing V",
        "doi": "10.1016/j.jinf.2016.02.003",
        "id": "tubiana-2016",
        "pmid": "26916042",
        "source": "J Infect. 2016;72(5):544-553",
        "title": "The VIRSTA score, a prediction score to estimate risk of infective endocarditis and determine priority for echocardiography in patients with Staphylococcus aureus bacteremia"
      },
      "formula": "virsta",
      "formula_expression": "VIRSTA = cerebral_or_peripheral_emboli (5 if present) + meningitis (5) + intracardiac_device_or_previous_ie (4) + iv_drug_use (4) + native_valve_disease (3) + persistent_bacteremia (3) + vertebral_osteomyelitis (2) + community_or_non_nosocomial (2) + severe_sepsis_or_shock (1) + (crp_mg_l > 190 → 1); Tubiana 2016 caller-assigned items; CRP cutoff is above 190 mg/L (not ≥190); intracardiac device or previous IE is one 4-point item; max 30; high_risk iff score ≥ 3",
      "max_score": 30,
      "score": 0,
      "high_risk": false,
      "crp_mg_l": 50.0
    },
    {
      "components": [
        {
          "factor": "cerebral_or_peripheral_emboli",
          "points": 0,
          "present": false
        },
        {
          "factor": "meningitis",
          "points": 0,
          "present": false
        },
        {
          "factor": "intracardiac_device_or_previous_ie",
          "points": 0,
          "present": false
        },
        {
          "factor": "iv_drug_use",
          "points": 0,
          "present": false
        },
        {
          "factor": "native_valve_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "persistent_bacteremia",
          "points": 0,
          "present": false
        },
        {
          "factor": "vertebral_osteomyelitis",
          "points": 0,
          "present": false
        },
        {
          "factor": "community_or_non_nosocomial",
          "points": 0,
          "present": false
        },
        {
          "factor": "severe_sepsis_or_shock",
          "points": 0,
          "present": false
        },
        {
          "value": 50.0,
          "factor": "crp_gt_190",
          "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": "Tubiana S, Duval X, Alla F, Selton-Suty C, Tattevin P, Delahaye F, Piroth L, Chirouze C, Lavigne JP, Erpelding ML, Hoen B, Vandenesch F, Iung B, Le Moing V",
        "doi": "10.1016/j.jinf.2016.02.003",
        "id": "tubiana-2016",
        "pmid": "26916042",
        "source": "J Infect. 2016;72(5):544-553",
        "title": "The VIRSTA score, a prediction score to estimate risk of infective endocarditis and determine priority for echocardiography in patients with Staphylococcus aureus bacteremia"
      },
      "formula": "virsta",
      "formula_expression": "VIRSTA = cerebral_or_peripheral_emboli (5 if present) + meningitis (5) + intracardiac_device_or_previous_ie (4) + iv_drug_use (4) + native_valve_disease (3) + persistent_bacteremia (3) + vertebral_osteomyelitis (2) + community_or_non_nosocomial (2) + severe_sepsis_or_shock (1) + (crp_mg_l > 190 → 1); Tubiana 2016 caller-assigned items; CRP cutoff is above 190 mg/L (not ≥190); intracardiac device or previous IE is one 4-point item; max 30; high_risk iff score ≥ 3",
      "max_score": 30,
      "score": 0,
      "high_risk": false,
      "crp_mg_l": 50.0
    }
  ]
}
```

## Response fields

- `formula` (string): virsta
- `formula_expression` (string): Exact expression used
- `score` (integer): VIRSTA points 0-30
- `max_score` (integer): Always 30
- `high_risk` (boolean): true iff score ≥ 3 (Tubiana 2016 not-low-risk / echocardiography-priority cutoff). Not a diagnosis and not an imaging order. No extra strata.
- `crp_mg_l` (number): CRP in mg/L used
- `components` (array): Per-item Tubiana 2016 points
- `citation` (object): Tubiana J Infect 2016 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "cerebral_or_peripheral_emboli",
      "points": 0,
      "present": false
    },
    {
      "factor": "meningitis",
      "points": 0,
      "present": false
    },
    {
      "factor": "intracardiac_device_or_previous_ie",
      "points": 0,
      "present": false
    },
    {
      "factor": "iv_drug_use",
      "points": 0,
      "present": false
    },
    {
      "factor": "native_valve_disease",
      "points": 0,
      "present": false
    },
    {
      "factor": "persistent_bacteremia",
      "points": 0,
      "present": false
    },
    {
      "factor": "vertebral_osteomyelitis",
      "points": 0,
      "present": false
    },
    {
      "factor": "community_or_non_nosocomial",
      "points": 0,
      "present": false
    },
    {
      "factor": "severe_sepsis_or_shock",
      "points": 0,
      "present": false
    },
    {
      "value": 50.0,
      "factor": "crp_gt_190",
      "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": "Tubiana S, Duval X, Alla F, Selton-Suty C, Tattevin P, Delahaye F, Piroth L, Chirouze C, Lavigne JP, Erpelding ML, Hoen B, Vandenesch F, Iung B, Le Moing V",
    "doi": "10.1016/j.jinf.2016.02.003",
    "id": "tubiana-2016",
    "pmid": "26916042",
    "source": "J Infect. 2016;72(5):544-553",
    "title": "The VIRSTA score, a prediction score to estimate risk of infective endocarditis and determine priority for echocardiography in patients with Staphylococcus aureus bacteremia"
  },
  "formula": "virsta",
  "formula_expression": "VIRSTA = cerebral_or_peripheral_emboli (5 if present) + meningitis (5) + intracardiac_device_or_previous_ie (4) + iv_drug_use (4) + native_valve_disease (3) + persistent_bacteremia (3) + vertebral_osteomyelitis (2) + community_or_non_nosocomial (2) + severe_sepsis_or_shock (1) + (crp_mg_l > 190 → 1); Tubiana 2016 caller-assigned items; CRP cutoff is above 190 mg/L (not ≥190); intracardiac device or previous IE is one 4-point item; max 30; high_risk iff score ≥ 3",
  "max_score": 30,
  "score": 0,
  "high_risk": false,
  "crp_mg_l": 50.0
}
```

## Errors

- HTTP 400 `invalid_virsta`: VIRSTA needs Tubiana 2016 Staphylococcus aureus bacteremia flags and CRP in published ranges. 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

- [Duke](https://magentlab.com/docs/duke) — Apply the Durack 1994 original Duke criteria for infective endocarditis and return definite, possible, or rejected from caller-assigned pathologic, major, minor, and rejected flags.
- [IE mortality](https://magentlab.com/docs/ie-mortality) — Compute the Park 2016 ICE simplified risk score for 6-month mortality in infective endocarditis from age and caller-assigned Table 5 flags, and return the score, quadratic 6-month mortality percent, and whether score >= 8.

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