MAGENT

Respiratory · LIVE

Asthma Predictive Index

Apply Castro-Rodriguez 2000 Table 1 and return stringent and loose Asthma Predictive Index flags from caller-assigned early-wheeze class and five major/minor criteria.

LIVE $0.005 USDC GET /api/calc/asthma_api

Markdown: /docs/asthma-api.md · Canonical: https://magentlab.com/docs/asthma-api

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

What it computes

Apply Castro-Rodriguez 2000 Table 1 and return stringent and loose Asthma Predictive Index flags from caller-assigned early-wheeze class and five major/minor criteria.

When to use

When an agent has caller-assigned early-wheeze frequency (none, any, or frequent) and the published major and minor criteria for a young child with recurrent wheezing and needs the Castro-Rodriguez 2000 Asthma Predictive Index, not mAPI and not an asthma diagnosis.

When not to use

  • Not a medical device. Not a diagnosis of asthma. magent does not examine the child.
  • This tool is the Castro-Rodriguez 2000 original Asthma Predictive Index (stringent and loose) only. It is not the modified Asthma Predictive Index (mAPI).
  • The caller assigns parental MD asthma, MD eczema, MD allergic rhinitis, wheezing apart from colds, and circulating eosinophils >4% of WBC. magent does not take an eosinophil percent and does not interpret a CBC.
  • Derivation was in the Tucson Children's Respiratory Study among children with recurrent wheezing in the first 3 years. magent does not take numeric age.
  • stringent_positive and loose_positive are published risk-index flags, not an asthma diagnosis or a treatment or inhaler order.

Formula

stringent_positive iff wheeze is frequent and (major_count >= 1 or minor_count >= 2); loose_positive iff wheeze is any or frequent and the same risk factors; majors parental_md_asthma and md_eczema; minors md_allergic_rhinitis, wheezing_apart_from_colds, eosinophilia_gt_4pct (Castro-Rodriguez 2000 Table 1)

Citation

Title
A clinical index to define risk of asthma in young children with recurrent wheezing
Authors
Castro-Rodríguez JA, Holberg CJ, Wright AL, Martinez FD
Source
Am J Respir Crit Care Med. 2000;162(4 Pt 1):1403-1406
DOI
10.1164/ajrccm.162.4.9912111

Worked example

No early wheeze and no criteria

Given: eosinophilia_gt_4pct=falsemd_allergic_rhinitis=falsemd_eczema=falseparental_md_asthma=falsewheeze=nonewheezing_apart_from_colds=false

  1. wheeze is none (not an early wheezer)
  2. No major or minor criterion is present
  3. Both stringent and loose indices are negative

Early wheezer with one major is loose only

Given: eosinophilia_gt_4pct=falsemd_allergic_rhinitis=falsemd_eczema=falseparental_md_asthma=truewheeze=anywheezing_apart_from_colds=false

  1. wheeze is any (early wheezer; chest ever sounded wheezy in the first 3 years)
  2. One major criterion (parental MD asthma) meets risk factors
  3. Loose index is positive; stringent index requires frequent wheeze and stays negative

Early frequent wheezer with one major is stringent and loose

Given: eosinophilia_gt_4pct=falsemd_allergic_rhinitis=falsemd_eczema=falseparental_md_asthma=truewheeze=frequentwheezing_apart_from_colds=false

  1. wheeze is frequent (early frequent wheezer; parent frequency scale > 3)
  2. One major criterion meets risk factors
  3. Both stringent and loose indices are positive

Also searched as

  • Asthma Predictive Index
  • Castro-Rodriguez API
  • Tucson API
  • stringent Asthma Predictive Index
  • loose Asthma Predictive Index
  • early frequent wheezer
  • Castro-Rodriguez 2000
  • pediatric recurrent wheeze index

Try

Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.

/api/calc/asthma_api?wheeze=none&parental_md_asthma=false&md_eczema=false&md_allergic_rhinitis=false&wheezing_apart_from_colds=false&eosinophilia_gt_4pct=false

Full URL: https://api.magentlab.com/api/calc/asthma_api?wheeze=none&parental_md_asthma=false&md_eczema=false&md_allergic_rhinitis=false&wheezing_apart_from_colds=false&eosinophilia_gt_4pct=false

Call

Expect HTTP 402 until you retry with PAYMENT-SIGNATURE. Incomplete query params return HTTP 400 before any quote or charge.

