org.openmrs.api.impl
Class ProgramWorkflowServiceImpl

java.lang.Object
  extended by org.openmrs.api.impl.BaseOpenmrsService
      extended by org.openmrs.api.impl.ProgramWorkflowServiceImpl
All Implemented Interfaces:
OpenmrsService, ProgramWorkflowService

public class ProgramWorkflowServiceImpl
extends BaseOpenmrsService
implements ProgramWorkflowService

Default implementation of the ProgramWorkflow-related services class. This method should not be invoked by itself. Spring injection is used to inject this implementation into the ServiceContext. Which implementation is injected is determined by the spring application context file: /metadata/api/spring/applicationContext.xml

See Also:
ProgramWorkflowService

Field Summary
protected  ProgramWorkflowDAO dao
           
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
ProgramWorkflowServiceImpl()
           
 
Method Summary
 void changeToState(PatientProgram patientProgram, ProgramWorkflow workflow, ProgramWorkflowState state, java.util.Date onDate)
          Deprecated.  
 void createConceptStateConversion(ConceptStateConversion csc)
          Deprecated.  
 void createOrUpdateProgram(Program program)
          Deprecated.  
 void createPatientProgram(PatientProgram patientProgram)
          Deprecated.  
 void createWorkflow(ProgramWorkflow w)
          Deprecated.  
 void deleteConceptStateConversion(ConceptStateConversion csc)
          Deprecated.  
 void enrollPatientInProgram(Patient patient, Program program, java.util.Date enrollmentDate, java.util.Date completionDate, User creator)
          Deprecated.  
 java.util.List<ConceptStateConversion> getAllConceptStateConversions()
          Returns all conceptStateConversions
 java.util.List<ConceptStateConversion> getAllConversions()
          Deprecated.  
 java.util.List<Program> getAllPrograms()
          Returns all programs, includes retired programs.
 java.util.List<Program> getAllPrograms(boolean includeRetired)
          Returns all programs
 ConceptStateConversion getConceptStateConversion(java.lang.Integer id)
          Returns a conceptStateConversion given that conceptStateConversions primary key conceptStateConversionId A null value is returned if no conceptStateConversion exists with this conceptStateConversionId.
 ConceptStateConversion getConceptStateConversion(ProgramWorkflow workflow, Concept trigger)
          Retrieves the ConceptStateConversion that matches the passed ProgramWorkflow and Concept
 ConceptStateConversion getConceptStateConversionByUuid(java.lang.String uuid)
          Get a concept state conversion by its uuid.
 java.util.Collection<PatientProgram> getCurrentPrograms(Patient patient, java.util.Date onDate)
          Deprecated.  
 java.util.Set<ProgramWorkflow> getCurrentWorkflowsByPatient(Patient patient)
          Deprecated.  
 java.util.Set<ProgramWorkflow> getCurrentWorkflowsByPatientProgram(PatientProgram patientProgram)
          Deprecated.  
 PatientState getLatestState(PatientProgram patientProgram, ProgramWorkflow workflow)
          Deprecated.  
 PatientProgram getPatientProgram(java.lang.Integer patientProgramId)
          Returns a PatientProgram given that PatientPrograms primary key patientProgramId A null value is returned if no PatientProgram exists with this patientProgramId.
 PatientProgram getPatientProgramByUuid(java.lang.String uuid)
          Get a patient program by its uuid.
 java.util.List<PatientProgram> getPatientPrograms(Cohort cohort, java.util.Collection<Program> programs)
          TODO: refactor?
 java.util.Collection<PatientProgram> getPatientPrograms(Patient patient)
          Deprecated.  
 java.util.List<PatientProgram> getPatientPrograms(Patient patient, Program program, java.util.Date minEnrollmentDate, java.util.Date maxEnrollmentDate, java.util.Date minCompletionDate, java.util.Date maxCompletionDate, boolean includeVoided)
          Returns PatientPrograms that match the input parameters.
 PatientState getPatientState(java.lang.Integer patientStateId)
          Deprecated.  
 PatientState getPatientStateByUuid(java.lang.String uuid)
          Get a program state by its uuid.
 java.util.List<ProgramWorkflowState> getPossibleNextStates(PatientProgram patientProgram, ProgramWorkflow workflow)
          Deprecated.  
 Program getProgram(java.lang.Integer id)
          Returns a program given that programs primary key programId A null value is returned if no program exists with this programId.
 Program getProgram(java.lang.String name)
           
 Program getProgramByName(java.lang.String name)
          Returns a program given the program's exact name A null value is returned if there is no program with this name
 Program getProgramByUuid(java.lang.String uuid)
          Get a program by its uuid.
 java.util.List<Program> getPrograms()
          Deprecated.  
 java.util.List<Program> getPrograms(java.lang.String nameFragment)
          Returns programs that match the given string.
 ProgramWorkflowState getState(java.lang.Integer id)
          Deprecated.  
 ProgramWorkflowState getState(ProgramWorkflow programWorkflow, java.lang.String name)
          Deprecated.  
 ProgramWorkflowState getStateByUuid(java.lang.String uuid)
          Get a state by its uuid.
 java.util.List<ProgramWorkflowState> getStates()
          Deprecated.  
 java.util.List<ProgramWorkflowState> getStates(boolean includeRetired)
          Deprecated.  
 ProgramWorkflow getWorkflow(java.lang.Integer id)
          Deprecated.  
 ProgramWorkflow getWorkflow(Program program, java.lang.String name)
          Deprecated.  
 ProgramWorkflow getWorkflowByUuid(java.lang.String uuid)
          Get ProgramWorkflow by its UUID
 boolean isInProgram(Patient patient, Program program, java.util.Date fromDate, java.util.Date toDate)
          Deprecated.  
 boolean isLegalTransition(ProgramWorkflowState fromState, ProgramWorkflowState toState)
          Deprecated.  
 java.util.Collection<java.lang.Integer> patientsInProgram(Program program, java.util.Date fromDate, java.util.Date toDate)
          Deprecated.  
 void purgeConceptStateConversion(ConceptStateConversion conceptStateConversion)
          Completely remove a conceptStateConversion from the database (not reversible) This method delegates to #purgeConceptStateConversion(conceptStateConversion, boolean) method
 void purgeConceptStateConversion(ConceptStateConversion conceptStateConversion, boolean cascade)
          Completely remove a conceptStateConversion from the database (not reversible)
 void purgePatientProgram(PatientProgram patientProgram)
          Completely remove a patientProgram from the database (not reversible) This method delegates to #purgePatientProgram(patientProgram, boolean) method
 void purgePatientProgram(PatientProgram patientProgram, boolean cascade)
          Completely remove a patientProgram from the database (not reversible)
 void purgeProgram(Program program)
          Completely remove a program from the database (not reversible) This method delegates to #purgeProgram(program, boolean) method
 void purgeProgram(Program program, boolean cascade)
          Completely remove a program from the database (not reversible)
 Program retireProgram(Program program)
          Retires the given program
 ConceptStateConversion saveConceptStateConversion(ConceptStateConversion csc)
          Save ConceptStateConversion to database (create if new or update if changed)
 PatientProgram savePatientProgram(PatientProgram patientProgram)
          Save patientProgram to database (create if new or update if changed)
 Program saveProgram(Program program)
          Save program to database (create if new or update if changed)
 void setProgramWorkflowDAO(ProgramWorkflowDAO dao)
          Setter for the ProgramWorkflow DataAccessObject (DAO).
 void terminatePatientProgram(PatientProgram patientProgram, ProgramWorkflowState finalState, java.util.Date terminatedOn)
          Deprecated.  
 void triggerStateConversion(Patient patient, Concept trigger, java.util.Date dateConverted)
          Triggers any ConceptStateConversion that exists for the passed reasonForExit concept and any ProgramWorkflow in the PatientPrograms for the patient
 Program unRetireProgram(Program program)
          Unretires the given program
 PatientProgram unvoidPatientProgram(PatientProgram patientProgram)
          Unvoids the given patientProgram
 void updateConceptStateConversion(ConceptStateConversion csc)
          Deprecated.  
 void updatePatientProgram(PatientProgram patientProgram)
          Deprecated.  
 void updateWorkflow(ProgramWorkflow w)
          Deprecated.  
 void voidLastState(PatientProgram patientProgram, ProgramWorkflow workflow, java.lang.String voidReason)
          Deprecated.  
 PatientProgram voidPatientProgram(PatientProgram patientProgram, java.lang.String reason)
          Voids the given patientProgram
 void voidWorkflow(ProgramWorkflow w, java.lang.String reason)
          Deprecated.  
 
