# Preoperative mortality predictor (PMP)

PMP

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

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

## What it computes

Sum the Ghanem 2012 Table 5 bedside preoperative mortality predictor and return the −1 to 30 total plus the printed Figure 3 0–5 and 20–30 interval facts.

## When to use

When an agent needs the published Table 5 PMP point total and must not invent a go/no-go for surgery, race points, or the Table 4 open-pancreas odds ratio.

## When not to use

- Not a medical device. Not a go/no-go for surgery, cancellation, or operative clearance.
- magent does not assign functional status. poor_functional_status is the caller-assigned NSQIP totally-dependent flag (total assistance for all daily activities).
- Table 5 bedside scoresheet only. No Table 4 open-pancreas odds ratio, no race parameter, no laboratory values, and no ASA class.
- Age 65–69 is 0.5 as printed on Table 5, not the Discussion 1 / 1.5 / 2.5 wording.
- Figure 3 reports <1% died in 0–5 and 73% died in 20–30. magent does not invent other risk labels. Those percents are cohort interval facts, not an individual probability.

## Formula

```
PMP = inpatient 6 + sepsis 4 + poor_functional_status 3 + disseminated_cancer 1 + age (>=80 -> 2; 70-79 -> 1; 65-69 -> 0.5; <65 -> 0) + cardiac_comorbidity 5 + pulmonary_comorbidity 3 + renal_comorbidity 1 + liver_comorbidity 1 + steroid_chronic 1 + weight_loss_gt_10_percent 1 + bleeding_disorder 1 + dnr 1 + obesity -1; Ghanem 2012 Table 5 bedside scoresheet; published range -1 through 30; Figure 3 <1% died in 0-5 and 73% died in 20-30; pmp_ge_20 is the 20-30 interval isolate
```

## Citation

