# Pediatric appendicitis risk calculator (pARC)

pARC

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

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

## What it computes

Compute the Kharbanda 2018 Table 3 logistic probability of appendicitis from sex, age (5-18 years), pain duration, pain with walking, migration of pain to the RLQ, maximal tenderness in the RLQ, abdominal guarding, and ANC.

## When to use

When an agent already has Kharbanda 2018 Table 3 inputs and needs the published pARC probability and must not invent a PAS score, Alvarado points, an imaging order, or a nausea/vomiting term (dropped from the final model).

## When not to use

- Not a medical device. Not a diagnosis and not an imaging or operating-room order. magent does not examine the child.
- Kharbanda 2018 Table 3 logistic model only. Nausea and vomiting were not significant in the final model and are not inputs.
- Age is 5-18 years (derivation). Sex-specific age terms follow Table 3: female 12-18 y and male 14-18 y are the reference; magent does not apply pARC under age 5.
- pain_duration, pain_with_walking, pain_migration_rlq, maximal_tenderness_rlq, and abdominal_guarding are caller-assigned published categories or flags. magent does not examine the abdomen.
- ANC is required in x10^3/uL. magent does not impute missing ANC from WBC. This is not the Pediatric Appendicitis Score (PAS) and not Alvarado. Kharbanda 2018 Table 4 risk strata are not returned.

## Formula

```
L = -8.7 + 1.28*male + age_sex + pain_duration + 1.05*pain_with_walking + 0.46*pain_migration_rlq + 1.14*maximal_tenderness_rlq + 0.67*abdominal_guarding + anc (Kharbanda 2018 Table 3); age 5-7.9 y 0.38; male 5-7.9 y -1.05; age 8-13.9 y -0.72 (male 8-13.9 y and female 8-11.9 y); reference = male 14-18 y and female 12-18 y; duration lt_24 0, 24_lt_48 0.47, 48_96 0.10; ANC <14 x10^3/uL: 1.77*sqrt(ANC); ANC >=14: 6.62 instead of the sqrt term; estimated_probability = 1 / (1 + exp(-L)); estimated_probability_percent = 100 * estimated_probability
```

## Citation