Methods inherited from class org.openmrs.api.impl.BaseOpenmrsService
onShutdown, onStartup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmrs.api.OpenmrsService
onShutdown, onStartup
 

Field Detail

log

protected final org.apache.commons.logging.Log log

dao

protected ProgramWorkflowDAO dao
Constructor Detail

ProgramWorkflowServiceImpl

public ProgramWorkflowServiceImpl()
Method Detail

setProgramWorkflowDAO

public void setProgramWorkflowDAO(ProgramWorkflowDAO dao)
Description copied from interface: ProgramWorkflowService
Setter for the ProgramWorkflow DataAccessObject (DAO). The DAO is used for saving and retrieving from the database

Specified by:
setProgramWorkflowDAO in interface ProgramWorkflowService
Parameters:
dao - - The DAO for this service
See Also:
ProgramWorkflowService.setProgramWorkflowDAO(org.openmrs.api.db.ProgramWorkflowDAO)

saveProgram

public Program saveProgram(Program program)
                    throws APIException
Description copied from interface: ProgramWorkflowService
Save program to database (create if new or update if changed)

Specified by:
saveProgram in interface ProgramWorkflowService
Parameters:
program - is the Program to be saved to the database
Returns:
The Program that was saved
Throws:
APIException
See Also:
ProgramWorkflowService.saveProgram(org.openmrs.Program)

getProgram

public Program getProgram(java.lang.Integer id)
Description copied from interface: ProgramWorkflowService
Returns a program given that programs primary key programId A null value is returned if no program exists with this programId.

