Respiratory · LIVE
Liu respiratory clinical score (2004)
Liu respiratory
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.
Markdown: /docs/liu-respiratory.md · Canonical: https://magentlab.com/docs/liu-respiratory
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
- Authors
- Liu LL, Gallaher MM, Davis RL, Rutter CM, Lewis TC, Marcuse EK
- Source
- Pediatr Pulmonol. 2004;37(3):243-248
Worked example
All domains 0
Given:
auscultation=0dyspnea=0respiratory_rate=0retractions=0
- respiratory_rate 0 + retractions 0 + dyspnea 0 + auscultation 0
- Score = 0 (max 12)
Maximum 12
Given:
auscultation=3dyspnea=3respiratory_rate=3retractions=3
- respiratory_rate 3 + retractions 3 + dyspnea 3 + auscultation 3
- 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
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/liu_respiratory?respiratory_rate=0&retractions=0&dyspnea=0&auscultation=0
Full URL: https://api.magentlab.com/api/calc/liu_respiratory?respiratory_rate=0&retractions=0&dyspnea=0&auscultation=0
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/liu_respiratory?respiratory_rate=0&retractions=0&dyspnea=0&auscultation=0"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
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.
- 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": [
{
"auscultation": "0",
"dyspnea": "0",
"respiratory_rate": "0",
"retractions": "0"
},
{
"auscultation": "0",
"dyspnea": "0",
"respiratory_rate": "0",
"retractions": "0"
}
]
}
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/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
| Field | Type | Description |
|---|---|---|
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
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"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
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 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. |
| 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
- PRAM — Sum five caller-assigned Chalut 2000 PRAM item points and return the published 0-12 total.
- 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. 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.