fixed issues

merge-requests/359/head
Fatimah Alshammari 3 years ago
parent bbb8e04066
commit 74d0826342

@ -17,12 +17,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/';
//const BASE_URL = 'https://hmgwebservices.com/'; //const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
//const BASE_PHARMACY_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/'; const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs // Pharmacy Production URLs
const BASE_PHARMACY_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 PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';

@ -20,6 +20,8 @@ class AncillaryOrdersService extends BaseService {
_ancillaryLists = []; _ancillaryLists = [];
response['AncillaryOrderList'].forEach((item) { response['AncillaryOrderList'].forEach((item) {
ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
print("response of ancillary Lists__________");
print(response);
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
@ -27,175 +29,183 @@ class AncillaryOrdersService extends BaseService {
}, body: body); }, body: body);
} }
Future getOrdersDetails(appointmentNo, orderNo) async { Future getOrdersDetails(appointmentNo, orderNo, projectID) async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['AppointmentNo_Vida'] = appointmentNo;
body['OrderNo'] = orderNo;
body['ProjectID'] = projectID;
// "OrderNo=$orderNo&AppointmentNo_Vida=$appointmentNo&ProjectID=$projectID"
hasError = false; hasError = false;
await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_ancillaryProcLists = []; // _ancillaryProcLists.clear();
response['AncillaryOrderProcList'] = [ _ancillaryProcLists = [];
{ // response['AncillaryOrderProcList'] = [
"AncillaryOrderProcList": [ // {
{ // "AncillaryOrderProcList": [
"ApprovalLineItemNo": 0, // {
"ApprovalNo": 0, // "ApprovalLineItemNo": 0,
"ApprovalStatus": "", // "ApprovalNo": 0,
"ApprovalStatusID": 0, // "ApprovalStatus": "",
"CompanyShare": 501.3, // "ApprovalStatusID": 0,
"CompanyShareWithTax": 576.5, // "CompanyShare": 501.3,
"CompanyTaxAmount": 75.19, // "CompanyShareWithTax": 576.5,
"DiscountAmount": 55.7, // "CompanyTaxAmount": 75.19,
"DiscountCategory": 1, // "DiscountAmount": 55.7,
"DiscountType": "P", // "DiscountCategory": 1,
"DiscountTypeValue": 10, // "DiscountType": "P",
"IsApprovalCreated": false, // "DiscountTypeValue": 10,
"IsApprovalRequired": false, // "IsApprovalCreated": false,
"IsCovered": false, // "IsApprovalRequired": false,
"OrderDate": "/Date(1601758800000+0300)/", // "IsCovered": false,
"OrderLineItemNo": 1, // "OrderDate": "/Date(1601758800000+0300)/",
"OrderNo": 2020000001, // "OrderLineItemNo": 1,
"PartnerID": 0, // "OrderNo": 2020000001,
"PartnerShare": 0, // "PartnerID": 0,
"PartnerShareType": "P", // "PartnerShare": 0,
"PatientShare": 0, // "PartnerShareType": "P",
"PatientShareWithTax": 0, // "PatientShare": 0,
"PatientTaxAmount": 0, // "PatientShareWithTax": 0,
"ProcPrice": 557, // "PatientTaxAmount": 0,
"ProcedureCategoryID": 2, // "ProcPrice": 557,
"ProcedureCategoryName": "LABORATORY", // "ProcedureCategoryID": 2,
"ProcedureID": "02013001", // "ProcedureCategoryName": "LABORATORY",
"ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O", // "ProcedureID": "02013001",
"TaxAmount": 75.19, // "ProcedureName": "11-DESOXYCORTISOL (COMPOUND S) - S.O",
"TaxPct": 15 // "TaxAmount": 75.19,
}, // "TaxPct": 15
{ // },
"ApprovalLineItemNo": 0, // {
"ApprovalNo": 0, // "ApprovalLineItemNo": 0,
"ApprovalStatus": "", // "ApprovalNo": 0,
"ApprovalStatusID": 0, // "ApprovalStatus": "",
"CompanyShare": 90, // "ApprovalStatusID": 0,
"CompanyShareWithTax": 103.5, // "CompanyShare": 90,
"CompanyTaxAmount": 13.5, // "CompanyShareWithTax": 103.5,
"DiscountAmount": 10, // "CompanyTaxAmount": 13.5,
"DiscountCategory": 1, // "DiscountAmount": 10,
"DiscountType": "P", // "DiscountCategory": 1,
"DiscountTypeValue": 10, // "DiscountType": "P",
"IsApprovalCreated": false, // "DiscountTypeValue": 10,
"IsApprovalRequired": true, // "IsApprovalCreated": false,
"IsCovered": false, // "IsApprovalRequired": true,
"OrderDate": "/Date(1601758800000+0300)/", // "IsCovered": false,
"OrderLineItemNo": 4, // "OrderDate": "/Date(1601758800000+0300)/",
"OrderNo": 2020000001, // "OrderLineItemNo": 4,
"PartnerID": 0, // "OrderNo": 2020000001,
"PartnerShare": 0, // "PartnerID": 0,
"PartnerShareType": "P", // "PartnerShare": 0,
"PatientShare": 0, // "PartnerShareType": "P",
"PatientShareWithTax": 0, // "PatientShare": 0,
"PatientTaxAmount": 0, // "PatientShareWithTax": 0,
"ProcPrice": 100, // "PatientTaxAmount": 0,
"ProcedureCategoryID": 2, // "ProcPrice": 100,
"ProcedureCategoryName": "LABORATORY", // "ProcedureCategoryID": 2,
"ProcedureID": "02014011", // "ProcedureCategoryName": "LABORATORY",
"ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)", // "ProcedureID": "02014011",
"TaxAmount": 13.5, // "ProcedureName": "CBC (COMPLETE BLOOD COUNT PROFILE)",
"TaxPct": 15 // "TaxAmount": 13.5,
}, // "TaxPct": 15
{ // },
"ApprovalLineItemNo": 0, // {
"ApprovalNo": 0, // "ApprovalLineItemNo": 0,
"ApprovalStatus": "", // "ApprovalNo": 0,
"ApprovalStatusID": 0, // "ApprovalStatus": "",
"CompanyShare": 347.76, // "ApprovalStatusID": 0,
"CompanyShareWithTax": 399.92, // "CompanyShare": 347.76,
"CompanyTaxAmount": 52.16, // "CompanyShareWithTax": 399.92,
"DiscountAmount": 38.64, // "CompanyTaxAmount": 52.16,
"DiscountCategory": 1, // "DiscountAmount": 38.64,
"DiscountType": "P", // "DiscountCategory": 1,
"DiscountTypeValue": 10, // "DiscountType": "P",
"IsApprovalCreated": false, // "DiscountTypeValue": 10,
"IsApprovalRequired": false, // "IsApprovalCreated": false,
"IsCovered": false, // "IsApprovalRequired": false,
"OrderDate": "/Date(1601758800000+0300)/", // "IsCovered": false,
"OrderLineItemNo": 3, // "OrderDate": "/Date(1601758800000+0300)/",
"OrderNo": 2020000001, // "OrderLineItemNo": 3,
"PartnerID": 0, // "OrderNo": 2020000001,
"PartnerShare": 0, // "PartnerID": 0,
"PartnerShareType": "P", // "PartnerShare": 0,
"PatientShare": 0, // "PartnerShareType": "P",
"PatientShareWithTax": 0, // "PatientShare": 0,
"PatientTaxAmount": 0, // "PatientShareWithTax": 0,
"ProcPrice": 386.4, // "PatientTaxAmount": 0,
"ProcedureCategoryID": 2, // "ProcPrice": 386.4,
"ProcedureCategoryName": "LABORATORY", // "ProcedureCategoryID": 2,
"ProcedureID": "02019302", // "ProcedureCategoryName": "LABORATORY",
"ProcedureName": "21-HYDROXYLASE ABS - S.O", // "ProcedureID": "02019302",
"TaxAmount": 52.16, // "ProcedureName": "21-HYDROXYLASE ABS - S.O",
"TaxPct": 15 // "TaxAmount": 52.16,
}, // "TaxPct": 15
{ // },
"ApprovalLineItemNo": 0, // {
"ApprovalNo": 0, // "ApprovalLineItemNo": 0,
"ApprovalStatus": "", // "ApprovalNo": 0,
"ApprovalStatusID": 0, // "ApprovalStatus": "",
"CompanyShare": 1323, // "ApprovalStatusID": 0,
"CompanyShareWithTax": 1521.45, // "CompanyShare": 1323,
"CompanyTaxAmount": 198.45, // "CompanyShareWithTax": 1521.45,
"DiscountAmount": 147, // "CompanyTaxAmount": 198.45,
"DiscountCategory": 1, // "DiscountAmount": 147,
"DiscountType": "P", // "DiscountCategory": 1,
"DiscountTypeValue": 10, // "DiscountType": "P",
"IsApprovalCreated": false, // "DiscountTypeValue": 10,
"IsApprovalRequired": true, // "IsApprovalCreated": false,
"IsCovered": false, // "IsApprovalRequired": true,
"OrderDate": "/Date(1601758800000+0300)/", // "IsCovered": false,
"OrderLineItemNo": 5, // "OrderDate": "/Date(1601758800000+0300)/",
"OrderNo": 2020000001, // "OrderLineItemNo": 5,
"PartnerID": 0, // "OrderNo": 2020000001,
"PartnerShare": 0, // "PartnerID": 0,
"PartnerShareType": "P", // "PartnerShare": 0,
"PatientShare": 0, // "PartnerShareType": "P",
"PatientShareWithTax": 0, // "PatientShare": 0,
"PatientTaxAmount": 0, // "PatientShareWithTax": 0,
"ProcPrice": 1470, // "PatientTaxAmount": 0,
"ProcedureCategoryID": 3, // "ProcPrice": 1470,
"ProcedureCategoryName": "RADIOLOGY", // "ProcedureCategoryID": 3,
"ProcedureID": "03033065", // "ProcedureCategoryName": "RADIOLOGY",
"ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)", // "ProcedureID": "03033065",
"TaxAmount": 198.45, // "ProcedureName": "CT SCAN - ABDOMEN (WITH CONTRAST)",
"TaxPct": 15 // "TaxAmount": 198.45,
} // "TaxPct": 15
], // }
"AppointmentDate": "/Date(1601499600000+0300)/", // ],
"AppointmentNo": 2016053756, // "AppointmentDate": "/Date(1601499600000+0300)/",
"ClinicID": 1, // "AppointmentNo": 2016053756,
"ClinicName": "INTERNAL MEDICINE CLINIC", // "ClinicID": 1,
"CompanyID": 0, // "ClinicName": "INTERNAL MEDICINE CLINIC",
"CompanyName": "Blood Donation Investigation", // "CompanyID": 0,
"DoctorID": 1485, // "CompanyName": "Blood Donation Investigation",
"DoctorName": "ANAS ABDULLAH", // "DoctorID": 1485,
"ErrCode": null, // "DoctorName": "ANAS ABDULLAH",
"GroupID": 2, // "ErrCode": null,
"InsurancePolicyNo": "45976500", // "GroupID": 2,
"Message": "Success", // "InsurancePolicyNo": "45976500",
"PatientCardID": "232332323", // "Message": "Success",
"PatientID": 3072055, // "PatientCardID": "232332323",
"PatientName": "MAYA KHALED SADDIQ", // "PatientID": 3072055,
"PatientType": 1, // "PatientName": "MAYA KHALED SADDIQ",
"PolicyID": 2, // "PatientType": 1,
"PolicyName": "Test", // "PolicyID": 2,
"ProjectID": 15, // "PolicyName": "Test",
"SetupID": "010266", // "ProjectID": 15,
"StatusCode": 1, // "SetupID": "010266",
"SubCategoryID": 2, // "StatusCode": 1,
"SubPolicyNo": "234234" // "SubCategoryID": 2,
} // "SubPolicyNo": "234234"
]; // }
// ];
response['AncillaryOrderProcList'].forEach((item) { response['AncillaryOrderProcList'].forEach((item) {
ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(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) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -12,8 +12,10 @@ class AnciallryOrdersViewModel extends BaseViewModel {
AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>(); AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>();
List<AncillaryOrdersListModel> get ancillaryLists => List<AncillaryOrdersListModel> get ancillaryLists =>
_ancillaryService.ancillaryLists; _ancillaryService.ancillaryLists;
List<AncillaryOrdersListProcListModel> get ancillaryListsDetails => List<AncillaryOrdersListProcListModel> get ancillaryListsDetails =>
_ancillaryService.ancillaryProcLists; _ancillaryService.ancillaryProcLists;
Future getOrders() async { Future getOrders() async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
@ -25,10 +27,10 @@ class AnciallryOrdersViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getOrdersDetails(appointmentNo, orderNo) async { Future getOrdersDetails(appointmentNo, orderNo, projectID) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _ancillaryService.getOrdersDetails(appointmentNo, orderNo); await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID );
if (_ancillaryService.hasError) { if (_ancillaryService.hasError) {
error = _ancillaryService.error; error = _ancillaryService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -1,60 +1,61 @@
class AncillaryOrdersListProcListModel { class AncillaryOrdersListProcListModel {
List<AncillaryOrderProcList> ancillaryOrderProcList; List<AncillaryOrderProcDetailsList> ancillaryOrderProcDetailsList;
String appointmentDate; String appointmentDate;
dynamic appointmentNo; int appointmentNo;
dynamic clinicID; int clinicID;
String clinicName; String clinicName;
dynamic companyID; int companyID;
String companyName; String companyName;
dynamic doctorID; int doctorID;
String doctorName; String doctorName;
Null errCode; Null errCode;
dynamic groupID; int groupID;
String insurancePolicyNo; String insurancePolicyNo;
String message; String message;
String patientCardID; String patientCardID;
dynamic patientID; int patientID;
String patientName; String patientName;
dynamic patientType; int patientType;
dynamic policyID; int policyID;
String policyName; String policyName;
dynamic projectID; int projectID;
String setupID; String setupID;
dynamic statusCode; int statusCode;
dynamic subCategoryID; int subCategoryID;
String subPolicyNo; String subPolicyNo;
AncillaryOrdersListProcListModel( AncillaryOrdersListProcListModel(
{this.ancillaryOrderProcList, {this.ancillaryOrderProcDetailsList,
this.appointmentDate, this.appointmentDate,
this.appointmentNo, this.appointmentNo,
this.clinicID, this.clinicID,
this.clinicName, this.clinicName,
this.companyID, this.companyID,
this.companyName, this.companyName,
this.doctorID, this.doctorID,
this.doctorName, this.doctorName,
this.errCode, this.errCode,
this.groupID, this.groupID,
this.insurancePolicyNo, this.insurancePolicyNo,
this.message, this.message,
this.patientCardID, this.patientCardID,
this.patientID, this.patientID,
this.patientName, this.patientName,
this.patientType, this.patientType,
this.policyID, this.policyID,
this.policyName, this.policyName,
this.projectID, this.projectID,
this.setupID, this.setupID,
this.statusCode, this.statusCode,
this.subCategoryID, this.subCategoryID,
this.subPolicyNo}); this.subPolicyNo});
AncillaryOrdersListProcListModel.fromJson(Map<String, dynamic> json) { AncillaryOrdersListProcListModel.fromJson(Map<String, dynamic> json) {
if (json['AncillaryOrderProcList'] != null) { if (json['AncillaryOrderProcDetailsList'] != null) {
ancillaryOrderProcList = new List<AncillaryOrderProcList>(); ancillaryOrderProcDetailsList = new List<AncillaryOrderProcDetailsList>();
json['AncillaryOrderProcList'].forEach((v) { json['AncillaryOrderProcDetailsList'].forEach((v) {
ancillaryOrderProcList.add(new AncillaryOrderProcList.fromJson(v)); ancillaryOrderProcDetailsList
.add(new AncillaryOrderProcDetailsList.fromJson(v));
}); });
} }
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
@ -84,9 +85,9 @@ class AncillaryOrdersListProcListModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.ancillaryOrderProcList != null) { if (this.ancillaryOrderProcDetailsList != null) {
data['AncillaryOrderProcList'] = data['AncillaryOrderProcDetailsList'] =
this.ancillaryOrderProcList.map((v) => v.toJson()).toList(); this.ancillaryOrderProcDetailsList.map((v) => v.toJson()).toList();
} }
data['AppointmentDate'] = this.appointmentDate; data['AppointmentDate'] = this.appointmentDate;
data['AppointmentNo'] = this.appointmentNo; data['AppointmentNo'] = this.appointmentNo;
@ -115,71 +116,71 @@ class AncillaryOrdersListProcListModel {
} }
} }
class AncillaryOrderProcList { class AncillaryOrderProcDetailsList {
dynamic approvalLineItemNo; int approvalLineItemNo;
dynamic approvalNo; int approvalNo;
String approvalStatus; String approvalStatus;
dynamic approvalStatusID; int approvalStatusID;
dynamic companyShare; int companyShare;
dynamic companyShareWithTax; int companyShareWithTax;
dynamic companyTaxAmount; int companyTaxAmount;
dynamic discountAmount; int discountAmount;
dynamic discountCategory; int discountCategory;
String discountType; String discountType;
dynamic discountTypeValue; int discountTypeValue;
bool isApprovalCreated; bool isApprovalCreated;
bool isApprovalRequired; bool isApprovalRequired;
bool isCovered; bool isCovered;
String orderDate; String orderDate;
dynamic orderLineItemNo; int orderLineItemNo;
dynamic orderNo; int orderNo;
dynamic partnerID; int partnerID;
dynamic partnerShare; int partnerShare;
String partnerShareType; String partnerShareType;
dynamic patientShare; int patientShare;
dynamic patientShareWithTax; double patientShareWithTax;
dynamic patientTaxAmount; double patientTaxAmount;
dynamic procPrice; int procPrice;
dynamic procedureCategoryID; int procedureCategoryID;
String procedureCategoryName; String procedureCategoryName;
String procedureID; String procedureID;
String procedureName; String procedureName;
dynamic taxAmount; dynamic taxAmount;
dynamic taxPct; int taxPct;
AncillaryOrderProcList( AncillaryOrderProcDetailsList(
{this.approvalLineItemNo, {this.approvalLineItemNo,
this.approvalNo, this.approvalNo,
this.approvalStatus, this.approvalStatus,
this.approvalStatusID, this.approvalStatusID,
this.companyShare, this.companyShare,
this.companyShareWithTax, this.companyShareWithTax,
this.companyTaxAmount, this.companyTaxAmount,
this.discountAmount, this.discountAmount,
this.discountCategory, this.discountCategory,
this.discountType, this.discountType,
this.discountTypeValue, this.discountTypeValue,
this.isApprovalCreated, this.isApprovalCreated,
this.isApprovalRequired, this.isApprovalRequired,
this.isCovered, this.isCovered,
this.orderDate, this.orderDate,
this.orderLineItemNo, this.orderLineItemNo,
this.orderNo, this.orderNo,
this.partnerID, this.partnerID,
this.partnerShare, this.partnerShare,
this.partnerShareType, this.partnerShareType,
this.patientShare, this.patientShare,
this.patientShareWithTax, this.patientShareWithTax,
this.patientTaxAmount, this.patientTaxAmount,
this.procPrice, this.procPrice,
this.procedureCategoryID, this.procedureCategoryID,
this.procedureCategoryName, this.procedureCategoryName,
this.procedureID, this.procedureID,
this.procedureName, this.procedureName,
this.taxAmount, this.taxAmount,
this.taxPct}); this.taxPct});
AncillaryOrderProcList.fromJson(Map<String, dynamic> json) { AncillaryOrderProcDetailsList.fromJson(Map<String, dynamic> json) {
approvalLineItemNo = json['ApprovalLineItemNo']; approvalLineItemNo = json['ApprovalLineItemNo'];
approvalNo = json['ApprovalNo']; approvalNo = json['ApprovalNo'];
approvalStatus = json['ApprovalStatus']; approvalStatus = json['ApprovalStatus'];

@ -95,7 +95,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
.map( .map(
(item) => InkWell( (item) => InkWell(
onTap: () { onTap: () {
ancillaryOrdersDetails(item); ancillaryOrdersDetails(item, model.ancillaryLists[0].projectID);
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -166,11 +166,11 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
.toList()); .toList());
} }
ancillaryOrdersDetails(item) { ancillaryOrdersDetails(item, projectId) {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo), page: AnicllaryOrdersDetails(item.appointmentNo, item.orderNo,projectId ),
), ),
); );
} }

@ -12,7 +12,9 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
class AnicllaryOrdersDetails extends StatefulWidget { class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo; final dynamic appoNo;
final dynamic orderNo; final dynamic orderNo;
AnicllaryOrdersDetails(this.appoNo, this.orderNo); final dynamic projectID;
AnicllaryOrdersDetails(this.appoNo, this.orderNo, this.projectID);
@override @override
_AnicllaryOrdersState createState() => _AnicllaryOrdersState(); _AnicllaryOrdersState createState() => _AnicllaryOrdersState();
} }
@ -31,7 +33,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<AnciallryOrdersViewModel>( return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) => onModelReady: (model) =>
model.getOrdersDetails(widget.appoNo, widget.orderNo), model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
@ -89,7 +91,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
fontSize: 20, fontSize: 20,
), ),
Texts( Texts(
model.ancillaryListsDetails[0].patientID.toString(), model.ancillaryLists[0].patientID.toString(),
) )
], ],
), ),
@ -212,7 +214,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
} }
Widget getAncillaryDetails(model) { Widget getAncillaryDetails(model) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcList, Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList,
(obj) => obj.procedureCategoryName); (obj) => obj.procedureCategoryName);
print(newMap); print(newMap);
@ -247,7 +249,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
String getTotalValue(value) { String getTotalValue(value) {
double total = 0.0; double total = 0.0;
value.ancillaryListsDetails[0].ancillaryOrderProcList value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList
.forEach((result) => {total += result.companyShareWithTax}); .forEach((result) => {total += result.companyShareWithTax});
return total.toStringAsFixed(2); return total.toStringAsFixed(2);
} }

