MAGENT

Infection / VTE · LIVE

SCAP (España 2006)

SCAP

Apply the España 2006 SCAP major/minor rule from eight caller-assigned flags and return major_count, minor_count, score, and whether the published severe threshold is met.

LIVE $0.005 USDC GET /api/calc/scap

Markdown: /docs/scap.md · Canonical: https://magentlab.com/docs/scap

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

What it computes

Apply the España 2006 SCAP major/minor rule from eight caller-assigned flags and return major_count, minor_count, score, and whether the published severe threshold is met.

When to use

When an agent already has the published España 2006 predictors assigned as flags and needs the 1-major or ≥2-minor severe rule. magent does not measure pH, blood pressure, respiratory rate, BUN, or PaO2, and does not read radiographs.

When not to use

  • Not a medical device and not a diagnosis of pneumonia.
  • Not an ICU-admission, site-of-care, or treatment order.
  • España 2006 major/minor rule only. Not CURB-65, not PSI/PORT, and not SMART-COP.
  • The caller assigns every flag. magent does not measure pH, blood pressure, respiratory rate, BUN, or PaO2, and does not interpret radiographs.
  • hypoxemia is caller-assigned as PaO2 <54 mm Hg or PaO2/FiO2 <250. magent does not combine those measurements.
  • Each true predictor scores 1 (max 8). This is the published 1-major or ≥2-minor rule, not secondary 13/11/9/6/5 integer cards or 0–9 / 10–19 / ≥20 classes.

Formula

SCAP severe iff 1 major (ph_lt_7_30 or sbp_lt_90) OR >=2 minor (respiratory_rate_gt_30, altered_mental_status, bun_gt_30_mg_dl, hypoxemia, age_ge_80, multilobar_or_bilateral); 1 point per true predictor (España 2006 major/minor rule; not beta-derived integer cards); max 8

Citation

Title
Development and validation of a clinical prediction rule for severe community-acquired pneumonia
Authors
España PP, Capelastegui A, Gorordo I, Esteban C, Oribe M, Ortega M, Bilbao A, Quintana JM
Source
Am J Respir Crit Care Med. 2006;174(11):1249-1256
DOI
10.1164/rccm.200602-177OC

Worked example

All eight flags absent

Given: age_ge_80=falsealtered_mental_status=falsebun_gt_30_mg_dl=falsehypoxemia=falsemultilobar_or_bilateral=falseph_lt_7_30=falserespiratory_rate_gt_30=falsesbp_lt_90=false

  1. Both major flags are false → major_count = 0
  2. All six minor flags are false → minor_count = 0
  3. score = 0; scap_severe is false (needs 1 major or ≥2 minor)

Also searched as

  • SCAP
  • España 2006 SCAP
  • severe community-acquired pneumonia
  • SCAP rule
  • CURXO80
  • España severe CAP
  • SCAP major minor criteria

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/scap?ph_lt_7_30=false&sbp_lt_90=false&respiratory_rate_gt_30=false&altered_mental_status=false&bun_gt_30_mg_dl=false&hypoxemia=false&age_ge_80=false&multilobar_or_bilateral=false

Full URL: https://api.magentlab.com/api/calc/scap?ph_lt_7_30=false&sbp_lt_90=false&respiratory_rate_gt_30=false&altered_mental_status=false&bun_gt_30_mg_dl=false&hypoxemia=false&age_ge_80=false&multilobar_or_bilateral=false

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/scap?ph_lt_7_30=false&sbp_lt_90=false&respiratory_rate_gt_30=false&altered_mental_status=false&bun_gt_30_mg_dl=false&hypoxemia=false&age_ge_80=false&multilobar_or_bilateral=false"

Parameters

