updates for ER Online-Checkin

dev_3.13.6_Development
haroon amjad 2 years ago
parent 8f9882fc5c
commit 84159656b6

@ -20,10 +20,10 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:1022/';
// var BASE_URL = 'http://10.50.100.198:4422/'; // var BASE_URL = 'http://10.50.100.198:4422/';
// var BASE_URL = 'https://uat.hmgwebservices.com/'; var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -671,6 +671,8 @@ var AUTO_GENERATE_INVOICE_ER = 'Services/OUTPs.svc/Rest/Outp_AutoGenerateInvoice
var CHECK_IF_PATIENT_ARRIVED_ER_ONLINE_CHECKIN = 'Services/OUTPs.svc/Rest/IsPatientArrived'; var CHECK_IF_PATIENT_ARRIVED_ER_ONLINE_CHECKIN = 'Services/OUTPs.svc/Rest/IsPatientArrived';
var CHECK_PATIENT_ER_CLINIC_BALANCE_AMOUNT = 'Services/OUTPs.svc/Rest/getPatientAdvanceBalanceAmountByClinic';
var GET_PROJECT_FROM_NFC = 'Services/OUTPs.svc/Rest/GetProjectByNFC'; var GET_PROJECT_FROM_NFC = 'Services/OUTPs.svc/Rest/GetProjectByNFC';
//PAYFORT //PAYFORT

@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/ErService/EROnlineCheckIn/EROnlineCheckInBookAppointment.dart'; import 'package:diplomaticquarterapp/pages/ErService/EROnlineCheckIn/EROnlineCheckInBookAppointment.dart';
import 'package:diplomaticquarterapp/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart'; import 'package:diplomaticquarterapp/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -31,7 +33,8 @@ class _EROnlineCheckInHomePageState extends State<EROnlineCheckInHomePage> with
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
checkIfPatientHasArrived(); // checkIfPatientHasArrived();
checkPatientERClinicBalanceAmount();
}); });
super.initState(); super.initState();
} }
@ -283,6 +286,7 @@ class _EROnlineCheckInHomePageState extends State<EROnlineCheckInHomePage> with
showNfcReader(context, onNcfScan: (String nfcId) { showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
print(nfcId); print(nfcId);
getProjectIDFromNFC(nfcId, true);
// Navigator.push(context, FadePage(page: EROnlineCheckInPaymentDetails())); // Navigator.push(context, FadePage(page: EROnlineCheckInPaymentDetails()));
}); });
}, onCancel: () { }, onCancel: () {
@ -309,7 +313,7 @@ class _EROnlineCheckInHomePageState extends State<EROnlineCheckInHomePage> with
showNfcReader(context, onNcfScan: (String nfcId) { showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
print(nfcId); print(nfcId);
getProjectIDFromNFC(nfcId); getProjectIDFromNFC(nfcId, false);
}); });
}, onCancel: () { }, onCancel: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -340,7 +344,7 @@ class _EROnlineCheckInHomePageState extends State<EROnlineCheckInHomePage> with
); );
} }
void getProjectIDFromNFC(String nfcID) { void getProjectIDFromNFC(String nfcID, bool isArrived) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ClinicListService ancillaryOrdersService = new ClinicListService(); ClinicListService ancillaryOrdersService = new ClinicListService();
ancillaryOrdersService.getProjectIDFromNFC(nfcID).then((response) { ancillaryOrdersService.getProjectIDFromNFC(nfcID).then((response) {
@ -348,17 +352,21 @@ class _EROnlineCheckInHomePageState extends State<EROnlineCheckInHomePage> with
print(response["GetProjectByNFC"]); print(response["GetProjectByNFC"]);
int projectID = response['GetProjectByNFC'][0]["ProjectID"]; int projectID = response['GetProjectByNFC'][0]["ProjectID"];
String projectName = response['GetProjectByNFC'][0]["ProjectName"]; String projectName = response['GetProjectByNFC'][0]["ProjectName"];
GifLoaderDialogUtils.hideDialog(context); if (isArrived) {
Navigator.push( autoGenerateInvoiceER(projectID);
context, } else {
FadePage( GifLoaderDialogUtils.hideDialog(context);
page: EROnlineCheckInPaymentDetails( Navigator.push(
projectID: projectID, context,
isERBookAppointment: false, FadePage(
projectName: projectName, page: EROnlineCheckInPaymentDetails(
projectID: projectID,
isERBookAppointment: false,
projectName: projectName,
),
), ),
), );
); }
} else { } else {
AppToast.showErrorToast(message: "Invalid NFC Card Scanned."); AppToast.showErrorToast(message: "Invalid NFC Card Scanned.");
} }
@ -382,4 +390,59 @@ class _EROnlineCheckInHomePageState extends State<EROnlineCheckInHomePage> with
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }
autoGenerateInvoiceER(int projectID) {
DoctorsListService service = new DoctorsListService();
service.autoGenerateInvoiceERClinicWithNoPaymentDetails(projectID, true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
_showMyDialog("Your online Check-In in the ER clinic has been done successfully.", context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
Future<void> _showMyDialog(String message, BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Alert'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(message),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
},
),
],
);
},
);
}
void checkPatientERClinicBalanceAmount() {
GifLoaderDialogUtils.showMyDialog(context);
ClinicListService ancillaryOrdersService = new ClinicListService();
ancillaryOrdersService.checkPatientERClinicBalanceAmount(10).then((response) {
print(response["BalanceAmount"]);
isPatientArrived = response['BalanceAmount'] > 0;
GifLoaderDialogUtils.hideDialog(context);
// erOnlineCheckInPaymentDetailsResponse = EROnlineCheckInPaymentDetailsResponse.fromJson(response["ResponsePatientShare"]);
setState(() {});
}).catchError((err) {
AppToast.showErrorToast(message: err.toString());
GifLoaderDialogUtils.hideDialog(context);
});
}
} }

