Search in sources :

Example 1 with GeoPoint

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

the class SimpleEventSMSListenerTest method createSimpleEventSubmission.

private SimpleEventSmsSubmission createSimpleEventSubmission() {
    SimpleEventSmsSubmission subm = new SimpleEventSmsSubmission();
    subm.setUserId(user.getUid());
    subm.setOrgUnit(organisationUnit.getUid());
    subm.setEventProgram(program.getUid());
    subm.setAttributeOptionCombo(categoryOptionCombo.getUid());
    subm.setEvent(programStageInstance.getUid());
    subm.setEventStatus(SmsEventStatus.COMPLETED);
    subm.setEventDate(new Date());
    subm.setDueDate(new Date());
    subm.setCoordinates(new GeoPoint(59.9399586f, 10.7195609f));
    ArrayList<SmsDataValue> values = new ArrayList<>();
    values.add(new SmsDataValue(categoryOptionCombo.getUid(), dataElement.getUid(), "true"));
    subm.setValues(values);
    subm.setSubmissionId(1);
    return subm;
}
Also used : GeoPoint(org.hisp.dhis.smscompression.models.GeoPoint) SimpleEventSmsSubmission(org.hisp.dhis.smscompression.models.SimpleEventSmsSubmission) SmsDataValue(org.hisp.dhis.smscompression.models.SmsDataValue) ArrayList(java.util.ArrayList) Date(java.util.Date)

Example 2 with GeoPoint

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

the class TrackerEventSMSListenerTest method createTrackerEventSubmission.

private TrackerEventSmsSubmission createTrackerEventSubmission() {
    TrackerEventSmsSubmission subm = new TrackerEventSmsSubmission();
    subm.setUserId(user.getUid());
    subm.setOrgUnit(organisationUnit.getUid());
    subm.setProgramStage(programStage.getUid());
    subm.setAttributeOptionCombo(categoryOptionCombo.getUid());
    subm.setEnrollment(programInstance.getUid());
    subm.setEvent(programStageInstance.getUid());
    subm.setEventStatus(SmsEventStatus.COMPLETED);
    subm.setEventDate(new Date());
    subm.setDueDate(new Date());
    subm.setCoordinates(new GeoPoint(59.9399586f, 10.7195609f));
    ArrayList<SmsDataValue> values = new ArrayList<>();
    values.add(new SmsDataValue(categoryOptionCombo.getUid(), dataElement.getUid(), "10"));
    subm.setValues(values);
    subm.setSubmissionId(1);
    return subm;
}
Also used : GeoPoint(org.hisp.dhis.smscompression.models.GeoPoint) SmsDataValue(org.hisp.dhis.smscompression.models.SmsDataValue) ArrayList(java.util.ArrayList) TrackerEventSmsSubmission(org.hisp.dhis.smscompression.models.TrackerEventSmsSubmission) Date(java.util.Date)

Example 3 with GeoPoint

use of org.hisp.dhis.smscompression.models.GeoPoint 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 4 with GeoPoint

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

the class EnrollmentSMSListenerTest method createEvent.

private SmsEvent createEvent() {
    SmsEvent event = new SmsEvent();
    event.setOrgUnit(organisationUnit.getUid());
    event.setProgramStage(programStage.getUid());
    event.setAttributeOptionCombo(categoryOptionCombo.getUid());
    event.setEvent(programStageInstance.getUid());
    event.setEventStatus(SmsEventStatus.COMPLETED);
    event.setEventDate(new Date());
    event.setDueDate(new Date());
    event.setCoordinates(new GeoPoint(59.9399586f, 10.7195609f));
    ArrayList<SmsDataValue> eventValues = new ArrayList<>();
    eventValues.add(new SmsDataValue(categoryOptionCombo.getUid(), dataElement.getUid(), "10"));
    event.setValues(eventValues);
    return event;
}
Also used : GeoPoint(org.hisp.dhis.smscompression.models.GeoPoint) SmsDataValue(org.hisp.dhis.smscompression.models.SmsDataValue) SmsEvent(org.hisp.dhis.smscompression.models.SmsEvent) ArrayList(java.util.ArrayList) Date(java.util.Date)

Aggregations

ArrayList (java.util.ArrayList)4 Date (java.util.Date)4 GeoPoint (org.hisp.dhis.smscompression.models.GeoPoint)4 SmsDataValue (org.hisp.dhis.smscompression.models.SmsDataValue)3 EnrollmentSmsSubmission (org.hisp.dhis.smscompression.models.EnrollmentSmsSubmission)1 SimpleEventSmsSubmission (org.hisp.dhis.smscompression.models.SimpleEventSmsSubmission)1 SmsAttributeValue (org.hisp.dhis.smscompression.models.SmsAttributeValue)1 SmsEvent (org.hisp.dhis.smscompression.models.SmsEvent)1 TrackerEventSmsSubmission (org.hisp.dhis.smscompression.models.TrackerEventSmsSubmission)1