MAGENT

GI · LIVE

Ranson criteria

Ranson

Sum the eleven Ranson 1974 prognostic signs (five at admission, six during the first 48 hours) and return the published mortality band.

LIVE $0.005 USDC GET /api/calc/ranson

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

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

What it computes

Sum the eleven Ranson 1974 prognostic signs (five at admission, six during the first 48 hours) and return the published mortality band.

When to use

When an agent already has the published cutoffs as flags and must not invent a Ranson total or an ICU triage decision.

When not to use

  • Not a diagnosis, operative plan, or ICU order. Mortality bands group scores 0-2, 3-4, 5-6, and 7-11 as commonly reported from the 1974 series; magent does not reprint a percent as a prognosis for a named patient.
  • Complete score needs 48-hour signs. This tool does not parse raw labs; each cutoff is a boolean. Does not apply the later gallstone-modified cutoffs.

Formula

Ranson = 5 admission signs + 6 signs during first 48 h; each 1 if present; max 11

Citation

Title
Prognostic signs and the role of operative management in acute pancreatitis
Authors
Ranson JH, Rifkind KM, Roses DF, Fink SD, Eng K, Spencer FC
Source
Surg Gynecol Obstet. 1974;139(1):69-81
DOI
none

Worked example

No signs

Given: age_gt_55=falseast_gt_250=falsebase_deficit_gt_4=falsebun_rise_gt_5=falsecalcium_lt_8=falsefluid_seq_gt_6l=falseglucose_gt_200=falsehct_drop_gt_10=falseldh_gt_350=falsepao2_lt_60=falsewbc_gt_16k=false

  1. score = 0
  2. band 0-2

Seven signs present

Given: age_gt_55=trueast_gt_250=truebase_deficit_gt_4=falsebun_rise_gt_5=truecalcium_lt_8=falsefluid_seq_gt_6l=falseglucose_gt_200=truehct_drop_gt_10=trueldh_gt_350=truepao2_lt_60=falsewbc_gt_16k=true

  1. score = 7
  2. band 7-11

Also searched as

  • Ranson criteria
  • Ranson score
  • pancreatitis prognostic signs
  • Ranson 1974
  • acute pancreatitis score

Try

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

/api/calc/ranson?age_gt_55=false&wbc_gt_16k=false&glucose_gt_200=false&ldh_gt_350=false&ast_gt_250=false&hct_drop_gt_10=false&bun_rise_gt_5=false&calcium_lt_8=false&pao2_lt_60=false&base_deficit_gt_4=false&fluid_seq_gt_6l=false

Full URL: https://api.magentlab.com/api/calc/ranson?age_gt_55=false&wbc_gt_16k=false&glucose_gt_200=false&ldh_gt_350=false&ast_gt_250=false&hct_drop_gt_10=false&bun_rise_gt_5=false&calcium_lt_8=false&pao2_lt_60=false&base_deficit_gt_4=false&fluid_seq_gt_6l=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/ranson?age_gt_55=false&wbc_gt_16k=false&glucose_gt_200=false&ldh_gt_350=false&ast_gt_250=false&hct_drop_gt_10=false&bun_rise_gt_5=false&calcium_lt_8=false&pao2_lt_60=false&base_deficit_gt_4=false&fluid_seq_gt_6l=false"

Parameters

