public class CohortServiceImpl extends BaseOpenmrsService implements CohortService
| Constructor and Description |
|---|
CohortServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Cohort |
addPatientToCohort(Cohort cohort,
Patient patient)
Adds a new patient to a Cohort.
|
Cohort |
createCohort(Cohort cohort)
Deprecated.
|
Cohort |
evaluate(CohortDefinition definition,
EvaluationContext evalContext)
Deprecated.
see reportingcompatibility module
|
List<CohortDefinitionItemHolder> |
getAllCohortDefinitions()
Deprecated.
see reportingcompatibility module
|
List<Cohort> |
getAllCohorts()
Gets all Cohorts (not including voided ones)
|
List<Cohort> |
getAllCohorts(boolean includeVoided)
Gets all Cohorts, possibly including the voided ones
|
CohortDefinition |
getAllPatientsCohortDefinition()
Deprecated.
see reportingcompatibility module
|
Cohort |
getCohort(Integer id)
Gets a Cohort by its database primary key
|
Cohort |
getCohort(String name)
Gets a non voided Cohort by its name
|
Cohort |
getCohortByUuid(String uuid)
Get Cohort by its UUID
|
CohortDefinition |
getCohortDefinition(Class<CohortDefinition> clazz,
Integer id)
Deprecated.
see reportingcompatibility module
|
CohortDefinition |
getCohortDefinition(String key)
Deprecated.
see reportingcompatibility module
|
Map<Class<? extends CohortDefinition>,CohortDefinitionProvider> |
getCohortDefinitionProviders()
Deprecated.
see reportingcompatibility module
|
List<CohortDefinitionItemHolder> |
getCohortDefinitions(Class providerClass)
Deprecated.
see reportingcompatibility module
|
List<Cohort> |
getCohorts()
Deprecated.
|
List<Cohort> |
getCohorts(String nameFragment)
Returns Cohorts whose names match the given string.
|
List<Cohort> |
getCohortsContainingPatient(Patient patient)
Find all Cohorts that contain the given patient.
|
List<Cohort> |
getCohortsContainingPatientId(Integer patientId)
Find all Cohorts that contain the given patientId.
|
void |
onShutdown()
Clean up after this class.
|
Cohort |
purgeCohort(Cohort cohort)
Completely removes a Cohort from the database (not reversible)
|
void |
purgeCohortDefinition(CohortDefinition definition)
Deprecated.
see reportingcompatibility module
|
void |
registerCohortDefinitionProvider(Class<? extends CohortDefinition> defClass,
CohortDefinitionProvider cohortDefProvider)
Deprecated.
see reportingcompatibility module
|
void |
removeCohortDefinitionProvider(Class<? extends CohortDefinitionProvider> providerClass)
Deprecated.
see reportingcompatibility module
|
Cohort |
removePatientFromCohort(Cohort cohort,
Patient patient)
Removes a patient from a Cohort.
|
Cohort |
saveCohort(Cohort cohort)
Save a cohort to the database (create if new, or update if changed) This method will throw an
exception if any patientIds in the Cohort don't exist.
|
CohortDefinition |
saveCohortDefinition(CohortDefinition definition)
Deprecated.
see reportingcompatibility module
|
void |
setCohortDAO(CohortDAO dao)
Sets the CohortDAO for this service to use
|
void |
setCohortDefinitionProviders(Map<Class<? extends CohortDefinition>,CohortDefinitionProvider> providerClassMap)
Deprecated.
see reportingcompatibility module
|
Cohort |
updateCohort(Cohort cohort)
Deprecated.
|
Cohort |
voidCohort(Cohort cohort,
String reason)
Voids the given cohort, deleting it from the perspective of the typical end user.
|
onStartupclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonStartuppublic void setCohortDAO(CohortDAO dao)
CohortServicesetCohortDAO in interface CohortServiceCohortService.setCohortDAO(org.openmrs.api.db.CohortDAO)public void onShutdown()
onShutdown in interface OpenmrsServiceonShutdown in class BaseOpenmrsServiceBaseOpenmrsService.onShutdown()public Cohort saveCohort(Cohort cohort) throws APIException
CohortServicesaveCohort in interface CohortServicecohort - the cohort to be saved to the databaseAPIExceptionCohortService.saveCohort(org.openmrs.Cohort)public Cohort createCohort(Cohort cohort)
createCohort in interface CohortServiceCohortService.createCohort(org.openmrs.Cohort)public Cohort getCohort(Integer id)
CohortServicegetCohort in interface CohortServiceCohortService.getCohort(java.lang.Integer)public List<Cohort> getCohorts()
getCohorts in interface CohortServiceCohortService.getCohorts()public Cohort voidCohort(Cohort cohort, String reason)
CohortServicevoidCohort in interface CohortServicecohort - the cohort to deletereason - the reason this cohort is being retiredCohortService.voidCohort(org.openmrs.Cohort, java.lang.String)public Cohort getCohortByUuid(String uuid)
CohortServicegetCohortByUuid in interface CohortServiceCohortService.getCohortByUuid(java.lang.String)public Cohort addPatientToCohort(Cohort cohort, Patient patient)
CohortServiceaddPatientToCohort in interface CohortServicecohort - the cohort to receive the given patientpatient - the patient to insert into the cohortCohortService.addPatientToCohort(org.openmrs.Cohort,
org.openmrs.Patient)public Cohort removePatientFromCohort(Cohort cohort, Patient patient)
CohortServiceremovePatientFromCohort in interface CohortServicecohort - the cohort containing the given patientpatient - the patient to remove from the given cohortCohortService.removePatientFromCohort(org.openmrs.Cohort,
org.openmrs.Patient)public Cohort updateCohort(Cohort cohort)
updateCohort in interface CohortServiceCohortService.updateCohort(org.openmrs.Cohort)public List<Cohort> getCohortsContainingPatient(Patient patient)
CohortServicegetCohortsContainingPatient in interface CohortServiceCohortService.getCohortsContainingPatient(org.openmrs.Patient)public List<Cohort> getCohortsContainingPatientId(Integer patientId)
CohortServicegetCohortsContainingPatientId in interface CohortServicepublic List<Cohort> getCohorts(String nameFragment) throws APIException
CohortServicegetCohorts in interface CohortServiceAPIExceptionCohortService.getCohorts(java.lang.String)public List<Cohort> getAllCohorts() throws APIException
CohortServicegetAllCohorts in interface CohortServiceAPIExceptionCohortService.getAllCohorts()public List<Cohort> getAllCohorts(boolean includeVoided) throws APIException
CohortServicegetAllCohorts in interface CohortServiceincludeVoided - whether or not to include voided CohortsAPIExceptionCohortService.getAllCohorts(boolean)public Cohort getCohort(String name) throws APIException
CohortServicegetCohort in interface CohortServiceAPIExceptionCohortService.getCohort(java.lang.String)public Cohort purgeCohort(Cohort cohort) throws APIException
CohortServicepurgeCohort in interface CohortServicecohort - the Cohort to completely remove from the databaseAPIExceptionCohortService.purgeCohort(org.openmrs.Cohort)@Deprecated public Cohort evaluate(CohortDefinition definition, EvaluationContext evalContext) throws APIException
CohortServiceevaluate in interface CohortServiceAPIExceptionCohortService.evaluate(org.openmrs.cohort.CohortDefinition,
org.openmrs.report.EvaluationContext)@Deprecated public CohortDefinition getAllPatientsCohortDefinition()
getAllPatientsCohortDefinition in interface CohortServiceCohortService.getAllPatientsCohortDefinition()@Deprecated public CohortDefinition getCohortDefinition(Class<CohortDefinition> clazz, Integer id)
getCohortDefinition in interface CohortServiceCohortService.getCohortDefinition(java.lang.Class, java.lang.Integer)@Deprecated public CohortDefinition getCohortDefinition(String key)
getCohortDefinition in interface CohortServiceCohortService.getCohortDefinition(java.lang.String)@Deprecated public List<CohortDefinitionItemHolder> getAllCohortDefinitions()
CohortServicegetAllCohortDefinitions in interface CohortServiceCohortService.getAllCohortDefinitions()@Deprecated public void purgeCohortDefinition(CohortDefinition definition)
purgeCohortDefinition in interface CohortServiceCohortService.purgeCohortDefinition(org.openmrs.cohort.CohortDefinition)@Deprecated public void setCohortDefinitionProviders(Map<Class<? extends CohortDefinition>,CohortDefinitionProvider> providerClassMap)
CohortServiceproviderClassMap are added to the
already set list of providers. This allows multiple Spring application context files to call
this method with their own providerssetCohortDefinitionProviders in interface CohortServiceproviderClassMap - mapping from CohortDefinition to its providerCohortService.setCohortDefinitionProviders(Map)@Deprecated public Map<Class<? extends CohortDefinition>,CohortDefinitionProvider> getCohortDefinitionProviders()
CohortServicegetCohortDefinitionProviders in interface CohortServiceCohortService.getCohortDefinitionProviders()@Deprecated public void registerCohortDefinitionProvider(Class<? extends CohortDefinition> defClass, CohortDefinitionProvider cohortDefProvider) throws APIException
CohortServiceregisterCohortDefinitionProvider in interface CohortServicedefClass - the type of cohort definition that this provider works oncohortDefProvider - the providerAPIExceptionCohortService.registerCohortDefinitionProvider(Class,
CohortDefinitionProvider)@Deprecated public void removeCohortDefinitionProvider(Class<? extends CohortDefinitionProvider> providerClass)
CohortServiceproviderClass is the
CohortDefinitionProviderremoveCohortDefinitionProvider in interface CohortServiceproviderClass - the provider to removeCohortService.removeCohortDefinitionProvider(java.lang.Class)@Deprecated public CohortDefinition saveCohortDefinition(CohortDefinition definition) throws APIException
saveCohortDefinition in interface CohortServiceAPIExceptionCohortService.saveCohortDefinition(org.openmrs.cohort.CohortDefinition)@Deprecated public List<CohortDefinitionItemHolder> getCohortDefinitions(Class providerClass)
getCohortDefinitions in interface CohortServiceCohortService.getCohortDefinitions(java.lang.Class)Copyright © 2018 OpenMRS LLC.. All Rights Reserved.