diff --git a/lib/config/config.dart b/lib/config/config.dart index a7676855..3fea4c82 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,7 +21,8 @@ var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; +var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -411,14 +412,14 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 9.8; +var VERSION_ID = 7.6; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; var SESSION_ID = 'TMRhVmkGhOsvamErw'; var IS_DENTAL_ALLOWED_BACKEND = false; var PATIENT_TYPE = 1; -var PATIENT_TYPE_ID = 1; +var PATIENT_TYPE_ID = null; var DEVICE_TOKEN = ""; var IS_VOICE_COMMAND_CLOSED = true; var IS_TEXT_COMPLETED = false; diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart index bdeb3930..b3794e3c 100644 --- a/lib/core/model/labs/request_patient_lab_special_result.dart +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -1,5 +1,6 @@ class RequestPatientLabSpecialResult { String invoiceNo; + String invoiceNoVP; String orderNo; String setupID; String projectID; @@ -20,6 +21,7 @@ class RequestPatientLabSpecialResult { RequestPatientLabSpecialResult( {this.invoiceNo, + this.invoiceNoVP, this.orderNo, this.setupID, this.projectID, @@ -40,6 +42,7 @@ class RequestPatientLabSpecialResult { RequestPatientLabSpecialResult.fromJson(Map json) { invoiceNo = json['InvoiceNo']; + invoiceNo = json['InvoiceNo_VP']; orderNo = json['OrderNo']; setupID = json['SetupID']; projectID = json['ProjectID']; @@ -62,6 +65,7 @@ class RequestPatientLabSpecialResult { Map toJson() { final Map data = new Map(); data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNoVP; data['OrderNo'] = this.orderNo; data['SetupID'] = this.setupID; data['ProjectID'] = this.projectID; diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart index 118da906..dcd28b5b 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -23,6 +23,7 @@ class RequestSendLabReportEmail { String doctorName; String projectID; String invoiceNo; + String invoiceNoVP; String orderDate; RequestSendLabReportEmail( @@ -50,6 +51,7 @@ class RequestSendLabReportEmail { this.doctorName, this.projectID, this.invoiceNo, + this.invoiceNoVP, this.orderDate}); RequestSendLabReportEmail.fromJson(Map json) { @@ -77,6 +79,7 @@ class RequestSendLabReportEmail { doctorName = json['DoctorName']; projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; + invoiceNo = json['InvoiceNo_VP']; orderDate = json['OrderDate']; } @@ -106,6 +109,7 @@ class RequestSendLabReportEmail { data['DoctorName'] = this.doctorName; data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo; data['OrderDate'] = this.orderDate; return data; } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 38e63391..041c3bb0 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -77,6 +77,7 @@ class BaseAppClient { body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; + body['isVidaPlus'] = true; body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); @@ -98,31 +99,12 @@ class BaseAppClient { } else { body['PatientType'] = PATIENT_TYPE; } - // } - // body['PatientType'] = body.containsKey('PatientType') - // ? body['PatientType'] != null - // ? body['PatientType'] - // : user['PatientType'] != null - // ? user['PatientType'] - // : PATIENT_TYPE - // : PATIENT_TYPE; - - // if (!body.containsKey('PatientTypeID')) { if (user != null && user['PatientType'] != null) { body['PatientTypeID'] = user['PatientType']; } else { body['PatientType'] = PATIENT_TYPE_ID; } - // } - - // body['PatientTypeID'] = body.containsKey('PatientTypeID') - // ? body['PatientTypeID'] != null - // ? body['PatientTypeID'] - // : user['PatientType'] != null - // ? user['PatientType'] - // : PATIENT_TYPE_ID - // : PATIENT_TYPE_ID; if (user != null) { body['TokenID'] = body['TokenID'] != null ? body['TokenID'] : token; @@ -158,11 +140,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { - print("URL : $url"); + // if (AppGlobal.isNetworkDebugEnabled) { + print("Debug URL : $url"); final jsonBody = json.encode(body); - print(jsonBody); - } + print("Debug Body : $jsonBody"); + // } if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index f12e4669..b967d41c 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -36,7 +36,8 @@ class LabsService extends BaseService { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; - _requestPatientLabSpecialResult.invoiceNo = invoiceNo; + _requestPatientLabSpecialResult.invoiceNo = "0"; + _requestPatientLabSpecialResult.invoiceNoVP = invoiceNo; _requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.setupID = setupID; @@ -54,7 +55,8 @@ class LabsService extends BaseService { Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; + body['InvoiceNo'] = "0"; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -156,7 +158,8 @@ class LabsService extends BaseService { Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['InvoiceNo'] = "0"; + body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -178,7 +181,8 @@ class LabsService extends BaseService { Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; - _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; + _requestSendLabReportEmail.invoiceNo = "0"; + _requestSendLabReportEmail.invoiceNoVP = patientLabOrder.invoiceNo; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index df3f0e19..44940b31 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -28,7 +28,8 @@ class RadiologyService extends BaseService { hasError = false; await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { finalRadiologyList.clear(); - response['FinalRadiologyList'].forEach((radiology) { + // response['FinalRadiologyList'].forEach((radiology) { + response['FinalRadiologyListAPI'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/main.dart b/lib/main.dart index f2faf588..4f6e43f6 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -70,7 +70,7 @@ class _MyApp extends State { // var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans'; // Re-enable once going live - if (Platform.isAndroid) checkForUpdate(); + // if (Platform.isAndroid) checkForUpdate(); ThemeNotifier(defaultTheme()); super.initState(); diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 94747b37..adcc4820 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -256,7 +256,7 @@ class _Login extends State { sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); GifLoaderDialogUtils.showMyDialog(context); authService.checkPatientAuthentication(request).then((value) { - if (value['UserAccountIsActivated']) { + // if (value['UserAccountIsActivated']) { if (value['isSMSSent']) { sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request); @@ -267,17 +267,17 @@ class _Login extends State { this.checkActivationCode(); } } - } else { - ConfirmDialog activationDialog = new ConfirmDialog( - context: context, - confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, - okText: TranslationBase.of(context).yes, - cancelText: TranslationBase.of(context).no, - okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()}, - cancelFunction: () => {}); - GifLoaderDialogUtils.hideDialog(context); - activationDialog.showAlertDialog(context); - } + // } else { + // ConfirmDialog activationDialog = new ConfirmDialog( + // context: context, + // confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, + // okText: TranslationBase.of(context).yes, + // cancelText: TranslationBase.of(context).no, + // okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()}, + // cancelFunction: () => {}); + // GifLoaderDialogUtils.hideDialog(context); + // activationDialog.showAlertDialog(context); + // } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); ConfirmDialog dialog = new ConfirmDialog( diff --git a/lib/uitl/push-notification-handler.dart b/lib/uitl/push-notification-handler.dart index 2cea20f3..dcd90cdb 100644 --- a/lib/uitl/push-notification-handler.dart +++ b/lib/uitl/push-notification-handler.dart @@ -20,7 +20,7 @@ import 'package:flutter/material.dart'; // import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart'; import 'package:flutter_ios_voip_kit/call_state_type.dart'; import 'package:flutter_ios_voip_kit/flutter_ios_voip_kit.dart'; -import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; +// import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:huawei_push/huawei_push.dart' as h_push; import 'app_shared_preferences.dart'; @@ -115,7 +115,7 @@ class PushNotificationHandler { final BuildContext context; static PushNotificationHandler _instance; final voIPKit = FlutterIOSVoIPKit.instance; - HmsApiAvailability hmsApiAvailability; + // HmsApiAvailability hmsApiAvailability; Timer timeOutTimer; bool isTalking = false; @@ -161,7 +161,7 @@ class PushNotificationHandler { } init() async { - hmsApiAvailability = new HmsApiAvailability(); + // hmsApiAvailability = new HmsApiAvailability(); // VoIP Callbacks voIPKit.getVoIPToken().then((value) { print('🎈 example: getVoIPToken: $value'); @@ -223,12 +223,12 @@ class PushNotificationHandler { // if (Platform.isAndroid && (!await FlutterHmsGmsAvailability.isHmsAvailable)) { if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value != 0) { - final fcmToken = await FirebaseMessaging.instance.getToken(); - if (fcmToken != null) onToken(fcmToken); - } - }); + // await hmsApiAvailability.isHMSAvailable().then((value) async { + // if (value != 0) { + // final fcmToken = await FirebaseMessaging.instance.getToken(); + // if (fcmToken != null) onToken(fcmToken); + // } + // }).catchError((err) {}); } if (Platform.isIOS) { @@ -244,7 +244,6 @@ class PushNotificationHandler { // 'Android GMS or iOS' (Handle Firebase Messaging Streams FirebaseMessaging.instance.getInitialMessage().then((RemoteMessage message) async { - print("Firebase getInitialMessage with message : ${message.data.toString()}"); subscribeFCMTopic(); if (Platform.isIOS) await Future.delayed(Duration(milliseconds: 3000)).then((value) { @@ -288,29 +287,29 @@ class PushNotificationHandler { FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler); if (Platform.isAndroid) { - await hmsApiAvailability.isHMSAvailable().then((value) async { - if (value == 0) { - h_push.Push.enableLogger(); - final result = await h_push.Push.setAutoInitEnabled(true); - - h_push.Push.onNotificationOpenedApp.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.onMessageReceivedStream.listen((message) { - newMessage(toFirebaseRemoteMessage(message)); - }, onError: (e) => print(e.toString())); - - h_push.Push.getTokenStream.listen((token) { - onToken(token); - }, onError: (e) => print(e.toString())); - await h_push.Push.getToken(''); - - h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); - } - }).catchError((err) { - print(err); - }); + // await hmsApiAvailability.isHMSAvailable().then((value) async { + // if (value == 0) { + // h_push.Push.enableLogger(); + // final result = await h_push.Push.setAutoInitEnabled(true); + // + // h_push.Push.onNotificationOpenedApp.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.onMessageReceivedStream.listen((message) { + // newMessage(toFirebaseRemoteMessage(message)); + // }, onError: (e) => print(e.toString())); + // + // h_push.Push.getTokenStream.listen((token) { + // onToken(token); + // }, onError: (e) => print(e.toString())); + // await h_push.Push.getToken(''); + // + // h_push.Push.registerBackgroundMessageHandler(backgroundMessageHandler); + // } + // }).catchError((err) { + // print(err); + // }); } }