# SMART-COP pneumonia IRVS

SMART-COP

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

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

## What it computes

Compute the Charles 2008 SMART-COP point total and IRVS risk band for community-acquired pneumonia.

## When to use

When an agent needs the published Charles 2008 SMART-COP total and IRVS band and must not invent a site-of-care or ICU-admission decision.

## When not to use

- Not a medical device and not a site-of-care, admission, ICU, or treatment protocol.
- Charles 2008 SMART-COP only. Not CURB-65, CRB-65, or PSI/PORT. Those are separate tools.
- Respiratory rate and oxygenation cutoffs are age-adjusted at 50 years (≤50 vs >50) as published.
- Provide exactly one of pao2_mm_hg, spo2_percent, or pf_ratio. magent does not combine them.
- Albumin is g/dL or g/L, not mixed. arterial_ph is optional; omitted pH scores 0 (Charles 2008 missing-pH assumption).
- magent does not interpret chest radiographs or assess confusion. multilobar_cxr and confusion are caller-assigned flags.

## Formula

```
SMART-COP (Charles 2008) = SBP<90 (2) + multilobar_cxr (1) + albumin<3.5 g/dL (1) + age-adjusted RR (1; age<=50 RR>=25, age>50 RR>=30) + HR>=125 (1) + confusion (1) + age-adjusted low oxygen (2; age<=50 PaO2<70 or SpO2<=93 or P/F<333; age>50 PaO2<60 or SpO2<=90 or P/F<250) + arterial_pH<7.35 (2; omitted pH scores 0); max 11; IRVS 0-2 low, 3-4 moderate, 5-6 high, >=7 very high
```

## Citation

