org.openmrs.cohort.impl
Class StaticCohortDefinitionProvider

java.lang.Object
  extended by org.openmrs.cohort.impl.StaticCohortDefinitionProvider
All Implemented Interfaces:
CohortDefinitionProvider

Deprecated. see reportingcompatibility module

@Deprecated
public class StaticCohortDefinitionProvider
extends java.lang.Object
implements CohortDefinitionProvider

This class provides access to Cohort objects that are saved in the cohort table, but exposes them as CohortDefinition The evaluate(CohortDefinition, EvaluationContext) method does not set links to the CohortDefinition or EvaluationContext in the cohort that it returns. Those are not meaningful in the context of a static cohort, and alse because we want to preserve the original CohortDefinition that produced the Cohort that is being wrapped by a StaticCohortDefinition.


Constructor Summary
StaticCohortDefinitionProvider()
          Deprecated.  
 
Method Summary
 Cohort evaluate(CohortDefinition cohortDefinition, EvaluationContext evaluationContext)
          Deprecated. Note that this method does *not* set a CohortDefinition or EvaluationContext in the Cohort that it returns, although that Cohort may have had those properties set when it was originally evaluated.
 java.util.List<CohortDefinitionItemHolder> getAllCohortDefinitions()
          Deprecated.  
 java.lang.Class<? extends CohortDefinition> getClassHandled()
          Deprecated. TODO: this is potentially not necessary because its set via spring's application context
 CohortDefinition getCohortDefinition(java.lang.Integer id)
          Deprecated.  
 void purgeCohortDefinition(CohortDefinition cohortDefinition)
          Deprecated. Deletes a cohort definition from the database.
 CohortDefinition saveCohortDefinition(CohortDefinition cohortDefinition)
          Deprecated. Creates or updates a CohortDefinition in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticCohortDefinitionProvider

public StaticCohortDefinitionProvider()
Deprecated. 
Method Detail

getClassHandled

public java.lang.Class<? extends CohortDefinition> getClassHandled()
Deprecated. 
Description copied from interface: CohortDefinitionProvider
TODO: this is potentially not necessary because its set via spring's application context

Specified by:
getClassHandled in interface CohortDefinitionProvider
Returns:
all the classes that this provider is capable of evaluating or persisting
See Also:
CohortDefinitionProvider.getClassHandled()

evaluate

public Cohort evaluate(CohortDefinition cohortDefinition,
                       EvaluationContext evaluationContext)
Deprecated. 
Note that this method does *not* set a CohortDefinition or EvaluationContext in the Cohort that it returns, although that Cohort may have had those properties set when it was originally evaluated.

Specified by:
evaluate in interface CohortDefinitionProvider
Parameters:
cohortDefinition - CohortDefinition to evaluate
evaluationContext - context to use during evaluation
Returns:
the cohort of all patients who meet the definition now
See Also:
CohortDefinitionProvider.evaluate(org.openmrs.cohort.CohortDefinition, org.openmrs.report.EvaluationContext)

getAllCohortDefinitions

public java.util.List<CohortDefinitionItemHolder> getAllCohortDefinitions()
Deprecated. 
Specified by:
getAllCohortDefinitions in interface CohortDefinitionProvider
Returns:
All cohort definitions whose persistence is managed by this provider
See Also:
CohortDefinitionProvider.getAllCohortDefinitions()

getCohortDefinition

public CohortDefinition getCohortDefinition(java.lang.Integer id)
Deprecated. 
Specified by:
getCohortDefinition in interface CohortDefinitionProvider
Returns:
the cohort definition with the given id, of the type whose persistence is managed by this class
See Also:
CohortDefinitionProvider.getCohortDefinition(java.lang.Integer)

purgeCohortDefinition

public void purgeCohortDefinition(CohortDefinition cohortDefinition)
Deprecated. 
Description copied from interface: CohortDefinitionProvider
Deletes a cohort definition from the database. CohortService ensures that this method is only called with a CohortDefinition of a class this provider is registered for.

Specified by:
purgeCohortDefinition in interface CohortDefinitionProvider
See Also:
CohortDefinitionProvider.purgeCohortDefinition(org.openmrs.cohort.CohortDefinition)

saveCohortDefinition

public CohortDefinition saveCohortDefinition(CohortDefinition cohortDefinition)
Deprecated. 
Description copied from interface: CohortDefinitionProvider
Creates or updates a CohortDefinition in the database. CohortService ensures that this method is only called with a CohortDefinition of a class this provider is registered for.

Specified by:
saveCohortDefinition in interface CohortDefinitionProvider
Returns:
the CohortDefinition that was passed in
See Also:
CohortDefinitionProvider.saveCohortDefinition(org.openmrs.cohort.CohortDefinition)

OpenMRS-1.7.x

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