[Development and Validation of a Novel Pediatric Appendicitis Risk Calculator (pARC)](https://doi.org/10.1542/peds.2017-2699)
Kharbanda AB, Vazquez-Benitez G, Ballard DW, et al.
Pediatrics. 2018;141(4):e20172699
DOI: [10.1542/peds.2017-2699](https://doi.org/10.1542/peds.2017-2699)

## Worked example

### Female 15 y, duration <24 h, exam flags false, ANC 2.0

Given: `abdominal_guarding=false, age=15, anc_10e3_ul=2.0, maximal_tenderness_rlq=false, pain_duration=lt_24, pain_migration_rlq=false, pain_with_walking=false, sex=female`

1. Female 15 y is the Table 3 age-and-sex reference (0). Duration lt_24, walking, migration, RLQ tenderness, and guarding add 0.
2. ANC 2.0 < 14, so ANC term = 1.77 × √2. L = -8.7 + 1.77 × √2.
3. estimated_probability = 1 / (1 + exp(-L)); estimated_probability_percent = 100 × that from the unrounded logit


### Male 15 y, otherwise the reference teen example

Given: `abdominal_guarding=false, age=15, anc_10e3_ul=2.0, maximal_tenderness_rlq=false, pain_duration=lt_24, pain_migration_rlq=false, pain_with_walking=false, sex=male`

1. Male sex +1.28. Age 15 y male is the Table 3 reference age band (0).
2. L = -8.7 + 1.28 + 1.77 × √2


### Male 6 y, duration <24 h, exam flags false, ANC 2.0

Given: `abdominal_guarding=false, age=6, anc_10e3_ul=2.0, maximal_tenderness_rlq=false, pain_duration=lt_24, pain_migration_rlq=false, pain_with_walking=false, sex=male`

1. Male sex +1.28, age 5-7.9 y +0.38, male 5-7.9 y −1.05.
2. L = -8.7 + 1.28 + 0.38 − 1.05 + 1.77 × √2


### Female 15 y, duration 24-<48 h

Given: `abdominal_guarding=false, age=15, anc_10e3_ul=2.0, maximal_tenderness_rlq=false, pain_duration=24_lt_48, pain_migration_rlq=false, pain_with_walking=false, sex=female`

1. Duration 24-<48 h +0.47. Other terms match the reference teen female example.
2. L = -8.7 + 0.47 + 1.77 × √2


### Female 15 y with walking, RLQ tenderness, and guarding

Given: `abdominal_guarding=true, age=15, anc_10e3_ul=2.0, maximal_tenderness_rlq=true, pain_duration=lt_24, pain_migration_rlq=false, pain_with_walking=true, sex=female`

1. Pain with walking +1.05, maximal tenderness in RLQ +1.14, abdominal guarding +0.67.
2. L = -8.7 + 1.05 + 1.14 + 0.67 + 1.77 × √2


### Female 15 y, ANC 14 (constant instead of √ANC)

Given: `abdominal_guarding=false, age=15, anc_10e3_ul=14, maximal_tenderness_rlq=false, pain_duration=lt_24, pain_migration_rlq=false, pain_with_walking=false, sex=female`

1. ANC ≥ 14 ×10³/µL uses constant 6.62 instead of 1.77 × √ANC.
2. L = -8.7 + 6.62 = -2.08


## Also searched as

- pARC
- pediatric appendicitis risk calculator
- Kharbanda pARC
- Kharbanda 2018 appendicitis
- pediatric appendicitis probability
- appendicitis risk calculator
- pARC logistic
- pediatric RLQ appendicitis risk

## Parameters

- `age` (integer, required): Age in whole years from 5 to 18 (Kharbanda 2018 derivation). Age 5-7 maps to 5-7.9 y; male 8-13 and female 8-11 use the age 8-13.9 y term; male 14-18 y and female 12-18 y are the Table 3 reference.
- `sex` (string, required): Caller-assigned sex. Male adds 1.28. Combined with age for the Table 3 age-and-sex terms. magent does not examine the child.
- `pain_duration` (string, required): Kharbanda 2018 Table 3 duration of pain as assigned by the caller: lt_24 (reference, 0), 24_lt_48 (+0.47), or 48_96 (+0.10). Derivation excluded pain beyond 96 hours. Do not send a nausea or vomiting flag.
- `pain_with_walking` (boolean, required): Caller-assigned presence of pain with walking (Kharbanda 2018 Table 3 +1.05). magent does not examine the child.
- `pain_migration_rlq` (boolean, required): Caller-assigned history of migration of pain to the right-lower quadrant (Kharbanda 2018 Table 3 +0.46). magent does not examine the child.
- `maximal_tenderness_rlq` (boolean, required): Caller-assigned maximal tenderness in the right-lower quadrant (Kharbanda 2018 Table 3 +1.14). magent does not examine the child.
- `abdominal_guarding` (boolean, required): Caller-assigned abdominal guarding (Kharbanda 2018 Table 3 +0.67). magent does not examine the child.
- `anc_10e3_ul` (number, required): Absolute neutrophil count in x10^3/uL (0-80). Kharbanda 2018 Table 3: if ANC < 14, add 1.77*sqrt(ANC); if ANC >= 14, add 6.62 instead of the sqrt term. Required; magent does not impute ANC from WBC.

## 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/parc`
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_guarding": "false",
      "age": "15",
      "anc_10e3_ul": "2.0",
      "maximal_tenderness_rlq": "false",
      "pain_duration": "lt_24",
      "pain_migration_rlq": "false",
      "pain_with_walking": "false",
      "sex": "female"
    },
    {
      "abdominal_guarding": "false",
      "age": "15",
      "anc_10e3_ul": "2.0",
      "maximal_tenderness_rlq": "false",
      "pain_duration": "lt_24",
      "pain_migration_rlq": "false",
      "pain_with_walking": "false",
      "sex": "female"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/parc",
  "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": "Kharbanda AB, Vazquez-Benitez G, Ballard DW, et al.",
        "doi": "10.1542/peds.2017-2699",
        "id": "kharbanda-2018",
        "pmid": "29535251",
        "source": "Pediatrics. 2018;141(4):e20172699",
        "title": "Development and Validation of a Novel Pediatric Appendicitis Risk Calculator (pARC)"
      },
      "formula": "parc",
      "formula_expression": "L = -8.7 + 1.28*male + age_sex + pain_duration + 1.05*pain_with_walking + 0.46*pain_migration_rlq + 1.14*maximal_tenderness_rlq + 0.67*abdominal_guarding + anc (Kharbanda 2018 Table 3); age 5-7.9 y 0.38; male 5-7.9 y -1.05; age 8-13.9 y -0.72 (male 8-13.9 y and female 8-11.9 y); reference = male 14-18 y and female 12-18 y; duration lt_24 0, 24_lt_48 0.47, 48_96 0.10; ANC <14 x10^3/uL: 1.77*sqrt(ANC); ANC >=14: 6.62 instead of the sqrt term; estimated_probability = 1 / (1 + exp(-L)); estimated_probability_percent = 100 * estimated_probability",
      "age_years": 15,
      "sex": "female",
      "estimated_probability_percent": 0.2,
      "logit": -6.1968,
      "abdominal_guarding": false,
      "anc_10e3_ul": 2.0,
      "estimated_probability": 0.002032,
      "maximal_tenderness_rlq": false,
      "pain_duration": "lt_24",
      "pain_migration_rlq": false,
      "pain_with_walking": 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": "Kharbanda AB, Vazquez-Benitez G, Ballard DW, et al.",
        "doi": "10.1542/peds.2017-2699",
        "id": "kharbanda-2018",
        "pmid": "29535251",
        "source": "Pediatrics. 2018;141(4):e20172699",
        "title": "Development and Validation of a Novel Pediatric Appendicitis Risk Calculator (pARC)"
      },
      "formula": "parc",
      "formula_expression": "L = -8.7 + 1.28*male + age_sex + pain_duration + 1.05*pain_with_walking + 0.46*pain_migration_rlq + 1.14*maximal_tenderness_rlq + 0.67*abdominal_guarding + anc (Kharbanda 2018 Table 3); age 5-7.9 y 0.38; male 5-7.9 y -1.05; age 8-13.9 y -0.72 (male 8-13.9 y and female 8-11.9 y); reference = male 14-18 y and female 12-18 y; duration lt_24 0, 24_lt_48 0.47, 48_96 0.10; ANC <14 x10^3/uL: 1.77*sqrt(ANC); ANC >=14: 6.62 instead of the sqrt term; estimated_probability = 1 / (1 + exp(-L)); estimated_probability_percent = 100 * estimated_probability",
      "age_years": 15,
      "sex": "female",
      "estimated_probability_percent": 0.2,
      "logit": -6.1968,
      "abdominal_guarding": false,
      "anc_10e3_ul": 2.0,
      "estimated_probability": 0.002032,
      "maximal_tenderness_rlq": false,
      "pain_duration": "lt_24",
      "pain_migration_rlq": false,
      "pain_with_walking": false
    }
  ]
}
```

## Response fields

- `formula` (string): parc
- `formula_expression` (string): Kharbanda 2018 Table 3 logistic expression
- `age_years` (integer): Input age in years (5-18)
- `sex` (string): female or male
- `pain_duration` (string): lt_24, 24_lt_48, or 48_96
- `pain_with_walking` (boolean): Caller-assigned pain with walking flag
- `pain_migration_rlq` (boolean): Caller-assigned history of pain migration to the RLQ
- `maximal_tenderness_rlq` (boolean): Caller-assigned maximal tenderness in the RLQ
- `abdominal_guarding` (boolean): Caller-assigned abdominal guarding flag
- `anc_10e3_ul` (number): Input ANC in x10^3/uL
- `logit` (number): Kharbanda 2018 Table 3 linear predictor L, 4 decimal places
- `estimated_probability` (number): 1 / (1 + exp(-L)) from the unrounded logit, 6 decimal places. A probability, not a diagnosis.
- `estimated_probability_percent` (number): 100 * estimated_probability from the unrounded logit, 2 decimal places. A probability, not a diagnosis or imaging order.
- `citation` (object): Kharbanda et al. Pediatrics 2018 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": "Kharbanda AB, Vazquez-Benitez G, Ballard DW, et al.",
    "doi": "10.1542/peds.2017-2699",
    "id": "kharbanda-2018",
    "pmid": "29535251",
    "source": "Pediatrics. 2018;141(4):e20172699",
    "title": "Development and Validation of a Novel Pediatric Appendicitis Risk Calculator (pARC)"
  },
  "formula": "parc",
  "formula_expression": "L = -8.7 + 1.28*male + age_sex + pain_duration + 1.05*pain_with_walking + 0.46*pain_migration_rlq + 1.14*maximal_tenderness_rlq + 0.67*abdominal_guarding + anc (Kharbanda 2018 Table 3); age 5-7.9 y 0.38; male 5-7.9 y -1.05; age 8-13.9 y -0.72 (male 8-13.9 y and female 8-11.9 y); reference = male 14-18 y and female 12-18 y; duration lt_24 0, 24_lt_48 0.47, 48_96 0.10; ANC <14 x10^3/uL: 1.77*sqrt(ANC); ANC >=14: 6.62 instead of the sqrt term; estimated_probability = 1 / (1 + exp(-L)); estimated_probability_percent = 100 * estimated_probability",
  "age_years": 15,
  "sex": "female",
  "estimated_probability_percent": 0.2,
  "logit": -6.1968,
  "abdominal_guarding": false,
  "anc_10e3_ul": 2.0,
  "estimated_probability": 0.002032,
  "maximal_tenderness_rlq": false,
  "pain_duration": "lt_24",
  "pain_migration_rlq": false,
  "pain_with_walking": false
}
```

## Errors

- HTTP 400 `invalid_parc`: pARC needs Kharbanda pediatric appendicitis inputs in published ranges. 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

- [Pediatric appendicitis score](https://magentlab.com/docs/pas) — Compute the Samuel 2002 pediatric appendicitis score from eight caller-assigned findings in children aged 4-15.
- [Alvarado score](https://magentlab.com/docs/alvarado) — Compute the Alvarado 1986 MANTRELS score from caller-assigned findings, temperature, WBC, and neutrophil percent.

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