# Neonatal early-onset sepsis risk

Neonatal early-onset sepsis risk

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

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

## What it computes

Return the Puopolo 2011 logistic prior probability of neonatal early-onset infection at birth from maternal temperature, gestational age, rupture of membranes, GBS, and intrapartum antibiotics, then the Escobar 2014 posterior after a caller-assigned well, equivocal, or ill exam. Infants ≥34 weeks.

## When to use

When an agent already has maternal intrapartum temperature, gestational age ≥34 weeks, ROM hours, GBS status, antibiotic timing flags, a published incidence (0.3-0.6 per 1000), and a caller-assigned Escobar 2014 clinical category, and needs the published prior and posterior risks per 1000. magent does not examine the infant or order antibiotics.

## When not to use

- Not a medical device. Not a sepsis diagnosis. Not an antibiotic order. magent does not examine the infant.
- Puopolo 2011 applies to infants ≥34 weeks. Gestational age below 34 weeks is rejected.
- The prior intercept is the published incidence-specific constant (0.3/0.4/0.5/0.6 per 1000), which replaces the 47.8398 case-control term printed with the coefficient list.
- clinical_category is caller-assigned from Escobar 2014 (well / equivocal / ill). Posterior uses that paper's conservative upper-95% CI likelihood ratios (0.41 / 5.0 / 21.2). magent does not observe vital signs or assign the category.

## Formula

```
SRS = 1/(1+exp(−βx)); βx = intercept(eos_incidence_per_1000) + 0.8680×maternal_temp_f + (−6.9325)×GA + 0.0877×GA² + 1.2256×(ROM_h+0.05)^0.2 + (−1.0488)×gbs_or_any_abx_2h + (−1.1861)×broad_spectrum_abx_4h + GBS(positive 0.5771, unknown 0.0427, negative 0). Intercepts replace the printed 47.8398 case-control constant: 0.3→40.0528, 0.4→40.3415, 0.5→40.5656, 0.6→40.7489. Posterior odds = prior odds × Escobar 2014 conservative upper-95% CI LRs (well 0.41, equivocal 5.0, ill 21.2). Infants ≥34 weeks. Not a sepsis diagnosis or antibiotic order.
```

## Citation

