|
|
|
@ -627,6 +627,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
getWalkinAppointmentPatientShare() {
|
|
|
|
getWalkinAppointmentPatientShare() {
|
|
|
|
|
|
|
|
String errorMsg = "";
|
|
|
|
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
|
|
|
|
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
appo.doctorTitle = widget.doctor.doctorTitle;
|
|
|
|
appo.doctorTitle = widget.doctor.doctorTitle;
|
|
|
|
@ -641,13 +642,52 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
widget.doctor.doctorID!,
|
|
|
|
widget.doctor.doctorID!,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.then((res) {
|
|
|
|
.then((res) {
|
|
|
|
|
|
|
|
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res["OnlineCheckInAppointmentsWalkInModel"]);
|
|
|
|
widget.patientShareResponse = new PatientShareResponse.fromJson(res["OnlineCheckInAppointmentsWalkInModel"]);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
if (widget.patientShareResponse.patientShareWithTax != 0 || widget.patientShareResponse.patientShareWithTax != 0.0) {
|
|
|
|
|
|
|
|
openPaymentDialog(appo, widget.patientShareResponse!);
|
|
|
|
isInsured = res["IsInsured"];
|
|
|
|
|
|
|
|
isEligible = res["IsEligible"];
|
|
|
|
|
|
|
|
isCash = res["IsCash"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isCash) {
|
|
|
|
|
|
|
|
if (widget.patientShareResponse.patientShareWithTax != 0 || widget.patientShareResponse.patientShareWithTax != 0.0) {
|
|
|
|
|
|
|
|
openPaymentDialog(appo, widget.patientShareResponse!);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
insertWalkInAppointment(context, widget.doctor, widget.initialSlotDuration, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
insertWalkInAppointment(context, widget.doctor, widget.initialSlotDuration, null);
|
|
|
|
if (isInsured && isEligible) {
|
|
|
|
|
|
|
|
if (widget.patientShareResponse.patientShareWithTax != 0 || widget.patientShareResponse.patientShareWithTax != 0.0) {
|
|
|
|
|
|
|
|
openPaymentDialog(appo, widget.patientShareResponse!);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
insertWalkInAppointment(context, widget.doctor, widget.initialSlotDuration, null);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} 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: () => {continueAsCashForWalkIn(widget.doctor.projectID!)});
|
|
|
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// widget.patientShareResponse = new PatientShareResponse.fromJson(res["OnlineCheckInAppointmentsWalkInModel"]);
|
|
|
|
|
|
|
|
// GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
// if (widget.patientShareResponse.patientShareWithTax != 0 || widget.patientShareResponse.patientShareWithTax != 0.0) {
|
|
|
|
|
|
|
|
// openPaymentDialog(appo, widget.patientShareResponse!);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// insertWalkInAppointment(context, widget.doctor, widget.initialSlotDuration, null);
|
|
|
|
|
|
|
|
// }
|
|
|
|
}).catchError((err) {
|
|
|
|
}).catchError((err) {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
@ -723,6 +763,22 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void continueAsCashForWalkIn(int projectID) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
|
|
|
widget.service.convertPatientToCash(projectID).then((res) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
|
|
|
getWalkinAppointmentPatientShare();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
|
|
|
|
print(err);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
insertWalkInAppointment(context, DoctorList docObject, int initialSlotDuration, paymentRes) async {
|
|
|
|
insertWalkInAppointment(context, DoctorList docObject, int initialSlotDuration, paymentRes) async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
GifLoaderDialogUtils.showMyDialog(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
|