# DRIP drug resistance in pneumonia

DRIP

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

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

## What it computes

Sum the Webb 2016 DRIP (drug resistance in pneumonia) major and minor flags and return score, max, and high_risk at ≥4.

## When to use

When an agent needs the published DRIP point total and must not invent an antibiotic order or HCAP criteria.

## When not to use

- Not a medical device.
- Not an antibiotic order and not a diagnosis of drug-resistant pneumonia.
- This tool is the Webb 2016 DRIP table only. It is not HCAP (healthcare-associated pneumonia) criteria.
- long_term_care is long-term acute care, skilled nursing, or inpatient rehabilitation as in Webb 2016; not assisted living or a group home. The caller assigns the flag; magent does not classify the facility.
- poor_functional_status is Karnofsky <70 or non-ambulatory as in Webb 2016. The caller supplies the boolean; magent does not compute Karnofsky.

## Formula

```
DRIP = antibiotics_60d (2) + long_term_care (2) + tube_feeding (2) + prior_drp_1yr (2) + hospitalization_60d (1) + chronic_pulmonary_disease (1) + poor_functional_status (1) + gastric_acid_suppression (1) + wound_care (1) + mrsa_colonization_1yr (1); max 14; high_risk iff score >= 4
```

## Citation

[Derivation and multicenter validation of the drug resistance in pneumonia clinical prediction score](https://doi.org/10.1128/AAC.03071-15)
Webb BJ, Dascomb K, Stenehjem E, et al.
Antimicrob Agents Chemother. 2016;60(5):2652-2663
DOI: [10.1128/AAC.03071-15](https://doi.org/10.1128/AAC.03071-15)

## Worked example

### All ten flags false

Given: `antibiotics_60d=false, chronic_pulmonary_disease=false, gastric_acid_suppression=false, hospitalization_60d=false, long_term_care=false, mrsa_colonization_1yr=false, poor_functional_status=false, prior_drp_1yr=false, tube_feeding=false, wound_care=false`

1. Four major flags absent → 0 each
2. Six minor flags absent → 0 each
3. Score = 0 (max 14); high_risk false


### All ten flags true

Given: `antibiotics_60d=true, chronic_pulmonary_disease=true, gastric_acid_suppression=true, hospitalization_60d=true, long_term_care=true, mrsa_colonization_1yr=true, poor_functional_status=true, prior_drp_1yr=true, tube_feeding=true, wound_care=true`

1. Four major flags → 2 each (8)
2. Six minor flags → 1 each (6)
3. Score = 14 (max 14); high_risk true


## Also searched as

- DRIP score
- drug resistance in pneumonia
- Webb DRIP
- DRIP pneumonia score
- drug-resistant pneumonia
- prior DRP score

## Parameters

- `antibiotics_60d` (boolean, required): Antibiotic use within 60 days (Webb 2016 major, 2 points). true or false as assigned by the caller.
- `long_term_care` (boolean, required): Residence in long-term acute care, a skilled nursing facility, or inpatient rehabilitation (Webb 2016 major, 2 points). Not assisted living or a group home. The caller assigns the flag; magent does not classify the facility. true or false.
- `tube_feeding` (boolean, required): Tube feeding (Webb 2016 major, 2 points). true or false as assigned by the caller.
- `prior_drp_1yr` (boolean, required): Prior drug-resistant pneumonia within 1 year (Webb 2016 major, 2 points). true or false as assigned by the caller.
- `hospitalization_60d` (boolean, required): Hospitalization within 60 days (Webb 2016 minor, 1 point). true or false as assigned by the caller.
- `chronic_pulmonary_disease` (boolean, required): Chronic pulmonary disease (Webb 2016 minor, 1 point). true or false as assigned by the caller.
- `poor_functional_status` (boolean, required): Poor functional status as in Webb 2016 (Karnofsky <70 or non-ambulatory). Caller-assigned boolean; magent does not compute Karnofsky. 1 point if true.
- `gastric_acid_suppression` (boolean, required): Gastric acid suppression (Webb 2016 minor, 1 point). true or false as assigned by the caller.
- `wound_care` (boolean, required): Wound care (Webb 2016 minor, 1 point). true or false as assigned by the caller.
- `mrsa_colonization_1yr` (boolean, required): MRSA colonization within 1 year (Webb 2016 minor, 1 point). true or false as assigned by the caller.

## 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/drip`
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": [
    {
      "antibiotics_60d": "false",
      "chronic_pulmonary_disease": "false",
      "gastric_acid_suppression": "false",
      "hospitalization_60d": "false",
      "long_term_care": "false",
      "mrsa_colonization_1yr": "false",
      "poor_functional_status": "false",
      "prior_drp_1yr": "false",
      "tube_feeding": "false",
      "wound_care": "false"
    },
    {
      "antibiotics_60d": "false",
      "chronic_pulmonary_disease": "false",
      "gastric_acid_suppression": "false",
      "hospitalization_60d": "false",
      "long_term_care": "false",
      "mrsa_colonization_1yr": "false",
      "poor_functional_status": "false",
      "prior_drp_1yr": "false",
      "tube_feeding": "false",
      "wound_care": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/drip",
  "items": [
    {
      "components": [
        {
          "factor": "antibiotics_60d",
          "points": 0,
          "present": false
        },
        {
          "factor": "long_term_care",
          "points": 0,
          "present": false
        },
        {
          "factor": "tube_feeding",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_drp_1yr",
          "points": 0,
          "present": false
        },
        {
          "factor": "hospitalization_60d",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_pulmonary_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "poor_functional_status",
          "points": 0,
          "present": false
        },
        {
          "factor": "gastric_acid_suppression",
          "points": 0,
          "present": false
        },
        {
          "factor": "wound_care",
          "points": 0,
          "present": false
        },
        {
          "factor": "mrsa_colonization_1yr",
          "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": "Webb BJ, Dascomb K, Stenehjem E, et al.",
        "doi": "10.1128/AAC.03071-15",
        "id": "webb-2016",
        "pmid": "26856838",
        "source": "Antimicrob Agents Chemother. 2016;60(5):2652-2663",
        "title": "Derivation and multicenter validation of the drug resistance in pneumonia clinical prediction score"
      },
      "formula": "drip",
      "formula_expression": "DRIP = antibiotics_60d (2) + long_term_care (2) + tube_feeding (2) + prior_drp_1yr (2) + hospitalization_60d (1) + chronic_pulmonary_disease (1) + poor_functional_status (1) + gastric_acid_suppression (1) + wound_care (1) + mrsa_colonization_1yr (1); max 14; high_risk iff score >= 4",
      "max_score": 14,
      "score": 0,
      "high_risk": false
    },
    {
      "components": [
        {
          "factor": "antibiotics_60d",
          "points": 0,
          "present": false
        },
        {
          "factor": "long_term_care",
          "points": 0,
          "present": false
        },
        {
          "factor": "tube_feeding",
          "points": 0,
          "present": false
        },
        {
          "factor": "prior_drp_1yr",
          "points": 0,
          "present": false
        },
        {
          "factor": "hospitalization_60d",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_pulmonary_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "poor_functional_status",
          "points": 0,
          "present": false
        },
        {
          "factor": "gastric_acid_suppression",
          "points": 0,
          "present": false
        },
        {
          "factor": "wound_care",
          "points": 0,
          "present": false
        },
        {
          "factor": "mrsa_colonization_1yr",
          "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": "Webb BJ, Dascomb K, Stenehjem E, et al.",
        "doi": "10.1128/AAC.03071-15",
        "id": "webb-2016",
        "pmid": "26856838",
        "source": "Antimicrob Agents Chemother. 2016;60(5):2652-2663",
        "title": "Derivation and multicenter validation of the drug resistance in pneumonia clinical prediction score"
      },
      "formula": "drip",
      "formula_expression": "DRIP = antibiotics_60d (2) + long_term_care (2) + tube_feeding (2) + prior_drp_1yr (2) + hospitalization_60d (1) + chronic_pulmonary_disease (1) + poor_functional_status (1) + gastric_acid_suppression (1) + wound_care (1) + mrsa_colonization_1yr (1); max 14; high_risk iff score >= 4",
      "max_score": 14,
      "score": 0,
      "high_risk": false
    }
  ]
}
```

## Response fields

- `formula` (string): drip
- `formula_expression` (string): Exact expression used
- `score` (integer): DRIP points 0-14 (Webb 2016)
- `max_score` (integer): 14
- `high_risk` (boolean): true iff score ≥ 4 (Webb 2016 cutoff). Not an antibiotic order and not a diagnosis of drug-resistant pneumonia.
- `components` (array): Per-factor points
- `citation` (object): Webb et al. AAC 2016 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "antibiotics_60d",
      "points": 0,
      "present": false
    },
    {
      "factor": "long_term_care",
      "points": 0,
      "present": false
    },
    {
      "factor": "tube_feeding",
      "points": 0,
      "present": false
    },
    {
      "factor": "prior_drp_1yr",
      "points": 0,
      "present": false
    },
    {
      "factor": "hospitalization_60d",
      "points": 0,
      "present": false
    },
    {
      "factor": "chronic_pulmonary_disease",
      "points": 0,
      "present": false
    },
    {
      "factor": "poor_functional_status",
      "points": 0,
      "present": false
    },
    {
      "factor": "gastric_acid_suppression",
      "points": 0,
      "present": false
    },
    {
      "factor": "wound_care",
      "points": 0,
      "present": false
    },
    {
      "factor": "mrsa_colonization_1yr",
      "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": "Webb BJ, Dascomb K, Stenehjem E, et al.",
    "doi": "10.1128/AAC.03071-15",
    "id": "webb-2016",
    "pmid": "26856838",
    "source": "Antimicrob Agents Chemother. 2016;60(5):2652-2663",
    "title": "Derivation and multicenter validation of the drug resistance in pneumonia clinical prediction score"
  },
  "formula": "drip",
  "formula_expression": "DRIP = antibiotics_60d (2) + long_term_care (2) + tube_feeding (2) + prior_drp_1yr (2) + hospitalization_60d (1) + chronic_pulmonary_disease (1) + poor_functional_status (1) + gastric_acid_suppression (1) + wound_care (1) + mrsa_colonization_1yr (1); max 14; high_risk iff score >= 4",
  "max_score": 14,
  "score": 0,
  "high_risk": false
}
```

## Errors

- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_drip`: each DRIP flag must be true or false (Webb 2016). 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

- [CURB-65](https://magentlab.com/docs/curb65) — Compute the CURB-65 community-acquired pneumonia severity score from age and discrete flags.
- [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.

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