Merge branch 'fatima-new' into 'development'

Fatima new

See merge request Cloud_Solution/diplomatic-quarter!361
merge-update-with-lab-changes
Mohammad Aljammal 5 years ago
commit b98a84bcac

@ -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';

@ -937,6 +937,7 @@ const Map localizedValues = {
}, },
"offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"}, "offerAndPackages": {"en": "Offers And Packages", "ar": "العروض والباقات"},
"InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"}, "InvoiceNo": {"en": "Invoice No", "ar": "رقم الفاتورة"},
"InvoiceDate": {"en": "Invoice Date", "ar": "تاريخ الفاتورة"},
"SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"},
"GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"}, "GeneralResult": {"en": "General Result", "ar": "نتيجة عامة"},
"show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"},

@ -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,25 @@ 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 = [];
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) { 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,7 +116,7 @@ class AncillaryOrdersListProcListModel {
} }
} }
class AncillaryOrderProcList { class AncillaryOrderProcDetailsList {
dynamic approvalLineItemNo; dynamic approvalLineItemNo;
dynamic approvalNo; dynamic approvalNo;
String approvalStatus; String approvalStatus;
@ -147,39 +148,39 @@ class AncillaryOrderProcList {
dynamic taxAmount; dynamic taxAmount;
dynamic taxPct; dynamic 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 ),
), ),
); );
} }

@ -8,11 +8,15 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import "package:collection/collection.dart"; import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ordersPayment.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 +35,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,
@ -64,7 +68,12 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
children: [ children: [
Button( Button(
label: TranslationBase.of(context).payNow, label: TranslationBase.of(context).payNow,
onTap: () {}, backgroundColor: Colors.red[800],
onTap: () {
Navigator.push(context,
FadePage(page: OrdersPayment(),
),);
},
) )
], ],
) )
@ -89,7 +98,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
fontSize: 20, fontSize: 20,
), ),
Texts( Texts(
model.ancillaryListsDetails[0].patientID.toString(), model.ancillaryLists[0].patientID.toString(),
) )
], ],
), ),
@ -126,7 +135,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
children: [ children: [
Texts( Texts(
TranslationBase.of(context).invoiceNo, TranslationBase.of(context).invoiceNo,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: Colors.red[500],
), ),
Texts(" : "), Texts(" : "),
Texts( Texts(
@ -137,8 +147,9 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
Row( Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context).date, TranslationBase.of(context).invoiceDate,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: Colors.red[500],
), ),
Texts(" : "), Texts(" : "),
Texts( Texts(
@ -152,8 +163,9 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
Row( Row(
children: [ children: [
Texts( Texts(
TranslationBase.of(context).date, TranslationBase.of(context).doctorName,
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
color: Colors.red[500],
), ),
Texts(" : "), Texts(" : "),
Texts( Texts(
@ -206,13 +218,49 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
Divider( Divider(
color: Colors.red[800], color: Colors.red[800],
thickness: 3, thickness: 3,
) ),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
children: [
],
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Texts(
TranslationBase.of(context).price,
color: Colors.grey[500],
fontSize: 14,
),
SizedBox(width: 15),
Texts(
TranslationBase.of(context).vat,
color: Colors.grey[500],
fontSize: 14,
),
SizedBox(width: 15),
Texts(
TranslationBase.of(context).total,
color: Colors.grey[500],
fontSize: 14,
),
] ),
],
),
Divider(
color: Colors.black26,
),
], ],
)); ));
} }
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 +295,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);
} }
@ -277,4 +325,6 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
}).toList(), }).toList(),
); );
} }
} }

@ -0,0 +1,20 @@
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
class OrdersPayment extends StatefulWidget {
@override
_OrdersPaymentState createState() => _OrdersPaymentState();
}
class _OrdersPaymentState extends State<OrdersPayment> {
@override
Widget build(BuildContext context) {
return Container();
}
}

@ -42,7 +42,8 @@ class AddBloodPressurePage extends StatefulWidget {
class _AddBloodPressurePageState extends State<AddBloodPressurePage> { class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodSystolicValueController = TextEditingController(); TextEditingController _bloodSystolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController = TextEditingController(); TextEditingController _bloodDiastolicValueController =
TextEditingController();
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
int measuredArm = 1; int measuredArm = 1;
@ -80,7 +81,9 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add, appBarTitle: widget.isUpdate
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate appBarIcons: widget.isUpdate
? [ ? [
IconButton( IconButton(
@ -96,10 +99,14 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) { widget.model
.deactivateDiabeticStatus(
lineItemNo: widget.lineItemNo)
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.model.state == ViewState.ErrorLocal) if (widget.model.state == ViewState.ErrorLocal)
AppToast.showErrorToast(message: widget.model.error); AppToast.showErrorToast(
message: widget.model.error);
else else
Navigator.pop(context); Navigator.pop(context);
}).catchError((e) { }).catchError((e) {
@ -144,13 +151,17 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList); confirmSelectMeasureTimeDialog(projectViewModel.isArabic
? measureTimeArList
: measureTimeEnList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -177,13 +188,17 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
bloodSugarDate = date; bloodSugarDate = date;
}, },
); );
}, currentTime: bloodSugarDate, locale: projectViewModel.localeType); },
currentTime: bloodSugarDate,
locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -198,22 +213,30 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) { DatePicker.showTimePicker(context, showTitleActions: true,
onConfirm: (date) {
setState( setState(
() { () {
timeSugarDate = date; timeSugarDate = date;
}, },
); );
}, currentTime: timeSugarDate, locale: projectViewModel.localeType); },
currentTime: timeSugarDate,
locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Texts(TranslationBase.of(context).time), Texts(getTime())], children: [
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), ),
@ -229,38 +252,44 @@ 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:
systolicePressure: _bloodSystolicValueController.text.toString(), _bloodDiastolicValueController.text.toString(),
measuredArm: measuredArm, systolicePressure:
) _bloodSystolicValueController.text.toString(),
.then((value) { measuredArm: measuredArm,
GifLoaderDialogUtils.hideDialog(context); )
if (widget.model.state == ViewState.BusyLocal) .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); AppToast.showErrorToast(message: widget.model.error);
else });
Navigator.pop(context); }
; }),
}).catchError((e) { ),
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: widget.model.error);
});
}
}),
], ],
), ),
), ),
@ -295,7 +324,8 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
} }
void validateForm() { void validateForm() {
print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString()); print("_bloodSystolicValueController " +
_bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' && if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 && _bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) { _bloodDiastolicValueController.text.length > 0) {

File diff suppressed because it is too large Load Diff

@ -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