org.openmrs.reporting
Class PatientSearch

java.lang.Object
  extended by org.openmrs.reporting.PatientSearch
All Implemented Interfaces:
java.io.Serializable, CohortDefinition, Parameterizable

Deprecated. see reportingcompatibility module

@Deprecated
public class PatientSearch
extends java.lang.Object
implements CohortDefinition

This class represents a search for a set of patients, as entered from a user interface. There are different types of searches:

Composition filters:
When isComposition() returns true, then this represents something like "1 and (2 or 3)", which must be evaluated in the context of a search history.

Saved filters:
When isSavedFilterReference() returns true, then this represents something like "saved filter #8"
When isSavedCohortReference() returns true, then this represents something like "saved cohort #3"

Regular filters:
Otherwise this search describes a PatientFilter subclass and a list of bean-style properties to set, so that it can be turned into a PatientFilter with the utility method OpenmrsUtil.toPatientFilter(PatientSearch). But it can also be left as-is for better version-compatibility if PatientFilter classes change, or to avoid issues with xml-encoding hibernate proxies.

See Also:
Serialized Form

Field Summary
protected static org.apache.commons.logging.Log log
          Deprecated.  
 
Constructor Summary
PatientSearch()
          Deprecated.  
 
Method Summary
 void addArgument(SearchArgument sa)
          Deprecated.  
 void addArgument(java.lang.String name, java.lang.String value, java.lang.Class clz)
          Deprecated.  
 void addParameter(Parameter parameter)
          Deprecated. Adds a SearchArgument as a Parameter where the SearchArgument name is set to the Parameter label and SearchArgument value is set to the Parameter name and SearchArgument propertyClass is set to the Parameter clazz
 CohortHistoryCompositionFilter cloneCompositionAsFilter(CohortSearchHistory history)
          Deprecated. Deep-copies this.parsedComposition, and converts to filters, in the context of history
 CohortHistoryCompositionFilter cloneCompositionAsFilter(CohortSearchHistory history, EvaluationContext evalContext)
          Deprecated. Deep-copies this.parsedComposition, and converts to filters, in the context of history
 PatientSearch copyAndDetachFromHistory(CohortSearchHistory history)
          Deprecated. Creates a copy of this PatientSearch that doesn't depend on history, replacing references with actual PatientSearch elements from the provided history.
static PatientSearch createCompositionSearch(java.util.List<java.lang.Object> tokens)
          Deprecated.  
static PatientSearch createCompositionSearch(java.lang.Object[] tokens)
          Deprecated.  
static PatientSearch createCompositionSearch(java.lang.String description)
          Deprecated.  
static PatientSearch createFilterSearch(java.lang.Class filterClass)
          Deprecated.  
static PatientSearch createSavedCohortReference(int id)
          Deprecated.  
static PatientSearch createSavedFilterReference(int id)
          Deprecated.  
static PatientSearch createSavedSearchReference(int id)
          Deprecated.  
 java.util.List<SearchArgument> getArguments()
          Deprecated.  
 java.lang.String getArgumentValue(java.lang.String name)
          Deprecated. Looks up an argument value, accounting for parameterValues
 java.lang.String getCompositionString()
          Deprecated.  
 java.lang.Class getFilterClass()
          Deprecated.  
 java.util.List<Parameter> getParameters()
          Deprecated. Returns all SearchArgument values that match EvaluationContext.parameterValues
 java.util.List<java.lang.Object> getParsedComposition()
          Deprecated.  
 java.lang.Integer getSavedCohortId()
          Deprecated.  
 java.lang.Integer getSavedFilterId()
          Deprecated.  
 java.lang.Integer getSavedSearchId()
          Deprecated.  
 java.lang.String getSpecificationString()
          Deprecated.  
 boolean isComposition()
          Deprecated.  
 boolean isSavedCohortReference()
          Deprecated.  
 boolean isSavedFilterReference()
          Deprecated.  
 boolean isSavedReference()
          Deprecated.  
 boolean isSavedSearchReference()
          Deprecated.  
 boolean removeFromHistoryNotify(int i)
          Deprecated. Call this to notify this composition search that the _i_th element of the search history has been removed, and the search potentially needs to renumber its constituent parts.
 boolean requiresHistory()
          Deprecated.  
 void setArguments(java.util.List<SearchArgument> arguments)
          Deprecated.  
 void setFilterClass(java.lang.Class clazz)
          Deprecated.  
 void setParameterValue(java.lang.String name, java.lang.String value)
          Deprecated.  
 void setParsedComposition(java.util.List<java.lang.Object> parsedComposition)
          Deprecated. Elements in this list can be: an Integer, indicating a 1-based index into a search history a BooleanOperator (AND, OR, NOT) a PatientFilter a PatientSearch another List of the same form, which indicates a parenthetical expression
 void setSavedCohortId(java.lang.Integer savedCohortId)
          Deprecated.  
 void setSavedFilterId(java.lang.Integer savedFilterId)
          Deprecated.  
 void setSavedSearchId(java.lang.Integer savedSearchId)
          Deprecated.  
 void setSpecificationString(java.lang.String specification)
          Deprecated. Convenience method so that a PatientSearch object can be created from a string of compositions
 java.lang.String toString()
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log
Deprecated. 
Constructor Detail

PatientSearch

public PatientSearch()
Deprecated. 
Method Detail

createSavedSearchReference

public static PatientSearch createSavedSearchReference(int id)
Deprecated. 

