Merge branch 'dev_v3.13.6' into dev_v3.13.6_voipcall

# Conflicts:
#	android/app/build.gradle
dev_v3.13.6_voipcall
Aamir Muhammad 2 years ago
commit ecaf503f8b

@ -34,22 +34,17 @@ apply plugin: 'com.google.gms.google-services'
//apply plugin: 'com.google.firebase.crashlytics' //apply plugin: 'com.google.firebase.crashlytics'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
configurations.all { configurations.all {
resolutionStrategy { c -> c.resolutionStrategy.eachDependency {
force 'androidx.core:core-ktx:1.6.0' DependencyResolveDetails dependency ->
println dependency.requested.group
if (dependency.requested.group == 'org.bouncycastle') {
dependency.useTarget 'org.bouncycastle:bcprov-jdk15to18:1.68'
} }
} }
//configurations.all { }
// c -> c.resolutionStrategy.dependencySubstitution {
// all { DependencySubstitution dependency ->
// if (dependency.requested.group == 'org.bouncycastle') {
// dependency.useTarget 'org.bouncycastle:bcprov-jdk15to18:1.68'
// }
// }
// }
//}
android { android {
compileSdkVersion 34 compileSdkVersion 34
@ -113,21 +108,6 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
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'
}
}
}
} }
flutter { flutter {

@ -77,14 +77,19 @@ var WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
var GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; var GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
// Wifi Credentials // Wifi Credentials
var WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID"; var WIFI_CREDENTIALS =
"Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
///Doctor ///Doctor
var GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; var GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
var GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; var GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
var GET_DOCTOR_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; var GET_DOCTOR_PRE_POST_IMAGES =
var GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; 'Services/Doctors.svc/REST/GetDoctorPrePostImages';
var GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails'; var GET_DOCTOR_RATING_NOTES =
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
var GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
var GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; var GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
@ -92,31 +97,46 @@ var GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
// var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; // var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; var PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; var GET_PRESCRIPTIONS_ALL_ORDERS =
var GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
var SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail'; var GET_PRESCRIPTION_REPORT =
var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
var SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
var GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order ///Lab Order
var GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; var GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
var GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; var GET_Patient_LAB_SPECIAL_RESULT =
var SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
var SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
var GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; var GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
var GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; var GET_Patient_LAB_ORDERS_RESULT =
var SEND_COVID_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/GenerateCOVIDReport'; 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
var COVID_PASSPORT_UPDATE = 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; var SEND_COVID_LAB_RESULT_EMAIL =
var GET_PATIENT_PASSPORT_NUMBER = 'Services/Patients.svc/REST/Covid19_Certificate_GetPassport'; 'Services/Notifications.svc/REST/GenerateCOVIDReport';
var COVID_PASSPORT_UPDATE =
var UPDATE_WORKPLACE_NAME = 'Services/Patients.svc/REST/ActivateSickLeave_FromVida'; 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate';
var GET_SICKLEAVE_STATUS_ADMISSION_NO = 'Services/ChatBot_Service.svc/REST/GetSickLeaveStatusByAdmissionNo'; var GET_PATIENT_PASSPORT_NUMBER =
'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
var UPDATE_WORKPLACE_NAME =
'Services/Patients.svc/REST/ActivateSickLeave_FromVida';
var GET_SICKLEAVE_STATUS_ADMISSION_NO =
'Services/ChatBot_Service.svc/REST/GetSickLeaveStatusByAdmissionNo';
/// ///
var GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; var GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
var GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo'; var GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT =
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
var GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead'; var GET_PATIENT_ORDERS_DETAILS =
'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
var GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; var GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
var SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; var SEND_RAD_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback ///Feedback
var SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; var SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
@ -128,28 +148,39 @@ var GET_PATIENT_AppointmentHistory = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory_Async'; '/Doctors.svc/REST/PateintHasAppoimentHistory_Async';
///VITAL SIGN ///VITAL SIGN
var GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; var GET_PATIENT_VITAL_SIGN =
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Er Nearest ///Er Nearest
var GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; var GET_NEAREST_HOSPITAL =
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online ///ED Online
var ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; var ER_GET_VISUAL_TRIAGE_QUESTIONS =
var ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
var ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; var ER_SAVE_TRIAGE_INFORMATION =
"services/Doctors.svc/REST/ER_SaveTriageInformation";
var ER_GetPatientPaymentInformationForERClinic =
"services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest ///Er Nearest
var GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; var GET_AMBULANCE_REQUEST =
var GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
var GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID'; var GET_PATIENT_ALL_PRES_ORDERS =
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
var GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID =
'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
var UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder'; var UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
var INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; var INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
/// ER RRT /// ER RRT
var GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation'; var GET_ALL_RC_TRANSPORTATION = 'api/Transportation/getalltransportation';
var GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation'; var GET_ALL_TRANSPORTATIONS_RC = 'api/Transportation/getalltransportation';
var GET_ALL_RRT_QUESTIONS = 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions'; var GET_ALL_RRT_QUESTIONS =
var GET_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; 'Services/Patients.svc/REST/PatientER_RRT_GetAllQuestions';
var GET_RRT_SERVICE_PRICE =
'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice';
var GET_ALL_TRANSPORTATIONS_ORDERS = 'api/Transportation/get'; var GET_ALL_TRANSPORTATIONS_ORDERS = 'api/Transportation/get';
@ -170,7 +201,8 @@ var GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID';
var GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; var GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation ///userInformation
var GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; var GET_USERINFORMATION_REQUEST =
'Services/Community.svc/REST/GetUserInformation_New';
///Update email ///Update email
var UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; var UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail';
@ -192,26 +224,37 @@ var GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
var GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; var GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities';
///BloodDetails ///BloodDetails
var GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails'; var GET_BLOOD_REQUEST =
'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
var SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; var SAVE_BLOOD_REQUEST =
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
var GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; var GET_BLOOD_AGREEMENT =
var SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation';
var SAVE_BLOOD_AGREEMENT =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
///Reports ///Reports
var REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; var REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
var INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; var INSERT_REQUEST_FOR_MEDICAL_REPORT =
var SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
var GET_INPATIENT_ADMISSIONS = 'Services/inps.svc/REST/getAdmissionForMedicalReport'; var SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
var GET_INPATIENT_ADMISSIONS =
'Services/inps.svc/REST/getAdmissionForMedicalReport';
var GET_MEDICAL_REPORT_PDF = 'Services/inps.svc/REST/getMedicalReportPDF'; var GET_MEDICAL_REPORT_PDF = 'Services/inps.svc/REST/getMedicalReportPDF';
///Rate ///Rate
// var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; // var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; var IS_LAST_APPOITMENT_RATED =
var GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo'; 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async';
var NEW_RATE_APPOINTMENT_URL = "Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate"; var GET_APPOINTMENT_DETAILS_BY_NO =
var NEW_RATE_DOCTOR_URL = "Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate"; 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
var NEW_RATE_APPOINTMENT_URL =
"Services/Doctors.svc/REST/AppointmentsRating_InsertAppointmentRate";
var NEW_RATE_DOCTOR_URL =
"Services/Doctors.svc/REST/DoctorsRating_InsertDoctorRate";
var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
@ -219,7 +262,8 @@ var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get active appointment list //URL to get active appointment list
var GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber"; var GET_ACTIVE_APPOINTMENTS_LIST_URL =
"Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
//URL to get projects list //URL to get projects list
var GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; var GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
@ -228,119 +272,165 @@ var GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
var GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; var GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to dental doctors list //URL to dental doctors list
var GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping"; var GET_DENTAL_DOCTORS_LIST_URL =
"Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
//URL to get doctor free slots //URL to get doctor free slots
var GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; var GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment //URL to insert appointment
var INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment"; var INSERT_SPECIFIC_APPOINTMENT =
"Services/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share //URL to get patient share
var GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; var GET_PATIENT_SHARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
var GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; var GET_PATIENT_APPOINTMENT_HISTORY =
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
var GET_OBGYNE_ORDERS_LIST = "services/Patients.svc/REST/HIS_OBGYNEProcedureGet"; var GET_OBGYNE_ORDERS_LIST =
"services/Patients.svc/REST/HIS_OBGYNEProcedureGet";
var GET_OBGYNE_DOCTORS_LIST = "services/Doctors.svc/REST/HIS_ObgyneUltrasoundDoctors"; var GET_OBGYNE_DOCTORS_LIST =
"services/Doctors.svc/REST/HIS_ObgyneUltrasoundDoctors";
var OBGYNE_PROCEDURE_UPDATE = "services/Patients.svc/REST/HIS_OBGYNEProcedure_Update"; var OBGYNE_PROCEDURE_UPDATE =
"services/Patients.svc/REST/HIS_OBGYNEProcedure_Update";
var GET_RRT_PROCEDURE_LIST = "Services/Patients.svc/REST/GetRRTProcedureDetailsListFromVida"; var GET_RRT_PROCEDURE_LIST =
"Services/Patients.svc/REST/GetRRTProcedureDetailsListFromVida";
var DOCTOR_SCHEDULE_URL = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; var DOCTOR_SCHEDULE_URL =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
var SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; var SEND_REPORT_EYE_EMAIL =
"Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
var SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; var SEND_CONTACT_LENS_PRESCRIPTION_EMAIL =
"Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
// var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; // var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async"; var GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew_Async";
//URL to confirm appointment //URL to confirm appointment
var CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment"; var CONFIRM_APPOINTMENT =
"Services/MobileNotifications.svc/REST/ConfirmAppointment";
var INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart"; var INSERT_VIDA_REQUEST =
"Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
//URL to cancel appointment //URL to cancel appointment
var CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; var CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR //URL get appointment QR
var GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo"; var GENERATE_QR_APPOINTMENT =
"Services/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR //URL send email appointment QR
var EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; var EMAIL_QR_APPOINTMENT =
"Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status //URL check payment status
var CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID"; var CHECK_PAYMENT_STATUS =
"Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment //URL create advance payment
var CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; var CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
var HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment"; var HIS_CREATE_ADVANCE_PAYMENT =
"Services/Patients.svc/REST/HIS_CreateAdvancePayment";
var ER_CREATE_ADVANCE_PAYMENT = "services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic"; var ER_CREATE_ADVANCE_PAYMENT =
"services/Doctors.svc/REST/ER_CreateAdvancePaymentForClinic";
var ER_INSERT_ADVANCE_PAYMENT = "services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails"; var ER_INSERT_ADVANCE_PAYMENT =
"services/Doctors.svc/REST/ER_InsertEROnlinePaymentDetails";
var ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest'; var ADD_ADVANCE_NUMBER_REQUEST =
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
var GENERATE_ANCILLARY_ORDERS_INVOICE = 'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice'; var GENERATE_ANCILLARY_ORDERS_INVOICE =
'Services/Doctors.svc/REST/AutoGenerateAncillaryOrderInvoice';
var IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; var IS_ALLOW_ASK_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
var GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; var GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
var ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart'; var ADD_VIDA_REQUEST =
'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
var SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; var SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
var GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics'; var GET_LIVECARE_CLINICS =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
var GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule'; var GET_LIVECARE_SCHEDULE_CLINICS =
'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
var GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID'; var GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST =
'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
var GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots'; var GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS =
'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
var INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule'; var INSERT_LIVECARE_SCHEDULE_APPOINTMENT =
'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
var GET_PATIENT_SHARE_LIVECARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; var GET_PATIENT_SHARE_LIVECARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
var SET_ONLINE_CHECKIN_FOR_APPOINTMENT = "Services/Patients.svc/REST/SetOnlineCheckInForAppointment"; var SET_ONLINE_CHECKIN_FOR_APPOINTMENT =
"Services/Patients.svc/REST/SetOnlineCheckInForAppointment";
var GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule'; var GET_LIVECARE_CLINIC_TIMING =
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
var GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees'; var GET_ER_APPOINTMENT_FEES =
'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
var GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; var GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
var ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER'; var ADD_NEW_CALL_FOR_PATIENT_ER =
'Services/DoctorApplication.svc/REST/NewCallForPatientER';
var GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; var GET_LIVECARE_HISTORY =
var CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
var SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; var CANCEL_LIVECARE_REQUEST =
'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
var SEND_LIVECARE_INVOICE_EMAIL =
'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
var CHANGE_PATIENT_ER_SESSION = 'Services/DoctorApplication.svc/REST/ChangePatientERSession'; var CHANGE_PATIENT_ER_SESSION =
'Services/DoctorApplication.svc/REST/ChangePatientERSession';
var APPLE_PAY_INSERT_REQUEST = 'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert'; var APPLE_PAY_INSERT_REQUEST =
'Services/PayFort_Serv.svc/REST/PayFort_ApplePayRequestData_Insert';
var GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; var GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
var TAMARA_REQUEST_INSERT = 'Services/PayFort_Serv.svc/REST/AddTamaraRequest'; var TAMARA_REQUEST_INSERT = 'Services/PayFort_Serv.svc/REST/AddTamaraRequest';
var UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport'; var UPDATE_HEALTH_TERMS =
'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
var GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts'; var GET_PATIENT_HEALTH_STATS =
'Services/Patients.svc/REST/Med_GetTransactionsSts';
var SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; var SEND_CHECK_IN_NFC_REQUEST =
'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
var HAS_DENTAL_PLAN = 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; var HAS_DENTAL_PLAN =
'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
var LASER_BODY_PARTS = 'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory'; var LASER_BODY_PARTS =
'Services/Patients.svc/REST/Laser_GetBodyPartsByCategory';
var INSERT_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert'; var INSERT_COVID_QUESTIONNAIRE =
var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update'; 'Services/Doctors.svc/REST/COVID19_Questionnarie_Insert';
var UPDATE_COVID_QUESTIONNAIRE =
'Services/Doctors.svc/REST/COVID19_Questionnarie_Update';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
var CHANNEL = 3; var CHANNEL = 3;
@ -362,19 +452,27 @@ var IS_TEXT_COMPLETED = false;
var GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; var GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
var GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; var GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
var GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; var GET_PAtIENTS_INSURANCE =
var GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
var GET_PAtIENTS_INSURANCE_UPDATED =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
var INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; var INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
var INSURANCE_SCHEMES = "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; var INSURANCE_SCHEMES =
var UPDATE_MANUAL_INSURANCE = "Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate"; "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet";
var INSURANCE_COMPANIES = "Services/Patients.svc/REST/PatientER_InsuranceCompanyGet"; var UPDATE_MANUAL_INSURANCE =
var GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; "Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate";
var UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate'; var INSURANCE_COMPANIES =
"Services/Patients.svc/REST/PatientER_InsuranceCompanyGet";
var GET_PATIENT_INSURANCE_DETAILS =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
var UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
var GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; var GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
var GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; var GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
var GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus_Async"; var GET_PAtIENTS_INSURANCE_APPROVALS =
"Services/Patients.svc/REST/GetApprovalStatus_Async";
// var GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; // var GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
var SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; var SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
@ -383,89 +481,132 @@ var GET_VACCINATION_ONHAND = "/Services/ERP.svc/REST/GET_VACCINATION_ONHAND";
var GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave'; var GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
var GET_PATIENT_SICK_LEAVE_STATUS = 'Services/Patients.svc/REST/GetPatientSickLeave_Status'; var GET_PATIENT_SICK_LEAVE_STATUS =
'Services/Patients.svc/REST/GetPatientSickLeave_Status';
var SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; var SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail';
var GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; var GET_PATIENT_AdVANCE_BALANCE_AMOUNT =
var GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
var GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; var GET_PATIENT_INFO_BY_ID =
var SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment'; 'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
var CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; var GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER =
'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
var SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
var CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
var GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter'; var GET_COVID_DRIVETHRU_PROJECT_LIST =
'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
var GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation'; var GET_COVID_DRIVETHRU_PAYMENT_INFO =
'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
var GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; var GET_COVID_DRIVETHRU_FREE_SLOTS =
'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
var GET_COVID_DRIVETHRU_PROCEDURES_LIST = 'Services/Doctors.svc/REST/COVID19_GetTestProcedures'; var GET_COVID_DRIVETHRU_PROCEDURES_LIST =
'Services/Doctors.svc/REST/COVID19_GetTestProcedures';
///Smartwatch Integration Services ///Smartwatch Integration Services
var GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; var GET_PATIENT_LAST_RECORD =
var INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions'; 'Services/Patients.svc/REST/Med_GetPatientLastRecord';
var INSERT_PATIENT_HEALTH_DATA =
'Services/Patients.svc/REST/Med_InsertTransactions';
///My Trackers ///My Trackers
var GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; var GET_DIABETIC_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
var GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults'; var GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults';
var ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult'; var ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
var GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; var GET_BLOOD_PRESSURE_RESULT_AVERAGE =
var GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
var ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; var GET_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
var ADD_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
var GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; var GET_WEIGHT_PRESSURE_RESULT_AVERAGE =
var GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
var ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; var GET_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
var ADD_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
var ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; var ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID =
'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
var GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult'; var GET_CALL_INFO_HOURS_RESULT =
var GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
var GET_CALL_REQUEST_TYPE_LOV =
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
var GET_QUESTION_TYPES = 'Services/OUTPs.svc/REST/getQuestionsTypes'; var GET_QUESTION_TYPES = 'Services/OUTPs.svc/REST/getQuestionsTypes';
var UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; var UPDATE_DIABETIC_RESULT =
'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
var SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
var DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; var SEND_AVERAGE_BLOOD_SUGAR_REPORT =
var DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; 'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
var DEACTIVATE_DIABETIC_STATUS =
var UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult'; 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
var SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport'; var DEACTIVATE_BLOOD_PRESSURES_STATUS =
var SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport'; 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus';
var UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult'; var UPDATE_BLOOD_PRESSURE_RESULT =
var DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus'; 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
var SEND_AVERAGE_BLOOD_WEIGHT_REPORT =
'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
var SEND_AVERAGE_BLOOD_PRESSURE_REPORT =
'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
var UPDATE_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
var DEACTIVATE_WEIGHT_PRESSURE_RESULT =
'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
var GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; var GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse';
var UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; var UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
var INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; var INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
var INSERT_APPOINTMENT_QUESTION = 'Services/OUTPs.svc/REST/insertAppointmentQuestion'; var INSERT_APPOINTMENT_QUESTION =
var RATE_DOCTOR_RESPONSE = 'Services/OUTPs.svc/REST/insertAppointmentQuestionRating'; 'Services/OUTPs.svc/REST/insertAppointmentQuestion';
var RATE_DOCTOR_RESPONSE =
'Services/OUTPs.svc/REST/insertAppointmentQuestionRating';
var GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; var GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O // H2O
var H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; var H2O_GET_USER_PROGRESS =
var H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
var H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New"; var H2O_INSERT_USER_ACTIVITY =
var H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New"; "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
var H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity"; var H2O_GET_USER_DETAIL =
"Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
var H2O_UPDATE_USER_DETAIL =
"Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
var H2O_UNDO_USER_ACTIVITY =
"Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
//E_Referral Services //E_Referral Services
var GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; var GET_ALL_RELATIONSHIP_TYPES =
var SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral'; "Services/Patients.svc/REST/GetAllRelationshipTypes";
var CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral'; var SEND_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
var CHECK_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
var GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; var GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
var CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; var CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
var GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; var GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// Encillary Orders // Encillary Orders
var GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; var GET_ANCILLARY_ORDERS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
var GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; var GET_ANCILLARY_ORDERS_DETAILS =
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
//Pharmacy wishlist //Pharmacy wishlist
// var GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // var GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
@ -498,13 +639,19 @@ var GET_SHIPPING_OPTIONS = "get_shipping_option/";
var DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; var DELETE_SHOPPING_CART = "delete_shopping_cart_items/";
var DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; var DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
var ORDER_SHOPPING_CART = "orders"; var ORDER_SHOPPING_CART = "orders";
var GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; var GET_LACUM_ACCOUNT_INFORMATION =
var GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; "Services/Patients.svc/REST/GetLakumAccountInformation";
var LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; var GET_LACUM_GROUP_INFORMATION =
var LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation"; "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
var LACUM_ACCOUNT_ACTIVATE =
"Services/Patients.svc/REST/LakumAccountActivation";
var LACUM_ACCOUNT_DEACTIVATE =
"Services/Patients.svc/REST/LakumAccountDeactivation";
var CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount"; var CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount";
var TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; var TRANSFER_YAHALA_LOYALITY_POINTS =
var LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
var LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
// var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; // var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async'; var PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList_Async';
@ -514,18 +661,29 @@ var GET_MOST_VIEWED_PRODUCTS = "mostview";
var GET_NEW_PRODUCTS = "newproducts"; var GET_NEW_PRODUCTS = "newproducts";
// Home Health Care // Home Health Care
var HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; var HHC_GET_ALL_SERVICES =
var HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
var PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder"; var HHC_GET_ALL_CMC_SERVICES =
var GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder"; "Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
var GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder"; var PATIENT_ER_UPDATE_PRES_ORDER =
"Services/Patients.svc/REST/PatientER_UpdatePresOrder";
var GET_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
var GET_CMC_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
var GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; var GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
var PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; var PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
var GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
var PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder'; 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
var BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; var GET_PATIENT_ALL_PRES_ORD =
var ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
var PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
var BLOOD_DONATION_REGISTER_BLOOD_TYPE =
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
var ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
// HHC RC SERVICES // HHC RC SERVICES
var HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc"; var HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc";
@ -569,17 +727,21 @@ var GET_CUSTOMER_INFO = "VerifyCustomer";
//Pharmacy //Pharmacy
var GET_PHARMACY_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0'; var GET_PHARMACY_CATEGORISE =
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=0';
var GET_OFFERS_CATEGORISE = 'discountcategories'; var GET_OFFERS_CATEGORISE = 'discountcategories';
var GET_OFFERS_PRODUCTS = 'offerproducts/'; var GET_OFFERS_PRODUCTS = 'offerproducts/';
var GET_CATEGORISE_PARENT = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; var GET_CATEGORISE_PARENT =
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
var GET_PARENT_PRODUCTS = 'products?categoryid='; var GET_PARENT_PRODUCTS = 'products?categoryid=';
var GET_SUB_CATEGORISE = 'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id='; var GET_SUB_CATEGORISE =
'categories?fields=id,name,namen,description,image,localized_names,display_order,parent_category_id,is_leaf&parent_id=';
var GET_SUB_PRODUCTS = 'products?categoryid='; var GET_SUB_PRODUCTS = 'products?categoryid=';
var GET_FINAL_PRODUCTS = var GET_FINAL_PRODUCTS =
'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';
var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; var GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
var GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID'; var GET_DISEASE_BY_CLINIC_ID =
'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
var SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; var SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime';
var TIMER_MIN = 10; var TIMER_MIN = 10;
@ -595,80 +757,105 @@ var SCAN_QR_CODE = 'productbysku/';
var FILTERED_PRODUCTS = 'products?categoryids='; var FILTERED_PRODUCTS = 'products?categoryids=';
var GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors"; var GET_DOCTOR_LIST_CALCULATION =
"Services/Doctors.svc/REST/GetCallculationDoctors";
var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC = "Services/Patients.svc/REST/GetDentalAppointments"; var GET_ALL_APPOINTMENTS_FOR_DENTAL_CLINIC =
"Services/Patients.svc/REST/GetDentalAppointments";
var GET_DENTAL_APPOINTMENT_INVOICE = "Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo"; var GET_DENTAL_APPOINTMENT_INVOICE =
"Services/Patients.svc/REST/HIS_eInvoiceForDentalByAppointmentNo";
var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL = "Services/Notifications.svc/REST/SendInvoiceForDental"; var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL =
"Services/Notifications.svc/REST/SendInvoiceForDental";
var GET_TAMARA_PLAN = 'https://mdlaboratories.com/tamaralive/Home/GetInstallments'; var GET_TAMARA_PLAN =
'https://mdlaboratories.com/tamaralive/Home/GetInstallments';
var GET_TAMARA_PAYMENT_STATUS = 'https://mdlaboratories.com/tamaralive/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'; var UPDATE_TAMARA_STATUS =
'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus';
var MARK_APPOINTMENT_TAMARA_STATUS = 'Services/Patients.svc/REST/MarkAppointmentForTamaraPayment_FromVida'; var MARK_APPOINTMENT_TAMARA_STATUS =
'Services/Patients.svc/REST/MarkAppointmentForTamaraPayment_FromVida';
var AUTO_GENERATE_INVOICE_TAMARA = 'Services/PayFort_Serv.svc/REST/Tamara_GetinfoByAppointmentNo_AutoGenerateInvoice'; var AUTO_GENERATE_INVOICE_TAMARA =
'Services/PayFort_Serv.svc/REST/Tamara_GetinfoByAppointmentNo_AutoGenerateInvoice';
var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players'; var GET_ONESIGNAL_VOIP_TOKEN = 'https://onesignal.com/api/v1/players';
var CANCEL_PHARMA_LIVECARE_REQUEST = 'https://vcallapi.hmg.com/api/PharmaLiveCare/SendPaymentStatus'; var CANCEL_PHARMA_LIVECARE_REQUEST =
'https://vcallapi.hmg.com/api/PharmaLiveCare/SendPaymentStatus';
var INSERT_FREE_SLOTS_LOGS = 'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs'; var INSERT_FREE_SLOTS_LOGS =
'Services/Doctors.svc/Rest/InsertDoctorFreeSlotsLogs';
var GET_NATIONALITY = 'Services/Lists.svc/REST/GetNationality'; var GET_NATIONALITY = 'Services/Lists.svc/REST/GetNationality';
var PAYFORT_TEST_URL = 'https://sbpaymentservices.payfort.com/FortAPI/paymentApi'; var PAYFORT_TEST_URL =
'https://sbpaymentservices.payfort.com/FortAPI/paymentApi';
var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi'; var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi';
// Check If InPatient API // Check If InPatient API
var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo'; var CHECK_IF_INPATIENT = 'Services/Patients.svc/REST/GetInPatientAdmissionInfo';
var CHECK_IF_PATIENT_ADMITTED = 'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest'; var CHECK_IF_PATIENT_ADMITTED =
'Services/Inps.svc/REST/checkIsPatientAdmittedOrAdmissionRequest';
// Get General Instructions API // Get General Instructions API
var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions'; var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions';
// Get Medical Instructions API // Get Medical Instructions API
var GET_MEDICAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getPatientAdmissionRequest'; var GET_MEDICAL_INSTRUCTIONS =
'Services/INPs.svc/REST/getPatientAdmissionRequest';
var GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS = 'Services/INPs.svc/REST/getInpatientAdvancePendingPayment'; var GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS =
'Services/INPs.svc/REST/getInpatientAdvancePendingPayment';
var GET_INPATIENT_PAID_ADVANCE_PAYMENT = 'Services/INPs.svc/REST/getInpatientAdvanceHistory'; var GET_INPATIENT_PAID_ADVANCE_PAYMENT =
'Services/INPs.svc/REST/getInpatientAdvanceHistory';
var GET_INPATIENT_ADVANCE_PAYMENT_LINK = 'Services/PayFort_Serv.svc/REST/InsertInPatientAdvanceDetails'; var GET_INPATIENT_ADVANCE_PAYMENT_LINK =
'Services/PayFort_Serv.svc/REST/InsertInPatientAdvanceDetails';
var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder'; var INSERT_INPATIENT_ORDER = 'Services/INPs.svc/REST/Inpcp_insertOrder';
var INPATIENT_DISCHARGE_MEDICATIONS = 'Services/INPs.svc/REST/chekPatientHasDischargeMedicine'; var INPATIENT_DISCHARGE_MEDICATIONS =
'Services/INPs.svc/REST/chekPatientHasDischargeMedicine';
var GET_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/getBirthNotification_bymothermrn'; var GET_BIRTH_NOTIFICATION =
'Services/INPs.svc/REST/getBirthNotification_bymothermrn';
var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification'; var SAVE_BIRTH_NOTIFICATION = 'Services/INPs.svc/REST/SaveBirthNotification';
//Meal Plan APIs //Meal Plan APIs
var GET_ADMITTED_PATIENTS = 'Services/MOP.svc/REST/GetAdmittedPatients'; var GET_ADMITTED_PATIENTS = 'Services/MOP.svc/REST/GetAdmittedPatients';
var GET_CURRENT_WEEKID_WEEKDAY = 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP'; var GET_CURRENT_WEEKID_WEEKDAY =
var GET_MEALS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetMealsOfScheduleID_Mobile'; 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP';
var GET_MEAL_ITEMS_OF_SCHEDULE_ID = 'Services/MOP.svc/REST/GetDefaultItemsOfScheduleID'; var GET_MEALS_OF_SCHEDULE_ID =
'Services/MOP.svc/REST/GetMealsOfScheduleID_Mobile';
var GET_MEAL_ITEMS_OF_SCHEDULE_ID =
'Services/MOP.svc/REST/GetDefaultItemsOfScheduleID';
var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder'; var PLACE_MEAL_PLAN_ORDER = 'Services/MOP.svc/REST/UpdateOrMakeNewOrder';
var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; var CHECK_PATIENT_NPHIES_ELIGIBILITY =
var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity';
var CONVERT_PATIENT_TO_CASH =
'Services/Doctors.svc/REST/deActivateInsuranceCompany';
//PAYFORT //PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var getPayFortProjectDetails =
"Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
// var payFortEnvironment = FortEnvironment.production; // var payFortEnvironment = FortEnvironment.production;
// var applePayMerchantId = "merchant.com.hmgwebservices"; // var applePayMerchantId = "merchant.com.hmgwebservices";
var payFortEnvironment = FortEnvironment.test; var payFortEnvironment = FortEnvironment.test;
var applePayMerchantId = "merchant.com.hmgwebservices.uat"; var applePayMerchantId = "merchant.com.hmgwebservices.uat";
bool apiStatus = false;
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -23,7 +23,11 @@ class H2OService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(H2O_GET_USER_DETAIL, onSuccess: (dynamic response, int statusCode) {
if (response["UserDetailData_New"] != null) {
userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]); userDetailModel = UserDetailModel.fromJson(response["UserDetailData_New"]);
} else {
userDetailModel = UserDetailModel();
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -28,7 +28,8 @@ class CMCService extends BaseService {
hasError = false; hasError = false;
// RC IMPLEMENTATION // RC IMPLEMENTATION
await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + user.patientID.toString(), isRCService: true, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_ALL_CMC_SERVICES_RC + "?patientID=" + authenticatedUserObject.user.patientID.toString(), isRCService: true, isAllowAny: true,
onSuccess: (dynamic response, int statusCode) {
cmcAllServicesList.clear(); cmcAllServicesList.clear();
response['response'].forEach((data) { response['response'].forEach((data) {
cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data)); cmcAllServicesList.add(GetCMCServicesResponseModel.fromJson(data));

@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_lis
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../../../../uitl/app_toast.dart';
class BariatricsService extends BaseService { class BariatricsService extends BaseService {
List<ClinicCategory> clinicCategoryList = []; List<ClinicCategory> clinicCategoryList = [];
List<DiseasesByClinic> diseasesList = []; List<DiseasesByClinic> diseasesList = [];
@ -127,6 +129,7 @@ class BariatricsService extends BaseService {
await baseAppClient.post(GET_DOCTOR_LIST_CALCULATION, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_DOCTOR_LIST_CALCULATION, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error);
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);

@ -30,7 +30,8 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: Map(); /// body: Map();
/// ///
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient { class BaseAppClient {
@ -54,12 +55,17 @@ class BaseAppClient {
url = BASE_URL + endPoint; url = BASE_URL + endPoint;
} }
try { try {
String? pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); String? pharmacyToken =
await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; Map<String, String> headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
if (!isExternal) { if (!isExternal) {
String? token = await sharedPref.getString(TOKEN); String? token = await sharedPref.getString(TOKEN);
String? languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); String? languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (endPoint == SEND_ACTIVATION_CODE) { if (endPoint == SEND_ACTIVATION_CODE) {
languageID = 'en'; languageID = 'en';
} }
@ -74,7 +80,7 @@ class BaseAppClient {
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
if (body.containsKey('LanguageID')) { // if (body.containsKey('LanguageID')) {
if (body['LanguageID'] != null) { if (body['LanguageID'] != null) {
//change this line because language issue happened on dental //change this line because language issue happened on dental
body['LanguageID'] = body['LanguageID'] == 'ar' body['LanguageID'] = body['LanguageID'] == 'ar'
@ -83,12 +89,20 @@ class BaseAppClient {
? 2 ? 2
: body['LanguageID']; : body['LanguageID'];
} else { } else {
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2; body['LanguageID'] =
} Provider.of<ProjectViewModel>(AppGlobal.context, listen: false)
} else { .isArabic
// body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); ? 1
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2; : 2;
} }
// } else {
// // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2);
// body['LanguageID'] =
// Provider.of<ProjectViewModel>(AppGlobal.context, listen: false)
// .isArabic
// ? 1
// : 2;
// }
// body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2; // body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
@ -103,7 +117,8 @@ class BaseAppClient {
body['Longitude'] = long; body['Longitude'] = long;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] ? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND
@ -151,14 +166,17 @@ class BaseAppClient {
if (user != null) { if (user != null) {
body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token; body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = body.containsKey('PatientOutSA') body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null ? body['PatientOutSA'] != null
? body['PatientOutSA'] ? body['PatientOutSA']
: user['OutSA'] : user['OutSA']
: user['OutSA']; : user['OutSA'];
body['SessionID'] = getSessionId(body['TokenID'] != null ? body['TokenID'] : ""); //getSe body['SessionID'] = getSessionId(
body['TokenID'] != null ? body['TokenID'] : ""); //getSe
// body['SessionID'] = body['TokenID']; //getSe // body['SessionID'] = body['TokenID']; //getSe
// headers = { // headers = {
@ -190,12 +208,15 @@ class BaseAppClient {
print(jsonBody); print(jsonBody);
// } // }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { if (await Utils.checkConnection(
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()),
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); logApiEndpointError(
endPoint, 'Error While Fetching data', statusCode);
} else { } else {
// var decoded = utf8.decode(response.bodyBytes); // var decoded = utf8.decode(response.bodyBytes);
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
@ -209,8 +230,12 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); navigateToAppUpdate(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); AppGlobal.context, parsed['ErrorEndUserMessage']);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
if (parsed['ErrorType'] == 2) { if (parsed['ErrorType'] == 2) {
await logout(); await logout();
@ -229,28 +254,46 @@ class BaseAppClient {
// if (parsed != null) { // if (parsed != null) {
// onSuccess(parsed, statusCode); // onSuccess(parsed, statusCode);
// } else { // } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
// logout(); // logout();
// } // }
} }
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { } else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { } else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", statusCode); onFailure("Server Error found with no available message",
logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); statusCode);
logApiEndpointError(
endPoint,
"Server Error found with no available message",
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode); logApiEndpointError(
endPoint, parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure(
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
logApiEndpointError(endPoint,
parsed['message'] ?? parsed['message'], statusCode);
} }
} }
} }
@ -262,11 +305,18 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(endPoint,
parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -275,17 +325,23 @@ class BaseAppClient {
} }
} else { } else {
onFailure('Please Check The Internet Connection', -1); onFailure('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} catch (e) { } catch (e) {
print(e); print(e);
onFailure(e.toString(), -1); onFailure(e.toString(), -1);
_analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url"); _analytics.errorTracking
.log(endPoint, error: "api exception: $e - API Path: $url");
} }
} }
postPharmacy(String endPoint, postPharmacy(String endPoint,
{Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async { {Map<String, dynamic>? body,
Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
String url; String url;
@ -302,13 +358,16 @@ class BaseAppClient {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': pharmacyToken ?? '', 'Authorization': pharmacyToken ?? '',
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}; };
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
// if (body.containsKey('SetupID')) { // if (body.containsKey('SetupID')) {
// body['SetupID'] = body.containsKey('SetupID') // body['SetupID'] = body.containsKey('SetupID')
@ -370,12 +429,14 @@ class BaseAppClient {
print("Headers : ${json.encode(headers)}"); print("Headers : ${json.encode(headers)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()),
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode); onFailure!('Error While Fetching data', statusCode);
logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); logApiEndpointError(
endPoint, 'Error While Fetching data', statusCode);
} else { } else {
// var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
@ -383,8 +444,12 @@ class BaseAppClient {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); navigateToAppUpdate(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); AppGlobal.context, parsed['ErrorEndUserMessage']);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
@ -399,29 +464,56 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else { } else {
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
logApiEndpointError(endPoint, 'session logged out', statusCode); statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint, 'session logged out', statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { } else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { } else if (parsed['MessageStatus'] == 2 &&
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else { } else {
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure!("Server Error found with no available message", statusCode); onFailure!("Server Error found with no available message",
logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); statusCode);
logApiEndpointError(
endPoint,
"Server Error found with no available message",
statusCode);
} else { } else {
onFailure!(parsed['ErrorSearchMsg'], statusCode); onFailure!(parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorSearchMsg'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); logApiEndpointError(
endPoint,
parsed['ErrorSearchMsg'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} else { } else {
onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
@ -433,11 +525,22 @@ class BaseAppClient {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else { } else {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure!(parsed['message'] ?? parsed['message'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(
endPoint,
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} else { } else {
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -445,7 +548,8 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} catch (e) { } catch (e) {
print(e); print(e);
@ -457,7 +561,8 @@ class BaseAppClient {
Future navigateToAppUpdate(context, String text) async { Future navigateToAppUpdate(context, String text) async {
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,
MaterialPageRoute(builder: (context) => AppUpdatePage(appUpdateText: text)), MaterialPageRoute(
builder: (context) => AppUpdatePage(appUpdateText: text)),
(Route<dynamic> route) => false, (Route<dynamic> route) => false,
); );
} }
@ -488,7 +593,10 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get( final response = await http.get(
Uri.parse(url.trim()), Uri.parse(url.trim()),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'}, headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");
@ -502,7 +610,8 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} }
@ -534,7 +643,9 @@ class BaseAppClient {
'Content-Type': 'text/html; charset=utf-8', 'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
// 'Host': "mdlaboratories.com", // 'Host': "mdlaboratories.com",
@ -544,14 +655,19 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
if (statusCode == 401) { if (statusCode == 401) {
onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin,
logApiEndpointError(endPoint, TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); statusCode);
logApiEndpointError(
endPoint,
TranslationBase.of(AppGlobal.context).pharmacyRelogin,
statusCode);
Navigator.of(AppGlobal.context).pushNamed(HOME); Navigator.of(AppGlobal.context).pushNamed(HOME);
} else { } else {
var bodyUtf = json.decode(utf8.decode(response.bodyBytes)); var bodyUtf = json.decode(utf8.decode(response.bodyBytes));
// print(bodyUtf); // print(bodyUtf);
onFailure!(bodyUtf['error']['ErrorEndUserMsg'], statusCode); onFailure!(bodyUtf['error']['ErrorEndUserMsg'], statusCode);
logApiEndpointError(endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode); logApiEndpointError(
endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode);
} }
} else { } else {
// var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
@ -560,7 +676,8 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} }
@ -576,7 +693,8 @@ class BaseAppClient {
// print("body: $body"); // print("body: $body");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers!.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.post( final response = await http.post(
Uri.parse(url.trim()), Uri.parse(url.trim()),
body: json.encode(body), body: json.encode(body),
@ -584,7 +702,12 @@ class BaseAppClient {
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePost(fullUrl, onFailure: onFailure, onSuccess: onSuccess, body: body, headers: headers); if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simplePost(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
body: body,
headers: headers);
// print(response.body.toString()); // print(response.body.toString());
@ -596,12 +719,16 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} }
simpleGet(String fullUrl, simpleGet(String fullUrl,
{Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map<String, dynamic>? queryParams, Map<String, String>? headers}) async { {Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
Map<String, dynamic>? queryParams,
Map<String, String>? headers}) async {
headers = headers ?? {}; headers = headers ?? {};
String url = fullUrl; String url = fullUrl;
@ -613,7 +740,8 @@ class BaseAppClient {
} }
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.get( final response = await http.get(
Uri.parse(url.trim()), Uri.parse(url.trim()),
headers: headers, headers: headers,
@ -621,7 +749,12 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleGet(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, queryParams: queryParams); if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simpleGet(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
headers: headers,
queryParams: queryParams);
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode); onFailure!('Error While Fetching data', statusCode);
@ -631,17 +764,22 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} }
simplePut(String fullUrl, simplePut(String fullUrl,
{Map<String, dynamic>? body, Map<String, String>? headers, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async { {Map<String, dynamic>? body,
Map<String, String>? headers,
Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure}) async {
String url = fullUrl; String url = fullUrl;
// print("URL Query String: $url"); // print("URL Query String: $url");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers!.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.put( final response = await http.put(
Uri.parse(url.trim()), Uri.parse(url.trim()),
body: json.encode(body), body: json.encode(body),
@ -650,7 +788,12 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simplePut(fullUrl, onFailure: onFailure, onSuccess: onSuccess, headers: headers, body: body); if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simplePut(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
headers: headers,
body: body);
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode); onFailure!('Error While Fetching data', statusCode);
@ -660,12 +803,16 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} }
simpleDelete(String fullUrl, simpleDelete(String fullUrl,
{Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map<String, String>? queryParams, Map<String, String>? headers}) async { {Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
Map<String, String>? queryParams,
Map<String, String>? headers}) async {
String url = fullUrl; String url = fullUrl;
// print("URL Query String: $url"); // print("URL Query String: $url");
@ -677,7 +824,8 @@ class BaseAppClient {
} }
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
headers!.addAll({'Content-Type': 'application/json', 'Accept': 'application/json'}); headers!.addAll(
{'Content-Type': 'application/json', 'Accept': 'application/json'});
final response = await http.delete( final response = await http.delete(
Uri.parse(url.trim()), Uri.parse(url.trim()),
headers: headers, headers: headers,
@ -685,7 +833,12 @@ class BaseAppClient {
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");
if (await handleUnauthorized(statusCode, forUrl: fullUrl)) simpleDelete(fullUrl, onFailure: onFailure, onSuccess: onSuccess, queryParams: queryParams, headers: headers); if (await handleUnauthorized(statusCode, forUrl: fullUrl))
simpleDelete(fullUrl,
onFailure: onFailure,
onSuccess: onSuccess,
queryParams: queryParams,
headers: headers);
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure!('Error While Fetching data', statusCode); onFailure!('Error While Fetching data', statusCode);
@ -695,11 +848,13 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} }
Future<bool> handleUnauthorized(int statusCode, {required String forUrl}) async { Future<bool> handleUnauthorized(int statusCode,
{required String forUrl}) async {
if (forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) { if (forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) {
final token = await generatePackagesToken(); final token = await generatePackagesToken();
packagesAuthHeader['Authorization'] = 'Bearer $token'; packagesAuthHeader['Authorization'] = 'Bearer $token';
@ -712,8 +867,10 @@ class BaseAppClient {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID);
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false; Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); false;
var model =
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
model.setState(0, 0, false, null); model.setState(0, 0, false, null);
@ -728,7 +885,8 @@ class BaseAppClient {
static defaultHttpParameters() async { static defaultHttpParameters() async {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
var params = {}; var params = {};
if (user != null) { if (user != null) {
@ -748,7 +906,11 @@ class BaseAppClient {
} }
pharmacyPost(String endPoint, pharmacyPost(String endPoint,
{Map<String, dynamic>? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async { {Map<String, dynamic>? body,
Function(dynamic response, int statusCode)? onSuccess,
Function(String error, int statusCode)? onFailure,
bool isAllowAny = false,
bool isExternal = false}) async {
var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var token = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
String url; String url;
@ -760,7 +922,8 @@ class BaseAppClient {
try { try {
if (isExternal) { if (isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); var languageID =
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body!.containsKey('SetupID')) { if (body!.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -783,7 +946,8 @@ class BaseAppClient {
: user['OutSA']; : user['OutSA'];
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') body['isDentalAllowedBackend'] =
body.containsKey('isDentalAllowedBackend')
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] ? body['isDentalAllowedBackend']
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND
@ -810,7 +974,9 @@ class BaseAppClient {
: user['PatientType']; : user['PatientType'];
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID']; body['PatientID'] = body['PatientID'] != null
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
// body['SessionID'] = SESSION_ID; //getSessionId(token); // body['SessionID'] = SESSION_ID; //getSessionId(token);
} }
@ -822,11 +988,14 @@ class BaseAppClient {
var ss = json.encode(body); var ss = json.encode(body);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: { final response = await http
.post(Uri.parse(url.trim()), body: json.encode(body), headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Mobilenumber': user != null
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}); });
@ -834,8 +1003,15 @@ class BaseAppClient {
// print("statusCode :$statusCode"); // print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
onFailure!(parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); parsed['error']['ErrorEndUserMsgN'] ??
'Error While Fetching data',
statusCode);
logApiEndpointError(
endPoint,
parsed['error']['ErrorEndUserMsgN'] ??
'Error While Fetching data',
statusCode);
} else { } else {
// var parsed = json.decode(response.body.toString()); // var parsed = json.decode(response.body.toString());
var parsed = json.decode(utf8.decode(response.bodyBytes)); var parsed = json.decode(utf8.decode(response.bodyBytes));
@ -843,7 +1019,8 @@ class BaseAppClient {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); navigateToAppUpdate(
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
@ -858,25 +1035,47 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else { } else {
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { } else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { } else if (parsed['MessageStatus'] == 2 &&
if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { parsed['IsAuthenticated']) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure!("Server Error found with no available message", statusCode); onFailure!("Server Error found with no available message",
logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); statusCode);
logApiEndpointError(
endPoint,
"Server Error found with no available message",
statusCode);
} else { } else {
onFailure!(parsed['ErrorSearchMsg'], statusCode); onFailure!(parsed['ErrorSearchMsg'], statusCode);
logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode); logApiEndpointError(
endPoint, parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
await logout(); await logout();
@ -887,11 +1086,18 @@ class BaseAppClient {
onSuccess!(parsed, statusCode); onSuccess!(parsed, statusCode);
} else { } else {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure!(parsed['message'] ?? parsed['message'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); parsed['message'] ?? parsed['message'], statusCode);
logApiEndpointError(endPoint,
parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); onFailure!(
logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logApiEndpointError(
endPoint,
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -899,7 +1105,8 @@ class BaseAppClient {
} }
} else { } else {
onFailure!('Please Check The Internet Connection', -1); onFailure!('Please Check The Internet Connection', -1);
_analytics.errorTracking.log("internet_connectivity", error: "no internet available"); _analytics.errorTracking
.log("internet_connectivity", error: "no internet available");
} }
} catch (e) { } catch (e) {
print(e); print(e);
@ -911,11 +1118,15 @@ class BaseAppClient {
Future<String> generatePackagesToken() async { Future<String> generatePackagesToken() async {
var url = EXA_CART_API_BASE_URL + PACKAGES_TOKEN; var url = EXA_CART_API_BASE_URL + PACKAGES_TOKEN;
var body = { var body = {
"api_client": {"client_id": "a4ab6be4-424f-4836-b032-46caed88e184", "client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"} "api_client": {
"client_id": "a4ab6be4-424f-4836-b032-46caed88e184",
"client_secret": "3c1a3e07-4a40-4510-9fb0-ee5f0a72752c"
}
}; };
String? token; String? token;
final completer = Completer(); final completer = Completer();
simplePost(url, body: body, headers: {}, onSuccess: (dynamic stringResponse, int statusCode) { simplePost(url, body: body, headers: {},
onSuccess: (dynamic stringResponse, int statusCode) {
if (statusCode == 200) { if (statusCode == 200) {
var jsonResponse = json.decode(stringResponse); var jsonResponse = json.decode(stringResponse);
token = jsonResponse['auth_token']; token = jsonResponse['auth_token'];

@ -102,11 +102,14 @@ class LabsViewModel extends BaseViewModel {
List<LabResultList> patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList(); List<LabResultList> patientLabOrdersClinic = labResultLists.where((elementClinic) => elementClinic.filterName == element.testCode).toList();
if (patientLabOrdersClinic.length != 0) { if (patientLabOrdersClinic.length != 0) {
var value = labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] // var value = labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])]
.patientLabResultList! // .patientLabResultList!
.where((e) => e.sampleCollectedOn == element.sampleCollectedOn && e.resultValue == element.resultValue) // .where((e) {
.toList(); // return e.sampleCollectedOn == element.sampleCollectedOn && e.resultValue == element.resultValue;
if (value.isEmpty) labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element); // })
// .toList();
// if (value.isEmpty)
labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])].patientLabResultList!.add(element);
} else { } else {
labResultLists.add(LabResultList(filterName: element.testCode, lab: element)); labResultLists.add(LabResultList(filterName: element.testCode, lab: element));
} }

@ -32,13 +32,13 @@ class SelectDeviceIMEIRES {
SelectDeviceIMEIRES.fromJson(Map<String, dynamic> json) { SelectDeviceIMEIRES.fromJson(Map<String, dynamic> json) {
biometricEnabled = json['BiometricEnabled']; biometricEnabled = json['BiometricEnabled'];
createdOn = json['CreatedOn']; createdOn = json['CreatedOn'].toString();
editedOn = json['EditedOn']; editedOn = json['EditedOn'].toString();
iD = json['ID']; iD = json['ID'];
iMEI = json['IMEI']; iMEI = json['IMEI'];
identificationNo = json['IdentificationNo']; identificationNo = json['IdentificationNo'].toString();
logInType = json['LogInType']; logInType = json['LogInType'];
mobile = json['Mobile']; mobile = json['Mobile'].toString();
name = json['Name']; name = json['Name'];
nameN = json['NameN']; nameN = json['NameN'];
outSA = json['OutSA']; outSA = json['OutSA'];
@ -65,4 +65,9 @@ class SelectDeviceIMEIRES {
data['PreferredLanguage'] = this.preferredLanguage; data['PreferredLanguage'] = this.preferredLanguage;
return data; return data;
} }
@override
String toString() {
return 'SelectDeviceIMEIRES{biometricEnabled: $biometricEnabled, createdOn: $createdOn, editedOn: $editedOn, iD: $iD, iMEI: $iMEI, identificationNo: $identificationNo, logInType: $logInType, mobile: $mobile, name: $name, nameN: $nameN, outSA: $outSA, patientID: $patientID, patientType: $patientType, preferredLanguage: $preferredLanguage}';
}
} }

@ -6,15 +6,12 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart'; import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart';
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
@ -34,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
class AnicllaryOrdersDetails extends StatefulWidget { class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo; final dynamic appoNo;
@ -51,7 +47,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
bool _agreeTerms = false; bool _agreeTerms = false;
String selectedPaymentMethod = ""; String selectedPaymentMethod = "";
MyInAppBrowser? browser; late MyInAppBrowser browser;
String transID = ""; String transID = "";
late BuildContext localContext; late BuildContext localContext;
String? selectedInstallmentPlan; String? selectedInstallmentPlan;
@ -483,7 +479,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return total.toStringAsFixed(2); return total.toStringAsFixed(2);
} }
bool checkIfProcedureSelected(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { bool checkIfProcedureSelected(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if (selectedProcList.length > 0) { if (selectedProcList.length > 0) {
if (selectedProcList.contains(ancillaryOrderProcDetailsList)) { if (selectedProcList.contains(ancillaryOrderProcDetailsList)) {
@ -495,6 +490,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return false; return false;
} }
} }
bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) { bool isProcedureDisabled(AncillaryOrderProcDetailsList ancillaryOrderProcDetailsList) {
if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) || if ((ancillaryOrderProcDetailsList.isApprovalRequired! && !ancillaryOrderProcDetailsList.isApprovalCreated!) ||
(ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) || (ancillaryOrderProcDetailsList.isApprovalCreated! && ancillaryOrderProcDetailsList.approvalNo == 0) ||
@ -504,6 +500,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return false; return false;
} }
} }
addToSelectedProcedures() { addToSelectedProcedures() {
if (_ancillaryProcLists.isNotEmpty) { if (_ancillaryProcLists.isNotEmpty) {
selectedProcList.clear(); selectedProcList.clear();
@ -594,10 +591,10 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
if (projectViewModel.havePrivilege(103)) { if (projectViewModel.havePrivilege(103)) {
startApplePay(); startApplePay();
} else { } else {
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan);
} }
} else { } else {
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), AppoitmentAllHistoryResultList(), selectedInstallmentPlan);
} }
}, },
patientShare: double.parse(getTotalValue()), patientShare: double.parse(getTotalValue()),
@ -693,7 +690,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!); transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID!);
browser!.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Ancillary Orders Payment", "Ancillary Orders Payment",
transID, transID,
@ -704,7 +701,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
projectViewModel.user.patientID, projectViewModel.user.patientID,
authenticatedUser, authenticatedUser,
browser!, browser,
false, false,
"3", "3",
// Need to get new Service ID from Ayman for Ancillary Tamara // Need to get new Service ID from Ayman for Ancillary Tamara
@ -735,7 +732,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser!.isOpened()) browser!.close(); if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = true; MyInAppBrowser.isPaymentDone = true;
return; return;
} }
@ -743,7 +740,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser!.isOpened()) browser!.close(); if (browser.isOpened()) browser.close();
MyInAppBrowser.isPaymentDone = false; MyInAppBrowser.isPaymentDone = false;
return; return;
} }
@ -860,7 +857,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
GifLoaderDialogUtils.showMyDialog(localContext); GifLoaderDialogUtils.showMyDialog(localContext);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, localContext).then((res) { service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, projectViewModel.isArabic ? 1 : 2, localContext).then((res) {
GifLoaderDialogUtils.hideDialog(localContext); GifLoaderDialogUtils.hideDialog(localContext);
showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo'], widget.projectID); showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo'], widget.projectID);
}).catchError((err) { }).catchError((err) {
@ -881,8 +878,4 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false); Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
}).showAlertDialog(context); }).showAlertDialog(context);
} }
} }

@ -61,11 +61,11 @@ class _H2oSettingState extends State<H2oSetting> {
_weightValue = _userDetailModel?.weight ?? 50; _weightValue = _userDetailModel?.weight ?? 50;
_heightController.text = _heightValue.toStringAsFixed(0); _heightController.text = _heightValue.toStringAsFixed(0);
_weightController.text = _weightValue.toStringAsFixed(0); _weightController.text = _weightValue.toStringAsFixed(0);
_nameController.text = _userDetailModel.firstName!; _nameController.text = _userDetailModel.firstName ?? "";
_isWeightKG = _userDetailModel?.isWeightInKG ?? true; _isWeightKG = _userDetailModel?.isWeightInKG ?? true;
_isHeightCM = _userDetailModel?.isHeightInCM ?? true; _isHeightCM = _userDetailModel?.isHeightInCM ?? true;
_isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false; _isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false;
_dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB!); _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB ?? DateUtil.convertDateToString(DateTime.now()));
_selectedActiveLevel = _userDetailModel.activityID ?? 1; _selectedActiveLevel = _userDetailModel.activityID ?? 1;
readPrefs(); readPrefs();
} }

@ -72,9 +72,9 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
} }
void calculateCalories() { void calculateCalories() {
if (isMale == true) { if (isMale == true && int.parse(ageController.text) <121) {
calories = 66.5 + (13.75 * int.parse(_weightController.text)) + (5.003 * int.parse(_heightController.text)) - (6.755 * int.parse(ageController.text)); calories = 66.5 + (13.75 * int.parse(_weightController.text)) + (5.003 * int.parse(_heightController.text)) - (6.755 * int.parse(ageController.text));
} else if (isMale == false) { } else if (isMale == false && int.parse(ageController.text) <121) {
calories = 655.0955 + (9.5634 * int.parse(_weightController.text)) + (1.850 * int.parse(_heightController.text)) - (4.676 * int.parse(ageController.text)); calories = 655.0955 + (9.5634 * int.parse(_weightController.text)) + (1.850 * int.parse(_heightController.text)) - (4.676 * int.parse(ageController.text));
} }
} }
@ -344,11 +344,13 @@ class _CalorieCalculatorState extends State<CalorieCalculator> {
color: Colors.white, color: Colors.white,
child: SecondaryButton( child: SecondaryButton(
label: TranslationBase.of(context).calculate, label: TranslationBase.of(context).calculate,
color: CustomColors.accentColor, color: ageController.text.isNotEmpty ? int.parse(ageController.text) >120 ? Colors.grey : CustomColors.accentColor : CustomColors.accentColor,
onTap: () { onTap: () {
if(ageController.text.isNotEmpty && int.parse(ageController.text) <121 && int.parse(_heightController.text)<250 && int.parse(_weightController.text) <200)
setState(() { setState(() {
calculateCalories(); calculateCalories();
print(calories);
{ {
Navigator.push( Navigator.push(
context, context,

@ -13,6 +13,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:percent_indicator/circular_percent_indicator.dart';
import '../../../../uitl/app_toast.dart';
class CalorieResultPage extends StatelessWidget { class CalorieResultPage extends StatelessWidget {
final double calorie; final double calorie;
@ -118,8 +120,8 @@ class CalorieResultPage extends StatelessWidget {
service.getCalculationDoctors(calculationID: 2).then((res) { service.getCalculationDoctors(calculationID: 2).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['List_CalculationTable'].length);
if (res['MessageStatus'] == 1) { if (res!=null && res['MessageStatus'] == 1) {
if (res['List_CalculationTable'].length != 0) { if (res['List_CalculationTable'].length != 0) {
res['List_CalculationTable'].forEach((item) { res['List_CalculationTable'].forEach((item) {
DoctorList docList = new DoctorList(); DoctorList docList = new DoctorList();
@ -157,7 +159,8 @@ class CalorieResultPage extends StatelessWidget {
} }
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err); print(err);
}); });
} }

@ -31,7 +31,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart'; import '../../config/shared_pref_kay.dart';
@ -42,7 +41,7 @@ class BookSuccess extends StatefulWidget {
DoctorList docObject; DoctorList docObject;
late MyInAppBrowser browser; late MyInAppBrowser browser;
final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser());
String appoDateFormatted; String appoDateFormatted;
String appoTimeFormatted; String appoTimeFormatted;
@ -70,9 +69,7 @@ class _BookSuccessState extends State<BookSuccess> {
initState() { initState() {
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
if (widget.patientShareResponse.isLiveCareAppointment! && if (widget.patientShareResponse.isLiveCareAppointment! &&
(widget.patientShareResponse.patientShareWithTax.toString() == "0" || (widget.patientShareResponse.patientShareWithTax.toString() == "0" || widget.patientShareResponse.patientShareWithTax.toString() == "0.0")) {
widget.patientShareResponse.patientShareWithTax.toString() ==
"0.0")) {
setOnlineCheckInForAppointment(); setOnlineCheckInForAppointment();
} }
}); });
@ -116,26 +113,18 @@ class _BookSuccessState extends State<BookSuccess> {
alignment: Alignment.center, alignment: Alignment.center,
color: CustomColors.green, color: CustomColors.green,
child: Table( child: Table(
border: TableBorder(verticalInside: BorderSide( border: TableBorder(verticalInside: BorderSide(width: 0.5, color: Colors.white)),
width: 0.5, color: Colors.white)),
children: [ children: [
TableRow( TableRow(
children: [ children: [
TableCell(child: _getNormalText(TranslationBase TableCell(child: _getNormalText(TranslationBase.of(context).patientShare)),
.of(context) TableCell(child: _getNormalText(TranslationBase.of(context).patientShareWithTax)),
.patientShare)),
TableCell(child: _getNormalText(TranslationBase
.of(context)
.patientShareWithTax)),
], ],
), ),
TableRow( TableRow(
children: [ children: [
TableCell(child: _getHeadingText("SR " + TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShare.toString())),
widget.patientShareResponse.patientShare.toString())), TableCell(child: _getHeadingText("SR " + widget.patientShareResponse.patientShareWithTax.toString())),
TableCell(child: _getHeadingText("SR " +
widget.patientShareResponse.patientShareWithTax
.toString())),
], ],
), ),
], ],
@ -178,10 +167,7 @@ class _BookSuccessState extends State<BookSuccess> {
return Container( return Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.all(14), margin: EdgeInsets.all(14),
height: MediaQuery height: MediaQuery.of(context).size.height * 0.18,
.of(context)
.size
.height * 0.18,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
@ -193,10 +179,7 @@ class _BookSuccessState extends State<BookSuccess> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery minWidth: MediaQuery.of(context).size.width * 0.7,
.of(context)
.size
.width * 0.7,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
@ -205,10 +188,7 @@ class _BookSuccessState extends State<BookSuccess> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
getAppoQR(context); getAppoQR(context);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)),
.of(context)
.checkinOptions,
style: TextStyle(fontSize: 18.0, color: Colors.white)),
), ),
), ),
), ),
@ -219,10 +199,7 @@ class _BookSuccessState extends State<BookSuccess> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery minWidth: MediaQuery.of(context).size.width * 0.7,
.of(context)
.size
.width * 0.7,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: Color(0xffc5272d), backgroundColor: Color(0xffc5272d),
@ -232,10 +209,7 @@ class _BookSuccessState extends State<BookSuccess> {
// GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
// getAppoQR(context); // getAppoQR(context);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)),
.of(context)
.done,
style: TextStyle(fontSize: 18.0, color: Colors.white)),
), ),
), ),
), ),
@ -270,16 +244,9 @@ class _BookSuccessState extends State<BookSuccess> {
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
startPaymentProcess(); startPaymentProcess();
projectViewModel.analytics.appointment projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true);
.pay_now_for_appointment(
appointment_type: 'regular',
doctorDetail: widget.docObject,
payNow: true);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).payNow.toUpperCase(),
.of(context)
.payNow
.toUpperCase(),
style: TextStyle( style: TextStyle(
fontSize: 18.0, fontSize: 18.0,
color: Colors.white, color: Colors.white,
@ -300,17 +267,9 @@ class _BookSuccessState extends State<BookSuccess> {
elevation: 0, elevation: 0,
onPressed: () { onPressed: () {
navigateToHome(context); navigateToHome(context);
projectViewModel.analytics.appointment projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
.pay_now_for_appointment(
appointment_type: 'regular',
doctorDetail: widget.docObject,
payNow: false);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
.of(context)
.payLater
.toUpperCase(), style: TextStyle(
fontSize: 18.0, color: Colors.white)),
), ),
), ),
), ),
@ -321,9 +280,7 @@ class _BookSuccessState extends State<BookSuccess> {
children: [ children: [
mHeight(10.0), mHeight(10.0),
Text( Text(
TranslationBase TranslationBase.of(context).cashAmountUpdateInsurance,
.of(context)
.cashAmountUpdateInsurance,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -332,9 +289,7 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
mHeight(5.0), mHeight(5.0),
DefaultButton( DefaultButton(
TranslationBase TranslationBase.of(context).updateInsuranceText,
.of(context)
.updateInsuranceText,
() { () {
Navigator.pop(context, null); Navigator.pop(context, null);
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
@ -380,23 +335,17 @@ class _BookSuccessState extends State<BookSuccess> {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
appo.appointmentNo = appo.appointmentNo = widget.patientShareResponse.appointmentNo;
widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
appo.appointmentDate = appo.appointmentDate = widget.patientShareResponse.appointmentDate;
widget.patientShareResponse.appointmentDate;
if (appo.isLiveCareAppointment!) if (appo.isLiveCareAppointment!)
insertLiveCareVIDARequest(appo); insertLiveCareVIDARequest(appo);
else else
navigateToHome(context); navigateToHome(context);
}, },
child: Text(TranslationBase child: Text(TranslationBase.of(context).confirmLater, style: TextStyle(fontSize: 16.0, color: Colors.white)),
.of(context)
.confirmLater,
style: TextStyle(fontSize: 16.0, color: Colors.white)),
), ),
), ),
), ),
@ -415,11 +364,9 @@ class _BookSuccessState extends State<BookSuccess> {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
appo.appointmentNo = appo.appointmentNo = widget.patientShareResponse.appointmentNo;
widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
if (appo.isLiveCareAppointment!) { if (appo.isLiveCareAppointment!) {
navigateToHome(context); navigateToHome(context);
@ -427,13 +374,7 @@ class _BookSuccessState extends State<BookSuccess> {
confirmAppointment(appo); confirmAppointment(appo);
} }
}, },
child: Text(widget.patientShareResponse.isLiveCareAppointment! child: Text(widget.patientShareResponse.isLiveCareAppointment! ? TranslationBase.of(context).confirmLiveCare : TranslationBase.of(context).confirm,
? TranslationBase
.of(context)
.confirmLiveCare
: TranslationBase
.of(context)
.confirm,
style: TextStyle(fontSize: 16.0, color: Colors.white)), style: TextStyle(fontSize: 16.0, color: Colors.white)),
), ),
), ),
@ -503,10 +444,7 @@ class _BookSuccessState extends State<BookSuccess> {
Container( Container(
margin: EdgeInsets.only(top: 30.0, bottom: 40.0), margin: EdgeInsets.only(top: 30.0, bottom: 40.0),
alignment: Alignment.center, alignment: Alignment.center,
child: Text(TranslationBase child: Text(TranslationBase.of(context).confirmAppo, style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
.of(context)
.confirmAppo,
style: TextStyle(fontSize: 18.0, letterSpacing: 0.8)),
), ),
Flex( Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
@ -520,14 +458,8 @@ class _BookSuccessState extends State<BookSuccess> {
children: <Widget>[ children: <Widget>[
_getBulletPoint("1"), _getBulletPoint("1"),
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 0.8,
.of(context) child: Text(TranslationBase.of(context).upcomingConfirm, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)),
.size
.width * 0.8,
child: Text(TranslationBase
.of(context)
.upcomingConfirm, overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
), ),
], ],
), ),
@ -547,14 +479,8 @@ class _BookSuccessState extends State<BookSuccess> {
children: <Widget>[ children: <Widget>[
_getBulletPoint("2"), _getBulletPoint("2"),
Container( Container(
width: MediaQuery width: MediaQuery.of(context).size.width * 0.8,
.of(context) child: Text(TranslationBase.of(context).upcomingConfirmMore, overflow: TextOverflow.clip, style: TextStyle(fontSize: 13.0)),
.size
.width * 0.8,
child: Text(TranslationBase
.of(context)
.upcomingConfirmMore, overflow: TextOverflow.clip,
style: TextStyle(fontSize: 13.0)),
), ),
], ],
), ),
@ -562,8 +488,7 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
], ],
), ),
Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), Container(margin: EdgeInsets.fromLTRB(20.0, 20.0, 20.0, 5.0), child: getPaymentMethods()),
child: getPaymentMethods()),
], ],
); );
} }
@ -575,17 +500,13 @@ class _BookSuccessState extends State<BookSuccess> {
setOnlineCheckInForAppointment() { setOnlineCheckInForAppointment() {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.setOnlineCheckInForAppointment( service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID!, projectViewModel.isArabic ? 1 : 2, context).then((res) {
widget.patientShareResponse.appointmentNo.toString(),
widget.patientShareResponse.projectID!,
projectViewModel.isArabic ? 1 : 2, context).then((res) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
appo.appointmentDate = widget.patientShareResponse.appointmentDate; appo.appointmentDate = widget.patientShareResponse.appointmentDate;
insertLiveCareVIDARequest(appo, isMoveHome: false); insertLiveCareVIDARequest(appo, isMoveHome: false);
@ -600,9 +521,7 @@ class _BookSuccessState extends State<BookSuccess> {
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.confirmAppointment( service.confirmAppointment(appo.appointmentNo!, appo.clinicID!, appo.projectID!, appo.isLiveCareAppointment!, context).then((res) {
appo.appointmentNo!, appo.clinicID!, appo.projectID!,
appo.isLiveCareAppointment!, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
@ -621,22 +540,12 @@ class _BookSuccessState extends State<BookSuccess> {
}); });
} }
insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo, {bool isMoveHome = true}) {
{bool isMoveHome = true}) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.insertVIDARequest( .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!,
appo.appointmentNo, Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
appo.clinicID,
appo.projectID,
appo.serviceID,
appo.doctorID,
appo.appointmentDate!,
Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo),
projectViewModel.isArabic ? 1 : 2,
context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -659,9 +568,7 @@ class _BookSuccessState extends State<BookSuccess> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Text( Text(
TranslationBase TranslationBase.of(context).payNowBookSuccess,
.of(context)
.payNowBookSuccess,
style: TextStyle( style: TextStyle(
fontSize: 24.0, fontSize: 24.0,
letterSpacing: -1.44, letterSpacing: -1.44,
@ -669,9 +576,7 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
), ),
Text( Text(
TranslationBase TranslationBase.of(context).neverWait,
.of(context)
.neverWait,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.54, letterSpacing: -0.54,
@ -679,20 +584,15 @@ class _BookSuccessState extends State<BookSuccess> {
), ),
), ),
mHeight(24), mHeight(24),
Text(TranslationBase Text(TranslationBase.of(context).payNowBookSuccesstext1,
.of(context)
.payNowBookSuccesstext1,
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
letterSpacing: -0.36, letterSpacing: -0.36,
)), )),
Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), Container(margin: EdgeInsets.fromLTRB(20.0, 5.0, 20.0, 5.0), child: getPaymentMethods()),
child: getPaymentMethods()),
Text( Text(
TranslationBase TranslationBase.of(context).payNowBookSuccesstext2,
.of(context)
.payNowBookSuccesstext2,
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
style: TextStyle( style: TextStyle(
fontSize: 12.0, fontSize: 12.0,
@ -708,16 +608,14 @@ class _BookSuccessState extends State<BookSuccess> {
navigateToPaymentMethod(context, widget.patientShareResponse); navigateToPaymentMethod(context, widget.patientShareResponse);
} }
Future navigateToPaymentMethod(context, Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async {
PatientShareResponse patientShareResponse) async {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientShareResponse.projectID; appo.projectID = widget.patientShareResponse.projectID;
appo.clinicID = widget.patientShareResponse.clinicID; appo.clinicID = widget.patientShareResponse.clinicID;
appo.clinicName = widget.patientShareResponse.clinicName; appo.clinicName = widget.patientShareResponse.clinicName;
appo.projectName = widget.patientShareResponse.projectName; appo.projectName = widget.patientShareResponse.projectName;
appo.appointmentNo = widget.patientShareResponse.appointmentNo; appo.appointmentNo = widget.patientShareResponse.appointmentNo;
appo.isLiveCareAppointment = appo.isLiveCareAppointment = widget.patientShareResponse.isLiveCareAppointment;
widget.patientShareResponse.isLiveCareAppointment;
appo.doctorID = widget.patientShareResponse.doctorID; appo.doctorID = widget.patientShareResponse.doctorID;
appo.appointmentDate = widget.patientShareResponse.appointmentDate; appo.appointmentDate = widget.patientShareResponse.appointmentDate;
appo.serviceID = widget.patientShareResponse.serviceID; appo.serviceID = widget.patientShareResponse.serviceID;
@ -726,8 +624,7 @@ class _BookSuccessState extends State<BookSuccess> {
context, context,
FadePage( FadePage(
page: PaymentMethod( page: PaymentMethod(
onSelectedMethod: (String metohd, onSelectedMethod: (String metohd, [String? selectedInstallmentPlan]) {
[String? selectedInstallmentPlan]) {
setState(() {}); setState(() {});
}, },
patientShare: widget.patientShareResponse.patientShareWithTax))) patientShare: widget.patientShareResponse.patientShareWithTax)))
@ -748,10 +645,8 @@ class _BookSuccessState extends State<BookSuccess> {
}); });
} }
void startApplePay(AppoitmentAllHistoryResultList appo, void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async {
PatientShareResponse patientShareResponse) async { transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
transID = Utils.getAppointmentTransID(
appo.projectID, appo.clinicID, appo.appointmentNo);
print("TransactionID: $transID"); print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -759,10 +654,7 @@ class _BookSuccessState extends State<BookSuccess> {
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest(); ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel? payfortProjectDetailsRespModel; PayfortProjectDetailsRespModel? payfortProjectDetailsRespModel;
await context.read<PayfortViewModel>() await context.read<PayfortViewModel>().getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()).then((value) {
.getProjectDetailsForPayfort(projectId: appo.projectID,
serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum())
.then((value) {
payfortProjectDetailsRespModel = value!; payfortProjectDetailsRespModel = value!;
}); });
@ -788,8 +680,7 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0"; applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = applePayInsertRequest.amount = patientShareResponse.patientShareWithTax.toString();
patientShareResponse.patientShareWithTax.toString();
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0"; applePayInsertRequest.isSchedule = appo.isLiveCareAppointment! ? "1" : "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
@ -800,20 +691,15 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest.isMobSDK = true; applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID; applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel!.merchantIdentifier!;
payfortProjectDetailsRespModel!.merchantIdentifier!;
applePayInsertRequest.commandType = "PURCHASE"; applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel!.signature; applePayInsertRequest.signature = payfortProjectDetailsRespModel!.signature;
applePayInsertRequest.accessCode = applePayInsertRequest.accessCode = payfortProjectDetailsRespModel!.accessCode;
payfortProjectDetailsRespModel!.accessCode; applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel!.shaRequest;
applePayInsertRequest.shaRequestPhrase = applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel!.shaResponse;
payfortProjectDetailsRespModel!.shaRequest;
applePayInsertRequest.shaResponsePhrase =
payfortProjectDetailsRespModel!.shaResponse;
applePayInsertRequest.returnURL = ""; applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then(( service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort( await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
@ -842,7 +728,6 @@ class _BookSuccessState extends State<BookSuccess> {
}); });
} }
openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];

