# mSOFA

mSOFA

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

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

## What it computes

Compute the Grissom 2010 modified SOFA (mSOFA) total from SpO2/FiO2, caller-assigned scleral icterus or jaundice, MAP and adrenergic agents, caller-assigned GCS, and creatinine.

## When to use

When an agent needs the published five-organ mSOFA total (max 19) and must not substitute Vincent 1996 SOFA, qSOFA, PaO2/FiO2, platelets, or bilirubin.

## When not to use

- Not a medical device, not a Sepsis-3 diagnosis, and not a treatment or triage-exclusion order.
- Not Vincent 1996 SOFA (already shipped as sofa) and not qSOFA. Coagulation (platelets) is not scored. Liver is caller-assigned scleral icterus or jaundice (0 or 3), not bilirubin. Respiration is SpO2/FiO2 without a ventilation gate.
- Grissom 2010 Table 2 renal row is creatinine only. Adrenergic doses are scored without a ≥1 h duration. GCS and jaundice are caller-assigned. magent does not examine the patient or assay labs.
- The paper reported 30-day mortality by day-1 total (0-7, 8-11, >11) in one ICU cohort. magent returns the score only and does not emit those observational bins as a risk class.

## Formula

```
mSOFA = respiration + liver + cardiovascular + cns + renal; respiration SpO2/FiO2 >400 → 0, ≤400 → 1, ≤315 → 2, ≤235 → 3, ≤150 → 4; liver no scleral icterus or jaundice → 0, present → 3; cardiovascular, CNS (GCS), and renal (creatinine) 0-4 as SOFA; coagulation not scored; max 19
```

## Citation

