# ANC

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

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

## What it computes

Compute absolute neutrophil count from WBC and neutrophil plus band percents, plus a Bodey 1966 granulocyte band.

## When to use

When an agent needs ANC from a CBC differential and must not invent cells/µL.

## When not to use

- Not a diagnosis. Bodey bands are granulocyte strata from acute-leukemia hospital days, not a febrile-neutropenia treatment plan.
- Does not convert a three-part differential or an absolute neutrophil count already reported by the lab.

## Formula

```
ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100
```

## Citation

Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia
Bodey GP, Buckley M, Sathe YS, Freireich EJ
Ann Intern Med. 1966;64(2):328-340
DOI: [10.7326/0003-4819-64-2-328](https://doi.org/10.7326/0003-4819-64-2-328)

## Worked example

### 6.0 K/µL, 50% segs, 3% bands

Given: `band_percent=3, neutrophil_percent=50, wbc_k_ul=6.0`

1. wbc_per_uL = 6.0 × 1000 = 6000
2. fraction = (50 + 3) / 100 = 0.53
3. ANC = 6000 × 0.53 = 3180
4. Bodey band >1500


## Parameters

- `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.
- `wbc_ul` (number, optional): WBC in cells/µL (same as cells/mm^3). Provide wbc_k_ul or wbc_ul. Range 10-500000.
- `neutrophil_percent` (number, required): Segmented neutrophils / PMNs as a percent of WBC (0-100).
- `band_percent` (number, optional): Band neutrophils as a percent of WBC (0-100). Omitted treats bands as 0. segs+bands must be ≤100.

## Bulk (POST)

POST the same path with a JSON items array. Price is n times the GET unit. Invalid items return HTTP 400 before settlement.

Method: `POST /api/calc/anc`
Max items: 25
Price: unit_amount * n (unit 5000 atomic)
Status: PREVIEW

- 1 to 25 items. Each item uses the same keys as the GET query parameters.
- 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": [
    {
      "band_percent": "3",
      "neutrophil_percent": "50",
      "wbc_k_ul": "6.0"
    },
    {
      "band_percent": "3",
      "neutrophil_percent": "50",
      "wbc_k_ul": "6.0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/anc",
  "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": "Bodey GP, Buckley M, Sathe YS, Freireich EJ",
        "doi": "10.7326/0003-4819-64-2-328",
        "id": "bodey-1966",
        "source": "Ann Intern Med. 1966;64(2):328-340",
        "title": "Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia"
      },
      "formula": "anc",
      "formula_expression": "ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100",
      "wbc_per_ul": 6.0e3,
      "anc_per_ul": 3180,
      "band_percent": 3.0,
      "bodey_granulocyte_band": ">1500",
      "neutrophil_percent": 50.0
    },
    {
      "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": "Bodey GP, Buckley M, Sathe YS, Freireich EJ",
        "doi": "10.7326/0003-4819-64-2-328",
        "id": "bodey-1966",
        "source": "Ann Intern Med. 1966;64(2):328-340",
        "title": "Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia"
      },
      "formula": "anc",
      "formula_expression": "ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100",
      "wbc_per_ul": 6.0e3,
      "anc_per_ul": 3180,
      "band_percent": 3.0,
      "bodey_granulocyte_band": ">1500",
      "neutrophil_percent": 50.0
    }
  ]
}
```

## Response fields

- `formula` (string): anc
- `formula_expression` (string): Exact expression used
- `wbc_per_ul` (number): Normalized WBC in cells/µL
- `neutrophil_percent` (number): Segmented neutrophil percent used
- `band_percent` (number): Band percent used (0 when omitted)
- `anc_per_ul` (integer): Absolute neutrophil count in cells/µL
- `bodey_granulocyte_band` (string): Bodey 1966 granulocyte strata (cells/mm^3 = cells/µL): <100, 100-500, 500-1000, 1000-1500, >1500. Not a diagnosis.
- `citation` (object): Ann Intern Med 1966 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": "Bodey GP, Buckley M, Sathe YS, Freireich EJ",
    "doi": "10.7326/0003-4819-64-2-328",
    "id": "bodey-1966",
    "source": "Ann Intern Med. 1966;64(2):328-340",
    "title": "Quantitative relationships between circulating leukocytes and infection in patients with acute leukemia"
  },
  "formula": "anc",
  "formula_expression": "ANC_per_uL = wbc_per_uL * (neutrophil_percent + band_percent) / 100",
  "wbc_per_ul": 6.0e3,
  "anc_per_ul": 3180,
  "band_percent": 3.0,
  "bodey_granulocyte_band": ">1500",
  "neutrophil_percent": 50.0
}
```

## Errors

- 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_neutrophil_percent`: neutrophil_percent must be a number from 0 to 100 Returned before settlement; you are not charged.
- HTTP 400 `invalid_band_percent`: band_percent must be a number from 0 to 100 Returned before settlement; you are not charged.
- HTTP 400 `invalid_differential`: neutrophil_percent + band_percent must be 0 to 100 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.
- HTTP 402 `payment_required`: Missing or invalid PAYMENT-SIGNATURE; decode the PAYMENT-REQUIRED header
- HTTP 409 `payment_in_progress`: The same authorization nonce is already being settled; retry shortly
- HTTP 429 `rate_limited`: Too many requests from this client
- HTTP 503 `settlement_uncertain`: Settlement is unconfirmed; retry with the same PAYMENT-SIGNATURE
- HTTP 503 `facilitator_unavailable`: Payment facilitator unavailable
- HTTP 503 `facilitator_misconfigured`: Payment facilitator is not configured
- HTTP 503 `facilitator_unauthorized`: Payment facilitator rejected credentials
- HTTP 503 `ledger_unavailable`: Payment ledger unavailable
- HTTP 503 `payment_unavailable`: Payment processing unavailable

## Related tools

- [Mosteller BSA](https://magentlab.com/docs/bsa) — Compute Mosteller body surface area in m^2 from height and weight.

## Also searched as

- absolute neutrophil count
- ANC
- neutropenia count
- segs and bands
- granulocyte count

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

## Guarantees

- Invalid query parameters return HTTP 400 before settlement. You are not charged.
- Settlement finishes before the tool executes. Uncertain settlement fails closed (HTTP 503).
- Execution is timeout-bounded and concurrency-capped.
- Calculator inputs are not persisted. Request logs store path without query.
