diff --git a/android/app/build.gradle b/android/app/build.gradle
index c6a8d0e3..a75b8ca5 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -35,8 +35,24 @@ apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
+configurations.all {
+ c ->
+ c.resolutionStrategy.eachDependency {
+ DependencyResolveDetails dependency ->
+ println dependency.requested.group
+ if (dependency.requested.group == 'org.bouncycastle') {
+ dependency.useTarget 'org.bouncycastle:bcprov-jdk15to18:1.68'
+ }
+ }
+}
+
+//configurations.all {
+// resolutionStrategy {
+// force 'androidx.core:core-ktx:1.6.0'
+// }
+//}
+
android {
- namespace = "com.ejada.hmg"
compileSdkVersion 34
// ndkVersion "24.0.8215888"
@@ -44,26 +60,10 @@ android {
viewBinding true
}
- compileOptions {
- coreLibraryDesugaringEnabled true
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
-
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
- kotlin {
- jvmToolchain(17)
- }
-
-
- buildFeatures {
- buildConfig = true
- }
-
lintOptions {
disable 'MissingTranslation'
checkReleaseBuilds false
@@ -71,9 +71,10 @@ android {
defaultConfig {
+ // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.ejada.hmg"
minSdkVersion 26
- targetSdkVersion 33
+ targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
@@ -127,6 +128,12 @@ android {
pickFirst '**/*.so'
}
+
+ compileOptions {
+// coreLibraryDesugaringEnabled true
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
}
flutter {
@@ -192,7 +199,6 @@ dependencies {
implementation files('libs/Penguin.aar')
implementation files('libs/PenguinRenderer.aar')
-// implementation "org.jetbrains.anko:anko-commons:$anko_version"
// implementation "org.jetbrains.anko:anko-commons:0.10.4"
implementation 'com.github.kittinunf.fuel:fuel:2.3.0' //for JVM
implementation 'com.github.kittinunf.fuel:fuel-android:2.3.0'
@@ -206,6 +212,4 @@ dependencies {
implementation 'com.google.android.material:material:1.9.0'
androidTestImplementation "androidx.test:core:1.4.0"
- coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
-
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index ed8b5ca3..abdab7be 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -34,9 +34,8 @@
-
-
-
+
+
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 605e449d..53b28a48 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -31,7 +31,7 @@ var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://webservices.hmg.com/';
-// var BASE_URL = 'http://10.50.100.198:4422/';
+ // var BASE_URL = 'http://10.200.204.42/';
// Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@@ -215,6 +215,7 @@ var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
//URL to get clinic list
var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
+var GET_CLINICS_LIST_WRT_HOSPITAL_URL = "Services/Lists.svc/REST/GetClinicFromDoctorSchedule";
//URL to get active appointment list
var GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
@@ -353,7 +354,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
-var VERSION_ID = 16.4;
+var VERSION_ID = 16.7;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;
@@ -610,9 +611,9 @@ var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceFor
var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental";
-var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamara/Home/GetInstallments';
+var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamaralive/Home/GetInstallments';
-var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamara/api/OnlineTamara/order_status?orderid=';
+var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid=';
var UPDATE_TAMARA_STATUS = 'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus';
@@ -679,10 +680,10 @@ var INSERT_WALKIN_APPOINTMENT = "Services/Doctors.svc/REST/InsertWalkinAppointme
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
-var payFortEnvironment = FortEnvironment.production;
-var applePayMerchantId = "merchant.com.hmgwebservices";
-// var payFortEnvironment = FortEnvironment.test;
-// var applePayMerchantId = "merchant.com.hmgwebservices.uat";
+// var payFortEnvironment = FortEnvironment.production;
+// var applePayMerchantId = "merchant.com.hmgwebservices";
+var payFortEnvironment = FortEnvironment.test;
+var applePayMerchantId = "merchant.com.hmgwebservices.uat";
class AppGlobal {
static var context;
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 2765fd51..546c2aeb 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -45,6 +45,8 @@ const Map localizedValues = {
'name': {'en': 'Name', 'ar': 'الإسم'},
'doctor': {'en': 'Doctor', 'ar': 'الطبيب'},
'clinicName': {'en': 'Clinic Name', 'ar': 'اسم العيادة'},
+ 'hospitalName': {'en': 'Hospital Name', 'ar': 'اسم المستشفى'},
+ 'NoClinicFound': {'en': 'No Clinic Found', 'ar': 'لم يتم العثور على عيادة'},
'doctorName': {'en': 'Doctor Name', 'ar': 'إسم الطبيب'},
'nearestAppo': {'en': 'Nearest Appointment', 'ar': 'أقرب موعد'},
'searchByDocText': {'en': 'Type the name of the doctor to help you find him', 'ar': 'اكتب اسم الطبيب لمساعدتك في العثور عليه'},
@@ -1870,8 +1872,14 @@ const Map localizedValues = {
"insuranceClassName": {"en": "Insurance Class", "ar": "فئة التأمين"},
"insuranceRequestSubmit": {"en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح."},
"NFCNotSupported": {"en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول"},
- "enter-workplace-name": {"en": "Please enter your workplace name:", "ar": "رجاء إدخال مكان العمل:"},
- "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"},
+ "enter-workplace-name": {"en": "Please enter your workplace details:", "ar": "الرجاء إدخال تفاصيل مكان عملك:"},
+
+ // "workplaceName": {"en": "Workplace name:", "ar": "مكان العمل:"},
+ "workplaceName": {"en": "Workplace name English", "ar": "مكان العمل انجليزي:"},
+ "workplaceNameAr": {"en": "Workplace name Arabic *", "ar": "مكان العمل عربي:"},
+ "occupationNameEn": {"en": "Occupation name English", "ar": "مكان العمل انجليزي:"},
+ "occupationNameAr": {"en": "Occupation name Arabic *", "ar": "مكان العمل عربي:"},
+
"callLiveCareSupport": {"en": "Call LiveCare Support", "ar": "اتصل بدعم اللايف كير"},
"needApproval": {
"en": "Your sick leave is under process in medical administration, you will be notified once approved.",
@@ -1943,8 +1951,15 @@ const Map localizedValues = {
"generalInstructions": {"en": "General Instructions:", "ar": "تعليمات عامة:"},
"copyLink": {"en": "COPY LINK", "ar": "نسخ الوصلة:"},
"paymentLinkCopied": {"en": "Payment link copied to your clipboard!'", "ar": "تم نسخ رابط الدفع إلى الحافظة الخاصة بك!"},
- "copyLinkTxt": {"en": "Or you can copy the payment link from below & send it to someone who can pay on your behalf: ", "ar": "أو يمكنك نسخ رابط الدفع من الأسفل وإرساله إلى شخص يمكنه الدفع نيابة عنك:"},
- "proErrorMessage": {"en": "Dear patient, Our staff is currently out of office, please note that our working hours are from 7:00 AM to 10:00 PM, and we'd love to help you during that time, or you can call ", "ar": "عزيزي المريض ، طاقم العمل لدينا خارج المكتب حاليًا ، يرجى ملاحظة أن ساعات العمل لدينا من 7:00 صباحًا إلى 10:00 مساءً ، ويسعدنا مساعدتك خلال هذا الوقت ، أو يمكنك الاتصال بـ <أدخل الرقم هنا>"},
+ "copyLinkTxt": {
+ "en": "Or you can copy the payment link from below & send it to someone who can pay on your behalf: ",
+ "ar": "أو يمكنك نسخ رابط الدفع من الأسفل وإرساله إلى شخص يمكنه الدفع نيابة عنك:"
+ },
+ "proErrorMessage": {
+ "en":
+ "Dear patient, Our staff is currently out of office, please note that our working hours are from 7:00 AM to 10:00 PM, and we'd love to help you during that time, or you can call ",
+ "ar": "عزيزي المريض ، طاقم العمل لدينا خارج المكتب حاليًا ، يرجى ملاحظة أن ساعات العمل لدينا من 7:00 صباحًا إلى 10:00 مساءً ، ويسعدنا مساعدتك خلال هذا الوقت ، أو يمكنك الاتصال بـ <أدخل الرقم هنا>"
+ },
"admissionNo": {"en": "Admission No", "ar": "رقم القبول:"},
"admissionReqNo": {"en": "Admission Request No", "ar": "رقم طلب القبول:"},
"dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"},
@@ -1965,10 +1980,7 @@ const Map localizedValues = {
"validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"},
"contactRRT": {"en": "Contact RRT", "ar": "تواصل مع فريق الاستجابة السريعة"},
"checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"},
- "locationCheckInError": {
- "en": "Please make sure that you're within the hospital location to perform online check-in.",
- "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."
- },
+ "locationCheckInError": {"en": "Please ensure you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."},
"upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"},
"noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"},
"locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "ar": "غير قادر على جلب موقعك، يرجى المحاولة مرة أخرى."},
@@ -1976,21 +1988,29 @@ const Map localizedValues = {
"selectHospitalBloodDonation": {"en": "Please select the hospital you want to book an appointment with: ", "ar": "يرجى اختيار المستشفى الذي تريد حجز موعد معه:"},
"wecare": {"en": "We Care", "ar": "نحن نهتم"},
"myinstructions": {"en": "My Instructions", "ar": "تعليماتي"},
- "existingPackage":{"en":"This patient has a package under this clinic,","ar":"هذا المريض لديه حزمة تحت هذه العيادة،"},
- "continueOrbookNew":{"en":"do you want to continue with that package? or book new appointment?","ar":"هل تريد الاستمرار في هذه الباقة؟ أو حجز موعد جديد؟"},
- "newAppointment":{"en":"New Appointment","ar":"موعد جديد"},
- "proceedPackage":{"en":"Proceed with package","ar":"المضي قدما في الحزمة"},
+ "existingPackage": {"en": "This patient has a package under this clinic,", "ar": "هذا المريض لديه حزمة تحت هذه العيادة،"},
+ "continueOrbookNew": {"en": "do you want to continue with that package? or book new appointment?", "ar": "هل تريد الاستمرار في هذه الباقة؟ أو حجز موعد جديد؟"},
+ "newAppointment": {"en": "New Appointment", "ar": "موعد جديد"},
+ "proceedPackage": {"en": "Proceed with package", "ar": "المضي قدما في الحزمة"},
"clinicLocation": {"en": "Clinic Location", "ar": "موقع العيادة"},
"waitingAppointment": {"en": "Waiting appointment", "ar": "انتظار الموعد"},
"whatWaitingAppointment": {"en": "What is Waiting appointment?", "ar": "ما هو انتظار الموعد؟"},
- "waitingAppointmentText1": {"en": "The waiting appointments feature allows you to book an appointment while you are inside the hospital building, and in case there is no available slot in the doctor’s schedule.", "ar": "تتيح لك خاصية انتظار المواعيد حجز موعد أثناء تواجدك داخل مبنى المستشفى، وفي حالة عدم وجود وقت متاح في جدول الطبيب."},
+ "waitingAppointmentText1": {
+ "en": "The waiting appointments feature allows you to book an appointment while you are inside the hospital building, and in case there is no available slot in the doctor’s schedule.",
+ "ar": "تتيح لك خاصية انتظار المواعيد حجز موعد أثناء تواجدك داخل مبنى المستشفى، وفي حالة عدم وجود وقت متاح في جدول الطبيب."
+ },
"waitingAppointmentText2": {"en": "The appointment with the doctor is confirmed, but the time of entry is uncertain", "ar": "دخول الموعد مؤكد, التوقيت غير محدد."},
- "waitingAppointmentText3": {"en": "Note: You must have to pay within 10 minutes of booking, otherwise your appointment will be cancelled automatically", "ar": "ملحوظة: يجب عليك الدفع خلال 10 دقائق من الحجز، وإلا سيتم إلغاء موعدك تلقائيًا"},
+ "waitingAppointmentText3": {
+ "en": "Note: You must have to pay within 10 minutes of booking, otherwise your appointment will be cancelled automatically",
+ "ar": "ملحوظة: يجب عليك الدفع خلال 10 دقائق من الحجز، وإلا سيتم إلغاء موعدك تلقائيًا"
+ },
"waitingAppointmentVerificationMethod": {"en": "Please select verification method", "ar": "الرجاء تحديد طريقة التحقق"},
"howToUseVerificationMethod": {"en": "How to use verification methods?", "ar": "كيفية استخدام طرق التحقق؟"},
"addToWaitingList": {"en": "Add to waiting list", "ar": "اضافه الى قائمة الانتظار"},
"searchClinic": {"en": "Search Clinic", "ar": "بحث العيادة"},
- "selectBranch":{"en":"Select Branch", "ar":"اختر الفرع"},
- "searchByBranch":{"en":"Search By Branch Name", "ar":"البحث عن طريق اسم الفرع"}
+ "selectBranch": {"en": "Select Branch", "ar": "اختر الفرع"},
+ "searchByBranch": {"en": "Search By Branch Name", "ar": "البحث عن طريق اسم الفرع"},
+ "hospitalNavigationTitle": {"en": "Hospital", "ar": "الملاحة"},
+ "hospitalNavigationSubtitle": {"en": "Navigation", "ar": "المستشفى"},
};
diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart
index 77ea728e..8ca246a0 100644
--- a/lib/core/service/medical/labs_service.dart
+++ b/lib/core/service/medical/labs_service.dart
@@ -124,12 +124,15 @@ class LabsService extends BaseService {
return Future.value(localRes);
}
- Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async {
+ Future updateWorkplaceName(String workplaceName, String workplaceNameAR, String occupation, String occupationAR, int requestNumber, String setupID, int projectID) async {
+ // Future updateWorkplaceName(String workplaceName, String workplaceNameAR, int requestNumber, String setupID, int projectID) async {
hasError = false;
Map body = Map();
body['Placeofwork'] = workplaceName;
- body['Placeofworkar'] = workplaceNameAR;
+ body['PlaceofworkAr'] = workplaceNameAR;
+ body['Occupation'] = occupation;
+ body['OccupationAr'] = occupationAR;
body['Req_ID'] = requestNumber;
body['TargetSetupID'] = setupID;
body['ProjectID'] = projectID;
diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart
index a77729c9..445f5ab6 100644
--- a/lib/core/service/medical/medical_service.dart
+++ b/lib/core/service/medical/medical_service.dart
@@ -72,11 +72,15 @@ class MedicalService extends BaseService {
dynamic localRes;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async {
localRes = response;
+ freeSlots.clear();
+ localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item));
}, onFailure: (String error, int statusCode) {
- throw error;
+ hasError = true;
+ super.error = error;
+ // throw error;
}, body: request);
- freeSlots.clear();
- localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item));
+ // freeSlots.clear();
+ // localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item));
// localRes['List_DoctorWorkingHoursTable'].forEach((item) =>
// {doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))});
}
diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart
index 205909c9..93cb81e5 100644
--- a/lib/models/Appointments/DoctorListResponse.dart
+++ b/lib/models/Appointments/DoctorListResponse.dart
@@ -44,6 +44,8 @@ class DoctorList {
List? specialityN;
dynamic workingHours;
dynamic decimalDoctorRate;
+ String? projectBottomName;
+ String? projectTopName;
DoctorList(
{this.clinicID,
@@ -90,7 +92,9 @@ class DoctorList {
this.speciality,
this.specialityN,
this.workingHours,
- this.decimalDoctorRate});
+ this.decimalDoctorRate,
+ this.projectBottomName,
+ this.projectTopName});
DoctorList.fromJson(Map json) {
clinicID = json['ClinicID'];
@@ -138,6 +142,8 @@ class DoctorList {
if (json.containsKey('SpecialityN') && json['SpecialityN'] != null) specialityN = json['SpecialityN'].cast();
workingHours = json['WorkingHours'];
decimalDoctorRate = json['DecimalDoctorRate'];
+ projectBottomName = json['ProjectNameBottom'];
+ projectTopName = json['ProjectNameTop'];
}
Map toJson() {
@@ -188,6 +194,10 @@ class DoctorList {
data['DecimalDoctorRate'] = this.decimalDoctorRate;
return data;
}
+
+ String getProjectCompleteName(){
+ return "${this.projectTopName} ${this.projectBottomName}";
+ }
}
class PatientDoctorAppointmentList {
diff --git a/lib/models/Appointments/PatientPackageComponent.dart b/lib/models/Appointments/PatientPackageComponent.dart
index 31163cc7..26ce9229 100644
--- a/lib/models/Appointments/PatientPackageComponent.dart
+++ b/lib/models/Appointments/PatientPackageComponent.dart
@@ -15,8 +15,7 @@ class PatientPackageComponent {
Map toJson() {
final Map data = new Map();
if (this.patientPackageComponents != null) {
- data['PatientPackageComponents'] =
- this.patientPackageComponents!.map((v) => v.toJson()).toList();
+ data['PatientPackageComponents'] = this.patientPackageComponents!.map((v) => v.toJson()).toList();
}
return data;
}
@@ -30,15 +29,9 @@ class PatientPackageComponents {
int? projectID;
int? sequence;
String? setupID;
+ num? invoiceNo_VP;
- PatientPackageComponents(
- {this.invoiceNo,
- this.lineItemNo,
- this.procedureID,
- this.procedureName,
- this.projectID,
- this.sequence,
- this.setupID});
+ PatientPackageComponents({this.invoiceNo, this.lineItemNo, this.procedureID, this.procedureName, this.projectID, this.sequence, this.setupID, this.invoiceNo_VP});
PatientPackageComponents.fromJson(Map json) {
invoiceNo = json['InvoiceNo'];
@@ -48,6 +41,7 @@ class PatientPackageComponents {
projectID = json['ProjectID'];
sequence = json['Sequence'];
setupID = json['SetupID'];
+ invoiceNo_VP = json['InvoiceNo_VP'];
}
Map toJson() {
@@ -59,6 +53,7 @@ class PatientPackageComponents {
data['ProjectID'] = this.projectID;
data['Sequence'] = this.sequence;
data['SetupID'] = this.setupID;
+ data['InvoiceNo_VP'] = this.invoiceNo_VP;
return data;
}
}
diff --git a/lib/models/SmartWatch/WeeklyHeartRateResModel.dart b/lib/models/SmartWatch/WeeklyHeartRateResModel.dart
index 1c21c22d..26341ee0 100644
--- a/lib/models/SmartWatch/WeeklyHeartRateResModel.dart
+++ b/lib/models/SmartWatch/WeeklyHeartRateResModel.dart
@@ -8,7 +8,7 @@ class WeeklyHeartRateResModel {
{this.valueAvg, this.machineDate, this.medCategoryID, this.patientID});
WeeklyHeartRateResModel.fromJson(Map json) {
- num value = json['ValueAvg'];
+ num value = json['ValueAvg'] != null ? json['ValueAvg'] : 0.0;
valueAvg = json['ValueAvg'] != null ? value.toInt() : 0;
machineDate = json['MachineDate'];
medCategoryID = json['MedCategoryID'];
diff --git a/lib/models/SmartWatch/YearlyHeartRateResModel.dart b/lib/models/SmartWatch/YearlyHeartRateResModel.dart
index 331d5adb..3d81ff2c 100644
--- a/lib/models/SmartWatch/YearlyHeartRateResModel.dart
+++ b/lib/models/SmartWatch/YearlyHeartRateResModel.dart
@@ -15,7 +15,7 @@ class YearlyHeartRateResModel {
this.year});
YearlyHeartRateResModel.fromJson(Map json) {
- num value = json['ValueAvg'];
+ num value = json['ValueAvg'] != null ? json['ValueAvg'] : 0.0;
valueAvg = json['ValueAvg'] != null ? value.toInt() : 0;
medCategoryID = json['MedCategoryID'];
month = json['Month'];
diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart
index dcda064c..65dfa1b1 100644
--- a/lib/pages/BookAppointment/BookConfirm.dart
+++ b/lib/pages/BookAppointment/BookConfirm.dart
@@ -680,7 +680,7 @@ class _BookConfirmState extends State {
);
}
- cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context, {int? invoiceNumber, int? lineItemNo}) async {
+ cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context, {int? invoiceNumber, int? lineItemNo, String? invoiceNoVP}) async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
DoctorsListService service = new DoctorsListService();
@@ -692,7 +692,7 @@ class _BookConfirmState extends State {
if (isLiveCareSchedule != null && isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
- insertAppointment(context, widget.doctor, widget.initialSlotDuration);
+ insertAppointment(context, widget.doctor, widget.initialSlotDuration, invoiceNumber: invoiceNumber, lineItemNo: lineItemNo, invoiceNoVP: invoiceNoVP);
}
});
} else {
@@ -736,7 +736,7 @@ class _BookConfirmState extends State {
widget.service.convertPatientToCash(docObject.projectID!).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
- if(isLiveCareAppointment) {
+ if (isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, appointmentNo, docObject!.clinicID!, docObject.projectID!, docObject);
} else {
getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject);
@@ -881,7 +881,9 @@ class _BookConfirmState extends State {
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
insertAppointment(context, widget.doctor, widget.initialSlotDuration,
- invoiceNumber: package.patientPackageComponents![0].invoiceNo, lineItemNo: package.patientPackageComponents![0].lineItemNo)
+ invoiceNumber: package.patientPackageComponents![0].invoiceNo,
+ lineItemNo: package.patientPackageComponents![0].lineItemNo,
+ invoiceNoVP: package.patientPackageComponents![0].invoiceNo_VP.toString())
},
cancelFunction: () => {insertAppointment(context, widget.doctor, widget.initialSlotDuration)},
);
@@ -894,7 +896,7 @@ class _BookConfirmState extends State {
});
}
- insertAppointment(context, DoctorList docObject, int initialSlotDuration, {int? invoiceNumber, int? lineItemNo}) async {
+ insertAppointment(context, DoctorList docObject, int initialSlotDuration, {int? invoiceNumber, int? lineItemNo, String? invoiceNoVP}) async {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
String logs = await sharedPref.getString('selectedLogSlots');
List decodedLogs = json.decode(logs);
@@ -903,7 +905,7 @@ class _BookConfirmState extends State {
widget.service
// .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel)
.insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context,
- null, null, null, projectViewModel, invoiceNumber, lineItemNo)
+ null, null, null, projectViewModel, invoiceNumber, lineItemNo, invoiceNoVP)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart
index b5680c1c..c7989cbf 100644
--- a/lib/pages/BookAppointment/Search.dart
+++ b/lib/pages/BookAppointment/Search.dart
@@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
+import 'package:diplomaticquarterapp/pages/BookAppointment/components/search_by_hospital_name.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@@ -28,15 +29,20 @@ class _SearchState extends State with TickerProviderStateMixin {
@override
void initState() {
- _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type, );
+ _tabController = new TabController(
+ length: 3,
+ vsync: this,
+ initialIndex: widget.type,
+ );
super.initState();
}
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
- // ProjectViewModel projectViewModel = Provider.of(context);
- GAnalytics.TREATMENT_TYPE = null; // reset treatment type on start new booking
+ // ProjectViewModel projectViewModel = Provider.of(context);
+ GAnalytics.TREATMENT_TYPE =
+ null; // reset treatment type on start new booking
return AppScaffold(
isShowAppBar: false,
@@ -54,32 +60,58 @@ class _SearchState extends State with TickerProviderStateMixin {
indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757),
- labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
+ labelPadding:
+ EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle(
- fontFamily: context.read().isArabic ? 'Cairo' : 'Poppins',
+ fontFamily: context.read().isArabic
+ ? 'Cairo'
+ : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
unselectedLabelStyle: TextStyle(
- fontFamily: context.read().isArabic ? 'Cairo' : 'Poppins',
+ fontFamily: context.read().isArabic
+ ? 'Cairo'
+ : 'Poppins',
fontSize: 16,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
),
- tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)],
+ tabs: [
+ Text(
+ TranslationBase.of(context).hospitalName,
+ style: TextStyle(fontSize: 12),
+ ),
+ Text(
+ TranslationBase.of(context).clinicName,
+ style: TextStyle(fontSize: 12),
+ ),
+ Text(
+ TranslationBase.of(context).doctorName,
+ style: TextStyle(fontSize: 12),
+ )
+ ],
onTap: (idx) {
if (idx == 0)
- context.read().analytics.appointment.book_appointment_by_clinic();
+ context
+ .read()
+ .analytics
+ .appointment
+ .book_appointment_by_clinic();
else
- context.read().analytics.appointment.book_appointment_by_doctor();
+ context
+ .read()
+ .analytics
+ .appointment
+ .book_appointment_by_doctor();
},
),
Expanded(
child: TabBarView(
-
physics: NeverScrollableScrollPhysics(),
children: [
+ SearchByHospital(),
SearchByClinic(clnicIds: widget.clnicIds),
SearchByDoctor(),
],
diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
index d44eee92..6e12c68e 100644
--- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
+++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
@@ -280,23 +280,27 @@ class _DocAvailableAppointmentsState extends State wit
selectedDateJSON = freeSlotsResponse[0];
});
openTimeSlotsPickerForDate(
- (isLiveCareSchedule != null && isLiveCareSchedule)
+ isWaitingAppointmentAvailable
+ ? DateTime.now()
+ : (isLiveCareSchedule != null && isLiveCareSchedule)
+ ? DateUtil.convertStringToDate(selectedDateJSON)
+ : DateUtil.convertStringToDateSaudiTimezone(
+ selectedDateJSON,
+ int.parse(
+ widget.doctor.projectID.toString(),
+ ),
+ ),
+ docFreeSlots);
+ _calendarController.selectedDate = isWaitingAppointmentAvailable
+ ? DateTime.now()
+ : (isLiveCareSchedule != null && isLiveCareSchedule)
? DateUtil.convertStringToDate(selectedDateJSON)
: DateUtil.convertStringToDateSaudiTimezone(
selectedDateJSON,
int.parse(
widget.doctor.projectID.toString(),
),
- ),
- docFreeSlots);
- _calendarController.selectedDate = (isLiveCareSchedule != null && isLiveCareSchedule)
- ? DateUtil.convertStringToDate(selectedDateJSON)
- : DateUtil.convertStringToDateSaudiTimezone(
- selectedDateJSON,
- int.parse(
- widget.doctor.projectID.toString(),
- ),
- );
+ );
_calendarController.displayDate = _calendarController.selectedDate;
return _eventsParsed;
}
@@ -327,10 +331,10 @@ class _DocAvailableAppointmentsState extends State wit
Widget getSelectedButton(int index) {
return CustomTextButton(
- backgroundColor: CustomColors.green,
+ backgroundColor: dayEvents[index].isoTime == TranslationBase.of(context).waitingAppointment ? CustomColors.darkOrange : CustomColors.green,
elevation: 0,
side: BorderSide(
- color: CustomColors.green, //Color of the border
+ color: dayEvents[index].isoTime == TranslationBase.of(context).waitingAppointment ? CustomColors.darkOrange : CustomColors.green, //Color of the border
style: BorderStyle.solid, //Style of the border
width: 1.5 //width of the border
),
@@ -360,16 +364,16 @@ class _DocAvailableAppointmentsState extends State wit
freeSlotsResponse = res['FreeTimeSlots'];
_getJSONSlots().then((value) {
setState(() {
- _events.clear();
- _events = value;
- if (widget.doctorSchedule != null)
- {
- _onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']));
- _calendarController.selectedDate = DateUtil.convertStringToDate(
- widget.doctorSchedule['Date'],
- );
- };
- });
+ _events.clear();
+ _events = value;
+ if (widget.doctorSchedule != null) {
+ _onDaySelected(DateUtil.convertStringToDate(widget.doctorSchedule['Date']));
+ _calendarController.selectedDate = DateUtil.convertStringToDate(
+ widget.doctorSchedule['Date'],
+ );
+ }
+ ;
+ });
});
} else {
DocAvailableAppointments.areAppointmentsAvailable = false;
diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart
index 849a0afc..a113e81b 100644
--- a/lib/pages/BookAppointment/components/SearchByClinic.dart
+++ b/lib/pages/BookAppointment/components/SearchByClinic.dart
@@ -1,6 +1,7 @@
import "dart:collection";
import 'package:auto_size_text/auto_size_text.dart';
+import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
@@ -95,6 +96,7 @@ class _SearchByClinicState extends State {
@override
Widget build(BuildContext context) {
+ AppGlobal.context = context;
return Container(
child: SingleChildScrollView(
child: Column(
@@ -648,7 +650,7 @@ class _SearchByClinicState extends State {
doctorsList.forEach((element) {
List doctorByHospital = _patientDoctorAppointmentListHospital
.where(
- (elementClinic) => elementClinic.filterName == element.projectName,
+ (elementClinic) => elementClinic.filterName == element.getProjectCompleteName(),
)
.toList();
@@ -656,7 +658,7 @@ class _SearchByClinicState extends State {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital
- .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
+ .add(PatientDoctorAppointmentList(filterName: element.getProjectCompleteName(), distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart
index f5c98d87..bc17a2ca 100644
--- a/lib/pages/BookAppointment/components/SearchByDoctor.dart
+++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart
@@ -105,13 +105,13 @@ class _SearchByDoctorState extends State {
});
doctorsList.forEach((element) {
- List doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
+ List doctorByHospital = _patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.getProjectCompleteName()).toList();
if (doctorByHospital.length != 0) {
_patientDoctorAppointmentListHospital[_patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList!.add(element);
} else {
_patientDoctorAppointmentListHospital
- .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
+ .add(PatientDoctorAppointmentList(filterName: element.getProjectCompleteName(), distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {
diff --git a/lib/pages/BookAppointment/components/search_by_hospital_name.dart b/lib/pages/BookAppointment/components/search_by_hospital_name.dart
new file mode 100644
index 00000000..72503cb4
--- /dev/null
+++ b/lib/pages/BookAppointment/components/search_by_hospital_name.dart
@@ -0,0 +1,559 @@
+import 'dart:collection';
+
+import 'package:auto_size_text/auto_size_text.dart';
+import 'package:diplomaticquarterapp/config/config.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
+import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+
+import '../../../config/shared_pref_kay.dart';
+import '../../../config/size_config.dart';
+import '../../../core/model/hospitals/hospitals_model.dart';
+import '../../../core/viewModels/project_view_model.dart';
+import '../../../models/Appointments/DoctorListResponse.dart';
+import '../../../models/Appointments/SearchInfoModel.dart';
+import '../../../models/Clinics/ClinicListResponse.dart';
+import '../../../services/appointment_services/GetDoctorsList.dart';
+import '../../../services/authentication/auth_provider.dart';
+import '../../../services/clinic_services/get_clinic_service.dart';
+import '../../../uitl/app_toast.dart';
+import '../../../uitl/gif_loader_dialog_utils.dart';
+import '../../../uitl/translations_delegate_base.dart';
+import '../../../widgets/transitions/fade_page.dart';
+import '../../livecare/livecare_home.dart';
+import '../DentalComplaints.dart';
+import '../LaserBooking.dart';
+import '../SearchResults.dart';
+import '../dialog/clinic_list_dialog.dart';
+import 'LiveCareBookAppointment.dart';
+
+class SearchByHospital extends StatefulWidget {
+ @override
+ State createState() => _SearchByHospitalState();
+}
+
+class _SearchByHospitalState extends State {
+ HospitalsModel? selectedHospital;
+ bool nearestAppo = false;
+
+ String? selectedClinicName;
+ List projectsList = [];
+ List? clinicIds = List.empty();
+
+ final GlobalKey projectDropdownKey = GlobalKey();
+
+ List clinicsList = [];
+ bool isMobileAppDentalAllow = false;
+ ListClinicCentralized? selectedClinic;
+
+ String? dropdownValue;
+ String dropdownTitle = "";
+
+ @override
+ void initState() {
+ WidgetsBinding.instance.addPostFrameCallback((_) => getProjectsList());
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ AppGlobal.context = context;
+
+ return Column(
+ children: [
+ Padding(
+ padding: const EdgeInsets.only(left: 6, right: 6, top: 16),
+ child: Row(
+ children: [
+ Checkbox(
+ activeColor: CustomColors.accentColor,
+ value: nearestAppo,
+ onChanged: (bool? value) {
+ nearestAppo = value ?? false;
+ setState(() {});
+ },
+ ),
+ AutoSizeText(
+ TranslationBase.of(context).nearestAppo.trim(),
+ maxLines: 1,
+ minFontSize: 10,
+ style: TextStyle(
+ fontSize: SizeConfig.textMultiplier! * 1.4,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.39,
+ height: 0.8,
+ ),
+ ),
+ // Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
+ ],
+ ),
+ ),
+ mHeight(8),
+ InkWell(
+ onTap: () {
+ openDropdown(projectDropdownKey);
+ },
+ child: Container(
+ width: double.infinity,
+ decoration: containerRadius(Colors.white, 12),
+ margin: EdgeInsets.only(left: 20, right: 20),
+ padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 12),
+ child: Row(
+ children: [
+ Flexible(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ TranslationBase.of(context).selectHospital,
+ style: TextStyle(
+ fontSize: 11,
+ letterSpacing: -0.44,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ Container(
+ height: 18,
+ width: double.infinity,
+ child: DropdownButtonHideUnderline(
+ child: DropdownButton(
+ key: projectDropdownKey,
+ hint: Text(
+ TranslationBase.of(context).selectHospital),
+ value: selectedHospital,
+ iconSize: 0,
+ isExpanded: true,
+ style: TextStyle(
+ fontSize: 14,
+ letterSpacing: -0.56,
+ color: Colors.black),
+ items: projectsList.map((HospitalsModel item) {
+ return DropdownMenuItem(
+ value: item,
+ child: AutoSizeText(
+ item.name!,
+ maxLines: 1,
+ minFontSize: 10,
+ style: TextStyle(
+ fontSize: SizeConfig.textMultiplier! * 1.6,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.39,
+ height: 0.8,
+ ),
+ ),
+ // Text('${item.name!}'),
+ );
+ }).toList(),
+ onChanged: (HospitalsModel? newValue) {
+ getClinicWrtHospital(newValue);
+ setState(() {
+ selectedHospital = newValue;
+ });
+ },
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ Icon(Icons.keyboard_arrow_down),
+ ],
+ )),
+ ),
+ if (clinicIds?.isNotEmpty == true) ...[
+ mHeight(8),
+ InkWell(
+ onTap: () {
+ showClickListDialog(context, clinicIds ?? List.empty(),
+ onSelection: (ListClinicCentralized clincs) {
+ selectedClinic = clincs;
+ Navigator.pop(context);
+ setState(() {
+ dropdownTitle = clincs.clinicDescription!;
+ dropdownValue = clincs.clinicID.toString() +
+ "-" +
+ clincs.isLiveCareClinicAndOnline.toString() +
+ "-" +
+ clincs.liveCareClinicID.toString() +
+ "-" +
+ clincs.liveCareServiceID.toString();
+ });
+ getDoctorsList(context);
+
+ context
+ .read()
+ .analytics
+ .appointment
+ .book_appointment_select_clinic(
+ appointment_type: 'regular',
+ clinic: clincs.clinicDescription);
+ });
+ },
+ child: Container(
+ width: double.infinity,
+ decoration: containerRadius(Colors.white, 12),
+ margin: EdgeInsets.only(left: 20, right: 20),
+ padding: EdgeInsets.only(left: 10, right: 10, top: 12, bottom: 8),
+ child: Row(
+ children: [
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ TranslationBase.of(context).selectClinic,
+ style: TextStyle(
+ fontSize: 11,
+ letterSpacing: -0.44,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ Padding(
+ padding: const EdgeInsets.only(top: 4, bottom: 2),
+ child: Text(
+ dropdownTitle,
+ style: TextStyle(
+ fontSize: 13,
+ letterSpacing: -0.44,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ Icon(Icons.keyboard_arrow_down),
+ ],
+ ),
+ ),
+ )
+ ]
+ ],
+ );
+ }
+
+ void openDropdown(GlobalKey key) {
+ GestureDetector? detector;
+
+ void searchForGestureDetector(BuildContext element) {
+ element.visitChildElements((element) {
+ if (element.widget != null && element.widget is GestureDetector) {
+ detector = element.widget as GestureDetector?;
+ //return false;
+ } else {
+ searchForGestureDetector(element);
+ }
+
+ //return true;
+ });
+ }
+
+ searchForGestureDetector(key.currentContext!);
+ assert(detector != null);
+
+ detector!.onTap!();
+ }
+
+ GestureDetector? searchForGestureDetector(BuildContext element) {
+ GestureDetector? detector;
+ element.visitChildElements((element) {
+ if (element.widget != null && element.widget is GestureDetector) {
+ detector = element.widget as GestureDetector?;
+ //return false;
+ } else {
+ searchForGestureDetector(element);
+ }
+ });
+ return detector;
+ }
+
+ getProjectsList() {
+ GifLoaderDialogUtils.showMyDialog(context);
+
+ int languageID = context.read().isArabic ? 1 : 2;
+ ClinicListService service = new ClinicListService();
+ List projectsListLocal = [];
+ service.getProjectsList(languageID, context).then((res) {
+ GifLoaderDialogUtils.hideDialog(context);
+
+ if (res['MessageStatus'] == 1) {
+ setState(() {
+ res['ListProject'].forEach((v) {
+ projectsListLocal.add(new HospitalsModel.fromJson(v));
+ });
+ projectsList = projectsListLocal;
+ });
+ } else {}
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+
+ print(err);
+ });
+ }
+
+ void getClinicWrtHospital(HospitalsModel? newValue) async {
+ GifLoaderDialogUtils.showMyDialog(context);
+ ClinicListService service = new ClinicListService();
+ List projectsListLocal = [];
+ setState(() {
+ clinicIds = List.empty();
+ });
+ List clinicId = [];
+ try {
+ Map res = await service.getClinicByHospital(
+ projectID: newValue?.mainProjectID.toString() ?? "");
+ GifLoaderDialogUtils.hideDialog(context);
+ if (res['MessageStatus'] == 1) {
+ List list = res['ListClinic'];
+
+ if (list.isEmpty) {
+ AppToast.showErrorToast(
+ message: TranslationBase.of(context).NoClinicFound,
+ );
+ }
+ res['ListClinic'].forEach((v) {
+ clinicId.add(ListClinicCentralized.fromJson(v));
+ });
+ clinicIds = clinicId;
+ setState(() {});
+ } else {
+ AppToast.showErrorToast(
+ message: TranslationBase.of(context).NoClinicFound,
+ );
+ }
+ } catch (e) {
+ print("the error is $e");
+ AppToast.showErrorToast(
+ message: TranslationBase.of(context).NoClinicFound,
+ );
+ GifLoaderDialogUtils.hideDialog(context);
+ }
+
+ // .then((res) {
+ // print("the result is obtained");
+ // GifLoaderDialogUtils.hideDialog(context);
+ // if (res['MessageStatus'] == 1) {
+ // List list = res['ListClinic'];
+ //
+ // if(list.isEmpty){
+ // AppToast.showErrorToast(message:
+ // TranslationBase.of(context).NoClinicFound,
+ // );
+ //
+ // }
+ // res['ListClinic'].forEach((v) {
+ // clinicId?.add(ListClinicCentralized.fromJson(v));
+ // });
+ // clinicIds = clinicId;
+ // setState(() {
+ //
+ // });
+ // } else {
+ // AppToast.showErrorToast(message:
+ // TranslationBase.of(context).NoClinicFound,
+ // );
+ // }
+ // }).catchError((err) {
+ // print('the error is $err');
+ // AppToast.showErrorToast(message:
+ // TranslationBase.of(context).NoClinicFound,
+ // );
+ // GifLoaderDialogUtils.hideDialog(context);
+ // }).catchError((err) {
+ // AppToast.showErrorToast(message:
+ // TranslationBase.of(context).NoClinicFound,
+ // );
+ // GifLoaderDialogUtils.hideDialog(context);
+ //
+ // print(err);
+ // });
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ }
+
+ Future navigateToDentalComplaints(
+ BuildContext context, SearchInfo searchInfo) async {
+ Navigator.push(
+ context,
+ FadePage(
+ page: DentalComplaints(searchInfo: searchInfo),
+ ),
+ ).then((value) {
+ setState(() {
+ dropdownValue = null;
+ selectedHospital = null;
+ dropdownTitle = "";
+ clinicIds = List.empty();
+ });
+ });
+ }
+
+ callDoctorsSearchAPI(int clinicID) {
+ int languageID = context.read().isArabic ? 1 : 2;
+ GifLoaderDialogUtils.showMyDialog(context);
+ List doctorsList = [];
+ List arr = [];
+ List arrDistance = [];
+ List result;
+ int numAll;
+ List _patientDoctorAppointmentListHospital =
+ [];
+
+ DoctorsListService service = new DoctorsListService();
+ service
+ .getDoctorsList(
+ clinicID,
+ selectedHospital?.mainProjectID.toString() != ""
+ ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1")
+ : 0,
+ nearestAppo,
+ languageID,
+ null)
+ .then((res) {
+ GifLoaderDialogUtils.hideDialog(context);
+ if (res['MessageStatus'] == 1) {
+ setState(() {
+ if (res['DoctorList'].length != 0) {
+ doctorsList.clear();
+ res['DoctorList'].forEach((v) {
+ doctorsList.add(DoctorList.fromJson(v));
+ });
+ doctorsList.forEach((element) {
+ List doctorByHospital =
+ _patientDoctorAppointmentListHospital
+ .where(
+ (elementClinic) =>
+ elementClinic.filterName == element.getProjectCompleteName(),
+ )
+ .toList();
+
+ if (doctorByHospital.length != 0) {
+ _patientDoctorAppointmentListHospital[
+ _patientDoctorAppointmentListHospital
+ .indexOf(doctorByHospital[0])]
+ .patientDoctorAppointmentList!
+ .add(element);
+ } else {
+ _patientDoctorAppointmentListHospital.add(
+ PatientDoctorAppointmentList(
+ filterName: element.getProjectCompleteName(),
+ distanceInKMs:
+ element.projectDistanceInKiloMeters.toString(),
+ patientDoctorAppointment: element));
+ }
+ });
+ } else {}
+ });
+
+ result = LinkedHashSet.from(arr).toList();
+ numAll = result.length;
+ navigateToSearchResults(
+ context, doctorsList, _patientDoctorAppointmentListHospital);
+ } else {
+ AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
+ }
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ print(err);
+ AppToast.showErrorToast(message: err, localContext: context);
+ });
+ }
+
+ Future navigateToSearchResults(
+ context,
+ List docList,
+ List
+ patientDoctorAppointmentListHospital) async {
+ Navigator.push(
+ context,
+ FadePage(
+ page: SearchResults(
+ isLiveCareAppointment: false,
+ doctorsList: docList,
+ patientDoctorAppointmentListHospital:
+ patientDoctorAppointmentListHospital)))
+ .then((value) {
+ print("navigation return ");
+ dropdownValue = null;
+ dropdownTitle = "";
+ selectedHospital = null;
+ clinicIds = List.empty();
+ setState(() {});
+ // getProjectsList();
+ });
+ }
+
+ Future navigateToLaserClinic(BuildContext context) async {
+ Navigator.push(
+ context,
+ FadePage(
+ page: LaserBooking(),
+ ),
+ ).then((value) {
+ print("LaserBooking navigation return ");
+ setState(() {
+ dropdownValue = null;
+ selectedHospital = null;
+ dropdownTitle = "";
+ clinicIds = List.empty();
+ });
+ });
+ }
+
+ getDoctorsList(BuildContext context) {
+ SearchInfo searchInfo = new SearchInfo();
+ if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") {
+ searchInfo.ProjectID = int.parse(selectedHospital?.mainProjectID.toString() ?? "");
+ searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]);
+ searchInfo.hospital = selectedHospital;
+ searchInfo.clinic = selectedClinic;
+ searchInfo.date = DateTime.now();
+
+ if (context.read().isLogin) {
+ if (context.read().user.age! > 12) {
+ navigateToDentalComplaints(context, searchInfo);
+ } else {
+ callDoctorsSearchAPI(17);
+ }
+ } else {
+ navigateToDentalComplaints(context, searchInfo);
+ }
+ } else if (dropdownValue!.split("-")[0] == "253") {
+ navigateToLaserClinic(context);
+ // callDoctorsSearchAPI();
+ } else if (dropdownValue!.split("-")[1] == "true"
+ // && authProvider.isLogin &&
+ // authUser.patientType == 1
+ ) {
+ Navigator.push(
+ context,
+ FadePage(
+ page: LiveCareBookAppointment(
+ clinicName: dropdownTitle,
+ liveCareClinicID: dropdownValue!.split("-")[2],
+ liveCareServiceID: dropdownValue!.split("-")[3]),
+ ),
+ ).then((value) {
+ print("navigation return ");
+ if (value == "false") dropdownValue = null;
+
+ // setState(() {
+ // });
+ if (value == "livecare") {
+ Navigator.push(context, FadePage(page: LiveCareHome()));
+ }
+ if (value == "schedule") {
+ callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
+ }
+ });
+ setState(() {});
+ } else {
+ callDoctorsSearchAPI(int.parse(dropdownValue!.split("-")[0]));
+ }
+ }
+}
diff --git a/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart b/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart
index ecbe1003..c3d82c74 100644
--- a/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart
+++ b/lib/pages/BookAppointment/dialog/clinic_list_dialog.dart
@@ -115,7 +115,7 @@ class _ClickListDialogState extends State {
),
),
),
- tempClinicsList[index].isLiveCareClinicAndOnline!
+ tempClinicsList[index].isLiveCareClinicAndOnline == true
? SvgPicture.asset(
'assets/images/new-design/video_icon_green_right.svg',
height: 12,
diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart
index a16876db..b3c39861 100644
--- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart
+++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart
@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
+import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/services/permission/permission_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
@@ -44,10 +45,10 @@ showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, S
}
}
-Future _showReminderDialog(BuildContext context, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
+Future _showReminderDialog(BuildContext providedContext, DateTime dateTime, String doctorName, String eventId, String appoDateFormatted, String appoTimeFormatted,
{required Function onSuccess, String? title, String? description, Function(int)? onMultiDateSuccess, bool? isMultiAllowed}) async {
return showDialog(
- context: context,
+ context: providedContext,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return Dialog(
@@ -81,7 +82,7 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String
if (onMultiDateSuccess == null) {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
await calendarUtils.createOrUpdateEvent(
- title: title ?? TranslationBase.of(context).reminderTitle + " " + doctorName,
+ title: title ?? TranslationBase.of(providedContext).reminderTitle + " " + doctorName,
description: description ?? "At " + appoDateFormatted + " " + appoTimeFormatted,
scheduleDateTime: dateTime,
eventId: eventId);
diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart
index fcb698b3..e7e7b1d0 100644
--- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart
+++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart
@@ -191,8 +191,8 @@ class _AppointmentActionsState extends State {
initPenguinSDK() async {
NavigationClinicDetails data = NavigationClinicDetails();
- // data.clinicId = widget.appo.clinicID.toString();
- data.clinicId = "49";
+ data.clinicId = widget.appo.clinicID.toString();
+ // data.clinicId = "49";
data.patientId = widget.appo.patientID.toString();
data.projectId = widget.appo.projectID.toString();
final bool permited = await AppPermission.askPenguinPermissions();
diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart
index 2c7f89fc..6ab67f12 100644
--- a/lib/pages/ToDoList/ToDo.dart
+++ b/lib/pages/ToDoList/ToDo.dart
@@ -378,12 +378,12 @@ class _ToDoState extends State with SingleTickerProviderStateMixin {
),
),
),
- if (projectViewModel.isIndoorNavigationEnabled)
+ if (projectViewModel.isIndoorNavigationEnabled && projectViewModel.havePrivilege(107) && appoList[index].projectID == 130)
InkWell(
onTap: () {
NavigationClinicDetails data = NavigationClinicDetails();
- // data.clinicId = appoList[index].clinicID.toString();
- data.clinicId = "46";
+ data.clinicId = appoList[index].clinicID.toString();
+ // data.clinicId = "46";
data.patientId = appoList[index].patientID.toString();
data.projectId = appoList[index].projectID.toString();
initPenguinSDK(data);
diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart
index 7711b4ff..a1e12240 100644
--- a/lib/pages/landing/fragments/home_page_fragment2.dart
+++ b/lib/pages/landing/fragments/home_page_fragment2.dart
@@ -54,7 +54,7 @@ class _HomePageFragment2State extends State {
hmgServices.add(HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin));
projectViewModel.isIndoorNavigationEnabled
- ? hmgServices.add(HmgServices(2, "Hospital", "Navigation", "assets/images/new/indoor_nav_home.svg", isLogin))
+ ? hmgServices.add(HmgServices(2, TranslationBase.of(context).hospitalNavigationTitle, TranslationBase.of(context).hospitalNavigationSubtitle, "assets/images/new/indoor_nav_home.svg", isLogin))
: hmgServices.add(HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin));
hmgServices.add(HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin));
@@ -346,7 +346,7 @@ class _HomePageFragment2State extends State {
itemCount: hmgServices.length,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
- return ServicesView(hmgServices[index], index, true, projectViewModel, isLocked: hmgServices[index].action == 2 ? !projectViewModel.havePrivilege(107) : false);
+ return ServicesView(hmgServices[index], index, true, projectViewModel, isLocked: (hmgServices[index].action == 2 && projectViewModel.isIndoorNavigationEnabled) ? !projectViewModel.havePrivilege(107) : false);
},
),
),
diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart
index c69f772c..e98855aa 100644
--- a/lib/pages/landing/widgets/services_view.dart
+++ b/lib/pages/landing/widgets/services_view.dart
@@ -195,6 +195,7 @@ class ServicesView extends StatelessWidget {
showDialog(
context: context,
builder: (cxt) => LocationSelectionDialog(
+ isArabic: projectViewModel.isArabic,
data: projectsListLocal,
selectedIndex: _selectedHospitalIndex,
onValueSelected: (index) {
@@ -215,7 +216,7 @@ class ServicesView extends StatelessWidget {
Permission.bluetoothScan,
Permission.activityRecognition,
].request().whenComplete(() {
- PenguinMethodChannel.launch("penguin", projectViewModel.isArabic ? "ar" : "en", "1231755");
+ PenguinMethodChannel.launch("penguin", projectViewModel.isArabic ? "ar" : "en", projectViewModel.authenticatedUserObject.user.patientID.toString());
});
} //
}
diff --git a/lib/pages/medical/sickleave_workplace_update_page.dart b/lib/pages/medical/sickleave_workplace_update_page.dart
index 0e555bab..ec7991cb 100644
--- a/lib/pages/medical/sickleave_workplace_update_page.dart
+++ b/lib/pages/medical/sickleave_workplace_update_page.dart
@@ -25,6 +25,10 @@ class WorkplaceUpdatePage extends StatefulWidget {
class _WorkplaceUpdatePageState extends State {
TextEditingController workplaceName = new TextEditingController();
+
+ TextEditingController workplaceNameAr = new TextEditingController();
+ TextEditingController occupationNameEn = new TextEditingController();
+ TextEditingController occupationNameAr = new TextEditingController();
bool? _isButtonDisabled;
ProjectViewModel? projectViewModel;
@@ -66,7 +70,14 @@ class _WorkplaceUpdatePageState extends State {
),
),
mHeight(8),
- inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName),
+ // inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName),
+ inputWidget(TranslationBase.of(context).workplaceName, "", workplaceName, FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]"))),
+ mHeight(8),
+ inputWidget(TranslationBase.of(context).workplaceNameAr, "", workplaceNameAr, FilteringTextInputFormatter.allow(RegExp("[ء-ي ]"))),
+ mHeight(8),
+ inputWidget(TranslationBase.of(context).occupationNameEn, "", occupationNameEn, FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]"))),
+ mHeight(8),
+ inputWidget(TranslationBase.of(context).occupationNameAr, "", occupationNameAr, FilteringTextInputFormatter.allow(RegExp("[ء-ي ]"))),
],
),
),
@@ -83,7 +94,7 @@ class _WorkplaceUpdatePageState extends State {
height: 50,
elevation: 0,
color: CustomColors.accentColor,
- disabledColor:Colors.grey.withOpacity(0.25),
+ disabledColor: Colors.grey.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(
TranslationBase.of(context).submit,
@@ -94,10 +105,12 @@ class _WorkplaceUpdatePageState extends State {
),
),
onPressed: () {
- if (_isButtonDisabled == false)
+ // if (_isButtonDisabled == false)
+ if (workplaceNameAr.text.isNotEmpty && occupationNameAr.text.isNotEmpty)
+ // AppToast.showSuccessToast(message: "API Called");
updateWorkplaceNameDialog();
else
- AppToast.showErrorToast(message: TranslationBase.of(context).enterWorkplaceName);
+ AppToast.showErrorToast(message: TranslationBase.of(context).enterDetailBelow);
},
),
),
@@ -109,7 +122,8 @@ class _WorkplaceUpdatePageState extends State {
);
}
- Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
+ Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, TextInputFormatter inputFormatter, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
+ // Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false}) {
return Container(
padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15),
alignment: Alignment.center,
@@ -145,7 +159,8 @@ class _WorkplaceUpdatePageState extends State {
keyboardType: TextInputType.name,
controller: _controller,
inputFormatters: [
- projectViewModel!.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")),
+ // projectViewModel!.isArabic ? FilteringTextInputFormatter.allow(RegExp("[ء-ي ]")) : FilteringTextInputFormatter.allow(RegExp("[a-zA-Z ]")),
+ inputFormatter
],
onChanged: (value) => {_onPassportTextChanged(value)},
style: TextStyle(
@@ -207,8 +222,8 @@ class _WorkplaceUpdatePageState extends State {
}
updateWorkplaceNameDialog() {
- var messageEn = "The workplace name you entered is: " + workplaceName.text + ". Please confirm!";
- var messageAr = "اسم مكان العمل الذي أدخلته هو: " + workplaceName.text + ". يرجى تأكيد!";
+ var messageEn = "The workplace name you entered is: " + workplaceNameAr.text + ". Please confirm!";
+ var messageAr = "اسم مكان العمل الذي أدخلته هو: " + workplaceNameAr.text + ". يرجى تأكيد!";
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: projectViewModel!.isArabic ? messageAr : messageEn,
@@ -226,9 +241,10 @@ class _WorkplaceUpdatePageState extends State {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
- service
- .updateWorkplaceName(projectViewModel!.isArabic ? "-" : workplaceName.text, projectViewModel!.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID)
- .then((res) {
+ service.updateWorkplaceName(workplaceName.text, workplaceNameAr.text, occupationNameEn.text, occupationNameAr.text, widget.requestNumber, widget.setupID, widget.projectID).then((res) {
+ // service
+ // .updateWorkplaceName(projectViewModel!.isArabic ? "-" : workplaceName.text, projectViewModel!.isArabic ? workplaceName.text : "-", widget.requestNumber, widget.setupID, widget.projectID)
+ // .then((res) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(true);
}).catchError((err) {
diff --git a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart
index 0e356b78..432707ce 100644
--- a/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart
+++ b/lib/pages/medical/smart_watch_health_data/distance/distanceTracker.dart
@@ -216,7 +216,7 @@ class _DistanceTrackerState extends State with SingleTickerProv
(element) {
weeklyTimeSeriesData.add(
TimeSeriesSales2(
- DateUtil.convertStringToDate(element.machineDate!),
+ DateUtil.convertStringToDate(element.machineDate ?? DateUtil.convertDateToString(DateTime.now())),
element.value != null ? (element.value!.toDouble() / 1000) : 0.0,
),
);
@@ -501,7 +501,7 @@ class _DistanceTrackerState extends State with SingleTickerProv
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
- DateUtil.convertStringToDate(step.machineDate!),
+ DateUtil.convertStringToDate(step.machineDate ?? DateUtil.convertDateToString(DateTime.now())),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
diff --git a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart
index fcd87cfd..a9a19945 100644
--- a/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart
+++ b/lib/pages/medical/smart_watch_health_data/steps/stepsTracker.dart
@@ -212,7 +212,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt
(element) {
weeklyTimeSeriesData.add(
TimeSeriesSales2(
- DateUtil.convertStringToDate(element.machineDate!),
+ DateUtil.convertStringToDate(element.machineDate ?? DateUtil.convertDateToString(DateTime.now())),
element.value != null ? element.value!.toDouble() : 0.0,
),
);
@@ -527,7 +527,7 @@ class _StepsTrackerState extends State with SingleTickerProviderSt
children: [
Utils.tableColumnValue(
'${DateUtil.getDayMonthYearDateFormatted(
- DateUtil.convertStringToDate(step.machineDate!),
+ DateUtil.convertStringToDate(step.machineDate ?? DateUtil.convertDateToString(DateTime.now())),
)} ',
isCapitable: false,
mProjectViewModel: projectViewModel),
diff --git a/lib/pages/rateAppointment/rate_appointment_clinic.dart b/lib/pages/rateAppointment/rate_appointment_clinic.dart
index 44484373..4dbc3edd 100644
--- a/lib/pages/rateAppointment/rate_appointment_clinic.dart
+++ b/lib/pages/rateAppointment/rate_appointment_clinic.dart
@@ -75,7 +75,7 @@ class _RateAppointmentClinicState extends State {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
Text(
- model.appointmentDetails.startTime.toString().substring(0, 5),
+ model.appointmentDetails.startTime != "" ? model.appointmentDetails.startTime.toString().substring(0, 5) : "",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
],
diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart
index 2d75be28..35b6d163 100644
--- a/lib/services/appointment_services/GetDoctorsList.dart
+++ b/lib/services/appointment_services/GetDoctorsList.dart
@@ -34,7 +34,7 @@ class DoctorsListService extends BaseService {
String? tokenID;
List selectedBodyPartList = [];
- Future