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
|
java.util.List<CohortDefinitionItemHolder> |
getAllCohortDefinitions()
Deprecated.
see reportingcompatibility module
|
java.util.List<Cohort> |
getAllCohorts()
Gets all Cohorts (not including voided ones)
|
java.util.List<Cohort> |
getAllCohorts(boolean includeVoided)
Gets all Cohorts, possibly including the voided ones
|
CohortDefinition |
getAllPatientsCohortDefinition()
Deprecated.
see reportingcompatibility module
|
Cohort |
getCohort(java.lang.Integer id)
Gets a Cohort by its database primary key
|
Cohort |
getCohort(java.lang.String name)
Gets a non voided Cohort by its name
|
Cohort |
getCohortByUuid(java.lang.String uuid)
Get Cohort by its UUID
|
CohortDefinition |
getCohortDefinition(java.lang.Class<CohortDefinition> clazz,
java.lang.Integer id)
Deprecated.
see reportingcompatibility module
|
CohortDefinition |
getCohortDefinition(java.lang.String key)
Deprecated.
see reportingcompatibility module
|
java.util.Map<java.lang.Class<? extends CohortDefinition>,CohortDefinitionProvider> |
getCohortDefinitionProviders()
Deprecated.
see reportingcompatibility module
|
java.util.List<CohortDefinitionItemHolder> |
getCohortDefinitions(java.lang.Class providerClass)
Deprecated.
see reportingcompatibility module
|
java.util.List<Cohort> |
getCohorts()
Deprecated.
|
java.util.List<Cohort> |
getCohorts(java.lang.String nameFragment)
Returns Cohorts whose names match the given string.
|
java.util.List<Cohort> |
getCohortsContainingPatient(Patient patient)
Find all Cohorts that contain the given patient.
|
java.util.List<Cohort> |
getCohortsContainingPatientId(java.lang.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(java.lang.Class<? extends CohortDefinition> defClass,
CohortDefinitionProvider cohortDefProvider)
Deprecated.
see reportingcompatibility module
|
void |
removeCohortDefinitionProvider(java.lang.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(java.util.Map<java.lang.Class<? extends CohortDefinition>,CohortDefinitionProvider> providerClassMap)
Deprecated.
see reportingcompatibility module
|
Cohort |
updateCohort(Cohort cohort)
Deprecated.
|
Cohort |
voidCohort(Cohort cohort,
java.lang.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(java.lang.Integer id)
CohortServicegetCohort in interface CohortServiceCohortService.getCohort(java.lang.Integer)public java.util.List<Cohort> getCohorts()
getCohorts in interface CohortServiceCohortService.getCohorts()public Cohort voidCohort(Cohort cohort, java.lang.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(java.lang.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 java.util.List<Cohort> getCohortsContainingPatient(Patient patient)
CohortServicegetCohortsContainingPatient in interface CohortServiceCohortService.getCohortsContainingPatient(org.openmrs.Patient)public java.util.List<Cohort> getCohortsContainingPatientId(java.lang.Integer patientId)
CohortServicegetCohortsContainingPatientId in interface CohortServicepublic java.util.List<Cohort> getCohorts(java.lang.String nameFragment) throws APIException
CohortServicegetCohorts in interface CohortServiceAPIExceptionCohortService.getCohorts(java.lang.String)public java.util.List<Cohort> getAllCohorts() throws APIException
CohortServicegetAllCohorts in interface CohortServiceAPIExceptionCohortService.getAllCohorts()public java.util.List<Cohort> getAllCohorts(boolean includeVoided) throws APIException
CohortServicegetAllCohorts in interface CohortServiceincludeVoided - whether or not to include voided CohortsAPIExceptionCohortService.getAllCohorts(boolean)public Cohort getCohort(java.lang.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(java.lang.Class<CohortDefinition> clazz, java.lang.Integer id)
getCohortDefinition in interface CohortServiceCohortService.getCohortDefinition(java.lang.Class, java.lang.Integer)@Deprecated public CohortDefinition getCohortDefinition(java.lang.String key)
getCohortDefinition in interface CohortServiceCohortService.getCohortDefinition(java.lang.String)@Deprecated public java.util.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(java.util.Map<java.lang.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 java.util.Map<java.lang.Class<? extends CohortDefinition>,CohortDefinitionProvider> getCohortDefinitionProviders()
CohortServicegetCohortDefinitionProviders in interface CohortServiceCohortService.getCohortDefinitionProviders()@Deprecated public void registerCohortDefinitionProvider(java.lang.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(java.lang.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 java.util.List<CohortDefinitionItemHolder> getCohortDefinitions(java.lang.Class providerClass)
getCohortDefinitions in interface CohortServiceCohortService.getCohortDefinitions(java.lang.Class)Copyright © 2018 OpenMRS Inc.. All Rights Reserved.