MAGENT

LIVE

Glasgow-Blatchford score

Compute the Blatchford 2000 Glasgow-Blatchford score from urea, haemoglobin, systolic BP, heart rate, and four clinical flags.

LIVE $0.005 USDC GET /api/calc/glasgow_blatchford

Markdown: /docs/glasgow-blatchford.md · Canonical: https://magentlab.com/docs/glasgow-blatchford

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

What it computes

Compute the Blatchford 2000 Glasgow-Blatchford score from urea, haemoglobin, systolic BP, heart rate, and four clinical flags.

When to use

When an agent needs the Blatchford 2000 Glasgow-Blatchford arithmetic for upper-gastrointestinal haemorrhage and must not invent Rockall, AIMS65, or extra GBS risk bands.

When not to use

  • Not a diagnosis of the cause or severity of bleeding.
  • Not Rockall (full or pre-endoscopy) and not AIMS65.
  • Score 0 is the published low-risk screen for needing treatment; magent does not invent other GBS bands.
  • Urea may be mmol/L or BUN mg/dL (÷ 2.8); haemoglobin may be g/L or g/dL (× 10). Points use unrounded converted SI values.
  • Adults as in Blatchford 2000. The caller assigns findings; magent does not examine the patient.

Formula

GBS = urea_mmol_l table + haemoglobin_g_l table (sex-specific) + systolic_mm_hg table + (heart_rate_bpm >= 100) + melena + 2*syncope + 2*hepatic_disease + 2*cardiac_failure; max 23; score 0 low, else not_low

Citation

Title
A risk score to predict need for treatment for upper-gastrointestinal haemorrhage
Authors
Blatchford O, Murray WR, Blatchford M
Source
Lancet. 2000;356(9238):1318-1321
DOI
10.1016/S0140-6736(00)02816-6

Worked example

All items absent (score 0, low)

Given: cardiac_failure=falseheart_rate_bpm=80hemoglobin_g_l=140hepatic_disease=falsemelena=falsesex=malesyncope=falsesystolic_mm_hg=120urea_mmol_l=5.0

  1. Urea 5.0 mmol/L < 6.5 → 0; male Hb 140 g/L ≥ 130 → 0; SBP 120 ≥ 110 → 0; HR 80 is not ≥100 → 0
  2. Melena, syncope, hepatic disease, and cardiac failure all false
  3. Score = 0 (max 23); gbs_risk low

Urea 25.0 mmol/L scores 6 (not_low)

Given: cardiac_failure=falseheart_rate_bpm=80hemoglobin_g_l=140hepatic_disease=falsemelena=falsesex=malesyncope=falsesystolic_mm_hg=120urea_mmol_l=25.0

  1. Urea 25.0 mmol/L ≥ 25.0 → 6; remaining items absent
  2. Score = 6 (max 23); gbs_risk not_low

Also searched as

  • Glasgow-Blatchford score
  • GBS
  • Blatchford score
  • upper GI bleed score
  • UGIB risk score
  • Glasgow Blatchford

Try

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

/api/calc/glasgow_blatchford?sex=male&urea_mmol_l=5.0&hemoglobin_g_l=140&systolic_mm_hg=120&heart_rate_bpm=80&melena=false&syncope=false&hepatic_disease=false&cardiac_failure=false

Full URL: https://api.magentlab.com/api/calc/glasgow_blatchford?sex=male&urea_mmol_l=5.0&hemoglobin_g_l=140&systolic_mm_hg=120&heart_rate_bpm=80&melena=false&syncope=false&hepatic_disease=false&cardiac_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/glasgow_blatchford?sex=male&urea_mmol_l=5.0&hemoglobin_g_l=140&systolic_mm_hg=120&heart_rate_bpm=80&melena=false&syncope=false&hepatic_disease=false&cardiac_failure=false"

Parameters

