70trust / 100

Calc Pews

by magent in News & content

x402 APIPassing, checked 3 h ago

Monaghan 2005 Brighton PEWS: behaviour, cardiovascular, and respiratory 0-3 each, plus +2 each for quarter-hourly nebulisers and persistent post-surgery vomiting (max 13). HR/RR use APLS 2005 age-group rest ranges as the paper's normal rate and mean. Returns score_ge_3. Not NEWS2; not MEWS; not Bedside PEWS.

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

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
152 ms typical, 171 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/pews" \
  -H "content-type: application/json" \
  -d '{"items":[{"age_group":"infant","behavior":"playing","cardiovascular":"pink","heart_rate_bpm":130,"oxygen":"none","persistent_vomiting_after_surgery":false,"quarter_hourly_nebulisers":false,"respiratory_effort":"none","respiratory_rate":35},{"age_group":"infant","behavior":"playing","cardiovascular":"pink","heart_rate_bpm":130,"oxygen":"none","persistent_vomiting_after_surgery":false,"quarter_hourly_nebulisers":false,"respiratory_effort":"none","respiratory_rate":35}]}'
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%2Fpews
const res = await pay("https://api.magentlab.com/api/calc/pews", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"items":[{"age_group":"infant","behavior":"playing","cardiovascular":"pink","heart_rate_bpm":130,"oxygen":"none","persistent_vomiting_after_surgery":false,"quarter_hourly_nebulisers":false,"respiratory_effort":"none","respiratory_rate":35},{"age_group":"infant","behavior":"playing","cardiovascular":"pink","heart_rate_bpm":130,"oxygen":"none","persistent_vomiting_after_surgery":false,"quarter_hourly_nebulisers":false,"respiratory_effort":"none","respiratory_rate":35}]}),
});
console.log(await res.json());

Example input

{
  "items": [
    {
      "age_group": "infant",
      "behavior": "playing",
      "cardiovascular": "pink",
      "heart_rate_bpm": 130,
      "oxygen": "none",
      "persistent_vomiting_after_surgery": false,
      "quarter_hourly_nebulisers": false,
      "respiratory_effort": "none",
      "respiratory_rate": 35
    },
    {
      "age_group": "infant",
      "behavior": "playing",
      "cardiovascular": "pink",
      "heart_rate_bpm": 130,
      "oxygen": "none",
      "persistent_vomiting_after_surgery": false,
      "quarter_hourly_nebulisers": false,
      "respiratory_effort": "none",
      "respiratory_rate": 35
    }
  ]
}

Example output

{
  "count": 2,
  "items": [
    {
      "age_group": "infant",
      "behavior": "playing",
      "cardiovascular": "pink",
      "citation": {
        "authors": "Monaghan A",
        "doi": "10.7748/paed2005.02.17.1.32.c964",
        "id": "monaghan-2005",
        "pmid": "15751446",
        "source": "Paediatr Nurs. 2005;17(1):32-35",
        "title": "Detecting and managing deterioration in children"
      },
      "components": [
        {
          "factor": "behavior",
          "points": 0,
          "present": false,
          "value": "playing"
        },
        {
          "factor": "cardiovascular",
          "points": 0,
          "present": false,
          "value": "pink"
        },
        {
          "factor": "respiratory",
          "points": 0,
          "present": false,
          "value": "none"
        },
        {
          "factor": "quarter_hourly_nebulisers",
          "points": 0,
          "present": false
        },
        {
          "factor": "persistent_vomiting_after_surgery",
          "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.",
      "formula": "pews",
      "formula_expression": "PEWS = behavior_points + cardiovascular_points + respiratory_points + nebuliser_points + vomiting_points; Monaghan 2005 Brighton table (each domain 0-3; extra +2 each for quarter-hourly nebulisers and persistent vomiting following surgery); max 13",
      "heart_rate_bpm": 130,
      "max_score": 13,
      "oxygen": "none",
      "persistent_vomiting_after_surgery": false,
      "quarter_hourly_nebulisers": false,
      "respiratory_effort": "none",
      "respiratory_rate": 35,
      "score": 0,
      "score_ge_3": false
    },
    {
      "age_group": "infant",
      "behavior": "playing",
      "cardiovascular": "pink",
      "citation": {
        "authors": "Monaghan A",
        "doi": "10.7748/paed2005.02.17.1.32.c964",
        "id": "monaghan-2005",
        "pmid": "15751446",
        "source": "Paediatr Nurs. 2005;17(1):32-35",
        "title": "Detecting and managing deterioration in children"
      },
      "components": [
        {
          "factor": "behavior",
          "points": 0,
          "present": false,
          "value": "playing"
        },
        {
          "factor": "cardiovascular",
          "points": 0,
          "present": false,
          "value": "pink"
        },
        {
          "factor": "respiratory",
          "points": 0,
          "present": false,
          "value": "none"
        },
        {
          "factor": "quarter_hourly_nebulisers",
          "points": 0,
          "present": false
        },
        {
          "factor": "persistent_vomiting_after_surgery",
          "points": 0,
          "present": false
        }
      ],
      "disclaimer": "Not a medical d

Security scan

  • Charges more than its listed price in payment
    Listed at $0.005, charges $0.007

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402141 ms$0.007
7 h agoPassed402171 ms$0.007
10 h agoPassed402161 ms$0.007
19 h agoPassed402152 ms$0.007
23 h agoPassed402144 ms$0.007
27 h agoPassed402156 ms$0.007
30 h agoPassed402147 ms$0.007
34 h agoPassed402151 ms$0.007
37 h agoPassed402160 ms$0.007
41 h agoPassed402307 ms$0.007
46 h agoPassed402137 ms$0.007

History

11 Oct 2026Price changed from $0.005 to $0.007