Skip to main content

MOISSCode vs Raw Python

MOISSCode provides clinical infrastructure that would take thousands of lines to build from scratch in Python. Here is a direct comparison across common clinical computing tasks.

Professional Use

MOISSCode is professional biomedical software. All clinical outputs require independent professional validation.

Drug Dose Validation

Raw Python (you build everything):

# You need to maintain your own drug database
VANCOMYCIN = {
"standard_dose_mg_per_kg": 15,
"max_dose_mg": 2000,
"min_dose_mg": 500,
"renal_adjust": True,
"interactions": {"Aminoglycosides": "nephrotoxicity"}
}

def validate_vancomycin(dose_mg, weight_kg, gfr=None):
dose_per_kg = dose_mg / weight_kg
if dose_mg > VANCOMYCIN["max_dose_mg"]:
return {"safe": False, "reason": "exceeds max"}
if dose_mg < VANCOMYCIN["min_dose_mg"]:
return {"safe": False, "reason": "below min"}
if gfr and gfr < 30:
return {"safe": False, "reason": "renal adjustment needed"}
return {"safe": True}

# Now repeat for 100+ drugs...

MOISSCode (built in):

from moisscode import PharmacokineticEngine

pk = PharmacokineticEngine()
result = pk.validate_dose("Vancomycin", 1.0, "g")
# Works for all 100+ drugs immediately
# Includes unit conversion, renal/hepatic adjustments, interaction checking

What you save: 100+ drug profiles already validated. Unit conversion logic. Interaction databases. Renal and hepatic adjustment algorithms.


Lab Interpretation

Raw Python:

def interpret_wbc(value):
if value < 4.0:
return "LOW"
elif value > 11.0:
return "HIGH"
else:
return "NORMAL"

# Add critical ranges, panic values, age adjustments, sex adjustments...
# Repeat for 80+ lab tests across 15 panels...

MOISSCode:

from moisscode import LabEngine

lab = LabEngine()
result = lab.interpret("WBC", 18.5)
# Returns: status, flag, reference range, critical alerts, panel info
# Works for all 80+ tests with panic values and clinical context

What you save: 80+ test reference ranges with critical/panic thresholds. Age and sex adjusted values. Panel groupings. GFR calculation (CKD-EPI 2021). ABG interpretation.


Clinical Scoring

Raw Python:

def qsofa(sbp, rr, gcs):
score = 0
if sbp <= 100: score += 1
if rr >= 22: score += 1
if gcs < 15: score += 1
return score

def sofa(pao2_fio2, platelets, bilirubin, map_val, gcs, creatinine):
# 6 organ systems, each with 4 severity tiers
# 50+ lines of scoring logic
pass

# Repeat for NEWS2, MELD, CHA2DS2-VASc, HEART, Framingham,
# Child-Pugh, CURB-65, Wells PE, Glasgow-Blatchford, KDIGO, APACHE II...

MOISSCode:

from moisscode import ClinicalScores, Patient

scores = ClinicalScores()
p = Patient(bp=85, rr=24, gcs=14, lactate=3.2)

qsofa = scores.qsofa(p) # 0-3
sofa = scores.sofa(p) # 0-24
news = scores.news2(p) # 0-20
meld = scores.meld(p) # 6-40
# 13 validated scoring systems, all using the same Patient object

What you save: 13 validated scoring systems. Consistent Patient interface. Risk stratification built in.


Lines of Code Comparison

TaskRaw PythonMOISSCode
Validate 1 drug dose~30 lines3 lines
Validate 100 drugs~3,000 lines3 lines
Interpret 1 lab test~15 lines2 lines
Interpret 80 lab tests~1,200 lines2 lines
Calculate qSOFA~8 lines2 lines
13 clinical scores~600 lines2 lines each
FHIR Patient resource~40 lines1 line
Drug interaction check~50 lines per pair2 lines
Full sepsis screening~200 lines15 lines (DSL)

When to Use Raw Python Instead

MOISSCode is optimized for clinical decision support workflows. For general purpose tasks (web scraping, ML training, data visualization), use Python directly. MOISSCode modules integrate with the broader Python ecosystem, so you can combine both approaches:

import matplotlib.pyplot as plt
from moisscode import PharmacokineticEngine

pk = PharmacokineticEngine()
times = range(0, 720, 10)
concentrations = [pk.plasma_concentration("Vancomycin", 1000, t, 70) for t in times]

plt.plot(times, concentrations)
plt.xlabel("Time (min)")
plt.ylabel("Plasma Concentration")
plt.title("Vancomycin Pharmacokinetics")
plt.show()

See Also