# VOCAL-Penn 30-day postoperative mortality

VOCAL-Penn

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

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

## What it computes

Compute the Mahmud 2021 VOCAL-Penn 30-day postoperative mortality percent for cirrhosis from caller-assigned ASA class, surgery category, emergency indication, NAFLD, obesity, albumin, bilirubin, and platelet count.

## When to use

When an agent needs the published Mahmud 2021 30-day VOCAL-Penn logistic probability and must not invent a surgical-candidacy order, assign ASA class, or substitute MELD or Child-Pugh.

## When not to use

- Not a medical device.
- Not a surgical-candidacy order and not an operative go/no-go.
- magent does not assign ASA class and does not read laboratory values.
- Mahmud 2021 Supplement Appendix 30-day logistic only. This is not the 90-day or 180-day conditional model.
- Age is required because the published tool asks for it. The 30-day Appendix linear predictor does not retain age (age appears in the 90- and 180-day models).
- abdominal is the Appendix open-abdominal dummy. abdominal_laparoscopic is the surgery reference. chest and cardiac share the printed chest/cardiac coefficient (Supplemental Table 1 combined those CPT groups).
- ASA is caller-assigned 2, 3, or 4. The derivation cohort had no ASA 1 and excluded ASA 5.
- Obesity is caller-assigned BMI ≥30. Fatty liver disease is caller-assigned NAFLD etiology.

## Formula

```
log_odds = -5.472096 + 1.061725*ASA + 0.927904*emergency + 1.56071*abdominal_open + 0.7418021*abdominal_wall + 0.9165415*vascular + 1.464183*orthopedic + 1.893621*chest_cardiac - 0.0075185*platelets_sp1 + 0.0036657*platelets_sp2 - 0.5181509*albumin_sp1 - 1.000672*albumin_sp2 + 0.1448936*bilirubin_mg_dl - 0.7541669*obesity + 0.8268748*NAFLD; laparoscopic abdominal is the surgery reference; sp1 = x; sp2 = Stata mkspline 3-knot restricted cubic spline / (k3-k1)^2; albumin knots 2.7, 3.7, 4.4 g/dL; platelets knots 75, 152, 271 x10^9/L; mortality_30d_percent = 100*exp(log_odds)/(1+exp(log_odds)), 1 decimal
```

## Citation

