# MACOCHA score

MACOCHA

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

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

## What it computes

Sum the seven De Jong 2013 Table 1 MACOCHA factors from caller-assigned flags and return the 0-12 total plus high_risk at that paper's score >= 3 cutoff.

## When to use

When an agent already has the seven De Jong 2013 MACOCHA flags (Mallampati III or IV, obstructive sleep apnea, reduced cervical mobility, limited mouth opening, coma, severe hypoxemia, non-anesthesiologist operator) and needs the published 0-12 total. magent does not examine the airway, compute GCS, or measure SpO2.

## When not to use

- Not a medical device.
- Not an intubation order.
- magent does not examine the airway, compute GCS, or measure SpO2. The caller assigns each Table 1 flag.
- Mallampati is a yes/no III-or-IV flag, not a 1-4 scale. Coma is the paper's pathology item (typically GCS <8 in that derivation); magent does not take raw GCS.
- high_risk is score >= 3 from De Jong 2013 (NPV ~98% at that cut in the validation cohort). 0 = easy, 12 = very difficult. Not a later review cut.

## Formula

```
MACOCHA = mallampati_iii_iv (5) + obstructive_sleep_apnea (2) + reduced_cervical_mobility (1) + limited_mouth_opening (1) + coma (1) + severe_hypoxemia (1) + non_anesthesiologist (1); De Jong 2013 Table 1; max 12; 0 easy, 12 very difficult; high_risk iff score >= 3
```

## Citation

