Used to create a hierarchical representation of a criteria (e.g., similar to a parse tree).
LogicExpression is an internal representation of the LogicCriteria created through LogicService.
The Logic Service provides a mechanism for both registering and consuming business logic in the form of logic rules.
Base class for all logic rules.
Represents a duration of time — e.g., one year, two weeks, or 18 months.
LogicTransform is internal representation of the transformation applied to the LogicCriteria
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");
Copyright © 2022 OpenMRS Inc.. All rights reserved.