diff --git a/lib/config/config.dart b/lib/config/config.dart index 4b976928..be71b6aa 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -12,8 +12,8 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi'; const PACKAGES_CATEGORIES = '/api/categories'; const PACKAGES_PRODUCTS = '/api/products'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_PHARMACY_URL = 'http://swd-pharapp-01:7200/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -440,6 +440,9 @@ const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList'; +const GET_ANCILLARY_ORDERS_DETAILS = + 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList'; + //Pharmacy wishlist // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index afcce431..3217d084 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1159,7 +1159,7 @@ const Map localizedValues = { "ar": "Connected with HMG Network,\n\nBut failed to access HMG services" }, "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, - "InvoiceNo": {"en": " Invoice No", "ar": "رقم الفاتورة"}, + "InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, @@ -1652,7 +1652,10 @@ const Map localizedValues = { "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, "result": {"en": "Result", "ar": "النتيجة"}, "sort": {"en": "Sort", "ar": "فرز"}, - "bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"}, + "bloodSugarConversion": { + "en": "Blood Sugar Conversion", + "ar": "السكر في الدم" + }, "convertBloodSugarStatement": { "en": "Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.", @@ -1954,6 +1957,9 @@ const Map localizedValues = { }, "order-overview": {"en": "Order Overview", "ar": "ملخص الطلب"}, "shipping-address": {"en": "Delivery Address", "ar": "عنوان التوصيل"}, - "ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"}, - + "ancillary-orders": {"en": "Ancillary Orders", "ar": "الأوامر التبعية"}, + "MRN": {"en": "MRN", "ar": "ایم آر این"}, + "appointment-date": {"en": "Appointment Date", "ar": "تقرری کی تاریخ"}, + "appointment-no": {"en": "Appointment No", "ar": "تقرری نمبر"}, + "insurance-id": {"en": "Insurance ID", "ar": "انشورنس ID"}, }; diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index 5adf5305..b9d14a06 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -1,10 +1,14 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; class AncillaryOrdersService extends BaseService { List _ancillaryLists = List(); List get ancillaryLists => _ancillaryLists; + List _ancillaryProcLists = List(); + List get ancillaryProcLists => + _ancillaryProcLists; Future getOrders() async { Map body = Map(); @@ -13,6 +17,7 @@ class AncillaryOrdersService extends BaseService { await baseAppClient.post(GET_ANCILLARY_ORDERS, onSuccess: (dynamic response, int statusCode) { + _ancillaryLists = []; response['AncillaryOrderList'].forEach((item) { ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); }); @@ -21,4 +26,179 @@ class AncillaryOrdersService extends BaseService { super.error = error; }, body: body); } + + Future getOrdersDetails(appointmentNo, orderNo) async { + Map body = Map(); + + hasError = false; + + await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, + onSuccess: (dynamic response, int statusCode) { + _ancillaryProcLists = []; + response['AncillaryOrderProcList'] = [ + { + "AncillaryOrderProcList": [ + { + "ApprovalLineItemNo": 0, + "ApprovalNo": 0, + "ApprovalStatus": "", + "ApprovalStatusID": 0, + "CompanyShare": 501.3, + "CompanyShareWithTax": 576.5, + "CompanyTaxAmount": 75.19, + "DiscountAmount": 55.7, + "DiscountCategory": 1, + "DiscountType": "P", + "DiscountTypeValue": 10, + "IsApprovalCreated": false, + "IsApprovalRequired": false, + "IsCovered": false, + "OrderDate": "/Date(1601758800000+0300)/", + "OrderLineItemNo": 1, + "OrderNo": 2020000001, + "PartnerID": 0, + "PartnerShare": 0, + "PartnerShareType": "P", + "PatientShare": 0, + "PatientShareWithTax": 0, + "PatientTaxAmount": 0, + "ProcPrice": 557, + "ProcedureCategoryID": 2, + "ProcedureCategoryName": "LABORATORY", + "ProcedureID": "02013001", + "ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O", + "TaxAmount": 75.19, + "TaxPct": 15 + }, + { + "ApprovalLineItemNo": 0, + "ApprovalNo": 0, + "ApprovalStatus": "", + "ApprovalStatusID": 0, + "CompanyShare": 90, + "CompanyShareWithTax": 103.5, + "CompanyTaxAmount": 13.5, + "DiscountAmount": 10, + "DiscountCategory": 1, + "DiscountType": "P", + "DiscountTypeValue": 10, + "IsApprovalCreated": false, + "IsApprovalRequired": true, + "IsCovered": false, + "OrderDate": "/Date(1601758800000+0300)/", + "OrderLineItemNo": 4, + "OrderNo": 2020000001, + "PartnerID": 0, + "PartnerShare": 0, + "PartnerShareType": "P", + "PatientShare": 0, + "PatientShareWithTax": 0, + "PatientTaxAmount": 0, + "ProcPrice": 100, + "ProcedureCategoryID": 2, + "ProcedureCategoryName": "LABORATORY", + "ProcedureID": "02014011", + "ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)", + "TaxAmount": 13.5, + "TaxPct": 15 + }, + { + "ApprovalLineItemNo": 0, + "ApprovalNo": 0, + "ApprovalStatus": "", + "ApprovalStatusID": 0, + "CompanyShare": 347.76, + "CompanyShareWithTax": 399.92, + "CompanyTaxAmount": 52.16, + "DiscountAmount": 38.64, + "DiscountCategory": 1, + "DiscountType": "P", + "DiscountTypeValue": 10, + "IsApprovalCreated": false, + "IsApprovalRequired": false, + "IsCovered": false, + "OrderDate": "/Date(1601758800000+0300)/", + "OrderLineItemNo": 3, + "OrderNo": 2020000001, + "PartnerID": 0, + "PartnerShare": 0, + "PartnerShareType": "P", + "PatientShare": 0, + "PatientShareWithTax": 0, + "PatientTaxAmount": 0, + "ProcPrice": 386.4, + "ProcedureCategoryID": 2, + "ProcedureCategoryName": "LABORATORY", + "ProcedureID": "02019302", + "ProcedureName": "21-HYDROXYLASE ABS - S.O", + "TaxAmount": 52.16, + "TaxPct": 15 + }, + { + "ApprovalLineItemNo": 0, + "ApprovalNo": 0, + "ApprovalStatus": "", + "ApprovalStatusID": 0, + "CompanyShare": 1323, + "CompanyShareWithTax": 1521.45, + "CompanyTaxAmount": 198.45, + "DiscountAmount": 147, + "DiscountCategory": 1, + "DiscountType": "P", + "DiscountTypeValue": 10, + "IsApprovalCreated": false, + "IsApprovalRequired": true, + "IsCovered": false, + "OrderDate": "/Date(1601758800000+0300)/", + "OrderLineItemNo": 5, + "OrderNo": 2020000001, + "PartnerID": 0, + "PartnerShare": 0, + "PartnerShareType": "P", + "PatientShare": 0, + "PatientShareWithTax": 0, + "PatientTaxAmount": 0, + "ProcPrice": 1470, + "ProcedureCategoryID": 3, + "ProcedureCategoryName": "RADIOLOGY", + "ProcedureID": "03033065", + "ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)", + "TaxAmount": 198.45, + "TaxPct": 15 + } + ], + "AppointmentDate": "/Date(1601499600000+0300)/", + "AppointmentNo": 2016053756, + "ClinicID": 1, + "ClinicName": "INTERNAL MEDICINE CLINIC", + "CompanyID": 0, + "CompanyName": "Blood Donation Investigation", + "DoctorID": 1485, + "DoctorName": "ANAS ABDULLAH", + "ErrCode": null, + "GroupID": 2, + "InsurancePolicyNo": "45976500", + "Message": "Success", + "PatientCardID": "232332323", + "PatientID": 3072055, + "PatientName": "MAYA KHALED SADDIQ", + "PatientType": 1, + "PolicyID": 2, + "PolicyName": "Test", + "ProjectID": 15, + "SetupID": "010266", + "StatusCode": 1, + "SubCategoryID": 2, + "SubPolicyNo": "234234" + } + ]; + + response['AncillaryOrderProcList'].forEach((item) { + ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } } diff --git a/lib/core/viewModels/ancillary_orders_view_model.dart b/lib/core/viewModels/ancillary_orders_view_model.dart index 2d92a402..77eb4237 100644 --- a/lib/core/viewModels/ancillary_orders_view_model.dart +++ b/lib/core/viewModels/ancillary_orders_view_model.dart @@ -1,4 +1,6 @@ import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; +import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_proc_model.dart'; import 'base_view_model.dart'; import '../../locator.dart'; @@ -8,7 +10,10 @@ class AnciallryOrdersViewModel extends BaseViewModel { bool hasError = false; AncillaryOrdersService _ancillaryService = locator(); - + List get ancillaryLists => + _ancillaryService.ancillaryLists; + List get ancillaryListsDetails => + _ancillaryService.ancillaryProcLists; Future getOrders() async { hasError = false; setState(ViewState.Busy); @@ -19,4 +24,15 @@ class AnciallryOrdersViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getOrdersDetails(appointmentNo, orderNo) async { + hasError = false; + setState(ViewState.Busy); + await _ancillaryService.getOrdersDetails(appointmentNo, orderNo); + if (_ancillaryService.hasError) { + error = _ancillaryService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/locator.dart b/lib/locator.dart index 7803b6a9..9bc077f7 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,7 +1,9 @@ import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/H2O_service.dart'; +import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart'; import 'package:diplomaticquarterapp/core/service/parmacyModule/prescription_service.dart'; import 'package:diplomaticquarterapp/core/service/qr_service.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/H2O_view_model.dart'; +import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/user_information_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/home_health_care_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; @@ -192,7 +194,7 @@ void setupLocator() { locator.registerLazySingleton(() => DeleteBabyService()); locator.registerLazySingleton(() => VaccinationTableService()); - + locator.registerLazySingleton(() => AncillaryOrdersService()); //pharmacy // locator.registerLazySingleton(() => PharmacyCategoriseService()); // locator.registerLazySingleton(() => OffersCategoriseService()); @@ -220,7 +222,6 @@ void setupLocator() { locator.registerLazySingleton(() => PrescriptionService()); locator.registerLazySingleton(() => RecommendedProductService()); - locator.registerLazySingleton(() => PrivilegeService()); locator.registerLazySingleton(() => WeatherService()); locator.registerLazySingleton(() => TermsConditionsService()); @@ -309,4 +310,5 @@ void setupLocator() { locator.registerLazySingleton( () => GeofencingServices()); // Geofencing Services locator.registerFactory(() => TermsConditionsViewModel()); + locator.registerFactory(() => AnciallryOrdersViewModel()); } diff --git a/lib/models/anicllary-orders/ancillary_order_proc_model.dart b/lib/models/anicllary-orders/ancillary_order_proc_model.dart new file mode 100644 index 00000000..7322d11a --- /dev/null +++ b/lib/models/anicllary-orders/ancillary_order_proc_model.dart @@ -0,0 +1,249 @@ +class AncillaryOrdersListProcListModel { + List ancillaryOrderProcList; + String appointmentDate; + dynamic appointmentNo; + dynamic clinicID; + String clinicName; + dynamic companyID; + String companyName; + dynamic doctorID; + String doctorName; + Null errCode; + dynamic groupID; + String insurancePolicyNo; + String message; + String patientCardID; + dynamic patientID; + String patientName; + dynamic patientType; + dynamic policyID; + String policyName; + dynamic projectID; + String setupID; + dynamic statusCode; + dynamic subCategoryID; + String subPolicyNo; + + AncillaryOrdersListProcListModel( + {this.ancillaryOrderProcList, + this.appointmentDate, + this.appointmentNo, + this.clinicID, + this.clinicName, + this.companyID, + this.companyName, + this.doctorID, + this.doctorName, + this.errCode, + this.groupID, + this.insurancePolicyNo, + this.message, + this.patientCardID, + this.patientID, + this.patientName, + this.patientType, + this.policyID, + this.policyName, + this.projectID, + this.setupID, + this.statusCode, + this.subCategoryID, + this.subPolicyNo}); + + AncillaryOrdersListProcListModel.fromJson(Map json) { + if (json['AncillaryOrderProcList'] != null) { + ancillaryOrderProcList = new List(); + json['AncillaryOrderProcList'].forEach((v) { + ancillaryOrderProcList.add(new AncillaryOrderProcList.fromJson(v)); + }); + } + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + companyID = json['CompanyID']; + companyName = json['CompanyName']; + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + errCode = json['ErrCode']; + groupID = json['GroupID']; + insurancePolicyNo = json['InsurancePolicyNo']; + message = json['Message']; + patientCardID = json['PatientCardID']; + patientID = json['PatientID']; + patientName = json['PatientName']; + patientType = json['PatientType']; + policyID = json['PolicyID']; + policyName = json['PolicyName']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + statusCode = json['StatusCode']; + subCategoryID = json['SubCategoryID']; + subPolicyNo = json['SubPolicyNo']; + } + + Map toJson() { + final Map data = new Map(); + if (this.ancillaryOrderProcList != null) { + data['AncillaryOrderProcList'] = + this.ancillaryOrderProcList.map((v) => v.toJson()).toList(); + } + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['CompanyID'] = this.companyID; + data['CompanyName'] = this.companyName; + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['ErrCode'] = this.errCode; + data['GroupID'] = this.groupID; + data['InsurancePolicyNo'] = this.insurancePolicyNo; + data['Message'] = this.message; + data['PatientCardID'] = this.patientCardID; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PatientType'] = this.patientType; + data['PolicyID'] = this.policyID; + data['PolicyName'] = this.policyName; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['StatusCode'] = this.statusCode; + data['SubCategoryID'] = this.subCategoryID; + data['SubPolicyNo'] = this.subPolicyNo; + return data; + } +} + +class AncillaryOrderProcList { + dynamic approvalLineItemNo; + dynamic approvalNo; + String approvalStatus; + dynamic approvalStatusID; + dynamic companyShare; + dynamic companyShareWithTax; + dynamic companyTaxAmount; + dynamic discountAmount; + dynamic discountCategory; + String discountType; + dynamic discountTypeValue; + bool isApprovalCreated; + bool isApprovalRequired; + bool isCovered; + String orderDate; + dynamic orderLineItemNo; + dynamic orderNo; + dynamic partnerID; + dynamic partnerShare; + String partnerShareType; + dynamic patientShare; + dynamic patientShareWithTax; + dynamic patientTaxAmount; + dynamic procPrice; + dynamic procedureCategoryID; + String procedureCategoryName; + String procedureID; + String procedureName; + dynamic taxAmount; + dynamic taxPct; + + AncillaryOrderProcList( + {this.approvalLineItemNo, + this.approvalNo, + this.approvalStatus, + this.approvalStatusID, + this.companyShare, + this.companyShareWithTax, + this.companyTaxAmount, + this.discountAmount, + this.discountCategory, + this.discountType, + this.discountTypeValue, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.orderDate, + this.orderLineItemNo, + this.orderNo, + this.partnerID, + this.partnerShare, + this.partnerShareType, + this.patientShare, + this.patientShareWithTax, + this.patientTaxAmount, + this.procPrice, + this.procedureCategoryID, + this.procedureCategoryName, + this.procedureID, + this.procedureName, + this.taxAmount, + this.taxPct}); + + AncillaryOrderProcList.fromJson(Map json) { + approvalLineItemNo = json['ApprovalLineItemNo']; + approvalNo = json['ApprovalNo']; + approvalStatus = json['ApprovalStatus']; + approvalStatusID = json['ApprovalStatusID']; + companyShare = json['CompanyShare']; + companyShareWithTax = json['CompanyShareWithTax']; + companyTaxAmount = json['CompanyTaxAmount']; + discountAmount = json['DiscountAmount']; + discountCategory = json['DiscountCategory']; + discountType = json['DiscountType']; + discountTypeValue = json['DiscountTypeValue']; + isApprovalCreated = json['IsApprovalCreated']; + isApprovalRequired = json['IsApprovalRequired']; + isCovered = json['IsCovered']; + orderDate = json['OrderDate']; + orderLineItemNo = json['OrderLineItemNo']; + orderNo = json['OrderNo']; + partnerID = json['PartnerID']; + partnerShare = json['PartnerShare']; + partnerShareType = json['PartnerShareType']; + patientShare = json['PatientShare']; + patientShareWithTax = json['PatientShareWithTax']; + patientTaxAmount = json['PatientTaxAmount']; + procPrice = json['ProcPrice']; + procedureCategoryID = json['ProcedureCategoryID']; + procedureCategoryName = json['ProcedureCategoryName']; + procedureID = json['ProcedureID']; + procedureName = json['ProcedureName']; + taxAmount = json['TaxAmount']; + taxPct = json['TaxPct']; + } + + Map toJson() { + final Map data = new Map(); + data['ApprovalLineItemNo'] = this.approvalLineItemNo; + data['ApprovalNo'] = this.approvalNo; + data['ApprovalStatus'] = this.approvalStatus; + data['ApprovalStatusID'] = this.approvalStatusID; + data['CompanyShare'] = this.companyShare; + data['CompanyShareWithTax'] = this.companyShareWithTax; + data['CompanyTaxAmount'] = this.companyTaxAmount; + data['DiscountAmount'] = this.discountAmount; + data['DiscountCategory'] = this.discountCategory; + data['DiscountType'] = this.discountType; + data['DiscountTypeValue'] = this.discountTypeValue; + data['IsApprovalCreated'] = this.isApprovalCreated; + data['IsApprovalRequired'] = this.isApprovalRequired; + data['IsCovered'] = this.isCovered; + data['OrderDate'] = this.orderDate; + data['OrderLineItemNo'] = this.orderLineItemNo; + data['OrderNo'] = this.orderNo; + data['PartnerID'] = this.partnerID; + data['PartnerShare'] = this.partnerShare; + data['PartnerShareType'] = this.partnerShareType; + data['PatientShare'] = this.patientShare; + data['PatientShareWithTax'] = this.patientShareWithTax; + data['PatientTaxAmount'] = this.patientTaxAmount; + data['ProcPrice'] = this.procPrice; + data['ProcedureCategoryID'] = this.procedureCategoryID; + data['ProcedureCategoryName'] = this.procedureCategoryName; + data['ProcedureID'] = this.procedureID; + data['ProcedureName'] = this.procedureName; + data['TaxAmount'] = this.taxAmount; + data['TaxPct'] = this.taxPct; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index fe8f73f6..877f9fb7 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart'; @@ -203,7 +204,7 @@ class _AllHabibMedicalServiceState extends State { onTap: () => Navigator.push( context, FadePage( - page: PaymentService(), + page: AnicllaryOrders(), ), ), imageLocation: diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart index 57b134bf..b229775a 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart @@ -1,16 +1,13 @@ import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; class AnicllaryOrders extends StatefulWidget { @override @@ -36,8 +33,145 @@ class _AnicllaryOrdersState extends State onModelReady: (model) => model.getOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).parking, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).anicllaryOrders, body: SingleChildScrollView( - padding: EdgeInsets.all(12), child: Container()))); + padding: EdgeInsets.all(12), + child: model.ancillaryLists.length > 0 + ? Column(children: [ + getPatientInfo(model), + getAncillaryOrdersList(model) + ]) + : SizedBox()))); + } + + Widget getPatientInfo(AnciallryOrdersViewModel model) { + print(model.ancillaryLists); + return Padding( + child: Column( + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context).mrn, + fontWeight: FontWeight.bold, + fontSize: 22, + ), + Texts( + " : ", + fontSize: 20, + ), + Texts( + model.ancillaryLists[0].patientID.toString(), + ) + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).patientName, + fontWeight: FontWeight.bold, + fontSize: 20, + ), + Texts( + " : ", + fontSize: 20, + ), + Texts( + model.ancillaryLists[0].patientName, + ) + ], + ), + Divider() + ], + ), + padding: EdgeInsets.only(top: 5.0, bottom: 10.0), + ); + } + + Widget getAncillaryOrdersList(AnciallryOrdersViewModel model) { + return Column( + children: model.ancillaryLists[0].ancillaryOrderList + .map( + (item) => InkWell( + onTap: () { + ancillaryOrdersDetails(item); + }, + child: Container( + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 0.5, + ))), + padding: EdgeInsets.all(5), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(3), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context) + .appointmentNo + + ' : ', + fontWeight: FontWeight.bold, + ), + Texts(item.appointmentNo.toString()) + ], + )), + Padding( + padding: EdgeInsets.all(3), + child: Row( + children: [ + Texts( + TranslationBase.of(context) + .appointmentDate + + ' : ', + fontWeight: FontWeight.bold), + Texts(DateUtil.getFormattedDate( + DateUtil.convertStringToDate( + item.appointmentDate), + "MMM dd,yyyy")) + ], + )), + Padding( + padding: EdgeInsets.all(3), + child: Row( + children: [ + Texts( + TranslationBase.of(context) + .doctorName + + ' : ', + fontWeight: FontWeight.bold), + Texts(item.doctorName.toString()) + ], + )), + Divider( + color: Colors.black12, + height: 1, + ) + ]), + Icon( + Icons.arrow_right, + size: 25, + ) + ]))), + ) + .toList()); + } + + ancillaryOrdersDetails(item) { + Navigator.push( + context, + FadePage( + page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo), + ), + ); } } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart new file mode 100644 index 00000000..9fb7e7d2 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -0,0 +1,196 @@ +import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:flutter/material.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import "package:collection/collection.dart"; + +class AnicllaryOrdersDetails extends StatefulWidget { + final dynamic appoNo; + final dynamic orderNo; + AnicllaryOrdersDetails(this.appoNo, this.orderNo); + @override + _AnicllaryOrdersState createState() => _AnicllaryOrdersState(); +} + +class _AnicllaryOrdersState extends State + with SingleTickerProviderStateMixin { + void initState() { + super.initState(); + } + + void dispose() { + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => + model.getOrdersDetails(widget.appoNo, widget.orderNo), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).anicllaryOrders, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: model.ancillaryListsDetails.length > 0 + ? Column(children: [ + getPatientInfo(model), + getInvoiceDetails(model), + getInsuranceDetails(model), + getAncillaryDetails(model) + ]) + : SizedBox()))); + } + + Widget getPatientInfo(AnciallryOrdersViewModel model) { + print(model.ancillaryListsDetails); + return Padding( + child: Column( + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context).mrn, + fontWeight: FontWeight.bold, + fontSize: 22, + ), + Texts( + " : ", + fontSize: 20, + ), + Texts( + model.ancillaryListsDetails[0].patientID.toString(), + ) + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).patientName, + fontWeight: FontWeight.bold, + fontSize: 20, + ), + Texts( + " : ", + fontSize: 20, + ), + Texts( + model.ancillaryLists[0].patientName, + ) + ], + ), + Divider( + color: Colors.black26, + ) + ], + ), + padding: EdgeInsets.only(top: 5.0, bottom: 5.0), + ); + } + + Widget getInvoiceDetails(model) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context).invoiceNo, + fontWeight: FontWeight.bold, + ), + Texts(" : "), + Texts( + model.ancillaryListsDetails[0].appointmentNo.toString(), + ) + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).date, + fontWeight: FontWeight.bold, + ), + Texts(" : "), + Texts( + DateUtil.getFormattedDate( + DateUtil.convertStringToDate( + model.ancillaryListsDetails[0].appointmentDate), + "MMM dd,yyyy"), + ) + ], + ), + Row( + children: [ + Texts( + TranslationBase.of(context).date, + fontWeight: FontWeight.bold, + ), + Texts(" : "), + Texts( + model.ancillaryListsDetails[0].doctorName, + ), + ], + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.black26, + ) + ], + ); + } + + Widget getInsuranceDetails(model) { + return Padding( + padding: EdgeInsets.only(top: 10, bottom: 10), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + TranslationBase.of(context).insurance, + fontWeight: FontWeight.bold, + ), + Texts( + TranslationBase.of(context).insuranceID, + fontWeight: FontWeight.bold, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + model.ancillaryListsDetails[0].policyName, + ), + Texts( + model.ancillaryListsDetails[0].insurancePolicyNo, + ) + ], + ), + SizedBox( + height: 15, + ), + Divider( + color: Colors.red[800], + thickness: 3, + ) + ], + )); + } + + Widget getAncillaryDetails(model) { + var newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcList, + (obj) => obj.procedureCategoryName); + print(newMap); + return Padding( + padding: EdgeInsets.only(top: 10, bottom: 10), + child: Column(children: [])); + } +} diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index e02453a6..a24be50a 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1394,9 +1394,12 @@ class TranslationBase { String get convertFrom => localizedValues["convertFrom"][locale.languageCode]; String get result => localizedValues["result"][locale.languageCode]; String get sort => localizedValues["sort"][locale.languageCode]; - String get bloodSugarConversion => localizedValues["bloodSugarConversion"][locale.languageCode]; - String get convertCholesterolStatement => localizedValues["convertCholesterolStatement"][locale.languageCode]; - String get triglyceridesConvertStatement => localizedValues["triglyceridesConvertStatement"][locale.languageCode]; + String get bloodSugarConversion => + localizedValues["bloodSugarConversion"][locale.languageCode]; + String get convertCholesterolStatement => + localizedValues["convertCholesterolStatement"][locale.languageCode]; + String get triglyceridesConvertStatement => + localizedValues["triglyceridesConvertStatement"][locale.languageCode]; String get bloodDEnterDesc => localizedValues["bloodD-enter-desc"][locale.languageCode]; String get viewTermsConditions => @@ -1572,6 +1575,13 @@ class TranslationBase { String get covidAlert => localizedValues["covid-alert"][locale.languageCode]; String get anicllaryOrders => localizedValues["ancillary-orders"][locale.languageCode]; + String get mrn => localizedValues["MRN"][locale.languageCode]; + String get appointmentDate => + localizedValues["appointment-date"][locale.languageCode]; + String get appointmentNo => + localizedValues["appointment-no"][locale.languageCode]; + String get insuranceID => + localizedValues["insurance-id"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index 3e3bae5a..69251773 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -834,11 +834,13 @@ class _FloatingSearchButton extends State if (isInit == true) { event.setValue({"animationEnable": 'true'}); } - if (isArabic == false && results['ReturnMessage'] != null) { + if (isArabic == false && + results['ReturnMessage'] != null && + isInit == false) { await flutterTts .setVoice({"name": "en-au-x-aub-network", "locale": "en-AU"}); await flutterTts.speak(results['ReturnMessage']); - } else if (results['ReturnMessage_Ar'] != null) { + } else if (results['ReturnMessage_Ar'] != null && isInit == false) { await flutterTts .setVoice({"name": "ar-xa-x-ard-network", "locale": "ar"}); await flutterTts.speak(results['ReturnMessage_Ar']); @@ -889,6 +891,21 @@ class _FloatingSearchButton extends State stopAnimation({isInit}) async { if (isInit == true) { IS_TEXT_COMPLETED = true; + Future.delayed(const Duration(seconds: 10), () { + event.setValue({"animationEnable": 'false'}); + setState(() { + this.networkImage = null; + this.isAnimationEnable = false; + }); + }); + } else { + flutterTts.setCompletionHandler(() async { + event.setValue({"animationEnable": 'false'}); + setState(() { + this.networkImage = null; + this.isAnimationEnable = false; + }); + }); } flutterTts.setCompletionHandler(() async { event.setValue({"animationEnable": 'false'});