|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
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 {
|
|
|
|
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
|
|
|
|
AppGlobal appGlobal = new AppGlobal();
|
|
|
|
|
|
|
|
|
|
AuthenticatedUser authUser = new AuthenticatedUser();
|
|
|
|
|
AuthProvider authProvider = new AuthProvider();
|
|
|
|
|
|
|
|
|
|
Future<Map> getDoctorsList(
|
|
|
|
|
int clinicID, int projectID, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
request = {
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": "10.20.10.20",
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": req.Channel,
|
|
|
|
|
"generalid": 'Cs2020@2016\$2958',
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"TokenID": "",
|
|
|
|
|
"DeviceTypeID": req.DeviceTypeID,
|
|
|
|
|
"SessionID": null,
|
|
|
|
|
"ClinicID": clinicID,
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"ContinueDentalPlan": false,
|
|
|
|
|
"IsSearchAppointmnetByClinicID": true,
|
|
|
|
|
"PatientID": authUser.patientID,
|
|
|
|
|
"gender": authUser.gender,
|
|
|
|
|
"age": authUser.age,
|
|
|
|
|
"IsGetNearAppointment": false,
|
|
|
|
|
"Latitude": 0,
|
|
|
|
|
"Longitude": 0,
|
|
|
|
|
"License": true
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_DOCTORS_LIST_URL,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getDoctorsListByName(String docName, 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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
request = {
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": "10.20.10.20",
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": req.Channel,
|
|
|
|
|
"generalid": 'Cs2020@2016\$2958',
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"TokenID": "",
|
|
|
|
|
"DeviceTypeID": req.DeviceTypeID,
|
|
|
|
|
"SessionID": null,
|
|
|
|
|
"ClinicID": 0,
|
|
|
|
|
"ProjectID": 0,
|
|
|
|
|
"ContinueDentalPlan": false,
|
|
|
|
|
"IsSearchAppointmnetByClinicID": false,
|
|
|
|
|
"DoctorName": docName,
|
|
|
|
|
"PatientID": authUser.patientID,
|
|
|
|
|
"gender": authUser.gender,
|
|
|
|
|
"age": authUser.age,
|
|
|
|
|
"IsGetNearAppointment": false,
|
|
|
|
|
"Latitude": 0,
|
|
|
|
|
"Longitude": 0,
|
|
|
|
|
"License": true
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_DOCTORS_LIST_URL,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
var languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
request = {
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": "10.20.10.20",
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": req.Channel,
|
|
|
|
|
"generalid": 'Cs2020@2016\$2958',
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"TokenID": "",
|
|
|
|
|
"DeviceTypeID": req.DeviceTypeID,
|
|
|
|
|
"SessionID": null,
|
|
|
|
|
"doctorID": docID,
|
|
|
|
|
"ClinicID": clinicID,
|
|
|
|
|
"PatientID": 0,
|
|
|
|
|
"License": true,
|
|
|
|
|
"IsRegistered": true,
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"isDentalAllowedBackend": false
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_DOCTOR_PROFILE,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getDoctorFreeSlots(
|
|
|
|
|
int docID, int clinicID, int projectID, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
var languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
request = {
|
|
|
|
|
"DoctorID": docID,
|
|
|
|
|
"IsBookingForLiveCare": 0,
|
|
|
|
|
"ClinicID": clinicID,
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"OriginalClinicID": clinicID,
|
|
|
|
|
"days": 0,
|
|
|
|
|
"isReschadual": false,
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": 3,
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": "10.20.10.20",
|
|
|
|
|
"generalid": "Cs2020@2016\$2958",
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"SessionID": null,
|
|
|
|
|
"isDentalAllowedBackend": false,
|
|
|
|
|
"DeviceTypeID": 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> insertAppointment(int docID, int clinicID, int projectID,
|
|
|
|
|
String selectedTime, String selectedDate, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
request = {
|
|
|
|
|
"IsForLiveCare": false,
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"ClinicID": clinicID,
|
|
|
|
|
"DoctorID": docID,
|
|
|
|
|
"StartTime": selectedTime,
|
|
|
|
|
"SelectedTime": selectedTime,
|
|
|
|
|
"EndTime": selectedTime,
|
|
|
|
|
"InitialSlotDuration": 0,
|
|
|
|
|
"StrAppointmentDate": selectedDate,
|
|
|
|
|
"IsVirtual": false,
|
|
|
|
|
"DeviceType": Platform.isIOS ? 'iOS' : 'Android',
|
|
|
|
|
"BookedBy": 102,
|
|
|
|
|
"VisitType": 1,
|
|
|
|
|
"VisitFor": 1,
|
|
|
|
|
"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
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(INSERT_SPECIFIC_APPOINTMENT,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getPatientShare(
|
|
|
|
|
String appoID, int clinicID, int projectID, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"ClinicID": clinicID,
|
|
|
|
|
"AppointmentNo": appoID,
|
|
|
|
|
"IsActiveAppointment": true,
|
|
|
|
|
"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
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_PATIENT_SHARE,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response['OnlineCheckInAppointments'][0];
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getPatientAppointmentHistory(
|
|
|
|
|
bool isActiveAppointment, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"IsActiveAppointment": isActiveAppointment,
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": req.Channel,
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": req.IPAdress,
|
|
|
|
|
"generalid": req.generalid,
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"SessionID": "YckwoXhUmWBsnHKEKig",
|
|
|
|
|
"isDentalAllowedBackend": false,
|
|
|
|
|
"DeviceTypeID": req.DeviceTypeID,
|
|
|
|
|
"PatientID": authUser.patientID,
|
|
|
|
|
"TokenID": "@dm!n",
|
|
|
|
|
"PatientTypeID": authUser.patientType,
|
|
|
|
|
"PatientType": authUser.patientType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> getPatientAppointmentCurfewHistory(
|
|
|
|
|
bool isActiveAppointment) async {
|
|
|
|
|
Map<String, dynamic> request;
|
|
|
|
|
var languageID = await sharedPref.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"IsActiveAppointment": isActiveAppointment,
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": req.Channel,
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": req.IPAdress,
|
|
|
|
|
"generalid": req.generalid,
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"SessionID": "YckwoXhUmWBsnHKEKig",
|
|
|
|
|
"isDentalAllowedBackend": false,
|
|
|
|
|
"DeviceTypeID": req.DeviceTypeID,
|
|
|
|
|
"PatientID": 1231755,
|
|
|
|
|
"TokenID": "@dm!n",
|
|
|
|
|
"PatientTypeID": 1,
|
|
|
|
|
"PatientType": 1
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GET_PATIENT_APPOINTMENT_CURFEW_HISTORY,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> confirmAppointment(
|
|
|
|
|
int appoNo, int clinicID, int projectID, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"AppointmentNumber": appoNo,
|
|
|
|
|
"ClinicID": clinicID,
|
|
|
|
|
"ProjectID": projectID,
|
|
|
|
|
"ConfirmationBy": 102,
|
|
|
|
|
"VersionID": req.VersionID,
|
|
|
|
|
"Channel": req.Channel,
|
|
|
|
|
"LanguageID": languageID == 'ar' ? 1 : 2,
|
|
|
|
|
"IPAdress": req.IPAdress,
|
|
|
|
|
"generalid": req.generalid,
|
|
|
|
|
"PatientOutSA": 0,
|
|
|
|
|
"SessionID": "YckwoXhUmWBsnHKEKig",
|
|
|
|
|
"isDentalAllowedBackend": false,
|
|
|
|
|
"DeviceTypeID": req.DeviceTypeID,
|
|
|
|
|
"PatientID": authUser.patientID,
|
|
|
|
|
"TokenID": "@dm!n",
|
|
|
|
|
"PatientTypeID": authUser.patientType,
|
|
|
|
|
"PatientType": authUser.patientType
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(CONFIRM_APPOINTMENT,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> cancelAppointment(
|
|
|
|
|
AppoitmentAllHistoryResultList appo, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"AppointmentID": appo.appointmentNo,
|
|
|
|
|
"ClinicID": appo.clinicID,
|
|
|
|
|
"ProjectID": appo.projectID,
|
|
|
|
|
"EndTime": appo.endTime,
|
|
|
|
|
"StartTime": appo.startTime,
|
|
|
|
|
"DoctorID": appo.doctorID,
|
|
|
|
|
"IsForLiveCare": appo.isLiveCareAppointment,
|
|
|
|
|
"OriginalClinicID": appo.originalClinicID,
|
|
|
|
|
"OriginalProjectID": appo.originalProjectID,
|
|
|
|
|
"StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate),
|
|
|
|
|
"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
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(CANCEL_APPOINTMENT,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> generateAppointmentQR(
|
|
|
|
|
PatientShareResponse patientShareResponse, BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"AppointmentNo": patientShareResponse.appointmentNo,
|
|
|
|
|
"ClinicID": patientShareResponse.clinicID,
|
|
|
|
|
"ProjectID": patientShareResponse.projectID,
|
|
|
|
|
"IsFollowup": patientShareResponse.isFollowup,
|
|
|
|
|
"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
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(GENERATE_QR_APPOINTMENT,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future<Map> sendAppointmentQREmail(
|
|
|
|
|
String to,
|
|
|
|
|
String appoDate,
|
|
|
|
|
String appoNo,
|
|
|
|
|
String docName,
|
|
|
|
|
String projName,
|
|
|
|
|
String QR,
|
|
|
|
|
String speciality,
|
|
|
|
|
BuildContext context) async {
|
|
|
|
|
Utils.showProgressDialog(context);
|
|
|
|
|
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.getString(APP_LANGUAGE);
|
|
|
|
|
Request req = appGlobal.getPublicRequest();
|
|
|
|
|
|
|
|
|
|
request = {
|
|
|
|
|
"AppointmentNo": appoNo,
|
|
|
|
|
"AppointmentDate": appoDate,
|
|
|
|
|
"DoctorName": docName,
|
|
|
|
|
"ProjectName": projName,
|
|
|
|
|
"QR": QR,
|
|
|
|
|
"Speciality": speciality,
|
|
|
|
|
"To": to,
|
|
|
|
|
"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
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dynamic localRes;
|
|
|
|
|
|
|
|
|
|
await baseAppClient.post(EMAIL_QR_APPOINTMENT,
|
|
|
|
|
onSuccess: (response, statusCode) async {
|
|
|
|
|
localRes = response;
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
}, onFailure: (String error, int statusCode) {
|
|
|
|
|
Utils.hideProgressDialog();
|
|
|
|
|
throw error;
|
|
|
|
|
}, body: request);
|
|
|
|
|
return Future.value(localRes);
|
|
|
|
|
}
|
|
|
|
|
}
|