[SMART-COP: a tool for predicting the need for intensive respiratory or vasopressor support in community-acquired pneumonia](https://doi.org/10.1086/589754)
Charles PGP, Wolfe R, Whitby M, et al.
Clin Infect Dis. 2008;47(3):375-384
DOI: [10.1086/589754](https://doi.org/10.1086/589754)

## Worked example

### Age 40, normal vitals and labs (low IRVS risk)

Given: `age=40, albumin_g_dl=4.0, arterial_ph=7.40, confusion=false, heart_rate_bpm=80, multilobar_cxr=false, respiratory_rate=16, spo2_percent=98, systolic_mm_hg=120`

1. SBP 120 is not <90 → 0; multilobar false → 0; albumin 4.0 is not <3.5 → 0
2. Age 40 ≤50: RR 16 is not ≥25 → 0; HR 80 is not ≥125 → 0; confusion false → 0
3. SpO2 98 is not ≤93 → 0; pH 7.40 is not <7.35 → 0
4. score = 0; irvs_risk = low (0–2)


### SBP 89, confusion, SpO2 93, pH 7.30 (very high IRVS risk)

Given: `age=40, albumin_g_dl=4.0, arterial_ph=7.30, confusion=true, heart_rate_bpm=80, multilobar_cxr=false, respiratory_rate=16, spo2_percent=93, systolic_mm_hg=89`

1. SBP 89 < 90 → 2; confusion true → 1; age ≤50 SpO2 93 ≤ 93 → 2; pH 7.30 < 7.35 → 2
2. score = 7; irvs_risk = very_high (≥7)


## Also searched as

- SMART-COP
- SMARTCOP
- Charles SMART-COP
- IRVS pneumonia
- community-acquired pneumonia SMART-COP
- SMART COP score

## Parameters

- `age` (integer, required): Age in years (18-120). Age ≤50 uses RR ≥25, PaO2 <70, SpO2 ≤93%, P/F <333. Age >50 uses RR ≥30, PaO2 <60, SpO2 ≤90%, P/F <250.
- `systolic_mm_hg` (number, required): Systolic blood pressure in mm Hg (50-250). Scores 2 when <90; 90 does not score (Charles 2008 S).
- `multilobar_cxr` (boolean, required): Multilobar involvement on chest radiograph as assigned by the caller (Charles 2008 M). true or false. 1 point if true. magent does not interpret radiographs.
- `albumin_g_dl` (number, optional): Albumin in g/dL (1-6). Provide this or albumin_g_l, not both. Scores 1 when <3.5; 3.5 does not score (Charles 2008 A).
- `albumin_g_l` (number, optional): Albumin in g/L (10-60). Converted as g/dL = g/L / 10. Provide this or albumin_g_dl, not both. Scores 1 when <35 g/L.
- `respiratory_rate` (integer, required): Respiratory rate in breaths/min (integer 4-80). Age ≤50: ≥25 scores 1 (24 does not). Age >50: ≥30 scores 1 (29 does not). Charles 2008 R.
- `heart_rate_bpm` (integer, required): Heart rate in beats per minute (integer 30-220). Scores 1 when ≥125; 124 does not score (Charles 2008 T).
- `confusion` (boolean, required): New or acute confusion as assigned by the caller (Charles 2008 C). true or false. 1 point if true. magent does not assess mental status.
- `pao2_mm_hg` (number, optional): Arterial PaO2 in mm Hg (20-700). Provide exactly one of pao2_mm_hg, spo2_percent, or pf_ratio. Age ≤50: <70 scores 2. Age >50: <60 scores 2.
- `spo2_percent` (number, optional): Oxygen saturation percent (50-100). Provide exactly one of pao2_mm_hg, spo2_percent, or pf_ratio. Age ≤50: ≤93 scores 2. Age >50: ≤90 scores 2.
- `pf_ratio` (number, optional): PaO2/FiO2 ratio (20-800). Provide exactly one of pao2_mm_hg, spo2_percent, or pf_ratio. Age ≤50: <333 scores 2. Age >50: <250 scores 2.
- `arterial_ph` (number, optional): Arterial pH (6.80-7.80). Optional. Scores 2 when <7.35; 7.35 does not score. Omitted pH scores 0 (Charles 2008 missing-pH assumption).

## 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/smart_cop`
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": "40",
      "albumin_g_dl": "4.0",
      "arterial_ph": "7.40",
      "confusion": "false",
      "heart_rate_bpm": "80",
      "multilobar_cxr": "false",
      "respiratory_rate": "16",
      "spo2_percent": "98",
      "systolic_mm_hg": "120"
    },
    {
      "age": "40",
      "albumin_g_dl": "4.0",
      "arterial_ph": "7.40",
      "confusion": "false",
      "heart_rate_bpm": "80",
      "multilobar_cxr": "false",
      "respiratory_rate": "16",
      "spo2_percent": "98",
      "systolic_mm_hg": "120"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/smart_cop",
  "items": [
    {
      "components": [
        {
          "value": 120.0,
          "factor": "systolic_lt_90",
          "points": 0,
          "present": false
        },
        {
          "factor": "multilobar_cxr",
          "points": 0,
          "present": false
        },
        {
          "value": 4.0,
          "factor": "albumin_lt_3_5",
          "points": 0,
          "present": false
        },
        {
          "value": 16,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate_ge_125",
          "points": 0,
          "present": false
        },
        {
          "factor": "confusion",
          "points": 0,
          "present": false
        },
        {
          "input": "spo2_percent",
          "value": 98.0,
          "factor": "oxygen_low",
          "points": 0,
          "present": false
        },
        {
          "value": 7.4,
          "factor": "arterial_ph_lt_7_35",
          "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": "Charles PGP, Wolfe R, Whitby M, et al.",
        "doi": "10.1086/589754",
        "id": "charles-2008",
        "pmid": "18558884",
        "source": "Clin Infect Dis. 2008;47(3):375-384",
        "title": "SMART-COP: a tool for predicting the need for intensive respiratory or vasopressor support in community-acquired pneumonia"
      },
      "formula": "smart_cop",
      "formula_expression": "SMART-COP (Charles 2008) = SBP<90 (2) + multilobar_cxr (1) + albumin<3.5 g/dL (1) + age-adjusted RR (1; age<=50 RR>=25, age>50 RR>=30) + HR>=125 (1) + confusion (1) + age-adjusted low oxygen (2; age<=50 PaO2<70 or SpO2<=93 or P/F<333; age>50 PaO2<60 or SpO2<=90 or P/F<250) + arterial_pH<7.35 (2; omitted pH scores 0); max 11; IRVS 0-2 low, 3-4 moderate, 5-6 high, >=7 very high",
      "max_score": 11,
      "score": 0,
      "albumin_g_dl": 4.0,
      "age_years": 40,
      "systolic_mm_hg": 120.0,
      "heart_rate_bpm": 80,
      "arterial_ph": 7.4,
      "respiratory_rate": 16,
      "spo2_percent": 98.0,
      "irvs_risk": "low"
    },
    {
      "components": [
        {
          "value": 120.0,
          "factor": "systolic_lt_90",
          "points": 0,
          "present": false
        },
        {
          "factor": "multilobar_cxr",
          "points": 0,
          "present": false
        },
        {
          "value": 4.0,
          "factor": "albumin_lt_3_5",
          "points": 0,
          "present": false
        },
        {
          "value": 16,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate_ge_125",
          "points": 0,
          "present": false
        },
        {
          "factor": "confusion",
          "points": 0,
          "present": false
        },
        {
          "input": "spo2_percent",
          "value": 98.0,
          "factor": "oxygen_low",
          "points": 0,
          "present": false
        },
        {
          "value": 7.4,
          "factor": "arterial_ph_lt_7_35",
          "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": "Charles PGP, Wolfe R, Whitby M, et al.",
        "doi": "10.1086/589754",
        "id": "charles-2008",
        "pmid": "18558884",
        "source": "Clin Infect Dis. 2008;47(3):375-384",
        "title": "SMART-COP: a tool for predicting the need for intensive respiratory or vasopressor support in community-acquired pneumonia"
      },
      "formula": "smart_cop",
      "formula_expression": "SMART-COP (Charles 2008) = SBP<90 (2) + multilobar_cxr (1) + albumin<3.5 g/dL (1) + age-adjusted RR (1; age<=50 RR>=25, age>50 RR>=30) + HR>=125 (1) + confusion (1) + age-adjusted low oxygen (2; age<=50 PaO2<70 or SpO2<=93 or P/F<333; age>50 PaO2<60 or SpO2<=90 or P/F<250) + arterial_pH<7.35 (2; omitted pH scores 0); max 11; IRVS 0-2 low, 3-4 moderate, 5-6 high, >=7 very high",
      "max_score": 11,
      "score": 0,
      "albumin_g_dl": 4.0,
      "age_years": 40,
      "systolic_mm_hg": 120.0,
      "heart_rate_bpm": 80,
      "arterial_ph": 7.4,
      "respiratory_rate": 16,
      "spo2_percent": 98.0,
      "irvs_risk": "low"
    }
  ]
}
```

## Response fields

- `formula` (string): smart_cop
- `formula_expression` (string): Exact expression used
- `score` (integer): SMART-COP points 0-11
- `max_score` (integer): 11
- `irvs_risk` (string): Charles 2008 IRVS band: low (0-2), moderate (3-4), high (5-6), or very_high (≥7). A band, not a site-of-care decision.
- `age_years` (integer): Age used for RR and oxygen cutoffs
- `systolic_mm_hg` (number): Systolic pressure used, mm Hg
- `albumin_g_dl` (number): Albumin used in g/dL (after conversion)
- `respiratory_rate` (integer): Respiratory rate used
- `heart_rate_bpm` (integer): Heart rate used
- `pao2_mm_hg` (number): PaO2 used when that oxygen input was given
- `spo2_percent` (number): SpO2 used when that oxygen input was given
- `pf_ratio` (number): P/F used when that oxygen input was given
- `arterial_ph` (number): Arterial pH when supplied; omitted when the param is absent
- `components` (array): Per-criterion SMART-COP points
- `citation` (object): Charles 2008 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 120.0,
      "factor": "systolic_lt_90",
      "points": 0,
      "present": false
    },
    {
      "factor": "multilobar_cxr",
      "points": 0,
      "present": false
    },
    {
      "value": 4.0,
      "factor": "albumin_lt_3_5",
      "points": 0,
      "present": false
    },
    {
      "value": 16,
      "factor": "respiratory_rate",
      "points": 0,
      "present": false
    },
    {
      "value": 80,
      "factor": "heart_rate_ge_125",
      "points": 0,
      "present": false
    },
    {
      "factor": "confusion",
      "points": 0,
      "present": false
    },
    {
      "input": "spo2_percent",
      "value": 98.0,
      "factor": "oxygen_low",
      "points": 0,
      "present": false
    },
    {
      "value": 7.4,
      "factor": "arterial_ph_lt_7_35",
      "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": "Charles PGP, Wolfe R, Whitby M, et al.",
    "doi": "10.1086/589754",
    "id": "charles-2008",
    "pmid": "18558884",
    "source": "Clin Infect Dis. 2008;47(3):375-384",
    "title": "SMART-COP: a tool for predicting the need for intensive respiratory or vasopressor support in community-acquired pneumonia"
  },
  "formula": "smart_cop",
  "formula_expression": "SMART-COP (Charles 2008) = SBP<90 (2) + multilobar_cxr (1) + albumin<3.5 g/dL (1) + age-adjusted RR (1; age<=50 RR>=25, age>50 RR>=30) + HR>=125 (1) + confusion (1) + age-adjusted low oxygen (2; age<=50 PaO2<70 or SpO2<=93 or P/F<333; age>50 PaO2<60 or SpO2<=90 or P/F<250) + arterial_pH<7.35 (2; omitted pH scores 0); max 11; IRVS 0-2 low, 3-4 moderate, 5-6 high, >=7 very high",
  "max_score": 11,
  "score": 0,
  "albumin_g_dl": 4.0,
  "age_years": 40,
  "systolic_mm_hg": 120.0,
  "heart_rate_bpm": 80,
  "arterial_ph": 7.4,
  "respiratory_rate": 16,
  "spo2_percent": 98.0,
  "irvs_risk": "low"
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_systolic_bp`: systolic_mm_hg or systolic_bp_mm_hg must be a number from 50 to 250. 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_albumin`: albumin_g_dl (1-6) or albumin_g_l (10-60) is required Returned before settlement; you are not charged.
- HTTP 400 `invalid_respiratory_rate`: respiratory_rate must be an integer from 4 to 80. Returned before settlement; you are not charged.
- HTTP 400 `invalid_heart_rate`: heart_rate_bpm must be an integer from 30 to 220 Returned before settlement; you are not charged.
- HTTP 400 `invalid_smart_cop_oxygen`: provide exactly one of pao2_mm_hg, spo2_percent, or pf_ratio (Charles 2008). Returned before settlement; you are not charged.
- HTTP 400 `invalid_pao2`: pao2_mm_hg must be a number from 20 to 700. Returned before settlement; you are not charged.
- HTTP 400 `invalid_spo2`: spo2_percent must be a number from 50 to 100. 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_arterial_ph`: arterial_ph must be a number from 6.80 to 7.80. 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

- [PSI / PORT](https://magentlab.com/docs/psi-port) — Compute the Fine 1997 Pneumonia Severity Index (PORT) two-step risk class and Table 2 point total for community-acquired pneumonia.
- [CURB-65](https://magentlab.com/docs/curb65) — Compute the CURB-65 community-acquired pneumonia severity score from age and discrete flags.
- [CRB-65](https://magentlab.com/docs/crb-65) — Compute the Lim 2003 CRB-65 community-acquired pneumonia score from age and caller-assigned confusion, respiratory-rate, and blood-pressure flags. Urea is not an input.

## 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 echoing accepted, payload, and extensions when present).
- 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.
