|
|
|
@ -212,12 +212,13 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
|
|
|
|
|
elevation: 0,
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
|
|
|
|
|
if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
} else {
|
|
|
|
|
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
|
|
|
|
|
}
|
|
|
|
|
checkPHCReferralAppointmentStatus(widget.doctor);
|
|
|
|
|
// bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
|
|
|
|
|
// if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
|
// insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
// } else {
|
|
|
|
|
// insertAppointment(context, widget.doctor, widget.initialSlotDuration);
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)),
|
|
|
|
|
),
|
|
|
|
@ -227,6 +228,45 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkPHCReferralAppointmentStatus(DoctorList docObject) {
|
|
|
|
|
int languageID = projectViewModel.isArabic ? 1 : 2;
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
widget.service.checkPHCReferralAppointmentStatus(docObject.projectID, docObject.clinicID, languageID).then((res) async {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
if (res["PHCReferralAppointment"]["statusCode"] == 1) {
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
confirmMessage: res['SuccessMsg'],
|
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
|
okFunction: () async {
|
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
|
|
|
|
|
if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
} else {
|
|
|
|
|
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
cancelFunction: () => {});
|
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
|
} else {
|
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
|
|
|
|
|
if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
|
} else {
|
|
|
|
|
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res["ErrorEndUserMessage"]);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget showInfo(String title, String des) {
|
|
|
|
|
return Container(
|
|
|
|
|
child: Row(
|
|
|
|
@ -329,7 +369,8 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
AppoitmentAllHistoryResultList appo;
|
|
|
|
|
widget.service
|
|
|
|
|
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context, null, null, null, projectViewModel)
|
|
|
|
|
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context, null,
|
|
|
|
|
null, null, projectViewModel)
|
|
|
|
|
.then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
@ -385,7 +426,10 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
|
widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5);
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
AppoitmentAllHistoryResultList appo;
|
|
|
|
|
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context).then((res) {
|
|
|
|
|
widget.service
|
|
|
|
|
.insertLiveCareScheduleAppointment(
|
|
|
|
|
docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
|
print(res['AppointmentNo']);
|
|
|
|
|