Search in sources :

Example 1 with ProgramEnrollmentCompletionNotificationEvent

use of org.hisp.dhis.program.notification.event.ProgramEnrollmentCompletionNotificationEvent in project dhis2-core by dhis2.

the class DefaultProgramInstanceService method completeProgramInstanceStatus.

@Override
@Transactional
public void completeProgramInstanceStatus(ProgramInstance programInstance) {
    // -----------------------------------------------------------------
    // Update program-instance
    // -----------------------------------------------------------------
    programInstance.setStatus(ProgramStatus.COMPLETED);
    updateProgramInstance(programInstance);
    // ---------------------------------------------------------------------
    // Send sms-message after program completion
    // ---------------------------------------------------------------------
    eventPublisher.publishEvent(new ProgramEnrollmentCompletionNotificationEvent(this, programInstance.getId()));
    eventPublisher.publishEvent(new EnrollmentEvaluationEvent(this, programInstance.getId()));
}
Also used : EnrollmentEvaluationEvent(org.hisp.dhis.programrule.engine.EnrollmentEvaluationEvent) ProgramEnrollmentCompletionNotificationEvent(org.hisp.dhis.program.notification.event.ProgramEnrollmentCompletionNotificationEvent) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

ProgramEnrollmentCompletionNotificationEvent (org.hisp.dhis.program.notification.event.ProgramEnrollmentCompletionNotificationEvent)1 EnrollmentEvaluationEvent (org.hisp.dhis.programrule.engine.EnrollmentEvaluationEvent)1 Transactional (org.springframework.transaction.annotation.Transactional)1