# Clinical PROMISE score (malignant pleural effusion)

PROMISE

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

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

## What it computes

Sum the Psallidas 2018 Table 2A clinical PROMISE points (previous chemotherapy and radiotherapy, haemoglobin, WBC, CRP, ECOG, cancer type) and return group A-D 3-month mortality bands.

## When to use

When an agent already has caller-assigned previous chemotherapy and radiotherapy flags, haemoglobin g/dL, serum WBC as 10^9/L, CRP mg/L, ECOG 0-4, and a cancer type token (mesothelioma, lung, or other), and must not invent a diagnosis, pleurodesis or chemotherapy order, or biological PROMISE/TIMP1 result. magent does not assay labs or assign ECOG.

## When not to use

- Not a medical device and not a diagnosis or treatment order. magent does not assay labs or assign ECOG.
- Clinical PROMISE only (Psallidas 2018 Table 2A). Not biological PROMISE. No TIMP1 input.
- Not a pleurodesis success score and not a chemotherapy or radiotherapy order.
- CRP is mg/L (0-500), not IU/L. magent does not convert CRP units.
- 3-month mortality percents are published Table 2A group bands, not a prognosis assignment.
- The caller assigns chemotherapy, radiotherapy, ECOG 0-4, and cancer type (mesothelioma, lung, or other). magent does not convert Karnofsky or assign cancer type from histology text.

## Formula

```
clinical PROMISE = previous_chemotherapy (no 0, yes 4) + previous_radiotherapy (no 0, yes 2) + haemoglobin_g_dl (≥16 → 0; 14 to <16 → 1; 12 to <14 → 2; 10 to <12 → 3; <10 → 4) + wbc_10e9_l (<4 → 0; 4 to <6.3 → 2; 6.3 to <10 → 4; 10 to <15.8 → 7; ≥15.8 → 10) + crp_mg_l (<3 → 0; 3 to <10 → 3; 10 to <32 → 5; 32 to <100 → 8; ≥100 → 11) + ECOG (0–1 → 0; 2–4 → 7) + cancer_type (mesothelioma → 0; other → 4; lung → 5); Psallidas 2018 Table 2A; groups A 0–20 <25% 3-month mortality, B 21–27 25% to <50%, C 28–35 50% to <75%, D >35 ≥75%
```

## Citation