[Estimating the probability of neonatal early-onset infection on the basis of maternal risk factors](https://doi.org/10.1542/peds.2010-3464)
Puopolo KM, Draper D, Wi S, Newman TB, Zupancic J, Lieberman E, Smith M, Escobar GJ
Pediatrics. 2011;128(5):e1155-e1163
DOI: [10.1542/peds.2010-3464](https://doi.org/10.1542/peds.2010-3464)

## Worked example

### Term 40 weeks, 98.6°F, ROM 0, GBS negative, incidence 0.5, well

Given: `broad_spectrum_abx_4h=false, clinical_category=well, eos_incidence_per_1000=0.5, gbs=negative, gbs_or_any_abx_2h=false, gestational_age_weeks=40.0, maternal_temp_f=98.6, rom_hours=0`

1. Intercept for incidence 0.5/1000 is 40.5656 (replaces printed 47.8398)
2. βx = 40.5656 + 0.8680×98.6 − 6.9325×40 + 0.0877×40² + 1.2256×(0.05)^0.2 = −10.1564
3. prior_risk_per_1000 = 1/(1+exp(10.1564)) × 1000 = 0.0388
4. posterior odds = prior odds × 0.41 (Escobar 2014 well, upper 95% CI LR) → 0.0159 per 1000


### Same maternal prior with caller-assigned ill exam

Given: `broad_spectrum_abx_4h=false, clinical_category=ill, eos_incidence_per_1000=0.5, gbs=negative, gbs_or_any_abx_2h=false, gestational_age_weeks=40.0, maternal_temp_f=98.6, rom_hours=0`

1. Prior is unchanged at 0.0388 per 1000
2. posterior odds = prior odds × 21.2 (Escobar 2014 ill, upper 95% CI LR) → 0.8224 per 1000


## Also searched as

- early onset sepsis
- neonatal EOS risk
- Puopolo EOS
- newborn sepsis probability
- GBS early-onset infection
- intrapartum sepsis risk
- Escobar clinical EOS

## Parameters

- `gestational_age_weeks` (number, required): Gestational age in weeks (34.0-43.0). Days as fractional weeks (39+4/7 ≈ 39.5714). Infants below 34 weeks are rejected (Puopolo 2011).
- `maternal_temp_f` (number, required): Highest maternal intrapartum temperature in °F (94.0-108.0), used to 0.1°F.
- `rom_hours` (number, required): Duration of rupture of membranes in hours (0-240). Transformed as (hours+0.05)^0.2.
- `gbs` (string, required): Maternal GBS status: negative, positive, or unknown (Puopolo 2011).
- `gbs_or_any_abx_2h` (boolean, required): true if GBS-specific antibiotics ≥2 h before delivery or any antibiotics 2-3.9 h before delivery. Caller assigns. true or false.
- `broad_spectrum_abx_4h` (boolean, required): true if broad-spectrum antibiotics ≥4 h before delivery. Caller assigns. true or false.
- `eos_incidence_per_1000` (number, required): Local EOS incidence per 1000 live births. Only 0.3, 0.4, 0.5, or 0.6 (published intercepts).
- `clinical_category` (string, required): Caller-assigned Escobar 2014 exam category: well, equivocal, or ill. magent does not examine the infant.

## 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/neonatal_eos`
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": [
    {
      "broad_spectrum_abx_4h": "false",
      "clinical_category": "well",
      "eos_incidence_per_1000": "0.5",
      "gbs": "negative",
      "gbs_or_any_abx_2h": "false",
      "gestational_age_weeks": "40.0",
      "maternal_temp_f": "98.6",
      "rom_hours": "0"
    },
    {
      "broad_spectrum_abx_4h": "false",
      "clinical_category": "well",
      "eos_incidence_per_1000": "0.5",
      "gbs": "negative",
      "gbs_or_any_abx_2h": "false",
      "gestational_age_weeks": "40.0",
      "maternal_temp_f": "98.6",
      "rom_hours": "0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/neonatal_eos",
  "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": "Puopolo KM, Draper D, Wi S, Newman TB, Zupancic J, Lieberman E, Smith M, Escobar GJ",
        "doi": "10.1542/peds.2010-3464",
        "id": "puopolo-2011",
        "pmid": "22025590",
        "source": "Pediatrics. 2011;128(5):e1155-e1163",
        "title": "Estimating the probability of neonatal early-onset infection on the basis of maternal risk factors"
      },
      "formula": "neonatal_eos",
      "formula_expression": "SRS = 1/(1+exp(−βx)); βx = intercept(eos_incidence_per_1000) + 0.8680×maternal_temp_f + (−6.9325)×GA + 0.0877×GA² + 1.2256×(ROM_h+0.05)^0.2 + (−1.0488)×gbs_or_any_abx_2h + (−1.1861)×broad_spectrum_abx_4h + GBS(positive 0.5771, unknown 0.0427, negative 0). Intercepts replace the printed 47.8398 case-control constant: 0.3→40.0528, 0.4→40.3415, 0.5→40.5656, 0.6→40.7489. Posterior odds = prior odds × Escobar 2014 conservative upper-95% CI LRs (well 0.41, equivocal 5.0, ill 21.2). Infants ≥34 weeks. Not a sepsis diagnosis or antibiotic order.",
      "broad_spectrum_abx_4h": false,
      "clinical_category": "well",
      "clinical_lr": 0.41,
      "eos_incidence_per_1000": 0.5,
      "gbs": "negative",
      "gbs_or_any_abx_2h": false,
      "gestational_age_weeks": 40.0,
      "maternal_temp_f": 98.6,
      "posterior_risk_per_1000": 0.0159,
      "prior_risk_per_1000": 0.0388,
      "rom_hours": 0.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": "Puopolo KM, Draper D, Wi S, Newman TB, Zupancic J, Lieberman E, Smith M, Escobar GJ",
        "doi": "10.1542/peds.2010-3464",
        "id": "puopolo-2011",
        "pmid": "22025590",
        "source": "Pediatrics. 2011;128(5):e1155-e1163",
        "title": "Estimating the probability of neonatal early-onset infection on the basis of maternal risk factors"
      },
      "formula": "neonatal_eos",
      "formula_expression": "SRS = 1/(1+exp(−βx)); βx = intercept(eos_incidence_per_1000) + 0.8680×maternal_temp_f + (−6.9325)×GA + 0.0877×GA² + 1.2256×(ROM_h+0.05)^0.2 + (−1.0488)×gbs_or_any_abx_2h + (−1.1861)×broad_spectrum_abx_4h + GBS(positive 0.5771, unknown 0.0427, negative 0). Intercepts replace the printed 47.8398 case-control constant: 0.3→40.0528, 0.4→40.3415, 0.5→40.5656, 0.6→40.7489. Posterior odds = prior odds × Escobar 2014 conservative upper-95% CI LRs (well 0.41, equivocal 5.0, ill 21.2). Infants ≥34 weeks. Not a sepsis diagnosis or antibiotic order.",
      "broad_spectrum_abx_4h": false,
      "clinical_category": "well",
      "clinical_lr": 0.41,
      "eos_incidence_per_1000": 0.5,
      "gbs": "negative",
      "gbs_or_any_abx_2h": false,
      "gestational_age_weeks": 40.0,
      "maternal_temp_f": 98.6,
      "posterior_risk_per_1000": 0.0159,
      "prior_risk_per_1000": 0.0388,
      "rom_hours": 0.0
    }
  ]
}
```

## Response fields

- `formula` (string): neonatal_eos
- `formula_expression` (string): Puopolo 2011 prior logistic with incidence intercepts replacing 47.8398, then Escobar 2014 posterior
- `gestational_age_weeks` (number): Input gestational age in weeks
- `maternal_temp_f` (number): Highest maternal intrapartum temperature in °F, to 0.1
- `rom_hours` (number): Rupture of membranes in hours
- `gbs` (string): negative, positive, or unknown
- `gbs_or_any_abx_2h` (boolean): GBS-specific ≥2 h or any antibiotics 2-3.9 h flag
- `broad_spectrum_abx_4h` (boolean): Broad-spectrum antibiotics ≥4 h flag
- `eos_incidence_per_1000` (number): Incidence used to select the intercept (0.3, 0.4, 0.5, or 0.6)
- `clinical_category` (string): Caller-assigned well, equivocal, or ill
- `clinical_lr` (number): Escobar 2014 conservative upper-95% CI likelihood ratio
- `prior_risk_per_1000` (number): Puopolo 2011 sepsis risk at birth per 1000 live births, 4 decimals
- `posterior_risk_per_1000` (number): Escobar 2014 posterior risk per 1000 after the clinical LR, 4 decimals
- `citation` (object): Puopolo et al. Pediatrics 2011 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": "Puopolo KM, Draper D, Wi S, Newman TB, Zupancic J, Lieberman E, Smith M, Escobar GJ",
    "doi": "10.1542/peds.2010-3464",
    "id": "puopolo-2011",
    "pmid": "22025590",
    "source": "Pediatrics. 2011;128(5):e1155-e1163",
    "title": "Estimating the probability of neonatal early-onset infection on the basis of maternal risk factors"
  },
  "formula": "neonatal_eos",
  "formula_expression": "SRS = 1/(1+exp(−βx)); βx = intercept(eos_incidence_per_1000) + 0.8680×maternal_temp_f + (−6.9325)×GA + 0.0877×GA² + 1.2256×(ROM_h+0.05)^0.2 + (−1.0488)×gbs_or_any_abx_2h + (−1.1861)×broad_spectrum_abx_4h + GBS(positive 0.5771, unknown 0.0427, negative 0). Intercepts replace the printed 47.8398 case-control constant: 0.3→40.0528, 0.4→40.3415, 0.5→40.5656, 0.6→40.7489. Posterior odds = prior odds × Escobar 2014 conservative upper-95% CI LRs (well 0.41, equivocal 5.0, ill 21.2). Infants ≥34 weeks. Not a sepsis diagnosis or antibiotic order.",
  "broad_spectrum_abx_4h": false,
  "clinical_category": "well",
  "clinical_lr": 0.41,
  "eos_incidence_per_1000": 0.5,
  "gbs": "negative",
  "gbs_or_any_abx_2h": false,
  "gestational_age_weeks": 40.0,
  "maternal_temp_f": 98.6,
  "posterior_risk_per_1000": 0.0159,
  "prior_risk_per_1000": 0.0388,
  "rom_hours": 0.0
}
```

