# Composite PE shock score (Bangalore)

CPES

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

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

## What it computes

Sum the six Bangalore 2023 composite PE shock flags from caller-assigned booleans and return the 0–6 integer total. No named risk bands.

## When to use

When an agent already has intermediate-risk (normotensive) PE findings assigned as six yes/no flags and needs the published 0–6 total, not a shock diagnosis, not sPESI, not Bova, and not PESI.

## When not to use

- Not a medical device and not a shock diagnosis. Not a reperfusion or thrombolysis order.
- For intermediate-risk (normotensive) PE as in Bangalore 2023. Not high-risk hypotensive PE. Not sPESI, not Bova, and not PESI.
- Six equally weighted caller-assigned flags. magent does not read echo or assays and does not take raw heart rate. Site troponin and BNP cutoffs were not standardized; this tool does not invent numeric biomarker thresholds.
- Returns the 0–6 integer score and max_score only. Bangalore 2023 reported prevalence of normotensive shock by integer score 0–6 and that a score of 6 predicted shock versus <6. This tool does not invent named risk bands.

## Formula

```
CPES = elevated_troponin + elevated_bnp + moderate_or_severe_rv_dysfunction + saddle_pe + concomitant_dvt + tachycardia; each 1 if true; max 6 (Bangalore 2023)
```

## Citation

