private void searchPatientByNameAndOrgUnit( List<String> searchText, OrganisationUnit organisationUnit) { total = patientService.countGetPatientsByOrgUnit(organisationUnit); this.paging = createPaging(total); // Collection<Patient> tempPatients = new ArrayList<Patient>(); for (String text : searchText) { // tPatients( OrganisationUnit organisationUnit, String searchText, int min, int max ) List<Patient> tempPatients = new ArrayList<Patient>( patientService.getPatients( organisationUnit, text, paging.getStartPos(), paging.getPageSize())); patients.addAll(tempPatients); } total = patients.size(); this.paging = createPaging(total); Collection<PatientAttributeValue> attributeValues = patientAttributeValueService.getPatientAttributeValues(patients); for (Patient patient : patients) { // programs.addAll( patient.getPrograms() ); mapPatientOrgunit.put(patient.getId(), getHierarchyOrgunit(patient.getOrganisationUnit())); for (PatientAttributeValue attributeValue : attributeValues) { mapPatientPatientAttr.put( patient.getId() + "-" + attributeValue.getPatientAttribute().getId(), attributeValue.getValue()); } // mapPatientPrograms.put( patient.getId(), getProgramsByPatient( patient ) ); } }