org.openmrs.report
Class CohortDataSetDefinition

java.lang.Object
  extended by org.openmrs.report.CohortDataSetDefinition
All Implemented Interfaces:
java.io.Serializable, DataSetDefinition, Parameterizable

public class CohortDataSetDefinition
extends java.lang.Object
implements DataSetDefinition

Metadata that defines a CohortDataSet. (I.e. a list of cohorts, each of which has a name) For example a CohortDatasetDefinition might represent: "1. Total # of Patients" -> (CohortDefinition) everyone "1.a. Male Adults" -> (CohortDefinition) Male AND Adult "1.b. Female Adults" -> (CohortDefinition) Female AND Adult "1.c. Male Children" -> (CohortDefinition) Male AND NOT Adult "1.d. Female Children" -> (CohortDefinition) Female AND NOT Adult ...

See Also:
CohortDataSet, CohortDataSetProvider, Serialized Form

Constructor Summary
CohortDataSetDefinition()
          Default constructor
 
Method Summary
 void addStrategy(java.lang.String name, CohortDefinition cohortDefinition)
          Add the given cohort as a "column" to this definition with the given key.
 void addStrategy(java.lang.String name, java.lang.String description, CohortDefinition cohortDefinition)
          Add the given cohort as a "column" to this definition with the given key and the given description.
 java.util.List<java.lang.Class> getColumnDatatypes()
          Gets a list of the datatype of the columns
 java.util.List<java.lang.String> getColumnKeys()
          Gets a list of column keys.
 java.lang.String getDescription(java.lang.String name)
          Returns a description for the @param cohort strategy name.
 java.util.Map<java.lang.String,java.lang.String> getDescriptions()
          Returns the map of cohort strategy names, descriptions.
 java.lang.String getName()
          Gets the name
 java.util.List<Parameter> getParameters()
          A object that can take parameters should examine itself and its child objects to find out all of its required parameters.
 java.util.Map<java.lang.String,CohortDefinition> getStrategies()
          Get the key-value pairs of names to defined cohorts
 boolean setDescription(java.lang.String name, java.lang.String description)
          Sets a description for the cohort name if it exists.
 void setDescriptions(java.util.Map<java.lang.String,java.lang.String> descriptions)
          Set the key-value pairs of names to cohort descriptions
 void setName(java.lang.String name)
          Sets the name of this data set definition
 void setStrategies(java.util.Map<java.lang.String,CohortDefinition> strategies)
          Set the key-value pairs of names to cohorts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CohortDataSetDefinition

public CohortDataSetDefinition()
Default constructor

Method Detail

addStrategy

public void addStrategy(java.lang.String name,
                        CohortDefinition cohortDefinition)
Add the given cohort as a "column" to this definition with the given key. The name is also added as the description.

Parameters:
name - key to refer by which to refer to this cohort
cohortDefinition - The patients for this column

addStrategy

public void addStrategy(java.lang.String name,
                        java.lang.String description,
                        CohortDefinition cohortDefinition)
Add the given cohort as a "column" to this definition with the given key and the given description.

Parameters:
name -
description -
cohortDefinition -

getColumnKeys

public java.util.List<java.lang.String> getColumnKeys()
Description copied from interface: DataSetDefinition
Gets a list of column keys.

Specified by:
getColumnKeys in interface DataSetDefinition
Returns:
See Also:
DataSetDefinition.getColumnKeys()

getColumnDatatypes

public java.util.List<java.lang.Class> getColumnDatatypes()
Description copied from interface: DataSetDefinition
Gets a list of the datatype of the columns

Specified by:
getColumnDatatypes in interface DataSetDefinition
Returns:
See Also:
DataSetDefinition.getColumnDatatypes()

getName

public java.lang.String getName()
Description copied from interface: DataSetDefinition
Gets the name

Specified by:
getName in interface DataSetDefinition
Returns:
See Also:
DataSetDefinition.getName()

setName

public void setName(java.lang.String name)
Description copied from interface: DataSetDefinition
Sets the name of this data set definition

Specified by:
setName in interface DataSetDefinition
Parameters:
name - the descriptive name of this definition
See Also:
DataSetDefinition.setName(java.lang.String)

getParameters

public java.util.List<Parameter> getParameters()
Description copied from interface: Parameterizable
A object that can take parameters should examine itself and its child objects to find out all of its required parameters. This method should not return null, but should return an empty list if no parameters exist

Specified by:
getParameters in interface Parameterizable
Returns:
list of parameters that will satisfy this object
See Also:
Parameterizable.getParameters()

setDescription

public boolean setDescription(java.lang.String name,
                              java.lang.String description)
Sets a description for the cohort name if it exists. Returns true if a cohort exists with the @param name else returns false.

Parameters:
name -
description -
Returns:

getDescription

public java.lang.String getDescription(java.lang.String name)
Returns a description for the @param cohort strategy name.

Parameters:
name -
Returns:

getDescriptions

public java.util.Map<java.lang.String,java.lang.String> getDescriptions()
Returns the map of cohort strategy names, descriptions.

Returns:

getStrategies

public java.util.Map<java.lang.String,CohortDefinition> getStrategies()
Get the key-value pairs of names to defined cohorts

Returns:

setStrategies

public void setStrategies(java.util.Map<java.lang.String,CohortDefinition> strategies)
Set the key-value pairs of names to cohorts

Parameters:
strategies -

setDescriptions

public void setDescriptions(java.util.Map<java.lang.String,java.lang.String> descriptions)
Set the key-value pairs of names to cohort descriptions

Parameters:
descriptions -

OpenMRS-trunk

Generated May 29 2008 02:01 AM. NOTE - these libraries are in active development and subject to change