[Prevalence and Predictors of Cardiogenic Shock in Intermediate-Risk Pulmonary Embolism: Insights From the FLASH Registry](https://doi.org/10.1016/j.jcin.2023.02.004)
Bangalore S, Horowitz JM, Beam D, Jaber WA, Khandhar S, Toma C, Weinberg MD, Mina B
JACC Cardiovasc Interv. 2023;16(8):958-972
DOI: [10.1016/j.jcin.2023.02.004](https://doi.org/10.1016/j.jcin.2023.02.004)

## Worked example

### All six flags false

Given: `concomitant_dvt=false, elevated_bnp=false, elevated_troponin=false, moderate_or_severe_rv_dysfunction=false, saddle_pe=false, tachycardia=false`

1. All six caller-assigned flags are false
2. Score = 0 (max 6); integer score only, no named band


### All six flags true

Given: `concomitant_dvt=true, elevated_bnp=true, elevated_troponin=true, moderate_or_severe_rv_dysfunction=true, saddle_pe=true, tachycardia=true`

1. All six caller-assigned flags are true (1 point each)
2. Score = 6 (max 6); integer score only, no named band


## Also searched as

- composite PE shock score
- Bangalore PE shock score
- intermediate-risk PE shock score
- CPES
- composite pulmonary embolism shock
- Bangalore 2023 PE score
- normotensive PE shock score
- intermediate-risk PE composite score

## Parameters

- `elevated_troponin` (boolean, required): Elevated troponin per local assay, as assigned by the caller (Bangalore 2023). true scores 1; false scores 0. Site cutoffs were not standardized; magent does not invent a numeric threshold or read the assay.
- `elevated_bnp` (boolean, required): Elevated BNP, as assigned by the caller (Bangalore 2023). true scores 1; false scores 0. Site cutoffs were not standardized; magent does not invent a numeric threshold or read the assay.
- `moderate_or_severe_rv_dysfunction` (boolean, required): Moderately or severely reduced RV function, as assigned by the caller (Bangalore 2023). Normal or mild reduction is false. true scores 1; false scores 0. magent does not read echo.
- `saddle_pe` (boolean, required): Saddle PE or central thrombus burden, as assigned by the caller (Bangalore 2023). true scores 1; false scores 0. magent does not read imaging.
- `concomitant_dvt` (boolean, required): Concomitant DVT, as assigned by the caller (Bangalore 2023). true scores 1; false scores 0. magent does not diagnose DVT.
- `tachycardia` (boolean, required): Tachycardia ≥100 beats/min as assigned by the caller (Bangalore 2023). true scores 1; false scores 0. magent does not take raw heart rate.

## 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/cpes`
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": [
    {
      "concomitant_dvt": "false",
      "elevated_bnp": "false",
      "elevated_troponin": "false",
      "moderate_or_severe_rv_dysfunction": "false",
      "saddle_pe": "false",
      "tachycardia": "false"
    },
    {
      "concomitant_dvt": "false",
      "elevated_bnp": "false",
      "elevated_troponin": "false",
      "moderate_or_severe_rv_dysfunction": "false",
      "saddle_pe": "false",
      "tachycardia": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/cpes",
  "items": [
    {
      "components": [
        {
          "factor": "elevated_troponin",
          "points": 0,
          "present": false
        },
        {
          "factor": "elevated_bnp",
          "points": 0,
          "present": false
        },
        {
          "factor": "moderate_or_severe_rv_dysfunction",
          "points": 0,
          "present": false
        },
        {
          "factor": "saddle_pe",
          "points": 0,
          "present": false
        },
        {
          "factor": "concomitant_dvt",
          "points": 0,
          "present": false
        },
        {
          "factor": "tachycardia",
          "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": "Bangalore S, Horowitz JM, Beam D, Jaber WA, Khandhar S, Toma C, Weinberg MD, Mina B",
        "doi": "10.1016/j.jcin.2023.02.004",
        "id": "bangalore-2023",
        "pmid": "37100559",
        "source": "JACC Cardiovasc Interv. 2023;16(8):958-972",
        "title": "Prevalence and Predictors of Cardiogenic Shock in Intermediate-Risk Pulmonary Embolism: Insights From the FLASH Registry"
      },
      "formula": "cpes",
      "formula_expression": "CPES = elevated_troponin + elevated_bnp + moderate_or_severe_rv_dysfunction + saddle_pe + concomitant_dvt + tachycardia; each 1 if true; max 6 (Bangalore 2023)",
      "max_score": 6,
      "score": 0
    },
    {
      "components": [
        {
          "factor": "elevated_troponin",
          "points": 0,
          "present": false
        },
        {
          "factor": "elevated_bnp",
          "points": 0,
          "present": false
        },
        {
          "factor": "moderate_or_severe_rv_dysfunction",
          "points": 0,
          "present": false
        },
        {
          "factor": "saddle_pe",
          "points": 0,
          "present": false
        },
        {
          "factor": "concomitant_dvt",
          "points": 0,
          "present": false
        },
        {
          "factor": "tachycardia",
          "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": "Bangalore S, Horowitz JM, Beam D, Jaber WA, Khandhar S, Toma C, Weinberg MD, Mina B",
        "doi": "10.1016/j.jcin.2023.02.004",
        "id": "bangalore-2023",
        "pmid": "37100559",
        "source": "JACC Cardiovasc Interv. 2023;16(8):958-972",
        "title": "Prevalence and Predictors of Cardiogenic Shock in Intermediate-Risk Pulmonary Embolism: Insights From the FLASH Registry"
      },
      "formula": "cpes",
      "formula_expression": "CPES = elevated_troponin + elevated_bnp + moderate_or_severe_rv_dysfunction + saddle_pe + concomitant_dvt + tachycardia; each 1 if true; max 6 (Bangalore 2023)",
      "max_score": 6,
      "score": 0
    }
  ]
}
```

## Response fields

- `formula` (string): cpes
- `formula_expression` (string): Exact expression used
- `score` (integer): Bangalore 2023 composite PE shock points 0-6
- `max_score` (integer): Always 6
- `components` (array): Per-factor points
- `citation` (object): Bangalore 2023 JACC Cardiovasc Interv citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "elevated_troponin",
      "points": 0,
      "present": false
    },
    {
      "factor": "elevated_bnp",
      "points": 0,
      "present": false
    },
    {
      "factor": "moderate_or_severe_rv_dysfunction",
      "points": 0,
      "present": false
    },
    {
      "factor": "saddle_pe",
      "points": 0,
      "present": false
    },
    {
      "factor": "concomitant_dvt",
      "points": 0,
      "present": false
    },
    {
      "factor": "tachycardia",
      "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": "Bangalore S, Horowitz JM, Beam D, Jaber WA, Khandhar S, Toma C, Weinberg MD, Mina B",
    "doi": "10.1016/j.jcin.2023.02.004",
    "id": "bangalore-2023",
    "pmid": "37100559",
    "source": "JACC Cardiovasc Interv. 2023;16(8):958-972",
    "title": "Prevalence and Predictors of Cardiogenic Shock in Intermediate-Risk Pulmonary Embolism: Insights From the FLASH Registry"
  },
  "formula": "cpes",
  "formula_expression": "CPES = elevated_troponin + elevated_bnp + moderate_or_severe_rv_dysfunction + saddle_pe + concomitant_dvt + tachycardia; each 1 if true; max 6 (Bangalore 2023)",
  "max_score": 6,
  "score": 0
}
```

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

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [Bova](https://magentlab.com/docs/bova) — Compute the Bova 2014 seven-point index (SBP 90-100 mm Hg, elevated troponin, RV dysfunction, heart rate ≥110) for confirmed acute PE that is not hypotensive, and return the published Table 6 stage band.
- [PESI](https://magentlab.com/docs/pesi) — Compute the Aujesky 2005 Pulmonary Embolism Severity Index (PESI) from age, sex, comorbidities, vital signs, and altered mental status.
- [Hestia criteria](https://magentlab.com/docs/hestia) — Apply the Zondag 2011 Hestia exclusion checklist and return whether outpatient treatment of acute PE is eligible from 11 caller-assigned items.
- [sPESI](https://magentlab.com/docs/spesi) — Compute the Jiménez 2010 simplified Pulmonary Embolism Severity Index (sPESI) from age and five caller-assigned findings.

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