Package org.openmrs.logic.op

Interface Summary
ComparisonOperator Marker interface to keep track of the ComparisonOperator sub type
LogicalOperator Marker for the logical operator
Operand This is a marker interface for things that can be operated on by an Operator in a LogicExpression
Operator An operator used within a logical expression.
TransformOperator Marker for all transform operator.
 

Class Summary
After The After operator works with a date object to tests whether an expression will yield result after a certain date position.

Example:
- logicService.parse("'CD4 COUNT'").after(Context.getDateformat().parse("2009/12/04");
The above will give us a criteria to check if there's "CD4 COUNT" observations after 12/04/2009
And The And operator is a conjunction operator to combine two or more LogicCriteria objects.

Example:
- logicService.parse("'CD4 COUNT'").and(logicService.parse("'WEIGHT (KG)'"));
The above will give us a criteria to check if there's "CD4 COUNT" and "WEIGHT (KG)" observations
AsOf The AsOf operator works with a date object to test whether an expression will yield result after a certain date position

Example:
- logicService.parse("'CD4 COUNT'").asOf(Context.getDateformat().parse("2009/12/04");
The above will give us a criteria to check if there's "CD4 COUNT" observations as of 12/04/2009
Average The Average operator will calculate the average result from a collection of result returned by the logic expression

Example:
- logicService.parse("'CD4 COUNT'").average();
The above will give us a criteria to get the average result of the "CD4 COUNT" observations
Before The Before operator works with a date object to tests whether an expression will yield result before a certain date position.

Example:
- logicService.parse("'CD4 COUNT'").before(Context.getDateformat().parse("2009/12/04");
The above will give us a criteria to check if there's "CD4 COUNT" observations before 12/04/2009
Contains The Contains operator will return results that contains the operand .

Example:
- logicService.parse("EncounterDataSource.ENCOUNTER_KEY").contains("ADULTRETURN");
The above will give us a criteria to check if there's encounter ADULTRETURN for a certain patients
Count The Count operator will return the number of results returned by the logic service

Example:
- logicService.parse("EncounterDataSource.ENCOUNTER_KEY").count();
The above will give us a criteria to get the number of encounter type we have in the system
Distinct The Distinct operator will filter out duplicate results and return a set of distinct results.

Example:
- logicService.parse("EncounterDataSource.ENCOUNTER_KEY").distinct();
The above will give us a criteria to get all distinct encounter type from the system
Equals The Equals operator will test whether a result equals to an operand or not.

Example:
- logicService.parse("EncounterDataSource.ENCOUNTER_KEY").equals("ADULTRETURN");
The above will give us a criteria to get only ADULTRETURN encounters
Exists The Exists operator test whether a criteria will exist for person or not.

Example:
- logicService.parse("EncounterDataSource.ENCOUNTER_KEY").equals("ADULTRETURN").exists();
The above will give us a criteria to test whether ADULTRETURN encounter exists or not
First The First operator will return a subset result of the entire result returned by the criteria

Example:
- logicService.parse("'CD4 COUNT'").first(2);
The above will give us a criteria to get the first two "CD4 COUNT" observations
GreaterThan The GreaterThan operator will return result that have a greater value than the operand.

Example:
- logicService.parse("'CD4 COUNT'").gt(200);
The above will give us a criteria to get the "CD4 COUNT" observations that has the value numeric more than 200
GreaterThanEquals The GreaterThanEquals operator will return result that have a greater value than or equals to the operand.

Example:
- logicService.parse("'CD4 COUNT'").gte(200);
The above will give us a criteria to get the "CD4 COUNT" observations that has the value numeric more than or equals to 200
In The In operator test whether a value is in a collection of value or not.

Example:
Collection answers = Collection.asList("ADULTRETURN");
logicService.parseString(EncounterDataSource.ENCOUNTER_KEY).in(typeNames);
The above criteria will test whether a patient have EncounterType in the list
Last The Last operator will return a subset result of the entire result returned by the criteria.

Example:
- logicService.parse("'CD4 COUNT'").last(2);
The above will give us a criteria to get the last two "CD4 COUNT" observations
LessThan The LessThan operator will return result that have a less value than the operand.

Example:
- logicService.parse("'CD4 COUNT'").gte(200);
The above will give us a criteria to get the "CD4 COUNT" observations that has the value numeric less than 200
LessThanEquals The LessThan operator will return result that have a less value than or equals to the operand.

Example:
- logicService.parse("'CD4 COUNT'").lte(200);
The above will give us a criteria to get the "CD4 COUNT" observations that has the value numeric less than or equals to 200
Not The Not operator will negate the a logic expression
NotExists The NotExists operator test whether a criteria will exist for person or not.

Example:
- logicService.parse("EncounterDataSource.ENCOUNTER_KEY").equals("ADULTRETURN").notExists();
The above will give us a criteria to test whether ADULTRETURN encounter exists or not
Or The Or operator is a disjunction operator to combine two or more LogicCriteria objects.

Example:
- logicService.parse("'CD4 COUNT'").or(logicService.parse("'WEIGHT (KG)'"));
The above will give us a criteria to check if there's "CD4 COUNT" or "WEIGHT (KG)" observations
Within The Within operator tests whether an expression will yield true for a certain time frame.

Example:
- logicService.parse("'CD4 COUNT'").within(Duration.years(2));
The above will give us a criteria to check if there's "CD4 COUNT" observations within the last 2 years
 


OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change