|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 FormField Summary | |
---|---|
static long |
serialVersionUID
|
Fields inherited from class org.openmrs.BaseOpenmrsData |
---|
creator |
Constructor Summary | |
---|---|
Cohort()
|
|
Cohort(java.util.Collection patientsOrIds)
This constructor does not check whether the database contains patients with the given ids, but |
|
Cohort(java.lang.Integer cohortId)
Convenience constructor to create a Cohort object that has an primarykey/internal identifier of cohortId |
|
Cohort(java.lang.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(java.lang.String name,
java.lang.String description,
java.util.Collection patientsOrIds)
This constructor does not check whether the database contains patients with the given ids, but |
|
Cohort(java.lang.String name,
java.lang.String description,
java.lang.Integer[] ids)
This constructor does not check whether the database contains patients with the given ids, but |
|
Cohort(java.lang.String name,
java.lang.String description,
Patient[] patients)
This constructor does not check whether the database contains patients with the given ids, but |
Method Summary | |
---|---|
void |
addMember(java.lang.Integer memberId)
|
boolean |
contains(java.lang.Integer patientId)
|
boolean |
contains(Patient patient)
|
boolean |
equals(java.lang.Object obj)
|
CohortDefinition |
getCohortDefinition()
Deprecated. |
java.lang.Integer |
getCohortId()
|
java.lang.String |
getCommaSeparatedPatientIds()
|
java.lang.String |
getDescription()
|
EvaluationContext |
getEvaluationContext()
Deprecated. |
java.lang.Integer |
getId()
|
java.util.Set<java.lang.Integer> |
getMemberIds()
|
java.lang.String |
getName()
|
java.util.Set<java.lang.Integer> |
getPatientIds()
Deprecated. use #getMemberIds() |
int |
getSize()
|
int |
hashCode()
|
static Cohort |
intersect(Cohort a,
Cohort b)
Returns the intersection of two cohorts |
boolean |
isEmpty()
|
void |
removeMember(java.lang.Integer memberId)
|
void |
setCohortDefinition(CohortDefinition cohortDefinition)
Deprecated. |
void |
setCohortId(java.lang.Integer cohortId)
|
void |
setDescription(java.lang.String description)
|
void |
setEvaluationContext(EvaluationContext evaluationContext)
Deprecated. |
void |
setId(java.lang.Integer id)
|
void |
setMemberIds(java.util.Set<java.lang.Integer> memberIds)
|
void |
setName(java.lang.String name)
|
int |
size()
|
static Cohort |
subtract(Cohort a,
Cohort b)
Subtracts a cohort from a cohort |
java.lang.String |
toString()
|
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 |
---|
getUuid, 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(java.lang.Integer cohortId)
cohortId
cohortId
- the internal identifier for this cohortpublic Cohort(java.lang.String name, java.lang.String description, java.lang.Integer[] ids)
name
- description
- optional descriptionids
- option array of Integer idswill.
public Cohort(java.lang.String name, java.lang.String description, Patient[] patients)
name
- description
- optional descriptionpatients
- optional array of patientswill.
public Cohort(java.util.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(java.lang.String name, java.lang.String description, java.util.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(java.lang.String commaSeparatedIds)
commaSeparatedIds
- will.
Method Detail |
---|
public java.lang.String getCommaSeparatedPatientIds()
public boolean contains(Patient patient)
public boolean contains(java.lang.Integer patientId)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void addMember(java.lang.Integer memberId)
public void removeMember(java.lang.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 java.lang.Integer getCohortId()
public void setCohortId(java.lang.Integer cohortId)
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.util.Set<java.lang.Integer> getMemberIds()
public java.util.Set<java.lang.Integer> getPatientIds()
public void setMemberIds(java.util.Set<java.lang.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 java.lang.Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(java.lang.Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
|
OpenMRS-1.7.x | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |