@Entity public class PatientState extends BaseFormRecordableOpenmrsData implements Serializable, Comparable<PatientState>
| Modifier and Type | Field and Description | 
|---|---|
static long | 
serialVersionUID  | 
FORM_NAMESPACE_PATH_MAX_LENGTH, FORM_NAMESPACE_PATH_SEPARATOR, formNamespaceAndPathcreator| Constructor and Description | 
|---|
PatientState()
Default Constructor 
 | 
PatientState(Integer patientStateId)
Constructor with id 
 | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
compareTo(PatientState o)
Compares by startDate with null as earliest and endDate with null as latest. 
 | 
PatientState | 
copy()
Does a shallow copy of this PatientState. 
 | 
protected PatientState | 
copyHelper(PatientState target)
The purpose of this method is to allow subclasses of PatientState to delegate a portion of
 their copy() method back to the superclass, in case the base class implementation changes. 
 | 
boolean | 
getActive()
Returns true if this  
PatientState is currently active | 
boolean | 
getActive(Date onDate)
Returns true if this  
PatientState is active as of the passed Date | 
Encounter | 
getEncounter()  | 
Date | 
getEndDate()  | 
Integer | 
getId()  | 
PatientProgram | 
getPatientProgram()  | 
Integer | 
getPatientStateId()  | 
Date | 
getStartDate()  | 
ProgramWorkflowState | 
getState()  | 
void | 
setEncounter(Encounter encounter)  | 
void | 
setEndDate(Date endDate)  | 
void | 
setId(Integer id)  | 
void | 
setPatientProgram(PatientProgram patientProgram)  | 
void | 
setPatientStateId(Integer patientStatusId)  | 
void | 
setStartDate(Date startDate)  | 
void | 
setState(ProgramWorkflowState state)  | 
String | 
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
 uuid=...} 
 | 
getFormFieldNamespace, getFormFieldNamespace, getFormFieldPath, getFormFieldPath, getFormNamespaceAndPath, getFormNamespaceAndPath, setFormField, setFormNamespaceAndPathgetChangedBy, getCreator, getDateChanged, getDateCreated, getDateVoided, getVoided, getVoidedBy, getVoidReason, isVoided, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateVoided, setVoided, setVoidedBy, setVoidReasonequals, getUuid, hashCode, setUuidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetUuid, setUuidpublic static final long serialVersionUID
public PatientState()
public PatientState(Integer patientStateId)
public PatientState copy()
protected PatientState copyHelper(PatientState target)
target - a PatientState that will have the state of this copied into itpublic boolean getActive(Date onDate)
PatientState is active as of the passed DateonDate - - Date to check for PatientState enrollmentPatientState is active as of the passed Date
 Should return false if voided and date in range
 Should return false if voided and date not in range
 Should return true if not voided and date in range
 Should return false if not voided and date earlier than startDate
 Should return false if not voided and date later than endDate
 Should return true if not voided and date in range with null startDate
 Should return true if not voided and date in range with null endDate
 Should return true if not voided and both startDate and endDate nulled
 Should compare with current date if date nullpublic boolean getActive()
PatientState is currently activePatientState is currently activepublic String toString()
BaseOpenmrsObjectClassName{hashCode=..., uuid=...}
 If the uuid field is null, it returns: 
ClassName{hashCode=...}Should include hashCode if uuid is null Should include uuid if not null
toString in class BaseOpenmrsObjectObject.toString()public PatientProgram getPatientProgram()
public void setPatientProgram(PatientProgram patientProgram)
public Integer getPatientStateId()
public void setPatientStateId(Integer patientStatusId)
public ProgramWorkflowState getState()
public void setState(ProgramWorkflowState state)
public Date getEndDate()
public void setEndDate(Date endDate)
public Date getStartDate()
public void setStartDate(Date startDate)
public Encounter getEncounter()
public void setEncounter(Encounter encounter)
encounter - - the encounter 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)public int compareTo(PatientState o)
compareTo in interface Comparable<PatientState>Should return positive if startDates equal and this endDate null
 Should return negative if this startDate null
 Should pass if two states have the same start date, end date and uuid
 Should return positive or negative if two states have the same start date and end date but different uuids
 Note: this comparator imposes orderings that are inconsistent with equals.Copyright © 2024 OpenMRS Inc.. All rights reserved.