MAGENT

Respiratory · LIVE

qCSI (quick COVID-19 Severity Index)

qCSI

Sum Haimovich 2020 qCSI bedside points (Table 2) from respiratory rate, lowest SpO2, and nasal-cannula oxygen flow and return the integer total (max 12).

LIVE $0.005 USDC GET /api/calc/qcsi

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

Not a medical device. Not a diagnosis or dosing recommendation.

What it computes

Sum Haimovich 2020 qCSI bedside points (Table 2) from respiratory rate, lowest SpO2, and nasal-cannula oxygen flow and return the integer total (max 12).

When to use

Returns the published qCSI bedside point total.

When not to use

  • Not a medical device and not a COVID-19 diagnosis or triage order. Magent does not measure vitals.
  • This is the Haimovich 2020 qCSI bedside points score (Table 2; max 12) only. It is not the 12-variable gradient-boosting CSI model.
  • Derivation included nasal cannula oxygen ≤6 L/min and excluded higher flows. oxygen_l_min >6 is rejected.
  • Respiratory rate, SpO2, and oxygen flow are caller-supplied. Magent does not measure them. The paper associated a low score with <5% decompensation; Magent returns the integer total only and does not emit named risk classes.

Formula

qCSI = RR(≤22→0, 23–28→1, >28→2) + SpO2(>92→0, 89–92→2, ≤88→5) + O2_L_min(≤2→0, 3–4→4, 5–6→5); Haimovich 2020 Table 2 bedside; max 12

Citation

Title
Development and Validation of the Quick COVID-19 Severity Index: A Prognostic Tool for Early Clinical Decompensation
Authors
Haimovich AD, Ravindra NG, Stoytchev S, Young HP, Wilson FP, van Dijk D, Schulz WL, Taylor RA
Source
Ann Emerg Med. 2020;76(4):442-453
DOI
10.1016/j.annemergmed.2020.07.022

Worked example

All zero-point bands

Given: oxygen_l_min=0respiratory_rate=16spo2_percent=98

  1. RR 16 → 0; SpO2 98 → 0; O2 0 L/min → 0
  2. Score = 0 (max 12). Integer total only; no named risk class.

Also searched as

  • qCSI
  • quick COVID-19 Severity Index
  • Haimovich qCSI
  • qCSI score
  • quick CSI
  • COVID-19 severity index
  • Haimovich 2020 qCSI
  • bedside qCSI

Try

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

/api/calc/qcsi?respiratory_rate=16&spo2_percent=98&oxygen_l_min=0

Full URL: https://api.magentlab.com/api/calc/qcsi?respiratory_rate=16&spo2_percent=98&oxygen_l_min=0

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/qcsi?respiratory_rate=16&spo2_percent=98&oxygen_l_min=0"

Parameters

