LIVE
SOFA organ failure score
SOFA
Compute the Vincent 1996 SOFA score from PaO2/FiO2, platelets, bilirubin, MAP and adrenergic agents, GCS, and creatinine or urine output.
Also searched as
- SOFA score
- Sequential Organ Failure Assessment
- Sepsis-related Organ Failure Assessment
- Vincent SOFA
- organ failure score
Markdown: /docs/sofa.md · Canonical: https://magentlab.com/docs/sofa
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Compute the Vincent 1996 SOFA score from PaO2/FiO2, platelets, bilirubin, MAP and adrenergic agents, GCS, and creatinine or urine output.
When to use
When an agent needs the published six-organ SOFA total and must not invent points from a chart narrative or a later SOFA revision.
When not to use
- Not a Sepsis-3 diagnosis and not a treatment recommendation.
- Respiration scores 3 and 4 require respiratory support (ventilated=true) as in Vincent 1996 Table 3. Unventilated PaO2/FiO2 <200 is capped at 2.
- Adrenergic doses are scored without the paper's ≥1 h duration. Only dopamine, epinephrine, norepinephrine, and dobutamine from Vincent 1996 Table 3 are scored.
- GCS is a caller-assigned integer 3-15. magent does not examine the patient.
Formula
SOFA = respiration + coagulation + liver + cardiovascular + cns + renal; each 0-4; max 24
Citation
- Title
- The SOFA (Sepsis-related Organ Failure Assessment) score to describe organ dysfunction/failure
- Authors
- Vincent JL, Moreno R, Takala J, Willatts S, De Mendonça A, Bruining H, Reinhart CK, Suter PM, Thijs LG
- Source
- Intensive Care Med. 1996;22(7):707-710
Worked example
All organs 0
Given:
bilirubin_mg_dl=0.8creatinine_mg_dl=1.0fio2=0.21gcs=15map_mm_hg=80pao2_mm_hg=96platelets_10e9_l=200ventilated=false
- PaO2/FiO2 96/0.21 ≥400 → 0; platelets 200 → 0; bilirubin 0.8 → 0; MAP 80, no pressors → 0; GCS 15 → 0; creatinine 1.0 → 0
- Score = 0 (max 24)
Unventilated PaO2/FiO2 80 stays 2
Given:
bilirubin_mg_dl=0.8creatinine_mg_dl=1.0fio2=1.0gcs=15map_mm_hg=80pao2_mm_hg=80platelets_10e9_l=200ventilated=false
- PaO2/FiO2 80 without ventilation cannot score 3 or 4
- Respiration → 2; other organs 0; score = 2
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/sofa?pao2_mm_hg=96&fio2=0.21&ventilated=false&platelets_10e9_l=200&bilirubin_mg_dl=0.8&map_mm_hg=80&gcs=15&creatinine_mg_dl=1.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/sofa?pao2_mm_hg=96&fio2=0.21&ventilated=false&platelets_10e9_l=200&bilirubin_mg_dl=0.8&map_mm_hg=80&gcs=15&creatinine_mg_dl=1.0"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
pao2_mm_hg |
number | required | Arterial PaO2 in mm Hg (20-700). Respiration uses PaO2/FiO2: ≥400 scores 0; <400 scores 1; <300 scores 2; <200 with ventilation scores 3; <100 with ventilation scores 4. |
fio2 |
number | required | Inspired oxygen as a fraction (0.21-1.0), not a percent. |
ventilated |
boolean | required | Respiratory support (Vincent 1996). true or false. Scores 3 and 4 require ventilation; unventilated PaO2/FiO2 <200 is capped at 2. |
platelets_10e9_l |
number | required | Platelets ×10^9/L, same as ×10^3/mm^3 (1-2000). ≥150 scores 0; <150 scores 1; <100 scores 2; <50 scores 3; <20 scores 4. |
bilirubin_mg_dl |
number | optional | Total bilirubin in mg/dL (0.1-40). Provide this or bilirubin_umol_l. <1.2 scores 0; 1.2-1.9 scores 1; 2.0-5.9 scores 2; 6.0-11.9 scores 3; >12.0 scores 4. |
bilirubin_umol_l |
number | optional | Total bilirubin in µmol/L. Converted as mg/dL = µmol/L / 17.1. |
map_mm_hg |
number | required | Mean arterial pressure in mm Hg (30-180). MAP <70 scores 1 unless a higher cardiovascular band applies. |
dopamine_ug_kg_min |
number | optional | Dopamine in µg/kg·min (0-50) when provided. Absent is 0. 0 < dose ≤5 scores 2; >5 scores 3; >15 scores 4. |
dobutamine |
boolean | optional | Any dobutamine. true or false when provided; absent is false. true scores cardiovascular 2 unless a higher band applies. |
epinephrine_ug_kg_min |
number | optional | Epinephrine in µg/kg·min (0-2) when provided. Absent is 0. 0 < dose ≤0.1 scores 3; >0.1 scores 4. |
norepinephrine_ug_kg_min |
number | optional | Norepinephrine in µg/kg·min (0-2) when provided. Absent is 0. 0 < dose ≤0.1 scores 3; >0.1 scores 4. |
gcs |
integer | required | Glasgow Coma Scale total as assigned by the caller (integer 3-15). 15 scores 0; 13-14 scores 1; 10-12 scores 2; 6-9 scores 3; <6 scores 4. |
creatinine_mg_dl |
number | optional | Creatinine in mg/dL (0.1-20). Provide this, creatinine_umol_l, or urine_output_ml_day. <1.2 scores 0; 1.2-1.9 scores 1; 2.0-3.4 scores 2; 3.5-4.9 scores 3; ≥5.0 scores 4. |
creatinine_umol_l |
number | optional | Creatinine in µmol/L. Converted as mg/dL = µmol/L / 88.42. |
urine_output_ml_day |
number | optional | Urine output in mL/day (0-20000) when provided. <200 scores 4; <500 scores 3; otherwise urine does not add 1-2. Renal is the max of creatinine and urine when both are given. |
Bulk (POST)
POST the same path with a JSON items array. Price is n times the GET unit. Invalid items return HTTP 400 before settlement.
- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- 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": [
{
"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",
"ventilated": "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",
"ventilated": "false"
}
]
}
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/sofa",
"items": [
{
"components": [
{
"value": 457.14285714285717,
"factor": "respiration",
"points": 0,
"present": false
},
{
"value": 200.0,
"factor": "coagulation",
"points": 0,
"present": false
},
{
"value": 0.8,
"factor": "liver",
"points": 0,
"present": false
},
{
"value": 80.0,
"factor": "cardiovascular",
"points": 0,
"present": false
},
{
"value": 15,
"factor": "cns",
"points": 0,
"present": false
},
{
"value": 1.0,
"factor": "renal",
"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": "Vincent JL, Moreno R, Takala J, Willatts S, De Mendonça A, Bruining H, Reinhart CK, Suter PM, Thijs LG",
"doi": "10.1007/BF01709751",
"id": "vincent-1996",
"source": "Intensive Care Med. 1996;22(7):707-710",
"title": "The SOFA (Sepsis-related Organ Failure Assessment) score to describe organ dysfunction/failure"
},
"formula": "sofa",
"formula_expression": "SOFA = respiration + coagulation + liver + cardiovascular + cns + renal; each 0-4; max 24",
"max_score": 24,
"score": 0
},
{
"components": [
{
"value": 457.14285714285717,
"factor": "respiration",
"points": 0,
"present": false
},
{
"value": 200.0,
"factor": "coagulation",
"points": 0,
"present": false
},
{
"value": 0.8,
"factor": "liver",
"points": 0,
"present": false
},
{
"value": 80.0,
"factor": "cardiovascular",
"points": 0,
"present": false
},
{
"value": 15,
"factor": "cns",
"points": 0,
"present": false
},
{
"value": 1.0,
"factor": "renal",
"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": "Vincent JL, Moreno R, Takala J, Willatts S, De Mendonça A, Bruining H, Reinhart CK, Suter PM, Thijs LG",
"doi": "10.1007/BF01709751",
"id": "vincent-1996",
"source": "Intensive Care Med. 1996;22(7):707-710",
"title": "The SOFA (Sepsis-related Organ Failure Assessment) score to describe organ dysfunction/failure"
},
"formula": "sofa",
"formula_expression": "SOFA = respiration + coagulation + liver + cardiovascular + cns + renal; each 0-4; max 24",
"max_score": 24,
"score": 0
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | sofa |
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 | Vincent 1996 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": 457.14285714285717,
"factor": "respiration",
"points": 0,
"present": false
},
{
"value": 200.0,
"factor": "coagulation",
"points": 0,
"present": false
},
{
"value": 0.8,
"factor": "liver",
"points": 0,
"present": false
},
{
"value": 80.0,
"factor": "cardiovascular",
"points": 0,
"present": false
},
{
"value": 15,
"factor": "cns",
"points": 0,
"present": false
},
{
"value": 1.0,
"factor": "renal",
"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": "Vincent JL, Moreno R, Takala J, Willatts S, De Mendonça A, Bruining H, Reinhart CK, Suter PM, Thijs LG",
"doi": "10.1007/BF01709751",
"id": "vincent-1996",
"source": "Intensive Care Med. 1996;22(7):707-710",
"title": "The SOFA (Sepsis-related Organ Failure Assessment) score to describe organ dysfunction/failure"
},
"formula": "sofa",
"formula_expression": "SOFA = respiration + coagulation + liver + cardiovascular + cns + renal; each 0-4; max 24",
"max_score": 24,
"score": 0
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_pao2 |
pao2_mm_hg must be a number from 20 to 700. Returned before settlement; you are not charged. |
| 400 | invalid_fio2 |
fio2 must be a fraction from 0.21 to 1.0. Returned before settlement; you are not charged. |
| 400 | invalid_flag |
boolean clinical flags must be true or false Returned before settlement; you are not charged. |
| 400 | invalid_platelets |
platelets_10e9_l must be a number from 1 to 2000 Returned before settlement; you are not charged. |
| 400 | invalid_bilirubin |
bilirubin_mg_dl (0.1-40) or bilirubin_umol_l (2-684) is required Returned before settlement; you are not charged. |
| 400 | invalid_map_mm_hg |
map_mm_hg must be a number from 30 to 180. Returned before settlement; you are not charged. |
| 400 | invalid_dopamine |
dopamine_ug_kg_min must be a number from 0 to 50 when provided. Returned before settlement; you are not charged. |
| 400 | invalid_epinephrine |
epinephrine_ug_kg_min must be a number from 0 to 2 when provided. Returned before settlement; you are not charged. |
| 400 | invalid_norepinephrine |
norepinephrine_ug_kg_min must be a number from 0 to 2 when provided. Returned before settlement; you are not charged. |
| 400 | invalid_sofa_gcs |
gcs must be an integer from 3 to 15. Returned before settlement; you are not charged. |
| 400 | invalid_creatinine |
creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required Returned before settlement; you are not charged. |
| 400 | invalid_urine_output |
urine_output_ml_day must be a number from 0 to 20000 when provided. 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
- qSOFA — Compute the Sepsis-3 qSOFA score from respiratory rate, caller-assigned altered mentation, and systolic blood pressure.
Payment
Required query parameters must be present and valid. 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
- Invalid query parameters return HTTP 400 before settlement. You are not charged.
- Settlement finishes before the tool executes (paymentFlow upfront). 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.