[A modified sequential organ failure assessment score for critical care triage](https://doi.org/10.1001/dmp.2010.40)
Grissom CK, Brown SM, Kuttler KG, Boltax JP, Jones J, Jephson AR, Orme JF Jr
Disaster Med Public Health Prep. 2010;4(4):277-284
DOI: [10.1001/dmp.2010.40](https://doi.org/10.1001/dmp.2010.40)

## Worked example

### All organs 0

Given: `creatinine_mg_dl=1.0, fio2=0.21, gcs=15, map_mm_hg=80, scleral_icterus_or_jaundice=false, spo2_percent=96`

1. SpO2/FiO2 96/0.21 >400 → 0; no icterus or jaundice → 0; MAP 80, no pressors → 0; GCS 15 → 0; creatinine 1.0 → 0
2. Score = 0 (max 19)


## Also searched as

- mSOFA score
- modified SOFA
- MSOFA
- Grissom mSOFA
- modified sequential organ failure assessment
- SpO2/FiO2 SOFA

## Parameters

- `spo2_percent` (number, required): Pulse-oximeter SpO2 in percent (50-100), not a fraction. Respiration uses SpO2/FiO2: >400 scores 0; ≤400 scores 1; ≤315 scores 2; ≤235 scores 3; ≤150 scores 4 (Grissom 2010 Table 2). magent does not read a probe.
- `fio2` (number, required): Inspired oxygen as a fraction (0.21-1.0), not a percent. For nasal cannula, Grissom 2010 estimated FiO2 as 0.21 + 0.03 × L/min; the caller supplies the fraction.
- `scleral_icterus_or_jaundice` (boolean, required): Scleral icterus or jaundice as assigned by the caller (Grissom 2010 Table 2). true or false. Absent scores 0; present scores 3. Not serum bilirubin. magent does not examine the patient.
- `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 or creatinine_umol_l. <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. Table 2 lists creatinine only (not urine output).
- `creatinine_umol_l` (number, optional): Creatinine in µmol/L. Converted as mg/dL = µmol/L / 88.42.

## 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/msofa`
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": [
    {
      "creatinine_mg_dl": "1.0",
      "fio2": "0.21",
      "gcs": "15",
      "map_mm_hg": "80",
      "scleral_icterus_or_jaundice": "false",
      "spo2_percent": "96"
    },
    {
      "creatinine_mg_dl": "1.0",
      "fio2": "0.21",
      "gcs": "15",
      "map_mm_hg": "80",
      "scleral_icterus_or_jaundice": "false",
      "spo2_percent": "96"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/msofa",
  "items": [
    {
      "components": [
        {
          "value": 457.14285714285717,
          "factor": "respiration",
          "points": 0,
          "present": false
        },
        {
          "value": false,
          "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": "Grissom CK, Brown SM, Kuttler KG, Boltax JP, Jones J, Jephson AR, Orme JF Jr",
        "doi": "10.1001/dmp.2010.40",
        "id": "grissom-2010",
        "pmid": "21149228",
        "source": "Disaster Med Public Health Prep. 2010;4(4):277-284",
        "title": "A modified sequential organ failure assessment score for critical care triage"
      },
      "formula": "msofa",
      "formula_expression": "mSOFA = respiration + liver + cardiovascular + cns + renal; respiration SpO2/FiO2 >400 → 0, ≤400 → 1, ≤315 → 2, ≤235 → 3, ≤150 → 4; liver no scleral icterus or jaundice → 0, present → 3; cardiovascular, CNS (GCS), and renal (creatinine) 0-4 as SOFA; coagulation not scored; max 19",
      "max_score": 19,
      "score": 0
    },
    {
      "components": [
        {
          "value": 457.14285714285717,
          "factor": "respiration",
          "points": 0,
          "present": false
        },
        {
          "value": false,
          "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": "Grissom CK, Brown SM, Kuttler KG, Boltax JP, Jones J, Jephson AR, Orme JF Jr",
        "doi": "10.1001/dmp.2010.40",
        "id": "grissom-2010",
        "pmid": "21149228",
        "source": "Disaster Med Public Health Prep. 2010;4(4):277-284",
        "title": "A modified sequential organ failure assessment score for critical care triage"
      },
      "formula": "msofa",
      "formula_expression": "mSOFA = respiration + liver + cardiovascular + cns + renal; respiration SpO2/FiO2 >400 → 0, ≤400 → 1, ≤315 → 2, ≤235 → 3, ≤150 → 4; liver no scleral icterus or jaundice → 0, present → 3; cardiovascular, CNS (GCS), and renal (creatinine) 0-4 as SOFA; coagulation not scored; max 19",
      "max_score": 19,
      "score": 0
    }
  ]
}
```

## Response fields

- `formula` (string): msofa
- `formula_expression` (string): Exact expression used
- `score` (integer): Total points 0-19
- `max_score` (integer): Always 19
- `components` (array): Per-organ points
- `citation` (object): Grissom 2010 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 457.14285714285717,
      "factor": "respiration",
      "points": 0,
      "present": false
    },
    {
      "value": false,
      "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": "Grissom CK, Brown SM, Kuttler KG, Boltax JP, Jones J, Jephson AR, Orme JF Jr",
    "doi": "10.1001/dmp.2010.40",
    "id": "grissom-2010",
    "pmid": "21149228",
    "source": "Disaster Med Public Health Prep. 2010;4(4):277-284",
    "title": "A modified sequential organ failure assessment score for critical care triage"
  },
  "formula": "msofa",
  "formula_expression": "mSOFA = respiration + liver + cardiovascular + cns + renal; respiration SpO2/FiO2 >400 → 0, ≤400 → 1, ≤315 → 2, ≤235 → 3, ≤150 → 4; liver no scleral icterus or jaundice → 0, present → 3; cardiovascular, CNS (GCS), and renal (creatinine) 0-4 as SOFA; coagulation not scored; max 19",
  "max_score": 19,
  "score": 0
}
```

## Errors

- HTTP 400 `invalid_msofa`: mSOFA needs Grissom modified SOFA organ scores in published ranges (SpO2/FiO2 not PaO2/FiO2). 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.
