openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/api/repository/PatientRepository.java
/**
     * Load more patients.
     *
     * @param limit      the limit
     * @param startIndex the start index
     * @param callback   the callback
     */
Load more patients.
@param limit      the limit
@param startIndex the start index
@param callback   the callback
Load more patients . @param limit the limit @param startIndex the start index @param callback the callback
public void loadMorePatients(int limit, int startIndex, PatientResponseCallback callback) {
        Call<Results<Patient>> call = restApi.getLastViewedPatients(limit, startIndex);
        call.enqueue(new Callback<Results<Patient>>() {
            @Override
            public void onResponse(@NonNull Call<Results<Patient>> call, @NonNull Response<Results<Patient>> response) {
                if (callback != null) {
                    if (response.isSuccessful()) {
                        callback.onResponse(response.body());
                    }
                } else {
                    callback.onErrorResponse(response.message());
                }
            }
            @Override
            public void onFailure(@NonNull Call<Results<Patient>> call, @NonNull Throwable t) {
                callback.onErrorResponse(t.getMessage());
            }
        });
    }
public void loadMorePatients ( int limit , int startIndex , PatientResponseCallback callback ) { Call < Results < Patient > > call = restApi . getLastViewedPatients ( limit , startIndex ) ; call . enqueue ( new Callback < Results < Patient > > ( ) { @ Override public void onResponse ( @ NonNull Call < Results < Patient > > call , @ NonNull Response < Results < Patient > > response ) { if ( callback != null ) { if ( response . isSuccessful ( ) ) { callback . onResponse ( response . body ( ) ) ; } } else { callback . onErrorResponse ( response . message ( ) ) ; } } @ Override public void onFailure ( @ NonNull Call < Results < Patient > > call , @ NonNull Throwable t ) { callback . onErrorResponse ( t . getMessage ( ) ) ; } } ) ; }
Load more patients.
Load more patients .