@Transactional public interface ProgramWorkflowService extends OpenmrsService
Program program = new Program(); program.set___(___); ...etc Context.getProgramWorkflowService().saveProgram(program);
| Modifier and Type | Method and Description |
|---|---|
void |
changeToState(PatientProgram patientProgram,
ProgramWorkflow workflow,
ProgramWorkflowState state,
Date onDate)
Deprecated.
|
void |
createConceptStateConversion(ConceptStateConversion conceptStateConversion)
Deprecated.
|
void |
createOrUpdateProgram(Program program)
Deprecated.
|
void |
createPatientProgram(PatientProgram patientProgram)
Deprecated.
|
void |
createWorkflow(ProgramWorkflow programWorkflow)
Deprecated.
|
void |
deleteConceptStateConversion(ConceptStateConversion csc)
Deprecated.
|
void |
enrollPatientInProgram(Patient patient,
Program program,
Date enrollmentDate,
Date completionDate,
User creator)
Deprecated.
use {new PatientProgram(...) followed by @link
#savePatientProgram(PatientProgram)}
|
List<ConceptStateConversion> |
getAllConceptStateConversions()
Returns all conceptStateConversions
|
List<ConceptStateConversion> |
getAllConversions()
Deprecated.
|
List<Program> |
getAllPrograms()
Returns all programs, includes retired programs.
|
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)
Get a concept state conversion by its uuid.
|
Collection<PatientProgram> |
getCurrentPrograms(Patient patient,
Date onDate)
|
Set<ProgramWorkflow> |
getCurrentWorkflowsByPatient(Patient patient)
Deprecated.
No current use outside of this service. Should be retrieved from Patient,
PatientProgram, and PatientState
|
Set<ProgramWorkflow> |
getCurrentWorkflowsByPatientProgram(PatientProgram program)
Deprecated.
No current use outside of this service. Should be retrieved from Patient,
PatientProgram, and PatientState
|
PatientState |
getLatestState(PatientProgram patientProgram,
ProgramWorkflow programWorkflow)
Deprecated.
|
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. |
PatientProgram |
getPatientProgramByUuid(String uuid)
Get a patient program by its uuid.
|
List<PatientProgram> |
getPatientPrograms(Cohort cohort,
Collection<Program> programs)
TODO: refactor?
|
Collection<PatientProgram> |
getPatientPrograms(Patient patient)
|
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 |
getPatientState(Integer patientStateId)
Deprecated.
|
PatientState |
getPatientStateByUuid(String uuid)
Get a program state by its uuid.
|
List<ProgramWorkflowState> |
getPossibleNextStates(PatientProgram patientProgram,
ProgramWorkflow workflow)
Deprecated.
|
Program |
getProgram(Integer programId)
Returns a program given that programs primary key
programId A null value is
returned if no program exists with this programId. |
Program |
getProgram(String name)
Deprecated.
|
Program |
getProgramByName(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(String uuid)
Get a program by its uuid.
|
List<Program> |
getPrograms()
Deprecated.
use
getAllPrograms() |
List<Program> |
getPrograms(String nameFragment)
Returns programs that match the given string.
|
ProgramWorkflowState |
getState(Integer id)
Deprecated.
ProgramWorkflowStates should be retrieved from the
ProgramWorkflow they
belong to |
ProgramWorkflowState |
getState(ProgramWorkflow programWorkflow,
String name)
Deprecated.
ProgramWorkflowStates should be retrieved from the
ProgramWorkflow they
belong to |
ProgramWorkflowState |
getStateByUuid(String uuid)
Get a state by its uuid.
|
List<ProgramWorkflowState> |
getStates()
Deprecated.
ProgramWorkflowStates should be retrieved from the
ProgramWorkflow they
belong to |
List<ProgramWorkflowState> |
getStates(boolean includeVoided)
Deprecated.
ProgramWorkflowStates should be retrieved from the
ProgramWorkflow they
belong to |
ProgramWorkflow |
getWorkflow(Integer id)
Deprecated.
ProgramWorkflows should not be retrieved directly, but rather through the
programs they belong to: use
Program.getWorkflows() |
ProgramWorkflow |
getWorkflow(Program program,
String name)
Deprecated.
|
ProgramWorkflow |
getWorkflowByUuid(String uuid)
Get ProgramWorkflow by its UUID
|
boolean |
isInProgram(Patient patient,
Program program,
Date fromDate,
Date toDate)
|
boolean |
isLegalTransition(ProgramWorkflowState fromState,
ProgramWorkflowState toState)
|
Collection<Integer> |
patientsInProgram(Program program,
Date fromDate,
Date toDate)
Deprecated.
use
getPatientPrograms(Patient, Program, Date, Date, Date, Date, boolean)
which can be Iterated across to return collection of patient ids |
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 conceptStateConversion)
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,
Date terminatedOn)
Deprecated.
|
void |
triggerStateConversion(Patient patient,
Concept reasonForExit,
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 conceptStateConversion)
Deprecated.
|
void |
updatePatientProgram(PatientProgram patientProgram)
Deprecated.
|
void |
updateWorkflow(ProgramWorkflow programWorkflow)
Deprecated.
|
void |
voidLastState(PatientProgram patientProgram,
ProgramWorkflow wf,
String voidReason)
|
PatientProgram |
voidPatientProgram(PatientProgram patientProgram,
String reason)
Voids the given patientProgram
|
void |
voidWorkflow(ProgramWorkflow programWorkflow,
String reason)
Deprecated.
|
onShutdown, onStartupvoid setProgramWorkflowDAO(ProgramWorkflowDAO dao)
dao - - The DAO for this service@Authorized(value="Manage Programs") Program saveProgram(Program program) throws APIException
program to database (create if new or update if changed)program - is the Program to be saved to the databaseAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) Program getProgram(Integer programId) throws APIException
programId A null value is
returned if no program exists with this programId.programId - integer primary key of the program to findprogramId passed in.APIException@Transactional(readOnly=true) Program getProgram(String name)
getProgramByName(String)@Authorized(value="View Programs") @Transactional(readOnly=true) Program getProgramByName(String name) throws APIException
name A null value is returned if
there is no program with this namename - the exact name of the program to match onname to Program.nameAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) List<Program> getAllPrograms() throws APIException
APIException@Authorized(value="View Programs") @Transactional(readOnly=true) List<Program> getAllPrograms(boolean includeRetired) throws APIException
includeRetired - whether or not to include retired programsAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) List<Program> getPrograms(String nameFragment) throws APIException
nameFragmentnameFragment - is the string used to search for programsAPIException@Authorized(value="Manage Programs") void purgeProgram(Program program) throws APIException
program - the Program to clean out of the database.APIException@Authorized(value="Manage Programs") void purgeProgram(Program program, boolean cascade) throws APIException
cascade - true to delete related contentAPIException@Authorized(value="Manage Programs") Program retireProgram(Program program) throws APIException
program - Program to be retiredAPIException@Authorized(value="Manage Programs") Program unRetireProgram(Program program) throws APIException
program - Program to be unretiredAPIException@Transactional(readOnly=true) Program getProgramByUuid(String uuid)
uuid - the universally unique identifier@Transactional(readOnly=true) PatientState getPatientStateByUuid(String uuid)
uuid - the universally unique identifier@Authorized(value={"Add Patient Programs","Edit Patient Programs"}) PatientProgram savePatientProgram(PatientProgram patientProgram) throws APIException
patientProgram - is the PatientProgram to be saved to the databaseAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) PatientProgram getPatientProgram(Integer patientProgramId) throws APIException
patientProgramId
A null value is returned if no PatientProgram exists with this patientProgramId.patientProgramId - integer primary key of the PatientProgram to findpatientProgramId passed in.APIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) List<PatientProgram> getPatientPrograms(Patient patient, Program program, Date minEnrollmentDate, Date maxEnrollmentDate, Date minCompletionDate, Date maxCompletionDate, boolean includeVoided) throws APIException
patient - 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 - if true, will also include voided PatientProgramsAPIException@Authorized(value="Purge Patient Programs") void purgePatientProgram(PatientProgram patientProgram) throws APIException
patientProgram - the PatientProgram to clean out of the database.APIException@Authorized(value="Purge Patient Programs") void purgePatientProgram(PatientProgram patientProgram, boolean cascade) throws APIException
patientProgram - the PatientProgram to clean out of the database.cascade - true to delete related contentAPIException@Authorized(value="Delete Patient Programs") PatientProgram voidPatientProgram(PatientProgram patientProgram, String reason) throws APIException
patientProgram - patientProgram to be voidedreason - is the reason why the patientProgram is being voidedAPIException@Authorized(value="Delete Patient Programs") PatientProgram unvoidPatientProgram(PatientProgram patientProgram) throws APIException
patientProgram - patientProgram to be un-voidedAPIException@Transactional(readOnly=true) ProgramWorkflow getWorkflowByUuid(String uuid)
uuid - @Authorized(value={"Add Patient Programs","Edit Patient Programs"}) ConceptStateConversion saveConceptStateConversion(ConceptStateConversion conceptStateConversion) throws APIException
conceptStateConversion - - The ConceptStateConversion to saveAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) ConceptStateConversion getConceptStateConversion(Integer conceptStateConversionId) throws APIException
conceptStateConversionId A null value is returned if no conceptStateConversion
exists with this conceptStateConversionId.conceptStateConversionId - integer primary key of the conceptStateConversion to findconceptStateConversionId passed in.APIException@Authorized(value="View Programs") @Transactional(readOnly=true) List<ConceptStateConversion> getAllConceptStateConversions() throws APIException
APIException@Authorized(value="Manage Programs") void purgeConceptStateConversion(ConceptStateConversion conceptStateConversion) throws APIException
conceptStateConversion - the ConceptStateConversion to clean out of the database.APIException@Authorized(value="Manage Programs") void purgeConceptStateConversion(ConceptStateConversion conceptStateConversion, boolean cascade) throws APIException
conceptStateConversion - the ConceptStateConversion to clean out of the database.cascade - true to delete related contentAPIExceptionvoid triggerStateConversion(Patient patient, Concept reasonForExit, Date dateConverted) throws APIException
reasonForExit
concept and any ProgramWorkflow in the PatientPrograms for the patientpatient - - the Patient to trigger the ConceptStateConversion onreasonForExit - - the Concept to trigger the ConceptStateConversiondateConverted - - the Date of the ConceptStateConversionAPIException@Transactional(readOnly=true) ConceptStateConversion getConceptStateConversion(ProgramWorkflow workflow, Concept trigger) throws APIException
ProgramWorkflow and
Conceptworkflow - - the ProgramWorkflow to checktrigger - - the Concept to checkProgramWorkflow and
ConceptAPIException@Authorized(value="Manage Programs") void createOrUpdateProgram(Program program) throws APIException
saveProgram(Program)program - Program to createAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) List<Program> getPrograms() throws APIException
getAllPrograms()APIException@Authorized(value="Manage Programs") void createWorkflow(ProgramWorkflow programWorkflow) throws APIException
followed by @link
#saveProgram(Program)programWorkflow - - The ProgramWorkflow to createAPIException@Authorized(value="Manage Programs") void updateWorkflow(ProgramWorkflow programWorkflow) throws APIException
to save changes to all ProgramWorkflows for the
given ProgramprogramWorkflow - - The ProgramWorkflow to updateAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) ProgramWorkflow getWorkflow(Integer id) throws APIException
Program.getWorkflows()programWorkflowIdid - integer primary key of the ProgramWorkflow to findAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) ProgramWorkflow getWorkflow(Program program, String name) throws APIException
Program.getWorkflowByName(String)program - - The Program of the ProgramWorkflow to returnname - - The name of the ProgramWorkflow to returnAPIException@Authorized(value="Manage Programs") void voidWorkflow(ProgramWorkflow programWorkflow, String reason) throws APIException
followed by @link
#saveProgram(Program)programWorkflow - - The ProgramWorkflow to retirereason - - The reason for retiring the ProgramWorkflowAPIException@Transactional(readOnly=true) ProgramWorkflowState getStateByUuid(String uuid)
uuid - the universally unique identifier@Authorized(value="View Programs") @Transactional(readOnly=true) List<ProgramWorkflowState> getStates() throws APIException
ProgramWorkflow they
belong toAPIExceptionProgramWorkflow.getStates()@Authorized(value="View Programs") @Transactional(readOnly=true) List<ProgramWorkflowState> getStates(boolean includeVoided) throws APIException
ProgramWorkflow they
belong toincludeVoided - - if false, only returns non-voided ProgramWorkflowStatesAPIExceptionProgramWorkflow.getStates(boolean)@Authorized(value="View Programs") @Transactional(readOnly=true) ProgramWorkflowState getState(Integer id) throws APIException
ProgramWorkflow they
belong toid - - The primary key id of the ProgramWorkflowState to returnAPIExceptionProgramWorkflow.getState(Integer)@Authorized(value="View Programs") @Transactional(readOnly=true) ProgramWorkflowState getState(ProgramWorkflow programWorkflow, String name) throws APIException
ProgramWorkflow they
belong toname in the passed
programWorkflowprogramWorkflow - - The programWorkflow to check for ProgramWorkflowStatename - - the name of the programWorkflowState to look forname in
the passed programWorkflowAPIExceptionProgramWorkflow.getStateByName(String)@Authorized(value="View Programs") @Transactional(readOnly=true) List<ProgramWorkflowState> getPossibleNextStates(PatientProgram patientProgram, ProgramWorkflow workflow) throws APIException
ProgramWorkflow.getPossibleNextStates(PatientProgram)patientProgram - - the PatientProgram to retrieve possible next transitions fromworkflow - - the ProgramWorkflow to retrieve possible next transitions fromAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) boolean isLegalTransition(ProgramWorkflowState fromState, ProgramWorkflowState toState) throws APIException
fromState - - the ProgramWorkflowState to use as the state to check transitions fromtoState - - the ProgramWorkflowState to use as the state to check transitions into from
fromStatefromState to
toStateAPIException@Authorized(value="Add Patient Programs") void createPatientProgram(PatientProgram patientProgram) throws APIException
savePatientProgram(PatientProgram)patientProgram - - The PatientProgram to createAPIException@Authorized(value="Edit Patient Programs") void updatePatientProgram(PatientProgram patientProgram) throws APIException
savePatientProgram(PatientProgram)patientProgram - - The PatientProgram to updateAPIException@Authorized(value="Add Patient Programs") void enrollPatientInProgram(Patient patient, Program program, Date enrollmentDate, Date completionDate, User creator) throws APIException
patient - - The Patient to enrollprogram - - The Program to enroll the patient intoenrollmentDate - - The Date to use as the enrollment date in the program
for the patientcompletionDate - - The Date to use as the completion date in the program
for the patientcreator - - The User who is enrolling this patientAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) Collection<PatientProgram> getPatientPrograms(Patient patient) throws APIException
patientpatient - - The Patient to retrieve all PatientPrograms forpatientAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) Collection<Integer> patientsInProgram(Program program, Date fromDate, Date toDate) throws APIException
getPatientPrograms(Patient, Program, Date, Date, Date, Date, boolean)
which can be Iterated across to return collection of patient idsprogram - - The Program to check for patient enrollmentfromDate - - Used to check whether patients were enrolled in the program on
or after this DatetoDate - - Used to check whether patients were enrolled in the program on
or before this Dateprogram between fromDate and toDateAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) Collection<PatientProgram> getCurrentPrograms(Patient patient, Date onDate) throws APIException
patient - - The Patient to check for program enrollmentonDate - - Specifies only to return programs that the patient is in as of this Datepatient as of onDateAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) boolean isInProgram(Patient patient, Program program, Date fromDate, Date toDate) throws APIException
patient - - The Patient to check for enrollmentprogram - - The Program to check for enrollmentfromDate - - Used to check whether patients were enrolled in the program on
or after this DatetoDate - - Used to check whether patients were enrolled in the program on
or before this Datepatient was enrolled in the
program between fromDate and toDateAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) PatientState getPatientState(Integer patientStateId) throws APIException
PatientProgram.getPatientState(Integer)patientStateId - - The primary key id of the PatientState to returnpatientStateIdAPIExceptionPatientProgram@Authorized(value="View Patient Programs") @Transactional(readOnly=true) PatientState getLatestState(PatientProgram patientProgram, ProgramWorkflow programWorkflow) throws APIException
PatientProgram.getCurrentState(ProgramWorkflow)patientProgram - - The PatientProgram whose states to checkprogramWorkflow - - The ProgramWorkflow whose current state to check within the given
patientProgramprogramWorkflow within the given patientProgramAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) Set<ProgramWorkflow> getCurrentWorkflowsByPatient(Patient patient) throws APIException
patient - - The Patient to checkpatientAPIException@Authorized(value="View Patient Programs") @Transactional(readOnly=true) Set<ProgramWorkflow> getCurrentWorkflowsByPatientProgram(PatientProgram program) throws APIException
program - - The PatientProgram to checkprogramAPIException@Authorized(value={"Add Patient Programs","Edit Patient Programs"}) void changeToState(PatientProgram patientProgram, ProgramWorkflow workflow, ProgramWorkflowState state, Date onDate) throws APIException
PatientProgram.transitionToState(ProgramWorkflowState, Date)patientProgram - - The PatientProgram whose state you wish to changeworkflow - - The ProgramWorkflow whose within the patientProgram whose
state you wish to changestate - - The ProgramWorkflowState you wish to change the ProgramWorkflow toonDate - - The Date that you wish the State change to take placeAPIException@Transactional(readOnly=true) PatientProgram getPatientProgramByUuid(String uuid)
uuid - the universally unique identifier@Transactional(readOnly=true) @Authorized(value="View Patient Programs") List<PatientProgram> getPatientPrograms(Cohort cohort, Collection<Program> programs)
cohort - programs - @Authorized(value={"Add Patient Programs","Edit Patient Programs"}) void terminatePatientProgram(PatientProgram patientProgram, ProgramWorkflowState finalState, Date terminatedOn)
PatientProgram.transitionToState(ProgramWorkflowState, Date)patientProgram - - The PatientProgram whose state you wish to changefinalState - - The ProgramWorkflowState you wish to change the ProgramWorkflow toterminatedOn - - The Date that you wish the State change to take placeAPIException@Authorized(value="Edit Patient Programs") void voidLastState(PatientProgram patientProgram, ProgramWorkflow wf, String voidReason) throws APIException
patientProgram - - The patientProgram to checkwf - - The ProgramWorkflow to checkvoidReason - - The reason for voidingAPIException@Authorized(value="Add Patient Programs") void createConceptStateConversion(ConceptStateConversion conceptStateConversion) throws APIException
saveConceptStateConversion(ConceptStateConversion)conceptStateConversion - - The ConceptStateConversion to createAPIException@Authorized(value="Edit Patient Programs") void updateConceptStateConversion(ConceptStateConversion conceptStateConversion) throws APIException
saveConceptStateConversion(ConceptStateConversion)conceptStateConversion - - The ConceptStateConversion to updateAPIException@Authorized(value="View Programs") @Transactional(readOnly=true) List<ConceptStateConversion> getAllConversions() throws APIException
getAllConceptStateConversions()APIExceptiongetAllConceptStateConversions()void deleteConceptStateConversion(ConceptStateConversion csc) throws APIException
purgeConceptStateConversion(ConceptStateConversion)csc - - The ConceptStateConversion to delete from the databaseAPIException@Transactional(readOnly=true) ConceptStateConversion getConceptStateConversionByUuid(String uuid)
uuid - the universally unique identifierCopyright © 2018 OpenMRS LLC.. All Rights Reserved.