@ -1,6 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
@ -15,7 +14,6 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -39,7 +37,7 @@ class BookReminderPage extends StatefulWidget {
class _BookReminderPageState extends State<BookReminderPage> { class _BookReminderPageState extends State<BookReminderPage> {
late MyInAppBrowser browser; late MyInAppBrowser browser;
final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser()); // final ChromeSafariBrowser chromeBrowser = new MyChromeSafariBrowser(new MyInAppBrowser());
String? selectedTime; String? selectedTime;
bool isSuccessShow = true; bool isSuccessShow = true;
@ -189,20 +187,11 @@ class _BookReminderPageState extends State<BookReminderPage> {
backgroundColor: CustomColors.green, backgroundColor: CustomColors.green,
elevation: 0, elevation: 0,
onPressed: () async { onPressed: () async {
showReminderDialog( showReminderDialog(context, widget.dateTime!, widget.docObject.name!, widget.patientShareResponse.appointmentNo.toString(), widget.appoDateFormatted, widget.appoTimeFormatted,
context,
widget.dateTime!,
widget.docObject.name!,
widget.patientShareResponse.appointmentNo.toString(),
widget.appoDateFormatted,
widget.appoTimeFormatted,
onSuccess: () { onSuccess: () {
AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess);
navigateToBookSuccess(context); navigateToBookSuccess(context);
}, }, title: null, description: null);
title: null,
description: null
);
projectViewModel.analytics.appointment.appointment_reminder(true); projectViewModel.analytics.appointment.appointment_reminder(true);
}, },
child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)), child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)),