Specified by:
getProgram in interface ProgramWorkflowService
Parameters:
id - integer primary key of the program to find
Returns:
Program object that has program.programId = programId passed in.
See Also:
ProgramWorkflowService.getProgram(java.lang.Integer)

getProgram

public Program getProgram(java.lang.String name)
Specified by:
getProgram in interface ProgramWorkflowService
See Also:
ProgramWorkflowService.getProgram(java.lang.String)

getProgramByName

public Program getProgramByName(java.lang.String name)
Description copied from interface: ProgramWorkflowService
Returns a program given the program's exact name A null value is returned if there is no program with this name

Specified by:
getProgramByName in interface ProgramWorkflowService
Parameters:
name - the exact name of the program to match on
Returns:
Program matching the name to Program.name
See Also:
ProgramWorkflowService.getProgram(java.lang.String)

getAllPrograms

public java.util.List<Program> getAllPrograms()
                                       throws APIException
Description copied from interface: ProgramWorkflowService
Returns all programs, includes retired programs. This method delegates to the #getAllPrograms(boolean) method

Specified by:
getAllPrograms in interface ProgramWorkflowService
Returns:
List of all existing programs, including retired programs
Throws:
APIException
See Also:
ProgramWorkflowService.getAllPrograms()

getAllPrograms

public java.util.List<Program> getAllPrograms(boolean includeRetired)
                                       throws APIException
Description copied from interface: ProgramWorkflowService
Returns all programs

Specified by:
getAllPrograms in interface ProgramWorkflowService
Parameters:
includeRetired - whether or not to include retired programs
Returns:
List all existing programs, including retired based on the input parameter
Throws:
APIException
See Also:
ProgramWorkflowService.getAllPrograms(boolean)

getPrograms

public java.util.List<Program> getPrograms(java.lang.String nameFragment)
                                    throws APIException
Description copied from interface: ProgramWorkflowService
Returns programs that match the given string. A null list will never be returned. An empty list will be returned if there are no programs matching this nameFragment

Specified by:
getPrograms in interface ProgramWorkflowService
Parameters:
nameFragment - is the string used to search for programs
Returns:
List - list of Programs whose name matches the input parameter
Throws:
APIException
See Also:
ProgramWorkflowService.getPrograms(String)

purgeProgram

public void purgeProgram(Program program)
                  throws APIException
Description copied from interface: ProgramWorkflowService
Completely remove a program from the database (not reversible) This method delegates to #purgeProgram(program, boolean) method

Specified by:
purgeProgram in interface ProgramWorkflowService
Parameters:
program - the Program to clean out of the database.
Throws:
APIException
See Also:
ProgramWorkflowService.purgeProgram(org.openmrs.Program)

purgeProgram

public void purgeProgram(Program program,
                         boolean cascade)
                  throws APIException
Description copied from interface: ProgramWorkflowService
Completely remove a program from the database (not reversible)

Specified by:
purgeProgram in interface ProgramWorkflowService
cascade - true to delete related content
Throws:
APIException
See Also:
ProgramWorkflowService.purgeProgram(org.openmrs.Program, boolean)

retireProgram

public Program retireProgram(Program program)
                      throws APIException
Description copied from interface: ProgramWorkflowService
Retires the given program

Specified by:
retireProgram in interface ProgramWorkflowService
Parameters:
program - Program to be retired
Returns:
the Program which has been retired
Throws:
APIException
See Also:
ProgramWorkflowService.retireProgram(org.openmrs.Program)

unRetireProgram

public Program unRetireProgram(Program program)
                        throws APIException
Description copied from interface: ProgramWorkflowService
Unretires the given program

Specified by:
unRetireProgram in interface ProgramWorkflowService
Parameters:
program - Program to be unretired
Returns:
the Program which has been unretired
Throws:
APIException
See Also:
ProgramWorkflowService.retireProgram(org.openmrs.Program)

savePatientProgram

public PatientProgram savePatientProgram(PatientProgram patientProgram)
                                  throws APIException
Description copied from interface: ProgramWorkflowService
Save patientProgram to database (create if new or update if changed)

Specified by:
savePatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - is the PatientProgram to be saved to the database
Returns:
PatientProgram - the saved PatientProgram
Throws:
APIException
See Also:
ProgramWorkflowService.savePatientProgram(org.openmrs.PatientProgram)

getPatientProgram

public PatientProgram getPatientProgram(java.lang.Integer patientProgramId)
Description copied from interface: ProgramWorkflowService
Returns a PatientProgram given that PatientPrograms primary key patientProgramId A null value is returned if no PatientProgram exists with this patientProgramId.

Specified by:
getPatientProgram in interface ProgramWorkflowService
Parameters:
patientProgramId - integer primary key of the PatientProgram to find
Returns:
PatientProgram object that has patientProgram.patientProgramId = patientProgramId passed in.
See Also:
ProgramWorkflowService.getPatientProgram(java.lang.Integer)

getPatientPrograms

public java.util.List<PatientProgram> getPatientPrograms(Patient patient,
                                                         Program program,
                                                         java.util.Date minEnrollmentDate,
                                                         java.util.Date maxEnrollmentDate,
                                                         java.util.Date minCompletionDate,
                                                         java.util.Date maxCompletionDate,
                                                         boolean includeVoided)
                                                  throws APIException
