From e80ac2481a6ba4d48835209eef2dd133c3a26425 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 31 Oct 2022 16:01:22 +0300 Subject: [PATCH] Ancillary order & manual insurance update --- lib/config/config.dart | 8 +- lib/config/localized_values.dart | 3 + .../patient_advance_balance_amount.dart | 2 +- .../service/ancillary_orders_service.dart | 33 +- lib/core/service/client/base_app_client.dart | 4 +- lib/core/service/insurance_service.dart | 56 +- .../insurance/getInsuranceCompaniesModel.dart | 64 +++ lib/models/tamara_request_model.dart | 14 +- .../ancillaryOrdersDetails.dart | 25 +- lib/pages/BookAppointment/BookSuccess.dart | 4 +- lib/pages/ToDoList/ToDo.dart | 502 ++++++++++-------- .../insurance/UpdateInsuranceManually.dart | 93 ++-- lib/pages/insurance/insurance_page.dart | 16 +- lib/pages/livecare/widgets/clinic_list.dart | 2 +- lib/pages/paymentService/payment_service.dart | 61 ++- .../clinic_services/get_clinic_service.dart | 21 +- lib/uitl/translations_delegate_base.dart | 3 + lib/widgets/in_app_browser/InAppBrowser.dart | 3 + .../others/app_expandable_notifier.dart | 22 +- pubspec.yaml | 2 +- 20 files changed, 627 insertions(+), 311 deletions(-) create mode 100644 lib/models/insurance/getInsuranceCompaniesModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index b1caf315..a2d3ecac 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:3334/'; -// 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/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -408,7 +408,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 = 9.6; +var VERSION_ID = 9.7; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -430,6 +430,8 @@ var GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory"; var INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; +var INSURANCE_SCHEMES = "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet"; +var INSURANCE_COMPANIES = "Services/Patients.svc/REST/PatientER_InsuranceCompanyGet"; var GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; var UPLOAD_INSURANCE_CARD = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 665464d7..c921c5b9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1857,5 +1857,8 @@ const Map localizedValues = { "cardHolderName": { "en": "Card Holder Name", "ar": "إسم صاحب البطاقة" }, "membershipNo": { "en": "Membership No.", "ar": "رقم العضوية" }, "policyNo": { "en": "Policy No.", "ar": "رقم وثيقة التأمين" }, + "paymentOnly": { "en": "Payment", "ar": "معلقة" }, + "pendingOnly": { "en": "Pending", "ar": "مدفوعات" }, "insuranceClassName": { "en": "Insurance Class", "ar": "فئة التأمين" }, + "NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" }, }; diff --git a/lib/core/model/my_balance/patient_advance_balance_amount.dart b/lib/core/model/my_balance/patient_advance_balance_amount.dart index 44a5083f..bcceb3ff 100644 --- a/lib/core/model/my_balance/patient_advance_balance_amount.dart +++ b/lib/core/model/my_balance/patient_advance_balance_amount.dart @@ -1,5 +1,5 @@ class PatientAdvanceBalanceAmount { - int distanceInKilometers; + num distanceInKilometers; dynamic patientAdvanceBalanceAmount; String projectDescription; int projectID; diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index 36cac50e..631f17ff 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -5,14 +5,17 @@ import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_pro class AncillaryOrdersService extends BaseService { List _ancillaryLists = List(); + List get ancillaryLists => _ancillaryLists; List _ancillaryProcLists = List(); - List get ancillaryProcLists => - _ancillaryProcLists; + + List get ancillaryProcLists => _ancillaryProcLists; String _insuranceCompanyName = ""; + String get insuranceCompanyName => _insuranceCompanyName; String _insurancePolicyNumber = ""; + String get insurancePolicyNumber => _insurancePolicyNumber; Future getOrders() async { @@ -20,9 +23,27 @@ class AncillaryOrdersService extends BaseService { hasError = false; - await baseAppClient.post(GET_ANCILLARY_ORDERS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ANCILLARY_ORDERS, onSuccess: (dynamic response, int statusCode) { + _ancillaryLists = []; + response['AncillaryOrderList'].forEach((item) { + ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getOrdersMyAppo() async { + Map body = Map(); + + hasError = false; + + dynamic localRes; + + await baseAppClient.post(GET_ANCILLARY_ORDERS, onSuccess: (dynamic response, int statusCode) { _ancillaryLists = []; + localRes = response; response['AncillaryOrderList'].forEach((item) { ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); }); @@ -30,6 +51,7 @@ class AncillaryOrdersService extends BaseService { hasError = true; super.error = error; }, body: body); + return Future.value(localRes); } Future getOrdersDetails(appointmentNo, orderNo, projectID) async { @@ -38,8 +60,7 @@ class AncillaryOrdersService extends BaseService { body['OrderNo'] = orderNo; body['ProjectID'] = projectID; hasError = false; - await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, - onSuccess: (dynamic response, int statusCode) { + await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, onSuccess: (dynamic response, int statusCode) { _ancillaryProcLists = []; response['AncillaryOrderProcList'].forEach((item) { diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index b2b36383..b73dce48 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'] = 3775256; //3844083 + // body['PatientID'] = 2222149; //3844083 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 @@ -174,6 +174,8 @@ class BaseAppClient { var decoded = utf8.decode(response.bodyBytes); var parsed = json.decode(utf8.decode(response.bodyBytes)); + // print("Response: $parsed"); + if (isAllowAny) { onSuccess(parsed, statusCode); } else { diff --git a/lib/core/service/insurance_service.dart b/lib/core/service/insurance_service.dart index a0120398..9cb2eb28 100644 --- a/lib/core/service/insurance_service.dart +++ b/lib/core/service/insurance_service.dart @@ -159,8 +159,48 @@ class InsuranceCardService extends BaseService { hasError = true; super.error = error; }, - body: {'SetupID': setupID, 'ProjectID': projectID, 'PatientIdentificationID': patientIdentificationID, 'isDentalAllowedBackend': false, 'PatientID': patientID, 'IsFamily': isFamily, 'ParentID': parentID}, + body: { + 'SetupID': setupID, + 'ProjectID': projectID, + 'PatientIdentificationID': patientIdentificationID, + 'isDentalAllowedBackend': false, + 'PatientID': patientID, + 'IsFamily': isFamily, + 'ParentID': parentID + }, + ); + } + + Future getInsuranceSchemes(int projectID, int companyID) async { + dynamic localRes; + await baseAppClient.post( + INSURANCE_SCHEMES, + onSuccess: (dynamic response, int statusCode) { + localRes = response['PatientER_SchemesOfAactiveCompaniesGetList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {'CompanyID': companyID, 'ProjectID': projectID}, + ); + return Future.value(localRes); + } + + Future getInsuranceCompanies() async { + dynamic localRes; + await baseAppClient.post( + INSURANCE_COMPANIES, + onSuccess: (dynamic response, int statusCode) { + localRes = response['PatientER_InsuranceCompanyGetList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {}, ); + return Future.value(localRes); } Future uploadInsuranceCard(BuildContext context, {String patientIdentificationID, int patientID, String image = ""}) async { @@ -177,13 +217,13 @@ class InsuranceCardService extends BaseService { await baseAppClient.post( UPLOAD_INSURANCE_CARD, onSuccess: (dynamic response, int statusCode) { - print(response); - if(response['MessageStatus'] == 1) { - AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); - } else { - AppToast.showErrorToast(message: response['ErrorEndUserMessage']); - } - localRes = response; + print(response); + if (response['MessageStatus'] == 1) { + AppToast.showSuccessToast(message: TranslationBase.of(context).requestSent); + } else { + AppToast.showErrorToast(message: response['ErrorEndUserMessage']); + } + localRes = response; }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/models/insurance/getInsuranceCompaniesModel.dart b/lib/models/insurance/getInsuranceCompaniesModel.dart new file mode 100644 index 00000000..b5d07e76 --- /dev/null +++ b/lib/models/insurance/getInsuranceCompaniesModel.dart @@ -0,0 +1,64 @@ +class InsuranceCompaniesGetModel { + String setupID; + int projectID; + int companyID; + String companyName; + String companyNameN; + String alias; + String aliasN; + String insurancePolicyNo; + String phoneOffice1; + String phoneOffice2; + String faxNumber; + int status; + String contractExpiry; + + InsuranceCompaniesGetModel( + {this.setupID, + this.projectID, + this.companyID, + this.companyName, + this.companyNameN, + this.alias, + this.aliasN, + this.insurancePolicyNo, + this.phoneOffice1, + this.phoneOffice2, + this.faxNumber, + this.status, + this.contractExpiry}); + + InsuranceCompaniesGetModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + companyID = json['CompanyID']; + companyName = json['CompanyName']; + companyNameN = json['CompanyNameN']; + alias = json['Alias']; + aliasN = json['AliasN']; + insurancePolicyNo = json['InsurancePolicyNo']; + phoneOffice1 = json['PhoneOffice1']; + phoneOffice2 = json['PhoneOffice2']; + faxNumber = json['FaxNumber']; + status = json['Status']; + contractExpiry = json['ContractExpiry']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['CompanyID'] = this.companyID; + data['CompanyName'] = this.companyName; + data['CompanyNameN'] = this.companyNameN; + data['Alias'] = this.alias; + data['AliasN'] = this.aliasN; + data['InsurancePolicyNo'] = this.insurancePolicyNo; + data['PhoneOffice1'] = this.phoneOffice1; + data['PhoneOffice2'] = this.phoneOffice2; + data['FaxNumber'] = this.faxNumber; + data['Status'] = this.status; + data['ContractExpiry'] = this.contractExpiry; + return data; + } +} diff --git a/lib/models/tamara_request_model.dart b/lib/models/tamara_request_model.dart index 82938cb3..bbfd8622 100644 --- a/lib/models/tamara_request_model.dart +++ b/lib/models/tamara_request_model.dart @@ -23,6 +23,9 @@ class TamaraRequestModel { String appointmentNo; var serviceID; var liveServiceID; + String doctorID; + var appointmentDate; + bool isSchedule; TamaraRequestModel( {this.merchantReference, @@ -48,7 +51,10 @@ class TamaraRequestModel { this.latitude, this.appointmentNo, this.serviceID, - this.liveServiceID}); + this.liveServiceID, + this.appointmentDate, + this.doctorID, + this.isSchedule}); TamaraRequestModel.fromJson(Map json) { merchantReference = json['Merchant_Reference']; @@ -75,6 +81,9 @@ class TamaraRequestModel { appointmentNo = json['AppointmentNo']; serviceID = json['Service_ID']; liveServiceID = json['Live_ServiceID']; + doctorID = json['DoctorID']; + appointmentDate = json['AppointmentDate']; + isSchedule = json['IsSchedule']; } Map toJson() { @@ -103,6 +112,9 @@ class TamaraRequestModel { data['AppointmentNo'] = this.appointmentNo; data['Service_ID'] = this.serviceID; data['Live_ServiceID'] = this.liveServiceID; + data['DoctorID'] = this.doctorID; + data['AppointmentDate'] = this.appointmentDate; + data['IsSchedule'] = this.isSchedule; return data; } } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 0ac2442d..b03d8b37 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -39,6 +39,7 @@ class _AnicllaryOrdersState extends State with SingleTic String selectedPaymentMethod; MyInAppBrowser browser; String transID = ""; + BuildContext localContext; List selectedProcList = []; @@ -53,6 +54,8 @@ class _AnicllaryOrdersState extends State with SingleTic @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); + localContext = context; + AppGlobal.context = context; return BaseView( onModelReady: (model) { model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) { @@ -535,18 +538,18 @@ class _AnicllaryOrdersState extends State with SingleTic } checkPaymentStatus(AppoitmentAllHistoryResultList appo) { - GifLoaderDialogUtils.showMyDialog(AppGlobal.context); + GifLoaderDialogUtils.showMyDialog(localContext); DoctorsListService service = new DoctorsListService(); - service.checkPaymentStatus(transID, AppGlobal.context).then((res) { + service.checkPaymentStatus(transID, localContext).then((res) { String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { createAdvancePayment(res, appo); } else { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); + GifLoaderDialogUtils.hideDialog(localContext); AppToast.showErrorToast(message: res['Response_Message']); } }).catchError((err) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); + GifLoaderDialogUtils.hideDialog(localContext); AppToast.showErrorToast(message: err); print(err); }); @@ -564,11 +567,11 @@ class _AnicllaryOrdersState extends State with SingleTic projectViewModel.authenticatedUserObject.user.patientType, projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, projectViewModel.authenticatedUserObject.user.patientID, - AppGlobal.context) + localContext) .then((res) { addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); + GifLoaderDialogUtils.hideDialog(localContext); AppToast.showErrorToast(message: err); print(err); }); @@ -576,10 +579,10 @@ class _AnicllaryOrdersState extends State with SingleTic addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, AppGlobal.context).then((res) { + service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, localContext).then((res) { autoGenerateInvoice(); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); + GifLoaderDialogUtils.hideDialog(localContext); AppToast.showErrorToast(message: err.toString()); print(err); }); @@ -598,11 +601,11 @@ class _AnicllaryOrdersState extends State with SingleTic }); DoctorsListService service = new DoctorsListService(); - service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, AppGlobal.context).then((res) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); + service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, localContext).then((res) { + GifLoaderDialogUtils.hideDialog(localContext); showAlertDialog(res['AncillaryOrderInvoiceList'][0]['InvoiceNo'], widget.projectID); }).catchError((err) { - GifLoaderDialogUtils.hideDialog(AppGlobal.context); + GifLoaderDialogUtils.hideDialog(localContext); AppToast.showErrorToast(message: err); print(err); }); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 68c13f5a..c00edc46 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -597,8 +597,8 @@ class _BookSuccessState extends State { authenticatedUser, widget.browser, widget.patientShareResponse.isLiveCareAppointment, - "2", - "", + widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.serviceID.toString() : "2", + widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo, widget.patientShareResponse.clinicID, diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index f1ab1422..4bff1cd0 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -10,6 +10,8 @@ import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResp import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; @@ -25,14 +27,17 @@ 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/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/my_rich_text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; import 'package:flutter_countdown_timer/flutter_countdown_timer.dart'; +import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -40,6 +45,7 @@ import 'package:rating_bar/rating_bar.dart'; class ToDo extends StatefulWidget { PatientShareResponse patientShareResponse; List appoList = []; + List ancillaryLists = []; List obGyneAppoList = []; var languageID; MyInAppBrowser browser; @@ -68,6 +74,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { String tamaraPaymentStatus; String tamaraOrderID; + bool dataLoaded = false; + @override void initState() { widget.patientShareResponse = new PatientShareResponse(); @@ -136,190 +144,239 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { physics: BouncingScrollPhysics(), controller: _tabController, children: [ - Container( - child: widget.appoList.length != 0 - ? ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - padding: EdgeInsets.all(0.0), - itemCount: widget.appoList.length, - itemBuilder: (context, index) { - return Container( - width: double.infinity, - margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0), - decoration: cardRadius(12), - padding: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 2, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(top: 4.0), - child: widget.appoList[index].clinicID == 265 - ? Container( - margin: EdgeInsets.only(left: 5.0, right: 5.0), - child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), - ) - : widget.appoList[index].isLiveCareAppointment - ? SvgPicture.asset("assets/images/new/virtual.svg") - : SvgPicture.asset("assets/images/new/hospital-visit.svg"), - - // SvgPicture.asset("assets/images/new/virtual.svg"), - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: Text( - widget.appoList[index].clinicID == 265 - ? TranslationBase.of(context).covidTestTodo + SingleChildScrollView( + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 12), + child: AppExpandableNotifier( + isExpand: true, + hasCounter: true, + counter: widget.appoList.length.toString(), + title: TranslationBase.of(context).appointments, + bodyWidget: widget.appoList.length != 0 + ? ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + padding: EdgeInsets.all(0.0), + itemCount: widget.appoList.length, + itemBuilder: (context, index) { + return Container( + width: double.infinity, + margin: EdgeInsets.only(left: 12.0, right: 12.0, top: 12.0), + decoration: cardRadius(12), + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 2, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(top: 4.0), + child: widget.appoList[index].clinicID == 265 + ? Container( + margin: EdgeInsets.only(left: 5.0, right: 5.0), + child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), + ) : widget.appoList[index].isLiveCareAppointment - ? TranslationBase.of(context).liveCareAppo - : TranslationBase.of(context).walkinAppo, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), + ? SvgPicture.asset("assets/images/new/virtual.svg") + : SvgPicture.asset("assets/images/new/hospital-visit.svg"), + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + widget.appoList[index].clinicID == 265 + ? TranslationBase.of(context).covidTestTodo + : widget.appoList[index].isLiveCareAppointment + ? TranslationBase.of(context).liveCareAppo + : TranslationBase.of(context).walkinAppo, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: CountdownTimer( + controller: new CountdownTimerController( + endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), + widgetBuilder: (_, CurrentRemainingTime time) { + return time != null + ? Text( + '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' + + TranslationBase.of(context).upcomingTimeLeft, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48)) + : Container(); + }, + ), + ), + ], + ), + ], ), - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: CountdownTimer( - controller: - new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), - widgetBuilder: (_, CurrentRemainingTime time) { - return time != null - ? Text( - '${time.days != null ? time.days : "0"}:${time.hours != null ? time.hours.toString().length == 1 ? "0" + time.hours.toString() : time.hours : "00"}:${time.min}:${time.sec} \n' + - TranslationBase.of(context).upcomingTimeLeft, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48)) - : Container(); + ), + Expanded( + child: Container( + child: InkWell( + onTap: () { + performNextAction(widget.appoList[index]); }, + child: Container( + padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), + decoration: BoxDecoration( + color: getNextActionButtonColor(widget.appoList[index].nextAction), + border: Border.all(color: Colors.white, width: 1), + borderRadius: BorderRadius.circular(6), + ), + child: Text( + getNextActionText(widget.appoList[index].nextAction), + textAlign: TextAlign.center, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + ), + ), ), ), - ], + ), + ], + ), + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Text( + widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), - ], - ), - ), - Expanded( - child: Container( - child: InkWell( + ), + Row( + mainAxisSize: MainAxisSize.min, + children: [ + LargeAvatar( + name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, + url: widget.appoList[index].doctorImageURL, + width: 52, + height: 52, + ), + SizedBox(width: 11), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic), + // MyRichText(TranslationBase.of(context).appointmentDate + ": ", + // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), + + // Timezone changes + widget.appoList[index].isLiveCareAppointment + ? MyRichText( + TranslationBase.of(context).appointmentDate + ": ", + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + + " " + + DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), + projectViewModel.isArabic) + : MyRichText( + TranslationBase.of(context).appointmentDate + ": ", + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + + " " + + widget.appoList[index].startTime.substring(0, 5), + projectViewModel.isArabic), + + MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, + children: [ + RatingBar.readOnly( + initialRating: widget.appoList[index].actualDoctorRate.toDouble(), + size: 16.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + ], + ), + ], + ), + ), + ], + ), + Padding( + padding: const EdgeInsets.only(top: 12.0), + child: Text( + getNextActionDescription(widget.appoList[index].nextAction), + style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), + ), + ), + InkWell( onTap: () { - performNextAction(widget.appoList[index]); + navigateToAppointmentDetails(context, widget.appoList[index]); }, - child: Container( - padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), - decoration: BoxDecoration( - color: getNextActionButtonColor(widget.appoList[index].nextAction), - border: Border.all(color: Colors.white, width: 1), - borderRadius: BorderRadius.circular(6), - ), + child: Padding( + padding: const EdgeInsets.only(top: 0.0), child: Text( - getNextActionText(widget.appoList[index].nextAction), - textAlign: TextAlign.center, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), + TranslationBase.of(context).moreDetails, + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + color: CustomColors.accentColor, + letterSpacing: -0.48, + height: 25 / 16, + decoration: TextDecoration.underline), ), ), ), - ), - ), - ], - ), - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: Text( - widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), - ), - ), - Row( - mainAxisSize: MainAxisSize.min, - children: [ - LargeAvatar( - name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, - url: widget.appoList[index].doctorImageURL, - width: 52, - height: 52, - ), - SizedBox(width: 11), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic), - // MyRichText(TranslationBase.of(context).appointmentDate + ": ", - // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), - - // Timezone changes - widget.appoList[index].isLiveCareAppointment - ? MyRichText( - TranslationBase.of(context).appointmentDate + ": ", - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + - " " + - DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), - projectViewModel.isArabic) - : MyRichText( - TranslationBase.of(context).appointmentDate + ": ", - DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + - " " + - widget.appoList[index].startTime.substring(0, 5), - projectViewModel.isArabic), - - MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - mainAxisSize: MainAxisSize.max, - children: [ - RatingBar.readOnly( - initialRating: widget.appoList[index].actualDoctorRate.toDouble(), - size: 16.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, - ), - ], - ), - ], - ), - ), - ], - ), - Padding( - padding: const EdgeInsets.only(top: 12.0), - child: Text( - getNextActionDescription(widget.appoList[index].nextAction), - style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), - ), - ), - InkWell( - onTap: () { - navigateToAppointmentDetails(context, widget.appoList[index]); - }, - child: Padding( - padding: const EdgeInsets.only(top: 0.0), - child: Text( - TranslationBase.of(context).moreDetails, - style: TextStyle( - fontSize: 10, fontWeight: FontWeight.w600, color: CustomColors.accentColor, letterSpacing: -0.48, height: 25 / 16, decoration: TextDecoration.underline), + ], ), - ), - ), - ], - ), - ); - }, - ) - : getNoDataWidget(context), + ); + }, + ) + : getNoDataWidget(context), + ), + ), + Container( + margin: EdgeInsets.only(top: 12), + child: AppExpandableNotifier( + isExpand: true, + hasCounter: true, + counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0", + title: TranslationBase.of(context).anicllaryOrders, + bodyWidget: widget.ancillaryLists.length != 0 + ? Container( + padding: EdgeInsets.all(12), + child: ListView.separated( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + reverse: true, + itemBuilder: (context, index) { + return DoctorCard( + onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), + isInOutPatient: true, + name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName), + billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), + profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", + subName: widget.ancillaryLists[0].projectName, + isLiveCareAppointment: false, + date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate), + isSortByClinic: true, + ); + }, + itemCount: widget.ancillaryLists[0].ancillaryOrderList.length, + separatorBuilder: (context, index) => SizedBox(height: 14), + ), + ) + : getNoDataWidget(context), + )), + ], + ), ), Container( child: widget.obGyneAppoList.length != 0 @@ -428,7 +485,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { ), ), SizedBox( - height: 120.0, + height: 20.0, ), ], ), @@ -761,9 +818,13 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { res['AppoimentAllHistoryResultList'].forEach((v) { widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); }); - } else { - // Navigator.of(context).popAndPushNamed(HOME); } + if (res['AncillaryOrderList'].length != 0) { + res['AncillaryOrderList'].forEach((item) { + widget.ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + }); + } + dataLoaded = true; }); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); @@ -773,6 +834,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.hideDialog(context); err != null ?? AppToast.showErrorToast(message: err); }); + // getAncillaryOrders(); } getPatientShare(context, AppoitmentAllHistoryResultList appo) { @@ -807,27 +869,23 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } getAppoQR(context, AppoitmentAllHistoryResultList appo) { - // GifLoaderDialogUtils.showMyDialog(context); - PatientShareResponse patientShareResponse = new PatientShareResponse(); - - patientShareResponse.doctorNameObj = appo.doctorNameObj; - patientShareResponse.doctorSpeciality = appo.doctorSpeciality; - patientShareResponse.projectName = appo.projectName; - patientShareResponse.appointmentDate = appo.appointmentDate; - patientShareResponse.appointmentNo = appo.appointmentNo; - patientShareResponse.clinicID = appo.clinicID; - patientShareResponse.projectID = appo.projectID; - patientShareResponse.isFollowup = appo.isFollowup; - - // DoctorsListService service = new DoctorsListService(); - // service.generateAppointmentQR(patientShareResponse, context).then((res) { - // GifLoaderDialogUtils.hideDialog(context); - navigateToQR(context, "", patientShareResponse, appo); - projectViewModel.analytics.todoList.to_do_list_check_in(appo); - // }).catchError((err) { - // GifLoaderDialogUtils.hideDialog(context); - // print(err); - // }); + FlutterNfcKit.nfcAvailability.then((value) { + if (value == NFCAvailability.available) { + PatientShareResponse patientShareResponse = new PatientShareResponse(); + patientShareResponse.doctorNameObj = appo.doctorNameObj; + patientShareResponse.doctorSpeciality = appo.doctorSpeciality; + patientShareResponse.projectName = appo.projectName; + patientShareResponse.appointmentDate = appo.appointmentDate; + patientShareResponse.appointmentNo = appo.appointmentNo; + patientShareResponse.clinicID = appo.clinicID; + patientShareResponse.projectID = appo.projectID; + patientShareResponse.isFollowup = appo.isFollowup; + navigateToQR(context, "", patientShareResponse, appo); + projectViewModel.analytics.todoList.to_do_list_check_in(appo); + } else { + Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); + } + }); } Future navigateToQR(context, String appoQR, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appintment) async { @@ -882,8 +940,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { authenticatedUser, widget.browser, appo.isLiveCareAppointment, - "2", - "", + appo.isLiveCareAppointment ? widget.patientShareResponse.serviceID.toString() : "2", + appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", appo.appointmentDate, appo.appointmentNo, appo.clinicID, @@ -908,23 +966,23 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } // if(selectedPaymentMethod != "TAMARA") { - MyInAppBrowser.successURLS.forEach((element) { - if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); - MyInAppBrowser.isPaymentDone = true; - return; - } - }); + MyInAppBrowser.successURLS.forEach((element) { + if (url.contains(element)) { + if (widget.browser.isOpened()) widget.browser.close(); + MyInAppBrowser.isPaymentDone = true; + return; + } + }); // } // if(selectedPaymentMethod != "TAMARA") { - MyInAppBrowser.errorURLS.forEach((element) { - if (url.contains(element)) { - if (widget.browser.isOpened()) widget.browser.close(); - MyInAppBrowser.isPaymentDone = false; - return; - } - }); + MyInAppBrowser.errorURLS.forEach((element) { + if (url.contains(element)) { + if (widget.browser.isOpened()) widget.browser.close(); + MyInAppBrowser.isPaymentDone = false; + return; + } + }); // } } @@ -943,8 +1001,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); - service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) { - }).catchError((err) { + service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); print(err); @@ -1085,7 +1142,10 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + .then((res) { GifLoaderDialogUtils.hideDialog(context); getPatientAppointmentHistory(); }).catchError((err) { @@ -1142,7 +1202,10 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { insertLiveCareVIDARequest(AppoitmentAllHistoryResultList appo) { GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { + service + .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, + Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) + .then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); @@ -1155,4 +1218,13 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { GifLoaderDialogUtils.hideDialog(context); }); } + + ancillaryOrdersDetails(item, projectId) { + Navigator.push( + context, + FadePage( + page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo, projectId), + ), + ); + } } diff --git a/lib/pages/insurance/UpdateInsuranceManually.dart b/lib/pages/insurance/UpdateInsuranceManually.dart index 84ea25af..846532e2 100644 --- a/lib/pages/insurance/UpdateInsuranceManually.dart +++ b/lib/pages/insurance/UpdateInsuranceManually.dart @@ -1,6 +1,10 @@ +import 'package:diplomaticquarterapp/core/service/insurance_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/locator.dart'; +import 'package:diplomaticquarterapp/models/insurance/getInsuranceCompaniesModel.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart'; import 'package:diplomaticquarterapp/theme/colors.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/dialogs/radio_selection_dialog.dart'; @@ -22,6 +26,22 @@ class _UpdateInsuranceManuallyState extends State { TextEditingController _policyNoTextController = TextEditingController(); ProjectViewModel projectViewModel; + InsuranceCardService _insuranceCardService = locator(); + + List insuranceCompaniesList = []; + + int _selectedInsuranceCompanyIndex = -1; + + InsuranceCompaniesGetModel selectedInsuranceCompanyObj; + + @override + void initState() { + WidgetsBinding.instance.addPostFrameCallback((_) { + getInsuranceCompanies(); + }); + super.initState(); + } + @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); @@ -51,31 +71,7 @@ class _UpdateInsuranceManuallyState extends State { SizedBox(height: 12), InkWell( onTap: () { - List list = [ - RadioSelectionDialogModel(TranslationBase.of(context).myAccount, 0), - RadioSelectionDialogModel(TranslationBase.of(context).myFamilyFiles, 1), - RadioSelectionDialogModel(TranslationBase.of(context).otherAccount, 2), - ]; - showDialog( - context: context, - builder: (cxt) => RadioSelectionDialog( - listData: list, - // selectedIndex: - // beneficiaryType == BeneficiaryType.MyAccount ? 0 : (beneficiaryType == BeneficiaryType.MyFamilyFiles ? 1 : (beneficiaryType == BeneficiaryType.OtherAccount ? 2 : -1)), - onValueSelected: (index) { - var type; - if (index == 0) { - // type = BeneficiaryType.MyAccount; - } else if (index == 1) { - // type = BeneficiaryType.MyFamilyFiles; - } else { - // type = BeneficiaryType.OtherAccount; - } - - setState(() {}); - }, - ), - ); + confirmSelectInsuranceCompanyDialog(); }, child: Container( padding: EdgeInsets.all(8), @@ -86,7 +82,7 @@ class _UpdateInsuranceManuallyState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - TranslationBase.of(context).insuranceCompany, + selectedInsuranceCompanyObj != null ? selectedInsuranceCompanyObj.companyName : TranslationBase.of(context).insuranceCompany, style: TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -179,11 +175,48 @@ class _UpdateInsuranceManuallyState extends State { bottomSheet: Container( color: Theme.of(context).scaffoldBackgroundColor, padding: EdgeInsets.all(18), - child: DefaultButton( - TranslationBase.of(context).submit, - (){} - ), + child: DefaultButton(TranslationBase.of(context).submit, () {}), + ), + ); + } + + void confirmSelectInsuranceCompanyDialog() { + List list = [ + for (int i = 0; i < insuranceCompaniesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesList[i].companyName, i), + ]; + showDialog( + context: context, + builder: (cxt) => RadioSelectionDialog( + listData: list, + selectedIndex: _selectedInsuranceCompanyIndex, + isScrollable: true, + onValueSelected: (index) { + _selectedInsuranceCompanyIndex = index; + selectedInsuranceCompanyObj = insuranceCompaniesList[index]; + setState(() {}); + getInsuranceScheme(); + }, ), ); } + + void getInsuranceCompanies() { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService.getInsuranceCompanies().then((value) { + value.forEach((result) { + insuranceCompaniesList.add(InsuranceCompaniesGetModel.fromJson(result)); + }); + GifLoaderDialogUtils.hideDialog(context); + }); + } + + void getInsuranceScheme() { + GifLoaderDialogUtils.showMyDialog(context); + _insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID, selectedInsuranceCompanyObj.companyID).then((value) { + value.forEach((result) { + insuranceCompaniesList.add(InsuranceCompaniesGetModel.fromJson(result)); + }); + GifLoaderDialogUtils.hideDialog(context); + }); + } } diff --git a/lib/pages/insurance/insurance_page.dart b/lib/pages/insurance/insurance_page.dart index 2ea4213f..75acbffb 100644 --- a/lib/pages/insurance/insurance_page.dart +++ b/lib/pages/insurance/insurance_page.dart @@ -143,10 +143,10 @@ class InsurancePage extends StatelessWidget { } getDetails({String setupID, int projectID, String patientIdentificationID, int patientID, String name, bool isFamily, int parentID = 0, BuildContext context}) { - GifLoaderDialogUtils.showMyDialog(context); - _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID).then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { + // GifLoaderDialogUtils.showMyDialog(context); + // _insuranceCardService.getPatientInsuranceDetails(setupID: setupID, projectID: projectID, patientID: patientID, patientIdentificationID: patientIdentificationID, isFamily: isFamily, parentID: parentID).then((value) { + // GifLoaderDialogUtils.hideDialog(context); + // if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) { Navigator.push( context, FadePage( @@ -158,9 +158,9 @@ class InsurancePage extends StatelessWidget { ))).then((value) { model.getInsuranceUpdated(); }); - } else { - AppToast.showErrorToast(message: _insuranceCardService.error); - } - }); + // } else { + // AppToast.showErrorToast(message: _insuranceCardService.error); + // } + // }); } } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 6ac23156..263f2c09 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -377,7 +377,7 @@ class _clinic_listState extends State { DoctorsListService service = new DoctorsListService(); service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) { GifLoaderDialogUtils.hideDialog(context); - if (tamaraPaymentStatus.toLowerCase() == "approved") { + if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); } else { AppToast.showErrorToast(message: res['Response_Message']); diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index da21d7f9..5bcf4592 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -1,3 +1,5 @@ +import 'package:badges/badges.dart'; +import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; @@ -79,13 +81,50 @@ class PaymentService extends StatelessWidget { navigateToToDoPage(context); projectViewModel.analytics.advancePayments.payment_services(service_type: 'online check-in appointment'); }, - child: MedicalProfileItem( - title: TranslationBase.of(context).onlineCheckIn, - imagePath: 'assets/images/device_icon.png', - subTitle: TranslationBase.of(context).appointment, - isPngImage: true, - width: 45.0, - height: 45.0, + child: Stack( + children: [ + MedicalProfileItem( + title: TranslationBase.of(context).pendingOnly, + imagePath: 'pendingPayment.svg', + subTitle: TranslationBase.of(context).paymentOnly, + isPngImage: false, + width: 45.0, + height: 45.0, + ), + projectViewModel.isArabic + ? Positioned( + left: 8, + top: 4, + child: Badge( + toAnimate: false, + elevation: 0, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + : Positioned( + right: 8, + top: 4, + child: Badge( + toAnimate: false, + elevation: 0, + position: BadgePosition.topEnd(), + shape: BadgeShape.circle, + badgeColor: secondaryColor.withOpacity(1.0), + borderRadius: BorderRadius.circular(8), + badgeContent: Container( + padding: EdgeInsets.all(2.0), + child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), + ), + ), + ) + ], ), ), ); @@ -111,11 +150,11 @@ class PaymentService extends StatelessWidget { navigateToToDoPage(BuildContext context) { if (projectViewModel.isLogin) { - if (model.count != 0) { + // if (model.count != 0) { Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); - } else { - AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); - } + // } else { + // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); + // } } else { Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); } diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index afc053c6..e6efb110 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -48,18 +48,17 @@ class ClinicListService extends BaseService { var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); Request req = appGlobal.getPublicRequest(); request = { - "LanguageID": languageID == 'ar' ? 1 : 2, - "IPAdress": "10.20.10.20", - "VersionID": req.VersionID, - "Channel": req.Channel, - "generalid": 'Cs2020@2016\$2958', - "PatientOutSA": user.outSA, - "TokenID": "", + // "LanguageID": languageID == 'ar' ? 1 : 2, + // "IPAdress": "10.20.10.20", + // "VersionID": req.VersionID, + // "Channel": req.Channel, + // "generalid": 'Cs2020@2016\$2958', + // "PatientOutSA": user.outSA, "IsActiveAppointment": true, - "DeviceTypeID": req.DeviceTypeID, - "PatientType": user.patientType, - "PatientTypeID": user.patientType, - "SessionID": null + // "DeviceTypeID": req.DeviceTypeID, + // "PatientType": user.patientType, + // "PatientTypeID": user.patientType, + // "SessionID": null }; dynamic localRes; diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index a6b3d14a..2759358e 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2866,6 +2866,9 @@ class TranslationBase { String get membershipNo => localizedValues["membershipNo"][locale.languageCode]; String get insurancePolicyNo => localizedValues["policyNo"][locale.languageCode]; String get insuranceClassName => localizedValues["insuranceClassName"][locale.languageCode]; + String get NFCNotSupported => localizedValues["NFCNotSupported"][locale.languageCode]; + String get paymentOnly => localizedValues["paymentOnly"][locale.languageCode]; + String get pendingOnly => localizedValues["pendingOnly"][locale.languageCode]; } diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 18e40dad..a8efc40d 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -226,6 +226,9 @@ class MyInAppBrowser extends InAppBrowser { tamaraRequestModel.longitude = this.long.toString(); tamaraRequestModel.serviceID = servID; tamaraRequestModel.liveServiceID = LiveServID; + tamaraRequestModel.doctorID = (doctorID.toString() != null && doctorID != "") ? doctorID.toString() : ""; + tamaraRequestModel.appointmentDate = (appoDate != null && appoDate != "") ? appoDate : null; + tamaraRequestModel.isSchedule = ((appoNo != null && appoNo != "") && (appoDate != null && appoDate != "")) ? true : false; service.tamaraInsertRequest(tamaraRequestModel, context).then((res) { if (context != null) GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index 0910f0d0..ece72712 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -1,5 +1,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; @@ -17,10 +18,12 @@ class AppExpandableNotifier extends StatefulWidget { final Widget collapsed; final bool isExpand; bool expandFlag = false; + bool hasCounter = false; + String counter = "0"; var controller = new ExpandableController(); bool isTitleSingleLine; - AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true}); + AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true, this.hasCounter = false, this.counter = "0"}); _AppExpandableNotifier createState() => _AppExpandableNotifier(); } @@ -90,9 +93,26 @@ class _AppExpandableNotifier extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_mainTitle.isNotEmpty && widget.isTitleSingleLine) + !widget.hasCounter ? Text( _mainTitle, style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), + ) : Row( + children: [ + Text( + _mainTitle, + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), + ), + SizedBox(width: 10.0,), + CircleAvatar( + backgroundColor: CustomColors.accentColor, + radius: 12.0, + child: Text( + widget.counter, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.72), + ), + ) + ], ), if (_title.isNotEmpty && !widget.isTitleSingleLine) Text( diff --git a/pubspec.yaml b/pubspec.yaml index a5afdb28..c7ce510c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.004+4050004 +version: 4.5.005+4050005 environment: sdk: ">=2.7.0 <3.0.0"