# Step-by-Step febrile infant

Step-by-Step febrile infant

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

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

## What it computes

Apply the Gomez 2016 sequential Step-by-Step approach and return high, intermediate, or low IBI-risk tier for a febrile infant 90 days or younger.

## When to use

When an agent already has age in days, a caller-assigned well-appearing flag, leukocyturia, serum procalcitonin, CRP, and ANC and needs the published three-tier Step-by-Step result. magent does not examine the infant or assay UA, PCT, CRP, or ANC. Not Rochester, Boston, Philadelphia, or PECARN febrile.

## When not to use

- Not a medical device.
- Not a diagnosis of invasive bacterial infection (IBI) and not a discharge, admission, lumbar-puncture, or antibiotic order.
- magent does not examine the infant. The caller assigns well_appearing. magent does not assay urine dipstick/UA, procalcitonin, CRP, or ANC.
- This tool is the Gomez 2016 sequential Step-by-Step only (derivation Mintegi 2014). Not Rochester, Boston, Philadelphia, or PECARN febrile (Kuppermann 2019 ANC 4090 / PCT 1.71).
- Age 0-90 days pins the published population (febrile infants 90 days and younger). Age 21 days is high-risk; age 22 can be low when remaining low-risk criteria hold.
- Returns the published high/intermediate/low tier only. Does not report an IBI probability.

## Formula

```
risk = high if not well_appearing or age_days <= 21 or leukocyturia or pct_ng_ml >= 0.5; else intermediate if crp_mg_l > 20 or anc_per_ul > 10000; else low; low_risk iff well_appearing and age_gt_21 and no_leukocyturia and pct_lt_0_5 and crp_le_20 and anc_le_10000 (Gomez 2016 Step-by-Step; derivation Mintegi 2014)
```

## Citation

