diff --git a/lib/config/config.dart b/lib/config/config.dart index 8ca36300..afd9e6de 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -96,6 +96,7 @@ 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 SEND_PRESCRIPTION_EMAIL_NEW = 'Services/Notifications.svc/REST/SendPrescriptionEmail_New'; var GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; ///Lab Order diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c85d3ef4..2ddd73e9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -2291,7 +2291,6 @@ const Map localizedValues = { "liveCareTermsConditions28": {"en": "5.5 Telehealth Services is intended only for your own personal use and the use of your children under your supervision. You must not share your user access details (log-in name, password etc.) with any other person and must take reasonable steps to maintain the security of such details. Our services are delivered on the basis that we have certain information about the user, which may be connected to or obtained from your account details (age, gender, medical history etc.). We accept no responsibility whatsoever to you or any other person if our services are delivered via a user account to a person other than the registered user. This is particularly important for telehealth services, where the practitioner will need to assess the information, the patient provides during the consultation in the context of the patient’s medical file and history.", "ar": "5-5 خدمات الرعاية الصحية عن بُعد مخصصة فقط لاستخدامك الشخصي واستخدام أطفالك تحت إشرافك. يتعين عليك ألا تشارك بيانات تسجيل الدخول الخاصة بك (اسم المستخدم وكلمة المرور وما إلى ذلك) مع أي شخص آخر ويجب أن تتخذ خطوات معقولة للحفاظ على أمان هذه البيانات. يتم تقديم خدماتنا على أساس أن لدينا معلومات معينة حول المستخدم، والتي قد تكون مرتبطة أو تم الحصول عليها من تفاصيل حسابك (العمر والجنس والتاريخ الطبي وما إلى ذلك). نحن لا نتحمل أي مسؤولية من أي نوع تجاهك أو تجاه أي شخص آخر إذا تم تقديم خدماتنا عبر حساب مستخدم إلى شخص آخر غير المستخدم المسجل. هذا مهم بشكل خاص لخدمات الرعاية الصحية عن بعد، حيث سيحتاج الممارس الصحي إلى تقييم المعلومات التي يقدمها المريض أثناء الاستشارة في سياق الملف الطبي للمريض وتاريخه."}, "liveCareTermsConditions29": {"en": "5.6 You are responsible for ensuring you have a device connected to the internet and capable of transmitting and receiving video and sound. We are not responsible for any failure of a Telehealth Services session caused by your device or your internet connection. You are responsible for all costs associated with your own internet connection and use.", "ar": "5-6 أنت مسؤول عن التأكد من أن لديك جهازاً متصلاً بالإنترنت وقادراً على إرسال واستقبال الفيديو والصوت. نحن لسنا مسؤولين عن أي انقطاع في جلسة خدمات الرعاية الصحية عن بعد بسبب ناجم عن جهازك أو اتصالك بالإنترنت. أنت مسؤول عن جميع التكاليف المرتبطة باتصالك بالإنترنت واستخدامك لها."}, "liveCareTermsConditions30": {"en": "5.7 From time to time we may release updates to our Application and or the Website. You should ensure that you are running the latest version of the Application. Use of old versions of the Application may lead to technical errors in your use of the Telehealth Services and may expose you to additional security risks.", "ar": "5-7 قد نقوم من وقت لآخر بإصدار تحديثات لتطبيقنا و/أو موقع الويب الخاص بنا. يجب عليك التأكد من أنك تقوم بتشغيل أحدث إصدار من التطبيق. قد يؤدي استخدام الإصدارات القديمة من التطبيق إلى حدوث أخطاء فنية أثناء استخدامك لخدمات الرعاية الصحية عن بُعد وقد يعرضك ذلك لمخاطر أمنية إضافية."}, - "liveCareTermsHeading8": {"en": "6. TELEHEALTH SERVICES", "ar": "6. خدمات الرعاية الصحية عن بُعد"}, "liveCareTermsConditions31": {"en": "Our Telehealth Services will be for specific medical specialties or follow-up or medication refill appointments.", "ar": "خدمات الرعاية الصحية عن بُعد الخاصة بنا سوف تكون لتخصصات طبية محددة أو لمواعيد المتابعة أو إعادة صرف الدواء. "}, "liveCareTermsHeading9": {"en": "7. CHARGES AND PAYMENT", "ar": "7. الأجور والسداد"}, diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 0f498787..957b3652 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -187,7 +187,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 10716; //4609100 + // body['PatientID'] = 10715; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 3f83a493..61fff9b2 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -231,9 +231,11 @@ class LabsService extends BaseService { _requestSendLabReportEmail.languageID = languageID; // await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { - await baseAppClient.post(isVidaPlus ? SEND_LAB_RESULT_EMAIL : SEND_LAB_RESULT_EMAIL_NEW, onSuccess: (dynamic response, int statusCode) { + // await baseAppClient.post(isVidaPlus ? SEND_LAB_RESULT_EMAIL : SEND_LAB_RESULT_EMAIL_NEW, onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(SEND_LAB_RESULT_EMAIL_NEW, onSuccess: (dynamic response, int statusCode) { if (isDownload) { labReportPDF = isVidaPlus ? response['LabReportsPDFContent'] : response['PdfContent']; + // labReportPDF = response['PdfContent']; } }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index 8becfb7e..e3e66e60 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -123,34 +123,80 @@ class PrescriptionsService extends BaseService { isDentalAllowedBackend: false, ); - Future sendPrescriptionEmail(String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID, bool isInOutPatient, bool isDownload) async { - _requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList; - _requestSendPrescriptionEmail.listPrescriptionsINP = prescriptionReportListINP; - _requestSendPrescriptionEmail.appointmentDate = appointmentDate; - _requestSendPrescriptionEmail.patientID = patientID; - _requestSendPrescriptionEmail.clinicName = clinicName; - _requestSendPrescriptionEmail.doctorName = doctorName; - _requestSendPrescriptionEmail.projectID = projectID; - _requestSendPrescriptionEmail.to = user.emailAddress; - _requestSendPrescriptionEmail.dateofBirth = user.dateofBirth; - _requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo; - _requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber; - _requestSendPrescriptionEmail.doctorID = doctorID; - _requestSendPrescriptionEmail.patientName = user.firstName! + " " + user.lastName!; - _requestSendPrescriptionEmail.setupID = user.setupID; - _requestSendPrescriptionEmail.to = user.emailAddress; - _requestSendPrescriptionEmail.isDownload = isDownload; + Future sendPrescriptionEmail(Prescriptions prescriptions, bool isDownload) async { + // _requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList; + // _requestSendPrescriptionEmail.listPrescriptionsINP = prescriptionReportListINP; + // _requestSendPrescriptionEmail.appointmentDate = appointmentDate; + // _requestSendPrescriptionEmail.patientID = patientID; + // _requestSendPrescriptionEmail.clinicName = clinicName; + // _requestSendPrescriptionEmail.doctorName = doctorName; + // _requestSendPrescriptionEmail.projectID = projectID; + // _requestSendPrescriptionEmail.to = user.emailAddress; + // _requestSendPrescriptionEmail.dateofBirth = user.dateofBirth; + // _requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo; + // _requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber; + // _requestSendPrescriptionEmail.doctorID = doctorID; + // _requestSendPrescriptionEmail.patientName = user.firstName! + " " + user.lastName!; + // _requestSendPrescriptionEmail.setupID = user.setupID; + // _requestSendPrescriptionEmail.to = user.emailAddress; + // _requestSendPrescriptionEmail.isDownload = isDownload; + + Map mapDevice = { + "AppointmentNo": prescriptions.appointmentNo, + "SetupID": prescriptions.setupID, + "EpisodeNo": prescriptions.episodeID, + "ClinicID": prescriptions.clinicID, + "ProjectID": prescriptions.projectID, + "DischargeNo": prescriptions.dischargeNo, + "IsDownload": true, + "To": user.emailAddress, + // "To": "amjad.haroon@cloudsolutions.com.sa", + "ClinicName": prescriptions.clinicDescription, + "DoctorName": prescriptions.doctorName, + }; + hasError = false; - await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) { + // await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) { + await baseAppClient.post(SEND_PRESCRIPTION_EMAIL_NEW, onSuccess: (response, statusCode) { if (isDownload) { prescriptionReportPDF = response["Base64Data"]; } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _requestSendPrescriptionEmail.toJson()); + // }, body: _requestSendPrescriptionEmail.toJson()); + }, body: mapDevice); } + // Future sendPrescriptionEmail(String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID, bool isInOutPatient, bool isDownload) async { + // _requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList; + // _requestSendPrescriptionEmail.listPrescriptionsINP = prescriptionReportListINP; + // _requestSendPrescriptionEmail.appointmentDate = appointmentDate; + // _requestSendPrescriptionEmail.patientID = patientID; + // _requestSendPrescriptionEmail.clinicName = clinicName; + // _requestSendPrescriptionEmail.doctorName = doctorName; + // _requestSendPrescriptionEmail.projectID = projectID; + // _requestSendPrescriptionEmail.to = user.emailAddress; + // _requestSendPrescriptionEmail.dateofBirth = user.dateofBirth; + // _requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo; + // _requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber; + // _requestSendPrescriptionEmail.doctorID = doctorID; + // _requestSendPrescriptionEmail.patientName = user.firstName! + " " + user.lastName!; + // _requestSendPrescriptionEmail.setupID = user.setupID; + // _requestSendPrescriptionEmail.to = user.emailAddress; + // _requestSendPrescriptionEmail.isDownload = isDownload; + // + // hasError = false; + // await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) { + // if (isDownload) { + // prescriptionReportPDF = response["Base64Data"]; + // } + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: _requestSendPrescriptionEmail.toJson()); + // } + RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions( latitude: 0, longitude: 0, diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 82c0282e..80b6d037 100644 --- a/lib/core/viewModels/medical/prescriptions_view_model.dart +++ b/lib/core/viewModels/medical/prescriptions_view_model.dart @@ -122,17 +122,19 @@ class PrescriptionsViewModel extends BaseViewModel { } sendPrescriptionEmail( - {required String appointmentDate, - required int patientID, - required String clinicName, - required String doctorName, - required int doctorID, - required String mes, - required int projectID, - required bool isInOutPatient, - required bool isDownload}) async { + // {required String appointmentDate, + // required int patientID, + // required String clinicName, + // required String doctorName, + // required int doctorID, + // required String mes, + // required int projectID, + // required bool isInOutPatient, + // required bool isDownload}) async + {required Prescriptions prescriptions, required bool isDownload}) async { setState(ViewState.BusyLocal); - await _prescriptionsService.sendPrescriptionEmail(appointmentDate, patientID, clinicName, doctorName, doctorID, projectID, isInOutPatient, isDownload); + // await _prescriptionsService.sendPrescriptionEmail(appointmentDate, patientID, clinicName, doctorName, doctorID, projectID, isInOutPatient, isDownload); + await _prescriptionsService.sendPrescriptionEmail(prescriptions, isDownload); if (_prescriptionsService.hasError) { error = _prescriptionsService.error!; setState(ViewState.ErrorLocal); @@ -148,7 +150,7 @@ class PrescriptionsViewModel extends BaseViewModel { } } } else { - AppToast.showSuccessToast(message: mes); + AppToast.showSuccessToast(message: ""); } // AppToast.showSuccessToast(message: mes); setState(ViewState.Idle); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index fa916910..3681c25a 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1211,7 +1211,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { "Appointment check in", transID!, appo.projectID.toString(), - authenticatedUser.emailAddress!, + authenticatedUser.emailAddress ?? "Cust_${authenticatedUser.patientID}@HMG.com", paymentMethod[0]!, authenticatedUser.patientType, authenticatedUser.firstName!, diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index f34db3c7..8f638c53 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -83,14 +83,15 @@ class PrescriptionItemsPage extends StatelessWidget { // showConfirmMessage(context, model); GifLoaderDialogUtils.showMyDialog(context); await model.sendPrescriptionEmail( - appointmentDate: prescriptions.appointmentDate!, - patientID: prescriptions.patientID!, - clinicName: prescriptions.companyName!, - doctorName: prescriptions.doctorName!, - doctorID: prescriptions.doctorID!, - mes: TranslationBase.of(context).sendSuc, - projectID: prescriptions.projectID!, - isInOutPatient: prescriptions.isInOutPatient!, + prescriptions: prescriptions, + // appointmentDate: prescriptions.appointmentDate!, + // patientID: prescriptions.patientID!, + // clinicName: prescriptions.companyName!, + // doctorName: prescriptions.doctorName!, + // doctorID: prescriptions.doctorID!, + // mes: TranslationBase.of(context).sendSuc, + // projectID: prescriptions.projectID!, + // isInOutPatient: prescriptions.isInOutPatient!, isDownload: true); GifLoaderDialogUtils.hideDialog(context); }, @@ -445,14 +446,15 @@ class PrescriptionItemsPage extends StatelessWidget { email: projectViewModel.user!.emailAddress!, onTapSendEmail: () { model.sendPrescriptionEmail( - appointmentDate: prescriptions.appointmentDate!, - patientID: prescriptions.patientID!, - clinicName: prescriptions.companyName!, - doctorName: prescriptions.doctorName!, - doctorID: prescriptions.doctorID!, - mes: TranslationBase.of(context).sendSuc, - projectID: prescriptions.projectID!, - isInOutPatient: prescriptions.isInOutPatient!, + prescriptions: prescriptions, + // appointmentDate: prescriptions.appointmentDate!, + // patientID: prescriptions.patientID!, + // clinicName: prescriptions.companyName!, + // doctorName: prescriptions.doctorName!, + // doctorID: prescriptions.doctorID!, + // mes: TranslationBase.of(context).sendSuc, + // projectID: prescriptions.projectID!, + // isInOutPatient: prescriptions.isInOutPatient!, isDownload: true); }, ), diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 4737756c..494cf978 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -336,13 +336,19 @@ class ClinicListService extends BaseService { } Future getCurrentWeekIDAndDay(BuildContext context) async { + + Map request; + // request = {"ProjectID": projectID, "MealScheduleID": patientID}; + request = {}; + dynamic localRes; - await baseAppClient.get(GET_CURRENT_WEEKID_WEEKDAY, isExternal: false, isRCService: false, onSuccess: (response, statusCode) async { + await baseAppClient.post(GET_CURRENT_WEEKID_WEEKDAY, isExternal: false, isRCService: false, onSuccess: (response, statusCode) async { localRes = response; }, onFailure: (String error, int statusCode) { throw error; - }); - return localRes; + }, body: request); + // return localRes; + return Future.value(localRes); } Future getMealsOfScheduleID(int projectID, int admissionNo, int dietType, int weekID, int weekDay, context) async { diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index ff6b44f7..40215897 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -41,7 +41,8 @@ class MyInAppBrowser extends InAppBrowser { // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String SERVICE_URL = 'https://rsgwebservices.hmg.com/Payment/pages/RsgSendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://rsgwebservices.hmg.com/Payment/pages/RsgSendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://rsgpayment.hmg.com/pages/RsgSendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS