org.openmrs
Class PatientState

java.lang.Object
  extended by org.openmrs.BaseOpenmrsObject
      extended by org.openmrs.BaseOpenmrsData
          extended by org.openmrs.PatientState
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<PatientState>, Auditable, OpenmrsData, OpenmrsObject, Voidable

public class PatientState
extends BaseOpenmrsData
implements java.io.Serializable, java.lang.Comparable<PatientState>

PatientState

See Also:
Serialized Form

Field Summary
static long serialVersionUID
           
 
Fields inherited from class org.openmrs.BaseOpenmrsData
creator
 
Constructor Summary
PatientState()
          Default Constructor
PatientState(java.lang.Integer patientStateId)
          Constructor with id
 
Method Summary
 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 equals(java.lang.Object obj)
           
 boolean getActive()
          Returns true if this PatientState is currently active
 boolean getActive(java.util.Date onDate)
          Returns true if this PatientState is active as of the passed Date
 java.util.Date getEndDate()
           
 java.lang.Integer getId()
           
 PatientProgram getPatientProgram()
           
 java.lang.Integer getPatientStateId()
           
 java.util.Date getStartDate()
           
 ProgramWorkflowState getState()
           
 void setEndDate(java.util.Date endDate)
           
 void setId(java.lang.Integer id)
           
 void setPatientProgram(PatientProgram patientProgram)
           
 void setPatientStateId(java.lang.Integer patientStatusId)
           
 void setStartDate(java.util.Date startDate)
           
 void setState(ProgramWorkflowState state)
           
 java.lang.String toString()
           
 
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, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmrs.OpenmrsObject
getUuid, setUuid
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

PatientState

public PatientState()
Default Constructor


PatientState

public PatientState(java.lang.Integer patientStateId)
Constructor with id

Method Detail

copy

public PatientState copy()
Does a shallow copy of this PatientState. Does NOT copy patientStateId

Returns:
a copy of this PatientState

copyHelper

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.

Parameters:
target - a PatientState that will have the state of this copied into it
Returns:
the PatientState that was passed in, with state copied into it

getActive

public boolean getActive(java.util.Date onDate)
Returns true if this PatientState is active as of the passed Date

Parameters:
onDate - - Date to check for PatientState enrollment
Returns:
boolean - true if this PatientState is active as of the passed Date

getActive

public boolean getActive()
Returns true if this PatientState is currently active

Returns:
boolean - true if this PatientState is currently active

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getPatientProgram

public PatientProgram getPatientProgram()

setPatientProgram

public void setPatientProgram(PatientProgram patientProgram)

getPatientStateId

public java.lang.Integer getPatientStateId()

setPatientStateId

public void setPatientStateId(java.lang.Integer patientStatusId)

getState

public ProgramWorkflowState getState()

setState

public void setState(ProgramWorkflowState state)

getEndDate

public java.util.Date getEndDate()

setEndDate

public void setEndDate(java.util.Date endDate)

getStartDate

public java.util.Date getStartDate()

setStartDate

public void setStartDate(java.util.Date startDate)

getId

public java.lang.Integer getId()
Specified by:
getId in interface OpenmrsObject
Returns:
id - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.getId()

setId

public void setId(java.lang.Integer id)
Specified by:
setId in interface OpenmrsObject
Parameters:
id - - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.setId(java.lang.Integer)

compareTo

public int compareTo(PatientState o)
Compares by startDate with null as earliest and endDate with null as latest.

Specified by:
compareTo in interface java.lang.Comparable<PatientState>
Since:
1.7.4
See Also:
Comparable.compareTo(java.lang.Object)
Expected behavior:
return positive if startDates equal and this endDate null, return negative if this startDate null

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change