openmrs-android-sdk/src/main/java/com/openmrs/android_sdk/library/api/repository/PatientRepository.java
/**
     * Register patient.
     *
     * @param patient          the patient
     * @param callbackListener the callback listener
     */
Register patient.
@param patient          the patient
@param callbackListener the callback listener
Register patient . @param patient the patient @param callbackListener the callback listener
public void registerPatient(final Patient patient, @Nullable final PatientDeferredResponseCallback callbackListener) {
        patientDAO.savePatient(patient)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(id -> {
                    patient.setId(id);
                    if (callbackListener != null) {
                        syncPatient(patient, callbackListener);
                    } else {
                        syncPatient(patient);
                    }
                });
    }
public void registerPatient ( final Patient patient , @ Nullable final PatientDeferredResponseCallback callbackListener ) { patientDAO . savePatient ( patient ) . observeOn ( AndroidSchedulers . mainThread ( ) ) . subscribe ( id -> { patient . setId ( id ) ; if ( callbackListener != null ) { syncPatient ( patient , callbackListener ) ; } else { syncPatient ( patient ) ; } } ) ; }
Register patient.
Register patient .