NPHIES Eligibility check implemented in LiveCare Schedule Appointment booking in ToDo list

merge-update-with-lab-changes
Haroon Amjad 1 year ago
parent 05abea2d53
commit fb13096f94

@ -1014,13 +1014,17 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Navigator.push(context, FadePage(page: InsuranceUpdate()));
}
void continueAsCash(AppoitmentAllHistoryResultList appo) {
void continueAsCash(AppoitmentAllHistoryResultList appo, bool isLiveCareAppointment) {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.convertPatientToCash(appo.projectID!).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res["MessageStatus"] == 1) {
getPatientShare(context, appo);
if (isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo);
} else {
getPatientShare(context, appo);
}
// getToDoCount();
} else {
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
@ -1080,11 +1084,40 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse!);
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
openPaymentDialog(appo, widget.patientShareResponse!);
} else {
if (isInsured && isEligible) {
openPaymentDialog(appo, widget.patientShareResponse!);
} 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(appo)});
dialog.showAlertDialog(context);
}
}
// openPaymentDialog(appo, widget.patientShareResponse!);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);

Loading…
Cancel
Save