Neonatal · LIVE
AAP 2022 phototherapy threshold (Kemper)
Return the AAP 2022 Kemper KAS 10 intensive phototherapy threshold from Supplemental Table 1 (no extra neurotoxicity risk factors other than gestational age) or Supplemental Table 2 (any additional listed factor), with TSB minus that threshold and whether TSB is at or above it.
Markdown: /docs/aap-tsb.md · Canonical: https://magentlab.com/docs/aap-tsb
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Return the AAP 2022 Kemper KAS 10 intensive phototherapy threshold from Supplemental Table 1 (no extra neurotoxicity risk factors other than gestational age) or Supplemental Table 2 (any additional listed factor), with TSB minus that threshold and whether TSB is at or above it.
When to use
When an agent already has completed gestational age ≥35 weeks, age in hours, TSB, and caller-assigned extra neurotoxicity risk factors and needs the published hour-specific phototherapy threshold. magent does not assay TSB or order phototherapy. Gestational age <38 weeks is already in the GA-specific curve; use Table 2 only when an additional listed factor is assigned.
When not to use
- Not a medical device and not a phototherapy or exchange-transfusion order. magent does not assay TSB.
- Published for newborn infants 35 or more weeks of gestation only (Kemper 2022). Ages under 1 hour and after 336 hours are rejected.
- Use total serum bilirubin. Do not subtract direct-reacting or conjugated bilirubin.
- Neurotoxicity risk factors other than gestational age are caller-assigned (isoimmune hemolytic disease, G6PD deficiency or other hemolytic conditions, sepsis, albumin <3.0 g/dL, significant clinical instability in the previous 24 hours). magent does not determine those factors or assign race or ethnicity.
- This tool is Supplemental Tables 1 and 2 only. It is not Bhutani 1999 percentile zones and is not an exchange-transfusion threshold.
Formula
Kemper 2022 KAS 10 intensive phototherapy threshold (mg/dL) from Supplemental Table 1 when the caller assigns no neurotoxicity risk factors other than gestational age, or Supplemental Table 2 when any additional listed factor is assigned. Table 1 curves are completed GA 35, 36, 37, 38, 39, and ≥40 weeks. Table 2 curves are 35, 36, 37, and ≥38 weeks. Age is in hours (tabulated hourly from 1 through 336); interpolate linearly between adjacent tabulated hours. Use total serum bilirubin; do not subtract direct-reacting or conjugated bilirubin. Gestational age <38 weeks is already in the GA-specific curve — do not apply Table 2 solely for prematurity. Not a phototherapy or exchange order. magent does not assay TSB
Citation
- Authors
- Kemper AR, Newman TB, Slaughter JL, et al.
- Source
- Pediatrics. 2022;150(3):e2022058859
Worked example
40 weeks, no extra risk factors, age 48 hours, TSB 17 (Table 1, at threshold)
Given:
age_hours=48albumin_lt_3=falseclinical_instability_24h=falseg6pd_deficiency=falsegestational_age_weeks=40isoimmune_hemolytic_disease=falseother_hemolytic_condition=falsesepsis=falsetsb_mg_dl=17
- No additional neurotoxicity risk factor → Supplemental Table 1, ≥40-week curve
- Age 48 hours is tabulated; printed threshold is 17.0 mg/dL
- TSB 17.0 − 17.0 = 0.0; above_phototherapy_threshold true (at or above). Not a phototherapy order
Same infant, TSB 16.9 (below the printed 17.0 threshold)
Given:
age_hours=48albumin_lt_3=falseclinical_instability_24h=falseg6pd_deficiency=falsegestational_age_weeks=40isoimmune_hemolytic_disease=falseother_hemolytic_condition=falsesepsis=falsetsb_mg_dl=16.9
- Table 1 ≥40 weeks at 48 hours remains 17.0 mg/dL
- TSB 16.9 − 17.0 = −0.1; above_phototherapy_threshold false
40 weeks with caller-assigned sepsis, age 48 hours, TSB 14 (Table 2)
Given:
age_hours=48albumin_lt_3=falseclinical_instability_24h=falseg6pd_deficiency=falsegestational_age_weeks=40isoimmune_hemolytic_disease=falseother_hemolytic_condition=falsesepsis=truetsb_mg_dl=14
- Any additional neurotoxicity risk factor → Supplemental Table 2, ≥38-week curve
- Age 48 hours is tabulated; printed threshold is 14.0 mg/dL
- TSB 14.0 − 14.0 = 0.0; above_phototherapy_threshold true
35 weeks, no extra risk factors, age 72 hours, TSB 16.8 (Table 1, at threshold)
Given:
age_hours=72albumin_lt_3=falseclinical_instability_24h=falseg6pd_deficiency=falsegestational_age_weeks=35isoimmune_hemolytic_disease=falseother_hemolytic_condition=falsesepsis=falsetsb_mg_dl=16.8
- No additional factor → Supplemental Table 1, 35-week curve
- Age 72 hours is tabulated; printed threshold is 16.8 mg/dL
- TSB 16.8 − 16.8 = 0.0; above_phototherapy_threshold true
Also searched as
- AAP 2022 phototherapy threshold
- Kemper hyperbilirubinemia phototherapy
- neonatal TSB phototherapy threshold
- intensive phototherapy KAS 10
- Supplemental Table 1 phototherapy
- hour-specific phototherapy threshold
- neurotoxicity risk factor phototherapy
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/aap_tsb?gestational_age_weeks=40&age_hours=48&tsb_mg_dl=17&isoimmune_hemolytic_disease=false&g6pd_deficiency=false&other_hemolytic_condition=false&sepsis=false&albumin_lt_3=false&clinical_instability_24h=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/aap_tsb?gestational_age_weeks=40&age_hours=48&tsb_mg_dl=17&isoimmune_hemolytic_disease=false&g6pd_deficiency=false&other_hemolytic_condition=false&sepsis=false&albumin_lt_3=false&clinical_instability_24h=false"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
gestational_age_weeks |
integer | required | Completed gestational age in weeks, integer 35-45. Table 1 uses distinct curves for 35, 36, 37, 38, 39, and ≥40. Table 2 groups ≥38 together. magent does not convert days. |
age_hours |
number | required | Chronologic age in hours (1-336). Supplemental Tables 1 and 2 are tabulated hourly; ages between adjacent hours are linearly interpolated. Hour 0 is not tabulated. magent does not convert days. |
tsb_mg_dl |
number | required | Total serum bilirubin in mg/dL (0-40). Use TSB; do not subtract direct-reacting or conjugated bilirubin. magent does not assay TSB. |
isoimmune_hemolytic_disease |
boolean | required | Caller-assigned isoimmune hemolytic disease (positive direct antiglobulin test) from Kemper 2022 Table 2. true or false. magent does not interpret DAT. |
g6pd_deficiency |
boolean | required | Caller-assigned glucose-6-phosphate dehydrogenase (G6PD) deficiency from Kemper 2022 Table 2. true or false. magent does not assay G6PD. |
other_hemolytic_condition |
boolean | required | Caller-assigned other hemolytic condition (Kemper 2022 Table 2, same neurotoxicity-risk row as isoimmune disease and G6PD deficiency). true or false. |
sepsis |
boolean | required | Caller-assigned sepsis or suspected sepsis from Kemper 2022 Table 2. true or false. magent does not diagnose sepsis. |
albumin_lt_3 |
boolean | required | Caller-assigned albumin <3.0 g/dL from Kemper 2022 Table 2. true or false. magent does not assay albumin. |
clinical_instability_24h |
boolean | required | Caller-assigned significant clinical instability in the previous 24 hours from Kemper 2022 Table 2. true or false. 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.
- 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": [
{
"age_hours": "48",
"albumin_lt_3": "false",
"clinical_instability_24h": "false",
"g6pd_deficiency": "false",
"gestational_age_weeks": "40",
"isoimmune_hemolytic_disease": "false",
"other_hemolytic_condition": "false",
"sepsis": "false",
"tsb_mg_dl": "17"
},
{
"age_hours": "48",
"albumin_lt_3": "false",
"clinical_instability_24h": "false",
"g6pd_deficiency": "false",
"gestational_age_weeks": "40",
"isoimmune_hemolytic_disease": "false",
"other_hemolytic_condition": "false",
"sepsis": "false",
"tsb_mg_dl": "17"
}
]
}
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/aap_tsb",
"items": [
{
"components": [
{
"factor": "any_neurotoxicity_risk_factor",
"met": false
},
{
"value": 17.0,
"factor": "above_phototherapy_threshold",
"met": true
}
],
"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": "Kemper AR, Newman TB, Slaughter JL, et al.",
"doi": "10.1542/peds.2022-058859",
"id": "kemper-2022-aap-hyperbilirubinemia",
"pmid": "35927462",
"source": "Pediatrics. 2022;150(3):e2022058859",
"title": "Clinical Practice Guideline Revision: Management of Hyperbilirubinemia in the Newborn Infant 35 or More Weeks of Gestation"
},
"formula": "aap_tsb",
"formula_expression": "Kemper 2022 KAS 10 intensive phototherapy threshold (mg/dL) from Supplemental Table 1 when the caller assigns no neurotoxicity risk factors other than gestational age, or Supplemental Table 2 when any additional listed factor is assigned. Table 1 curves are completed GA 35, 36, 37, 38, 39, and ≥40 weeks. Table 2 curves are 35, 36, 37, and ≥38 weeks. Age is in hours (tabulated hourly from 1 through 336); interpolate linearly between adjacent tabulated hours. Use total serum bilirubin; do not subtract direct-reacting or conjugated bilirubin. Gestational age <38 weeks is already in the GA-specific curve — do not apply Table 2 solely for prematurity. Not a phototherapy or exchange order. magent does not assay TSB",
"above_phototherapy_threshold": true,
"age_hours": 48,
"albumin_lt_3": false,
"any_neurotoxicity_risk_factor": false,
"clinical_instability_24h": false,
"g6pd_deficiency": false,
"gestational_age_group": "40_or_more",
"gestational_age_weeks": 40,
"isoimmune_hemolytic_disease": false,
"other_hemolytic_condition": false,
"phototherapy_threshold_mg_dl": 17.0,
"sepsis": false,
"supplemental_table": 1,
"tsb_mg_dl": 17.0,
"tsb_minus_threshold": 0.0
},
{
"components": [
{
"factor": "any_neurotoxicity_risk_factor",
"met": false
},
{
"value": 17.0,
"factor": "above_phototherapy_threshold",
"met": true
}
],
"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": "Kemper AR, Newman TB, Slaughter JL, et al.",
"doi": "10.1542/peds.2022-058859",
"id": "kemper-2022-aap-hyperbilirubinemia",
"pmid": "35927462",
"source": "Pediatrics. 2022;150(3):e2022058859",
"title": "Clinical Practice Guideline Revision: Management of Hyperbilirubinemia in the Newborn Infant 35 or More Weeks of Gestation"
},
"formula": "aap_tsb",
"formula_expression": "Kemper 2022 KAS 10 intensive phototherapy threshold (mg/dL) from Supplemental Table 1 when the caller assigns no neurotoxicity risk factors other than gestational age, or Supplemental Table 2 when any additional listed factor is assigned. Table 1 curves are completed GA 35, 36, 37, 38, 39, and ≥40 weeks. Table 2 curves are 35, 36, 37, and ≥38 weeks. Age is in hours (tabulated hourly from 1 through 336); interpolate linearly between adjacent tabulated hours. Use total serum bilirubin; do not subtract direct-reacting or conjugated bilirubin. Gestational age <38 weeks is already in the GA-specific curve — do not apply Table 2 solely for prematurity. Not a phototherapy or exchange order. magent does not assay TSB",
"above_phototherapy_threshold": true,
"age_hours": 48,
"albumin_lt_3": false,
"any_neurotoxicity_risk_factor": false,
"clinical_instability_24h": false,
"g6pd_deficiency": false,
"gestational_age_group": "40_or_more",
"gestational_age_weeks": 40,
"isoimmune_hemolytic_disease": false,
"other_hemolytic_condition": false,
"phototherapy_threshold_mg_dl": 17.0,
"sepsis": false,
"supplemental_table": 1,
"tsb_mg_dl": 17.0,
"tsb_minus_threshold": 0.0
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | aap_tsb |
formula_expression |
string | Published Kemper 2022 Supplemental Table 1 or 2 lookup |
gestational_age_weeks |
integer | Echo of completed gestational age in weeks |
gestational_age_group |
string | Guideline curve group: 35, 36, 37, 38, 39, or 40_or_more on Table 1; 35, 36, 37, or 38_or_more on Table 2 |
age_hours |
number | Echo of age in hours |
tsb_mg_dl |
number | Echo of total serum bilirubin in mg/dL |
isoimmune_hemolytic_disease |
boolean | Echo of caller-assigned isoimmune hemolytic disease |
g6pd_deficiency |
boolean | Echo of caller-assigned G6PD deficiency |
other_hemolytic_condition |
boolean | Echo of caller-assigned other hemolytic condition |
sepsis |
boolean | Echo of caller-assigned sepsis |
albumin_lt_3 |
boolean | Echo of caller-assigned albumin <3.0 g/dL |
clinical_instability_24h |
boolean | Echo of caller-assigned significant clinical instability in the previous 24 hours |
any_neurotoxicity_risk_factor |
boolean | true when any additional neurotoxicity risk factor other than GA is assigned (Supplemental Table 2) |
supplemental_table |
integer | 1 when Table 1 (no extra factors); 2 when Table 2 (any extra factor) |
phototherapy_threshold_mg_dl |
number | Printed (or linearly interpolated) intensive phototherapy threshold in mg/dL |
tsb_minus_threshold |
number | TSB minus phototherapy threshold in mg/dL (negative when below threshold) |
above_phototherapy_threshold |
boolean | true when TSB is at or above the phototherapy threshold. Not a treatment order |
components |
array | Tree rows for any_neurotoxicity_risk_factor and above_phototherapy_threshold (value is the threshold in mg/dL) |
citation |
object | Kemper 2022 Pediatrics citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"components": [
{
"factor": "any_neurotoxicity_risk_factor",
"met": false
},
{
"value": 17.0,
"factor": "above_phototherapy_threshold",
"met": true
}
],
"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": "Kemper AR, Newman TB, Slaughter JL, et al.",
"doi": "10.1542/peds.2022-058859",
"id": "kemper-2022-aap-hyperbilirubinemia",
"pmid": "35927462",
"source": "Pediatrics. 2022;150(3):e2022058859",
"title": "Clinical Practice Guideline Revision: Management of Hyperbilirubinemia in the Newborn Infant 35 or More Weeks of Gestation"
},
"formula": "aap_tsb",
"formula_expression": "Kemper 2022 KAS 10 intensive phototherapy threshold (mg/dL) from Supplemental Table 1 when the caller assigns no neurotoxicity risk factors other than gestational age, or Supplemental Table 2 when any additional listed factor is assigned. Table 1 curves are completed GA 35, 36, 37, 38, 39, and ≥40 weeks. Table 2 curves are 35, 36, 37, and ≥38 weeks. Age is in hours (tabulated hourly from 1 through 336); interpolate linearly between adjacent tabulated hours. Use total serum bilirubin; do not subtract direct-reacting or conjugated bilirubin. Gestational age <38 weeks is already in the GA-specific curve — do not apply Table 2 solely for prematurity. Not a phototherapy or exchange order. magent does not assay TSB",
"above_phototherapy_threshold": true,
"age_hours": 48,
"albumin_lt_3": false,
"any_neurotoxicity_risk_factor": false,
"clinical_instability_24h": false,
"g6pd_deficiency": false,
"gestational_age_group": "40_or_more",
"gestational_age_weeks": 40,
"isoimmune_hemolytic_disease": false,
"other_hemolytic_condition": false,
"phototherapy_threshold_mg_dl": 17.0,
"sepsis": false,
"supplemental_table": 1,
"tsb_mg_dl": 17.0,
"tsb_minus_threshold": 0.0
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_aap_tsb |
AAP 2022 phototherapy-threshold inputs must match gestational age, age in hours, total serum bilirubin, and caller-assigned neurotoxicity risk factors. 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
- 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. 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.