# Liu respiratory clinical score (2004)

Liu respiratory

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

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

## What it computes

Sum four caller-assigned Liu 2004 respiratory clinical-score domains (respiratory rate, retractions, dyspnea, auscultation; each 0-3) and return the published 0-12 total.

## When to use

When an agent has already assigned Liu 2004 0-3 points for respiratory rate (from that paper's age-banded table), retractions, dyspnea, and auscultation and needs the 0-12 total. magent does not count breaths, auscultate, or diagnose asthma or bronchiolitis.

## When not to use

- Not a medical device and not an asthma or bronchiolitis diagnosis or a treatment or admission order.
- Each of the four domains is a caller-assigned integer 0-3 from Liu 2004. Respiratory rate is that paper's 0-3 ordinal (age-banded 1/2/3 cutoffs in Table 1), not raw breaths/min and not adult Params.age. magent does not count breaths, examine the patient, or auscultate.
- Liu 2004 four-domain index, max 12. Score only; that paper does not print mild/moderate/severe total-score cutoffs, and magent does not invent them.
- Not the Chalut 2000 PRAM. Not the Westley 1978 croup score.

## Formula

```
Liu = respiratory_rate + retractions + dyspnea + auscultation; each caller-assigned 0-3; max 12
```

## Citation

[Use of a respiratory clinical score among different providers](https://doi.org/10.1002/ppul.10425)
Liu LL, Gallaher MM, Davis RL, Rutter CM, Lewis TC, Marcuse EK
Pediatr Pulmonol. 2004;37(3):243-248
DOI: [10.1002/ppul.10425](https://doi.org/10.1002/ppul.10425)

## Worked example

### All domains 0

Given: `auscultation=0, dyspnea=0, respiratory_rate=0, retractions=0`

1. respiratory_rate 0 + retractions 0 + dyspnea 0 + auscultation 0
2. Score = 0 (max 12)


### Maximum 12

Given: `auscultation=3, dyspnea=3, respiratory_rate=3, retractions=3`

1. respiratory_rate 3 + retractions 3 + dyspnea 3 + auscultation 3
2. Score = 12 (max 12)


## Also searched as

- Liu respiratory score
- Liu respiratory clinical score
- Liu 2004 respiratory score
- pediatric respiratory clinical score
- asthma bronchiolitis respiratory score
- Liu Gallaher respiratory score
- four-domain respiratory score
- Liu 2004 Table 1

## Parameters

- `respiratory_rate` (integer, required): Caller-assigned Liu 2004 respiratory-rate points (integer 0-3), not raw breaths/min. Table 1 age bands for 1/2/3: <2 months ≤60 / 61-69 / ≥70; 2-12 months ≤50 / 51-59 / ≥60; 1-2 years ≤40 / 41-44 / ≥45; 2-3 years ≤34 / 35-39 / ≥40; 4-5 years ≤30 / 31-35 / ≥36; 6-12 years ≤26 / 27-30 / ≥31; >12 years ≤23 / 24-27 / ≥28. 0 is the 0-point ordinal. magent does not count breaths.
- `retractions` (integer, required): Caller-assigned Liu 2004 retractions (integer 0-3): 0 none; 1 subcostal or intercostal; 2 two of subcostal, intercostal, substernal or nasal flaring (infant); 3 three of subcostal, intercostal, substernal, infraclavicular or nasal flaring/head bobbing (infant). magent does not examine the patient.
- `dyspnea` (integer, required): Caller-assigned Liu 2004 dyspnea (integer 0-3). 0-2 years: 0 normal feeding, vocalizations and activity; 1 one of difficulty feeding, decreased vocalization or agitated; 2 two of those; 3 stops feeding, no vocalization, drowsy or confused. 2-4 years: 0 normal feeding, vocalizations and activity; 1 one of decreased appetite, increased coughing after play, hyperactivity; 2 two of those; 3 stops eating or drinking, stops playing, or drowsy and confused. >4 years: 0 counts to ≥10 in one breath; 1 counts to 7-9; 2 counts to 4-6; 3 counts to ≤3. magent does not examine the patient.
- `auscultation` (integer, required): Caller-assigned Liu 2004 auscultation (integer 0-3): 0 normal breathing, no wheezing; 1 end-expiratory wheeze only; 2 expiratory wheeze only (greater than end-expiratory); 3 inspiratory and expiratory wheeze or diminished breath sounds or both. magent does not auscultate.

## 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/liu_respiratory`
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": [
    {
      "auscultation": "0",
      "dyspnea": "0",
      "respiratory_rate": "0",
      "retractions": "0"
    },
    {
      "auscultation": "0",
      "dyspnea": "0",
      "respiratory_rate": "0",
      "retractions": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/liu_respiratory",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "respiratory_rate",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "retractions",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "dyspnea",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "auscultation",
          "points": 0,
          "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": "Liu LL, Gallaher MM, Davis RL, Rutter CM, Lewis TC, Marcuse EK",
        "doi": "10.1002/ppul.10425",
        "id": "liu-2004",
        "source": "Pediatr Pulmonol. 2004;37(3):243-248",
        "title": "Use of a respiratory clinical score among different providers"
      },
      "formula": "liu_respiratory",
      "formula_expression": "Liu = respiratory_rate + retractions + dyspnea + auscultation; each caller-assigned 0-3; max 12",
      "max_score": 12,
      "score": 0,
      "respiratory_rate": 0,
      "auscultation": 0,
      "dyspnea": 0,
      "retractions": 0
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "respiratory_rate",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "retractions",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "dyspnea",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "auscultation",
          "points": 0,
          "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": "Liu LL, Gallaher MM, Davis RL, Rutter CM, Lewis TC, Marcuse EK",
        "doi": "10.1002/ppul.10425",
        "id": "liu-2004",
        "source": "Pediatr Pulmonol. 2004;37(3):243-248",
        "title": "Use of a respiratory clinical score among different providers"
      },
      "formula": "liu_respiratory",
      "formula_expression": "Liu = respiratory_rate + retractions + dyspnea + auscultation; each caller-assigned 0-3; max 12",
      "max_score": 12,
      "score": 0,
      "respiratory_rate": 0,
      "auscultation": 0,
      "dyspnea": 0,
      "retractions": 0
    }
  ]
}
```

## Response fields

- `formula` (string): liu_respiratory
- `formula_expression` (string): Exact expression used
- `score` (integer): Liu 2004 points 0-12
- `max_score` (integer): Always 12
- `respiratory_rate` (integer): Caller-assigned respiratory-rate points 0-3
- `retractions` (integer): Caller-assigned retractions 0-3
- `dyspnea` (integer): Caller-assigned dyspnea 0-3
- `auscultation` (integer): Caller-assigned auscultation 0-3
- `components` (array): Per-domain caller-assigned points
- `citation` (object): Liu et al. Pediatr Pulmonol 2004 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "respiratory_rate",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "retractions",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "dyspnea",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "auscultation",
      "points": 0,
      "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": "Liu LL, Gallaher MM, Davis RL, Rutter CM, Lewis TC, Marcuse EK",
    "doi": "10.1002/ppul.10425",
    "id": "liu-2004",
    "source": "Pediatr Pulmonol. 2004;37(3):243-248",
    "title": "Use of a respiratory clinical score among different providers"
  },
  "formula": "liu_respiratory",
  "formula_expression": "Liu = respiratory_rate + retractions + dyspnea + auscultation; each caller-assigned 0-3; max 12",
  "max_score": 12,
  "score": 0,
  "respiratory_rate": 0,
  "auscultation": 0,
  "dyspnea": 0,
  "retractions": 0
}
```

## Errors

- HTTP 400 `invalid_liu_component`: each Liu 2004 respiratory-score domain must be an integer from 0 to 3. 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

- [PRAM](https://magentlab.com/docs/pram) — Sum five caller-assigned Chalut 2000 PRAM item points and return the published 0-12 total.
- [Westley croup](https://magentlab.com/docs/westley-croup) — Sum the Westley 1978 croup clinical score from caller-assigned consciousness, cyanosis, stridor, air entry, and retractions (maximum 17).

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