# PECARN pediatric head CT

PECARN pediatric head CT

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

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

## What it computes

Apply the Kuppermann 2009 PECARN prediction trees and return high, intermediate, or low risk of clinically important brain injury from caller-assigned findings after pediatric head trauma.

## When to use

When an agent has caller-assigned findings after blunt head trauma in a child 0-17 years and needs the Kuppermann 2009 PECARN head CT trees, not Canadian CT Head, CATCH, CHALICE, or NEXUS.

## When not to use

- Not a diagnosis of clinically important brain injury. magent does not examine the patient.
- This tool is the Kuppermann 2009 PECARN head CT rule only. It is not Canadian CT Head, not CATCH, not CHALICE, not NEXUS, and not PECARN IAI, febrile infant, or c-spine rules.
- Two mutually exclusive trees: age <2 (lt_2) and age 2-17 (ge_2). Flags that belong to the other age band are required on the API but do not score.
- The caller assigns GCS <=14, altered mental status (agitation, somnolence, repetitive questioning, or slow response), and all other findings. magent does not take a GCS integer and does not classify mechanism or fall height.
- Severe mechanism is caller-assigned. Published list: MVC ejection, rollover, or death of another passenger; unhelmeted pedestrian or bicyclist struck by a motorized vehicle; fall >3 ft if <2 years or >5 ft if >=2 years; head struck by a high-impact object.

## Formula

```
high if any age-applicable high-risk factor, else intermediate if any age-applicable intermediate factor, else low; lt_2 tree if age < 2, ge_2 tree if age 2-17
```

## Citation

