Derma package appointment booking fixes

dev_v_3.13.6_CR_6804
haroon amjad 1 year ago
parent 554548bc9a
commit 66ec7b5ca4

@ -1976,8 +1976,9 @@ const Map localizedValues = {
"selectHospitalBloodDonation": {"en": "Please select the hospital you want to book an appointment with: ", "ar": "يرجى اختيار المستشفى الذي تريد حجز موعد معه:"},
"wecare": {"en": "We Care", "ar": "نحن نهتم"},
"myinstructions": {"en": "My Instructions", "ar": "تعليماتي"},
"existingPackage":{"en":"There is an existing package","ar":"هناك حزمة موجودة"},
"continueOrbookNew":{"en":"do you want to continue with that package? or book new appointment","ar":"هل تريد الاستمرار في هذه الباقة؟ أو حجز موعد جديد"},
"existingPackage":{"en":"This patient has a package under this clinic,","ar":"هذا المريض لديه حزمة تحت هذه العيادة،"},
"continueOrbookNew":{"en":"do you want to continue with that package? or book new appointment?","ar":"هل تريد الاستمرار في هذه الباقة؟ أو حجز موعد جديد؟"},
"newAppointment":{"en":"New Appointment","ar":"موعد جديد"},
"proceedPackage":{"en":"Proceed with package","ar":"المضي قدما في الحزمة"},
};

@ -212,13 +212,11 @@ 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) ?? false;
bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false;
if (isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
checkPatientHasDermaPackage(
widget.doctor, projectViewModel.user.patientID!);
checkPatientHasDermaPackage(widget.doctor, projectViewModel.user.patientID!);
}
},
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)),
@ -256,7 +254,7 @@ class _BookConfirmState extends State<BookConfirm> {
);
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context, {int? invoiceNumber, int? lineItemNo}) async {
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context, {int? invoiceNumber, int? lineItemNo}) async {
ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
DoctorsListService service = new DoctorsListService();
@ -268,7 +266,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (isLiveCareSchedule != null && isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor, widget.initialSlotDuration, invoiceNumber: invoiceNumber, lineItemNo: lineItemNo);
insertAppointment(widget.doctor, widget.initialSlotDuration, invoiceNumber: invoiceNumber, lineItemNo: lineItemNo);
}
});
} else {
@ -322,55 +320,53 @@ class _BookConfirmState extends State<BookConfirm> {
print(err);
});
}
checkPatientHasDermaPackage(DoctorList doctor, int patientID){
checkPatientHasDermaPackage(DoctorList doctor, int patientID) {
GifLoaderDialogUtils.showMyDialog(context);
widget.service
// .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel)
.checkPatientHasDermaPackage(patientID!, doctor.clinicID!, doctor.projectID!, doctor.doctorID!, projectViewModel.isArabic ? 1 : 2, context,
)
.checkPatientHasDermaPackage(
patientID!,
doctor.clinicID!,
doctor.projectID!,
doctor.doctorID!,
projectViewModel.isArabic ? 1 : 2,
context,
)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1 && res['PatientPackageComponent']['Message'] =='Success') {
if (res['MessageStatus'] == 1 && res['PatientPackageComponent']['Message'] == 'Success') {
PatientPackageComponent package = PatientPackageComponent.fromJson(res['PatientPackageComponent']);
ConfirmDialog dialog = ConfirmDialog(
context: context,
confirmMessage: "${TranslationBase.of(context).existingPackage} , ${package.patientPackageComponents![0].procedureName} , ${ TranslationBase.of(context).continueOrbookNew}",
okText: TranslationBase.of(context).continues,
cancelText:TranslationBase.of(context).newAppointment,
confirmMessage: "${TranslationBase.of(context).existingPackage} ${package.patientPackageComponents![0].procedureName}, ${TranslationBase.of(context).continueOrbookNew}",
okText: TranslationBase.of(context).proceedPackage,
cancelText: TranslationBase.of(context).newAppointment,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
insertAppointment(
context, widget.doctor, widget.initialSlotDuration, invoiceNumber: package.patientPackageComponents![0].invoiceNo, lineItemNo:package.patientPackageComponents![0].lineItemNo ) },
cancelFunction: () => {
ConfirmDialog.closeAlertDialog(context),
insertAppointment(
context, widget.doctor, widget.initialSlotDuration)
ConfirmDialog.closeAlertDialog(context),
insertAppointment(widget.doctor, widget.initialSlotDuration, invoiceNumber: package.patientPackageComponents![0].invoiceNo, lineItemNo: package.patientPackageComponents![0].lineItemNo)
},
cancelFunction: () => {insertAppointment(widget.doctor, widget.initialSlotDuration)},
);
dialog.showAlertDialog(context);
} else{
insertAppointment(
context, widget.doctor, widget.initialSlotDuration);
} else {
insertAppointment(widget.doctor, widget.initialSlotDuration);
}
}).onError((error, stackTrace) {
insertAppointment(
context, widget.doctor, widget.initialSlotDuration);
insertAppointment(widget.doctor, widget.initialSlotDuration);
});
}
insertAppointment(context, DoctorList docObject, int initialSlotDuration, {int? invoiceNumber, int? lineItemNo} ) async {
insertAppointment(DoctorList docObject, int initialSlotDuration, {int? invoiceNumber, int? lineItemNo}) async {
final timeSlot = DocAvailableAppointments.selectedAppoDateTime;
String logs = await sharedPref.getString('selectedLogSlots');
List<dynamic> decodedLogs = json.decode(logs);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false);
GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: true);
AppoitmentAllHistoryResultList appo;
widget.service
// .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, 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, invoiceNumber, lineItemNo!)
null, null, null, projectViewModel, invoiceNumber, lineItemNo)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -407,14 +403,14 @@ class _BookConfirmState extends State<BookConfirm> {
confirmMessage: res['ErrorEndUserMessage'],
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {cancelAppointment(docObject, appo, context, invoiceNumber: invoiceNumber, lineItemNo: lineItemNo!)},
okFunction: () => {cancelAppointment(docObject, appo, context, invoiceNumber: invoiceNumber, lineItemNo: lineItemNo)},
cancelFunction: () => {},
);
dialog.showAlertDialog(context);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
AppToast.showErrorToast(message: err, localContext: context);
});
projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'regular', dateTime: timeSlot!, doctor: widget.doctor);
}

