Skip to main content

MOISSCode vs CQL

CQL (Clinical Quality Language) is the HL7 standard for expressing clinical knowledge. MOISSCode is a domain specific language focused on clinical decision support, pharmacokinetics, and biotech workflow automation. Both are clinical DSLs. They serve different use cases.

Professional Use

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

Architecture Comparison

AspectCQLMOISSCode
StandardizationHL7 standard (normative)Independent (BSL 1.1 license)
Primary useQuality measures, clinical rulesProtocol automation, PK simulation
Data modelFHIR, QDMBuilt in Patient type, FHIR export
RuntimeRequires CQL engine (e.g., cql-execution)Self contained interpreter + Python library
Language styleQuery/expression focusedImperative, protocol focused
Built in modulesNone (references external data)20 modules (PK, lab, scores, micro, etc.)
Drug databasesExternal100+ built in drug profiles
Lab interpretationExternal80+ built in tests
PharmacokineticsNot includedFull PK engine with ADME
Python integrationLimitedNative (pip install)
CLIEngine dependentBuilt in (moiss run, moiss repl)

CQL Strengths

CQL is the authoritative standard for clinical quality measures across EHR systems. If you are:

  • Writing eCQMs (electronic Clinical Quality Measures) for CMS reporting
  • Building CDS Hooks for production EHR integration
  • Working within an HL7 FHIR ecosystem that already uses CQL

CQL is the appropriate choice. It has formal specification, vendor adoption, and regulatory acceptance.

MOISSCode Strengths

MOISSCode includes computational engines that CQL does not:

Full pharmacokinetic simulation:

protocol VancomycinDosing {
input: Patient p;

let dose = pk.calculate_dose("Vancomycin", weight_kg: p.weight);
let level = pk.plasma_concentration("Vancomycin", dose: 1000, time_min: 480, weight_kg: p.weight);
let adjustment = pk.renal_adjust("Vancomycin", gfr: 35);

if adjustment.factor < 0.75 {
alert "Significant renal dose reduction required" severity: warning;
}
}

Integrated lab + scoring + dosing pipeline:

from moisscode import StandardLibrary, Patient

lib = StandardLibrary()
p = Patient(bp=82, rr=28, gcs=12, lactate=5.1, creatinine=3.2, sex='M', age=71)

# All in one pipeline
qsofa = lib.scores.qsofa(p)
gfr = lib.lab.gfr(creatinine=3.2, age=71, sex='M')
dose = lib.pk.calculate_dose("Meropenem", weight_kg=80)
renal = lib.pk.renal_adjust("Meropenem", gfr=gfr["eGFR"])
fhir_bundle = lib.fhir.to_fhir(p)

CQL would require external services for each of these lookups. MOISSCode ships everything in one package.

When to Use Which

ScenarioRecommended
CMS quality measure reportingCQL
EHR CDS Hooks integrationCQL
Pharmacokinetic simulationMOISSCode
Research protocol automationMOISSCode
Lab panel interpretation at scaleMOISSCode
Drug interaction screeningMOISSCode
FHIR resource generationEither
Production clinical rules in hospitalsCQL (regulatory path)
Biotech workflow automationMOISSCode
Teaching clinical informaticsMOISSCode (easier syntax)

Interoperability

MOISSCode can export FHIR R4 resources, which means its output can feed into CQL-based systems. The two are complementary: use MOISSCode for computation and simulation, then pass structured FHIR data to CQL-based quality engines.


See Also