## Errors

- HTTP 400 `invalid_neonatal_eos`: Puopolo 2011 / Escobar 2014 EOS inputs must match gestational age, maternal temperature, ROM hours, GBS, antibiotics, incidence, and clinical category. Returned before settlement; you are not charged.
- HTTP 400 `invalid_gestational_age_weeks`: gestational_age_weeks must be at least 34 weeks as in Puopolo 2011 (infants ≥34 weeks). Returned before settlement; you are not charged.
- HTTP 400 `invalid_eos_incidence`: eos_incidence_per_1000 must be 0.3, 0.4, 0.5, or 0.6 as published for the Puopolo 2011 intercepts. Returned before settlement; you are not charged.
- HTTP 400 `invalid_eos_clinical`: clinical_category must be well, equivocal, or ill as in Escobar 2014. 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

- [Apgar score](https://magentlab.com/docs/apgar) — Compute the Apgar newborn evaluation score as the sum of five caller-assigned 0-2 signs.
- [Eat, Sleep, Console](https://magentlab.com/docs/eat-sleep-console) — Apply the Grossman 2018 Eat, Sleep, Console functional assessment from caller-assigned eat, sleep, and console flags. magent does not examine the infant.
- [Rebound hyperbilirubinemia](https://magentlab.com/docs/rebound-hyperbilirubinemia) — Return the Chang 2017 three-variable rebound hyperbilirubinemia prediction score after inpatient phototherapy from gestational age, age at phototherapy initiation in days, TSB at termination, and a caller-supplied AAP phototherapy threshold. Scores <20 correspond to a <4% probability of rebound in that paper.

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