# RESECT-90 lung-resection mortality

RESECT-90

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

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

## What it computes

Compute the Taylor 2021 RESECT-90 logistic estimated 90-day mortality after lung resection from the twelve published preoperative variables in Table 3.

## When to use

When an agent needs the published RESECT-90 90-day mortality percent and must not invent a mortality band, assign ECOG, read spirometry, substitute race for sex, or issue an operative go/no-go.

## When not to use

- Not a medical device. Not a diagnosis and not an operative go/no-go.
- Taylor 2021 Table 3 multivariable logistic RESECT-90 only. This is not EuroSCORE II and not Gupta PRF.
- Taylor 2021 does not publish a low or high mortality cutoff; magent does not invent one.
- Sex is a published coefficient. This model does not use race.
- ecog, anemia, arrhythmia, laterality, surgical_approach, diagnosis, and resected_segments are caller-assigned. magent does not assign ECOG, read spirometry or DLCO, assay creatinine, or classify an incision.
- Creatinine is umol/L as published. magent does not convert from mg/dL.

## Formula

```
L = -6.036 + 0.041*age + 0.493*male + 0.183*ecog - 0.029*dlco_percent - 0.056*bmi + 0.005*creatinine_umol_l + 0.242*anemia + 0.608*arrhythmia + 0.379*right + 0.179*resected_segments + 0.634*thoracotomy + 0.769*malignant (Taylor 2021 Table 3 / PMC8632783); estimated_mortality_percent = 100 / (1 + exp(-L)) from the unrounded logit, 2 decimals
```

## Citation