@ -197,6 +197,7 @@ class _SummaryState extends State<Summary> {
TranslationBase.of(context).submit, TranslationBase.of(context).submit,
() async { () async {
await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC); await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC);
widget.tabController.animateTo(1);
}, },
color: CustomColors.green, color: CustomColors.green,
), ),

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
@ -35,14 +37,11 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart';
import 'package:huawei_map/huawei_map.dart' as hmsMap;
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:map_launcher/map_launcher.dart'; import 'package:map_launcher/map_launcher.dart';
import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
import 'dart:io';
import 'package:huawei_map/huawei_map.dart' as hmsMap;
class AppointmentActions extends StatefulWidget { class AppointmentActions extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
@ -466,7 +465,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
static Future<void> openMap(double latitude, double longitude) async { static Future<void> openMap(double latitude, double longitude) async {
await MapLauncher.showMarker( await MapLauncher.showMarker(
mapType: Platform.isAndroid ? isHuawei == true ? MapType.petal: MapType.google : MapType.apple, mapType: Platform.isAndroid
? isHuawei == true
? MapType.petal
: MapType.google
: MapType.apple,
coords: Coords(latitude, longitude), coords: Coords(latitude, longitude),
title: "Sulaiman Al Habib", title: "Sulaiman Al Habib",
description: "Appointment Location", description: "Appointment Location",
@ -482,6 +485,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
print(isHuawei); print(isHuawei);
} }
} }
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
@ -541,8 +545,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
barrierDismissible: true, barrierDismissible: true,
barrierLabel: '', barrierLabel: '',
context: context, context: context,
pageBuilder: (context, animation1, animation2) =>SizedBox()) pageBuilder: (context, animation1, animation2) => SizedBox()).then((value) {
.then((value) {
print("Dialog Closed"); print("Dialog Closed");
print(value); print(value);
if (value != null) { if (value != null) {
@ -661,7 +664,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
rateAppointment() { rateAppointment() {
widget.browser = new MyInAppBrowser(); widget.browser = new MyInAppBrowser(onExitCallback: () {});
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';
print(url); print(url);
launch(url); launch(url);

@ -47,7 +47,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart'; import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -55,7 +54,7 @@ import 'package:provider/provider.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse? patientShareResponse; PatientShareResponse? patientShareResponse;
var languageID; var languageID;
MyInAppBrowser? browser; // MyInAppBrowser? browser;
bool? isShowAppBar = true; bool? isShowAppBar = true;
Function()? onBackClick; Function()? onBackClick;
bool? isFromMyAppointments; bool? isFromMyAppointments;
@ -1089,7 +1088,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
projectViewModel.analytics.todoList.to_do_list_pay_now(appo); projectViewModel.analytics.todoList.to_do_list_pay_now(appo);
} }
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
browser?.openPaymentBrowser( browser?.openPaymentBrowser(
@ -1103,8 +1102,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser.firstName!, authenticatedUser.firstName!,
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
widget!.browser!, browser!,
appo.isLiveCareAppointment!, appo.isLiveCareAppointment ?? false,
"2", "2",
appo.isLiveCareAppointment! ? widget.patientShareResponse!.clinicID.toString() : "", appo.isLiveCareAppointment! ? widget.patientShareResponse!.clinicID.toString() : "",
context, context,
@ -1308,7 +1307,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) { addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context).then((res) { service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate!, transID!, projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}).catchError((err) { }).catchError((err) {

@ -22,7 +22,8 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart'; import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'
as family;
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart'; import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
@ -74,7 +75,8 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver { class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var authProvider = new AuthProvider(); var authProvider = new AuthProvider();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
int currentTab = 0; int currentTab = 0;
late PageController pageController; late PageController pageController;
@ -91,7 +93,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
bool _showBottomNavigationBar = true; bool _showBottomNavigationBar = true;
///inject the user data ///inject the user data
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance;
final authService = new AuthProvider(); final authService = new AuthProvider();
@ -118,17 +121,22 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
"appointmentdate": "2022-01-19", "appointmentdate": "2022-01-19",
"appointmenttime": "12:10", "appointmenttime": "12:10",
"PatientName": "Testing", "PatientName": "Testing",
"session_id": "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg", "session_id":
"1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg",
"token": "token":
"T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9OGMyY2IyYWFiZmZmMzI4ZmEwMjgxNDdmMGFhZGI0N2JiZjdmZWY4MjpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTBOekkxTmpZeE5ESTJPWDV5U1hobFZqWmphbTEzUkZkTVZtZGxlV1ZzU0RoelFreC1mZyZjcmVhdGVfdGltZT0xNjQ3MjU2NjE0Jm5vbmNlPTAuMjgzNDgyNjM1NDczNjQ2OCZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjQ3MjU4NDE0JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9", "T1==cGFydG5lcl9pZD00NjIwOTk2MiZzaWc9OGMyY2IyYWFiZmZmMzI4ZmEwMjgxNDdmMGFhZGI0N2JiZjdmZWY4MjpzZXNzaW9uX2lkPTFfTVg0ME5qSXdPVGsyTW41LU1UWTBOekkxTmpZeE5ESTJPWDV5U1hobFZqWmphbTEzUkZkTVZtZGxlV1ZzU0RoelFreC1mZyZjcmVhdGVfdGltZT0xNjQ3MjU2NjE0Jm5vbmNlPTAuMjgzNDgyNjM1NDczNjQ2OCZyb2xlPW1vZGVyYXRvciZleHBpcmVfdGltZT0xNjQ3MjU4NDE0JmluaXRpYWxfbGF5b3V0X2NsYXNzX2xpc3Q9",
"DoctorImageURL": "https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg", "DoctorImageURL":
"https://image.shutterstock.com/image-vector/sample-stamp-square-grunge-sign-260nw-1474408826.jpg",
"callerID": "9920", "callerID": "9920",
"PatientID": "1231755", "PatientID": "1231755",
"is_call": "true" "is_call": "true"
}; };
void _requestIOSPermissions() { void _requestIOSPermissions() {
flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions( flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true, alert: true,
badge: true, badge: true,
sound: true, sound: true,
@ -144,7 +152,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return Future.value(false); return Future.value(false);
} else { } else {
DateTime now = DateTime.now(); DateTime now = DateTime.now();
if (currentBackPressTime == null || now.difference(currentBackPressTime!) > Duration(seconds: 2)) { if (currentBackPressTime == null ||
now.difference(currentBackPressTime!) > Duration(seconds: 2)) {
currentBackPressTime = now; currentBackPressTime = now;
AppToast.showToast(message: TranslationBase.of(context).pressAgain); AppToast.showToast(message: TranslationBase.of(context).pressAgain);
return Future.value(false); return Future.value(false);
@ -159,14 +168,18 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
List<ImagesInfo> imagesInfo = []; List<ImagesInfo> imagesInfo = [];
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png', imageEn:
imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'), 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
); );
imagesInfo.add( imagesInfo.add(
ImagesInfo( ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', imageEn:
imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
); );
Navigator.push( Navigator.push(
@ -185,8 +198,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
if (tab == 4) { if (tab == 4) {
List<ImagesInfo> imagesInfo = []; List<ImagesInfo> imagesInfo = [];
imagesInfo.add( imagesInfo.add(ImagesInfo(
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png'));
Navigator.push( Navigator.push(
context, context,
@ -231,7 +247,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}); });
}); });
projectViewModel.analytics.bottomTabNavigation.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); projectViewModel.analytics.bottomTabNavigation
.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin);
} }
getToDoCount() { getToDoCount() {
@ -242,7 +259,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount); toDoProvider.setState(
res['AppointmentActiveNumber'],
res['AncillaryOrderListCount'],
true,
toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -281,7 +302,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; int languageID =
Provider.of<ProjectViewModel>(context, listen: false).isArabic
? 1
: 2;
familyFileProvider.getSharedRecordByStatus(languageID); familyFileProvider.getSharedRecordByStatus(languageID);
} }
}); });
@ -356,23 +380,32 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (data != null) { if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
// AppGlobal.context = context;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) { //
// authService
// .selectDeviceImei(DEVICE_TOKEN)
// .then((value) {})
// .catchError((err) {
// print("error: ${err.toString()}");
// GifLoaderDialogUtils.hideDialog(context);
// Navigator.of(context).pushNamed(
// WELCOME_LOGIN,
// );
// });
int languageID = projectViewModel.isArabic ? 1 : 2;
await authService.selectDeviceImei(DEVICE_TOKEN, languageID: languageID);
var userData = await getUserInformation();
if (apiStatus && userData != null) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
setUserValues(value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(WELCOME_LOGIN);
WELCOME_LOGIN, }
);
});
} }
} }
@ -434,14 +467,20 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
getNotificationCount(token) async { getNotificationCount(token) async {
if (await sharedPref.getObject(USER_PROFILE) != null) { if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) { if (data != null) {
authService.getDashboard().then((value) => { authService.getDashboard().then((value) => {
if (value != null) if (value != null)
{ {
setState(() { setState(() {
notificationCount = notificationCount = value['List_PatientDashboard'][0]
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); ['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
model.setState(model.count, 0, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
@ -471,8 +510,11 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
getText(currentTab).toUpperCase(), getText(currentTab).toUpperCase(),
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1!.color, color: currentTab == 0
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), ? CustomColors.backgroudGreyColor
: Theme.of(context).textTheme.headline1!.color,
fontFamily:
projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// bold: true, // bold: true,
), ),
leading: Builder( leading: Builder(
@ -481,9 +523,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: <Widget>[ children: <Widget>[
currentTab == 0 currentTab == 0
? IconButton( ? IconButton(
icon: SvgPicture.asset("assets/images/new/menu.svg"), icon: SvgPicture.asset(
color: Theme.of(context).textTheme.headline1!.color, "assets/images/new/menu.svg"),
onPressed: () => Scaffold.of(context).openDrawer(), color: Theme.of(context)
.textTheme
.headline1!
.color,
onPressed: () =>
Scaffold.of(context).openDrawer(),
) )
: IconButton( : IconButton(
icon: Icon(Icons.arrow_back), icon: Icon(Icons.arrow_back),
@ -494,7 +541,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
pageController.jumpToPage(0); pageController.jumpToPage(0);
}, },
), ),
projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild projectViewModel.isLogin &&
model.notificationsCount != null &&
!projectViewModel.isLoginChild
? Positioned( ? Positioned(
right: projectViewModel.isArabic ? 35 : 0, right: projectViewModel.isArabic ? 35 : 0,
top: 5, top: 5,
@ -512,7 +561,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
model.notificationsCount.toString(), model.notificationsCount.toString(),
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9, fontSize:
projectViewModel.isArabic ? 8 : 9,
), ),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -596,7 +646,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
index: currentTab, index: currentTab,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) floatingActionButton:
(projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton( ? FloatingButton(
elevation: true, elevation: true,
onTap: () { onTap: () {
@ -630,15 +681,24 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void checkUserStatus(token) async { void checkUserStatus(token) async {
await PushNotificationHandler.getInstance().requestPermissions(); await PushNotificationHandler.getInstance().requestPermissions();
authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value)); // authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value));
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) { if (data != null) {
authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {});
authService.getDashboard().then((value) async { authService.getDashboard().then((value) async {
setState(() { setState(() {
if (value != null) { if (value != null) {
notificationCount = value ['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
model.setState(model.count, 0, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); FlutterAppIconBadge.updateBadge(int.parse(notificationCount));

@ -47,7 +47,12 @@ class ConfirmLogin extends StatefulWidget {
final fromRegistration; final fromRegistration;
final bool isDubai; final bool isDubai;
const ConfirmLogin({Key? key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key); const ConfirmLogin(
{Key? key,
this.changePageViewIndex,
this.fromRegistration = false,
this.isDubai = false})
: super(key: key);
@override @override
_ConfirmLogin createState() => _ConfirmLogin(); _ConfirmLogin createState() => _ConfirmLogin();
@ -59,7 +64,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var sharedPref = AppSharedPreferences(); var sharedPref = AppSharedPreferences();
bool authenticated = false; bool authenticated = false;
final authService = AuthProvider(); final authService = AuthProvider();
PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>(); PharmacyModuleViewModel pharmacyModuleViewModel =
locator<PharmacyModuleViewModel>();
late int mobileNumber; late int mobileNumber;
String errorMsg = ''; String errorMsg = '';
SelectDeviceIMEIRES? user; SelectDeviceIMEIRES? user;
@ -89,8 +95,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
int fingrePrintBefore = 0; int fingrePrintBefore = 0;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>(); locator<AuthenticatedUserObject>();
AppointmentRateViewModel appointmentRateViewModel =
locator<AppointmentRateViewModel>();
late ProjectViewModel projectViewModel; late ProjectViewModel projectViewModel;
late ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
@ -138,16 +146,30 @@ class _ConfirmLogin extends State<ConfirmLogin> {
children: [ children: [
Text( Text(
TranslationBase.of(context).welcomeBack, TranslationBase.of(context).welcomeBack,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64),
), ),
Text( Text(
user!.name!.toLowerCase().capitalizeFirstofEach, user!.name!.toLowerCase().capitalizeFirstofEach,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.w700, color: Color(0xff2B353E), height: 1, letterSpacing: -1.44), style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w700,
color: Color(0xff2B353E),
height: 1,
letterSpacing: -1.44),
), ),
SizedBox(height: 10), SizedBox(height: 10),
Text( Text(
TranslationBase.of(context).accountInfo, TranslationBase.of(context).accountInfo,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 25 / 16),
), ),
Container( Container(
height: 72, height: 72,
@ -166,29 +188,46 @@ class _ConfirmLogin extends State<ConfirmLogin> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
TranslationBase.of(context).lastLoginAt.toCamelCase, TranslationBase.of(context)
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64), .lastLoginAt
.toCamelCase,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64),
), ),
Text( Text(
user!.editedOn != null // user!.editedOn != null
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!)) // ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.editedOn!))
: user!.createdOn != null // :
? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(user!.createdOn!)) user!.createdOn != null
? DateUtil.getDayMonthYearDateFormatted(
DateUtil.convertStringToDate(
user!.createdOn!))
: '--', : '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48), style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.48),
), ),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
TranslationBase.of(context).lastLoginWith.toCamelCase, TranslationBase.of(context)
.lastLoginWith
.toCamelCase,
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -205,12 +244,23 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Text( Text(
user!.editedOn != null // user!.editedOn != null
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.editedOn!), false) // ? DateUtil.formatDateToTimeLang(
: user!.createdOn != null // DateUtil.convertStringToDate(
? DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(user!.createdOn!), false) // user!.editedOn!),
// false)
// :
user!.createdOn != null
? DateUtil.formatDateToTimeLang(
DateUtil.convertStringToDate(
user!.createdOn!),
false)
: '--', : '--',
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.48), style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.48),
), ),
], ],
) )
@ -219,10 +269,18 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
TranslationBase.of(context).pleaseVerify, TranslationBase.of(context).pleaseVerify,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64),
), ),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 13,
mainAxisSpacing: 9),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 9), padding: EdgeInsets.only(top: 9),
shrinkWrap: true, shrinkWrap: true,
@ -236,7 +294,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
], ],
) )
else else
Column(mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset( Image.asset(
'assets/images/habib-logo.png', 'assets/images/habib-logo.png',
height: 90, height: 90,
@ -246,19 +307,38 @@ class _ConfirmLogin extends State<ConfirmLogin> {
this.onlySMSBox == false this.onlySMSBox == false
? Text( ? Text(
TranslationBase.of(context).verifyLoginWith, TranslationBase.of(context).verifyLoginWith,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 25 / 16),
) )
: Text( : Text(
TranslationBase.of(context).verifyFingerprint2, TranslationBase.of(context)
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.64, height: 25 / 16), .verifyFingerprint2,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
height: 25 / 16),
), ),
SizedBox(height: 23), SizedBox(height: 23),
Text( Text(
TranslationBase.of(context).pleaseVerify, TranslationBase.of(context).pleaseVerify,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
letterSpacing: -0.64),
), ),
GridView( GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, crossAxisSpacing: 13, mainAxisSpacing: 9), gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
crossAxisSpacing: 13,
mainAxisSpacing: 9),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(top: 9), padding: EdgeInsets.only(top: 9),
shrinkWrap: true, shrinkWrap: true,
@ -280,7 +360,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
TranslationBase.of(context).useAnotherAccount, TranslationBase.of(context).useAnotherAccount,
() { () {
Navigator.of(context).pushNamed(LOGIN_TYPE); Navigator.of(context).pushNamed(LOGIN_TYPE);
projectViewModel.analytics.loginRegistration.login_with_other_account(); projectViewModel.analytics.loginRegistration
.login_with_other_account();
}, },
), ),
], ],
@ -290,7 +371,6 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
Future<void> _getAvailableBiometrics() async { Future<void> _getAvailableBiometrics() async {
final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics; final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics;
final bool canAuthenticate = final bool canAuthenticate =
canAuthenticateWithBiometrics || await auth.isDeviceSupported(); canAuthenticateWithBiometrics || await auth.isDeviceSupported();
@ -322,7 +402,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
login_method = type; login_method = type;
LoginRegistration.verificationMethod = type; LoginRegistration.verificationMethod = type;
// if(!widget.fromRegistration) // if(!widget.fromRegistration)
projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); projectViewModel.analytics.loginRegistration
.login_verfication(forRegistration: widget.fromRegistration);
switch (type) { switch (type) {
case 1: case 1:
@ -340,7 +421,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
default: default:
break; break;
} }
sharedPref.setInt(LAST_LOGIN, this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); sharedPref.setInt(LAST_LOGIN,
this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN);
} }
loginWithSMS(type) { loginWithSMS(type) {
@ -396,7 +478,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null || widget.isDubai) { if (healthId != null || widget.isDubai) {
if (!widget.isDubai) { if (!widget.isDubai) {
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob)); request.dob =
dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
} }
request.healthId = healthId; request.healthId = healthId;
request.isHijri = isHijri; request.isHijri = isHijri;
@ -452,7 +535,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
stickyAuth: true, stickyAuth: true,
), ),
authMessages: [ authMessages: [
IOSAuthMessages(cancelButton: 'cancel', goToSettingsButton: 'settings', goToSettingsDescription: 'Please set up your Touch ID.', lockOut: 'Please reenable your Touch ID'), IOSAuthMessages(
cancelButton: 'cancel',
goToSettingsButton: 'settings',
goToSettingsDescription: 'Please set up your Touch ID.',
lockOut: 'Please reenable your Touch ID'),
], ],
); );
} on PlatformException catch (e) { } on PlatformException catch (e) {
@ -508,14 +595,19 @@ class _ConfirmLogin extends State<ConfirmLogin> {
setDefault() async { setDefault() async {
showLoader(true); showLoader(true);
if (await sharedPref.getObject(IMEI_USER_DATA) != null) user = SelectDeviceIMEIRES.fromJson(await sharedPref.getObject(IMEI_USER_DATA)); if (await sharedPref.getObject(IMEI_USER_DATA) != null)
user = SelectDeviceIMEIRES.fromJson(
await sharedPref.getObject(IMEI_USER_DATA));
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) { if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
isMoreOption = true; isMoreOption = true;
this.registerd_data = await CheckPatientAuthenticationReq.fromJson(await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN)); this.registerd_data = await CheckPatientAuthenticationReq.fromJson(
await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN));
} }
this.mobileNumber = this.registerd_data != null ? this.registerd_data.patientMobileNumber : int.parse(this.user!.mobile!); this.mobileNumber = this.registerd_data != null
? this.registerd_data.patientMobileNumber
: int.parse(this.user!.mobile!);
this.zipCode = this.registerd_data != null this.zipCode = this.registerd_data != null
? this.registerd_data.zipCode ? this.registerd_data.zipCode
: this.user!.outSA == true : this.user!.outSA == true
@ -534,7 +626,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
if (nhic != null) { if (nhic != null) {
final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth'])); dob = nhic['IsHijri']
? nhic['DateOfBirth']
: dateFormat2.format(dateFormat.parse(nhic['DateOfBirth']));
isHijri = nhic['IsHijri'] ? 1 : 0; isHijri = nhic['IsHijri'] ? 1 : 0;
healthId = nhic['HealthId']; healthId = nhic['HealthId'];
@ -557,22 +651,34 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.deviceToken = this.deviceToken; request.deviceToken = this.deviceToken;
request.projectOutSA = this.patientOutSA == true ? true : false; request.projectOutSA = this.patientOutSA == true ? true : false;
request.loginType = this.selectedOption; request.loginType = this.selectedOption;
request.oTPSendType = type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2; request.oTPSendType =
type == 1 ? type : 2; //this.selectedOption == 1 ? 1 : 2;
request.zipCode = this.zipCode; request.zipCode = this.zipCode;
request.logInTokenID = this.loginTokenID ?? ""; request.logInTokenID = this.loginTokenID ?? "";
if (this.registerd_data != null) { if (this.registerd_data != null) {
request.searchType = this.registerd_data.searchType != null ? this.registerd_data.searchType : 1; request.searchType = this.registerd_data.searchType != null
request.patientID = this.registerd_data.patientID != null ? this.registerd_data.patientID : 0; ? this.registerd_data.searchType
request.patientIdentificationID = request.nationalID = this.registerd_data.patientIdentificationID != null ? this.registerd_data.patientIdentificationID : '0'; : 1;
request.patientID = this.registerd_data.patientID != null
? this.registerd_data.patientID
: 0;
request.patientIdentificationID = request.nationalID =
this.registerd_data.patientIdentificationID != null
? this.registerd_data.patientIdentificationID
: '0';
request.dob = this.registerd_data.dob; request.dob = this.registerd_data.dob;
request.isRegister = this.registerd_data.isRegister; request.isRegister = this.registerd_data.isRegister;
} else { } else {
request.searchType = request.searchType != null ? request.searchType : 2; request.searchType = request.searchType != null ? request.searchType : 2;
request.patientID = this.user!.patientID != null ? this.user!.patientID : 0; request.patientID =
request.nationalID = request.nationalID != null ? request.nationalID : '0'; this.user!.patientID != null ? this.user!.patientID : 0;
request.patientIdentificationID = request.patientIdentificationID != null ? request.patientIdentificationID : '0'; request.nationalID =
request.nationalID != null ? request.nationalID : '0';
request.patientIdentificationID = request.patientIdentificationID != null
? request.patientIdentificationID
: '0';
request.isRegister = false; request.isRegister = false;
} }
request.deviceTypeID = request.searchType; request.deviceTypeID = request.searchType;
@ -597,14 +703,19 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result, res = result,
if (result is Map) if (result is Map)
{ {
result = CheckActivationCode.fromJson(result as Map<String, dynamic>), result = CheckActivationCode.fromJson(
if (this.registerd_data != null && this.registerd_data.isRegister == true) result as Map<String, dynamic>),
if (this.registerd_data != null &&
this.registerd_data.isRegister == true)
{ {
// if(widget.isDubai ==false){ // if(widget.isDubai ==false){
widget.changePageViewIndex!(1), widget.changePageViewIndex!(1),
// if(widget.isDubai ==false){ // if(widget.isDubai ==false){
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), Navigator.popUntil(
context,
(route) =>
Utils.route(route, equalsTo: RegisterNew)),
} }
} }
else else
@ -614,8 +725,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: result); AppToast.showErrorToast(message: result);
}), }),
projectViewModel.analytics.loginRegistration.login_fail(error: result), projectViewModel.analytics.loginRegistration
projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result), .login_fail(error: result),
projectViewModel.analytics.errorTracking.log(
'otp_verification_at_confirm_login',
error: result),
} }
}) })
.catchError((err) { .catchError((err) {
@ -633,27 +747,36 @@ class _ConfirmLogin extends State<ConfirmLogin> {
res = result, res = result,
if (result is Map) if (result is Map)
{ {
result = CheckActivationCode.fromJson(result as Map<String, dynamic>), result = CheckActivationCode.fromJson(
if (this.registerd_data != null && this.registerd_data.isRegister == true) result as Map<String, dynamic>),
if (this.registerd_data != null &&
this.registerd_data.isRegister == true)
{ {
widget.changePageViewIndex!(1), widget.changePageViewIndex!(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)), Navigator.popUntil(
context,
(route) =>
Utils.route(route, equalsTo: RegisterNew)),
} }
else else
{ {
sharedPref.remove(FAMILY_FILE), sharedPref.remove(FAMILY_FILE),
result.list.isFamily = false, result.list.isFamily = false,
userData = result.list, userData = result.list,
sharedPref.setString(BLOOD_TYPE, result.patientBloodType ?? "O+"), sharedPref.setString(
BLOOD_TYPE, result.patientBloodType ?? "O+"),
//Remove o+ from here Added by Aamir //Remove o+ from here Added by Aamir
authenticatedUserObject.user = result.list, authenticatedUserObject.user = result.list,
projectViewModel.setPrivilege(privilegeList: res), projectViewModel.setPrivilege(privilegeList: res),
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,
sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), sharedPref.setObject(
sharedPref.setString(TOKEN, result.authenticationTokenID), LOGIN_TOKEN_ID, result.logInTokenID),
projectViewModel.analytics.loginRegistration.login_successful(), sharedPref.setString(
TOKEN, result.authenticationTokenID),
projectViewModel.analytics.loginRegistration
.login_successful(),
checkIfUserAgreedBefore(result), checkIfUserAgreedBefore(result),
} }
} }
@ -666,8 +789,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
startSMSService(tempType); startSMSService(tempType);
}), }),
projectViewModel.analytics.loginRegistration.login_fail(error: result), projectViewModel.analytics.loginRegistration
projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result) .login_fail(error: result),
projectViewModel.analytics.errorTracking
.log('otp_verification_at_confirm_login', error: result)
} }
}) })
.catchError((err) { .catchError((err) {
@ -703,17 +828,25 @@ class _ConfirmLogin extends State<ConfirmLogin> {
print("Has Admission Request: $hasAdmissionRequest"); print("Has Admission Request: $hasAdmissionRequest");
if (isAdmitted) { if (isAdmitted) {
if (res['PatientAdmittedInformation'].length != 0) { if (res['PatientAdmittedInformation'].length != 0) {
getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel.fromJson(res['PatientAdmittedInformation'][0]); getAdmissionInfoResponseModel =
projectViewModel.setInPatientProjectID(res['PatientAdmittedInformation'][0]['ProjectID']); GetAdmissionInfoResponseModel.fromJson(
projectViewModel.setInPatientAdmissionInfo(getAdmissionInfoResponseModel); res['PatientAdmittedInformation'][0]);
projectViewModel.setInPatientProjectID(
res['PatientAdmittedInformation'][0]['ProjectID']);
projectViewModel
.setInPatientAdmissionInfo(getAdmissionInfoResponseModel);
projectViewModel.setIsPatientAdmitted(true); projectViewModel.setIsPatientAdmitted(true);
} }
} }
if (hasAdmissionRequest) { if (hasAdmissionRequest) {
if (res['MedicalInstruction'].length != 0) { if (res['MedicalInstruction'].length != 0) {
getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel.fromJson(res['MedicalInstruction'][0]); getAdmissionRequestInfoResponseModel =
projectViewModel.setInPatientProjectID(res['MedicalInstruction'][0]['ProjectID']); GetAdmissionRequestInfoResponseModel.fromJson(
projectViewModel.setInPatientAdmissionRequest(getAdmissionRequestInfoResponseModel); res['MedicalInstruction'][0]);
projectViewModel.setInPatientProjectID(
res['MedicalInstruction'][0]['ProjectID']);
projectViewModel.setInPatientAdmissionRequest(
getAdmissionRequestInfoResponseModel);
projectViewModel.setPatientHasAdmissionRequest(true); projectViewModel.setPatientHasAdmissionRequest(true);
} }
} }
@ -722,7 +855,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
insertIMEI() { insertIMEI() {
authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) { authService
.insertDeviceImei(selectedOption)
.then((value) => {})
.catchError((err) {
print(err); print(err);
}); });
} }
@ -732,7 +868,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0"); toDoProvider.setState(res['AppointmentActiveNumber'],
res['AncillaryOrderListCount'], true, "0");
// toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
@ -794,8 +931,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}); });
} }
Widget _loginOptionButton(String _title, String _icon, int _flag, int? _loginIndex) { Widget _loginOptionButton(
bool isDisable = (_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) || _flag == 2 && !checkIfBiometricAvailable(BiometricType.fingerprint) && _flag == 2 && !checkIfBiometricAvailable(BiometricType.strong)); String _title, String _icon, int _flag, int? _loginIndex) {
bool isDisable =
(_flag == 3 && !checkIfBiometricAvailable(BiometricType.face) ||
_flag == 2 &&
!checkIfBiometricAvailable(BiometricType.fingerprint) &&
_flag == 2 &&
!checkIfBiometricAvailable(BiometricType.strong));
return InkWell( return InkWell(
onTap: isDisable onTap: isDisable
? null ? null
@ -806,7 +949,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}); });
} else { } else {
authenticateUser(_flag, isActive: _loginIndex); authenticateUser(_flag, isActive: _loginIndex);
projectViewModel.analytics.loginRegistration.verify_otp_method(forRegistration: widget.fromRegistration); projectViewModel.analytics.loginRegistration.verify_otp_method(
forRegistration: widget.fromRegistration);
} }
}, },
child: Container( child: Container(
@ -831,7 +975,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
), ),
Text( Text(
TranslationBase.of(context).verifyThrough + " " + _title, TranslationBase.of(context).verifyThrough + " " + _title,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: isDisable ? Color(0xff2B353E).withOpacity(0.7) : Color(0xff2B353E), letterSpacing: -0.48, height: 20 / 16), style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w600,
color: isDisable
? Color(0xff2B353E).withOpacity(0.7)
: Color(0xff2B353E),
letterSpacing: -0.48,
height: 20 / 16),
), ),
], ],
), ),
@ -843,16 +994,26 @@ class _ConfirmLogin extends State<ConfirmLogin> {
Widget getButton(int flag) { Widget getButton(int flag) {
switch (flag) { switch (flag) {
case 4: case 4:
return _loginOptionButton(TranslationBase.of(context).verifyWhatsApp, 'assets/images/new/verify_whatsapp.svg', flag, null); return _loginOptionButton(TranslationBase.of(context).verifyWhatsApp,
'assets/images/new/verify_whatsapp.svg', flag, null);
break; break;
case 1: case 1:
return _loginOptionButton(TranslationBase.of(context).verifySMS, 'assets/images/new/verify_sms.svg', flag, null); return _loginOptionButton(TranslationBase.of(context).verifySMS,
'assets/images/new/verify_sms.svg', flag, null);
break; break;
case 2: case 2:
return _loginOptionButton(TranslationBase.of(context).verifyFingerprint, 'assets/images/new/verify_thumb.svg', flag, BiometricType.fingerprint.index); return _loginOptionButton(
TranslationBase.of(context).verifyFingerprint,
'assets/images/new/verify_thumb.svg',
flag,
BiometricType.fingerprint.index);
break; break;
case 3: case 3:
return _loginOptionButton(TranslationBase.of(context).verifyFaceID, 'assets/images/new/verify_face.svg', flag, BiometricType.face.index); return _loginOptionButton(
TranslationBase.of(context).verifyFaceID,
'assets/images/new/verify_face.svg',
flag,
BiometricType.face.index);
break; break;
default: default:
@ -864,7 +1025,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
}, },
child: RoundedContainer( child: RoundedContainer(
height: 150, height: 150,
backgroundColor: BiometricType.fingerprint.index == 1 ? Colors.white : Colors.white.withOpacity(.7), backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey, borderColor: Colors.grey,
showBorder: true, showBorder: true,
child: Padding( child: Padding(
@ -883,7 +1046,10 @@ class _ConfirmLogin extends State<ConfirmLogin> {
: SizedBox( : SizedBox(
height: 20, height: 20,
), ),
Texts(TranslationBase.of(context).moreVerification, fontSize: SizeConfig.textMultiplier! * 1.8, textAlign: TextAlign.center, color: Colors.black) Texts(TranslationBase.of(context).moreVerification,
fontSize: SizeConfig.textMultiplier! * 1.8,
textAlign: TextAlign.center,
color: Colors.black)
], ],
), ),
), ),

@ -71,7 +71,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
widget.appointmentAllHistoryResultList!.doctorTitle! + " " + widget.appointmentAllHistoryResultList!.doctorNameObj!, widget.appointmentAllHistoryResultList!.doctorTitle! + " " + widget.appointmentAllHistoryResultList!.doctorNameObj!,
widget.appointmentAllHistoryResultList!.doctorID!, widget.appointmentAllHistoryResultList!.doctorID!,
widget.appointmentAllHistoryResultList!.doctorImageURL!, widget.appointmentAllHistoryResultList!.doctorImageURL!,
widget.appointmentAllHistoryResultList!.doctorSpeciality!, widget.appointmentAllHistoryResultList!.doctorSpeciality !=null ? widget.appointmentAllHistoryResultList!.doctorSpeciality! : [],
"", "",
widget.appointmentAllHistoryResultList!.projectName!, widget.appointmentAllHistoryResultList!.projectName!,
DateUtil.convertStringToDate(widget.appointmentAllHistoryResultList!.appointmentDate!), DateUtil.convertStringToDate(widget.appointmentAllHistoryResultList!.appointmentDate!),
@ -84,17 +84,25 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
//model.user.emailAddress, //model.user.emailAddress,
), ),
isNeedToShowButton: _tabController!.index == 0 ? true : projectViewModel!.havePrivilege(15), isNeedToShowButton: _tabController!.index == 0 ? true : projectViewModel!.havePrivilege(15),
showConfirmMessageDialog: true, showConfirmMessageDialog: false,
onRatingAndReviewTap: getDoctorRatingsDetails, onRatingAndReviewTap: getDoctorRatingsDetails,
onTap: () { onTap: () {
showConfirmMessage(context, () async { print("Email..");
showDialog(
context: context,
builder: (cxt) => ConfirmSendEmailDialog(
email: projectViewModel!.user!.emailAddress!,
onTapSendEmail: () async{
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.sendGlassesPrescriptionEmail( await model.sendGlassesPrescriptionEmail(
appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo!, appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo!,
projectName: widget.appointmentAllHistoryResultList!.projectName!, projectName: widget.appointmentAllHistoryResultList!.projectName!,
projectID: widget.appointmentAllHistoryResultList!.projectID!); projectID: widget.appointmentAllHistoryResultList!.projectID!);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, projectViewModel!.user!.emailAddress!); },
),
);
}, },
), ),
Container( Container(
@ -165,18 +173,10 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
), ),
); );
} }
//
void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { // void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) {
showDialog( //
context: context, // }
builder: (cxt) => ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
onTap();
},
),
);
}
void getDoctorRatingsDetails() { void getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -14,6 +14,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../uitl/gif_loader_dialog_utils.dart';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
import 'EyeHomePage.dart'; import 'EyeHomePage.dart';
class EyeMeasurementsPage extends StatelessWidget { class EyeMeasurementsPage extends StatelessWidget {
@ -69,6 +71,16 @@ class EyeMeasurementsPage extends StatelessWidget {
), ),
), ),
), ),
onEmailTap: () {
showConfirmMessage(context, () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendGlassesPrescriptionEmail(
appointmentNo: _appointmentResult!.appointmentNo!,
projectName: _appointmentResult!.projectName!,
projectID: _appointmentResult!.projectID!);
GifLoaderDialogUtils.hideDialog(context);
}, projectViewModel!.user!.emailAddress!);
},
isInOutPatient: _appointmentResult.isInOutPatient, isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!, name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!,
// billNo: "appointmentResult.do", // billNo: "appointmentResult.do",
@ -99,4 +111,16 @@ class EyeMeasurementsPage extends StatelessWidget {
), ),
); );
} }
void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) {
showDialog(
context: context,
builder: (cxt) => ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
onTap();
},
),
);
}
} }

