public class HibernateProgramWorkflowDAO extends Object implements ProgramWorkflowDAO
ProgramWorkflowService methods.ProgramWorkflowDAO,
ProgramWorkflowService| Constructor and Description |
|---|
HibernateProgramWorkflowDAO() |
| Modifier and Type | Method and Description |
|---|---|
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
|
List<Program> |
findPrograms(String nameFragment)
Returns programs that match the given string.
|
List<ConceptStateConversion> |
getAllConceptStateConversions()
Returns all conceptStateConversions
|
List<ProgramAttributeType> |
getAllProgramAttributeTypes() |
List<Program> |
getAllPrograms(boolean includeRetired)
Returns all programs
|
ConceptStateConversion |
getConceptStateConversion(Integer conceptStateConversionId)
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(String uuid) |
PatientProgram |
getPatientProgram(Integer patientProgramId)
Returns a PatientProgram given that PatientPrograms primary key
patientProgramId
A null value is returned if no PatientProgram exists with this patientProgramId. |
Map<Object,Object> |
getPatientProgramAttributeByAttributeName(List<Integer> patientIds,
String attributeName) |
PatientProgramAttribute |
getPatientProgramAttributeByUuid(String uuid) |
List<PatientProgram> |
getPatientProgramByAttributeNameAndValue(String attributeName,
String attributeValue) |
PatientProgram |
getPatientProgramByUuid(String uuid) |
List<PatientProgram> |
getPatientPrograms(Cohort cohort,
Collection<Program> programs) |
List<PatientProgram> |
getPatientPrograms(Patient patient,
Program program,
Date minEnrollmentDate,
Date maxEnrollmentDate,
Date minCompletionDate,
Date maxCompletionDate,
boolean includeVoided)
Returns PatientPrograms that match the input parameters.
|
PatientState |
getPatientStateByUuid(String uuid) |
Program |
getProgram(Integer programId)
Retrieves a
Program from the database by primary key programId |
ProgramAttributeType |
getProgramAttributeType(Integer id) |
ProgramAttributeType |
getProgramAttributeTypeByUuid(String uuid) |
Program |
getProgramByUuid(String uuid) |
List<Program> |
getProgramsByConcept(Concept concept)
Returns a list of Programs that are using a particular concept.
|
List<Program> |
getProgramsByName(String programName,
boolean includeRetired)
Retrieves the Programs from the dB which have the given name.
|
List<ProgramWorkflow> |
getProgramWorkflowsByConcept(Concept concept)
Returns a list of ProgramWorkflows that are using a particular concept.
|
List<ProgramWorkflowState> |
getProgramWorkflowStatesByConcept(Concept concept)
Returns a list of ProgramWorkflowStates that are using a particular concept.
|
ProgramWorkflowState |
getState(Integer stateId)
Retrieves a
ProgramWorkflowState from the database by its primary key. |
ProgramWorkflowState |
getStateByUuid(String uuid) |
ProgramWorkflow |
getWorkflow(Integer workflowId)
Retrieves a
ProgramWorkflow from the database by its primary key. |
ProgramWorkflow |
getWorkflowByUuid(String uuid) |
void |
purgeProgramAttributeType(ProgramAttributeType type) |
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
|
ProgramAttributeType |
saveProgramAttributeType(ProgramAttributeType programAttributeType) |
void |
setSessionFactory(org.hibernate.SessionFactory sessionFactory)
Hibernate Session Factory
|
public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
sessionFactory - public Program saveProgram(Program program) throws DAOException
ProgramWorkflowDAOsaveProgram in interface ProgramWorkflowDAOprogram - - The Program to saveProgramDAOExceptionProgramWorkflowDAO.saveProgram(org.openmrs.Program)public Program getProgram(Integer programId) throws DAOException
ProgramWorkflowDAOProgram from the database by primary key programIdgetProgram in interface ProgramWorkflowDAOprogramId - - The primary key programId to use to retrieve a ProgramProgram matching the passed programIdDAOExceptionProgramWorkflowDAO.getProgram(java.lang.Integer)public List<Program> getAllPrograms(boolean includeRetired) throws DAOException
ProgramWorkflowDAOgetAllPrograms in interface ProgramWorkflowDAOincludeRetired - whether or not to include retired programsDAOExceptionProgramWorkflowDAO.getAllPrograms(boolean)public List<Program> getProgramsByName(String programName, boolean includeRetired)
ProgramWorkflowDAOgetProgramsByName in interface ProgramWorkflowDAOprogramName - the name of the Programs to retrieve.includeRetired - whether to include retired programs or not
Should return an empty list when there is no program in the dB with given name
Should return only and exactly the programs with the given nameProgramWorkflowDAO.getProgramsByName(String, boolean)public List<Program> findPrograms(String nameFragment) throws DAOException
ProgramWorkflowDAOnameFragmentfindPrograms in interface ProgramWorkflowDAOnameFragment - is the string used to search for programsDAOExceptionProgramWorkflowDAO.findPrograms(java.lang.String)public void deleteProgram(Program program) throws DAOException
ProgramWorkflowDAOdeleteProgram in interface ProgramWorkflowDAOprogram - the Program to clean out of the database.DAOExceptionProgramWorkflowDAO.deleteProgram(org.openmrs.Program)public PatientProgram savePatientProgram(PatientProgram patientProgram) throws DAOException
ProgramWorkflowDAOsavePatientProgram in interface ProgramWorkflowDAOpatientProgram - is the PatientProgram to be saved to the databaseDAOExceptionProgramWorkflowDAO.savePatientProgram(org.openmrs.PatientProgram)public PatientProgram getPatientProgram(Integer patientProgramId) throws DAOException
ProgramWorkflowDAOpatientProgramId
A null value is returned if no PatientProgram exists with this patientProgramId.getPatientProgram in interface ProgramWorkflowDAOpatientProgramId - integer primary key of the PatientProgram to findpatientProgramId passed in.DAOExceptionProgramWorkflowDAO.getPatientProgram(java.lang.Integer)public List<PatientProgram> getPatientPrograms(Patient patient, Program program, Date minEnrollmentDate, Date maxEnrollmentDate, Date minCompletionDate, Date maxCompletionDate, boolean includeVoided) throws DAOException
ProgramWorkflowDAOgetPatientPrograms in interface ProgramWorkflowDAOpatient - - if supplied all PatientPrograms returned will be for this Patientprogram - - if supplied all PatientPrograms returned will be for this ProgramminEnrollmentDate - - if supplied will limit PatientPrograms to those with enrollments
on or after this DatemaxEnrollmentDate - - if supplied will limit PatientPrograms to those with enrollments
on or before this DateminCompletionDate - - if supplied will limit PatientPrograms to those completed on or
after this Date OR not yet completedmaxCompletionDate - - if supplied will limit PatientPrograms to those completed on or
before this DateincludeVoided - - boolean, if true will return voided PatientPrograms as well. If false,
will not return voided PatientProgramsDAOExceptionProgramWorkflowDAO.getPatientPrograms(Patient, Program, Date, Date,
Date, Date, boolean)public List<PatientProgram> getPatientPrograms(Cohort cohort, Collection<Program> programs)
getPatientPrograms in interface ProgramWorkflowDAOProgramWorkflowDAO.getPatientPrograms(org.openmrs.Cohort,
java.util.Collection)public void deletePatientProgram(PatientProgram patientProgram) throws DAOException
ProgramWorkflowDAOdeletePatientProgram in interface ProgramWorkflowDAOpatientProgram - the PatientProgram to clean out of the database.DAOExceptionProgramWorkflowDAO.deletePatientProgram(org.openmrs.PatientProgram)public ConceptStateConversion saveConceptStateConversion(ConceptStateConversion csc) throws DAOException
ProgramWorkflowDAOsaveConceptStateConversion in interface ProgramWorkflowDAOcsc - The ConceptStateConversion to saveDAOExceptionProgramWorkflowDAO.saveConceptStateConversion(org.openmrs.ConceptStateConversion)public List<ConceptStateConversion> getAllConceptStateConversions() throws DAOException
ProgramWorkflowDAOgetAllConceptStateConversions in interface ProgramWorkflowDAODAOExceptionProgramWorkflowDAO.getAllConceptStateConversions()public ConceptStateConversion getConceptStateConversion(Integer conceptStateConversionId)
ProgramWorkflowDAOconceptStateConversionId A null value is returned if no conceptStateConversion
exists with this conceptStateConversionId.getConceptStateConversion in interface ProgramWorkflowDAOconceptStateConversionId - integer primary key of the conceptStateConversion to findconceptStateConversionId passed in.ProgramWorkflowDAO.getConceptStateConversion(java.lang.Integer)public void deleteConceptStateConversion(ConceptStateConversion csc)
ProgramWorkflowDAOdeleteConceptStateConversion in interface ProgramWorkflowDAOcsc - the ConceptStateConversion to clean out of the database.ProgramWorkflowDAO.deleteConceptStateConversion(org.openmrs.ConceptStateConversion)public ConceptStateConversion getConceptStateConversion(ProgramWorkflow workflow, Concept trigger)
ProgramWorkflowDAOProgramWorkflow and
ConceptgetConceptStateConversion in interface ProgramWorkflowDAOworkflow - the ProgramWorkflow to checktrigger - the Concept to checkProgramWorkflow and
ConceptProgramWorkflowDAO.getConceptStateConversion(org.openmrs.ProgramWorkflow,
org.openmrs.Concept)public ConceptStateConversion getConceptStateConversionByUuid(String uuid)
getConceptStateConversionByUuid in interface ProgramWorkflowDAOProgramWorkflowDAO.getConceptStateConversionByUuid(java.lang.String)public PatientProgram getPatientProgramByUuid(String uuid)
getPatientProgramByUuid in interface ProgramWorkflowDAOProgramWorkflowDAO.getPatientProgramByUuid(java.lang.String)public Program getProgramByUuid(String uuid)
getProgramByUuid in interface ProgramWorkflowDAOProgramWorkflowDAO.getProgramByUuid(java.lang.String)public ProgramWorkflowState getState(Integer stateId)
ProgramWorkflowDAOProgramWorkflowState from the database by its primary key.getState in interface ProgramWorkflowDAOstateId - the primary key used to retrieve program workflow stateProgramWorkflowDAO.getState(Integer)public ProgramWorkflowState getStateByUuid(String uuid)
getStateByUuid in interface ProgramWorkflowDAOProgramWorkflowDAO.getStateByUuid(java.lang.String)public PatientState getPatientStateByUuid(String uuid)
getPatientStateByUuid in interface ProgramWorkflowDAOpublic ProgramWorkflow getWorkflow(Integer workflowId)
ProgramWorkflowDAOProgramWorkflow from the database by its primary key.getWorkflow in interface ProgramWorkflowDAOworkflowId - the primary key used to retrieve program workflowProgramWorkflowDAO.getWorkflow(Integer)public ProgramWorkflow getWorkflowByUuid(String uuid)
getWorkflowByUuid in interface ProgramWorkflowDAOProgramWorkflowDAO.getWorkflowByUuid(java.lang.String)public List<Program> getProgramsByConcept(Concept concept)
ProgramWorkflowDAOgetProgramsByConcept in interface ProgramWorkflowDAOconcept - - The Concept being used.ProgramWorkflowDAO.getProgramsByConcept(org.openmrs.Concept)public List<ProgramWorkflow> getProgramWorkflowsByConcept(Concept concept)
ProgramWorkflowDAOgetProgramWorkflowsByConcept in interface ProgramWorkflowDAOconcept - - The Concept being used.ProgramWorkflowDAO.getProgramWorkflowsByConcept(org.openmrs.Concept)public List<ProgramWorkflowState> getProgramWorkflowStatesByConcept(Concept concept)
ProgramWorkflowDAOgetProgramWorkflowStatesByConcept in interface ProgramWorkflowDAOconcept - - The Concept being used.ProgramWorkflowDAO.getProgramWorkflowStatesByConcept(org.openmrs.Concept)public List<ProgramAttributeType> getAllProgramAttributeTypes()
getAllProgramAttributeTypes in interface ProgramWorkflowDAOpublic ProgramAttributeType getProgramAttributeType(Integer id)
getProgramAttributeType in interface ProgramWorkflowDAOpublic ProgramAttributeType getProgramAttributeTypeByUuid(String uuid)
getProgramAttributeTypeByUuid in interface ProgramWorkflowDAOpublic ProgramAttributeType saveProgramAttributeType(ProgramAttributeType programAttributeType)
saveProgramAttributeType in interface ProgramWorkflowDAOpublic PatientProgramAttribute getPatientProgramAttributeByUuid(String uuid)
getPatientProgramAttributeByUuid in interface ProgramWorkflowDAOpublic void purgeProgramAttributeType(ProgramAttributeType type)
purgeProgramAttributeType in interface ProgramWorkflowDAOpublic List<PatientProgram> getPatientProgramByAttributeNameAndValue(String attributeName, String attributeValue)
getPatientProgramByAttributeNameAndValue in interface ProgramWorkflowDAOpublic Map<Object,Object> getPatientProgramAttributeByAttributeName(List<Integer> patientIds, String attributeName)
getPatientProgramAttributeByAttributeName in interface ProgramWorkflowDAOCopyright © 2024 OpenMRS Inc.. All rights reserved.