MAGENT

Emergency · LIVE

APACHE II severity of disease classification

APACHE II

Compute the Knaus 1985 APACHE II integer from 12 Acute Physiology Score items, age points, and chronic-health points.

LIVE $0.005 USDC GET /api/calc/apache-ii

Markdown: /docs/apache-ii.md · Canonical: https://magentlab.com/docs/apache-ii

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

What it computes

Compute the Knaus 1985 APACHE II integer from 12 Acute Physiology Score items, age points, and chronic-health points.

When to use

Returns the published Knaus 1985 integer classification.

When not to use

  • Magent does not measure vitals and does not examine the patient.
  • Each APS item is the worst value in 24 hours as assigned by the caller. Magent does not choose the worst from a time series.
  • Not APACHE III or APACHE IV. Table 1 bands only.
  • Does not compute predicted death risk. The Knaus 1985 logistic equation needs diagnostic category weights that this tool does not accept.
  • Venous HCO3 substitution from Table 1 is not accepted; arterial_ph is required.
  • Oxygenation uses A-aDO2 when fio2 ≥ 0.5 and PaO2 when fio2 < 0.5. The unused gas parameter is ignored. Magent does not compute A-aDO2.
  • chronic_health is the paper's severe organ insufficiency or immunocompromise as assigned by the caller. elective_postop must be false when chronic_health is false.

Formula

APACHE II = APS + age_points + chronic_health_points; APS is the sum of 12 Knaus 1985 Table 1 items (worst values in 24h as assigned by the caller): temperature_c, map_mm_hg, heart_rate, respiratory_rate, oxygenation (A-aDO2 if fio2 >= 0.5, PaO2 if fio2 < 0.5), arterial_ph, sodium_mmol_l, potassium_mmol_l, creatinine_mg_dl (doubled if acute_renal_failure), hematocrit_percent, wbc_k_ul, and 15-gcs; age <=44 → 0, 45-54 → 2, 55-64 → 3, 65-74 → 5, >=75 → 6; chronic health 0 if none, else +5 nonoperative or emergency postoperative or +2 elective postoperative; max 71

Citation

Title
APACHE II: a severity of disease classification system
Authors
Knaus WA, Draper EA, Wagner DP, Zimmerman JE
Source
Crit Care Med. 1985;13(10):818-829
DOI
10.1097/00003246-198510000-00009

Worked example

All-normal APS, age 40, no chronic health

Given: acute_renal_failure=falseage=40arterial_ph=7.40chronic_health=falsecreatinine_mg_dl=1.0elective_postop=falsefio2=0.21gcs=15heart_rate=80hematocrit_percent=40map_mm_hg=90pao2_mm_hg=90potassium_mmol_l=4.0respiratory_rate=16sodium_mmol_l=140temperature_c=37.0wbc_k_ul=8.0

  1. Each of the 12 APS rows is in a 0-point Table 1 band (PaO2 90 with FiO2 0.21; GCS 15 → 0)
  2. Age 40 → 0; no chronic health → 0
  3. Score = 0 (max 71)

Age 50 only

Given: acute_renal_failure=falseage=50arterial_ph=7.40chronic_health=falsecreatinine_mg_dl=1.0elective_postop=falsefio2=0.21gcs=15heart_rate=80hematocrit_percent=40map_mm_hg=90pao2_mm_hg=90potassium_mmol_l=4.0respiratory_rate=16sodium_mmol_l=140temperature_c=37.0wbc_k_ul=8.0

  1. APS remains 0
  2. Age 45-54 → 2; no chronic health → 0
  3. Score = 2 (max 71)

Also searched as

  • APACHE II
  • Acute Physiology and Chronic Health Evaluation II
  • APACHE 2 score
  • Knaus APACHE II
  • ICU severity of disease score
  • acute physiology score APACHE

Try

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

