MAGENT

GI · LIVE

Edinburgh gastric ulcer score (EGUS)

EGUS

Return the Brindle 2021 Edinburgh gastric ulcer score (age, ulcer size, and location; total 0-6) and the published Youden cut higher_malignancy_risk at score ≥ 3.

LIVE $0.005 USDC GET /api/calc/egus

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

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

What it computes

Return the Brindle 2021 Edinburgh gastric ulcer score (age, ulcer size, and location; total 0-6) and the published Youden cut higher_malignancy_risk at score ≥ 3.

When to use

When an agent already has age, endoscopist-estimated ulcer size in cm, and antral versus non-antral location at index OGD and needs the published 0-6 total and ≥3 cut. magent does not read endoscopy images or decide follow-up OGD.

When not to use

  • Not a medical device. Not a biopsy protocol, follow-up-OGD order, or gastric-cancer diagnosis.
  • Human gastric ulcer malignancy risk at index OGD (Brindle 2021). Not equine EGUS (equine gastric ulcer syndrome).
  • The score applies only alongside a macroscopically benign appearance and at least six negative biopsies, as that paper states. magent does not read endoscopy images, measure the ulcer, or assign location.
  • Age <68 scores 0; 68-79 scores 1; ≥80 scores 2. Ulcer size <1.25 cm scores 0; 1.25-2.99 cm scores 2; ≥3.00 cm scores 3. There is no 1-point size band. Location antral (antrum or pre-pylorus) scores 0; non-antral scores 1. The caller assigns location as antral or non-antral.
  • higher_malignancy_risk is the published Youden cut score ≥ 3 of 6. Derivation NPV below 3 was 97.4%; validation NPV was 98.6% (Brindle 2021 citation facts). magent does not emit extra risk classes or follow-up bands.

Formula

EGUS = age_points + ulcer_size_points + location_points; age <68 → 0, 68-79 → 1, ≥80 → 2; size <1.25 cm → 0, 1.25-2.99 cm → 2, ≥3.00 cm → 3 (no 1-point size band); antral 0, non-antral 1; max 6; higher_malignancy_risk iff score ≥ 3 (Brindle 2021 Youden cut)

Citation

Title
Risk stratifying gastric ulcers: development and validation of a scoring system
Authors
Brindle WM, Grant RK, Smith M, Suddaby M, Wallace A, Gillespie SL, Church NI, Noble CL, Penman ID, Plevris JN, Robertson AR, Watson EF, Selinger CP, Kalla R, Masterton GSM, EGAR (Edinburgh GI Audit and Research) Collaborative
Source
Frontline Gastroenterol. 2021;13(2):111-118
DOI
10.1136/flgastro-2020-101759

Worked example

Age 50, 1.0 cm antral ulcer

Given: age=50location=antralulcer_size_cm=1.0

  1. age 50 → 0; ulcer_size_cm 1.0 (<1.25) → 0; location antral → 0
  2. Score = 0 (max 6); higher_malignancy_risk false

Age 80, 3.0 cm non-antral ulcer

Given: age=80location=non-antralulcer_size_cm=3.0

  1. age 80 → 2; ulcer_size_cm 3.0 (≥3.00) → 3; location non-antral → 1
  2. Score = 6 (max 6); higher_malignancy_risk true

Also searched as

  • Edinburgh gastric ulcer score
  • EGUS
  • Brindle gastric ulcer score
  • gastric ulcer malignancy risk score
  • antral gastric ulcer score
  • Brindle 2021 gastric ulcer
  • index OGD gastric ulcer score
  • human gastric ulcer risk score

Try

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

/api/calc/egus?age=50&ulcer_size_cm=1.0&location=antral

Full URL: https://api.magentlab.com/api/calc/egus?age=50&ulcer_size_cm=1.0&location=antral

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/egus?age=50&ulcer_size_cm=1.0&location=antral"

Parameters

Name Type Required Description
age integer required Age in years (18-120). Brindle 2021: <68 → 0; 68-79 → 1; ≥80 → 2.
ulcer_size_cm number required Endoscopist-estimated ulcer size in cm as assigned by the caller (Brindle 2021). <1.25 cm → 0; 1.25-2.99 cm → 2; ≥3.00 cm → 3. There is no 1-point size band. Magent clamp 0.1-40, not a published range. magent does not measure the ulcer.
location string required · antral, non-antral Caller-assigned ulcer location (Brindle 2021). antral (antrum or pre-pylorus) scores 0; non-antral scores 1. Case-insensitive. magent does not read endoscopy images or assign location.

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/egus 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": "50",
      "location": "antral",
      "ulcer_size_cm": "1.0"
    },
    {
      "age": "50",
      "location": "antral",
      "ulcer_size_cm": "1.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/egus",
  "items": [
    {
      "components": [
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": true
        },
        {
          "value": 1.0,
          "factor": "ulcer_size_cm",
          "points": 0,
          "present": true
        },
        {
          "value": "antral",
          "factor": "location",
          "points": 0,
          "present": true
        }
      ],
      "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": "Brindle WM, Grant RK, Smith M, Suddaby M, Wallace A, Gillespie SL, Church NI, Noble CL, Penman ID, Plevris JN, Robertson AR, Watson EF, Selinger CP, Kalla R, Masterton GSM, EGAR (Edinburgh GI Audit and Research) Collaborative",
        "doi": "10.1136/flgastro-2020-101759",
        "id": "brindle-2021",
        "pmid": "35295750",
        "source": "Frontline Gastroenterol. 2021;13(2):111-118",
        "title": "Risk stratifying gastric ulcers: development and validation of a scoring system"
      },
      "formula": "egus",
      "formula_expression": "EGUS = age_points + ulcer_size_points + location_points; age <68 → 0, 68-79 → 1, ≥80 → 2; size <1.25 cm → 0, 1.25-2.99 cm → 2, ≥3.00 cm → 3 (no 1-point size band); antral 0, non-antral 1; max 6; higher_malignancy_risk iff score ≥ 3 (Brindle 2021 Youden cut)",
      "max_score": 6,
      "score": 0,
      "higher_malignancy_risk": false
    },
    {
      "components": [
        {
          "value": 50,
          "factor": "age",
          "points": 0,
          "present": true
        },
        {
          "value": 1.0,
          "factor": "ulcer_size_cm",
          "points": 0,
          "present": true
        },
        {
          "value": "antral",
          "factor": "location",
          "points": 0,
          "present": true
        }
      ],
      "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": "Brindle WM, Grant RK, Smith M, Suddaby M, Wallace A, Gillespie SL, Church NI, Noble CL, Penman ID, Plevris JN, Robertson AR, Watson EF, Selinger CP, Kalla R, Masterton GSM, EGAR (Edinburgh GI Audit and Research) Collaborative",
        "doi": "10.1136/flgastro-2020-101759",
        "id": "brindle-2021",
        "pmid": "35295750",
        "source": "Frontline Gastroenterol. 2021;13(2):111-118",
        "title": "Risk stratifying gastric ulcers: development and validation of a scoring system"
      },
      "formula": "egus",
      "formula_expression": "EGUS = age_points + ulcer_size_points + location_points; age <68 → 0, 68-79 → 1, ≥80 → 2; size <1.25 cm → 0, 1.25-2.99 cm → 2, ≥3.00 cm → 3 (no 1-point size band); antral 0, non-antral 1; max 6; higher_malignancy_risk iff score ≥ 3 (Brindle 2021 Youden cut)",
      "max_score": 6,
      "score": 0,
      "higher_malignancy_risk": false
    }
  ]
}

Response

Field Type Description
formula string egus
formula_expression string Exact expression used
score integer Total points 0-6
max_score integer Always 6
higher_malignancy_risk boolean true iff score ≥ 3 (Brindle 2021 Youden cut). Not a gastric-cancer diagnosis.
components array Age, ulcer-size, and location points
citation object Brindle 2021 citation
disclaimer string Not a medical device

Example JSON

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

{
  "components": [
    {
      "value": 50,
      "factor": "age",
      "points": 0,
      "present": true
    },
    {
      "value": 1.0,
      "factor": "ulcer_size_cm",
      "points": 0,
      "present": true
    },
    {
      "value": "antral",
      "factor": "location",
      "points": 0,
      "present": true
    }
  ],
  "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": "Brindle WM, Grant RK, Smith M, Suddaby M, Wallace A, Gillespie SL, Church NI, Noble CL, Penman ID, Plevris JN, Robertson AR, Watson EF, Selinger CP, Kalla R, Masterton GSM, EGAR (Edinburgh GI Audit and Research) Collaborative",
    "doi": "10.1136/flgastro-2020-101759",
    "id": "brindle-2021",
    "pmid": "35295750",
    "source": "Frontline Gastroenterol. 2021;13(2):111-118",
    "title": "Risk stratifying gastric ulcers: development and validation of a scoring system"
  },
  "formula": "egus",
  "formula_expression": "EGUS = age_points + ulcer_size_points + location_points; age <68 → 0, 68-79 → 1, ≥80 → 2; size <1.25 cm → 0, 1.25-2.99 cm → 2, ≥3.00 cm → 3 (no 1-point size band); antral 0, non-antral 1; max 6; higher_malignancy_risk iff score ≥ 3 (Brindle 2021 Youden cut)",
  "max_score": 6,
  "score": 0,
  "higher_malignancy_risk": false
}

Client errors (HTTP 400)

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

HTTP Code When
400 invalid_age age must be an integer from 18 to 120 Returned before settlement; you are not charged.
400 invalid_egus EGUS inputs must match Brindle 2021 age, ulcer size, and location bands from that paper. 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

  • 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.
  • 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.

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. 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.