MAGENT

GI · LIVE

Oakland score (safe discharge after LGIB)

Oakland score

Sum the Oakland 2017 derivation-table weights for acute lower gastrointestinal bleeding and return safe_discharge (score ≤8) or not_safe (score >8).

LIVE $0.005 USDC GET /api/calc/oakland

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

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

What it computes

Sum the Oakland 2017 derivation-table weights for acute lower gastrointestinal bleeding and return safe_discharge (score ≤8) or not_safe (score >8).

When to use

When an agent needs the published Oakland 2017 point total and must not invent a discharge order, an LGIB diagnosis, or a later validation cutoff.

When not to use

  • Not a medical device and not a discharge order. magent does not examine the rectum or assay hemoglobin.
  • Not a diagnosis of lower GI bleeding. This tool returns the published Oakland 2017 point total only.
  • dre_blood is blood on digital rectal examination as assigned by the caller. magent does not examine the patient.
  • Hemoglobin may be g/dL or g/L (÷ 10). The first published band starts at 3.6 g/dL; values below that after conversion are rejected.
  • safe_discharge is score ≤8 from the Oakland 2017 derivation. This is not a later US validation threshold.

Formula

Oakland = age (≤39:0, 40-69:1, ≥70:2) + male 1 + previous_lgib_admission 1 + dre_blood 1 + HR (<70:0, 70-89:1, 90-109:2, ≥110:3) + SBP (50-89:5, 90-119:4, 120-129:3, 130-159:2, ≥160:0) + Hb g/dL (3.6-6.9:22, 7.0-8.9:17, 9.0-10.9:13, 11.0-12.9:8, 13.0-15.9:4, ≥16.0:0); Oakland 2017 derivation; max 35; safe_discharge ≤8

Citation

Title
Derivation and validation of a novel risk score for safe discharge after acute lower gastrointestinal bleeding: a modelling study
Authors
Oakland K, Jairath V, Uberoi R, Guy R, Ayaru L, Mortensen N, Murphy MF, Collins GS
Source
Lancet Gastroenterol Hepatol. 2017;2(9):635-643
DOI
10.1016/s2468-1253(17)30150-4

Worked example

All items in zero bands (score 0, safe_discharge)

Given: age=35dre_blood=falseheart_rate_bpm=65hemoglobin_g_dl=16.5previous_lgib_admission=falsesex=femalesystolic_mm_hg=165

  1. Age 35 ≤39 → 0; female → 0; previous LGIB false → 0; DRE blood false → 0
  2. HR 65 <70 → 0; SBP 165 ≥160 → 0; Hb 16.5 g/dL ≥16.0 → 0
  3. Score = 0 (max 35); oakland_band = safe_discharge (≤8)

High-weight bands (score 35, not_safe)

Given: age=80dre_blood=trueheart_rate_bpm=110hemoglobin_g_dl=6.0previous_lgib_admission=truesex=malesystolic_mm_hg=80

  1. Age 80 ≥70 → 2; male → 1; previous LGIB → 1; DRE blood → 1
  2. HR 110 ≥110 → 3; SBP 80 in 50-89 → 5; Hb 6.0 g/dL in 3.6-6.9 → 22
  3. Score = 35 (max 35); oakland_band = not_safe (>8)

Also searched as

  • Oakland score
  • Oakland LGIB score
  • lower GI bleed discharge score
  • Oakland 2017
  • acute lower GI bleeding score
  • Oakland safe discharge

Try

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

/api/calc/oakland?age=35&sex=female&previous_lgib_admission=false&dre_blood=false&heart_rate_bpm=65&systolic_mm_hg=165&hemoglobin_g_dl=16.5

Full URL: https://api.magentlab.com/api/calc/oakland?age=35&sex=female&previous_lgib_admission=false&dre_blood=false&heart_rate_bpm=65&systolic_mm_hg=165&hemoglobin_g_dl=16.5

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/oakland?age=35&sex=female&previous_lgib_admission=false&dre_blood=false&heart_rate_bpm=65&systolic_mm_hg=165&hemoglobin_g_dl=16.5"

Parameters

