Emergency · LIVE
Preoperative mortality predictor (PMP)
PMP
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.
Markdown: /docs/pmp.md · Canonical: https://magentlab.com/docs/pmp
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
- Authors
- Vaid S, Bell T, Grim R, Ahuja V
- Source
- Perm J. 2012;16(4):10-16
Worked example
Age 50, obesity only (score −1)
Given:
age=50bleeding_disorder=falsecardiac_comorbidity=falsedisseminated_cancer=falsednr=falseinpatient=falseliver_comorbidity=falseobesity=truepoor_functional_status=falsepulmonary_comorbidity=falserenal_comorbidity=falsesepsis=falsesteroid_chronic=falseweight_loss_gt_10_percent=false
- Age 50 (<65) → 0; obesity → −1; all other Table 5 flags false
- Score = −1; pmp_ge_20 false. Not a go/no-go for surgery.
Inpatient, sepsis, age 82 (score 12)
Given:
age=82bleeding_disorder=falsecardiac_comorbidity=falsedisseminated_cancer=falsednr=falseinpatient=trueliver_comorbidity=falseobesity=falsepoor_functional_status=falsepulmonary_comorbidity=falserenal_comorbidity=falsesepsis=truesteroid_chronic=falseweight_loss_gt_10_percent=false
- Inpatient → 6; sepsis → 4; age ≥80 → 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
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/pmp?age=50&inpatient=false&sepsis=false&poor_functional_status=false&disseminated_cancer=false&cardiac_comorbidity=false&pulmonary_comorbidity=false&renal_comorbidity=false&liver_comorbidity=false&steroid_chronic=false&weight_loss_gt_10_percent=false&bleeding_disorder=false&dnr=false&obesity=true
Call
Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params
return HTTP 400 before any quote or charge.
curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/pmp?age=50&inpatient=false&sepsis=false&poor_functional_status=false&disseminated_cancer=false&cardiac_comorbidity=false&pulmonary_comorbidity=false&renal_comorbidity=false&liver_comorbidity=false&steroid_chronic=false&weight_loss_gt_10_percent=false&bleeding_disorder=false&dnr=false&obesity=true"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
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.
- 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 (fixture)
{
"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"
}
]
}
Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.
Example 200 (fixture)
{
"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.",
"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,
"age_years": 50,
"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.",
"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,
"age_years": 50,
"figure3_died_percent": null,
"pmp_ge_20": false,
"score_interval": null
}
]
}
Response
| Field | Type | Description |
|---|---|---|
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
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"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.",
"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,
"age_years": 50,
"figure3_died_percent": null,
"pmp_ge_20": false,
"score_interval": null
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_pmp |
PMP needs Ghanem 2012 bedside preoperative flags and age band in published ranges. Returned before settlement; you are not charged. |
| 400 | invalid_items |
POST body must be a JSON object with only an items array Returned before settlement; you are not charged. |
| 400 | invalid_item_count |
items must be an array of 1 to 25 objects Returned before settlement; you are not charged. |
| 400 | invalid_item |
each items entry must be a JSON object Returned before settlement; you are not charged. |
Related tools
- 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 — 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 — 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. Unpaid valid requests return HTTP 402 with a base64
PAYMENT-REQUIRED
header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake
and shared payment errors: Payments.
Stdio MCP: /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.