public class ProgramWorkflow extends BaseChangeableOpenmrsMetadata
| 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 |
Concept |
getConcept() |
Integer |
getId() |
int |
getNonRetiredStateCount()
Gets the number of states which are not retired
|
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()
Returns a string equal to the value of: ClassName{hashCode=...,
uuid=...}
|
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReasonequals, getUuid, hashCode, setUuidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetUuid, setUuidpublic 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)
ProgramWorkflowStatestate - - 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
programWorkflowStateIdpublic ProgramWorkflowState getState(Concept concept)
ProgramWorkflowState whose Concept matches the passed conceptconcept - the Concept to matchProgramWorkflowState whose Concept matches the passed
conceptpublic ProgramWorkflowState getState(String name)
ProgramWorkflowState whose Concept name matches the passed name in any
Localename - the Concept name to match in any LocaleProgramWorkflowState whose Concept name matches the passed
namepublic ProgramWorkflowState getStateByName(String name)
name - the ProgramWorkflowState name, in any LocaleProgramWorkflowState which has the passed name in any
Localepublic 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
ConceptNameConceptName
Should sort names containing numbers intelligentlypublic List<ProgramWorkflowState> getPossibleNextStates(PatientProgram patientProgram)
ProgramWorkflowState> including all possible next
ProgramWorkflowStates, for the passed PatientProgram ordered by ConceptNamepatientProgram - - The PatientProgram to checkPatientProgram ordered by ConceptNamepublic boolean isLegalTransition(ProgramWorkflowState fromState, ProgramWorkflowState toState)
fromState to
toState.fromState - ProgramWorkflowState to check transition fromtoState - ProgramWorkflowState to check transition tofromState to
toStatepublic 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 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()
OpenmrsObject.getId()public void setId(Integer id)
id - - The unique Identifier for the objectOpenmrsObject.setId(java.lang.Integer)public int getNonRetiredStateCount()
Copyright © 2024 OpenMRS Inc.. All rights reserved.