# DELTA-P LEMS tumor association

DELTA-P

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

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

## What it computes

Sum the six Titulaer 2011 DELTA-P items (bulbar weakness, erectile dysfunction in males, weight loss ≥5%, smoking at onset, age ≥50, Karnofsky <70) and return the score, SCLC band, and published SCLC percents for scores 0, 1, and 3-6.

## When to use

When an agent has caller-assigned DELTA-P items at or within 3 months of LEMS onset and needs the published Titulaer 2011 total and SCLC band, without inventing a LEMS diagnosis, SOX1 result, or SCLC screen.

## When not to use

- Not a medical device. magent does not diagnose LEMS or small-cell lung cancer.
- Not a LEMS diagnosis and not SOX1 antibody testing.
- magent does not screen for SCLC and does not order CT, PET, or bronchoscopy.
- Items are scored at or within 3 months of LEMS onset as assigned by the caller.
- Female erectile_dysfunction is always 0 (Titulaer 2011 Female | 0), including if omitted or true. The flag is required only when sex is male.
- Age 50 scores 1; 49 does not. kps_lt_70 is a caller flag for Karnofsky 0-60; magent does not compute Karnofsky.
- Published SCLC percents are returned for scores 0, 1, 3, 4, 5, and 6 (0%, 2.6%, 83.9%, 93.5%, 96.6%, 100%). Score 2 (intermediate) has no published percent in the Titulaer 2011 main text; magent does not invent one.

## Formula

```
DELTA-P = bulbar_weakness 1 + (male and erectile_dysfunction) 1 + weight_loss_ge_5pct 1 + smoking_at_onset 1 + (age>=50) 1 + kps_lt_70 1; each at or within 3 months of LEMS onset; female erectile always 0; max 6; bands 0-1 low / 2 intermediate / 3-6 high (Titulaer 2011); SCLC percents 0/2.6/omit/83.9/93.5/96.6/100 for scores 0-6
```

## Citation