Name Type Required Description
age_gt_55 boolean required Admission: age >55 years (Ranson 1974). true or false.
wbc_gt_16k boolean required Admission: WBC >16 000/mm^3. true or false.
glucose_gt_200 boolean required Admission: blood glucose >200 mg/dL. true or false.
ldh_gt_350 boolean required Admission: LDH >350 IU/L. true or false.
ast_gt_250 boolean required Admission: AST >250 U/L. true or false.
hct_drop_gt_10 boolean required First 48 h: hematocrit fall >10 percentage points. true or false.
bun_rise_gt_5 boolean required First 48 h: BUN rise >5 mg/dL. true or false.
calcium_lt_8 boolean required First 48 h: serum calcium <8 mg/dL. true or false.
pao2_lt_60 boolean required First 48 h: arterial PaO2 <60 mm Hg. true or false.
base_deficit_gt_4 boolean required First 48 h: base deficit >4 mEq/L. true or false.
fluid_seq_gt_6l boolean required First 48 h: estimated fluid sequestration >6 L. true or false.

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/ranson 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": [
    {
      "age_gt_55": "false",
      "ast_gt_250": "false",
      "base_deficit_gt_4": "false",
      "bun_rise_gt_5": "false",
      "calcium_lt_8": "false",
      "fluid_seq_gt_6l": "false",
      "glucose_gt_200": "false",
      "hct_drop_gt_10": "false",
      "ldh_gt_350": "false",
      "pao2_lt_60": "false",
      "wbc_gt_16k": "false"
    },
    {
      "age_gt_55": "false",
      "ast_gt_250": "false",
      "base_deficit_gt_4": "false",
      "bun_rise_gt_5": "false",
      "calcium_lt_8": "false",
      "fluid_seq_gt_6l": "false",
      "glucose_gt_200": "false",
      "hct_drop_gt_10": "false",
      "ldh_gt_350": "false",
      "pao2_lt_60": "false",
      "wbc_gt_16k": "false"
    }
  ]
}

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/ranson",
  "items": [
    {
      "components": [
        {
          "factor": "age_gt_55",
          "points": 0,
          "present": false
        },
        {
          "factor": "wbc_gt_16k",
          "points": 0,
          "present": false
        },
        {
          "factor": "glucose_gt_200",
          "points": 0,
          "present": false
        },
        {
          "factor": "ldh_gt_350",
          "points": 0,
          "present": false
        },
        {
          "factor": "ast_gt_250",
          "points": 0,
          "present": false
        },
        {
          "factor": "hct_drop_gt_10",
          "points": 0,
          "present": false
        },
        {
          "factor": "bun_rise_gt_5",
          "points": 0,
          "present": false
        },
        {
          "factor": "calcium_lt_8",
          "points": 0,
          "present": false
        },
        {
          "factor": "pao2_lt_60",
          "points": 0,
          "present": false
        },
        {
          "factor": "base_deficit_gt_4",
          "points": 0,
          "present": false
        },
        {
          "factor": "fluid_seq_gt_6l",
          "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": "Ranson JH, Rifkind KM, Roses DF, Fink SD, Eng K, Spencer FC",
        "id": "ranson-1974",
        "pmid": "4834279",
        "source": "Surg Gynecol Obstet. 1974;139(1):69-81",
        "title": "Prognostic signs and the role of operative management in acute pancreatitis"
      },
      "formula": "ranson",
      "formula_expression": "Ranson = 5 admission signs + 6 signs during first 48 h; each 1 if present; max 11",
      "max_score": 11,
      "score": 0,
      "mortality_band": "0-2"
    },
    {
      "components": [
        {
          "factor": "age_gt_55",
          "points": 0,
          "present": false
        },
        {
          "factor": "wbc_gt_16k",
          "points": 0,
          "present": false
        },
        {
          "factor": "glucose_gt_200",
          "points": 0,
          "present": false
        },
        {
          "factor": "ldh_gt_350",
          "points": 0,
          "present": false
        },
        {
          "factor": "ast_gt_250",
          "points": 0,
          "present": false
        },
        {
          "factor": "hct_drop_gt_10",
          "points": 0,
          "present": false
        },
        {
          "factor": "bun_rise_gt_5",
          "points": 0,
          "present": false
        },
        {
          "factor": "calcium_lt_8",
          "points": 0,
          "present": false
        },
        {
          "factor": "pao2_lt_60",
          "points": 0,
          "present": false
        },
        {
          "factor": "base_deficit_gt_4",
          "points": 0,
          "present": false
        },
        {
          "factor": "fluid_seq_gt_6l",
          "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": "Ranson JH, Rifkind KM, Roses DF, Fink SD, Eng K, Spencer FC",
        "id": "ranson-1974",
        "pmid": "4834279",
        "source": "Surg Gynecol Obstet. 1974;139(1):69-81",
        "title": "Prognostic signs and the role of operative management in acute pancreatitis"
      },
      "formula": "ranson",
      "formula_expression": "Ranson = 5 admission signs + 6 signs during first 48 h; each 1 if present; max 11",
      "max_score": 11,
      "score": 0,
      "mortality_band": "0-2"
    }
  ]
}

Response

Field Type Description
formula string ranson
formula_expression string Exact expression used
score integer Ranson points 0-11
max_score integer 11
mortality_band string Published grouped mortality: 0-2, 3-4, 5-6, or 7-11. A band, not an ICU order.
components array Per-sign points
citation object Ranson et al. 1974 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "factor": "age_gt_55",
      "points": 0,
      "present": false
    },
    {
      "factor": "wbc_gt_16k",
      "points": 0,
      "present": false
    },
    {
      "factor": "glucose_gt_200",
      "points": 0,
      "present": false
    },
    {
      "factor": "ldh_gt_350",
      "points": 0,
      "present": false
    },
    {
      "factor": "ast_gt_250",
      "points": 0,
      "present": false
    },
    {
      "factor": "hct_drop_gt_10",
      "points": 0,
      "present": false
    },
    {
      "factor": "bun_rise_gt_5",
      "points": 0,
      "present": false
    },
    {
      "factor": "calcium_lt_8",
      "points": 0,
      "present": false
    },
    {
      "factor": "pao2_lt_60",
      "points": 0,
      "present": false
    },
    {
      "factor": "base_deficit_gt_4",
      "points": 0,
      "present": false
    },
    {
      "factor": "fluid_seq_gt_6l",
      "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": "Ranson JH, Rifkind KM, Roses DF, Fink SD, Eng K, Spencer FC",
    "id": "ranson-1974",
    "pmid": "4834279",
    "source": "Surg Gynecol Obstet. 1974;139(1):69-81",
    "title": "Prognostic signs and the role of operative management in acute pancreatitis"
  },
  "formula": "ranson",
  "formula_expression": "Ranson = 5 admission signs + 6 signs during first 48 h; each 1 if present; max 11",
  "max_score": 11,
  "score": 0,
  "mortality_band": "0-2"
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_flag boolean clinical flags must be true or false 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

  • BISAP — Compute the Wu 2008 BISAP score for early prediction of mortality in acute pancreatitis from BUN, caller-assigned impaired mental status, caller-assigned SIRS, age, and caller-assigned pleural effusion.

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. Stdio MCP: /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.
  • 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.