Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

import com.google.android.libraries.places.api.net.PlacesClient;

import org.jetbrains.annotations.Nullable;
import org.openmrs.mobile.R;
import org.openmrs.mobile.activities.BasePresenter;
import org.openmrs.mobile.api.RestApi;
import org.openmrs.mobile.api.RestServiceBuilder;
import org.openmrs.mobile.api.promise.SimpleDeferredObject;
import org.openmrs.mobile.api.repository.PatientRepository;
import org.openmrs.mobile.dao.PatientDAO;
import org.openmrs.mobile.listeners.retrofitcallbacks.DefaultResponseCallback;
Expand Down Expand Up @@ -218,6 +220,21 @@ private boolean validate(Patient patient) {
@Override
public void registerPatient() {
patientRepository.registerPatient(mPatient, new PatientDeferredResponseCallback() {
@Override
public void onNotifyResponse(@Nullable String notifyMessage) {

}

@Override
public void onErrorResponse(@Nullable String errorMessage, @Nullable SimpleDeferredObject<Patient> errorResponse) {

}

@Override
public void onResponse(@Nullable SimpleDeferredObject<Patient> response) {

}

@Override
public void onResponse() {
mPatientInfoView.startPatientDashbordActivity(mPatient);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.mobile.listeners.retrofitcallbacks

package org.openmrs.mobile.listeners.retrofitcallbacks;
import org.openmrs.mobile.models.Patient

import org.openmrs.mobile.models.Patient;

public interface DownloadPatientCallback extends DefaultResponseCallback {
void onPatientDownloaded(Patient patient);

void onPatientPhotoDownloaded(Patient patient);
}
@JvmSuppressWildcards
interface DownloadPatientCallback : DefaultResponseCallback {
fun onPatientDownloaded(patient: Patient?)
fun onPatientPhotoDownloaded(patient: Patient?)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.mobile.listeners.retrofitcallbacks

package org.openmrs.mobile.listeners.retrofitcallbacks;
import org.openmrs.mobile.models.VisitType

import org.openmrs.mobile.models.VisitType;

public interface GetVisitTypeCallback extends DefaultResponseCallback {
void onGetVisitTypeResponse(VisitType visitType);
}
@JvmSuppressWildcards
interface GetVisitTypeCallback : DefaultResponseCallback {
fun onGetVisitTypeResponse(visitType: VisitType?)
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* The contents of this file are subject to the OpenMRS Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://license.openmrs.org
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
* License for the specific language governing rights and limitations
* under the License.
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.mobile.listeners.retrofitcallbacks

import org.openmrs.mobile.api.promise.SimpleDeferredObject
import org.openmrs.mobile.models.Patient

@JvmSuppressWildcards
interface PatientDeferredResponseCallback : DefaultResponseCallback {
fun onResponse(response: SimpleDeferredObject<Patient?>?) {}
fun onErrorResponse(errorMessage: String?, errorResponse: SimpleDeferredObject<Patient?>?) {}
fun onNotifyResponse(notifyMessage: String?) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.mobile.listeners.retrofitcallbacks

package org.openmrs.mobile.listeners.retrofitcallbacks;

public interface VisitsResponseCallback {
void onSuccess(String response);

void onFailure(String errorMessage);
}
@JvmSuppressWildcards
interface StartVisitResponseCallback : DefaultResponseCallback {
fun onStartVisitResponse(id: Long)
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
*
* Copyright (C) OpenMRS, LLC. All Rights Reserved.
*/
package org.openmrs.mobile.listeners.retrofitcallbacks

package org.openmrs.mobile.listeners.retrofitcallbacks;

public interface StartVisitResponseCallback extends DefaultResponseCallback {
void onStartVisitResponse(long id);
}
@JvmSuppressWildcards
interface VisitsResponseCallback {
fun onSuccess(response: String?)
fun onFailure(errorMessage: String?)
}

This file was deleted.

Loading