/api/calc/apache-ii?temperature_c=37.0&map_mm_hg=90&heart_rate=80&respiratory_rate=16&fio2=0.21&pao2_mm_hg=90&arterial_ph=7.40&sodium_mmol_l=140&potassium_mmol_l=4.0&creatinine_mg_dl=1.0&hematocrit_percent=40&wbc_k_ul=8.0&gcs=15&age=40&chronic_health=false&elective_postop=false&acute_renal_failure=false

Full URL: https://api.magentlab.com/api/calc/apache-ii?temperature_c=37.0&map_mm_hg=90&heart_rate=80&respiratory_rate=16&fio2=0.21&pao2_mm_hg=90&arterial_ph=7.40&sodium_mmol_l=140&potassium_mmol_l=4.0&creatinine_mg_dl=1.0&hematocrit_percent=40&wbc_k_ul=8.0&gcs=15&age=40&chronic_health=false&elective_postop=false&acute_renal_failure=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/apache-ii?temperature_c=37.0&map_mm_hg=90&heart_rate=80&respiratory_rate=16&fio2=0.21&pao2_mm_hg=90&arterial_ph=7.40&sodium_mmol_l=140&potassium_mmol_l=4.0&creatinine_mg_dl=1.0&hematocrit_percent=40&wbc_k_ul=8.0&gcs=15&age=40&chronic_health=false&elective_postop=false&acute_renal_failure=false"

Parameters

