Logic Service

The OpenMRS logic service not only provides an engine to perform sophisticated calculations (logical rules) and return their results, but also provides a single, unified method for obtaining data from OpenMRS -- i.e., data can be exposed through simple token references that obviate the need to know whether data are being directly obtained from the database or through complicated derivations.  For example, you could use the logic service to evaluate GENDER, CD4 COUNT, or CARDIAC RISK: in the case of gender, the gender is simply pulled directly from the person table; for the CD4 count, a list of observations are returned; and, in the final case, a complicated business rule is performed to determine the result.

Much of the implementation of logic is currently housed within a Logic Module, not for the typical reason of supporting multiple implementations of the logic service, but rather to allow the bulk of logic service features to be developed & evolve at a pace distinct from the rest of the OpenMRS code base -- i.e., we may have multiple iterations of logic service improvements between OpenMRS releases.  OpenMRS cannot run without a logic service implementation; therefore, the logic module is a core module, meaning that it is distributed with OpenMRS and required for OpenMRS to run.