[Predicting Risk of Death in General Surgery Patients on the Basis of Preoperative Variables Using American College of Surgeons National Surgical Quality Improvement Program Data](https://doi.org/10.7812/TPP/12-019)
Vaid S, Bell T, Grim R, Ahuja V
Perm J. 2012;16(4):10-16
DOI: [10.7812/TPP/12-019](https://doi.org/10.7812/TPP/12-019)

## Worked example

### Age 50, obesity only (score −1)

Given: `age=50, bleeding_disorder=false, cardiac_comorbidity=false, disseminated_cancer=false, dnr=false, inpatient=false, liver_comorbidity=false, obesity=true, poor_functional_status=false, pulmonary_comorbidity=false, renal_comorbidity=false, sepsis=false, steroid_chronic=false, weight_loss_gt_10_percent=false`

1. Age 50 (<65) → 0; obesity → −1; all other Table 5 flags false
2. Score = −1; pmp_ge_20 false. Not a go/no-go for surgery.


### Inpatient, sepsis, age 82 (score 12)

Given: `age=82, bleeding_disorder=false, cardiac_comorbidity=false, disseminated_cancer=false, dnr=false, inpatient=true, liver_comorbidity=false, obesity=false, poor_functional_status=false, pulmonary_comorbidity=false, renal_comorbidity=false, sepsis=true, steroid_chronic=false, weight_loss_gt_10_percent=false`

1. Inpatient → 6; sepsis → 4; age ≥80 → 2
2. Score = 6+4+2 = 12; pmp_ge_20 false. Not a go/no-go for surgery.


## Also searched as

- preoperative mortality predictor
- PMP score
- bedside surgical mortality
- NSQIP preoperative mortality
- Vaid PMP
- Ghanem 2012 PMP

## Parameters

- `age` (integer, required): Age in years (18-120). Ghanem 2012 Table 5: ≥80 → 2; 70–79 → 1; 65–69 → 0.5; <65 → 0. Age 65 and 69 score 0.5; 70 and 79 score 1; 80 scores 2. Table 5 only (not the Discussion 1 / 1.5 / 2.5 wording).
- `inpatient` (boolean, required): Inpatient status (Ghanem 2012 Table 5). true scores 6. Caller-assigned; magent does not classify admission status.
- `sepsis` (boolean, required): Preoperative sepsis as assigned by the caller (Ghanem 2012 Table 5). true scores 4. magent does not diagnose sepsis.
- `poor_functional_status` (boolean, required): Poor functional status: total assistance required for all daily activities (Ghanem 2012 Table 5 / NSQIP totally dependent). true scores 3. magent does not assign functional status.
- `disseminated_cancer` (boolean, required): Disseminated cancer as assigned by the caller (Ghanem 2012 Table 5). true scores 1. magent does not diagnose cancer.
- `cardiac_comorbidity` (boolean, required): Cardiac comorbidity as assigned by the caller (Ghanem 2012: dyspnea, heart failure, myocardial infarction, angina, peripheral artery disease, or hypertension requiring medication). true scores 5. magent does not diagnose cardiac disease.
- `pulmonary_comorbidity` (boolean, required): Pulmonary comorbidity as assigned by the caller (Ghanem 2012: ventilator, COPD, or current pneumonia). true scores 3. magent does not diagnose lung disease.
- `renal_comorbidity` (boolean, required): Renal comorbidity as assigned by the caller (Ghanem 2012: dialysis or renal failure). true scores 1. magent does not grade kidney disease.
- `liver_comorbidity` (boolean, required): Liver comorbidity as assigned by the caller (Ghanem 2012: ascites or esophageal varices). true scores 1. magent does not grade liver disease.
- `steroid_chronic` (boolean, required): Steroid for a chronic condition (Ghanem 2012 Table 5). true scores 1. magent does not read a medication list.
- `weight_loss_gt_10_percent` (boolean, required): Loss of >10% body weight in the last 6 months (Ghanem 2012 Table 5). true scores 1. magent does not compute weight change.
- `bleeding_disorder` (boolean, required): Bleeding disorder as assigned by the caller (Ghanem 2012 Table 5). true scores 1. magent does not diagnose coagulopathy.
- `dnr` (boolean, required): Do-not-resuscitate directive (Ghanem 2012 Table 5). true scores 1. magent does not read code-status orders.
- `obesity` (boolean, required): Obesity as assigned by the caller (Ghanem 2012 Table 5). true scores −1. magent does not compute BMI.

## 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/pmp`
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": "50",
      "bleeding_disorder": "false",
      "cardiac_comorbidity": "false",
      "disseminated_cancer": "false",
      "dnr": "false",
      "inpatient": "false",
      "liver_comorbidity": "false",
      "obesity": "true",
      "poor_functional_status": "false",
      "pulmonary_comorbidity": "false",
      "renal_comorbidity": "false",
      "sepsis": "false",
      "steroid_chronic": "false",
      "weight_loss_gt_10_percent": "false"
    },
    {
      "age": "50",
      "bleeding_disorder": "false",
      "cardiac_comorbidity": "false",
      "disseminated_cancer": "false",
      "dnr": "false",
      "inpatient": "false",
      "liver_comorbidity": "false",
      "obesity": "true",
      "poor_functional_status": "false",
      "pulmonary_comorbidity": "false",
      "renal_comorbidity": "false",
      "sepsis": "false",
      "steroid_chronic": "false",
      "weight_loss_gt_10_percent": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/pmp",
  "items": [
    {
      "components": [
        {
          "factor": "inpatient",
          "points": 0,
          "present": false
        },
        {
          "factor": "sepsis",
          "points": 0,
          "present": false
        },
        {
          "factor": "poor_functional_status",
          "points": 0,
          "present": false
        },
        {
          "factor": "disseminated_cancer",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "cardiac_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "pulmonary_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "renal_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "liver_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "steroid_chronic",
          "points": 0,
          "present": false
        },
        {
          "factor": "weight_loss_gt_10_percent",
          "points": 0,
          "present": false
        },
        {
          "factor": "bleeding_disorder",
          "points": 0,
          "present": false
        },
        {
          "factor": "dnr",
          "points": 0,
          "present": false
        },
        {
          "factor": "obesity",
          "points": -1,
          "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.",
      "age_years": 50,
      "citation": {
        "authors": "Vaid S, Bell T, Grim R, Ahuja V",
        "doi": "10.7812/TPP/12-019",
        "id": "ghanem-2012",
        "pmid": "23251111",
        "source": "Perm J. 2012;16(4):10-16",
        "title": "Predicting Risk of Death in General Surgery Patients on the Basis of Preoperative Variables Using American College of Surgeons National Surgical Quality Improvement Program Data"
      },
      "formula": "pmp",
      "formula_expression": "PMP = inpatient 6 + sepsis 4 + poor_functional_status 3 + disseminated_cancer 1 + age (>=80 -> 2; 70-79 -> 1; 65-69 -> 0.5; <65 -> 0) + cardiac_comorbidity 5 + pulmonary_comorbidity 3 + renal_comorbidity 1 + liver_comorbidity 1 + steroid_chronic 1 + weight_loss_gt_10_percent 1 + bleeding_disorder 1 + dnr 1 + obesity -1; Ghanem 2012 Table 5 bedside scoresheet; published range -1 through 30; Figure 3 <1% died in 0-5 and 73% died in 20-30; pmp_ge_20 is the 20-30 interval isolate",
      "max_score": 30,
      "score": -1,
      "figure3_died_percent": null,
      "pmp_ge_20": false,
      "score_interval": null
    },
    {
      "components": [
        {
          "factor": "inpatient",
          "points": 0,
          "present": false
        },
        {
          "factor": "sepsis",
          "points": 0,
          "present": false
        },
        {
          "factor": "poor_functional_status",
          "points": 0,
          "present": false
        },
        {
          "factor": "disseminated_cancer",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "cardiac_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "pulmonary_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "renal_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "liver_comorbidity",
          "points": 0,
          "present": false
        },
        {
          "factor": "steroid_chronic",
          "points": 0,
          "present": false
        },
        {
          "factor": "weight_loss_gt_10_percent",
          "points": 0,
          "present": false
        },
        {
          "factor": "bleeding_disorder",
          "points": 0,
          "present": false
        },
        {
          "factor": "dnr",
          "points": 0,
          "present": false
        },
        {
          "factor": "obesity",
          "points": -1,
          "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.",
      "age_years": 50,
      "citation": {
        "authors": "Vaid S, Bell T, Grim R, Ahuja V",
        "doi": "10.7812/TPP/12-019",
        "id": "ghanem-2012",
        "pmid": "23251111",
        "source": "Perm J. 2012;16(4):10-16",
        "title": "Predicting Risk of Death in General Surgery Patients on the Basis of Preoperative Variables Using American College of Surgeons National Surgical Quality Improvement Program Data"
      },
      "formula": "pmp",
      "formula_expression": "PMP = inpatient 6 + sepsis 4 + poor_functional_status 3 + disseminated_cancer 1 + age (>=80 -> 2; 70-79 -> 1; 65-69 -> 0.5; <65 -> 0) + cardiac_comorbidity 5 + pulmonary_comorbidity 3 + renal_comorbidity 1 + liver_comorbidity 1 + steroid_chronic 1 + weight_loss_gt_10_percent 1 + bleeding_disorder 1 + dnr 1 + obesity -1; Ghanem 2012 Table 5 bedside scoresheet; published range -1 through 30; Figure 3 <1% died in 0-5 and 73% died in 20-30; pmp_ge_20 is the 20-30 interval isolate",
      "max_score": 30,
      "score": -1,
      "figure3_died_percent": null,
      "pmp_ge_20": false,
      "score_interval": null
    }
  ]
}
```

## Response fields

- `formula` (string): pmp
- `formula_expression` (string): Exact Ghanem 2012 Table 5 bedside expression
- `score` (number): Table 5 PMP points; published range −1 through 30. Age 65–69 contributes 0.5.
- `max_score` (integer): 30 (Table 5 highest possible score)
- `age_years` (integer): Age in years used for the age band
- `pmp_ge_20` (boolean): true when score ≥ 20, isolating the Figure 3 20–30 interval (73% died in that cohort group). Not a go/no-go for surgery.
- `score_interval` (string): Figure 3 printed intervals only: 0-5 or 20-30. Null when the total is outside those ranges. magent does not invent other labels.
- `figure3_died_percent` (string): Published Figure 3 cohort facts: <1% in 0–5, 73% in 20–30. Null outside those intervals. A group percent, not an individual probability.
- `components` (array): Per-factor points
- `citation` (object): Ghanem 2012 Permanente Journal citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "inpatient",
      "points": 0,
      "present": false
    },
    {
      "factor": "sepsis",
      "points": 0,
      "present": false
    },
    {
      "factor": "poor_functional_status",
      "points": 0,
      "present": false
    },
    {
      "factor": "disseminated_cancer",
      "points": 0,
      "present": false
    },
    {
      "value": 50,
      "factor": "age",
      "points": 0,
      "present": false
    },
    {
      "factor": "cardiac_comorbidity",
      "points": 0,
      "present": false
    },
    {
      "factor": "pulmonary_comorbidity",
      "points": 0,
      "present": false
    },
    {
      "factor": "renal_comorbidity",
      "points": 0,
      "present": false
    },
    {
      "factor": "liver_comorbidity",
      "points": 0,
      "present": false
    },
    {
      "factor": "steroid_chronic",
      "points": 0,
      "present": false
    },
    {
      "factor": "weight_loss_gt_10_percent",
      "points": 0,
      "present": false
    },
    {
      "factor": "bleeding_disorder",
      "points": 0,
      "present": false
    },
    {
      "factor": "dnr",
      "points": 0,
      "present": false
    },
    {
      "factor": "obesity",
      "points": -1,
      "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.",
  "age_years": 50,
  "citation": {
    "authors": "Vaid S, Bell T, Grim R, Ahuja V",
    "doi": "10.7812/TPP/12-019",
    "id": "ghanem-2012",
    "pmid": "23251111",
    "source": "Perm J. 2012;16(4):10-16",
    "title": "Predicting Risk of Death in General Surgery Patients on the Basis of Preoperative Variables Using American College of Surgeons National Surgical Quality Improvement Program Data"
  },
  "formula": "pmp",
  "formula_expression": "PMP = inpatient 6 + sepsis 4 + poor_functional_status 3 + disseminated_cancer 1 + age (>=80 -> 2; 70-79 -> 1; 65-69 -> 0.5; <65 -> 0) + cardiac_comorbidity 5 + pulmonary_comorbidity 3 + renal_comorbidity 1 + liver_comorbidity 1 + steroid_chronic 1 + weight_loss_gt_10_percent 1 + bleeding_disorder 1 + dnr 1 + obesity -1; Ghanem 2012 Table 5 bedside scoresheet; published range -1 through 30; Figure 3 <1% died in 0-5 and 73% died in 20-30; pmp_ge_20 is the 20-30 interval isolate",
  "max_score": 30,
  "score": -1,
  "figure3_died_percent": null,
  "pmp_ge_20": false,
  "score_interval": null
}
```

## Errors

- HTTP 400 `invalid_pmp`: PMP needs Ghanem 2012 bedside preoperative flags and age band 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

- [POSSUM](https://magentlab.com/docs/possum) — Sum Copeland 1991 Table 1 physiologic and Table 2 operative severity items, then return the published morbidity and mortality probabilities from the unrounded logits.
- [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.
- [RCRI](https://magentlab.com/docs/rcri) — Sum the six Lee 1999 revised cardiac risk index factors and return class I–IV.

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