Name Type Required Description
respiratory_rate integer required Respiratory rate in breaths/min (integer 4-80). Haimovich 2020 Table 2: ≤22 → 0, 23-28 → 1, >28 → 2. magent does not measure vitals.
spo2_percent number required Lowest SpO2 percent as assigned by the caller (50-100). Haimovich 2020 Table 2: >92 → 0, 89-92 → 2, ≤88 → 5. magent does not measure SpO2.
oxygen_l_min number required Nasal-cannula oxygen flow in L/min (0-6). Haimovich 2020 Table 2: ≤2 → 0, 3-4 → 4, 5-6 → 5. Derivation excluded >6 L/min. magent does not measure flow.

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/qcsi 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": [
    {
      "oxygen_l_min": "0",
      "respiratory_rate": "16",
      "spo2_percent": "98"
    },
    {
      "oxygen_l_min": "0",
      "respiratory_rate": "16",
      "spo2_percent": "98"
    }
  ]
}

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/qcsi",
  "items": [
    {
      "components": [
        {
          "value": 16,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 98.0,
          "factor": "spo2_percent",
          "points": 0,
          "present": false
        },
        {
          "value": 0.0,
          "factor": "oxygen_l_min",
          "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": "Haimovich AD, Ravindra NG, Stoytchev S, Young HP, Wilson FP, van Dijk D, Schulz WL, Taylor RA",
        "doi": "10.1016/j.annemergmed.2020.07.022",
        "id": "haimovich-2020",
        "pmid": "33012378",
        "source": "Ann Emerg Med. 2020;76(4):442-453",
        "title": "Development and Validation of the Quick COVID-19 Severity Index: A Prognostic Tool for Early Clinical Decompensation"
      },
      "formula": "qcsi",
      "formula_expression": "qCSI = RR(≤22→0, 23–28→1, >28→2) + SpO2(>92→0, 89–92→2, ≤88→5) + O2_L_min(≤2→0, 3–4→4, 5–6→5); Haimovich 2020 Table 2 bedside; max 12",
      "max_score": 12,
      "score": 0,
      "spo2_percent": 98.0,
      "respiratory_rate": 16,
      "oxygen_l_min": 0.0
    },
    {
      "components": [
        {
          "value": 16,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 98.0,
          "factor": "spo2_percent",
          "points": 0,
          "present": false
        },
        {
          "value": 0.0,
          "factor": "oxygen_l_min",
          "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": "Haimovich AD, Ravindra NG, Stoytchev S, Young HP, Wilson FP, van Dijk D, Schulz WL, Taylor RA",
        "doi": "10.1016/j.annemergmed.2020.07.022",
        "id": "haimovich-2020",
        "pmid": "33012378",
        "source": "Ann Emerg Med. 2020;76(4):442-453",
        "title": "Development and Validation of the Quick COVID-19 Severity Index: A Prognostic Tool for Early Clinical Decompensation"
      },
      "formula": "qcsi",
      "formula_expression": "qCSI = RR(≤22→0, 23–28→1, >28→2) + SpO2(>92→0, 89–92→2, ≤88→5) + O2_L_min(≤2→0, 3–4→4, 5–6→5); Haimovich 2020 Table 2 bedside; max 12",
      "max_score": 12,
      "score": 0,
      "spo2_percent": 98.0,
      "respiratory_rate": 16,
      "oxygen_l_min": 0.0
    }
  ]
}

Response

Field Type Description
formula string qcsi
formula_expression string Exact expression used
score integer qCSI points 0-12
max_score integer Always 12
respiratory_rate integer Respiratory rate used, breaths/min
spo2_percent number Caller-assigned lowest SpO2 used, %
oxygen_l_min number Caller-assigned nasal-cannula oxygen flow used, L/min
components array Per-factor points
citation object Haimovich 2020 Ann Emerg Med citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "value": 16,
      "factor": "respiratory_rate",
      "points": 0,
      "present": false
    },
    {
      "value": 98.0,
      "factor": "spo2_percent",
      "points": 0,
      "present": false
    },
    {
      "value": 0.0,
      "factor": "oxygen_l_min",
      "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": "Haimovich AD, Ravindra NG, Stoytchev S, Young HP, Wilson FP, van Dijk D, Schulz WL, Taylor RA",
    "doi": "10.1016/j.annemergmed.2020.07.022",
    "id": "haimovich-2020",
    "pmid": "33012378",
    "source": "Ann Emerg Med. 2020;76(4):442-453",
    "title": "Development and Validation of the Quick COVID-19 Severity Index: A Prognostic Tool for Early Clinical Decompensation"
  },
  "formula": "qcsi",
  "formula_expression": "qCSI = RR(≤22→0, 23–28→1, >28→2) + SpO2(>92→0, 89–92→2, ≤88→5) + O2_L_min(≤2→0, 3–4→4, 5–6→5); Haimovich 2020 Table 2 bedside; max 12",
  "max_score": 12,
  "score": 0,
  "spo2_percent": 98.0,
  "respiratory_rate": 16,
  "oxygen_l_min": 0.0
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_respiratory_rate respiratory_rate must be an integer from 4 to 80. Returned before settlement; you are not charged.
400 invalid_spo2 spo2_percent must be a number from 50 to 100. Returned before settlement; you are not charged.
400 invalid_o2_flow_l_min oxygen_l_min must be a number from 0 to 6 (Haimovich 2020 qCSI; derivation excluded >6 L/min). 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

  • HACOR — Sum Duan 2017 HACOR (ESM Table 2) points from heart rate, pH, GCS, PaO2/FiO2, and respiratory rate and return low (≤5) or high (>5).

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.

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.