[Identification of children at very low risk of clinically-important brain injuries after head trauma: a prospective cohort study](https://doi.org/10.1016/S0140-6736(09)61558-0)
Kuppermann N, Holmes JF, Dayan PS, et al.
Lancet. 2009;374(9696):1160-1170
DOI: [10.1016/S0140-6736(09)61558-0](https://doi.org/10.1016/S0140-6736(09)61558-0)

## Worked example

### Age 10, all findings absent

Given: `age=10, altered_mental_status=false, gcs_le_14=false, history_of_loc=false, history_of_vomiting=false, loc_ge_5_seconds=false, nonfrontal_scalp_hematoma=false, not_acting_normally=false, palpable_skull_fracture=false, severe_headache=false, severe_mechanism=false, signs_basilar_skull_fracture=false`

1. Age 10 uses the ge_2 tree
2. No age-applicable high-risk or intermediate factor
3. risk_tier is low; CT is not recommended


### Age 1 palpable skull fracture is high

Given: `age=1, altered_mental_status=false, gcs_le_14=false, history_of_loc=false, history_of_vomiting=false, loc_ge_5_seconds=false, nonfrontal_scalp_hematoma=false, not_acting_normally=false, palpable_skull_fracture=true, severe_headache=false, severe_mechanism=false, signs_basilar_skull_fracture=false`

1. Age 1 uses the lt_2 tree
2. Palpable skull fracture is a high-risk factor on lt_2
3. risk_tier is high; CT is recommended


### Age 10 history of vomiting is intermediate

Given: `age=10, altered_mental_status=false, gcs_le_14=false, history_of_loc=false, history_of_vomiting=true, loc_ge_5_seconds=false, nonfrontal_scalp_hematoma=false, not_acting_normally=false, palpable_skull_fracture=false, severe_headache=false, severe_mechanism=false, signs_basilar_skull_fracture=false`

1. Age 10 uses the ge_2 tree
2. No high-risk factor; history of vomiting is intermediate on ge_2
3. risk_tier is intermediate; observation versus CT


## Also searched as

- PECARN head CT
- PECARN pediatric head injury
- Kuppermann 2009
- PECARN ciTBI
- pediatric head trauma CT
- PECARN head trauma algorithm
- children very low risk brain injury
- PECARN under 2 and 2 or older

## Parameters

- `age` (integer, required): Age in years (0-17). Age 0 and 1 use the lt_2 tree; age 2 through 17 use the ge_2 tree. Age 18 is rejected.
- `gcs_le_14` (boolean, required): GCS <=14 as assigned by the caller. true or false. High-risk in both trees. GCS 15 is not <=14. magent does not take a GCS integer.
- `altered_mental_status` (boolean, required): Altered mental status as assigned by the caller (paper: agitation, somnolence, repetitive questioning, or slow response). true or false. High-risk in both trees.
- `palpable_skull_fracture` (boolean, required): Palpable skull fracture as assigned by the caller. true or false. High-risk only on the lt_2 tree; parsed but not scored when age >= 2.
- `signs_basilar_skull_fracture` (boolean, required): Signs of basilar skull fracture as assigned by the caller. true or false. High-risk only on the ge_2 tree; parsed but not scored when age < 2.
- `nonfrontal_scalp_hematoma` (boolean, required): Occipital, parietal, or temporal scalp hematoma (not frontal) as assigned by the caller. true or false. Intermediate only on the lt_2 tree; parsed but not scored when age >= 2.
- `loc_ge_5_seconds` (boolean, required): Loss of consciousness >=5 seconds as assigned by the caller. true or false. Intermediate only on the lt_2 tree; parsed but not scored when age >= 2.
- `not_acting_normally` (boolean, required): Not acting normally per parent report as assigned by the caller. true or false. Intermediate only on the lt_2 tree; parsed but not scored when age >= 2.
- `history_of_loc` (boolean, required): History of loss of consciousness as assigned by the caller. true or false. Intermediate only on the ge_2 tree; parsed but not scored when age < 2.
- `history_of_vomiting` (boolean, required): History of vomiting as assigned by the caller. true or false. Intermediate only on the ge_2 tree; parsed but not scored when age < 2.
- `severe_headache` (boolean, required): Severe headache as assigned by the caller. true or false. Intermediate only on the ge_2 tree; parsed but not scored when age < 2.
- `severe_mechanism` (boolean, required): Severe mechanism as assigned by the caller. true or false. Intermediate in both trees. Paper list: MVC ejection/rollover/death of another passenger; unhelmeted pedestrian or bicyclist struck by a motorized vehicle; fall >3 ft if <2 years or >5 ft if >=2 years; head struck by a high-impact object. magent does not classify mechanism or take fall height.

## 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/pecarn_head`
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": [
    {
      "age": "10",
      "altered_mental_status": "false",
      "gcs_le_14": "false",
      "history_of_loc": "false",
      "history_of_vomiting": "false",
      "loc_ge_5_seconds": "false",
      "nonfrontal_scalp_hematoma": "false",
      "not_acting_normally": "false",
      "palpable_skull_fracture": "false",
      "severe_headache": "false",
      "severe_mechanism": "false",
      "signs_basilar_skull_fracture": "false"
    },
    {
      "age": "10",
      "altered_mental_status": "false",
      "gcs_le_14": "false",
      "history_of_loc": "false",
      "history_of_vomiting": "false",
      "loc_ge_5_seconds": "false",
      "nonfrontal_scalp_hematoma": "false",
      "not_acting_normally": "false",
      "palpable_skull_fracture": "false",
      "severe_headache": "false",
      "severe_mechanism": "false",
      "signs_basilar_skull_fracture": "false"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/pecarn_head",
  "items": [
    {
      "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": "Kuppermann N, Holmes JF, Dayan PS, et al.",
        "doi": "10.1016/S0140-6736(09)61558-0",
        "id": "kuppermann-2009",
        "source": "Lancet. 2009;374(9696):1160-1170",
        "title": "Identification of children at very low risk of clinically-important brain injuries after head trauma: a prospective cohort study"
      },
      "formula": "pecarn_head",
      "formula_expression": "high if any age-applicable high-risk factor, else intermediate if any age-applicable intermediate factor, else low; lt_2 tree if age < 2, ge_2 tree if age 2-17",
      "age_years": 10,
      "criteria": [
        {
          "factor": "gcs_le_14",
          "met": false
        },
        {
          "factor": "altered_mental_status",
          "met": false
        },
        {
          "factor": "signs_basilar_skull_fracture",
          "met": false
        },
        {
          "factor": "history_of_loc",
          "met": false
        },
        {
          "factor": "history_of_vomiting",
          "met": false
        },
        {
          "factor": "severe_headache",
          "met": false
        },
        {
          "factor": "severe_mechanism",
          "met": false
        }
      ],
      "age_band": "ge_2",
      "ct_not_recommended": true,
      "ct_recommended": false,
      "observation_vs_ct": false,
      "risk_tier": "low"
    },
    {
      "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": "Kuppermann N, Holmes JF, Dayan PS, et al.",
        "doi": "10.1016/S0140-6736(09)61558-0",
        "id": "kuppermann-2009",
        "source": "Lancet. 2009;374(9696):1160-1170",
        "title": "Identification of children at very low risk of clinically-important brain injuries after head trauma: a prospective cohort study"
      },
      "formula": "pecarn_head",
      "formula_expression": "high if any age-applicable high-risk factor, else intermediate if any age-applicable intermediate factor, else low; lt_2 tree if age < 2, ge_2 tree if age 2-17",
      "age_years": 10,
      "criteria": [
        {
          "factor": "gcs_le_14",
          "met": false
        },
        {
          "factor": "altered_mental_status",
          "met": false
        },
        {
          "factor": "signs_basilar_skull_fracture",
          "met": false
        },
        {
          "factor": "history_of_loc",
          "met": false
        },
        {
          "factor": "history_of_vomiting",
          "met": false
        },
        {
          "factor": "severe_headache",
          "met": false
        },
        {
          "factor": "severe_mechanism",
          "met": false
        }
      ],
      "age_band": "ge_2",
      "ct_not_recommended": true,
      "ct_recommended": false,
      "observation_vs_ct": false,
      "risk_tier": "low"
    }
  ]
}
```

## Response fields

- `formula` (string): pecarn_head
- `formula_expression` (string): Kuppermann 2009 two-tree high then intermediate then low rule
- `age_years` (integer): Age used to choose lt_2 vs ge_2
- `age_band` (string): lt_2 when age < 2; ge_2 when age is 2 through 17
- `risk_tier` (string): high, intermediate, or low from the age-applicable tree
- `ct_recommended` (boolean): true when risk_tier is high
- `observation_vs_ct` (boolean): true when risk_tier is intermediate
- `ct_not_recommended` (boolean): true when risk_tier is low
- `criteria` (array): Age-applicable factors only, high-risk first then intermediate, each with factor and met
- `citation` (object): Kuppermann 2009 Lancet citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "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": "Kuppermann N, Holmes JF, Dayan PS, et al.",
    "doi": "10.1016/S0140-6736(09)61558-0",
    "id": "kuppermann-2009",
    "source": "Lancet. 2009;374(9696):1160-1170",
    "title": "Identification of children at very low risk of clinically-important brain injuries after head trauma: a prospective cohort study"
  },
  "formula": "pecarn_head",
  "formula_expression": "high if any age-applicable high-risk factor, else intermediate if any age-applicable intermediate factor, else low; lt_2 tree if age < 2, ge_2 tree if age 2-17",
  "age_years": 10,
  "criteria": [
    {
      "factor": "gcs_le_14",
      "met": false
    },
    {
      "factor": "altered_mental_status",
      "met": false
    },
    {
      "factor": "signs_basilar_skull_fracture",
      "met": false
    },
    {
      "factor": "history_of_loc",
      "met": false
    },
    {
      "factor": "history_of_vomiting",
      "met": false
    },
    {
      "factor": "severe_headache",
      "met": false
    },
    {
      "factor": "severe_mechanism",
      "met": false
    }
  ],
  "age_band": "ge_2",
  "ct_not_recommended": true,
  "ct_recommended": false,
  "observation_vs_ct": false,
  "risk_tier": "low"
}
```