@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Clinics/EROnlineCheckInPaymentDetailsResponse.dart'; import 'package:diplomaticquarterapp/models/Clinics/EROnlineCheckInPaymentDetailsResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
@ -452,7 +453,8 @@ class _EROnlineCheckInPaymentDetailsState extends State<EROnlineCheckInPaymentDe
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
createAdvancePayment(res, appo); // createAdvancePayment(res, appo);
ER_createAdvancePayment(res, appo);
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['Response_Message'], localContext: context); AppToast.showErrorToast(message: res['Response_Message'], localContext: context);
@ -464,6 +466,28 @@ class _EROnlineCheckInPaymentDetailsState extends State<EROnlineCheckInPaymentDe
}); });
} }
ER_createAdvancePayment(payment_res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
// GifLoaderDialogUtils.showMyDialog(context);
String paymentReference = payment_res['Fort_id'].toString();
service.ER_createAdvancePayment(appo, widget.projectID.toString(), payment_res['Amount'], payment_res['Fort_id'], payment_res['PaymentMethod'], context).then((res) {
addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, widget.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
0,
appo,
payment_res);
// GifLoaderDialogUtils.hideDialog(context);
// ER_InsertEROnlinePaymentDetails(payment_res, appo);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
print(err);
});
}
createAdvancePayment(paymentRes, AppoitmentAllHistoryResultList appo) { createAdvancePayment(paymentRes, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = paymentRes['Fort_id'].toString(); String paymentReference = paymentRes['Fort_id'].toString();
@ -508,6 +532,7 @@ class _EROnlineCheckInPaymentDetailsState extends State<EROnlineCheckInPaymentDe
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.autoGenerateInvoiceERClinic(widget.projectID, 4, res['Fort_id'], res['Amount'], res['PaymentMethod'], res['CardNumber'], res['Merchant_Reference'], res['RRN'], true).then((res) { service.autoGenerateInvoiceERClinic(widget.projectID, 4, res['Fort_id'], res['Amount'], res['PaymentMethod'], res['CardNumber'], res['Merchant_Reference'], res['RRN'], true).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
_showMyDialog("Your online Check-In in the ER clinic has been done successfully.", context);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -515,6 +540,34 @@ class _EROnlineCheckInPaymentDetailsState extends State<EROnlineCheckInPaymentDe
}); });
} }
Future<void> _showMyDialog(String message, BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Alert'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(message),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
},
),
],
);
},
);
}
getEROnlineCheckInPaymentDetails() { getEROnlineCheckInPaymentDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ClinicListService ancillaryOrdersService = new ClinicListService(); ClinicListService ancillaryOrdersService = new ClinicListService();

@ -52,7 +52,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
hmgServices.add(HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); hmgServices.add(HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin));
hmgServices.add(HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin)); hmgServices.add(HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.svg", isLogin));
hmgServices.add(HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).onlineCheckIn, "assets/images/new/emergency.svg", isLogin));
hmgServices.add(HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin));
hmgServices.add(HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); hmgServices.add(HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin));
hmgServices.add(HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin));

@ -28,9 +28,9 @@ class DoctorsListService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
double? lat; double? lat;
double? long; double? long;
String? deviceToken; String? deviceToken;
String? tokenID; String? tokenID;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
@ -1765,7 +1765,33 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> autoGenerateInvoiceERClinic(int projectID, int paymentMethod, String paymentReferenceNo, num amount, String cardType, String cardNumber, String orderID, String rrn, bool isAdvanceAvailable) async { Future<Map> autoGenerateInvoiceERClinicWithNoPaymentDetails(int projectID, bool isAdvanceAvailable) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
"ClinicID": "10",
// "PaymentMethod": cardType,
// "PaymentReferenceNo": paymentReferenceNo,
// "PaymentAmount": amount,
// "CardType": cardType,
// "CardNumber": cardNumber,
// "OrderId": orderID,
"MemberID": 102,
// "RRN": rrn,
"IsAdvanceAvailable": isAdvanceAvailable
};
dynamic localRes;
await baseAppClient.post(AUTO_GENERATE_INVOICE_ER, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> autoGenerateInvoiceERClinic(
int projectID, int paymentMethod, String paymentReferenceNo, num amount, String cardType, String cardNumber, String orderID, String rrn, bool isAdvanceAvailable) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"ProjectID": projectID, "ProjectID": projectID,

@ -461,6 +461,17 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> checkPatientERClinicBalanceAmount(int clinicID) async {
Map<String, dynamic> request = {"ClinicID": clinicID};
dynamic localRes;
await baseAppClient.post(CHECK_PATIENT_ER_CLINIC_BALANCE_AMOUNT, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getProjectIDFromNFC(String nfcID) async { Future<Map> getProjectIDFromNFC(String nfcID) async {
Map<String, dynamic> request = {"nFC_Code": nfcID}; Map<String, dynamic> request = {"nFC_Code": nfcID};
dynamic localRes; dynamic localRes;

@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS
@ -343,7 +343,7 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PROJECT_ID_VALUE', projId); form = form.replaceFirst('PROJECT_ID_VALUE', projId);
form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod); form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod);
form = form.replaceFirst('LANG_VALUE', currentLanguageID); form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamaralive/Home/Checkout"); form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamara/Home/Checkout");
form = form.replaceFirst('INSTALLMENTS_VALUE', installments); form = form.replaceFirst('INSTALLMENTS_VALUE', installments);
form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo!); form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo!);

Loading…
Cancel
Save