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
PatientState s 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
PatientState s 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, setVoidReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public 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 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 invalidprogramWorkflowState
- - The ProgramWorkflowState
to transition toonDate
- - The Date
of the transitionjava.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)
programWorkflow
- The ProgramWorkflow whose current PatientState
we want to
retrievePatientState
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 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 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 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)
public Location getLocation()
public void setLocation(Location location)
location
- the location to setCopyright © 2018 OpenMRS Inc.. All Rights Reserved.