Search in sources :

Example 1 with PatientList

use of org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList in project dhis2-core by dhis2.

the class ActivityReportingServiceImpl method findPatients.

@Override
public org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList findPatients(String patientIds) throws NotAllowedException {
    PatientList patientlist = new PatientList();
    while (patientIds.length() > 0) {
        int patientId = Integer.parseInt(patientIds.substring(0, patientIds.indexOf("$")));
        TrackedEntityInstance patient = entityInstanceService.getTrackedEntityInstance(patientId);
        patientlist.getPatientList().add(getPatientModel(patient));
        patientIds = patientIds.substring(patientIds.indexOf("$") + 1, patientIds.length());
    }
    return patientlist;
}
Also used : PatientList(org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList) TrackedEntityInstance(org.hisp.dhis.trackedentity.TrackedEntityInstance)

Aggregations

PatientList (org.hisp.dhis.api.mobile.model.LWUITmodel.PatientList)1 TrackedEntityInstance (org.hisp.dhis.trackedentity.TrackedEntityInstance)1