diff --git a/lib/config/config.dart b/lib/config/config.dart index 3f54786f..8e19b054 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,12 +20,12 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; - // var BASE_URL = 'http://10.50.100.198:2018/'; +// var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:4422/'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -77,14 +77,19 @@ var WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; var GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; // 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 -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_PRE_POST_IMAGES = 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; -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_PRE_POST_IMAGES = + 'Services/Doctors.svc/REST/GetDoctorPrePostImages'; +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'; @@ -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_Async'; -var GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; -var GET_PRESCRIPTION_REPORT = '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'; +var GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +var GET_PRESCRIPTION_REPORT = + '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 var GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; -var GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; -var SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; +var GET_Patient_LAB_SPECIAL_RESULT = + '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_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; -var SEND_COVID_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/GenerateCOVIDReport'; -var COVID_PASSPORT_UPDATE = 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; -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_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; +var SEND_COVID_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/GenerateCOVIDReport'; +var COVID_PASSPORT_UPDATE = + 'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate'; +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_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 SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail'; +var SEND_RAD_REPORT_EMAIL = + 'Services/Notifications.svc/REST/SendRadReportEmail'; ///Feedback var SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; @@ -128,28 +148,39 @@ var GET_PATIENT_AppointmentHistory = 'Services' '/Doctors.svc/REST/PateintHasAppoimentHistory_Async'; ///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 -var GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; +var GET_NEAREST_HOSPITAL = + 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime'; ///ED Online -var ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; -var ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation"; -var ER_GetPatientPaymentInformationForERClinic = "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; +var ER_GET_VISUAL_TRIAGE_QUESTIONS = + "services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; +var ER_SAVE_TRIAGE_INFORMATION = + "services/Doctors.svc/REST/ER_SaveTriageInformation"; +var ER_GetPatientPaymentInformationForERClinic = + "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; ///Er Nearest -var GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; -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 GET_AMBULANCE_REQUEST = + 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; +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 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 var GET_ALL_RC_TRANSPORTATION = '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_RRT_SERVICE_PRICE = 'Services/Patients.svc/REST/PatientE_RealRRT_GetServicePrice'; +var GET_ALL_RRT_QUESTIONS = + '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'; @@ -170,7 +201,8 @@ var GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID'; var GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; ///userInformation -var GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New'; +var GET_USERINFORMATION_REQUEST = + 'Services/Community.svc/REST/GetUserInformation_New'; ///Update email 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'; ///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 SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; +var GET_BLOOD_AGREEMENT = + 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; +var SAVE_BLOOD_AGREEMENT = + 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation'; ///Reports var REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; -var INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; -var SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail'; -var GET_INPATIENT_ADMISSIONS = 'Services/inps.svc/REST/getAdmissionForMedicalReport'; +var INSERT_REQUEST_FOR_MEDICAL_REPORT = + 'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; +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'; ///Rate // var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated'; -var IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; -var GET_APPOINTMENT_DETAILS_BY_NO = '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 IS_LAST_APPOITMENT_RATED = + 'Services/Doctors.svc/REST/IsLastAppoitmentRated_Async'; +var GET_APPOINTMENT_DETAILS_BY_NO = + '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'; @@ -219,7 +262,8 @@ var GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; var GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; //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 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"; //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 var GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; //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 -var GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; +var GET_PATIENT_SHARE = + "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO"; //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 // 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 -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 var CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; //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 -var EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; +var EMAIL_QR_APPOINTMENT = + "Services/Notifications.svc/REST/sendEmailForOnLineCheckin"; //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 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 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 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 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 CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest'; -var SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare'; +var GET_LIVECARE_HISTORY = + 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; +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 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 UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnarie_Update'; +var INSERT_COVID_QUESTIONNAIRE = + '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 var CHANNEL = 3; @@ -362,19 +452,27 @@ var IS_TEXT_COMPLETED = false; var GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; var GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; -var GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails"; -var GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; +var GET_PAtIENTS_INSURANCE = + "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_SCHEMES = "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; -var UPDATE_MANUAL_INSURANCE = "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 INSURANCE_SCHEMES = + "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; +var UPDATE_MANUAL_INSURANCE = + "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_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 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_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 GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; -var GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; -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_PATIENT_AdVANCE_BALANCE_AMOUNT = + 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; +var GET_PATIENT_INFO_BY_ID = + 'Services/Doctors.svc/REST/GetPatientInfoByPatientID'; +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 -var GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; -var INSERT_PATIENT_HEALTH_DATA = 'Services/Patients.svc/REST/Med_InsertTransactions'; +var GET_PATIENT_LAST_RECORD = + 'Services/Patients.svc/REST/Med_GetPatientLastRecord'; +var INSERT_PATIENT_HEALTH_DATA = + 'Services/Patients.svc/REST/Med_InsertTransactions'; ///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 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 = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; -var ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult'; +var GET_BLOOD_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; +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 = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult'; -var ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult'; +var GET_WEIGHT_PRESSURE_RESULT_AVERAGE = + 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage'; +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_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV'; +var GET_CALL_INFO_HOURS_RESULT = + '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 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 DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; - -var UPDATE_BLOOD_PRESSURE_RESULT = '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 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 DEACTIVATE_BLOOD_PRESSURES_STATUS = + 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; + +var UPDATE_BLOOD_PRESSURE_RESULT = + '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 UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; var INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; -var INSERT_APPOINTMENT_QUESTION = 'Services/OUTPs.svc/REST/insertAppointmentQuestion'; -var RATE_DOCTOR_RESPONSE = 'Services/OUTPs.svc/REST/insertAppointmentQuestionRating'; +var INSERT_APPOINTMENT_QUESTION = + 'Services/OUTPs.svc/REST/insertAppointmentQuestion'; +var RATE_DOCTOR_RESPONSE = + 'Services/OUTPs.svc/REST/insertAppointmentQuestionRating'; var GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; // H2O -var H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; -var H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; -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"; +var H2O_GET_USER_PROGRESS = + "Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; +var H2O_INSERT_USER_ACTIVITY = + "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; +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 -var GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes"; -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_RELATIONSHIP_TYPES = + "Services/Patients.svc/REST/GetAllRelationshipTypes"; +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 CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; var GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; // 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 // 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_ALL = "delete_shopping_cart_item_by_customer/"; var ORDER_SHOPPING_CART = "orders"; -var GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation"; -var GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; -var LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation"; -var LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation"; +var GET_LACUM_ACCOUNT_INFORMATION = + "Services/Patients.svc/REST/GetLakumAccountInformation"; +var GET_LACUM_GROUP_INFORMATION = + "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 TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints"; -var LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy"; +var TRANSFER_YAHALA_LOYALITY_POINTS = + "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_Async'; @@ -514,18 +661,29 @@ var GET_MOST_VIEWED_PRODUCTS = "mostview"; var GET_NEW_PRODUCTS = "newproducts"; // Home Health Care -var HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; -var HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; -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 HHC_GET_ALL_SERVICES = + "Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; +var HHC_GET_ALL_CMC_SERVICES = + "Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; +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 PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; -var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; -var GET_PATIENT_ALL_PRES_ORD = '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'; +var PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = + 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; +var PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = + 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; +var GET_PATIENT_ALL_PRES_ORD = + '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 var HHC_GET_ALL_SERVICES_RC = "api/HHC/getallhhc"; @@ -569,17 +727,21 @@ var GET_CUSTOMER_INFO = "VerifyCustomer"; //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_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_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_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='; 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 TIMER_MIN = 10; @@ -595,80 +757,105 @@ var SCAN_QR_CODE = 'productbysku/'; 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 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 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'; // Check If InPatient API 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 var GET_GENERAL_INSTRUCTIONS = 'Services/INPs.svc/REST/getGeneralInstructions'; // 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 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'; //Meal Plan APIs var GET_ADMITTED_PATIENTS = 'Services/MOP.svc/REST/GetAdmittedPatients'; -var GET_CURRENT_WEEKID_WEEKDAY = 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP'; -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 GET_CURRENT_WEEKID_WEEKDAY = + 'Services/MOP.svc/REST/GetCurrentWeekAndDayHMGMP'; +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 CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; -var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; +var CHECK_PATIENT_NPHIES_ELIGIBILITY = + 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; +var CONVERT_PATIENT_TO_CASH = + 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; //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 payFortEnvironment = FortEnvironment.production; // var applePayMerchantId = "merchant.com.hmgwebservices"; var payFortEnvironment = FortEnvironment.test; var applePayMerchantId = "merchant.com.hmgwebservices.uat"; +bool apiStatus = false; + class AppGlobal { static var context; diff --git a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart index ee3cf458..336a632d 100644 --- a/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart +++ b/lib/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart @@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_lis import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:flutter/cupertino.dart'; +import '../../../../uitl/app_toast.dart'; + class BariatricsService extends BaseService { List clinicCategoryList = []; List diseasesList = []; @@ -127,6 +129,7 @@ class BariatricsService extends BaseService { await baseAppClient.post(GET_DOCTOR_LIST_CALCULATION, onSuccess: (dynamic response, int statusCode) { localRes = response; }, onFailure: (String error, int statusCode) { + AppToast.showErrorToast(message: error); hasError = true; super.error = error; }, body: body); diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 027978a0..2583a776 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -30,7 +30,8 @@ AppSharedPreferences sharedPref = new AppSharedPreferences(); /// onFailure: (String error, int statusCode) {}, /// body: Map(); /// -AuthenticatedUserObject authenticatedUserObject = locator(); +AuthenticatedUserObject authenticatedUserObject = + locator(); VitalSignService _vitalSignService = locator(); class BaseAppClient { @@ -54,12 +55,17 @@ class BaseAppClient { url = BASE_URL + endPoint; } try { - String? pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); + String? pharmacyToken = + await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var user = await sharedPref.getObject(USER_PROFILE); - Map headers = {'Content-Type': 'application/json', 'Accept': 'application/json'}; + Map headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }; if (!isExternal) { 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) { languageID = 'en'; } @@ -74,21 +80,29 @@ class BaseAppClient { body['VersionID'] = VERSION_ID; body['Channel'] = CHANNEL; - if (body.containsKey('LanguageID')) { - if (body['LanguageID'] != null) { - //change this line because language issue happened on dental - body['LanguageID'] = body['LanguageID'] == 'ar' - ? 1 - : body['LanguageID'] == 'en' - ? 2 - : body['LanguageID']; - } else { - body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; - } + // if (body.containsKey('LanguageID')) { + if (body['LanguageID'] != null) { + //change this line because language issue happened on dental + body['LanguageID'] = body['LanguageID'] == 'ar' + ? 1 + : body['LanguageID'] == 'en' + ? 2 + : body['LanguageID']; } else { - // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); - body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; + body['LanguageID'] = + Provider.of(AppGlobal.context, listen: false) + .isArabic + ? 1 + : 2; } + // } else { + // // body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2); + // body['LanguageID'] = + // Provider.of(AppGlobal.context, listen: false) + // .isArabic + // ? 1 + // : 2; + // } // body['LanguageID'] = Provider.of(AppGlobal.context, listen: false).isArabic ? 1 : 2; @@ -103,11 +117,12 @@ class BaseAppClient { body['Longitude'] = long; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isIOS @@ -151,14 +166,17 @@ class BaseAppClient { if (user != null) { 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'] != null ? body['PatientOutSA'] : 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 // headers = { @@ -190,12 +208,15 @@ class BaseAppClient { print(jsonBody); // } - if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { - final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); + if (await Utils.checkConnection( + bypassConnectionCheck: bypassConnectionCheck)) { + final response = await http.post(Uri.parse(url.trim()), + body: json.encode(body), headers: headers); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure('Error While Fetching data', statusCode); - logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); + logApiEndpointError( + endPoint, 'Error While Fetching data', statusCode); } else { // var decoded = utf8.decode(response.bodyBytes); var parsed = json.decode(utf8.decode(response.bodyBytes)); @@ -209,8 +230,12 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + navigateToAppUpdate( + AppGlobal.context, parsed['ErrorEndUserMessage']); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } if (parsed['ErrorType'] == 2) { await logout(); @@ -229,28 +254,46 @@ class BaseAppClient { // if (parsed != null) { // onSuccess(parsed, statusCode); // } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); // logout(); // } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess(parsed, statusCode); } else { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure("Server Error found with no available message", statusCode); - logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); + onFailure("Server Error found with no available message", + statusCode); + logApiEndpointError( + endPoint, + "Server Error found with no available message", + statusCode); } else { onFailure(parsed['ErrorSearchMsg'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode); + logApiEndpointError( + endPoint, parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); + onFailure( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); + logApiEndpointError(endPoint, + parsed['message'] ?? parsed['message'], statusCode); } } } @@ -262,11 +305,18 @@ class BaseAppClient { onSuccess(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure(parsed['message'] ?? parsed['message'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); + onFailure( + parsed['message'] ?? parsed['message'], statusCode); + logApiEndpointError(endPoint, + parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -275,17 +325,23 @@ class BaseAppClient { } } else { 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) { print(e); 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, - {Map? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async { + {Map? 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 user = await sharedPref.getObject(USER_PROFILE); String url; @@ -302,13 +358,16 @@ class BaseAppClient { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': pharmacyToken ?? '', - 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", + 'Mobilenumber': user != null + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", }; if (!isExternal) { 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')) { // body['SetupID'] = body.containsKey('SetupID') @@ -370,12 +429,14 @@ class BaseAppClient { print("Headers : ${json.encode(headers)}"); 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; // print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { onFailure!('Error While Fetching data', statusCode); - logApiEndpointError(endPoint, 'Error While Fetching data', statusCode); + logApiEndpointError( + endPoint, 'Error While Fetching data', statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); @@ -383,8 +444,12 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + navigateToAppUpdate( + AppGlobal.context, parsed['ErrorEndUserMessage']); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } if (isAllowAny) { onSuccess!(parsed, statusCode); @@ -399,29 +464,56 @@ class BaseAppClient { if (parsed != null) { onSuccess!(parsed, statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, 'session logged out', statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, 'session logged out', statusCode); logout(); } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess!(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { if (parsed['SameClinicApptList'] != null) { onSuccess!(parsed, statusCode); } else { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure!("Server Error found with no available message", statusCode); - logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); + onFailure!("Server Error found with no available message", + statusCode); + logApiEndpointError( + endPoint, + "Server Error found with no available message", + statusCode); } else { onFailure!(parsed['ErrorSearchMsg'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorSearchMsg'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorSearchMsg'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } else { - onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } } else if (!parsed['IsAuthenticated']) { @@ -433,11 +525,22 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure!(parsed['message'] ?? parsed['message'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['message'] ?? parsed['message'], statusCode); + logApiEndpointError( + endPoint, + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -445,7 +548,8 @@ class BaseAppClient { } } else { 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) { print(e); @@ -457,7 +561,8 @@ class BaseAppClient { Future navigateToAppUpdate(context, String text) async { Navigator.pushAndRemoveUntil( context, - MaterialPageRoute(builder: (context) => AppUpdatePage(appUpdateText: text)), + MaterialPageRoute( + builder: (context) => AppUpdatePage(appUpdateText: text)), (Route route) => false, ); } @@ -488,7 +593,10 @@ class BaseAppClient { if (await Utils.checkConnection()) { final response = await http.get( 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; // print("statusCode :$statusCode"); @@ -502,7 +610,8 @@ class BaseAppClient { } } else { 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', 'Accept': 'application/json', 'Authorization': token ?? '', - 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", + 'Mobilenumber': user != null + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", // 'Host': "mdlaboratories.com", @@ -544,14 +655,19 @@ class BaseAppClient { if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode == 401) { - onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); - logApiEndpointError(endPoint, TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); + onFailure!(TranslationBase.of(AppGlobal.context).pharmacyRelogin, + statusCode); + logApiEndpointError( + endPoint, + TranslationBase.of(AppGlobal.context).pharmacyRelogin, + statusCode); Navigator.of(AppGlobal.context).pushNamed(HOME); } else { var bodyUtf = json.decode(utf8.decode(response.bodyBytes)); // print(bodyUtf); onFailure!(bodyUtf['error']['ErrorEndUserMsg'], statusCode); - logApiEndpointError(endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode); + logApiEndpointError( + endPoint, bodyUtf['error']['ErrorEndUserMsg'], statusCode); } } else { // var parsed = json.decode(response.body.toString()); @@ -560,7 +676,8 @@ class BaseAppClient { } } else { 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"); 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( Uri.parse(url.trim()), body: json.encode(body), @@ -584,7 +702,12 @@ class BaseAppClient { ); final int statusCode = response.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()); @@ -596,12 +719,16 @@ class BaseAppClient { } } else { 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, - {Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map? queryParams, Map? headers}) async { + {Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, + Map? queryParams, + Map? headers}) async { headers = headers ?? {}; String url = fullUrl; @@ -613,7 +740,8 @@ class BaseAppClient { } 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( Uri.parse(url.trim()), headers: headers, @@ -621,7 +749,12 @@ class BaseAppClient { final int statusCode = response.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) { onFailure!('Error While Fetching data', statusCode); @@ -631,17 +764,22 @@ class BaseAppClient { } } else { 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, - {Map? body, Map? headers, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure}) async { + {Map? body, + Map? headers, + Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure}) async { String url = fullUrl; // print("URL Query String: $url"); 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( Uri.parse(url.trim()), body: json.encode(body), @@ -650,7 +788,12 @@ class BaseAppClient { final int statusCode = response.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) { onFailure!('Error While Fetching data', statusCode); @@ -660,12 +803,16 @@ class BaseAppClient { } } else { 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, - {Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, Map? queryParams, Map? headers}) async { + {Function(dynamic response, int statusCode)? onSuccess, + Function(String error, int statusCode)? onFailure, + Map? queryParams, + Map? headers}) async { String url = fullUrl; // print("URL Query String: $url"); @@ -677,7 +824,8 @@ class BaseAppClient { } 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( Uri.parse(url.trim()), headers: headers, @@ -685,7 +833,12 @@ class BaseAppClient { final int statusCode = response.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) { onFailure!('Error While Fetching data', statusCode); @@ -695,11 +848,13 @@ class BaseAppClient { } } else { 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 handleUnauthorized(int statusCode, {required String forUrl}) async { + Future handleUnauthorized(int statusCode, + {required String forUrl}) async { if (forUrl.startsWith(EXA_CART_API_BASE_URL) && statusCode == 401) { final token = await generatePackagesToken(); packagesAuthHeader['Authorization'] = 'Bearer $token'; @@ -712,8 +867,10 @@ class BaseAppClient { await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID); await authenticatedUserObject.getUser(); - Provider.of(AppGlobal.context, listen: false).isLogin = false; - var model = Provider.of(AppGlobal.context, listen: false); + Provider.of(AppGlobal.context, listen: false).isLogin = + false; + var model = + Provider.of(AppGlobal.context, listen: false); _vitalSignService.weightKg = ""; _vitalSignService.heightCm = ""; model.setState(0, 0, false, null); @@ -728,7 +885,8 @@ class BaseAppClient { static defaultHttpParameters() async { 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 params = {}; if (user != null) { @@ -748,7 +906,11 @@ class BaseAppClient { } pharmacyPost(String endPoint, - {Map? body, Function(dynamic response, int statusCode)? onSuccess, Function(String error, int statusCode)? onFailure, bool isAllowAny = false, bool isExternal = false}) async { + {Map? 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 user = await sharedPref.getObject(USER_PROFILE); String url; @@ -760,7 +922,8 @@ class BaseAppClient { try { if (isExternal) { 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); if (body!.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') @@ -783,11 +946,12 @@ class BaseAppClient { : user['OutSA']; if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; } body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; @@ -810,7 +974,9 @@ class BaseAppClient { : user['PatientType']; if (user != null) { 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['SessionID'] = SESSION_ID; //getSessionId(token); } @@ -822,11 +988,14 @@ class BaseAppClient { var ss = json.encode(body); 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', 'Accept': 'application/json', 'Authorization': token ?? '', - 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", + 'Mobilenumber': user != null + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", }); @@ -834,8 +1003,15 @@ class BaseAppClient { // print("statusCode :$statusCode"); if (statusCode < 200 || statusCode >= 400 || json == null) { var parsed = json.decode(utf8.decode(response.bodyBytes)); - onFailure!(parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); - logApiEndpointError(endPoint, parsed['error']['ErrorEndUserMsgN'] ?? 'Error While Fetching data', statusCode); + onFailure!( + parsed['error']['ErrorEndUserMsgN'] ?? + 'Error While Fetching data', + statusCode); + logApiEndpointError( + endPoint, + parsed['error']['ErrorEndUserMsgN'] ?? + 'Error While Fetching data', + statusCode); } else { // var parsed = json.decode(response.body.toString()); var parsed = json.decode(utf8.decode(response.bodyBytes)); @@ -843,7 +1019,8 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['ErrorType'] == 4) { - navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']); + navigateToAppUpdate( + AppGlobal.context, parsed['ErrorEndUserMessage']); } if (isAllowAny) { onSuccess!(parsed, statusCode); @@ -858,25 +1035,47 @@ class BaseAppClient { if (parsed != null) { onSuccess!(parsed, statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); logout(); } } - } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) { + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { onSuccess!(parsed, statusCode); - } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) { - if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) { + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { if (parsed['ErrorSearchMsg'] == null) { - onFailure!("Server Error found with no available message", statusCode); - logApiEndpointError(endPoint, "Server Error found with no available message", statusCode); + onFailure!("Server Error found with no available message", + statusCode); + logApiEndpointError( + endPoint, + "Server Error found with no available message", + statusCode); } else { onFailure!(parsed['ErrorSearchMsg'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorSearchMsg'], statusCode); + logApiEndpointError( + endPoint, parsed['ErrorSearchMsg'], statusCode); } } else { - onFailure!(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); } } else if (!parsed['IsAuthenticated']) { await logout(); @@ -887,11 +1086,18 @@ class BaseAppClient { onSuccess!(parsed, statusCode); } else { if (parsed['message'] != null) { - onFailure!(parsed['message'] ?? parsed['message'], statusCode); - logApiEndpointError(endPoint, parsed['message'] ?? parsed['message'], statusCode); + onFailure!( + parsed['message'] ?? parsed['message'], statusCode); + logApiEndpointError(endPoint, + parsed['message'] ?? parsed['message'], statusCode); } else { - onFailure!(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); - logApiEndpointError(endPoint, parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode); + onFailure!( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + logApiEndpointError( + endPoint, + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); } } } @@ -899,7 +1105,8 @@ class BaseAppClient { } } else { 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) { print(e); @@ -911,11 +1118,15 @@ class BaseAppClient { Future generatePackagesToken() async { var url = EXA_CART_API_BASE_URL + PACKAGES_TOKEN; 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; 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) { var jsonResponse = json.decode(stringResponse); token = jsonResponse['auth_token']; diff --git a/lib/models/Authentication/select_device_imei_res.dart b/lib/models/Authentication/select_device_imei_res.dart index 4b6ae33e..979dfca1 100644 --- a/lib/models/Authentication/select_device_imei_res.dart +++ b/lib/models/Authentication/select_device_imei_res.dart @@ -32,13 +32,13 @@ class SelectDeviceIMEIRES { SelectDeviceIMEIRES.fromJson(Map json) { biometricEnabled = json['BiometricEnabled']; - createdOn = json['CreatedOn']; - editedOn = json['EditedOn']; + createdOn = json['CreatedOn'].toString(); + editedOn = json['EditedOn'].toString(); iD = json['ID']; iMEI = json['IMEI']; - identificationNo = json['IdentificationNo']; + identificationNo = json['IdentificationNo'].toString(); logInType = json['LogInType']; - mobile = json['Mobile']; + mobile = json['Mobile'].toString(); name = json['Name']; nameN = json['NameN']; outSA = json['OutSA']; @@ -65,4 +65,9 @@ class SelectDeviceIMEIRES { data['PreferredLanguage'] = this.preferredLanguage; 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}'; + } } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index de81df4c..c9a06485 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -857,7 +857,7 @@ class _AnicllaryOrdersState extends State with SingleTic GifLoaderDialogUtils.showMyDialog(localContext); 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); showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo'], widget.projectID); }).catchError((err) { diff --git a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart index bd6267f0..8e3495c1 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h20_setting.dart @@ -61,11 +61,11 @@ class _H2oSettingState extends State { _weightValue = _userDetailModel?.weight ?? 50; _heightController.text = _heightValue.toStringAsFixed(0); _weightController.text = _weightValue.toStringAsFixed(0); - _nameController.text = _userDetailModel.firstName!; + _nameController.text = _userDetailModel.firstName ?? ""; _isWeightKG = _userDetailModel?.isWeightInKG ?? true; _isHeightCM = _userDetailModel?.isHeightInCM ?? true; _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; readPrefs(); } diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index 98c0b1b5..6916299c 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -72,9 +72,9 @@ class _CalorieCalculatorState extends State { } 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)); - } 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)); } } @@ -344,11 +344,13 @@ class _CalorieCalculatorState extends State { color: Colors.white, child: SecondaryButton( label: TranslationBase.of(context).calculate, - color: CustomColors.accentColor, + color: ageController.text.isNotEmpty ? int.parse(ageController.text) >120 ? Colors.grey : CustomColors.accentColor : CustomColors.accentColor, onTap: () { + if(ageController.text.isNotEmpty && int.parse(ageController.text) <121 && int.parse(_heightController.text)<250 && int.parse(_weightController.text) <200) setState(() { + calculateCalories(); - print(calories); + { Navigator.push( context, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart index aa67a41a..ac67f1d8 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_result_page.dart @@ -13,6 +13,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; +import '../../../../uitl/app_toast.dart'; + class CalorieResultPage extends StatelessWidget { final double calorie; @@ -118,8 +120,8 @@ class CalorieResultPage extends StatelessWidget { service.getCalculationDoctors(calculationID: 2).then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res['List_CalculationTable'].length); - if (res['MessageStatus'] == 1) { + + if (res!=null && res['MessageStatus'] == 1) { if (res['List_CalculationTable'].length != 0) { res['List_CalculationTable'].forEach((item) { DoctorList docList = new DoctorList(); @@ -157,7 +159,8 @@ class CalorieResultPage extends StatelessWidget { } } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(context); + + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart index 85e88d7e..b9533089 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/Summary.dart @@ -197,6 +197,7 @@ class _SummaryState extends State { TranslationBase.of(context).submit, () async { await widget.amRequestViewModel.insertERPressOrder(patientER: widget.patientER_RC); + widget.tabController.animateTo(1); }, color: CustomColors.green, ), diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 72f9d719..49beeddc 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -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/services/authentication/auth_provider.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/payfort_services/payfort_view_model.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; @@ -74,7 +75,8 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); - AppointmentRateViewModel appointmentRateViewModel = locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); int currentTab = 0; late PageController pageController; @@ -91,7 +93,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { bool _showBottomNavigationBar = true; ///inject the user data - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging.instance; final authService = new AuthProvider(); @@ -118,17 +121,22 @@ class _LandingPageState extends State with WidgetsBindingObserver { "appointmentdate": "2022-01-19", "appointmenttime": "12:10", "PatientName": "Testing", - "session_id": "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg", + "session_id": + "1_MX40NjIwOTk2Mn5-MTY0NzI1NjYxNDI2OX5ySXhlVjZjam13RFdMVmdleWVsSDhzQkx-fg", "token": "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", "PatientID": "1231755", "is_call": "true" }; void _requestIOSPermissions() { - flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation()?.requestPermissions( + flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + IOSFlutterLocalNotificationsPlugin>() + ?.requestPermissions( alert: true, badge: true, sound: true, @@ -144,7 +152,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { return Future.value(false); } else { DateTime now = DateTime.now(); - if (currentBackPressTime == null || now.difference(currentBackPressTime!) > Duration(seconds: 2)) { + if (currentBackPressTime == null || + now.difference(currentBackPressTime!) > Duration(seconds: 2)) { currentBackPressTime = now; AppToast.showToast(message: TranslationBase.of(context).pressAgain); return Future.value(false); @@ -159,14 +168,18 @@ class _LandingPageState extends State with WidgetsBindingObserver { List imagesInfo = []; imagesInfo.add( ImagesInfo( - imageEn: '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'), + imageEn: + '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( - imageEn: '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'), + imageEn: + '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( @@ -185,8 +198,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { } if (tab == 4) { List imagesInfo = []; - imagesInfo.add( - 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')); + imagesInfo.add(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')); Navigator.push( context, @@ -231,7 +247,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { }); }); - projectViewModel.analytics.bottomTabNavigation.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); + projectViewModel.analytics.bottomTabNavigation + .log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); } getToDoCount() { @@ -242,7 +259,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { print(res['AppointmentActiveNumber']); if (res['MessageStatus'] == 1) { // 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 {} }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -281,7 +302,10 @@ class _LandingPageState extends State with WidgetsBindingObserver { WidgetsBinding.instance.addPostFrameCallback((_) { if (projectViewModel.isLogin && !projectViewModel.isLoginChild) { - int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + int languageID = + Provider.of(context, listen: false).isArabic + ? 1 + : 2; familyFileProvider.getSharedRecordByStatus(languageID); } }); @@ -356,23 +380,32 @@ class _LandingPageState extends State with WidgetsBindingObserver { if (data != null) { Navigator.of(context).pushNamed(CONFIRM_LOGIN); } else { + // AppGlobal.context = 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); - if (value != null) { - setUserValues(value); - Navigator.of(context).pushNamed(CONFIRM_LOGIN); - } else { - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); - } - }).catchError((err) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { GifLoaderDialogUtils.hideDialog(context); - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); - }); + Navigator.of(context).pushNamed(WELCOME_LOGIN); + } } } @@ -434,14 +467,20 @@ class _LandingPageState extends State with WidgetsBindingObserver { getNotificationCount(token) async { 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) { authService.getDashboard().then((value) => { if (value != null) { setState(() { - 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); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); }) @@ -471,8 +510,11 @@ class _LandingPageState extends State with WidgetsBindingObserver { getText(currentTab).toUpperCase(), style: TextStyle( fontWeight: FontWeight.bold, - color: currentTab == 0 ? CustomColors.backgroudGreyColor : Theme.of(context).textTheme.headline1!.color, - fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + color: currentTab == 0 + ? CustomColors.backgroudGreyColor + : Theme.of(context).textTheme.headline1!.color, + fontFamily: + projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // bold: true, ), leading: Builder( @@ -481,9 +523,14 @@ class _LandingPageState extends State with WidgetsBindingObserver { children: [ currentTab == 0 ? IconButton( - icon: SvgPicture.asset("assets/images/new/menu.svg"), - color: Theme.of(context).textTheme.headline1!.color, - onPressed: () => Scaffold.of(context).openDrawer(), + icon: SvgPicture.asset( + "assets/images/new/menu.svg"), + color: Theme.of(context) + .textTheme + .headline1! + .color, + onPressed: () => + Scaffold.of(context).openDrawer(), ) : IconButton( icon: Icon(Icons.arrow_back), @@ -494,7 +541,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController.jumpToPage(0); }, ), - projectViewModel.isLogin && model.notificationsCount != null && !projectViewModel.isLoginChild + projectViewModel.isLogin && + model.notificationsCount != null && + !projectViewModel.isLoginChild ? Positioned( right: projectViewModel.isArabic ? 35 : 0, top: 5, @@ -512,7 +561,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { model.notificationsCount.toString(), style: TextStyle( color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, + fontSize: + projectViewModel.isArabic ? 8 : 9, ), textAlign: TextAlign.center, ), @@ -596,15 +646,16 @@ class _LandingPageState extends State with WidgetsBindingObserver { index: currentTab, ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, - floatingActionButton: (projectViewModel.havePrivilege(34) && currentTab == 0) - ? FloatingButton( - elevation: true, - onTap: () { - changeCurrentTab(2); - projectViewModel.analytics.appointment.book_appointment(); - }, - ) - : null); + floatingActionButton: + (projectViewModel.havePrivilege(34) && currentTab == 0) + ? FloatingButton( + elevation: true, + onTap: () { + changeCurrentTab(2); + projectViewModel.analytics.appointment.book_appointment(); + }, + ) + : null); } triggerRobot() { @@ -630,15 +681,24 @@ class _LandingPageState extends State with WidgetsBindingObserver { void checkUserStatus(token) async { await PushNotificationHandler.getInstance().requestPermissions(); - authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value)); + // authService.selectDeviceImei(token).then((SelectDeviceIMEIRES? value) => setUserValues(value)); if (authenticatedUserObject.isLogin) { - var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); + var data = + AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); if (data != null) { - authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); + authService + .registeredAuthenticatedUser(data, token, 0, 0) + .then((res) => {}); authService.getDashboard().then((value) async { setState(() { 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); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(int.parse(notificationCount)); @@ -669,7 +729,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { } if (Platform.isIOS) { String voipToken = await sharedPref.getString(APNS_TOKEN); - getOneSignalVOIPToken(voipToken); + getOneSignalVOIPToken(voipToken); } // registerGeofences(); } diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 576e4bbf..e7a5c42b 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -84,17 +84,25 @@ class _EyeHomePageState extends State with SingleTickerProviderStat //model.user.emailAddress, ), isNeedToShowButton: _tabController!.index == 0 ? true : projectViewModel!.havePrivilege(15), - showConfirmMessageDialog: true, + showConfirmMessageDialog: false, onRatingAndReviewTap: getDoctorRatingsDetails, onTap: () { - showConfirmMessage(context, () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendGlassesPrescriptionEmail( - appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo!, - projectName: widget.appointmentAllHistoryResultList!.projectName!, - projectID: widget.appointmentAllHistoryResultList!.projectID!); - GifLoaderDialogUtils.hideDialog(context); - }, projectViewModel!.user!.emailAddress!); + print("Email.."); + + showDialog( + context: context, + builder: (cxt) => ConfirmSendEmailDialog( + email: projectViewModel!.user!.emailAddress!, + onTapSendEmail: () async{ + GifLoaderDialogUtils.showMyDialog(context); + await model.sendGlassesPrescriptionEmail( + appointmentNo: widget.appointmentAllHistoryResultList!.appointmentNo!, + projectName: widget.appointmentAllHistoryResultList!.projectName!, + projectID: widget.appointmentAllHistoryResultList!.projectID!); + GifLoaderDialogUtils.hideDialog(context); + }, + ), + ); }, ), Container( @@ -165,18 +173,10 @@ class _EyeHomePageState extends State with SingleTickerProviderStat ), ); } - - void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { - showDialog( - context: context, - builder: (cxt) => ConfirmSendEmailDialog( - email: email, - onTapSendEmail: () { - onTap(); - }, - ), - ); - } + // + // void showConfirmMessage(BuildContext context, GestureTapCallback onTap, String email) { + // + // } void getDoctorRatingsDetails() { GifLoaderDialogUtils.showMyDialog(context); diff --git a/lib/pages/medical/eye/EyeMeasurementsPage.dart b/lib/pages/medical/eye/EyeMeasurementsPage.dart index 9bde92b7..652c0a24 100644 --- a/lib/pages/medical/eye/EyeMeasurementsPage.dart +++ b/lib/pages/medical/eye/EyeMeasurementsPage.dart @@ -14,6 +14,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../uitl/gif_loader_dialog_utils.dart'; +import '../../../widgets/dialogs/confirm_send_email_dialog.dart'; import 'EyeHomePage.dart'; 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, name: _appointmentResult.doctorTitle! + " " + _appointmentResult.doctorNameObj!, // 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(); + }, + ), + ); + } + } diff --git a/lib/pages/medical/medical_profile_page_new.dart b/lib/pages/medical/medical_profile_page_new.dart index e28542cf..2f61a795 100644 --- a/lib/pages/medical/medical_profile_page_new.dart +++ b/lib/pages/medical/medical_profile_page_new.dart @@ -32,7 +32,7 @@ class _MedicalProfilePageState extends State { var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin); return BaseView( - // onModelReady: (model) => model.getAppointmentHistory(), + onModelReady: (model) => model.getAppointmentHistory(), builder: (_, model, widget1) => AppScaffold( isShowDecPage: false, isShowAppBar: false, diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 0d2cb52b..f9abb655 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1037,7 +1037,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future autoGenerateAncillaryOrdersInvoice(dynamic orderNo, int projectID, dynamic appointmentID, List selectedProcListAPI, BuildContext context) async { + Future autoGenerateAncillaryOrdersInvoice(dynamic orderNo, int projectID, dynamic appointmentID, List selectedProcListAPI, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1051,7 +1051,7 @@ class DoctorsListService extends BaseService { }); request = { - "LanguageID": 1, + "LanguageID": languageID, "RequestAncillaryOrderInvoice": [ {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} ], diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index a9b0ff10..e89a6741 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -168,35 +168,44 @@ class AuthProvider with ChangeNotifier { } } - Future selectDeviceImei(imei) async { + Future selectDeviceImei(imei, + {int languageID = 1}) async { try { - dynamic localRes; + // SelectDeviceIMEIRES? localRes; print(imei); Map request = {}; request['IMEI'] = imei; + request['LanguageID'] = languageID; + await BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) async { - localRes = Map(); + // localRes = Map(); + print( + "Here response: ${response['Patient_SELECTDeviceIMEIbyIMEIList'][0]}"); 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]); + } else { + print("ELSE TRIGERRED!!!!!!!!!"); } - request['LanguageID'] = - Provider.of(AppGlobal.context, listen: false) - .isArabic - ? 1 - : 2; - await new BaseAppClient().post(SELECT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { - localRes = SelectDeviceIMEIRES.fromJson( - response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); - }, onFailure: (String error, int statusCode) { - throw error; - }, body: request); - return Future.value(localRes); - }, onFailure: (String error, int statusCode) {}, body: {}); + // await new BaseAppClient().post(SELECT_DEVICE_IMEI, + // onSuccess: (dynamic response, int statusCode) { + // localRes = SelectDeviceIMEIRES.fromJson( + // response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); + // }, onFailure: (String error, int statusCode) { + // throw error; + // }, body: request); + }, onFailure: (String error, int statusCode) { + print("in the failure with : $error and $statusCode"); + }, body: request); } 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(PHARMACY_CUSTOMER_ID); await authenticatedUserObject.getUser(); - Provider.of(AppGlobal.context, listen: false).isLogin = false; - var model = Provider.of(AppGlobal.context, listen: false); + Provider.of(AppGlobal.context, listen: false).isLogin = + false; + var model = + Provider.of(AppGlobal.context, listen: false); model.setState(0, 0, false, null); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); } diff --git a/lib/uitl/gif_loader_dialog_utils.dart b/lib/uitl/gif_loader_dialog_utils.dart index d95307de..304dda51 100644 --- a/lib/uitl/gif_loader_dialog_utils.dart +++ b/lib/uitl/gif_loader_dialog_utils.dart @@ -9,9 +9,9 @@ class GifLoaderDialogUtils { static hideDialog(BuildContext context) { try { - Navigator.of(context).pop(); + Navigator.of(context, rootNavigator: true).pop(); } 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()); } } -} +} \ No newline at end of file