GI · LIVE
Agachan constipation scoring system
Agachan constipation score
Sum the eight Agachan 1996 constipation scoring system items from caller-assigned published table bands and return the 0-30 total and whether score > 15.
Markdown: /docs/wexner-constipation.md · Canonical: https://magentlab.com/docs/wexner-constipation
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum the eight Agachan 1996 constipation scoring system items from caller-assigned published table bands and return the 0-30 total and whether score > 15.
When to use
When an agent already has the eight Agachan 1996 table bands assigned and needs the published 0-30 constipation score. magent does not take a bowel history. Not Jorge 1993 fecal incontinence scoring, not Rome, and not a laxative order.
When not to use
- Not a medical device.
- Not a laxative order. magent does not prescribe laxatives, enemas, or digital assistance.
- Not fecal incontinence scoring. This is Agachan 1996 constipation scoring system, not Jorge 1993 fecal incontinence / CCF-FIS.
- The caller assigns the eight published table bands. magent does not take a bowel history.
- Agachan 1996 derivation patients all scored more than 15. constipation is true iff score > 15. Score 0 is the published normal pole; 30 is the published maximum. magent does not return Rome or ODS-only extra bands.
Formula
wexner_constipation = frequency + painful_evacuation + incomplete_evacuation + abdominal_pain + time_per_attempt + assistance + unsuccessful_attempts + duration; Agachan 1996 eight-item constipation scoring system; frequency, painful_evacuation, incomplete_evacuation, abdominal_pain, time_per_attempt, unsuccessful_attempts, and duration each 0-4; assistance 0-2; max 30; constipation iff score > 15
Citation
- Authors
- Agachan F, Chen T, Pfeifer J, Reissman P, Wexner SD
- Source
- Dis Colon Rectum. 1996;39(6):681-685
Worked example
All lowest published bands
Given:
abdominal_pain=neverassistance=without_assistanceduration=0frequency=1_2_times_per_1_2_daysincomplete_evacuation=neverpainful_evacuation=nevertime_per_attempt=less_than_5unsuccessful_attempts=never
- Each item is the published 0 pole (frequency 1-2 times per 1-2 days; never for painful, incomplete, and abdominal pain; time less than 5 minutes; without assistance; never unsuccessful; duration 0 years)
- Score = 0 (max 30); constipation false (Agachan 1996 cut is score > 15)
Four items at published maxima
Given:
abdominal_pain=alwaysassistance=without_assistanceduration=0frequency=less_than_once_per_monthincomplete_evacuation=alwayspainful_evacuation=alwaystime_per_attempt=less_than_5unsuccessful_attempts=never
- frequency less_than_once_per_month → 4; painful_evacuation always → 4; incomplete_evacuation always → 4; abdominal_pain always → 4; remaining items 0
- Score = 16 (max 30); constipation true (score > 15)
Also searched as
- Wexner constipation score
- Agachan constipation score
- constipation scoring system
- Agachan 1996 CSS
- Wexner constipation
- Agachan CSS
- constipation score Agachan
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/wexner_constipation?frequency=1_2_times_per_1_2_days&painful_evacuation=never&incomplete_evacuation=never&abdominal_pain=never&time_per_attempt=less_than_5&assistance=without_assistance&unsuccessful_attempts=never&duration=0
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/wexner_constipation?frequency=1_2_times_per_1_2_days&painful_evacuation=never&incomplete_evacuation=never&abdominal_pain=never&time_per_attempt=less_than_5&assistance=without_assistance&unsuccessful_attempts=never&duration=0"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
frequency |
string | required · 1_2_times_per_1_2_days, 2_times_per_week, once_per_week, less_than_once_per_week, less_than_once_per_month | Caller-assigned Agachan 1996 frequency of bowel movements. 1_2_times_per_1_2_days (1-2 times per 1-2 days) scores 0; 2_times_per_week scores 1; once_per_week scores 2; less_than_once_per_week scores 3; less_than_once_per_month scores 4. magent does not take a bowel history. |
painful_evacuation |
string | required · never, rarely, sometimes, usually, always | Caller-assigned Agachan 1996 painful evacuation effort. never scores 0; rarely 1; sometimes 2; usually 3; always 4. magent does not take a bowel history. |
incomplete_evacuation |
string | required · never, rarely, sometimes, usually, always | Caller-assigned Agachan 1996 feeling of incomplete evacuation. never scores 0; rarely 1; sometimes 2; usually 3; always 4. magent does not take a bowel history. |
abdominal_pain |
string | required · never, rarely, sometimes, usually, always | Caller-assigned Agachan 1996 abdominal pain. never scores 0; rarely 1; sometimes 2; usually 3; always 4. magent does not take a bowel history. |
time_per_attempt |
string | required · less_than_5, 5_10, 10_20, 20_30, more_than_30 | Caller-assigned Agachan 1996 minutes in lavatory per attempt. less_than_5 scores 0; 5_10 scores 1; 10_20 scores 2; 20_30 scores 3; more_than_30 scores 4. magent does not time the attempt. |
assistance |
string | required · without_assistance, stimulative_laxatives, digital_assistance_or_enema | Caller-assigned Agachan 1996 type of assistance. without_assistance scores 0; stimulative_laxatives scores 1; digital_assistance_or_enema scores 2. This item is 0-2 in that table, not 0-4. magent does not order laxatives, enemas, or digital assistance. |
unsuccessful_attempts |
string | required · never, 1_3, 3_6, 6_9, more_than_9 | Caller-assigned Agachan 1996 unsuccessful attempts for evacuation per 24 hours. never scores 0; 1_3 scores 1; 3_6 scores 2; 6_9 scores 3; more_than_9 scores 4. Adjacent printed ranges overlap; the caller assigns the published band. magent does not take a bowel history. |
duration |
string | required · 0, 1_5, 5_10, 10_20, more_than_20 | Caller-assigned Agachan 1996 duration of constipation in years. 0 scores 0; 1_5 scores 1; 5_10 scores 2; 10_20 scores 3; more_than_20 scores 4. Adjacent printed ranges overlap; the caller assigns the published band. magent does not take a bowel history. |
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": [
{
"abdominal_pain": "never",
"assistance": "without_assistance",
"duration": "0",
"frequency": "1_2_times_per_1_2_days",
"incomplete_evacuation": "never",
"painful_evacuation": "never",
"time_per_attempt": "less_than_5",
"unsuccessful_attempts": "never"
},
{
"abdominal_pain": "never",
"assistance": "without_assistance",
"duration": "0",
"frequency": "1_2_times_per_1_2_days",
"incomplete_evacuation": "never",
"painful_evacuation": "never",
"time_per_attempt": "less_than_5",
"unsuccessful_attempts": "never"
}
]
}
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/wexner_constipation",
"items": [
{
"components": [
{
"value": "1_2_times_per_1_2_days",
"factor": "frequency",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "painful_evacuation",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "incomplete_evacuation",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "abdominal_pain",
"points": 0,
"present": false
},
{
"value": "less_than_5",
"factor": "time_per_attempt",
"points": 0,
"present": false
},
{
"value": "without_assistance",
"factor": "assistance",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "unsuccessful_attempts",
"points": 0,
"present": false
},
{
"value": "0",
"factor": "duration",
"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": "Agachan F, Chen T, Pfeifer J, Reissman P, Wexner SD",
"doi": "10.1007/BF02056950",
"id": "agachan-1996",
"pmid": "8646957",
"source": "Dis Colon Rectum. 1996;39(6):681-685",
"title": "A constipation scoring system to simplify evaluation and management of constipated patients"
},
"formula": "wexner_constipation",
"formula_expression": "wexner_constipation = frequency + painful_evacuation + incomplete_evacuation + abdominal_pain + time_per_attempt + assistance + unsuccessful_attempts + duration; Agachan 1996 eight-item constipation scoring system; frequency, painful_evacuation, incomplete_evacuation, abdominal_pain, time_per_attempt, unsuccessful_attempts, and duration each 0-4; assistance 0-2; max 30; constipation iff score > 15",
"max_score": 30,
"score": 0,
"cutoff": 15,
"constipation": false
},
{
"components": [
{
"value": "1_2_times_per_1_2_days",
"factor": "frequency",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "painful_evacuation",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "incomplete_evacuation",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "abdominal_pain",
"points": 0,
"present": false
},
{
"value": "less_than_5",
"factor": "time_per_attempt",
"points": 0,
"present": false
},
{
"value": "without_assistance",
"factor": "assistance",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "unsuccessful_attempts",
"points": 0,
"present": false
},
{
"value": "0",
"factor": "duration",
"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": "Agachan F, Chen T, Pfeifer J, Reissman P, Wexner SD",
"doi": "10.1007/BF02056950",
"id": "agachan-1996",
"pmid": "8646957",
"source": "Dis Colon Rectum. 1996;39(6):681-685",
"title": "A constipation scoring system to simplify evaluation and management of constipated patients"
},
"formula": "wexner_constipation",
"formula_expression": "wexner_constipation = frequency + painful_evacuation + incomplete_evacuation + abdominal_pain + time_per_attempt + assistance + unsuccessful_attempts + duration; Agachan 1996 eight-item constipation scoring system; frequency, painful_evacuation, incomplete_evacuation, abdominal_pain, time_per_attempt, unsuccessful_attempts, and duration each 0-4; assistance 0-2; max 30; constipation iff score > 15",
"max_score": 30,
"score": 0,
"cutoff": 15,
"constipation": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | wexner_constipation |
formula_expression |
string | Exact expression used |
score |
integer | Agachan 1996 constipation scoring system points 0-30 |
max_score |
integer | 30 |
cutoff |
integer | 15. Agachan 1996 derivation patients all scored more than 15. constipation is true iff score > 15. Score 15 is not constipation by that cut. |
constipation |
boolean | true iff score > 15 (Agachan 1996 derivation cohort). Not Rome. Not an ODS-only extra band. Not a diagnosis. |
components |
array | Per-item Agachan 1996 points |
citation |
object | Agachan et al. Dis Colon Rectum 1996 citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"value": "1_2_times_per_1_2_days",
"factor": "frequency",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "painful_evacuation",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "incomplete_evacuation",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "abdominal_pain",
"points": 0,
"present": false
},
{
"value": "less_than_5",
"factor": "time_per_attempt",
"points": 0,
"present": false
},
{
"value": "without_assistance",
"factor": "assistance",
"points": 0,
"present": false
},
{
"value": "never",
"factor": "unsuccessful_attempts",
"points": 0,
"present": false
},
{
"value": "0",
"factor": "duration",
"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": "Agachan F, Chen T, Pfeifer J, Reissman P, Wexner SD",
"doi": "10.1007/BF02056950",
"id": "agachan-1996",
"pmid": "8646957",
"source": "Dis Colon Rectum. 1996;39(6):681-685",
"title": "A constipation scoring system to simplify evaluation and management of constipated patients"
},
"formula": "wexner_constipation",
"formula_expression": "wexner_constipation = frequency + painful_evacuation + incomplete_evacuation + abdominal_pain + time_per_attempt + assistance + unsuccessful_attempts + duration; Agachan 1996 eight-item constipation scoring system; frequency, painful_evacuation, incomplete_evacuation, abdominal_pain, time_per_attempt, unsuccessful_attempts, and duration each 0-4; assistance 0-2; max 30; constipation iff score > 15",
"max_score": 30,
"score": 0,
"cutoff": 15,
"constipation": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_wexner_constipation |
Constipation score inputs must match Agachan 1996 frequency, evacuation, pain, time, assistance, failures, and duration 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
- Rome IV FC — Apply the Mearin 2016 Rome IV C2 functional constipation criteria and return symptom_count (0-6) and whether the published C2 box holds (rome_iv_fc).
- Rome IV OIC — Apply the Mearin 2016 Rome IV C6 opioid-induced constipation criteria and return symptom_count (0-6) and whether the published C6 box holds (rome_iv_oic).
- Kruis — Sum the Kruis 1984 signed weights (history items plus physical and laboratory flags) and return whether the published IBS cutoff of 44 is met.
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.