|
|
|
@ -717,7 +717,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
okText: "Update insurance",
|
|
|
|
okText: "Update insurance",
|
|
|
|
cancelText: "Continue as cash",
|
|
|
|
cancelText: "Continue as cash",
|
|
|
|
okFunction: () => {openUpdateInsurance()},
|
|
|
|
okFunction: () => {openUpdateInsurance()},
|
|
|
|
cancelFunction: () => {continueAsCash(docObject, appointmentNo)});
|
|
|
|
cancelFunction: () => {continueAsCash(docObject, appointmentNo, false)});
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catchError((err) {
|
|
|
|
}).catchError((err) {
|
|
|
|
@ -731,12 +731,16 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
Navigator.push(context, FadePage(page: InsuranceUpdate()));
|
|
|
|
Navigator.push(context, FadePage(page: InsuranceUpdate()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void continueAsCash(DoctorList docObject, String appointmentNo) {
|
|
|
|
void continueAsCash(DoctorList docObject, String appointmentNo, bool isLiveCareAppointment) {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
widget.service.convertPatientToCash(docObject.projectID!).then((res) {
|
|
|
|
widget.service.convertPatientToCash(docObject.projectID!).then((res) {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject);
|
|
|
|
if(isLiveCareAppointment) {
|
|
|
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, appointmentNo, docObject!.clinicID!, docObject.projectID!, docObject);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject);
|
|
|
|
|
|
|
|
}
|
|
|
|
getToDoCount();
|
|
|
|
getToDoCount();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
|
|
|
|
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
|
|
|
|
@ -1046,7 +1050,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
okText: TranslationBase.of(context).updateInsuranceText,
|
|
|
|
okText: TranslationBase.of(context).updateInsuranceText,
|
|
|
|
cancelText: TranslationBase.of(context).continueCash,
|
|
|
|
cancelText: TranslationBase.of(context).continueCash,
|
|
|
|
okFunction: () => {openUpdateInsurance()},
|
|
|
|
okFunction: () => {openUpdateInsurance()},
|
|
|
|
cancelFunction: () => {continueAsCash(docObject, appointmentNo)});
|
|
|
|
cancelFunction: () => {continueAsCash(docObject, appointmentNo, false)});
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1061,10 +1065,40 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
|
|
|
|
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
|
|
|
|
|
|
|
|
String errorMsg = "";
|
|
|
|
|
|
|
|
|
|
|
|
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
|
|
|
|
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
navigateToBookSuccess(context, docObject, widget.patientShareResponse, false);
|
|
|
|
|
|
|
|
|
|
|
|
isInsured = res["IsInsured"];
|
|
|
|
|
|
|
|
isEligible = res["IsEligible"];
|
|
|
|
|
|
|
|
isCash = res["IsCash"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isCash) {
|
|
|
|
|
|
|
|
navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (isInsured && isEligible) {
|
|
|
|
|
|
|
|
navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (isInsured && !isEligible) {
|
|
|
|
|
|
|
|
errorMsg = TranslationBase.of(context).invalidEligibility;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
errorMsg = TranslationBase.of(context).invalidInsurance;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
|
|
|
isDissmissable: false,
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
confirmMessage: errorMsg,
|
|
|
|
|
|
|
|
okText: TranslationBase.of(context).updateInsuranceText,
|
|
|
|
|
|
|
|
cancelText: TranslationBase.of(context).continueCash,
|
|
|
|
|
|
|
|
okFunction: () => {openUpdateInsurance()},
|
|
|
|
|
|
|
|
cancelFunction: () => {continueAsCash(docObject, appointmentNo, true)});
|
|
|
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// navigateToBookSuccess(context, docObject, widget.patientShareResponse, false);
|
|
|
|
}).catchError((err) {
|
|
|
|
}).catchError((err) {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
|