public class Cohort extends BaseOpenmrsData implements java.io.Serializable
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 FormModifier and Type | Field and Description |
---|---|
static long |
serialVersionUID |
creator
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
void |
addMember(java.lang.Integer memberId) |
boolean |
contains(java.lang.Integer patientId) |
boolean |
contains(Patient patient) |
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() |
static Cohort |
intersect(Cohort a,
Cohort b)
Returns the intersection of two cohorts, treating null as an empty cohort
|
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()
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
|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public static final long serialVersionUID
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.
public java.lang.String getCommaSeparatedPatientIds()
public boolean contains(Patient patient)
public boolean contains(java.lang.Integer patientId)
public java.lang.String toString()
BaseOpenmrsObject
uuid
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 BaseOpenmrsObject
Object.toString()
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 Cohortpublic static Cohort intersect(Cohort a, Cohort b)
a
- The first Cohortb
- The second Cohortpublic static Cohort subtract(Cohort a, Cohort b)
a
- the original Cohortb
- the Cohort to subtractpublic 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)
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.