GI · LIVE
Eosinophilic oesophagitis endoscopic reference score
EREFS
Sum five caller-assigned Hirano 2013 modified EREFS descriptors (edema 0-1, rings 0-3, exudates 0-2, furrows 0-1 after collapsing original 0-2, stricture 0-1) and return the total (max 8). Does not return activity bands, inflammatory or fibrostenotic subscores, or later 0-9 furrows 0-2 expansions.
Markdown: /docs/erefs.md · Canonical: https://magentlab.com/docs/erefs
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum five caller-assigned Hirano 2013 modified EREFS descriptors (edema 0-1, rings 0-3, exudates 0-2, furrows 0-1 after collapsing original 0-2, stricture 0-1) and return the total (max 8). Does not return activity bands, inflammatory or fibrostenotic subscores, or later 0-9 furrows 0-2 expansions.
When to use
When an agent has already assigned Hirano 2013 modified edema, rings, exudates, furrows, and stricture at endoscopy and needs the five-item 0-8 total, not a diagnosis, inflammatory/fibrostenotic subscores, or the later 0-9 expansion that restores furrows 0-2.
When not to use
- Not a medical device and not a diagnosis of eosinophilic oesophagitis or a treatment order.
- Each descriptor is a caller-assigned Hirano 2013 modified token. magent does not perform endoscopy.
- Furrows use the modified good-agreement collapse (absent 0, present 1). This is not original Hirano 2013 furrows 0-2 and not later 0-9 expansions that restore furrows 0-2.
- Hirano 2013 did not publish mild, moderate, or severe cutoffs for the total score. magent returns score and max_score only and does not apply later EREFS activity bands.
- Crepe-paper mucosa and narrow-calibre oesophagus are not included in the sum. Inflammatory and fibrostenotic subscores are not returned.
Formula
EREFS = edema (absent 0, present 1; loss of vascular markings) + rings (none 0, mild 1, moderate 2, severe 3) + exudates (none 0, mild_lt_10pct 1, severe_gt_10pct 2) + furrows (absent 0, present 1; modified, original 0-2 collapsed) + stricture (absent 0, present 1); Hirano 2013 modified good-agreement version; not later 0-9 furrows 0-2; crepe-paper and narrow-calibre not scored; no published total-score activity bands
Citation
- Authors
- Hirano I, Moy N, Heckman MG, Thomas CS, Gonsalves N, Achem SR
- Source
- Gut. 2013;62(4):489-495
Worked example
All descriptors absent or none
Given:
edema=absentexudates=nonefurrows=absentrings=nonestricture=absent
- edema absent 0 + rings none 0 + exudates none 0 + furrows absent 0 + stricture absent 0
- Score = 0 (max 8). No activity band.
All descriptors maximum
Given:
edema=presentexudates=severe_gt_10pctfurrows=presentrings=severestricture=present
- edema present 1 + rings severe 3 + exudates severe_gt_10pct 2 + furrows present 1 + stricture present 1
- Score = 8 (max 8). No activity band.
Also searched as
- EREFS
- eosinophilic oesophagitis endoscopic reference score
- EoE EREFS
- Hirano EREFS
- EREFS score
- eosinophilic esophagitis endoscopy score
- modified EREFS
- EoE endoscopic reference score
- Hirano 2013 EREFS
- oesophageal EREFS
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
/api/calc/erefs?edema=absent&rings=none&exudates=none&furrows=absent&stricture=absent
Full URL: https://api.magentlab.com/api/calc/erefs?edema=absent&rings=none&exudates=none&furrows=absent&stricture=absent
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/erefs?edema=absent&rings=none&exudates=none&furrows=absent&stricture=absent"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
edema |
string | required · absent, present | Caller-assigned Hirano 2013 modified EREFS edema (oedema; loss of vascular markings): absent (0; vascular markings present) or present (1; decreased or absent vascular markings). magent does not perform endoscopy. |
rings |
string | required · none, mild, moderate, severe | Caller-assigned Hirano 2013 EREFS rings (fixed rings): none (0), mild (1; subtle circumferential ridges), moderate (2; distinct rings that a diagnostic adult endoscope still passes), or severe (3; cannot pass a diagnostic adult endoscope). magent does not perform endoscopy. |
exudates |
string | required · none, mild_lt_10pct, severe_gt_10pct | Caller-assigned Hirano 2013 EREFS exudates (white plaques): none (0), mild_lt_10pct (1; lesions involving <10% of the oesophageal surface area), or severe_gt_10pct (2; lesions involving >10% of the oesophageal surface area). magent does not perform endoscopy. |
furrows |
string | required · absent, present | Caller-assigned Hirano 2013 modified EREFS furrows (vertical lines): absent (0) or present (1). Original Hirano 2013 graded furrows 0-2 (none / mild without depth / severe with indentation); the modified good-agreement version collapses that to absent vs present. Not the later 0-9 expansion that restores furrows 0-2. magent does not perform endoscopy. |
stricture |
string | required · absent, present | Caller-assigned Hirano 2013 EREFS stricture: absent (0) or present (1). magent does not perform endoscopy. |
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.
- 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": [
{
"edema": "absent",
"exudates": "none",
"furrows": "absent",
"rings": "none",
"stricture": "absent"
},
{
"edema": "absent",
"exudates": "none",
"furrows": "absent",
"rings": "none",
"stricture": "absent"
}
]
}
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/erefs",
"items": [
{
"components": [
{
"value": "absent",
"factor": "edema",
"points": 0,
"present": true
},
{
"value": "none",
"factor": "rings",
"points": 0,
"present": true
},
{
"value": "none",
"factor": "exudates",
"points": 0,
"present": true
},
{
"value": "absent",
"factor": "furrows",
"points": 0,
"present": true
},
{
"value": "absent",
"factor": "stricture",
"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": "Hirano I, Moy N, Heckman MG, Thomas CS, Gonsalves N, Achem SR",
"doi": "10.1136/gutjnl-2011-301817",
"id": "hirano-2013",
"pmid": "22619364",
"source": "Gut. 2013;62(4):489-495",
"title": "Endoscopic assessment of the oesophageal features of eosinophilic oesophagitis: validation of a novel classification and grading system."
},
"formula": "erefs",
"formula_expression": "EREFS = edema (absent 0, present 1; loss of vascular markings) + rings (none 0, mild 1, moderate 2, severe 3) + exudates (none 0, mild_lt_10pct 1, severe_gt_10pct 2) + furrows (absent 0, present 1; modified, original 0-2 collapsed) + stricture (absent 0, present 1); Hirano 2013 modified good-agreement version; not later 0-9 furrows 0-2; crepe-paper and narrow-calibre not scored; no published total-score activity bands",
"max_score": 8,
"score": 0,
"edema": "absent",
"exudates": "none",
"furrows": "absent",
"rings": "none",
"stricture": "absent"
},
{
"components": [
{
"value": "absent",
"factor": "edema",
"points": 0,
"present": true
},
{
"value": "none",
"factor": "rings",
"points": 0,
"present": true
},
{
"value": "none",
"factor": "exudates",
"points": 0,
"present": true
},
{
"value": "absent",
"factor": "furrows",
"points": 0,
"present": true
},
{
"value": "absent",
"factor": "stricture",
"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": "Hirano I, Moy N, Heckman MG, Thomas CS, Gonsalves N, Achem SR",
"doi": "10.1136/gutjnl-2011-301817",
"id": "hirano-2013",
"pmid": "22619364",
"source": "Gut. 2013;62(4):489-495",
"title": "Endoscopic assessment of the oesophageal features of eosinophilic oesophagitis: validation of a novel classification and grading system."
},
"formula": "erefs",
"formula_expression": "EREFS = edema (absent 0, present 1; loss of vascular markings) + rings (none 0, mild 1, moderate 2, severe 3) + exudates (none 0, mild_lt_10pct 1, severe_gt_10pct 2) + furrows (absent 0, present 1; modified, original 0-2 collapsed) + stricture (absent 0, present 1); Hirano 2013 modified good-agreement version; not later 0-9 furrows 0-2; crepe-paper and narrow-calibre not scored; no published total-score activity bands",
"max_score": 8,
"score": 0,
"edema": "absent",
"exudates": "none",
"furrows": "absent",
"rings": "none",
"stricture": "absent"
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | erefs |
formula_expression |
string | Exact expression used |
score |
integer | Hirano 2013 modified EREFS points 0-8 (furrows collapsed to absent/present; not later 0-9) |
max_score |
integer | Always 8 |
edema |
string | Caller-assigned token: absent or present |
rings |
string | Caller-assigned token: none, mild, moderate, or severe |
exudates |
string | Caller-assigned token: none, mild_lt_10pct, or severe_gt_10pct |
furrows |
string | Caller-assigned token: absent or present (modified; not original 0-2) |
stricture |
string | Caller-assigned token: absent or present |
components |
array | Per-descriptor caller-assigned points |
citation |
object | Hirano et al. Gut 2013 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": "absent",
"factor": "edema",
"points": 0,
"present": true
},
{
"value": "none",
"factor": "rings",
"points": 0,
"present": true
},
{
"value": "none",
"factor": "exudates",
"points": 0,
"present": true
},
{
"value": "absent",
"factor": "furrows",
"points": 0,
"present": true
},
{
"value": "absent",
"factor": "stricture",
"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": "Hirano I, Moy N, Heckman MG, Thomas CS, Gonsalves N, Achem SR",
"doi": "10.1136/gutjnl-2011-301817",
"id": "hirano-2013",
"pmid": "22619364",
"source": "Gut. 2013;62(4):489-495",
"title": "Endoscopic assessment of the oesophageal features of eosinophilic oesophagitis: validation of a novel classification and grading system."
},
"formula": "erefs",
"formula_expression": "EREFS = edema (absent 0, present 1; loss of vascular markings) + rings (none 0, mild 1, moderate 2, severe 3) + exudates (none 0, mild_lt_10pct 1, severe_gt_10pct 2) + furrows (absent 0, present 1; modified, original 0-2 collapsed) + stricture (absent 0, present 1); Hirano 2013 modified good-agreement version; not later 0-9 furrows 0-2; crepe-paper and narrow-calibre not scored; no published total-score activity bands",
"max_score": 8,
"score": 0,
"edema": "absent",
"exudates": "none",
"furrows": "absent",
"rings": "none",
"stricture": "absent"
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_erefs |
edema must be absent or present; rings must be none, mild, moderate, or severe; exudates must be none, mild_lt_10pct, or severe_gt_10pct; furrows must be absent or present; stricture must be absent or present (Hirano 2013 modified EREFS). 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
- UCEIS — Sum three caller-assigned Travis 2013 UCEIS descriptors (vascular_pattern 0-2, bleeding 0-3, erosions_ulcers 0-3) scored at the most severely affected flexible-sigmoidoscopy segment and return the total (max 8). Uses the 2013 0-8 recode (normal 0). Does not return activity bands.
- LA grading — Apply Lundell 1999 Table 1 Los Angeles classification of oesophagitis and return la_grade (none, A, B, C, or D) from four caller-assigned endoscopic flags.
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.