Description copied from interface: ProgramWorkflowService
Returns PatientPrograms that match the input parameters. If an input parameter is set to null, the parameter will not be used. Calling this method will all null parameters will return all PatientPrograms in the database A null list will never be returned. An empty list will be returned if there are no programs matching the input criteria

Specified by:
getPatientPrograms in interface ProgramWorkflowService
Parameters:
patient - if supplied all PatientPrograms returned will be for this Patient
program - if supplied all PatientPrograms returned will be for this Program
minEnrollmentDate - if supplied will limit PatientPrograms to those with enrollments on or after this Date
maxEnrollmentDate - if supplied will limit PatientPrograms to those with enrollments on or before this Date
minCompletionDate - if supplied will limit PatientPrograms to those completed on or after this Date OR not yet completed
maxCompletionDate - if supplied will limit PatientPrograms to those completed on or before this Date
includeVoided - if true, will also include voided PatientPrograms
Returns:
List of PatientPrograms that match the passed input parameters
Throws:
APIException
See Also:
ProgramWorkflowService.getPatientPrograms(Patient, Program, Date, Date, Date, Date, boolean)

getPatientPrograms

public java.util.List<PatientProgram> getPatientPrograms(Cohort cohort,
                                                         java.util.Collection<Program> programs)
Description copied from interface: ProgramWorkflowService
TODO: refactor?

Specified by:
getPatientPrograms in interface ProgramWorkflowService
Returns:
List for all Patients in the given Cohort that are in the given programs
See Also:
ProgramWorkflowService.getPatientPrograms(Cohort, Collection)

purgePatientProgram

public void purgePatientProgram(PatientProgram patientProgram)
                         throws APIException
Description copied from interface: ProgramWorkflowService
Completely remove a patientProgram from the database (not reversible) This method delegates to #purgePatientProgram(patientProgram, boolean) method

Specified by:
purgePatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - the PatientProgram to clean out of the database.
Throws:
APIException
See Also:
ProgramWorkflowService.purgePatientProgram(org.openmrs.PatientProgram)

purgePatientProgram

public void purgePatientProgram(PatientProgram patientProgram,
                                boolean cascade)
                         throws APIException
Description copied from interface: ProgramWorkflowService
Completely remove a patientProgram from the database (not reversible)

Specified by:
purgePatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - the PatientProgram to clean out of the database.
cascade - true to delete related content
Throws:
APIException
See Also:
ProgramWorkflowService.purgePatientProgram(org.openmrs.PatientProgram, boolean)

voidPatientProgram

public PatientProgram voidPatientProgram(PatientProgram patientProgram,
                                         java.lang.String reason)
Description copied from interface: ProgramWorkflowService
Voids the given patientProgram

Specified by:
voidPatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - patientProgram to be voided
reason - is the reason why the patientProgram is being voided
Returns:
the voided PatientProgram
See Also:
ProgramWorkflowService.voidPatientProgram(org.openmrs.PatientProgram, java.lang.String)

unvoidPatientProgram

public PatientProgram unvoidPatientProgram(PatientProgram patientProgram)
Description copied from interface: ProgramWorkflowService
Unvoids the given patientProgram

Specified by:
unvoidPatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - patientProgram to be un-voided
Returns:
the voided PatientProgram
See Also:
ProgramWorkflowService.voidPatientProgram(org.openmrs.PatientProgram, java.lang.String)

saveConceptStateConversion

public ConceptStateConversion saveConceptStateConversion(ConceptStateConversion csc)
                                                  throws APIException
Description copied from interface: ProgramWorkflowService
Save ConceptStateConversion to database (create if new or update if changed)

Specified by:
saveConceptStateConversion in interface ProgramWorkflowService
Parameters:
csc - - The ConceptStateConversion to save
Returns:
ConceptStateConversion - The saved ConceptStateConversion
Throws:
APIException
See Also:
ProgramWorkflowService.saveConceptStateConversion(org.openmrs.ConceptStateConversion)

getConceptStateConversion

public ConceptStateConversion getConceptStateConversion(java.lang.Integer id)
Description copied from interface: ProgramWorkflowService
Returns a conceptStateConversion given that conceptStateConversions primary key conceptStateConversionId A null value is returned if no conceptStateConversion exists with this conceptStateConversionId.

Specified by:
getConceptStateConversion in interface ProgramWorkflowService
Parameters:
id - integer primary key of the conceptStateConversion to find
Returns:
ConceptStateConversion object that has conceptStateConversion.conceptStateConversionId = conceptStateConversionId passed in.
See Also:
ProgramWorkflowService.getConceptStateConversion(java.lang.Integer)

getAllConceptStateConversions

public java.util.List<ConceptStateConversion> getAllConceptStateConversions()
                                                                     throws APIException
Description copied from interface: ProgramWorkflowService
Returns all conceptStateConversions

Specified by:
getAllConceptStateConversions in interface ProgramWorkflowService
Returns:
List of all ConceptStateConversions that exist
Throws:
APIException
See Also:
ProgramWorkflowService.getAllConceptStateConversions()

purgeConceptStateConversion

public void purgeConceptStateConversion(ConceptStateConversion conceptStateConversion)
                                 throws APIException
