diff --git a/android/app/build.gradle b/android/app/build.gradle
index 1f71421f..9640ea61 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -27,7 +27,7 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
- compileSdkVersion 30
+ compileSdkVersion 28
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@@ -41,7 +41,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.cloud.diplomaticquarterapp"
minSdkVersion 21
- targetSdkVersion 30
+ targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index f1a5a3f8..8c32edfd 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -17,6 +17,9 @@
+
+
+
+
+
diff --git a/android/gradle.properties b/android/gradle.properties
index 3f45ee5b..9c0729c9 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -2,4 +2,4 @@
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
-org.gradle.jvmargs=-Xmx4608m
\ No newline at end of file
+org.gradle.jvmargs=-Xmx4608m
diff --git a/assets/images/Wifi-AR.png b/assets/images/Wifi-AR.png
new file mode 100644
index 00000000..a8e2d9af
Binary files /dev/null and b/assets/images/Wifi-AR.png differ
diff --git a/assets/images/covid-car.png b/assets/images/covid-car.png
new file mode 100644
index 00000000..01090b74
Binary files /dev/null and b/assets/images/covid-car.png differ
diff --git a/assets/images/covid_bg_transparent.png b/assets/images/covid_bg_transparent.png
new file mode 100644
index 00000000..cd5f12f1
Binary files /dev/null and b/assets/images/covid_bg_transparent.png differ
diff --git a/assets/images/home_health_care_icon.png b/assets/images/home_health_care_icon.png
new file mode 100644
index 00000000..d80ec015
Binary files /dev/null and b/assets/images/home_health_care_icon.png differ
diff --git a/assets/images/new-design/calendar.png b/assets/images/new-design/calendar.png
new file mode 100644
index 00000000..ac72b030
Binary files /dev/null and b/assets/images/new-design/calendar.png differ
diff --git a/assets/images/new-design/covid-19-big-banner-bg.png b/assets/images/new-design/covid-19-big-banner-bg.png
new file mode 100644
index 00000000..a66d6815
Binary files /dev/null and b/assets/images/new-design/covid-19-big-banner-bg.png differ
diff --git a/assets/images/new-design/covid_bg_transparent.png b/assets/images/new-design/covid_bg_transparent.png
new file mode 100644
index 00000000..cd5f12f1
Binary files /dev/null and b/assets/images/new-design/covid_bg_transparent.png differ
diff --git a/assets/images/new-design/hmg_full_logo_hd_white.png b/assets/images/new-design/hmg_full_logo_hd_white.png
new file mode 100644
index 00000000..e4d7ae60
Binary files /dev/null and b/assets/images/new-design/hmg_full_logo_hd_white.png differ
diff --git a/assets/images/new-design/waiting_for_doctor.png b/assets/images/new-design/waiting_for_doctor.png
new file mode 100644
index 00000000..c330c25a
Binary files /dev/null and b/assets/images/new-design/waiting_for_doctor.png differ
diff --git a/assets/images/wifi-EN.png b/assets/images/wifi-EN.png
new file mode 100644
index 00000000..5711925c
Binary files /dev/null and b/assets/images/wifi-EN.png differ
diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements
index 0c67376e..903def2a 100644
--- a/ios/Runner/Runner.entitlements
+++ b/ios/Runner/Runner.entitlements
@@ -1,5 +1,8 @@
-
+
+ aps-environment
+ development
+
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 40314b70..a3ce19e9 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -57,8 +57,9 @@ const GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///Er Nearest
-const GET_AMBULANCE_REQUEST =
- 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
+const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
+const GET_PATIENT_ALL_PRES_ORDERS= 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
+const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID= 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@@ -138,8 +139,7 @@ const GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history
-const GET_PATIENT_APPOINTMENT_HISTORY =
- "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
+const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
@@ -149,6 +149,9 @@ const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
const CONFIRM_APPOINTMENT =
"Services/MobileNotifications.svc/REST/ConfirmAppointment";
+const INSERT_VIDA_REQUEST =
+ "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
+
//URL to cancel appointment
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
@@ -178,6 +181,22 @@ const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_LIVECARE_CLINICS =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
+
+const GET_LIVECARE_SCHEDULE_CLINICS =
+ 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
+
+const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST =
+ 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
+
+const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS =
+ 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
+
+const INSERT_LIVECARE_SCHEDULE_APPOINTMENT =
+ 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
+
+const GET_PATIENT_SHARE_LIVECARE =
+ "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
+
const GET_LIVECARE_CLINIC_TIMING =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
@@ -243,6 +262,14 @@ const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
+
+const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
+
+const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
+
+const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
+
+
///My Trackers
const GET_DIABETIC_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
@@ -296,6 +323,7 @@ const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
+
const TIMER_MIN = 10;
class AppGlobal {
@@ -318,6 +346,7 @@ class AppGlobal {
request.TokenID = "@dm!n";
request.isDentalAllowedBackend = false;
request.DeviceTypeID = Platform.isIOS ? 1 : 2;
+ request.DeviceType = Platform.isIOS ? "iOS" : "Android";
return request;
}
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 3a8b7ec1..81f8a3d4 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -47,6 +47,8 @@ const Map> localizedValues = {
},
'confirmAppo': {'en': 'Confirm Appointment', 'ar': 'تأكيد الموعد'},
'confirm': {'en': 'Confirm', 'ar': 'تأكيد'},
+ 'confirmLiveCare': {'en': 'Confirm LiveCare', 'ar': 'تأكيد لايف كير'},
+ 'waitingForDoctor': {'en': 'Waiting for doctor', 'ar': 'في انتظار الطبيب'},
'appointment': {'en': 'Appointment', 'ar': 'الموعد'},
'confirmLater': {'en': 'Confirm Later', 'ar': 'تأكيد لاحقا'},
'todoList': {'en': 'Todo List', 'ar': 'مهامي'},
@@ -58,6 +60,7 @@ const Map> localizedValues = {
'viewQR': {'en': 'View QR Code', 'ar': 'عرض رمز الاستجابة السريعة'},
'instruction': {'en': 'Instructions', 'ar': 'تعليمات'},
'livecare': {'en': 'LiveCare', 'ar': 'لايف كير'},
+ 'livecareAppo': {'en': 'LiveCare Appointment', 'ar': 'الموعد لايف كير'},
'cancelAppoMsg': {
'en': 'Are you sure you want to cancel this appointment?',
'ar': 'هل أنت متأكد أنك تريد إلغاء هذا الموعد؟'
@@ -576,6 +579,15 @@ const Map> localizedValues = {
"All":{"en":"All","ar":"الكل"},
"QuestionHere":{"en":"Enter the question here...","ar":"اضف الاستفسار هنا"},
"ViewDoctorResponses":{"en":"View Doctor Responses","ar":"الاطلاع على ردود الأطباء"},
-
+ "ServiceInformationButton":{"en":"LOGIN / REGISTER","ar":"دخول / تسجيل"},
+ "ServiceInformationTitle":{"en":"Service Information","ar":"معلومات الخدمة"},
+ "info-lab": {
+ "en": "This service allows you to view the results of all laboratory tests performed in Al Habib Medical Group as well as sending the report via e-mail.",
+ "ar": "خدمة نتائج المختبر: هذه الخدمة تمكنك من الاطلاع على نتائج جميع الفحوصات المخبرية التي تمت في مجموعة الحبيب الطبية."
+ },
+ "info-radiology": {
+ "en": "This service allows you to view the reports and photos of radiology in Al Habib Medical Group as well as send the report by e-mail.",
+ "ar": "خدمة الاشعة: هذه الخدمة تمكنك من الاطلاع على تقارير وصور الاشعة التي تمت في مجموعة الحبيب الطبية وكذلك ارسال التقرير عن طريق الايميل."
+ },
};
diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart
index d987ef96..7422052d 100644
--- a/lib/config/shared_pref_kay.dart
+++ b/lib/config/shared_pref_kay.dart
@@ -15,3 +15,4 @@ const USER_LAT = 'user-lat';
const USER_LONG = 'user-long';
const IS_GO_TO_PARKING = 'IS_GO_TO_PARKING';
const IS_SEARCH_APPO = 'is-search-appo';
+const IS_LIVECARE_APPOINTMENT = 'is_livecare_appointment';
diff --git a/lib/core/enum/Ambulate.dart b/lib/core/enum/Ambulate.dart
new file mode 100644
index 00000000..f8b2e8be
--- /dev/null
+++ b/lib/core/enum/Ambulate.dart
@@ -0,0 +1,60 @@
+import 'package:flutter/cupertino.dart';
+
+enum Ambulate { Wheelchair, Walker, Stretcher, None }
+
+extension SelectedAmbulate on Ambulate {
+ String getAmbulateTitle(BuildContext context) {
+ switch (this) {
+ case Ambulate.Wheelchair:
+ return 'Wheelchair';
+ break;
+ case Ambulate.Walker:
+ return 'Walker';
+ break;
+ case Ambulate.Stretcher:
+ return 'Stretcher';
+ break;
+ case Ambulate.None:
+ return 'None';
+ break;
+ }
+ return 'None';
+ }
+
+ int selectAmbulateNumber() {
+ switch (this) {
+ case Ambulate.Wheelchair:
+ return 0;
+ break;
+ case Ambulate.Walker:
+ return 1;
+ break;
+ case Ambulate.Stretcher:
+ return 2;
+ break;
+ case Ambulate.None:
+ return 3;
+ break;
+ }
+ return 3;
+ }
+
+ Ambulate getAmbulateById(int id) {
+ switch (id) {
+ case 0:
+ return Ambulate.Wheelchair;
+ break;
+ case 1:
+ return Ambulate.Walker;
+ break;
+ case 2:
+ return Ambulate.Stretcher;
+ break;
+ case 3:
+ return Ambulate.None;
+ break;
+ }
+
+ return Ambulate.None;
+ }
+}
diff --git a/lib/core/enum/OrderService.dart b/lib/core/enum/OrderService.dart
new file mode 100644
index 00000000..e6ce24eb
--- /dev/null
+++ b/lib/core/enum/OrderService.dart
@@ -0,0 +1,22 @@
+enum OrderService { AMBULANCE }
+
+extension SelectedOrderService on OrderService {
+ int getIdOrderService() {
+ switch (this) {
+ case OrderService.AMBULANCE:
+ return 4;
+ break;
+ }
+ return 4;
+ }
+
+ OrderService getOrderServiceById(int id) {
+ switch (id) {
+ case 4:
+ return OrderService.AMBULANCE;
+ break;
+ }
+
+ return OrderService.AMBULANCE;
+ }
+}
diff --git a/lib/core/model/er/PatientAllPresOrders.dart b/lib/core/model/er/PatientAllPresOrders.dart
new file mode 100644
index 00000000..90ce074a
--- /dev/null
+++ b/lib/core/model/er/PatientAllPresOrders.dart
@@ -0,0 +1,132 @@
+class PatientAllPresOrders {
+ int iD;
+ String patientID;
+ bool patientOutSA;
+ bool isOutPatient;
+ int projectID;
+ int nearestProjectID;
+ double longitude;
+ double latitude;
+ String appointmentNo;
+ String dischargeID;
+ int lineItemNo;
+ int status;
+ String description;
+ String descriptionN;
+ String createdOn;
+ int serviceID;
+ int createdBy;
+ String editedOn;
+ int editedBy;
+ int channel;
+ dynamic clientRequestID;
+ bool returnedToQueue;
+ dynamic pickupDateTime;
+ dynamic pickupLocationName;
+ dynamic dropoffLocationName;
+ int realRRTHaveTransactions;
+ String nearestProjectDescription;
+ String nearestProjectDescriptionN;
+ String projectDescription;
+ String projectDescriptionN;
+
+ PatientAllPresOrders(
+ {this.iD,
+ this.patientID,
+ this.patientOutSA,
+ this.isOutPatient,
+ this.projectID,
+ this.nearestProjectID,
+ this.longitude,
+ this.latitude,
+ this.appointmentNo,
+ this.dischargeID,
+ this.lineItemNo,
+ this.status,
+ this.description,
+ this.descriptionN,
+ this.createdOn,
+ this.serviceID,
+ this.createdBy,
+ this.editedOn,
+ this.editedBy,
+ this.channel,
+ this.clientRequestID,
+ this.returnedToQueue,
+ this.pickupDateTime,
+ this.pickupLocationName,
+ this.dropoffLocationName,
+ this.realRRTHaveTransactions,
+ this.nearestProjectDescription,
+ this.nearestProjectDescriptionN,
+ this.projectDescription,
+ this.projectDescriptionN});
+
+ PatientAllPresOrders.fromJson(Map json) {
+ iD = json['ID'];
+ patientID = json['PatientID'];
+ patientOutSA = json['PatientOutSA'];
+ isOutPatient = json['IsOutPatient'];
+ projectID = json['ProjectID'];
+ nearestProjectID = json['NearestProjectID'];
+ longitude = json['Longitude'];
+ latitude = json['Latitude'];
+ appointmentNo = json['AppointmentNo'];
+ dischargeID = json['DischargeID'];
+ lineItemNo = json['LineItemNo'];
+ status = json['Status'];
+ description = json['Description'];
+ descriptionN = json['DescriptionN'];
+ createdOn = json['CreatedOn'];
+ serviceID = json['ServiceID'];
+ createdBy = json['CreatedBy'];
+ editedOn = json['EditedOn'];
+ editedBy = json['EditedBy'];
+ channel = json['Channel'];
+ clientRequestID = json['ClientRequestID'];
+ returnedToQueue = json['ReturnedToQueue'];
+ pickupDateTime = json['PickupDateTime'];
+ pickupLocationName = json['PickupLocationName'];
+ dropoffLocationName = json['DropoffLocationName'];
+ realRRTHaveTransactions = json['RealRRT_HaveTransactions'];
+ nearestProjectDescription = json['NearestProjectDescription'];
+ nearestProjectDescriptionN = json['NearestProjectDescriptionN'];
+ projectDescription = json['ProjectDescription'];
+ projectDescriptionN = json['ProjectDescriptionN'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['ID'] = this.iD;
+ data['PatientID'] = this.patientID;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['IsOutPatient'] = this.isOutPatient;
+ data['ProjectID'] = this.projectID;
+ data['NearestProjectID'] = this.nearestProjectID;
+ data['Longitude'] = this.longitude;
+ data['Latitude'] = this.latitude;
+ data['AppointmentNo'] = this.appointmentNo;
+ data['DischargeID'] = this.dischargeID;
+ data['LineItemNo'] = this.lineItemNo;
+ data['Status'] = this.status;
+ data['Description'] = this.description;
+ data['DescriptionN'] = this.descriptionN;
+ data['CreatedOn'] = this.createdOn;
+ data['ServiceID'] = this.serviceID;
+ data['CreatedBy'] = this.createdBy;
+ data['EditedOn'] = this.editedOn;
+ data['EditedBy'] = this.editedBy;
+ data['Channel'] = this.channel;
+ data['ClientRequestID'] = this.clientRequestID;
+ data['ReturnedToQueue'] = this.returnedToQueue;
+ data['PickupDateTime'] = this.pickupDateTime;
+ data['PickupLocationName'] = this.pickupLocationName;
+ data['DropoffLocationName'] = this.dropoffLocationName;
+ data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions;
+ data['NearestProjectDescription'] = this.nearestProjectDescription;
+ data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN;
+ data['ProjectDescription'] = this.projectDescription;
+ data['ProjectDescriptionN'] = this.projectDescriptionN;
+ return data;
+ }
+}
diff --git a/lib/core/model/er/PatientER.dart b/lib/core/model/er/PatientER.dart
new file mode 100644
index 00000000..d0827311
--- /dev/null
+++ b/lib/core/model/er/PatientER.dart
@@ -0,0 +1,207 @@
+import 'package:diplomaticquarterapp/core/enum/Ambulate.dart';
+
+import 'get_all_transportation_method_list_model.dart';
+
+class PatientER {
+ double versionID;
+ int channel;
+ int languageID;
+ String iPAdress;
+ String generalid;
+ int patientOutSA;
+ String sessionID;
+ bool isDentalAllowedBackend;
+ int deviceTypeID;
+ int patientID;
+ String tokenID;
+ int patientTypeID;
+ int patientType;
+ int orderServiceID;
+ String patientIdentificationID;
+ int direction;
+ bool haveAppointment;
+ int tripType;
+ int pickupUrgency;
+ int pickupSpot;
+ String pickupDateTime;
+ int transportationMethodId;
+ int selectedAmbulate;
+ String requesterNote;
+ int requesterFileNo;
+ String requesterMobileNo;
+ bool requesterIsOutSA;
+ int isOutPatient;
+ String pickupLocationName;
+ String dropoffLocationName;
+ int projectID;
+ int createdBy;
+ int lineItemNo;
+ int cost;
+ double vAT;
+ double totalPrice;
+ String pickupLocationLattitude;
+ String pickupLocationLongitude;
+ String dropoffLocationLattitude;
+ String dropoffLocationLongitude;
+ String latitude;
+ String longitude;
+ String appointmentNo;
+ dynamic appointmentClinicName;
+ dynamic appointmentDoctorName;
+ dynamic appointmentBranch;
+ dynamic appointmentTime;
+ PatientERTransportationMethod patientERTransportationMethod;
+ Ambulate ambulate;
+ PatientER(
+ {this.versionID,
+ this.channel,
+ this.languageID,
+ this.iPAdress,
+ this.generalid,
+ this.patientOutSA,
+ this.sessionID,
+ this.isDentalAllowedBackend,
+ this.deviceTypeID,
+ this.patientID,
+ this.tokenID,
+ this.patientTypeID,
+ this.patientType,
+ this.orderServiceID = 4,
+ this.patientIdentificationID,
+ this.direction,
+ this.haveAppointment,
+ this.tripType,
+ this.pickupUrgency,
+ this.pickupSpot,
+ this.pickupDateTime,
+ this.transportationMethodId,
+ this.selectedAmbulate,
+ this.requesterNote,
+ this.requesterFileNo,
+ this.requesterMobileNo,
+ this.requesterIsOutSA,
+ this.isOutPatient,
+ this.pickupLocationName,
+ this.dropoffLocationName,
+ this.projectID,
+ this.createdBy,
+ this.lineItemNo,
+ this.cost,
+ this.vAT,
+ this.totalPrice,
+ this.pickupLocationLattitude,
+ this.pickupLocationLongitude,
+ this.dropoffLocationLattitude,
+ this.dropoffLocationLongitude,
+ this.latitude,
+ this.longitude,
+ this.appointmentNo,
+ this.appointmentClinicName,
+ this.appointmentDoctorName,
+ this.appointmentBranch,
+ this.appointmentTime,
+ this.patientERTransportationMethod,
+ this.ambulate});
+
+ PatientER.fromJson(Map json) {
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ patientID = json['PatientID'];
+ tokenID = json['TokenID'];
+ patientTypeID = json['PatientTypeID'];
+ patientType = json['PatientType'];
+ orderServiceID = json['OrderServiceID'];
+ patientIdentificationID = json['PatientIdentificationID'];
+ direction = json['Direction'];
+ haveAppointment = json['HaveAppointment'];
+ tripType = json['TripType'];
+ pickupUrgency = json['PickupUrgency'];
+ pickupSpot = json['PickupSpot'];
+ pickupDateTime = json['PickupDateTime'];
+ transportationMethodId = json['TransportationMethodId'];
+ selectedAmbulate = json['SelectedAmbulate'];
+ requesterNote = json['RequesterNote'];
+ requesterFileNo = json['RequesterFileNo'];
+ requesterMobileNo = json['RequesterMobileNo'];
+ requesterIsOutSA = json['RequesterIsOutSA'];
+ isOutPatient = json['IsOutPatient'];
+ pickupLocationName = json['PickupLocationName'];
+ dropoffLocationName = json['DropoffLocationName'];
+ projectID = json['ProjectID'];
+ createdBy = json['CreatedBy'];
+ lineItemNo = json['LineItemNo'];
+ cost = json['Cost'];
+ vAT = json['VAT'];
+ totalPrice = json['TotalPrice'];
+ pickupLocationLattitude = json['PickupLocationLattitude'];
+ pickupLocationLongitude = json['PickupLocationLongitude'];
+ dropoffLocationLattitude = json['DropoffLocationLattitude'];
+ dropoffLocationLongitude = json['DropoffLocationLongitude'];
+ latitude = json['Latitude'];
+ longitude = json['Longitude'];
+ appointmentNo = json['AppointmentNo'];
+ appointmentClinicName = json['AppointmentClinicName'];
+ appointmentDoctorName = json['AppointmentDoctorName'];
+ appointmentBranch = json['AppointmentBranch'];
+ appointmentTime = json['AppointmentTime'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ data['PatientID'] = this.patientID;
+ data['TokenID'] = this.tokenID;
+ data['PatientTypeID'] = this.patientTypeID;
+ data['PatientType'] = this.patientType;
+ data['OrderServiceID'] = this.orderServiceID;
+ data['PatientIdentificationID'] = this.patientIdentificationID;
+ data['Direction'] = this.direction;
+ data['HaveAppointment'] = this.haveAppointment;
+ data['TripType'] = this.tripType;
+ data['PickupUrgency'] = this.pickupUrgency;
+ data['PickupSpot'] = this.pickupSpot;
+ data['PickupDateTime'] = this.pickupDateTime;
+ data['TransportationMethodId'] = this.transportationMethodId;
+ data['SelectedAmbulate'] = this.selectedAmbulate;
+ data['RequesterNote'] = this.requesterNote;
+ data['RequesterFileNo'] = this.requesterFileNo;
+ data['RequesterMobileNo'] = this.requesterMobileNo;
+ data['RequesterIsOutSA'] = this.requesterIsOutSA;
+ data['IsOutPatient'] = this.isOutPatient;
+ data['PickupLocationName'] = this.pickupLocationName;
+ data['DropoffLocationName'] = this.dropoffLocationName;
+ data['ProjectID'] = this.projectID;
+ data['CreatedBy'] = this.createdBy;
+ data['LineItemNo'] = this.lineItemNo;
+ data['Cost'] = this.cost;
+ data['VAT'] = this.vAT;
+ data['TotalPrice'] = this.totalPrice;
+ data['PickupLocationLattitude'] = this.pickupLocationLattitude;
+ data['PickupLocationLongitude'] = this.pickupLocationLongitude;
+ data['DropoffLocationLattitude'] = this.dropoffLocationLattitude;
+ data['DropoffLocationLongitude'] = this.dropoffLocationLongitude;
+ data['Latitude'] = this.latitude;
+ data['Longitude'] = this.longitude;
+ data['AppointmentNo'] = this.appointmentNo;
+ data['AppointmentClinicName'] = this.appointmentClinicName;
+ data['AppointmentDoctorName'] = this.appointmentDoctorName;
+ data['AppointmentBranch'] = this.appointmentBranch;
+ data['AppointmentTime'] = this.appointmentTime;
+ return data;
+ }
+}
diff --git a/lib/core/model/er/PickUpRequestPresOrder.dart b/lib/core/model/er/PickUpRequestPresOrder.dart
new file mode 100644
index 00000000..9ce3e678
--- /dev/null
+++ b/lib/core/model/er/PickUpRequestPresOrder.dart
@@ -0,0 +1,204 @@
+class PickUpRequestPresOrder {
+ int id;
+ int presOrderID;
+ String createDate;
+ String lastEditDate;
+ int createdBy;
+ int lastEditBy;
+ bool isActive;
+ String requestNo;
+ int requesterId;
+ int direction;
+ bool haveAppointment;
+ dynamic appointmentId;
+ int tripType;
+ int pickupUrgency;
+ String pickupDateTime;
+ dynamic pickupLocationId;
+ int pickupSpot;
+ dynamic dropoffLocationId;
+ int transportationMethodId;
+ int cost;
+ double vAT;
+ double totalPrice;
+ int amountCollected;
+ int selectedAmbulate;
+ String requesterNote;
+ int status;
+ int paymentStatus;
+ dynamic rejectReason;
+ int visibility;
+ dynamic durationId;
+ dynamic imageId;
+ String requesterFileNo;
+ String requesterMobileNo;
+ bool requesterIsOutSA;
+ String pickupLocationLongitude;
+ String pickupLocationLattitude;
+ String dropoffLocationLongitude;
+ String dropoffLocationLattitude;
+ dynamic appointmentClinicName;
+ dynamic appointmentDoctorName;
+ dynamic appointmentBranch;
+ dynamic appointmentTime;
+ String pickupLocationName;
+ String dropoffLocationName;
+ String title;
+ String titleAR;
+ String ambulateDescription;
+ String ambulateDescriptionN;
+
+ PickUpRequestPresOrder(
+ {this.id,
+ this.presOrderID,
+ this.createDate,
+ this.lastEditDate,
+ this.createdBy,
+ this.lastEditBy,
+ this.isActive,
+ this.requestNo,
+ this.requesterId,
+ this.direction,
+ this.haveAppointment,
+ this.appointmentId,
+ this.tripType,
+ this.pickupUrgency,
+ this.pickupDateTime,
+ this.pickupLocationId,
+ this.pickupSpot,
+ this.dropoffLocationId,
+ this.transportationMethodId,
+ this.cost,
+ this.vAT,
+ this.totalPrice,
+ this.amountCollected,
+ this.selectedAmbulate,
+ this.requesterNote,
+ this.status,
+ this.paymentStatus,
+ this.rejectReason,
+ this.visibility,
+ this.durationId,
+ this.imageId,
+ this.requesterFileNo,
+ this.requesterMobileNo,
+ this.requesterIsOutSA,
+ this.pickupLocationLongitude,
+ this.pickupLocationLattitude,
+ this.dropoffLocationLongitude,
+ this.dropoffLocationLattitude,
+ this.appointmentClinicName,
+ this.appointmentDoctorName,
+ this.appointmentBranch,
+ this.appointmentTime,
+ this.pickupLocationName,
+ this.dropoffLocationName,
+ this.title,
+ this.titleAR,
+ this.ambulateDescription,
+ this.ambulateDescriptionN});
+
+ PickUpRequestPresOrder.fromJson(Map json) {
+ id = json['Id'];
+ presOrderID = json['PresOrderID'];
+ createDate = json['CreateDate'];
+ lastEditDate = json['LastEditDate'];
+ createdBy = json['CreatedBy'];
+ lastEditBy = json['LastEditBy'];
+ isActive = json['IsActive'];
+ requestNo = json['RequestNo'];
+ requesterId = json['RequesterId'];
+ direction = json['Direction'];
+ haveAppointment = json['HaveAppointment'];
+ appointmentId = json['AppointmentId'];
+ tripType = json['TripType'];
+ pickupUrgency = json['PickupUrgency'];
+ pickupDateTime = json['PickupDateTime'];
+ pickupLocationId = json['PickupLocationId'];
+ pickupSpot = json['PickupSpot'];
+ dropoffLocationId = json['DropoffLocationId'];
+ transportationMethodId = json['TransportationMethodId'];
+ cost = json['Cost'];
+ vAT = json['VAT'];
+ totalPrice = json['TotalPrice'];
+ amountCollected = json['AmountCollected'];
+ selectedAmbulate = json['SelectedAmbulate'];
+ requesterNote = json['RequesterNote'];
+ status = json['Status'];
+ paymentStatus = json['PaymentStatus'];
+ rejectReason = json['RejectReason'];
+ visibility = json['Visibility'];
+ durationId = json['DurationId'];
+ imageId = json['ImageId'];
+ requesterFileNo = json['RequesterFileNo'];
+ requesterMobileNo = json['RequesterMobileNo'];
+ requesterIsOutSA = json['RequesterIsOutSA'];
+ pickupLocationLongitude = json['PickupLocationLongitude'];
+ pickupLocationLattitude = json['PickupLocationLattitude'];
+ dropoffLocationLongitude = json['DropoffLocationLongitude'];
+ dropoffLocationLattitude = json['DropoffLocationLattitude'];
+ appointmentClinicName = json['AppointmentClinicName'];
+ appointmentDoctorName = json['AppointmentDoctorName'];
+ appointmentBranch = json['AppointmentBranch'];
+ appointmentTime = json['AppointmentTime'];
+ pickupLocationName = json['PickupLocationName'];
+ dropoffLocationName = json['DropoffLocationName'];
+ title = json['Title'];
+ titleAR = json['TitleAR'];
+ ambulateDescription = json['AmbulateDescription'];
+ ambulateDescriptionN = json['AmbulateDescriptionN'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['Id'] = this.id;
+ data['PresOrderID'] = this.presOrderID;
+ data['CreateDate'] = this.createDate;
+ data['LastEditDate'] = this.lastEditDate;
+ data['CreatedBy'] = this.createdBy;
+ data['LastEditBy'] = this.lastEditBy;
+ data['IsActive'] = this.isActive;
+ data['RequestNo'] = this.requestNo;
+ data['RequesterId'] = this.requesterId;
+ data['Direction'] = this.direction;
+ data['HaveAppointment'] = this.haveAppointment;
+ data['AppointmentId'] = this.appointmentId;
+ data['TripType'] = this.tripType;
+ data['PickupUrgency'] = this.pickupUrgency;
+ data['PickupDateTime'] = this.pickupDateTime;
+ data['PickupLocationId'] = this.pickupLocationId;
+ data['PickupSpot'] = this.pickupSpot;
+ data['DropoffLocationId'] = this.dropoffLocationId;
+ data['TransportationMethodId'] = this.transportationMethodId;
+ data['Cost'] = this.cost;
+ data['VAT'] = this.vAT;
+ data['TotalPrice'] = this.totalPrice;
+ data['AmountCollected'] = this.amountCollected;
+ data['SelectedAmbulate'] = this.selectedAmbulate;
+ data['RequesterNote'] = this.requesterNote;
+ data['Status'] = this.status;
+ data['PaymentStatus'] = this.paymentStatus;
+ data['RejectReason'] = this.rejectReason;
+ data['Visibility'] = this.visibility;
+ data['DurationId'] = this.durationId;
+ data['ImageId'] = this.imageId;
+ data['RequesterFileNo'] = this.requesterFileNo;
+ data['RequesterMobileNo'] = this.requesterMobileNo;
+ data['RequesterIsOutSA'] = this.requesterIsOutSA;
+ data['PickupLocationLongitude'] = this.pickupLocationLongitude;
+ data['PickupLocationLattitude'] = this.pickupLocationLattitude;
+ data['DropoffLocationLongitude'] = this.dropoffLocationLongitude;
+ data['DropoffLocationLattitude'] = this.dropoffLocationLattitude;
+ data['AppointmentClinicName'] = this.appointmentClinicName;
+ data['AppointmentDoctorName'] = this.appointmentDoctorName;
+ data['AppointmentBranch'] = this.appointmentBranch;
+ data['AppointmentTime'] = this.appointmentTime;
+ data['PickupLocationName'] = this.pickupLocationName;
+ data['DropoffLocationName'] = this.dropoffLocationName;
+ data['Title'] = this.title;
+ data['TitleAR'] = this.titleAR;
+ data['AmbulateDescription'] = this.ambulateDescription;
+ data['AmbulateDescriptionN'] = this.ambulateDescriptionN;
+ return data;
+ }
+}
diff --git a/lib/core/model/er/get_all_transportation_method_list_model.dart b/lib/core/model/er/get_all_transportation_method_list_model.dart
index 3402873e..ebc9caf7 100644
--- a/lib/core/model/er/get_all_transportation_method_list_model.dart
+++ b/lib/core/model/er/get_all_transportation_method_list_model.dart
@@ -1,23 +1,23 @@
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
-class PatientER_RRT_GetAllTransportationMethodListModel {
- int id;
+class PatientERTransportationMethod {
+ dynamic id;
DateTime createDate;
DateTime lastEditDate;
- int createdBy;
- int lastEditBy;
+ dynamic createdBy;
+ dynamic lastEditBy;
bool isActive;
String title;
String titleAR;
- int price;
- Null isDefault;
- int visibility;
- Null durationId;
+ dynamic price;
+ dynamic isDefault;
+ dynamic visibility;
+ dynamic durationId;
String description;
String descriptionAR;
- int totalPrice;
- int vAT;
+ dynamic totalPrice;
+ dynamic vAT;
- PatientER_RRT_GetAllTransportationMethodListModel(
+ PatientERTransportationMethod(
{
this.id,
this.createDate,
@@ -36,7 +36,7 @@ class PatientER_RRT_GetAllTransportationMethodListModel {
this.totalPrice,
this.vAT});
- PatientER_RRT_GetAllTransportationMethodListModel.fromJson(
+ PatientERTransportationMethod.fromJson(
Map json) {
id = json['Id'];
createDate = DateUtil.convertStringToDate(json['CreateDate']);
diff --git a/lib/core/service/AuthenticatedUserObject.dart b/lib/core/service/AuthenticatedUserObject.dart
index 1aaa4755..600e17e1 100644
--- a/lib/core/service/AuthenticatedUserObject.dart
+++ b/lib/core/service/AuthenticatedUserObject.dart
@@ -2,16 +2,17 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
-class AuthenticatedUserObject{
+class AuthenticatedUserObject {
AuthenticatedUser user;
AppSharedPreferences sharedPref = AppSharedPreferences();
bool isLogin = false;
- AuthenticatedUserObject(){
+
+ AuthenticatedUserObject() {
getUser();
}
getUser() async {
- if (user==null) {
+ if (user == null) {
var userData = await sharedPref.getObject(USER_PROFILE);
if (userData != null) user = AuthenticatedUser.fromJson(userData);
}
@@ -20,4 +21,7 @@ class AuthenticatedUserObject{
this.isLogin = isLogin != null;
}
+ logout() async {
+ isLogin = false;
+ }
}
diff --git a/lib/core/service/base_service.dart b/lib/core/service/base_service.dart
index f2820dc1..fdb80604 100644
--- a/lib/core/service/base_service.dart
+++ b/lib/core/service/base_service.dart
@@ -17,6 +17,7 @@ class BaseService {
AppSharedPreferences sharedPref = AppSharedPreferences();
BaseService() {
+ authenticatedUserObject.getUser();
user = authenticatedUserObject.user;
// getUser();
}
diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart
index 16b3286c..237245f8 100644
--- a/lib/core/service/client/base_app_client.dart
+++ b/lib/core/service/client/base_app_client.dart
@@ -15,7 +15,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
///await BaseAppClient.post('',
/// onSuccess: (dynamic response, int statusCode) {},
/// onFailure: (String error, int statusCode) {},
-/// body: null);
+/// body: Map();
class BaseAppClient {
post(String endPoint,
@@ -84,7 +84,6 @@ class BaseAppClient {
print("URL : $url");
print("Body : ${json.encode(body)}");
- var asd = "";
if (await Utils.checkConnection()) {
final response = await http.post(url.trim(),
body: json.encode(body),
diff --git a/lib/core/service/er/am_service.dart b/lib/core/service/er/am_service.dart
index 181ad37b..b654e0eb 100644
--- a/lib/core/service/er/am_service.dart
+++ b/lib/core/service/er/am_service.dart
@@ -1,25 +1,76 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/enum/OrderService.dart';
+import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
+import 'package:diplomaticquarterapp/core/model/er/PickUpRequestPresOrder.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
import '../base_service.dart';
class AmService extends BaseService {
- List AmModelList = List();
- Map body = Map();
+ List amModelList = List();
+ List patientAllPresOrdersList = List();
+ bool hasPendingOrder = false;
+ int pendingOrderID = 0;
+ String pendingOrderStatus = "";
+ String pendingOrderStatusAR = "";
+ PickUpRequestPresOrder pickUpRequestPresOrder;
Future getAllTransportationOrders() async {
hasError = false;
-
+ Map body = Map();
+ body['isDentalAllowedBackend'] = false;
+ body['IdentificationNo'] = user.patientIdentificationNo;
await baseAppClient.post(GET_AMBULANCE_REQUEST,
onSuccess: (dynamic response, int statusCode) {
- AmModelList.clear();
- response['AmModelList'].forEach((vital) {
- AmModelList.add(
- PatientER_RRT_GetAllTransportationMethodListModel.fromJson(vital));
+ amModelList.clear();
+ response['PatientER_RRT_GetAllTransportationMethodList'].forEach((item) {
+ amModelList.add(PatientERTransportationMethod.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
+
+ Future getPatientAllPresOrdersList() async {
+ hasError = false;
+ hasPendingOrder = false;
+ await baseAppClient.post(GET_PATIENT_ALL_PRES_ORDERS,
+ onSuccess: (dynamic response, int statusCode) {
+ patientAllPresOrdersList.clear();
+ response['PatientER_GetPatientAllPresOrdersList'].forEach((item) {
+ if (item['ServiceID'] == OrderService.AMBULANCE.getIdOrderService()) {
+ var order = PatientAllPresOrders.fromJson(item);
+ patientAllPresOrdersList.add(order);
+ if (order.status == 1) {
+ hasPendingOrder = true;
+ pendingOrderID = order.iD;
+ pendingOrderStatus = order.description;
+ pendingOrderStatusAR = order.descriptionN;
+ }
+ }
+ });
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: Map());
+ }
+
+ Future getOrderDetails() async {
+ hasError = false;
+ hasPendingOrder = false;
+ Map body = Map();
+ body['PresOrderID'] = pendingOrderID;
+ await baseAppClient.post(GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID,
+ onSuccess: (dynamic response, int statusCode) {
+ patientAllPresOrdersList.clear();
+ response['PatientER_RRT_GetPickUpRequestByPresOrderIDList']
+ .forEach((item) {
+ pickUpRequestPresOrder = PickUpRequestPresOrder.fromJson(item);
+ });
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: Map());
+ }
}
diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart
index 90230f6d..f90280cf 100644
--- a/lib/core/service/medical/medical_service.dart
+++ b/lib/core/service/medical/medical_service.dart
@@ -1,13 +1,20 @@
import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/core/model/er/PatientER.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+import 'package:flutter/cupertino.dart';
class MedicalService extends BaseService {
List appoitmentAllHistoryResultList = List();
- getAppointmentHistory() async {
+ getAppointmentHistory({bool isActiveAppointment = false}) async {
hasError = false;
super.error = "";
+ Map body = Map();
+ if(isActiveAppointment) {
+ body['IsActiveAppointment'] = true;
+ body['isDentalAllowedBackend'] = false;
+ }
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
onSuccess: (response, statusCode) async {
@@ -19,6 +26,23 @@ class MedicalService extends BaseService {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
- }, body: Map());
+ }, body: body);
+ }
+
+ addAmbulanceRequest({@required PatientER patientER}) async {
+ hasError = false;
+ super.error = "";
+ Map body = Map();
+ body['RequesterFileNo'] = user.patientID;
+ body['RequesterMobileNo'] = user.mobileNumber;
+ body['RequesterIsOutSA'] = user.outSA;
+ await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY,
+ onSuccess: (response, statusCode) async {
+
+
+ }, onFailure: (String error, int statusCode) {
+ hasError = true;
+ super.error = error;
+ }, body: body);
}
}
diff --git a/lib/core/viewModels/base_view_model.dart b/lib/core/viewModels/base_view_model.dart
index 7e16d22d..18ab02e3 100644
--- a/lib/core/viewModels/base_view_model.dart
+++ b/lib/core/viewModels/base_view_model.dart
@@ -18,6 +18,7 @@ class BaseViewModel extends ChangeNotifier {
AuthenticatedUser user;
AppSharedPreferences sharedPref = AppSharedPreferences();
+ AuthenticatedUserObject authenticatedUserObject = locator();
void setState(ViewState viewState) {
_state = viewState;
diff --git a/lib/core/viewModels/er/am_request_view_model.dart b/lib/core/viewModels/er/am_request_view_model.dart
index db1acbf0..fbd3d95d 100644
--- a/lib/core/viewModels/er/am_request_view_model.dart
+++ b/lib/core/viewModels/er/am_request_view_model.dart
@@ -1,32 +1,82 @@
-
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
+import 'package:diplomaticquarterapp/core/model/er/PatientAllPresOrders.dart';
import 'package:diplomaticquarterapp/core/model/er/get_all_transportation_method_list_model.dart';
+import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/service/er/am_service.dart';
+import 'package:diplomaticquarterapp/core/service/hospital_service.dart';
+import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import '../base_view_model.dart';
import '../../../locator.dart';
-class AmRequestViewModel extends BaseViewModel{
+class AmRequestViewModel extends BaseViewModel {
+ AmService _amService = locator();
+ HospitalService _hospitalService = locator();
+ MedicalService _medicalService = locator();
+ List get amRequestModeList =>
+ _amService.amModelList;
- AmService _amService = locator();
+ List get patientAllPresOrdersList =>
+ _amService.patientAllPresOrdersList;
- List get AmRequestModeList=>
- _amService.AmModelList;
+ List get appoitmentAllHistoryResultList =>
+ _medicalService.appoitmentAllHistoryResultList;
- getAmRequestOrders({int id, int projectID}) async {
- setState(ViewState.Busy);
+ List get hospitals => _hospitalService.hospitals;
+ bool get hasPendingOrder =>_amService.hasPendingOrder;
- await _amService.getAllTransportationOrders();
+ Future getAppointmentHistory() async {
+ setState(ViewState.BusyLocal);
+ await _medicalService.getAppointmentHistory(isActiveAppointment: true);
+ if (_medicalService.hasError) {
+ error = _medicalService.error;
+ setState(ViewState.ErrorLocal);
+ } else
+ setState(ViewState.Idle);
+ }
- if ( _amService.hasError) {
- error = _amService.error;
+ Future getAmRequestOrders() async {
+ setState(ViewState.Busy);
+ await _amService.getAllTransportationOrders();
+ if (_amService.hasError) {
+ error = _amService.error;
setState(ViewState.Error);
} else
- setState(ViewState.Idle);
+ getHospitals();
}
+ Future getHospitals() async {
+ setState(ViewState.Busy);
+ await _hospitalService.getHospitals();
+ if (_hospitalService.hasError) {
+ error = _hospitalService.error;
+ setState(ViewState.Error);
+ } else
+ getPatientAllPresOrdersList();
+ }
+ Future getPatientAllPresOrdersList() async {
+ setState(ViewState.Busy);
+ await _amService.getPatientAllPresOrdersList();
+ if (_hospitalService.hasError) {
+ error = _hospitalService.error;
+ setState(ViewState.Error);
+ } else if (_amService.hasPendingOrder) {
+ getOrderDetails();
+ } else
+ setState(ViewState.Idle);
+ }
-}
\ No newline at end of file
+ Future getOrderDetails() async {
+ setState(ViewState.Busy);
+ await _amService.getOrderDetails();
+ if (_hospitalService.hasError) {
+ error = _hospitalService.error;
+ setState(ViewState.Error);
+ } else
+ setState(ViewState.Idle);
+ }
+}
diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart
index 032aeb1e..8cbf0efc 100644
--- a/lib/core/viewModels/medical/labs_view_model.dart
+++ b/lib/core/viewModels/medical/labs_view_model.dart
@@ -21,52 +21,54 @@ class LabsViewModel extends BaseViewModel {
: _patientLabOrdersListHospital;
void getLabs() async {
- setState(ViewState.Busy);
- await _labsService.getPatientLabOrdersList();
- if (_labsService.hasError) {
- error = _labsService.error;
- setState(ViewState.Error);
- } else {
- _labsService.patientLabOrdersList.forEach((element) {
- List patientLabOrdersClinic =
- _patientLabOrdersListClinic
- .where((elementClinic) =>
- elementClinic.filterName == element.clinicDescription)
- .toList();
+ if (authenticatedUserObject.isLogin) {
+ setState(ViewState.Busy);
+ await _labsService.getPatientLabOrdersList();
+ if (_labsService.hasError) {
+ error = _labsService.error;
+ setState(ViewState.Error);
+ } else {
+ _labsService.patientLabOrdersList.forEach((element) {
+ List patientLabOrdersClinic =
+ _patientLabOrdersListClinic
+ .where((elementClinic) =>
+ elementClinic.filterName == element.clinicDescription)
+ .toList();
- if (patientLabOrdersClinic.length != 0) {
- _patientLabOrdersListClinic[_patientLabOrdersListClinic
- .indexOf(patientLabOrdersClinic[0])]
- .patientLabOrdersList
- .add(element);
- } else {
- _patientLabOrdersListClinic.add(PatientLabOrdersList(
- filterName: element.clinicDescription,
- patientDoctorAppointment: element));
- }
+ if (patientLabOrdersClinic.length != 0) {
+ _patientLabOrdersListClinic[_patientLabOrdersListClinic
+ .indexOf(patientLabOrdersClinic[0])]
+ .patientLabOrdersList
+ .add(element);
+ } else {
+ _patientLabOrdersListClinic.add(PatientLabOrdersList(
+ filterName: element.clinicDescription,
+ patientDoctorAppointment: element));
+ }
- // doctor list sort via project
- List patientLabOrdersHospital =
- _patientLabOrdersListHospital
- .where(
- (elementClinic) =>
- elementClinic.filterName == element.projectName,
- )
- .toList();
+ // doctor list sort via project
+ List patientLabOrdersHospital =
+ _patientLabOrdersListHospital
+ .where(
+ (elementClinic) =>
+ elementClinic.filterName == element.projectName,
+ )
+ .toList();
- if (patientLabOrdersHospital.length != 0) {
- _patientLabOrdersListHospital[_patientLabOrdersListHospital
- .indexOf(patientLabOrdersHospital[0])]
- .patientLabOrdersList
- .add(element);
- } else {
- _patientLabOrdersListHospital.add(PatientLabOrdersList(
- filterName: element.projectName,
- patientDoctorAppointment: element));
- }
- });
+ if (patientLabOrdersHospital.length != 0) {
+ _patientLabOrdersListHospital[_patientLabOrdersListHospital
+ .indexOf(patientLabOrdersHospital[0])]
+ .patientLabOrdersList
+ .add(element);
+ } else {
+ _patientLabOrdersListHospital.add(PatientLabOrdersList(
+ filterName: element.projectName,
+ patientDoctorAppointment: element));
+ }
+ });
- setState(ViewState.Idle);
+ setState(ViewState.Idle);
+ }
}
}
diff --git a/lib/core/viewModels/medical/medical_view_model.dart b/lib/core/viewModels/medical/medical_view_model.dart
index fa330aad..f8b14c6e 100644
--- a/lib/core/viewModels/medical/medical_view_model.dart
+++ b/lib/core/viewModels/medical/medical_view_model.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
+import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/medical/medical_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
@@ -11,13 +12,15 @@ class MedicalViewModel extends BaseViewModel {
_medicalService.appoitmentAllHistoryResultList;
getAppointmentHistory() async {
- setState(ViewState.Busy);
- if (_medicalService.appoitmentAllHistoryResultList.length == 0)
- await _medicalService.getAppointmentHistory();
- if (_medicalService.hasError) {
- error = _medicalService.error;
- setState(ViewState.Error);
- } else
- setState(ViewState.Idle);
+ if (authenticatedUserObject.isLogin) {
+ setState(ViewState.Busy);
+ if (_medicalService.appoitmentAllHistoryResultList.length == 0)
+ await _medicalService.getAppointmentHistory();
+ if (_medicalService.hasError) {
+ error = _medicalService.error;
+ setState(ViewState.Error);
+ } else
+ setState(ViewState.Idle);
+ }
}
}
diff --git a/lib/models/Appointments/AppoimentAllHistoryResultList.dart b/lib/models/Appointments/AppoimentAllHistoryResultList.dart
index 9ba1fb8e..20eace25 100644
--- a/lib/models/Appointments/AppoimentAllHistoryResultList.dart
+++ b/lib/models/Appointments/AppoimentAllHistoryResultList.dart
@@ -64,73 +64,75 @@ class AppoitmentAllHistoryResultList {
String qR;
int remaniningHoursTocanPay;
bool sMSButtonVisable;
+ int serviceID;
AppoitmentAllHistoryResultList(
{this.setupID,
- this.projectID,
- this.appointmentNo,
- this.appointmentDate,
- this.appointmentDateN,
- this.appointmentType,
- this.bookDate,
- this.patientType,
- this.patientID,
- this.clinicID,
- this.doctorID,
- this.endDate,
- this.startTime,
- this.endTime,
- this.status,
- this.visitType,
- this.visitFor,
- this.patientStatusType,
- this.companyID,
- this.bookedBy,
- this.bookedOn,
- this.confirmedBy,
- this.confirmedOn,
- this.arrivalChangedBy,
- this.arrivedOn,
- this.editedBy,
- this.editedOn,
- this.doctorName,
- this.doctorNameN,
- this.statusDesc,
- this.statusDescN,
- this.vitalStatus,
- this.vitalSignAppointmentNo,
- this.episodeID,
- this.actualDoctorRate,
- this.clinicName,
- this.complainExists,
- this.doctorImageURL,
- this.doctorNameObj,
- this.doctorRate,
- this.doctorSpeciality,
- this.doctorTitle,
- this.gender,
- this.genderDescription,
- this.iSAllowOnlineCheckedIN,
- this.isActiveDoctor,
- this.isActiveDoctorProfile,
- this.isDoctorAllowVedioCall,
- this.isExecludeDoctor,
- this.isFollowup,
- this.isLiveCareAppointment,
- this.isMedicalReportRequested,
- this.isOnlineCheckedIN,
- this.latitude,
- this.listHISGetContactLensPerscription,
- this.listHISGetGlassPerscription,
- this.longitude,
- this.nextAction,
- this.noOfPatientsRate,
- this.originalClinicID,
- this.originalProjectID,
- this.projectName,
- this.qR,
- this.remaniningHoursTocanPay,
- this.sMSButtonVisable});
+ this.projectID,
+ this.appointmentNo,
+ this.appointmentDate,
+ this.appointmentDateN,
+ this.appointmentType,
+ this.bookDate,
+ this.patientType,
+ this.patientID,
+ this.clinicID,
+ this.doctorID,
+ this.endDate,
+ this.startTime,
+ this.endTime,
+ this.status,
+ this.visitType,
+ this.visitFor,
+ this.patientStatusType,
+ this.companyID,
+ this.bookedBy,
+ this.bookedOn,
+ this.confirmedBy,
+ this.confirmedOn,
+ this.arrivalChangedBy,
+ this.arrivedOn,
+ this.editedBy,
+ this.editedOn,
+ this.doctorName,
+ this.doctorNameN,
+ this.statusDesc,
+ this.statusDescN,
+ this.vitalStatus,
+ this.vitalSignAppointmentNo,
+ this.episodeID,
+ this.actualDoctorRate,
+ this.clinicName,
+ this.complainExists,
+ this.doctorImageURL,
+ this.doctorNameObj,
+ this.doctorRate,
+ this.doctorSpeciality,
+ this.doctorTitle,
+ this.gender,
+ this.genderDescription,
+ this.iSAllowOnlineCheckedIN,
+ this.isActiveDoctor,
+ this.isActiveDoctorProfile,
+ this.isDoctorAllowVedioCall,
+ this.isExecludeDoctor,
+ this.isFollowup,
+ this.isLiveCareAppointment,
+ this.isMedicalReportRequested,
+ this.isOnlineCheckedIN,
+ this.latitude,
+ this.listHISGetContactLensPerscription,
+ this.listHISGetGlassPerscription,
+ this.longitude,
+ this.nextAction,
+ this.noOfPatientsRate,
+ this.originalClinicID,
+ this.originalProjectID,
+ this.projectName,
+ this.qR,
+ this.remaniningHoursTocanPay,
+ this.sMSButtonVisable,
+ this.serviceID});
AppoitmentAllHistoryResultList.fromJson(Map json) {
setupID = json['SetupID'];
@@ -173,7 +175,9 @@ class AppoitmentAllHistoryResultList {
doctorImageURL = json['DoctorImageURL'];
doctorNameObj = json['DoctorNameObj'];
doctorRate = json['DoctorRate'];
- doctorSpeciality = json['DoctorSpeciality'] != null ?json['DoctorSpeciality'].cast() : ["null"];
+ doctorSpeciality = json['DoctorSpeciality'] != null
+ ? json['DoctorSpeciality'].cast()
+ : ["null"];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
@@ -188,7 +192,7 @@ class AppoitmentAllHistoryResultList {
isOnlineCheckedIN = json['IsOnlineCheckedIN'];
latitude = json['Latitude'];
listHISGetContactLensPerscription =
- json['List_HIS_GetContactLensPerscription'];
+ json['List_HIS_GetContactLensPerscription'];
listHISGetGlassPerscription = json['List_HIS_GetGlassPerscription'];
longitude = json['Longitude'];
nextAction = json['NextAction'];
@@ -199,6 +203,7 @@ class AppoitmentAllHistoryResultList {
qR = json['QR'];
remaniningHoursTocanPay = json['RemaniningHoursTocanPay'];
sMSButtonVisable = json['SMSButtonVisable'];
+ serviceID = json['ServiceID'];
}
Map toJson() {
@@ -269,6 +274,7 @@ class AppoitmentAllHistoryResultList {
data['QR'] = this.qR;
data['RemaniningHoursTocanPay'] = this.remaniningHoursTocanPay;
data['SMSButtonVisable'] = this.sMSButtonVisable;
+ data['ServiceID'] = this.serviceID;
return data;
}
}
@@ -278,7 +284,8 @@ class PatientAppointmentList {
List patientDoctorAppointmentList = List();
PatientAppointmentList(
- {this.filterName, AppoitmentAllHistoryResultList patientDoctorAppointment}) {
+ {this.filterName,
+ AppoitmentAllHistoryResultList patientDoctorAppointment}) {
patientDoctorAppointmentList.add(patientDoctorAppointment);
}
}
diff --git a/lib/models/Appointments/InsertAppointmentRequest.dart b/lib/models/Appointments/InsertAppointmentRequest.dart
index badbb6a7..383e2eb5 100644
--- a/lib/models/Appointments/InsertAppointmentRequest.dart
+++ b/lib/models/Appointments/InsertAppointmentRequest.dart
@@ -13,7 +13,6 @@ class InsertAppointmentRequest extends Request {
bool IsVirtual;
List GeneralProcedureList;
String DeviceToken;
- String DeviceType;
bool IsForLiveCare;
String OriginalClinicID;
String OriginalProjectID;
diff --git a/lib/models/Appointments/PatientShareResposne.dart b/lib/models/Appointments/PatientShareResposne.dart
index e4a05e04..40670990 100644
--- a/lib/models/Appointments/PatientShareResposne.dart
+++ b/lib/models/Appointments/PatientShareResposne.dart
@@ -1,104 +1,108 @@
class PatientShareResponse {
int advanceNumber;
- String appointmentDate;
+ dynamic appointmentDate;
int appointmentNo;
int cashPrice;
int cashPriceTax;
int cashPriceWithTax;
int clinicID;
- String clinicName;
+ dynamic clinicName;
int companyId;
- String companyName;
+ dynamic companyName;
int companyShareWithTax;
- String doctorImageURL;
- String doctorNameObj;
- List doctorSpeciality;
- Null errCode;
+ dynamic doctorImageURL;
+ dynamic doctorNameObj;
+ int doctorID;
+ List doctorSpeciality;
+ dynamic errCode;
int groupID;
bool iSAllowOnlineCheckedIN;
- Null insurancePolicyNo;
+ dynamic insurancePolicyNo;
bool isExcludedForOnlineCheckin;
int isFollowup;
bool isLiveCareAppointment;
bool isOnlineCheckedIN;
- String message;
+ dynamic message;
int nextAction;
- Null patientCardID;
+ dynamic patientCardID;
int patientID;
dynamic patientShare;
dynamic patientShareWithTax;
int patientStatusType;
dynamic patientTaxAmount;
- String patientType;
+ dynamic patientType;
int paymentAmount;
- String paymentDate;
- Null paymentMethodName;
- Null paymentReferenceNumber;
+ dynamic paymentDate;
+ dynamic paymentMethodName;
+ dynamic paymentReferenceNumber;
int policyId;
- String policyName;
- String procedureName;
+ dynamic policyName;
+ dynamic procedureName;
int projectID;
- String projectName;
- Null setupID;
+ dynamic projectName;
+ dynamic setupID;
int sourceType;
- String startTime;
+ dynamic startTime;
int status;
int statusCode;
- Null statusDesc;
- Null subPolicyNo;
+ dynamic statusDesc;
+ dynamic subPolicyNo;
int userID;
+ int serviceID;
PatientShareResponse(
{this.advanceNumber,
- this.appointmentDate,
- this.appointmentNo,
- this.cashPrice,
- this.cashPriceTax,
- this.cashPriceWithTax,
- this.clinicID,
- this.clinicName,
- this.companyId,
- this.companyName,
- this.companyShareWithTax,
- this.doctorImageURL,
- this.doctorNameObj,
- this.doctorSpeciality,
- this.errCode,
- this.groupID,
- this.iSAllowOnlineCheckedIN,
- this.insurancePolicyNo,
- this.isExcludedForOnlineCheckin,
- this.isFollowup,
- this.isLiveCareAppointment,
- this.isOnlineCheckedIN,
- this.message,
- this.nextAction,
- this.patientCardID,
- this.patientID,
- this.patientShare,
- this.patientShareWithTax,
- this.patientStatusType,
- this.patientTaxAmount,
- this.patientType,
- this.paymentAmount,
- this.paymentDate,
- this.paymentMethodName,
- this.paymentReferenceNumber,
- this.policyId,
- this.policyName,
- this.procedureName,
- this.projectID,
- this.projectName,
- this.setupID,
- this.sourceType,
- this.startTime,
- this.status,
- this.statusCode,
- this.statusDesc,
- this.subPolicyNo,
- this.userID});
+ this.appointmentDate,
+ this.appointmentNo,
+ this.cashPrice,
+ this.cashPriceTax,
+ this.cashPriceWithTax,
+ this.clinicID,
+ this.clinicName,
+ this.companyId,
+ this.companyName,
+ this.companyShareWithTax,
+ this.doctorID,
+ this.doctorImageURL,
+ this.doctorNameObj,
+ this.doctorSpeciality,
+ this.errCode,
+ this.groupID,
+ this.iSAllowOnlineCheckedIN,
+ this.insurancePolicyNo,
+ this.isExcludedForOnlineCheckin,
+ this.isFollowup,
+ this.isLiveCareAppointment,
+ this.isOnlineCheckedIN,
+ this.message,
+ this.nextAction,
+ this.patientCardID,
+ this.patientID,
+ this.patientShare,
+ this.patientShareWithTax,
+ this.patientStatusType,
+ this.patientTaxAmount,
+ this.patientType,
+ this.paymentAmount,
+ this.paymentDate,
+ this.paymentMethodName,
+ this.paymentReferenceNumber,
+ this.policyId,
+ this.policyName,
+ this.procedureName,
+ this.projectID,
+ this.projectName,
+ this.setupID,
+ this.sourceType,
+ this.startTime,
+ this.status,
+ this.statusCode,
+ this.statusDesc,
+ this.subPolicyNo,
+ this.userID,
+ this.serviceID});
- PatientShareResponse.fromJson(Map json) {
+ PatientShareResponse.fromJson(Map json) {
advanceNumber = json['AdvanceNumber'];
appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo'];
@@ -110,9 +114,10 @@ class PatientShareResponse {
companyId = json['CompanyId'];
companyName = json['CompanyName'];
companyShareWithTax = json['CompanyShareWithTax'];
+ doctorID = json['DoctorID'];
doctorImageURL = json['DoctorImageURL'];
doctorNameObj = json['DoctorNameObj'];
- doctorSpeciality = json['DoctorSpeciality'].cast();
+// doctorSpeciality = json['DoctorSpeciality'].cast();
errCode = json['ErrCode'];
groupID = json['GroupID'];
iSAllowOnlineCheckedIN = json['ISAllowOnlineCheckedIN'];
@@ -147,10 +152,11 @@ class PatientShareResponse {
statusDesc = json['StatusDesc'];
subPolicyNo = json['SubPolicyNo'];
userID = json['UserID'];
+ serviceID = json['ServiceID'];
}
- Map toJson() {
- final Map data = new Map();
+ Map toJson() {
+ final Map data = new Map();
data['AdvanceNumber'] = this.advanceNumber;
data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo;
@@ -162,6 +168,7 @@ class PatientShareResponse {
data['CompanyId'] = this.companyId;
data['CompanyName'] = this.companyName;
data['CompanyShareWithTax'] = this.companyShareWithTax;
+ data['DoctorID'] = this.doctorID;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorNameObj'] = this.doctorNameObj;
data['DoctorSpeciality'] = this.doctorSpeciality;
@@ -199,6 +206,7 @@ class PatientShareResponse {
data['StatusDesc'] = this.statusDesc;
data['SubPolicyNo'] = this.subPolicyNo;
data['UserID'] = this.userID;
+ data['ServiceID'] = this.serviceID;
return data;
}
}
diff --git a/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart
new file mode 100644
index 00000000..a1290e4d
--- /dev/null
+++ b/lib/models/CovidDriveThru/CovidPaymentInfoResponse.dart
@@ -0,0 +1,96 @@
+class CovidPaymentInfoResponse {
+ dynamic propertyChanged;
+ dynamic cashPriceField;
+ dynamic cashPriceTaxField;
+ dynamic cashPriceWithTaxField;
+ dynamic companyIdField;
+ String companyNameField;
+ dynamic companyShareWithTaxField;
+ dynamic errCodeField;
+ dynamic groupIDField;
+ dynamic insurancePolicyNoField;
+ String messageField;
+ dynamic patientCardIDField;
+ dynamic patientShareField;
+ dynamic patientShareWithTaxField;
+ dynamic patientTaxAmountField;
+ dynamic policyIdField;
+ dynamic policyNameField;
+ String procedureNameField;
+ dynamic setupIDField;
+ dynamic statusCodeField;
+ dynamic subPolicyNoField;
+
+ CovidPaymentInfoResponse(
+ {this.propertyChanged,
+ this.cashPriceField,
+ this.cashPriceTaxField,
+ this.cashPriceWithTaxField,
+ this.companyIdField,
+ this.companyNameField,
+ this.companyShareWithTaxField,
+ this.errCodeField,
+ this.groupIDField,
+ this.insurancePolicyNoField,
+ this.messageField,
+ this.patientCardIDField,
+ this.patientShareField,
+ this.patientShareWithTaxField,
+ this.patientTaxAmountField,
+ this.policyIdField,
+ this.policyNameField,
+ this.procedureNameField,
+ this.setupIDField,
+ this.statusCodeField,
+ this.subPolicyNoField});
+
+ CovidPaymentInfoResponse.fromJson(Map json) {
+ propertyChanged = json['PropertyChanged'];
+ cashPriceField = json['cashPriceField'];
+ cashPriceTaxField = json['cashPriceTaxField'];
+ cashPriceWithTaxField = json['cashPriceWithTaxField'];
+ companyIdField = json['companyIdField'];
+ companyNameField = json['companyNameField'];
+ companyShareWithTaxField = json['companyShareWithTaxField'];
+ errCodeField = json['errCodeField'];
+ groupIDField = json['groupIDField'];
+ insurancePolicyNoField = json['insurancePolicyNoField'];
+ messageField = json['messageField'];
+ patientCardIDField = json['patientCardIDField'];
+ patientShareField = json['patientShareField'];
+ patientShareWithTaxField = json['patientShareWithTaxField'];
+ patientTaxAmountField = json['patientTaxAmountField'];
+ policyIdField = json['policyIdField'];
+ policyNameField = json['policyNameField'];
+ procedureNameField = json['procedureNameField'];
+ setupIDField = json['setupIDField'];
+ statusCodeField = json['statusCodeField'];
+ subPolicyNoField = json['subPolicyNoField'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['PropertyChanged'] = this.propertyChanged;
+ data['cashPriceField'] = this.cashPriceField;
+ data['cashPriceTaxField'] = this.cashPriceTaxField;
+ data['cashPriceWithTaxField'] = this.cashPriceWithTaxField;
+ data['companyIdField'] = this.companyIdField;
+ data['companyNameField'] = this.companyNameField;
+ data['companyShareWithTaxField'] = this.companyShareWithTaxField;
+ data['errCodeField'] = this.errCodeField;
+ data['groupIDField'] = this.groupIDField;
+ data['insurancePolicyNoField'] = this.insurancePolicyNoField;
+ data['messageField'] = this.messageField;
+ data['patientCardIDField'] = this.patientCardIDField;
+ data['patientShareField'] = this.patientShareField;
+ data['patientShareWithTaxField'] = this.patientShareWithTaxField;
+ data['patientTaxAmountField'] = this.patientTaxAmountField;
+ data['policyIdField'] = this.policyIdField;
+ data['policyNameField'] = this.policyNameField;
+ data['procedureNameField'] = this.procedureNameField;
+ data['setupIDField'] = this.setupIDField;
+ data['statusCodeField'] = this.statusCodeField;
+ data['subPolicyNoField'] = this.subPolicyNoField;
+ return data;
+ }
+}
diff --git a/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart b/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart
new file mode 100644
index 00000000..c85a06b3
--- /dev/null
+++ b/lib/models/CovidDriveThru/DriveThroughTestingCenterModel.dart
@@ -0,0 +1,68 @@
+class DriveThroughTestingCenterModel {
+ int rowID;
+ int iD;
+ int projectID;
+ String setupID;
+ double longitude;
+ double latitude;
+ int numberOfTracks;
+ bool isActive;
+ int createdBy;
+ String createdOn;
+ dynamic editedBy;
+ dynamic editedON;
+ dynamic projectName;
+ dynamic projectNameN;
+
+ DriveThroughTestingCenterModel(
+ {this.rowID,
+ this.iD,
+ this.projectID,
+ this.setupID,
+ this.longitude,
+ this.latitude,
+ this.numberOfTracks,
+ this.isActive,
+ this.createdBy,
+ this.createdOn,
+ this.editedBy,
+ this.editedON,
+ this.projectName,
+ this.projectNameN});
+
+ DriveThroughTestingCenterModel.fromJson(Map json) {
+ rowID = json['RowID'];
+ iD = json['ID'];
+ projectID = json['ProjectID'];
+ setupID = json['SetupID'];
+ longitude = json['Longitude'];
+ latitude = json['Latitude'];
+ numberOfTracks = json['NumberOfTracks'];
+ isActive = json['IsActive'];
+ createdBy = json['CreatedBy'];
+ createdOn = json['CreatedOn'];
+ editedBy = json['EditedBy'];
+ editedON = json['EditedON'];
+ projectName = json['ProjectName'];
+ projectNameN = json['ProjectNameN'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['RowID'] = this.rowID;
+ data['ID'] = this.iD;
+ data['ProjectID'] = this.projectID;
+ data['SetupID'] = this.setupID;
+ data['Longitude'] = this.longitude;
+ data['Latitude'] = this.latitude;
+ data['NumberOfTracks'] = this.numberOfTracks;
+ data['IsActive'] = this.isActive;
+ data['CreatedBy'] = this.createdBy;
+ data['CreatedOn'] = this.createdOn;
+ data['EditedBy'] = this.editedBy;
+ data['EditedON'] = this.editedON;
+ data['ProjectName'] = this.projectName;
+ data['ProjectNameN'] = this.projectNameN;
+ return data;
+ }
+}
diff --git a/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart b/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart
new file mode 100644
index 00000000..8951370c
--- /dev/null
+++ b/lib/models/LiveCare/LiveCareScheduleClinicsListResponse.dart
@@ -0,0 +1,64 @@
+class LiveCareScheduleClinicsListResponse {
+ List clinicsHaveScheduleList;
+
+ LiveCareScheduleClinicsListResponse({this.clinicsHaveScheduleList});
+
+ LiveCareScheduleClinicsListResponse.fromJson(Map json) {
+ if (json['ClinicsHaveScheduleList'] != null) {
+ clinicsHaveScheduleList = new List();
+ json['ClinicsHaveScheduleList'].forEach((v) {
+ clinicsHaveScheduleList.add(new ClinicsHaveScheduleList.fromJson(v));
+ });
+ }
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ if (this.clinicsHaveScheduleList != null) {
+ data['ClinicsHaveScheduleList'] =
+ this.clinicsHaveScheduleList.map((v) => v.toJson()).toList();
+ }
+ return data;
+ }
+}
+
+class ClinicsHaveScheduleList {
+ int clinicID;
+ int serviceID;
+ int projectID;
+ String clinicDesc;
+ String clinicDescN;
+ String projectDesc;
+ String projectDescN;
+
+ ClinicsHaveScheduleList(
+ {this.clinicID,
+ this.serviceID,
+ this.projectID,
+ this.clinicDesc,
+ this.clinicDescN,
+ this.projectDesc,
+ this.projectDescN});
+
+ ClinicsHaveScheduleList.fromJson(Map json) {
+ clinicID = json['ClinicID'];
+ serviceID = json['ServiceID'];
+ projectID = json['ProjectID'];
+ clinicDesc = json['ClinicDesc'];
+ clinicDescN = json['ClinicDescN'];
+ projectDesc = json['ProjectDesc'];
+ projectDescN = json['ProjectDescN'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['ClinicID'] = this.clinicID;
+ data['ServiceID'] = this.serviceID;
+ data['ProjectID'] = this.projectID;
+ data['ClinicDesc'] = this.clinicDesc;
+ data['ClinicDescN'] = this.clinicDescN;
+ data['ProjectDesc'] = this.projectDesc;
+ data['ProjectDescN'] = this.projectDescN;
+ return data;
+ }
+}
diff --git a/lib/models/LiveCare/insertVIDARequest.dart b/lib/models/LiveCare/insertVIDARequest.dart
new file mode 100644
index 00000000..938ca102
--- /dev/null
+++ b/lib/models/LiveCare/insertVIDARequest.dart
@@ -0,0 +1,92 @@
+class insertVIDARequest {
+ int patientID;
+ int acceptedBy;
+ int appointmentNo;
+ String deviceToken;
+ double latitude;
+ double longitude;
+ int serviceID;
+ int projectID;
+ int clinicID;
+ String deviceType;
+ String voipToken;
+ double versionID;
+ int channel;
+ int languageID;
+ String iPAdress;
+ String generalid;
+ int patientOutSA;
+ String sessionID;
+ bool isDentalAllowedBackend;
+ int deviceTypeID;
+
+ insertVIDARequest(
+ {this.patientID,
+ this.acceptedBy,
+ this.appointmentNo,
+ this.deviceToken,
+ this.latitude,
+ this.longitude,
+ this.serviceID,
+ this.projectID,
+ this.clinicID,
+ this.deviceType,
+ this.voipToken,
+ this.versionID,
+ this.channel,
+ this.languageID,
+ this.iPAdress,
+ this.generalid,
+ this.patientOutSA,
+ this.sessionID,
+ this.isDentalAllowedBackend,
+ this.deviceTypeID});
+
+ insertVIDARequest.fromJson(Map json) {
+ patientID = json['PatientID'];
+ acceptedBy = json['AcceptedBy'];
+ appointmentNo = json['AppointmentNo'];
+ deviceToken = json['DeviceToken'];
+ latitude = json['Latitude'];
+ longitude = json['Longitude'];
+ serviceID = json['ServiceID'];
+ projectID = json['ProjectID'];
+ clinicID = json['ClinicID'];
+ deviceType = json['DeviceType'];
+ voipToken = json['VoipToken'];
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['PatientID'] = this.patientID;
+ data['AcceptedBy'] = this.acceptedBy;
+ data['AppointmentNo'] = this.appointmentNo;
+ data['DeviceToken'] = this.deviceToken;
+ data['Latitude'] = this.latitude;
+ data['Longitude'] = this.longitude;
+ data['ServiceID'] = this.serviceID;
+ data['ProjectID'] = this.projectID;
+ data['ClinicID'] = this.clinicID;
+ data['DeviceType'] = this.deviceType;
+ data['VoipToken'] = this.voipToken;
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ return data;
+ }
+}
diff --git a/lib/models/Request.dart b/lib/models/Request.dart
index 03aa7760..a4cef77b 100644
--- a/lib/models/Request.dart
+++ b/lib/models/Request.dart
@@ -5,6 +5,7 @@ class Request {
var ProjectID;
var LanguageID;
var DeviceTypeID;
+ var DeviceType;
var AppointmentNo;
var IPAdress;
var VersionID;
diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart
index f5951057..f717ba8e 100644
--- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart
+++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart
@@ -42,6 +42,7 @@ class _AllHabibMedicalServiceState extends State {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).alhabiServices,
+ isShowDecPage: false,
body: Column(
children: [
Expanded(
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart
index 62729222..c84053c5 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart
@@ -1,4 +1,3 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@@ -6,6 +5,8 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'dart:math';
+import 'result_page.dart';
+
const activeCardColor = Color(0xff70777A);
const inactiveCardColor = Color(0xffFAFAFd);
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart
index 3d287610..1af0f949 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart
@@ -1,10 +1,11 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'dart:math';
+import 'bmr_result_page.dart';
+
const activeCardColorGender = Color(0xffC5272D);
const inactiveCardColorGender = Color(0xffFAFAFd);
const activeCardColor = Color(0xff70777A);
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart
index ccc7d212..91847e37 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart
@@ -1,10 +1,11 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'dart:math';
+import 'body_fat_result_page.dart';
+
const activeCardColorGender = Color(0xffC5272D);
const inactiveCardColorGender = Color(0xffFAFAFd);
const activeCardColor = Color(0xff70777A);
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart
index 994484e7..4361425a 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart
@@ -1,9 +1,10 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
+import 'calorie_result_page.dart';
+
const activeCardColorGender = Color(0xffC5272D);
const inactiveCardColorGender = Color(0xffFAFAFd);
const activeCardColor = Color(0xff70777A);
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart
index 2dfc3f92..e273b075 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart
@@ -1,13 +1,13 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'dart:math';
-
+import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:flutter/services.dart';
+import 'carbs_result_page.dart';
+
class Carbs extends StatefulWidget {
@override
_CarbsState createState() => _CarbsState();
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart
index 1e8cb50c..c9993b95 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart
@@ -96,7 +96,7 @@ class _DeliveryDueState extends State {
children: [
Row(
children: [
- Icon(Icons.date_range_rounded),
+ Icon(Icons.date_range),
Texts('Date'),
],
),
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart
index fb4f8948..9bdbfb36 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart
@@ -1,10 +1,11 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body_result_page.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'dart:math';
+import 'ideal_body_result_page.dart';
+
const activeCardColor = Color(0xff70777A);
const inactiveCardColor = Color(0xffFAFAFd);
diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart
index adc2f06d..1a272c11 100644
--- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart
+++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart
@@ -1,4 +1,3 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_result_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@@ -7,6 +6,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:intl/intl.dart';
+import 'ovulation_result_page.dart';
+
class OvulationPeriod extends StatefulWidget {
@override
_OvulationPeriodState createState() => _OvulationPeriodState();
diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart
index 9a2f08df..58caee36 100644
--- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart
+++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart
@@ -190,7 +190,7 @@ class _BloodCholesterolState extends State {
child: TextFormField(
controller: textController,
inputFormatters: [
- FilteringTextInputFormatter.digitsOnly
+// FilteringTextInputFormatter.digitsOnly
],
keyboardType: TextInputType.number,
decoration: InputDecoration(
diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart
index a90a5bbb..f5d66ccf 100644
--- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart
+++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart
@@ -192,7 +192,7 @@ class _BloodSugarState extends State {
child: TextFormField(
controller: textController,
inputFormatters: [
- FilteringTextInputFormatter.digitsOnly
+// FilteringTextInputFormatter.digitsOnly
],
keyboardType: TextInputType.number,
decoration: InputDecoration(
diff --git a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart
index fdf8d191..a86fdb88 100644
--- a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart
+++ b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart
@@ -188,7 +188,7 @@ class _TriglyceridesState extends State {
child: TextFormField(
controller: textController,
inputFormatters: [
- FilteringTextInputFormatter.digitsOnly
+// FilteringTextInputFormatter.digitsOnly
],
keyboardType: TextInputType.number,
decoration: InputDecoration(
diff --git a/lib/pages/AlHabibMedicalService/ health_calculators.dart b/lib/pages/AlHabibMedicalService/ health_calculators.dart
index 160f7e02..d3bd4bed 100644
--- a/lib/pages/AlHabibMedicalService/ health_calculators.dart
+++ b/lib/pages/AlHabibMedicalService/ health_calculators.dart
@@ -1,5 +1,5 @@
-import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart';
+import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart';
@@ -9,7 +9,9 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'health_calculator/bmi_calculator/bmi_calculator.dart';
import 'health_calculator/bmr_calculator/bmr_calculator.dart';
+import 'health_calculator/calorie_calculator/calorie_calculator.dart';
import 'health_calculator/delivery_due/delivery_due.dart';
import 'health_calculator/ideal_body/ideal_body.dart';
diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart
index 88ecdb6b..b0110d2b 100644
--- a/lib/pages/BookAppointment/BookConfirm.dart
+++ b/lib/pages/BookAppointment/BookConfirm.dart
@@ -24,10 +24,12 @@ class BookConfirm extends StatefulWidget {
String appoDateFormatted = "";
String appoTimeFormatted = "";
+ bool isLiveCareAppointment;
BookConfirm(
{@required this.doctor,
@required this.selectedDate,
+ @required this.isLiveCareAppointment,
@required this.selectedTime});
DoctorsListService service;
@@ -208,11 +210,13 @@ class _BookConfirmState extends State {
"assets/images/new-design/icon_hospital.png"),
),
Container(
+ width: MediaQuery.of(context).size.width * 0.7,
margin: EdgeInsets.fromLTRB(20.0, 5.0, 10.0, 5.0),
child: Text(
TranslationBase.of(context).clinic +
": " +
widget.doctor.clinicName,
+ overflow: TextOverflow.clip,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
@@ -338,6 +342,9 @@ class _BookConfirmState extends State {
),
),
),
+ SizedBox(
+ height: 120.0,
+ ),
],
),
),
@@ -358,7 +365,11 @@ class _BookConfirmState extends State {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
onPressed: () {
- insertAppointment(context, widget.doctor);
+ if (!widget.isLiveCareAppointment) {
+ insertAppointment(context, widget.doctor);
+ } else {
+ insertLiveCareScheduledAppointment(context, widget.doctor);
+ }
},
child: Text(TranslationBase.of(context).bookNow,
style: TextStyle(fontSize: 18.0)),
@@ -375,7 +386,11 @@ class _BookConfirmState extends State {
service.cancelAppointment(appo, context).then((res) {
if (res['MessageStatus'] == 1) {
Future.delayed(new Duration(milliseconds: 1500), () {
- insertAppointment(context, docObject);
+ if (!widget.isLiveCareAppointment) {
+ insertAppointment(context, widget.doctor);
+ } else {
+ insertLiveCareScheduledAppointment(context, widget.doctor);
+ }
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@@ -434,6 +449,55 @@ class _BookConfirmState extends State {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
+ insertLiveCareScheduledAppointment(context, DoctorList docObject) {
+ AppoitmentAllHistoryResultList appo;
+ widget.service
+ .insertLiveCareScheduleAppointment(
+ docObject.doctorID,
+ docObject.clinicID,
+ docObject.projectID,
+ docObject.serviceID,
+ widget.selectedTime,
+ widget.selectedDate,
+ context)
+ .then((res) {
+ if (res['MessageStatus'] == 1) {
+ AppToast.showSuccessToast(message: "Appointment Booked Successfully");
+ print(res['AppointmentNo']);
+
+ Future.delayed(new Duration(milliseconds: 1800), () {
+ getLiveCareAppointmentPatientShare(context, res['AppointmentNo'],
+ docObject.clinicID, docObject.projectID, docObject);
+ });
+ } else {
+ appo = new AppoitmentAllHistoryResultList();
+ appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
+ appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
+ appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
+ appo.endTime = res['SameClinicApptList'][0]['EndTime'];
+ appo.startTime = res['SameClinicApptList'][0]['StartTime'];
+ appo.doctorID = res['SameClinicApptList'][0]['DoctorID'];
+ appo.isLiveCareAppointment = true;
+ appo.originalClinicID = 0;
+ appo.originalProjectID = 0;
+ appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
+
+ ConfirmDialog dialog = new ConfirmDialog(
+ context: context,
+ confirmMessage: res['ErrorEndUserMessage'],
+ okText: TranslationBase.of(context).confirm,
+ cancelText: TranslationBase.of(context).cancel_nocaps,
+ okFunction: () => {cancelAppointment(docObject, appo, context)},
+ cancelFunction: () => {});
+ dialog.showAlertDialog(context);
+ }
+ }).catchError((err) {
+ AppToast.showErrorToast(message: err);
+ print(err);
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }
+
getPatientShare(context, String appointmentNo, int clinicID, int projectID,
DoctorList docObject) {
widget.service
@@ -448,6 +512,21 @@ class _BookConfirmState extends State {
text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
+ getLiveCareAppointmentPatientShare(context, String appointmentNo,
+ int clinicID, int projectID, DoctorList docObject) {
+ widget.service
+ .getLiveCareAppointmentPatientShare(
+ appointmentNo, clinicID, projectID, context)
+ .then((res) {
+ print(res);
+ widget.patientShareResponse = new PatientShareResponse.fromJson(res);
+ navigateToBookSuccess(context, docObject, widget.patientShareResponse);
+ }).catchError((err) {
+ print(err);
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }
+
String getTime(DateTime dateTime) {
final DateFormat formatter = DateFormat('HH:mm');
setState(() {
@@ -502,7 +581,6 @@ class _BookConfirmState extends State {
Future navigateToBookSuccess(context, DoctorList docObject,
PatientShareResponse patientShareResponse) async {
-
Navigator.push(
context,
MaterialPageRoute(
diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart
index 7a19ea28..34dbdc2f 100644
--- a/lib/pages/BookAppointment/BookSuccess.dart
+++ b/lib/pages/BookAppointment/BookSuccess.dart
@@ -39,12 +39,6 @@ class _BookSuccessState extends State {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
- @override
- void initState() {
- // TODO: implement initState
- super.initState();
- }
-
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -184,6 +178,9 @@ class _BookSuccessState extends State {
case 30:
return _getQRAppo();
break;
+ case 50:
+ return _getConfirmAppo();
+ break;
}
}
@@ -204,6 +201,9 @@ class _BookSuccessState extends State {
case 30:
return 'QR Code';
break;
+ case 50:
+ return 'Confirm LiveCare';
+ break;
}
}
@@ -286,8 +286,24 @@ class _BookSuccessState extends State {
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
- onPressed: () {},
- child: Text(TranslationBase.of(context).confirm.toUpperCase(),
+ onPressed: () {
+ AppoitmentAllHistoryResultList appo =
+ new AppoitmentAllHistoryResultList();
+ appo.clinicID = widget.docObject.clinicID;
+ appo.projectID = widget.docObject.projectID;
+ appo.appointmentNo =
+ widget.patientShareResponse.appointmentNo;
+ appo.serviceID = widget.patientShareResponse.serviceID;
+ appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
+ appo.doctorID = widget.patientShareResponse.doctorID;
+ confirmAppointment(appo);
+ },
+ child: Text(
+ widget.patientShareResponse.isLiveCareAppointment
+ ? TranslationBase.of(context)
+ .confirmLiveCare
+ .toUpperCase()
+ : TranslationBase.of(context).confirm.toUpperCase(),
style: TextStyle(fontSize: 18.0)),
),
),
@@ -321,6 +337,50 @@ class _BookSuccessState extends State {
return Container();
}
+ confirmAppointment(AppoitmentAllHistoryResultList appo) {
+ DoctorsListService service = new DoctorsListService();
+ service
+ .confirmAppointment(
+ appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context)
+ .then((res) {
+ if (res['MessageStatus'] == 1) {
+ AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
+ } else {
+ AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
+ }
+ })
+ .catchError((err) {
+ print(err);
+ })
+ .showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6))
+ .then((value) {
+ if (appo.isLiveCareAppointment) {
+ insertLiveCareVIDARequest(appo);
+ } else {
+ navigateToHome(context);
+ }
+ });
+ }
+
+ insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) {
+ DoctorsListService service = new DoctorsListService();
+ service
+ .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID,
+ appo.serviceID, appo.doctorID, context)
+ .then((res) {
+ if (res['MessageStatus'] == 1) {
+ AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
+ navigateToHome(context);
+ } else {
+ AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
+ }
+ }).catchError((err) {
+ print(err);
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }
+
Widget _getPayNowAppo() {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -543,7 +603,8 @@ class _BookSuccessState extends State {
}
}).catchError((err) {
print(err);
- }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
@@ -560,22 +621,12 @@ class _BookSuccessState extends State {
appo.appointmentNo.toString());
}).catchError((err) {
print(err);
- }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
-//
-// Future navigateToQR(
-// context, String appoQR, PatientShareResponse patientShareResponse) async {
-// Navigator.push(
-// context,
-// MaterialPageRoute(
-// builder: (context) => QRCode(
-// patientShareResponse: patientShareResponse,
-// appoQR: appoQR,
-// ))).then((value) {});
-// }
-
- addAdvancedNumberRequest(String advanceNumber, String paymentReference,
- String appointmentID) {
+
+ addAdvancedNumberRequest(
+ String advanceNumber, String paymentReference, String appointmentID) {
DoctorsListService service = new DoctorsListService();
service
.addAdvancedNumberRequest(
@@ -585,7 +636,8 @@ class _BookSuccessState extends State {
getAppoQR(context);
}).catchError((err) {
print(err);
- }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Widget _getQRAppo() {
@@ -730,7 +782,7 @@ class _BookSuccessState extends State {
}
Future navigateToHome(context) async {
- Navigator.of(context).pushNamed(HOME);
+ Navigator.of(context).popAndPushNamed(HOME);
}
getAppoQR(context) {
@@ -742,7 +794,8 @@ class _BookSuccessState extends State {
navigateToQR(context, res['AppointmentQR']);
}).catchError((err) {
print(err);
- }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Future navigateToQR(context, String appoQR) async {
diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart
index c51ce5a6..d6986f6f 100644
--- a/lib/pages/BookAppointment/DoctorProfile.dart
+++ b/lib/pages/BookAppointment/DoctorProfile.dart
@@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/routes.dart';
+import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@@ -10,7 +11,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
-import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
+
import 'BookConfirm.dart';
import 'components/DocAvailableAppointments.dart';
import 'components/DocInfo.dart';
@@ -19,9 +20,12 @@ class DoctorProfile extends StatefulWidget {
DoctorList doctor;
DoctorProfileList docProfileList;
final bool isOpenAppt;
+ bool isLiveCareAppointment;
+
DoctorProfile(
{@required this.doctor,
@required this.docProfileList,
+ @required this.isLiveCareAppointment,
this.isOpenAppt = false});
AuthenticatedUser authUser;
@@ -35,6 +39,7 @@ class _DoctorProfileState extends State
TabController _tabController;
bool showFooterButton = false;
var event = RobotProvider();
+
@override
void initState() {
_tabController = new TabController(
@@ -54,6 +59,7 @@ class _DoctorProfileState extends State
// });
_tabController = new TabController(length: 2, vsync: this);
widget.authUser = new AuthenticatedUser();
+ widget.doctor.speciality = widget.docProfileList.specialty;
getPatientData();
super.initState();
}
@@ -190,7 +196,9 @@ class _DoctorProfileState extends State
physics: NeverScrollableScrollPhysics(),
children: [
DoctorInformation(docProfileList: widget.docProfileList),
- DocAvailableAppointments(doctor: widget.doctor)
+ DocAvailableAppointments(
+ doctor: widget.doctor,
+ isLiveCareAppointment: widget.isLiveCareAppointment)
],
controller: _tabController,
),
@@ -245,6 +253,7 @@ class _DoctorProfileState extends State
MaterialPageRoute(
builder: (context) => BookConfirm(
doctor: widget.doctor,
+ isLiveCareAppointment: widget.isLiveCareAppointment,
selectedDate: DocAvailableAppointments.selectedDate,
selectedTime: DocAvailableAppointments.selectedTime)));
}
diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart
index bd4bb601..055b0c41 100644
--- a/lib/pages/BookAppointment/SearchResults.dart
+++ b/lib/pages/BookAppointment/SearchResults.dart
@@ -9,9 +9,10 @@ import 'package:flutter/material.dart';
class SearchResults extends StatefulWidget {
List doctorsList = [];
List patientDoctorAppointmentListHospital;
+ bool isLiveCareAppointment;
SearchResults(
- {@required this.doctorsList, this.patientDoctorAppointmentListHospital});
+ {@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override
_SearchResultsState createState() => _SearchResultsState();
@@ -52,6 +53,7 @@ class _SearchResultsState extends State {
.map((doctor) {
return DoctorView(
doctor: doctor,
+ isLiveCareAppointment: widget.isLiveCareAppointment,
);
}).toList(),
)),
diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
index 3c5e49ff..88116cd9 100644
--- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
+++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
@@ -2,12 +2,13 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
-import 'package:table_calendar/table_calendar.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
+import 'package:table_calendar/table_calendar.dart';
import '../../../uitl/date_uitl.dart';
@@ -17,8 +18,10 @@ class DocAvailableAppointments extends StatefulWidget {
static DateTime selectedAppoDateTime;
static String selectedDate;
static String selectedTime;
+ bool isLiveCareAppointment;
- DocAvailableAppointments({@required this.doctor});
+ DocAvailableAppointments(
+ {@required this.doctor, @required this.isLiveCareAppointment});
@override
_DocAvailableAppointmentsState createState() =>
@@ -31,6 +34,8 @@ class _DocAvailableAppointmentsState extends State
AnimationController _animationController;
CalendarController _calendarController;
+ AppSharedPreferences sharedPref = new AppSharedPreferences();
+
var selectedDate = "";
dynamic selectedDateJSON;
dynamic jsonFreeSlots;
@@ -56,8 +61,13 @@ class _DocAvailableAppointmentsState extends State
_selectedDay: ['Event A0']
};
- WidgetsBinding.instance
- .addPostFrameCallback((_) => getDoctorFreeSlots(context, widget.doctor));
+ WidgetsBinding.instance.addPostFrameCallback((_) async {
+ if (widget.isLiveCareAppointment)
+ getDoctorScheduledFreeSlots(context, widget.doctor);
+ else {
+ getDoctorFreeSlots(context, widget.doctor);
+ }
+ });
_calendarController = CalendarController();
_animationController = AnimationController(
@@ -323,8 +333,8 @@ class _DocAvailableAppointmentsState extends State
getDoctorFreeSlots(context, DoctorList docObject) {
DoctorsListService service = new DoctorsListService();
service
- .getDoctorFreeSlots(
- docObject.doctorID, docObject.clinicID, docObject.projectID, context)
+ .getDoctorFreeSlots(docObject.doctorID, docObject.clinicID,
+ docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) {
@@ -340,7 +350,32 @@ class _DocAvailableAppointmentsState extends State
}
}).catchError((err) {
print(err);
- }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }
+
+ getDoctorScheduledFreeSlots(context, DoctorList docObject) {
+ DoctorsListService service = new DoctorsListService();
+ service
+ .getDoctorScheduledFreeSlots(docObject.doctorID, docObject.clinicID,
+ docObject.projectID, docObject.serviceID, context)
+ .then((res) {
+ if (res['MessageStatus'] == 1) {
+ if (res['PatientER_DoctorFreeSlots'].length != 0) {
+ freeSlotsResponse = res['PatientER_DoctorFreeSlots'];
+ print("res['PatientER_DoctorFreeSlots']");
+ print(res['PatientER_DoctorFreeSlots'].length);
+ _getJSONSlots().then((value) => {
+ setState(() => {_events.clear(), _events = value})
+ });
+ } else {}
+ } else {
+ AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
+ }
+ }).catchError((err) {
+ print(err);
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
Widget _buildEventsMarker(DateTime date, List events) {
@@ -350,8 +385,8 @@ class _DocAvailableAppointmentsState extends State
color: _calendarController.isSelected(date)
? Colors.green[400]
: _calendarController.isToday(date)
- ? Colors.brown[300]
- : Colors.blue[400],
+ ? Colors.brown[300]
+ : Colors.blue[400],
),
width: 40.0,
height: 40.0,
diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart
index 1e7deb38..80288085 100644
--- a/lib/pages/BookAppointment/components/SearchByDoctor.dart
+++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart
@@ -162,6 +162,7 @@ class _SearchByDoctorState extends State {
context,
MaterialPageRoute(
builder: (context) => SearchResults(
+ isLiveCareAppointment: false,
doctorsList: docList,
patientDoctorAppointmentListHospital:
patientDoctorAppointmentListHospital)));
diff --git a/lib/pages/BookAppointment/widgets/BranchView.dart b/lib/pages/BookAppointment/widgets/BranchView.dart
index 58ccbd1a..4ba5a9d3 100644
--- a/lib/pages/BookAppointment/widgets/BranchView.dart
+++ b/lib/pages/BookAppointment/widgets/BranchView.dart
@@ -148,8 +148,8 @@ class _ExpandableListViewState extends State {
widget.doctorsList2[index].projectName.toString()
? DoctorView(
//AJ note
- doctor: widget.doctorsList2[index]
-
+ doctor: widget.doctorsList2[index],
+ isLiveCareAppointment: false,
// widget.doctorsList2[index]
)
: Container();
diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart
index cad9da25..40c0e2fc 100644
--- a/lib/pages/BookAppointment/widgets/DoctorView.dart
+++ b/lib/pages/BookAppointment/widgets/DoctorView.dart
@@ -11,10 +11,11 @@ import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget {
final DoctorList doctor;
+ bool isLiveCareAppointment;
- DoctorView({@required this.doctor});
+ DoctorView({@required this.doctor, @required this.isLiveCareAppointment});
@override
Widget build(BuildContext context) {
@@ -186,6 +187,7 @@ class DoctorView extends StatelessWidget {
MaterialPageRoute(
builder: (context) => DoctorProfile(
doctor: docObject,
+ isLiveCareAppointment: isLiveCareAppointment,
docProfileList: docProfile,
isOpenAppt: isAppo,
)));
diff --git a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart
index 4b797e8c..5bffe17c 100644
--- a/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart
+++ b/lib/pages/ContactUs/LiveChat/hospitalsLivechat_page.dart
@@ -138,7 +138,7 @@ class _HospitalsLiveChatPageState extends State {
))), //model.cOCItemList[index].cOCTitl
IconButton(
icon: Icon(
- Icons.arrow_forward,
+ Icons.arrow_forward_ios,
color:
tappedIndex == index
? Colors.white
diff --git a/lib/pages/ContactUs/hmg_service.dart b/lib/pages/ContactUs/contact_us_page.dart
similarity index 93%
rename from lib/pages/ContactUs/hmg_service.dart
rename to lib/pages/ContactUs/contact_us_page.dart
index 4f19e8f8..7d2192f9 100644
--- a/lib/pages/ContactUs/hmg_service.dart
+++ b/lib/pages/ContactUs/contact_us_page.dart
@@ -6,12 +6,12 @@ import 'package:flutter/material.dart';
import '../../uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart';
-class HmgServicePage extends StatefulWidget {
+class ContactUsPage extends StatefulWidget {
@override
- _HmgServicePageState createState() => _HmgServicePageState();
+ _ContactUsPageState createState() => _ContactUsPageState();
}
-class _HmgServicePageState extends State {
+class _ContactUsPageState extends State {
LocationUtils locationUtils;
@@ -29,6 +29,7 @@ class _HmgServicePageState extends State {
return AppScaffold(
isShowAppBar: true,//widget.isAppbar,
appBarTitle: "HMG Services",//TranslationBase.of(context).bookAppo,
+ isShowDecPage: false,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
child: Column(
diff --git a/lib/pages/ContactUs/findus/hospitrals_page.dart b/lib/pages/ContactUs/findus/hospitrals_page.dart
index b883ae41..d8d898e3 100644
--- a/lib/pages/ContactUs/findus/hospitrals_page.dart
+++ b/lib/pages/ContactUs/findus/hospitrals_page.dart
@@ -115,7 +115,7 @@ class _HospitalsPageState extends State {
CrossAxisAlignment.center,
children: [
IconButton(
- // icon: Icon(Icons.person_pin_circle_outlined,color: Colors.red,),
+ // icon: Icon(Icons.location_on,color: Colors.red,),
icon: new Image.asset(
'assets/images/new-design/navigate.png'),
tooltip: '',
diff --git a/lib/pages/ContactUs/findus/pharmacies_page.dart b/lib/pages/ContactUs/findus/pharmacies_page.dart
index 5dc44019..663bd3ec 100644
--- a/lib/pages/ContactUs/findus/pharmacies_page.dart
+++ b/lib/pages/ContactUs/findus/pharmacies_page.dart
@@ -141,7 +141,7 @@ class _PharmaciesPageState extends State {
IconButton(
// icon: Icon(
// Icons
- // .person_pin_circle_outlined,
+ // .location_on,
// color: Colors.red,
// ),
icon: new Image.asset(
diff --git a/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart
new file mode 100644
index 00000000..060a8132
--- /dev/null
+++ b/lib/pages/Covid-DriveThru/Covid-TimeSlots.dart
@@ -0,0 +1,599 @@
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
+import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
+import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
+import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
+import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-payment-alert.dart';
+import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
+import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/uitl/app_toast.dart';
+import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_svg/flutter_svg.dart';
+import 'package:intl/intl.dart';
+import 'package:smart_progress_bar/smart_progress_bar.dart';
+import 'package:table_calendar/table_calendar.dart';
+
+class CovidTimeSlots extends StatefulWidget {
+ int projectID;
+ static bool areSlotsAvailable = false;
+ static DateTime selectedAppoDateTime;
+ static String selectedDate;
+ static String selectedTime;
+
+ int selectedClinicID;
+ int selectedDoctorID;
+
+ PatientShareResponse patientShareResponse;
+
+ CovidTimeSlots({@required this.projectID});
+
+ @override
+ _CovidTimeSlotsState createState() => _CovidTimeSlotsState();
+}
+
+class _CovidTimeSlotsState extends State
+ with TickerProviderStateMixin {
+ Map _events;
+ AnimationController _animationController;
+ CalendarController _calendarController;
+
+ AppSharedPreferences sharedPref = new AppSharedPreferences();
+
+ var selectedDate = "";
+ dynamic selectedDateJSON;
+ dynamic jsonFreeSlots;
+
+ List docFreeSlots = [];
+ List dayEvents = [];
+
+ int selectedButtonIndex = 0;
+
+ dynamic freeSlotsResponse;
+
+ ScrollController _scrollController;
+
+ @override
+ void initState() {
+ final _selectedDay = DateTime.now();
+
+ widget.patientShareResponse = new PatientShareResponse();
+
+ _scrollController = new ScrollController();
+
+ _events = {
+ _selectedDay: ['Event A0']
+ };
+
+ WidgetsBinding.instance.addPostFrameCallback(
+ (_) => getCovidFreeSlots(context, widget.projectID));
+
+ _calendarController = CalendarController();
+ _animationController = AnimationController(
+ vsync: this,
+ duration: const Duration(milliseconds: 50),
+ );
+
+ _animationController.forward();
+ super.initState();
+ }
+
+ @override
+ void dispose() {
+ _animationController.dispose();
+ _calendarController.dispose();
+ super.dispose();
+ }
+
+ void _onDaySelected(DateTime day, List events) {
+ final DateFormat formatter = DateFormat('yyyy-MM-dd');
+ setState(() {
+ this.selectedDate = DateUtil.getMonthDayYearDateFormatted(day);
+ openTimeSlotsPickerForDate(day, docFreeSlots);
+ CovidTimeSlots.selectedDate = formatter.format(day);
+ print(CovidTimeSlots.selectedDate);
+ });
+ }
+
+ void _onVisibleDaysChanged(
+ DateTime first, DateTime last, CalendarFormat format) {
+ print('CALLBACK: _onVisibleDaysChanged');
+ }
+
+ void _onCalendarCreated(
+ DateTime first, DateTime last, CalendarFormat format) {
+ print('CALLBACK: _onCalendarCreated');
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return AppScaffold(
+ appBarTitle: "COVID-19 TEST",
+ isShowAppBar: true,
+ body: SingleChildScrollView(
+ child: Container(
+ margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ height: 150.0,
+ decoration: BoxDecoration(
+ image: DecorationImage(
+ image: AssetImage(
+ "assets/images/new-design/covid-19-big-banner-bg.png"),
+ fit: BoxFit.fill,
+ ),
+ color: Colors.white.withOpacity(0.3),
+ borderRadius: BorderRadius.all(Radius.circular(10))),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ margin:
+ EdgeInsets.only(left: 15.0, right: 15.0, top: 30.0),
+ child: SvgPicture.asset(
+ 'assets/images/new-design/covid-19-car.svg',
+ width: 90.0,
+ height: 90.0),
+ ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ margin: EdgeInsets.only(
+ left: 20.0, right: 20.0, top: 40.0),
+ child: Text("COVID-19 TEST",
+ style: TextStyle(
+ color: Colors.white,
+ fontWeight: FontWeight.bold,
+ fontSize: 24.0)),
+ ),
+ Container(
+ margin: EdgeInsets.only(
+ left: 20.0, right: 20.0, top: 10.0),
+ child: Text("Drive-Thru",
+ style: TextStyle(
+ color: Colors.white, fontSize: 24.0)),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ Container(
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10.0),
+ color: Colors.white),
+ margin: EdgeInsets.fromLTRB(0.0, 20.0, 0.0, 5.0),
+ padding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 20.0),
+ width: MediaQuery.of(context).size.width,
+ height: MediaQuery.of(context).size.height * 0.65,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ margin: EdgeInsets.all(10.0),
+ child: Text(
+ "Kindly select one of the available appointments from below: ",
+ style:
+ TextStyle(color: Colors.black, fontSize: 16.0)),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 10.0),
+ alignment: Alignment.center,
+ child: Text(selectedDate,
+ style: TextStyle(
+ fontSize: 18.0, fontWeight: FontWeight.bold)),
+ ),
+ Container(
+ height: 50,
+ margin: EdgeInsets.all(20.0),
+ child: ListView.builder(
+ controller: _scrollController,
+ scrollDirection: Axis.horizontal,
+ itemCount: dayEvents.length,
+ itemBuilder: (context, index) {
+ return Container(
+ margin: EdgeInsets.only(right: 10.0),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(5.0),
+ side: BorderSide(
+ color: Colors.blue[400],
+ //Color of the border
+ style: BorderStyle.solid,
+ //Style of the border
+ width: 1.5, //width of the border
+ ),
+ ),
+ minWidth:
+ MediaQuery.of(context).size.width * 0.2,
+ child: index == selectedButtonIndex
+ ? getSelectedButton(index)
+ : getNormalButton(index)),
+ );
+ },
+ ),
+ ),
+ _buildTableCalendarWithBuilders(),
+ ],
+ ),
+ ),
+ SizedBox(
+ height: 100.0,
+ ),
+ ],
+ ),
+ ),
+ ),
+ bottomSheet: Container(
+ margin: EdgeInsets.all(10.0),
+ child: Flex(
+ direction: Axis.horizontal,
+ children: [
+ Expanded(
+ flex: 1,
+ child: Container(
+ margin: EdgeInsets.fromLTRB(10.0, 0.0, 5.0, 0.0),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.7,
+ height: 45.0,
+ child: RaisedButton(
+ color: new Color(0xFF60686b),
+ textColor: Colors.white,
+ disabledTextColor: Colors.white,
+ disabledColor: Colors.grey[500],
+ onPressed: () {
+ bookCovidTestAppointment();
+ },
+ child: Text("BOOK", style: TextStyle(fontSize: 18.0)),
+ ),
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget _buildTableCalendarWithBuilders() {
+ return TableCalendar(
+ locale: 'en_US',
+ calendarController: _calendarController,
+ events: _events,
+ initialCalendarFormat: CalendarFormat.month,
+ startDay: DateTime.now(),
+ formatAnimation: FormatAnimation.slide,
+ startingDayOfWeek: StartingDayOfWeek.sunday,
+ weekendDays: [DateTime.friday, DateTime.saturday],
+ availableGestures: AvailableGestures.horizontalSwipe,
+ availableCalendarFormats: const {
+ CalendarFormat.month: '',
+ CalendarFormat.week: '',
+ },
+ calendarStyle: CalendarStyle(
+ outsideDaysVisible: false,
+ weekendStyle: TextStyle().copyWith(color: Colors.blue[800]),
+ holidayStyle: TextStyle().copyWith(color: Colors.blue[800]),
+ ),
+ daysOfWeekStyle: DaysOfWeekStyle(
+ weekendStyle: TextStyle().copyWith(color: Colors.blue[600]),
+ ),
+ headerStyle: HeaderStyle(
+ centerHeaderTitle: true,
+ formatButtonVisible: false,
+ ),
+ builders: CalendarBuilders(
+ selectedDayBuilder: (context, date, _) {
+ return FadeTransition(
+ opacity: Tween(begin: 0.0, end: 1.0).animate(_animationController),
+ child: Container(
+ margin: const EdgeInsets.all(4.0),
+ padding: const EdgeInsets.only(top: 5.0, left: 6.0),
+ color: Colors.transparent,
+ width: 0,
+ height: 0,
+ child: Text(
+ '${date.day}',
+ style: TextStyle().copyWith(fontSize: 16.0),
+ ),
+ ),
+ );
+ },
+ todayDayBuilder: (context, date, _) {
+ return Container(
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: _calendarController.isSelected(date)
+ ? Colors.green[400]
+ : _calendarController.isToday(date)
+ ? Colors.brown[300]
+ : Colors.blue[400],
+ ),
+ width: 40.0,
+ height: 40.0,
+ child: Center(
+ child: Text(
+ '${date.day}',
+ style: TextStyle().copyWith(
+ color: Colors.white,
+ fontSize: 14.0,
+ ),
+ ),
+ ),
+ );
+ },
+ markersBuilder: (context, date, events, holidays) {
+ final children = [];
+
+ if (events.isNotEmpty) {
+ children.add(
+ Positioned(
+ right: 4,
+ bottom: 4,
+ child: _buildEventsMarker(date, events),
+ ),
+ );
+ }
+
+ return children;
+ },
+ ),
+ onDaySelected: (date, events) {
+ _onDaySelected(date, events);
+ _animationController.forward(from: 0.0);
+ },
+ onVisibleDaysChanged: _onVisibleDaysChanged,
+ onCalendarCreated: _onCalendarCreated,
+ );
+ }
+
+ openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) {
+ dayEvents.clear();
+ DateTime dateStartObj = new DateTime(
+ dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
+
+ freeSlots.forEach((v) {
+ if (v.start == dateStartObj) dayEvents.add(v);
+ });
+
+ setState(() {
+ if (dayEvents.length != 0)
+ CovidTimeSlots.areSlotsAvailable = true;
+ else
+ CovidTimeSlots.areSlotsAvailable = false;
+
+ selectedButtonIndex = 0;
+
+ CovidTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime;
+ });
+ }
+
+ Future