Added immediate patient insurance update API

master
Haroon Amjad 8 hours ago
parent 6fe8c5039f
commit a9f1f268ad

@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.201.204.103/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -706,6 +706,8 @@ var GET_OFFER_DETAILS = 'Services/Authentication.svc/REST/GetNDOfferData';
var GET_PRESCRIPTION_INSTRUCTIONS_PDF = 'Services/ChatBot_Service.svc/REST/Chatbot_SendMedicationInstructionByWhatsApp';
var SEND_PATIENT_IMMEDIATE_UPDATE_INSURANCE_REQUEST = 'Services/OUTPs.svc/REST/PatientCompanyUpdate';
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";

@ -189,8 +189,8 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232
body['PatientID'] = 4768663; //4609100
body['TokenID'] = "@dm!n";
// body['PatientID'] = 4768663; //4609100
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574
// Mobile no.: 0502303285

@ -303,7 +303,7 @@ class _BookConfirmState extends State<BookConfirm> {
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
okFunction: () => {openUpdateInsuranceForWalkIn()},
cancelFunction: () => {continueAsCashForWalkIn(widget.doctor.projectID!)});
dialog.showAlertDialog(context);
}
@ -717,7 +717,7 @@ class _BookConfirmState extends State<BookConfirm> {
confirmMessage: res['ErrorEndUserMessage'],
okText: "Update insurance",
cancelText: "Continue as cash",
okFunction: () => {openUpdateInsurance()},
okFunction: () => {openUpdateInsurance(docObject, appointmentNo, false)},
cancelFunction: () => {continueAsCash(docObject, appointmentNo, false)});
dialog.showAlertDialog(context);
}
@ -727,9 +727,28 @@ class _BookConfirmState extends State<BookConfirm> {
});
}
void openUpdateInsurance() {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
void openUpdateInsurance(DoctorList docObject, String appointmentNo, bool isLiveCareAppointment) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.sendPatientUpdateRequest().then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
if (isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, appointmentNo, docObject!.clinicID!, docObject.projectID!, docObject);
} else {
getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject);
}
getToDoCount();
} else {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
});
}
void continueAsCash(DoctorList docObject, String appointmentNo, bool isLiveCareAppointment) {
@ -753,6 +772,29 @@ class _BookConfirmState extends State<BookConfirm> {
});
}
void openUpdateInsuranceForWalkIn() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.sendPatientUpdateRequest().then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
if (res["MessageStatus"] == 1) {
getWalkinAppointmentPatientShare();
} else {
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
}
} else {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
});
}
void continueAsCashForWalkIn(int projectID) {
GifLoaderDialogUtils.showMyDialog(context);
widget.service.convertPatientToCash(projectID).then((res) {
@ -893,6 +935,7 @@ class _BookConfirmState extends State<BookConfirm> {
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
}
}).onError((error, stackTrace) {
GifLoaderDialogUtils.hideDialog(context);
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
});
}
@ -913,6 +956,7 @@ class _BookConfirmState extends State<BookConfirm> {
Future.delayed(Duration(milliseconds: 500), () {
// checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
GifLoaderDialogUtils.hideDialog(context);
getToDoCount();
getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject);
});
@ -1025,6 +1069,7 @@ class _BookConfirmState extends State<BookConfirm> {
String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
widget.service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;
if (res['OnlineCheckInAppointments'].length != 0) {
@ -1052,8 +1097,8 @@ class _BookConfirmState extends State<BookConfirm> {
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
cancelFunction: () => {continueAsCash(docObject, appointmentNo, false)});
okFunction: () => {Navigator.pop(context), openUpdateInsurance(docObject, appointmentNo, widget.patientShareResponse.isLiveCareAppointment!)},
cancelFunction: () => {Navigator.pop(context), continueAsCash(docObject, appointmentNo, widget.patientShareResponse.isLiveCareAppointment!)});
dialog.showAlertDialog(context);
}
}
@ -1095,7 +1140,7 @@ class _BookConfirmState extends State<BookConfirm> {
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
okFunction: () => {openUpdateInsurance(docObject, appointmentNo, true)},
cancelFunction: () => {continueAsCash(docObject, appointmentNo, true)});
dialog.showAlertDialog(context);
}