[Clinical Dutch-English Lambert-Eaton Myasthenic Syndrome (LEMS) Tumor Association Prediction Score Accurately Predicts Small-Cell Lung Cancer in the LEMS](https://doi.org/10.1200/JCO.2010.32.0440)
Titulaer MJ, Maddison P, Sont JK, Wirtz PW, Hilton-Jones D, Klooster R, Willcox N, Potman M, Sillevis Smitt PAE, Kuks JBM, Roep BO, Vincent A, van der Maarel SM, van Dijk JG, Lang B, Verschuuren JJGM
J Clin Oncol. 2011;29(7):902-908
DOI: [10.1200/JCO.2010.32.0440](https://doi.org/10.1200/JCO.2010.32.0440)

## Worked example

### Female, age 40, no DELTA-P items

Given: `age=40, bulbar_weakness=false, kps_lt_70=false, sex=female, smoking_at_onset=false, weight_loss_ge_5pct=false`

1. Female erectile 0; bulbar 0; weight loss 0; smoking 0; age 40 is not ≥50 → 0; kps_lt_70 0
2. Score = 0 (max 6); sclc_band low; sclc_percent 0


### Female age 50, bulbar weakness, and smoking (score 3)

Given: `age=50, bulbar_weakness=true, kps_lt_70=false, sex=female, smoking_at_onset=true, weight_loss_ge_5pct=false`

1. Bulbar → 1; female erectile 0; weight loss 0; smoking → 1; age 50 ≥50 → 1; kps_lt_70 0
2. Score = 3 (max 6); sclc_band high; sclc_percent 83.9


## Also searched as

- DELTA-P
- DELTA-P score
- LEMS tumor association
- Titulaer DELTA-P
- Dutch-English LEMS
- Lambert-Eaton SCLC
- DELTA-P LEMS

## Parameters

- `sex` (string, required): female or male. Erectile dysfunction scores only when male. Female erectile is always 0 (Titulaer 2011: Female | 0).
- `age` (integer, required): Age at LEMS onset in years (18-120). ≥50 scores 1; 49 does not (Titulaer 2011).
- `bulbar_weakness` (boolean, required): Dysarthria, dysphagia, chewing difficulty, or neck weakness at or within 3 months of LEMS onset (Titulaer 2011 D). true or false. Caller-assigned. 1 point if true.
- `erectile_dysfunction` (boolean, optional): Erectile dysfunction at or within 3 months of LEMS onset (Titulaer 2011 E). Required when sex is male (true scores 1). When female, this item is always 0, including if omitted, false, or true. true or false.
- `weight_loss_ge_5pct` (boolean, required): Weight loss ≥5% at or within 3 months of LEMS onset (Titulaer 2011 L). true or false. Caller-assigned. 1 point if true.
- `smoking_at_onset` (boolean, required): Smoking at LEMS onset (Titulaer 2011 T). true or false. Caller-assigned. 1 point if true.
- `kps_lt_70` (boolean, required): Karnofsky Performance Status 0-60 (KPS <70) at or within 3 months of LEMS onset (Titulaer 2011 P). Caller-assigned flag; magent does not compute Karnofsky. true or false. 1 point if true.

## 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/delta_p`
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": [
    {
      "age": "40",
      "bulbar_weakness": "false",
      "kps_lt_70": "false",
      "sex": "female",
      "smoking_at_onset": "false",
      "weight_loss_ge_5pct": "false"
    },
    {
      "age": "40",
      "bulbar_weakness": "false",
      "kps_lt_70": "false",
      "sex": "female",
      "smoking_at_onset": "false",
      "weight_loss_ge_5pct": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/delta_p",
  "items": [
    {
      "components": [
        {
          "factor": "bulbar_weakness",
          "points": 0,
          "present": false
        },
        {
          "factor": "erectile_dysfunction",
          "points": 0,
          "present": false
        },
        {
          "factor": "weight_loss_ge_5pct",
          "points": 0,
          "present": false
        },
        {
          "factor": "smoking_at_onset",
          "points": 0,
          "present": false
        },
        {
          "value": 40,
          "factor": "age_ge_50",
          "points": 0,
          "present": false
        },
        {
          "factor": "kps_lt_70",
          "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": "Titulaer MJ, Maddison P, Sont JK, Wirtz PW, Hilton-Jones D, Klooster R, Willcox N, Potman M, Sillevis Smitt PAE, Kuks JBM, Roep BO, Vincent A, van der Maarel SM, van Dijk JG, Lang B, Verschuuren JJGM",
        "doi": "10.1200/JCO.2010.32.0440",
        "id": "titulaer-2011",
        "pmid": "21245427",
        "source": "J Clin Oncol. 2011;29(7):902-908",
        "title": "Clinical Dutch-English Lambert-Eaton Myasthenic Syndrome (LEMS) Tumor Association Prediction Score Accurately Predicts Small-Cell Lung Cancer in the LEMS"
      },
      "formula": "delta_p",
      "formula_expression": "DELTA-P = bulbar_weakness 1 + (male and erectile_dysfunction) 1 + weight_loss_ge_5pct 1 + smoking_at_onset 1 + (age>=50) 1 + kps_lt_70 1; each at or within 3 months of LEMS onset; female erectile always 0; max 6; bands 0-1 low / 2 intermediate / 3-6 high (Titulaer 2011); SCLC percents 0/2.6/omit/83.9/93.5/96.6/100 for scores 0-6",
      "age_years": 40,
      "max_score": 6,
      "score": 0,
      "sex": "female",
      "sclc_band": "low",
      "sclc_percent": 0.0
    },
    {
      "components": [
        {
          "factor": "bulbar_weakness",
          "points": 0,
          "present": false
        },
        {
          "factor": "erectile_dysfunction",
          "points": 0,
          "present": false
        },
        {
          "factor": "weight_loss_ge_5pct",
          "points": 0,
          "present": false
        },
        {
          "factor": "smoking_at_onset",
          "points": 0,
          "present": false
        },
        {
          "value": 40,
          "factor": "age_ge_50",
          "points": 0,
          "present": false
        },
        {
          "factor": "kps_lt_70",
          "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": "Titulaer MJ, Maddison P, Sont JK, Wirtz PW, Hilton-Jones D, Klooster R, Willcox N, Potman M, Sillevis Smitt PAE, Kuks JBM, Roep BO, Vincent A, van der Maarel SM, van Dijk JG, Lang B, Verschuuren JJGM",
        "doi": "10.1200/JCO.2010.32.0440",
        "id": "titulaer-2011",
        "pmid": "21245427",
        "source": "J Clin Oncol. 2011;29(7):902-908",
        "title": "Clinical Dutch-English Lambert-Eaton Myasthenic Syndrome (LEMS) Tumor Association Prediction Score Accurately Predicts Small-Cell Lung Cancer in the LEMS"
      },
      "formula": "delta_p",
      "formula_expression": "DELTA-P = bulbar_weakness 1 + (male and erectile_dysfunction) 1 + weight_loss_ge_5pct 1 + smoking_at_onset 1 + (age>=50) 1 + kps_lt_70 1; each at or within 3 months of LEMS onset; female erectile always 0; max 6; bands 0-1 low / 2 intermediate / 3-6 high (Titulaer 2011); SCLC percents 0/2.6/omit/83.9/93.5/96.6/100 for scores 0-6",
      "age_years": 40,
      "max_score": 6,
      "score": 0,
      "sex": "female",
      "sclc_band": "low",
      "sclc_percent": 0.0
    }
  ]
}
```

## Response fields

- `formula` (string): delta_p
- `formula_expression` (string): Exact expression used
- `score` (integer): DELTA-P points 0-6
- `max_score` (integer): 6
- `sclc_band` (string): Titulaer 2011 SCLC-association band: low (0-1), intermediate (2), or high (3-6). Not an SCLC screen.
- `sclc_percent` (number): Titulaer 2011 published SCLC percent for scores 0, 1, 3, 4, 5, and 6 (0, 2.6, 83.9, 93.5, 96.6, 100). Omitted for score 2; no published percent in the main text.
- `sex` (string): female or male
- `age_years` (integer): Age used for the ≥50 criterion
- `components` (array): Per-item Titulaer 2011 points
- `citation` (object): Titulaer 2011 J Clin Oncol citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "bulbar_weakness",
      "points": 0,
      "present": false
    },
    {
      "factor": "erectile_dysfunction",
      "points": 0,
      "present": false
    },
    {
      "factor": "weight_loss_ge_5pct",
      "points": 0,
      "present": false
    },
    {
      "factor": "smoking_at_onset",
      "points": 0,
      "present": false
    },
    {
      "value": 40,
      "factor": "age_ge_50",
      "points": 0,
      "present": false
    },
    {
      "factor": "kps_lt_70",
      "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": "Titulaer MJ, Maddison P, Sont JK, Wirtz PW, Hilton-Jones D, Klooster R, Willcox N, Potman M, Sillevis Smitt PAE, Kuks JBM, Roep BO, Vincent A, van der Maarel SM, van Dijk JG, Lang B, Verschuuren JJGM",
    "doi": "10.1200/JCO.2010.32.0440",
    "id": "titulaer-2011",
    "pmid": "21245427",
    "source": "J Clin Oncol. 2011;29(7):902-908",
    "title": "Clinical Dutch-English Lambert-Eaton Myasthenic Syndrome (LEMS) Tumor Association Prediction Score Accurately Predicts Small-Cell Lung Cancer in the LEMS"
  },
  "formula": "delta_p",
  "formula_expression": "DELTA-P = bulbar_weakness 1 + (male and erectile_dysfunction) 1 + weight_loss_ge_5pct 1 + smoking_at_onset 1 + (age>=50) 1 + kps_lt_70 1; each at or within 3 months of LEMS onset; female erectile always 0; max 6; bands 0-1 low / 2 intermediate / 3-6 high (Titulaer 2011); SCLC percents 0/2.6/omit/83.9/93.5/96.6/100 for scores 0-6",
  "age_years": 40,
  "max_score": 6,
  "score": 0,
  "sex": "female",
  "sclc_band": "low",
  "sclc_percent": 0.0
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_sex`: sex must be female or male 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

- [Karnofsky](https://magentlab.com/docs/karnofsky) — Return the Karnofsky 1949 Performance Status 10-100 from a caller-assigned integer, with a stable label.

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