Description copied from interface: ProgramWorkflowService
Completely remove a conceptStateConversion from the database (not reversible) This method delegates to #purgeConceptStateConversion(conceptStateConversion, boolean) method

Specified by:
purgeConceptStateConversion in interface ProgramWorkflowService
Parameters:
conceptStateConversion - the ConceptStateConversion to clean out of the database.
Throws:
APIException
See Also:
ProgramWorkflowService.purgeConceptStateConversion(org.openmrs.ConceptStateConversion)

purgeConceptStateConversion

public void purgeConceptStateConversion(ConceptStateConversion conceptStateConversion,
                                        boolean cascade)
                                 throws APIException
Description copied from interface: ProgramWorkflowService
Completely remove a conceptStateConversion from the database (not reversible)

Specified by:
purgeConceptStateConversion in interface ProgramWorkflowService
Parameters:
conceptStateConversion - the ConceptStateConversion to clean out of the database.
cascade - true to delete related content
Throws:
APIException
See Also:
ProgramWorkflowService.purgeConceptStateConversion(org.openmrs.ConceptStateConversion, boolean)

triggerStateConversion

public void triggerStateConversion(Patient patient,
                                   Concept trigger,
                                   java.util.Date dateConverted)
Description copied from interface: ProgramWorkflowService
Triggers any ConceptStateConversion that exists for the passed reasonForExit concept and any ProgramWorkflow in the PatientPrograms for the patient

Specified by:
triggerStateConversion in interface ProgramWorkflowService
Parameters:
patient - - the Patient to trigger the ConceptStateConversion on
trigger - - the Concept to trigger the ConceptStateConversion
dateConverted - - the Date of the ConceptStateConversion
See Also:
ProgramWorkflowService.triggerStateConversion(org.openmrs.Patient, org.openmrs.Concept, java.util.Date)

getConceptStateConversion

public ConceptStateConversion getConceptStateConversion(ProgramWorkflow workflow,
                                                        Concept trigger)
Description copied from interface: ProgramWorkflowService
Retrieves the ConceptStateConversion that matches the passed ProgramWorkflow and Concept

Specified by:
getConceptStateConversion in interface ProgramWorkflowService
Parameters:
workflow - - the ProgramWorkflow to check
trigger - - the Concept to check
Returns:
ConceptStateConversion that matches the passed ProgramWorkflow and Concept
See Also:
ProgramWorkflowService.getConceptStateConversion(org.openmrs.ProgramWorkflow, org.openmrs.Concept)

createOrUpdateProgram

public void createOrUpdateProgram(Program program)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Create a new program

Specified by:
createOrUpdateProgram in interface ProgramWorkflowService
Parameters:
program - Program to create
See Also:
ProgramWorkflowService.createOrUpdateProgram(org.openmrs.Program)

getPrograms

public java.util.List<Program> getPrograms()
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns all programs, includes retired programs.

Specified by:
getPrograms in interface ProgramWorkflowService
Returns:
List of all existing programs
See Also:
ProgramWorkflowService.getPrograms()

createWorkflow

public void createWorkflow(ProgramWorkflow w)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Create a new programWorkflow

Specified by:
createWorkflow in interface ProgramWorkflowService
Parameters:
w - - The ProgramWorkflow to create
See Also:
ProgramWorkflowService.createWorkflow(ProgramWorkflow)

updateWorkflow

public void updateWorkflow(ProgramWorkflow w)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Update a programWorkflow

Specified by:
updateWorkflow in interface ProgramWorkflowService
Parameters:
w - - The ProgramWorkflow to update
See Also:
ProgramWorkflowService.updateWorkflow(org.openmrs.ProgramWorkflow)

getWorkflow

public ProgramWorkflow getWorkflow(java.lang.Integer id)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns a programWorkflow given that programWorkflows primary key programWorkflowId

Specified by:
getWorkflow in interface ProgramWorkflowService
Parameters:
id - integer primary key of the ProgramWorkflow to find
Returns:
ProgramWorkflow object that has an id that matches the input parameter
See Also:
ProgramWorkflowService.getWorkflow(java.lang.Integer)

getWorkflow

public ProgramWorkflow getWorkflow(Program program,
                                   java.lang.String name)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns a programWorkflow with the given name within the given Program

Specified by:
getWorkflow in interface ProgramWorkflowService
Parameters:
program - - The Program of the ProgramWorkflow to return
name - - The name of the ProgramWorkflow to return
Returns:
ProgramWorkflow - The ProgramWorkflow that matches the passed Program and name
See Also:
ProgramWorkflowService.getWorkflow(org.openmrs.Program, java.lang.String)

voidWorkflow

public void voidWorkflow(ProgramWorkflow w,
                         java.lang.String reason)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Retires the given programWorkflow

Specified by:
voidWorkflow in interface ProgramWorkflowService
Parameters:
w - - The ProgramWorkflow to retire
reason - - The reason for retiring the ProgramWorkflow
See Also:
ProgramWorkflowService.voidWorkflow(org.openmrs.ProgramWorkflow, java.lang.String)

getStates

public java.util.List<ProgramWorkflowState> getStates()
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns all ProgramWorkflowStates

