@Transactional public interface CohortService extends OpenmrsService
Cohort
,
CohortDefinition
,
CohortDefinitionProvider
Modifier and Type | Method and Description |
---|---|
Cohort |
addPatientToCohort(Cohort cohort,
Patient patient)
Adds a new patient to a Cohort.
|
Cohort |
createCohort(Cohort cohort)
Deprecated.
replaced by saveCohort(Cohort)
|
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 cohortKey)
Deprecated.
see reportingcompatibility module
|
Map<Class<? extends CohortDefinition>,CohortDefinitionProvider> |
getCohortDefinitionProviders()
Deprecated.
see reportingcompatibility module
|
List<CohortDefinitionItemHolder> |
getCohortDefinitions(Class<? extends CohortDefinitionProvider> providerClass)
Deprecated.
see reportingcompatibility module
|
List<Cohort> |
getCohorts()
Deprecated.
replaced by getAllCohorts()
|
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.
|
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> cohortDefClass,
CohortDefinitionProvider cohortDef)
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.
replaced by saveCohort(Cohort)
|
Cohort |
voidCohort(Cohort cohort,
String reason)
Voids the given cohort, deleting it from the perspective of the typical end user.
|
onShutdown, onStartup
void setCohortDAO(CohortDAO dao)
dao
- @Authorized(value={"Add Cohorts","Edit Cohorts"}) Cohort saveCohort(Cohort cohort) throws APIException
cohort
- the cohort to be saved to the databaseAPIException
@Deprecated @Authorized(value="Add Cohorts") Cohort createCohort(Cohort cohort) throws APIException
APIException
saveCohort(Cohort)
@Deprecated @Authorized(value="Edit Cohorts") Cohort updateCohort(Cohort cohort) throws APIException
APIException
saveCohort(Cohort)
@Authorized(value="Delete Cohorts") Cohort voidCohort(Cohort cohort, String reason) throws APIException
cohort
- the cohort to deletereason
- the reason this cohort is being retiredAPIException
Cohort purgeCohort(Cohort cohort) throws APIException
cohort
- the Cohort to completely remove from the databaseAPIException
@Transactional(readOnly=true) @Authorized(value="View Patient Cohorts") Cohort getCohort(Integer id) throws APIException
id
- APIException
@Authorized(value="View Patient Cohorts") Cohort getCohort(String name) throws APIException
name
- APIException
@Authorized(value="View Patient Cohorts") List<Cohort> getAllCohorts() throws APIException
APIException
@Authorized(value="View Patient Cohorts") List<Cohort> getAllCohorts(boolean includeVoided) throws APIException
includeVoided
- whether or not to include voided CohortsAPIException
@Deprecated @Authorized(value="View Patient Cohorts") List<Cohort> getCohorts() throws APIException
APIException
getAllCohorts()
List<Cohort> getCohorts(String nameFragment) throws APIException
nameFragment
- APIException
@Authorized(value="View Patient Cohorts") List<Cohort> getCohortsContainingPatient(Patient patient) throws APIException
patient
- APIException
@Authorized(value="View Patient Cohorts") List<Cohort> getCohortsContainingPatientId(Integer patientId) throws APIException
patientId
- APIException
@Authorized(value="Edit Cohorts") Cohort addPatientToCohort(Cohort cohort, Patient patient) throws APIException
cohort
- the cohort to receive the given patientpatient
- the patient to insert into the cohortAPIException
@Authorized(value="Edit Cohorts") Cohort removePatientFromCohort(Cohort cohort, Patient patient) throws APIException
cohort
- the cohort containing the given patientpatient
- the patient to remove from the given cohortAPIException
@Transactional(readOnly=true) @Deprecated void setCohortDefinitionProviders(Map<Class<? extends CohortDefinition>,CohortDefinitionProvider> providerClassMap) throws APIException
providerClassMap
are added to the
already set list of providers. This allows multiple Spring application context files to call
this method with their own providersproviderClassMap
- mapping from CohortDefinition to its providerAPIException
@Transactional(readOnly=true) @Deprecated void registerCohortDefinitionProvider(Class<? extends CohortDefinition> cohortDefClass, CohortDefinitionProvider cohortDef) throws APIException
cohortDefClass
- the type of cohort definition that this provider works oncohortDef
- the providerAPIException
@Transactional(readOnly=true) @Deprecated Map<Class<? extends CohortDefinition>,CohortDefinitionProvider> getCohortDefinitionProviders() throws APIException
APIException
setCohortDefinitionProviders(Map)
@Transactional(readOnly=true) @Deprecated void removeCohortDefinitionProvider(Class<? extends CohortDefinitionProvider> providerClass) throws APIException
providerClass is the
CohortDefinitionProvider
providerClass
- the provider to removeAPIException
@Transactional(readOnly=true) @Deprecated List<CohortDefinitionItemHolder> getAllCohortDefinitions() throws APIException
APIException
@Transactional(readOnly=true) @Deprecated List<CohortDefinitionItemHolder> getCohortDefinitions(Class<? extends CohortDefinitionProvider> providerClass) throws APIException
APIException
@Transactional(readOnly=true) @Deprecated CohortDefinition getCohortDefinition(Class<CohortDefinition> clazz, Integer id) throws APIException
APIException
@Transactional(readOnly=true) @Deprecated CohortDefinition getCohortDefinition(String cohortKey) throws APIException
APIException
@Transactional(readOnly=true) @Deprecated CohortDefinition saveCohortDefinition(CohortDefinition definition) throws APIException
APIException
@Transactional @Deprecated void purgeCohortDefinition(CohortDefinition definition) throws APIException
APIException
@Transactional(readOnly=true) @Deprecated Cohort evaluate(CohortDefinition definition, EvaluationContext evalContext) throws APIException
definition
- evalContext
- APIException
@Transactional(readOnly=true) @Deprecated CohortDefinition getAllPatientsCohortDefinition() throws APIException
APIException
@Transactional(readOnly=true) @Authorized(value="View Patient Cohorts") Cohort getCohortByUuid(String uuid)
uuid
- Copyright © 2018 OpenMRS LLC.. All Rights Reserved.