# pFIB-c pediatric fibrosis

pFIB-c

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

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

## What it computes

Compute the Lefere 2025 pFIB-c logistic probability of significant (≥F2) liver fibrosis in pediatric MASLD from sex, hypertension, ALT, a caller-assigned weight Z-score, HOMA-IR, and caller-assigned Black ethnicity.

## When to use

When an agent already has pediatric MASLD sex (boy or girl), hypertension, ALT in U/L, a caller-assigned CDC or WHO weight Z-score, HOMA-IR, and caller-assigned Black ethnicity as Lefere 2025 used the term, and needs the published Table 2 probability and derivation-cohort rule-out cutoff 0.226, not pFIB-6, FIB-4, APRI, or the NAFLD fibrosis score.

## When not to use

- Not a medical device and not a diagnosis. Not a liver-biopsy substitute or a treatment order.
- black_ethnicity is caller-assigned Black ethnicity as used in Lefere 2025. magent does not assign race or ethnicity.
- weight_z_score is a caller-assigned CDC or WHO weight-for-age Z-score. magent does not compute LMS tables from height, weight, age, or sex.
- HOMA-IR is caller-assigned. magent does not compute HOMA-IR from glucose and insulin.
- The 0.226 cutoff is the Lefere 2025 derivation-cohort rule-out for significant (≥F2) fibrosis (high NPV). magent does not invent other probability bands. This is pFIB-c only, not the ordinal pFIB-6 score.

## Formula

```
x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6
```

## Citation

[Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD](https://doi.org/10.1097/hep.0000000000001016)
Lefere S, Dupont E, De Guchtenaere A, et al.
Hepatology. 2025;81(4):1276-1287
DOI: [10.1097/hep.0000000000001016](https://doi.org/10.1097/hep.0000000000001016)

## Worked example

### Girl, no hypertension, ALT 30, weight Z 1.0, HOMA-IR 2.0

Given: `alt_u_l=30, black_ethnicity=false, homa_ir=2.0, hypertension=false, sex=girl, weight_z_score=1.0`

1. girl (sex_boy=0); hypertension false; black_ethnicity false
2. x = -5.155 + 0.019*30 + 0.633*1.0 + 0.079*2.0 = -3.794
3. probability = exp(x)/(1+exp(x)), 3 decimals; below_rule_out_cutoff iff probability < 0.226


### Boy, otherwise the girl worked example

Given: `alt_u_l=30, black_ethnicity=false, homa_ir=2.0, hypertension=false, sex=boy, weight_z_score=1.0`

1. same ALT, weight Z, HOMA-IR, and flags as the girl example; sex_boy term 1.194
2. x = -5.155 + 1.194 + 0.019*30 + 0.633*1.0 + 0.079*2.0 = -2.600
3. probability from the unrounded x, 3 decimals; below_rule_out_cutoff iff probability < 0.226


## Also searched as

- pFIB-c
- pediatric fibrosis score continuous
- Lefere pFIB
- pediatric MASLD fibrosis
- pFIB continuous
- exclusion of significant fibrosis children
- Lefere 2025 pFIB-c
- pediatric fatty liver fibrosis

## Parameters

- `sex` (string, required): Sex as Lefere 2025 Table 2 (boy or girl). boy adds 1.194 (sex_boy=1); girl adds 0. Paper terms.
- `hypertension` (boolean, required): Hypertension as assigned by the caller (true or false). Lefere 2025 Table 2: true adds 1.636.
- `alt_u_l` (number, required): Alanine aminotransferase in U/L (5-500). Lefere 2025 Table 2: +0.019 per U/L. magent does not convert other ALT units.
- `weight_z_score` (number, required): Caller-assigned CDC or WHO weight-for-age Z-score (-5 to 8). Lefere 2025 Table 2: +0.633 per unit. magent does not compute LMS tables from height, weight, age, or sex.
- `homa_ir` (number, required): Caller-assigned HOMA-IR (0-50). Lefere 2025 Table 2: +0.079 per unit. magent does not compute HOMA-IR from glucose and insulin.
- `black_ethnicity` (boolean, required): Caller-assigned Black ethnicity as used in Lefere 2025 (true or false). Table 2: true adds -2.453. magent does not assign race or ethnicity.

## 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/pfib_c`
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": [
    {
      "alt_u_l": "30",
      "black_ethnicity": "false",
      "homa_ir": "2.0",
      "hypertension": "false",
      "sex": "girl",
      "weight_z_score": "1.0"
    },
    {
      "alt_u_l": "30",
      "black_ethnicity": "false",
      "homa_ir": "2.0",
      "hypertension": "false",
      "sex": "girl",
      "weight_z_score": "1.0"
    }
  ]
}
```

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

Example 200:

```json
{
  "count": 2,
  "path": "/api/calc/pfib_c",
  "items": [
    {
      "x": -3.794,
      "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": "Lefere S, Dupont E, De Guchtenaere A, et al.",
        "doi": "10.1097/hep.0000000000001016",
        "id": "lefere-2025-pfib",
        "pmid": "39028885",
        "source": "Hepatology. 2025;81(4):1276-1287",
        "title": "Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD"
      },
      "formula": "pfib_c",
      "formula_expression": "x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6",
      "sex": "girl",
      "alt_u_l": 30.0,
      "probability": 0.022,
      "hypertension": false,
      "homa_ir": 2.0,
      "below_rule_out_cutoff": true,
      "black_ethnicity": false,
      "weight_z_score": 1.0
    },
    {
      "x": -3.794,
      "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": "Lefere S, Dupont E, De Guchtenaere A, et al.",
        "doi": "10.1097/hep.0000000000001016",
        "id": "lefere-2025-pfib",
        "pmid": "39028885",
        "source": "Hepatology. 2025;81(4):1276-1287",
        "title": "Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD"
      },
      "formula": "pfib_c",
      "formula_expression": "x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6",
      "sex": "girl",
      "alt_u_l": 30.0,
      "probability": 0.022,
      "hypertension": false,
      "homa_ir": 2.0,
      "below_rule_out_cutoff": true,
      "black_ethnicity": false,
      "weight_z_score": 1.0
    }
  ]
}
```

## Response fields

- `formula` (string): pfib_c
- `formula_expression` (string): Lefere 2025 Table 2 logistic linear predictor and probability
- `sex` (string): boy or girl used
- `hypertension` (boolean): Caller-assigned hypertension
- `alt_u_l` (number): Input ALT in U/L
- `weight_z_score` (number): Caller-assigned CDC or WHO weight-for-age Z-score
- `homa_ir` (number): Caller-assigned HOMA-IR
- `black_ethnicity` (boolean): Caller-assigned Black ethnicity as used in Lefere 2025
- `x` (number): Unrounded linear predictor, 3 decimals
- `probability` (number): pFIB-c probability of significant (≥F2) fibrosis from the unrounded x, 3 decimals (0-1). Not a biopsy.
- `below_rule_out_cutoff` (boolean): true iff probability < 0.226 (Lefere 2025 derivation-cohort high NPV for significant fibrosis). Not a biopsy.
- `citation` (object): Lefere 2025 pFIB-c citation
- `disclaimer` (string): Not-a-device notice

## Example JSON

Frozen fixture. Not a live lookup.

```json
{
  "x": -3.794,
  "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": "Lefere S, Dupont E, De Guchtenaere A, et al.",
    "doi": "10.1097/hep.0000000000001016",
    "id": "lefere-2025-pfib",
    "pmid": "39028885",
    "source": "Hepatology. 2025;81(4):1276-1287",
    "title": "Development and validation of pFIB scores for exclusion of significant liver fibrosis in pediatric MASLD"
  },
  "formula": "pfib_c",
  "formula_expression": "x = -5.155 + 1.194*sex_boy + 1.636*hypertension + 0.019*alt_u_l + 0.633*weight_z_score + 0.079*homa_ir - 2.453*black_ethnicity; probability = exp(x)/(1+exp(x)); Lefere 2025 Table 2 logistic for significant (≥F2) fibrosis; sex_boy 1 if boy, 0 if girl (paper terms); black_ethnicity caller-assigned Black ethnicity; weight_z_score caller-assigned CDC/WHO weight Z; below_rule_out_cutoff iff probability < 0.226 (derivation-cohort high NPV); not pFIB-6",
  "sex": "girl",
  "alt_u_l": 30.0,
  "probability": 0.022,
  "hypertension": false,
  "homa_ir": 2.0,
  "below_rule_out_cutoff": true,
  "black_ethnicity": false,
  "weight_z_score": 1.0
}
```

## Errors

- HTTP 400 `invalid_pfib_c`: pFIB-c inputs must match Lefere 2025 sex, caller-assigned Black ethnicity, hypertension, ALT, caller-assigned weight Z-score, and HOMA-IR. 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

- [FIB-4](https://magentlab.com/docs/fib4) — Compute the FIB-4 fibrosis index from age, AST, ALT, and platelets.
- [APRI](https://magentlab.com/docs/apri) — Compute the AST to platelet ratio index (APRI) from AST, laboratory AST ULN, and platelet count.
- [NAFLD fibrosis score](https://magentlab.com/docs/nafld-fibrosis) — Compute the Angulo 2007 NAFLD fibrosis score from age, BMI, IFG/diabetes, AST, ALT, platelets, and albumin.

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