|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmrs.BaseOpenmrsObject
org.openmrs.BaseOpenmrsData
org.openmrs.Cohort
public class Cohort
This class represents a list of patientIds. If it is generated from a CohortDefinition via
ReportService.evaluate(org.openmrs.report.ReportSchema, Cohort, EvaluationContext) then
it will contain a link back to the CohortDefinition it came from and the EvalutionContext that
definition was evaluated in.
CohortDefinition,
Serialized Form| Field Summary | |
|---|---|
static long |
serialVersionUID
|
| Fields inherited from class org.openmrs.BaseOpenmrsData |
|---|
creator |
| Constructor Summary | |
|---|---|
Cohort()
|
|
Cohort(Collection patientsOrIds)
This constructor does not check whether the database contains patients with the given ids, but |
|
Cohort(Integer cohortId)
Convenience constructor to create a Cohort object that has an primarykey/internal identifier of cohortId |
|
Cohort(String commaSeparatedIds)
Convenience contructor taking in a string that is a list of comma separated patient ids This constructor does not check whether the database contains patients with the given ids, but |
|
Cohort(String name,
String description,
Collection patientsOrIds)
This constructor does not check whether the database contains patients with the given ids, but |
|
Cohort(String name,
String description,
Integer[] ids)
This constructor does not check whether the database contains patients with the given ids, but |
|
Cohort(String name,
String description,
Patient[] patients)
This constructor does not check whether the database contains patients with the given ids, but |
|
| Method Summary | |
|---|---|
void |
addMember(Integer memberId)
|
boolean |
contains(Integer patientId)
|
boolean |
contains(Patient patient)
|
CohortDefinition |
getCohortDefinition()
Deprecated. |
Integer |
getCohortId()
|
String |
getCommaSeparatedPatientIds()
|
String |
getDescription()
|
EvaluationContext |
getEvaluationContext()
Deprecated. |
Integer |
getId()
|
Set<Integer> |
getMemberIds()
|
String |
getName()
|
Set<Integer> |
getPatientIds()
Deprecated. use #getMemberIds() |
int |
getSize()
|
static Cohort |
intersect(Cohort a,
Cohort b)
Returns the intersection of two cohorts, treating null as an empty cohort |
boolean |
isEmpty()
|
void |
removeMember(Integer memberId)
|
void |
setCohortDefinition(CohortDefinition cohortDefinition)
Deprecated. |
void |
setCohortId(Integer cohortId)
|
void |
setDescription(String description)
|
void |
setEvaluationContext(EvaluationContext evaluationContext)
Deprecated. |
void |
setId(Integer id)
|
void |
setMemberIds(Set<Integer> memberIds)
|
void |
setName(String name)
|
int |
size()
|
static Cohort |
subtract(Cohort a,
Cohort b)
Subtracts a cohort from a cohort |
String |
toString()
Returns a string consisting of the name of the class of which the object is an instance and the uuid field surrounded by [ and ]. |
static Cohort |
union(Cohort a,
Cohort b)
Returns the union of two cohorts |
| Methods inherited from class org.openmrs.BaseOpenmrsData |
|---|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason |
| Methods inherited from class org.openmrs.BaseOpenmrsObject |
|---|
equals, getUuid, hashCode, setUuid |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.openmrs.OpenmrsObject |
|---|
getUuid, setUuid |
| Field Detail |
|---|
public static final long serialVersionUID
| Constructor Detail |
|---|
public Cohort()
public Cohort(Integer cohortId)
cohortId
cohortId - the internal identifier for this cohort
public Cohort(String name,
String description,
Integer[] ids)
name - description - optional descriptionids - option array of Integer idswill.
public Cohort(String name,
String description,
Patient[] patients)
name - description - optional descriptionpatients - optional array of patientswill.public Cohort(Collection patientsOrIds)
patientsOrIds - optional collection which may contain Patients, or patientIds which may
be Integers, Strings, or anything whose toString() can be parsed to an Integer.will.
public Cohort(String name,
String description,
Collection patientsOrIds)
name - description - optional descriptionpatientsOrIds - optional collection which may contain Patients, or patientIds which may
be Integers, Strings, or anything whose toString() can be parsed to an Integer.will.public Cohort(String commaSeparatedIds)
commaSeparatedIds - will.| Method Detail |
|---|
public String getCommaSeparatedPatientIds()
public boolean contains(Patient patient)
public boolean contains(Integer patientId)
public String toString()
BaseOpenmrsObjectuuid field surrounded by [ and ]. In other words,
this method returns a string equal to the value of: getClass().getName() + '[' + uuid + ']'
If the uuid field is null, it delegates to
Object.toString()
toString in class BaseOpenmrsObjectObject.toString()public void addMember(Integer memberId)
public void removeMember(Integer memberId)
public int size()
public int getSize()
public boolean isEmpty()
public static Cohort union(Cohort a,
Cohort b)
a - The first Cohortb - The second Cohort
public static Cohort intersect(Cohort a,
Cohort b)
a - The first Cohortb - The second Cohort
public static Cohort subtract(Cohort a,
Cohort b)
a - the original Cohortb - the Cohort to subtract
public Integer getCohortId()
public void setCohortId(Integer cohortId)
public String getDescription()
public void setDescription(String description)
public String getName()
public void setName(String name)
public Set<Integer> getMemberIds()
public Set<Integer> getPatientIds()
public void setMemberIds(Set<Integer> memberIds)
@Deprecated public CohortDefinition getCohortDefinition()
@Deprecated public void setCohortDefinition(CohortDefinition cohortDefinition)
cohortDefinition - the cohortDefinition to set@Deprecated public EvaluationContext getEvaluationContext()
@Deprecated public void setEvaluationContext(EvaluationContext evaluationContext)
evaluationContext - the evaluationContext to setpublic Integer getId()
getId in interface OpenmrsObjectOpenmrsObject.getId()public void setId(Integer id)
setId in interface OpenmrsObjectid - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
|
OpenMRS | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||