Specified by:
getStates in interface ProgramWorkflowService
Returns:
List - all ProgramWorkflowStates that exist
See Also:
ProgramWorkflowService.getStates()

getStates

public java.util.List<ProgramWorkflowState> getStates(boolean includeRetired)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns all ProgramWorkflowStates

Specified by:
getStates in interface ProgramWorkflowService
Parameters:
includeRetired - - if false, only returns non-voided ProgramWorkflowStates
Returns:
List - all ProgramWorkflowStates that exist, including voided based on the input parameter
See Also:
ProgramWorkflowService.getStates(boolean)

getState

public ProgramWorkflowState getState(java.lang.Integer id)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns ProgramWorkflowState with the passed primary key id

Specified by:
getState in interface ProgramWorkflowService
Parameters:
id - - The primary key id of the ProgramWorkflowState to return
Returns:
ProgramWorkflowState - returns ProgramWorkflowState whose primary key id matches the passed id
See Also:
ProgramWorkflowService.getState(java.lang.Integer)

getState

public ProgramWorkflowState getState(ProgramWorkflow programWorkflow,
                                     java.lang.String name)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns ProgramWorkflowState with the passed name in the passed programWorkflow

Specified by:
getState in interface ProgramWorkflowService
Parameters:
programWorkflow - - The programWorkflow to check for ProgramWorkflowState
name - - the name of the programWorkflowState to look for
Returns:
ProgramWorkflowState - the ProgramWorkflowState with the passed name in the passed programWorkflow
See Also:
ProgramWorkflowService.getState(org.openmrs.ProgramWorkflow, java.lang.String)

getPossibleNextStates

public java.util.List<ProgramWorkflowState> getPossibleNextStates(PatientProgram patientProgram,
                                                                  ProgramWorkflow workflow)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns List of ProgramWorkflowStates that a patient is allowed to transition into given their current program

Specified by:
getPossibleNextStates in interface ProgramWorkflowService
Parameters:
patientProgram - - the PatientProgram to retrieve possible next transitions from
workflow - - the ProgramWorkflow to retrieve possible next transitions from
Returns:
List - returns List that a patient with the given PatientProgram and ProgramWorkflow is allowed to transition into
See Also:
ProgramWorkflowService.getPossibleNextStates(org.openmrs.PatientProgram, org.openmrs.ProgramWorkflow)

isLegalTransition

public boolean isLegalTransition(ProgramWorkflowState fromState,
                                 ProgramWorkflowState toState)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns boolean indicating whether it is legal to transition from one ProgramWorkflowState to another

Specified by:
isLegalTransition in interface ProgramWorkflowService
Parameters:
fromState - - the ProgramWorkflowState to use as the state to check transitions from
toState - - the ProgramWorkflowState to use as the state to check transitions into from fromState
Returns:
boolean - returns true if a legal transition exists from fromState to toState
See Also:
ProgramWorkflowService.isLegalTransition(org.openmrs.ProgramWorkflowState, org.openmrs.ProgramWorkflowState)

createPatientProgram

public void createPatientProgram(PatientProgram patientProgram)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Create a new patientProgram

Specified by:
createPatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - - The PatientProgram to create
See Also:
ProgramWorkflowService.createPatientProgram(org.openmrs.PatientProgram)

updatePatientProgram

public void updatePatientProgram(PatientProgram patientProgram)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Update a patientProgram

Specified by:
updatePatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - - The PatientProgram to update
See Also:
ProgramWorkflowService.updatePatientProgram(org.openmrs.PatientProgram)

enrollPatientInProgram

public void enrollPatientInProgram(Patient patient,
                                   Program program,
                                   java.util.Date enrollmentDate,
                                   java.util.Date completionDate,
                                   User creator)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Create a new PatientProgram

Specified by:
enrollPatientInProgram in interface ProgramWorkflowService
Parameters:
patient - - The Patient to enroll
program - - The Program to enroll the patient into
enrollmentDate - - The Date to use as the enrollment date in the program for the patient
completionDate - - The Date to use as the completion date in the program for the patient
creator - - The User who is enrolling this patient
See Also:
ProgramWorkflowService.enrollPatientInProgram(org.openmrs.Patient, org.openmrs.Program, java.util.Date, java.util.Date, org.openmrs.User)

getPatientPrograms

public java.util.Collection<PatientProgram> getPatientPrograms(Patient patient)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns a Collection of all PatientPrograms for the passed patient

Specified by:
getPatientPrograms in interface ProgramWorkflowService
Parameters:
patient - - The Patient to retrieve all PatientPrograms for
Returns:
Collection of all PatientPrograms for the passed patient
See Also:
ProgramWorkflowService.getPatientPrograms(org.openmrs.Patient)

patientsInProgram

public java.util.Collection<java.lang.Integer> patientsInProgram(Program program,
                                                                 java.util.Date fromDate,
                                                                 java.util.Date toDate)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Get Collection of PatientIds for patients who are enrolled in program between fromDate and toDate

