Respiratory · LIVE
DECAF score
DECAF
Sum Steer 2012 DECAF points from extended MRC dyspnoea, eosinophils, chest radiograph consolidation, arterial pH, and atrial fibrillation.
Markdown: /docs/decaf.md · Canonical: https://magentlab.com/docs/decaf
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum Steer 2012 DECAF points from extended MRC dyspnoea, eosinophils, chest radiograph consolidation, arterial pH, and atrial fibrillation.
When to use
When an agent needs the published Steer 2012 DECAF total and band and must not invent an early-discharge or escalation decision or a mortality percent.
When not to use
- Not a medical device. Not an early-discharge or escalation protocol. Bands follow Steer 2012 (0-1 / 2 / 3-6) and do not include mortality percents.
- eMRCD is the caller-assigned extended MRC grade 1-4, 5a, or 5b. magent does not interview the patient.
- Consolidation and atrial fibrillation are caller-assigned flags. magent does not interpret the chest radiograph or ECG.
Formula
DECAF = emrcd_points + eosinopenia + consolidation + acidemia + atrial_fibrillation; eMRCD 1-4 -> 0, 5a -> 1, 5b -> 2; eosinophils_10e9_l < 0.05 -> 1 (0.05 does not score); consolidation true -> 1; arterial_ph < 7.30 -> 1 (7.30 does not score); atrial_fibrillation true -> 1; bands 0-1 / 2 / 3-6; max 6
Citation
- Authors
- Steer J, Gibson J, Bourke SC
- Source
- Thorax. 2012;67(11):970-976
Worked example
No DECAF points (band 0-1)
Given:
arterial_ph=7.40atrial_fibrillation=falseconsolidation=falseemrcd=1-4eosinophils_10e9_l=0.10
- eMRCD 1-4 → 0; eosinophils 0.10 ≥0.05 → 0; no consolidation → 0; pH 7.40 ≥7.30 → 0; no AF → 0
- Score = 0; band 0-1
Maximum points (band 3-6)
Given:
arterial_ph=7.20atrial_fibrillation=trueconsolidation=trueemrcd=5beosinophils_10e9_l=0.02
- eMRCD 5b → 2; eosinophils 0.02 <0.05 → 1; consolidation → 1; pH 7.20 <7.30 → 1; AF → 1
- Score = 6; band 3-6
Also searched as
- DECAF score
- Steer DECAF
- COPD exacerbation DECAF
- eMRCD DECAF
- extended MRC DECAF
- dyspnoea eosinopenia consolidation
- COPD hospital mortality score
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/decaf?emrcd=1-4&eosinophils_10e9_l=0.10&consolidation=false&arterial_ph=7.40&atrial_fibrillation=false
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/decaf?emrcd=1-4&eosinophils_10e9_l=0.10&consolidation=false&arterial_ph=7.40&atrial_fibrillation=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
emrcd |
string | required · 1-4, 5a, 5b | Steer 2012 extended MRC dyspnoea as assigned by the caller. 1-4 scores 0; 5a scores 1; 5b scores 2. magent does not interview the patient. |
eosinophils_10e9_l |
number | required | Blood eosinophil count ×10^9/L (0-5). Steer 2012: <0.05 scores 1; 0.05 does not score. |
consolidation |
boolean | required | Chest radiograph consolidation as assigned by the caller (Steer 2012 C). true or false. 1 point if true. magent does not interpret radiographs. |
arterial_ph |
number | required | Arterial pH (6.80-7.80). Steer 2012: <7.30 scores 1; 7.30 does not score. |
atrial_fibrillation |
boolean | required | Atrial fibrillation as assigned by the caller (Steer 2012 F). true or false. 1 point if true. magent does not interpret the ECG. |
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": [
{
"arterial_ph": "7.40",
"atrial_fibrillation": "false",
"consolidation": "false",
"emrcd": "1-4",
"eosinophils_10e9_l": "0.10"
},
{
"arterial_ph": "7.40",
"atrial_fibrillation": "false",
"consolidation": "false",
"emrcd": "1-4",
"eosinophils_10e9_l": "0.10"
}
]
}
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/decaf",
"items": [
{
"components": [
{
"value": "1-4",
"factor": "emrcd",
"points": 0,
"present": false
},
{
"value": 0.1,
"factor": "eosinopenia",
"points": 0,
"present": false
},
{
"factor": "consolidation",
"points": 0,
"present": false
},
{
"value": 7.4,
"factor": "acidemia",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"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": "Steer J, Gibson J, Bourke SC",
"doi": "10.1136/thoraxjnl-2012-202103",
"id": "steer-2012",
"pmid": "22895999",
"source": "Thorax. 2012;67(11):970-976",
"title": "The DECAF Score: predicting hospital mortality in exacerbations of chronic obstructive pulmonary disease"
},
"formula": "decaf",
"formula_expression": "DECAF = emrcd_points + eosinopenia + consolidation + acidemia + atrial_fibrillation; eMRCD 1-4 -> 0, 5a -> 1, 5b -> 2; eosinophils_10e9_l < 0.05 -> 1 (0.05 does not score); consolidation true -> 1; arterial_ph < 7.30 -> 1 (7.30 does not score); atrial_fibrillation true -> 1; bands 0-1 / 2 / 3-6; max 6",
"max_score": 6,
"score": 0,
"atrial_fibrillation": false,
"arterial_ph": 7.4,
"consolidation": false,
"decaf_band": "0-1",
"emrcd": "1-4",
"eosinophils_10e9_l": 0.1
},
{
"components": [
{
"value": "1-4",
"factor": "emrcd",
"points": 0,
"present": false
},
{
"value": 0.1,
"factor": "eosinopenia",
"points": 0,
"present": false
},
{
"factor": "consolidation",
"points": 0,
"present": false
},
{
"value": 7.4,
"factor": "acidemia",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"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": "Steer J, Gibson J, Bourke SC",
"doi": "10.1136/thoraxjnl-2012-202103",
"id": "steer-2012",
"pmid": "22895999",
"source": "Thorax. 2012;67(11):970-976",
"title": "The DECAF Score: predicting hospital mortality in exacerbations of chronic obstructive pulmonary disease"
},
"formula": "decaf",
"formula_expression": "DECAF = emrcd_points + eosinopenia + consolidation + acidemia + atrial_fibrillation; eMRCD 1-4 -> 0, 5a -> 1, 5b -> 2; eosinophils_10e9_l < 0.05 -> 1 (0.05 does not score); consolidation true -> 1; arterial_ph < 7.30 -> 1 (7.30 does not score); atrial_fibrillation true -> 1; bands 0-1 / 2 / 3-6; max 6",
"max_score": 6,
"score": 0,
"atrial_fibrillation": false,
"arterial_ph": 7.4,
"consolidation": false,
"decaf_band": "0-1",
"emrcd": "1-4",
"eosinophils_10e9_l": 0.1
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | decaf |
formula_expression |
string | Exact Steer 2012 expression |
score |
integer | DECAF points 0-6 |
max_score |
integer | Always 6 |
decaf_band |
string | Steer 2012 band 0-1 (low), 2 (moderate), or 3-6 (high). A band, not a mortality percent. |
emrcd |
string | Caller-assigned eMRCD: 1-4, 5a, or 5b |
eosinophils_10e9_l |
number | Eosinophil count ×10^9/L used |
consolidation |
boolean | Caller-assigned chest radiograph consolidation |
arterial_ph |
number | Arterial pH used |
atrial_fibrillation |
boolean | Caller-assigned atrial fibrillation |
components |
array | Per-factor points for emrcd, eosinopenia, consolidation, acidemia, and AF |
citation |
object | Steer et al. Thorax 2012 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": "1-4",
"factor": "emrcd",
"points": 0,
"present": false
},
{
"value": 0.1,
"factor": "eosinopenia",
"points": 0,
"present": false
},
{
"factor": "consolidation",
"points": 0,
"present": false
},
{
"value": 7.4,
"factor": "acidemia",
"points": 0,
"present": false
},
{
"factor": "atrial_fibrillation",
"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": "Steer J, Gibson J, Bourke SC",
"doi": "10.1136/thoraxjnl-2012-202103",
"id": "steer-2012",
"pmid": "22895999",
"source": "Thorax. 2012;67(11):970-976",
"title": "The DECAF Score: predicting hospital mortality in exacerbations of chronic obstructive pulmonary disease"
},
"formula": "decaf",
"formula_expression": "DECAF = emrcd_points + eosinopenia + consolidation + acidemia + atrial_fibrillation; eMRCD 1-4 -> 0, 5a -> 1, 5b -> 2; eosinophils_10e9_l < 0.05 -> 1 (0.05 does not score); consolidation true -> 1; arterial_ph < 7.30 -> 1 (7.30 does not score); atrial_fibrillation true -> 1; bands 0-1 / 2 / 3-6; max 6",
"max_score": 6,
"score": 0,
"atrial_fibrillation": false,
"arterial_ph": 7.4,
"consolidation": false,
"decaf_band": "0-1",
"emrcd": "1-4",
"eosinophils_10e9_l": 0.1
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_emrcd |
emrcd must be 1-4, 5a, or 5b (Steer 2012 extended MRC dyspnoea). Returned before settlement; you are not charged. |
| 400 | invalid_eosinophils |
eosinophils_10e9_l must be a number from 0 to 5 (Steer 2012). Returned before settlement; you are not charged. |
| 400 | invalid_arterial_ph |
arterial_ph must be a number from 6.80 to 7.80. Returned before settlement; you are not charged. |
| 400 | invalid_flag |
boolean clinical flags must be true or false 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
- BODE — Sum Celli 2004 BODE points from BMI, FEV1 percent predicted, MMRC dyspnea, and 6-minute walk distance.
- GAP index — Sum Ley 2012 GAP index points from sex, age, FVC percent predicted, and DLCO percent predicted or cannot-perform.
- CURB-65 — Compute the CURB-65 community-acquired pneumonia severity score from age and discrete flags.
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.
- 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.