# Shorr score for MRSA pneumonia

Shorr score

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

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

## What it computes

Sum the Shorr 2013 Table 2 MRSA pneumonia risk points and return score, max_score, and the published low, medium, or high band.

## When to use

When an agent needs the published Shorr 2013 MRSA pneumonia point total and must not invent an antibiotic order, HCAP criteria, or DRIP.

## When not to use

- Not a medical device.
- Not an antibiotic order and not a MRSA diagnosis. This tool returns score, max_score, and risk_band only.
- Shorr 2013 Table 2 only. Not HCAP (healthcare-associated pneumonia) criteria and not the Webb 2016 DRIP score.
- hospitalization_90d is a recent inpatient stay of ≥2 days within 90 days as in Shorr 2013. The caller assigns the flag.
- nursing_home_ltac_snf is recent nursing home, LTAC, or SNF exposure as in Shorr 2013. magent does not classify the facility.
- Female with diabetes scores 1; diabetes in a male scores 0. Age <30 or >79 scores 1 (29 scores 1, 30 scores 0, 79 scores 0, 80 scores 1).

## Formula

```
Shorr = hospitalization_90d (2) + icu_admission (2) + age_lt_30_or_gt_79 (1) + prior_iv_antibiotics (1) + dementia (1) + cerebrovascular_disease (1) + female_and_diabetes (1) + nursing_home_ltac_snf (1); max 10; 0-1 low, 2-5 medium, >=6 high
```

## Citation

