# Pediatric ulcerative colitis activity index (PUCAI)

PUCAI

Status: LIVE
Price: $0.005 USDC
`GET /api/calc/pucai`
HTML: https://magentlab.com/docs/pucai
Markdown: https://magentlab.com/docs/pucai.md

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

## What it computes

Sum six caller-assigned Turner 2007 PUCAI item points and return the published total (max 85) with activity band.

## When to use

When an agent has already assigned Turner 2007 published point values for the six PUCAI items and needs the total and published activity band, not a diagnosis, adult Mayo score, or treatment order.

## When not to use

- Not a medical device and not a diagnosis of ulcerative colitis or a treatment order.
- Each of the six items is a caller-assigned published point value from Turner 2007. magent does not examine the child.
- Pediatric ulcerative colitis activity index (PUCAI). No age parameter. Not the adult Mayo score or UCDAI.
- Activity bands follow Turner 2007: <10 remission, 10-34 mild (10 and 34 are mild), 35-64 moderate (35 and 64 are moderate), ≥65 severe (65 is severe). magent does not add unofficial adult cutoffs.

## Formula

```
PUCAI = abdominal_pain + rectal_bleeding + stool_consistency_of_most + stools_per_24h + nocturnal_stools + activity_level; Turner 2007 caller-assigned item points; max 85; <10 remission, 10-34 mild, 35-64 moderate, ≥65 severe
```

## Citation