[Development and validation of response markers to predict survival and pleurodesis success in patients with malignant pleural effusion (PROMISE): a multicohort analysis](https://doi.org/10.1016/S1470-2045(18)30294-8)
Psallidas I, Kanellakis NI, Gerry S, et al.
Lancet Oncol. 2018;19(7):930-939
DOI: [10.1016/S1470-2045(18)30294-8](https://doi.org/10.1016/S1470-2045(18)30294-8)

## Worked example

### No chemo/RT, Hb 15, WBC 8, CRP 20, ECOG 0, other

Given: `cancer_type=other, chemotherapy=false, crp_mg_l=20, ecog=0, haemoglobin_g_dl=15.0, radiotherapy=false, wbc=8.0`

1. chemotherapy false → 0; radiotherapy false → 0
2. haemoglobin 15.0 (14 to <16) → 1
3. WBC 8.0 (6.3 to <10) → 4
4. CRP 20 mg/L (10 to <32) → 5
5. ECOG 0 → 0; cancer_type other → 4
6. score = 1+4+5+4 = 14 (max 43); group A (<25% 3-month mortality)


### Chemo+RT, Hb 9, WBC 16, CRP 120, ECOG 3, lung

Given: `cancer_type=lung, chemotherapy=true, crp_mg_l=120, ecog=3, haemoglobin_g_dl=9.0, radiotherapy=true, wbc=16.0`

1. chemotherapy true → 4; radiotherapy true → 2
2. haemoglobin 9.0 (<10) → 4; WBC 16.0 (≥15.8) → 10; CRP 120 (≥100) → 11
3. ECOG 3 (2-4) → 7; cancer_type lung → 5
4. score = 4+2+4+10+11+7+5 = 43 (max 43); group D (>=75% 3-month mortality)


## Also searched as

- PROMISE score
- clinical PROMISE
- malignant pleural effusion PROMISE
- Psallidas PROMISE
- MPE PROMISE score
- PROMISE 3-month mortality
- Table 2A PROMISE

## Parameters

- `chemotherapy` (boolean, required): Previous chemotherapy as assigned by the caller (Psallidas 2018 Table 2A). true or false. true scores 4; false scores 0. Not a chemotherapy order. magent does not read a treatment history.
- `radiotherapy` (boolean, required): Previous radiotherapy as assigned by the caller (Psallidas 2018 Table 2A). true or false. true scores 2; false scores 0. Not a radiotherapy order. magent does not read a treatment history.
- `haemoglobin_g_dl` (number, required): Haemoglobin in g/dL (3-25). Psallidas 2018 Table 2A: ≥16 scores 0; 14 to <16 scores 1; 12 to <14 scores 2; 10 to <12 scores 3; <10 scores 4. Caller-supplied; magent does not assay haemoglobin.
- `wbc` (number, required): Serum white cell count as 10^9/L (0.1-80). Psallidas 2018 Table 2A: <4 scores 0; 4 to <6.3 scores 2; 6.3 to <10 scores 4; 10 to <15.8 scores 7; ≥15.8 scores 10. Caller-supplied; magent does not assay WBC.
- `crp_mg_l` (number, required): Serum CRP in mg/L (0-500), not IU/L. Psallidas 2018 Table 2A: <3 scores 0; 3 to <10 scores 3; 10 to <32 scores 5; 32 to <100 scores 8; ≥100 scores 11. Caller-supplied; magent does not assay CRP or convert IU/L.
- `ecog` (integer, required): Oken 1982 ECOG performance status 0-4 as assigned by the caller. Psallidas 2018 Table 2A: 0-1 scores 0; 2-4 scores 7. Grade 5 (dead) is not scored. magent does not observe the patient or convert Karnofsky.
- `cancer_type` (string, required): Psallidas 2018 Table 2A cancer type as assigned by the caller. mesothelioma scores 0; other scores 4; lung scores 5. magent does not assign cancer type from histology text.

## 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/promise`
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": [
    {
      "cancer_type": "other",
      "chemotherapy": "false",
      "crp_mg_l": "20",
      "ecog": "0",
      "haemoglobin_g_dl": "15.0",
      "radiotherapy": "false",
      "wbc": "8.0"
    },
    {
      "cancer_type": "other",
      "chemotherapy": "false",
      "crp_mg_l": "20",
      "ecog": "0",
      "haemoglobin_g_dl": "15.0",
      "radiotherapy": "false",
      "wbc": "8.0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/promise",
  "items": [
    {
      "group": "A",
      "components": [
        {
          "value": false,
          "factor": "chemotherapy",
          "points": 0,
          "present": false
        },
        {
          "value": false,
          "factor": "radiotherapy",
          "points": 0,
          "present": false
        },
        {
          "value": 15.0,
          "factor": "haemoglobin",
          "points": 1,
          "present": true
        },
        {
          "value": 8.0,
          "factor": "wbc",
          "points": 4,
          "present": true
        },
        {
          "value": 20.0,
          "factor": "crp",
          "points": 5,
          "present": true
        },
        {
          "value": 0,
          "factor": "ecog",
          "points": 0,
          "present": false
        },
        {
          "value": "other",
          "factor": "cancer_type",
          "points": 4,
          "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": "Psallidas I, Kanellakis NI, Gerry S, et al.",
        "doi": "10.1016/S1470-2045(18)30294-8",
        "id": "psallidas-2018",
        "pmid": "29908990",
        "source": "Lancet Oncol. 2018;19(7):930-939",
        "title": "Development and validation of response markers to predict survival and pleurodesis success in patients with malignant pleural effusion (PROMISE): a multicohort analysis"
      },
      "formula": "promise",
      "formula_expression": "clinical PROMISE = previous_chemotherapy (no 0, yes 4) + previous_radiotherapy (no 0, yes 2) + haemoglobin_g_dl (≥16 → 0; 14 to <16 → 1; 12 to <14 → 2; 10 to <12 → 3; <10 → 4) + wbc_10e9_l (<4 → 0; 4 to <6.3 → 2; 6.3 to <10 → 4; 10 to <15.8 → 7; ≥15.8 → 10) + crp_mg_l (<3 → 0; 3 to <10 → 3; 10 to <32 → 5; 32 to <100 → 8; ≥100 → 11) + ECOG (0–1 → 0; 2–4 → 7) + cancer_type (mesothelioma → 0; other → 4; lung → 5); Psallidas 2018 Table 2A; groups A 0–20 <25% 3-month mortality, B 21–27 25% to <50%, C 28–35 50% to <75%, D >35 ≥75%",
      "max_score": 43,
      "score": 14,
      "crp_mg_l": 20.0,
      "ecog": 0,
      "cancer_type": "other",
      "chemotherapy": false,
      "haemoglobin_g_dl": 15.0,
      "radiotherapy": false,
      "three_month_mortality": "<25%",
      "wbc": 8.0
    },
    {
      "group": "A",
      "components": [
        {
          "value": false,
          "factor": "chemotherapy",
          "points": 0,
          "present": false
        },
        {
          "value": false,
          "factor": "radiotherapy",
          "points": 0,
          "present": false
        },
        {
          "value": 15.0,
          "factor": "haemoglobin",
          "points": 1,
          "present": true
        },
        {
          "value": 8.0,
          "factor": "wbc",
          "points": 4,
          "present": true
        },
        {
          "value": 20.0,
          "factor": "crp",
          "points": 5,
          "present": true
        },
        {
          "value": 0,
          "factor": "ecog",
          "points": 0,
          "present": false
        },
        {
          "value": "other",
          "factor": "cancer_type",
          "points": 4,
          "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": "Psallidas I, Kanellakis NI, Gerry S, et al.",
        "doi": "10.1016/S1470-2045(18)30294-8",
        "id": "psallidas-2018",
        "pmid": "29908990",
        "source": "Lancet Oncol. 2018;19(7):930-939",
        "title": "Development and validation of response markers to predict survival and pleurodesis success in patients with malignant pleural effusion (PROMISE): a multicohort analysis"
      },
      "formula": "promise",
      "formula_expression": "clinical PROMISE = previous_chemotherapy (no 0, yes 4) + previous_radiotherapy (no 0, yes 2) + haemoglobin_g_dl (≥16 → 0; 14 to <16 → 1; 12 to <14 → 2; 10 to <12 → 3; <10 → 4) + wbc_10e9_l (<4 → 0; 4 to <6.3 → 2; 6.3 to <10 → 4; 10 to <15.8 → 7; ≥15.8 → 10) + crp_mg_l (<3 → 0; 3 to <10 → 3; 10 to <32 → 5; 32 to <100 → 8; ≥100 → 11) + ECOG (0–1 → 0; 2–4 → 7) + cancer_type (mesothelioma → 0; other → 4; lung → 5); Psallidas 2018 Table 2A; groups A 0–20 <25% 3-month mortality, B 21–27 25% to <50%, C 28–35 50% to <75%, D >35 ≥75%",
      "max_score": 43,
      "score": 14,
      "crp_mg_l": 20.0,
      "ecog": 0,
      "cancer_type": "other",
      "chemotherapy": false,
      "haemoglobin_g_dl": 15.0,
      "radiotherapy": false,
      "three_month_mortality": "<25%",
      "wbc": 8.0
    }
  ]
}
```

## Response fields

- `formula` (string): promise
- `formula_expression` (string): Psallidas 2018 Table 2A clinical PROMISE rule
- `score` (integer): Clinical PROMISE points 0-43
- `max_score` (integer): 43
- `group` (string): A when score is 0-20, B when 21-27, C when 28-35, D when score is >35 (Psallidas 2018 Table 2A). Not a diagnosis or treatment order.
- `three_month_mortality` (string): Published Table 2A 3-month mortality band: <25% (A), 25% to <50% (B), 50% to <75% (C), >=75% (D). Paper group percents only, not a prognosis assignment.
- `chemotherapy` (boolean): Caller-assigned previous chemotherapy flag used
- `radiotherapy` (boolean): Caller-assigned previous radiotherapy flag used
- `haemoglobin_g_dl` (number): Haemoglobin used, g/dL
- `wbc` (number): Serum WBC used, 10^9/L
- `crp_mg_l` (number): Serum CRP used, mg/L
- `ecog` (integer): Caller-assigned Oken 1982 ECOG grade 0-4
- `cancer_type` (string): Canonical Table 2A cancer token used (mesothelioma, lung, or other)
- `components` (array): Per-factor Table 2A points
- `citation` (object): Psallidas 2018 Lancet Oncology citation
- `disclaimer` (string): Not a medical device

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "group": "A",
  "components": [
    {
      "value": false,
      "factor": "chemotherapy",
      "points": 0,
      "present": false
    },
    {
      "value": false,
      "factor": "radiotherapy",
      "points": 0,
      "present": false
    },
    {
      "value": 15.0,
      "factor": "haemoglobin",
      "points": 1,
      "present": true
    },
    {
      "value": 8.0,
      "factor": "wbc",
      "points": 4,
      "present": true
    },
    {
      "value": 20.0,
      "factor": "crp",
      "points": 5,
      "present": true
    },
    {
      "value": 0,
      "factor": "ecog",
      "points": 0,
      "present": false
    },
    {
      "value": "other",
      "factor": "cancer_type",
      "points": 4,
      "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": "Psallidas I, Kanellakis NI, Gerry S, et al.",
    "doi": "10.1016/S1470-2045(18)30294-8",
    "id": "psallidas-2018",
    "pmid": "29908990",
    "source": "Lancet Oncol. 2018;19(7):930-939",
    "title": "Development and validation of response markers to predict survival and pleurodesis success in patients with malignant pleural effusion (PROMISE): a multicohort analysis"
  },
  "formula": "promise",
  "formula_expression": "clinical PROMISE = previous_chemotherapy (no 0, yes 4) + previous_radiotherapy (no 0, yes 2) + haemoglobin_g_dl (≥16 → 0; 14 to <16 → 1; 12 to <14 → 2; 10 to <12 → 3; <10 → 4) + wbc_10e9_l (<4 → 0; 4 to <6.3 → 2; 6.3 to <10 → 4; 10 to <15.8 → 7; ≥15.8 → 10) + crp_mg_l (<3 → 0; 3 to <10 → 3; 10 to <32 → 5; 32 to <100 → 8; ≥100 → 11) + ECOG (0–1 → 0; 2–4 → 7) + cancer_type (mesothelioma → 0; other → 4; lung → 5); Psallidas 2018 Table 2A; groups A 0–20 <25% 3-month mortality, B 21–27 25% to <50%, C 28–35 50% to <75%, D >35 ≥75%",
  "max_score": 43,
  "score": 14,
  "crp_mg_l": 20.0,
  "ecog": 0,
  "cancer_type": "other",
  "chemotherapy": false,
  "haemoglobin_g_dl": 15.0,
  "radiotherapy": false,
  "three_month_mortality": "<25%",
  "wbc": 8.0
}
```

## Errors

- HTTP 400 `invalid_promise`: Clinical PROMISE needs Psallidas 2018 chemotherapy, radiotherapy, haemoglobin, WBC, CRP, ECOG, and cancer type 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

- [LENT](https://magentlab.com/docs/lent) — Sum the Clive 2014 Table 3 LENT score (pleural fluid LDH, ECOG, serum NLR, tumour type) and return low (0-1), moderate (2-4), or high (5-7).
- [Light's criteria](https://magentlab.com/docs/lights) — Apply Light 1972 pleural fluid criteria from protein ratio, LDH ratio, and pleural LDH versus two-thirds the laboratory LDH upper limit of normal.

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