|
|
|
@ -98,7 +98,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
widget.doctor.projectName!,
|
|
|
|
widget.doctor.projectName!,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
widget.doctor.nationalityFlagURL!,
|
|
|
|
widget.doctor.nationalityFlagURL ?? "",
|
|
|
|
widget.doctor.doctorRate,
|
|
|
|
widget.doctor.doctorRate,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
widget.doctor.noOfPatientsRate,
|
|
|
|
widget.doctor.noOfPatientsRate,
|
|
|
|
@ -212,7 +212,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
|
|
|
|
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
|
|
|
|
elevation: 0,
|
|
|
|
elevation: 0,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
|
|
|
|
if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -257,12 +257,12 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async {
|
|
|
|
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async {
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
ConfirmDialog.closeAlertDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
DoctorsListService service = DoctorsListService();
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT);
|
|
|
|
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
|
|
|
|
service.cancelAppointment(appo, context, isReschedule: true).then((res) {
|
|
|
|
service.cancelAppointment(appo, context, isReschedule: true).then((res) {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
Future.delayed(new Duration(milliseconds: 1500), () async {
|
|
|
|
Future.delayed(Duration(milliseconds: 1500), () async {
|
|
|
|
if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
if (isLiveCareSchedule != null && isLiveCareSchedule) {
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
insertLiveCareScheduledAppointment(context, widget.doctor);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -285,7 +285,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject);
|
|
|
|
getPatientShare(context, appointmentNo, docObject.clinicID!, docObject.projectID!, docObject);
|
|
|
|
getToDoCount();
|
|
|
|
getToDoCount();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
ConfirmDialog dialog = ConfirmDialog(
|
|
|
|
isDissmissable: false,
|
|
|
|
isDissmissable: false,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
confirmMessage: res['ErrorEndUserMessage'],
|
|
|
|
confirmMessage: res['ErrorEndUserMessage'],
|
|
|
|
@ -334,8 +334,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
|
|
|
|
|
|
|
|
Future.delayed(new Duration(milliseconds: 500), () {
|
|
|
|
Future.delayed(Duration(milliseconds: 500), () {
|
|
|
|
|
|
|
|
|
|
|
|
// checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
|
|
|
|
// checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
|
|
|
|
getToDoCount();
|
|
|
|
getToDoCount();
|
|
|
|
getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject);
|
|
|
|
getPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject);
|
|
|
|
@ -350,7 +349,7 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
|
|
|
|
projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
appo = new AppoitmentAllHistoryResultList();
|
|
|
|
appo = AppoitmentAllHistoryResultList();
|
|
|
|
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
|
|
|
|
appo.appointmentNo = res['SameClinicApptList'][0]['AppointmentNo'];
|
|
|
|
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
|
|
|
|
appo.clinicID = res['SameClinicApptList'][0]['DoctorID'];
|
|
|
|
appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
|
|
|
|
appo.projectID = res['SameClinicApptList'][0]['ProjectID'];
|
|
|
|
@ -362,13 +361,14 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
appo.originalProjectID = 0;
|
|
|
|
appo.originalProjectID = 0;
|
|
|
|
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
|
|
|
|
appo.appointmentDate = res['SameClinicApptList'][0]['AppointmentDate'];
|
|
|
|
|
|
|
|
|
|
|
|
ConfirmDialog dialog = new ConfirmDialog(
|
|
|
|
ConfirmDialog dialog = ConfirmDialog(
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
confirmMessage: res['ErrorEndUserMessage'],
|
|
|
|
confirmMessage: res['ErrorEndUserMessage'],
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
okText: TranslationBase.of(context).confirm,
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
cancelText: TranslationBase.of(context).cancel_nocaps,
|
|
|
|
okFunction: () => {cancelAppointment(docObject, appo, context)},
|
|
|
|
okFunction: () => {cancelAppointment(docObject, appo, context)},
|
|
|
|
cancelFunction: () => {});
|
|
|
|
cancelFunction: () => {},
|
|
|
|
|
|
|
|
);
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
dialog.showAlertDialog(context);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catchError((err) {
|
|
|
|
}).catchError((err) {
|
|
|
|
@ -382,10 +382,12 @@ class _BookConfirmState extends State<BookConfirm> {
|
|
|
|
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
|
|
|
|
insertLiveCareScheduledAppointment(context, DoctorList docObject) {
|
|
|
|
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
|
|
|
|
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
|
|
|
|
widget.selectedDate = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[0];
|
|
|
|
widget.selectedDate = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[0];
|
|
|
|
widget.selectedTime = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5);
|
|
|
|
widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
AppoitmentAllHistoryResultList appo;
|
|
|
|
AppoitmentAllHistoryResultList appo;
|
|
|
|
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) {
|
|
|
|
widget.service
|
|
|
|
|
|
|
|
.insertLiveCareScheduleAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, context)
|
|
|
|
|
|
|
|
.then((res) {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
|
|
|
|
print(res['AppointmentNo']);
|
|
|
|
print(res['AppointmentNo']);
|
|
|
|
|