Manual Insurance Updates, Service ID fixes, Tamara Fixes

merge-update-with-lab-changes
haroon amjad 3 years ago
parent 52070c8f94
commit 22a0e456bc

@ -408,7 +408,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 9.7;
var VERSION_ID = 9.8;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;
@ -431,6 +431,7 @@ var GET_PAtIENTS_INSURANCE_UPDATED =
var INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
var INSURANCE_SCHEMES = "Services/Patients.svc/REST/PatientER_SchemesOfAactiveCompaniesGet";
var UPDATE_MANUAL_INSURANCE = "Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate";
var INSURANCE_COMPANIES = "Services/Patients.svc/REST/PatientER_InsuranceCompanyGet";
var GET_PATIENT_INSURANCE_DETAILS =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
@ -733,6 +734,9 @@ var SEND_DENTAL_APPOINTMENT_INVOICE_EMAIL =
var GET_TAMARA_PLAN =
'https://mdlaboratories.com/tamaralive/Home/GetInstallments';
var GET_TAMARA_PAYMENT_STATUS =
'https://mdlaboratories.com/tamaralive/api/OnlineTamara/order_status?orderid=';
var UPDATE_TAMARA_STATUS =
'Services/PayFort_Serv.svc/REST/Tamara_UpdateRequestStatus';

@ -1860,5 +1860,6 @@ const Map localizedValues = {
"paymentOnly": { "en": "Payment", "ar": "معلقة" },
"pendingOnly": { "en": "Pending", "ar": "مدفوعات" },
"insuranceClassName": { "en": "Insurance Class", "ar": "فئة التأمين" },
"insuranceRequestSubmit": { "en": "Your insurance update request has been submitted successfully.", "ar": "تم تقديم طلب تحديث التأمين الخاص بك بنجاح." },
"NFCNotSupported": { "en": "Your device does not support NFC. Please visit reception to Check-In", "ar": "جهازك لا يدعم NFC. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" },
};

