# Clinical pulmonary infection score (Pugin)

CPIS

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

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

## What it computes

Sum the six Pugin 1991 CPIS domains (temperature, leukocytes, tracheal secretions, oxygenation, chest radiograph, tracheal-aspirate culture) and return le_6 or gt_6.

## When to use

When an agent needs the published Pugin 1991 CPIS total and >6 band and must not invent a VAP diagnosis, an antibiotic order, or Singh 2000 modified CPIS radiographic progression.

## When not to use

- Not a medical device and not a VAP diagnosis or antibiotic order. CPIS >6 suggested pulmonary infection in the Pugin 1991 derivation; it is not a diagnosis.
- This is original Pugin 1991 CPIS (max 12). It is not Singh 2000 modified CPIS and does not score day-3 radiographic progression.
- Chest radiograph (none, diffuse, or localized) and culture (none, pathogen, or pathogen_and_gram) are caller-assigned. magent does not read radiographs or Gram stains.
- Leukocyte band forms are the caller-assigned bands_ge_50 flag (≥50% bands). magent does not compute a differential.
- Pugin 1991 temperature bins are one-decimal. 36.1–36.4 and 38.91–38.99 are unpublished and score 0 (not ≤36.0, not 38.5–38.9, not ≥39.0). Do not invent a <39 one-point band.

## Formula

```
CPIS = temperature(36.5-38.4→0, 38.5-38.9→1, ≥39 or ≤36→2) + leukocytes(4.0-11.0→0, <4.0 or >11.0→1, +1 if abnormal and bands_ge_50) + tracheal_secretions(none→0, nonpurulent→1, purulent→2) + oxygenation(pf_ratio>240 or ards→0, pf_ratio≤240 and not ards→2) + chest_radiograph(none→0, diffuse→1, localized→2) + culture(none→0, pathogen→1, pathogen_and_gram→2); Pugin 1991; max 12; CPIS>6 suggests pulmonary infection in that derivation
```

## Citation

