openmrs-client/src/main/java/org/openmrs/mobile/activities/syncedpatients/SyncedPatientsPresenter.java
/**
     * Used to update local patients list
     * It handles search events and replaces View's data to display
     */
Used to update local patients list
It handles search events and replaces View's data to display
Used to update local patients list It handles search events and replaces View ' s data to display
@Override
    public void updateLocalPatientsList() {
        addSubscription(patientDAO.getAllPatients()
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(patientList -> {
                boolean isFiltering = StringUtils.notNull(mQuery) && !mQuery.isEmpty();
                if (isFiltering) {
                    patientList = FilterUtil.getPatientsFilteredByQuery(patientList, mQuery);
                    if (patientList.isEmpty()) {
                        syncedPatientsView.updateListVisibility(false, mQuery);
                    } else {
                        syncedPatientsView.updateListVisibility(true);
                    }
                } else {
                    if (patientList.isEmpty()) {
                        syncedPatientsView.updateListVisibility(false);
                    } else {
                        syncedPatientsView.updateListVisibility(true);
                    }
                }
                syncedPatientsView.updateAdapter(patientList);
            }));
    }
@ Override public void updateLocalPatientsList ( ) { addSubscription ( patientDAO . getAllPatients ( ) . observeOn ( AndroidSchedulers . mainThread ( ) ) . subscribe ( patientList -> { boolean isFiltering = StringUtils . notNull ( mQuery ) && ! mQuery . isEmpty ( ) ; if ( isFiltering ) { patientList = FilterUtil . getPatientsFilteredByQuery ( patientList , mQuery ) ; if ( patientList . isEmpty ( ) ) { syncedPatientsView . updateListVisibility ( false , mQuery ) ; } else { syncedPatientsView . updateListVisibility ( true ) ; } } else { if ( patientList . isEmpty ( ) ) { syncedPatientsView . updateListVisibility ( false ) ; } else { syncedPatientsView . updateListVisibility ( true ) ; } } syncedPatientsView . updateAdapter ( patientList ) ; } ) ) ; }
Used to update local patients list
 It handles search events and replaces View's data to display
Used to update local patients list It handles search events and replaces View ' s data to display