# Gupta MICA perioperative cardiac risk

Gupta MICA

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

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

## What it computes

Compute the Gupta 2011 Table 2 logistic probability of 30-day myocardial infarction or cardiac arrest after surgery from age, ASA class, functional status, creatinine category, and surgery type.

## When to use

When an agent needs the published Gupta 2011 MICA probability and must not invent an operative-clearance decision, a diagnosis, RCRI points, or a low/high cutoff.

## When not to use

- Not a medical device. Not a diagnosis and not a surgical clearance.
- Gupta 2011 Table 2 MICA logistic model only. This is not the Revised Cardiac Risk Index (RCRI).
- Gupta 2011 does not publish a low or high risk cutoff; magent does not invent one.
- creatinine is the published category normal, abnormal (>1.5 mg/dL), or missing. magent does not parse a creatinine number.
- functional_status and surgery are caller-assigned published categories. magent does not examine the patient or classify the procedure from a CPT code.

## Formula

```
L = -5.25 + 0.02*age + functional_status + asa_class + creatinine + surgery (Gupta 2011 Table 2); independent 0, partially_dependent 0.65, totally_dependent 1.03; ASA1 -5.17, ASA2 -3.29, ASA3 -1.92, ASA4 -0.95, ASA5 0; creatinine normal 0, abnormal 0.61, missing -0.10; hernia 0, anorectal -0.16, aortic 1.60, bariatric -0.25, brain 1.40, breast -1.61, cardiac 1.01, ent 0.71, foregut_hpb 1.39, gbaas 0.59, intestinal 1.14, neck 0.18, obstetric_gynecologic 0.76, orthopedic 0.80, other_abdomen 1.13, peripheral_vascular 0.86, skin 0.54, spine 0.21, thoracic 0.40, vein -1.09, urology -0.26; estimated_probability_percent = 100 * exp(L) / (1 + exp(L))
```

## Citation

