public class PatientProgram extends BaseOpenmrsData implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID |
creator| Constructor and Description |
|---|
PatientProgram()
Default Constructor
|
PatientProgram(java.lang.Integer patientProgramId)
Constructor with id
|
| Modifier and Type | Method and Description |
|---|---|
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 |
getActive()
|
boolean |
getActive(java.util.Date onDate)
|
PatientState |
getCurrentState()
Deprecated.
|
PatientState |
getCurrentState(ProgramWorkflow programWorkflow)
|
java.util.Set<PatientState> |
getCurrentStates()
Returns a Set
PatientStates for the
PatientProgram |
java.util.Date |
getDateCompleted() |
java.util.Date |
getDateEnrolled() |
java.lang.Integer |
getId() |
Location |
getLocation() |
Concept |
getOutcome() |
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 |
setLocation(Location location) |
void |
setOutcome(Concept concept) |
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
PatientStates in the passed
ProgramWorkflow for the PatientProgram |
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 ]. |
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 |
getChangedBy, 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 PatientProgram()
public PatientProgram(java.lang.Integer patientProgramId)
public PatientProgram copy()
protected PatientProgram copyHelper(PatientProgram target)
target - a PatientProgram that will have the state of this copied into itpublic boolean getActive(java.util.Date onDate)
public boolean getActive()
public PatientState getPatientState(java.lang.Integer patientStateId)
PatientState associated with this PatientProgram that has an id that
matches the passed patientStateIdpatientStateId - - The identifier to use to lookup a PatientStatepatientStateIdpublic 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 invalidprogramWorkflowState - - The ProgramWorkflowState to transition toonDate - - The Date of the transitionjava.lang.IllegalArgumentExceptionpublic 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 PatientStateworkflow - - The ProgramWorkflow whose last PatientState within the
current PatientProgram we want to voidvoidBy - - The user who is voiding the PatientStatevoidDate - - The date to void the PatientStatevoidReason - - The reason for voiding the PatientStatepublic PatientState getCurrentState(ProgramWorkflow programWorkflow)
programWorkflow - The ProgramWorkflow whose current PatientState we want to
retrievePatientState for the passed ProgramWorkflow
within this PatientProgrampublic PatientState getCurrentState()
getCurrentState(ProgramWorkflow)public java.util.Set<PatientState> getCurrentStates()
PatientStates for the
PatientProgramPatientStates for the PatientProgrampublic java.util.List<PatientState> statesInWorkflow(ProgramWorkflow programWorkflow, boolean includeVoided)
PatientStates in the passed
ProgramWorkflow for the PatientProgramprogramWorkflow - - The ProgramWorkflow to checkincludeVoided - - If true, return voided PatientStates in the returned
ListPatientStates in the passed ProgramWorkflow
for the PatientProgrampublic java.lang.String toString()
BaseOpenmrsObjectuuid 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 BaseOpenmrsObjectObject.toString()public Concept getOutcome()
public void setOutcome(Concept concept)
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 OpenmrsObjectOpenmrsObject.getId()public void setId(java.lang.Integer id)
setId in interface OpenmrsObjectid - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)public Location getLocation()
public void setLocation(Location location)
location - the location to setCopyright © 2018 OpenMRS Inc.. All Rights Reserved.