A domain-specific language for encoding clinical and biomedical logic as executable, testable programs. A MOISS protocol takes typed patients and biomarkers as input, expresses reasoning as clinical verbs (track, assess, administer, alert), and the interpreter returns a fully auditable event trace. Underneath, twenty medical modules do the real computation: validated severity scores, compartmental pharmacokinetics, pharmacogenomics, epidemiology, and physiologic signal processing.
A spreadsheet or a Python script leaves clinical logic implicit and unverifiable. MOISSCode makes it explicit. Protocols are typed, so a dose in the wrong unit, a contraindicated drug, or a missing biomarker is caught before it runs. The interpreter is sandboxed and deterministic: the same protocol on the same inputs always yields the same event trace, so you can unit-test a guideline the way you test code. It is not an LLM wrapper and it does not guess. Every number comes from a validated formula in the standard library.
Declare typed inputs (Patient, biomarkers), then express the pathway with clinical verbs: track, assess, administer, alert. Import any of 20 modules as med.*.
Run locally with moiss run, embed the interpreter in Python, or call the hosted API. Dose validation and interaction geometry are enforced at execution time.
Every statement emits a typed event (scores, doses, alerts, interactions) that you can log, diff against a baseline, or export to FHIR R4 for the record.
Each panel below runs a real function from the standard library on real inputs. These are the workflows MOISSCode is built for, from the bedside to the bench.
Compartmental pharmacokinetics across 106 agents. Vancomycin 1 g IV q12h, 70 kg: Cmax 47.6, trough target 15 to 20 mg/L, elimination t½ 6 h. Predict troughs and adjust for renal clearance before dosing.
R-peak detection, rhythm classification, and heart-rate variability from RR intervals. Time-domain metrics quantify autonomic tone. Reduced HRV flags increased cardiac risk.
A-priori power analysis, block randomization, stratification, and Safe-Harbor de-identification (keyed HMAC). Two-sample test, alpha 0.05, 80% power: n scales with effect size.
Every co-administered pair is graded against a curated drug-drug interaction table and escalated to the maximum severity, so a MAJOR or SEVERE pairing halts before the order stands.
SIR and SEIR compartment models with reproduction number, incidence, and herd-immunity thresholds. N 100k, beta 0.3, gamma 0.1: incident cases peak at 30,165 on day 50 (attack rate 91%).
Transcription, translation, GC content, and CYP star-allele phenotyping. Clopidogrel maps to CYP2C19; a poor-metabolizer phenotype predicts reduced antiplatelet activation.
Everything resolves as med.<module>.<fn>() inside a protocol or from Python. Dispatch is allowlisted, so a hostile protocol cannot reach the host filesystem or network.
Deterministic execution, a fully typed event trace, and a non-zero exit on any dose or interaction violation. Install and run your first protocol in under a minute.
moiss run itself calls no model.pip install moisscode and execute locally with moiss run, or import the interpreter into Python. The REST API is optional. Results export to FHIR R4 (Condition, MedicationRequest) or plain JSON for your own pipeline.