openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/api/repository/VisitRepository.java
/**
     * This method is used to end an active visit of a patient.
     *
     * @see Visit
     * @see VisitsResponseCallback
     *
     * @param uuid
     * @param visit
     * @param callbackListener
     */
This method is used to end an active visit of a patient.
@see Visit
@see VisitsResponseCallback


This method is used to end an active visit of a patient . @see Visit @see VisitsResponseCallback
public void endVisitByUuid(String uuid, Visit visit, VisitsResponseCallback callbackListener) {
        restApi.endVisitByUUID(uuid, visit).enqueue(new Callback<Visit>() {
            @Override
            public void onResponse(@NonNull Call<Visit> call, @NonNull Response<Visit> response) {
                if (callbackListener != null) {
                    if (response.isSuccessful()) {
                        callbackListener.onSuccess(response.body().getStopDatetime());
                    } else {
                        callbackListener.onFailure(response.message());
                    }
                }
            }
            @Override
            public void onFailure(@NonNull Call<Visit> call, @NonNull Throwable t) {
                if (callbackListener != null) {
                    callbackListener.onFailure(t.getMessage());
                }
            }
        });
    }
public void endVisitByUuid ( String uuid , Visit visit , VisitsResponseCallback callbackListener ) { restApi . endVisitByUUID ( uuid , visit ) . enqueue ( new Callback < Visit > ( ) { @ Override public void onResponse ( @ NonNull Call < Visit > call , @ NonNull Response < Visit > response ) { if ( callbackListener != null ) { if ( response . isSuccessful ( ) ) { callbackListener . onSuccess ( response . body ( ) . getStopDatetime ( ) ) ; } else { callbackListener . onFailure ( response . message ( ) ) ; } } } @ Override public void onFailure ( @ NonNull Call < Visit > call , @ NonNull Throwable t ) { if ( callbackListener != null ) { callbackListener . onFailure ( t . getMessage ( ) ) ; } } } ) ; }
This method is used to end an active visit of a patient.
This method is used to end an active visit of a patient .