[Validation of the "Step-by-Step" Approach in the Management of Young Febrile Infants](https://doi.org/10.1542/peds.2015-4381)
Gomez B, Mintegi S, Bressan S, Da Dalt L, Gervaix A, Lacroix L
Pediatrics. 2016;138(2):e20154381
DOI: [10.1542/peds.2015-4381](https://doi.org/10.1542/peds.2015-4381)

## Worked example

### Gomez 2016 low-risk febrile infant

Given: `age_days=47, anc_per_ul=4000, crp_mg_l=5, leukocyturia=false, pct_ng_ml=0.2, well_appearing=true`

1. age_days 47 is in the published 0-90 day population and is greater than 21
2. well_appearing is true and leukocyturia is false (caller-assigned)
3. PCT 0.2 ng/mL is less than 0.5; CRP 5 mg/L is not greater than 20; ANC 4000/µL is not greater than 10000
4. No high-risk or intermediate criterion holds, so risk is low and low_risk is true


## Also searched as

- Step-by-Step febrile infant
- Gomez 2016
- Mintegi 2014
- febrile infant 90 days
- infant procalcitonin CRP
- febrile infant leukocyturia
- Gomez Mintegi Bressan
- young febrile infant IBI

## Parameters

- `age_days` (integer, required): Chronological age in days (integer 0-90). Gomez 2016 studied febrile infants 90 days and younger. Age 21 days or younger is high-risk. Age 22 can be low-risk when remaining low-risk criteria hold.
- `well_appearing` (boolean, required): Caller-assigned well-appearing as used in Gomez 2016. true or false. Ill-appearing (well_appearing=false) is high-risk. magent does not examine the infant.
- `leukocyturia` (boolean, required): Caller-assigned leukocyturia (urine dipstick / UA leukocytes) as used in Gomez 2016. true means leukocytes are present and is high-risk. true or false. magent does not assay UA.
- `pct_ng_ml` (number, required): Serum procalcitonin in ng/mL. Range 0.01-100. High-risk if 0.5 ng/mL or greater (0.5 is high). Low-risk requires less than 0.5. magent does not assay procalcitonin.
- `crp_mg_l` (number, required): C-reactive protein in mg/L. Range 0-500. Intermediate (when not already high) if greater than 20 mg/L (20 is not intermediate). magent does not assay CRP.
- `anc_per_ul` (number, required): Absolute neutrophil count in cells/µL. Range 0-100000. Intermediate (when not already high) if greater than 10000/µL (10000 is not intermediate). magent does not assay ANC.

## 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/step_by_step`
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_days": "47",
      "anc_per_ul": "4000",
      "crp_mg_l": "5",
      "leukocyturia": "false",
      "pct_ng_ml": "0.2",
      "well_appearing": "true"
    },
    {
      "age_days": "47",
      "anc_per_ul": "4000",
      "crp_mg_l": "5",
      "leukocyturia": "false",
      "pct_ng_ml": "0.2",
      "well_appearing": "true"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/step_by_step",
  "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": "Gomez B, Mintegi S, Bressan S, Da Dalt L, Gervaix A, Lacroix L",
        "doi": "10.1542/peds.2015-4381",
        "id": "gomez-2016",
        "pmid": "27382134",
        "source": "Pediatrics. 2016;138(2):e20154381",
        "title": "Validation of the \"Step-by-Step\" Approach in the Management of Young Febrile Infants"
      },
      "formula": "step_by_step",
      "formula_expression": "risk = high if not well_appearing or age_days <= 21 or leukocyturia or pct_ng_ml >= 0.5; else intermediate if crp_mg_l > 20 or anc_per_ul > 10000; else low; low_risk iff well_appearing and age_gt_21 and no_leukocyturia and pct_lt_0_5 and crp_le_20 and anc_le_10000 (Gomez 2016 Step-by-Step; derivation Mintegi 2014)",
      "anc_per_ul": 4.0e3,
      "low_risk": true,
      "crp_mg_l": 5.0,
      "criteria": [
        {
          "factor": "well_appearing",
          "met": true
        },
        {
          "value": 47,
          "factor": "age_gt_21",
          "met": true
        },
        {
          "factor": "no_leukocyturia",
          "met": true
        },
        {
          "value": 0.2,
          "factor": "pct_lt_0_5",
          "met": true
        },
        {
          "value": 5.0,
          "factor": "crp_le_20",
          "met": true
        },
        {
          "value": 4.0e3,
          "factor": "anc_le_10000",
          "met": true
        }
      ],
      "high_risk": false,
      "risk": "low",
      "age_days": 47,
      "pct_ng_ml": 0.2,
      "intermediate_risk": 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": "Gomez B, Mintegi S, Bressan S, Da Dalt L, Gervaix A, Lacroix L",
        "doi": "10.1542/peds.2015-4381",
        "id": "gomez-2016",
        "pmid": "27382134",
        "source": "Pediatrics. 2016;138(2):e20154381",
        "title": "Validation of the \"Step-by-Step\" Approach in the Management of Young Febrile Infants"
      },
      "formula": "step_by_step",
      "formula_expression": "risk = high if not well_appearing or age_days <= 21 or leukocyturia or pct_ng_ml >= 0.5; else intermediate if crp_mg_l > 20 or anc_per_ul > 10000; else low; low_risk iff well_appearing and age_gt_21 and no_leukocyturia and pct_lt_0_5 and crp_le_20 and anc_le_10000 (Gomez 2016 Step-by-Step; derivation Mintegi 2014)",
      "anc_per_ul": 4.0e3,
      "low_risk": true,
      "crp_mg_l": 5.0,
      "criteria": [
        {
          "factor": "well_appearing",
          "met": true
        },
        {
          "value": 47,
          "factor": "age_gt_21",
          "met": true
        },
        {
          "factor": "no_leukocyturia",
          "met": true
        },
        {
          "value": 0.2,
          "factor": "pct_lt_0_5",
          "met": true
        },
        {
          "value": 5.0,
          "factor": "crp_le_20",
          "met": true
        },
        {
          "value": 4.0e3,
          "factor": "anc_le_10000",
          "met": true
        }
      ],
      "high_risk": false,
      "risk": "low",
      "age_days": 47,
      "pct_ng_ml": 0.2,
      "intermediate_risk": false
    }
  ]
}
```

## Response fields

- `formula` (string): step_by_step
- `formula_expression` (string): Gomez 2016 sequential Step-by-Step three-tier rule
- `risk` (string): high, intermediate, or low. Sequential: high before intermediate. Not an IBI probability and not a discharge, admission, LP, or antibiotic order.
- `low_risk` (boolean): true only when risk is low (every tree criterion holds). false is not a discharge order.
- `high_risk` (boolean): true only when risk is high (ill-appearing, age_days <= 21, leukocyturia, or PCT >= 0.5). High beats intermediate.
- `intermediate_risk` (boolean): true only when risk is intermediate (CRP > 20 or ANC > 10000 and no high-risk criterion). CRP 20 and ANC 10000 are not intermediate.
- `age_days` (integer): Age in days used for the age_days <= 21 high-risk cutoff
- `pct_ng_ml` (number): Serum procalcitonin in ng/mL used for the >=0.5 high-risk cutoff
- `crp_mg_l` (number): CRP in mg/L used for the >20 intermediate cutoff
- `anc_per_ul` (number): ANC in cells/µL used for the >10000 intermediate cutoff
- `criteria` (array): Per-criterion rows with factor and met: well_appearing, age_gt_21, no_leukocyturia, pct_lt_0_5, crp_le_20, anc_le_10000. low_risk iff all are met. If any of well_appearing, age_gt_21, no_leukocyturia, or pct_lt_0_5 is unmet, risk is high even when CRP or ANC is also elevated.
- `citation` (object): Gomez et al. Pediatrics 2016 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": "Gomez B, Mintegi S, Bressan S, Da Dalt L, Gervaix A, Lacroix L",
    "doi": "10.1542/peds.2015-4381",
    "id": "gomez-2016",
    "pmid": "27382134",
    "source": "Pediatrics. 2016;138(2):e20154381",
    "title": "Validation of the \"Step-by-Step\" Approach in the Management of Young Febrile Infants"
  },
  "formula": "step_by_step",
  "formula_expression": "risk = high if not well_appearing or age_days <= 21 or leukocyturia or pct_ng_ml >= 0.5; else intermediate if crp_mg_l > 20 or anc_per_ul > 10000; else low; low_risk iff well_appearing and age_gt_21 and no_leukocyturia and pct_lt_0_5 and crp_le_20 and anc_le_10000 (Gomez 2016 Step-by-Step; derivation Mintegi 2014)",
  "anc_per_ul": 4.0e3,
  "low_risk": true,
  "crp_mg_l": 5.0,
  "criteria": [
    {
      "factor": "well_appearing",
      "met": true
    },
    {
      "value": 47,
      "factor": "age_gt_21",
      "met": true
    },
    {
      "factor": "no_leukocyturia",
      "met": true
    },
    {
      "value": 0.2,
      "factor": "pct_lt_0_5",
      "met": true
    },
    {
      "value": 5.0,
      "factor": "crp_le_20",
      "met": true
    },
    {
      "value": 4.0e3,
      "factor": "anc_le_10000",
      "met": true
    }
  ],
  "high_risk": false,
  "risk": "low",
  "age_days": 47,
  "pct_ng_ml": 0.2,
  "intermediate_risk": false
}
```

## Errors

- HTTP 400 `invalid_step_by_step`: age_days must be an integer 0-90, pct_ng_ml a number 0.01-100, crp_mg_l a number 0-500, and anc_per_ul a number 0-100000 (Gomez 2016 Step-by-Step). 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

- [PECARN febrile infant](https://magentlab.com/docs/pecarn-febrile) — Apply the Kuppermann 2019 PECARN clinical prediction rule and return low_risk only when a febrile infant 60 days or younger has a caller-assigned negative urinalysis, ANC ≤4090/µL, and serum procalcitonin ≤1.71 ng/mL.
- [Rochester criteria](https://magentlab.com/docs/rochester) — Apply the Dagan 1985 Rochester criteria and return low_risk only when every published criterion holds for an infant younger than 3 months.

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