# SOFA-2 organ failure score

SOFA-2

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

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

## What it computes

Compute the Ranzani 2025 SOFA-2 score from oxygenation (PaO2/FiO2 or SpO2/FiO2), advanced respiratory support or ECMO, MAP and vasopressor doses, caller-assigned GCS, bilirubin, platelets, and creatinine, urine output, or RRT.

## When to use

When an agent needs the published Ranzani 2025 SOFA-2 total and must not use Vincent 1996 SOFA cutoffs or invent gastrointestinal or immune points.

## When not to use

- Not a medical device. Not a diagnosis of sepsis or organ failure and not a treatment order. magent does not examine the patient.
- Ranzani 2025 SOFA-2 only. Not Vincent 1996 SOFA (use sofa). Gastrointestinal and immune systems are not in SOFA-2.
- GCS is a caller-assigned integer 3-15 (last pre-sedation GCS, or the motor scale when the three-domain GCS cannot be evaluated). Delirium-drug scoring is the caller's assignment that drugs were given to treat delirium.
- Vasopressor points use the published dose as assigned by the caller; magent does not time the ≥1 h infusion. Norepinephrine is scored as the base. RRT eligibility, ECMO indication, mechanical circulatory support, and ceiling-of-treatment or resource-unavailable flags are caller-assigned.

## Formula

```
SOFA-2 = brain + respiratory + cardiovascular + liver + kidney + hemostasis; each 0-4; max 24
```

## Citation

