81trust / 100

Calc Chip

by magent in Onchain & crypto

x402 APIPassing, checked 5 h ago

Smits 2007 CHIP rule (adults ≥16, GCS 13-15). CT if ≥1 major (pedestrian/cyclist vs vehicle, ejected, vomiting, PTA ≥4 h, skull-fracture signs, GCS <15, GCS drop ≥2 at 1 h, anticoagulants, posttraumatic seizure, age ≥60) or ≥2 minor (fall from elevation, persistent anterograde amnesia, PTA 2 to <4 h, skull contusion, neurologic deficit, LOC, GCS drop of 1 at 1 h, age 40-60). Not a diagnosis; not Canadian CT Head, NEXUS, PECARN, or 2022 CHIP. magent does not examine the patient.

GET https://api.magentlab.com/api/calc/chip

Last 30 days

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

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://api.magentlab.com/api/calc/chip?age=30&anticoagulant_therapy=false&clinical_signs_skull_fracture=false&ejected_from_vehicle=false&fall_from_any_elevation=false&gcs=15&gcs_deterioration_1=false&gcs_deterioration_ge_2=false&loss_of_consciousness=false&neurologic_deficit=false&pedestrian_or_cyclist_vs_vehicle=false&persistent_anterograde_amnesia=false&posttraumatic_seizure=false&pta_2_to_lt_4h=false&pta_ge_4h=false&skull_contusion=false&vomiting=false"
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%2Fchip
const res = await pay("https://api.magentlab.com/api/calc/chip?age=30&anticoagulant_therapy=false&clinical_signs_skull_fracture=false&ejected_from_vehicle=false&fall_from_any_elevation=false&gcs=15&gcs_deterioration_1=false&gcs_deterioration_ge_2=false&loss_of_consciousness=false&neurologic_deficit=false&pedestrian_or_cyclist_vs_vehicle=false&persistent_anterograde_amnesia=false&posttraumatic_seizure=false&pta_2_to_lt_4h=false&pta_ge_4h=false&skull_contusion=false&vomiting=false");
console.log(await res.json());

Example input

{
  "age": 30,
  "anticoagulant_therapy": false,
  "clinical_signs_skull_fracture": false,
  "ejected_from_vehicle": false,
  "fall_from_any_elevation": false,
  "gcs": 15,
  "gcs_deterioration_1": false,
  "gcs_deterioration_ge_2": false,
  "loss_of_consciousness": false,
  "neurologic_deficit": false,
  "pedestrian_or_cyclist_vs_vehicle": false,
  "persistent_anterograde_amnesia": false,
  "posttraumatic_seizure": false,
  "pta_2_to_lt_4h": false,
  "pta_ge_4h": false,
  "skull_contusion": false,
  "vomiting": false
}

Example output

{
  "age_years": 30,
  "citation": {
    "authors": "Smits M, Dippel DW, Steyerberg EW, et al.",
    "doi": "10.7326/0003-4819-146-6-200703200-00004",
    "id": "smits-2007",
    "pmid": "17371884",
    "source": "Ann Intern Med. 2007;146(6):397-405",
    "title": "Predicting intracranial traumatic findings on computed tomography in patients with minor head injury: the CHIP prediction rule"
  },
  "criteria": [
    {
      "factor": "pedestrian_or_cyclist_vs_vehicle",
      "met": false
    },
    {
      "factor": "ejected_from_vehicle",
      "met": false
    },
    {
      "factor": "vomiting",
      "met": false
    },
    {
      "factor": "pta_ge_4h",
      "met": false
    },
    {
      "factor": "clinical_signs_skull_fracture",
      "met": false
    },
    {
      "factor": "gcs_lt_15",
      "met": false,
      "value": 15
    },
    {
      "factor": "gcs_deterioration_ge_2",
      "met": false
    },
    {
      "factor": "anticoagulant_therapy",
      "met": false
    },
    {
      "factor": "posttraumatic_seizure",
      "met": false
    },
    {
      "factor": "age_ge_60",
      "met": false,
      "value": 30
    },
    {
      "factor": "fall_from_any_elevation",
      "met": false
    },
    {
      "factor": "persistent_anterograde_amnesia",
      "met": false
    },
    {
      "factor": "pta_2_to_lt_4h",
      "met": false
    },
    {
      "factor": "skull_contusion",
      "met": false
    },
    {
      "factor": "neurologic_deficit",
      "met": false
    },
    {
      "factor": "loss_of_consciousness",
      "met": false
    },
    {
      "factor": "gcs_deterioration_1",
      "met": false
    },
    {
      "factor": "age_40_to_60",
      "met": false,
      "value": 30
    }
  ],
  "ct_indicated": 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.",
  "formula": "chip",
  "formula_expression": "ct indicated if ≥1 major (pedestrian_or_cyclist_vs_vehicle, ejected_from_vehicle, vomiting, pta_ge_4h, clinical_signs_skull_fracture, gcs < 15, gcs_deterioration_ge_2, anticoagulant_therapy, posttraumatic_seizure, age ≥ 60) or ≥2 minor (fall_from_any_elevation, persistent_anterograde_amnesia, pta_2_to_lt_4h, skull_contusion, neurologic_deficit, loss_of_consciousness, gcs_deterioration_1, age 40-60)",
  "gcs": 15,
  "major_count": 0,
  "minor_count": 0
}

Security scan

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

Recent checks

WhenResultHTTPTimePrice
5 h agoPassed402133 ms$0.005