Name Type Required Description
age integer required Age in years (integer 16-120). Oakland 2017: ≤39 → 0, 40-69 → 1, ≥70 → 2.
sex string required · female, male Sex as assigned by the caller. female scores 0; male scores 1.
previous_lgib_admission boolean required Previous admission for lower GI bleeding as assigned by the caller (Oakland 2017). true scores 1.
dre_blood boolean required Blood on digital rectal examination as assigned by the caller (Oakland 2017). true scores 1. magent does not examine the rectum.
heart_rate_bpm integer required Heart rate in beats per minute (integer 30-220). Oakland 2017: <70 → 0, 70-89 → 1, 90-109 → 2, ≥110 → 3.
systolic_mm_hg number required Systolic blood pressure in mm Hg (50-250). Oakland 2017: 50-89 → 5, 90-119 → 4, 120-129 → 3, 130-159 → 2, ≥160 → 0. magent does not read a blood pressure.
hemoglobin_g_dl number optional Hemoglobin in g/dL (3-22). Provide this or hemoglobin_g_l, not both. Oakland 2017 bands start at 3.6 g/dL: 3.6-6.9 → 22, 7.0-8.9 → 17, 9.0-10.9 → 13, 11.0-12.9 → 8, 13.0-15.9 → 4, ≥16.0 → 0. Values <3.6 after conversion are rejected. magent does not assay hemoglobin.
hemoglobin_g_l number optional Hemoglobin in g/L (30-220). Converted as hemoglobin_g_dl = hemoglobin_g_l / 10. Provide this or hemoglobin_g_dl, not both. Values <3.6 g/dL after conversion are rejected.

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/oakland 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": "35",
      "dre_blood": "false",
      "heart_rate_bpm": "65",
      "hemoglobin_g_dl": "16.5",
      "previous_lgib_admission": "false",
      "sex": "female",
      "systolic_mm_hg": "165"
    },
    {
      "age": "35",
      "dre_blood": "false",
      "heart_rate_bpm": "65",
      "hemoglobin_g_dl": "16.5",
      "previous_lgib_admission": "false",
      "sex": "female",
      "systolic_mm_hg": "165"
    }
  ]
}

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/oakland",
  "items": [
    {
      "components": [
        {
          "value": 35,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "value": "female",
          "factor": "sex",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_lgib_admission",
          "points": 0,
          "present": false
        },
        {
          "factor": "dre_blood",
          "points": 0,
          "present": false
        },
        {
          "value": 65,
          "factor": "heart_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 165.0,
          "factor": "systolic",
          "points": 0,
          "present": false
        },
        {
          "value": 16.5,
          "factor": "hemoglobin",
          "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": "Oakland K, Jairath V, Uberoi R, Guy R, Ayaru L, Mortensen N, Murphy MF, Collins GS",
        "doi": "10.1016/s2468-1253(17)30150-4",
        "id": "oakland-2017",
        "pmid": "28651935",
        "source": "Lancet Gastroenterol Hepatol. 2017;2(9):635-643",
        "title": "Derivation and validation of a novel risk score for safe discharge after acute lower gastrointestinal bleeding: a modelling study"
      },
      "formula": "oakland",
      "formula_expression": "Oakland = age (≤39:0, 40-69:1, ≥70:2) + male 1 + previous_lgib_admission 1 + dre_blood 1 + HR (<70:0, 70-89:1, 90-109:2, ≥110:3) + SBP (50-89:5, 90-119:4, 120-129:3, 130-159:2, ≥160:0) + Hb g/dL (3.6-6.9:22, 7.0-8.9:17, 9.0-10.9:13, 11.0-12.9:8, 13.0-15.9:4, ≥16.0:0); Oakland 2017 derivation; max 35; safe_discharge ≤8",
      "systolic_mm_hg": 165.0,
      "age_years": 35,
      "max_score": 35,
      "score": 0,
      "sex": "female",
      "heart_rate_bpm": 65,
      "hemoglobin_g_dl": 16.5,
      "dre_blood": false,
      "oakland_band": "safe_discharge",
      "previous_lgib_admission": false
    },
    {
      "components": [
        {
          "value": 35,
          "factor": "age",
          "points": 0,
          "present": false
        },
        {
          "value": "female",
          "factor": "sex",
          "points": 0,
          "present": false
        },
        {
          "factor": "previous_lgib_admission",
          "points": 0,
          "present": false
        },
        {
          "factor": "dre_blood",
          "points": 0,
          "present": false
        },
        {
          "value": 65,
          "factor": "heart_rate",
          "points": 0,
          "present": false
        },
        {
          "value": 165.0,
          "factor": "systolic",
          "points": 0,
          "present": false
        },
        {
          "value": 16.5,
          "factor": "hemoglobin",
          "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": "Oakland K, Jairath V, Uberoi R, Guy R, Ayaru L, Mortensen N, Murphy MF, Collins GS",
        "doi": "10.1016/s2468-1253(17)30150-4",
        "id": "oakland-2017",
        "pmid": "28651935",
        "source": "Lancet Gastroenterol Hepatol. 2017;2(9):635-643",
        "title": "Derivation and validation of a novel risk score for safe discharge after acute lower gastrointestinal bleeding: a modelling study"
      },
      "formula": "oakland",
      "formula_expression": "Oakland = age (≤39:0, 40-69:1, ≥70:2) + male 1 + previous_lgib_admission 1 + dre_blood 1 + HR (<70:0, 70-89:1, 90-109:2, ≥110:3) + SBP (50-89:5, 90-119:4, 120-129:3, 130-159:2, ≥160:0) + Hb g/dL (3.6-6.9:22, 7.0-8.9:17, 9.0-10.9:13, 11.0-12.9:8, 13.0-15.9:4, ≥16.0:0); Oakland 2017 derivation; max 35; safe_discharge ≤8",
      "systolic_mm_hg": 165.0,
      "age_years": 35,
      "max_score": 35,
      "score": 0,
      "sex": "female",
      "heart_rate_bpm": 65,
      "hemoglobin_g_dl": 16.5,
      "dre_blood": false,
      "oakland_band": "safe_discharge",
      "previous_lgib_admission": false
    }
  ]
}

Response

Field Type Description
formula string oakland
formula_expression string Exact expression used
score integer Oakland points 0-35
max_score integer Always 35
oakland_band string safe_discharge when score ≤8, not_safe when score >8 (Oakland 2017 derivation cutoff). Not a discharge order.
age_years integer Age used (years)
sex string Sex used: male or female
previous_lgib_admission boolean Caller-assigned previous LGIB admission flag used
dre_blood boolean Caller-assigned blood on digital rectal examination flag used
heart_rate_bpm integer Heart rate used (bpm)
systolic_mm_hg number Systolic blood pressure used (mm Hg)
hemoglobin_g_dl number Hemoglobin used in g/dL (g/L inputs converted as g/dL = g/L / 10)
components array Per-factor points
citation object Oakland 2017 Lancet Gastroenterol Hepatol citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "value": 35,
      "factor": "age",
      "points": 0,
      "present": false
    },
    {
      "value": "female",
      "factor": "sex",
      "points": 0,
      "present": false
    },
    {
      "factor": "previous_lgib_admission",
      "points": 0,
      "present": false
    },
    {
      "factor": "dre_blood",
      "points": 0,
      "present": false
    },
    {
      "value": 65,
      "factor": "heart_rate",
      "points": 0,
      "present": false
    },
    {
      "value": 165.0,
      "factor": "systolic",
      "points": 0,
      "present": false
    },
    {
      "value": 16.5,
      "factor": "hemoglobin",
      "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": "Oakland K, Jairath V, Uberoi R, Guy R, Ayaru L, Mortensen N, Murphy MF, Collins GS",
    "doi": "10.1016/s2468-1253(17)30150-4",
    "id": "oakland-2017",
    "pmid": "28651935",
    "source": "Lancet Gastroenterol Hepatol. 2017;2(9):635-643",
    "title": "Derivation and validation of a novel risk score for safe discharge after acute lower gastrointestinal bleeding: a modelling study"
  },
  "formula": "oakland",
  "formula_expression": "Oakland = age (≤39:0, 40-69:1, ≥70:2) + male 1 + previous_lgib_admission 1 + dre_blood 1 + HR (<70:0, 70-89:1, 90-109:2, ≥110:3) + SBP (50-89:5, 90-119:4, 120-129:3, 130-159:2, ≥160:0) + Hb g/dL (3.6-6.9:22, 7.0-8.9:17, 9.0-10.9:13, 11.0-12.9:8, 13.0-15.9:4, ≥16.0:0); Oakland 2017 derivation; max 35; safe_discharge ≤8",
  "systolic_mm_hg": 165.0,
  "age_years": 35,
  "max_score": 35,
  "score": 0,
  "sex": "female",
  "heart_rate_bpm": 65,
  "hemoglobin_g_dl": 16.5,
  "dre_blood": false,
  "oakland_band": "safe_discharge",
  "previous_lgib_admission": false
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_oakland_age age must be an integer from 16 to 120 (Oakland 2017 acute lower GI bleeding). Returned before settlement; you are not charged.
400 invalid_sex sex must be female or male 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_heart_rate heart_rate_bpm must be an integer from 30 to 220 Returned before settlement; you are not charged.
400 invalid_systolic_bp systolic_mm_hg or systolic_bp_mm_hg must be a number from 50 to 250. Returned before settlement; you are not charged.
400 invalid_hemoglobin hemoglobin_g_l (30-220) or hemoglobin_g_dl (3-22) is required, not both. 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

  • Glasgow-Blatchford score — Compute the Blatchford 2000 Glasgow-Blatchford score from urea, haemoglobin, systolic BP, heart rate, and four clinical flags.
  • AIMS65 — Compute the Saltzman 2011 AIMS65 score for in-hospital mortality in acute upper GI bleeding from albumin, INR, caller-assigned altered mental status, systolic blood pressure, and age.
  • Rockall — Compute the Rockall 1996 complete (post-endoscopy) score from age, heart rate, systolic blood pressure, caller-assigned comorbidity, diagnosis, and stigmata of recent haemorrhage after acute upper gastrointestinal haemorrhage.

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.