[Development and Validation of the Sequential Organ Failure Assessment (SOFA)-2 Score](https://doi.org/10.1001/jama.2025.20516)
Ranzani OT, Singer M, Salluh JIF, Shankar-Hari M, Pilcher D, Berger-Estilita J, Coopersmith CM, Juffermans NP, Laffey J, Reinikainen M, Serpa Neto A, Tavares M, Timsit JF, Arias Lopez MDP, Arulkumaran N, Aryal D, Azoulay E, Celi LA, Chaudhuri D, De Lange D, De Waele J, Dos Santos CC, Du B, Einav S, Engelbrecht T, Fazla F, Ferrer R, Finazzi S, Fujii T, Gershengorn HB, Greene JD, Haniffa R, Hao S, Hasan MS, Hollenberg S, Ippolito M, Jung C, Kirov M, Kobari S, Lakbar I, Lipman J, Liu V, Liu X, Lobo SM, Magatti D, Martin GS, Metnitz B, Metnitz P, Myatra SN, Oczkowski S, Paiva JA, Paruk F, Pekkarinen PT, Piquilloud L, Pölkki A, Prescott HC, Reintam Blaser A, Rezende E, Robba C, Rochwerg B, Ruckly S, Samei R, Schenck EJ, Secombe P, Sendagire C, Siaw-Frimpong M, Simpkin AJ, Soares M, Summers C, Szczeklik W, Takala J, Tanaka S, Tricella G, Vincent JL, Wendon J, Zampieri FG, Rhodes A, Moreno R
JAMA. 2025 (SOFA-2)
DOI: [10.1001/jama.2025.20516](https://doi.org/10.1001/jama.2025.20516)

## Worked example

### All organs 0

Given: `advanced_ventilatory_support=false, bilirubin_mg_dl=0.8, creatinine_mg_dl=1.0, fio2=0.21, gcs=15, map_mm_hg=80, pao2_mm_hg=96, platelets_10e9_l=200`

1. PaO2/FiO2 96/0.21 >300 → 0; no advanced support; platelets 200 → 0; bilirubin 0.8 → 0; MAP 80, no pressors → 0; GCS 15 → 0; creatinine 1.0 → 0
2. Score = 0 (max 24)


## Also searched as

- SOFA-2
- SOFA 2
- Sequential Organ Failure Assessment 2
- Ranzani SOFA-2
- SOFA-2 score
- updated SOFA

## Parameters

- `pao2_mm_hg` (number, optional): Arterial PaO2 in mm Hg (20-700). Provide this with fio2, or spo2 with fio2 when PaO2 is unavailable. PaO2/FiO2 >300 scores 0; ≤300 scores 1; ≤225 scores 2; ≤150 with advanced ventilatory support scores 3; ≤75 with advanced ventilatory support scores 4. Respiratory ECMO scores 4 regardless of the ratio.
- `spo2` (number, optional): Pulse-oximetry SpO2 as a percent (50-97.9). Used with fio2 only when pao2_mm_hg is absent and SpO2 is <98 (Ranzani 2025). SpO2/FiO2 >300 scores 0; ≤300 scores 1; ≤250 scores 2; ≤200 with advanced ventilatory support scores 3; ≤120 with advanced ventilatory support or ECMO scores 4.
- `fio2` (number, required): Inspired oxygen as a fraction (0.21-1.0), not a percent.
- `advanced_ventilatory_support` (boolean, required): High-flow nasal cannula, CPAP, bilevel positive airway pressure, noninvasive ventilation, invasive mechanical ventilation, or long-term home ventilation (Ranzani 2025). true or false. Respiratory scores 3 and 4 require this, ventilatory_support_unavailable, or respiratory ECMO.
- `ecmo` (boolean, optional): Respiratory ECMO of any form. true or false when provided; absent is false. true scores respiratory 4 regardless of PaO2/FiO2 or SpO2/FiO2 and does not by itself score cardiovascular points.
- `ventilatory_support_unavailable` (boolean, optional): Advanced ventilatory support not available or precluded by a ceiling of treatment (Ranzani 2025). true or false when provided; absent is false. When true, oxygenation ratios may score 3 or 4 without advanced_ventilatory_support.
- `platelets_10e9_l` (number, required): Platelets ×10^9/L, same as ×10^3/μL (1-2000). >150 scores 0; ≤150 scores 1; ≤100 scores 2; ≤80 scores 3; ≤50 scores 4.
- `bilirubin_mg_dl` (number, optional): Total bilirubin in mg/dL (0.1-40). Provide this or bilirubin_umol_l. ≤1.20 scores 0; ≤3.0 scores 1; ≤6.0 scores 2; ≤12.0 scores 3; >12.0 scores 4.
- `bilirubin_umol_l` (number, optional): Total bilirubin in µmol/L (2-684). ≤20.6 scores 0; ≤51.3 scores 1; ≤102.6 scores 2; ≤205 scores 3; >205 scores 4.
- `map_mm_hg` (number, required): Mean arterial pressure in mm Hg (20-180). MAP <70 with no vasopressor or inotrope scores 1 unless a higher cardiovascular band applies. When vasoactive_unavailable is true, MAP ≥70 scores 0; 60-69 scores 1; 50-59 scores 2; 40-49 scores 3; <40 scores 4.
- `norepinephrine_ug_kg_min` (number, optional): Norepinephrine as the base in µg/kg·min (0-10) when provided. Absent is 0. Summed with epinephrine: >0 to ≤0.2 scores 2; >0.2 to ≤0.4 scores 3; >0.4 scores 4. Low-dose plus any other vasopressor or inotrope scores 3; medium-dose plus any other, or mechanical circulatory support, scores 4.
- `epinephrine_ug_kg_min` (number, optional): Epinephrine in µg/kg·min (0-10) when provided. Absent is 0. Added to norepinephrine for the published dose bands.
- `dopamine_ug_kg_min` (number, optional): Dopamine in µg/kg·min (0-80) when provided. Absent is 0. As a single vasopressor: ≤20 scores 2; >20 to 40 scores 3; >40 scores 4. With norepinephrine, epinephrine, or another agent it counts as an other vasopressor or inotrope.
- `other_vasopressor_or_inotrope` (boolean, optional): Any other vasopressor or inotrope (Ranzani 2025). true or false when provided; absent is false. Any dose scores cardiovascular 2 unless a higher norepinephrine/epinephrine or mechanical band applies.
- `mechanical_circulatory_support` (boolean, optional): Mechanical circulatory support (veno-arterial ECMO, intra-aortic balloon pump, left ventricular assist device, or microaxial flow pump). true or false when provided; absent is false. true scores cardiovascular 4.
- `vasoactive_unavailable` (boolean, optional): Vasoactive drugs unavailable or precluded by a ceiling of treatment (Ranzani 2025). true or false when provided; absent is false. When true, cardiovascular points use the MAP-only cutoffs unless mechanical_circulatory_support is true.
- `gcs` (integer, required): Glasgow Coma Scale total as assigned by the caller (integer 3-15), including last pre-sedation GCS or the motor scale when the three-domain GCS cannot be evaluated. 15 scores 0; 13-14 scores 1; 9-12 scores 2; 6-8 scores 3; 3-5 scores 4. magent does not examine the patient.
- `delirium_drugs` (boolean, optional): Drugs given to treat delirium (Ranzani 2025). true or false when provided; absent is false. true scores brain at least 1 even if GCS is 15.
- `creatinine_mg_dl` (number, optional): Creatinine in mg/dL (0.1-20). Provide this, creatinine_umol_l, or rrt=true. ≤1.20 scores 0; ≤2.0 scores 1; ≤3.50 scores 2; >3.50 scores 3. Kidney is the max of creatinine, urine, and RRT.
- `creatinine_umol_l` (number, optional): Creatinine in µmol/L (9-1768). ≤110 scores 0; ≤170 scores 1; ≤300 scores 2; >300 scores 3.
- `urine_output_ml_kg_h` (number, optional): Urine output in mL/kg/h (0-20) when provided. Provide oliguria_hours with this. <0.5 for 6-12 h scores 1; <0.5 for ≥12 h scores 2; <0.3 for ≥24 h or anuria (0 mL) for ≥12 h scores 3.
- `oliguria_hours` (number, optional): Hours at the reported urine_output_ml_kg_h (0-72). Required when urine_output_ml_kg_h is provided.
- `rrt` (boolean, optional): Receiving renal replacement therapy or fulfilling published RRT criteria, including chronic use (Ranzani 2025). true or false when provided; absent is false. true scores kidney 4. Non-renal RRT is not scored; the caller assigns this flag.

## 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/sofa_2`
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": [
    {
      "advanced_ventilatory_support": "false",
      "bilirubin_mg_dl": "0.8",
      "creatinine_mg_dl": "1.0",
      "fio2": "0.21",
      "gcs": "15",
      "map_mm_hg": "80",
      "pao2_mm_hg": "96",
      "platelets_10e9_l": "200"
    },
    {
      "advanced_ventilatory_support": "false",
      "bilirubin_mg_dl": "0.8",
      "creatinine_mg_dl": "1.0",
      "fio2": "0.21",
      "gcs": "15",
      "map_mm_hg": "80",
      "pao2_mm_hg": "96",
      "platelets_10e9_l": "200"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/sofa_2",
  "items": [
    {
      "components": [
        {
          "value": 15,
          "factor": "brain",
          "points": 0,
          "present": false
        },
        {
          "value": 457.14285714285717,
          "factor": "respiratory",
          "points": 0,
          "present": false
        },
        {
          "value": 80.0,
          "factor": "cardiovascular",
          "points": 0,
          "present": false
        },
        {
          "value": 0.8,
          "factor": "liver",
          "points": 0,
          "present": false
        },
        {
          "value": {
            "rrt": false,
            "creatinine": {
              "mg_dl": 1.0
            },
            "urine": null
          },
          "factor": "kidney",
          "points": 0,
          "present": false
        },
        {
          "value": 200.0,
          "factor": "hemostasis",
          "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": "Ranzani OT, Singer M, Salluh JIF, Shankar-Hari M, Pilcher D, Berger-Estilita J, Coopersmith CM, Juffermans NP, Laffey J, Reinikainen M, Serpa Neto A, Tavares M, Timsit JF, Arias Lopez MDP, Arulkumaran N, Aryal D, Azoulay E, Celi LA, Chaudhuri D, De Lange D, De Waele J, Dos Santos CC, Du B, Einav S, Engelbrecht T, Fazla F, Ferrer R, Finazzi S, Fujii T, Gershengorn HB, Greene JD, Haniffa R, Hao S, Hasan MS, Hollenberg S, Ippolito M, Jung C, Kirov M, Kobari S, Lakbar I, Lipman J, Liu V, Liu X, Lobo SM, Magatti D, Martin GS, Metnitz B, Metnitz P, Myatra SN, Oczkowski S, Paiva JA, Paruk F, Pekkarinen PT, Piquilloud L, Pölkki A, Prescott HC, Reintam Blaser A, Rezende E, Robba C, Rochwerg B, Ruckly S, Samei R, Schenck EJ, Secombe P, Sendagire C, Siaw-Frimpong M, Simpkin AJ, Soares M, Summers C, Szczeklik W, Takala J, Tanaka S, Tricella G, Vincent JL, Wendon J, Zampieri FG, Rhodes A, Moreno R",
        "doi": "10.1001/jama.2025.20516",
        "id": "ranzani-2025",
        "pmid": "41159833",
        "source": "JAMA. 2025 (SOFA-2)",
        "title": "Development and Validation of the Sequential Organ Failure Assessment (SOFA)-2 Score"
      },
      "formula": "sofa_2",
      "formula_expression": "SOFA-2 = brain + respiratory + cardiovascular + liver + kidney + hemostasis; each 0-4; max 24",
      "max_score": 24,
      "score": 0
    },
    {
      "components": [
        {
          "value": 15,
          "factor": "brain",
          "points": 0,
          "present": false
        },
        {
          "value": 457.14285714285717,
          "factor": "respiratory",
          "points": 0,
          "present": false
        },
        {
          "value": 80.0,
          "factor": "cardiovascular",
          "points": 0,
          "present": false
        },
        {
          "value": 0.8,
          "factor": "liver",
          "points": 0,
          "present": false
        },
        {
          "value": {
            "rrt": false,
            "creatinine": {
              "mg_dl": 1.0
            },
            "urine": null
          },
          "factor": "kidney",
          "points": 0,
          "present": false
        },
        {
          "value": 200.0,
          "factor": "hemostasis",
          "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": "Ranzani OT, Singer M, Salluh JIF, Shankar-Hari M, Pilcher D, Berger-Estilita J, Coopersmith CM, Juffermans NP, Laffey J, Reinikainen M, Serpa Neto A, Tavares M, Timsit JF, Arias Lopez MDP, Arulkumaran N, Aryal D, Azoulay E, Celi LA, Chaudhuri D, De Lange D, De Waele J, Dos Santos CC, Du B, Einav S, Engelbrecht T, Fazla F, Ferrer R, Finazzi S, Fujii T, Gershengorn HB, Greene JD, Haniffa R, Hao S, Hasan MS, Hollenberg S, Ippolito M, Jung C, Kirov M, Kobari S, Lakbar I, Lipman J, Liu V, Liu X, Lobo SM, Magatti D, Martin GS, Metnitz B, Metnitz P, Myatra SN, Oczkowski S, Paiva JA, Paruk F, Pekkarinen PT, Piquilloud L, Pölkki A, Prescott HC, Reintam Blaser A, Rezende E, Robba C, Rochwerg B, Ruckly S, Samei R, Schenck EJ, Secombe P, Sendagire C, Siaw-Frimpong M, Simpkin AJ, Soares M, Summers C, Szczeklik W, Takala J, Tanaka S, Tricella G, Vincent JL, Wendon J, Zampieri FG, Rhodes A, Moreno R",
        "doi": "10.1001/jama.2025.20516",
        "id": "ranzani-2025",
        "pmid": "41159833",
        "source": "JAMA. 2025 (SOFA-2)",
        "title": "Development and Validation of the Sequential Organ Failure Assessment (SOFA)-2 Score"
      },
      "formula": "sofa_2",
      "formula_expression": "SOFA-2 = brain + respiratory + cardiovascular + liver + kidney + hemostasis; each 0-4; max 24",
      "max_score": 24,
      "score": 0
    }
  ]
}
```

## Response fields

- `formula` (string): sofa_2
- `formula_expression` (string): Exact expression used
- `score` (integer): Total points 0-24
- `max_score` (integer): Always 24
- `components` (array): Per-organ 0-4 points
- `citation` (object): Ranzani 2025 JAMA citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 15,
      "factor": "brain",
      "points": 0,
      "present": false
    },
    {
      "value": 457.14285714285717,
      "factor": "respiratory",
      "points": 0,
      "present": false
    },
    {
      "value": 80.0,
      "factor": "cardiovascular",
      "points": 0,
      "present": false
    },
    {
      "value": 0.8,
      "factor": "liver",
      "points": 0,
      "present": false
    },
    {
      "value": {
        "rrt": false,
        "creatinine": {
          "mg_dl": 1.0
        },
        "urine": null
      },
      "factor": "kidney",
      "points": 0,
      "present": false
    },
    {
      "value": 200.0,
      "factor": "hemostasis",
      "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": "Ranzani OT, Singer M, Salluh JIF, Shankar-Hari M, Pilcher D, Berger-Estilita J, Coopersmith CM, Juffermans NP, Laffey J, Reinikainen M, Serpa Neto A, Tavares M, Timsit JF, Arias Lopez MDP, Arulkumaran N, Aryal D, Azoulay E, Celi LA, Chaudhuri D, De Lange D, De Waele J, Dos Santos CC, Du B, Einav S, Engelbrecht T, Fazla F, Ferrer R, Finazzi S, Fujii T, Gershengorn HB, Greene JD, Haniffa R, Hao S, Hasan MS, Hollenberg S, Ippolito M, Jung C, Kirov M, Kobari S, Lakbar I, Lipman J, Liu V, Liu X, Lobo SM, Magatti D, Martin GS, Metnitz B, Metnitz P, Myatra SN, Oczkowski S, Paiva JA, Paruk F, Pekkarinen PT, Piquilloud L, Pölkki A, Prescott HC, Reintam Blaser A, Rezende E, Robba C, Rochwerg B, Ruckly S, Samei R, Schenck EJ, Secombe P, Sendagire C, Siaw-Frimpong M, Simpkin AJ, Soares M, Summers C, Szczeklik W, Takala J, Tanaka S, Tricella G, Vincent JL, Wendon J, Zampieri FG, Rhodes A, Moreno R",
    "doi": "10.1001/jama.2025.20516",
    "id": "ranzani-2025",
    "pmid": "41159833",
    "source": "JAMA. 2025 (SOFA-2)",
    "title": "Development and Validation of the Sequential Organ Failure Assessment (SOFA)-2 Score"
  },
  "formula": "sofa_2",
  "formula_expression": "SOFA-2 = brain + respiratory + cardiovascular + liver + kidney + hemostasis; each 0-4; max 24",
  "max_score": 24,
  "score": 0
}
```

## Errors

- HTTP 400 `invalid_sofa_2`: SOFA-2 needs Ranzani 2025 six organ-system inputs in published ranges. 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

- [SOFA](https://magentlab.com/docs/sofa) — Compute the Vincent 1996 SOFA score from PaO2/FiO2, platelets, bilirubin, MAP and adrenergic agents, GCS, and creatinine or urine output.
- [qSOFA](https://magentlab.com/docs/qsofa) — Compute the Sepsis-3 qSOFA score from respiratory rate, caller-assigned altered mentation, and systolic blood pressure.

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