public class PatientProgram extends BaseChangeableOpenmrsData implements Customizable<PatientProgramAttribute>
| Modifier and Type | Field and Description |
|---|---|
static long |
serialVersionUID |
creator| Constructor and Description |
|---|
PatientProgram()
Default Constructor
|
PatientProgram(Integer patientProgramId)
Constructor with id
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(PatientProgramAttribute attribute)
Adds an attribute.
|
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(Date onDate)
|
Collection<PatientProgramAttribute> |
getActiveAttributes() |
List<PatientProgramAttribute> |
getActiveAttributes(CustomValueDescriptor ofType) |
Set<PatientProgramAttribute> |
getAttributes() |
PatientState |
getCurrentState(ProgramWorkflow programWorkflow)
|
Set<PatientState> |
getCurrentStates()
Returns a Set<PatientState> of all current
PatientStates for the
PatientProgram |
Date |
getDateCompleted() |
Date |
getDateEnrolled() |
Integer |
getId() |
Location |
getLocation() |
Set<PatientState> |
getMostRecentStateInEachWorkflow()
Returns a Set<PatientState> of all recent
PatientStates for each workflow of the
PatientProgram |
Concept |
getOutcome() |
Patient |
getPatient() |
Integer |
getPatientProgramId() |
PatientState |
getPatientState(Integer patientStateId)
Returns the
PatientState associated with this PatientProgram that has an id that
matches the passed patientStateId |
Program |
getProgram() |
Set<PatientState> |
getStates() |
void |
setAttribute(PatientProgramAttribute attribute) |
void |
setAttributes(Set<PatientProgramAttribute> attributes) |
void |
setDateCompleted(Date dateCompleted) |
void |
setDateEnrolled(Date dateEnrolled) |
void |
setId(Integer id) |
void |
setLocation(Location location) |
void |
setOutcome(Concept concept) |
void |
setPatient(Patient patient) |
void |
setPatientProgramId(Integer patientProgramId) |
void |
setProgram(Program program) |
void |
setStates(Set<PatientState> states) |
List<PatientState> |
statesInWorkflow(ProgramWorkflow programWorkflow,
boolean includeVoided)
Returns a List<PatientState> of all
PatientStates in the passed
ProgramWorkflow for the PatientProgram |
String |
toString()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
void |
transitionToState(ProgramWorkflowState programWorkflowState,
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,
Date voidDate,
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(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(Date onDate)
public boolean getActive()
public PatientState getPatientState(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, 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 transitionIllegalArgumentExceptionpublic void voidLastState(ProgramWorkflow workflow, User voidBy, Date voidDate, 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 PatientState
Should void state with endDate null if startDates equalpublic PatientState getCurrentState(ProgramWorkflow programWorkflow)
programWorkflow - The ProgramWorkflow whose current PatientState we want to
retrievePatientState for the passed ProgramWorkflow
within this PatientProgrampublic Set<PatientState> getCurrentStates()
PatientStates for the
PatientProgramPatientStates for the PatientProgrampublic Set<PatientState> getMostRecentStateInEachWorkflow()
PatientStates for each workflow of the
PatientProgramPatientStates for the PatientProgrampublic 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 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 Concept getOutcome()
public void setOutcome(Concept concept)
public Date getDateCompleted()
public void setDateCompleted(Date dateCompleted)
public Date getDateEnrolled()
public void setDateEnrolled(Date dateEnrolled)
public Patient getPatient()
public void setPatient(Patient patient)
public Integer getPatientProgramId()
public void setPatientProgramId(Integer patientProgramId)
public Program getProgram()
public void setProgram(Program program)
public Set<PatientState> getStates()
public void setStates(Set<PatientState> states)
public 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 Location getLocation()
public void setLocation(Location location)
location - the location to setpublic Set<PatientProgramAttribute> getAttributes()
getAttributes in interface Customizable<PatientProgramAttribute>public Collection<PatientProgramAttribute> getActiveAttributes()
getActiveAttributes in interface Customizable<PatientProgramAttribute>public List<PatientProgramAttribute> getActiveAttributes(CustomValueDescriptor ofType)
getActiveAttributes in interface Customizable<PatientProgramAttribute>public void addAttribute(PatientProgramAttribute attribute)
CustomizableaddAttribute in interface Customizable<PatientProgramAttribute>public void setAttributes(Set<PatientProgramAttribute> attributes)
public void setAttribute(PatientProgramAttribute attribute)
Copyright © 2024 OpenMRS Inc.. All rights reserved.