curl -i -H "Accept: application/json" "https://api.magentlab.com/api/calc/asthma_api?wheeze=none&parental_md_asthma=false&md_eczema=false&md_allergic_rhinitis=false&wheezing_apart_from_colds=false&eosinophilia_gt_4pct=false"

Parameters

Name Type Required Description
wheeze string required · none, any, frequent Early-wheeze class from Castro-Rodriguez 2000. none = not an early wheezer; any = early wheezer (chest ever sounded wheezy in the first 3 years); frequent = early frequent wheezer (parent frequency scale > 3). Loose index requires any or frequent. Stringent index requires frequent.
parental_md_asthma boolean required Parental physician-diagnosed asthma as assigned by the caller. true or false. Major criterion (Castro-Rodriguez 2000 Table 1). magent does not take a family history.
md_eczema boolean required Physician-diagnosed eczema as assigned by the caller. true or false. Major criterion (Castro-Rodriguez 2000 Table 1). magent does not examine the child.
md_allergic_rhinitis boolean required Physician-diagnosed allergic rhinitis as assigned by the caller. true or false. Minor criterion (Castro-Rodriguez 2000 Table 1). magent does not examine the child.
wheezing_apart_from_colds boolean required Wheezing apart from colds as assigned by the caller. true or false. Minor criterion (Castro-Rodriguez 2000 Table 1). magent does not auscultate.
eosinophilia_gt_4pct boolean required Circulating eosinophils >4% of WBC as assigned by the caller (Castro-Rodriguez 2000 Table 1). true or false. Minor criterion. magent does not take an eosinophil percent and does not interpret a CBC.

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.

POST /api/calc/asthma_api Max 25 unit_amount + extra_item_amount * (n - 1) extra $0.002 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 (fixture)

{
  "items": [
    {
      "eosinophilia_gt_4pct": "false",
      "md_allergic_rhinitis": "false",
      "md_eczema": "false",
      "parental_md_asthma": "false",
      "wheeze": "none",
      "wheezing_apart_from_colds": "false"
    },
    {
      "eosinophilia_gt_4pct": "false",
      "md_allergic_rhinitis": "false",
      "md_eczema": "false",
      "parental_md_asthma": "false",
      "wheeze": "none",
      "wheezing_apart_from_colds": "false"
    }
  ]
}

Open bulk paywall →

Opens a two-item fixture on the API host. Unpaid browsers get the same MetaMask paywall as GET; Pay retries POST with those items.

Example 200 (fixture)

{
  "count": 2,
  "path": "/api/calc/asthma_api",
  "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": "Castro-Rodríguez JA, Holberg CJ, Wright AL, Martinez FD",
        "doi": "10.1164/ajrccm.162.4.9912111",
        "id": "castro-rodriguez-2000",
        "pmid": "11029352",
        "source": "Am J Respir Crit Care Med. 2000;162(4 Pt 1):1403-1406",
        "title": "A clinical index to define risk of asthma in young children with recurrent wheezing"
      },
      "formula": "asthma_api",
      "formula_expression": "stringent_positive iff wheeze is frequent and (major_count >= 1 or minor_count >= 2); loose_positive iff wheeze is any or frequent and the same risk factors; majors parental_md_asthma and md_eczema; minors md_allergic_rhinitis, wheezing_apart_from_colds, eosinophilia_gt_4pct (Castro-Rodriguez 2000 Table 1)",
      "criteria": [
        {
          "factor": "parental_md_asthma",
          "met": false
        },
        {
          "factor": "md_eczema",
          "met": false
        },
        {
          "factor": "md_allergic_rhinitis",
          "met": false
        },
        {
          "factor": "wheezing_apart_from_colds",
          "met": false
        },
        {
          "factor": "eosinophilia_gt_4pct",
          "met": false
        }
      ],
      "loose_positive": false,
      "major_count": 0,
      "minor_count": 0,
      "risk_factors_met": false,
      "stringent_positive": false,
      "wheeze": "none"
    },
    {
      "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": "Castro-Rodríguez JA, Holberg CJ, Wright AL, Martinez FD",
        "doi": "10.1164/ajrccm.162.4.9912111",
        "id": "castro-rodriguez-2000",
        "pmid": "11029352",
        "source": "Am J Respir Crit Care Med. 2000;162(4 Pt 1):1403-1406",
        "title": "A clinical index to define risk of asthma in young children with recurrent wheezing"
      },
      "formula": "asthma_api",
      "formula_expression": "stringent_positive iff wheeze is frequent and (major_count >= 1 or minor_count >= 2); loose_positive iff wheeze is any or frequent and the same risk factors; majors parental_md_asthma and md_eczema; minors md_allergic_rhinitis, wheezing_apart_from_colds, eosinophilia_gt_4pct (Castro-Rodriguez 2000 Table 1)",
      "criteria": [
        {
          "factor": "parental_md_asthma",
          "met": false
        },
        {
          "factor": "md_eczema",
          "met": false
        },
        {
          "factor": "md_allergic_rhinitis",
          "met": false
        },
        {
          "factor": "wheezing_apart_from_colds",
          "met": false
        },
        {
          "factor": "eosinophilia_gt_4pct",
          "met": false
        }
      ],
      "loose_positive": false,
      "major_count": 0,
      "minor_count": 0,
      "risk_factors_met": false,
      "stringent_positive": false,
      "wheeze": "none"
    }
  ]
}