[Risk Prediction Models for Post-Operative Mortality in Patients With Cirrhosis](https://doi.org/10.1002/hep.31558)
Mahmud N, Fricker Z, Hubbard RA, Ioannou GN, Lewis JD, Taddei TH, Rothstein KD, Serper M, Goldberg DS, Kaplan DE
Hepatology. 2021;73(1):204-218
DOI: [10.1002/hep.31558](https://doi.org/10.1002/hep.31558)

## Worked example

### Age 60, albumin 3.5 g/dL, bilirubin 1.2 mg/dL, platelets 150, ASA 3, elective abdominal wall

Given: `age=60, albumin_g_dl=3.5, asa_class=3, bilirubin_mg_dl=1.2, emergency=false, fatty_liver_disease=false, obesity=false, platelets_10e9_l=150, surgery_category=abdominal_wall`

1. Supplemental Table 2 three-knot RCS: albumin 2.7, 3.7, 4.4; platelets 75, 152, 271. albumin_sp1=3.5; albumin_sp2=0.1772; platelets_sp1=150; platelets_sp2=10.9818. abdominal_wall dummy=1; laparoscopic abdominal is the reference. ASA=3 ordinal. Emergency, obesity, and NAFLD are 0.
2. log_odds = -5.472096 + 1.061725*3 + 0.7418021 - 0.0075185*150 + 0.0036657*10.9818 - 0.5181509*3.5 - 1.000672*0.1772 + 0.1448936*1.2
3. mortality_30d_percent = 100*exp(log_odds)/(1+exp(log_odds)) → 1.2


## Also searched as

- VOCAL-Penn score
- VOCAL Penn
- cirrhosis surgical risk
- postoperative mortality cirrhosis
- Mahmud 2021 surgical risk
- NAFLD cirrhosis surgery
- ASA cirrhosis surgery

## Parameters

- `age` (integer, required): Age in years (18-120). The Mahmud 2021 Supplement Appendix 30-day linear predictor does not retain age (age is in the 90- and 180-day models). Required because the published tool asks for it.
- `albumin_g_dl` (number, optional): Preoperative albumin in g/dL (1.0-6.0). Provide this or albumin_g_l. Restricted cubic spline knots 2.7, 3.7, 4.4 (Supplemental Table 2). magent does not read the laboratory.
- `albumin_g_l` (number, optional): Preoperative albumin in g/L (10-60). Converted as g/dL = g/L / 10.
- `bilirubin_mg_dl` (number, optional): Preoperative total bilirubin in mg/dL (0.1-40). Provide this or bilirubin_umol_l. Linear in the 30-day Appendix model. magent does not read the laboratory.
- `bilirubin_umol_l` (number, optional): Preoperative total bilirubin in µmol/L (2-684). Converted as mg/dL = µmol/L / 17.1.
- `platelets_10e9_l` (number, required): Preoperative platelet count in 10^9/L (10-800), equal to 1,000/µL. Spline knots 75, 152, 271 (Supplemental Table 2). magent does not read the laboratory.
- `obesity` (boolean, required): Caller-assigned BMI ≥30 kg/m² (true/false). Protective in the 30-day model. magent does not compute BMI.
- `fatty_liver_disease` (boolean, required): Caller-assigned NAFLD as the etiology of cirrhosis (true/false). magent does not assign etiology.
- `asa_class` (integer, required): Caller-assigned ASA physical status 2, 3, or 4 (ordinal in the Appendix). The derivation cohort had no ASA 1 and excluded ASA 5. magent does not assign ASA class.
- `emergency` (boolean, required): Caller-assigned emergency indication (true/false). magent does not classify urgency.
- `surgery_category` (string, required): Mahmud 2021 Appendix surgery dummy as assigned by the caller. abdominal_laparoscopic is the reference (0). abdominal is open abdominal. chest and cardiac share the printed chest/cardiac coefficient. magent does not classify a CPT code.

## 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/vocal_penn`
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": "60",
      "albumin_g_dl": "3.5",
      "asa_class": "3",
      "bilirubin_mg_dl": "1.2",
      "emergency": "false",
      "fatty_liver_disease": "false",
      "obesity": "false",
      "platelets_10e9_l": "150",
      "surgery_category": "abdominal_wall"
    },
    {
      "age": "60",
      "albumin_g_dl": "3.5",
      "asa_class": "3",
      "bilirubin_mg_dl": "1.2",
      "emergency": "false",
      "fatty_liver_disease": "false",
      "obesity": "false",
      "platelets_10e9_l": "150",
      "surgery_category": "abdominal_wall"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/vocal_penn",
  "items": [
    {
      "emergency": 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": "Mahmud N, Fricker Z, Hubbard RA, Ioannou GN, Lewis JD, Taddei TH, Rothstein KD, Serper M, Goldberg DS, Kaplan DE",
        "doi": "10.1002/hep.31558",
        "id": "mahmud-2021-vocal-penn",
        "pmid": "32939786",
        "source": "Hepatology. 2021;73(1):204-218",
        "title": "Risk Prediction Models for Post-Operative Mortality in Patients With Cirrhosis"
      },
      "formula": "mahmud_vocal_penn_30d_2021",
      "formula_expression": "log_odds = -5.472096 + 1.061725*ASA + 0.927904*emergency + 1.56071*abdominal_open + 0.7418021*abdominal_wall + 0.9165415*vascular + 1.464183*orthopedic + 1.893621*chest_cardiac - 0.0075185*platelets_sp1 + 0.0036657*platelets_sp2 - 0.5181509*albumin_sp1 - 1.000672*albumin_sp2 + 0.1448936*bilirubin_mg_dl - 0.7541669*obesity + 0.8268748*NAFLD; laparoscopic abdominal is the surgery reference; sp1 = x; sp2 = Stata mkspline 3-knot restricted cubic spline / (k3-k1)^2; albumin knots 2.7, 3.7, 4.4 g/dL; platelets knots 75, 152, 271 x10^9/L; mortality_30d_percent = 100*exp(log_odds)/(1+exp(log_odds)), 1 decimal",
      "age_years": 60,
      "albumin_g_dl": 3.5,
      "platelets_10e9_l": 150.0,
      "bilirubin_mg_dl": 1.2,
      "logit": -4.4496,
      "asa_class": 3,
      "fatty_liver_disease": false,
      "mortality_30d_percent": 1.2,
      "obesity": false,
      "surgery_category": "abdominal_wall"
    },
    {
      "emergency": 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": "Mahmud N, Fricker Z, Hubbard RA, Ioannou GN, Lewis JD, Taddei TH, Rothstein KD, Serper M, Goldberg DS, Kaplan DE",
        "doi": "10.1002/hep.31558",
        "id": "mahmud-2021-vocal-penn",
        "pmid": "32939786",
        "source": "Hepatology. 2021;73(1):204-218",
        "title": "Risk Prediction Models for Post-Operative Mortality in Patients With Cirrhosis"
      },
      "formula": "mahmud_vocal_penn_30d_2021",
      "formula_expression": "log_odds = -5.472096 + 1.061725*ASA + 0.927904*emergency + 1.56071*abdominal_open + 0.7418021*abdominal_wall + 0.9165415*vascular + 1.464183*orthopedic + 1.893621*chest_cardiac - 0.0075185*platelets_sp1 + 0.0036657*platelets_sp2 - 0.5181509*albumin_sp1 - 1.000672*albumin_sp2 + 0.1448936*bilirubin_mg_dl - 0.7541669*obesity + 0.8268748*NAFLD; laparoscopic abdominal is the surgery reference; sp1 = x; sp2 = Stata mkspline 3-knot restricted cubic spline / (k3-k1)^2; albumin knots 2.7, 3.7, 4.4 g/dL; platelets knots 75, 152, 271 x10^9/L; mortality_30d_percent = 100*exp(log_odds)/(1+exp(log_odds)), 1 decimal",
      "age_years": 60,
      "albumin_g_dl": 3.5,
      "platelets_10e9_l": 150.0,
      "bilirubin_mg_dl": 1.2,
      "logit": -4.4496,
      "asa_class": 3,
      "fatty_liver_disease": false,
      "mortality_30d_percent": 1.2,
      "obesity": false,
      "surgery_category": "abdominal_wall"
    }
  ]
}
```

## Response fields

- `formula` (string): mahmud_vocal_penn_30d_2021
- `formula_expression` (string): Mahmud 2021 Supplement Appendix 30-day log-odds expression
- `age_years` (integer): Input age in years; not a term in the 30-day Appendix linear predictor
- `albumin_g_dl` (number): Input albumin in g/dL
- `bilirubin_mg_dl` (number): Input bilirubin in mg/dL
- `platelets_10e9_l` (number): Input platelet count in 10^9/L
- `obesity` (boolean): Caller-assigned BMI ≥30
- `fatty_liver_disease` (boolean): Caller-assigned NAFLD etiology
- `asa_class` (integer): Caller-assigned ASA class 2, 3, or 4
- `emergency` (boolean): Caller-assigned emergency indication
- `surgery_category` (string): Appendix surgery dummy used in the linear predictor
- `logit` (number): Appendix 30-day log-odds, 4 decimal places
- `mortality_30d_percent` (number): 100 * exp(log_odds) / (1 + exp(log_odds)) from the unrounded logit, 1 decimal. A probability, not a surgical order.
- `citation` (object): Mahmud 2021 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "emergency": 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": "Mahmud N, Fricker Z, Hubbard RA, Ioannou GN, Lewis JD, Taddei TH, Rothstein KD, Serper M, Goldberg DS, Kaplan DE",
    "doi": "10.1002/hep.31558",
    "id": "mahmud-2021-vocal-penn",
    "pmid": "32939786",
    "source": "Hepatology. 2021;73(1):204-218",
    "title": "Risk Prediction Models for Post-Operative Mortality in Patients With Cirrhosis"
  },
  "formula": "mahmud_vocal_penn_30d_2021",
  "formula_expression": "log_odds = -5.472096 + 1.061725*ASA + 0.927904*emergency + 1.56071*abdominal_open + 0.7418021*abdominal_wall + 0.9165415*vascular + 1.464183*orthopedic + 1.893621*chest_cardiac - 0.0075185*platelets_sp1 + 0.0036657*platelets_sp2 - 0.5181509*albumin_sp1 - 1.000672*albumin_sp2 + 0.1448936*bilirubin_mg_dl - 0.7541669*obesity + 0.8268748*NAFLD; laparoscopic abdominal is the surgery reference; sp1 = x; sp2 = Stata mkspline 3-knot restricted cubic spline / (k3-k1)^2; albumin knots 2.7, 3.7, 4.4 g/dL; platelets knots 75, 152, 271 x10^9/L; mortality_30d_percent = 100*exp(log_odds)/(1+exp(log_odds)), 1 decimal",
  "age_years": 60,
  "albumin_g_dl": 3.5,
  "platelets_10e9_l": 150.0,
  "bilirubin_mg_dl": 1.2,
  "logit": -4.4496,
  "asa_class": 3,
  "fatty_liver_disease": false,
  "mortality_30d_percent": 1.2,
  "obesity": false,
  "surgery_category": "abdominal_wall"
}
```

## Errors

- HTTP 400 `invalid_vocal_penn`: VOCAL-Penn inputs must match Mahmud 2021 age, albumin, bilirubin, platelets, obesity, fatty liver disease, ASA class, emergency indication, and surgery category. 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

- [MELD-Na](https://magentlab.com/docs/meld-na) — Compute OPTN/UNOS 2016 MELD and MELD-Na from creatinine, bilirubin, INR, sodium, and dialysis.
- [Child–Pugh](https://magentlab.com/docs/child-pugh) — Compute the Child–Turcotte–Pugh cirrhosis severity score from bilirubin, albumin, INR, encephalopathy, and ascites.
- [MELD 3.0](https://magentlab.com/docs/meld-3) — Compute the Kim 2021 MELD 3.0 integer from sex, bilirubin, INR, creatinine, sodium, albumin, and dialysis.

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