Name Type Required Description
ph_lt_7_30 boolean required Arterial pH <7.30 (España 2006 major). true or false as assigned by the caller. magent does not measure pH.
sbp_lt_90 boolean required Systolic blood pressure <90 mm Hg (España 2006 major). true or false as assigned by the caller. magent does not measure blood pressure.
respiratory_rate_gt_30 boolean required Respiratory rate >30 breaths/min (España 2006 minor; strict greater-than, not ≥30). true or false as assigned by the caller. magent does not measure respiratory rate.
altered_mental_status boolean required Altered mental status (España 2006 minor). true or false as assigned by the caller. magent does not assess mental status.
bun_gt_30_mg_dl boolean required Blood urea nitrogen >30 mg/dL (España 2006 minor). true or false as assigned by the caller. magent does not convert urea or measure BUN.
hypoxemia boolean required Hypoxemia as PaO2 <54 mm Hg or PaO2/FiO2 <250 (España 2006 minor), as assigned by the caller. true or false. magent does not measure PaO2 or FiO2.
age_ge_80 boolean required Age ≥80 years (España 2006 minor). true or false as assigned by the caller. magent does not compute age.
multilobar_or_bilateral boolean required Multilobar or bilateral lung involvement (España 2006 minor). true or false as assigned by the caller. magent does not interpret radiographs.

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.

POST /api/calc/scap Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 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 (fixture)