Response

Field Type Description
formula string asthma_api
formula_expression string Castro-Rodriguez 2000 Table 1 stringent and loose API rule
stringent_positive boolean true when wheeze is frequent (early frequent wheezer) and risk_factors_met is true. Not a diagnosis of asthma.
loose_positive boolean true when wheeze is any or frequent (early wheezer) and risk_factors_met is true. Not a diagnosis of asthma.
risk_factors_met boolean true when at least one major criterion is present or at least two minor criteria are present
major_count integer Count of true major criteria (parental_md_asthma, md_eczema); 0-2
minor_count integer Count of true minor criteria (md_allergic_rhinitis, wheezing_apart_from_colds, eosinophilia_gt_4pct); 0-3
wheeze string Parsed early-wheeze class: none, any, or frequent
criteria array Per-criterion rows with factor and met for the two majors then three minors; met is true when that Table 1 finding is present
citation object Castro-Rodriguez 2000 Am J Respir Crit Care Med citation
disclaimer string Not-a-device notice

Example JSON

Machine form of the same example. Frozen fixture. Not a live lookup.

{
  "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": "Castro-Rodríguez JA, Holberg CJ, Wright AL, Martinez FD",
    "doi": "10.1164/ajrccm.162.4.9912111",
    "id": "castro-rodriguez-2000",
    "pmid": "11029352",
    "source": "Am J Respir Crit Care Med. 2000;162(4 Pt 1):1403-1406",
    "title": "A clinical index to define risk of asthma in young children with recurrent wheezing"
  },
  "formula": "asthma_api",
  "formula_expression": "stringent_positive iff wheeze is frequent and (major_count >= 1 or minor_count >= 2); loose_positive iff wheeze is any or frequent and the same risk factors; majors parental_md_asthma and md_eczema; minors md_allergic_rhinitis, wheezing_apart_from_colds, eosinophilia_gt_4pct (Castro-Rodriguez 2000 Table 1)",
  "criteria": [
    {
      "factor": "parental_md_asthma",
      "met": false
    },
    {
      "factor": "md_eczema",
      "met": false
    },
    {
      "factor": "md_allergic_rhinitis",
      "met": false
    },
    {
      "factor": "wheezing_apart_from_colds",
      "met": false
    },
    {
      "factor": "eosinophilia_gt_4pct",
      "met": false
    }
  ],
  "loose_positive": false,
  "major_count": 0,
  "minor_count": 0,
  "risk_factors_met": false,
  "stringent_positive": false,
  "wheeze": "none"
}

Client errors (HTTP 400)

Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.

HTTP Code When
400 invalid_api_wheeze wheeze must be none, any, or frequent (Castro-Rodriguez 2000 early wheezer vs early frequent wheezer). Returned before settlement; you are not charged.
400 invalid_flag boolean clinical flags must be true or false Returned before settlement; you are not charged.
400 invalid_items POST body must be a JSON object with only an items array Returned before settlement; you are not charged.
400 invalid_item_count items must be an array of 1 to 25 objects Returned before settlement; you are not charged.
400 invalid_item each items entry must be a JSON object Returned before settlement; you are not charged.

Related tools

  • PRAM — Sum five caller-assigned Chalut 2000 PRAM item points and return the published 0-12 total.

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. Unpaid valid requests return HTTP 402 with a base64 PAYMENT-REQUIRED header. HTTP 503 is not a new quote: retry the same PAYMENT-SIGNATURE. Full handshake and shared payment errors: Payments. Stdio MCP: /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.