openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/api/repository/PatientRepository.java
/**
     * Update matching patient.
     *
     * @param patient  the patient
     * @param callback the callback
     */
Update matching patient.
@param patient  the patient
@param callback the callback
Update matching patient . @param patient the patient @param callback the callback
public void updateMatchingPatient(final Patient patient, DefaultResponseCallback callback) {
        PatientDtoUpdate patientDto = patient.getUpdatedPatientDto();
        patient.setUuid(null);
        Call<PatientDto> call = restApi.updatePatient(patientDto, patient.getUuid(), ApplicationConstants.API.FULL);
        call.enqueue(new Callback<PatientDto>() {
            @Override
            public void onResponse(@NonNull Call<PatientDto> call, @NonNull Response<PatientDto> response) {
                if (callback != null) {
                    if (response.isSuccessful()) {
                        callback.onResponse();
                    } else {
                        callback.onErrorResponse(response.message());
                    }
                }
            }
            @Override
            public void onFailure(@NonNull Call<PatientDto> call, @NonNull Throwable t) {
                if (callback != null) {
                    callback.onErrorResponse(t.getMessage());
                }
            }
        });
    }
public void updateMatchingPatient ( final Patient patient , DefaultResponseCallback callback ) { PatientDtoUpdate patientDto = patient . getUpdatedPatientDto ( ) ; patient . setUuid ( null ) ; Call < PatientDto > call = restApi . updatePatient ( patientDto , patient . getUuid ( ) , ApplicationConstants . API . FULL ) ; call . enqueue ( new Callback < PatientDto > ( ) { @ Override public void onResponse ( @ NonNull Call < PatientDto > call , @ NonNull Response < PatientDto > response ) { if ( callback != null ) { if ( response . isSuccessful ( ) ) { callback . onResponse ( ) ; } else { callback . onErrorResponse ( response . message ( ) ) ; } } } @ Override public void onFailure ( @ NonNull Call < PatientDto > call , @ NonNull Throwable t ) { if ( callback != null ) { callback . onErrorResponse ( t . getMessage ( ) ) ; } } } ) ; }
Update matching patient.
Update matching patient .