70trust / 100
Calc Cedocs
by magent in Productivity & SaaS
x402 APIPassing, checked 1 h ago
Weiss 2014 Community ED Overcrowding Scale (CEDOCS) reduced model: critical-care patients, longest admitted-patient hours since admission, waiting-room count, ED patients indexed to ED beds, and annual ED visits with a restricted cubic spline. Returns the 1-decimal score on the paper's 0-100 scale without clamping or named class bands. Caller supplies counts and hours; magent does not count patients or wait times. Not a medical device and not a diversion or ambulance-bypass order.
POST https://api.magentlab.com/api/calc/cedocs
Last 30 days
All checks passedSome failedAll failedNot checked
- Uptime
- 100%
- Response time
- 147 ms typical, 154 ms slowest 5%
- Last check
- 1 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/cedocs" \
-H "content-type: application/json" \
-d '{"items":[{"admit_time_hours":0,"critical_care_patients":0,"ed_beds":20,"ed_patients":0,"ed_visits_per_year":46000,"waiting_room_patients":0},{"admit_time_hours":0,"critical_care_patients":0,"ed_beds":20,"ed_patients":0,"ed_visits_per_year":46000,"waiting_room_patients":0}]}'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%2Fcedocs
const res = await pay("https://api.magentlab.com/api/calc/cedocs", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({"items":[{"admit_time_hours":0,"critical_care_patients":0,"ed_beds":20,"ed_patients":0,"ed_visits_per_year":46000,"waiting_room_patients":0},{"admit_time_hours":0,"critical_care_patients":0,"ed_beds":20,"ed_patients":0,"ed_visits_per_year":46000,"waiting_room_patients":0}]}),
});
console.log(await res.json());Example input
{
"items": [
{
"admit_time_hours": 0,
"critical_care_patients": 0,
"ed_beds": 20,
"ed_patients": 0,
"ed_visits_per_year": 46000,
"waiting_room_patients": 0
},
{
"admit_time_hours": 0,
"critical_care_patients": 0,
"ed_beds": 20,
"ed_patients": 0,
"ed_visits_per_year": 46000,
"waiting_room_patients": 0
}
]
}Example output
{
"count": 2,
"items": [
{
"admit_time_hours": 0,
"cedocs_score": 5.5,
"citation": {
"authors": "Weiss SJ, Rogers DB, Maas F, Ernst AA, Nick TG",
"doi": "10.1016/j.ajem.2014.08.035",
"id": "weiss-2014",
"pmid": "25234796",
"source": "Am J Emerg Med. 2014;32(11):1357-1363",
"title": "Evaluating community ED crowding: the Community ED Overcrowding Scale study"
},
"critical_care_patients": 0,
"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.",
"ed_beds": 20,
"ed_patients": 0,
"ed_visits_per_year": 46000,
"formula": "cedocs",
"formula_expression": "cedocs_score = -30.39 + 3.00 * critical_care_patients + 0.53 * admit_time_hours + 1.16 * waiting_room_patients + 20.66 * (ed_patients / ed_beds) + 0.00126 * ed_visits_per_year - 1.11e-12 * pmax(ed_visits_per_year - 18811, 0)^3 + 8.23e-12 * pmax(ed_visits_per_year - 43012, 0)^3 - 8.20e-12 * pmax(ed_visits_per_year - 49466, 0)^3 + 1.08e-12 * pmax(ed_visits_per_year - 67273, 0)^3",
"occupancy": 0,
"waiting_room_patients": 0
},
{
"admit_time_hours": 0,
"cedocs_score": 5.5,
"citation": {
"authors": "Weiss SJ, Rogers DB, Maas F, Ernst AA, Nick TG",
"doi": "10.1016/j.ajem.2014.08.035",
"id": "weiss-2014",
"pmid": "25234796",
"source": "Am J Emerg Med. 2014;32(11):1357-1363",
"title": "Evaluating community ED crowding: the Community ED Overcrowding Scale study"
},
"critical_care_patients": 0,
"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.",
"ed_beds": 20,
"ed_patients": 0,
"ed_visits_per_year": 46000,
"formula": "cedocs",
"formula_expression": "cedocs_score = -30.39 + 3.00 * critical_care_patients + 0.53 * admit_time_hours + 1.16 * waiting_room_patients + 20.66 * (ed_patients / ed_beds) + 0.00126 * ed_visits_per_year - 1.11e-12 * pmax(ed_visits_per_year - 18811, 0)^3 + 8.23e-12 * pmax(ed_visits_per_year - 43012, 0)^3 - 8.20e-12 * pmax(ed_visits_per_year - 49466, 0)^3 + 1.08e-12 * pmax(ed_visits_per_year - 67273, 0)^3",
"occupancy": 0,
"waiting_room_patients": 0
}
],
"path": "/api/calc/cedocs"
}Security scan
- Charges more than its listed price in payment
Listed at $0.005, charges $0.007
Recent checks
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 1 h ago | Passed | 402 | 903 ms | $0.007 |
| 11 h ago | Passed | 402 | 136 ms | $0.007 |
| 14 h ago | Passed | 402 | 142 ms | $0.007 |
| 18 h ago | Passed | 402 | 148 ms | $0.007 |
| 21 h ago | Passed | 402 | 137 ms | $0.007 |
| 25 h ago | Passed | 402 | 154 ms | $0.007 |
| 29 h ago | Passed | 402 | 147 ms | $0.007 |
| 32 h ago | Passed | 402 | 140 ms | $0.007 |
| 37 h ago | Passed | 402 | 150 ms | $0.007 |
History
| 11 Oct 2026 | Price changed from $0.005 to $0.007 |