Name Type Required Description
temperature_c number required Rectal temperature in °C (20-46) as assigned by the caller (Knaus 1985 Table 1). ≥41 → 4; 39-40.9 → 3; 38.5-38.9 → 1; 36-38.4 → 0; 34-35.9 → 1; 32-33.9 → 2; 30-31.9 → 3; ≤29.9 → 4. magent does not measure temperature or convert Fahrenheit.
map_mm_hg number required Mean arterial pressure in mm Hg (20-250). ≥160 → 4; 130-159 → 3; 110-129 → 2; 70-109 → 0; 50-69 → 2; ≤49 → 4. magent does not measure blood pressure.
heart_rate integer required Heart rate, ventricular response, integer 20-250. ≥180 → 4; 140-179 → 3; 110-139 → 2; 70-109 → 0; 55-69 → 2; 40-54 → 3; ≤39 → 4.
respiratory_rate integer required Respiratory rate, non-ventilated or ventilated, integer 0-80. ≥50 → 4; 35-49 → 3; 25-34 → 1; 12-24 → 0; 10-11 → 1; 6-9 → 2; ≤5 → 4.
fio2 number required Inspired oxygen as a fraction 0.21-1.00, not a percent. If fio2 ≥ 0.5, oxygenation uses aa_gradient. If fio2 < 0.5, oxygenation uses pao2_mm_hg. The unused gas parameter is ignored.
aa_gradient number optional A-aDO2 in mm Hg (0-800). Required when fio2 ≥ 0.5. ≥500 → 4; 350-499 → 3; 200-349 → 2; <200 → 0. Ignored when fio2 < 0.5. magent does not compute A-aDO2 from PaO2.
pao2_mm_hg number optional Arterial PaO2 in mm Hg (20-700). Required when fio2 < 0.5. >70 → 0; 61-70 → 1; 55-60 → 3; <55 → 4. Ignored when fio2 ≥ 0.5.
arterial_ph number required Arterial pH (6.5-8.0). ≥7.70 → 4; 7.60-7.69 → 3; 7.50-7.59 → 1; 7.33-7.49 → 0; 7.25-7.32 → 2; 7.15-7.24 → 3; <7.15 → 4. Venous HCO3 substitution from Table 1 is not accepted.
sodium_mmol_l number required Serum sodium in mmol/L (90-200). ≥180 → 4; 160-179 → 3; 155-159 → 2; 150-154 → 1; 130-149 → 0; 120-129 → 2; 111-119 → 3; ≤110 → 4.
potassium_mmol_l number required Serum potassium in mmol/L (1-12). ≥7.0 → 4; 6.0-6.9 → 3; 5.5-5.9 → 1; 3.5-5.4 → 0; 3.0-3.4 → 1; 2.5-2.9 → 2; <2.5 → 4.
creatinine_mg_dl number required Serum creatinine in mg/dL (0.1-20). ≥3.5 → 4; 2.0-3.4 → 3; 1.5-1.9 → 2; 0.6-1.4 → 0; <0.6 → 2. Double that row when acute_renal_failure is true.
hematocrit_percent number required Hematocrit percent (5-80). ≥60 → 4; 50-59.9 → 2; 46-49.9 → 1; 30-45.9 → 0; 20-29.9 → 2; <20 → 4.
wbc_k_ul number required White blood count in thousands per mm^3 (0.1-100). ≥40 → 4; 20-39.9 → 2; 15-19.9 → 1; 3-14.9 → 0; 1-2.9 → 2; <1 → 4.
gcs integer required Glasgow Coma Scale total as assigned by the caller (integer 3-15). APS GCS points = 15 minus gcs. magent does not examine the patient.
age integer required Age in years, integer 16-120. ≤44 → 0; 45-54 → 2; 55-64 → 3; 65-74 → 5; ≥75 → 6.
chronic_health boolean required true if the caller assigns severe organ insufficiency or immunocompromise as defined in Knaus 1985. false → 0 chronic-health points and elective_postop must be false.
elective_postop boolean required true only for elective postoperative patients with chronic_health true (+2). false with chronic_health true is nonoperative or emergency postoperative (+5). Must be false when chronic_health is false.
acute_renal_failure boolean required true doubles the creatinine Table 1 points (Knaus 1985). false leaves creatinine points unchanged. magent does not diagnose renal failure.

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/apache-ii 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": [
    {
      "acute_renal_failure": "false",
      "age": "40",
      "arterial_ph": "7.40",
      "chronic_health": "false",
      "creatinine_mg_dl": "1.0",
      "elective_postop": "false",
      "fio2": "0.21",
      "gcs": "15",
      "heart_rate": "80",
      "hematocrit_percent": "40",
      "map_mm_hg": "90",
      "pao2_mm_hg": "90",
      "potassium_mmol_l": "4.0",
      "respiratory_rate": "16",
      "sodium_mmol_l": "140",
      "temperature_c": "37.0",
      "wbc_k_ul": "8.0"
    },
    {
      "acute_renal_failure": "false",
      "age": "40",
      "arterial_ph": "7.40",
      "chronic_health": "false",
      "creatinine_mg_dl": "1.0",
      "elective_postop": "false",
      "fio2": "0.21",
      "gcs": "15",
      "heart_rate": "80",
      "hematocrit_percent": "40",
      "map_mm_hg": "90",
      "pao2_mm_hg": "90",
      "potassium_mmol_l": "4.0",
      "respiratory_rate": "16",
      "sodium_mmol_l": "140",
      "temperature_c": "37.0",
      "wbc_k_ul": "8.0"
    }
  ]
}

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/apache-ii",
  "items": [
    {
      "components": [
        {
          "value": 37.0,
          "factor": "temperature_c",
          "points": 0,
          "present": false
        },
        {
          "value": 90.0,
          "factor": "map_mm_hg",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 16,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 90.0,
          "factor": "oxygenation",
          "branch": "pao2_mm_hg",
          "points": 0,
          "present": false,
          "fio2": 0.21
        },
        {
          "value": 7.4,
          "factor": "arterial_ph",
          "points": 0,
          "present": false
        },
        {
          "value": 140.0,
          "factor": "sodium_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "value": 4.0,
          "factor": "potassium_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "creatinine_mg_dl",
          "points": 0,
          "present": false,
          "acute_renal_failure": false
        },
        {
          "value": 40.0,
          "factor": "hematocrit_percent",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0,
          "factor": "wbc_k_ul",
          "points": 0,
          "present": false
        },
        {
          "value": 15,
          "factor": "gcs",
          "points": 0,
          "present": false
        },
        {
          "value": 40,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_health",
          "points": 0,
          "present": false,
          "chronic_health": false,
          "elective_postop": 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": "Knaus WA, Draper EA, Wagner DP, Zimmerman JE",
        "doi": "10.1097/00003246-198510000-00009",
        "id": "knaus-1985",
        "pmid": "3928249",
        "source": "Crit Care Med. 1985;13(10):818-829",
        "title": "APACHE II: a severity of disease classification system"
      },
      "formula": "apache_ii",
      "formula_expression": "APACHE II = APS + age_points + chronic_health_points; APS is the sum of 12 Knaus 1985 Table 1 items (worst values in 24h as assigned by the caller): temperature_c, map_mm_hg, heart_rate, respiratory_rate, oxygenation (A-aDO2 if fio2 >= 0.5, PaO2 if fio2 < 0.5), arterial_ph, sodium_mmol_l, potassium_mmol_l, creatinine_mg_dl (doubled if acute_renal_failure), hematocrit_percent, wbc_k_ul, and 15-gcs; age <=44 → 0, 45-54 → 2, 55-64 → 3, 65-74 → 5, >=75 → 6; chronic health 0 if none, else +5 nonoperative or emergency postoperative or +2 elective postoperative; max 71",
      "max_score": 71,
      "score": 0
    },
    {
      "components": [
        {
          "value": 37.0,
          "factor": "temperature_c",
          "points": 0,
          "present": false
        },
        {
          "value": 90.0,
          "factor": "map_mm_hg",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 16,
          "factor": "respiratory_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 90.0,
          "factor": "oxygenation",
          "branch": "pao2_mm_hg",
          "points": 0,
          "present": false,
          "fio2": 0.21
        },
        {
          "value": 7.4,
          "factor": "arterial_ph",
          "points": 0,
          "present": false
        },
        {
          "value": 140.0,
          "factor": "sodium_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "value": 4.0,
          "factor": "potassium_mmol_l",
          "points": 0,
          "present": false
        },
        {
          "value": 1.0,
          "factor": "creatinine_mg_dl",
          "points": 0,
          "present": false,
          "acute_renal_failure": false
        },
        {
          "value": 40.0,
          "factor": "hematocrit_percent",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0,
          "factor": "wbc_k_ul",
          "points": 0,
          "present": false
        },
        {
          "value": 15,
          "factor": "gcs",
          "points": 0,
          "present": false
        },
        {
          "value": 40,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "factor": "chronic_health",
          "points": 0,
          "present": false,
          "chronic_health": false,
          "elective_postop": 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": "Knaus WA, Draper EA, Wagner DP, Zimmerman JE",
        "doi": "10.1097/00003246-198510000-00009",
        "id": "knaus-1985",
        "pmid": "3928249",
        "source": "Crit Care Med. 1985;13(10):818-829",
        "title": "APACHE II: a severity of disease classification system"
      },
      "formula": "apache_ii",
      "formula_expression": "APACHE II = APS + age_points + chronic_health_points; APS is the sum of 12 Knaus 1985 Table 1 items (worst values in 24h as assigned by the caller): temperature_c, map_mm_hg, heart_rate, respiratory_rate, oxygenation (A-aDO2 if fio2 >= 0.5, PaO2 if fio2 < 0.5), arterial_ph, sodium_mmol_l, potassium_mmol_l, creatinine_mg_dl (doubled if acute_renal_failure), hematocrit_percent, wbc_k_ul, and 15-gcs; age <=44 → 0, 45-54 → 2, 55-64 → 3, 65-74 → 5, >=75 → 6; chronic health 0 if none, else +5 nonoperative or emergency postoperative or +2 elective postoperative; max 71",
      "max_score": 71,
      "score": 0
    }
  ]
}

Response

Field Type Description
formula string apache_ii
formula_expression string Exact expression used
score integer APACHE II integer 0-71
max_score integer Always 71
components array Twelve APS rows plus age and chronic health
citation object Knaus 1985 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "value": 37.0,
      "factor": "temperature_c",
      "points": 0,
      "present": false
    },
    {
      "value": 90.0,
      "factor": "map_mm_hg",
      "points": 0,
      "present": false
    },
    {
      "value": 80,
      "factor": "heart_rate",
      "points": 0,
      "present": false
    },
    {
      "value": 16,
      "factor": "respiratory_rate",
      "points": 0,
      "present": false
    },
    {
      "value": 90.0,
      "factor": "oxygenation",
      "branch": "pao2_mm_hg",
      "points": 0,
      "present": false,
      "fio2": 0.21
    },
    {
      "value": 7.4,
      "factor": "arterial_ph",
      "points": 0,
      "present": false
    },
    {
      "value": 140.0,
      "factor": "sodium_mmol_l",
      "points": 0,
      "present": false
    },
    {
      "value": 4.0,
      "factor": "potassium_mmol_l",
      "points": 0,
      "present": false
    },
    {
      "value": 1.0,
      "factor": "creatinine_mg_dl",
      "points": 0,
      "present": false,
      "acute_renal_failure": false
    },
    {
      "value": 40.0,
      "factor": "hematocrit_percent",
      "points": 0,
      "present": false
    },
    {
      "value": 8.0,
      "factor": "wbc_k_ul",
      "points": 0,
      "present": false
    },
    {
      "value": 15,
      "factor": "gcs",
      "points": 0,
      "present": false
    },
    {
      "value": 40,
      "factor": "age",
      "points": 0,
      "present": false
    },
    {
      "factor": "chronic_health",
      "points": 0,
      "present": false,
      "chronic_health": false,
      "elective_postop": 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": "Knaus WA, Draper EA, Wagner DP, Zimmerman JE",
    "doi": "10.1097/00003246-198510000-00009",
    "id": "knaus-1985",
    "pmid": "3928249",
    "source": "Crit Care Med. 1985;13(10):818-829",
    "title": "APACHE II: a severity of disease classification system"
  },
  "formula": "apache_ii",
  "formula_expression": "APACHE II = APS + age_points + chronic_health_points; APS is the sum of 12 Knaus 1985 Table 1 items (worst values in 24h as assigned by the caller): temperature_c, map_mm_hg, heart_rate, respiratory_rate, oxygenation (A-aDO2 if fio2 >= 0.5, PaO2 if fio2 < 0.5), arterial_ph, sodium_mmol_l, potassium_mmol_l, creatinine_mg_dl (doubled if acute_renal_failure), hematocrit_percent, wbc_k_ul, and 15-gcs; age <=44 → 0, 45-54 → 2, 55-64 → 3, 65-74 → 5, >=75 → 6; chronic health 0 if none, else +5 nonoperative or emergency postoperative or +2 elective postoperative; max 71",
  "max_score": 71,
  "score": 0
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_apache_ii apache_ii must be an integer from 0 to 71 (Heyland 2011 NUTRIC); APACHE II needs Knaus 1985 physiologic, age, and chronic-health integers in published ranges. 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

  • SOFA — Compute the Vincent 1996 SOFA score from PaO2/FiO2, platelets, bilirubin, MAP and adrenergic agents, GCS, and creatinine or urine output.
  • qSOFA — Compute the Sepsis-3 qSOFA score from respiratory rate, caller-assigned altered mentation, and systolic blood pressure.
  • SIRS — Compute the Bone 1992 ACCP/SCCM SIRS criteria from temperature, heart rate, respiratory rate, and WBC, with optional PaCO2 and band percent.

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.