Name Type Required Description
sex string required Sex (female or male). Haemoglobin points use the Blatchford 2000 sex-specific table.
urea_mmol_l number optional Blood urea in mmol/L (1-50). Provide this or bun_mg_dl, not both. <6.5 scores 0; 6.5–7.9 scores 2; 8.0–9.9 scores 3; 10.0–24.9 scores 4; ≥25.0 scores 6.
bun_mg_dl number optional BUN in mg/dL (3-140). Converted as urea_mmol_l = bun_mg_dl / 2.8. Provide this or urea_mmol_l, not both.
hemoglobin_g_l number optional Haemoglobin in g/L (30-220). Provide this or hemoglobin_g_dl, not both. Men: <100 → 6; 100–119 → 3; 120–129 → 1; ≥130 → 0. Women: <100 → 6; 100–119 → 1; ≥120 → 0.
hemoglobin_g_dl number optional Haemoglobin in g/dL (3-22). Converted as hemoglobin_g_l = hemoglobin_g_dl × 10. Provide this or hemoglobin_g_l, not both.
systolic_mm_hg number required Systolic blood pressure in mm Hg (50-250). <90 scores 3; 90–99 scores 2; 100–109 scores 1; ≥110 scores 0.
heart_rate_bpm integer required Heart rate in beats per minute (integer 30-220). Scores 1 when ≥100; 99 does not score.
melena boolean required Melena as assigned by the caller. true or false. 1 point if true.
syncope boolean required Syncope as assigned by the caller. true or false. 2 points if true.
hepatic_disease boolean required Hepatic disease as assigned by the caller. true or false. 2 points if true.
cardiac_failure boolean required Cardiac failure as assigned by the caller. true or false. 2 points if true.

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.

