Implemented NPHIES check in WalkIn Appointment

dev_3.13.6_CR6750
haroon amjad 1 year ago
parent 6c98f9f94f
commit e4d0b93c9f

@ -627,6 +627,7 @@ class _BookConfirmState extends State<BookConfirm> {
// }
getWalkinAppointmentPatientShare() {
String errorMsg = "";
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
GifLoaderDialogUtils.showMyDialog(context);
appo.doctorTitle = widget.doctor.doctorTitle;
@ -641,13 +642,52 @@ class _BookConfirmState extends State<BookConfirm> {
widget.doctor.doctorID!,
)
.then((res) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res["OnlineCheckInAppointmentsWalkInModel"]);
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 {
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) {
GifLoaderDialogUtils.hideDialog(context);
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 {
GifLoaderDialogUtils.showMyDialog(
context,

@ -92,8 +92,8 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsListByName(String docName, int languageID, BuildContext context) async {
Map<String, dynamic> request;
late double lat;
late double long;
late double lat = 0.0;
late double long = 0.0;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));

Loading…
Cancel
Save