public class ProgramWorkflow extends BaseOpenmrsMetadata implements java.io.Serializable
Constructor and Description |
---|
ProgramWorkflow()
Default Constructor
|
ProgramWorkflow(java.lang.Integer programWorkflowId)
Constructor with id
|
Modifier and Type | Method and Description |
---|---|
void |
addState(ProgramWorkflowState state)
Adds a new
ProgramWorkflowState to this ProgramWorkflow |
Concept |
getConcept() |
java.lang.Integer |
getId() |
int |
getNonRetiredStateCount()
Gets the number of states which are not retired
|
java.util.List<ProgramWorkflowState> |
getPossibleNextStates(PatientProgram patientProgram)
Returns a List<
ProgramWorkflowState > including all possible next
ProgramWorkflowStates, for the passed PatientProgram ordered by ConceptName |
Program |
getProgram() |
java.lang.Integer |
getProgramWorkflowId() |
java.util.Set<ProgramWorkflowState> |
getSortedStates()
Returns a Set<
ProgramWorkflowState > including all ProgramWorkflowStates, sorted by
ConceptName |
ProgramWorkflowState |
getState(Concept concept)
Returns a
ProgramWorkflowState whose Concept matches the passed concept |
ProgramWorkflowState |
getState(java.lang.Integer programWorkflowStateId)
Returns a
ProgramWorkflowState whose primary key id matches the input parameter |
ProgramWorkflowState |
getState(java.lang.String name)
Returns a
ProgramWorkflowState whose Concept name matches the passed name in any
Locale |
ProgramWorkflowState |
getStateByName(java.lang.String name)
|
java.util.Set<ProgramWorkflowState> |
getStates() |
java.util.Set<ProgramWorkflowState> |
getStates(boolean includeRetired)
Returns a Set<
ProgramWorkflowState > including all non-retired ProgramWorkflowStates
and all retired ProgramWorkflowStates in this ProgramWorkflow if includeRetired
is true |
boolean |
isLegalTransition(ProgramWorkflowState fromState,
ProgramWorkflowState toState)
Check whether it is allowable to transition from
fromState to
toState . |
void |
removeState(ProgramWorkflowState state)
Removes a
ProgramWorkflowState from this ProgramWorkflow |
void |
retireState(ProgramWorkflowState state)
Retires a
ProgramWorkflowState |
void |
setConcept(Concept concept) |
void |
setId(java.lang.Integer id) |
void |
setProgram(Program program) |
void |
setProgramWorkflowId(java.lang.Integer programWorkflowId) |
void |
setStates(java.util.Set<ProgramWorkflowState> states) |
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 ] . |
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReason
equals, getUuid, hashCode, setUuid
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public ProgramWorkflow()
public ProgramWorkflow(java.lang.Integer programWorkflowId)
public void addState(ProgramWorkflowState state)
ProgramWorkflowState
to this ProgramWorkflowstate
- - the ProgramWorkflowState
to addpublic void removeState(ProgramWorkflowState state)
ProgramWorkflowState
from this ProgramWorkflowstate
- - the ProgramWorkflowState
to removepublic void retireState(ProgramWorkflowState state)
ProgramWorkflowState
state
- - the ProgramWorkflowState
to retirepublic ProgramWorkflowState getState(java.lang.Integer programWorkflowStateId)
ProgramWorkflowState
whose primary key id matches the input parameterprogramWorkflowStateId
- the primary key Integer
id to matchProgramWorkflowState
whose identifier matches the passed
programWorkflowStateId
public ProgramWorkflowState getState(Concept concept)
ProgramWorkflowState
whose Concept matches the passed conceptconcept
- the Concept to matchProgramWorkflowState
whose Concept
matches the passed
concept
public ProgramWorkflowState getState(java.lang.String name)
ProgramWorkflowState
whose Concept name matches the passed name in any
Locale
name
- the Concept name to match in any Locale
ProgramWorkflowState
whose Concept
name matches the passed
name
public ProgramWorkflowState getStateByName(java.lang.String name)
name
- the ProgramWorkflowState
name, in any Locale
ProgramWorkflowState
which has the passed name
in any
Locale
public java.util.Set<ProgramWorkflowState> getStates(boolean includeRetired)
ProgramWorkflowState
> including all non-retired ProgramWorkflowStates
and all retired ProgramWorkflowStates in this ProgramWorkflow if includeRetired
is trueincludeRetired
- - if false, returns only non-retired ProgramWorkflowState
objects in this ProgramWorkflowpublic java.util.Set<ProgramWorkflowState> getSortedStates()
ProgramWorkflowState
> including all ProgramWorkflowStates, sorted by
ConceptName
ConceptName
public java.util.List<ProgramWorkflowState> getPossibleNextStates(PatientProgram patientProgram)
ProgramWorkflowState
> including all possible next
ProgramWorkflowStates, for the passed PatientProgram
ordered by ConceptName
patientProgram
- - The PatientProgram to checkPatientProgram
ordered by ConceptName
public boolean isLegalTransition(ProgramWorkflowState fromState, ProgramWorkflowState toState)
fromState
to
toState
.fromState
- ProgramWorkflowState
to check transition fromtoState
- ProgramWorkflowState
to check transition tofromState
to
toState
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 java.util.Set<ProgramWorkflowState> getStates()
public void setStates(java.util.Set<ProgramWorkflowState> states)
public Concept getConcept()
public void setConcept(Concept concept)
public Program getProgram()
public void setProgram(Program program)
public java.lang.Integer getProgramWorkflowId()
public void setProgramWorkflowId(java.lang.Integer programWorkflowId)
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 int getNonRetiredStateCount()
Copyright © 2018 OpenMRS Inc.. All Rights Reserved.