# du Bois IPF score

du Bois IPF

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

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

## What it computes

Sum du Bois 2011 Table 4 points from age, 24-week respiratory hospitalization, FVC percent predicted, and 24-week change in FVC percent predicted (abbreviated four-predictor model).

## When to use

When an agent needs the published du Bois 2011 four-predictor IPF point total and must not invent a 1-year mortality percent, a GAP stage, or a transplant listing.

## When not to use

- Not a medical device and not a transplant listing protocol. Returns the published du Bois 2011 Table 4 point total only; Table 4 expected 1-year risk percents have gaps and are not interpolated.
- Not the Ley 2012 GAP index. Age and FVC bands follow du Bois 2011 Table 4, not GAP cutoffs.
- FVC percent predicted and 24-week FVC change are caller-supplied. magent does not perform spirometry or compute percent predicted from raw volumes.
- Abbreviated four-predictor clinical model omits DLCO and SGRQ by design (du Bois 2011). Respiratory hospitalization is a caller-assigned 24-week history flag.

## Formula

```
du_bois = age_points + hospitalization_points + fvc_points + fvc_change_points; age <60 -> 0, 60-69 -> 4, >=70 -> 8; respiratory_hospitalization false -> 0, true -> 14; FVC% <50 -> 18, 51-65 -> 13, 66-79 -> 8, >80 -> 0 (50 and 80 unpublished); 24-wk FVC% change <= -10 -> 21, > -10 and < -4.9 -> 10, >= -4.9 -> 0; max 61; score only
```

## Citation