[A risk score for identifying methicillin-resistant Staphylococcus aureus in patients presenting to the hospital with pneumonia](https://doi.org/10.1186/1471-2334-13-268)
Shorr AF, Myers DE, Huang DB, Nathanson BH, Emons MF, Kollef MH
BMC Infect Dis. 2013;13:268
DOI: [10.1186/1471-2334-13-268](https://doi.org/10.1186/1471-2334-13-268)

## Worked example

### Age 50, male, all flags false

Given: `age=50, cerebrovascular_disease=false, dementia=false, diabetes=false, hospitalization_90d=false, icu_admission=false, nursing_home_ltac_snf=false, prior_iv_antibiotics=false, sex=male`

1. Age 50 is not <30 or >79 → 0; sex male and diabetes false → 0
2. hospitalization_90d, icu_admission, prior_iv_antibiotics, dementia, cerebrovascular_disease, and nursing_home_ltac_snf false → 0
3. Score = 0 (max 10); risk_band low


### Age 80, female, all Table 2 items present

Given: `age=80, cerebrovascular_disease=true, dementia=true, diabetes=true, hospitalization_90d=true, icu_admission=true, nursing_home_ltac_snf=true, prior_iv_antibiotics=true, sex=female`

1. hospitalization_90d 2 + icu_admission 2 + age >79 1 + prior_iv_antibiotics 1
2. dementia 1 + cerebrovascular_disease 1 + female and diabetes 1 + nursing_home_ltac_snf 1
3. Score = 10 (max 10); risk_band high


## Also searched as

- Shorr score
- Shorr MRSA pneumonia
- MRSA pneumonia risk score
- Shorr 2013
- methicillin-resistant Staphylococcus aureus pneumonia score
- hospital pneumonia MRSA score

## Parameters

- `age` (integer, required): Age in years (18-120). Shorr 2013 Table 2: <30 or >79 scores 1; 30 through 79 scores 0. 29 scores 1; 30 scores 0; 79 scores 0; 80 scores 1.
- `sex` (string, required): female or male. Female with diabetes scores 1 (Shorr 2013 Table 2). Male with diabetes scores 0. Sex alone does not score.
- `hospitalization_90d` (boolean, required): Recent inpatient hospitalization for ≥2 days within 90 days (Shorr 2013 Table 2, 2 points). true or false as assigned by the caller.
- `icu_admission` (boolean, required): ICU admission (Shorr 2013 Table 2, 2 points). true or false as assigned by the caller.
- `prior_iv_antibiotics` (boolean, required): Prior IV antibiotic exposure (Shorr 2013 Table 2, 1 point). true or false as assigned by the caller.
- `dementia` (boolean, required): Dementia (Shorr 2013 Table 2, 1 point). true or false as assigned by the caller.
- `cerebrovascular_disease` (boolean, required): Cerebrovascular disease (Shorr 2013 Table 2, 1 point). true or false as assigned by the caller.
- `diabetes` (boolean, required): Diabetes mellitus. Scores 1 only when sex is female (Shorr 2013 Table 2). Male with diabetes scores 0. true or false as assigned by the caller.
- `nursing_home_ltac_snf` (boolean, required): Recent nursing home, long-term acute care, or skilled nursing facility exposure (Shorr 2013 Table 2, 1 point). true or false as assigned by the caller. magent does not classify the facility.

## 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/shorr`
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": "50",
      "cerebrovascular_disease": "false",
      "dementia": "false",
      "diabetes": "false",
      "hospitalization_90d": "false",
      "icu_admission": "false",
      "nursing_home_ltac_snf": "false",
      "prior_iv_antibiotics": "false",
      "sex": "male"
    },
    {
      "age": "50",
      "cerebrovascular_disease": "false",
      "dementia": "false",
      "diabetes": "false",
      "hospitalization_90d": "false",
      "icu_admission": "false",
      "nursing_home_ltac_snf": "false",
      "prior_iv_antibiotics": "false",
      "sex": "male"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/shorr",
  "items": [
    {
      "components": [
        {
          "factor": "hospitalization_90d",
          "points": 0,
          "present": false
        },
        {
          "factor": "icu_admission",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_iv_antibiotics",
          "points": 0,
          "present": false
        },
        {
          "factor": "dementia",
          "points": 0,
          "present": false
        },
        {
          "factor": "cerebrovascular_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "female_diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "nursing_home_ltac_snf",
          "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": "Shorr AF, Myers DE, Huang DB, Nathanson BH, Emons MF, Kollef MH",
        "doi": "10.1186/1471-2334-13-268",
        "id": "shorr-2013",
        "pmid": "23742753",
        "source": "BMC Infect Dis. 2013;13:268",
        "title": "A risk score for identifying methicillin-resistant Staphylococcus aureus in patients presenting to the hospital with pneumonia"
      },
      "formula": "shorr",
      "formula_expression": "Shorr = hospitalization_90d (2) + icu_admission (2) + age_lt_30_or_gt_79 (1) + prior_iv_antibiotics (1) + dementia (1) + cerebrovascular_disease (1) + female_and_diabetes (1) + nursing_home_ltac_snf (1); max 10; 0-1 low, 2-5 medium, >=6 high",
      "max_score": 10,
      "score": 0,
      "age_years": 50,
      "risk_band": "low",
      "sex": "male"
    },
    {
      "components": [
        {
          "factor": "hospitalization_90d",
          "points": 0,
          "present": false
        },
        {
          "factor": "icu_admission",
          "points": 0,
          "present": false
        },
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_iv_antibiotics",
          "points": 0,
          "present": false
        },
        {
          "factor": "dementia",
          "points": 0,
          "present": false
        },
        {
          "factor": "cerebrovascular_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "female_diabetes",
          "points": 0,
          "present": false
        },
        {
          "factor": "nursing_home_ltac_snf",
          "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": "Shorr AF, Myers DE, Huang DB, Nathanson BH, Emons MF, Kollef MH",
        "doi": "10.1186/1471-2334-13-268",
        "id": "shorr-2013",
        "pmid": "23742753",
        "source": "BMC Infect Dis. 2013;13:268",
        "title": "A risk score for identifying methicillin-resistant Staphylococcus aureus in patients presenting to the hospital with pneumonia"
      },
      "formula": "shorr",
      "formula_expression": "Shorr = hospitalization_90d (2) + icu_admission (2) + age_lt_30_or_gt_79 (1) + prior_iv_antibiotics (1) + dementia (1) + cerebrovascular_disease (1) + female_and_diabetes (1) + nursing_home_ltac_snf (1); max 10; 0-1 low, 2-5 medium, >=6 high",
      "max_score": 10,
      "score": 0,
      "age_years": 50,
      "risk_band": "low",
      "sex": "male"
    }
  ]
}
```

## Response fields

- `formula` (string): shorr
- `formula_expression` (string): Exact expression used
- `score` (integer): Shorr 2013 Table 2 points 0-10
- `max_score` (integer): 10
- `risk_band` (string): Shorr 2013 band: low (0-1), medium (2-5), or high (≥6). A band, not a MRSA prevalence and not an antibiotic order.
- `age_years` (integer): Age used for the <30 or >79 criterion
- `sex` (string): female or male used for the female-with-diabetes item
- `components` (array): Per-factor points
- `citation` (object): Shorr et al. BMC Infect Dis 2013 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "hospitalization_90d",
      "points": 0,
      "present": false
    },
    {
      "factor": "icu_admission",
      "points": 0,
      "present": false
    },
    {
      "value": 50,
      "factor": "age",
      "points": 0,
      "present": false
    },
    {
      "factor": "prior_iv_antibiotics",
      "points": 0,
      "present": false
    },
    {
      "factor": "dementia",
      "points": 0,
      "present": false
    },
    {
      "factor": "cerebrovascular_disease",
      "points": 0,
      "present": false
    },
    {
      "factor": "female_diabetes",
      "points": 0,
      "present": false
    },
    {
      "factor": "nursing_home_ltac_snf",
      "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": "Shorr AF, Myers DE, Huang DB, Nathanson BH, Emons MF, Kollef MH",
    "doi": "10.1186/1471-2334-13-268",
    "id": "shorr-2013",
    "pmid": "23742753",
    "source": "BMC Infect Dis. 2013;13:268",
    "title": "A risk score for identifying methicillin-resistant Staphylococcus aureus in patients presenting to the hospital with pneumonia"
  },
  "formula": "shorr",
  "formula_expression": "Shorr = hospitalization_90d (2) + icu_admission (2) + age_lt_30_or_gt_79 (1) + prior_iv_antibiotics (1) + dementia (1) + cerebrovascular_disease (1) + female_and_diabetes (1) + nursing_home_ltac_snf (1); max 10; 0-1 low, 2-5 medium, >=6 high",
  "max_score": 10,
  "score": 0,
  "age_years": 50,
  "risk_band": "low",
  "sex": "male"
}
```

## Errors

- HTTP 400 `invalid_age`: age must be an integer from 18 to 120 Returned before settlement; you are not charged.
- HTTP 400 `invalid_sex`: sex must be female or male 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_shorr`: each Shorr 2013 MRSA pneumonia item must be a published value. 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

- [DRIP](https://magentlab.com/docs/drip) — Sum the Webb 2016 DRIP (drug resistance in pneumonia) major and minor flags and return score, max, and high_risk at ≥4.
- [CURB-65](https://magentlab.com/docs/curb65) — 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.

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