[Development, validation, and evaluation of a pediatric ulcerative colitis activity index: a prospective multicenter study](https://doi.org/10.1053/j.gastro.2007.05.029)
Turner D, Otley AR, Mack D, et al.
Gastroenterology. 2007;133(2):423-432
DOI: [10.1053/j.gastro.2007.05.029](https://doi.org/10.1053/j.gastro.2007.05.029)

## Worked example

### All items 0

Given: `abdominal_pain=0, activity_level=0, nocturnal_stools=0, rectal_bleeding=0, stool_consistency_of_most=0, stools_per_24h=0`

1. abdominal_pain 0 + rectal_bleeding 0 + stool_consistency_of_most 0 + stools_per_24h 0 + nocturnal_stools 0 + activity_level 0
2. Score = 0 (max 85), activity_band remission


### All items maximum

Given: `abdominal_pain=10, activity_level=10, nocturnal_stools=10, rectal_bleeding=30, stool_consistency_of_most=10, stools_per_24h=15`

1. abdominal_pain 10 + rectal_bleeding 30 + stool_consistency_of_most 10 + stools_per_24h 15 + nocturnal_stools 10 + activity_level 10
2. Score = 85 (max 85), activity_band severe


## Also searched as

- PUCAI
- pediatric ulcerative colitis activity index
- Turner PUCAI
- pediatric UC activity
- PUCAI score
- ulcerative colitis children
- Turner 2007 PUCAI

## Parameters

- `abdominal_pain` (integer, required): Caller-assigned Turner 2007 PUCAI abdominal pain points (integer 0, 5, or 10): 0 no pain; 5 pain can be ignored; 10 pain cannot be ignored. magent does not examine the child.
- `rectal_bleeding` (integer, required): Caller-assigned Turner 2007 PUCAI rectal bleeding points (integer 0, 10, 20, or 30): 0 none; 10 small amount only, in less than 50% of stools; 20 small amount with most stools; 30 large amount (>50% of the stool content). magent does not examine the child.
- `stool_consistency_of_most` (integer, required): Caller-assigned Turner 2007 PUCAI stool consistency of most stools points (integer 0, 5, or 10): 0 formed; 5 partially formed; 10 completely unformed. magent does not examine the child.
- `stools_per_24h` (integer, required): Caller-assigned Turner 2007 PUCAI number of stools per 24 hours points (integer 0, 5, 10, or 15): 0 for 0-2 stools; 5 for 3-5; 10 for 6-8; 15 for >8. magent does not examine the child.
- `nocturnal_stools` (integer, required): Caller-assigned Turner 2007 PUCAI nocturnal stools points (integer 0 or 10): 0 no; 10 yes (any episode causing wakening). magent does not examine the child.
- `activity_level` (integer, required): Caller-assigned Turner 2007 PUCAI activity level points (integer 0, 5, or 10): 0 no limitation of activity; 5 occasional limitation of activity; 10 severe restricted activity. magent does not examine the child.

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

Method: `POST /api/calc/pucai`
Max items: 25
Price: unit_amount + extra_item_amount * (n - 1) (unit 5000 atomic, extra 2000 atomic)
Status: 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:

```json
{
  "items": [
    {
      "abdominal_pain": "0",
      "activity_level": "0",
      "nocturnal_stools": "0",
      "rectal_bleeding": "0",
      "stool_consistency_of_most": "0",
      "stools_per_24h": "0"
    },
    {
      "abdominal_pain": "0",
      "activity_level": "0",
      "nocturnal_stools": "0",
      "rectal_bleeding": "0",
      "stool_consistency_of_most": "0",
      "stools_per_24h": "0"
    }
  ]
}
```

Human paywall (two-item fixture): https://api.magentlab.com/paywall/bulk/pucai

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/pucai",
  "items": [
    {
      "components": [
        {
          "value": 0,
          "factor": "abdominal_pain",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "rectal_bleeding",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "stool_consistency_of_most",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "stools_per_24h",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "nocturnal_stools",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "activity_level",
          "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": "Turner D, Otley AR, Mack D, et al.",
        "doi": "10.1053/j.gastro.2007.05.029",
        "id": "turner-2007",
        "pmid": "17681163",
        "source": "Gastroenterology. 2007;133(2):423-432",
        "title": "Development, validation, and evaluation of a pediatric ulcerative colitis activity index: a prospective multicenter study"
      },
      "formula": "pucai",
      "formula_expression": "PUCAI = abdominal_pain + rectal_bleeding + stool_consistency_of_most + stools_per_24h + nocturnal_stools + activity_level; Turner 2007 caller-assigned item points; max 85; <10 remission, 10-34 mild, 35-64 moderate, ≥65 severe",
      "max_score": 85,
      "score": 0,
      "activity_band": "remission",
      "abdominal_pain": 0,
      "activity_level": 0,
      "nocturnal_stools": 0,
      "rectal_bleeding": 0,
      "stool_consistency_of_most": 0,
      "stools_per_24h": 0
    },
    {
      "components": [
        {
          "value": 0,
          "factor": "abdominal_pain",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "rectal_bleeding",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "stool_consistency_of_most",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "stools_per_24h",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "nocturnal_stools",
          "points": 0,
          "present": true
        },
        {
          "value": 0,
          "factor": "activity_level",
          "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": "Turner D, Otley AR, Mack D, et al.",
        "doi": "10.1053/j.gastro.2007.05.029",
        "id": "turner-2007",
        "pmid": "17681163",
        "source": "Gastroenterology. 2007;133(2):423-432",
        "title": "Development, validation, and evaluation of a pediatric ulcerative colitis activity index: a prospective multicenter study"
      },
      "formula": "pucai",
      "formula_expression": "PUCAI = abdominal_pain + rectal_bleeding + stool_consistency_of_most + stools_per_24h + nocturnal_stools + activity_level; Turner 2007 caller-assigned item points; max 85; <10 remission, 10-34 mild, 35-64 moderate, ≥65 severe",
      "max_score": 85,
      "score": 0,
      "activity_band": "remission",
      "abdominal_pain": 0,
      "activity_level": 0,
      "nocturnal_stools": 0,
      "rectal_bleeding": 0,
      "stool_consistency_of_most": 0,
      "stools_per_24h": 0
    }
  ]
}
```

## Response fields

- `formula` (string): pucai
- `formula_expression` (string): Exact expression used
- `score` (integer): PUCAI points 0-85
- `max_score` (integer): Always 85
- `activity_band` (string): Turner 2007 band: remission (<10), mild (10-34), moderate (35-64), or severe (≥65). Score 10 is mild; 34 is mild; 35 is moderate; 64 is moderate; 65 is severe. Not a diagnosis and not an adult Mayo cutoff.
- `abdominal_pain` (integer): Caller-assigned abdominal pain points 0, 5, or 10
- `rectal_bleeding` (integer): Caller-assigned rectal bleeding points 0, 10, 20, or 30
- `stool_consistency_of_most` (integer): Caller-assigned stool consistency of most stools points 0, 5, or 10
- `stools_per_24h` (integer): Caller-assigned stools per 24 hours points 0, 5, 10, or 15
- `nocturnal_stools` (integer): Caller-assigned nocturnal stools points 0 or 10
- `activity_level` (integer): Caller-assigned activity level points 0, 5, or 10
- `components` (array): Per-item caller-assigned points
- `citation` (object): Turner et al. Gastroenterology 2007 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 0,
      "factor": "abdominal_pain",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "rectal_bleeding",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "stool_consistency_of_most",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "stools_per_24h",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "nocturnal_stools",
      "points": 0,
      "present": true
    },
    {
      "value": 0,
      "factor": "activity_level",
      "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": "Turner D, Otley AR, Mack D, et al.",
    "doi": "10.1053/j.gastro.2007.05.029",
    "id": "turner-2007",
    "pmid": "17681163",
    "source": "Gastroenterology. 2007;133(2):423-432",
    "title": "Development, validation, and evaluation of a pediatric ulcerative colitis activity index: a prospective multicenter study"
  },
  "formula": "pucai",
  "formula_expression": "PUCAI = abdominal_pain + rectal_bleeding + stool_consistency_of_most + stools_per_24h + nocturnal_stools + activity_level; Turner 2007 caller-assigned item points; max 85; <10 remission, 10-34 mild, 35-64 moderate, ≥65 severe",
  "max_score": 85,
  "score": 0,
  "activity_band": "remission",
  "abdominal_pain": 0,
  "activity_level": 0,
  "nocturnal_stools": 0,
  "rectal_bleeding": 0,
  "stool_consistency_of_most": 0,
  "stools_per_24h": 0
}
```

## Errors

- HTTP 400 `invalid_pucai`: each PUCAI item must be a published point value from Turner 2007. Returned before settlement; you are not charged.
- HTTP 400 `invalid_items`: POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
- HTTP 400 `invalid_item_count`: items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
- HTTP 400 `invalid_item`: each items entry must be a JSON object Returned before settlement; you are not charged.

Shared HTTP 402 and 503: https://magentlab.com/docs/payments

## Related tools

- [Forrest](https://magentlab.com/docs/forrest) — Return the Forrest 1974 endoscopic lesion class (ia, ib, iia, iib, iic, or iii) and published description from a caller-assigned token.

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

- GET the tool with Accept: application/json (do not send Accept: text/html unless you want the human paywall).
- HTTP 402 means you have not paid. Decode the base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote.
- Sign accepts[0] (exact, EIP-3009) with validBefore = now + maxTimeoutSeconds (600 seconds), or accepts[1] (batch-settlement deposit/voucher) on product GET. Ping and POST {items} stay exact. Magent retries transient facilitator 429/5xx before answering.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON of accepted and payload). Magent attaches canonical extensions.bazaar on CDP verify/settle; echoing 402 bazaar is optional.
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. exact settles before the tool. batch-settlement verifies (and deposit-settles) before the tool and commits the charge after HTTP 2xx. HTTP 503: retry the same PAYMENT-SIGNATURE. Mint a new exact nonce only after a new HTTP 402.

- offered `exact` on eip155:8453: Fixed-price USDC on Base. The buyer authorizes the advertised amount (EIP-3009). magent settles before the tool runs (paymentFlow upfront). extra.assetTransferMethod=eip3009 extra.paymentFlow=upfront.
- offered `batch-settlement` on eip155:8453: Payment-channel vouchers claimed later in batches. Exact stays accepts[0]. Same-path POST {items} is still exact. extra.assetTransferMethod=eip3009 extra.paymentFlow=authorization.

- not offered `upto`: Not offered. Usage-based: buyer authorizes a ceiling, seller settles the actual amount after work. Reserved for a future metered tool. Not for current calculators or code search.

Same-path POST {items} is still scheme exact: one EIP-3009 authorization for GET unit plus $0.002 per extra item. That is not x402 batch-settlement (payment channels / vouchers).

Shared HTTP 402 and 503 table: https://magentlab.com/docs/payments

Stdio MCP (one process per host): https://magentlab.com/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.