[Development and validation of a risk calculator for prediction of cardiac risk after surgery](https://doi.org/10.1161/CIRCULATIONAHA.110.015701)
Gupta PK, Gupta H, Sundaram A, et al.
Circulation. 2011;124(4):381-387
DOI: [10.1161/CIRCULATIONAHA.110.015701](https://doi.org/10.1161/CIRCULATIONAHA.110.015701)

## Worked example

### Age 40, ASA 2, independent, normal creatinine, gbaas

Given: `age=40, asa_class=2, creatinine=normal, functional_status=independent, surgery=gbaas`

1. L = -5.25 + 0.02×40 + 0 (independent) + -3.29 (ASA 2) + 0 (normal) + 0.59 (gbaas) = -7.15
2. estimated_probability_percent = 100 × e^(-7.15) / (1 + e^(-7.15)) = 0.08


### Age 60, ASA 4, independent, normal creatinine, aortic

Given: `age=60, asa_class=4, creatinine=normal, functional_status=independent, surgery=aortic`

1. L = -5.25 + 0.02×60 + 0 + -0.95 (ASA 4) + 0 + 1.60 (aortic) = -3.40
2. estimated_probability_percent from Table 2 two-decimal coefficients


### Age 70, ASA 3, independent, normal creatinine, brain

Given: `age=70, asa_class=3, creatinine=normal, functional_status=independent, surgery=brain`

1. L = -5.25 + 0.02×70 + 0 + -1.92 (ASA 3) + 0 + 1.40 (brain) = -4.37
2. estimated_probability_percent from Table 2 two-decimal coefficients


### Age 70, ASA 5, totally dependent, abnormal creatinine, foregut_hpb

Given: `age=70, asa_class=5, creatinine=abnormal, functional_status=totally_dependent, surgery=foregut_hpb`

1. L = -5.25 + 0.02×70 + 1.03 (totally_dependent) + 0 (ASA 5) + 0.61 (abnormal) + 1.39 (foregut_hpb) = -0.82
2. estimated_probability_percent from Table 2 two-decimal coefficients


### Age 65, ASA 4, partially dependent, abnormal creatinine, peripheral_vascular

Given: `age=65, asa_class=4, creatinine=abnormal, functional_status=partially_dependent, surgery=peripheral_vascular`

1. L = -5.25 + 0.02×65 + 0.65 (partially_dependent) + -0.95 (ASA 4) + 0.61 (abnormal) + 0.86 (peripheral_vascular) = -2.78
2. estimated_probability_percent from Table 2 two-decimal coefficients


## Also searched as

- Gupta MICA
- perioperative myocardial infarction cardiac arrest
- Gupta 2011 cardiac risk
- NSQIP MICA
- postoperative cardiac arrest probability
- myocardial infarction after surgery
- Gupta perioperative cardiac risk
- MICA probability

## Parameters

- `age` (integer, required): Age in years (18-120). Gupta 2011 Table 2: +0.02 per year.
- `functional_status` (string, required): Gupta 2011 functional status as assigned by the caller: independent (reference, 0), partially_dependent (+0.65), or totally_dependent (+1.03). magent does not examine the patient.
- `asa_class` (integer, required): ASA physical status 1-5 (Gupta 2011 Table 2; class 5 is the reference). class 1 -5.17, class 2 -3.29, class 3 -1.92, class 4 -0.95, class 5 adds 0. Caller-assigned integer.
- `creatinine` (string, required): Gupta 2011 creatinine category as assigned by the caller: normal (reference, 0), abnormal (>1.5 mg/dL, +0.61), or missing (-0.10). Do not send a creatinine number.
- `surgery` (string, required): Gupta 2011 Table 2 procedure category as assigned by the caller. hernia is the reference (0). gbaas is gallbladder, adrenal, appendix, or spleen (laparoscopic cholecystectomy in the paper example). 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/gupta_mica`
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",
      "asa_class": "2",
      "creatinine": "normal",
      "functional_status": "independent",
      "surgery": "gbaas"
    },
    {
      "age": "40",
      "asa_class": "2",
      "creatinine": "normal",
      "functional_status": "independent",
      "surgery": "gbaas"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/gupta_mica",
  "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": "Gupta PK, Gupta H, Sundaram A, et al.",
        "doi": "10.1161/CIRCULATIONAHA.110.015701",
        "id": "gupta-2011",
        "pmid": "21730309",
        "source": "Circulation. 2011;124(4):381-387",
        "title": "Development and validation of a risk calculator for prediction of cardiac risk after surgery"
      },
      "formula": "gupta_mica",
      "formula_expression": "L = -5.25 + 0.02*age + functional_status + asa_class + creatinine + surgery (Gupta 2011 Table 2); independent 0, partially_dependent 0.65, totally_dependent 1.03; ASA1 -5.17, ASA2 -3.29, ASA3 -1.92, ASA4 -0.95, ASA5 0; creatinine normal 0, abnormal 0.61, missing -0.10; hernia 0, anorectal -0.16, aortic 1.60, bariatric -0.25, brain 1.40, breast -1.61, cardiac 1.01, ent 0.71, foregut_hpb 1.39, gbaas 0.59, intestinal 1.14, neck 0.18, obstetric_gynecologic 0.76, orthopedic 0.80, other_abdomen 1.13, peripheral_vascular 0.86, skin 0.54, spine 0.21, thoracic 0.40, vein -1.09, urology -0.26; estimated_probability_percent = 100 * exp(L) / (1 + exp(L))",
      "age_years": 40,
      "surgery": "gbaas",
      "asa_class": 2,
      "creatinine": "normal",
      "estimated_probability_percent": 0.08,
      "functional_status": "independent",
      "logit": -7.15
    },
    {
      "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": "Gupta PK, Gupta H, Sundaram A, et al.",
        "doi": "10.1161/CIRCULATIONAHA.110.015701",
        "id": "gupta-2011",
        "pmid": "21730309",
        "source": "Circulation. 2011;124(4):381-387",
        "title": "Development and validation of a risk calculator for prediction of cardiac risk after surgery"
      },
      "formula": "gupta_mica",
      "formula_expression": "L = -5.25 + 0.02*age + functional_status + asa_class + creatinine + surgery (Gupta 2011 Table 2); independent 0, partially_dependent 0.65, totally_dependent 1.03; ASA1 -5.17, ASA2 -3.29, ASA3 -1.92, ASA4 -0.95, ASA5 0; creatinine normal 0, abnormal 0.61, missing -0.10; hernia 0, anorectal -0.16, aortic 1.60, bariatric -0.25, brain 1.40, breast -1.61, cardiac 1.01, ent 0.71, foregut_hpb 1.39, gbaas 0.59, intestinal 1.14, neck 0.18, obstetric_gynecologic 0.76, orthopedic 0.80, other_abdomen 1.13, peripheral_vascular 0.86, skin 0.54, spine 0.21, thoracic 0.40, vein -1.09, urology -0.26; estimated_probability_percent = 100 * exp(L) / (1 + exp(L))",
      "age_years": 40,
      "surgery": "gbaas",
      "asa_class": 2,
      "creatinine": "normal",
      "estimated_probability_percent": 0.08,
      "functional_status": "independent",
      "logit": -7.15
    }
  ]
}
```

## Response fields

- `formula` (string): gupta_mica
- `formula_expression` (string): Gupta 2011 Table 2 logistic expression
- `age_years` (integer): Input age in years
- `functional_status` (string): independent, partially_dependent, or totally_dependent
- `asa_class` (integer): ASA physical status 1-5
- `creatinine` (string): normal, abnormal, or missing
- `surgery` (string): Gupta 2011 Table 2 procedure category
- `logit` (number): Gupta 2011 Table 2 linear predictor L, 4 decimal places
- `estimated_probability_percent` (number): 100 * exp(L) / (1 + exp(L)) from the unrounded logit, 2 decimal places. A probability, not a clearance.
- `citation` (object): Gupta et al. Circulation 2011 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": "Gupta PK, Gupta H, Sundaram A, et al.",
    "doi": "10.1161/CIRCULATIONAHA.110.015701",
    "id": "gupta-2011",
    "pmid": "21730309",
    "source": "Circulation. 2011;124(4):381-387",
    "title": "Development and validation of a risk calculator for prediction of cardiac risk after surgery"
  },
  "formula": "gupta_mica",
  "formula_expression": "L = -5.25 + 0.02*age + functional_status + asa_class + creatinine + surgery (Gupta 2011 Table 2); independent 0, partially_dependent 0.65, totally_dependent 1.03; ASA1 -5.17, ASA2 -3.29, ASA3 -1.92, ASA4 -0.95, ASA5 0; creatinine normal 0, abnormal 0.61, missing -0.10; hernia 0, anorectal -0.16, aortic 1.60, bariatric -0.25, brain 1.40, breast -1.61, cardiac 1.01, ent 0.71, foregut_hpb 1.39, gbaas 0.59, intestinal 1.14, neck 0.18, obstetric_gynecologic 0.76, orthopedic 0.80, other_abdomen 1.13, peripheral_vascular 0.86, skin 0.54, spine 0.21, thoracic 0.40, vein -1.09, urology -0.26; estimated_probability_percent = 100 * exp(L) / (1 + exp(L))",
  "age_years": 40,
  "surgery": "gbaas",
  "asa_class": 2,
  "creatinine": "normal",
  "estimated_probability_percent": 0.08,
  "functional_status": "independent",
  "logit": -7.15
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_gupta_mica`: each Gupta 2011 MICA item must be a published category for that field. Returned before settlement; you are not charged.
- HTTP 400 `invalid_gupta_surgery`: surgery must be a Gupta 2011 Table 2 procedure category (hernia is the reference). Returned before settlement; you are not charged.
- HTTP 400 `invalid_asa_class`: asa_class must be an integer from 1 to 5 (Gupta 2011 ASA physical status). 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

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