Compare commits

...

4 Commits

@ -313,6 +313,8 @@ var GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_Get
var GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
var GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
var CHECK_PATIENT_DERMA_PACKAGE = 'Services/OUTPs.svc/REST/getPatientPackageComponentsForOnlineCheckIn';
var ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER';
var GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
@ -344,7 +346,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 15.9;
var VERSION_ID = 16.1;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;

@ -1976,4 +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":"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":"المضي قدما في الحزمة"},
};

@ -30,7 +30,7 @@ class ProjectViewModel extends BaseViewModel {
AppSharedPreferences sharedPref = AppSharedPreferences();
Locale _appLocale = Locale('ar');
String currentLanguage = 'ar';
bool _isArabic = false;
bool _isArabic = true;
bool isInternetConnection = true;
bool isLoading = false;
bool isError = false;

@ -0,0 +1,64 @@
class PatientPackageComponent {
List<PatientPackageComponents>? patientPackageComponents;
PatientPackageComponent({this.patientPackageComponents});
PatientPackageComponent.fromJson(Map<String, dynamic> json) {
if (json['PatientPackageComponents'] != null) {
patientPackageComponents = <PatientPackageComponents>[];
json['PatientPackageComponents'].forEach((v) {
patientPackageComponents!.add(new PatientPackageComponents.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.patientPackageComponents != null) {
data['PatientPackageComponents'] =
this.patientPackageComponents!.map((v) => v.toJson()).toList();
}
return data;
}
}
class PatientPackageComponents {
int? invoiceNo;
int? lineItemNo;
String? procedureID;
String? procedureName;
int? projectID;
int? sequence;
String? setupID;
PatientPackageComponents(
{this.invoiceNo,
this.lineItemNo,
this.procedureID,
this.procedureName,
this.projectID,
this.sequence,
this.setupID});
PatientPackageComponents.fromJson(Map<String, dynamic> json) {
invoiceNo = json['InvoiceNo'];
lineItemNo = json['LineItemNo'];
procedureID = json['ProcedureID'];
procedureName = json['ProcedureName'];
projectID = json['ProjectID'];
sequence = json['Sequence'];
setupID = json['SetupID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['InvoiceNo'] = this.invoiceNo;
data['LineItemNo'] = this.lineItemNo;
data['ProcedureID'] = this.procedureID;
data['ProcedureName'] = this.procedureName;
data['ProjectID'] = this.projectID;
data['Sequence'] = this.sequence;
data['SetupID'] = this.setupID;
return data;
}
}

@ -28,6 +28,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import '../../models/Appointments/PatientPackageComponent.dart';
import 'book_reminder_page.dart';
import 'components/DocAvailableAppointments.dart';
@ -215,7 +216,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
checkPatientHasDermaPackage(widget.doctor, projectViewModel.user.patientID!);
}
},
child: Text(TranslationBase.of(context).bookAppo, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48, color: Colors.white)),
@ -253,7 +254,7 @@ class _BookConfirmState extends State<BookConfirm> {
);
}
cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) 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();
@ -265,7 +266,7 @@ class _BookConfirmState extends State<BookConfirm> {
if (isLiveCareSchedule != null && isLiveCareSchedule) {
insertLiveCareScheduledAppointment(context, widget.doctor);
} else {
insertAppointment(context, widget.doctor, widget.initialSlotDuration);
insertAppointment(widget.doctor, widget.initialSlotDuration, invoiceNumber: invoiceNumber, lineItemNo: lineItemNo);
}
});
} else {
@ -320,16 +321,52 @@ class _BookConfirmState extends State<BookConfirm> {
});
}
insertAppointment(context, DoctorList docObject, int initialSlotDuration) async {
checkPatientHasDermaPackage(DoctorList doctor, int patientID) {
GifLoaderDialogUtils.showMyDialog(context);
widget.service
.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') {
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).proceedPackage,
cancelText: TranslationBase.of(context).newAppointment,
okFunction: () => {
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(widget.doctor, widget.initialSlotDuration);
}
}).onError((error, stackTrace) {
insertAppointment(widget.doctor, widget.initialSlotDuration);
});
}
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)
null, null, null, projectViewModel, invoiceNumber, lineItemNo)
.then((res) {
if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -366,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)},
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]) 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) {
@ -374,7 +374,10 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
"PatientType": authUser.patientType,
"InvoiceNo": invoiceNumber,
"LineItemNo": lineItemNo,
// "TokenID":"@dm!n"
};
if (clinicID == 253) {
@ -509,6 +512,26 @@ 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;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data;
}
request = {"PatientID": patientID, "ClinicID": clinicID, "ProjectID": projectID, "LanguageID": languageID};
//request = { "PatientID":4768732, "ClinicID":1, "ProjectID": 15, "LanguageID": languageID, "TokenID":"@dm!n" };
dynamic localRes;
await baseAppClient.post(CHECK_PATIENT_DERMA_PACKAGE, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async {
Map<String, dynamic> request;

@ -52,7 +52,7 @@ class ClinicListService extends BaseService {
Future<Map> getProjectsList(int languageID, context) async {
Map<String, dynamic> request = {};
request = {"LanguageID": languageID};
// request = {"LanguageID": languageID};
dynamic localRes;

@ -76,7 +76,7 @@ class AppSharedPreferences {
final SharedPreferences prefs = await _prefs;
await prefs.reload();
String value = prefs.getString(key).toString();
return value == null ? defaultVal : value;
return (value == null ) || (value =="null") ? defaultVal : value;
}
/// Get List of String [key] the key was saved

@ -2964,7 +2964,10 @@ class TranslationBase {
String get wecare => localizedValues["wecare"][locale.languageCode];
String get myinstructions => localizedValues["myinstructions"][locale.languageCode];
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> {

@ -73,7 +73,9 @@ class Mdialog extends StatelessWidget {
Text(
// title != null ? title : TranslationBase.of(context).confirm,
title!,
style: TextStyle(
fontSize: 24,
letterSpacing: -0.94,
fontWeight: FontWeight.w600,
@ -82,6 +84,7 @@ class Mdialog extends StatelessWidget {
Text(
// this.confirmMessage,
description!,
style: TextStyle(
fontSize: 12,
letterSpacing: -0.48,
@ -101,7 +104,7 @@ class Mdialog extends StatelessWidget {
child: Container(
decoration: containerRadius(CustomColors.accentColor, 12),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Center(child: Texts(cancelText, variant: "caption3", color: CustomColors.white,)),
child: Center(child: Texts(cancelText, textAlign: TextAlign.center, variant: "caption3", color: CustomColors.white,)),
),
),
),
@ -115,6 +118,7 @@ class Mdialog extends StatelessWidget {
child: Center(
child: Texts(
okText,
textAlign: TextAlign.center,
color: Colors.white,
variant: "caption3",
),

Loading…
Cancel
Save