78trust / 100

Calc Khorana

by magent in AI models & inference

x402 APIPassing, checked 3 h ago

Khorana 2008 Blood predictive model for chemotherapy-associated thrombosis: very_high site (stomach or pancreas) 2, high (lung, lymphoma, gynecologic, bladder, testicular) 1, other 0; platelets >=350 1; hemoglobin <10 g/dL or ESA 1 (once); WBC >11 x10^9/L 1; BMI>=35 caller flag 1. Max 6. 0 low; 1-2 intermediate; >=3 high. Not a diagnosis. Not Padua or Caprini. Caller assigns cancer site; magent does not compute BMI.

POST https://api.magentlab.com/api/calc/khorana

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
152 ms typical, 235 ms slowest 5%
Last check
3 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://api.magentlab.com/api/calc/khorana" \
  -H "content-type: application/json" \
  -d '{"items":[{"bmi_ge_35":false,"cancer_site":"other","erythropoiesis_stimulating_agent":false,"hemoglobin_g_dl":12,"hemoglobin_g_l":120,"platelets_10e9_l":200,"wbc_k_ul":8,"wbc_ul":8000},{"bmi_ge_35":false,"cancer_site":"other","erythropoiesis_stimulating_agent":false,"hemoglobin_g_dl":12,"hemoglobin_g_l":120,"platelets_10e9_l":200,"wbc_k_ul":8,"wbc_ul":8000}]}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.magentlab.com%2Fapi%2Fcalc%2Fkhorana
const res = await pay("https://api.magentlab.com/api/calc/khorana", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"items":[{"bmi_ge_35":false,"cancer_site":"other","erythropoiesis_stimulating_agent":false,"hemoglobin_g_dl":12,"hemoglobin_g_l":120,"platelets_10e9_l":200,"wbc_k_ul":8,"wbc_ul":8000},{"bmi_ge_35":false,"cancer_site":"other","erythropoiesis_stimulating_agent":false,"hemoglobin_g_dl":12,"hemoglobin_g_l":120,"platelets_10e9_l":200,"wbc_k_ul":8,"wbc_ul":8000}]}),
});
console.log(await res.json());

Example input

{
  "items": [
    {
      "bmi_ge_35": false,
      "cancer_site": "other",
      "erythropoiesis_stimulating_agent": false,
      "hemoglobin_g_dl": 12,
      "hemoglobin_g_l": 120,
      "platelets_10e9_l": 200,
      "wbc_k_ul": 8,
      "wbc_ul": 8000
    },
    {
      "bmi_ge_35": false,
      "cancer_site": "other",
      "erythropoiesis_stimulating_agent": false,
      "hemoglobin_g_dl": 12,
      "hemoglobin_g_l": 120,
      "platelets_10e9_l": 200,
      "wbc_k_ul": 8,
      "wbc_ul": 8000
    }
  ]
}

Example output

{
  "count": 2,
  "items": [
    {
      "bmi_ge_35": false,
      "cancer_site": "other",
      "citation": {
        "authors": "Khorana AA, Kuderer NM, Culakova E, Lyman GH, Francis CW",
        "doi": "10.1182/blood-2007-10-116327",
        "id": "khorana-2008",
        "source": "Blood. 2008;111(10):4902-4907",
        "title": "Development and validation of a predictive model for chemotherapy-associated thrombosis"
      },
      "components": [
        {
          "factor": "cancer_site",
          "points": 0,
          "present": false,
          "value": "other"
        },
        {
          "factor": "platelets",
          "points": 0,
          "present": false,
          "value": 200
        },
        {
          "factor": "hemoglobin_or_esa",
          "points": 0,
          "present": false,
          "value": {
            "erythropoiesis_stimulating_agent": false,
            "hemoglobin_g_dl": 12
          }
        },
        {
          "factor": "wbc",
          "points": 0,
          "present": false,
          "value": 8000
        },
        {
          "factor": "bmi_ge_35",
          "points": 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.",
      "erythropoiesis_stimulating_agent": false,
      "formula": "khorana",
      "formula_expression": "Khorana = cancer_site (very_high 2, high 1, other 0) + (platelets>=350) + (hemoglobin<10 g/dL or ESA) + (wbc>11 x10^9/L) + (BMI>=35); max 6; 0 low, 1-2 intermediate, >=3 high",
      "hemoglobin_g_dl": 12,
      "khorana_risk": "low",
      "max_score": 6,
      "platelets_10e9_l": 200,
      "score": 0,
      "wbc_ul": 8000
    },
    {
      "bmi_ge_35": false,
      "cancer_site": "other",
      "citation": {
        "authors": "Khorana AA, Kuderer NM, Culakova E, Lyman GH, Francis CW",
        "doi": "10.1182/blood-2007-10-116327",
        "id": "khorana-2008",
        "source": "Blood. 2008;111(10):4902-4907",
        "title": "Development and validation of a predictive model for chemotherapy-associated thrombosis"
      },
      "components": [
        {
          "factor": "cancer_site",
          "points": 0,
          "present": false,
          "value": "other"
        },
        {
          "factor": "platelets",
          "points": 0,
          "present": false,
          "value": 200
        },
        {
          "factor": "hemoglobin_or_esa",
          "points": 0,
          "present": false,
          "value": {
            "erythropoiesis_stimulating_agent": false,
            "hemoglobin_g_dl": 12
          }
        },
        {
          "factor": "wbc",
          "points": 0,
          "present": false,
          "value": 8000
        },
        {
          "factor": "bmi_ge_35",
          "points": 0,
          "present": false
        }
      ],
     

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402148 ms$0.005
6 h agoPassed402164 ms$0.005
10 h agoPassed402382 ms$0.005
13 h agoPassed402235 ms$0.005
23 h agoPassed402141 ms$0.005
26 h agoPassed402139 ms$0.005
30 h agoPassed402146 ms$0.005
33 h agoPassed402159 ms$0.005
37 h agoPassed402142 ms$0.005
41 h agoPassed402153 ms$0.005
44 h agoPassed402163 ms$0.005
2 days agoPassed402152 ms$0.005