|
|
|
|
@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Request.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
|
|
|
|
|
class DoctorsListService extends BaseService {
|
|
|
|
|
@ -934,6 +935,64 @@ class DoctorsListService extends BaseService {
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> addVIDARequest(String advanceNumber,
|
|
|
|
|
String paymentReference, dynamic apptData, BuildContext context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
|
var data = AuthenticatedUser.fromJson(
|
|
|
|
|
await this.sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
authUser = data;
|
|
|
|
|
}
|
|
|
|
|
var languageID =
|
|
|
|
|
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
request = {
|
|
|
|
|
"AdvanceNumber": advanceNumber,
|
|
|
|
|
"PaymentReferenceNumber": paymentReference,
|
|
|
|
|
"AppointmentNo": apptData.AppointmentNo,
|
|
|
|
|
"AcceptedBy": apptData.DoctorID,
|
|
|
|
|
"ServiceID": apptData.ServiceID,
|
|
|
|
|
"ProjectID": apptData.ProjectID,
|
|
|
|
|
"ClinicID": apptData.ClinicID,
|
|
|
|
|
"ClientRequestID": Utils.getAppointmentTransID(
|
|
|
|
|
apptData.ProjectID, apptData.ClinicID, apptData.AppointmentNo),
|
|
|
|
|
"AppointmentDate": apptData.AppointmentDate,
|
|
|
|
|
"DeviceType": Platform.isIOS ? "iOS" : "Android",
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": req.Channel,
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": req.IPAdress,
|
|
|
|
|
"generalid": req.generalid,
|
|
|
|
|
"PatientOutSA": authUser.outSA,
|
|
|
|
|
"SessionID": "YckwoXhUmWBsnHKEKig",
|
|
|
|
|
"isDentalAllowedBackend": false,
|
|
|
|
|
"DeviceTypeID": req.DeviceTypeID,
|
|
|
|
|
"PatientID": authUser.patientID,
|
|
|
|
|
"TokenID": "@dm!n",
|
|
|
|
|
"PatientTypeID": authUser.patientType,
|
|
|
|
|
"PatientType": authUser.patientType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// request.DeviceToken = this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false);
|
|
|
|
|
// request.Latitude = this.cs.sharedService.getSharedData('userLat', false);
|
|
|
|
|
// request.Longitude = this.cs.sharedService.getSharedData('userLong', false);
|
|
|
|
|
// request.ServiceID = apptData.ServiceID;
|
|
|
|
|
// request.ProjectID = apptData.ProjectID;
|
|
|
|
|
// request.ClinicID = apptData.ClinicID;
|
|
|
|
|
// request.ClientRequestID = AppointmentModel.getAppointmentTransID(apptData);
|
|
|
|
|
// request.AppointmentDate = apptData.AppointmentDate;
|
|
|
|
|
// request.DeviceType = this.getDeviceType();
|
|
|
|
|
// request.VoipToken = this.platform.is('ios') ? this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false) : "";
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
await baseAppClient.post(ADD_VIDA_REQUEST,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> isAllowedToAskDoctor(int docID, BuildContext context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
|
@ -1109,14 +1168,16 @@ class DoctorsListService extends BaseService {
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async {
|
|
|
|
|
Future<Map> getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID,
|
|
|
|
|
dynamic clinicID, BuildContext context) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
|
|
|
|
|
var data = AuthenticatedUser.fromJson(
|
|
|
|
|
await this.sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
authUser = data;
|
|
|
|
|
}
|
|
|
|
|
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
|
|
|
|
|
var languageID =
|
|
|
|
|
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
request = {
|
|
|
|
|
"AppointmentNo": appoNo,
|
|
|
|
|
@ -1140,10 +1201,10 @@ class DoctorsListService extends BaseService {
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
await baseAppClient.post(GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|