org.openmrs
Class ProgramWorkflow

java.lang.Object
  extended by org.openmrs.BaseOpenmrsObject
      extended by org.openmrs.BaseOpenmrsMetadata
          extended by org.openmrs.ProgramWorkflow
All Implemented Interfaces:
java.io.Serializable, Auditable, OpenmrsMetadata, OpenmrsObject, Retireable

public class ProgramWorkflow
extends BaseOpenmrsMetadata
implements java.io.Serializable

ProgramWorkflow

See Also:
Serialized Form

Constructor Summary
ProgramWorkflow()
          Default Constructor
ProgramWorkflow(java.lang.Integer programWorkflowId)
          Constructor with id
 
Method Summary
 void addState(ProgramWorkflowState state)
          Adds a new ProgramWorkflowState to this ProgramWorkflow
 boolean equals(java.lang.Object obj)
           
 Concept getConcept()
           
 java.lang.Integer getId()
           
 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)
          Returns a ProgramWorkflowState whose Concept has any ConceptName that matches the given 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()
           
 
Methods inherited from class org.openmrs.BaseOpenmrsMetadata
getChangedBy, getCreator, getDateChanged, getDateCreated, getDateRetired, getDescription, getName, getRetired, getRetiredBy, getRetireReason, isRetired, setChangedBy, setCreator, setDateChanged, setDateCreated, setDateRetired, setDescription, setName, setRetired, setRetiredBy, setRetireReason
 
Methods inherited from class org.openmrs.BaseOpenmrsObject
getUuid, setUuid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmrs.OpenmrsObject
getUuid, setUuid
 

Constructor Detail

ProgramWorkflow

public ProgramWorkflow()
Default Constructor


ProgramWorkflow

public ProgramWorkflow(java.lang.Integer programWorkflowId)
Constructor with id

Method Detail

addState

public void addState(ProgramWorkflowState state)
Adds a new ProgramWorkflowState to this ProgramWorkflow

Parameters:
state - - the ProgramWorkflowState to add

removeState

public void removeState(ProgramWorkflowState state)
Removes a ProgramWorkflowState from this ProgramWorkflow

Parameters:
state - - the ProgramWorkflowState to remove

retireState

public void retireState(ProgramWorkflowState state)
Retires a ProgramWorkflowState

Parameters:
state - - the ProgramWorkflowState to retire

getState

public ProgramWorkflowState getState(java.lang.Integer programWorkflowStateId)
Returns a ProgramWorkflowState whose primary key id matches the input parameter

Parameters:
programWorkflowStateId - the primary key Integer id to match
Returns:
a ProgramWorkflowState whose identifier matches the passed programWorkflowStateId

getState

public ProgramWorkflowState getState(Concept concept)
Returns a ProgramWorkflowState whose Concept matches the passed concept

Parameters:
concept - the Concept to match
Returns:
Returns a ProgramWorkflowState whose Concept matches the passed concept

getState

public ProgramWorkflowState getState(java.lang.String name)
Returns a ProgramWorkflowState whose Concept name matches the passed name in any Locale

Parameters:
name - the Concept name to match in any Locale
Returns:
a ProgramWorkflowState whose Concept name matches the passed name

getStateByName

public ProgramWorkflowState getStateByName(java.lang.String name)
Returns a ProgramWorkflowState whose Concept has any ConceptName that matches the given name

Parameters:
name - the ProgramWorkflowState name, in any Locale
Returns:
a ProgramWorkflowState which has the passed name in any Locale

getStates

public 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

Parameters:
includeRetired - - if false, returns only non-retired ProgramWorkflowState objects in this ProgramWorkflow
Returns:
Set - all ProgramWorkflowStates matching input parameters

getSortedStates

public java.util.Set<ProgramWorkflowState> getSortedStates()
Returns a Set<ProgramWorkflowState> including all ProgramWorkflowStates, sorted by ConceptName

Returns:
Set - all ProgramWorkflowStates, sorted by ConceptName
Expected behavior:
sort names containing numbers intelligently

getPossibleNextStates

public java.util.List<ProgramWorkflowState> getPossibleNextStates(PatientProgram patientProgram)
Returns a List<ProgramWorkflowState> including all possible next ProgramWorkflowStates, for the passed PatientProgram ordered by ConceptName

Parameters:
patientProgram - - The PatientProgram to check
Returns:
List - all possible next ProgramWorkflowStates, for the passed PatientProgram ordered by ConceptName

isLegalTransition

public boolean isLegalTransition(ProgramWorkflowState fromState,
                                 ProgramWorkflowState toState)
Check whether it is allowable to transition from fromState to toState.

Parameters:
fromState - ProgramWorkflowState to check transition from
toState - ProgramWorkflowState to check transition to
Returns:
boolean true if it is allowable to transition from fromState to toState

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getStates

public java.util.Set<ProgramWorkflowState> getStates()

setStates

public void setStates(java.util.Set<ProgramWorkflowState> states)

getConcept

public Concept getConcept()

setConcept

public void setConcept(Concept concept)

getProgram

public Program getProgram()

setProgram

public void setProgram(Program program)

getProgramWorkflowId

public java.lang.Integer getProgramWorkflowId()

setProgramWorkflowId

public void setProgramWorkflowId(java.lang.Integer programWorkflowId)

getId

public java.lang.Integer getId()
Specified by:
getId in interface OpenmrsObject
Returns:
id - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.getId()

setId

public void setId(java.lang.Integer id)
Specified by:
setId in interface OpenmrsObject
Parameters:
id - - The unique Identifier for the object
Since:
1.5
See Also:
OpenmrsObject.setId(java.lang.Integer)

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change