# Kocher criteria

Kocher criteria

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

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

## What it computes

Sum the four Kocher 1999 predictors and return the published predicted probability of septic arthritis versus transient synovitis in children with irritable hip.

## When to use

When an agent needs the published Kocher 1999 point total and predicted probability and must not invent hip findings or treat the total as a diagnosis or aspiration order.

## When not to use

- Not a medical device, not a diagnosis of septic arthritis, and not an aspiration or operating-room order.
- Kocher 1999 four predictors only (history of fever, non-weight-bearing, ESR ≥40 mm/h, serum WBC >12,000/mm³). Does not include Caird CRP. Not for adults.
- History of fever and non-weight-bearing are caller-assigned. magent does not examine the hip.

## Formula

```
Kocher = history_of_fever + non_weight_bearing + (esr_mm_h >= 40) + (wbc_ul > 12000); each 1; max 4; predicted probability 0:<0.2% 1:3.0% 2:40.0% 3:93.1% 4:99.6%
```

## Citation

[Differentiating between septic arthritis and transient synovitis of the hip in children: an evidence-based clinical prediction algorithm](https://doi.org/10.2106/00004623-199912000-00002)
Kocher MS, Zurakowski D, Kasser JR
J Bone Joint Surg Am. 1999;81(12):1662-1670
DOI: [10.2106/00004623-199912000-00002](https://doi.org/10.2106/00004623-199912000-00002)

## Worked example

### No predictors

Given: `esr_mm_h=20, history_of_fever=false, non_weight_bearing=false, wbc_k_ul=8.0`

1. history_of_fever false → 0; non_weight_bearing false → 0; ESR 20 < 40 → 0; WBC 8.0 k/µL = 8000 ≤ 12000 → 0
2. Score = 0; predicted_probability <0.2%


## Also searched as

- kocher
- septic arthritis
- transient synovitis
- pediatric hip
- Kocher criteria
- Kocher algorithm
- irritable hip
- Kocher 1999

## Parameters

- `history_of_fever` (boolean, required): History of fever (oral temperature >38.5°C in Kocher 1999). true or false as assigned by the caller.
- `non_weight_bearing` (boolean, required): Non-weight-bearing on the affected limb (Kocher 1999). true or false as assigned by the caller.
- `esr_mm_h` (number, required): Erythrocyte sedimentation rate in mm/h (1.0-150.0). ≥40 scores 1 (40 scores; 39.9 does not).
- `wbc_k_ul` (number, optional): WBC in 10^3/µL (same as 10^9/L). Provide wbc_k_ul or wbc_ul. Range 0.01-500. >12000/µL scores 1.
- `wbc_ul` (number, optional): WBC in cells/µL (same as cells/mm^3). Provide wbc_k_ul or wbc_ul. Range 10-500000. >12000 scores 1 (12000 does not; 12001 does).

## 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/kocher`
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": [
    {
      "esr_mm_h": "20",
      "history_of_fever": "false",
      "non_weight_bearing": "false",
      "wbc_k_ul": "8.0"
    },
    {
      "esr_mm_h": "20",
      "history_of_fever": "false",
      "non_weight_bearing": "false",
      "wbc_k_ul": "8.0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/kocher",
  "items": [
    {
      "components": [
        {
          "factor": "history_of_fever",
          "points": 0,
          "present": false
        },
        {
          "factor": "non_weight_bearing",
          "points": 0,
          "present": false
        },
        {
          "value": 20.0,
          "factor": "esr_ge_40",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0e3,
          "factor": "wbc_gt_12000",
          "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": "Kocher MS, Zurakowski D, Kasser JR",
        "doi": "10.2106/00004623-199912000-00002",
        "id": "kocher-1999",
        "pmid": "10608376",
        "source": "J Bone Joint Surg Am. 1999;81(12):1662-1670",
        "title": "Differentiating between septic arthritis and transient synovitis of the hip in children: an evidence-based clinical prediction algorithm"
      },
      "formula": "kocher",
      "formula_expression": "Kocher = history_of_fever + non_weight_bearing + (esr_mm_h >= 40) + (wbc_ul > 12000); each 1; max 4; predicted probability 0:<0.2% 1:3.0% 2:40.0% 3:93.1% 4:99.6%",
      "max_score": 4,
      "score": 0,
      "wbc_ul": 8.0e3,
      "esr_mm_h": 20.0,
      "predicted_probability": "<0.2%"
    },
    {
      "components": [
        {
          "factor": "history_of_fever",
          "points": 0,
          "present": false
        },
        {
          "factor": "non_weight_bearing",
          "points": 0,
          "present": false
        },
        {
          "value": 20.0,
          "factor": "esr_ge_40",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0e3,
          "factor": "wbc_gt_12000",
          "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": "Kocher MS, Zurakowski D, Kasser JR",
        "doi": "10.2106/00004623-199912000-00002",
        "id": "kocher-1999",
        "pmid": "10608376",
        "source": "J Bone Joint Surg Am. 1999;81(12):1662-1670",
        "title": "Differentiating between septic arthritis and transient synovitis of the hip in children: an evidence-based clinical prediction algorithm"
      },
      "formula": "kocher",
      "formula_expression": "Kocher = history_of_fever + non_weight_bearing + (esr_mm_h >= 40) + (wbc_ul > 12000); each 1; max 4; predicted probability 0:<0.2% 1:3.0% 2:40.0% 3:93.1% 4:99.6%",
      "max_score": 4,
      "score": 0,
      "wbc_ul": 8.0e3,
      "esr_mm_h": 20.0,
      "predicted_probability": "<0.2%"
    }
  ]
}
```

## Response fields

- `formula` (string): kocher
- `formula_expression` (string): Exact expression used
- `score` (integer): Kocher predictors present, 0-4
- `max_score` (integer): Always 4
- `predicted_probability` (string): Kocher 1999 predicted probability of septic arthritis vs transient synovitis: <0.2%, 3.0%, 40.0%, 93.1%, or 99.6%. Not a diagnosis.
- `esr_mm_h` (number): ESR in mm/h used for the ≥40 cutoff
- `wbc_ul` (number): Normalized WBC in cells/µL used for the >12000 cutoff
- `components` (array): Per-predictor points
- `citation` (object): Kocher et al. JBJS 1999 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "factor": "history_of_fever",
      "points": 0,
      "present": false
    },
    {
      "factor": "non_weight_bearing",
      "points": 0,
      "present": false
    },
    {
      "value": 20.0,
      "factor": "esr_ge_40",
      "points": 0,
      "present": false
    },
    {
      "value": 8.0e3,
      "factor": "wbc_gt_12000",
      "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": "Kocher MS, Zurakowski D, Kasser JR",
    "doi": "10.2106/00004623-199912000-00002",
    "id": "kocher-1999",
    "pmid": "10608376",
    "source": "J Bone Joint Surg Am. 1999;81(12):1662-1670",
    "title": "Differentiating between septic arthritis and transient synovitis of the hip in children: an evidence-based clinical prediction algorithm"
  },
  "formula": "kocher",
  "formula_expression": "Kocher = history_of_fever + non_weight_bearing + (esr_mm_h >= 40) + (wbc_ul > 12000); each 1; max 4; predicted probability 0:<0.2% 1:3.0% 2:40.0% 3:93.1% 4:99.6%",
  "max_score": 4,
  "score": 0,
  "wbc_ul": 8.0e3,
  "esr_mm_h": 20.0,
  "predicted_probability": "<0.2%"
}
```

## Errors

- HTTP 400 `invalid_flag`: boolean clinical flags must be true or false Returned before settlement; you are not charged.
- HTTP 400 `invalid_esr`: esr_mm_h must be a number from 1 to 150. Returned before settlement; you are not charged.
- HTTP 400 `invalid_wbc`: wbc_k_ul (0.01-500) or wbc_ul (10-500000) is required 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

- [Alvarado score](https://magentlab.com/docs/alvarado) — Compute the Alvarado 1986 MANTRELS score from caller-assigned findings, temperature, WBC, and neutrophil percent.
- [Ottawa knee rule](https://magentlab.com/docs/ottawa-knee) — Apply the Stiell 1995 Ottawa knee rule and return whether a knee x-ray series is indicated from age and caller-assigned bone tenderness, flexion, and weight-bearing findings.

## 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 echoing accepted, payload, and extensions when present).
- 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.
- 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.
