# LRINEC score

LRINEC

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

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

## What it computes

Sum the Wong 2004 LRINEC laboratory table and return whether the total is at or above the published cutoff of 6.

## When to use

When an agent needs the published Wong 2004 laboratory score and must not invent a necrotizing-fasciitis diagnosis or an operative decision.

## When not to use

- Not a diagnosis of necrotizing fasciitis and not an operative decision.
- A score below the cutoff of 6 does not exclude disease; Wong later noted that about 10% of patients with score <6 still had necrotizing fasciitis.
- Wong 2004 laboratory score only. magent does not add a separate high band at 8.

## Formula

```
LRINEC = CRP (>=150 mg/L → 4) + WBC 10^3/mm^3 (<15 → 0; 15-25 → 1; >25 → 2) + hemoglobin g/dL (>13.5 → 0; 11-13.5 → 1; <11 → 2) + sodium (<135 mmol/L → 2) + creatinine (>141 µmol/L → 2) + glucose (>10 mmol/L → 1); max 13; cutoff >=6
```

## Citation

[The LRINEC (Laboratory Risk Indicator for Necrotizing Fasciitis) score: a tool for distinguishing necrotizing fasciitis from other soft tissue infections](https://doi.org/10.1097/01.ccm.0000131218.22741.d4)
Wong CH, Khin LW, Heng KS, Tan KC, Low CO
Crit Care Med. 2004;32(7):1535-1541
DOI: [10.1097/01.ccm.0000131218.22741.d4](https://doi.org/10.1097/01.ccm.0000131218.22741.d4)

## Worked example

### All rows 0

Given: `creatinine_mg_dl=1.0, crp_mg_l=20, glucose_mg_dl=90, hemoglobin_g_dl=14, sodium_mmol_l=140, wbc_k_ul=8`

1. CRP 20 <150 → 0; WBC 8 <15 → 0; Hb 14 >13.5 → 0; Na 140 ≥135 → 0; Cr 1.0 mg/dL ≈88 µmol ≤141 → 0; glucose 90 mg/dL ≈5 mmol ≤10 → 0
2. Score = 0; at_or_above_cutoff false


### Cutoff 6 (CRP 4 + sodium 2)

Given: `creatinine_mg_dl=1.0, crp_mg_l=150, glucose_mg_dl=90, hemoglobin_g_dl=14, sodium_mmol_l=134, wbc_k_ul=8`

1. CRP ≥150 → 4; Na <135 → 2; others 0
2. Score = 6; at_or_above_cutoff true


## Also searched as

- LRINEC score
- laboratory risk indicator necrotizing fasciitis
- Wong LRINEC
- necrotizing fasciitis score
- NF laboratory score
- nec fasc LRINEC

## Parameters

- `crp_mg_l` (number, required): C-reactive protein in mg/L (0-500). ≥150 scores 4; otherwise 0.
- `wbc_k_ul` (number, optional): WBC in 10^3/mm^3 (same as k/µL or 10^9/L). Provide wbc_k_ul or wbc_ul. Range 0.01-500. <15 scores 0; 15-25 scores 1; >25 scores 2.
- `wbc_ul` (number, optional): WBC in cells/µL (same as cells/mm^3). Provide wbc_k_ul or wbc_ul. Range 10-500000. Converted as k/µL = cells/µL / 1000.
- `hemoglobin_g_dl` (number, required): Hemoglobin in g/dL (3-22). >13.5 scores 0; 11-13.5 scores 1; <11 scores 2.
- `sodium_mmol_l` (number, required): Serum sodium in mmol/L (110-160). <135 scores 2; otherwise 0.
- `creatinine_mg_dl` (number, optional): Creatinine in mg/dL (0.1-20). Provide this or creatinine_umol_l. Converted as µmol/L = mg/dL × 88.42. >141 µmol/L scores 2.
- `creatinine_umol_l` (number, optional): Creatinine in µmol/L (9-1768). Provide this or creatinine_mg_dl. >141 scores 2.
- `glucose_mg_dl` (number, optional): Plasma glucose in mg/dL (50-1000). Provide this or glucose_mmol_l, not both. Converted as mmol/L = mg/dL / 18.0182. >10 mmol/L scores 1.
- `glucose_mmol_l` (number, optional): Plasma glucose in mmol/L (2.8-55.5). Provide this or glucose_mg_dl, not both. >10 scores 1.

## 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/lrinec`
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": [
    {
      "creatinine_mg_dl": "1.0",
      "crp_mg_l": "20",
      "glucose_mg_dl": "90",
      "hemoglobin_g_dl": "14",
      "sodium_mmol_l": "140",
      "wbc_k_ul": "8"
    },
    {
      "creatinine_mg_dl": "1.0",
      "crp_mg_l": "20",
      "glucose_mg_dl": "90",
      "hemoglobin_g_dl": "14",
      "sodium_mmol_l": "140",
      "wbc_k_ul": "8"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/lrinec",
  "items": [
    {
      "components": [
        {
          "value": 20.0,
          "factor": "crp",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0,
          "factor": "wbc",
          "points": 0,
          "present": false
        },
        {
          "value": 14.0,
          "factor": "hemoglobin",
          "points": 0,
          "present": false
        },
        {
          "value": 140.0,
          "factor": "sodium",
          "points": 0,
          "present": false
        },
        {
          "value": 88.42,
          "factor": "creatinine",
          "points": 0,
          "present": false
        },
        {
          "value": 4.994949551009535,
          "factor": "glucose",
          "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": "Wong CH, Khin LW, Heng KS, Tan KC, Low CO",
        "doi": "10.1097/01.ccm.0000131218.22741.d4",
        "id": "wong-2004",
        "source": "Crit Care Med. 2004;32(7):1535-1541",
        "title": "The LRINEC (Laboratory Risk Indicator for Necrotizing Fasciitis) score: a tool for distinguishing necrotizing fasciitis from other soft tissue infections"
      },
      "formula": "lrinec",
      "formula_expression": "LRINEC = CRP (>=150 mg/L → 4) + WBC 10^3/mm^3 (<15 → 0; 15-25 → 1; >25 → 2) + hemoglobin g/dL (>13.5 → 0; 11-13.5 → 1; <11 → 2) + sodium (<135 mmol/L → 2) + creatinine (>141 µmol/L → 2) + glucose (>10 mmol/L → 1); max 13; cutoff >=6",
      "max_score": 13,
      "score": 0,
      "sodium_mmol_l": 140.0,
      "hemoglobin_g_dl": 14.0,
      "wbc_k_ul": 8.0,
      "glucose_mmol_l": 4.994949551009535,
      "at_or_above_cutoff": false,
      "creatinine_umol_l": 88.42,
      "crp_mg_l": 20.0
    },
    {
      "components": [
        {
          "value": 20.0,
          "factor": "crp",
          "points": 0,
          "present": false
        },
        {
          "value": 8.0,
          "factor": "wbc",
          "points": 0,
          "present": false
        },
        {
          "value": 14.0,
          "factor": "hemoglobin",
          "points": 0,
          "present": false
        },
        {
          "value": 140.0,
          "factor": "sodium",
          "points": 0,
          "present": false
        },
        {
          "value": 88.42,
          "factor": "creatinine",
          "points": 0,
          "present": false
        },
        {
          "value": 4.994949551009535,
          "factor": "glucose",
          "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": "Wong CH, Khin LW, Heng KS, Tan KC, Low CO",
        "doi": "10.1097/01.ccm.0000131218.22741.d4",
        "id": "wong-2004",
        "source": "Crit Care Med. 2004;32(7):1535-1541",
        "title": "The LRINEC (Laboratory Risk Indicator for Necrotizing Fasciitis) score: a tool for distinguishing necrotizing fasciitis from other soft tissue infections"
      },
      "formula": "lrinec",
      "formula_expression": "LRINEC = CRP (>=150 mg/L → 4) + WBC 10^3/mm^3 (<15 → 0; 15-25 → 1; >25 → 2) + hemoglobin g/dL (>13.5 → 0; 11-13.5 → 1; <11 → 2) + sodium (<135 mmol/L → 2) + creatinine (>141 µmol/L → 2) + glucose (>10 mmol/L → 1); max 13; cutoff >=6",
      "max_score": 13,
      "score": 0,
      "sodium_mmol_l": 140.0,
      "hemoglobin_g_dl": 14.0,
      "wbc_k_ul": 8.0,
      "glucose_mmol_l": 4.994949551009535,
      "at_or_above_cutoff": false,
      "creatinine_umol_l": 88.42,
      "crp_mg_l": 20.0
    }
  ]
}
```

## Response fields

- `formula` (string): lrinec
- `formula_expression` (string): Exact expression used
- `score` (integer): LRINEC points 0-13
- `max_score` (integer): 13
- `at_or_above_cutoff` (boolean): true iff score >= 6 (Wong 2004 cutoff)
- `crp_mg_l` (number): CRP in mg/L used
- `wbc_k_ul` (number): WBC in 10^3/mm^3 used
- `hemoglobin_g_dl` (number): Hemoglobin in g/dL used
- `sodium_mmol_l` (number): Sodium in mmol/L used
- `creatinine_umol_l` (number): Creatinine in µmol/L used (mg/dL × 88.42)
- `glucose_mmol_l` (number): Glucose in mmol/L used
- `components` (array): Per-lab Wong 2004 points
- `citation` (object): Wong et al. Crit Care Med 2004 citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "components": [
    {
      "value": 20.0,
      "factor": "crp",
      "points": 0,
      "present": false
    },
    {
      "value": 8.0,
      "factor": "wbc",
      "points": 0,
      "present": false
    },
    {
      "value": 14.0,
      "factor": "hemoglobin",
      "points": 0,
      "present": false
    },
    {
      "value": 140.0,
      "factor": "sodium",
      "points": 0,
      "present": false
    },
    {
      "value": 88.42,
      "factor": "creatinine",
      "points": 0,
      "present": false
    },
    {
      "value": 4.994949551009535,
      "factor": "glucose",
      "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": "Wong CH, Khin LW, Heng KS, Tan KC, Low CO",
    "doi": "10.1097/01.ccm.0000131218.22741.d4",
    "id": "wong-2004",
    "source": "Crit Care Med. 2004;32(7):1535-1541",
    "title": "The LRINEC (Laboratory Risk Indicator for Necrotizing Fasciitis) score: a tool for distinguishing necrotizing fasciitis from other soft tissue infections"
  },
  "formula": "lrinec",
  "formula_expression": "LRINEC = CRP (>=150 mg/L → 4) + WBC 10^3/mm^3 (<15 → 0; 15-25 → 1; >25 → 2) + hemoglobin g/dL (>13.5 → 0; 11-13.5 → 1; <11 → 2) + sodium (<135 mmol/L → 2) + creatinine (>141 µmol/L → 2) + glucose (>10 mmol/L → 1); max 13; cutoff >=6",
  "max_score": 13,
  "score": 0,
  "sodium_mmol_l": 140.0,
  "hemoglobin_g_dl": 14.0,
  "wbc_k_ul": 8.0,
  "glucose_mmol_l": 4.994949551009535,
  "at_or_above_cutoff": false,
  "creatinine_umol_l": 88.42,
  "crp_mg_l": 20.0
}
```

## Errors

- HTTP 400 `invalid_crp`: crp_mg_l must be a number from 0 to 500. 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_hemoglobin`: hemoglobin_g_l (30-220) or hemoglobin_g_dl (3-22) is required, not both. Returned before settlement; you are not charged.
- HTTP 400 `invalid_sodium`: sodium_mmol_l must be a number from 110 to 160 Returned before settlement; you are not charged.
- HTTP 400 `invalid_creatinine`: creatinine_mg_dl (0.1-20) or creatinine_umol_l (9-1768) is required Returned before settlement; you are not charged.
- HTTP 400 `invalid_glucose`: glucose_mg_dl (50-1000) or glucose_mmol_l (2.8-55.5) 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

- [SIRS](https://magentlab.com/docs/sirs) — Compute the Bone 1992 ACCP/SCCM SIRS criteria from temperature, heart rate, respiratory rate, and WBC, with optional PaCO2 and band percent.
- [SOFA](https://magentlab.com/docs/sofa) — Compute the Vincent 1996 SOFA score from PaO2/FiO2, platelets, bilirubin, MAP and adrenergic agents, GCS, and creatinine or urine output.
- [qSOFA](https://magentlab.com/docs/qsofa) — Compute the Sepsis-3 qSOFA score from respiratory rate, caller-assigned altered mentation, and systolic blood pressure.

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