Package org.openmrs.logic

The OpenMRS Logic Service provides access to granular and derived data.

See:
          Description

Interface Summary
LogicService The Logic Service provides a mechanism for both registering and consuming business logic in the form of logic rules.
Rule Base class for all logic rules.
 

Class Summary
Duration Represents a duration of time — e.g., one year, two weeks, or 18 months.
LogicCache A caching mechanism used by LogicContext to avoid recalculating a re-fetching the same results more than once during a single request of the logic service.
LogicContext The context within which logic rule and data source evaluations are made.
LogicCriteria Used to create a hierarchical representation of a criteria (e.g., similar to a parse tree).
RuleFactory A helper class used internally by the logic service to fetch Rules by token and to keep track of tags and tokens assigned to rules.
 

Enum Summary
Duration.Units  
 

Exception Summary
LogicException Logic-specific exception
 

Package org.openmrs.logic Description

The OpenMRS Logic Service provides access to granular and derived data. Medical data is extremely complex. While a dictionary-based system provides tremendous flexibility in collecting data, consuming the data for decision support, reporting, research question, or even for display within the web application can be increasingly difficult. For example, even answering a simple question like "is the patient HIV positive?" may require a complex algorithm that considers the results of multiple lab results, temporal relations of results, orders, and questionnaire responses. Ideally, this "business logic" is defined in one place and easily accessible to all aspects of the system — e.g., whether we're displaying HIV status on a web page, generating a PEPFAR report, or executing a decision support alert, the same algorithm should be used. We call this bit of business knowledge a "rule." Rules should be easily accessible and return predictable and flexible results.

Rules can be fashioned from just about any source, but must compile into a Java class that extends org.openmrs.logic.Rule (@see org.openmrs.logic.Rule).

Data can be obtained from the logic service like this:

Patient myPatient = Context.getPatientService().getPatient(123); LogicService ls = Context.getLogicService(); Result age = ls.eval(myPatient, "AGE");


OpenMRS-trunk

Generated May 29 2008 02:01 AM. NOTE - these libraries are in active development and subject to change