## Errors

- HTTP 400 `invalid_pecarn_age`: age must be an integer from 0 to 17. Returned before settlement; you are not charged.
- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false 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

- [Canadian CT Head Rule](https://magentlab.com/docs/canadian-ct-head) — Apply the Stiell 2001 Canadian CT Head Rule and return whether CT is indicated from caller-assigned high-risk and medium-risk findings after minor blunt head injury.
- [Glasgow Coma Scale](https://magentlab.com/docs/gcs) — Compute the Glasgow Coma Scale as the sum of caller-assigned eye, verbal, and motor integers. The 1974 or 1976 edition is required.

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

- 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 EIP-3009 (scheme exact, assetTransferMethod eip3009) with validBefore = now + accepts[0].maxTimeoutSeconds (600 seconds). That window starts when you sign and must cover wallet confirmation plus CDP verify and settle. Magent retries transient facilitator 429/5xx before answering. Do not send upto or batch-settlement payloads; magent does not offer those schemes.
- Retry the same URL with PAYMENT-SIGNATURE (base64 JSON echoing accepted, payload, and extensions when present).
- Success is HTTP 200 JSON plus PAYMENT-RESPONSE. Settlement happens before the tool runs. HTTP 503 settlement_uncertain or settle_failed: retry the same PAYMENT-SIGNATURE. Mint a new 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.

- 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.
- not offered `batch-settlement`: Not offered. Payment-channel vouchers claimed later in batches. Not the same as POST {items} bulk (that is still exact).

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

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