Search in sources :

Example 6 with EnrollmentSmsSubmission

use of org.hisp.dhis.smscompression.models.EnrollmentSmsSubmission in project dhis2-core by dhis2.

the class EnrollmentSMSListenerTest method createEnrollmentSubmissionNoEvents.

private EnrollmentSmsSubmission createEnrollmentSubmissionNoEvents() {
    EnrollmentSmsSubmission subm = new EnrollmentSmsSubmission();
    subm.setUserId(user.getUid());
    subm.setOrgUnit(organisationUnit.getUid());
    subm.setTrackerProgram(program.getUid());
    subm.setTrackedEntityType(trackedEntityType.getUid());
    subm.setTrackedEntityInstance(trackedEntityInstance.getUid());
    subm.setEnrollment(programInstance.getUid());
    subm.setEnrollmentDate(new Date());
    subm.setIncidentDate(new Date());
    subm.setEnrollmentStatus(SmsEnrollmentStatus.ACTIVE);
    subm.setCoordinates(new GeoPoint(59.9399586f, 10.7195609f));
    ArrayList<SmsAttributeValue> values = new ArrayList<>();
    values.add(new SmsAttributeValue(trackedEntityAttribute.getUid(), ATTRIBUTE_VALUE));
    subm.setValues(values);
    subm.setSubmissionId(1);
    return subm;
}
Also used : GeoPoint(org.hisp.dhis.smscompression.models.GeoPoint) EnrollmentSmsSubmission(org.hisp.dhis.smscompression.models.EnrollmentSmsSubmission) SmsAttributeValue(org.hisp.dhis.smscompression.models.SmsAttributeValue) ArrayList(java.util.ArrayList) Date(java.util.Date)

Example 7 with EnrollmentSmsSubmission

use of org.hisp.dhis.smscompression.models.EnrollmentSmsSubmission in project dhis2-core by dhis2.

the class EnrollmentSMSListenerTest method createEnrollmentSubmissionNoAttribs.

private EnrollmentSmsSubmission createEnrollmentSubmissionNoAttribs() {
    EnrollmentSmsSubmission subm = createEnrollmentSubmissionNoEvents();
    subm.setValues(null);
    return subm;
}
Also used : EnrollmentSmsSubmission(org.hisp.dhis.smscompression.models.EnrollmentSmsSubmission)

Aggregations

EnrollmentSmsSubmission (org.hisp.dhis.smscompression.models.EnrollmentSmsSubmission)7 ArrayList (java.util.ArrayList)5 SmsEvent (org.hisp.dhis.smscompression.models.SmsEvent)4 Date (java.util.Date)2 OrganisationUnit (org.hisp.dhis.organisationunit.OrganisationUnit)1 Program (org.hisp.dhis.program.Program)1 ProgramInstance (org.hisp.dhis.program.ProgramInstance)1 GeoPoint (org.hisp.dhis.smscompression.models.GeoPoint)1 SmsAttributeValue (org.hisp.dhis.smscompression.models.SmsAttributeValue)1 Uid (org.hisp.dhis.smscompression.models.Uid)1 TrackedEntityInstance (org.hisp.dhis.trackedentity.TrackedEntityInstance)1 TrackedEntityType (org.hisp.dhis.trackedentity.TrackedEntityType)1 TrackedEntityAttributeValue (org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue)1 User (org.hisp.dhis.user.User)1