{
  "items": [
    {
      "age_ge_80": "false",
      "altered_mental_status": "false",
      "bun_gt_30_mg_dl": "false",
      "hypoxemia": "false",
      "multilobar_or_bilateral": "false",
      "ph_lt_7_30": "false",
      "respiratory_rate_gt_30": "false",
      "sbp_lt_90": "false"
    },
    {
      "age_ge_80": "false",
      "altered_mental_status": "false",
      "bun_gt_30_mg_dl": "false",
      "hypoxemia": "false",
      "multilobar_or_bilateral": "false",
      "ph_lt_7_30": "false",
      "respiratory_rate_gt_30": "false",
      "sbp_lt_90": "false"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/scap",
  "items": [
    {
      "components": [
        {
          "factor": "ph_lt_7_30",
          "points": 0,
          "present": false
        },
        {
          "factor": "sbp_lt_90",
          "points": 0,
          "present": false
        },
        {
          "factor": "respiratory_rate_gt_30",
          "points": 0,
          "present": false
        },
        {
          "factor": "altered_mental_status",
          "points": 0,
          "present": false
        },
        {
          "factor": "bun_gt_30_mg_dl",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypoxemia",
          "points": 0,
          "present": false
        },
        {
          "factor": "age_ge_80",
          "points": 0,
          "present": false
        },
        {
          "factor": "multilobar_or_bilateral",
          "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": "España PP, Capelastegui A, Gorordo I, Esteban C, Oribe M, Ortega M, Bilbao A, Quintana JM",
        "doi": "10.1164/rccm.200602-177OC",
        "id": "espana-2006",
        "pmid": "16973986",
        "source": "Am J Respir Crit Care Med. 2006;174(11):1249-1256",
        "title": "Development and validation of a clinical prediction rule for severe community-acquired pneumonia"
      },
      "formula": "scap",
      "formula_expression": "SCAP severe iff 1 major (ph_lt_7_30 or sbp_lt_90) OR >=2 minor (respiratory_rate_gt_30, altered_mental_status, bun_gt_30_mg_dl, hypoxemia, age_ge_80, multilobar_or_bilateral); 1 point per true predictor (España 2006 major/minor rule; not beta-derived integer cards); max 8",
      "max_score": 8,
      "score": 0,
      "major_count": 0,
      "minor_count": 0,
      "scap_severe": false
    },
    {
      "components": [
        {
          "factor": "ph_lt_7_30",
          "points": 0,
          "present": false
        },
        {
          "factor": "sbp_lt_90",
          "points": 0,
          "present": false
        },
        {
          "factor": "respiratory_rate_gt_30",
          "points": 0,
          "present": false
        },
        {
          "factor": "altered_mental_status",
          "points": 0,
          "present": false
        },
        {
          "factor": "bun_gt_30_mg_dl",
          "points": 0,
          "present": false
        },
        {
          "factor": "hypoxemia",
          "points": 0,
          "present": false
        },
        {
          "factor": "age_ge_80",
          "points": 0,
          "present": false
        },
        {
          "factor": "multilobar_or_bilateral",
          "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": "España PP, Capelastegui A, Gorordo I, Esteban C, Oribe M, Ortega M, Bilbao A, Quintana JM",
        "doi": "10.1164/rccm.200602-177OC",
        "id": "espana-2006",
        "pmid": "16973986",
        "source": "Am J Respir Crit Care Med. 2006;174(11):1249-1256",
        "title": "Development and validation of a clinical prediction rule for severe community-acquired pneumonia"
      },
      "formula": "scap",
      "formula_expression": "SCAP severe iff 1 major (ph_lt_7_30 or sbp_lt_90) OR >=2 minor (respiratory_rate_gt_30, altered_mental_status, bun_gt_30_mg_dl, hypoxemia, age_ge_80, multilobar_or_bilateral); 1 point per true predictor (España 2006 major/minor rule; not beta-derived integer cards); max 8",
      "max_score": 8,
      "score": 0,
      "major_count": 0,
      "minor_count": 0,
      "scap_severe": false
    }
  ]
}

Response

Field Type Description
formula string scap
formula_expression string España 2006 1-major or ≥2-minor rule with 1 point per true predictor
score integer Count of true predictors (0-8). Not a 13/11/9/6/5 weighted card.
max_score integer Always 8
major_count integer Count of true major flags: ph_lt_7_30 and sbp_lt_90 (0-2)
minor_count integer Count of true minor flags: respiratory_rate_gt_30, altered_mental_status, bun_gt_30_mg_dl, hypoxemia, age_ge_80, multilobar_or_bilateral (0-6)
scap_severe boolean true when major_count ≥1 or minor_count ≥2 (España 2006). Not a pneumonia diagnosis and not an ICU-admission order.
components array Per-predictor points (1 if true, else 0)
citation object España 2006 AJRCCM citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "components": [
    {
      "factor": "ph_lt_7_30",
      "points": 0,
      "present": false
    },
    {
      "factor": "sbp_lt_90",
      "points": 0,
      "present": false
    },
    {
      "factor": "respiratory_rate_gt_30",
      "points": 0,
      "present": false
    },
    {
      "factor": "altered_mental_status",
      "points": 0,
      "present": false
    },
    {
      "factor": "bun_gt_30_mg_dl",
      "points": 0,
      "present": false
    },
    {
      "factor": "hypoxemia",
      "points": 0,
      "present": false
    },
    {
      "factor": "age_ge_80",
      "points": 0,
      "present": false
    },
    {
      "factor": "multilobar_or_bilateral",
      "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": "España PP, Capelastegui A, Gorordo I, Esteban C, Oribe M, Ortega M, Bilbao A, Quintana JM",
    "doi": "10.1164/rccm.200602-177OC",
    "id": "espana-2006",
    "pmid": "16973986",
    "source": "Am J Respir Crit Care Med. 2006;174(11):1249-1256",
    "title": "Development and validation of a clinical prediction rule for severe community-acquired pneumonia"
  },
  "formula": "scap",
  "formula_expression": "SCAP severe iff 1 major (ph_lt_7_30 or sbp_lt_90) OR >=2 minor (respiratory_rate_gt_30, altered_mental_status, bun_gt_30_mg_dl, hypoxemia, age_ge_80, multilobar_or_bilateral); 1 point per true predictor (España 2006 major/minor rule; not beta-derived integer cards); max 8",
  "max_score": 8,
  "score": 0,
  "major_count": 0,
  "minor_count": 0,
  "scap_severe": false
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_flag boolean clinical flags must be true or false Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • CURB-65 — Compute the CURB-65 community-acquired pneumonia severity score from age and discrete flags.
  • 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. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /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.