@ -0,0 +1,64 @@
class InsuranceManualUpdateRequest {
String setupID;
String patientIdentificationID;
int projectID;
String mobileNo;
int activityId;
String component;
bool enableLogging;
String insuranceCompanyName;
String cardHolderName;
String memberShipNo;
String policyNo;
String schemeClass;
int requestType;
InsuranceManualUpdateRequest(
{this.setupID,
this.patientIdentificationID,
this.projectID,
this.mobileNo,
this.activityId,
this.component,
this.enableLogging,
this.insuranceCompanyName,
this.cardHolderName,
this.memberShipNo,
this.policyNo,
this.schemeClass,
this.requestType});
InsuranceManualUpdateRequest.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
patientIdentificationID = json['PatientIdentificationID'];
projectID = json['ProjectID'];
mobileNo = json['MobileNo'];
activityId = json['activityId'];
component = json['component'];
enableLogging = json['enableLogging'];
insuranceCompanyName = json['InsuranceCompanyName'];
cardHolderName = json['CardHolderName'];
memberShipNo = json['MemberShipNo'];
policyNo = json['PolicyNo'];
schemeClass = json['SchemeClass'];
requestType = json['RequestType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['ProjectID'] = this.projectID;
data['MobileNo'] = this.mobileNo;
data['activityId'] = this.activityId;
data['component'] = this.component;
data['enableLogging'] = this.enableLogging;
data['InsuranceCompanyName'] = this.insuranceCompanyName;
data['CardHolderName'] = this.cardHolderName;
data['MemberShipNo'] = this.memberShipNo;
data['PolicyNo'] = this.policyNo;
data['SchemeClass'] = this.schemeClass;
data['RequestType'] = this.requestType;
return data;
}
}

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart';
import 'package:diplomaticquarterapp/core/model/insurance/ReauestInsuranceApprovalModel.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insuranceManualUpdateRequest.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart';
@ -187,6 +188,22 @@ class InsuranceCardService extends BaseService {
return Future.value(localRes);
}
Future submitManualInsuranceUpdateRequest(InsuranceManualUpdateRequest insuranceManualUpdateRequest) async {
dynamic localRes;
await baseAppClient.post(
UPDATE_MANUAL_INSURANCE,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: insuranceManualUpdateRequest.toJson(),
);
return Future.value(localRes);
}
Future getInsuranceCompanies() async {
dynamic localRes;
await baseAppClient.post(

@ -0,0 +1,72 @@
class InsuranceCompaniesSchemeModel {
String setupID;
int projectID;
int companyID;
int subCategoryID;
String subCategoryDesc;
String subCategoryDescN;
String validFrom;
String validTo;
var isInpatient;
int roomCategory;
bool isActive;
int createdBy;
String createdOn;
int editedBy;
String editedOn;
InsuranceCompaniesSchemeModel(
{this.setupID,
this.projectID,
this.companyID,
this.subCategoryID,
this.subCategoryDesc,
this.subCategoryDescN,
this.validFrom,
this.validTo,
this.isInpatient,
this.roomCategory,
this.isActive,
this.createdBy,
this.createdOn,
this.editedBy,
this.editedOn});
InsuranceCompaniesSchemeModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
companyID = json['CompanyID'];
subCategoryID = json['SubCategoryID'];
subCategoryDesc = json['SubCategoryDesc'];
subCategoryDescN = json['SubCategoryDescN'];
validFrom = json['ValidFrom'];
validTo = json['ValidTo'];
isInpatient = json['IsInpatient'];
roomCategory = json['RoomCategory'];
isActive = json['IsActive'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['CompanyID'] = this.companyID;
data['SubCategoryID'] = this.subCategoryID;
data['SubCategoryDesc'] = this.subCategoryDesc;
data['SubCategoryDescN'] = this.subCategoryDescN;
data['ValidFrom'] = this.validFrom;
data['ValidTo'] = this.validTo;
data['IsInpatient'] = this.isInpatient;
data['RoomCategory'] = this.roomCategory;
data['IsActive'] = this.isActive;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
return data;
}
}

@ -1,3 +1,5 @@
import 'dart:io';
import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
@ -40,9 +42,13 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
MyInAppBrowser browser;
String transID = "";
BuildContext localContext;
String selectedInstallmentPlan;
List<AncillaryOrderProcDetailsList> selectedProcList = [];
String tamaraPaymentStatus;
String tamaraOrderID;
void initState() {
super.initState();
}
@ -477,10 +483,11 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
PaymentMethod(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) {
selectedPaymentMethod = method;
print(selectedPaymentMethod);
this.selectedInstallmentPlan = selectedInstallmentPlan;
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan);
},
patientShare: double.parse(getTotalValue()),
isFromAdvancePayment: !projectViewModel.havePrivilege(94),
));
}
@ -503,6 +510,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
browser,
false,
"3",
// Need to get new Service ID from Ayman for Ancillary Tamara
"",
model.ancillaryListsDetails[0].appointmentDate,
model.ancillaryListsDetails[0].appointmentNo,
@ -515,6 +523,18 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
print("onBrowserLoadStart");
print(url);
if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['status'];
tamaraOrderID = uri.queryParameters['AuthorizePaymentId'];
} else {
Uri uri = new Uri.dataFromString(url);
tamaraPaymentStatus = uri.queryParameters['paymentStatus'];
tamaraOrderID = uri.queryParameters['orderId'];
}
}
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (browser.isOpened()) browser.close();
@ -534,7 +554,50 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
checkPaymentStatus(appo);
if (selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(transID, appo);
} else {
checkPaymentStatus(appo);
}
}
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(this.selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(this.selectedInstallmentPlan), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
try {
DoctorsListService service = new DoctorsListService();
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus.toLowerCase() == "approved") {
createAdvancePayment(res, appo);
// addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo);
}
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
GifLoaderDialogUtils.hideDialog(context);
});
} catch (err) {
print(err);
}
}
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
@ -653,7 +716,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} else {
if (value.isApprovalCreated && value.approvalNo != 0) {
insuranceText = "Approved";
} else if(value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) {
} else if (value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) {
insuranceText = "Approval Rejected - Please visit receptionist";
} else {
insuranceText = "Sent For Approval";
@ -669,7 +732,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} else {
if (value.isApprovalCreated && value.approvalNo != 0) {
color = Color(0xff359846);
} else if(value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) {
} else if (value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) {
color = Color(0xffD02127);
} else {
color = Color(0xffCC9B14);

@ -41,7 +41,7 @@ class BookConfirm extends StatefulWidget {
DoctorsListService service;
PatientShareResponse patientShareResponse;
AuthenticatedUser authUser;
// AuthenticatedUser authUser;
@override
_BookConfirmState createState() => _BookConfirmState();
@ -55,8 +55,8 @@ class _BookConfirmState extends State<BookConfirm> {
@override
void initState() {
widget.authUser = new AuthenticatedUser();
getPatientData();
// widget.authUser = new AuthenticatedUser();
// getPatientData();
widget.service = new DoctorsListService();
widget.patientShareResponse = new PatientShareResponse();
super.initState();
@ -166,9 +166,9 @@ class _BookConfirmState extends State<BookConfirm> {
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
showInfo(TranslationBase.of(context).name, widget.authUser.firstName + " " + widget.authUser.lastName),
showInfo(TranslationBase.of(context).gender, widget.authUser.genderDescription),
showInfo(TranslationBase.of(context).age, widget.authUser.age.toString())
showInfo(TranslationBase.of(context).name, projectViewModel.user.firstName + " " + projectViewModel.user.lastName),
showInfo(TranslationBase.of(context).gender, projectViewModel.user.genderDescription),
showInfo(TranslationBase.of(context).age, projectViewModel.user.age.toString())
],
),
],
@ -447,16 +447,16 @@ class _BookConfirmState extends State<BookConfirm> {
return docSpeciality;
}
getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() {
print(data);
widget.authUser = data;
});
}
}
// getPatientData() async {
// AppSharedPreferences sharedPref = AppSharedPreferences();
// if (await sharedPref.getObject(USER_PROFILE) != null) {
// var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
// setState(() {
// print(data);
// widget.authUser = data;
// });
// }
// }
Future navigateToHome(context) async {
Navigator.of(context).popAndPushNamed(HOME);

@ -23,7 +23,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'QRCode.dart';
@ -343,7 +342,6 @@ class _BookSuccessState extends State<BookSuccess> {
break;
case 90:
return _getQRAppo();
}
}
@ -597,7 +595,7 @@ class _BookSuccessState extends State<BookSuccess> {
authenticatedUser,
widget.browser,
widget.patientShareResponse.isLiveCareAppointment,
widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.serviceID.toString() : "2",
"2",
widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "",
widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo,
@ -608,8 +606,6 @@ class _BookSuccessState extends State<BookSuccess> {
}
onBrowserLoadStart(String url) {
print(url);
if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url);
@ -622,7 +618,6 @@ class _BookSuccessState extends State<BookSuccess> {
}
}
// if (selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
@ -630,9 +625,7 @@ class _BookSuccessState extends State<BookSuccess> {
return;
}
});
// }
// if (selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
@ -640,18 +633,18 @@ class _BookSuccessState extends State<BookSuccess> {
return;
}
});
// }
}
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
try {
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
}
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// } else {
// updateTamaraRequestStatus(
// "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
// }
} else {
checkPaymentStatus(appo);
}
@ -660,6 +653,24 @@ class _BookSuccessState extends State<BookSuccess> {
}
}
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(selectedInstallments), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {
@ -943,7 +954,6 @@ class _BookSuccessState extends State<BookSuccess> {
getAppoQR(context) {
DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(widget.patientShareResponse, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR']);
}).catchError((err) {

@ -276,12 +276,13 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserExit Called!!!!");
try {
if (widget.selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "",
num.parse(widget.selectedInstallmentPlan), appo);
}
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
// } else {
// updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "",
// num.parse(widget.selectedInstallmentPlan), appo);
// }
} else {
checkPaymentStatus(appo);
}
@ -290,6 +291,24 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
}
}
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "",
num.parse(widget.selectedInstallmentPlan), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {

@ -345,36 +345,36 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Container(
margin: EdgeInsets.only(top: 12),
child: AppExpandableNotifier(
isExpand: true,
hasCounter: true,
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0",
title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: widget.ancillaryLists.length != 0
? Container(
padding: EdgeInsets.all(12),
child: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
reverse: true,
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName),
billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate),
isSortByClinic: true,
);
},
itemCount: widget.ancillaryLists[0].ancillaryOrderList.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
)
: getNoDataWidget(context),
)),
isExpand: true,
hasCounter: true,
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0",
title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: widget.ancillaryLists.length != 0
? Container(
padding: EdgeInsets.all(12),
child: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
reverse: true,
itemBuilder: (context, index) {
return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID),
isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName),
billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName,
isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate),
isSortByClinic: true,
);
},
itemCount: widget.ancillaryLists[0].ancillaryOrderList.length,
separatorBuilder: (context, index) => SizedBox(height: 14),
),
)
: getNoDataWidget(context),
)),
],
),
),
@ -869,6 +869,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
getAppoQR(context, AppoitmentAllHistoryResultList appo) {
// GifLoaderDialogUtils.showMyDialog(context);
PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj;
patientShareResponse.doctorSpeciality = appo.doctorSpeciality;
patientShareResponse.projectName = appo.projectName;
patientShareResponse.appointmentDate = appo.appointmentDate;
patientShareResponse.appointmentNo = appo.appointmentNo;
patientShareResponse.clinicID = appo.clinicID;
patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup;
FlutterNfcKit.nfcAvailability.then((value) {
if (value == NFCAvailability.available) {
PatientShareResponse patientShareResponse = new PatientShareResponse();
@ -886,6 +898,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
}
});
projectViewModel.analytics.todoList.to_do_list_check_in(appo);
DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(patientShareResponse, context).then((res) {}).catchError((err) {
print(err);
});
}
Future navigateToQR(context, String appoQR, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appintment) async {
@ -940,7 +958,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser,
widget.browser,
appo.isLiveCareAppointment,
appo.isLiveCareAppointment ? widget.patientShareResponse.serviceID.toString() : "2",
"2",
appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "",
appo.appointmentDate,
appo.appointmentNo,
@ -989,16 +1007,35 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!");
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
} else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
}
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// } else {
// updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// }
} else {
checkPaymentStatus(appo);
}
}
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {
@ -1045,7 +1082,6 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert("0", tamaraOrderID, appo);
else
getAppoQR(context, appo);
// autoGenerateInvoiceTamara(appo);
}).catchError((err) {
print(err);
AppToast.showErrorToast(message: err);
@ -1053,30 +1089,6 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
});
}
// autoGenerateInvoiceTamara(AppoitmentAllHistoryResultList appo) {
// GifLoaderDialogUtils.showMyDialog(context);
// var apptData = {
// "AppointmentNo": appo.appointmentNo.toString(),
// "DoctorID": appo.doctorID.toString(),
// "ServiceID": appo.serviceID.toString(),
// "ProjectID": appo.projectID.toString(),
// "ClinicID": appo.clinicID.toString(),
// "AppointmentDate": appo.appointmentDate.toString(),
// };
// DoctorsListService service = new DoctorsListService();
// service.autoGenerateInvoiceTamara(appo.projectID, appo.appointmentNo.toString(), projectViewModel.user.mobileNumber).then((res) {
// GifLoaderDialogUtils.hideDialog(context);
// if (appo.isLiveCareAppointment)
// addVIDARequestInsert("0", tamaraOrderID, apptData);
// else
// getAppoQR(context, appo);
// }).catchError((err) {
// print(err);
// AppToast.showErrorToast(message: err);
// GifLoaderDialogUtils.hideDialog(context);
// });
// }
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
String txn_ref;
num amount;
@ -1106,7 +1118,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
error_type: res['Response_Message']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
if(mounted) GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}

