From e50a67ea122a14778c1b4b9cec155f156155a49a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 21 Dec 2022 15:59:56 +0300 Subject: [PATCH 01/50] Vida Plus changes --- lib/config/config.dart | 7 +- .../request_patient_lab_special_result.dart | 4 ++ .../labs/request_send_lab_report_email.dart | 4 ++ lib/core/service/client/base_app_client.dart | 28 ++------ lib/core/service/medical/labs_service.dart | 12 ++-- .../service/medical/radiology_service.dart | 3 +- lib/main.dart | 2 +- lib/pages/login/login.dart | 24 +++---- lib/uitl/push-notification-handler.dart | 65 +++++++++---------- 9 files changed, 72 insertions(+), 77 deletions(-) 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); + // }); } } From 98abc5a0692c0dd65edbdc2e6ec8e5f86c540a5c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 19 Jan 2023 09:37:34 +0300 Subject: [PATCH 02/50] updates --- .../PharmacyAddressesViewModel.dart | 2 +- .../NewCMC/cmc_location_page.dart | 2 +- .../NewCMC/new_cmc_step_tow_page.dart | 2 +- .../NewHomeHealthCare/location_page.dart | 2 +- .../new_Home_health_care_step_one_page.dart | 2 +- .../new_Home_health_care_step_tow_page.dart | 2 +- .../rrt-pickup-address-page.dart | 4 +- lib/pages/feedback/send_feedback_page.dart | 44 ++++++------ .../pharmacyAddresses/AddAddress.dart | 2 +- lib/uitl/LocalNotification.dart | 26 +++---- lib/widgets/others/bottom_bar.dart | 70 +++++++++---------- .../others/floating_button_search.dart | 44 ++++++------ .../pickupLocation/PickupLocationFromMap.dart | 2 +- 13 files changed, 102 insertions(+), 102 deletions(-) diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index 5a098b6f..ea9af54d 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index fbef90e6..f45d2942 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -25,7 +25,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 87d55b72..e846d31c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:permission_handler/permission_handler.dart'; import 'cmc_location_page.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index e96ddcc7..78e13982 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -23,7 +23,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 7984cbbf..3a59b21e 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -12,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index 5328bfba..9cc194f1 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -21,7 +21,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'location_page.dart'; diff --git a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart index 2008ef4c..c12cdb26 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-pickup-address-page.dart @@ -318,7 +318,7 @@ class RRTRequestPickupAddressPageState extends State { final formKey = GlobalKey(); MessageType messageType = MessageType.NON; var _currentLocaleId; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; int selectedStatusIndex = 5; var event = RobotProvider(); @@ -520,23 +520,23 @@ class _SendFeedbackPageState extends State { openSpeechReco() async { new RoboSearch(context: context).showAlertDialog(context); _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - if (available) { - speech.listen( - onResult: resultListener, - listenMode: stt.ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // if (available) { + // speech.listen( + // onResult: resultListener, + // listenMode: stt.ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } } - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - //SpeechToText.closeAlertDialog(context); - print(error); - } + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // SpeechToText.closeAlertDialog(context); + // print(error); + // } void statusListener(String status) { reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; @@ -556,14 +556,14 @@ class _SendFeedbackPageState extends State { setState(() { messageController.text += reconizedWord + '\n'; RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); }); } } Future initSpeechState() async { - bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); - print(hasSpeech); - if (!mounted) return; + // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); + // print(hasSpeech); + // if (!mounted) return; } } diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index dcc4b299..d93e0c3a 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class AddAddressPage extends StatefulWidget { diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 3d31e84b..c6e1685d 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -30,9 +30,9 @@ class LocalNotification { _initialize() { var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); - var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); - var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); - flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); + // var initializationSettingsIOS = IOSInitializationSettings(onDidReceiveLocalNotification: null); + // var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); + // flutterLocalNotificationsPlugin.initialize(initializationSettings, onSelectNotification: _onNotificationClick); } var _random = new Random(); @@ -55,11 +55,11 @@ class LocalNotification { Future.delayed(Duration(seconds: 1)).then((result) async { var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern()); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); - var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { - print(err); - }); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { + // print(err); + // }); }); } @@ -84,18 +84,18 @@ class LocalNotification { ledColor: const Color.fromARGB(255, 255, 0, 0), ledOnMs: 1000, ledOffMs: 500); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(sound: 'slow_spring_board.aiff'); // /change it to be as ionic - var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); + // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + // await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); } ///Repeat notification every day at approximately 10:00:00 am Future showDailyAtTime() async { var time = Time(10, 0, 0); var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // await flutterLocalNotificationsPlugin.showDailyAtTime( @@ -110,7 +110,7 @@ class LocalNotification { Future showWeeklyAtDayAndTime() async { var time = Time(10, 0, 0); var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); - var iOSPlatformChannelSpecifics = IOSNotificationDetails(); + // var iOSPlatformChannelSpecifics = IOSNotificationDetails(); // var platformChannelSpecifics = NotificationDetails( // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 03622a7a..04f4f851 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -33,9 +33,9 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_recognition_result.dart'; -import 'package:speech_to_text/speech_to_text.dart'; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_recognition_result.dart'; +// import 'package:speech_to_text/speech_to_text.dart'; class BottomBarSearch extends StatefulWidget { @override @@ -47,7 +47,7 @@ class _SearchBot extends State { RobotProvider Provider = RobotProvider(); bool isLoading = false; bool isError = false; - final SpeechToText speech = SpeechToText(); + // final SpeechToText speech = SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -112,33 +112,33 @@ class _SearchBot extends State { } startVoiceSearch() async { - speech.listen( - onResult: resultListener, - listenFor: Duration(seconds: 10), - localeId: _currentLocaleId, - onSoundLevelChange: soundLevelListener, - cancelOnError: true, - partialResults: true, - onDevice: true, - listenMode: ListenMode.confirmation); + // speech.listen( + // onResult: resultListener, + // listenFor: Duration(seconds: 10), + // localeId: _currentLocaleId, + // onSoundLevelChange: soundLevelListener, + // cancelOnError: true, + // partialResults: true, + // onDevice: true, + // listenMode: ListenMode.confirmation); } - void resultListener(SpeechRecognitionResult result) { - // lastWords = "${result.recognizedWords} - ${result.finalResult}"; - - if (result.finalResult == true) { - // setState(() { - reconizedWord = result.recognizedWords; - //}); - setState(() { - searchController.text = reconizedWord; - }); - Future.delayed(const Duration(seconds: 1), () { - _speak(reconizedWord); - }); - } - //}); - } + // void resultListener(SpeechRecognitionResult result) { + // // lastWords = "${result.recognizedWords} - ${result.finalResult}"; + // + // if (result.finalResult == true) { + // // setState(() { + // reconizedWord = result.recognizedWords; + // //}); + // setState(() { + // searchController.text = reconizedWord; + // }); + // Future.delayed(const Duration(seconds: 1), () { + // _speak(reconizedWord); + // }); + // } + // //}); + // } Future _speak(reconizedWord) async { //await flutterTts.speak(reconizedWord); @@ -162,7 +162,7 @@ class _SearchBot extends State { } Future initSpeechState() async { - await speech.initialize(onError: errorListener, onStatus: statusListener); + // await speech.initialize(onError: errorListener, onStatus: statusListener); _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' @@ -173,11 +173,11 @@ class _SearchBot extends State { // if (!mounted) return; } - void errorListener(SpeechRecognitionError error) { - //setState(() { - // reconizedWord = "${error.errorMsg} - ${error.permanent}"; - //}); - } + // void errorListener(SpeechRecognitionError error) { + // //setState(() { + // // reconizedWord = "${error.errorMsg} - ${error.permanent}"; + // //}); + // } void statusListener(String status) { //setState(() { diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 10f30b71..5b2c995e 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -66,8 +66,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; -import 'package:speech_to_text/speech_recognition_error.dart'; -import 'package:speech_to_text/speech_to_text.dart' as stt; +// import 'package:speech_to_text/speech_recognition_error.dart'; +// import 'package:speech_to_text/speech_to_text.dart' as stt; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -83,7 +83,7 @@ class _FloatingSearchButton extends State with TickerProvi RobotProvider eventProvider = RobotProvider(); bool isLoading = false; bool isError = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); String error = ''; String _currentLocaleId = ""; String lastError; @@ -235,18 +235,18 @@ class _FloatingSearchButton extends State with TickerProvi } startVoiceSearch() async { - bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); - _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - - if (available) { - speech.listen( - onResult: resultListener, - //listenMode: ListenMode.confirmation, - localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', - ); - } else { - print("The user has denied the use of speech recognition."); - } + // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); + // _currentLocaleId = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + + // if (available) { + // speech.listen( + // onResult: resultListener, + // //listenMode: ListenMode.confirmation, + // localeId: _currentLocaleId == 'en' ? 'en_US' : 'ar_SA', + // ); + // } else { + // print("The user has denied the use of speech recognition."); + // } // some time later... //speech.stop(); // speech.listen( @@ -305,7 +305,7 @@ class _FloatingSearchButton extends State with TickerProvi isArabic = Provider.of(context, listen: false).isArabic; await requestPermissions(); getUserData(); - await speech.initialize(onError: errorListener, onStatus: statusListener); + // await speech.initialize(onError: errorListener, onStatus: statusListener); //initialSpeak(); if (!mounted) return; @@ -315,10 +315,10 @@ class _FloatingSearchButton extends State with TickerProvi // }); } - void errorListener(SpeechRecognitionError error) { - event.setValue({"searchText": 'null'}); - RoboSearch.closeAlertDialog(context); - } + // void errorListener(SpeechRecognitionError error) { + // event.setValue({"searchText": 'null'}); + // RoboSearch.closeAlertDialog(context); + // } void statusListener(String status) { //setState(() { @@ -951,7 +951,7 @@ class _MyStatefulBuilderState extends State { var searchText; static StreamSubscription streamSubscription; static var isClosed = false; - stt.SpeechToText speech = stt.SpeechToText(); + // stt.SpeechToText speech = stt.SpeechToText(); @override void initState() { @@ -1019,7 +1019,7 @@ class _MyStatefulBuilderState extends State { TranslationBase.of(context).ok, () { RoboSearch.closeAlertDialog(context); - speech.stop(); + // speech.stop(); // event.setValue({"searchText": { // 'isIOSFeedback':true, // diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index e5639f5c..d8aa1642 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; From 8e140844678ce8c8762d8cbfbf2759437c4b6918 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 19 Jan 2023 09:50:15 +0300 Subject: [PATCH 03/50] updates --- lib/config/config.dart | 2 +- .../pharmacyModule/PharmacyAddressesViewModel.dart | 1 - .../NewCMC/cmc_location_page.dart | 2 +- .../NewCMC/new_cmc_step_tow_page.dart | 2 +- .../HomeHealthCare/NewHomeHealthCare/location_page.dart | 2 +- .../new_Home_health_care_step_one_page.dart | 2 +- .../new_Home_health_care_step_tow_page.dart | 2 +- lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart | 2 +- lib/widgets/pickupLocation/PickupLocationFromMap.dart | 2 +- pubspec.yaml | 6 +++--- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3fea4c82..9680994d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -412,7 +412,7 @@ 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 = 7.6; +var VERSION_ID = 9.9; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart index ea9af54d..947ace34 100644 --- a/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart @@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer import 'package:diplomaticquarterapp/services/pharmacy_services/pharmacyAddress_service.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:geocoding/geocoding.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; import '../../../locator.dart'; import '../base_view_model.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart index f45d2942..fbef90e6 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/cmc_location_page.dart @@ -25,7 +25,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index e846d31c..87d55b72 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -20,7 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:permission_handler/permission_handler.dart'; import 'cmc_location_page.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index 78e13982..e96ddcc7 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -23,7 +23,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 3a59b21e..7984cbbf 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -12,7 +12,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class NewHomeHealthCareStepOnePage extends StatefulWidget { diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index 9cc194f1..5328bfba 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -21,7 +21,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'location_page.dart'; diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index d93e0c3a..dcc4b299 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -16,7 +16,7 @@ import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:provider/provider.dart'; class AddAddressPage extends StatefulWidget { diff --git a/lib/widgets/pickupLocation/PickupLocationFromMap.dart b/lib/widgets/pickupLocation/PickupLocationFromMap.dart index d8aa1642..e5639f5c 100644 --- a/lib/widgets/pickupLocation/PickupLocationFromMap.dart +++ b/lib/widgets/pickupLocation/PickupLocationFromMap.dart @@ -13,7 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:geocoding/geocoding.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:google_maps_place_picker_mb/google_maps_place_picker.dart'; +import 'package:google_maps_place_picker/google_maps_place_picker.dart'; import 'package:huawei_hmsavailability/huawei_hmsavailability.dart'; import 'package:provider/provider.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index 7acc49ed..30b311be 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -209,9 +209,9 @@ dependency_overrides: permission_handler : ^6.0.1+1 flutter_svg: ^1.0.0 # firebase_messaging_platform_interface: any - flutter_inappwebview: - git: - url: https://github.com/CodeEagle/flutter_inappwebview + flutter_inappwebview: 5.7.2+3 +# git: +# url: https://github.com/CodeEagle/flutter_inappwebview dev_dependencies: From 83c15196c8cf48d1e517a3c882266104cb39ddd1 Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Sun, 21 May 2023 18:25:57 +0300 Subject: [PATCH 04/50] VIDA PLUS CHANGE --- lib/config/config.dart | 6 +++--- lib/core/model/radiology/final_radiology.dart | 6 +++++- lib/pages/medical/radiology/radiology_home_page.dart | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index cd192911..8c32434d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,9 +21,9 @@ 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://orash.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://oras§h.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart index 7a9121fa..d92ffead 100644 --- a/lib/core/model/radiology/final_radiology.dart +++ b/lib/core/model/radiology/final_radiology.dart @@ -3,9 +3,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class FinalRadiology { String setupID; int projectID; - Null patientID; + dynamic patientID; int invoiceLineItemNo; int invoiceNo; + dynamic invoiceNo_VP; int doctorID; int clinicID; DateTime orderDate; @@ -49,6 +50,7 @@ class FinalRadiology { this.patientID, this.invoiceLineItemNo, this.invoiceNo, + this.invoiceNo_VP, this.doctorID, this.clinicID, this.orderDate, @@ -92,6 +94,7 @@ class FinalRadiology { patientID = json['PatientID']; invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; doctorID = json['DoctorID']; clinicID = json['ClinicID']; orderDate = DateUtil.convertStringToDate(json['OrderDate']); @@ -141,6 +144,7 @@ class FinalRadiology { data['PatientID'] = this.patientID; data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['DoctorID'] = this.doctorID; data['ClinicID'] = this.clinicID; data['OrderDate'] = this.orderDate; diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 4e22dcf6..8a98401a 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -83,7 +83,7 @@ class RadiologyHomePage extends StatelessWidget { ), isInOutPatient: radiology.isInOutPatient, name: TranslationBase.of(context).dr + " " + radiology.doctorName, - billNo: radiology.invoiceNo.toString(), + billNo: radiology.invoiceNo_VP.toString(), profileUrl: radiology.doctorImageURL, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, isLiveCareAppointment: radiology.isLiveCareAppointment, From 0514fecae265f01e6bf1b8dd02b9101714a01d0e Mon Sep 17 00:00:00 2001 From: Sultan khan <> Date: Tue, 23 May 2023 10:40:40 +0300 Subject: [PATCH 05/50] lab report email change --- lib/core/model/labs/patient_lab_orders.dart | 4 ++++ lib/core/model/labs/request_send_lab_report_email.dart | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart index 3c49b80a..c2908023 100644 --- a/lib/core/model/labs/patient_lab_orders.dart +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -16,6 +16,7 @@ class PatientLabOrders { int gender; String genderDescription; String invoiceNo; + String invoiceNo_VP; bool isActiveDoctorProfile; bool isDoctorAllowVedioCall; bool isExecludeDoctor; @@ -68,6 +69,7 @@ class PatientLabOrders { this.projectNameN, this.qR, this.setupID, + this.invoiceNo_VP, this.speciality,this.isLiveCareAppointment}); PatientLabOrders.fromJson(Map json) { @@ -103,6 +105,7 @@ class PatientLabOrders { projectNameN = json['ProjectNameN']; qR = json['QR']; setupID = json['SetupID']; + invoiceNo_VP = json['invoiceNo_VP']; isLiveCareAppointment = json['IsLiveCareAppointment']; // speciality = json['Speciality'].cast(); } @@ -143,6 +146,7 @@ class PatientLabOrders { data['SetupID'] = this.setupID; data['Speciality'] = this.speciality; data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + data['invoiceNo_VP'] =this.invoiceNo_VP; return data; } } 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 dcd28b5b..53a6f7b7 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -79,7 +79,7 @@ class RequestSendLabReportEmail { doctorName = json['DoctorName']; projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; - invoiceNo = json['InvoiceNo_VP']; + invoiceNoVP = json['InvoiceNo_VP']; orderDate = json['OrderDate']; } @@ -109,7 +109,7 @@ class RequestSendLabReportEmail { data['DoctorName'] = this.doctorName; data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; - data['InvoiceNo_VP'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNoVP; data['OrderDate'] = this.orderDate; return data; } From 3675d05911294358085e235b2b3473a42fa60ced Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 May 2023 11:47:38 +0300 Subject: [PATCH 06/50] config changes --- lib/config/config.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 8c32434d..c22e6e38 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -22,8 +22,9 @@ 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://oras§h.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; From 17e788690779081162b156c41be70084011e574a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 25 May 2023 09:36:16 +0300 Subject: [PATCH 07/50] VidaPlus Project changes --- .../privilege/VidaPlusProjectListModel.dart | 15 ++++++++ lib/core/service/medical/labs_service.dart | 20 ++++++----- .../service/medical/radiology_service.dart | 13 ++++--- lib/core/service/privilege_service.dart | 12 +++++-- .../viewModels/medical/labs_view_model.dart | 12 +++---- lib/core/viewModels/project_view_model.dart | 34 ++++++++++++------- .../medical/labs/laboratory_result_page.dart | 15 ++++---- lib/splashPage.dart | 1 + lib/uitl/utils.dart | 12 +++++++ .../LabResult/laboratory_result_widget.dart | 3 +- 10 files changed, 96 insertions(+), 41 deletions(-) create mode 100644 lib/core/model/privilege/VidaPlusProjectListModel.dart diff --git a/lib/core/model/privilege/VidaPlusProjectListModel.dart b/lib/core/model/privilege/VidaPlusProjectListModel.dart new file mode 100644 index 00000000..e56b82db --- /dev/null +++ b/lib/core/model/privilege/VidaPlusProjectListModel.dart @@ -0,0 +1,15 @@ +class VidaPlusProjectListModel { + int projectID; + + VidaPlusProjectListModel({this.projectID}); + + VidaPlusProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 9703874e..e9c9d846 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -32,12 +32,14 @@ class LabsService extends BaseService { List labResultList = List(); List labOrdersResultsList = List(); - Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { + Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { hasError = false; _requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.clinicID = clinicID; - _requestPatientLabSpecialResult.invoiceNo = "0"; - _requestPatientLabSpecialResult.invoiceNoVP = invoiceNo; + + _requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo; + _requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0"; + _requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.setupID = setupID; @@ -52,11 +54,11 @@ class LabsService extends BaseService { }, body: _requestPatientLabSpecialResult.toJson()); } - Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { + Future getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async { hasError = false; Map body = Map(); - body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; - body['InvoiceNo'] = "0"; + body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0"; + body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; @@ -179,10 +181,10 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { + Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj, bool isVidaPlus}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; - _requestSendLabReportEmail.invoiceNo = "0"; - _requestSendLabReportEmail.invoiceNoVP = patientLabOrder.invoiceNo; + _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo; + _requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0"; _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 44940b31..6c8ed698 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -1,7 +1,6 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -29,9 +28,15 @@ class RadiologyService extends BaseService { await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { finalRadiologyList.clear(); // response['FinalRadiologyList'].forEach((radiology) { - response['FinalRadiologyListAPI'].forEach((radiology) { - finalRadiologyList.add(FinalRadiology.fromJson(radiology)); - }); + if (response['FinalRadiologyList'].length != 0) { + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + } else { + response['FinalRadiologyListAPI'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index 5beef992..e9b2d8a9 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -1,19 +1,25 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class PrivilegeService extends BaseService { - List privilegeModelList = List(); + List vidaPlusProjectListModel = List(); Future getPrivilege() async { Map body = Map(); body['PatientType'] = 4; - await baseAppClient.post(GET_PRIVILEGE, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) { response['ServicePrivilegeList'].forEach((item) { privilegeModelList.add(PrivilegeModel.fromJson(item)); }); + + if (response['ProjectListVidaPlus'].length != 0) { + response['ProjectListVidaPlus'].forEach((item) { + vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index e42dbbb4..3d4b1039 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -72,9 +72,9 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); - getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { + getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID); + await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -83,9 +83,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabResult({PatientLabOrders patientLabOrder}) async { + getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); @@ -135,8 +135,8 @@ class LabsViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isVidaPlus}) async { + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; } else diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index c45e7dd8..d3b7566c 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; @@ -15,8 +16,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; var isAppArabic = false; -class ProjectViewModel extends BaseViewModel { +class ProjectViewModel extends BaseViewModel { GAnalytics get analytics => locator(); // Platform Bridge @@ -39,10 +40,14 @@ class ProjectViewModel extends BaseViewModel { double _latitude; double _longitude; - RegisterInfoResponse _registerInfo =RegisterInfoResponse(); + RegisterInfoResponse _registerInfo = RegisterInfoResponse(); + double get latitude => _latitude; + double get longitude => _longitude; - RegisterInfoResponse get registerInfo=> _registerInfo; + + RegisterInfoResponse get registerInfo => _registerInfo; + dynamic get searchValue => searchvalue; Locale get appLocal => _appLocale; @@ -54,9 +59,11 @@ class ProjectViewModel extends BaseViewModel { bool isLoginChild = false; List privilegeRootUser = List(); List privilegeChildUser = List(); + List _vidaPlusProjectListModel = List(); - List get privileges => - isLoginChild ? privilegeChildUser : privilegeChildUser; + List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; + + List get vidaPlusProjectList => _vidaPlusProjectListModel; List selectedBodyPartList = []; @@ -64,9 +71,7 @@ class ProjectViewModel extends BaseViewModel { ProjectViewModel() { loadSharedPrefLanguage(); - subscription = Connectivity() - .onConnectivityChanged - .listen((ConnectivityResult result) { + subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) { switch (result) { case ConnectivityResult.wifi: isInternetConnection = true; @@ -89,8 +94,7 @@ class ProjectViewModel extends BaseViewModel { } Future loadSharedPrefLanguage() async { - currentLanguage = - await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); _appLocale = Locale(currentLanguage); isAppArabic = _isArabic = currentLanguage == 'ar'; notifyListeners(); @@ -121,6 +125,11 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setVidaPlusProjectList(List vidaPlusProjectListModelInput) { + _vidaPlusProjectListModel = vidaPlusProjectListModelInput; + notifyListeners(); + } + setPrivilege({privilegeList, bool isLoginChild = false}) { List privilege = List(); @@ -166,8 +175,9 @@ class ProjectViewModel extends BaseViewModel { searchvalue = data; notifyListeners(); } - setRegisterData(RegisterInfoResponse data){ - _registerInfo =data; + + setRegisterData(RegisterInfoResponse data) { + _registerInfo = data; notifyListeners(); } } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 847f979b..2a77436f 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -25,11 +26,13 @@ class _LaboratoryResultPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getLaboratoryResult( - invoiceNo: widget.patientLabOrders.invoiceNo, - clinicID: widget.patientLabOrders.clinicID, - projectID: widget.patientLabOrders.projectID, - orderNo: widget.patientLabOrders.orderNo, - setupID: widget.patientLabOrders.setupID), + invoiceNo: widget.patientLabOrders.invoiceNo, + clinicID: widget.patientLabOrders.clinicID, + projectID: widget.patientLabOrders.projectID, + orderNo: widget.patientLabOrders.orderNo, + setupID: widget.patientLabOrders.setupID, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), + ), builder: (_, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: widget.patientLabOrders.doctorName, @@ -43,7 +46,7 @@ class _LaboratoryResultPageState extends State { itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 5876ed99..04e1c3b5 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -54,6 +54,7 @@ class _SplashScreenState extends State { await _privilegeService.getPrivilege(); ProjectViewModel projectProvider = Provider.of(context, listen: false); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); + projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); var themeNotifier = Provider.of(context, listen: false); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 001baf50..a417f40b 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -809,6 +809,18 @@ class Utils { static String generateMd5Hash(String input) { return crypto.md5.convert(utf8.encode(input)).toString(); } + + static bool isVidaPlusProject(ProjectViewModel projectViewModel, int projectID) { + bool isVidaPlus = false; + projectViewModel.vidaPlusProjectList.forEach((element) { + if (element.projectID == projectID) { + isVidaPlus = true; + } else { + isVidaPlus = false; + } + }); + return isVidaPlus; + } } Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index d54249da..3436523d 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:flutter/cupertino.dart'; @@ -35,7 +36,7 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder), + onModelReady: (model) => model.getPatientLabResult(isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrder.projectID)), patientLabOrder: widget.patientLabOrder), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Column( From 77f3d0a2383221cca2d3503676b83c0f635476e1 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 28 May 2023 10:02:46 +0300 Subject: [PATCH 08/50] radiology API fixes --- lib/core/service/medical/radiology_service.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index 6c8ed698..a289cebd 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -28,7 +28,7 @@ class RadiologyService extends BaseService { await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { finalRadiologyList.clear(); // response['FinalRadiologyList'].forEach((radiology) { - if (response['FinalRadiologyList'].length != 0) { + if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { response['FinalRadiologyList'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); From 2437d2da9ceffd2da3cb52c3b32a9373b55a972c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 30 May 2023 14:49:52 +0300 Subject: [PATCH 09/50] Updates --- lib/config/config.dart | 8 ++-- .../request_send_rad_report_email.dart | 4 ++ lib/core/service/client/base_app_client.dart | 2 +- .../service/medical/radiology_service.dart | 6 +++ .../medical/radiology_view_model.dart | 5 +++ .../medical/ask_doctor/doctor_response.dart | 41 +++++++++---------- .../radiology/radiology_details_page.dart | 7 ++-- .../radiology/radiology_home_page.dart | 4 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 9 files changed, 49 insertions(+), 32 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index c22e6e38..a8bc93d3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,8 +23,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // 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/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -39,7 +39,9 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -var RC_BASE_URL = 'https://rc.hmg.com/'; +// var RC_BASE_URL = 'https://rc.hmg.com/'; + +var RC_BASE_URL = 'https://ms.hmg.com/rc/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart index a461156e..6819de0d 100644 --- a/lib/core/model/radiology/request_send_rad_report_email.dart +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -6,6 +6,7 @@ class RequestSendRadReportEmail { String doctorName; String generalid; int invoiceNo; + int invoiceNo_VP; String iPAdress; bool isDentalAllowedBackend; int languageID; @@ -35,6 +36,7 @@ class RequestSendRadReportEmail { this.doctorName, this.generalid, this.invoiceNo, + this.invoiceNo_VP, this.iPAdress, this.isDentalAllowedBackend, this.languageID, @@ -63,6 +65,7 @@ class RequestSendRadReportEmail { doctorName = json['DoctorName']; generalid = json['generalid']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; iPAdress = json['IPAdress']; isDentalAllowedBackend = json['isDentalAllowedBackend']; languageID = json['LanguageID']; @@ -94,6 +97,7 @@ class RequestSendRadReportEmail { data['DoctorName'] = this.doctorName; data['generalid'] = this.generalid; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['IPAdress'] = this.iPAdress; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['LanguageID'] = this.languageID; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index db9cc5e8..7d38d794 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 3649158; //3844083 + // body['PatientID'] = 336; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index a289cebd..5a586356 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -8,10 +8,13 @@ class RadiologyService extends BaseService { List finalRadiologyList = List(); String url = ''; + bool isRadiologyVIDAPlus = false; + Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; + body['InvoiceNo_VP'] = invoiceNo; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; @@ -29,10 +32,12 @@ class RadiologyService extends BaseService { finalRadiologyList.clear(); // response['FinalRadiologyList'].forEach((radiology) { if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { + isRadiologyVIDAPlus = false; response['FinalRadiologyList'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); } else { + isRadiologyVIDAPlus = true; response['FinalRadiologyListAPI'].forEach((radiology) { finalRadiologyList.add(FinalRadiology.fromJson(radiology)); }); @@ -62,6 +67,7 @@ class RadiologyService extends BaseService { _requestSendRadReportEmail.projectID = finalRadiology.projectID; _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; + _requestSendRadReportEmail.invoiceNo_VP = finalRadiology.invoiceNo_VP; _requestSendRadReportEmail.invoiceLineItemNo = finalRadiology.invoiceLineItemNo; _requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName; diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index e944b685..311c4366 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -18,9 +18,14 @@ class RadiologyViewModel extends BaseViewModel { List get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; + bool _isRadiologyVIDAPlus = false; + + bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; + void getPatientRadOrders() async { setState(ViewState.Busy); await _radiologyService.getPatientRadOrders(); + _isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus; if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/pages/medical/ask_doctor/doctor_response.dart b/lib/pages/medical/ask_doctor/doctor_response.dart index 37e5f1c9..1ff9def7 100644 --- a/lib/pages/medical/ask_doctor/doctor_response.dart +++ b/lib/pages/medical/ask_doctor/doctor_response.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -27,7 +28,7 @@ class DoctorResponse extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 65, + height: 16, ), AppExpandableNotifier( headerWidget: Padding( @@ -61,14 +62,18 @@ class DoctorResponse extends StatelessWidget { return InkWell( onTap: () { ///go to page ViewDoctorResponsesPage - Navigator.push( - context, - FadePage( - page: ViewDoctorResponsesPage( - doctorResponse: doctor, + if (doctor.transactions != null && doctor.transactions.isNotEmpty) { + Navigator.push( + context, + FadePage( + page: ViewDoctorResponsesPage( + doctorResponse: doctor, + ), ), - ), - ); + ); + } else { + Utils.showErrorToast("There are no doctor responses for this request."); + } }, child: Container( height: 100, @@ -85,24 +90,20 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), - Texts( - '${doctor.requestTypeDescription}'), + Texts('${doctor.requestTypeDescription}'), ], ), ), ), Padding( padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), - child: Icon(projectViewModel.isArabic - ? Icons.arrow_forward_ios - : Icons.arrow_back_ios), + child: Icon(projectViewModel.isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios), ) ], ), @@ -158,24 +159,20 @@ class DoctorResponse extends StatelessWidget { child: Padding( padding: const EdgeInsets.all(8.0), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts('${doctor.doctorName}'), SizedBox( height: 5, ), - Texts( - '${doctor.requestTypeDescription}'), + Texts('${doctor.requestTypeDescription}'), ], ), ), ), Padding( padding: const EdgeInsets.all(8.0), - child: Icon(projectViewModel.isArabic - ? Icons.arrow_forward_ios - : Icons.arrow_back_ios), + child: Icon(projectViewModel.isArabic ? Icons.arrow_back_ios : Icons.arrow_forward_ios), ) ], ), diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index a84acbae..c7513757 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -1,6 +1,5 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; -import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; @@ -19,14 +18,16 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; + bool isRadiologyVidaPlus; - RadiologyDetailsPage({Key key, this.finalRadiology}); + RadiologyDetailsPage({Key key, this.finalRadiology, this.isRadiologyVidaPlus}); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getRadImageURL(projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), + onModelReady: (model) => model.getRadImageURL( + projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isRadiologyVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( appBarTitle: TranslationBase.of(context).report, isShowAppBar: true, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 8a98401a..2c18dc09 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; @@ -78,12 +79,13 @@ class RadiologyHomePage extends StatelessWidget { FadePage( page: RadiologyDetailsPage( finalRadiology: radiology, + isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID), ), ), ), isInOutPatient: radiology.isInOutPatient, name: TranslationBase.of(context).dr + " " + radiology.doctorName, - billNo: radiology.invoiceNo_VP.toString(), + billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(), profileUrl: radiology.doctorImageURL, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, isLiveCareAppointment: radiology.isLiveCareAppointment, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e91990b4..ba9d79ee 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -39,9 +39,9 @@ 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://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From cf30762eecd9de24b6effeaf37e6e3e41c2e6531 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 1 Jun 2023 12:17:29 +0300 Subject: [PATCH 10/50] updates --- lib/core/model/labs/request_send_lab_report_email.dart | 5 ++++- lib/core/service/client/base_app_client.dart | 4 ++-- lib/core/service/medical/labs_service.dart | 1 + lib/core/service/medical/radiology_service.dart | 6 +++--- lib/core/viewModels/medical/radiology_view_model.dart | 4 ++-- lib/pages/medical/radiology/radiology_details_page.dart | 8 ++++++-- lib/pages/medical/radiology/radiology_home_page.dart | 1 + lib/uitl/utils.dart | 2 -- 8 files changed, 19 insertions(+), 12 deletions(-) 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 53a6f7b7..4f2fc02a 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -25,6 +25,7 @@ class RequestSendLabReportEmail { String invoiceNo; String invoiceNoVP; String orderDate; + String orderNo; RequestSendLabReportEmail( {this.versionID, @@ -52,7 +53,7 @@ class RequestSendLabReportEmail { this.projectID, this.invoiceNo, this.invoiceNoVP, - this.orderDate}); + this.orderDate, this.orderNo}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; @@ -81,6 +82,7 @@ class RequestSendLabReportEmail { invoiceNo = json['InvoiceNo']; invoiceNoVP = json['InvoiceNo_VP']; orderDate = json['OrderDate']; + orderNo = json['OrderNo']; } Map toJson() { @@ -111,6 +113,7 @@ class RequestSendLabReportEmail { data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo_VP'] = this.invoiceNoVP; data['OrderDate'] = this.orderDate; + data['OrderNo'] = this.orderNo; return data; } } diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 7d38d794..bd89c933 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 336; //3844083 - // body['TokenID'] = "@dm!n"; + body['PatientID'] = 339; //3844083 + body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index e9c9d846..ab3cd829 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -195,6 +195,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.patientMobileNumber = userObj.mobileNumber; _requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.setupID = patientLabOrder.setupID; + _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index 5a586356..f2a54c0c 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -10,11 +10,11 @@ class RadiologyService extends BaseService { bool isRadiologyVIDAPlus = false; - Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { + Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { hasError = false; final Map body = new Map(); - body['InvoiceNo'] = invoiceNo; - body['InvoiceNo_VP'] = invoiceNo; + body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; + body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; body['LineItemNo'] = lineItem; body['ProjectID'] = projectId; diff --git a/lib/core/viewModels/medical/radiology_view_model.dart b/lib/core/viewModels/medical/radiology_view_model.dart index 311c4366..3ee6fedf 100644 --- a/lib/core/viewModels/medical/radiology_view_model.dart +++ b/lib/core/viewModels/medical/radiology_view_model.dart @@ -48,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel { String get radImageURL => _radiologyService.url; - getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { + getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { setState(ViewState.Busy); - await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId); + await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); if (_radiologyService.hasError) { error = _radiologyService.error; setState(ViewState.Error); diff --git a/lib/pages/medical/radiology/radiology_details_page.dart b/lib/pages/medical/radiology/radiology_details_page.dart index c7513757..7e609370 100644 --- a/lib/pages/medical/radiology/radiology_details_page.dart +++ b/lib/pages/medical/radiology/radiology_details_page.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -27,7 +28,10 @@ class RadiologyDetailsPage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getRadImageURL( - projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: isRadiologyVidaPlus ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo), + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID)), builder: (_, model, widget) => AppScaffold( appBarTitle: TranslationBase.of(context).report, isShowAppBar: true, @@ -46,7 +50,7 @@ class RadiologyDetailsPage extends StatelessWidget { finalRadiology.doctorID, finalRadiology.doctorImageURL, finalRadiology.speciality, - finalRadiology.invoiceNo.toString(), + Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(), finalRadiology.projectName, finalRadiology.orderDate, null, diff --git a/lib/pages/medical/radiology/radiology_home_page.dart b/lib/pages/medical/radiology/radiology_home_page.dart index 2c18dc09..9fc49cb5 100644 --- a/lib/pages/medical/radiology/radiology_home_page.dart +++ b/lib/pages/medical/radiology/radiology_home_page.dart @@ -86,6 +86,7 @@ class RadiologyHomePage extends StatelessWidget { isInOutPatient: radiology.isInOutPatient, name: TranslationBase.of(context).dr + " " + radiology.doctorName, billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(), + // billNo: radiology.invoiceNo_VP.toString(), profileUrl: radiology.doctorImageURL, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, isLiveCareAppointment: radiology.isLiveCareAppointment, diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index a417f40b..4d9904c7 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -815,8 +815,6 @@ class Utils { projectViewModel.vidaPlusProjectList.forEach((element) { if (element.projectID == projectID) { isVidaPlus = true; - } else { - isVidaPlus = false; } }); return isVidaPlus; From 101f2dcab8b7d3b32e27f2794b04ca4ce08a0e5f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 11 Jun 2023 13:39:32 +0300 Subject: [PATCH 11/50] updates --- lib/config/config.dart | 12 ++++++++---- lib/core/service/client/base_app_client.dart | 4 ++-- .../Covid-DriveThru/covid-drivethru-location.dart | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a8bc93d3..af5c606c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,16 +23,20 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // 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/'; -// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // // Pharmacy Production URLs -var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; + +// Pharmacy VidaPlus URLs +var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; +var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // // Pharmacy Pre-Production URLs // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index bd89c933..014e3eab 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - body['PatientID'] = 339; //3844083 - body['TokenID'] = "@dm!n"; + // body['PatientID'] = 339; //3844083 + // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index 4d0479e6..c85f53ae 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -126,7 +126,7 @@ class _CovidDrivethruLocationState extends State { value: item, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [Text(item.projectName), getCovidTestTypeImage(item)], + children: [Text(item.projectName ?? ""), getCovidTestTypeImage(item)], ), ); }).toList(), From 17acae0a95a62884a95bfae104955fd9d41abe77 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 11 Jun 2023 16:40:39 +0300 Subject: [PATCH 12/50] updates --- lib/core/service/client/base_app_client.dart | 4 ++-- lib/pages/ToDoList/ToDo.dart | 11 +++++++++-- lib/services/appointment_services/GetDoctorsList.dart | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 014e3eab..d88769a3 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 339; //3844083 - // body['TokenID'] = "@dm!n"; + body['PatientID'] = 454; //3844083 + body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d8eeded9..5f29e784 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1119,7 +1119,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { error_type: res['Response_Message']); } }).catchError((err) { - if(mounted) GifLoaderDialogUtils.hideDialog(context); + if (mounted) GifLoaderDialogUtils.hideDialog(context); print(err); }); } @@ -1130,7 +1130,14 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { String paymentReference = res['Fort_id'].toString(); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { GifLoaderDialogUtils.hideDialog(context); - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo, + res['OnlineCheckInAppointments'][0]); }).catchError((err) { print(err); GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index effa4445..dfd3ed32 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -961,6 +961,7 @@ class DoctorsListService extends BaseService { Request req = appGlobal.getPublicRequest(); request = { "AdvanceNumber": advanceNumber, + "AdvanceNumber_VP": advanceNumber, "PaymentReferenceNumber": paymentReference, "AppointmentID": appointmentID, "VersionID": req.VersionID, From f28fcbd006247bc4dbb10a9b8769b8120b4ae8fc Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 12 Jun 2023 13:37:20 +0300 Subject: [PATCH 13/50] AdvanceNumber_VP added --- lib/config/config.dart | 4 ++-- lib/core/service/client/base_app_client.dart | 6 +++--- .../ancillaryOrdersDetails.dart | 21 ++++++++----------- lib/pages/Blood/confirm_payment_page.dart | 13 ++++++++++-- lib/pages/BookAppointment/BookSuccess.dart | 10 +++++++-- .../covid-payment-summary.dart | 8 +++++-- .../medical/balance/confirm_payment_page.dart | 10 ++++++++- 7 files changed, 48 insertions(+), 24 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index af5c606c..470fba3b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,8 +23,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // 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/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index d88769a3..cf19dbac 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -77,7 +77,7 @@ class BaseAppClient { body['IPAdress'] = IP_ADDRESS; body['generalid'] = GENERAL_ID; - body['isVidaPlus'] = true; + // body['isVidaPlus'] = true; body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - body['PatientID'] = 454; //3844083 - body['TokenID'] = "@dm!n"; + // body['PatientID'] = 442; //3844083 + // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 1dd34876..eb411b46 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -560,7 +560,6 @@ class _AnicllaryOrdersState extends State with SingleTic } else { checkPaymentStatus(appo); } - } checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) { @@ -622,18 +621,16 @@ class _AnicllaryOrdersState extends State with SingleTic createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - service.HIS_createAdvancePayment( - appo, - widget.projectID.toString(), - res['Amount'], - res['Fort_id'], - res['PaymentMethod'], - projectViewModel.user.patientType, - projectViewModel.user.firstName + " " + projectViewModel.user.lastName, - projectViewModel.user.patientID, - localContext) + service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext) .then((res) { - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + 0, + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(localContext); AppToast.showErrorToast(message: err); diff --git a/lib/pages/Blood/confirm_payment_page.dart b/lib/pages/Blood/confirm_payment_page.dart index 4b3f96e2..bfd8f69a 100644 --- a/lib/pages/Blood/confirm_payment_page.dart +++ b/lib/pages/Blood/confirm_payment_page.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; @@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; import 'dialogs/ConfirmSMSDialog.dart'; import 'new_text_Field.dart'; @@ -31,11 +33,13 @@ class ConfirmPaymentPage extends StatelessWidget { MyInAppBrowser browser; AuthenticatedUser authenticatedUser; AppSharedPreferences sharedPref = AppSharedPreferences(); + ProjectViewModel projectViewModel; ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); void showSMSDialog() { showDialog( context: context, @@ -250,8 +254,13 @@ class ConfirmPaymentPage extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); - print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 890b96d8..83c3fdbd 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -1,6 +1,5 @@ import 'dart:io'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; @@ -46,6 +45,7 @@ class BookSuccess extends StatefulWidget { class _BookSuccessState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); + // AuthenticatedUser authUser; ProjectViewModel projectViewModel; @@ -775,7 +775,13 @@ class _BookSuccessState extends State { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString(), + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index d23be14a..e1f00173 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -402,8 +402,12 @@ class _CovidPaymentSummaryState extends State { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { - print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString()); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + appo.appointmentNo.toString()); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 7c562b43..a36eb4fd 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; + // import 'package:pay/pay.dart'; import 'package:provider/provider.dart'; @@ -52,6 +53,7 @@ class _ConfirmPaymentPageState extends State { String tamaraPaymentStatus; String tamaraOrderID; + // Pay _payClient; @override @@ -463,7 +465,13 @@ class _ConfirmPaymentPageState extends State { service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType, widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) .then((res) { - addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); + addAdvancedNumberRequest( + Utils.isVidaPlusProject(projectViewModel, appo.projectID) + ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() + : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), + paymentReference, + 0, + appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); AppToast.showErrorToast(message: err); From 58e598843bcf8da04801e83e3cb9377561755081 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 14 Jun 2023 10:27:08 +0300 Subject: [PATCH 14/50] sickleave --- lib/config/config.dart | 4 +-- lib/core/service/client/base_app_client.dart | 2 +- .../medical/patient_sick_leave_page.dart | 25 ++++++++++++------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 470fba3b..2777ebee 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,9 +21,9 @@ 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://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index cf19dbac..87faf867 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 442; //3844083 + // body['PatientID'] = 197; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 1ca32e02..3d977a96 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -57,8 +57,8 @@ class _PatientSickLeavePageState extends State { subName: model.sickLeaveList[index].clinicName, isSortByClinic: false, isInOutPatient: model.sickLeaveList[index].isInOutPatient, - // isSickLeave: true, - // sickLeaveStatus: model.sickLeaveList[index].status, + isSickLeave: true, + sickLeaveStatus: model.sickLeaveList[index].status, onEmailTap: () { showConfirmMessage(model, index); }, @@ -69,13 +69,13 @@ class _PatientSickLeavePageState extends State { } void showConfirmMessage(PatientSickLeaveViewMode model, int index) { - // if (model.sickLeaveList[index].status == 1) { - // openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); - // } else if (model.sickLeaveList[index].status == 2) { + if (model.sickLeaveList[index].status == 1) { + openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo, model.sickLeaveList[index].setupID, model, index, model.sickLeaveList[index].projectID); + } else if (model.sickLeaveList[index].status == 2) { showEmailDialog(model, index); - // } else { - // showApprovalDialog(); - // } + } else { + showApprovalDialog(); + } } void showApprovalDialog() { @@ -111,7 +111,14 @@ class _PatientSickLeavePageState extends State { } void openWorkPlaceUpdatePage(int requestNumber, String setupID, PatientSickLeaveViewMode model, int index, int projectID) { - Navigator.push(context, FadePage(page: WorkplaceUpdatePage(requestNumber: requestNumber, setupID: setupID, projectID: projectID,))).then((value) { + Navigator.push( + context, + FadePage( + page: WorkplaceUpdatePage( + requestNumber: requestNumber, + setupID: setupID, + projectID: projectID, + ))).then((value) { print(value); if (value != null && value == true) { model.getSickLeave(); From 83ca5e8e4c28c1fee67a25bfcac3b1fd47437f5d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 Jun 2023 20:08:10 +0300 Subject: [PATCH 15/50] ask doctor date param added --- lib/pages/medical/ask_doctor/ask_doctor_page.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/medical/ask_doctor/ask_doctor_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_page.dart index 19636d62..463f7fb9 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_page.dart @@ -60,6 +60,7 @@ class AskDoctorPage extends StatelessWidget { itemBuilder: (context, _index) { DoctorList _doctor = _doctorList[_index]; DoctorList doctorList = DoctorList( + date: _doctor.date, projectID: _doctor.projectID, setupID: _doctor.setupID, clinicID: _doctor.clinicID, From e4fe4baa27e11b40dbb6e70c03cad4909ef416d5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 18 Jun 2023 20:30:44 +0300 Subject: [PATCH 16/50] nearest appo crash fixed --- lib/pages/BookAppointment/components/SearchByClinic.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 891d01cb..850e23af 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -243,8 +243,7 @@ class _SearchByClinicState extends State { Navigator.push(context, FadePage(page: LaserClinic())); } else if (!isDentalSelectedAndSupported()) { projectDropdownValue = ""; - if(!nearestAppo) - getDoctorsList(context); + if (!nearestAppo) getDoctorsList(context); } else {} }); projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); @@ -531,8 +530,8 @@ class _SearchByClinicState extends State { searchInfo.clinic = selectedClinic; searchInfo.date = DateTime.now(); - if(projectViewModel.isLogin) { - if(projectViewModel.user.age > 12) { + if (projectViewModel.isLogin) { + if (projectViewModel.user.age > 12) { navigateToDentalComplaints(context, searchInfo); } else { callDoctorsSearchAPI(17); @@ -606,6 +605,8 @@ class _SearchByClinicState extends State { result = LinkedHashSet.from(arr).toList(); numAll = result.length; + nearestAppo = false; + isProjectLoaded = false; navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); From 792b3ea249229c0d19c67db5e990985db2ffb225 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 21 Jun 2023 11:16:54 +0300 Subject: [PATCH 17/50] no message --- lib/core/service/medical/ask_doctor_services.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart index 57ab856b..e3fddf66 100644 --- a/lib/core/service/medical/ask_doctor_services.dart +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -96,6 +96,7 @@ class AskDoctorService extends BaseService { body['EditedBy'] = 102; body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['isDentalAllowedBackend'] = false; + body['QuestionType'] = num.parse(requestType); await baseAppClient.post(INSERT_CALL_INFO, onSuccess: (dynamic response, int statusCode) { From 12af8bb8a9fef315a6fc058ed5add4c62660e9f0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 3 Jul 2023 12:45:03 +0300 Subject: [PATCH 18/50] updates --- lib/config/config.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 2777ebee..470fba3b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,9 +21,9 @@ 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://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs From 7bc105c6c77857c5517c3cae459b440e29a429ac Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 3 Jul 2023 14:33:00 +0300 Subject: [PATCH 19/50] updates --- lib/pages/medical/labs/laboratory_result_page.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 2a77436f..694382cc 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -46,7 +46,11 @@ class _LaboratoryResultPageState extends State { itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); + await model.sendLabReportEmail( + patientLabOrder: widget.patientLabOrders, + mes: TranslationBase.of(context).sendSuc, + userObj: projectViewModel.user, + isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, From 31d8443f87888781e1f98de73d767a884d8285fa Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 9 Jul 2023 10:40:40 +0300 Subject: [PATCH 20/50] insert call info updates --- .../service/medical/ask_doctor_services.dart | 49 ++++++++----------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/lib/core/service/medical/ask_doctor_services.dart b/lib/core/service/medical/ask_doctor_services.dart index e3fddf66..ca2e12a3 100644 --- a/lib/core/service/medical/ask_doctor_services.dart +++ b/lib/core/service/medical/ask_doctor_services.dart @@ -18,9 +18,8 @@ class AskDoctorService extends BaseService { dynamic localRes; - await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, - onSuccess: (dynamic response, int statusCode) { - localRes = response; + await baseAppClient.post(GET_CALL_INFO_HOURS_RESULT, onSuccess: (dynamic response, int statusCode) { + localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -29,11 +28,10 @@ class AskDoctorService extends BaseService { } Future getCallRequestTypeLOV() async { - hasError =false; + hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_CALL_REQUEST_TYPE_LOV, onSuccess: (dynamic response, int statusCode) { askDoctorReqTypes.clear(); response['ListReqTypes'].forEach((reqType) { askDoctorReqTypes.add(AskDoctorReqTypes.fromJson(reqType)); @@ -45,15 +43,12 @@ class AskDoctorService extends BaseService { } Future getDoctorResponse() async { - hasError =false; + hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; - body['from'] = - "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; - body['from'] = - "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00"; - await baseAppClient.post(GET_DOCTOR_RESPONSE, - onSuccess: (dynamic response, int statusCode) { + body['from'] = "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} 00:00:00"; + body['from'] = "${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}:00"; + await baseAppClient.post(GET_DOCTOR_RESPONSE, onSuccess: (dynamic response, int statusCode) { doctorResponseList.clear(); response['List_DoctorResponse'].forEach((reqType) { doctorResponseList.add(DoctorResponse.fromJson(reqType)); @@ -65,12 +60,11 @@ class AskDoctorService extends BaseService { } Future updateReadStatus({int transactionNo}) async { - hasError =false; + hasError = false; Map body = Map(); body['isDentalAllowedBackend'] = false; body['TransactionNo'] = transactionNo; - await baseAppClient.post(UPDATE_READ_STATUS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(UPDATE_READ_STATUS, onSuccess: (dynamic response, int statusCode) { //TODO fix it }, onFailure: (String error, int statusCode) { hasError = true; @@ -78,9 +72,8 @@ class AskDoctorService extends BaseService { }, body: body); } - - Future sendRequestLOV({DoctorList doctorList,String requestType,String remark}) async { - hasError =false; + Future sendRequestLOV({DoctorList doctorList, String requestType, String remark}) async { + hasError = false; Map body = Map(); body['ProjectID'] = doctorList.projectID; body['SetupID'] = doctorList.setupID; @@ -90,20 +83,18 @@ class AskDoctorService extends BaseService { body['RequestDate'] = DateUtil.yearMonthDay(DateTime.now()); body['RequestTime'] = DateUtil.time(DateTime.now()); body['Remarks'] = remark; - body['Status'] = 2;// 4 for testing only.."cancelled status insert" else should be changed to 1 in live version + body['Status'] = 2; // 4 for testing only.."cancelled status insert" else should be changed to 1 in live version body['CreatedBy'] = 102; - body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); + body['CreatedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['EditedBy'] = 102; body['EditedOn'] = DateUtil.yearMonthDay(DateTime.now()); body['isDentalAllowedBackend'] = false; body['QuestionType'] = num.parse(requestType); - await baseAppClient.post(INSERT_CALL_INFO, - onSuccess: (dynamic response, int statusCode) { - - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + body['RequestType'] = num.parse(requestType); + body['RequestTypeID'] = num.parse(requestType); + await baseAppClient.post(INSERT_CALL_INFO, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } - } From b337343df3b173884cb11d50f73399217c564b2d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 11 Jul 2023 12:25:18 +0300 Subject: [PATCH 21/50] Project ID fix in ancillary orders --- .../ancillary-orders/ancillaryOrdersDetails.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index eb411b46..5f9411ad 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -625,7 +625,7 @@ class _AnicllaryOrdersState extends State with SingleTic projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext) .then((res) { addAdvancedNumberRequest( - Utils.isVidaPlusProject(projectViewModel, appo.projectID) + Utils.isVidaPlusProject(projectViewModel, widget.projectID) ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, From b2ec6c76bf4480a87d9cec54ce2680f9acb81297 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 8 Aug 2023 11:19:28 +0300 Subject: [PATCH 22/50] ancillary fix --- lib/models/anicllary-orders/ancillary_order_list_model.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/models/anicllary-orders/ancillary_order_list_model.dart b/lib/models/anicllary-orders/ancillary_order_list_model.dart index 76ef3a7d..56cfeb31 100644 --- a/lib/models/anicllary-orders/ancillary_order_list_model.dart +++ b/lib/models/anicllary-orders/ancillary_order_list_model.dart @@ -1,6 +1,6 @@ class AncillaryOrdersListModel { List ancillaryOrderList; - Null errCode; + dynamic errCode; String message; int patientID; String patientName; @@ -32,7 +32,7 @@ class AncillaryOrdersListModel { errCode = json['ErrCode']; message = json['Message']; patientID = json['PatientID']; - patientName = json['PatientName']; + patientName = json['PatientName'] != null ? json['PatientName'] : ""; patientType = json['PatientType']; projectID = json['ProjectID']; projectName = json['ProjectName']; @@ -83,7 +83,7 @@ class AncillaryOrderList { appointmentDate = json['AppointmentDate']; appointmentNo = json['AppointmentNo']; clinicID = json['ClinicID']; - clinicName = json['ClinicName']; + clinicName = json['ClinicName'] != null ? json['ClinicName'] : ""; doctorID = json['DoctorID']; doctorName = json['DoctorName']; orderDate = json['OrderDate']; From ff23f3a8cbaf1ba4c1dd74a9eeff3baa1563425a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 8 Aug 2023 14:47:29 +0300 Subject: [PATCH 23/50] fixes --- lib/pages/medical/balance/confirm_payment_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index a36eb4fd..b43810c0 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -466,7 +466,7 @@ class _ConfirmPaymentPageState extends State { widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) .then((res) { addAdvancedNumberRequest( - Utils.isVidaPlusProject(projectViewModel, appo.projectID) + Utils.isVidaPlusProject(projectViewModel, widget.advanceModel.hospitalsModel.iD) ? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() : res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, From 3353c93de9623bbe0e546f48885c4456b719fa3c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 10 Aug 2023 10:44:58 +0300 Subject: [PATCH 24/50] fixes --- .../conference/web_rtc/call_home_page_.dart | 408 ++++++------- lib/pages/landing/landing_page.dart | 2 +- lib/pages/livecare/incoming_call.dart | 2 +- lib/pages/webRTC/call_page.dart | 4 +- lib/pages/webRTC/signaling.dart | 554 +++++++++--------- lib/uitl/SignalRUtil.dart | 346 +++++------ 6 files changed, 658 insertions(+), 658 deletions(-) diff --git a/lib/pages/conference/web_rtc/call_home_page_.dart b/lib/pages/conference/web_rtc/call_home_page_.dart index 1f36a8e9..a831a23f 100644 --- a/lib/pages/conference/web_rtc/call_home_page_.dart +++ b/lib/pages/conference/web_rtc/call_home_page_.dart @@ -1,204 +1,204 @@ -import 'dart:async'; -import 'dart:convert'; - -import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; -import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; -import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -import '../conference_button_bar.dart'; - -class CallHomePage extends StatefulWidget { - final String receiverId; - final String callerId; - - const CallHomePage({Key key, this.receiverId, this.callerId}) : super(key: key); - - @override - _CallHomePageState createState() => _CallHomePageState(); -} - -class _CallHomePageState extends State { - bool showNoise = true; - RTCVideoRenderer _localRenderer = RTCVideoRenderer(); - RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); - - final StreamController _audioButton = StreamController.broadcast(); - final StreamController _videoButton = StreamController.broadcast(); - final StreamController _onButtonBarVisibleStreamController = StreamController.broadcast(); - final StreamController _onButtonBarHeightStreamController = StreamController.broadcast(); - - //Stream to enable video - MediaStream localMediaStream; - MediaStream remoteMediaStream; - Signaling signaling = Signaling(); - - @override - void initState() { - // TODO: implement initState - super.initState(); - startCall(); - } - - startCall() async{ - await _localRenderer.initialize(); - await _remoteRenderer.initialize(); - await signaling.init(); - final connected = await receivedCall(); - } - - - Future receivedCall() async { - //Stream local media - localMediaStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true}); - _localRenderer.srcObject = localMediaStream; - - final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, - onRemoteMediaStream: (remoteMediaStream){ - - // print(remoteMediaStream.toString()); - // print(json.encode(remoteMediaStream.getTracks().asMap())); - this.remoteMediaStream = remoteMediaStream; - _remoteRenderer.srcObject = remoteMediaStream; - _remoteRenderer.addListener(() { - print('_remoteRenderer'); - print(_remoteRenderer); - setState(() {}); - }); - }, - onRemoteTrack: (track){ - _remoteRenderer.srcObject.addTrack(track.track); - // setState(() { - // }); - - print(track.streams.first.getVideoTracks()); - print(track.streams.first.getAudioTracks()); - print(json.encode(track.streams.asMap())); - } - ); - - if(connected){ - signaling.signalR.listen( - onAcceptCall: (arg0){ - print(arg0.toString()); - }, - onCandidate: (candidateJson){ - signaling.addCandidate(candidateJson); - }, - onDeclineCall: (arg0,arg1){ - // _onHangup(); - }, - onHangupCall: (arg0){ - // _onHangup(); - }, - - onOffer: (offerSdp, callerUser) async{ - print('${offerSdp.toString()} | ${callerUser.toString()}'); - await signaling.answerOffer(offerSdp); - } - ); - } - return connected; - } - - @override - void dispose() { - // TODO: implement dispose - super.dispose(); - signaling.dispose(); - _localRenderer?.dispose(); - _remoteRenderer?.dispose(); - _audioButton?.close(); - _videoButton?.close(); - localMediaStream?.dispose(); - remoteMediaStream?.dispose(); - _disposeStreamsAndSubscriptions(); - } - - Future _disposeStreamsAndSubscriptions() async { - if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close(); - if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close(); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: Colors.white, - body: buildLayout(), - ); - } - - LayoutBuilder buildLayout() { - return LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - return Stack( - children: [ - CamViewWidget( - localRenderer: _localRenderer, - remoteRenderer: _remoteRenderer, - constraints: constraints, - onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController, - onButtonBarHeightStreamController: _onButtonBarHeightStreamController, - ), - ConferenceButtonBar( - audioEnabled: _audioButton.stream, - videoEnabled: _videoButton.stream, - onAudioEnabled: _onAudioEnable, - onVideoEnabled: _onVideoEnabled, - onSwitchCamera: _onSwitchCamera, - onHangup: _onHangup, - onPersonAdd: () {}, - onPersonRemove: () {}, - onHeight: _onHeightBar, - onShow: _onShowBar, - onHide: _onHideBar, - ), - ], - ); - }, - ); - } - - Function _onAudioEnable() { - final audioTrack = localMediaStream.getAudioTracks()[0]; - final mute = audioTrack.muted; - Helper.setMicrophoneMute(!mute, audioTrack); - _audioButton.add(mute); - } - - Function _onVideoEnabled() { - final videoTrack = localMediaStream.getVideoTracks()[0]; - bool videoEnabled = videoTrack.enabled; - localMediaStream.getVideoTracks()[0].enabled = !videoEnabled; - _videoButton.add(!videoEnabled); - } - - Function _onSwitchCamera() { - Helper.switchCamera(localMediaStream.getVideoTracks()[0]); - } - - void _onShowBar() { - setState(() { - }); - _onButtonBarVisibleStreamController.add(true); - } - - void _onHeightBar(double height) { - _onButtonBarHeightStreamController.add(height); - } - - void _onHideBar() { - setState(() { - SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]); - }); - _onButtonBarVisibleStreamController.add(false); - } - - Future _onHangup() async { - signaling.hangupCall(widget.callerId, widget.receiverId); - print('onHangup'); - Navigator.of(context).pop(); - } -} +// import 'dart:async'; +// import 'dart:convert'; +// +// import 'package:diplomaticquarterapp/pages/conference/web_rtc/widgets/cam_view_widget.dart'; +// import 'package:diplomaticquarterapp/pages/conference/widgets/noise_box.dart'; +// import 'package:diplomaticquarterapp/pages/webRTC/signaling.dart'; +// import 'package:flutter/material.dart'; +// import 'package:flutter/services.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// import '../conference_button_bar.dart'; +// +// class CallHomePage extends StatefulWidget { +// final String receiverId; +// final String callerId; +// +// const CallHomePage({Key key, this.receiverId, this.callerId}) : super(key: key); +// +// @override +// _CallHomePageState createState() => _CallHomePageState(); +// } +// +// class _CallHomePageState extends State { +// bool showNoise = true; +// RTCVideoRenderer _localRenderer = RTCVideoRenderer(); +// RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); +// +// final StreamController _audioButton = StreamController.broadcast(); +// final StreamController _videoButton = StreamController.broadcast(); +// final StreamController _onButtonBarVisibleStreamController = StreamController.broadcast(); +// final StreamController _onButtonBarHeightStreamController = StreamController.broadcast(); +// +// //Stream to enable video +// MediaStream localMediaStream; +// MediaStream remoteMediaStream; +// // Signaling signaling = Signaling(); +// +// @override +// void initState() { +// // TODO: implement initState +// super.initState(); +// startCall(); +// } +// +// startCall() async{ +// await _localRenderer.initialize(); +// await _remoteRenderer.initialize(); +// await signaling.init(); +// final connected = await receivedCall(); +// } +// +// +// Future receivedCall() async { +// //Stream local media +// localMediaStream = await navigator.mediaDevices.getUserMedia({'video': true, 'audio': true}); +// _localRenderer.srcObject = localMediaStream; +// +// final connected = await signaling.acceptCall(widget.callerId, widget.receiverId, localMediaStream: localMediaStream, +// onRemoteMediaStream: (remoteMediaStream){ +// +// // print(remoteMediaStream.toString()); +// // print(json.encode(remoteMediaStream.getTracks().asMap())); +// this.remoteMediaStream = remoteMediaStream; +// _remoteRenderer.srcObject = remoteMediaStream; +// _remoteRenderer.addListener(() { +// print('_remoteRenderer'); +// print(_remoteRenderer); +// setState(() {}); +// }); +// }, +// onRemoteTrack: (track){ +// _remoteRenderer.srcObject.addTrack(track.track); +// // setState(() { +// // }); +// +// print(track.streams.first.getVideoTracks()); +// print(track.streams.first.getAudioTracks()); +// print(json.encode(track.streams.asMap())); +// } +// ); +// +// if(connected){ +// signaling.signalR.listen( +// onAcceptCall: (arg0){ +// print(arg0.toString()); +// }, +// onCandidate: (candidateJson){ +// signaling.addCandidate(candidateJson); +// }, +// onDeclineCall: (arg0,arg1){ +// // _onHangup(); +// }, +// onHangupCall: (arg0){ +// // _onHangup(); +// }, +// +// onOffer: (offerSdp, callerUser) async{ +// print('${offerSdp.toString()} | ${callerUser.toString()}'); +// await signaling.answerOffer(offerSdp); +// } +// ); +// } +// return connected; +// } +// +// @override +// void dispose() { +// // TODO: implement dispose +// super.dispose(); +// signaling.dispose(); +// _localRenderer?.dispose(); +// _remoteRenderer?.dispose(); +// _audioButton?.close(); +// _videoButton?.close(); +// localMediaStream?.dispose(); +// remoteMediaStream?.dispose(); +// _disposeStreamsAndSubscriptions(); +// } +// +// Future _disposeStreamsAndSubscriptions() async { +// if (_onButtonBarVisibleStreamController != null) await _onButtonBarVisibleStreamController.close(); +// if (_onButtonBarHeightStreamController != null) await _onButtonBarHeightStreamController.close(); +// } +// +// @override +// Widget build(BuildContext context) { +// return Scaffold( +// backgroundColor: Colors.white, +// body: buildLayout(), +// ); +// } +// +// LayoutBuilder buildLayout() { +// return LayoutBuilder( +// builder: (BuildContext context, BoxConstraints constraints) { +// return Stack( +// children: [ +// CamViewWidget( +// localRenderer: _localRenderer, +// remoteRenderer: _remoteRenderer, +// constraints: constraints, +// onButtonBarVisibleStreamController: _onButtonBarVisibleStreamController, +// onButtonBarHeightStreamController: _onButtonBarHeightStreamController, +// ), +// ConferenceButtonBar( +// audioEnabled: _audioButton.stream, +// videoEnabled: _videoButton.stream, +// onAudioEnabled: _onAudioEnable, +// onVideoEnabled: _onVideoEnabled, +// onSwitchCamera: _onSwitchCamera, +// onHangup: _onHangup, +// onPersonAdd: () {}, +// onPersonRemove: () {}, +// onHeight: _onHeightBar, +// onShow: _onShowBar, +// onHide: _onHideBar, +// ), +// ], +// ); +// }, +// ); +// } +// +// Function _onAudioEnable() { +// final audioTrack = localMediaStream.getAudioTracks()[0]; +// final mute = audioTrack.muted; +// Helper.setMicrophoneMute(!mute, audioTrack); +// _audioButton.add(mute); +// } +// +// Function _onVideoEnabled() { +// final videoTrack = localMediaStream.getVideoTracks()[0]; +// bool videoEnabled = videoTrack.enabled; +// localMediaStream.getVideoTracks()[0].enabled = !videoEnabled; +// _videoButton.add(!videoEnabled); +// } +// +// Function _onSwitchCamera() { +// Helper.switchCamera(localMediaStream.getVideoTracks()[0]); +// } +// +// void _onShowBar() { +// setState(() { +// }); +// _onButtonBarVisibleStreamController.add(true); +// } +// +// void _onHeightBar(double height) { +// _onButtonBarHeightStreamController.add(height); +// } +// +// void _onHideBar() { +// setState(() { +// SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]); +// }); +// _onButtonBarVisibleStreamController.add(false); +// } +// +// Future _onHangup() async { +// signaling.hangupCall(widget.callerId, widget.receiverId); +// print('onHangup'); +// Navigator.of(context).pop(); +// } +// } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index e9fbd62c..623c9298 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -81,7 +81,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { var themeNotifier; DateTime currentBackPressTime; - SignalRUtil signalRUtil; + // SignalRUtil signalRUtil; ToDoCountProviderModel toDoProvider; diff --git a/lib/pages/livecare/incoming_call.dart b/lib/pages/livecare/incoming_call.dart index da8c507e..7cea1153 100644 --- a/lib/pages/livecare/incoming_call.dart +++ b/lib/pages/livecare/incoming_call.dart @@ -34,7 +34,7 @@ class _IncomingCallState extends State with SingleTickerProviderSt CameraController _controller; Future _initializeControllerFuture; bool isCameraReady = false; - Signaling signaling = Signaling()..init(); + // Signaling signaling = Signaling()..init(); @override void initState() { diff --git a/lib/pages/webRTC/call_page.dart b/lib/pages/webRTC/call_page.dart index 8a5625b2..e75b2f8e 100644 --- a/lib/pages/webRTC/call_page.dart +++ b/lib/pages/webRTC/call_page.dart @@ -14,7 +14,7 @@ class CallPage extends StatefulWidget { } class _CallPageState extends State { - Signaling signaling = Signaling(); + // Signaling signaling = Signaling(); RTCVideoRenderer _localRenderer = RTCVideoRenderer(); RTCVideoRenderer _remoteRenderer = RTCVideoRenderer(); String roomId; @@ -73,7 +73,7 @@ class _CallPageState extends State { ), ElevatedButton( onPressed: () { - signaling.hangUp(_localRenderer); + // signaling.hangUp(_localRenderer); }, child: Text("Hangup"), ) diff --git a/lib/pages/webRTC/signaling.dart b/lib/pages/webRTC/signaling.dart index 9a4d1c48..53966bdc 100644 --- a/lib/pages/webRTC/signaling.dart +++ b/lib/pages/webRTC/signaling.dart @@ -1,277 +1,277 @@ -import 'dart:convert'; - -import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; - -typedef void StreamStateCallback(MediaStream stream); -typedef void RTCIceGatheringStateCallback(RTCIceGatheringState state); -typedef void RTCPeerConnectionStateCallback(RTCPeerConnectionState state); -typedef void RTCSignalingStateCallback(RTCSignalingState state); - -final Map constraints = { - 'mandatory': {}, - 'optional': [ - {'DtlsSrtpKeyAgreement': true}, - ] -}; - -Map snapsis_ice_config = { - 'iceServers': [ - { "urls": 'stun:15.185.116.59:3478' }, - { "urls": "turn:15.185.116.59:3479", "username": "admin", "credential": "admin" }, - ], - // 'sdpSemantics': 'unified-plan' -}; -Map twilio_ice_config = { - "ice_servers": [ - { - "url": "stun:global.stun.twilio.com:3478?transport=udp", - "urls": "stun:global.stun.twilio.com:3478?transport=udp" - }, - { - "url": "turn:global.turn.twilio.com:3478?transport=udp", - "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", - "urls": "turn:global.turn.twilio.com:3478?transport=udp", - "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" - }, - { - "url": "turn:global.turn.twilio.com:3478?transport=tcp", - "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", - "urls": "turn:global.turn.twilio.com:3478?transport=tcp", - "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" - }, - { - "url": "turn:global.turn.twilio.com:443?transport=tcp", - "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", - "urls": "turn:global.turn.twilio.com:443?transport=tcp", - "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" - } - ], - // 'sdpSemantics': 'unified-plan' -}; -Map google_ice_config = { - 'iceServers': [ - { - 'urls': [ - 'stun:stun.l.google.com:19302', - 'stun:stun1.l.google.com:19302', - 'stun:stun2.l.google.com:19302', - 'stun:stun3.l.google.com:19302' - ] - }, - ], - // 'sdpSemantics': 'unified-plan' -}; -Map aws_ice_config = { - 'iceServers': [ - {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, - {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} - ], - // 'sdpSemantics': 'unified-plan' -}; - -class Signaling { - dispose() { - if (peerConnection != null) { - peerConnection.dispose(); - peerConnection.getLocalStreams().forEach((e) => e.dispose()); - peerConnection.getRemoteStreams().forEach((e) => e.dispose()); - } - signalR.closeConnection(); - } - - init() async{ - // Create Peer Connection - peerConnection = await createPeerConnection(google_ice_config, constraints); - registerPeerConnectionListeners(); - } - - initializeSignalR(String userName) async { - if (signalR != null) await signalR.closeConnection(); - // https://vcallapi.hmg.com/webRTCHub?source=web&username=zohaib - // signalR = SignalRUtil(hubName: "https://vcallapi.hmg.com/webRTCHub?source=mobile&username=$userName"); - signalR = SignalRUtil(hubName: "http://35.193.237.29/webRTCHub?source=mobile&username=$userName"); - final connected = await signalR.openConnection(); - if (!connected) throw 'Failed to connect SignalR'; - } - - Map configuration = { - // 'iceServers': [ - // { - // 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] - // } - // ] - - 'iceServers': [ - // {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, - // {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} - // {'url': "stun:15.185.116.59:3478"}, - // { - // "url":"turn:15.185.116.59:3479", - // "username": "admin", - // "credential":"admin" - // } - { - "url": "stun:global.stun.twilio.com:3478?transport=udp", - "urls": "stun:global.stun.twilio.com:3478?transport=udp" - }, - { - "url": "turn:global.turn.twilio.com:3478?transport=udp", - "username": "f18fc347ba4aeeaa1b00f5199b1e900834b464962d434a4a89b4cdba02510047", - "urls": "turn:global.turn.twilio.com:3478?transport=udp", - "credential": "WX16BB+9nKm0f+Whf5EwpM8S/Yv+T2tlvQWLfdV7oqo=" - } - ] - }; - - SignalRUtil signalR; - - RTCPeerConnection peerConnection; - MediaStream localStream; - MediaStream remoteStream; - RTCDataChannel dataChannel; - - // Future call(String patientId, String mobile, {@required RTCVideoRenderer localVideo, @required RTCVideoRenderer remoteVideo}) async { - // await initializeSignalR(patientId); - // - // // final isCallPlaced = await FCM.sendCallNotifcationTo(DOCTOR_TOKEN, patientId, mobile); - // if(!isCallPlaced) - // throw 'Failed to notify target for call'; - // - // return isCallPlaced; - // } - - Future acceptCall(String caller, String receiver, {@required MediaStream localMediaStream, @required Function(MediaStream) onRemoteMediaStream, @required Function(RTCTrackEvent) onRemoteTrack}) async { - await initializeSignalR(receiver); - signalR.setContributors(caller: caller, receiver: receiver); - await signalR.acceptCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); - - peerConnection.addStream(localMediaStream); - - // peerConnection?.onTrack = (track){ - // onRemoteTrack(track); - // }; - peerConnection?.onAddStream = (MediaStream stream) { - remoteStream = stream; - onRemoteMediaStream?.call(stream); - }; - return true; - } - - - Future declineCall(String caller, String receiver) async { - await initializeSignalR(receiver); - signalR.setContributors(caller: caller, receiver: receiver); - await signalR.declineCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); - - // peerConnection.addStream(localMediaStream); - // - // peerConnection?.onAddStream = (MediaStream stream) { - // remoteStream = stream; - // onRemoteMediaStream?.call(stream); - // }; - return true; - } - - Future hangupCall(String caller, String receiver) async { - await signalR.hangupCall(caller, receiver); - dispose(); - } - - answerOffer(String sdp) async { - final offer = jsonDecode(sdp); - final caller = offer['caller']; - final receiver = offer['target']; - final offerSdp = offer['sdp']; - peerConnection.setRemoteDescription(rtcSessionDescriptionFrom(offerSdp)).then((value) { - return peerConnection.createAnswer().catchError((e){ - print(e); - }); - }).then((anwser) { - return peerConnection.setLocalDescription(anwser).catchError((e){ - print(e); - }); - }).then((value) { - return peerConnection.getLocalDescription().catchError((e){ - print(e); - }); - }).then((answer) { - return signalR.answerOffer(answer, caller, receiver).catchError((e){ - print(e); - }); - }).catchError((e) { - print(e); - }); - } - - Future hangUp(RTCVideoRenderer localVideo) async {} - - Future createSdpAnswer(String toOfferSdp) async { - final offerSdp = rtcSessionDescriptionFrom(jsonDecode(toOfferSdp)); - peerConnection.setRemoteDescription(offerSdp).catchError((e){ - print(e); - }); - - final answer = await peerConnection.createAnswer().catchError((e){ - print(e); - }); - var answerSdp = json.encode(answer); // Send SDP via Push or any channel - return answerSdp; - } - - Future createSdpOffer() async { - final offer = await peerConnection.createOffer(); - await peerConnection.setLocalDescription(offer).catchError((e){ - print(e); - }); - final map = offer.toMap(); - var offerSdp = json.encode(map); // Send SDP via Push or any channel - return offerSdp; - } - - addCandidate(String candidateJson) { - peerConnection.addCandidate(rtcIceCandidateFrom(candidateJson)).catchError((e){ - print(e); - }); - } - - void registerPeerConnectionListeners() { - peerConnection.onRenegotiationNeeded = (){ - print('Renegotiation Needed...'); - }; - - peerConnection.onIceCandidate = (RTCIceCandidate candidate) { - // print(json.encode(candidate.toMap())); - signalR.addIceCandidate(json.encode(candidate.toMap())).catchError((e){ - print(e); - }); - }; - - peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { - print('ICE gathering state changed: $state'); - }; - - peerConnection?.onConnectionState = (RTCPeerConnectionState state) { - print('Connection state change: $state'); - }; - - peerConnection?.onSignalingState = (RTCSignalingState state) { - print('Signaling state change: $state'); - }; - - - } -} - -rtcSessionDescriptionFrom(Map sdp) { - return RTCSessionDescription( - sdp['sdp'], - sdp['type'], - ); -} - -rtcIceCandidateFrom(String json) { - final map = jsonDecode(json)['candidate']; - return RTCIceCandidate(map['candidate'], map['sdpMid'], map['sdpMLineIndex']); -} +// import 'dart:convert'; +// +// import 'package:diplomaticquarterapp/uitl/SignalRUtil.dart'; +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// +// typedef void StreamStateCallback(MediaStream stream); +// typedef void RTCIceGatheringStateCallback(RTCIceGatheringState state); +// typedef void RTCPeerConnectionStateCallback(RTCPeerConnectionState state); +// typedef void RTCSignalingStateCallback(RTCSignalingState state); +// +// final Map constraints = { +// 'mandatory': {}, +// 'optional': [ +// {'DtlsSrtpKeyAgreement': true}, +// ] +// }; +// +// Map snapsis_ice_config = { +// 'iceServers': [ +// { "urls": 'stun:15.185.116.59:3478' }, +// { "urls": "turn:15.185.116.59:3479", "username": "admin", "credential": "admin" }, +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// Map twilio_ice_config = { +// "ice_servers": [ +// { +// "url": "stun:global.stun.twilio.com:3478?transport=udp", +// "urls": "stun:global.stun.twilio.com:3478?transport=udp" +// }, +// { +// "url": "turn:global.turn.twilio.com:3478?transport=udp", +// "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", +// "urls": "turn:global.turn.twilio.com:3478?transport=udp", +// "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" +// }, +// { +// "url": "turn:global.turn.twilio.com:3478?transport=tcp", +// "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", +// "urls": "turn:global.turn.twilio.com:3478?transport=tcp", +// "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" +// }, +// { +// "url": "turn:global.turn.twilio.com:443?transport=tcp", +// "username": "ce8042842b62c21bd20b176f80d6067fd3db81b1e9766312418ef5421d9ca2a2", +// "urls": "turn:global.turn.twilio.com:443?transport=tcp", +// "credential": "UzGOsiLwPZJ32cjafAebfDDpVrqeQjgpFHZEdau/8r4=" +// } +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// Map google_ice_config = { +// 'iceServers': [ +// { +// 'urls': [ +// 'stun:stun.l.google.com:19302', +// 'stun:stun1.l.google.com:19302', +// 'stun:stun2.l.google.com:19302', +// 'stun:stun3.l.google.com:19302' +// ] +// }, +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// Map aws_ice_config = { +// 'iceServers': [ +// {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, +// {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} +// ], +// // 'sdpSemantics': 'unified-plan' +// }; +// +// class Signaling { +// dispose() { +// if (peerConnection != null) { +// peerConnection.dispose(); +// peerConnection.getLocalStreams().forEach((e) => e.dispose()); +// peerConnection.getRemoteStreams().forEach((e) => e.dispose()); +// } +// signalR.closeConnection(); +// } +// +// init() async{ +// // Create Peer Connection +// peerConnection = await createPeerConnection(google_ice_config, constraints); +// registerPeerConnectionListeners(); +// } +// +// initializeSignalR(String userName) async { +// if (signalR != null) await signalR.closeConnection(); +// // https://vcallapi.hmg.com/webRTCHub?source=web&username=zohaib +// // signalR = SignalRUtil(hubName: "https://vcallapi.hmg.com/webRTCHub?source=mobile&username=$userName"); +// // signalR = SignalRUtil(hubName: "http://35.193.237.29/webRTCHub?source=mobile&username=$userName"); +// final connected = await signalR.openConnection(); +// if (!connected) throw 'Failed to connect SignalR'; +// } +// +// Map configuration = { +// // 'iceServers': [ +// // { +// // 'urls': ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'] +// // } +// // ] +// +// 'iceServers': [ +// // {'url': "stun:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3478"}, +// // {'url': "turn:ec2-15-185-116-59.me-south-1.compute.amazonaws.com:3479", 'credential': "admin", 'username': "admin"} +// // {'url': "stun:15.185.116.59:3478"}, +// // { +// // "url":"turn:15.185.116.59:3479", +// // "username": "admin", +// // "credential":"admin" +// // } +// { +// "url": "stun:global.stun.twilio.com:3478?transport=udp", +// "urls": "stun:global.stun.twilio.com:3478?transport=udp" +// }, +// { +// "url": "turn:global.turn.twilio.com:3478?transport=udp", +// "username": "f18fc347ba4aeeaa1b00f5199b1e900834b464962d434a4a89b4cdba02510047", +// "urls": "turn:global.turn.twilio.com:3478?transport=udp", +// "credential": "WX16BB+9nKm0f+Whf5EwpM8S/Yv+T2tlvQWLfdV7oqo=" +// } +// ] +// }; +// +// // SignalRUtil signalR; +// +// RTCPeerConnection peerConnection; +// MediaStream localStream; +// MediaStream remoteStream; +// RTCDataChannel dataChannel; +// +// // Future call(String patientId, String mobile, {@required RTCVideoRenderer localVideo, @required RTCVideoRenderer remoteVideo}) async { +// // await initializeSignalR(patientId); +// // +// // // final isCallPlaced = await FCM.sendCallNotifcationTo(DOCTOR_TOKEN, patientId, mobile); +// // if(!isCallPlaced) +// // throw 'Failed to notify target for call'; +// // +// // return isCallPlaced; +// // } +// +// Future acceptCall(String caller, String receiver, {@required MediaStream localMediaStream, @required Function(MediaStream) onRemoteMediaStream, @required Function(RTCTrackEvent) onRemoteTrack}) async { +// await initializeSignalR(receiver); +// signalR.setContributors(caller: caller, receiver: receiver); +// await signalR.acceptCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); +// +// peerConnection.addStream(localMediaStream); +// +// // peerConnection?.onTrack = (track){ +// // onRemoteTrack(track); +// // }; +// peerConnection?.onAddStream = (MediaStream stream) { +// remoteStream = stream; +// onRemoteMediaStream?.call(stream); +// }; +// return true; +// } +// +// +// Future declineCall(String caller, String receiver) async { +// await initializeSignalR(receiver); +// signalR.setContributors(caller: caller, receiver: receiver); +// await signalR.declineCall(receiver, caller).catchError((e) => throw 'Failed to inform signalR that i accepted a call'); +// +// // peerConnection.addStream(localMediaStream); +// // +// // peerConnection?.onAddStream = (MediaStream stream) { +// // remoteStream = stream; +// // onRemoteMediaStream?.call(stream); +// // }; +// return true; +// } +// +// Future hangupCall(String caller, String receiver) async { +// await signalR.hangupCall(caller, receiver); +// dispose(); +// } +// +// answerOffer(String sdp) async { +// final offer = jsonDecode(sdp); +// final caller = offer['caller']; +// final receiver = offer['target']; +// final offerSdp = offer['sdp']; +// peerConnection.setRemoteDescription(rtcSessionDescriptionFrom(offerSdp)).then((value) { +// return peerConnection.createAnswer().catchError((e){ +// print(e); +// }); +// }).then((anwser) { +// return peerConnection.setLocalDescription(anwser).catchError((e){ +// print(e); +// }); +// }).then((value) { +// return peerConnection.getLocalDescription().catchError((e){ +// print(e); +// }); +// }).then((answer) { +// return signalR.answerOffer(answer, caller, receiver).catchError((e){ +// print(e); +// }); +// }).catchError((e) { +// print(e); +// }); +// } +// +// Future hangUp(RTCVideoRenderer localVideo) async {} +// +// Future createSdpAnswer(String toOfferSdp) async { +// final offerSdp = rtcSessionDescriptionFrom(jsonDecode(toOfferSdp)); +// peerConnection.setRemoteDescription(offerSdp).catchError((e){ +// print(e); +// }); +// +// final answer = await peerConnection.createAnswer().catchError((e){ +// print(e); +// }); +// var answerSdp = json.encode(answer); // Send SDP via Push or any channel +// return answerSdp; +// } +// +// Future createSdpOffer() async { +// final offer = await peerConnection.createOffer(); +// await peerConnection.setLocalDescription(offer).catchError((e){ +// print(e); +// }); +// final map = offer.toMap(); +// var offerSdp = json.encode(map); // Send SDP via Push or any channel +// return offerSdp; +// } +// +// addCandidate(String candidateJson) { +// peerConnection.addCandidate(rtcIceCandidateFrom(candidateJson)).catchError((e){ +// print(e); +// }); +// } +// +// void registerPeerConnectionListeners() { +// peerConnection.onRenegotiationNeeded = (){ +// print('Renegotiation Needed...'); +// }; +// +// peerConnection.onIceCandidate = (RTCIceCandidate candidate) { +// // print(json.encode(candidate.toMap())); +// signalR.addIceCandidate(json.encode(candidate.toMap())).catchError((e){ +// print(e); +// }); +// }; +// +// peerConnection?.onIceGatheringState = (RTCIceGatheringState state) { +// print('ICE gathering state changed: $state'); +// }; +// +// peerConnection?.onConnectionState = (RTCPeerConnectionState state) { +// print('Connection state change: $state'); +// }; +// +// peerConnection?.onSignalingState = (RTCSignalingState state) { +// print('Signaling state change: $state'); +// }; +// +// +// } +// } +// +// rtcSessionDescriptionFrom(Map sdp) { +// return RTCSessionDescription( +// sdp['sdp'], +// sdp['type'], +// ); +// } +// +// rtcIceCandidateFrom(String json) { +// final map = jsonDecode(json)['candidate']; +// return RTCIceCandidate(map['candidate'], map['sdpMid'], map['sdpMLineIndex']); +// } diff --git a/lib/uitl/SignalRUtil.dart b/lib/uitl/SignalRUtil.dart index d9a73a14..904155a2 100644 --- a/lib/uitl/SignalRUtil.dart +++ b/lib/uitl/SignalRUtil.dart @@ -1,173 +1,173 @@ -import 'dart:convert'; -import 'dart:io'; - -import 'package:flutter/cupertino.dart'; -import 'package:flutter_webrtc/flutter_webrtc.dart'; -import 'package:http/io_client.dart'; -import 'package:signalr_core/signalr_core.dart'; - -class SignalRUtil { - String hubName; - - String sourceUser; - String destinationUser; - setContributors({@required String caller, @required String receiver}){ - this.sourceUser = caller; - this.destinationUser = receiver; - } - - Function(bool) onConnected; - SignalRUtil({@required this.hubName}); - - - HubConnection connectionHub; - - closeConnection() async{ - if(connectionHub != null) { - connectionHub.off('OnIncomingCallAsync'); - connectionHub.off('OnCallDeclinedAsync'); - connectionHub.off('OnCallAcceptedAsync'); - connectionHub.off('nHangUpAsync'); - connectionHub.off('OnIceCandidateAsync'); - connectionHub.off('OnOfferAsync'); - await connectionHub.stop(); - } - } - - Future openConnection() async { - connectionHub = HubConnectionBuilder() - .withUrl( - hubName, - HttpConnectionOptions( - logMessageContent: true, - client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), - logging: (level, message) => print(message), - )).build(); - - await connectionHub.start(); - await Future.delayed(Duration(seconds: 1)); - - connectionHub.on('ReceiveMessage', (message) { - handleIncomingMessage(message); - }); - - return getConnectionState(); - } - - void handleIncomingMessage(List message) { - print(message.toString()); - } - - void sendMessage(List args) async { - await connectionHub.invoke('SendMessage', args: args); //['Bob', 'Says hi!'] - } - - listen({Function(CallUser) onAcceptCall, Function(CallUser) onHangupCall, Function(String, CallUser) onDeclineCall, Function(String, CallUser) onOffer, Function(String) onCandidate}){ - - connectionHub.on('OnIncomingCallAsync', (arguments) { - print('OnIncomingCallAsync: ${arguments.toString()}'); - }); - - connectionHub.on('OnCallDeclinedAsync', (arguments) { - print('OnCallDeclinedAsync: ${arguments.toString()}'); - onDeclineCall(arguments.first, CallUser.from(arguments.last)); - }); - - connectionHub.on('OnCallAcceptedAsync', (arguments) { - print('OnCallAcceptedAsync: ${arguments.toString()}'); - }); - - connectionHub.on('OnHangUpAsync', (arguments) { - print('nHangUpAsync: ${arguments.toString()}'); - onHangupCall(CallUser.from(arguments.first)); - }); - - connectionHub.on('OnIceCandidateAsync', (arguments) { - print('OnIceCandidateAsync: ${arguments.toString()}'); - onCandidate(arguments.first); - }); - - connectionHub.on('OnOfferAsync', (arguments) { - print('OnOfferAsync: ${arguments.toString()}'); - onOffer(arguments.first, CallUser.from(arguments.last)); - }); - - } - - // CallUserAsync(string currentUserId, string targerUserId) - Future callUser(String from, to) async{ - return await connectionHub.invoke('CallUserAsync', args: [from, to]); - } - - // CallDeclinedAsync(string currentUserId, string targerUserId) - Future declineCall(String from, to) async{ - return await connectionHub.invoke('CallDeclinedAsync', args: [from, to]); - } - - // AnswerCallAsync(string currentUserId, string targetUserId) - Future answerCall(String from, to) async{ - return await connectionHub.invoke('AnswerCallAsync', args: [from, to]); - } - - // IceCandidateAsync(string targetUserId, string candidate) - Future addIceCandidate(String candidate) async{ - final target = destinationUser; - return await connectionHub.invoke('IceCandidateAsync', args: [target, candidate]); - } - - // OfferAsync(string targetUserId,string currentUserId, string targetOffer) - Future offer(String from, to, offer) async{ - return await connectionHub.invoke('OfferAsync', args: [from, to, offer]); - } - - // AnswerOfferAsync(string targetUserId, string CallerOffer) - Future answerOffer(RTCSessionDescription answerSdp, caller, receiver) async{ - final payload = { - 'target': receiver, - 'caller': caller, - 'sdp': answerSdp.toMap(), - }; - return await connectionHub.invoke('AnswerOfferAsync', args: [caller, jsonEncode(payload)]); - } - - // HangUpAsync(string currentUserId, string targetUserId) - Future hangupCall(String from, to) async{ - return await connectionHub.invoke('HangUpAsync', args: [from, to]); - } - - // CallAccepted(string currentUserId,string targetUserId) - Future acceptCall(String from, to) async{ - // return await connectionHub.send(methodName: 'CallAccepted', args: [from, to]); - return await connectionHub.invoke("CallAccepted", args: [ from, to]); - } - - - bool getConnectionState() { - if (connectionHub.state == HubConnectionState.connected) return true; - if (connectionHub.state == HubConnectionState.disconnected) return false; - return false; - } -} - - -class CallUser{ - String Id; - String UserName; - String Email; - String Phone; - String Title; - dynamic UserStatus; - String Image; - int UnreadMessageCount = 0; - - CallUser.from(Map map){ - Id = map['Id']; - UserName = map['UserName']; - Email = map['Email']; - Phone = map['Phone']; - Title = map['Title']; - UserStatus = map['UserStatus']; - Image = map['Image']; - UnreadMessageCount = map['UnreadMessageCount']; - } -} \ No newline at end of file +// import 'dart:convert'; +// import 'dart:io'; +// +// import 'package:flutter/cupertino.dart'; +// import 'package:flutter_webrtc/flutter_webrtc.dart'; +// import 'package:http/io_client.dart'; +// // import 'package:signalr_core/signalr_core.dart'; +// +// class SignalRUtil { +// String hubName; +// +// String sourceUser; +// String destinationUser; +// setContributors({@required String caller, @required String receiver}){ +// this.sourceUser = caller; +// this.destinationUser = receiver; +// } +// +// Function(bool) onConnected; +// SignalRUtil({@required this.hubName}); +// +// +// // HubConnection connectionHub; +// +// closeConnection() async{ +// if(connectionHub != null) { +// connectionHub.off('OnIncomingCallAsync'); +// connectionHub.off('OnCallDeclinedAsync'); +// connectionHub.off('OnCallAcceptedAsync'); +// connectionHub.off('nHangUpAsync'); +// connectionHub.off('OnIceCandidateAsync'); +// connectionHub.off('OnOfferAsync'); +// await connectionHub.stop(); +// } +// } +// +// Future openConnection() async { +// // connectionHub = HubConnectionBuilder() +// // .withUrl( +// // hubName, +// // HttpConnectionOptions( +// // logMessageContent: true, +// // client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true), +// // logging: (level, message) => print(message), +// // )).build(); +// +// await connectionHub.start(); +// await Future.delayed(Duration(seconds: 1)); +// +// connectionHub.on('ReceiveMessage', (message) { +// handleIncomingMessage(message); +// }); +// +// return getConnectionState(); +// } +// +// void handleIncomingMessage(List message) { +// print(message.toString()); +// } +// +// void sendMessage(List args) async { +// await connectionHub.invoke('SendMessage', args: args); //['Bob', 'Says hi!'] +// } +// +// listen({Function(CallUser) onAcceptCall, Function(CallUser) onHangupCall, Function(String, CallUser) onDeclineCall, Function(String, CallUser) onOffer, Function(String) onCandidate}){ +// +// connectionHub.on('OnIncomingCallAsync', (arguments) { +// print('OnIncomingCallAsync: ${arguments.toString()}'); +// }); +// +// connectionHub.on('OnCallDeclinedAsync', (arguments) { +// print('OnCallDeclinedAsync: ${arguments.toString()}'); +// onDeclineCall(arguments.first, CallUser.from(arguments.last)); +// }); +// +// connectionHub.on('OnCallAcceptedAsync', (arguments) { +// print('OnCallAcceptedAsync: ${arguments.toString()}'); +// }); +// +// connectionHub.on('OnHangUpAsync', (arguments) { +// print('nHangUpAsync: ${arguments.toString()}'); +// onHangupCall(CallUser.from(arguments.first)); +// }); +// +// connectionHub.on('OnIceCandidateAsync', (arguments) { +// print('OnIceCandidateAsync: ${arguments.toString()}'); +// onCandidate(arguments.first); +// }); +// +// connectionHub.on('OnOfferAsync', (arguments) { +// print('OnOfferAsync: ${arguments.toString()}'); +// onOffer(arguments.first, CallUser.from(arguments.last)); +// }); +// +// } +// +// // CallUserAsync(string currentUserId, string targerUserId) +// Future callUser(String from, to) async{ +// return await connectionHub.invoke('CallUserAsync', args: [from, to]); +// } +// +// // CallDeclinedAsync(string currentUserId, string targerUserId) +// Future declineCall(String from, to) async{ +// return await connectionHub.invoke('CallDeclinedAsync', args: [from, to]); +// } +// +// // AnswerCallAsync(string currentUserId, string targetUserId) +// Future answerCall(String from, to) async{ +// return await connectionHub.invoke('AnswerCallAsync', args: [from, to]); +// } +// +// // IceCandidateAsync(string targetUserId, string candidate) +// Future addIceCandidate(String candidate) async{ +// final target = destinationUser; +// return await connectionHub.invoke('IceCandidateAsync', args: [target, candidate]); +// } +// +// // OfferAsync(string targetUserId,string currentUserId, string targetOffer) +// Future offer(String from, to, offer) async{ +// return await connectionHub.invoke('OfferAsync', args: [from, to, offer]); +// } +// +// // AnswerOfferAsync(string targetUserId, string CallerOffer) +// Future answerOffer(RTCSessionDescription answerSdp, caller, receiver) async{ +// final payload = { +// 'target': receiver, +// 'caller': caller, +// 'sdp': answerSdp.toMap(), +// }; +// return await connectionHub.invoke('AnswerOfferAsync', args: [caller, jsonEncode(payload)]); +// } +// +// // HangUpAsync(string currentUserId, string targetUserId) +// Future hangupCall(String from, to) async{ +// return await connectionHub.invoke('HangUpAsync', args: [from, to]); +// } +// +// // CallAccepted(string currentUserId,string targetUserId) +// Future acceptCall(String from, to) async{ +// // return await connectionHub.send(methodName: 'CallAccepted', args: [from, to]); +// return await connectionHub.invoke("CallAccepted", args: [ from, to]); +// } +// +// +// bool getConnectionState() { +// if (connectionHub.state == HubConnectionState.connected) return true; +// if (connectionHub.state == HubConnectionState.disconnected) return false; +// return false; +// } +// } +// +// +// class CallUser{ +// String Id; +// String UserName; +// String Email; +// String Phone; +// String Title; +// dynamic UserStatus; +// String Image; +// int UnreadMessageCount = 0; +// +// CallUser.from(Map map){ +// Id = map['Id']; +// UserName = map['UserName']; +// Email = map['Email']; +// Phone = map['Phone']; +// Title = map['Title']; +// UserStatus = map['UserStatus']; +// Image = map['Image']; +// UnreadMessageCount = map['UnreadMessageCount']; +// } +// } \ No newline at end of file From 3e63d80655757142017aeb51d32f04878095bcb2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 16 Aug 2023 17:27:28 +0300 Subject: [PATCH 25/50] Ancillary order updates --- .../ancillary_orders_proc_list.dart | 18 ++++++ .../ancillaryOrdersDetails.dart | 9 ++- .../appointment_services/GetDoctorsList.dart | 63 +++++++++---------- 3 files changed, 53 insertions(+), 37 deletions(-) create mode 100644 lib/models/anicllary-orders/ancillary_orders_proc_list.dart diff --git a/lib/models/anicllary-orders/ancillary_orders_proc_list.dart b/lib/models/anicllary-orders/ancillary_orders_proc_list.dart new file mode 100644 index 00000000..ed22bd05 --- /dev/null +++ b/lib/models/anicllary-orders/ancillary_orders_proc_list.dart @@ -0,0 +1,18 @@ +class AncillaryOrdersProcedureList { + int procedureID; + String procedureDescription; + + AncillaryOrdersProcedureList({this.procedureID, this.procedureDescription}); + + AncillaryOrdersProcedureList.fromJson(Map json) { + procedureID = json['ProcedureID']; + procedureDescription = json['ProcedureDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['ProcedureID'] = this.procedureID; + data['ProcedureDescription'] = this.procedureDescription; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 5f9411ad..ff669048 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; @@ -621,8 +622,13 @@ class _AnicllaryOrdersState extends State with SingleTic createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); + List ancillaryOrdersProcedureList = []; + selectedProcList.forEach((element) { + ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); + }); service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, - projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext) + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext, + isAncillaryOrder: true, ancillaryOrdersProcedureList: ancillaryOrdersProcedureList) .then((res) { addAdvancedNumberRequest( Utils.isVidaPlusProject(projectViewModel, widget.projectID) @@ -651,7 +657,6 @@ class _AnicllaryOrdersState extends State with SingleTic autoGenerateInvoice() { List selectedProcListAPI = []; - Map selectedProcListAPIMap; selectedProcList.forEach((element) { selectedProcListAPI.add({ diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index dfd3ed32..2a7a92b8 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.d import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Request.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -1369,7 +1370,8 @@ class DoctorsListService extends BaseService { } Future HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, - String patientName, dynamic patientID, BuildContext context) async { + String patientName, dynamic patientID, BuildContext context, + {bool isAncillaryOrder = false, List ancillaryOrdersProcedureList}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1401,6 +1403,8 @@ class DoctorsListService extends BaseService { "SessionID": "YckwoXhUmWBsnHKEKig", "isDentalAllowedBackend": false, "PatientTypeID": patientType, + "IsAncillaryOrder": isAncillaryOrder, + "AncillaryProcedureList": ancillaryOrdersProcedureList, "PatientType": patientType }; dynamic localRes; @@ -1758,41 +1762,32 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future logDoctorFreeSlots(int docID, int clinicID, int projectID, List selectedfreeSlots, dynamic appoNumber, BuildContext context, [ProjectViewModel projectViewModel]) async { + Map requestFreeSlots; + Map request; - - Future logDoctorFreeSlots(int docID, int clinicID, int projectID, List selectedfreeSlots, dynamic appoNumber, BuildContext context, [ProjectViewModel projectViewModel]) async { - Map requestFreeSlots; - Map request; - - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); - requestFreeSlots = { - "DoctorID": docID, - "IsBookingForLiveCare": 0, - "ClinicID": clinicID, - "ProjectID": projectID, - "OriginalClinicID": clinicID, - "days": 0, - "isReschadual": false, - "VersionID": req.VersionID, - "Channel": 3, - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "generalid": "Cs2020@2016\$2958", - "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, - "SessionID": null, - "isDentalAllowedBackend": false, - "DeviceTypeID": 1 - }; - - request = { + var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); + Request req = appGlobal.getPublicRequest(); + requestFreeSlots = { + "DoctorID": docID, + "IsBookingForLiveCare": 0, "ClinicID": clinicID, "ProjectID": projectID, - "AppointmentNo":appoNumber, - "DoctorFreeSlotRequest":requestFreeSlots, - "DoctorFreeSlotResponse":selectedfreeSlots, - "Value1":docID - }; + "OriginalClinicID": clinicID, + "days": 0, + "isReschadual": false, + "VersionID": req.VersionID, + "Channel": 3, + "LanguageID": languageID == 'ar' ? 1 : 2, + "IPAdress": "10.20.10.20", + "generalid": "Cs2020@2016\$2958", + "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, + "SessionID": null, + "isDentalAllowedBackend": false, + "DeviceTypeID": 1 + }; + + request = {"ClinicID": clinicID, "ProjectID": projectID, "AppointmentNo": appoNumber, "DoctorFreeSlotRequest": requestFreeSlots, "DoctorFreeSlotResponse": selectedfreeSlots, "Value1": docID}; dynamic localRes; await baseAppClient.post(INSERT_FREE_SLOTS_LOGS, onSuccess: (response, statusCode) async { localRes = response; @@ -1802,6 +1797,4 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - - } From 275c99a4ceb576ccd298a0514c471756c3326eb0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 29 Aug 2023 16:25:54 +0300 Subject: [PATCH 26/50] updates --- lib/pages/BookAppointment/BookConfirm.dart | 6 +++--- lib/pages/ToDoList/ToDo.dart | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 0405f657..830bd6bb 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -331,9 +331,9 @@ class _BookConfirmState extends State { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); Future.delayed(new Duration(milliseconds: 500), () { - checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); - // getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); - // getToDoCount(); + // checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); + getToDoCount(); + getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); }); widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d3705a7c..9d806a18 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -543,8 +543,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { confirmAppointment(appo); break; case 20: - // getPatientShare(context, appo); - checkPatientNphiesEligibility(context, appo); + getPatientShare(context, appo); + // checkPatientNphiesEligibility(context, appo); break; case 30: getAppoQR(context, appo); From 38661621e33253c3b415e0703b07cada0e9dd232 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 4 Sep 2023 14:09:26 +0300 Subject: [PATCH 27/50] updates & fixes --- lib/core/service/medical/reports_service.dart | 4 ++-- lib/pages/medical/balance/my_balance_page.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/core/service/medical/reports_service.dart b/lib/core/service/medical/reports_service.dart index 9f8bfb45..d80c80e4 100644 --- a/lib/core/service/medical/reports_service.dart +++ b/lib/core/service/medical/reports_service.dart @@ -29,7 +29,7 @@ class ReportsService extends BaseService { } Future getInPatientReports() async { - RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 2, patientOutSA: 0, projectID: 0); + RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 1, patientOutSA: 0, projectID: 0); hasError = false; await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) { inpatientReportsList.clear(); @@ -137,7 +137,7 @@ class ReportsService extends BaseService { body['ProjectID'] = projectID; body['Remarks'] = ""; body['ProcedureId'] = ""; - body['RequestType'] = 2; + body['RequestType'] = 1; body['Source'] = 2; body['Status'] = 1; body['CreatedBy'] = 102; diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index a7a6d5d7..6783c895 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -106,7 +106,7 @@ class MyBalancePage extends StatelessWidget { ), ), Text( - TranslationBase.of(context).sar, + projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar, style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, @@ -157,7 +157,7 @@ class MyBalancePage extends StatelessWidget { ), ), Text( - amount.toStringAsFixed(2) + " " + TranslationBase.of(context).sar, + amount.toStringAsFixed(2) + " " + (projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar), style: TextStyle( fontSize: 16, letterSpacing: -0.64, From a58e4452b854a2725b0a5d060e7e86e9201306d5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 5 Sep 2023 11:51:50 +0300 Subject: [PATCH 28/50] ancillary changes --- .../ancillary-orders/ancillaryOrdersDetails.dart | 10 +++++----- lib/services/appointment_services/GetDoctorsList.dart | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index ff669048..5fba9b5a 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -622,13 +622,13 @@ class _AnicllaryOrdersState extends State with SingleTic createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); String paymentReference = res['Fort_id'].toString(); - List ancillaryOrdersProcedureList = []; - selectedProcList.forEach((element) { - ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); - }); + // List ancillaryOrdersProcedureList = []; + // selectedProcList.forEach((element) { + // ancillaryOrdersProcedureList.add(new AncillaryOrdersProcedureList(procedureID: num.parse(element.procedureID), procedureDescription: element.procedureName)); + // }); service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType, projectViewModel.user.firstName + " " + projectViewModel.user.lastName, projectViewModel.user.patientID, localContext, - isAncillaryOrder: true, ancillaryOrdersProcedureList: ancillaryOrdersProcedureList) + isAncillaryOrder: true) .then((res) { addAdvancedNumberRequest( Utils.isVidaPlusProject(projectViewModel, widget.projectID) diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 2a7a92b8..128a3460 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1371,7 +1371,7 @@ class DoctorsListService extends BaseService { Future HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, String patientName, dynamic patientID, BuildContext context, - {bool isAncillaryOrder = false, List ancillaryOrdersProcedureList}) async { + {bool isAncillaryOrder = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1404,7 +1404,7 @@ class DoctorsListService extends BaseService { "isDentalAllowedBackend": false, "PatientTypeID": patientType, "IsAncillaryOrder": isAncillaryOrder, - "AncillaryProcedureList": ancillaryOrdersProcedureList, + // "AncillaryProcedureList": ancillaryOrdersProcedureList, "PatientType": patientType }; dynamic localRes; From 4dd16bde59762959a434de8934818376beb2049a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 7 Sep 2023 12:53:14 +0300 Subject: [PATCH 29/50] Inpatient medical report fixes --- .../medical/reports/report_home_page.dart | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 7cc8fc2b..911e74a0 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -104,40 +104,39 @@ class _HomeReportPageState extends State with SingleTickerProvid ), if (model.user != null) Expanded( - child: - TabBarView( - physics: BouncingScrollPhysics(), - controller: _tabController_new, - children: [ + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController_new, + children: [ Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(21), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - myRadioButton(TranslationBase.of(context).requested, 0), - myRadioButton(TranslationBase.of(context).ready, 1), - myRadioButton(TranslationBase.of(context).cancelled, 2), - ], - ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(21), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + myRadioButton(TranslationBase.of(context).requested, 0), + myRadioButton(TranslationBase.of(context).ready, 1), + myRadioButton(TranslationBase.of(context).cancelled, 2), + ], + ), + ), + Expanded( + child: IndexedStack( + index: _currentPage, + children: [ + ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), + ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), + ], + ), + ) + ], ), - Expanded( - child: IndexedStack( - index: _currentPage, - children: [ - ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress), - ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress), - ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress), - ], - ), - ) - ], - ), - ), - // InPatient Medical Reports - Container( + ), + // InPatient Medical Reports + Container( child: model.admissionsMedicalReportList.isNotEmpty ? Column( children: [ @@ -249,20 +248,21 @@ class _HomeReportPageState extends State with SingleTickerProvid if (projectViewModel.havePrivilege(21) // && _tabController_new.index == 0 ) - Padding( - padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), - child: DefaultButton( - TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach, - () => Navigator.push( - context, - FadePage( - page: MedicalReports(), - ), - ).then((value) { - model.getReports(); - }), - ), - ) + if (_tabController_new.index == 0) + Padding( + padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), + child: DefaultButton( + TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach, + () => Navigator.push( + context, + FadePage( + page: MedicalReports(), + ), + ).then((value) { + model.getReports(); + }), + ), + ) ], ), ), From 49963911ba6870b0096f654763212f5a0f56d796 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 7 Sep 2023 14:12:53 +0300 Subject: [PATCH 30/50] Patient eligibility change --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 3 ++ lib/pages/BookAppointment/BookConfirm.dart | 29 +++++++++++++++++-- lib/pages/ToDoList/ToDo.dart | 28 ++++++++++++++++-- .../appointment_services/GetDoctorsList.dart | 2 +- lib/uitl/translations_delegate_base.dart | 3 ++ 6 files changed, 61 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e93af7c8..1b4c69b3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -326,7 +326,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.8; +var VERSION_ID = 10.9; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4984053d..ea364e24 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1893,4 +1893,7 @@ const Map localizedValues = { "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, + + "invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."}, + "invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."}, }; \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 830bd6bb..f6988037 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -59,6 +59,9 @@ class _BookConfirmState extends State { AppSharedPreferences sharedPref = new AppSharedPreferences(); + bool isInsured = false; + bool isEligible = false; + @override void initState() { // widget.authUser = new AuthenticatedUser(); @@ -437,13 +440,35 @@ class _BookConfirmState extends State { } getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { + String errorMsg = ""; GifLoaderDialogUtils.showMyDialog(context); widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { projectViewModel.selectedBodyPartList.clear(); projectViewModel.laserSelectionDuration = 0; print(res); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - navigateToBookSuccess(context, docObject, widget.patientShareResponse); + widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + + isInsured = res["IsInsured"]; + isEligible = res["IsEligible"]; + + if (isInsured && isEligible) { + navigateToBookSuccess(context, docObject, widget.patientShareResponse); + } else { + if (isInsured && !isEligible) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: "Update insurance", + cancelText: "Continue as cash", + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(docObject, appointmentNo)}); + dialog.showAlertDialog(context); + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); // AppToast.showErrorToast(message: err); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 9d806a18..d98c40be 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -79,6 +79,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { bool dataLoaded = false; + bool isInsured = false; + bool isEligible = false; + @override void initState() { widget.patientShareResponse = new PatientShareResponse(); @@ -889,6 +892,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } getPatientShare(context, AppoitmentAllHistoryResultList appo) { + String errorMsg = ""; DoctorsListService service = new DoctorsListService(); if (appo.isLiveCareAppointment) { getLiveCareAppointmentPatientShare(context, service, appo); @@ -896,8 +900,28 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.showMyDialog(context); service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - widget.patientShareResponse = new PatientShareResponse.fromJson(res); - openPaymentDialog(appo, widget.patientShareResponse); + widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); + isInsured = res["IsInsured"]; + isEligible = res["IsEligible"]; + + if (isInsured && isEligible) { + openPaymentDialog(appo, widget.patientShareResponse); + } else { + if (isInsured && !isEligible) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: "Update insurance", + cancelText: "Continue as cash", + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(appo)}); + dialog.showAlertDialog(context); + } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 7d97239c..f4c0aec3 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -484,7 +484,7 @@ class DoctorsListService extends BaseService { dynamic localRes; await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async { - localRes = response['OnlineCheckInAppointments'][0]; + localRes = response; }, onFailure: (String error, int statusCode) { throw error; }, body: request); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 8d8f51ee..35e6b7bf 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2903,6 +2903,9 @@ class TranslationBase { String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode]; String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode]; + String get invalidEligibility => localizedValues["invalidEligibility"][locale.languageCode]; + String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { From 9ed454f67a3405d18e3791ce5f51b63df9fb2b1b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 12 Sep 2023 11:01:04 +0300 Subject: [PATCH 31/50] Cash patient check implemented --- lib/config/localized_values.dart | 3 +- lib/pages/BookAppointment/BookConfirm.dart | 32 +++++++++++++--------- lib/pages/ToDoList/ToDo.dart | 32 +++++++++++++--------- lib/uitl/translations_delegate_base.dart | 3 +- 4 files changed, 42 insertions(+), 28 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea364e24..4a24f79b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1893,7 +1893,8 @@ const Map localizedValues = { "sickLeaveAdmittedPatient": {"en": "You cannot activate this sick leave since you're an admitted patient.", "ar": "لا يمكنك تفعيل هذه الإجازة المرضية لأنك مريض مقبل."}, "dischargeDate": {"en": "Discharge Date", "ar": "تاريخ التفريغ"}, "selectAdmissionText": {"en": "Please select one of the admissions from below to view medical reports:", "ar": "يرجى تحديد أحد حالات القبول من الأسفل لعرض التقارير الطبية:"}, - "invalidEligibility": {"en": "You cannot make online payment because you are not eligible to use the provided service.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنك غير مؤهل لاستخدام الخدمة المقدمة."}, "invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."}, + "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, + "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, }; \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index f6988037..50dbc70f 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -61,6 +61,7 @@ class _BookConfirmState extends State { bool isInsured = false; bool isEligible = false; + bool isCash = false; @override void initState() { @@ -450,24 +451,29 @@ class _BookConfirmState extends State { isInsured = res["IsInsured"]; isEligible = res["IsEligible"]; + isCash = res["IsCash"]; - if (isInsured && isEligible) { + if (isCash) { navigateToBookSuccess(context, docObject, widget.patientShareResponse); } else { - if (isInsured && !isEligible) { - errorMsg = TranslationBase.of(context).invalidEligibility; + if (isInsured && isEligible) { + navigateToBookSuccess(context, docObject, widget.patientShareResponse); } else { - errorMsg = TranslationBase.of(context).invalidInsurance; + if (isInsured && !isEligible) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: TranslationBase.of(context).updateInsuranceText, + cancelText: TranslationBase.of(context).continueCash, + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(docObject, appointmentNo)}); + dialog.showAlertDialog(context); } - ConfirmDialog dialog = new ConfirmDialog( - isDissmissable: false, - context: context, - confirmMessage: errorMsg, - okText: "Update insurance", - cancelText: "Continue as cash", - okFunction: () => {openUpdateInsurance()}, - cancelFunction: () => {continueAsCash(docObject, appointmentNo)}); - dialog.showAlertDialog(context); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index d98c40be..d3af8742 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -81,6 +81,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { bool isInsured = false; bool isEligible = false; + bool isCash = false; @override void initState() { @@ -903,24 +904,29 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); isInsured = res["IsInsured"]; isEligible = res["IsEligible"]; + isCash = res["IsCash"]; - if (isInsured && isEligible) { + if (isCash) { openPaymentDialog(appo, widget.patientShareResponse); } else { - if (isInsured && !isEligible) { - errorMsg = TranslationBase.of(context).invalidEligibility; + if (isInsured && isEligible) { + openPaymentDialog(appo, widget.patientShareResponse); } else { - errorMsg = TranslationBase.of(context).invalidInsurance; + if (isInsured && !isEligible) { + errorMsg = TranslationBase.of(context).invalidEligibility; + } else { + errorMsg = TranslationBase.of(context).invalidInsurance; + } + ConfirmDialog dialog = new ConfirmDialog( + isDissmissable: false, + context: context, + confirmMessage: errorMsg, + okText: TranslationBase.of(context).updateInsuranceText, + cancelText: TranslationBase.of(context).continueCash, + okFunction: () => {openUpdateInsurance()}, + cancelFunction: () => {continueAsCash(appo)}); + dialog.showAlertDialog(context); } - ConfirmDialog dialog = new ConfirmDialog( - isDissmissable: false, - context: context, - confirmMessage: errorMsg, - okText: "Update insurance", - cancelText: "Continue as cash", - okFunction: () => {openUpdateInsurance()}, - cancelFunction: () => {continueAsCash(appo)}); - dialog.showAlertDialog(context); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 35e6b7bf..b14c21a5 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2902,9 +2902,10 @@ class TranslationBase { String get sickLeaveAdmittedPatient => localizedValues["sickLeaveAdmittedPatient"][locale.languageCode]; String get dischargeDate => localizedValues["dischargeDate"][locale.languageCode]; String get selectAdmissionText => localizedValues["selectAdmissionText"][locale.languageCode]; - String get invalidEligibility => localizedValues["invalidEligibility"][locale.languageCode]; String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode]; + String get continueCash => localizedValues["continueCash"][locale.languageCode]; + String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; } From 2048747a628cc9006ce9d09e61ded6cc4814c472 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 17 Sep 2023 14:37:33 +0300 Subject: [PATCH 32/50] ancillary updates --- lib/config/config.dart | 4 ++-- .../appointment_services/GetDoctorsList.dart | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 470fba3b..af5c606c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,8 +23,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // 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/'; -// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 128a3460..62097fb1 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1048,12 +1048,18 @@ class DoctorsListService extends BaseService { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); - Request req = appGlobal.getPublicRequest(); + + List procedureOrderIDs = []; + + selectedProcListAPI.forEach((element) { + procedureOrderIDs.add(element["ProcedureID"]); + }); + request = { "RequestAncillaryOrderInvoice": [ {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} - ] + ], + "ProcedureOrderIds": procedureOrderIDs }; dynamic localRes; await baseAppClient.post(GENERATE_ANCILLARY_ORDERS_INVOICE, onSuccess: (response, statusCode) async { From 31144c7c279d96228e7730eaf23e7f50bd96a047 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 20 Sep 2023 16:57:09 +0300 Subject: [PATCH 33/50] updates --- lib/config/config.dart | 4 +++- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index af5c606c..02cd4161 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -24,7 +24,9 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; + +var BASE_URL = 'https://webservices.hmg.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index ba9d79ee..e91990b4 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -39,9 +39,9 @@ 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://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From d8e9f368449c07a46eea1da0d5b83a0a081ba27b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 28 Sep 2023 12:01:41 +0300 Subject: [PATCH 34/50] updates --- lib/config/config.dart | 4 +-- lib/pages/paymentService/payment_service.dart | 14 +++++----- lib/uitl/utils.dart | 26 +++++++++---------- .../bottom_navigation_item.dart | 8 +++--- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +-- lib/widgets/others/app_scaffold_widget.dart | 8 +++--- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 02cd4161..4645ba77 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -23,10 +23,10 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // 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/'; +var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; -var BASE_URL = 'https://webservices.hmg.com/'; +// var BASE_URL = 'https://webservices.hmg.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 5bcf4592..3c5cb01f 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; @@ -95,11 +95,11 @@ class PaymentService extends StatelessWidget { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -111,11 +111,11 @@ class PaymentService extends StatelessWidget { : Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 4d9904c7..1621002c 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity/connectivity.dart'; import 'package:crypto/crypto.dart' as crypto; @@ -241,11 +241,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -259,11 +259,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -614,11 +614,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -632,11 +632,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index ff085dd9..f7cdafce 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -106,10 +106,10 @@ class BottomNavigationItem extends StatelessWidget { Positioned( right: 18.0, bottom: 28.0, - child: Badge( + child: badge_import.Badge( toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e91990b4..ba9d79ee 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -39,9 +39,9 @@ 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://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 6865ece5..f433a8e4 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,5 +1,5 @@ import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -494,7 +494,7 @@ class AppBarWidgetState extends State { actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( + icon: badge_import.Badge( badgeContent: Text( orderPreviewViewModel.cartResponse.quantityCount.toString(), style: TextStyle(color: Colors.white), @@ -507,8 +507,8 @@ class AppBarWidgetState extends State { : Container(), (widget.isOfferPackages && widget.showOfferPackagesCart) ? IconButton( - icon: Badge( - position: BadgePosition.topStart(top: -15, start: -10), + icon: badge_import.Badge( + position: badge_import.BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( _badgeText, style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), From df610690d55abdd4effe7974c30041c0bf72d838 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 1 Oct 2023 11:46:48 +0300 Subject: [PATCH 35/50] updates --- lib/config/localized_values.dart | 1 + lib/core/service/client/base_app_client.dart | 2 +- .../medical/labs/laboratory_result_page.dart | 56 ++++++++++++++----- lib/pages/paymentService/payment_service.dart | 14 ++--- lib/uitl/translations_delegate_base.dart | 1 + lib/uitl/utils.dart | 26 ++++----- .../bottom_navigation_item.dart | 8 +-- lib/widgets/others/app_scaffold_widget.dart | 8 +-- 8 files changed, 72 insertions(+), 44 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4a24f79b..e818eb82 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1897,4 +1897,5 @@ const Map localizedValues = { "invalidInsurance": {"en": "You cannot make online payment because you do not have a valid insurance.", "ar": "لا يمكنك إجراء الدفع عبر الإنترنت لأنه ليس لديك تأمين صالح."}, "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, + "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, }; \ No newline at end of file diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index fb3c900a..9cb81a41 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -149,7 +149,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 4767370; //3844083 + // body['PatientID'] = 2001273; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 847f979b..88fdcbe8 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -37,22 +38,47 @@ class _LaboratoryResultPageState extends State { showNewAppBar: true, showNewAppBarTitle: true, backgroundColor: Color(0xffF8F8F8), - body: ListView.builder( - physics: BouncingScrollPhysics(), - padding: EdgeInsets.only(bottom: 12), - itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); - GifLoaderDialogUtils.hideDialog(context); - }, - billNo: widget.patientLabOrders.invoiceNo, - // details: model.patientLabSpecialResult[index].resultDataHTML, - details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, + body: SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + physics: BouncingScrollPhysics(), + shrinkWrap: true, + padding: EdgeInsets.only(bottom: 12), + itemBuilder: (context, index) => LaboratoryResultWidget( + onTap: () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); + GifLoaderDialogUtils.hideDialog(context); + }, + billNo: widget.patientLabOrders.invoiceNo, + // details: model.patientLabSpecialResult[index].resultDataHTML, + details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + ), + itemCount: 1, + ), + ], + ), + ), + bottomSheet: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.08, + width: double.infinity, + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: DefaultButton( + TranslationBase.of(context).downloadReport, + () => {}, + textColor: Colors.white, + ), + ), + ], ), - itemCount: 1, ), ), ); diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 5bcf4592..3c5cb01f 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; @@ -95,11 +95,11 @@ class PaymentService extends StatelessWidget { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -111,11 +111,11 @@ class PaymentService extends StatelessWidget { : Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index b14c21a5..0863de1e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2906,6 +2906,7 @@ class TranslationBase { String get invalidInsurance => localizedValues["invalidInsurance"][locale.languageCode]; String get continueCash => localizedValues["continueCash"][locale.languageCode]; String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; + String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; } diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index ece5613d..f061b6bf 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:cached_network_image/cached_network_image.dart'; import 'package:connectivity/connectivity.dart'; import 'package:crypto/crypto.dart' as crypto; @@ -241,11 +241,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -259,11 +259,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -614,11 +614,11 @@ class Utils { ? Positioned( left: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( @@ -632,11 +632,11 @@ class Utils { ? Positioned( right: 8, top: 4, - child: Badge( + child: badge_import.Badge( toAnimate: false, elevation: 0, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/bottom_navigation/bottom_navigation_item.dart b/lib/widgets/bottom_navigation/bottom_navigation_item.dart index ff085dd9..f7cdafce 100644 --- a/lib/widgets/bottom_navigation/bottom_navigation_item.dart +++ b/lib/widgets/bottom_navigation/bottom_navigation_item.dart @@ -1,4 +1,4 @@ -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -106,10 +106,10 @@ class BottomNavigationItem extends StatelessWidget { Positioned( right: 18.0, bottom: 28.0, - child: Badge( + child: badge_import.Badge( toAnimate: false, - position: BadgePosition.topEnd(), - shape: BadgeShape.circle, + position: badge_import.BadgePosition.topEnd(), + shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8), badgeContent: Container( diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index 6865ece5..f433a8e4 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -1,5 +1,5 @@ import 'package:auto_size_text/auto_size_text.dart'; -import 'package:badges/badges.dart'; +import 'package:badges/badges.dart' as badge_import; import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; @@ -494,7 +494,7 @@ class AppBarWidgetState extends State { actions: [ (widget.isPharmacy && widget.showPharmacyCart) ? IconButton( - icon: Badge( + icon: badge_import.Badge( badgeContent: Text( orderPreviewViewModel.cartResponse.quantityCount.toString(), style: TextStyle(color: Colors.white), @@ -507,8 +507,8 @@ class AppBarWidgetState extends State { : Container(), (widget.isOfferPackages && widget.showOfferPackagesCart) ? IconButton( - icon: Badge( - position: BadgePosition.topStart(top: -15, start: -10), + icon: badge_import.Badge( + position: badge_import.BadgePosition.topStart(top: -15, start: -10), badgeContent: Text( _badgeText, style: TextStyle(fontSize: 9, color: Colors.white, fontWeight: FontWeight.normal), From 34d3cf29456fbf3850459a172ce378889694e6d0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Oct 2023 12:01:56 +0300 Subject: [PATCH 36/50] CR 6204 Lab reports enhancements in progress --- .../labs/request_send_lab_report_email.dart | 54 ++++++++++--------- lib/core/service/medical/labs_service.dart | 3 +- .../viewModels/medical/labs_view_model.dart | 2 +- .../medical/labs/laboratory_result_page.dart | 6 ++- 4 files changed, 37 insertions(+), 28 deletions(-) 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 65ac1762..a849da73 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -25,34 +25,36 @@ class RequestSendLabReportEmail { String invoiceNo; String orderDate; String orderNo; + bool isDownload; RequestSendLabReportEmail( {this.versionID, - this.channel, - this.languageID, - this.iPAdress, - this.generalid, - this.patientOutSA, - this.sessionID, - this.isDentalAllowedBackend, - this.deviceTypeID, - this.patientID, - this.tokenID, - this.patientTypeID, - this.patientType, - this.to, - this.dateofBirth, - this.patientIditificationNum, - this.patientMobileNumber, - this.patientName, - this.setupID, - this.projectName, - this.clinicName, - this.doctorName, - this.projectID, - this.invoiceNo, - this.orderDate, - this.orderNo}); + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate, + this.orderNo, + this.isDownload}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; @@ -81,6 +83,7 @@ class RequestSendLabReportEmail { invoiceNo = json['InvoiceNo']; orderDate = json['OrderDate']; orderNo = json['OrderNo']; + isDownload = json['IsDownload']; } Map toJson() { @@ -111,6 +114,7 @@ class RequestSendLabReportEmail { data['InvoiceNo'] = this.invoiceNo; data['OrderDate'] = this.orderDate; data['OrderNo'] = this.orderNo; + data['IsDownload'] = this.isDownload; return data; } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 714ebcb1..06115173 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -194,7 +194,7 @@ class LabsService extends BaseService { RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); - Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { + Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj, bool isDownload = false}) async { _requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; @@ -208,6 +208,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.setupID = patientLabOrder.setupID; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; + _requestSendLabReportEmail.isDownload = isDownload; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index e42dbbb4..263d7d32 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -135,7 +135,7 @@ class LabsViewModel extends BaseViewModel { } } - sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async { + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isDownload = false}) async { await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); if (_labsService.hasError) { error = _labsService.error; diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 88fdcbe8..574c407f 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -73,7 +73,11 @@ class _LaboratoryResultPageState extends State { width: MediaQuery.of(context).size.width * 0.9, child: DefaultButton( TranslationBase.of(context).downloadReport, - () => {}, + () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isDownload: true); + GifLoaderDialogUtils.hideDialog(context); + }, textColor: Colors.white, ), ), From 14928ad833a3ac1514c68730867150a40f1eec9e Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Oct 2023 12:48:15 +0300 Subject: [PATCH 37/50] CR 6204 --- lib/core/model/labs/request_send_lab_report_email.dart | 6 +++++- lib/core/service/medical/labs_service.dart | 1 + lib/core/viewModels/medical/labs_view_model.dart | 2 +- lib/pages/medical/labs/laboratory_result_page.dart | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) 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 a849da73..2fae6e0c 100644 --- a/lib/core/model/labs/request_send_lab_report_email.dart +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -26,6 +26,7 @@ class RequestSendLabReportEmail { String orderDate; String orderNo; bool isDownload; + int doctorID; RequestSendLabReportEmail( {this.versionID, @@ -54,7 +55,8 @@ class RequestSendLabReportEmail { this.invoiceNo, this.orderDate, this.orderNo, - this.isDownload}); + this.isDownload, + this.doctorID}); RequestSendLabReportEmail.fromJson(Map json) { versionID = json['VersionID']; @@ -84,6 +86,7 @@ class RequestSendLabReportEmail { orderDate = json['OrderDate']; orderNo = json['OrderNo']; isDownload = json['IsDownload']; + doctorID = json['DoctorID']; } Map toJson() { @@ -115,6 +118,7 @@ class RequestSendLabReportEmail { data['OrderDate'] = this.orderDate; data['OrderNo'] = this.orderNo; data['IsDownload'] = this.isDownload; + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 06115173..1bc12af3 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -209,6 +209,7 @@ class LabsService extends BaseService { _requestSendLabReportEmail.setupID = patientLabOrder.setupID; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.isDownload = isDownload; + _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 263d7d32..e250a85c 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -136,7 +136,7 @@ class LabsViewModel extends BaseViewModel { } sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isDownload = false}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isDownload: true); if (_labsService.hasError) { error = _labsService.error; } else diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 574c407f..9ef18fb3 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -59,12 +59,15 @@ class _LaboratoryResultPageState extends State { ), itemCount: 1, ), + SizedBox( + height: 120.0, + ) ], ), ), bottomSheet: Container( color: Colors.white, - height: MediaQuery.of(context).size.height * 0.08, + height: MediaQuery.of(context).size.height * 0.081, width: double.infinity, padding: EdgeInsets.all(12.0), child: Column( From b2f390c19d438d08afa00ee66ec6fcee11bdb739 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 2 Oct 2023 14:42:47 +0300 Subject: [PATCH 38/50] CR 6204 implemented --- ios/Podfile | 26 +++++++++++++++++++ lib/core/service/medical/labs_service.dart | 10 ++++++- .../viewModels/medical/labs_view_model.dart | 13 +++++++--- .../medical/labs/laboratory_result_page.dart | 21 +++++++++++++++ pubspec.yaml | 2 +- 5 files changed, 67 insertions(+), 5 deletions(-) diff --git a/ios/Podfile b/ios/Podfile index c92f7e80..264db98d 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -32,6 +32,7 @@ target 'Runner' do use_modular_headers! pod 'OpenTok', '~> 2.22.0' + pod 'VTO2Lib' flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) end @@ -53,9 +54,34 @@ post_install do |installer| ] build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' + xcconfig_path = build_configuration.base_configuration_reference.real_path + xcconfig = File.read(xcconfig_path) + xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") + File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } + if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' end end end +end + +post_integrate do |installer| + compiler_flags_key = 'COMPILER_FLAGS' + project_path = 'Pods/Pods.xcodeproj' + + project = Xcodeproj::Project.open(project_path) + project.targets.each do |target| + target.build_phases.each do |build_phase| + if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase) + build_phase.files.each do |file| + if !file.settings.nil? && file.settings.key?(compiler_flags_key) + compiler_flags = file.settings[compiler_flags_key] + file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '') + end + end + end + end + end + project.save() end \ No newline at end of file diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 1bc12af3..c9abb4e8 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -11,6 +11,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da class LabsService extends BaseService { List patientLabOrdersList = List(); + String labReportPDF = ""; + Future getPatientLabOrdersList() async { hasError = false; Map body = Map(); @@ -211,7 +213,13 @@ class LabsService extends BaseService { _requestSendLabReportEmail.isDownload = isDownload; _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; - await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { + await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { + + if(isDownload) { + labReportPDF = response['LabReportsPDFContent']; + } + + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: _requestSendLabReportEmail.toJson()); diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index e250a85c..c9fdd114 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -20,6 +20,8 @@ class LabsViewModel extends BaseViewModel { List get labOrdersResultsList => _labsService.labOrdersResultsList; List timeSeries = []; + String get labReportPDF => _labsService.labReportPDF; + List _patientLabOrdersListClinic = List(); List _patientLabOrdersListHospital = List(); @@ -136,10 +138,15 @@ class LabsViewModel extends BaseViewModel { } sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isDownload = false}) async { - await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isDownload: true); + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isDownload: isDownload); if (_labsService.hasError) { error = _labsService.error; - } else - AppToast.showSuccessToast(message: mes); + } else { + if(isDownload) { + + } else { + AppToast.showSuccessToast(message: mes); + } + } } } diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9ef18fb3..f2c86c5f 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -1,7 +1,12 @@ +import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; + import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; @@ -9,6 +14,8 @@ import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/labo import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:open_filex/open_filex.dart'; +import 'package:path_provider/path_provider.dart'; import 'package:provider/provider.dart'; class LaboratoryResultPage extends StatefulWidget { @@ -80,6 +87,12 @@ class _LaboratoryResultPageState extends State { GifLoaderDialogUtils.showMyDialog(context); await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isDownload: true); GifLoaderDialogUtils.hideDialog(context); + try { + String path = await _createFileFromString(model.labReportPDF, "pdf"); + OpenFilex.open(path); + } catch (ex) { + AppToast.showErrorToast(message: "Cannot open file."); + } }, textColor: Colors.white, ), @@ -91,6 +104,14 @@ class _LaboratoryResultPageState extends State { ); } + Future _createFileFromString(String encodedStr, String ext) async { + Uint8List bytes = base64.decode(encodedStr); + String dir = (await getApplicationDocumentsDirectory()).path; + File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext); + await file.writeAsBytes(bytes); + return file.path; + } + String getSpecialResults(LabsViewModel model) { String labResults = ""; model.patientLabSpecialResult.forEach((element) { diff --git a/pubspec.yaml b/pubspec.yaml index 9f3755da..a711467e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -207,7 +207,7 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 google_api_availability: ^3.0.1 -# open_file: ^3.2.1 + # open_file: ^3.2.1 open_filex: ^4.3.2 path_provider: ^2.0.8 # flutter_callkit_incoming: ^1.0.3+3 From af5b0766a27c0916d7b63f032f4c9fa9b4c6f22b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 3 Oct 2023 09:51:50 +0300 Subject: [PATCH 39/50] CR 6654, Disable update manual insurance temporarily. --- lib/config/localized_values.dart | 1 + .../AttachInsuranceCardImageDialog.dart | 41 +++++++++++-------- lib/pages/insurance/insurance_page.dart | 16 ++++---- lib/uitl/translations_delegate_base.dart | 1 + 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e818eb82..7fd9507b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1898,4 +1898,5 @@ const Map localizedValues = { "continueCash": {"en": "Continue as cash", "ar": "تواصل نقدا"}, "updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"}, "downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"}, + "habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."}, }; \ No newline at end of file diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index c331da2a..16c8cdf5 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -132,24 +132,31 @@ class _AttachInsuranceCardImageDialogState extends State { Navigator.pop(context), Navigator.push( - context, - FadePage( - page: UpdateInsuranceManually( + context, + FadePage( + page: UpdateInsuranceManually( patientIdentificationNo: patientIdentificationID, patientID: patientID, patientMobileNumber: mobileNumber, - ))) + ), + ), + ), }, cancelFunction: () => {}); dialog.showAlertDialog(context); diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0863de1e..804cecdd 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2907,6 +2907,7 @@ class TranslationBase { String get continueCash => localizedValues["continueCash"][locale.languageCode]; String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode]; String get downloadReport => localizedValues["downloadReport"][locale.languageCode]; + String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode]; } From 3f6c05825d41893d7eee07377caaa60acb7ef01b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 5 Oct 2023 16:49:26 +0300 Subject: [PATCH 40/50] updates --- lib/config/config.dart | 8 ++++---- lib/core/service/client/base_app_client.dart | 2 +- lib/pages/feedback/send_feedback_page.dart | 2 +- lib/pages/medical/labs/laboratory_result_page.dart | 4 ++-- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0764c199..44c635f4 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,10 +20,10 @@ 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://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/'; +// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://webservices.hmg.com/'; @@ -45,9 +45,9 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // RC API URL -// var RC_BASE_URL = 'https://rc.hmg.com/'; +var RC_BASE_URL = 'https://rc.hmg.com/'; -var RC_BASE_URL = 'https://ms.hmg.com/rc/'; +// var RC_BASE_URL = 'https://ms.hmg.com/rc/'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 87faf867..698b3b43 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 197; //3844083 + // body['PatientID'] = 2001273; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/feedback/send_feedback_page.dart b/lib/pages/feedback/send_feedback_page.dart index 91ae7ba0..06e9560b 100644 --- a/lib/pages/feedback/send_feedback_page.dart +++ b/lib/pages/feedback/send_feedback_page.dart @@ -341,7 +341,7 @@ class _SendFeedbackPageState extends State { } }, color: Color(0xffD02127), - textColor: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xff000000) : Colors.white, + textColor: Colors.white, disabledColor: Color(0xffEAEAEA), ), ), diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 3e4aa2be..9cf303aa 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -58,7 +58,7 @@ class _LaboratoryResultPageState extends State { itemBuilder: (context, index) => LaboratoryResultWidget( onTap: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID))); GifLoaderDialogUtils.hideDialog(context); }, billNo: widget.patientLabOrders.invoiceNo, @@ -88,7 +88,7 @@ class _LaboratoryResultPageState extends State { TranslationBase.of(context).downloadReport, () async { GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isDownload: true); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); GifLoaderDialogUtils.hideDialog(context); try { String path = await _createFileFromString(model.labReportPDF, "pdf"); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 73069b22..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,11 +35,11 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS + // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; From f0a4bd69258e3874ca8c2b5040088d3c71876d2f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 8 Oct 2023 12:49:05 +0300 Subject: [PATCH 41/50] Commented the CRs code --- ios/Runner.xcodeproj/project.pbxproj | 4 +- lib/config/config.dart | 8 +-- .../AttachInsuranceCardImageDialog.dart | 49 +++++++------- lib/pages/insurance/insurance_page.dart | 9 ++- .../medical/labs/laboratory_result_page.dart | 56 ++++++++-------- .../medical/reports/report_home_page.dart | 64 +++++++++---------- .../medical/reports/report_list_widget.dart | 34 +++++----- 7 files changed, 115 insertions(+), 109 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 240eb6e4..02d0d9b7 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -322,6 +322,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -392,6 +393,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); diff --git a/lib/config/config.dart b/lib/config/config.dart index 44c635f4..23c9f20a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -33,12 +33,12 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // // Pharmacy Production URLs -// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; // Pharmacy VidaPlus URLs -var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; -var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; +// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; +// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // // Pharmacy Pre-Production URLs // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; diff --git a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart index 16c8cdf5..03e61116 100644 --- a/lib/pages/insurance/AttachInsuranceCardImageDialog.dart +++ b/lib/pages/insurance/AttachInsuranceCardImageDialog.dart @@ -132,31 +132,32 @@ class _AttachInsuranceCardImageDialogState extends State { Navigator.pop(context), Navigator.push( diff --git a/lib/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index 9cf303aa..d5bb9035 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -75,34 +75,34 @@ class _LaboratoryResultPageState extends State { ], ), ), - bottomSheet: Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.081, - width: double.infinity, - padding: EdgeInsets.all(12.0), - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width * 0.9, - child: DefaultButton( - TranslationBase.of(context).downloadReport, - () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); - GifLoaderDialogUtils.hideDialog(context); - try { - String path = await _createFileFromString(model.labReportPDF, "pdf"); - OpenFilex.open(path); - } catch (ex) { - AppToast.showErrorToast(message: "Cannot open file."); - } - }, - textColor: Colors.white, - ), - ), - ], - ), - ), + // bottomSheet: Container( + // color: Colors.white, + // height: MediaQuery.of(context).size.height * 0.081, + // width: double.infinity, + // padding: EdgeInsets.all(12.0), + // child: Column( + // children: [ + // Container( + // width: MediaQuery.of(context).size.width * 0.9, + // child: DefaultButton( + // TranslationBase.of(context).downloadReport, + // () async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); + // GifLoaderDialogUtils.hideDialog(context); + // try { + // String path = await _createFileFromString(model.labReportPDF, "pdf"); + // OpenFilex.open(path); + // } catch (ex) { + // AppToast.showErrorToast(message: "Cannot open file."); + // } + // }, + // textColor: Colors.white, + // ), + // ), + // ], + // ), + // ), ), ); } diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 911e74a0..55d1b901 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -70,38 +70,38 @@ class _HomeReportPageState extends State with SingleTickerProvid body: Container( child: Column( children: [ - TabBar( - controller: _tabController_new, - indicatorWeight: 3.0, - indicatorSize: TabBarIndicatorSize.tab, - labelColor: Color(0xff2B353E), - unselectedLabelColor: Color(0xff575757), - labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), - labelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - unselectedLabelStyle: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - ), - onTap: (int value) { - print(value); - setState(() {}); - }, - tabs: [ - Text( - TranslationBase.of(context).outpatient, - style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - ), - Text( - TranslationBase.of(context).inPatient, - style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), - ), - ], - ), + // TabBar( + // controller: _tabController_new, + // indicatorWeight: 3.0, + // indicatorSize: TabBarIndicatorSize.tab, + // labelColor: Color(0xff2B353E), + // unselectedLabelColor: Color(0xff575757), + // labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + // labelStyle: TextStyle( + // fontSize: 16, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.48, + // ), + // unselectedLabelStyle: TextStyle( + // fontSize: 16, + // fontWeight: FontWeight.w600, + // letterSpacing: -0.48, + // ), + // onTap: (int value) { + // print(value); + // setState(() {}); + // }, + // tabs: [ + // Text( + // TranslationBase.of(context).outpatient, + // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + // ), + // Text( + // TranslationBase.of(context).inPatient, + // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + // ), + // ], + // ), if (model.user != null) Expanded( child: TabBarView( diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index adaef00e..2809b317 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget { if (reportList[index].status == 2) Row( children: [ - InkWell( - onTap: () { - getMedicalReportPDF(report); - }, - child: Padding( - padding: const EdgeInsets.only(right: 11.0, left: 11.0), - child: Text(TranslationBase.of(context).viewReport, - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - fontStyle: FontStyle.italic, - color: CustomColors.accentColor, - letterSpacing: -0.48, - height: 18 / 12, - decoration: TextDecoration.underline)), - ), - ), + // InkWell( + // onTap: () { + // getMedicalReportPDF(report); + // }, + // child: Padding( + // padding: const EdgeInsets.only(right: 11.0, left: 11.0), + // child: Text(TranslationBase.of(context).viewReport, + // style: TextStyle( + // fontSize: 12, + // fontWeight: FontWeight.w600, + // fontStyle: FontStyle.italic, + // color: CustomColors.accentColor, + // letterSpacing: -0.48, + // height: 18 / 12, + // decoration: TextDecoration.underline)), + // ), + // ), IconButton( icon: Icon(Icons.email), color: Color(0xff28323A), From 645e266af8096f5234746f14ed07bde65ab5b9d6 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 9 Oct 2023 12:09:57 +0300 Subject: [PATCH 42/50] Vida plus updates sent to stores --- lib/config/config.dart | 6 ++++-- lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- pubspec.yaml | 10 +++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 23c9f20a..24b1378a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,14 +20,16 @@ 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://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/'; -// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://webservices.hmg.com/'; +// var BASE_URL = 'http://10.50.100.198:4422/'; + // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS diff --git a/pubspec.yaml b/pubspec.yaml index a711467e..235254f9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.026+4050026 +version: 4.5.028+4050028 environment: sdk: ">=2.7.0 <3.0.0" @@ -42,6 +42,7 @@ dependencies: # Permissions permission_handler: ^10.2.0 + # Flutter Html View flutter_html: ^2.2.1 @@ -136,6 +137,13 @@ dependencies: #device_calendar device_calendar: ^4.2.0 + # TEMPORAL FIX for https://github.com/builttoroam/device_calendar/issues/507 + # device_calendar: ^4.3.1 +# device_calendar: +# git: +# url: https://github.com/builttoroam/device_calendar.git +# ref: develop + #Handle Geolocation geolocator: ^9.0.2 From d11b12ac9a9a07b4f381de84a168822744bd0068 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 10 Oct 2023 12:11:03 +0300 Subject: [PATCH 43/50] no message --- lib/core/service/client/base_app_client.dart | 4 +- .../medical/labs/laboratory_result_page.dart | 56 +++++++++---------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 698b3b43..bf6bff20 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -159,11 +159,11 @@ class BaseAppClient { body.removeWhere((key, value) => key == null || value == null); - if (AppGlobal.isNetworkDebugEnabled) { + // if (AppGlobal.isNetworkDebugEnabled) { print("URL : $url"); final jsonBody = json.encode(body); print(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/pages/medical/labs/laboratory_result_page.dart b/lib/pages/medical/labs/laboratory_result_page.dart index d5bb9035..9cf303aa 100644 --- a/lib/pages/medical/labs/laboratory_result_page.dart +++ b/lib/pages/medical/labs/laboratory_result_page.dart @@ -75,34 +75,34 @@ class _LaboratoryResultPageState extends State { ], ), ), - // bottomSheet: Container( - // color: Colors.white, - // height: MediaQuery.of(context).size.height * 0.081, - // width: double.infinity, - // padding: EdgeInsets.all(12.0), - // child: Column( - // children: [ - // Container( - // width: MediaQuery.of(context).size.width * 0.9, - // child: DefaultButton( - // TranslationBase.of(context).downloadReport, - // () async { - // GifLoaderDialogUtils.showMyDialog(context); - // await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); - // GifLoaderDialogUtils.hideDialog(context); - // try { - // String path = await _createFileFromString(model.labReportPDF, "pdf"); - // OpenFilex.open(path); - // } catch (ex) { - // AppToast.showErrorToast(message: "Cannot open file."); - // } - // }, - // textColor: Colors.white, - // ), - // ), - // ], - // ), - // ), + bottomSheet: Container( + color: Colors.white, + height: MediaQuery.of(context).size.height * 0.081, + width: double.infinity, + padding: EdgeInsets.all(12.0), + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: DefaultButton( + TranslationBase.of(context).downloadReport, + () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true); + GifLoaderDialogUtils.hideDialog(context); + try { + String path = await _createFileFromString(model.labReportPDF, "pdf"); + OpenFilex.open(path); + } catch (ex) { + AppToast.showErrorToast(message: "Cannot open file."); + } + }, + textColor: Colors.white, + ), + ), + ], + ), + ), ), ); } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 7c804f77fbabb0f74469a85c2ef324c22bfaed2d Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 11 Oct 2023 11:53:38 +0300 Subject: [PATCH 44/50] updates & fixes --- lib/config/config.dart | 4 ++-- lib/core/service/medical/PatientSickLeaveService.dart | 8 +++++--- lib/core/service/medical/labs_service.dart | 6 +++--- lib/core/viewModels/medical/labs_view_model.dart | 4 ++-- lib/pages/insurance/insurance_update_screen.dart | 2 +- lib/pages/medical/allergies_page.dart | 5 +++-- lib/pages/medical/patient_sick_leave_page.dart | 5 +++-- .../data_display/medical/LabResult/FlowChartPage.dart | 11 +++++++++-- .../medical/LabResult/laboratory_result_widget.dart | 2 ++ lib/widgets/in_app_browser/InAppBrowser.dart | 4 ++-- 10 files changed, 32 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 24b1378a..6778932a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,11 +20,11 @@ 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://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/'; -var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; +// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://webservices.hmg.com/'; diff --git a/lib/core/service/medical/PatientSickLeaveService.dart b/lib/core/service/medical/PatientSickLeaveService.dart index 10d30606..3c4a397a 100644 --- a/lib/core/service/medical/PatientSickLeaveService.dart +++ b/lib/core/service/medical/PatientSickLeaveService.dart @@ -11,9 +11,11 @@ class PatientSickLeaveService extends BaseService { await baseAppClient.post(GET_PATIENT_SICK_LEAVE_STATUS, onSuccess: (response, statusCode) async { sickLeaveList.clear(); - response['List_SickLeave'].forEach((sickLeave) { - sickLeaveList.add(SickLeave.fromJson(sickLeave)); - }); + if(response['List_SickLeave'] != null && response['List_SickLeave'].length != 0) { + response['List_SickLeave'].forEach((sickLeave) { + sickLeaveList.add(SickLeave.fromJson(sickLeave)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/medical/labs_service.dart b/lib/core/service/medical/labs_service.dart index 15337576..bee65b87 100644 --- a/lib/core/service/medical/labs_service.dart +++ b/lib/core/service/medical/labs_service.dart @@ -177,11 +177,11 @@ class LabsService extends BaseService { return Future.value(localRes); } - Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { + Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = "0"; - body['InvoiceNo_VP'] = patientLabOrder.invoiceNo; + body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0"; + body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo; body['OrderNo'] = patientLabOrder.orderNo; body['isDentalAllowedBackend'] = false; body['SetupID'] = patientLabOrder.setupID; diff --git a/lib/core/viewModels/medical/labs_view_model.dart b/lib/core/viewModels/medical/labs_view_model.dart index 4fbab4e6..ca577ac6 100644 --- a/lib/core/viewModels/medical/labs_view_model.dart +++ b/lib/core/viewModels/medical/labs_view_model.dart @@ -114,9 +114,9 @@ class LabsViewModel extends BaseViewModel { } } - getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { + getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async { setState(ViewState.Busy); - await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure); + await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, isVidaPlus: isVidaPlus); if (_labsService.hasError) { error = _labsService.error; setState(ViewState.Error); diff --git a/lib/pages/insurance/insurance_update_screen.dart b/lib/pages/insurance/insurance_update_screen.dart index 56f67282..49446730 100644 --- a/lib/pages/insurance/insurance_update_screen.dart +++ b/lib/pages/insurance/insurance_update_screen.dart @@ -167,7 +167,7 @@ class _InsuranceUpdateState extends State with SingleTickerProv Container( margin: EdgeInsets.only(top: 6.5, left: 2.0), child: Text( - model.insuranceUpdate[index].statusDescription, + model.insuranceUpdate[index].statusDescription ?? "", style: TextStyle( fontSize: 10, fontWeight: FontWeight.w600, diff --git a/lib/pages/medical/allergies_page.dart b/lib/pages/medical/allergies_page.dart index b3f54a60..ba6ce2cc 100644 --- a/lib/pages/medical/allergies_page.dart +++ b/lib/pages/medical/allergies_page.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; @@ -22,7 +23,7 @@ class AllergiesPage extends StatelessWidget { baseViewModel: model, description: TranslationBase.of(context).infoAllergies, imagesInfo: imagesInfo, - body: ListView.builder( + body: model.allergies.isNotEmpty ? ListView.builder( itemCount: model.allergies.length, itemBuilder: (context, index) => Container( margin: EdgeInsets.all(15), @@ -54,7 +55,7 @@ class AllergiesPage extends StatelessWidget { ], ), ), - ), + ) : getNoDataWidget(context), ), ); } diff --git a/lib/pages/medical/patient_sick_leave_page.dart b/lib/pages/medical/patient_sick_leave_page.dart index 479b5fe6..15e68e0e 100644 --- a/lib/pages/medical/patient_sick_leave_page.dart +++ b/lib/pages/medical/patient_sick_leave_page.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -49,7 +50,7 @@ class _PatientSickLeavePageState extends State { backgroundColor: Color(0xffF7F7F7), imagesInfo: imagesInfo, baseViewModel: model, - body: ListView.separated( + body: model.sickLeaveList.isNotEmpty ? ListView.separated( physics: BouncingScrollPhysics(), itemCount: model.sickLeaveList.length, padding: EdgeInsets.all(21), @@ -69,7 +70,7 @@ class _PatientSickLeavePageState extends State { showConfirmMessage(model, index); }, ), - ), + ) : getNoDataWidget(context), ), ); } diff --git a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart index 8f5a0df9..c369c84e 100644 --- a/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart +++ b/lib/widgets/data_display/medical/LabResult/FlowChartPage.dart @@ -1,13 +1,16 @@ import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/charts/show_chart.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'LineChartCurved.dart'; import 'lab_result_chart_and_detials.dart'; @@ -18,10 +21,14 @@ class FlowChartPage extends StatelessWidget { FlowChartPage({this.patientLabOrder, this.filterName}); + ProjectViewModel projectViewModel; + @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName), + onModelReady: (model) => + model.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: filterName, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(patientLabOrder.projectID))), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, @@ -72,7 +79,7 @@ class FlowChartPage extends StatelessWidget { ) : Center( child: Container( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.32), + padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * 0.32), child: Center( child: getNoDataWidget(context), ), diff --git a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart index 3436523d..f08bc3dd 100644 --- a/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart +++ b/lib/widgets/data_display/medical/LabResult/laboratory_result_widget.dart @@ -151,6 +151,7 @@ class _LaboratoryResultWidgetState extends State { ], ), child: Column( + mainAxisSize: MainAxisSize.min, children: [ Row( children: [ @@ -170,6 +171,7 @@ class _LaboratoryResultWidgetState extends State { if (_isShowMore) Container( width: double.infinity, + // height: 450.0, child: Html( data: widget.details ?? TranslationBase.of(context).noDataAvailable, ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 28a364e5..f38ad57c 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 55f1e4166e8101ecb109ba3ff09a7110c4d28b9b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 29 Oct 2023 16:13:34 +0300 Subject: [PATCH 45/50] updates --- lib/core/service/client/base_app_client.dart | 2 +- .../widgets/AppointmentActions.dart | 21 ++++++++++++++++--- lib/pages/ToDoList/ToDo.dart | 7 ++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index bf6bff20..313742fa 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,7 +150,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 2001273; //3844083 + // body['PatientID'] = 4767512; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 8068c541..0802f91d 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -73,7 +73,8 @@ class _AppointmentActionsState extends State { shrinkWrap: true, itemBuilder: (context, index) { // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); - bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); + bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || + (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); return InkWell( onTap: shouldEnable ? null @@ -583,12 +584,26 @@ class _AppointmentActionsState extends State { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { if (widget.projectViewModel.isLogin) { if (model.count != 0) { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } else { AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); } } else { - Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); + Navigator.push( + context, + FadePage( + page: ToDo( + isShowAppBar: true, + isFromMyAppointments: true, + appointment: widget.appo, + ))); } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 75290ab1..b147f6c1 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -55,8 +55,10 @@ class ToDo extends StatefulWidget { bool isShowAppBar = true; Function onBackClick; + bool isFromMyAppointments; + AppoitmentAllHistoryResultList appointment; - ToDo({@required this.isShowAppBar, this.onBackClick}); + ToDo({@required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment}); @override _ToDoState createState() => _ToDoState(); @@ -833,6 +835,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { }); } dataLoaded = true; + if(widget.isFromMyAppointments) { + getPatientShare(context, widget.appointment); + } }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); From a5e0de08cef3c8f6fc09011748a5095f15268c0c Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 30 Oct 2023 12:05:07 +0300 Subject: [PATCH 46/50] updates for ancillary --- lib/config/config.dart | 2 +- .../ancillary-orders/ancillaryOrdersDetails.dart | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 6778932a..5ab2c668 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -337,7 +337,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 10.9; +var VERSION_ID = 11.1; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index b1b457f5..547d8467 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -134,9 +134,13 @@ class _AnicllaryOrdersState extends State with SingleTic SizedBox(height: 12), DefaultButton( TranslationBase.of(context).payNow.toUpperCase(), - selectedProcList.length > 0 && getTotalValue() != "0.00" + selectedProcList.length > 0 ? () { - makePayment(model); + if (getTotalValue() != "0.00") { + makePayment(model); + } else { + autoGenerateInvoice(); + } } : null, color: CustomColors.green, @@ -677,6 +681,8 @@ 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) { GifLoaderDialogUtils.hideDialog(localContext); From 542501f5c58ec83ac65d65332029458fc88338b3 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 31 Oct 2023 09:47:45 +0300 Subject: [PATCH 47/50] updates --- lib/config/localized_values.dart | 2 +- lib/pages/BookAppointment/QRCode.dart | 49 ++++++-------------- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- 3 files changed, 17 insertions(+), 38 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7fd9507b..29671b2d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -182,7 +182,7 @@ const Map localizedValues = { 'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'}, 'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'}, 'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'}, - 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وافحصها عبر NFC لتسجيل الوصول'}, + 'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول'}, 'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'}, "sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"}, "success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"}, diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 2f861bd3..5c17950b 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -16,6 +16,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; @@ -111,44 +112,22 @@ class _QRCodeState extends State { onTap: () {}, onRatingAndReviewTap: () {}, ), - InkWell( - child: Container( - margin: EdgeInsets.only(top: 30.0), - padding: EdgeInsets.all(8), - child: SvgPicture.asset( - "assets/images/nfc/contactless.svg", - width: 80.0, - height: 80.0, - ), - ), - onTap: () { - showNfcReader(context, onNcfScan: (String nfcId) { - Future.delayed(const Duration(milliseconds: 100), () { - sendNfcCheckInRequest(nfcId); - locator().todoList.to_do_list_nfc(widget.appointment); - }); - }, onCancel: () { - // Navigator.of(context).pop(); - locator().todoList.to_do_list_nfc_cancel(widget.appointment); - }); - }, + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), + child: Text(TranslationBase.of(context).scanQRHospital, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + )), ), + mHeight(21), Row( - children: [ - Expanded( - child: Container( - width: double.infinity, - margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), - child: Text(TranslationBase.of(context).scanQRHospital, - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w600, - letterSpacing: -0.48, - )), - ), - ), + children: [ + ], - ), + ) ], ), ), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index f38ad57c..28a364e5 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -35,9 +35,9 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS From 0a478e077aec0411bb70ea054acf56930b74142b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 31 Oct 2023 10:42:07 +0300 Subject: [PATCH 48/50] QR Code checkin implemented --- lib/pages/BookAppointment/QRCode.dart | 126 +++++++++++++----- lib/uitl/utils.dart | 23 ++-- .../medical/medical_profile_item.dart | 4 +- 3 files changed, 105 insertions(+), 48 deletions(-) diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 5c17950b..ad676eff 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -1,5 +1,6 @@ import 'dart:typed_data'; +import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -18,6 +19,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; @@ -56,7 +58,7 @@ class _QRCodeState extends State { }); WidgetsBinding.instance.addPostFrameCallback((timeStamp) { - startNFCScan(); + // startNFCScan(); }); super.initState(); @@ -76,9 +78,18 @@ class _QRCodeState extends State { }); } + startQRCodeScan() async { + String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; + if (onlineCheckInQRCode != "") { + sendNfcCheckInRequest(onlineCheckInQRCode); + locator().todoList.to_do_list_nfc(widget.appointment); + } else {} + } + @override Widget build(BuildContext context) { _context = context; + List checkInOptionsList = getCheckInOptionsList(context); return AppScaffold( appBarTitle: TranslationBase.of(context).onlineCheckIn, isShowAppBar: true, @@ -123,47 +134,94 @@ class _QRCodeState extends State { )), ), mHeight(21), - Row( - children: [ - - ], - ) - ], - ), - ), - bottomSheet: Container( - color: CustomColors.appBackgroudGreyColor, - padding: EdgeInsets.all(21), - // height: 45.0, - child: Row( - children: [ - Expanded( - flex: 1, - child: ButtonTheme( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - height: 45.0, - child: CustomTextButton( - backgroundColor: CustomColors.green, - elevation: 0, - onPressed: () { - startNFCScan(); - }, - child: Text(TranslationBase.of(context).scanNFC, - style: TextStyle( - fontSize: 18.0, - color: Colors.white, - )), - ), + Padding( + padding: EdgeInsets.only(left: 21, right: 21), + child: GridView.builder( + shrinkWrap: true, + primary: false, + physics: NeverScrollableScrollPhysics(), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12), + padding: EdgeInsets.zero, + itemCount: checkInOptionsList.length, + itemBuilder: (BuildContext context, int index) { + return checkInOptionsList[index]; + }, ), ), ], ), ), + // bottomSheet: Container( + // color: CustomColors.appBackgroudGreyColor, + // padding: EdgeInsets.all(21), + // // height: 45.0, + // child: Row( + // children: [ + // Expanded( + // flex: 1, + // child: ButtonTheme( + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(10.0), + // ), + // height: 45.0, + // child: CustomTextButton( + // backgroundColor: CustomColors.green, + // elevation: 0, + // onPressed: () { + // startNFCScan(); + // }, + // child: Text(TranslationBase.of(context).scanNFC, + // style: TextStyle( + // fontSize: 18.0, + // color: Colors.white, + // )), + // ), + // ), + // ), + // ], + // ), + // ), ); } + List getCheckInOptionsList(BuildContext context) { + List optionsList = []; + + optionsList.add( + InkWell( + onTap: () { + startNFCScan(); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).scanNFC, + imagePath: 'contactless.svg', + subTitle: "", + isEnable: true, + width: 80.0, + height: 80.0, + ), + ), + ); + + optionsList.add( + InkWell( + onTap: () { + startQRCodeScan(); + }, + child: MedicalProfileItem( + title: TranslationBase.of(context).pharmaLiveCareScanQR, + imagePath: 'qr_code.svg', + subTitle: "", + isEnable: true, + width: 80.0, + height: 80.0, + ), + ), + ); + + return optionsList; + } + sendEmail() async { DoctorsListService service = new DoctorsListService(); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 75b11879..d41d4f1f 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -294,15 +294,17 @@ class Utils { )); } - medical.add(InkWell( - onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, - child: MedicalProfileItem( - title: TranslationBase.of(context).radiology, - imagePath: 'radiology.svg', - subTitle: TranslationBase.of(context).radiologySubtitle, - isEnable: projectViewModel.havePrivilege(7), + medical.add( + InkWell( + onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null, + child: MedicalProfileItem( + title: TranslationBase.of(context).radiology, + imagePath: 'radiology.svg', + subTitle: TranslationBase.of(context).radiologySubtitle, + isEnable: projectViewModel.havePrivilege(7), + ), ), - )); + ); medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null, @@ -820,10 +822,7 @@ class Utils { return isVidaPlus; } - static String generateSignature() { - - } - + static String generateSignature() {} } Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) { diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index cfe7f59f..0a4a1928 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -51,8 +51,8 @@ class MedicalProfileItem extends StatelessWidget { ) : SvgPicture.asset( "assets/images/new/services/$imagePath", - height: SizeConfig.widthMultiplier * 7, - width: SizeConfig.widthMultiplier * 7, + height: height != null ? height : SizeConfig.widthMultiplier * 7, + width: width != null ? width : SizeConfig.widthMultiplier * 7, color: imgColor, ), mFlex(2), From 6bd6572e7e64f80fe8bd0a49606b8f56f771a204 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 31 Oct 2023 16:28:53 +0300 Subject: [PATCH 49/50] Lab, Rad & prescription disabled in my appointments screen in case of ER appointment (Clinic ID 10) & project is Vida Plus. --- lib/config/config.dart | 4 ++-- lib/core/service/client/base_app_client.dart | 4 ++-- lib/pages/MyAppointments/widgets/AppointmentActions.dart | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5ab2c668..d1fbb48e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,13 +20,13 @@ 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://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/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://webservices.hmg.com/'; +var BASE_URL = 'https://webservices.hmg.com/'; // var BASE_URL = 'http://10.50.100.198:4422/'; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 313742fa..44dc5764 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -150,8 +150,8 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 4767512; //3844083 - // body['TokenID'] = "@dm!n"; + body['PatientID'] = 2621536; //3844083 + body['TokenID'] = "@dm!n"; // Patient ID: 3027574 // Mobile no.: 0502303285 diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 0802f91d..9a71e55c 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -29,6 +29,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -74,7 +75,10 @@ class _AppointmentActionsState extends State { itemBuilder: (context, index) { // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || - (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); + (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || + (Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) && + widget.appo.clinicID == 10 && + (appoButtonsList[index].caller == "prescriptions" || appoButtonsList[index].caller == "radiology" || appoButtonsList[index].caller == "labResult"))); return InkWell( onTap: shouldEnable ? null From 13b2db47b58fcefe74faa813b4ac7c957502490a Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 1 Nov 2023 10:40:18 +0300 Subject: [PATCH 50/50] HMC color change applied in my appointments --- .../model/privilege/HMCProjectListModel.dart | 15 +++++++++++++++ lib/core/service/privilege_service.dart | 12 ++++++++++-- lib/core/viewModels/project_view_model.dart | 9 +++++++++ lib/pages/MyAppointments/MyAppointments.dart | 1 + lib/splashPage.dart | 1 + lib/uitl/utils.dart | 10 ++++++++++ .../data_display/medical/doctor_card.dart | 17 +++++++++++------ 7 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 lib/core/model/privilege/HMCProjectListModel.dart diff --git a/lib/core/model/privilege/HMCProjectListModel.dart b/lib/core/model/privilege/HMCProjectListModel.dart new file mode 100644 index 00000000..6b69c1c5 --- /dev/null +++ b/lib/core/model/privilege/HMCProjectListModel.dart @@ -0,0 +1,15 @@ +class HMCProjectListModel { + int projectID; + + HMCProjectListModel({this.projectID}); + + HMCProjectListModel.fromJson(Map json) { + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + return data; + } +} diff --git a/lib/core/service/privilege_service.dart b/lib/core/service/privilege_service.dart index e9b2d8a9..137bfca6 100644 --- a/lib/core/service/privilege_service.dart +++ b/lib/core/service/privilege_service.dart @@ -1,11 +1,13 @@ import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class PrivilegeService extends BaseService { - List privilegeModelList = List(); - List vidaPlusProjectListModel = List(); + List privilegeModelList = []; + List vidaPlusProjectListModel = []; + List hMCProjectListModel = []; Future getPrivilege() async { Map body = Map(); @@ -20,6 +22,12 @@ class PrivilegeService extends BaseService { vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item)); }); } + + if (response['HMCProjectList'].length != 0) { + response['HMCProjectList'].forEach((item) { + hMCProjectListModel.add(HMCProjectListModel.fromJson(item)); + }); + } }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index d3b7566c..3a47c753 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -4,6 +4,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; @@ -60,11 +61,14 @@ class ProjectViewModel extends BaseViewModel { List privilegeRootUser = List(); List privilegeChildUser = List(); List _vidaPlusProjectListModel = List(); + List _hMCProjectListModel = []; List get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; List get vidaPlusProjectList => _vidaPlusProjectListModel; + List get hMCProjectListModel => _hMCProjectListModel; + List selectedBodyPartList = []; StreamSubscription subscription; @@ -130,6 +134,11 @@ class ProjectViewModel extends BaseViewModel { notifyListeners(); } + setHMCProjectList(List hMCProjectListModel) { + _hMCProjectListModel = hMCProjectListModel; + notifyListeners(); + } + setPrivilege({privilegeList, bool isLoginChild = false}) { List privilege = List(); diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index cccff881..533bd6e6 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -371,6 +371,7 @@ class _MyAppointmentsState extends State with SingleTickerProvid }), isInOutPatient: _appointmentResult.isInOutPatient, name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, + projectID: _appointmentResult.projectID, // billNo: _appointmentResult.invoiceNo, profileUrl: _appointmentResult.doctorImageURL, subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName, diff --git a/lib/splashPage.dart b/lib/splashPage.dart index 04e1c3b5..8ffef7a4 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -55,6 +55,7 @@ class _SplashScreenState extends State { ProjectViewModel projectProvider = Provider.of(context, listen: false); projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList); projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); + projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel); AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); var themeNotifier = Provider.of(context, listen: false); diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index d41d4f1f..a39029b8 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -822,6 +822,16 @@ class Utils { return isVidaPlus; } + static bool isHMCProject(ProjectViewModel projectViewModel, int projectID) { + bool isHMCProject = false; + projectViewModel.hMCProjectListModel.forEach((element) { + if (element.projectID == projectID) { + isHMCProject = true; + } + }); + return isHMCProject; + } + static String generateSignature() {} } diff --git a/lib/widgets/data_display/medical/doctor_card.dart b/lib/widgets/data_display/medical/doctor_card.dart index 20b2714e..12454335 100644 --- a/lib/widgets/data_display/medical/doctor_card.dart +++ b/lib/widgets/data_display/medical/doctor_card.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -32,6 +33,7 @@ class DoctorCard extends StatelessWidget { final String vaccineName; final bool isSickLeave; final int sickLeaveStatus; + final int projectID; DoctorCard( {this.name, @@ -51,7 +53,8 @@ class DoctorCard extends StatelessWidget { this.vaccineName = "", this.isParentAppointment = false, this.isSickLeave = false, - this.sickLeaveStatus = 0}); + this.sickLeaveStatus = 0, + this.projectID = 0}); ProjectViewModel projectViewModel; @@ -87,11 +90,13 @@ class DoctorCard extends StatelessWidget { decoration: isShowInOutPatient ? BoxDecoration( //Colors.red[900] Color(0xff404545) - color: isLiveCareAppointment - ? Color(0xff2E303A) - : !isInOutPatient - ? Color(0xffD02127) - : Color(0xffa9a089), + color: Utils.isHMCProject(projectViewModel, projectID) + ? Color(0xff3FACC8) + : isLiveCareAppointment + ? Color(0xff2E303A) + : !isInOutPatient + ? Color(0xffD02127) + : Color(0xffa9a089), borderRadius: BorderRadius.only( topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10), bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10),