@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList); confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
@ -229,38 +229,41 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
widthFactor: 0.9, widthFactor: 0.9,
child: Column( child: Column(
children: [ children: [
SecondaryButton( Container(
loading: widget.model.state == ViewState.BusyLocal, height: 50,
label: TranslationBase.of(context).save.toUpperCase(), child: SecondaryButton(
textColor: Colors.white, loading: widget.model.state == ViewState.BusyLocal,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey, label: TranslationBase.of(context).save.toUpperCase(),
onTap: () async { textColor: Colors.white,
if (_bloodSystolicValueController.text.isNotEmpty && color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
_bloodDiastolicValueController.text.isNotEmpty) { onTap: () async {
GifLoaderDialogUtils.showMyDialog(context); if (_bloodSystolicValueController.text.isNotEmpty &&
_bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
.addORUpdateDiabtecResult( .addORUpdateDiabtecResult(
isUpdate: widget.isUpdate, isUpdate: widget.isUpdate,
bloodPressureDate: bloodPressureDate:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: _bloodDiastolicValueController.text.toString(), diastolicPressure: _bloodDiastolicValueController.text.toString(),
systolicePressure: _bloodSystolicValueController.text.toString(), systolicePressure: _bloodSystolicValueController.text.toString(),
measuredArm: measuredArm, measuredArm: measuredArm,
) )
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.BusyLocal) 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); AppToast.showErrorToast(message: widget.model.error);
else });
Navigator.pop(context); }
; }),
}).catchError((e) { ),
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
}
}),
], ],
), ),
), ),

@ -128,7 +128,8 @@ class _MobileNo extends State<MobileNo> {
controller: widget.controller, controller: widget.controller,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
maxLength: 10, maxLength: 10,
inputFormatters: <TextInputFormatter>[ inputFormatters: <TextInputFormatter>
[
FilteringTextInputFormatter.allow(RegExp("[0-9]")), FilteringTextInputFormatter.allow(RegExp("[0-9]")),
], ],
// maxLengthEnforced: true, // maxLengthEnforced: true,

Loading…
Cancel
Save