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
 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

@Transactional(readOnly=true)
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

@Transactional(readOnly=true)
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

@Transactional(readOnly=true)
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

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

Parameters:
patientId -
Returns:
Throws:
DAOException

saveCohort

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

Parameters:
cohort -
Returns:
Throws:
DAOException

getCohorts

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

Parameters:
nameFragment -
Returns:
Throws:
DAOException

deleteCohort

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

Parameters:
cohort -
Returns:
Throws:
DAOException

OpenMRS-trunk

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