Search By Clinic & Search By Doctor Name implemented
parent
9eb9f01dbd
commit
ca7b4534a8
@ -1,12 +0,0 @@
|
|||||||
class FreeSlot {
|
|
||||||
List event;
|
|
||||||
DateTime slot;
|
|
||||||
|
|
||||||
|
|
||||||
FreeSlot(this.slot, this.event);
|
|
||||||
|
|
||||||
@override
|
|
||||||
String toString() {
|
|
||||||
return '{ ${this.slot}, ${this.event} }';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
import 'package:diplomaticquarterapp/client/base_app_client.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/Request.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||||
|
|
||||||
|
class DoctorsListService {
|
||||||
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||||
|
AppGlobal appGlobal = new AppGlobal();
|
||||||
|
|
||||||
|
Future<Map> getDoctorsList(int clinicID, int projectID) async {
|
||||||
|
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,
|
||||||
|
"ClinicID": 21,
|
||||||
|
"ProjectID": 0,
|
||||||
|
"ContinueDentalPlan": false,
|
||||||
|
"IsSearchAppointmnetByClinicID": true,
|
||||||
|
"PatientID": 0,
|
||||||
|
"gender": 0,
|
||||||
|
"age": 0,
|
||||||
|
"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> getDoctorsListByName(String docName) async {
|
||||||
|
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,
|
||||||
|
"ClinicID": 0,
|
||||||
|
"ProjectID": 0,
|
||||||
|
"ContinueDentalPlan": false,
|
||||||
|
"IsSearchAppointmnetByClinicID": false,
|
||||||
|
"DoctorName": docName,
|
||||||
|
"PatientID": 0,
|
||||||
|
"gender": 0,
|
||||||
|
"age": 0,
|
||||||
|
"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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue