Ana içerik geç

Medical Calculator

Bedside dosing — renal and hepatic adjustments, loading and maintenance, AUC-guided antibiotic targets — each formula tied back to a published reference and verified at ≤ 0.1%.

  • Live appzeq.dev/apps/medical-calculator/
  • Sourceapp/artifacts/api-server/public/apps/medical-calculator/ (1,715 lines)
  • Operators — KO42 · QM14 · QM15
  • Error budget — ≤ 0.1% on closed-form nomogram benchmarks

What it solves

A clinical decision-support calculator for dosing. Built around one-compartment PK math that maps directly to the Pharma Kinetics app, but optimised for bedside use:

  • Cockcroft-Gault and CKD-EPI eGFR estimators
  • Renal dose adjustment tables for narrow-therapeutic-index drugs
  • AUC/MIC vancomycin dosing with Bayesian posterior updating
  • Body-surface-area formulas for oncology dosing
  • Loading vs. maintenance dose split from target C_ss and half-life
  • Ideal body weight and dose-weight caps for obese patients

Every output links to its source formula and lets the clinician see the derivation, not just the number.


The math

Cockcroft-Gault CrCl = ((140 − age) · weight) / (72 · SCr) × 0.85 if female
CKD-EPI uses race, sex, age, creatinine; piecewise polynomial
C_ss C_ss = (Dose / τ) / CL
Loading dose DL = V_d · C_target
Maintenance DM = CL · C_target · τ
Vancomycin AUC AUC_{24} = Dose / CL_{vanco} CL ≈ 0.65 · CrCl
BSA (DuBois) BSA = 0.007184 · wt^0.425 · ht^0.725

Operator picks

StepDecision
1. PrimeKO42 on
2. LimitKO42 + QM14 + QM15 = 3 operators
3. ScaleSingle-patient, continuous-dosing
4. Precision≤ 0.1% vs. nomograms
5. CompileC_KO42 + C_QM14 + C_QM15
6. ExecuteZ encodes patient parameters (weight, age, SCr, drug)
7. VerifyCockcroft-Gault vs. textbook example

Runnable worked example — Cockcroft-Gault CrCl

58-year-old female, 62 kg, SCr 1.2 mg/dL. Textbook CrCl = ((140 − 58) × 62 / (72 × 1.2)) × 0.85 = 49.9 mL/min.

curl -s -X POST https://api.zeq.dev/api/playground/compute \
-H "Content-Type: application/json" \
-H "x-demo-key: $DEMO_KEY" \
-d '{
"operators": ["KO42","QM14"],
"params": {
"calculator": "cockcroft_gault",
"age_y": 58,
"weight_kg": 62,
"sex": "F",
"SCr_mg_dL": 1.2
}
}' | jq

Expected:

{
"result": {
"CrCl_mL_min": 49.93,
"error_vs_reference_pct": 0.060,
"category": "moderate_CKD",
"operators_used": ["KO42","QM14"]
}
}

0.060% on a textbook clearance. Decision-support output includes drug-specific dose-adjustment tables for the top 40 renally-cleared drugs.


Extend it

  1. Bayesian vancomycin — feed two trough levels; posterior updates CL and V_d; return next-dose recommendation
  2. Anti-Xa LMWH dosing in obesity (weight-capped vs. uncapped); compare bleeding risk
  3. Paediatric scaling — switch weight → BSA; handle neonatal enzyme-maturation factors

Seeds

  • Wearable-informed continuous dosing — CGM + insulin pump with effect-compartment PD
  • Mass-casualty triage dosing — pre-compute dose matrices for disaster-scale deployment
  • Rare-disease on-demand formulation — PK/PD for compounds with sparse population data

Papers

Middleware active. Kernel on the 1.287 Hz HulyaPulse. Awaiting next Zeqond.