@ -28,9 +28,9 @@ class DoctorsListService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
double? lat;
double? long;
String? deviceToken;
double? lat;
double? long;
String? deviceToken;
String? tokenID;
List<LaserBodyPart> selectedBodyPartList = [];
@ -335,7 +335,7 @@ class DoctorsListService extends BaseService {
}
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context,
[String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel, int? invoiceNumber, int? lineItemNo]) async {
[String? procedureID, num? testTypeEnum, num? testProcedureEnum, ProjectViewModel? projectViewModel, int? invoiceNumber, int? lineItemNo]) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -375,8 +375,8 @@ class DoctorsListService extends BaseService {
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType,
"InvoiceNo":invoiceNumber,
"LineItemNo":lineItemNo,
"InvoiceNo": invoiceNumber,
"LineItemNo": lineItemNo,
// "TokenID":"@dm!n"
};
@ -512,8 +512,6 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> checkPatientHasDermaPackage(int patientID, int clinicID, int projectID, int doctorID, int languageID, BuildContext context) async {
Map<String, dynamic> request;
@ -521,7 +519,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
request = { "PatientID":patientID, "ClinicID":clinicID, "ProjectID": projectID, "LanguageID": languageID};
request = {"PatientID": patientID, "ClinicID": clinicID, "ProjectID": projectID, "LanguageID": languageID};
//request = { "PatientID":4768732, "ClinicID":1, "ProjectID": 15, "LanguageID": languageID, "TokenID":"@dm!n" };
dynamic localRes;

@ -2967,6 +2967,7 @@ class TranslationBase {
String get existingPackage => localizedValues["existingPackage"][locale.languageCode];
String get continueOrbookNew => localizedValues["continueOrbookNew"][locale.languageCode];
String get newAppointment => localizedValues["newAppointment"][locale.languageCode];
String get proceedPackage => localizedValues["proceedPackage"][locale.languageCode];
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save