|
|||||||||
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.PatientProgram
public class PatientProgram
PatientProgram
Field Summary | |
---|---|
static long |
serialVersionUID
|
Fields inherited from class org.openmrs.BaseOpenmrsData |
---|
creator |
Constructor Summary | |
---|---|
PatientProgram()
Default Constructor |
|
PatientProgram(java.lang.Integer patientProgramId)
Constructor with id |
Method Summary | |
---|---|
PatientProgram |
copy()
Does a mostly-shallow copy of this PatientProgram. |
protected PatientProgram |
copyHelper(PatientProgram target)
The purpose of this method is to allow subclasses of PatientProgram 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 the associated Patient is currently enrolled in the associated
Program |
boolean |
getActive(java.util.Date onDate)
Returns true if the associated Patient is enrolled in the associated Program
on the passed Date |
PatientState |
getCurrentState()
Deprecated. use getCurrentState(ProgramWorkflow) |
PatientState |
getCurrentState(ProgramWorkflow programWorkflow)
Returns the current PatientState for the passed ProgramWorkflow within this
PatientProgram . |
java.util.Set<PatientState> |
getCurrentStates()
Returns a Set PatientState s for the
PatientProgram |
java.util.Date |
getDateCompleted()
|
java.util.Date |
getDateEnrolled()
|
java.lang.Integer |
getId()
|
Patient |
getPatient()
|
java.lang.Integer |
getPatientProgramId()
|
PatientState |
getPatientState(java.lang.Integer patientStateId)
Returns the PatientState associated with this PatientProgram that has an id that
matches the passed patientStateId |
Program |
getProgram()
|
java.util.Set<PatientState> |
getStates()
|
void |
setDateCompleted(java.util.Date dateCompleted)
|
void |
setDateEnrolled(java.util.Date dateEnrolled)
|
void |
setId(java.lang.Integer id)
|
void |
setPatient(Patient patient)
|
void |
setPatientProgramId(java.lang.Integer patientProgramId)
|
void |
setProgram(Program program)
|
void |
setStates(java.util.Set<PatientState> states)
|
java.util.List<PatientState> |
statesInWorkflow(ProgramWorkflow programWorkflow,
boolean includeVoided)
Returns a List PatientState s in the passed
ProgramWorkflow for the PatientProgram |
java.lang.String |
toString()
|
void |
transitionToState(ProgramWorkflowState programWorkflowState,
java.util.Date onDate)
Attempts to transition the PatientProgram to the passed ProgramWorkflowState on the
passed Date by ending the most recent PatientState in the
PatientProgram and creating a new one with the passed ProgramWorkflowState
This will throw an IllegalArgumentException if the transition is invalid |
void |
voidLastState(ProgramWorkflow workflow,
User voidBy,
java.util.Date voidDate,
java.lang.String voidReason)
Attempts to void the latest PatientState in the PatientProgram If earlier
PatientStates exist, it will try to reset the endDate to null so that the next latest state
becomes the current PatientState |
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 |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public PatientProgram()
public PatientProgram(java.lang.Integer patientProgramId)
Method Detail |
---|
public PatientProgram copy()
protected PatientProgram copyHelper(PatientProgram target)
target
- a PatientProgram that will have the state of this
copied into it
public boolean getActive(java.util.Date onDate)
Patient
is enrolled in the associated Program
on the passed Date
onDate
- - Date to check for PatientProgram enrollment
Patient
is enrolled in the associated
Program
on the passed Date
public boolean getActive()
Patient
is currently enrolled in the associated
Program
Patient
is currently enrolled in the
associated Program
public PatientState getPatientState(java.lang.Integer patientStateId)
PatientState
associated with this PatientProgram that has an id that
matches the passed patientStateId
patientStateId
- - The identifier to use to lookup a PatientState
patientStateId
public void transitionToState(ProgramWorkflowState programWorkflowState, java.util.Date onDate)
ProgramWorkflowState
on the
passed Date
by ending the most recent PatientState
in the
PatientProgram
and creating a new one with the passed ProgramWorkflowState
This will throw an IllegalArgumentException if the transition is invalid
programWorkflowState
- - The ProgramWorkflowState
to transition toonDate
- - The Date
of the transition
java.lang.IllegalArgumentException
public void voidLastState(ProgramWorkflow workflow, User voidBy, java.util.Date voidDate, java.lang.String voidReason)
PatientState
in the PatientProgram
If earlier
PatientStates exist, it will try to reset the endDate to null so that the next latest state
becomes the current PatientState
workflow
- - The ProgramWorkflow
whose last PatientState
within the
current PatientProgram
we want to voidvoidBy
- - The user who is voiding the PatientState
voidDate
- - The date to void the PatientState
voidReason
- - The reason for voiding the PatientState
public PatientState getCurrentState(ProgramWorkflow programWorkflow)
PatientState
for the passed ProgramWorkflow
within this
PatientProgram
.
programWorkflow
- The ProgramWorkflow whose current PatientState
we want to
retrieve
PatientState
for the passed ProgramWorkflow
within this PatientProgram
public PatientState getCurrentState()
getCurrentState(ProgramWorkflow)
public java.util.Set<PatientState> getCurrentStates()
PatientState
s for the
PatientProgram
PatientState
s for the PatientProgram
public java.util.List<PatientState> statesInWorkflow(ProgramWorkflow programWorkflow, boolean includeVoided)
PatientState
s in the passed
ProgramWorkflow
for the PatientProgram
programWorkflow
- - The ProgramWorkflow
to checkincludeVoided
- - If true, return voided PatientState
s in the returned
List
PatientState
s in the passed ProgramWorkflow
for the PatientProgram
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(Object)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public java.util.Date getDateCompleted()
public void setDateCompleted(java.util.Date dateCompleted)
public java.util.Date getDateEnrolled()
public void setDateEnrolled(java.util.Date dateEnrolled)
public Patient getPatient()
public void setPatient(Patient patient)
public java.lang.Integer getPatientProgramId()
public void setPatientProgramId(java.lang.Integer patientProgramId)
public Program getProgram()
public void setProgram(Program program)
public java.util.Set<PatientState> getStates()
public void setStates(java.util.Set<PatientState> states)
public 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 |