POST /api/calc/glasgow_blatchford Max 25 unit_amount * n PREVIEW

  • 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": [
    {
      "cardiac_failure": "false",
      "heart_rate_bpm": "80",
      "hemoglobin_g_l": "140",
      "hepatic_disease": "false",
      "melena": "false",
      "sex": "male",
      "syncope": "false",
      "systolic_mm_hg": "120",
      "urea_mmol_l": "5.0"
    },
    {
      "cardiac_failure": "false",
      "heart_rate_bpm": "80",
      "hemoglobin_g_l": "140",
      "hepatic_disease": "false",
      "melena": "false",
      "sex": "male",
      "syncope": "false",
      "systolic_mm_hg": "120",
      "urea_mmol_l": "5.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/glasgow_blatchford",
  "items": [
    {
      "components": [
        {
          "value": 5.0,
          "factor": "urea",
          "points": 0,
          "present": false
        },
        {
          "value": 140.0,
          "factor": "hemoglobin",
          "points": 0,
          "present": false
        },
        {
          "value": 120.0,
          "factor": "systolic",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate",
          "points": 0,
          "present": false
        },
        {
          "factor": "melena",
          "points": 0,
          "present": false
        },
        {
          "factor": "syncope",
          "points": 0,
          "present": false
        },
        {
          "factor": "hepatic_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "cardiac_failure",
          "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": "Blatchford O, Murray WR, Blatchford M",
        "doi": "10.1016/S0140-6736(00)02816-6",
        "id": "blatchford-2000",
        "source": "Lancet. 2000;356(9238):1318-1321",
        "title": "A risk score to predict need for treatment for upper-gastrointestinal haemorrhage"
      },
      "formula": "glasgow_blatchford",
      "formula_expression": "GBS = urea_mmol_l table + haemoglobin_g_l table (sex-specific) + systolic_mm_hg table + (heart_rate_bpm >= 100) + melena + 2*syncope + 2*hepatic_disease + 2*cardiac_failure; max 23; score 0 low, else not_low",
      "max_score": 23,
      "score": 0,
      "systolic_mm_hg": 120.0,
      "sex": "male",
      "gbs_risk": "low",
      "heart_rate_bpm": 80,
      "hemoglobin_g_l": 140.0,
      "urea_mmol_l": 5.0
    },
    {
      "components": [
        {
          "value": 5.0,
          "factor": "urea",
          "points": 0,
          "present": false
        },
        {
          "value": 140.0,
          "factor": "hemoglobin",
          "points": 0,
          "present": false
        },
        {
          "value": 120.0,
          "factor": "systolic",
          "points": 0,
          "present": false
        },
        {
          "value": 80,
          "factor": "heart_rate",
          "points": 0,
          "present": false
        },
        {
          "factor": "melena",
          "points": 0,
          "present": false
        },
        {
          "factor": "syncope",
          "points": 0,
          "present": false
        },
        {
          "factor": "hepatic_disease",
          "points": 0,
          "present": false
        },
        {
          "factor": "cardiac_failure",
          "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": "Blatchford O, Murray WR, Blatchford M",
        "doi": "10.1016/S0140-6736(00)02816-6",
        "id": "blatchford-2000",
        "source": "Lancet. 2000;356(9238):1318-1321",
        "title": "A risk score to predict need for treatment for upper-gastrointestinal haemorrhage"
      },
      "formula": "glasgow_blatchford",
      "formula_expression": "GBS = urea_mmol_l table + haemoglobin_g_l table (sex-specific) + systolic_mm_hg table + (heart_rate_bpm >= 100) + melena + 2*syncope + 2*hepatic_disease + 2*cardiac_failure; max 23; score 0 low, else not_low",
      "max_score": 23,
      "score": 0,
      "systolic_mm_hg": 120.0,
      "sex": "male",
      "gbs_risk": "low",
      "heart_rate_bpm": 80,
      "hemoglobin_g_l": 140.0,
      "urea_mmol_l": 5.0
    }
  ]
}

Response

Field Type Description
formula string glasgow_blatchford
formula_expression string Exact expression used
score integer Total points 0-23
max_score integer Always 23
gbs_risk string low when score is 0; not_low otherwise. Score 0 is the published low-risk screen. magent does not invent other GBS bands.
urea_mmol_l number Urea used in mmol/L (after conversion), 1 decimal
hemoglobin_g_l number Haemoglobin used in g/L (after conversion), 1 decimal
sex string female or male
systolic_mm_hg number Systolic BP used, mm Hg
heart_rate_bpm integer Heart rate used, beats per minute
components array Per-item points
citation object Blatchford 2000 citation
disclaimer string Not-a-device notice

Example JSON

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

{
  "components": [
    {
      "value": 5.0,
      "factor": "urea",
      "points": 0,
      "present": false
    },
    {
      "value": 140.0,
      "factor": "hemoglobin",
      "points": 0,
      "present": false
    },
    {
      "value": 120.0,
      "factor": "systolic",
      "points": 0,
      "present": false
    },
    {
      "value": 80,
      "factor": "heart_rate",
      "points": 0,
      "present": false
    },
    {
      "factor": "melena",
      "points": 0,
      "present": false
    },
    {
      "factor": "syncope",
      "points": 0,
      "present": false
    },
    {
      "factor": "hepatic_disease",
      "points": 0,
      "present": false
    },
    {
      "factor": "cardiac_failure",
      "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": "Blatchford O, Murray WR, Blatchford M",
    "doi": "10.1016/S0140-6736(00)02816-6",
    "id": "blatchford-2000",
    "source": "Lancet. 2000;356(9238):1318-1321",
    "title": "A risk score to predict need for treatment for upper-gastrointestinal haemorrhage"
  },
  "formula": "glasgow_blatchford",
  "formula_expression": "GBS = urea_mmol_l table + haemoglobin_g_l table (sex-specific) + systolic_mm_hg table + (heart_rate_bpm >= 100) + melena + 2*syncope + 2*hepatic_disease + 2*cardiac_failure; max 23; score 0 low, else not_low",
  "max_score": 23,
  "score": 0,
  "systolic_mm_hg": 120.0,
  "sex": "male",
  "gbs_risk": "low",
  "heart_rate_bpm": 80,
  "hemoglobin_g_l": 140.0,
  "urea_mmol_l": 5.0
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_urea urea_mmol_l (1-50) or bun_mg_dl (3-140) is required, not both. 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_sex sex must be female or male 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_heart_rate heart_rate_bpm must be an integer from 30 to 220 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_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

None.

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.