Infection / VTE · LIVE
EPIPHANY Index
EPIPHANY
Apply the Carmona-Bayonas 2017 EPIPHANY Index decision tree and return low, intermediate, or high 15-day serious-complication class with the published class rates.
Markdown: /docs/epiphany.md · Canonical: https://magentlab.com/docs/epiphany
Not a medical device. Not a diagnosis, dose, or listing recommendation.
What it computes
Apply the Carmona-Bayonas 2017 EPIPHANY Index decision tree and return low, intermediate, or high 15-day serious-complication class with the published class rates.
When to use
When an agent already has the six Figure 2 covariates for a patient with cancer and PE (incidental or symptomatic) and needs the published CHAID class, not an additive PE score.
When not to use
- Not a medical device and not a diagnosis. Not an anticoagulation, admission, fibrinolysis, or outpatient-treatment order. magent does not examine the patient, measure vitals, assign ECOG-PS, apply RECIST, or read an operative note; the caller assigns the six Figure 2 covariates.
- This is the Carmona-Bayonas 2017 Exhaustive CHAID tree (Figure 2), not an additive point score. Off-path covariates are parsed and ignored.
- The Hestia-like CDR is the paper's six-item adaptation (any vs none), not the 11-item Zondag 2011 Hestia checklist and not PESI, sPESI, Wells PE, POMPE-C, or RIETE.
- Arterial oxygen saturation <90% is both a Hestia-like CDR item and a later split on the ECOG-PS >=2 branch; the caller assigns both independently as the figure does. Both saturation leaves are high class.
- Tumour 'others' is complete or partial response, stable disease, or no evidence of disease (Table 1). Progression, unknown, or not evaluated is the uncontrolled split.
- Class rates 1.6 / 9.4 / 30.6% (15-day serious complications) and 0.3 / 6.1 / 17.1% (15-day mortality) are the published three-class summaries, not per-leaf percents.
- Does not use race.
Formula
root: hestia-like CDR any vs none (Carmona-Bayonas 2017 Figure 2). CDR any: ECOG-PS >=2 then SaO2 <90 vs >=90 (both high), else PE-specific symptoms yes (high) vs no (intermediate). CDR none: tumour progression/unknown/not evaluated vs others (CR/PR/SD/NED); if uncontrolled then primary tumour resection yes (low) vs no (intermediate); if others then low. Classes low/intermediate/high with 15-day serious complications 1.6/9.4/30.6% and 15-day mortality 0.3/6.1/17.1%
Citation
- Authors
- Carmona-Bayonas A, Jiménez-Fonseca P, Font C, Fenoy F, Otero R, Beato C, Plasencia JM, Biosca M, Sánchez M, Benegas M, Calvo-Temprano D, Varona D, Faez L, de la Haba I, Antonio M, Madridano O, Solis MP, Ramchandani A, Castañón E, Marchena PJ, Martín M, Ayala de la Peña F, Vicente V; Asociación de Investigación de la Enfermedad Tromboembólica de la Región de Murcia
- Source
- Br J Cancer. 2017;116:994-1001
Worked example
Hestia-like none with controlled tumour (low-risk leaf)
Given:
ecog_ps_ge_2=falsehestia_like_any=falseoxygen_sat_lt_90=falsepe_specific_symptoms=falseprimary_tumour_resected=truetumour_uncontrolled=false
- Hestia-like CDR: none of the six items present → tumour-response branch
- Tumour response is not progression/unknown/not evaluated (CR/PR/SD/NED) → low_controlled leaf
- ECOG-PS, saturation, PE symptoms, and resection are parsed and not used on this path
- Class low: 1.6% 15-day serious complications, 0.3% 15-day mortality
Hestia-like any, ECOG-PS >=2, SaO2 <90% (high-risk leaf)
Given:
ecog_ps_ge_2=truehestia_like_any=trueoxygen_sat_lt_90=truepe_specific_symptoms=trueprimary_tumour_resected=falsetumour_uncontrolled=true
- Hestia-like CDR any present → ECOG-PS split
- ECOG-PS >=2 → saturation split
- SaO2 <90% → high_ecog_hypoxemia leaf
- Class high: 30.6% 15-day serious complications, 17.1% 15-day mortality
Also searched as
- EPIPHANY Index
- Carmona-Bayonas EPIPHANY
- cancer-associated pulmonary embolism
- EPIPHANY PE cancer
- Hestia-like cancer PE
- cancer PE serious complications
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/epiphany?hestia_like_any=false&ecog_ps_ge_2=false&oxygen_sat_lt_90=false&pe_specific_symptoms=false&tumour_uncontrolled=false&primary_tumour_resected=true
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/epiphany?hestia_like_any=false&ecog_ps_ge_2=false&oxygen_sat_lt_90=false&pe_specific_symptoms=false&tumour_uncontrolled=false&primary_tumour_resected=true"
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
hestia_like_any |
boolean | required | true if any Carmona-Bayonas 2017 Hestia-like clinical decision rule item is present: SBP <100 mm Hg, arterial oxygen saturation <90%, respiratory rate >=30 breaths/min, pulse >=110 beats/min, sudden or progressive dyspnoea, or clinically relevant haemorrhage / high bleeding risk / platelets <50 000 mm^-3 (Figure 2). false if none. Caller-assigned; magent does not measure vitals or score the 11-item Zondag Hestia checklist. |
ecog_ps_ge_2 |
boolean | required | ECOG-PS >=2 as assigned by the caller (Carmona-Bayonas 2017: <2 vs >=2). true or false. Used on the Hestia-like-any branch. magent does not assign performance status. |
oxygen_sat_lt_90 |
boolean | required | Arterial oxygen saturation <90% as assigned by the caller (Figure 2: <90 vs >=90%). true or false. Used when Hestia-like any is present and ECOG-PS >=2; both sat leaves are high class. Distinct from the same cutoff inside the Hestia-like CDR. magent does not measure saturation. |
pe_specific_symptoms |
boolean | required | PE-specific symptoms present as assigned by the caller (Carmona-Bayonas 2017 Figure 2). true or false. Used when Hestia-like any is present and ECOG-PS <2. Distinct from incidental vs symptomatic diagnosis and from the dyspnoea CDR item. magent does not take a history. |
tumour_uncontrolled |
boolean | required | true if tumour response is progression, unknown, or not evaluated; false for others (complete or partial response, stable disease, or no evidence of disease) per Carmona-Bayonas 2017 Table 1 / Figure 2. Used on the Hestia-like-none branch. magent does not apply RECIST. |
primary_tumour_resected |
boolean | required | Prior surgical resection of the primary tumour as assigned by the caller. true or false. Used when Hestia-like none and tumour_uncontrolled are both true. magent does not read an operative note. |
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": [
{
"ecog_ps_ge_2": "false",
"hestia_like_any": "false",
"oxygen_sat_lt_90": "false",
"pe_specific_symptoms": "false",
"primary_tumour_resected": "true",
"tumour_uncontrolled": "false"
},
{
"ecog_ps_ge_2": "false",
"hestia_like_any": "false",
"oxygen_sat_lt_90": "false",
"pe_specific_symptoms": "false",
"primary_tumour_resected": "true",
"tumour_uncontrolled": "false"
}
]
}
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/epiphany",
"items": [
{
"leaf": "low_controlled",
"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": "Carmona-Bayonas A, Jiménez-Fonseca P, Font C, Fenoy F, Otero R, Beato C, Plasencia JM, Biosca M, Sánchez M, Benegas M, Calvo-Temprano D, Varona D, Faez L, de la Haba I, Antonio M, Madridano O, Solis MP, Ramchandani A, Castañón E, Marchena PJ, Martín M, Ayala de la Peña F, Vicente V; Asociación de Investigación de la Enfermedad Tromboembólica de la Región de Murcia",
"doi": "10.1038/bjc.2017.48",
"id": "carmona-bayonas-2017",
"pmid": "28267709",
"source": "Br J Cancer. 2017;116:994-1001",
"title": "Predicting serious complications in patients with cancer and pulmonary embolism using decision tree modelling: the EPIPHANY Index"
},
"formula": "epiphany",
"formula_expression": "root: hestia-like CDR any vs none (Carmona-Bayonas 2017 Figure 2). CDR any: ECOG-PS >=2 then SaO2 <90 vs >=90 (both high), else PE-specific symptoms yes (high) vs no (intermediate). CDR none: tumour progression/unknown/not evaluated vs others (CR/PR/SD/NED); if uncontrolled then primary tumour resection yes (low) vs no (intermediate); if others then low. Classes low/intermediate/high with 15-day serious complications 1.6/9.4/30.6% and 15-day mortality 0.3/6.1/17.1%",
"criteria": [
{
"factor": "hestia_like_any",
"met": false
},
{
"factor": "ecog_ps_ge_2",
"met": false
},
{
"factor": "oxygen_sat_lt_90",
"met": false
},
{
"factor": "pe_specific_symptoms",
"met": false
},
{
"factor": "tumour_uncontrolled",
"met": false
},
{
"factor": "primary_tumour_resected",
"met": true
}
],
"ecog_ps_ge_2": false,
"hestia_like_any": false,
"mortality_15d_percent": 0.3,
"oxygen_sat_lt_90": false,
"pe_specific_symptoms": false,
"primary_tumour_resected": true,
"risk_class": "low",
"serious_complication_15d_percent": 1.6,
"tumour_uncontrolled": false
},
{
"leaf": "low_controlled",
"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": "Carmona-Bayonas A, Jiménez-Fonseca P, Font C, Fenoy F, Otero R, Beato C, Plasencia JM, Biosca M, Sánchez M, Benegas M, Calvo-Temprano D, Varona D, Faez L, de la Haba I, Antonio M, Madridano O, Solis MP, Ramchandani A, Castañón E, Marchena PJ, Martín M, Ayala de la Peña F, Vicente V; Asociación de Investigación de la Enfermedad Tromboembólica de la Región de Murcia",
"doi": "10.1038/bjc.2017.48",
"id": "carmona-bayonas-2017",
"pmid": "28267709",
"source": "Br J Cancer. 2017;116:994-1001",
"title": "Predicting serious complications in patients with cancer and pulmonary embolism using decision tree modelling: the EPIPHANY Index"
},
"formula": "epiphany",
"formula_expression": "root: hestia-like CDR any vs none (Carmona-Bayonas 2017 Figure 2). CDR any: ECOG-PS >=2 then SaO2 <90 vs >=90 (both high), else PE-specific symptoms yes (high) vs no (intermediate). CDR none: tumour progression/unknown/not evaluated vs others (CR/PR/SD/NED); if uncontrolled then primary tumour resection yes (low) vs no (intermediate); if others then low. Classes low/intermediate/high with 15-day serious complications 1.6/9.4/30.6% and 15-day mortality 0.3/6.1/17.1%",
"criteria": [
{
"factor": "hestia_like_any",
"met": false
},
{
"factor": "ecog_ps_ge_2",
"met": false
},
{
"factor": "oxygen_sat_lt_90",
"met": false
},
{
"factor": "pe_specific_symptoms",
"met": false
},
{
"factor": "tumour_uncontrolled",
"met": false
},
{
"factor": "primary_tumour_resected",
"met": true
}
],
"ecog_ps_ge_2": false,
"hestia_like_any": false,
"mortality_15d_percent": 0.3,
"oxygen_sat_lt_90": false,
"pe_specific_symptoms": false,
"primary_tumour_resected": true,
"risk_class": "low",
"serious_complication_15d_percent": 1.6,
"tumour_uncontrolled": false
}
]
}
Response
| Field | Type | Description |
|---|---|---|
formula |
string | epiphany |
formula_expression |
string | Carmona-Bayonas 2017 Figure 2 CHAID tree |
hestia_like_any |
boolean | Caller-assigned Hestia-like CDR any vs none |
ecog_ps_ge_2 |
boolean | Caller-assigned ECOG-PS >=2 |
oxygen_sat_lt_90 |
boolean | Caller-assigned arterial oxygen saturation <90% |
pe_specific_symptoms |
boolean | Caller-assigned PE-specific symptoms |
tumour_uncontrolled |
boolean | true when tumour response is progression, unknown, or not evaluated; false for CR/PR/SD/NED |
primary_tumour_resected |
boolean | Caller-assigned prior primary tumour resection |
risk_class |
string | low, intermediate, or high. Published three-class summary, not a diagnosis. |
leaf |
string | Figure 2 terminal leaf token: low_controlled, low_resected, intermediate_unresected, intermediate_silent, high_symptoms, high_ecog_normoxemia, or high_ecog_hypoxemia |
serious_complication_15d_percent |
number | Published 15-day serious-complication class rate: 1.6 (low), 9.4 (intermediate), or 30.6 (high) |
mortality_15d_percent |
number | Published 15-day mortality class rate: 0.3 (low), 6.1 (intermediate), or 17.1 (high) |
criteria |
array | Per-covariate rows with factor and met for the six Figure 2 inputs |
citation |
object | Carmona-Bayonas 2017 Br J Cancer citation |
disclaimer |
string | Not-a-device notice |
Example JSON
Machine form of the same example. Frozen fixture. Not a live lookup.
{
"leaf": "low_controlled",
"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": "Carmona-Bayonas A, Jiménez-Fonseca P, Font C, Fenoy F, Otero R, Beato C, Plasencia JM, Biosca M, Sánchez M, Benegas M, Calvo-Temprano D, Varona D, Faez L, de la Haba I, Antonio M, Madridano O, Solis MP, Ramchandani A, Castañón E, Marchena PJ, Martín M, Ayala de la Peña F, Vicente V; Asociación de Investigación de la Enfermedad Tromboembólica de la Región de Murcia",
"doi": "10.1038/bjc.2017.48",
"id": "carmona-bayonas-2017",
"pmid": "28267709",
"source": "Br J Cancer. 2017;116:994-1001",
"title": "Predicting serious complications in patients with cancer and pulmonary embolism using decision tree modelling: the EPIPHANY Index"
},
"formula": "epiphany",
"formula_expression": "root: hestia-like CDR any vs none (Carmona-Bayonas 2017 Figure 2). CDR any: ECOG-PS >=2 then SaO2 <90 vs >=90 (both high), else PE-specific symptoms yes (high) vs no (intermediate). CDR none: tumour progression/unknown/not evaluated vs others (CR/PR/SD/NED); if uncontrolled then primary tumour resection yes (low) vs no (intermediate); if others then low. Classes low/intermediate/high with 15-day serious complications 1.6/9.4/30.6% and 15-day mortality 0.3/6.1/17.1%",
"criteria": [
{
"factor": "hestia_like_any",
"met": false
},
{
"factor": "ecog_ps_ge_2",
"met": false
},
{
"factor": "oxygen_sat_lt_90",
"met": false
},
{
"factor": "pe_specific_symptoms",
"met": false
},
{
"factor": "tumour_uncontrolled",
"met": false
},
{
"factor": "primary_tumour_resected",
"met": true
}
],
"ecog_ps_ge_2": false,
"hestia_like_any": false,
"mortality_15d_percent": 0.3,
"oxygen_sat_lt_90": false,
"pe_specific_symptoms": false,
"primary_tumour_resected": true,
"risk_class": "low",
"serious_complication_15d_percent": 1.6,
"tumour_uncontrolled": false
}
Client errors (HTTP 400)
Invalid params return 400 without charge. Shared HTTP 402 and 503 meanings: Payments.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_epiphany |
EPIPHANY needs Carmona-Bayonas 2017 Hestia-like, ECOG, saturation, symptoms, tumour response, and resection flags. 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
- Hestia criteria — Apply the Zondag 2011 Hestia exclusion checklist and return whether outpatient treatment of acute PE is eligible from 11 caller-assigned items.
- PESI — Compute the Aujesky 2005 Pulmonary Embolism Severity Index (PESI) from age, sex, comorbidities, vital signs, and altered mental status.
- Wells PE — Compute the Wells pulmonary-embolism probability score and return three-tier and two-tier bands.
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.