Respiratory · LIVE
PIAMA preschool asthma prediction score
PIAMA
Sum the Caudri 2009 PIAMA Table III decimal clinical prediction weights for preschool children with symptoms suggestive of asthma and return below_10 (score < 10) and ge_30 (score ≥ 30).
Markdown: /docs/piama.md · Canonical: https://magentlab.com/docs/piama
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Sum the Caudri 2009 PIAMA Table III decimal clinical prediction weights for preschool children with symptoms suggestive of asthma and return below_10 (score < 10) and ge_30 (score ≥ 30).
When to use
When an agent has caller-assigned sex, post-term delivery, parental education and inhaled-medication flags, wheezing frequency, wheeze or dyspnea apart from colds, serious-infection frequency, and eczema with rash, and needs the published PIAMA Table III decimal total rather than API, mAPI, or a simplified integer port.
When not to use
- Not a medical device and not a diagnosis of asthma. magent does not examine the child.
- Decimal Caudri 2009 Table III clinical-prediction weights only. This is not a simplified 0–18 integer port.
- Not the Castro-Rodriguez 2000 Asthma Predictive Index (API) and not the modified Asthma Predictive Index (mAPI).
- wheeze_dyspnea_apart_from_colds was collected only at ages 3–4 in PIAMA; younger children were treated as negative by default. The caller assigns the boolean. magent does not take numeric age and does not auto-override.
- below_10 and ge_30 are the published abstract flags (~3% and ~42% asthma at 7–8 years). Table IV cutoffs 15/20/25/35 are test characteristics, not exclusive bands. magent does not return a continuous probability.
Formula
piama = 4.6*male + 7.3*postterm_delivery + 4.2*medium_low_parental_education + 7.7*parental_inhaled_medication + wheezing(none 0, 1_to_3 4.2, ge_4 9.1) + 7.1*wheeze_dyspnea_apart_from_colds + serious_infections(none 0, 1_to_2 4.6, ge_3 6.9) + 8.2*eczema_with_rash; Caudri 2009 Table III; max 55.1; below_10 iff score < 10 (~3% asthma at 7-8 years); ge_30 iff score ≥ 30 (~42% risk)
Citation
- Title
- Predicting the long-term prognosis of children with symptoms suggestive of asthma at preschool age
- Authors
- Caudri D, Wijga A, Schipper CMA, Hoekstra M, Postma DS, Koppelman GH, Brunekreef B, Smit HA, de Jongste JC
- Source
- J Allergy Clin Immunol. 2009;124(5):903-910
Worked example
Female, all flags false, wheezing none, infections none
Given:
eczema_with_rash=falsemedium_low_parental_education=falseparental_inhaled_medication=falsepostterm_delivery=falseserious_infections=nonesex=femalewheeze_dyspnea_apart_from_colds=falsewheezing=none
- Female and all flags false; wheezing none; serious_infections none → 0
- Score = 0 (max 55.1); below_10 = true (score < 10); ge_30 = false
Male only
Given:
eczema_with_rash=falsemedium_low_parental_education=falseparental_inhaled_medication=falsepostterm_delivery=falseserious_infections=nonesex=malewheeze_dyspnea_apart_from_colds=falsewheezing=none
- Male scores 4.6; remaining Table III factors are absent
- Score = 4.6 (max 55.1); below_10 = true; ge_30 = false
All Table III factors at maximum weight
Given:
eczema_with_rash=truemedium_low_parental_education=trueparental_inhaled_medication=truepostterm_delivery=trueserious_infections=ge_3sex=malewheeze_dyspnea_apart_from_colds=truewheezing=ge_4
- male 4.6 + postterm 7.3 + medium_low education 4.2 + parental inhaled medication 7.7 + wheezing ge_4 9.1 + wheeze/dyspnea apart 7.1 + infections ge_3 6.9 + eczema with rash 8.2
- Score = 55.1 (max 55.1); below_10 = false; ge_30 = true (score ≥ 30)
Also searched as
- PIAMA score
- Caudri PIAMA
- preschool asthma prediction score
- Caudri 2009
- PIAMA Table III
- children symptoms suggestive of asthma
- PIAMA clinical prediction score
- preschool wheezing asthma risk
Try
Opens the live endpoint. Unpaid browser requests show the paywall; agents should send Accept: application/json.
Full URL: https://api.magentlab.com/api/calc/piama?sex=female&postterm_delivery=false&medium_low_parental_education=false&parental_inhaled_medication=false&wheezing=none&wheeze_dyspnea_apart_from_colds=false&serious_infections=none&eczema_with_rash=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/piama?sex=female&postterm_delivery=false&medium_low_parental_education=false&parental_inhaled_medication=false&wheezing=none&wheeze_dyspnea_apart_from_colds=false&serious_infections=none&eczema_with_rash=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
sex |
string | required · female, male | Caller-assigned sex (Caudri 2009 Table III). male scores 4.6; female scores 0. magent does not assign sex. |
postterm_delivery |
boolean | required | Post-term delivery as assigned by the caller (Caudri 2009 Table III). true scores 7.3. magent does not take an obstetric history. |
medium_low_parental_education |
boolean | required | Medium or low education in at least one parent as assigned by the caller (Caudri 2009 Table III). true scores 4.2. magent does not take a parental education history. |
parental_inhaled_medication |
boolean | required | Inhalation medication by at least one parent as assigned by the caller (Caudri 2009 Table III). true scores 7.7. magent does not take a family medication history. |
wheezing |
string | required · none, 1_to_3, ge_4 | Wheezing frequency in the last year (Caudri 2009 Table III). none scores 0; 1_to_3 (infrequent, 1–3 times/year) scores 4.2; ge_4 (frequent, ≥4 times/year) scores 9.1. Mutually exclusive. magent does not auscultate. |
wheeze_dyspnea_apart_from_colds |
boolean | required | Wheeze or dyspnea apart from colds as assigned by the caller (Caudri 2009 Table III). true scores 7.1. PIAMA collected this only at ages 3–4 and treated younger children as negative by default; the caller assigns the boolean. magent does not take numeric age and does not auto-override. |
serious_infections |
string | required · none, 1_to_2, ge_3 | Serious respiratory or ear/nose/throat infections per year (Caudri 2009 Table III). none scores 0; 1_to_2 (1–2 times/year) scores 4.6; ge_3 (≥3 times/year) scores 6.9. Mutually exclusive. magent does not diagnose infection. |
eczema_with_rash |
boolean | required | Doctor's diagnosis of eczema AND eczematous rash present, as assigned by the caller (Caudri 2009 Table III). true scores 8.2. magent does not examine the child. |
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.
- 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": [
{
"eczema_with_rash": "false",
"medium_low_parental_education": "false",
"parental_inhaled_medication": "false",
"postterm_delivery": "false",
"serious_infections": "none",
"sex": "female",
"wheeze_dyspnea_apart_from_colds": "false",
"wheezing": "none"
},
{
"eczema_with_rash": "false",
"medium_low_parental_education": "false",
"parental_inhaled_medication": "false",
"postterm_delivery": "false",
"serious_infections": "none",
"sex": "female",
"wheeze_dyspnea_apart_from_colds": "false",
"wheezing": "none"
}
]
}
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/piama",
"items": [
{
"components": [
{
"factor": "male",
"points": 0.0,
"present": false
},
{
"factor": "postterm_delivery",
"points": 0.0,
"present": false
},
{
"factor": "medium_low_parental_education",
"points": 0.0,
"present": false
},
{
"factor": "parental_inhaled_medication",
"points": 0.0,
"present": false
},
{
"value": "none",
"factor": "wheezing",
"points": 0.0,
"present": false
},
{
"factor": "wheeze_dyspnea_apart_from_colds",
"points": 0.0,
"present": false
},
{
"value": "none",
"factor": "serious_infections",
"points": 0.0,
"present": false
},
{
"factor": "eczema_with_rash",
"points": 0.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": "Caudri D, Wijga A, Schipper CMA, Hoekstra M, Postma DS, Koppelman GH, Brunekreef B, Smit HA, de Jongste JC",
"doi": "10.1016/j.jaci.2009.06.045",
"id": "caudri-2009",
"pmid": "19665765",
"source": "J Allergy Clin Immunol. 2009;124(5):903-910",
"title": "Predicting the long-term prognosis of children with symptoms suggestive of asthma at preschool age"
},
"formula": "piama",
"formula_expression": "piama = 4.6*male + 7.3*postterm_delivery + 4.2*medium_low_parental_education + 7.7*parental_inhaled_medication + wheezing(none 0, 1_to_3 4.2, ge_4 9.1) + 7.1*wheeze_dyspnea_apart_from_colds + serious_infections(none 0, 1_to_2 4.6, ge_3 6.9) + 8.2*eczema_with_rash; Caudri 2009 Table III; max 55.1; below_10 iff score < 10 (~3% asthma at 7-8 years); ge_30 iff score ≥ 30 (~42% risk)",
"max_score": 55.1,
"score": 0.0,
"below_10": true,
"ge_30": false
},
{
"components": [
{
"factor": "male",
"points": 0.0,
"present": false
},
{
"factor": "postterm_delivery",
"points": 0.0,
"present": false
},
{
"factor": "medium_low_parental_education",
"points": 0.0,
"present": false
},
{
"factor": "parental_inhaled_medication",
"points": 0.0,
"present": false
},
{
"value": "none",
"factor": "wheezing",
"points": 0.0,
"present": false
},
{
"factor": "wheeze_dyspnea_apart_from_colds",
"points": 0.0,
"present": false
},
{
"value": "none",
"factor": "serious_infections",
"points": 0.0,
"present": false
},
{
"factor": "eczema_with_rash",
"points": 0.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": "Caudri D, Wijga A, Schipper CMA, Hoekstra M, Postma DS, Koppelman GH, Brunekreef B, Smit HA, de Jongste JC",
"doi": "10.1016/j.jaci.2009.06.045",
"id": "caudri-2009",
"pmid": "19665765",
"source": "J Allergy Clin Immunol. 2009;124(5):903-910",
"title": "Predicting the long-term prognosis of children with symptoms suggestive of asthma at preschool age"
},
"formula": "piama",
"formula_expression": "piama = 4.6*male + 7.3*postterm_delivery + 4.2*medium_low_parental_education + 7.7*parental_inhaled_medication + wheezing(none 0, 1_to_3 4.2, ge_4 9.1) + 7.1*wheeze_dyspnea_apart_from_colds + serious_infections(none 0, 1_to_2 4.6, ge_3 6.9) + 8.2*eczema_with_rash; Caudri 2009 Table III; max 55.1; below_10 iff score < 10 (~3% asthma at 7-8 years); ge_30 iff score ≥ 30 (~42% risk)",
"max_score": 55.1,
"score": 0.0,
"below_10": true,
"ge_30": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | piama |
formula_expression |
string | Caudri 2009 Table III decimal clinical prediction expression |
score |
number | Caudri 2009 Table III points 0-55.1, one decimal |
max_score |
number | Always 55.1 |
below_10 |
boolean | true iff score < 10 (Caudri 2009 abstract: ~3% risk of asthma at 7–8 years). Not a diagnosis of asthma. |
ge_30 |
boolean | true iff score ≥ 30 (Caudri 2009 abstract: ~42% risk of asthma at 7–8 years). Not a diagnosis of asthma. |
components |
array | Per-factor Table III points |
citation |
object | Caudri 2009 J Allergy Clin Immunol citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"factor": "male",
"points": 0.0,
"present": false
},
{
"factor": "postterm_delivery",
"points": 0.0,
"present": false
},
{
"factor": "medium_low_parental_education",
"points": 0.0,
"present": false
},
{
"factor": "parental_inhaled_medication",
"points": 0.0,
"present": false
},
{
"value": "none",
"factor": "wheezing",
"points": 0.0,
"present": false
},
{
"factor": "wheeze_dyspnea_apart_from_colds",
"points": 0.0,
"present": false
},
{
"value": "none",
"factor": "serious_infections",
"points": 0.0,
"present": false
},
{
"factor": "eczema_with_rash",
"points": 0.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": "Caudri D, Wijga A, Schipper CMA, Hoekstra M, Postma DS, Koppelman GH, Brunekreef B, Smit HA, de Jongste JC",
"doi": "10.1016/j.jaci.2009.06.045",
"id": "caudri-2009",
"pmid": "19665765",
"source": "J Allergy Clin Immunol. 2009;124(5):903-910",
"title": "Predicting the long-term prognosis of children with symptoms suggestive of asthma at preschool age"
},
"formula": "piama",
"formula_expression": "piama = 4.6*male + 7.3*postterm_delivery + 4.2*medium_low_parental_education + 7.7*parental_inhaled_medication + wheezing(none 0, 1_to_3 4.2, ge_4 9.1) + 7.1*wheeze_dyspnea_apart_from_colds + serious_infections(none 0, 1_to_2 4.6, ge_3 6.9) + 8.2*eczema_with_rash; Caudri 2009 Table III; max 55.1; below_10 iff score < 10 (~3% asthma at 7-8 years); ge_30 iff score ≥ 30 (~42% risk)",
"max_score": 55.1,
"score": 0.0,
"below_10": true,
"ge_30": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_sex |
sex must be female or male 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_piama |
wheezing must be none, 1_to_3, or ge_4; serious_infections must be none, 1_to_2, or ge_3 (Caudri 2009 PIAMA Table III). 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
- 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.
- 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.