org.openmrs.report
Class EvaluationContext

java.lang.Object
  extended by org.openmrs.report.EvaluationContext

Deprecated. see reportingcompatibility module

@Deprecated
public class EvaluationContext
extends java.lang.Object

The EvaluationContext provides the following capabilities: - A baseCohort, i.e. the universe of patients relevant to this context (defaults to all patients) - An in-memory cache which can be used to persist and retrieve objects. Note that this cache is cleared whenever any changes are made to baseCohort or any parameter values. - Capabilities to add, remove, and retrieve parameter values - Capabilities to evaluate parametric expressions, e.g. ${someDateParameterName+30d}


Field Summary
static java.util.regex.Pattern DATE_OPERATION_PATTERN
          Deprecated.  
static java.lang.String END_OF_EXPRESSION
          Deprecated.  
protected  org.apache.commons.logging.Log log
          Deprecated.  
static java.lang.String START_OF_EXPRESSION
          Deprecated.  
 
Constructor Summary
EvaluationContext()
          Deprecated.  
 
Method Summary
 void addParameterValue(Parameterizable obj, Parameter parameter, java.lang.Object value)
          Deprecated. Add a parameter to the context with the given value in the scope of the passed Parameterizable object
 void addParameterValue(Parameter parameter, java.lang.Object value)
          Deprecated. Add a parameter to the context with the given value with global scope
 void addToCache(java.lang.String key, java.lang.Object value)
          Deprecated. Add a value to the cache with a given key
 void clearCache()
          Deprecated. Clear the entire cache
 java.lang.Object evaluateExpression(java.lang.String expression)
          Deprecated. This method will parse the passed expression and return a value based on the following criteria:
Any string that matches a parameter within the EvaluationContext will be replaced by the value of that parameter ** CURRENTLY REPLACEMENT PARAMETERS MUST EXIST IN THE GLOBAL SCOPE If this date is followed by an expression, it will attempt to evaluate this by incrementing/decrementing days/weeks/months/years as specified Examples: Given 2 parameters: report.startDate = java.util.Date with value of [2007-01-10] report.gender = "male" The following should result:

 Cohort getBaseCohort()
          Deprecated.  
 java.util.Map<java.lang.String,java.lang.Object> getCache()
          Deprecated. Get the cache property
 java.lang.Object getFromCache(java.lang.String key)
          Deprecated. Retrieve an entry from the cached with the given key
 Parameter getParameter(Parameterizable obj, java.lang.String parameterName)
          Deprecated. Retrieve a Parameter by Name.
 java.lang.Object getParameter(java.lang.String parameterName)
          Deprecated. Retrieve Parameter from Global Scope only.
 java.lang.Object getParameterValue(Parameter parameter)
          Deprecated. Retrieve parameter value in Global Scope only.
 java.lang.Object getParameterValue(Parameterizable obj, Parameter parameter)
          Deprecated. Retrieve parameter value by Parameter.
 java.lang.Object getParameterValue(Parameterizable obj, java.lang.String parameterName)
          Deprecated. Retrieve parameter value by parameter name.
 java.lang.Object getParameterValue(java.lang.String parameterName)
          Deprecated. Retrieve global parameter value by name
 java.util.Map<Parameterizable,java.util.Map<Parameter,java.lang.Object>> getParameterValues()
          Deprecated. Retrieve all parameter values
 boolean isCached(java.lang.String key)
          Deprecated. Return true if a cache entry exists with the given key
static boolean isExpression(java.lang.String s)
          Deprecated.  
 void removeFromCache(java.lang.String key)
          Deprecated. Remove an entry cached with the given key
 void setBaseCohort(Cohort baseCohort)
          Deprecated.  
 void setCache(java.util.Map<java.lang.String,java.lang.Object> cache)
          Deprecated. Set the cache property
 void setParameterValues(java.util.Map<Parameterizable,java.util.Map<Parameter,java.lang.Object>> parameterValues)
          Deprecated. Set all parameter values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected org.apache.commons.logging.Log log
Deprecated. 

START_OF_EXPRESSION

public static final java.lang.String START_OF_EXPRESSION
Deprecated. 
See Also:
Constant Field Values

END_OF_EXPRESSION

public static final java.lang.String END_OF_EXPRESSION
Deprecated. 
See Also:
Constant Field Values

DATE_OPERATION_PATTERN