@ -135,12 +135,12 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
), ),
), ),
Container( Container(
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0), margin: EdgeInsets.only(top: 12.0, left: 12.0, right: 12.0, bottom: 10.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
), ),
minWidth: MediaQuery.of(context).size.width,
height: 45.0, height: 45.0,
child: CustomTextButton( child: CustomTextButton(
backgroundColor: Color(0xFFc5272d), backgroundColor: Color(0xFFc5272d),
@ -284,7 +284,7 @@ class _PassportUpdatePageState extends State<PassportUpdatePage> {
service.getCovidPassportNumber().then((res) { service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['Covid19_Certificate_GetPassportList'].length != 0) { if (res['Covid19_Certificate_GetPassportList'].length != 0) {
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo']; passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] ?? "";
if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") { if (res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false; _isButtonDisabled = false;
} }

@ -8,7 +8,6 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_new_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_new_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';

@ -39,7 +39,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
String measureUnitSelectedType = 'mg/dlt'; String measureUnitSelectedType = 'mg/dlt';
int measuredTime = 1; int measuredTime = 9;
bool isButtonDisabled = true; bool isButtonDisabled = true;
int _selectedMeasureUnitIndex = 0; int _selectedMeasureUnitIndex = 0;
@ -68,7 +68,7 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
"صائم", "صائم",
"آخر", "آخر",
]; ];
int? _selectedMeasureTimeIndex; int? _selectedMeasureTimeIndex =9;
String? measureTimeSelectedType; String? measureTimeSelectedType;
@override @override

@ -1037,7 +1037,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> autoGenerateAncillaryOrdersInvoice(dynamic orderNo, int projectID, dynamic appointmentID, List<dynamic> selectedProcListAPI, BuildContext context) async { Future<Map> autoGenerateAncillaryOrdersInvoice(dynamic orderNo, int projectID, dynamic appointmentID, List<dynamic> selectedProcListAPI, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1051,7 +1051,7 @@ class DoctorsListService extends BaseService {
}); });
request = { request = {
"LanguageID": 1, "LanguageID": languageID,
"RequestAncillaryOrderInvoice": [ "RequestAncillaryOrderInvoice": [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
], ],

@ -168,35 +168,44 @@ class AuthProvider with ChangeNotifier {
} }
} }
Future<SelectDeviceIMEIRES?> selectDeviceImei(imei) async { Future<SelectDeviceIMEIRES?> selectDeviceImei(imei,
{int languageID = 1}) async {
try { try {
dynamic localRes; // SelectDeviceIMEIRES? localRes;
print(imei); print(imei);
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['IMEI'] = imei; request['IMEI'] = imei;
request['LanguageID'] = languageID;
await BaseAppClient().post(SELECT_DEVICE_IMEI, await BaseAppClient().post(SELECT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) async { onSuccess: (dynamic response, int statusCode) async {
localRes = Map(); // localRes = Map();
print(
"Here response: ${response['Patient_SELECTDeviceIMEIbyIMEIList'][0]}");
if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) { if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) {
localRes = SelectDeviceIMEIRES.fromJson( apiStatus = true;
sharedPref.setObject(
IMEI_USER_DATA,
SelectDeviceIMEIRES.fromJson(
response['Patient_SELECTDeviceIMEIbyIMEIList'][0]));
return SelectDeviceIMEIRES.fromJson(
response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
} else {
print("ELSE TRIGERRED!!!!!!!!!");
} }
request['LanguageID'] = // await new BaseAppClient().post(SELECT_DEVICE_IMEI,
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false) // onSuccess: (dynamic response, int statusCode) {
.isArabic // localRes = SelectDeviceIMEIRES.fromJson(
? 1 // response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
: 2; // }, onFailure: (String error, int statusCode) {
await new BaseAppClient().post(SELECT_DEVICE_IMEI, // throw error;
onSuccess: (dynamic response, int statusCode) { // }, body: request);
localRes = SelectDeviceIMEIRES.fromJson(
response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; print("in the failure with : $error and $statusCode");
}, body: request); }, body: request);
return Future.value(localRes);
}, onFailure: (String error, int statusCode) {}, body: {});
} catch (error) { } catch (error) {
return Future.error(error); print("in the error");
// return Future.error(error);
} }
} }
@ -627,8 +636,10 @@ class AuthProvider with ChangeNotifier {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID);
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false; Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); false;
var model =
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
model.setState(0, 0, false, null); model.setState(0, 0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }

