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

@ -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<String, dynamic> 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.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'] = [
// {
// "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;

@ -12,8 +12,10 @@ class AnciallryOrdersViewModel extends BaseViewModel {
AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>();
List<AncillaryOrdersListModel> get ancillaryLists =>
_ancillaryService.ancillaryLists;
List<AncillaryOrdersListProcListModel> 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);

@ -1,31 +1,31 @@
class AncillaryOrdersListProcListModel {
List<AncillaryOrderProcList> ancillaryOrderProcList;
List<AncillaryOrderProcDetailsList> 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.ancillaryOrderProcDetailsList,
this.appointmentDate,
this.appointmentNo,
this.clinicID,
@ -51,10 +51,11 @@ class AncillaryOrdersListProcListModel {
this.subPolicyNo});
AncillaryOrdersListProcListModel.fromJson(Map<String, dynamic> json) {
if (json['AncillaryOrderProcList'] != null) {
ancillaryOrderProcList = new List<AncillaryOrderProcList>();
json['AncillaryOrderProcList'].forEach((v) {
ancillaryOrderProcList.add(new AncillaryOrderProcList.fromJson(v));
if (json['AncillaryOrderProcDetailsList'] != null) {
ancillaryOrderProcDetailsList = new List<AncillaryOrderProcDetailsList>();
json['AncillaryOrderProcDetailsList'].forEach((v) {
ancillaryOrderProcDetailsList
.add(new AncillaryOrderProcDetailsList.fromJson(v));
});
}
appointmentDate = json['AppointmentDate'];
@ -84,9 +85,9 @@ class AncillaryOrdersListProcListModel {
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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,39 +116,39 @@ 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,
@ -179,7 +180,7 @@ class AncillaryOrderProcList {
this.taxAmount,
this.taxPct});
AncillaryOrderProcList.fromJson(Map<String, dynamic> json) {
AncillaryOrderProcDetailsList.fromJson(Map<String, dynamic> json) {
approvalLineItemNo = json['ApprovalLineItemNo'];
approvalNo = json['ApprovalNo'];
approvalStatus = json['ApprovalStatus'];

@ -95,7 +95,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
.map(
(item) => InkWell(
onTap: () {
ancillaryOrdersDetails(item);
ancillaryOrdersDetails(item, model.ancillaryLists[0].projectID);
},
child: Container(
decoration: BoxDecoration(
@ -166,11 +166,11 @@ class _AnicllaryOrdersState extends State<AnicllaryOrders>
.toList());
}
ancillaryOrdersDetails(item) {
ancillaryOrdersDetails(item, projectId) {
Navigator.push(
context,
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 {
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<AnicllaryOrdersDetails>
Widget build(BuildContext context) {
return BaseView<AnciallryOrdersViewModel>(
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<AnicllaryOrdersDetails>
fontSize: 20,
),
Texts(
model.ancillaryListsDetails[0].patientID.toString(),
model.ancillaryLists[0].patientID.toString(),
)
],
),
@ -212,7 +214,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails>
}
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<AnicllaryOrdersDetails>
String getTotalValue(value) {
double total = 0.0;
value.ancillaryListsDetails[0].ancillaryOrderProcList
value.ancillaryListsDetails[0].ancillaryOrderProcDetailsList
.forEach((result) => {total += result.companyShareWithTax});
return total.toStringAsFixed(2);
}

@ -144,7 +144,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
),
InkWell(
onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeEnList : measureTimeArList);
confirmSelectMeasureTimeDialog(projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
},
child: Container(
padding: EdgeInsets.all(12),
@ -229,7 +229,9 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
widthFactor: 0.9,
child: Column(
children: [
SecondaryButton(
Container(
height: 50,
child: SecondaryButton(
loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white,
@ -261,6 +263,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
});
}
}),
),
],
),
),

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

Loading…
Cancel
Save