public static final java.util.regex.Pattern DATE_OPERATION_PATTERN
Deprecated. 
Constructor Detail

EvaluationContext

public EvaluationContext()
Deprecated. 
Method Detail

isExpression

public static boolean isExpression(java.lang.String s)
Deprecated. 

getCache

public java.util.Map<java.lang.String,java.lang.Object> getCache()
Deprecated. 
Get the cache property

Returns:
Map

setCache

public void setCache(java.util.Map<java.lang.String,java.lang.Object> cache)
Deprecated. 
Set the cache property

Parameters:
cache -

addToCache

public void addToCache(java.lang.String key,
                       java.lang.Object value)
Deprecated. 
Add a value to the cache with a given key


removeFromCache

public void removeFromCache(java.lang.String key)
Deprecated. 
Remove an entry cached with the given key

Parameters:
key -

getFromCache

public java.lang.Object getFromCache(java.lang.String key)
Deprecated. 
Retrieve an entry from the cached with the given key

Parameters:
key -

isCached

public boolean isCached(java.lang.String key)
Deprecated. 
Return true if a cache entry exists with the given key

Parameters:
key -

clearCache

public void clearCache()
Deprecated. 
Clear the entire cache


addParameterValue

public void addParameterValue(Parameter parameter,
                              java.lang.Object value)
Deprecated. 
Add a parameter to the context with the given value with global scope

Parameters:
parameter -
value -

addParameterValue

public void addParameterValue(Parameterizable obj,
                              Parameter parameter,
                              java.lang.Object value)
Deprecated. 
Add a parameter to the context with the given value in the scope of the passed Parameterizable object

Parameters:
obj - Parametrizable object
parameter -
value -

getParameterValues

public java.util.Map<Parameterizable,java.util.Map<Parameter,java.lang.Object>> getParameterValues()
Deprecated. 
Retrieve all parameter values

Returns:
Map

setParameterValues

public void setParameterValues(java.util.Map<Parameterizable,java.util.Map<Parameter,java.lang.Object>> parameterValues)
Deprecated. 
Set all parameter values

Parameters:
parameterValues -

getParameter

public Parameter getParameter(Parameterizable obj,
                              java.lang.String parameterName)
Deprecated. 
Retrieve a Parameter by Name. If a parameterizable is passed in, it will check scope local to the Parameterizable first, and if not found, check global scope It will return null if not found in either scope

Parameters:
obj - Parametrizable object to get from
parameterName -

getParameter

public java.lang.Object getParameter(java.lang.String parameterName)
Deprecated. 
Retrieve Parameter from Global Scope only. It will return null if not found

Parameters:
parameterName - String name for parameter to get

getParameterValue

public java.lang.Object getParameterValue(Parameterizable obj,
                                          Parameter parameter)
Deprecated. 
Retrieve parameter value by Parameter. If a parameterizable is passed in, it will check scope local to the Parameterizable first, and if not found, check global scope It will return null if not found in either scope

Parameters:
obj - Parametrizable object
parameter -

getParameterValue

public java.lang.Object getParameterValue(Parameter parameter)
Deprecated. 
Retrieve parameter value in Global Scope only. It will return null if not found

Parameters:
parameter -

getParameterValue

public java.lang.Object getParameterValue(Parameterizable obj,
                                          java.lang.String parameterName)
Deprecated. 
Retrieve parameter value by parameter name. If a parameterizable is passed in, it will check scope local to the Parameterizable first, and if not found, check global scope It will return null if not found in either scope

Parameters:
obj - Parametrizable object
parameterName - key of the parameter to look for
Returns:
Object value of the parameter named by parameterName

getParameterValue

public java.lang.Object getParameterValue(java.lang.String parameterName)
Deprecated. 
Retrieve global parameter value by name

Parameters:
parameterName - key of the parameter to look for
Returns:
Object value of the parameter named by parameterName

evaluateExpression

public java.lang.Object evaluateExpression(java.lang.String expression)
                                    throws ParameterException
Deprecated. 
This method will parse the passed expression and return a value based on the following criteria:

Parameters:
expression -
Returns:
value for given expression, as an Object
Throws:
ParameterException

getBaseCohort

public Cohort getBaseCohort()
Deprecated. 

setBaseCohort

public void setBaseCohort(Cohort baseCohort)
Deprecated. 

OpenMRS-1.7.x

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