public class ProgramWorkflow extends BaseOpenmrsMetadata implements Serializable
Constructor and Description |
---|
ProgramWorkflow()
Default Constructor
|
ProgramWorkflow(Integer programWorkflowId)
Constructor with id
|
Modifier and Type | Method and Description |
---|---|
void |
addState(ProgramWorkflowState state)
Adds a new
ProgramWorkflowState to this ProgramWorkflow |
boolean |
equals(Object obj) |
Concept |
getConcept() |
Integer |
getId() |
List<ProgramWorkflowState> |
getPossibleNextStates(PatientProgram patientProgram)
Returns a List<
ProgramWorkflowState > including all possible next
ProgramWorkflowStates, for the passed PatientProgram ordered by ConceptName |
Program |
getProgram() |
Integer |
getProgramWorkflowId() |
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(Integer programWorkflowStateId)
Returns a
ProgramWorkflowState whose primary key id matches the input parameter |
ProgramWorkflowState |
getState(String name)
Returns a
ProgramWorkflowState whose Concept name matches the passed name in any
Locale |
ProgramWorkflowState |
getStateByName(String name)
|
Set<ProgramWorkflowState> |
getStates() |
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(Integer id) |
void |
setProgram(Program program) |
void |
setProgramWorkflowId(Integer programWorkflowId) |
void |
setStates(Set<ProgramWorkflowState> states) |
String |
toString() |
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReason
getUuid, setUuid
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getUuid, setUuid
public ProgramWorkflow()
public ProgramWorkflow(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(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(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(String name)
name
- the ProgramWorkflowState
name, in any Locale
ProgramWorkflowState
which has the passed name
in any
Locale
public 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 Set<ProgramWorkflowState> getSortedStates()
ProgramWorkflowState
> including all ProgramWorkflowStates, sorted by
ConceptName
ConceptName
public 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 boolean equals(Object obj)
equals
in class Object
Object.equals(Object)
public String toString()
toString
in class Object
Object.toString()
public Set<ProgramWorkflowState> getStates()
public void setStates(Set<ProgramWorkflowState> states)
public Concept getConcept()
public void setConcept(Concept concept)
public Program getProgram()
public void setProgram(Program program)
public Integer getProgramWorkflowId()
public void setProgramWorkflowId(Integer programWorkflowId)
public Integer getId()
getId
in interface OpenmrsObject
OpenmrsObject.getId()
public void setId(Integer id)
setId
in interface OpenmrsObject
id
- - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.