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

@ -1860,5 +1860,6 @@ const Map localizedValues = {
"paymentOnly": { "en": "Payment", "ar": "معلقة" }, "paymentOnly": { "en": "Payment", "ar": "معلقة" },
"pendingOnly": { "en": "Pending", "ar": "مدفوعات" }, "pendingOnly": { "en": "Pending", "ar": "مدفوعات" },
"insuranceClassName": { "en": "Insurance Class", "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. يرجى زيارة مكتب الاستقبال لتسجيل الوصول" }, "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/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.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/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_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart';
@ -187,6 +188,22 @@ class InsuranceCardService extends BaseService {
return Future.value(localRes); 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 { Future getInsuranceCompanies() async {
dynamic localRes; dynamic localRes;
await baseAppClient.post( 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:collection/collection.dart";
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
@ -40,9 +42,13 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
MyInAppBrowser browser; MyInAppBrowser browser;
String transID = ""; String transID = "";
BuildContext localContext; BuildContext localContext;
String selectedInstallmentPlan;
List<AncillaryOrderProcDetailsList> selectedProcList = []; List<AncillaryOrderProcDetailsList> selectedProcList = [];
String tamaraPaymentStatus;
String tamaraOrderID;
void initState() { void initState() {
super.initState(); super.initState();
} }
@ -477,10 +483,11 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
PaymentMethod( PaymentMethod(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) { onSelectedMethod: (String method, [String selectedInstallmentPlan]) {
selectedPaymentMethod = method; selectedPaymentMethod = method;
print(selectedPaymentMethod); this.selectedInstallmentPlan = selectedInstallmentPlan;
openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan); openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan);
}, },
patientShare: double.parse(getTotalValue()), patientShare: double.parse(getTotalValue()),
isFromAdvancePayment: !projectViewModel.havePrivilege(94),
)); ));
} }
@ -503,6 +510,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
browser, browser,
false, false,
"3", "3",
// Need to get new Service ID from Ayman for Ancillary Tamara
"", "",
model.ancillaryListsDetails[0].appointmentDate, model.ancillaryListsDetails[0].appointmentDate,
model.ancillaryListsDetails[0].appointmentNo, model.ancillaryListsDetails[0].appointmentNo,
@ -515,6 +523,18 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
print("onBrowserLoadStart"); print("onBrowserLoadStart");
print(url); 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) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (browser.isOpened()) browser.close(); if (browser.isOpened()) browser.close();
@ -534,7 +554,50 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!"); 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) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
@ -653,7 +716,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} else { } else {
if (value.isApprovalCreated && value.approvalNo != 0) { if (value.isApprovalCreated && value.approvalNo != 0) {
insuranceText = "Approved"; 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"; insuranceText = "Approval Rejected - Please visit receptionist";
} else { } else {
insuranceText = "Sent For Approval"; insuranceText = "Sent For Approval";
@ -669,7 +732,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
} else { } else {
if (value.isApprovalCreated && value.approvalNo != 0) { if (value.isApprovalCreated && value.approvalNo != 0) {
color = Color(0xff359846); color = Color(0xff359846);
} else if(value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) { } else if (value.isApprovalRequired && value.isApprovalCreated && value.approvalNo == 0) {
color = Color(0xffD02127); color = Color(0xffD02127);
} else { } else {
color = Color(0xffCC9B14); color = Color(0xffCC9B14);

@ -41,7 +41,7 @@ class BookConfirm extends StatefulWidget {
DoctorsListService service; DoctorsListService service;
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
AuthenticatedUser authUser; // AuthenticatedUser authUser;
@override @override
_BookConfirmState createState() => _BookConfirmState(); _BookConfirmState createState() => _BookConfirmState();
@ -55,8 +55,8 @@ class _BookConfirmState extends State<BookConfirm> {
@override @override
void initState() { void initState() {
widget.authUser = new AuthenticatedUser(); // widget.authUser = new AuthenticatedUser();
getPatientData(); // getPatientData();
widget.service = new DoctorsListService(); widget.service = new DoctorsListService();
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
super.initState(); super.initState();
@ -166,9 +166,9 @@ class _BookConfirmState extends State<BookConfirm> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
showInfo(TranslationBase.of(context).name, widget.authUser.firstName + " " + widget.authUser.lastName), showInfo(TranslationBase.of(context).name, projectViewModel.user.firstName + " " + projectViewModel.user.lastName),
showInfo(TranslationBase.of(context).gender, widget.authUser.genderDescription), showInfo(TranslationBase.of(context).gender, projectViewModel.user.genderDescription),
showInfo(TranslationBase.of(context).age, widget.authUser.age.toString()) showInfo(TranslationBase.of(context).age, projectViewModel.user.age.toString())
], ],
), ),
], ],
@ -447,16 +447,16 @@ class _BookConfirmState extends State<BookConfirm> {
return docSpeciality; return docSpeciality;
} }
getPatientData() async { // getPatientData() async {
AppSharedPreferences sharedPref = AppSharedPreferences(); // AppSharedPreferences sharedPref = AppSharedPreferences();
if (await sharedPref.getObject(USER_PROFILE) != null) { // if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); // var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
setState(() { // setState(() {
print(data); // print(data);
widget.authUser = data; // widget.authUser = data;
}); // });
} // }
} // }
Future navigateToHome(context) async { Future navigateToHome(context) async {
Navigator.of(context).popAndPushNamed(HOME); 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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'QRCode.dart'; import 'QRCode.dart';
@ -343,7 +342,6 @@ class _BookSuccessState extends State<BookSuccess> {
break; break;
case 90: case 90:
return _getQRAppo(); return _getQRAppo();
} }
} }
@ -597,7 +595,7 @@ class _BookSuccessState extends State<BookSuccess> {
authenticatedUser, authenticatedUser,
widget.browser, widget.browser,
widget.patientShareResponse.isLiveCareAppointment, widget.patientShareResponse.isLiveCareAppointment,
widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.serviceID.toString() : "2", "2",
widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", widget.patientShareResponse.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "",
widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentDate,
widget.patientShareResponse.appointmentNo, widget.patientShareResponse.appointmentNo,
@ -608,8 +606,6 @@ class _BookSuccessState extends State<BookSuccess> {
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
print(url);
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
if (Platform.isAndroid) { if (Platform.isAndroid) {
Uri uri = new Uri.dataFromString(url); Uri uri = new Uri.dataFromString(url);
@ -622,7 +618,6 @@ class _BookSuccessState extends State<BookSuccess> {
} }
} }
// if (selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser.isOpened()) widget.browser.close();
@ -630,9 +625,7 @@ class _BookSuccessState extends State<BookSuccess> {
return; return;
} }
}); });
// }
// if (selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); if (widget.browser.isOpened()) widget.browser.close();
@ -640,18 +633,18 @@ class _BookSuccessState extends State<BookSuccess> {
return; return;
} }
}); });
// }
} }
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
try { try {
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
} else { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
updateTamaraRequestStatus( // } else {
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); // updateTamaraRequestStatus(
} // "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
// }
} else { } else {
checkPaymentStatus(appo); 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) { addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) { service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {
@ -943,7 +954,6 @@ class _BookSuccessState extends State<BookSuccess> {
getAppoQR(context) { getAppoQR(context) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(widget.patientShareResponse, context).then((res) { service.generateAppointmentQR(widget.patientShareResponse, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR']); navigateToQR(context, res['AppointmentQR']);
}).catchError((err) { }).catchError((err) {

@ -276,12 +276,13 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
try { try {
if (widget.selectedPaymentMethod == "TAMARA") { if (widget.selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
} else { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", // } else {
num.parse(widget.selectedInstallmentPlan), appo); // updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "",
} // num.parse(widget.selectedInstallmentPlan), appo);
// }
} else { } else {
checkPaymentStatus(appo); 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) { addAdvancedNumberRequestTamara(String advanceNumber, String paymentReference, String appointmentID, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) { service.addAdvancedNumberRequest(advanceNumber, paymentReference, appointmentID, context).then((res) {}).catchError((err) {

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

@ -133,6 +133,7 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).updateInsuranceManually, TranslationBase.of(context).updateInsuranceManually,
() { () {
Navigator.pop(context);
Navigator.push(context, FadePage(page: UpdateInsuranceManually())); Navigator.push(context, FadePage(page: UpdateInsuranceManually()));
}, },
textColor: Colors.white, 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/service/insurance_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/insurance/getInsuranceCompaniesModel.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/pages/medical/balance/new_text_Field.dart';
import 'package:diplomaticquarterapp/theme/colors.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/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -29,10 +32,13 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>(); InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
List<InsuranceCompaniesGetModel> insuranceCompaniesList = []; List<InsuranceCompaniesGetModel> insuranceCompaniesList = [];
List<InsuranceCompaniesSchemeModel> insuranceCompaniesSchemesList = [];
int _selectedInsuranceCompanyIndex = -1; int _selectedInsuranceCompanyIndex = -1;
int _selectedInsuranceCompanySchemeIndex = -1;
InsuranceCompaniesGetModel selectedInsuranceCompanyObj; InsuranceCompaniesGetModel selectedInsuranceCompanyObj;
InsuranceCompaniesSchemeModel selectedInsuranceCompaniesSchemesObj;
@override @override
void initState() { void initState() {
@ -121,31 +127,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
SizedBox(height: 12), SizedBox(height: 12),
InkWell( InkWell(
onTap: () { onTap: () {
List<RadioSelectionDialogModel> list = [ confirmSelectInsuranceCompanySchemeDialog();
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(() {});
},
),
);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
@ -156,7 +138,7 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
TranslationBase.of(context).insuranceClassName, selectedInsuranceCompaniesSchemesObj != null ? selectedInsuranceCompaniesSchemesObj.subCategoryDesc : TranslationBase.of(context).insuranceClassName,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
@ -175,11 +157,29 @@ class _UpdateInsuranceManuallyState extends State<UpdateInsuranceManually> {
bottomSheet: Container( bottomSheet: Container(
color: Theme.of(context).scaffoldBackgroundColor, color: Theme.of(context).scaffoldBackgroundColor,
padding: EdgeInsets.all(18), 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() { void confirmSelectInsuranceCompanyDialog() {
List<RadioSelectionDialogModel> list = [ List<RadioSelectionDialogModel> list = [
for (int i = 0; i < insuranceCompaniesList.length; i++) RadioSelectionDialogModel(insuranceCompaniesList[i].companyName, i), 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() { void getInsuranceCompanies() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceCompanies().then((value) { _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() { void getInsuranceScheme() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID, selectedInsuranceCompanyObj.companyID).then((value) { _insuranceCardService.getInsuranceSchemes(selectedInsuranceCompanyObj.projectID, selectedInsuranceCompanyObj.companyID).then((value) {
value.forEach((result) { value.forEach((result) {
insuranceCompaniesList.add(InsuranceCompaniesGetModel.fromJson(result)); insuranceCompaniesSchemesList.add(InsuranceCompaniesSchemeModel.fromJson(result));
}); });
GifLoaderDialogUtils.hideDialog(context); 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_home.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_scheduling/schedule_clinic_card.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/livecare_type_select.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/LiveCareInfoDialog.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
@ -356,12 +355,13 @@ class _clinic_listState extends State<ClinicList> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
try { try {
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
} else { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
updateTamaraRequestStatus( // } else {
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo); // updateTamaraRequestStatus(
} // "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
// }
} else { } else {
checkPaymentStatus(appo); 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) { updateTamaraRequestStatus(String responseMessage, String status, String clientRequestID, String tamaraOrderID, int selectedInstallments, AppoitmentAllHistoryResultList appo) {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

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

@ -922,6 +922,18 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); 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 { Future<Map> addAdvancedNumberRequest(String advanceNumber, String paymentReference, dynamic appointmentID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {

@ -2869,6 +2869,7 @@ class TranslationBase {
String get NFCNotSupported => localizedValues["NFCNotSupported"][locale.languageCode]; String get NFCNotSupported => localizedValues["NFCNotSupported"][locale.languageCode];
String get paymentOnly => localizedValues["paymentOnly"][locale.languageCode]; String get paymentOnly => localizedValues["paymentOnly"][locale.languageCode];
String get pendingOnly => localizedValues["pendingOnly"][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, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Image.asset("assets/images/new/payment/Mada.png", 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", 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", Image.asset("assets/images/new/payment/visa.png",
width: 50, height: 50), width: 40, height: 40),
Image.asset("assets/images/new/payment/Mastercard.png", 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", 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> 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 onExitCallback;
final Function onLoadStartCallback; final Function onLoadStartCallback;

Loading…
Cancel
Save