diff --git a/lib/config/config.dart b/lib/config/config.dart index eb532d8a..74bf8305 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,8 +21,8 @@ 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 = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.201.204.103/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; @@ -358,7 +358,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 20.1; +var VERSION_ID = 20.3; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 30d5958a..acea685a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -189,7 +189,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 4773715; //4609100 + // body['PatientID'] = 4774402; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/prescriptions_service.dart b/lib/core/service/medical/prescriptions_service.dart index c90e053b..f24b36cb 100644 --- a/lib/core/service/medical/prescriptions_service.dart +++ b/lib/core/service/medical/prescriptions_service.dart @@ -125,32 +125,50 @@ 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(String appointmentNo, String setupID, String appointmentDate, int episodeId, int patientID, String clinicName, String doctorName, int doctorID, int projectID, bool isInOutPatient, bool isDownload) async { + 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); } RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions( diff --git a/lib/core/viewModels/medical/prescriptions_view_model.dart b/lib/core/viewModels/medical/prescriptions_view_model.dart index 0ad266c5..198a2bc3 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/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index cbd756fb..eb501475 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -94,14 +94,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); }, @@ -491,14 +492,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); }, ),