From 7c1fd8043b5528ecfb2c1674ccb6702560c1cb09 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 17 Mar 2021 12:51:01 +0200 Subject: [PATCH] fix chart and eye and balance --- lib/config/config.dart | 12 +- .../customer_addresses_service.dart | 7 +- lib/core/service/client/base_app_client.dart | 18 +- lib/core/service/medical/EyeService.dart | 50 +++++ .../service/medical/radiology_service.dart | 2 +- .../add_new_address_Request_Model.dart | 4 +- .../home_health_care_view_model.dart | 12 +- lib/core/viewModels/medical/EyeViewModel.dart | 30 +++ .../NewHomeHealthCare/location_page.dart | 3 +- .../medical/balance/advance_payment_page.dart | 2 +- .../medical/balance/my_balance_page.dart | 4 +- lib/pages/medical/eye/ClassesPage.dart | 68 +++++- lib/pages/medical/eye/ContactLensPage.dart | 205 +++++++++++------- lib/pages/medical/eye/EyeHomePage.dart | 15 +- .../PrescriptionIDeliveryAddressPage.dart | 47 +++- .../medical/reports/report_home_page.dart | 8 +- lib/pages/medical/reports/reports_page.dart | 58 +++-- .../LineChartCurvedBloodPressure.dart | 3 +- lib/pages/paymentService/payment_service.dart | 2 +- 19 files changed, 388 insertions(+), 162 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f8df420..6902c47d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -14,12 +14,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs -// const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; -// const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; +const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // Pharmacy Production URLs -const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; -const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; +// const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; @@ -210,6 +210,10 @@ const GET_PATIENT_SHARE = const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory"; +const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail"; + +const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail"; + //URL to get patient appointment curfew history const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew"; diff --git a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart index 34fa4bbb..ea5d03ca 100644 --- a/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart +++ b/lib/core/service/AlHabibMedicalService/customer_addresses_service.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:intl/intl.dart'; +import '../../../locator.dart'; import '../base_service.dart'; class CustomerAddressesService extends BaseService { @@ -9,6 +11,7 @@ class CustomerAddressesService extends BaseService { List addressesList = List(); CustomerInfo customerInfo; + Future addAddressInfo({ AddNewAddressRequestModel addNewAddressRequestModel }) async { @@ -25,7 +28,7 @@ class CustomerAddressesService extends BaseService { var date = f.format(DateTime.now().toUtc()) + " GMT"; addNewAddressRequestModel.customer.addresses[0].createdOnUtc = date; hasError = false; - await baseAppClient.post(BASE_PHARMACY_URL+ADD_ADDRESS_INFO, + await baseAppClient.post(ADD_CUSTOMER_ADDRESS, onSuccess: (dynamic response, int statusCode) { addressesList.clear(); response["customers"][0]["addresses"].forEach((data) { @@ -35,7 +38,7 @@ class CustomerAddressesService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: addNewAddressRequestModel.toJson(), isExternal: true, isAllowAny: true); + }, body: addNewAddressRequestModel.toJson(), isAllowAny: true); } Future getCustomerAddresses() async { diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 1d5b55aa..4be9325f 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -115,7 +115,9 @@ class BaseAppClient { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': pharmacyToken, - 'Mobilenumber': user['MobileNumber'].toString(), + 'Mobilenumber': user != null + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user['PatientID'].toString(), }; @@ -238,7 +240,7 @@ class BaseAppClient { 'Accept': 'application/json', 'Authorization': token ?? '', 'Mobilenumber': user != null - ? getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", @@ -478,7 +480,7 @@ class BaseAppClient { 'Accept': 'application/json', 'Authorization': token ?? '', 'Mobilenumber': user != null - ? getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", @@ -504,13 +506,7 @@ class BaseAppClient { } } - getPhoneNumberWithoutZero(String number) { - String newNumber = number; - if (number.startsWith('0')) { - newNumber = number.substring(1); - } - return newNumber; - } + simpleGet(String fullUrl, {Function(dynamic response, int statusCode) onSuccess, @@ -680,7 +676,7 @@ class BaseAppClient { 'Accept': 'application/json', 'Authorization': token ?? '', 'Mobilenumber': user != null - ? getPhoneNumberWithoutZero(user['MobileNumber'].toString()) + ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "", 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Username': user != null ? user['PatientID'].toString() : "", diff --git a/lib/core/service/medical/EyeService.dart b/lib/core/service/medical/EyeService.dart index 879acbbf..937f89e3 100644 --- a/lib/core/service/medical/EyeService.dart +++ b/lib/core/service/medical/EyeService.dart @@ -1,6 +1,7 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; +import 'package:diplomaticquarterapp/uitl/utils.dart'; class EyeService extends BaseService { List appoimentAllHistoryResultList = List(); @@ -23,4 +24,53 @@ class EyeService extends BaseService { super.error = error; }, body: body); } + + sendGlassesPrescriptionEmail({int appointmentNo,String projectName,int projectID}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientName'] = user.firstName+" "+user.lastName; + body['To'] = user.emailAddress; + body['SetupID'] = user.setupID; + body['DateofBirth'] = user.dateofBirth; + body['ProjectID'] = projectID; + body['AppointmentNo'] = appointmentNo; + body['ProjectName'] = projectName; + body['PatientID'] = user.patientID; + body['PatientMobileNumber'] = Utils.getPhoneNumberWithoutZero(user.mobileNumber); + await baseAppClient.post(SEND_REPORT_EYE_EMAIL, + onSuccess: (response, statusCode) async { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + sendContactLensPrescriptionEmail({int appointmentNo,String projectName,int projectID}) async { + hasError = false; + super.error = ""; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + body['AppointmentNo'] = appointmentNo; + body['PatientIditificationNum'] = user.patientIdentificationNo; + body['PatientName'] = user.firstName+" "+user.lastName; + body['To'] = user.emailAddress; + body['SetupID'] = user.setupID; + body['DateofBirth'] = user.dateofBirth; + body['ProjectID'] = projectID; + body['AppointmentNo'] = appointmentNo; + body['ProjectName'] = projectName; + body['PatientID'] = user.patientID; + body['PatientMobileNumber'] = Utils.getPhoneNumberWithoutZero(user.mobileNumber); + await baseAppClient.post(SEND_CONTACT_LENS_PRESCRIPTION_EMAIL, + onSuccess: (response, statusCode) async { + + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/service/medical/radiology_service.dart b/lib/core/service/medical/radiology_service.dart index 965fa752..b0b96e71 100644 --- a/lib/core/service/medical/radiology_service.dart +++ b/lib/core/service/medical/radiology_service.dart @@ -11,7 +11,7 @@ class RadiologyService extends BaseService { hasError = false; final Map body = new Map(); body['InvoiceNo'] = invoiceNo; - body['LineItemNo'] = lineItem; + body['LineIt emNo'] = lineItem; body['ProjectID'] = projectId; await baseAppClient.post(GET_RAD_IMAGE_URL, diff --git a/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart b/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart index 5bde5a5f..23329a89 100644 --- a/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart @@ -55,7 +55,7 @@ class Addresses { String firstName; String lastName; String email; - Null company; + dynamic company; int countryId; String country; Null stateProvinceId; @@ -64,7 +64,7 @@ class Addresses { String address2; String zipPostalCode; String phoneNumber; - Null faxNumber; + dynamic faxNumber; String customerAttributes; String createdOnUtc; Null province; diff --git a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart index 5bab0df5..32644fd4 100644 --- a/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart +++ b/lib/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart @@ -40,6 +40,8 @@ class HomeHealthCareViewModel extends BaseViewModel { PharmacyModuleService _pharmacyModuleService = locator(); + + bool get isOrderUpdated => _homeHealthCareService.isOrderUpdated; GetHHCAllPresOrdersResponseModel pendingOrder; @@ -136,9 +138,13 @@ class HomeHealthCareViewModel extends BaseViewModel { {AddNewAddressRequestModel addNewAddressRequestModel}) async { setState(ViewState.Busy); - await _customerAddressesService.addAddressInfo( - addNewAddressRequestModel: addNewAddressRequestModel - ); + + await _pharmacyModuleService.generatePharmacyToken().then((value) async{ + await _customerAddressesService.addAddressInfo( + addNewAddressRequestModel: addNewAddressRequestModel + ); + }); + if (_customerAddressesService.hasError) { error = _customerAddressesService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModels/medical/EyeViewModel.dart b/lib/core/viewModels/medical/EyeViewModel.dart index d6c3bf80..ab76b94f 100644 --- a/lib/core/viewModels/medical/EyeViewModel.dart +++ b/lib/core/viewModels/medical/EyeViewModel.dart @@ -43,4 +43,34 @@ class EyeViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + sendGlassesPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async { + setState(ViewState.Busy); + await _eyeService.sendGlassesPrescriptionEmail( + appointmentNo: appointmentNo, + projectID: projectID, + projectName: projectName); + if (_eyeService.hasError) { + error = _eyeService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + sendContactLensPrescriptionEmail({int appointmentNo, String projectName, int projectID}) async { + setState(ViewState.Busy); + await _eyeService.sendContactLensPrescriptionEmail( + appointmentNo: appointmentNo, + projectID: projectID, + projectName: projectName); + if (_eyeService.hasError) { + error = _eyeService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + } diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart index c9e4262f..c87a3eb5 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart @@ -122,6 +122,7 @@ class _LocationPageState } }); + await model.addAddressInfo( addNewAddressRequestModel: addNewAddressRequestModel); if (model.state == ViewState.ErrorLocal) { @@ -130,7 +131,7 @@ class _LocationPageState AppToast.showSuccessToast( message: "Address Added Successfully"); } - Navigator.of(context).pop(); + Navigator.of(context).pop(addNewAddressRequestModel); }, label: TranslationBase.of(context).addNewAddress, ), diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 6611c779..5b2b5d56 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -237,7 +237,7 @@ class _AdvancePaymentPageState extends State { ), ), bottomSheet: Container( - height: MediaQuery.of(context).size.height * 0.10, + height: 90, width: double.infinity, padding: EdgeInsets.all(18), child: SecondaryButton( diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 8f80eeeb..7639bb2f 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -49,7 +49,7 @@ class MyBalancePage extends StatelessWidget { width: double.infinity, height: 65, decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: Colors.red[700], shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), @@ -79,7 +79,7 @@ class MyBalancePage extends StatelessWidget { height: 65, margin: EdgeInsets.only(top: 8), decoration: BoxDecoration( - color: Theme.of(context).primaryColor, + color: Colors.white, shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(7), ), diff --git a/lib/pages/medical/eye/ClassesPage.dart b/lib/pages/medical/eye/ClassesPage.dart index 7904178c..21a07d23 100644 --- a/lib/pages/medical/eye/ClassesPage.dart +++ b/lib/pages/medical/eye/ClassesPage.dart @@ -1,17 +1,28 @@ import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.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/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ClassesPage extends StatelessWidget { final ListHISGetGlassPerscription glassPerscription; + final int appointmentNo; + final String projectName; + final int projectID; - const ClassesPage({Key key, this.glassPerscription}) : super(key: key); + const ClassesPage( + {Key key, + this.glassPerscription, + this.appointmentNo, + this.projectName, + this.projectID}) + : super(key: key); @override Widget build(BuildContext context) { @@ -38,11 +49,16 @@ class ClassesPage extends StatelessWidget { bold: true, ), ), - getRow(TranslationBase.of(context).sphere, '${glassPerscription.rightEyeSpherical}', '-'), - getRow(TranslationBase.of(context).cylinder, '${glassPerscription.rightEyeCylinder}', '-'), - getRow(TranslationBase.of(context).axis, '${glassPerscription.rightEyeAxis}', '-'), - getRow(TranslationBase.of(context).prism, '${glassPerscription.rightEyePrism}', '-'), - getRow(TranslationBase.of(context).va, '${glassPerscription.rightEyeVA}', '-'), + getRow(TranslationBase.of(context).sphere, + '${glassPerscription.rightEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, + '${glassPerscription.rightEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, + '${glassPerscription.rightEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, + '${glassPerscription.rightEyePrism}', '-'), + getRow(TranslationBase.of(context).va, + '${glassPerscription.rightEyeVA}', '-'), ], ), ), @@ -65,11 +81,16 @@ class ClassesPage extends StatelessWidget { bold: true, ), ), - getRow(TranslationBase.of(context).sphere, '${glassPerscription.leftEyeSpherical}', '-'), - getRow(TranslationBase.of(context).cylinder, '${glassPerscription.leftEyeCylinder}', '-'), - getRow(TranslationBase.of(context).axis, '${glassPerscription.leftEyeAxis}', '-'), - getRow(TranslationBase.of(context).prism, '${glassPerscription.leftEyePrism}', '-'), - getRow(TranslationBase.of(context).va, '${glassPerscription.leftEyeVA}', '-'), + getRow(TranslationBase.of(context).sphere, + '${glassPerscription.leftEyeSpherical}', '-'), + getRow(TranslationBase.of(context).cylinder, + '${glassPerscription.leftEyeCylinder}', '-'), + getRow(TranslationBase.of(context).axis, + '${glassPerscription.leftEyeAxis}', '-'), + getRow(TranslationBase.of(context).prism, + '${glassPerscription.leftEyePrism}', '-'), + getRow(TranslationBase.of(context).va, + '${glassPerscription.leftEyeVA}', '-'), ], ), ), @@ -80,6 +101,16 @@ class ClassesPage extends StatelessWidget { width: double.infinity, child: SecondaryButton( label: TranslationBase.of(context).sendEmail, + onTap: () { + showConfirmMessage(context, () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendGlassesPrescriptionEmail( + appointmentNo: appointmentNo, + projectName: projectName, + projectID: projectID); + GifLoaderDialogUtils.hideDialog(context); + }, model.user.emailAddress); + }, textColor: Colors.white, color: Colors.red[700], icon: Icon( @@ -96,6 +127,19 @@ class ClassesPage extends StatelessWidget { ); } + void showConfirmMessage( + BuildContext context, GestureTapCallback onTap, String email) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: email, + onTapSendEmail: () { + onTap(); + }, + ), + ); + } + Widget getRow(String title, String val1, String val2) => Padding( padding: const EdgeInsets.all(8.0), child: Column( @@ -113,7 +157,7 @@ class ClassesPage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Texts(val1 == 'null' ? '-' : val1), - Texts(val2 != 'null' ? '-' :val2), + Texts(val2 != 'null' ? '-' : val2), ], ), ) diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart index 373c3c79..b70b9c09 100644 --- a/lib/pages/medical/eye/ContactLensPage.dart +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -1,8 +1,12 @@ import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/EyeViewModel.dart'; 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/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -10,95 +14,126 @@ import 'package:provider/provider.dart'; class ContactLensPage extends StatelessWidget { final ListHISGetContactLensPerscription listHISGetContactLensPerscription; + final int appointmentNo; + final String projectName; + final int projectID; - const ContactLensPage({Key key, this.listHISGetContactLensPerscription}) + const ContactLensPage( + {Key key, + this.listHISGetContactLensPerscription, + this.appointmentNo, + this.projectName, + this.projectID}) : super(key: key); @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - return AppScaffold( - body: SingleChildScrollView( - child: Container( - margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), - child: Column( - children: [ - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).rightEye, - fontSize: 23, - bold: true, + return BaseView( + builder: (_,model,w)=> + AppScaffold( + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only(top: 70, left: 15, right: 15, bottom: 15), + child: Column( + children: [ + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).rightEye, + fontSize: 23, + bold: true, + ), ), - ), - getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), - getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), - getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), - getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), - getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), - getRow('CT', '${listHISGetContactLensPerscription.cT}'), - getRow('Blend', '${listHISGetContactLensPerscription.blend}'), - getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), - - - ], + getRow(TranslationBase.of(context).brand, + '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', + '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, + '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, + '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow( + 'Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, + '${listHISGetContactLensPerscription.remarks}'), + ], + ), ), - ), - SizedBox( - height: 17, - ), - Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(8)), - color: Colors.white), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - TranslationBase.of(context).leftEye, - fontSize: 23, - bold: true, - ), - ), - getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription.brand}'), - getRow('B.C', '${listHISGetContactLensPerscription.baseCurve}'), - getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription.power}'), - getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription.diameter}'), - getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), - getRow('CT', '${listHISGetContactLensPerscription.cT}'), - getRow('Blend', '${listHISGetContactLensPerscription.blend}'), - getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription.remarks}'), - ], + SizedBox( + height: 17, ), - ), - SizedBox( - height: 17, - ), - if(projectViewModel.havePrivilege(15)) - Container( - width: double.infinity, - child: SecondaryButton( - label: TranslationBase.of(context).sendEmail, - textColor: Colors.white, - color: Colors.red[700], - icon: Icon( - Icons.email, - color: Colors.white, + Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + TranslationBase.of(context).leftEye, + fontSize: 23, + bold: true, + ), + ), + getRow(TranslationBase.of(context).brand, + '${listHISGetContactLensPerscription.brand}'), + getRow('B.C', + '${listHISGetContactLensPerscription.baseCurve}'), + getRow(TranslationBase.of(context).power, + '${listHISGetContactLensPerscription.power}'), + getRow(TranslationBase.of(context).diameter, + '${listHISGetContactLensPerscription.diameter}'), + getRow('OZ', '${listHISGetContactLensPerscription.oZ}'), + getRow('CT', '${listHISGetContactLensPerscription.cT}'), + getRow( + 'Blend', '${listHISGetContactLensPerscription.blend}'), + getRow(TranslationBase.of(context).reminder, + '${listHISGetContactLensPerscription.remarks}'), + ], ), ), - ) - ], + SizedBox( + height: 17, + ), + if (projectViewModel.havePrivilege(15)) + Container( + width: double.infinity, + child: SecondaryButton( + label: TranslationBase.of(context).sendEmail, + textColor: Colors.white, + color: Colors.red[700], + onTap: (){ + showConfirmMessage(context, () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.sendContactLensPrescriptionEmail( + appointmentNo: appointmentNo, + projectName: projectName, + projectID: projectID); + GifLoaderDialogUtils.hideDialog(context); + }, model.user.emailAddress); + }, + icon: Icon( + Icons.email, + color: Colors.white, + ), + ), + ) + ], + ), ), ), ), @@ -130,4 +165,18 @@ class ContactLensPage extends StatelessWidget { ], ), ); + + + void showConfirmMessage( + BuildContext context, GestureTapCallback onTap, String email) { + showDialog( + context: context, + child: ConfirmSendEmailDialog( + email: email, + onTapSendEmail: () { + onTap(); + }, + ), + ); + } } diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index bce778b8..3af2279e 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -43,6 +43,7 @@ class _EyeHomePageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, + isShowDecPage: false, appBarTitle: TranslationBase.of(context).measurements, body: Scaffold( extendBodyBehindAppBar: true, @@ -81,13 +82,13 @@ class _EyeHomePageState extends State unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.27, + width: MediaQuery.of(context).size.width * 0.40, child: Center( child: Texts(TranslationBase.of(context).classes), ), ), Container( - width: MediaQuery.of(context).size.width * 0.27, + width: MediaQuery.of(context).size.width * 0.40, child: Center( child: Texts(TranslationBase.of(context).contactLens), ), @@ -110,11 +111,15 @@ class _EyeHomePageState extends State ClassesPage( glassPerscription: widget.appointmentAllHistoryResultList .listHISGetGlassPerscription[0], + appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo, + projectName: widget.appointmentAllHistoryResultList.projectName, + projectID: widget.appointmentAllHistoryResultList.projectID, ), ContactLensPage( - listHISGetContactLensPerscription: widget - .appointmentAllHistoryResultList - .listHISGetContactLensPerscription[0], + listHISGetContactLensPerscription: widget.appointmentAllHistoryResultList.listHISGetContactLensPerscription[0], + appointmentNo: widget.appointmentAllHistoryResultList.appointmentNo, + projectName: widget.appointmentAllHistoryResultList.projectName, + projectID: widget.appointmentAllHistoryResultList.projectID, ) ], ), diff --git a/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart b/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart index 88234fe5..8f04d3a0 100644 --- a/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart +++ b/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; +import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/add_new_address_Request_Model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/PrescriptionDeliveryViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; @@ -212,7 +213,51 @@ class _PrescriptionDeliveryAddressPageState latitude: latitude, longitude: longitude, )), - ); + ).then((value) { + if (value != null && + value is AddNewAddressRequestModel) { + setState(() { + _selectedAddress = AddressInfo( + id: value.customer.id.toString(), + email: value.customer.email, + firstName: value.customer.addresses[0].firstName, + lastName: value.customer.addresses[0].lastName, + address1: value.customer.addresses[0].address1, + address2: value.customer.addresses[0].address2, + city: value.customer.addresses[0].city, + country: value.customer.addresses[0].country, + phoneNumber: value.customer.addresses[0].phoneNumber, + latLong: value.customer.addresses[0].latLong, + company: value.customer.addresses[0].company, + countryId: value.customer.addresses[0].countryId, + createdOnUtc: value.customer.addresses[0].createdOnUtc, + customerAttributes: value.customer.addresses[0].customerAttributes, + faxNumber: value.customer.addresses[0].faxNumber, + province: value.customer.addresses[0].province, + stateProvinceId: value.customer.addresses[0].stateProvinceId, + zipPostalCode: value.customer.addresses[0].zipPostalCode, + + ); + List latLongArr = _selectedAddress.latLong.split(','); + + latitude = double.parse(latLongArr[0]); + longitude = double.parse(latLongArr[1]); + markers = Set(); + markers.add( + Marker( + markerId: MarkerId( + _selectedAddress.latLong.hashCode.toString(), + ), + position: LatLng(latitude, longitude), + ), + ); + _kGooglePlex = CameraPosition( + target: LatLng(latitude, longitude), + zoom: 14.4746, + ); + }); + } + }); }, ), ), diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index 42dcf40a..f9efb1a1 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -106,26 +106,26 @@ class _HomeReportPageState extends State unselectedLabelColor: Colors.grey[800], tabs: [ Container( - width: MediaQuery.of(context).size.width * 0.15, + width: MediaQuery.of(context).size.width * 0.20, child: Center( child: Texts(TranslationBase.of(context).requested,fontSize: 11,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.15, + width: MediaQuery.of(context).size.width * 0.20, child: Center( child: Texts(TranslationBase.of(context).ready,fontSize: 11,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.15, + width: MediaQuery.of(context).size.width * 0.20, child: Center( child: Texts(TranslationBase.of(context).completed,fontSize: 11,), ), ), Container( - width: MediaQuery.of(context).size.width * 0.15, + width: MediaQuery.of(context).size.width * 0.20, child: Center( child: Texts(TranslationBase.of(context).cancelled,fontSize: 11,), diff --git a/lib/pages/medical/reports/reports_page.dart b/lib/pages/medical/reports/reports_page.dart index d8cb2ca0..11d5fc82 100644 --- a/lib/pages/medical/reports/reports_page.dart +++ b/lib/pages/medical/reports/reports_page.dart @@ -48,16 +48,13 @@ class MedicalReports extends StatelessWidget { )), child: Row( children: [ - Expanded( - flex: 1, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: LargeAvatar( - width: 50, - height: 50, - name: model.appointHistoryList[index].doctorNameObj, - url: model.appointHistoryList[index].doctorImageURL, - ), + Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: LargeAvatar( + width: 50, + height: 50, + name: model.appointHistoryList[index].doctorNameObj, + url: model.appointHistoryList[index].doctorImageURL, ), ), Expanded( @@ -85,29 +82,26 @@ class MedicalReports extends StatelessWidget { ), ), ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => - confirmBox(model.appointHistoryList[index], model), - child: Container( - width: 85, - height: 50, - decoration: BoxDecoration( - color: Colors.black54, - border: - Border.all(color: Colors.transparent, width: 2), - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all( - Radius.circular(8.0), - ), + InkWell( + onTap: () => + confirmBox(model.appointHistoryList[index], model), + child: Container( + width: 120, + height: 50, + decoration: BoxDecoration( + color: Colors.black54, + border: + Border.all(color: Colors.transparent, width: 2), + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all( + Radius.circular(8.0), ), - child: Center( - child: Texts( - TranslationBase.of(context).requestReport, - fontSize: 12, - color: Colors.white, - ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).requestReport, + fontSize: 12, + color: Colors.white, ), ), ), diff --git a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart index 605e264a..2d95f08c 100644 --- a/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart +++ b/lib/pages/medical/vital_sign/LineChartCurvedBloodPressure.dart @@ -81,7 +81,7 @@ class LineChartCurvedBloodPressure extends StatelessWidget { height: 20, decoration: BoxDecoration( shape: BoxShape.rectangle, - color: Colors.grey), + color: Colors.red), ), SizedBox(width: 5,), Texts(TranslationBase.of(context).diastolicLng) @@ -125,7 +125,6 @@ class LineChartCurvedBloodPressure extends StatelessWidget { fontSize: 10, ), rotateAngle: -65, - //rotateAngle:-65, margin: 22, getTitles: (value) { if (timeSeries1.length < 15) { diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index cca506ec..1b221454 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -117,7 +117,7 @@ class PaymentService extends StatelessWidget { ) ], ), - // if(!projectViewModel.havePrivilege(33)) + //if(!projectViewModel.havePrivilege(33)) Row( crossAxisAlignment: CrossAxisAlignment.start, children: [