public interface ProgramWorkflowService extends OpenmrsService
Program program = new Program(); program.set___(___); ...etc Context.getProgramWorkflowService().saveProgram(program);
Modifier and Type | Method and Description |
---|---|
List<ConceptStateConversion> |
getAllConceptStateConversions()
Returns all conceptStateConversions
|
List<ProgramAttributeType> |
getAllProgramAttributeTypes() |
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.
|
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> patients,
String attributeName) |
PatientProgramAttribute |
getPatientProgramAttributeByUuid(String var1) |
List<PatientProgram> |
getPatientProgramByAttributeNameAndValue(String attributeName,
String attributeValue) |
PatientProgram |
getPatientProgramByUuid(String uuid)
Get a patient program by its 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)
Get a program state by its uuid.
|
List<Concept> |
getPossibleOutcomes(Integer programId)
Get all possible outcome concepts for a program.
|
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. |
ProgramAttributeType |
getProgramAttributeType(Integer var1) |
ProgramAttributeType |
getProgramAttributeTypeByUuid(String var1) |
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(String nameFragment)
Returns programs that match the given string.
|
List<Program> |
getProgramsByConcept(Concept concept)
Returns a list of Programs that are using a particular concept.
|
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)
Get
ProgramWorkflowState by internal identifier. |
ProgramWorkflowState |
getStateByUuid(String uuid)
Get a state by its uuid.
|
ProgramWorkflow |
getWorkflow(Integer workflowId)
Get
ProgramWorkflow by internal identifier. |
ProgramWorkflow |
getWorkflowByUuid(String uuid)
Get ProgramWorkflow by its UUID
|
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)
|
void |
purgeProgramAttributeType(ProgramAttributeType var1) |
Program |
retireProgram(Program program,
String reason)
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) |
ProgramAttributeType |
saveProgramAttributeType(ProgramAttributeType var1) |
void |
setProgramWorkflowDAO(ProgramWorkflowDAO dao)
Setter for the ProgramWorkflow DataAccessObject (DAO).
|
Program |
unretireProgram(Program program)
Unretires the given program
|
PatientProgram |
unvoidPatientProgram(PatientProgram patientProgram)
Unvoids the given patientProgram
|
PatientProgram |
voidPatientProgram(PatientProgram patientProgram,
String reason)
Voids the given patientProgram
|
onShutdown, onStartup
void 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
- Should create program workflows
Should save program successfully
Should save workflows associated with program
Should save states associated with program
Should update detached program@Authorized(value="Get Programs") 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
- Should return program matching the given programId
Should return null when programId does not exist@Authorized(value="Get Programs") 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
ProgramNameDuplicatedException
- when there are more than one program in the dB with
the given name.
Should return program when name matches
Should return null when program does not exist with given name
Should fail when two programs found with same name@Authorized(value="Get Programs") List<Program> getAllPrograms() throws APIException
APIException
@Authorized(value="Get Programs") List<Program> getAllPrograms(boolean includeRetired) throws APIException
includeRetired
- whether or not to include retired programsAPIException
- Should return all programs including retired when includeRetired equals true
Should return all programs excluding retired when includeRetired equals false@Authorized(value="Get Programs") List<Program> getPrograms(String nameFragment) throws APIException
nameFragment
nameFragment
- is the string used to search for programsAPIException
- Should return all programs with partial name match
Should return all programs when exact name match
Should return empty list when name does not match
Should not return a null list
Should return programs when nameFragment matches beginning of program name
Should return programs when nameFragment matches ending of program name
Should return programs when nameFragment matches middle of program name
Should return programs when nameFragment matches entire program name
Should return programs ordered by name
Should return empty list when nameFragment does not match any@Authorized(value="Manage Programs") void purgeProgram(Program program) throws APIException
program
- the Program to clean out of the database.APIException
- Should delete program successfully@Authorized(value="Manage Programs") void purgeProgram(Program program, boolean cascade) throws APIException
cascade
- true
to delete related contentAPIException
- Should delete program successfully
Should not delete child associations when cascade equals false
Should throw APIException when given cascade equals true
Should purge program with patients enrolled@Authorized(value="Manage Programs") Program retireProgram(Program program, String reason) throws APIException
program
- Program to be retiredreason
- String for retiring the programAPIException
- Should retire program successfully
Should retire workflows associated with given program
Should retire states associated with given program@Authorized(value="Manage Programs") Program unretireProgram(Program program) throws APIException
program
- Program to be unretiredAPIException
- Should unretire program successfully
Should unretire workflows associated with given program
Should unretire states associated with given programProgram getProgramByUuid(String uuid)
uuid
- the universally unique identifierPatientState 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
- Should update patient program
Should save patient program successfully
Should return patient program with assigned patient program id@Authorized(value="Get Patient Programs") 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
- Should return patient program with given patientProgramId
Should get patient program with given identifier
Should return null if program does not exist@Authorized(value="Get Patient Programs") 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
- Should return patient programs for given patient
Should return patient programs for given program
Should return patient programs with dateEnrolled on or before minEnrollmentDate
Should return patient programs with dateEnrolled on or after maxEnrollmentDate
Should return patient programs with dateCompleted on or before minCompletionDate
Should return patient programs with dateCompleted on or after maxCompletionDate
Should return patient programs with dateCompleted
Should return patient programs not yet completed
Should return voided patient programs
Should return all patient programs when all parameters are null
Should return empty list when matches not found@Authorized(value="Purge Patient Programs") void purgePatientProgram(PatientProgram patientProgram) throws APIException
patientProgram
- the PatientProgram to clean out of the database.APIException
- Should delete patient program from database without cascade@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
- Should delete patient program from database
Should cascade delete patient program states when cascade equals true
Should not cascade delete patient program states when cascade equals false@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
- Should void patient program when reason is valid
Should fail when reason is empty@Authorized(value="Delete Patient Programs") PatientProgram unvoidPatientProgram(PatientProgram patientProgram) throws APIException
patientProgram
- patientProgram to be un-voidedAPIException
- Should void patient program when reason is valid@Authorized(value="Get Programs") List<Concept> getPossibleOutcomes(Integer programId)
Concept.getAnswers()
if they exist, then all concept set members
Concept.getSetMembers()
if they exist, then empty List.programId
- ProgramWorkflow getWorkflow(Integer workflowId)
ProgramWorkflow
by internal identifier.workflowId
- the primary key of the workflow to find, null not okProgramWorkflow getWorkflowByUuid(String uuid)
uuid
- @Authorized(value={"Add Patient Programs","Edit Patient Programs"}) ConceptStateConversion saveConceptStateConversion(ConceptStateConversion conceptStateConversion) throws APIException
conceptStateConversion
- - The ConceptStateConversion to saveAPIException
- Should save state conversion@Authorized(value="Get Programs") 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
- Should return concept state conversion for given identifier@Authorized(value="Get Programs") List<ConceptStateConversion> getAllConceptStateConversions() throws APIException
APIException
- Should return all concept state conversions@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 contentAPIException
- Should cascade delete given concept state conversion when given cascade is true
Should not cascade delete given concept state conversion when given cascade is falseConceptStateConversion getConceptStateConversion(ProgramWorkflow workflow, Concept trigger) throws APIException
ProgramWorkflow
and
Concept
workflow
- - the ProgramWorkflow to checktrigger
- - the Concept to checkProgramWorkflow
and
Concept
APIException
- Should return concept state conversion for given workflow and triggerProgramWorkflowState getState(Integer stateId)
ProgramWorkflowState
by internal identifier.stateId
- the primary key of the state to find, null not okProgramWorkflowState getStateByUuid(String uuid)
uuid
- the universally unique identifierPatientProgram getPatientProgramByUuid(String uuid)
uuid
- the universally unique identifier@Authorized(value="Get Patient Programs") List<PatientProgram> getPatientPrograms(Cohort cohort, Collection<Program> programs)
cohort
- programs
- @Authorized(value="Get Patient Programs") List<Program> getProgramsByConcept(Concept concept)
concept
- - The Concept being used.@Authorized(value="Get Patient Programs") List<ProgramWorkflow> getProgramWorkflowsByConcept(Concept concept)
concept
- - The Concept being used.@Authorized(value="Get Patient Programs") List<ProgramWorkflowState> getProgramWorkflowStatesByConcept(Concept concept)
concept
- - The Concept being used.ConceptStateConversion getConceptStateConversionByUuid(String uuid)
uuid
- the universally unique identifier@Transactional(readOnly=true) @Authorized(value="Get Patient Program Attribute Types") List<ProgramAttributeType> getAllProgramAttributeTypes()
@Transactional(readOnly=true) @Authorized(value="Get Patient Program Attribute Types") ProgramAttributeType getProgramAttributeType(Integer var1)
@Transactional(readOnly=true) @Authorized(value="Get Patient Program Attribute Types") ProgramAttributeType getProgramAttributeTypeByUuid(String var1)
@Authorized(value="Manage Patient Program Attribute Types") ProgramAttributeType saveProgramAttributeType(ProgramAttributeType var1)
@Authorized(value="Purge Patient Program Attribute Types") void purgeProgramAttributeType(ProgramAttributeType var1)
@Transactional(readOnly=true) @Authorized(value="Get Patient Programs") PatientProgramAttribute getPatientProgramAttributeByUuid(String var1)
Map<Object,Object> getPatientProgramAttributeByAttributeName(List<Integer> patients, String attributeName)
@Transactional(readOnly=true) @Authorized(value="Get Patient Programs") List<PatientProgram> getPatientProgramByAttributeNameAndValue(String attributeName, String attributeValue)
Copyright © 2024 OpenMRS Inc.. All rights reserved.