@ -133,6 +133,7 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
child: DefaultButton(
TranslationBase.of(context).updateInsuranceManually,
() {
Navigator.pop(context);
Navigator.push(context, FadePage(page: UpdateInsuranceManually()));
},
textColor: Colors.white,

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/core/model/insurance/insuranceManualUpdateRequest.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/insurance/getInsuranceCompaniesModel.dart';
import 'package:diplomaticquarterapp/models/insurance/insuranceCompaniesSchemeModel.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -29,10 +32,13 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
List<InsuranceCompaniesGetModel> insuranceCompaniesList = [];
List<InsuranceCompaniesSchemeModel> insuranceCompaniesSchemesList = [];
int _selectedInsuranceCompanyIndex = -1;
int _selectedInsuranceCompanySchemeIndex = -1;
InsuranceCompaniesGetModel selectedInsuranceCompanyObj;
InsuranceCompaniesSchemeModel selectedInsuranceCompaniesSchemesObj;
@override
void initState() {
@ -121,31 +127,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
SizedBox(height: 12),
InkWell(
onTap: () {
List<RadioSelectionDialogModel> list = [
RadioSelectionDialogModel(TranslationBase.of(context).myAccount, 0),
RadioSelectionDialogModel(TranslationBase.of(context).myFamilyFiles, 1),
RadioSelectionDialogModel(TranslationBase.of(context).otherAccount, 2),
];
showDialog(
context: context,
builder: (cxt) => RadioSelectionDialog(
listData: list,
// selectedIndex:
// beneficiaryType == BeneficiaryType.MyAccount ? 0 : (beneficiaryType == BeneficiaryType.MyFamilyFiles ? 1 : (beneficiaryType == BeneficiaryType.OtherAccount ? 2 : -1)),
onValueSelected: (index) {
var type;
if (index == 0) {
// type = BeneficiaryType.MyAccount;
} else if (index == 1) {
// type = BeneficiaryType.MyFamilyFiles;
} else {
// type = BeneficiaryType.OtherAccount;
}
setState(() {});
},
),
);
confirmSelectInsuranceCompanySchemeDialog();
},
child: Container(
padding: EdgeInsets.all(8),
@ -156,7 +138,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
TranslationBase.of(context).insuranceClassName,
selectedInsuranceCompaniesSchemesObj != null ? selectedInsuranceCompaniesSchemesObj.subCategoryDesc : TranslationBase.of(context).insuranceClassName,
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w600,
@ -175,11 +157,29 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
bottomSheet: Container(
color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(18),
child: DefaultButton(TranslationBase.of(context).submit, () {}),
child: DefaultButton(
TranslationBase.of(context).submit,
isFormValid() ? () {
submitManualInsuranceUpdateRequest();
} : null,
disabledColor: Colors.grey,
),
),
);
}
bool isFormValid() {
if (selectedInsuranceCompanyObj != null &&
_cardHolderNameTextController.text.isNotEmpty &&
_membershipNoTextController.text.isNotEmpty &&
_policyNoTextController.text.isNotEmpty &&
selectedInsuranceCompaniesSchemesObj != null) {
return true;
} else {
return false;
}
}
void confirmSelectInsuranceCompanyDialog() {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < insuranceCompaniesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesList[i].companyName, i),
@ -200,6 +200,25 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
);
}
void confirmSelectInsuranceCompanySchemeDialog() {
List<RadioSelectionDialogModel> list = [
for (int i = 0; i < insuranceCompaniesSchemesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesSchemesList[i].subCategoryDesc, i),
];
showDialog(
context: context,
builder: (cxt) => RadioSelectionDialog(
listData: list,
selectedIndex: _selectedInsuranceCompanySchemeIndex,
isScrollable: true,
onValueSelected: (index) {
_selectedInsuranceCompanySchemeIndex = index;
selectedInsuranceCompaniesSchemesObj = insuranceCompaniesSchemesList[index];
setState(() {});
},
),
);
}
void getInsuranceCompanies() {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceCompanies().then((value) {
@ -210,11 +229,37 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
});
}
void submitManualInsuranceUpdateRequest() {
GifLoaderDialogUtils.showMyDialog(context);
InsuranceManualUpdateRequest insuranceManualUpdateRequest = new InsuranceManualUpdateRequest();
insuranceManualUpdateRequest.projectID = selectedInsuranceCompanyObj.projectID;
insuranceManualUpdateRequest.requestType = 2;
insuranceManualUpdateRequest.mobileNo = projectViewModel.user.mobileNumber;
insuranceManualUpdateRequest.cardHolderName = _cardHolderNameTextController.text;
insuranceManualUpdateRequest.insuranceCompanyName = selectedInsuranceCompanyObj.companyName;
insuranceManualUpdateRequest.memberShipNo = _membershipNoTextController.text;
insuranceManualUpdateRequest.policyNo = _policyNoTextController.text;
insuranceManualUpdateRequest.patientIdentificationID = projectViewModel.user.patientIdentificationNo;
insuranceManualUpdateRequest.schemeClass = selectedInsuranceCompaniesSchemesObj.subCategoryDesc;
insuranceManualUpdateRequest.setupID = selectedInsuranceCompanyObj.setupID;
_insuranceCardService.submitManualInsuranceUpdateRequest(insuranceManualUpdateRequest).then((value) {
AppToast.showSuccessToast(message: TranslationBase.of(context).insuranceRequestSubmit);
Navigator.pop(context);
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err.toString());
});
}
void getInsuranceScheme() {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID, selectedInsuranceCompanyObj.companyID).then((value) {
value.forEach((result) {
insuranceCompaniesList.add(InsuranceCompaniesGetModel.fromJson(result));
insuranceCompaniesSchemesList.add(InsuranceCompaniesSchemeModel.fromJson(result));
});
GifLoaderDialogUtils.hideDialog(context);
});