Specified by:
patientsInProgram in interface ProgramWorkflowService
Parameters:
program - - The Program to check for patient enrollment
fromDate - - Used to check whether patients were enrolled in the program on or after this Date
toDate - - Used to check whether patients were enrolled in the program on or before this Date
Returns:
Collection containing all patientIds for patients who were enrolled in the program between fromDate and toDate
See Also:
ProgramWorkflowService.patientsInProgram(org.openmrs.Program, java.util.Date, java.util.Date)

getCurrentPrograms

public java.util.Collection<PatientProgram> getCurrentPrograms(Patient patient,
                                                               java.util.Date onDate)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Get Collection of PatientPrograms for patients that are current as of the passed Date

Specified by:
getCurrentPrograms in interface ProgramWorkflowService
Parameters:
patient - - The Patient to check for program enrollment
onDate - - Specifies only to return programs that the patient is in as of this Date
Returns:
Collection that contains all PatientPrograms are current for the patient as of onDate
See Also:
ProgramWorkflowService.getCurrentPrograms(org.openmrs.Patient, java.util.Date)

isInProgram

public boolean isInProgram(Patient patient,
                           Program program,
                           java.util.Date fromDate,
                           java.util.Date toDate)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Return boolean indicating if Patient was enrolled into the Program between Date and Date

Specified by:
isInProgram in interface ProgramWorkflowService
Parameters:
patient - - The Patient to check for enrollment
program - - The Program to check for enrollment
fromDate - - Used to check whether patients were enrolled in the program on or after this Date
toDate - - Used to check whether patients were enrolled in the program on or before this Date
Returns:
boolean - Returns true if the patient was enrolled in the program between fromDate and toDate
See Also:
ProgramWorkflowService.isInProgram(org.openmrs.Patient, org.openmrs.Program, java.util.Date, java.util.Date)

getPatientState

public PatientState getPatientState(java.lang.Integer patientStateId)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Get a PatientState by patientStateId

Specified by:
getPatientState in interface ProgramWorkflowService
Parameters:
patientStateId - - The primary key id of the PatientState to return
Returns:
The PatientState whose primary key id matches the input patientStateId
See Also:
ProgramWorkflowService.getPatientState(java.lang.Integer)

getLatestState

public PatientState getLatestState(PatientProgram patientProgram,
                                   ProgramWorkflow workflow)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Get the most recent PatientState for a given PatientProgram and ProgramWorkflow

Specified by:
getLatestState in interface ProgramWorkflowService
Parameters:
patientProgram - - The PatientProgram whose states to check
workflow - - The ProgramWorkflow whose current state to check within the given patientProgram
Returns:
PatientState - The PatientState that is most recent for the programWorkflow within the given patientProgram
See Also:
ProgramWorkflowService.getLatestState(org.openmrs.PatientProgram, org.openmrs.ProgramWorkflow)

getCurrentWorkflowsByPatient

public java.util.Set<ProgramWorkflow> getCurrentWorkflowsByPatient(Patient patient)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns a Set of current ProgramWorkflows for the given Patient

Specified by:
getCurrentWorkflowsByPatient in interface ProgramWorkflowService
Parameters:
patient - - The Patient to check
Returns:
Set containing all of the current ProgramWorkflows for the patient
See Also:
ProgramWorkflowService.getCurrentWorkflowsByPatient(org.openmrs.Patient)

getCurrentWorkflowsByPatientProgram

public java.util.Set<ProgramWorkflow> getCurrentWorkflowsByPatientProgram(PatientProgram patientProgram)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns a Set of current ProgramWorkflows for the given PatientProgram

Specified by:
getCurrentWorkflowsByPatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - - The PatientProgram to check
Returns:
Set containing all of the current ProgramWorkflows for the program
See Also:
ProgramWorkflowService.getCurrentWorkflowsByPatientProgram(org.openmrs.PatientProgram)

changeToState

public void changeToState(PatientProgram patientProgram,
                          ProgramWorkflow workflow,
                          ProgramWorkflowState state,
                          java.util.Date onDate)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Change the state of the passed PatientPrograms ProgramWorkflow to the passed ProgramWorkflowState on the passed Date

Specified by:
changeToState in interface ProgramWorkflowService
Parameters:
patientProgram - - The PatientProgram whose state you wish to change
workflow - - The ProgramWorkflow whose within the patientProgram whose state you wish to change
state - - The ProgramWorkflowState you wish to change the ProgramWorkflow to
onDate - - The Date that you wish the State change to take place
See Also:
ProgramWorkflowService.changeToState(org.openmrs.PatientProgram, org.openmrs.ProgramWorkflow, org.openmrs.ProgramWorkflowState, java.util.Date)

voidLastState

public void voidLastState(PatientProgram patientProgram,
                          ProgramWorkflow workflow,
                          java.lang.String voidReason)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Voids the last non-voided ProgramWorkflowState in the given ProgramWorkflow for the given PatientProgram, and clears the endDate of the next-to-last non-voided state.

Specified by:
voidLastState in interface ProgramWorkflowService
Parameters:
patientProgram - - The patientProgram to check
workflow - - The ProgramWorkflow to check
voidReason - - The reason for voiding
See Also:
ProgramWorkflowService.voidLastState(org.openmrs.PatientProgram, org.openmrs.ProgramWorkflow, java.lang.String)