@ -9,9 +9,9 @@ class GifLoaderDialogUtils {
static hideDialog(BuildContext context) { static hideDialog(BuildContext context) {
try { try {
Navigator.of(context).pop(); Navigator.of(context, rootNavigator: true).pop();
} catch (error) { } catch (error) {
Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context).canPop()); Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop());
} }
} }
} }

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -6,7 +5,6 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart';
@ -187,7 +185,7 @@ class DoctorCard extends StatelessWidget {
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).invoiceNo, billNo ?? "", projectViewModel!.isArabic), if (rating == null && billNo != "") MyRichText(TranslationBase.of(context).orderNo, billNo ?? "", projectViewModel!.isArabic),
if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic), if (vaccineName != "") MyRichText("", vaccineName ?? "", projectViewModel!.isArabic),
if (rating != null) if (rating != null)
Row( Row(
@ -216,7 +214,8 @@ class DoctorCard extends StatelessWidget {
), ),
half: Icon( half: Icon(
Icons.star_half, Icons.star_half,
color: CustomColors.accentColor, ), color: CustomColors.accentColor,
),
empty: Icon( empty: Icon(
Icons.star_border, Icons.star_border,
color: CustomColors.accentColor, color: CustomColors.accentColor,

@ -3,7 +3,6 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/main.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
@ -62,7 +61,7 @@ class _TimeLineViewState extends State<TimeLineView> {
dateObjs = dateObjs.toSet().toList(); dateObjs = dateObjs.toSet().toList();
dateObjs.sort((a, b) => a.month.compareTo(b.month)); dateObjs.sort((a, b) => a.month.compareTo(b.month));
dateObjs.sort((a, b) => a.year.compareTo(b.year)); dateObjs.sort((a, b) => a.year.compareTo(b.year));
logger.d(dateObjs); // logger.d(dateObjs);
for (int i = 0; i < dateObjs.length; i++) { for (int i = 0; i < dateObjs.length; i++) {
print(dateObjs[i].monthYear.toString()); print(dateObjs[i].monthYear.toString());
@ -167,7 +166,6 @@ class _TimeLineViewState extends State<TimeLineView> {
), ),
), ),
) )
: Container() : Container()
], ],
), ),

