org.openmrs.api.db
Interface CohortDAO

All Known Implementing Classes:
HibernateCohortDAO

public interface CohortDAO

Database methods for cohort objects.

See Also:
Cohort, CohortService, Context

Method Summary
 Cohort deleteCohort(Cohort cohort)
          Removes a cohort from the database
 java.util.List<Cohort> getAllCohorts(boolean includeVoided)
          Gets all cohorts in the database
 Cohort getCohort(java.lang.Integer id)
          Finds the cohort with the given primary key
 Cohort getCohort(java.lang.String name)
          Finds a cohort by name
 Cohort getCohortByUuid(java.lang.String uuid)
          Auto generated method comment
 java.util.List<Cohort> getCohorts(java.lang.String nameFragment)
          Finds all Cohorts with matching names
 java.util.List<Cohort> getCohortsContainingPatientId(java.lang.Integer patientId)
          Finds all cohorts that contain the given patientId
 Cohort saveCohort(Cohort cohort)
          Saves a Cohort to the database
 

Method Detail

getCohort

Cohort getCohort(java.lang.Integer id)
                 throws DAOException
Finds the cohort with the given primary key

Parameters:
id -
Returns:
The cohort with the given cohortId, or null if none exists
Throws:
DAOException

getCohort

Cohort getCohort(java.lang.String name)
Finds a cohort by name

Parameters:
name -
Returns:
The Cohort with the given name, or null if none exists

getAllCohorts

java.util.List<Cohort> getAllCohorts(boolean includeVoided)
                                     throws DAOException
Gets all cohorts in the database

Parameters:
includeVoided - whether to include voided cohorts
Returns:
All cohorts in the database, possibly including voided ones
Throws:
DAOException

getCohortsContainingPatientId

java.util.List<Cohort> getCohortsContainingPatientId(java.lang.Integer patientId)
                                                     throws DAOException
Finds all cohorts that contain the given patientId

Parameters:
patientId -
Returns:
List object of matching Cohorts
Throws:
DAOException

saveCohort

Cohort saveCohort(Cohort cohort)
                  throws DAOException
Saves a Cohort to the database

Parameters:
cohort - Cohort to save
Returns:
the saved Cohort
Throws:
DAOException

getCohorts

java.util.List<Cohort> getCohorts(java.lang.String nameFragment)
                                  throws DAOException
Finds all Cohorts with matching names

Parameters:
nameFragment -
Returns:
List object of matching Cohorts
Throws:
DAOException

deleteCohort

Cohort deleteCohort(Cohort cohort)
                    throws DAOException
Removes a cohort from the database

Parameters:
cohort -
Returns:
the deleted Cohort
Throws:
DAOException

getCohortByUuid

Cohort getCohortByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

OpenMRS-1.7.x

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