|
|
|
@ -7,6 +7,9 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/header_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/UpdateInsuranceManually.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/routes.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
|
|
|
@ -271,7 +274,51 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
insertAppointment(context, DoctorList docObject, int initialSlotDuration) async{
|
|
|
|
|
checkPatientNphiesEligibility(DoctorList docObject, String appointmentNo, BuildContext context) {
|
|
|
|
|
widget.service.checkPatientNphiesEligibility(docObject.projectID).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res["isNphiesMatchedWithVida"]) {
|
|
|
|
|
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
|
|
|
|
|
getToDoCount();
|
|
|
|
|
} else {
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
isDissmissable: false,
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: res['ErrorEndUserMessage'],
|
|
|
|
|
okText: "Update insurance",
|
|
|
|
|
cancelText: "Continue as cash",
|
|
|
|
|
okFunction: () => {openUpdateInsurance()},
|
|
|
|
|
cancelFunction: () => {continueAsCash(docObject, appointmentNo)});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void openUpdateInsurance() {
|
|
|
|
|
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
|
|
|
|
|
Navigator.push(context, FadePage(page: InsuranceUpdate()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void continueAsCash(DoctorList docObject, String appointmentNo) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
widget.service.convertPatientToCash(docObject.projectID).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
getPatientShare(context, appointmentNo, docObject.clinicID, docObject.projectID, docObject);
|
|
|
|
|
getToDoCount();
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
insertAppointment(context, DoctorList docObject, int initialSlotDuration) async {
|
|
|
|
|
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
|
|
|
|
|
String logs = await sharedPref.getString('selectedLogSlots');
|
|
|
|
|
List<dynamic> decodedLogs = json.decode(logs);
|
|
|
|
@ -284,14 +331,13 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
|
|
|
|
|
|
Future.delayed(new Duration(milliseconds: 500), () {
|
|
|
|
|
getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
|
|
|
|
|
getToDoCount();
|
|
|
|
|
checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs,res['AppointmentNo'], context).then((res) {
|
|
|
|
|
widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
print("Logs Saved");
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
print("Error Saving logs");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|