org.openmrs.api.db
Interface ProgramWorkflowDAO

All Known Implementing Classes:
HibernateProgramWorkflowDAO

public interface ProgramWorkflowDAO

Program- and PatientProgram- and ConceptStateConversion-related database functions

Version:
1.0

Method Summary
 void deleteConceptStateConversion(ConceptStateConversion csc)
          Completely remove a conceptStateConversion from the database (not reversible)
 void deletePatientProgram(PatientProgram patientProgram)
          Completely remove a patientProgram from the database (not reversible) This method delegates to #purgePatientProgram(patientProgram, boolean) method
 void deleteProgram(Program program)
          Completely remove a program from the database (not reversible) This method delegates to #purgeProgram(program, boolean) method
 java.util.List<Program> findPrograms(java.lang.String nameFragment)
          Returns programs that match the given string.
 java.util.List<ConceptStateConversion> getAllConceptStateConversions()
          Returns all conceptStateConversions
 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)
          Auto generated method comment
 PatientProgram getPatientProgram(java.lang.Integer id)
          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)
          Auto generated method comment
 java.util.List<PatientProgram> getPatientPrograms(Cohort cohort, java.util.Collection<Program> programs)
           
 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 getPatientStateByUuid(java.lang.String uuid)
           
 Program getProgram(java.lang.Integer programId)
          Retrieves a Program from the database by primary key programId
 Program getProgramByUuid(java.lang.String uuid)
          Auto generated method comment
 ProgramWorkflowState getStateByUuid(java.lang.String uuid)
          Auto generated method comment
 ProgramWorkflow getWorkflowByUuid(java.lang.String uuid)
          Auto generated method comment
 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)
          Saves a Program to the database
 

Method Detail

saveProgram

Program saveProgram(Program program)
                    throws DAOException
Saves a Program to the database

Parameters:
program - - The Program to save
Returns:
The saved Program
Throws:
DAOException

getProgram

Program getProgram(java.lang.Integer programId)
                   throws DAOException
Retrieves a Program from the database by primary key programId

Parameters:
programId - - The primary key programId to use to retrieve a Program
Returns:
Program - The Program matching the passed programId
Throws:
DAOException

getAllPrograms

java.util.List<Program> getAllPrograms(boolean includeRetired)
                                       throws DAOException
Returns all programs

Parameters:
includeRetired - whether or not to include retired programs
Returns:
List all existing programs, including retired based on the input parameter
Throws:
DAOException

findPrograms

java.util.List<Program> findPrograms(java.lang.String nameFragment)
                                     throws DAOException
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

Parameters:
nameFragment - is the string used to search for programs
Returns:
List - list of Programs whose name matches the input parameter
Throws:
DAOException

deleteProgram

void deleteProgram(Program program)
                   throws DAOException
Completely remove a program from the database (not reversible) This method delegates to #purgeProgram(program, boolean) method

Parameters:
program - the Program to clean out of the database.
Throws:
DAOException

savePatientProgram

PatientProgram savePatientProgram(PatientProgram patientProgram)
                                  throws DAOException
Save patientProgram to database (create if new or update if changed)

Parameters:
patientProgram - is the PatientProgram to be saved to the database
Returns:
PatientProgram - the saved PatientProgram
Throws:
DAOException

getPatientProgram

PatientProgram getPatientProgram(java.lang.Integer id)
Returns a PatientProgram given that PatientPrograms primary key patientProgramId A null value is returned if no PatientProgram exists with this patientProgramId.

Parameters:
id - integer primary key of the PatientProgram to find
Returns:
PatientProgram object that has patientProgram.patientProgramId = patientProgramId passed in.
Throws:
DAOException

getPatientPrograms

java.util.List<PatientProgram> getPatientPrograms(Cohort cohort,
                                                  java.util.Collection<Program> programs)

getPatientPrograms

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 DAOException
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

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 - - boolean, if true will return voided PatientPrograms as well. If false, will not return voided PatientPrograms
Returns:
List of PatientPrograms that match the passed input parameters
Throws:
DAOException

deletePatientProgram

void deletePatientProgram(PatientProgram patientProgram)
                          throws DAOException
Completely remove a patientProgram from the database (not reversible) This method delegates to #purgePatientProgram(patientProgram, boolean) method

Parameters:
patientProgram - the PatientProgram to clean out of the database.
Throws:
DAOException

saveConceptStateConversion

ConceptStateConversion saveConceptStateConversion(ConceptStateConversion csc)
                                                  throws DAOException
Save ConceptStateConversion to database (create if new or update if changed)

Parameters:
csc - The ConceptStateConversion to save
Returns:
The saved ConceptStateConversion
Throws:
DAOException

getAllConceptStateConversions

java.util.List<ConceptStateConversion> getAllConceptStateConversions()
                                                                     throws DAOException
Returns all conceptStateConversions

Returns:
List of all ConceptStateConversions that exist
Throws:
DAOException

getConceptStateConversion

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.

Parameters:
id - integer primary key of the conceptStateConversion to find
Returns:
ConceptStateConversion object that has conceptStateConversion.conceptStateConversionId = conceptStateConversionId passed in.
Throws:
DAOException

deleteConceptStateConversion

void deleteConceptStateConversion(ConceptStateConversion csc)
Completely remove a conceptStateConversion from the database (not reversible)

Parameters:
csc - the ConceptStateConversion to clean out of the database.
Throws:
DAOException

getConceptStateConversion

ConceptStateConversion getConceptStateConversion(ProgramWorkflow workflow,
                                                 Concept trigger)
Retrieves the ConceptStateConversion that matches the passed ProgramWorkflow and Concept

Parameters:
workflow - the ProgramWorkflow to check
trigger - the Concept to check
Returns:
ConceptStateConversion that matches the passed ProgramWorkflow and Concept
Throws:
DAOException

getConceptStateConversionByUuid

ConceptStateConversion getConceptStateConversionByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getPatientProgramByUuid

PatientProgram getPatientProgramByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getProgramByUuid

Program getProgramByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getStateByUuid

ProgramWorkflowState getStateByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

getPatientStateByUuid

PatientState getPatientStateByUuid(java.lang.String uuid)

getWorkflowByUuid

ProgramWorkflow getWorkflowByUuid(java.lang.String uuid)
Auto generated method comment

Parameters:
uuid -
Returns:

OpenMRS-1.7.x

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