[Development and internal validation of a clinical prediction model for 90-day mortality after lung resection: the RESECT-90 score](https://doi.org/10.1093/icvts/ivab200)
Taylor M, Martin GP, Abah U, Sperrin M, Smith MO, Bhullar D, Shackcloth M, Woolley S, West D, Shah R, Grant SW; North West Thoracic Surgery Collaborative (NWTSC)
Interact Cardiovasc Thorac Surg. 2021;33(6):921-927
DOI: [10.1093/icvts/ivab200](https://doi.org/10.1093/icvts/ivab200)

## Worked example

### Age 65 male ECOG 0, Table 1-typical continuous values, binary references

Given: `age=65, anemia=false, arrhythmia=false, bmi=27, creatinine_umol_l=74, diagnosis=benign, dlco_percent=73, ecog=0, laterality=left, resected_segments=3, sex=male, surgical_approach=vats`

1. L = -6.036 + 65×0.041 + 0.493 (male) + 0×0.183 − 73×0.029 − 27×0.056 + 74×0.005 + 0 + 0 + 0 + 3×0.179 + 0 + 0
2. L = -6.036 + 2.665 + 0.493 − 2.117 − 1.512 + 0.370 + 0.537 = -5.600
3. estimated_mortality_percent = 100 / (1 + exp(5.600)) from the unrounded logit


### Same row, female (sex path; female is the Table 3 reference)

Given: `age=65, anemia=false, arrhythmia=false, bmi=27, creatinine_umol_l=74, diagnosis=benign, dlco_percent=73, ecog=0, laterality=left, resected_segments=3, sex=female, surgical_approach=vats`

1. male term 0 instead of +0.493
2. estimated_mortality_percent from the unrounded logit


### Same row, ECOG 2 (performance-status path)

Given: `age=65, anemia=false, arrhythmia=false, bmi=27, creatinine_umol_l=74, diagnosis=benign, dlco_percent=73, ecog=2, laterality=left, resected_segments=3, sex=male, surgical_approach=vats`

1. ECOG 2 adds 2×0.183 = 0.366
2. estimated_mortality_percent from the unrounded logit


### Same row, thoracotomy (surgical-approach path)

Given: `age=65, anemia=false, arrhythmia=false, bmi=27, creatinine_umol_l=74, diagnosis=benign, dlco_percent=73, ecog=0, laterality=left, resected_segments=3, sex=male, surgical_approach=thoracotomy`

1. thoracotomy adds 0.634 (vats is the Table 3 reference)
2. estimated_mortality_percent from the unrounded logit


### Same row, age 80 (age path; no published cutoff)

Given: `age=80, anemia=false, arrhythmia=false, bmi=27, creatinine_umol_l=74, diagnosis=benign, dlco_percent=73, ecog=0, laterality=left, resected_segments=3, sex=male, surgical_approach=vats`

1. age 80 vs 65 adds 15×0.041 = 0.615
2. estimated_mortality_percent from the unrounded logit


## Also searched as

- RESECT-90
- 90-day mortality after lung resection
- Taylor 2021 lung resection
- lung resection mortality score
- DLCO lung resection mortality
- ECOG lung resection
- thoracotomy 90-day mortality
- resected bronchopulmonary segments

## Parameters

- `age` (integer, required): Age in years (18-120). Taylor 2021 Table 3 coefficient 0.041 per year. magent does not read a chart.
- `sex` (string, required): Sex as assigned by the caller. female is the reference (0). male adds 0.493 (Taylor 2021 Table 3). This is a published sex coefficient, not race.
- `ecog` (integer, required): ECOG / WHO performance status 0-4 as assigned by the caller (Taylor 2021 Table 3 coefficient 0.183 per point). magent does not assign ECOG.
- `dlco_percent` (number, required): Percent predicted DLCO (10-200). Taylor 2021 Table 3 subtracts 0.029 per percent. magent does not read spirometry or a gas-transfer tracing.
- `bmi` (number, required): Body-mass index in kg/m2 (10-80). Taylor 2021 Table 3 subtracts 0.056 per kg/m2. magent does not weigh the patient.
- `creatinine_umol_l` (number, required): Serum creatinine in µmol/L as published (20-2000). Taylor 2021 Table 3 coefficient 0.005 per µmol/L. Not mg/dL.
- `anemia` (boolean, required): Taylor 2021 WHO anaemia as assigned by the caller: haemoglobin <120 g/L for women or <130 g/L for men (+0.242). true or false. magent does not read a haemoglobin.
- `arrhythmia` (boolean, required): Preoperative arrhythmia as assigned by the caller (Taylor 2021 Table 3 +0.608). true or false. magent does not read an ECG.
- `laterality` (string, required): Resection laterality as assigned by the caller. left is the reference (0). right adds 0.379 (Taylor 2021 Table 3). magent does not read an operative note.
- `surgical_approach` (string, required): Approach as assigned by the caller. vats is the non-thoracotomy reference (0). thoracotomy adds 0.634 (Taylor 2021 Table 3). magent does not classify the incision.
- `diagnosis` (string, required): Diagnosis as assigned by the caller. benign is the reference (0). malignant (confirmed or suspected) adds 0.769 (Taylor 2021 Table 3).
- `resected_segments` (integer, required): Number of resected bronchopulmonary segments (0-19). Taylor 2021 Table 3 coefficient 0.179 per segment. magent does not map a procedure to segments.

## 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/resect_90`
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": "65",
      "anemia": "false",
      "arrhythmia": "false",
      "bmi": "27",
      "creatinine_umol_l": "74",
      "diagnosis": "benign",
      "dlco_percent": "73",
      "ecog": "0",
      "laterality": "left",
      "resected_segments": "3",
      "sex": "male",
      "surgical_approach": "vats"
    },
    {
      "age": "65",
      "anemia": "false",
      "arrhythmia": "false",
      "bmi": "27",
      "creatinine_umol_l": "74",
      "diagnosis": "benign",
      "dlco_percent": "73",
      "ecog": "0",
      "laterality": "left",
      "resected_segments": "3",
      "sex": "male",
      "surgical_approach": "vats"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/resect_90",
  "items": [
    {
      "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": "Taylor M, Martin GP, Abah U, Sperrin M, Smith MO, Bhullar D, Shackcloth M, Woolley S, West D, Shah R, Grant SW; North West Thoracic Surgery Collaborative (NWTSC)",
        "doi": "10.1093/icvts/ivab200",
        "id": "taylor-2021",
        "pmid": "34293121",
        "source": "Interact Cardiovasc Thorac Surg. 2021;33(6):921-927",
        "title": "Development and internal validation of a clinical prediction model for 90-day mortality after lung resection: the RESECT-90 score"
      },
      "formula": "resect_90",
      "formula_expression": "L = -6.036 + 0.041*age + 0.493*male + 0.183*ecog - 0.029*dlco_percent - 0.056*bmi + 0.005*creatinine_umol_l + 0.242*anemia + 0.608*arrhythmia + 0.379*right + 0.179*resected_segments + 0.634*thoracotomy + 0.769*malignant (Taylor 2021 Table 3 / PMC8632783); estimated_mortality_percent = 100 / (1 + exp(-L)) from the unrounded logit, 2 decimals",
      "age_years": 65,
      "sex": "male",
      "logit": -5.6,
      "anemia": false,
      "creatinine_umol_l": 74.0,
      "bmi": 27.0,
      "diagnosis": "benign",
      "ecog": 0,
      "estimated_mortality_percent": 0.37,
      "arrhythmia": false,
      "dlco_percent": 73.0,
      "laterality": "left",
      "resected_segments": 3,
      "surgical_approach": "vats"
    },
    {
      "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": "Taylor M, Martin GP, Abah U, Sperrin M, Smith MO, Bhullar D, Shackcloth M, Woolley S, West D, Shah R, Grant SW; North West Thoracic Surgery Collaborative (NWTSC)",
        "doi": "10.1093/icvts/ivab200",
        "id": "taylor-2021",
        "pmid": "34293121",
        "source": "Interact Cardiovasc Thorac Surg. 2021;33(6):921-927",
        "title": "Development and internal validation of a clinical prediction model for 90-day mortality after lung resection: the RESECT-90 score"
      },
      "formula": "resect_90",
      "formula_expression": "L = -6.036 + 0.041*age + 0.493*male + 0.183*ecog - 0.029*dlco_percent - 0.056*bmi + 0.005*creatinine_umol_l + 0.242*anemia + 0.608*arrhythmia + 0.379*right + 0.179*resected_segments + 0.634*thoracotomy + 0.769*malignant (Taylor 2021 Table 3 / PMC8632783); estimated_mortality_percent = 100 / (1 + exp(-L)) from the unrounded logit, 2 decimals",
      "age_years": 65,
      "sex": "male",
      "logit": -5.6,
      "anemia": false,
      "creatinine_umol_l": 74.0,
      "bmi": 27.0,
      "diagnosis": "benign",
      "ecog": 0,
      "estimated_mortality_percent": 0.37,
      "arrhythmia": false,
      "dlco_percent": 73.0,
      "laterality": "left",
      "resected_segments": 3,
      "surgical_approach": "vats"
    }
  ]
}
```

## Response fields

- `formula` (string): resect_90
- `formula_expression` (string): Taylor 2021 Table 3 logistic expression
- `age_years` (integer): Age in years
- `sex` (string): male or female
- `ecog` (integer): Caller-assigned ECOG 0-4
- `dlco_percent` (number): Percent predicted DLCO
- `bmi` (number): BMI in kg/m2
- `creatinine_umol_l` (number): Creatinine in µmol/L as published
- `anemia` (boolean): true if WHO anaemia is present
- `arrhythmia` (boolean): true if preoperative arrhythmia
- `laterality` (string): left or right
- `surgical_approach` (string): vats or thoracotomy
- `diagnosis` (string): benign or malignant
- `resected_segments` (integer): Number of resected bronchopulmonary segments
- `logit` (number): Taylor 2021 Table 3 linear predictor L, 4 decimal places
- `estimated_mortality_percent` (number): 100 / (1 + exp(-L)) from the unrounded logit, 2 decimal places. Estimated 90-day mortality percent, not an operative go/no-go.
- `citation` (object): Taylor et al. ICVTS 2021 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Taylor M, Martin GP, Abah U, Sperrin M, Smith MO, Bhullar D, Shackcloth M, Woolley S, West D, Shah R, Grant SW; North West Thoracic Surgery Collaborative (NWTSC)",
    "doi": "10.1093/icvts/ivab200",
    "id": "taylor-2021",
    "pmid": "34293121",
    "source": "Interact Cardiovasc Thorac Surg. 2021;33(6):921-927",
    "title": "Development and internal validation of a clinical prediction model for 90-day mortality after lung resection: the RESECT-90 score"
  },
  "formula": "resect_90",
  "formula_expression": "L = -6.036 + 0.041*age + 0.493*male + 0.183*ecog - 0.029*dlco_percent - 0.056*bmi + 0.005*creatinine_umol_l + 0.242*anemia + 0.608*arrhythmia + 0.379*right + 0.179*resected_segments + 0.634*thoracotomy + 0.769*malignant (Taylor 2021 Table 3 / PMC8632783); estimated_mortality_percent = 100 / (1 + exp(-L)) from the unrounded logit, 2 decimals",
  "age_years": 65,
  "sex": "male",
  "logit": -5.6,
  "anemia": false,
  "creatinine_umol_l": 74.0,
  "bmi": 27.0,
  "diagnosis": "benign",
  "ecog": 0,
  "estimated_mortality_percent": 0.37,
  "arrhythmia": false,
  "dlco_percent": 73.0,
  "laterality": "left",
  "resected_segments": 3,
  "surgical_approach": "vats"
}
```

## Errors

- HTTP 400 `invalid_resect_90`: RESECT-90 needs Taylor 2021 lung-resection predictors 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

- [Gupta PRF](https://magentlab.com/docs/gupta-prf) — Compute the Gupta 2011 Chest logistic probability of postoperative respiratory failure (mechanical ventilation >48 h after surgery or unplanned intubation within 30 days) from ASA class, functional status, preoperative sepsis, emergency case, and surgery type.
- [EuroSCORE II](https://magentlab.com/docs/euroscore-ii) — Compute the Nashef 2012 Table 6 logistic estimated in-hospital mortality after adult cardiac surgery from the published multivariable coefficients.

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