[Ascertainment of individual risk of mortality for patients with idiopathic pulmonary fibrosis](https://doi.org/10.1164/rccm.201011-1790OC)
du Bois RM, Weycker D, Albera C, Bradford WZ, Costabel U, Kartashov A, Lancaster L, Noble PW, Raghu G, Sahn SA, Szwarcberg J, Thomeer M, Valeyre D, King TE Jr
Am J Respir Crit Care Med. 2011;184(4):459-466
DOI: [10.1164/rccm.201011-1790OC](https://doi.org/10.1164/rccm.201011-1790OC)

## Worked example

### Table 4 footnote (score 31)

Given: `age=70, fvc_change_24wk=-7, fvc_percent_predicted=55, respiratory_hospitalization=false`

1. Age 70 ≥70 → 8; no respiratory hospitalization → 0; FVC 55% in 51–65 → 13; 24-week change −7 (between −10 and −4.9) → 10
2. Score = 31


### All 0-point bands

Given: `age=55, fvc_change_24wk=0, fvc_percent_predicted=81, respiratory_hospitalization=false`

1. Age 55 <60 → 0; no hospitalization → 0; FVC 81% >80 → 0; 24-week change 0 ≥ −4.9 → 0
2. Score = 0


## Also searched as

- du Bois score
- du Bois IPF
- IPF mortality score
- idiopathic pulmonary fibrosis risk
- four-predictor IPF
- du Bois 2011

## Parameters

- `age` (integer, required): Age in years (integer 18-120). du Bois 2011 Table 4: <60 scores 0; 60-69 scores 4; >=70 scores 8.
- `respiratory_hospitalization` (boolean, required): 24-week history of respiratory hospitalization (true or false). du Bois 2011 Table 4: false scores 0; true scores 14.
- `fvc_percent_predicted` (number, required): FVC percent predicted (10-150). du Bois 2011 Table 4: <50 scores 18; 51-65 scores 13; 66-79 scores 8; >80 scores 0. Exactly 50 or 80 is unpublished.
- `fvc_change_24wk` (number, required): 24-week change in FVC percent predicted, in percentage points (-50 to 50). du Bois 2011 Table 4: <= -10 scores 21; > -10 and < -4.9 scores 10; >= -4.9 scores 0.

## 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/du_bois`
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": "70",
      "fvc_change_24wk": "-7",
      "fvc_percent_predicted": "55",
      "respiratory_hospitalization": "false"
    },
    {
      "age": "70",
      "fvc_change_24wk": "-7",
      "fvc_percent_predicted": "55",
      "respiratory_hospitalization": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/du_bois",
  "items": [
    {
      "components": [
        {
          "value": 70,
          "factor": "age",
          "points": 8,
          "present": true
        },
        {
          "value": false,
          "factor": "respiratory_hospitalization",
          "points": 0,
          "present": false
        },
        {
          "value": 55.0,
          "factor": "fvc",
          "points": 13,
          "present": true
        },
        {
          "value": -7.0,
          "factor": "fvc_change",
          "points": 10,
          "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.",
      "age_years": 70,
      "citation": {
        "authors": "du Bois RM, Weycker D, Albera C, Bradford WZ, Costabel U, Kartashov A, Lancaster L, Noble PW, Raghu G, Sahn SA, Szwarcberg J, Thomeer M, Valeyre D, King TE Jr",
        "doi": "10.1164/rccm.201011-1790OC",
        "id": "du-bois-2011",
        "pmid": "21616999",
        "source": "Am J Respir Crit Care Med. 2011;184(4):459-466",
        "title": "Ascertainment of individual risk of mortality for patients with idiopathic pulmonary fibrosis"
      },
      "formula": "du_bois",
      "formula_expression": "du_bois = age_points + hospitalization_points + fvc_points + fvc_change_points; age <60 -> 0, 60-69 -> 4, >=70 -> 8; respiratory_hospitalization false -> 0, true -> 14; FVC% <50 -> 18, 51-65 -> 13, 66-79 -> 8, >80 -> 0 (50 and 80 unpublished); 24-wk FVC% change <= -10 -> 21, > -10 and < -4.9 -> 10, >= -4.9 -> 0; max 61; score only",
      "max_score": 61,
      "score": 31,
      "fvc_change_24wk": -7.0,
      "fvc_percent_predicted": 55.0,
      "respiratory_hospitalization": false
    },
    {
      "components": [
        {
          "value": 70,
          "factor": "age",
          "points": 8,
          "present": true
        },
        {
          "value": false,
          "factor": "respiratory_hospitalization",
          "points": 0,
          "present": false
        },
        {
          "value": 55.0,
          "factor": "fvc",
          "points": 13,
          "present": true
        },
        {
          "value": -7.0,
          "factor": "fvc_change",
          "points": 10,
          "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.",
      "age_years": 70,
      "citation": {
        "authors": "du Bois RM, Weycker D, Albera C, Bradford WZ, Costabel U, Kartashov A, Lancaster L, Noble PW, Raghu G, Sahn SA, Szwarcberg J, Thomeer M, Valeyre D, King TE Jr",
        "doi": "10.1164/rccm.201011-1790OC",
        "id": "du-bois-2011",
        "pmid": "21616999",
        "source": "Am J Respir Crit Care Med. 2011;184(4):459-466",
        "title": "Ascertainment of individual risk of mortality for patients with idiopathic pulmonary fibrosis"
      },
      "formula": "du_bois",
      "formula_expression": "du_bois = age_points + hospitalization_points + fvc_points + fvc_change_points; age <60 -> 0, 60-69 -> 4, >=70 -> 8; respiratory_hospitalization false -> 0, true -> 14; FVC% <50 -> 18, 51-65 -> 13, 66-79 -> 8, >80 -> 0 (50 and 80 unpublished); 24-wk FVC% change <= -10 -> 21, > -10 and < -4.9 -> 10, >= -4.9 -> 0; max 61; score only",
      "max_score": 61,
      "score": 31,
      "fvc_change_24wk": -7.0,
      "fvc_percent_predicted": 55.0,
      "respiratory_hospitalization": false
    }
  ]
}
```

## Response fields

- `formula` (string): du_bois
- `formula_expression` (string): Exact du Bois 2011 four-predictor Table 4 expression
- `score` (integer): du Bois 2011 Table 4 points 0-61
- `max_score` (integer): Always 61
- `age_years` (integer): Age in years used
- `respiratory_hospitalization` (boolean): Caller-assigned 24-week respiratory hospitalization flag
- `fvc_percent_predicted` (number): FVC percent predicted used
- `fvc_change_24wk` (number): 24-week change in FVC percent predicted, in percentage points
- `components` (array): Per-factor points for age, hospitalization, fvc, and fvc_change
- `citation` (object): du Bois et al. Am J Respir Crit Care Med 2011 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 70,
      "factor": "age",
      "points": 8,
      "present": true
    },
    {
      "value": false,
      "factor": "respiratory_hospitalization",
      "points": 0,
      "present": false
    },
    {
      "value": 55.0,
      "factor": "fvc",
      "points": 13,
      "present": true
    },
    {
      "value": -7.0,
      "factor": "fvc_change",
      "points": 10,
      "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.",
  "age_years": 70,
  "citation": {
    "authors": "du Bois RM, Weycker D, Albera C, Bradford WZ, Costabel U, Kartashov A, Lancaster L, Noble PW, Raghu G, Sahn SA, Szwarcberg J, Thomeer M, Valeyre D, King TE Jr",
    "doi": "10.1164/rccm.201011-1790OC",
    "id": "du-bois-2011",
    "pmid": "21616999",
    "source": "Am J Respir Crit Care Med. 2011;184(4):459-466",
    "title": "Ascertainment of individual risk of mortality for patients with idiopathic pulmonary fibrosis"
  },
  "formula": "du_bois",
  "formula_expression": "du_bois = age_points + hospitalization_points + fvc_points + fvc_change_points; age <60 -> 0, 60-69 -> 4, >=70 -> 8; respiratory_hospitalization false -> 0, true -> 14; FVC% <50 -> 18, 51-65 -> 13, 66-79 -> 8, >80 -> 0 (50 and 80 unpublished); 24-wk FVC% change <= -10 -> 21, > -10 and < -4.9 -> 10, >= -4.9 -> 0; max 61; score only",
  "max_score": 61,
  "score": 31,
  "fvc_change_24wk": -7.0,
  "fvc_percent_predicted": 55.0,
  "respiratory_hospitalization": false
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_fvc_percent`: fvc_percent_predicted must be a number from 10 to 150. Returned before settlement; you are not charged.
- HTTP 400 `invalid_du_bois_fvc`: fvc_percent_predicted must be <50, 51-65, 66-79, or >80 (du Bois 2011 Table 4; 50 and 80 are not published cells). Returned before settlement; you are not charged.
- HTTP 400 `invalid_fvc_change`: fvc_change_24wk must be a number from -50 to 50 (du Bois 2011 24-week change in % predicted FVC). 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

- [GAP index](https://magentlab.com/docs/gap-index) — Sum Ley 2012 GAP index points from sex, age, FVC percent predicted, and DLCO percent predicted or cannot-perform.

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