createSavedFilterReference

public static PatientSearch createSavedFilterReference(int id)
Deprecated. 

createSavedCohortReference

public static PatientSearch createSavedCohortReference(int id)
Deprecated. 

createCompositionSearch

public static PatientSearch createCompositionSearch(java.lang.String description)
Deprecated. 

createCompositionSearch

public static PatientSearch createCompositionSearch(java.lang.Object[] tokens)
Deprecated. 

createCompositionSearch

public static PatientSearch createCompositionSearch(java.util.List<java.lang.Object> tokens)
Deprecated. 

createFilterSearch

public static PatientSearch createFilterSearch(java.lang.Class filterClass)
Deprecated. 

toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class java.lang.Object

isComposition

public boolean isComposition()
Deprecated. 

getCompositionString

public java.lang.String getCompositionString()
Deprecated. 

setSpecificationString

public void setSpecificationString(java.lang.String specification)
Deprecated. 
Convenience method so that a PatientSearch object can be created from a string of compositions

Parameters:
specification -

getSpecificationString

public java.lang.String getSpecificationString()
Deprecated. 

requiresHistory

public boolean requiresHistory()
Deprecated. 
Returns:
Whether this search requires a history against which to evaluate it

copyAndDetachFromHistory

public PatientSearch copyAndDetachFromHistory(CohortSearchHistory history)
Deprecated. 
Creates a copy of this PatientSearch that doesn't depend on history, replacing references with actual PatientSearch elements from the provided history. The PatientSearch object returned is only a copy when necessary to detach it from history. This method does NOT do a clone.


cloneCompositionAsFilter

public CohortHistoryCompositionFilter cloneCompositionAsFilter(CohortSearchHistory history)
Deprecated. 
Deep-copies this.parsedComposition, and converts to filters, in the context of history


cloneCompositionAsFilter

public CohortHistoryCompositionFilter cloneCompositionAsFilter(CohortSearchHistory history,
                                                               EvaluationContext evalContext)
Deprecated. 
Deep-copies this.parsedComposition, and converts to filters, in the context of history


isSavedReference

public boolean isSavedReference()
Deprecated. 

isSavedSearchReference

public boolean isSavedSearchReference()
Deprecated. 

isSavedFilterReference

public boolean isSavedFilterReference()
Deprecated. 

isSavedCohortReference

public boolean isSavedCohortReference()
Deprecated. 

removeFromHistoryNotify

public boolean removeFromHistoryNotify(int i)
Deprecated. 
Call this to notify this composition search that the _i_th element of the search history has been removed, and the search potentially needs to renumber its constituent parts. Examples, assuming this search is "1 and (4 or 5)": * removeFromHistoryNotify(1) -> This search becomes "1 and (3 or 4)" and the method return false * removeFromHistoryNotify(3) -> This search becomes invalid, and the method returns true * removeFromHistoryNotify(9) -> This search is unaffected, and the method returns false

Returns:
whether or not this search itself should be removed (because it directly references the removed history element

getArgumentValue

public java.lang.String getArgumentValue(java.lang.String name)
Deprecated. 
Looks up an argument value, accounting for parameterValues

Parameters:
name -
Returns:
the String value for the specified argument

getArguments

public java.util.List<SearchArgument> getArguments()
Deprecated. 

setArguments

public void setArguments(java.util.List<SearchArgument> arguments)
Deprecated. 

getParameters

public java.util.List<Parameter> getParameters()
Deprecated. 
Returns all SearchArgument values that match EvaluationContext.parameterValues

Specified by:
getParameters in interface Parameterizable
Returns:
List<Parameter> of all parameters in the arguments

getFilterClass

public java.lang.Class getFilterClass()
Deprecated. 

setFilterClass

public void setFilterClass(java.lang.Class clazz)
Deprecated. 

addArgument

public void addArgument(java.lang.String name,
                        java.lang.String value,
                        java.lang.Class clz)
Deprecated. 

addArgument

public void addArgument(SearchArgument sa)
Deprecated. 

addParameter

public void addParameter(Parameter parameter)
Deprecated. 
Adds a SearchArgument as a Parameter where the SearchArgument name is set to the Parameter label and SearchArgument value is set to the Parameter name and SearchArgument propertyClass is set to the Parameter clazz

Parameters:
parameter -

getParsedComposition

public java.util.List<java.lang.Object> getParsedComposition()
Deprecated. 

setParsedComposition

public void setParsedComposition(java.util.List<java.lang.Object> parsedComposition)
Deprecated. 
Elements in this list can be: an Integer, indicating a 1-based index into a search history a BooleanOperator (AND, OR, NOT) a PatientFilter a PatientSearch another List of the same form, which indicates a parenthetical expression


getSavedSearchId

public java.lang.Integer getSavedSearchId()
Deprecated. 

setSavedSearchId

public void setSavedSearchId(java.lang.Integer savedSearchId)
Deprecated. 

getSavedFilterId

public java.lang.Integer getSavedFilterId()
Deprecated. 

setSavedFilterId

public void setSavedFilterId(java.lang.Integer savedFilterId)
Deprecated. 

getSavedCohortId

public java.lang.Integer getSavedCohortId()
Deprecated. 

setSavedCohortId

public void setSavedCohortId(java.lang.Integer savedCohortId)
Deprecated. 

setParameterValue

public void setParameterValue(java.lang.String name,
                              java.lang.String value)
Deprecated. 

OpenMRS-1.7.x

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