From 74d08263423ecd794d24204cc58606b8451cec5e Mon Sep 17 00:00:00 2001 From: Fatimah Alshammari Date: Mon, 16 Aug 2021 12:10:34 +0300 Subject: [PATCH] fixed issues --- lib/config/config.dart | 8 +- .../service/ancillary_orders_service.dart | 332 +++++++++--------- .../ancillary_orders_view_model.dart | 6 +- .../ancillary_order_proc_model.dart | 189 +++++----- .../ancillary-orders/ancillaryOrders.dart | 6 +- .../ancillaryOrdersDetails.dart | 12 +- .../blood_pressure/AddBloodPressurePage.dart | 65 ++-- lib/widgets/mobile-no/mobile_no.dart | 3 +- 8 files changed, 320 insertions(+), 301 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3aa66dd1..5c35f5f7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -17,12 +17,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'; diff --git a/lib/core/service/ancillary_orders_service.dart b/lib/core/service/ancillary_orders_service.dart index b9d14a06..da7fc753 100644 --- a/lib/core/service/ancillary_orders_service.dart +++ b/lib/core/service/ancillary_orders_service.dart @@ -20,6 +20,8 @@ class AncillaryOrdersService extends BaseService { _ancillaryLists = []; response['AncillaryOrderList'].forEach((item) { ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + print("response of ancillary Lists__________"); + print(response); }); }, onFailure: (String error, int statusCode) { hasError = true; @@ -27,175 +29,183 @@ class AncillaryOrdersService extends BaseService { }, body: body); } - Future getOrdersDetails(appointmentNo, orderNo) async { + Future getOrdersDetails(appointmentNo, orderNo, projectID) async { Map body = Map(); - + body['AppointmentNo_Vida'] = appointmentNo; + body['OrderNo'] = orderNo; + body['ProjectID'] = projectID; +// "OrderNo=$orderNo&AppointmentNo_Vida=$appointmentNo&ProjectID=$projectID" 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" - } - ]; +// _ancillaryProcLists.clear(); + _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)); +// ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(response['AncillaryOrderProcList'])); + print("----------------------------------"); + print("Test data"); + print(response); }); + //Future.value(_ancillaryProcLists); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/ancillary_orders_view_model.dart b/lib/core/viewModels/ancillary_orders_view_model.dart index 77eb4237..4a140004 100644 --- a/lib/core/viewModels/ancillary_orders_view_model.dart +++ b/lib/core/viewModels/ancillary_orders_view_model.dart @@ -12,8 +12,10 @@ class AnciallryOrdersViewModel extends BaseViewModel { AncillaryOrdersService _ancillaryService = locator(); List get ancillaryLists => _ancillaryService.ancillaryLists; + List get ancillaryListsDetails => _ancillaryService.ancillaryProcLists; + Future getOrders() async { hasError = false; setState(ViewState.Busy); @@ -25,10 +27,10 @@ class AnciallryOrdersViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getOrdersDetails(appointmentNo, orderNo) async { + Future getOrdersDetails(appointmentNo, orderNo, projectID) async { hasError = false; setState(ViewState.Busy); - await _ancillaryService.getOrdersDetails(appointmentNo, orderNo); + await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID ); if (_ancillaryService.hasError) { error = _ancillaryService.error; setState(ViewState.ErrorLocal); diff --git a/lib/models/anicllary-orders/ancillary_order_proc_model.dart b/lib/models/anicllary-orders/ancillary_order_proc_model.dart index 7322d11a..1b557f21 100644 --- a/lib/models/anicllary-orders/ancillary_order_proc_model.dart +++ b/lib/models/anicllary-orders/ancillary_order_proc_model.dart @@ -1,60 +1,61 @@ class AncillaryOrdersListProcListModel { - List ancillaryOrderProcList; + List ancillaryOrderProcDetailsList; String appointmentDate; - dynamic appointmentNo; - dynamic clinicID; + int appointmentNo; + int clinicID; String clinicName; - dynamic companyID; + int companyID; String companyName; - dynamic doctorID; + int doctorID; String doctorName; Null errCode; - dynamic groupID; + int groupID; String insurancePolicyNo; String message; String patientCardID; - dynamic patientID; + int patientID; String patientName; - dynamic patientType; - dynamic policyID; + int patientType; + int policyID; String policyName; - dynamic projectID; + int projectID; String setupID; - dynamic statusCode; - dynamic subCategoryID; + int statusCode; + int 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}); + {this.ancillaryOrderProcDetailsList, + 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)); + if (json['AncillaryOrderProcDetailsList'] != null) { + ancillaryOrderProcDetailsList = new List(); + json['AncillaryOrderProcDetailsList'].forEach((v) { + ancillaryOrderProcDetailsList + .add(new AncillaryOrderProcDetailsList.fromJson(v)); }); } appointmentDate = json['AppointmentDate']; @@ -84,9 +85,9 @@ class AncillaryOrdersListProcListModel { Map toJson() { final Map data = new Map(); - if (this.ancillaryOrderProcList != null) { - data['AncillaryOrderProcList'] = - this.ancillaryOrderProcList.map((v) => v.toJson()).toList(); + if (this.ancillaryOrderProcDetailsList != null) { + data['AncillaryOrderProcDetailsList'] = + this.ancillaryOrderProcDetailsList.map((v) => v.toJson()).toList(); } data['AppointmentDate'] = this.appointmentDate; data['AppointmentNo'] = this.appointmentNo; @@ -115,71 +116,71 @@ class AncillaryOrdersListProcListModel { } } -class AncillaryOrderProcList { - dynamic approvalLineItemNo; - dynamic approvalNo; +class AncillaryOrderProcDetailsList { + int approvalLineItemNo; + int approvalNo; String approvalStatus; - dynamic approvalStatusID; - dynamic companyShare; - dynamic companyShareWithTax; - dynamic companyTaxAmount; - dynamic discountAmount; - dynamic discountCategory; + int approvalStatusID; + int companyShare; + int companyShareWithTax; + int companyTaxAmount; + int discountAmount; + int discountCategory; String discountType; - dynamic discountTypeValue; + int discountTypeValue; bool isApprovalCreated; bool isApprovalRequired; bool isCovered; String orderDate; - dynamic orderLineItemNo; - dynamic orderNo; - dynamic partnerID; - dynamic partnerShare; + int orderLineItemNo; + int orderNo; + int partnerID; + int partnerShare; String partnerShareType; - dynamic patientShare; - dynamic patientShareWithTax; - dynamic patientTaxAmount; - dynamic procPrice; - dynamic procedureCategoryID; + int patientShare; + double patientShareWithTax; + double patientTaxAmount; + int procPrice; + int procedureCategoryID; String procedureCategoryName; String procedureID; String procedureName; dynamic taxAmount; - dynamic taxPct; + int taxPct; - AncillaryOrderProcList( + AncillaryOrderProcDetailsList( {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}); + 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) { + AncillaryOrderProcDetailsList.fromJson(Map json) { approvalLineItemNo = json['ApprovalLineItemNo']; approvalNo = json['ApprovalNo']; approvalStatus = json['ApprovalStatus']; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart index eccc1309..4cb2b658 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrders.dart @@ -95,7 +95,7 @@ class _AnicllaryOrdersState extends State .map( (item) => InkWell( onTap: () { - ancillaryOrdersDetails(item); + ancillaryOrdersDetails(item, model.ancillaryLists[0].projectID); }, child: Container( decoration: BoxDecoration( @@ -166,11 +166,11 @@ class _AnicllaryOrdersState extends State .toList()); } - ancillaryOrdersDetails(item) { + ancillaryOrdersDetails(item, projectId) { Navigator.push( context, FadePage( - page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo), + page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo,projectId ), ), ); } diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 20d2966b..535ecb38 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -12,7 +12,9 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; class AnicllaryOrdersDetails extends StatefulWidget { final dynamic appoNo; final dynamic orderNo; - AnicllaryOrdersDetails(this.appoNo, this.orderNo); + final dynamic projectID; + + AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID); @override _AnicllaryOrdersState createState() => _AnicllaryOrdersState(); } @@ -31,7 +33,7 @@ class _AnicllaryOrdersState extends State Widget build(BuildContext context) { return BaseView( onModelReady: (model) => - model.getOrdersDetails(widget.appoNo, widget.orderNo), + model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, baseViewModel: model, @@ -89,7 +91,7 @@ class _AnicllaryOrdersState extends State fontSize: 20, ), Texts( - model.ancillaryListsDetails[0].patientID.toString(), + model.ancillaryLists[0].patientID.toString(), ) ], ), @@ -212,7 +214,7 @@ class _AnicllaryOrdersState extends State } Widget getAncillaryDetails(model) { - Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcList, + Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName); print(newMap); @@ -247,7 +249,7 @@ class _AnicllaryOrdersState extends State String getTotalValue(value) { double total = 0.0; - value.ancillaryListsDetails[0].ancillaryOrderProcList + value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList .forEach((result) => {total += result.companyShareWithTax}); return total.toStringAsFixed(2); } diff --git a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart index 1b8f70e3..786ed458 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/AddBloodPressurePage.dart @@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State { ), InkWell( onTap: () { - confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList); + confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); }, child: Container( padding: EdgeInsets.all(12), @@ -229,38 +229,41 @@ class _AddBloodPressurePageState extends State { widthFactor: 0.9, child: Column( children: [ - SecondaryButton( - loading: widget.model.state == ViewState.BusyLocal, - label: TranslationBase.of(context).save.toUpperCase(), - textColor: Colors.white, - color: isButtonDisabled ? Colors.grey[900] : Colors.grey, - onTap: () async { - if (_bloodSystolicValueController.text.isNotEmpty && - _bloodDiastolicValueController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); + Container( + height: 50, + child: SecondaryButton( + loading: widget.model.state == ViewState.BusyLocal, + label: TranslationBase.of(context).save.toUpperCase(), + textColor: Colors.white, + color: isButtonDisabled ? Colors.grey[900] : Colors.grey, + onTap: () async { + if (_bloodSystolicValueController.text.isNotEmpty && + _bloodDiastolicValueController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); - widget.model - .addORUpdateDiabtecResult( - isUpdate: widget.isUpdate, - bloodPressureDate: - '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', - diastolicPressure: _bloodDiastolicValueController.text.toString(), - systolicePressure: _bloodSystolicValueController.text.toString(), - measuredArm: measuredArm, - ) - .then((value) { - GifLoaderDialogUtils.hideDialog(context); - if (widget.model.state == ViewState.BusyLocal) + widget.model + .addORUpdateDiabtecResult( + isUpdate: widget.isUpdate, + bloodPressureDate: + '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', + diastolicPressure: _bloodDiastolicValueController.text.toString(), + systolicePressure: _bloodSystolicValueController.text.toString(), + measuredArm: measuredArm, + ) + .then((value) { + GifLoaderDialogUtils.hideDialog(context); + if (widget.model.state == ViewState.BusyLocal) + AppToast.showErrorToast(message: widget.model.error); + else + Navigator.pop(context); + ; + }).catchError((e) { + GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: widget.model.error); - else - Navigator.pop(context); - ; - }).catchError((e) { - GifLoaderDialogUtils.hideDialog(context); - AppToast.showErrorToast(message: widget.model.error); - }); - } - }), + }); + } + }), + ), ], ), ), diff --git a/lib/widgets/mobile-no/mobile_no.dart b/lib/widgets/mobile-no/mobile_no.dart index 44162743..f449cdb8 100644 --- a/lib/widgets/mobile-no/mobile_no.dart +++ b/lib/widgets/mobile-no/mobile_no.dart @@ -128,7 +128,8 @@ class _MobileNo extends State { controller: widget.controller, keyboardType: TextInputType.number, maxLength: 10, - inputFormatters: [ + inputFormatters: + [ FilteringTextInputFormatter.allow(RegExp("[0-9]")), ], // maxLengthEnforced: true,