terminatePatientProgram

public void terminatePatientProgram(PatientProgram patientProgram,
                                    ProgramWorkflowState finalState,
                                    java.util.Date terminatedOn)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Terminatate the passed PatientPrograms ProgramWorkflow to the passed ProgramWorkflowState on the passed Date

Specified by:
terminatePatientProgram in interface ProgramWorkflowService
Parameters:
patientProgram - - The PatientProgram whose state you wish to change
finalState - - The ProgramWorkflowState you wish to change the ProgramWorkflow to
terminatedOn - - The Date that you wish the State change to take place
See Also:
ProgramWorkflowService.terminatePatientProgram(org.openmrs.PatientProgram, org.openmrs.ProgramWorkflowState, java.util.Date)

createConceptStateConversion

public void createConceptStateConversion(ConceptStateConversion csc)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Create a new ConceptStateConversion

Specified by:
createConceptStateConversion in interface ProgramWorkflowService
Parameters:
csc - - The ConceptStateConversion to create
See Also:
ProgramWorkflowService.createConceptStateConversion(org.openmrs.ConceptStateConversion)

updateConceptStateConversion

public void updateConceptStateConversion(ConceptStateConversion csc)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Update a ConceptStateConversion

Specified by:
updateConceptStateConversion in interface ProgramWorkflowService
Parameters:
csc - - The ConceptStateConversion to update
See Also:
ProgramWorkflowService.updateConceptStateConversion(org.openmrs.ConceptStateConversion)

getAllConversions

public java.util.List<ConceptStateConversion> getAllConversions()
Deprecated. 

Description copied from interface: ProgramWorkflowService
Returns all conceptStateConversions, includes retired conceptStateConversions.

Specified by:
getAllConversions in interface ProgramWorkflowService
Returns:
List of all ConceptStateConversions that exist, including retired
See Also:
ProgramWorkflowService.getAllConversions()

deleteConceptStateConversion

public void deleteConceptStateConversion(ConceptStateConversion csc)
Deprecated. 

Description copied from interface: ProgramWorkflowService
Delete a ConceptStateConversion

Specified by:
deleteConceptStateConversion in interface ProgramWorkflowService
Parameters:
csc - - The ConceptStateConversion to delete from the database
See Also:
ProgramWorkflowService.deleteConceptStateConversion(org.openmrs.ConceptStateConversion)

getConceptStateConversionByUuid

public ConceptStateConversion getConceptStateConversionByUuid(java.lang.String uuid)
Description copied from interface: ProgramWorkflowService
Get a concept state conversion by its uuid. There should be only one of these in the database. If multiple are found, an error is thrown.

Specified by:
getConceptStateConversionByUuid in interface ProgramWorkflowService
Parameters:
uuid - the universally unique identifier
Returns:
the concept state conversion which matches the given uuid
See Also:
ProgramWorkflowService.getConceptStateConversionByUuid(java.lang.String)

getPatientProgramByUuid

public PatientProgram getPatientProgramByUuid(java.lang.String uuid)
Description copied from interface: ProgramWorkflowService
Get a patient program by its uuid. There should be only one of these in the database. If multiple are found, an error is thrown.

Specified by:
getPatientProgramByUuid in interface ProgramWorkflowService
Parameters:
uuid - the universally unique identifier
Returns:
the patient program which matches the given uuid
See Also:
ProgramWorkflowService.getPatientProgramByUuid(java.lang.String)

getProgramByUuid

public Program getProgramByUuid(java.lang.String uuid)
Description copied from interface: ProgramWorkflowService
Get a program by its uuid. There should be only one of these in the database. If multiple are found, an error is thrown.

Specified by:
getProgramByUuid in interface ProgramWorkflowService
Parameters:
uuid - the universally unique identifier
Returns:
the program which matches the given uuid
See Also:
ProgramWorkflowService.getProgramByUuid(java.lang.String)

getStateByUuid

public ProgramWorkflowState getStateByUuid(java.lang.String uuid)
Description copied from interface: ProgramWorkflowService
Get a state by its uuid. There should be only one of these in the database. If multiple are found, an error is thrown.

Specified by:
getStateByUuid in interface ProgramWorkflowService
Parameters:
uuid - the universally unique identifier
Returns:
the program workflow state which matches the given uuid
See Also:
ProgramWorkflowService.getStateByUuid(java.lang.String)

getPatientStateByUuid

public PatientState getPatientStateByUuid(java.lang.String uuid)
Description copied from interface: ProgramWorkflowService
Get a program state by its uuid. There should be only one of these in the database. If multiple are found, an error is thrown.

Specified by:
getPatientStateByUuid in interface ProgramWorkflowService
Parameters:
uuid - the universally unique identifier
Returns:
the program which matches the given uuid

getWorkflowByUuid

public ProgramWorkflow getWorkflowByUuid(java.lang.String uuid)
Description copied from interface: ProgramWorkflowService
Get ProgramWorkflow by its UUID

Specified by:
getWorkflowByUuid in interface ProgramWorkflowService
Returns:
See Also:
ProgramWorkflowService.getWorkflowByUuid(java.lang.String)

OpenMRS-1.7.x

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