@ -6,6 +6,7 @@ import 'package:hmg_patient_app/config/shared_pref_kay.dart';
import 'package:hmg_patient_app/core/enum/PayfortEnums.dart';
import 'package:hmg_patient_app/core/model/ImagesInfo.dart';
import 'package:hmg_patient_app/core/viewModels/project_view_model.dart';
import 'package:hmg_patient_app/locator.dart';
import 'package:hmg_patient_app/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:hmg_patient_app/models/Appointments/DoctorListResponse.dart';
import 'package:hmg_patient_app/models/Appointments/OBGyneProcedureListResponse.dart';
@ -34,6 +35,7 @@ import 'package:hmg_patient_app/uitl/app_shared_preferences.dart';
import 'package:hmg_patient_app/uitl/app_toast.dart';
import 'package:hmg_patient_app/uitl/date_uitl.dart';
import 'package:hmg_patient_app/uitl/gif_loader_dialog_utils.dart';
import 'package:hmg_patient_app/uitl/navigation_service.dart';
import 'package:hmg_patient_app/uitl/penguin_method_channel.dart';
import 'package:hmg_patient_app/uitl/translations_delegate_base.dart';
import 'package:hmg_patient_app/uitl/utils.dart';
@ -967,7 +969,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
GifLoaderDialogUtils.hideDialog(locator<NavigationService>().navigatorKey.currentContext ?? context);
err != null ?? AppToast.showErrorToast(message: err);
});
getToDoCount();
@ -1000,8 +1002,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
confirmMessage: res['ErrorEndUserMessage'],
okText: "Update insurance",
cancelText: "Continue as cash",
okFunction: () => {openUpdateInsurance()},
cancelFunction: () => {continueAsCash(appo, false)});
okFunction: () => {openUpdateInsurance(appo, appo.isLiveCareAppointment!)},
cancelFunction: () => {continueAsCash(appo, appo.isLiveCareAppointment!)});
dialog.showAlertDialog(context);
}
}).catchError((err) {
@ -1010,9 +1012,28 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
});
}
void openUpdateInsurance() {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
void openUpdateInsurance(AppoitmentAllHistoryResultList appo, bool isLiveCareAppointment) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.sendPatientUpdateRequest().then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
if (isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo);
} else {
getPatientShare(context, appo);
}
// getToDoCount();
} else {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
});
}
void continueAsCash(AppoitmentAllHistoryResultList appo, bool isLiveCareAppointment) {
@ -1071,8 +1092,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
cancelFunction: () => {continueAsCash(appo, false)});
okFunction: () => {openUpdateInsurance(appo, appo.isLiveCareAppointment!)},
cancelFunction: () => {continueAsCash(appo, appo.isLiveCareAppointment!)});
dialog.showAlertDialog(context);
}
}
@ -1112,7 +1133,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
okFunction: () => {openUpdateInsurance(appo, appo.isLiveCareAppointment!)},
cancelFunction: () => {continueAsCash(appo, true)});
dialog.showAlertDialog(context);
}

@ -239,8 +239,25 @@ class _clinic_listState extends State<ClinicList> {
}
void openUpdateInsurance() {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.sendPatientUpdateRequest().then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
startLiveCare();
} else {
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
});
// Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
// Navigator.push(context, FadePage(page: InsuranceUpdate()));
}
showLiveCarePaymentDialog(GetERAppointmentFeesList getERAppointmentFeesList, int waitingTime) {

@ -1931,6 +1931,19 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> sendPatientUpdateRequest() async {
Map<String, dynamic> request;
request = {};
dynamic localRes;
await baseAppClient.post(SEND_PATIENT_IMMEDIATE_UPDATE_INSURANCE_REQUEST, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getAncillaryOrders() async {
Map<String, dynamic> body = Map();

Loading…
Cancel
Save