[Diagnosis of ventilator-associated pneumonia by bacteriologic analysis of bronchoscopic and nonbronchoscopic "blind" bronchoalveolar lavage fluid](https://doi.org/10.1164/ajrccm/143.5_Pt_1.1121)
Pugin J, Auckenthaler R, Mili N, Janssens JP, Lew PD, Suter PM
Am Rev Respir Dis. 1991;143(5 Pt 1):1121-1129
DOI: [10.1164/ajrccm/143.5_Pt_1.1121](https://doi.org/10.1164/ajrccm/143.5_Pt_1.1121)

## Worked example

### All zero-point domains

Given: `ards=false, bands_ge_50=false, chest_radiograph=none, culture=none, pf_ratio=300, temperature_c=37.0, tracheal_secretions=none, wbc_k_ul=8.0`

1. Temperature 37.0 → 0; WBC 8.0, bands_ge_50 false → 0; secretions none → 0; P/F 300, ARDS false → 0; radiograph none → 0; culture none → 0
2. Score = 0 (max 12); cpis_band = le_6


### Temperature 39, purulent secretions, localized infiltrate, pathogen

Given: `ards=false, bands_ge_50=false, chest_radiograph=localized, culture=pathogen, pf_ratio=300, temperature_c=39.0, tracheal_secretions=purulent, wbc_k_ul=8.0`

1. Temperature 39.0 → 2; purulent → 2; localized → 2; pathogen → 1; remaining domains 0
2. Score = 7 (max 12); cpis_band = gt_6. Not a VAP diagnosis.


## Also searched as

- clinical pulmonary infection score
- CPIS
- Pugin CPIS
- ventilator associated pneumonia score
- pulmonary infection score
- CPIS 1991

## Parameters

- `temperature_c` (number, required): Temperature in °C (30.0-45.0). 36.5-38.4 scores 0; 38.5-38.9 scores 1; ≥39.0 or ≤36.0 scores 2 (Pugin 1991).
- `wbc_k_ul` (number, required): WBC in 10^3/mm^3 (same as 10^3/µL or 10^9/L). Range 0.01-500. 4.0-11.0 scores 0; <4.0 or >11.0 scores 1. Abnormal WBC plus bands_ge_50 scores 2 for this domain.
- `bands_ge_50` (boolean, required): Caller-assigned ≥50% band forms (Pugin 1991). true adds 1 only when WBC is already <4.0 or >11.0. true or false.
- `tracheal_secretions` (string, required): Caller-assigned tracheal secretions. none scores 0; nonpurulent scores 1; purulent scores 2 (Pugin 1991).
- `pf_ratio` (number, required): PaO2/FiO2 in mm Hg (20-800). >240 or ards=true scores 0; ≤240 and ards=false scores 2 (Pugin 1991).
- `ards` (boolean, required): Caller-assigned ARDS. true scores 0 for oxygenation even when pf_ratio ≤240. true or false.
- `chest_radiograph` (string, required): Caller-assigned chest radiograph. none scores 0; diffuse scores 1; localized scores 2. magent does not read the radiograph.
- `culture` (string, required): Caller-assigned tracheal-aspirate culture. none scores 0; pathogen (moderate/heavy pathogenic growth) scores 1; pathogen_and_gram (same pathogen on Gram stain) scores 2. magent does not read Gram stains.

## 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/cpis`
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": [
    {
      "ards": "false",
      "bands_ge_50": "false",
      "chest_radiograph": "none",
      "culture": "none",
      "pf_ratio": "300",
      "temperature_c": "37.0",
      "tracheal_secretions": "none",
      "wbc_k_ul": "8.0"
    },
    {
      "ards": "false",
      "bands_ge_50": "false",
      "chest_radiograph": "none",
      "culture": "none",
      "pf_ratio": "300",
      "temperature_c": "37.0",
      "tracheal_secretions": "none",
      "wbc_k_ul": "8.0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/cpis",
  "items": [
    {
      "components": [
        {
          "value": 37.0,
          "factor": "temperature_c",
          "points": 0,
          "present": false
        },
        {
          "value": {
            "bands_ge_50": false,
            "wbc_k_ul": 8.0
          },
          "factor": "leukocytes",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "tracheal_secretions",
          "points": 0,
          "present": false
        },
        {
          "value": {
            "ards": false,
            "pf_ratio": 300.0
          },
          "factor": "oxygenation",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "chest_radiograph",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "culture",
          "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": "Pugin J, Auckenthaler R, Mili N, Janssens JP, Lew PD, Suter PM",
        "doi": "10.1164/ajrccm/143.5_Pt_1.1121",
        "id": "pugin-1991",
        "pmid": "2024824",
        "source": "Am Rev Respir Dis. 1991;143(5 Pt 1):1121-1129",
        "title": "Diagnosis of ventilator-associated pneumonia by bacteriologic analysis of bronchoscopic and nonbronchoscopic \"blind\" bronchoalveolar lavage fluid"
      },
      "formula": "cpis",
      "formula_expression": "CPIS = temperature(36.5-38.4→0, 38.5-38.9→1, ≥39 or ≤36→2) + leukocytes(4.0-11.0→0, <4.0 or >11.0→1, +1 if abnormal and bands_ge_50) + tracheal_secretions(none→0, nonpurulent→1, purulent→2) + oxygenation(pf_ratio>240 or ards→0, pf_ratio≤240 and not ards→2) + chest_radiograph(none→0, diffuse→1, localized→2) + culture(none→0, pathogen→1, pathogen_and_gram→2); Pugin 1991; max 12; CPIS>6 suggests pulmonary infection in that derivation",
      "max_score": 12,
      "score": 0,
      "temperature_c": 37.0,
      "bands_ge_50": false,
      "wbc_k_ul": 8.0,
      "ards": false,
      "pf_ratio": 300.0,
      "chest_radiograph": "none",
      "cpis_band": "le_6",
      "culture": "none",
      "tracheal_secretions": "none"
    },
    {
      "components": [
        {
          "value": 37.0,
          "factor": "temperature_c",
          "points": 0,
          "present": false
        },
        {
          "value": {
            "bands_ge_50": false,
            "wbc_k_ul": 8.0
          },
          "factor": "leukocytes",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "tracheal_secretions",
          "points": 0,
          "present": false
        },
        {
          "value": {
            "ards": false,
            "pf_ratio": 300.0
          },
          "factor": "oxygenation",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "chest_radiograph",
          "points": 0,
          "present": false
        },
        {
          "value": "none",
          "factor": "culture",
          "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": "Pugin J, Auckenthaler R, Mili N, Janssens JP, Lew PD, Suter PM",
        "doi": "10.1164/ajrccm/143.5_Pt_1.1121",
        "id": "pugin-1991",
        "pmid": "2024824",
        "source": "Am Rev Respir Dis. 1991;143(5 Pt 1):1121-1129",
        "title": "Diagnosis of ventilator-associated pneumonia by bacteriologic analysis of bronchoscopic and nonbronchoscopic \"blind\" bronchoalveolar lavage fluid"
      },
      "formula": "cpis",
      "formula_expression": "CPIS = temperature(36.5-38.4→0, 38.5-38.9→1, ≥39 or ≤36→2) + leukocytes(4.0-11.0→0, <4.0 or >11.0→1, +1 if abnormal and bands_ge_50) + tracheal_secretions(none→0, nonpurulent→1, purulent→2) + oxygenation(pf_ratio>240 or ards→0, pf_ratio≤240 and not ards→2) + chest_radiograph(none→0, diffuse→1, localized→2) + culture(none→0, pathogen→1, pathogen_and_gram→2); Pugin 1991; max 12; CPIS>6 suggests pulmonary infection in that derivation",
      "max_score": 12,
      "score": 0,
      "temperature_c": 37.0,
      "bands_ge_50": false,
      "wbc_k_ul": 8.0,
      "ards": false,
      "pf_ratio": 300.0,
      "chest_radiograph": "none",
      "cpis_band": "le_6",
      "culture": "none",
      "tracheal_secretions": "none"
    }
  ]
}
```

## Response fields

- `formula` (string): cpis
- `formula_expression` (string): Exact expression used
- `score` (integer): CPIS points 0-12
- `max_score` (integer): 12
- `cpis_band` (string): le_6 when score ≤6, gt_6 when score ≥7. Pugin 1991 CPIS>6 suggested pulmonary infection in that derivation. Not a VAP diagnosis.
- `temperature_c` (number): Temperature in °C used for scoring
- `wbc_k_ul` (number): WBC in 10^3/mm^3 used for scoring
- `bands_ge_50` (boolean): Caller-assigned ≥50% band forms used for the leukocyte domain
- `tracheal_secretions` (string): none, nonpurulent, or purulent
- `pf_ratio` (number): PaO2/FiO2 in mm Hg used for scoring
- `ards` (boolean): Caller-assigned ARDS used for oxygenation
- `chest_radiograph` (string): none, diffuse, or localized
- `culture` (string): none, pathogen, or pathogen_and_gram
- `components` (array): Per-domain Pugin 1991 points
- `citation` (object): Pugin et al. Am Rev Respir Dis 1991 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 37.0,
      "factor": "temperature_c",
      "points": 0,
      "present": false
    },
    {
      "value": {
        "bands_ge_50": false,
        "wbc_k_ul": 8.0
      },
      "factor": "leukocytes",
      "points": 0,
      "present": false
    },
    {
      "value": "none",
      "factor": "tracheal_secretions",
      "points": 0,
      "present": false
    },
    {
      "value": {
        "ards": false,
        "pf_ratio": 300.0
      },
      "factor": "oxygenation",
      "points": 0,
      "present": false
    },
    {
      "value": "none",
      "factor": "chest_radiograph",
      "points": 0,
      "present": false
    },
    {
      "value": "none",
      "factor": "culture",
      "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": "Pugin J, Auckenthaler R, Mili N, Janssens JP, Lew PD, Suter PM",
    "doi": "10.1164/ajrccm/143.5_Pt_1.1121",
    "id": "pugin-1991",
    "pmid": "2024824",
    "source": "Am Rev Respir Dis. 1991;143(5 Pt 1):1121-1129",
    "title": "Diagnosis of ventilator-associated pneumonia by bacteriologic analysis of bronchoscopic and nonbronchoscopic \"blind\" bronchoalveolar lavage fluid"
  },
  "formula": "cpis",
  "formula_expression": "CPIS = temperature(36.5-38.4→0, 38.5-38.9→1, ≥39 or ≤36→2) + leukocytes(4.0-11.0→0, <4.0 or >11.0→1, +1 if abnormal and bands_ge_50) + tracheal_secretions(none→0, nonpurulent→1, purulent→2) + oxygenation(pf_ratio>240 or ards→0, pf_ratio≤240 and not ards→2) + chest_radiograph(none→0, diffuse→1, localized→2) + culture(none→0, pathogen→1, pathogen_and_gram→2); Pugin 1991; max 12; CPIS>6 suggests pulmonary infection in that derivation",
  "max_score": 12,
  "score": 0,
  "temperature_c": 37.0,
  "bands_ge_50": false,
  "wbc_k_ul": 8.0,
  "ards": false,
  "pf_ratio": 300.0,
  "chest_radiograph": "none",
  "cpis_band": "le_6",
  "culture": "none",
  "tracheal_secretions": "none"
}
```

## Errors

- HTTP 400 `invalid_temperature`: temperature_c must be a number from 30.0 to 45.0. Returned before settlement; you are not charged.
- HTTP 400 `invalid_wbc`: wbc_k_ul (0.01-500) or wbc_ul (10-500000) is required 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_pf_ratio`: pf_ratio must be a number from 20 to 800. Returned before settlement; you are not charged.
- HTTP 400 `invalid_tracheal_secretions`: tracheal_secretions must be none, nonpurulent, or purulent (Pugin 1991 CPIS). Returned before settlement; you are not charged.
- HTTP 400 `invalid_chest_radiograph`: chest_radiograph must be none, diffuse, or localized (Pugin 1991 CPIS). Returned before settlement; you are not charged.
- HTTP 400 `invalid_cpis_culture`: culture must be none, pathogen, or pathogen_and_gram (Pugin 1991 CPIS). 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

- [SOFA](https://magentlab.com/docs/sofa) — Compute the Vincent 1996 SOFA score from PaO2/FiO2, platelets, bilirubin, MAP and adrenergic agents, GCS, and creatinine or urine output.
- [SIRS](https://magentlab.com/docs/sirs) — Compute the Bone 1992 ACCP/SCCM SIRS criteria from temperature, heart rate, respiratory rate, and WBC, with optional PaCO2 and band percent.

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