@ -14,9 +14,7 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT }
@ -40,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS
@ -60,7 +58,7 @@ class MyInAppBrowser extends InAppBrowser {
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled']; static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled'];
final Function? onExitCallback; final Function onExitCallback;
final Function? onLoadStartCallback; final Function? onLoadStartCallback;
final BuildContext? context; final BuildContext? context;
@ -78,7 +76,7 @@ class MyInAppBrowser extends InAppBrowser {
static bool isPaymentDone = false; static bool isPaymentDone = false;
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback, this.context}); MyInAppBrowser({required this.onExitCallback, this.appo, this.onLoadStartCallback, this.context});
Future onBrowserCreated() async { Future onBrowserCreated() async {
print("\n\nBrowser Created!\n\n"); print("\n\nBrowser Created!\n\n");
@ -89,8 +87,6 @@ class MyInAppBrowser extends InAppBrowser {
if (onLoadStartCallback != null) onLoadStartCallback!(url.toString()); if (onLoadStartCallback != null) onLoadStartCallback!(url.toString());
} }
@override @override
Future onLoadStop(Uri? url) async { Future onLoadStop(Uri? url) async {
print("\n\nStopped $url\n\n"); print("\n\nStopped $url\n\n");
@ -106,8 +102,15 @@ class MyInAppBrowser extends InAppBrowser {
@override @override
void onExit() { void onExit() {
print("\n\nBrowser closed!\n\n"); print("\n\nBrowser closed before!\n\n");
if (onExitCallback != null) onExitCallback!(appo, isPaymentDone); // if (onExitCallback != null) {
try {
onExitCallback(appo, isPaymentDone);
print("\n\nBrowser closed after!\n\n");
} catch (err) {
print(err.toString());
}
// }
} }
@override @override
@ -145,7 +148,8 @@ class MyInAppBrowser extends InAppBrowser {
// await getPatientData(); // await getPatientData();
if (paymentMethod == "ApplePay") { if (paymentMethod == "ApplePay") {
getDeviceToken(); getDeviceToken();
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); MyChromeSafariBrowser safariBrowser =
new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!);
if (context != null) GifLoaderDialogUtils.showMyDialog(context); if (context != null) GifLoaderDialogUtils.showMyDialog(context);
@ -249,7 +253,8 @@ class MyInAppBrowser extends InAppBrowser {
openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID, openPharmacyPaymentBrowser(OrderDetailModel order, double amount, String orderDesc, String transactionID, String emailId, String paymentMethod, String patientName, dynamic patientID,
AuthenticatedUser authenticatedUser, InAppBrowser browser) { AuthenticatedUser authenticatedUser, InAppBrowser browser) {
this.browser = browser; this.browser = browser;
MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!); MyChromeSafariBrowser safariBrowser =
new MyChromeSafariBrowser(new MyInAppBrowser(onExitCallback: browser.onExit), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo!);
// getPatientData(); // getPatientData();
generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) {
if (order.customValuesXml!.contains("ApplePay")) { if (order.customValuesXml!.contains("ApplePay")) {

Loading…
Cancel
Save