From b39357a497d97564a7f12b134e6f56e8632c988f Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 7 Jan 2024 15:06:22 +0300 Subject: [PATCH] Medical report changes, Loading added in Location Check-In --- lib/config/config.dart | 4 ++-- lib/core/model/reports/Reports.dart | 4 ++++ lib/core/service/client/base_app_client.dart | 2 +- lib/pages/BookAppointment/QRCode.dart | 5 ++++ lib/pages/landing/landing_page.dart | 2 +- .../medical/reports/report_list_widget.dart | 5 +++- lib/uitl/location_util.dart | 24 +++++++++++++++---- 7 files changed, 36 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a77a0814..128264a2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:4422/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; +var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; diff --git a/lib/core/model/reports/Reports.dart b/lib/core/model/reports/Reports.dart index 6791a3d4..0d409f04 100644 --- a/lib/core/model/reports/Reports.dart +++ b/lib/core/model/reports/Reports.dart @@ -5,6 +5,7 @@ class Reports { DateTime encounterDate; int projectID; int invoiceNo; + int invoiceNo_VP; int encounterNo; String procedureId; int requestType; @@ -35,6 +36,7 @@ class Reports { this.encounterDate, this.projectID, this.invoiceNo, + this.invoiceNo_VP, this.encounterNo, this.procedureId, this.requestType, @@ -67,6 +69,7 @@ class Reports { json['EncounterDate']); //json['EncounterDate']; projectID = json['ProjectID']; invoiceNo = json['InvoiceNo']; + invoiceNo_VP = json['InvoiceNo_VP']; encounterNo = json['EncounterNo']; procedureId = json['ProcedureId']; requestType = json['RequestType']; @@ -104,6 +107,7 @@ class Reports { data['EncounterDate'] = this.encounterDate; data['ProjectID'] = this.projectID; data['InvoiceNo'] = this.invoiceNo; + data['InvoiceNo_VP'] = this.invoiceNo_VP; data['EncounterNo'] = this.encounterNo; data['ProcedureId'] = this.procedureId; data['RequestType'] = this.requestType; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 109326bc..f756ba8e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -175,7 +175,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; - // body['PatientID'] = 1018977; //3844083 + // body['PatientID'] = 1400563; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart index 90e39767..cc700e97 100644 --- a/lib/pages/BookAppointment/QRCode.dart +++ b/lib/pages/BookAppointment/QRCode.dart @@ -93,16 +93,21 @@ class _QRCodeState extends State { } startLocationCheckIn() async { + GifLoaderDialogUtils.showMyDialog(context); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils.getCurrentLocation(callBack: (value) { projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment.projectID); double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000; print(dist); if (dist <= projectDetailListModel.geofenceRadius) { + GifLoaderDialogUtils.hideDialog(context); sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3); } else { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); } + }, failureCallBack: () { + GifLoaderDialogUtils.hideDialog(context); }); } diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 601e7303..36257423 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -650,7 +650,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { authService.getDashboard().then((value) async { setState(() { if (value != null) { - notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); + notificationCount = value ['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); model.setState(model.count, 0, true, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount); FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 2809b317..82df163c 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -12,6 +12,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/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; @@ -197,7 +198,9 @@ class ReportListWidget extends StatelessWidget { GifLoaderDialogUtils.showMyDialog(AppGlobal.context); ReportsService _reportsService = locator(); _reportsService - .sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID, + .sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), + Utils.isVidaPlusProject(projectViewModel, report.projectID) ? report.invoiceNo_VP.toString() : report.invoiceNo.toString(), + report.projectID, DateUtil.convertDateToString(report.requestDate), report.setupId) .then((value) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); diff --git a/lib/uitl/location_util.dart b/lib/uitl/location_util.dart index 3eb6388f..b890882f 100644 --- a/lib/uitl/location_util.dart +++ b/lib/uitl/location_util.dart @@ -28,7 +28,7 @@ class LocationUtils { LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false}); - void getCurrentLocation({Function(LatLng) callBack}) async { + void getCurrentLocation({Function(LatLng) callBack, Function() failureCallBack}) async { if (Platform.isAndroid && isHuawei) { _getHMSCurrentLocation(callBack); } else { @@ -68,7 +68,7 @@ class LocationUtils { print(err); }); } else { - if (isShowConfirmDialog) showErrorLocationDialog(false); + if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: failureCallBack); } }).catchError((err) { print(err); @@ -141,14 +141,28 @@ class LocationUtils { } } - showErrorLocationDialog(bool isPermissionError) { + showErrorLocationDialog(bool isPermissionError, {Function() failureCallBack}) { ConfirmDialog dialog = new ConfirmDialog( context: context, confirmMessage: TranslationBase.of(context).locationDialogMessage, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, - okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings(), Navigator.of(context).canPop()}, - cancelFunction: () => {}); + okFunction: () { + ConfirmDialog.closeAlertDialog(context); + if (isPermissionError) + Geolocator.openAppSettings(); + else + Geolocator.openLocationSettings(); + Navigator.of(context).canPop(); + if (failureCallBack != null) { + failureCallBack(); + } + }, + cancelFunction: () { + if (failureCallBack != null) { + failureCallBack(); + } + }); return dialog.showAlertDialog(context); }