openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/api/repository/PatientRepository.java
/**
     * Fetch similar patient and calculate locally.
     *
     * @param patient  the patient
     * @param callback the callback
     */
Fetch similar patient and calculate locally.
@param patient  the patient
@param callback the callback
Fetch similar patient and calculate locally . @param patient the patient @param callback the callback
public void fetchSimilarPatientAndCalculateLocally(final Patient patient, PatientResponseCallback callback) {
        Call<Results<Patient>> call = restApi.getPatients(patient.getName().getGivenName(), ApplicationConstants.API.FULL);
        call.enqueue(new Callback<Results<Patient>>() {
            @Override
            public void onResponse(@NonNull Call<Results<Patient>> call, @NonNull Response<Results<Patient>> response) {
                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 fetchSimilarPatientAndCalculateLocally ( final Patient patient , PatientResponseCallback callback ) { Call < Results < Patient > > call = restApi . getPatients ( patient . getName ( ) . getGivenName ( ) , ApplicationConstants . API . FULL ) ; call . enqueue ( new Callback < Results < Patient > > ( ) { @ Override public void onResponse ( @ NonNull Call < Results < Patient > > call , @ NonNull Response < Results < Patient > > response ) { 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 ( ) ) ; } } ) ; }
Fetch similar patient and calculate locally.
Fetch similar patient and calculate locally .