[Early identification of patients at risk for difficult intubation in the intensive care unit: development and validation of the MACOCHA score in a multicenter cohort study](https://doi.org/10.1164/rccm.201210-1851OC)
De Jong A, Molinari N, Terzi N, Mongardon N, Arnal JM, Guitton C, et al.
Am J Respir Crit Care Med. 2013;187(8):832-839
DOI: [10.1164/rccm.201210-1851OC](https://doi.org/10.1164/rccm.201210-1851OC)

## Worked example

### All flags false

Given: `coma=false, limited_mouth_opening=false, mallampati_iii_iv=false, non_anesthesiologist=false, obstructive_sleep_apnea=false, reduced_cervical_mobility=false, severe_hypoxemia=false`

1. All seven caller-assigned flags false
2. score = 0; max 12; high_risk is false


### Mallampati III or IV only

Given: `coma=false, limited_mouth_opening=false, mallampati_iii_iv=true, non_anesthesiologist=false, obstructive_sleep_apnea=false, reduced_cervical_mobility=false, severe_hypoxemia=false`

1. mallampati_iii_iv true scores 5
2. The other six flags are false
3. score = 5; max 12; high_risk is true (score >= 3)


## Also searched as

- MACOCHA score
- De Jong 2013 MACOCHA
- ICU difficult intubation score
- Mallampati apnea cervical
- difficult airway ICU
- MACOCHA
- ICU intubation prediction
- MACOCHA airway

## Parameters

- `mallampati_iii_iv` (boolean, required): Mallampati class III or IV as assigned by the caller (De Jong 2013 Table 1). true or false. Not a 1-4 Mallampati integer. magent does not examine the airway.
- `obstructive_sleep_apnea` (boolean, required): Obstructive sleep apnea syndrome as assigned by the caller (De Jong 2013 Table 1). true or false. magent does not diagnose sleep apnea.
- `reduced_cervical_mobility` (boolean, required): Reduced mobility of the cervical spine as assigned by the caller (De Jong 2013 Table 1). true or false. magent does not examine the neck.
- `limited_mouth_opening` (boolean, required): Limited mouth opening <3 cm as assigned by the caller (De Jong 2013 Table 1). true or false. magent does not measure mouth opening.
- `coma` (boolean, required): Coma as assigned by the caller (De Jong 2013 Table 1 pathology item; typically GCS <8 in that derivation). true or false. magent does not take raw GCS or compute GCS.
- `severe_hypoxemia` (boolean, required): Severe hypoxemia (SpO2 <80%) as assigned by the caller (De Jong 2013 Table 1). true or false. magent does not measure SpO2.
- `non_anesthesiologist` (boolean, required): Non-anesthesiologist operator as assigned by the caller (De Jong 2013 Table 1). true or false. magent does not identify the operator.

## 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/macocha`
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": [
    {
      "coma": "false",
      "limited_mouth_opening": "false",
      "mallampati_iii_iv": "false",
      "non_anesthesiologist": "false",
      "obstructive_sleep_apnea": "false",
      "reduced_cervical_mobility": "false",
      "severe_hypoxemia": "false"
    },
    {
      "coma": "false",
      "limited_mouth_opening": "false",
      "mallampati_iii_iv": "false",
      "non_anesthesiologist": "false",
      "obstructive_sleep_apnea": "false",
      "reduced_cervical_mobility": "false",
      "severe_hypoxemia": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/macocha",
  "items": [
    {
      "components": [
        {
          "factor": "mallampati_iii_iv",
          "points": 0,
          "present": false
        },
        {
          "factor": "obstructive_sleep_apnea",
          "points": 0,
          "present": false
        },
        {
          "factor": "reduced_cervical_mobility",
          "points": 0,
          "present": false
        },
        {
          "factor": "limited_mouth_opening",
          "points": 0,
          "present": false
        },
        {
          "factor": "coma",
          "points": 0,
          "present": false
        },
        {
          "factor": "severe_hypoxemia",
          "points": 0,
          "present": false
        },
        {
          "factor": "non_anesthesiologist",
          "points": 0,
          "present": 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": "De Jong A, Molinari N, Terzi N, Mongardon N, Arnal JM, Guitton C, et al.",
        "doi": "10.1164/rccm.201210-1851OC",
        "id": "de-jong-2013",
        "pmid": "23348979",
        "source": "Am J Respir Crit Care Med. 2013;187(8):832-839",
        "title": "Early identification of patients at risk for difficult intubation in the intensive care unit: development and validation of the MACOCHA score in a multicenter cohort study"
      },
      "formula": "macocha",
      "formula_expression": "MACOCHA = mallampati_iii_iv (5) + obstructive_sleep_apnea (2) + reduced_cervical_mobility (1) + limited_mouth_opening (1) + coma (1) + severe_hypoxemia (1) + non_anesthesiologist (1); De Jong 2013 Table 1; max 12; 0 easy, 12 very difficult; high_risk iff score >= 3",
      "max_score": 12,
      "score": 0,
      "high_risk": false
    },
    {
      "components": [
        {
          "factor": "mallampati_iii_iv",
          "points": 0,
          "present": false
        },
        {
          "factor": "obstructive_sleep_apnea",
          "points": 0,
          "present": false
        },
        {
          "factor": "reduced_cervical_mobility",
          "points": 0,
          "present": false
        },
        {
          "factor": "limited_mouth_opening",
          "points": 0,
          "present": false
        },
        {
          "factor": "coma",
          "points": 0,
          "present": false
        },
        {
          "factor": "severe_hypoxemia",
          "points": 0,
          "present": false
        },
        {
          "factor": "non_anesthesiologist",
          "points": 0,
          "present": 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": "De Jong A, Molinari N, Terzi N, Mongardon N, Arnal JM, Guitton C, et al.",
        "doi": "10.1164/rccm.201210-1851OC",
        "id": "de-jong-2013",
        "pmid": "23348979",
        "source": "Am J Respir Crit Care Med. 2013;187(8):832-839",
        "title": "Early identification of patients at risk for difficult intubation in the intensive care unit: development and validation of the MACOCHA score in a multicenter cohort study"
      },
      "formula": "macocha",
      "formula_expression": "MACOCHA = mallampati_iii_iv (5) + obstructive_sleep_apnea (2) + reduced_cervical_mobility (1) + limited_mouth_opening (1) + coma (1) + severe_hypoxemia (1) + non_anesthesiologist (1); De Jong 2013 Table 1; max 12; 0 easy, 12 very difficult; high_risk iff score >= 3",
      "max_score": 12,
      "score": 0,
      "high_risk": false
    }
  ]
}
```

## Response fields

- `formula` (string): macocha
- `formula_expression` (string): Exact expression used
- `score` (integer): MACOCHA points 0-12
- `max_score` (integer): Always 12
- `high_risk` (boolean): true iff score >= 3 (De Jong 2013 operating point for ruling out difficult intubation; NPV ~98% in that validation cohort). Not an intubation order.
- `components` (array): Per-factor points
- `citation` (object): De Jong 2013 Am J Respir Crit Care Med citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "mallampati_iii_iv",
      "points": 0,
      "present": false
    },
    {
      "factor": "obstructive_sleep_apnea",
      "points": 0,
      "present": false
    },
    {
      "factor": "reduced_cervical_mobility",
      "points": 0,
      "present": false
    },
    {
      "factor": "limited_mouth_opening",
      "points": 0,
      "present": false
    },
    {
      "factor": "coma",
      "points": 0,
      "present": false
    },
    {
      "factor": "severe_hypoxemia",
      "points": 0,
      "present": false
    },
    {
      "factor": "non_anesthesiologist",
      "points": 0,
      "present": 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": "De Jong A, Molinari N, Terzi N, Mongardon N, Arnal JM, Guitton C, et al.",
    "doi": "10.1164/rccm.201210-1851OC",
    "id": "de-jong-2013",
    "pmid": "23348979",
    "source": "Am J Respir Crit Care Med. 2013;187(8):832-839",
    "title": "Early identification of patients at risk for difficult intubation in the intensive care unit: development and validation of the MACOCHA score in a multicenter cohort study"
  },
  "formula": "macocha",
  "formula_expression": "MACOCHA = mallampati_iii_iv (5) + obstructive_sleep_apnea (2) + reduced_cervical_mobility (1) + limited_mouth_opening (1) + coma (1) + severe_hypoxemia (1) + non_anesthesiologist (1); De Jong 2013 Table 1; max 12; 0 easy, 12 very difficult; high_risk iff score >= 3",
  "max_score": 12,
  "score": 0,
  "high_risk": false
}
```

## Errors

- HTTP 400 `invalid_macocha`: MACOCHA inputs must match De Jong 2013 Mallampati, sleep apnea, cervical mobility, mouth opening, coma, hypoxia, and operator factors from that paper. 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

- [Mallampati](https://magentlab.com/docs/mallampati) — Return the Samsoon 1987 modified Mallampati class 1-4 from a caller-assigned integer, with a stable label.
- [HEAVEN](https://magentlab.com/docs/heaven) — Apply the Davis 2017 HEAVEN criteria from six caller-assigned flags and return high_risk iff any is true, plus the count of criteria met (0-6).
- [Pediatric ETT size](https://magentlab.com/docs/pediatric-ett) — Compute Cole 1957 uncuffed pediatric endotracheal tube internal diameter from age in years.

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