openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/api/repository/VisitRepository.java
/**
     * This method is used to sync Vitals of a patient with result asynchronously propagated back with callback listeners
     *
     * @see DefaultResponseCallback
     *
     * @param patientUuid
     * @param callbackListener
     */
This method is used to sync Vitals of a patient with result asynchronously propagated back with callback listeners
@see DefaultResponseCallback

@param patientUuid
@param callbackListener
This method is used to sync Vitals of a patient with result asynchronously propagated back with callback listeners @see DefaultResponseCallback @param patientUuid @param callbackListener
public void syncLastVitals(final String patientUuid, @Nullable final DefaultResponseCallback callbackListener) {
        Call<Results<Encounter>> call = restApi.getLastVitals(patientUuid, ApplicationConstants.EncounterTypes.VITALS, "full", 1, "desc");
        call.enqueue(new Callback<Results<Encounter>>() {
            @Override
            public void onResponse(@NonNull Call<Results<Encounter>> call, @NonNull Response<Results<Encounter>> response) {
                if (response.isSuccessful()) {
                    if (!response.body().getResults().isEmpty()) {
                        encounterDAO.saveLastVitalsEncounter(response.body().getResults().get(0), patientUuid);
                    }
                    if (callbackListener != null) {
                        callbackListener.onResponse();
                    }
                } else {
                    if (callbackListener != null) {
                        callbackListener.onErrorResponse(response.message());
                    }
                }
            }
            @Override
            public void onFailure(@NonNull Call<Results<Encounter>> call, @NonNull Throwable t) {
                if (callbackListener != null) {
                    callbackListener.onErrorResponse(t.getMessage());
                }
            }
        });
    }
public void syncLastVitals ( final String patientUuid , @ Nullable final DefaultResponseCallback callbackListener ) { Call < Results < Encounter > > call = restApi . getLastVitals ( patientUuid , ApplicationConstants . EncounterTypes . VITALS , "full" , 1 , "desc" ) ; call . enqueue ( new Callback < Results < Encounter > > ( ) { @ Override public void onResponse ( @ NonNull Call < Results < Encounter > > call , @ NonNull Response < Results < Encounter > > response ) { if ( response . isSuccessful ( ) ) { if ( ! response . body ( ) . getResults ( ) . isEmpty ( ) ) { encounterDAO . saveLastVitalsEncounter ( response . body ( ) . getResults ( ) . get ( 0 ) , patientUuid ) ; } if ( callbackListener != null ) { callbackListener . onResponse ( ) ; } } else { if ( callbackListener != null ) { callbackListener . onErrorResponse ( response . message ( ) ) ; } } } @ Override public void onFailure ( @ NonNull Call < Results < Encounter > > call , @ NonNull Throwable t ) { if ( callbackListener != null ) { callbackListener . onErrorResponse ( t . getMessage ( ) ) ; } } } ) ; }
This method is used to sync Vitals of a patient with result asynchronously propagated back with callback listeners
 @see DefaultResponseCallback
This method is used to sync Vitals of a patient with result asynchronously propagated back with callback listeners @see DefaultResponseCallback