@ -13,7 +13,6 @@ import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_type_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -356,12 +355,13 @@ class _clinic_listState extends State<ClinicList> {
print("onBrowserExit Called!!!!");
try {
if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
}
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
// } else {
// updateTamaraRequestStatus(
// "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
// }
} else {
checkPaymentStatus(appo);
}
@ -370,6 +370,24 @@ class _clinic_listState extends State<ClinicList> {
}
}
checkTamaraPaymentStatus(String orderID, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getTamaraPaymentStatus(orderID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context);

@ -206,6 +206,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
doctor.doctorImageURL = model.appointmentDetails.doctorImageURL;
doctor.clinicName = model.appointmentDetails.clinicName;
doctor.projectName = model.appointmentDetails.projectName;
doctor.date = model.appointmentDetails.appointmentDate;
doctor.actualDoctorRate = 5;
return doctor;

@ -922,6 +922,18 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future getTamaraPaymentStatus(String orderID) async {
hasError = false;
dynamic localRes;
await baseAppClient.get(GET_TAMARA_PAYMENT_STATUS + "$orderID", isRCService: false, isExternal: true, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
});
return Future.value(localRes);
}
Future<Map> addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, BuildContext context) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {

@ -2869,6 +2869,7 @@ class TranslationBase {
String get NFCNotSupported => localizedValues["NFCNotSupported"][locale.languageCode];
String get paymentOnly => localizedValues["paymentOnly"][locale.languageCode];
String get pendingOnly => localizedValues["pendingOnly"][locale.languageCode];
String get insuranceRequestSubmit => localizedValues["insuranceRequestSubmit"][locale.languageCode];
}

@ -33,15 +33,15 @@ Widget getPaymentMethods() {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Image.asset("assets/images/new/payment/Mada.png",
width: 50, height: 50),
width: 40, height: 40),
Image.asset("assets/images/new/payment/tamara_en.png",
width: 50, height: 50),
width: 40, height: 40),
Image.asset("assets/images/new/payment/visa.png",
width: 50, height: 50),
width: 40, height: 40),
Image.asset("assets/images/new/payment/Mastercard.png",
width: 50, height: 50),
width: 50, height: 40),
Image.asset("assets/images/new/payment/Apple_Pay.png",
width: 50, height: 50),
width: 40, height: 40),
],
),
);

@ -57,7 +57,7 @@ class MyInAppBrowser extends InAppBrowser {
static List<String> successURLS = ['success?', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?'];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?'];
static List<String> errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay', 'mdlaboratories.com/?', 'cancel', 'canceled'];
final Function onExitCallback;
final Function onLoadStartCallback;

Loading…
Cancel
Save