Merge branch 'development_v3.3' of http://34.17.52.79/Haroon6138/diplomatic-quarter into development_v3.3

# Conflicts:
#	pubspec.yaml
merge-update-with-lab-changes
Faiz Hashmi 2 years ago
commit d3b4f37c73

@ -38,6 +38,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_REDIRECT_URL = 'https://bit.ly/AlhabibPharmacy';
// Pharmacy VidaPlus URLs
// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
@ -337,7 +339,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 = 10.9;
var VERSION_ID = 11.4;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;

@ -182,7 +182,7 @@ const Map localizedValues = {
'passQRAppoAttend': {'en': 'Pass the QR code through the attendance devices available in the Hospital.', 'ar': 'تمرير الكود من خلال اجهزة تسجيل الحضور المتوفرة في الفرع.'},
'sitWaitingQR': {'en': 'Sit in the waiting rooms until called by the nurse.', 'ar': 'الجلوس في غرف الانتظار لحين منادتك من قبل الممرضة.'},
'attendRegisterCode': {'en': 'Attendance registration code', 'ar': 'رمز تسجيل الحضور'},
'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وافحصها عبر NFC لتسجيل الوصول'},
'scanQRHospital': {'en': 'Approach the Online Check-In board in the hospital & scan via NFC or QR Code to Check-In', 'ar': 'اقترب من لوحة تسجيل الوصول عبر الإنترنت في المستشفى وقم بالمسح الضوئي عبر NFC أو رمز الاستجابة السريعة لتسجيل الوصول'},
'scanNFC': {'en': 'Scan NFC to Check-In', 'ar': 'مسح NFC لتسجيل الوصول'},
"sendEmail": {"en": "Send Email", "ar": "ارسال نسخة"},
"success": {"en": "Done successfully", "ar": "تم تنفذ الطلب بنجاح"},
@ -791,7 +791,7 @@ const Map localizedValues = {
"Upon activation of this service, the system will send a monthly report automatically to the registered email which lists the vital signs and the results for the last visits made in AlHabib Medical Group.",
"ar": "خدمة التقارير الشهرية: عند تفعيل هذه الخدمة سيقوم النظام بارسال تقرير شهري بشكل آلي على الايميل المسجل والذي يسرد المؤشرات الحيوية ونتائج التحاليل لآخر زيارات تمت بمجموعة الحبيب الطبية."
},
"language-setting": {"en": "SMS and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة و الاتصال الآلي"},
"language-setting": {"en": "SMS, WhatsApp and Confirmation Calls Language", "ar": "لغة الرسائل القصيرة والواتس اب وتأكيد المكالمات"},
"alert": {"en": "Alerts", "ar": "التنبيهات"},
"email-alert": {"en": "Alert by Email", "ar": "استلام التنبيهات بالبريد الالكتروني"},
"sms-alert": {"en": "Alert by SMS", "ar": "استلام التنبيهات بالرسائل القصيرة"},
@ -1899,4 +1899,8 @@ const Map localizedValues = {
"updateInsurance": {"en": "Update insurance", "ar": "تحديث التأمين"},
"downloadReport": {"en": "Download Report", "ar": "تحميل تقرير المختبر"},
"habibCallCenter": {"en": "Please contact AlHabib call center to update your insurance manually.", "ar": "يرجى الاتصال بمركز اتصال الحبيب لتحديث التأمين الخاص بك يدوياً."},
"cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "ar": "يرجى ملاحظة أن هذا هو المبلغ النقدي، إذا كنت ترغب في تحديث التأمين الخاص بك، يرجى النقر أدناه:"},
"validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"},
"checkInViaLocation": {"en": "Check-In Via Location", "ar": "تسجيل الوصول عبر الموقع"},
"locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."},
};

@ -43,3 +43,4 @@ const CLINICS_LIST = 'CLINICS_LIST';
const COVID_QA_LIST = 'COVID_QA_LIST';
const IS_COVID_CONSENT_SHOWN = 'IS_COVID_CONSENT_SHOWN';
const REGISTER_INFO_DUBAI ='register-info-dubai';
const IS_LAST_APPOINTMENT_RATE_SHOWN ='is-last-appointment-rate-shown';

@ -17,6 +17,7 @@ class PatientLabOrders {
String genderDescription;
String invoiceNo;
String invoiceNo_VP;
String invoiceType;
bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
@ -36,6 +37,7 @@ class PatientLabOrders {
String setupID;
List<String> speciality;
bool isLiveCareAppointment;
PatientLabOrders(
{this.actualDoctorRate,
this.clinicDescription,
@ -69,8 +71,10 @@ class PatientLabOrders {
this.projectNameN,
this.qR,
this.setupID,
this.invoiceNo_VP,
this.speciality,this.isLiveCareAppointment});
this.invoiceNo_VP,
this.invoiceType,
this.speciality,
this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate'];
@ -106,8 +110,9 @@ class PatientLabOrders {
qR = json['QR'];
setupID = json['SetupID'];
invoiceNo_VP = json['invoiceNo_VP'];
invoiceType = json['InvoiceType'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
// speciality = json['Speciality'].cast<String>();
// speciality = json['Speciality'].cast<String>();
}
Map<String, dynamic> toJson() {
@ -146,7 +151,7 @@ class PatientLabOrders {
data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['invoiceNo_VP'] =this.invoiceNo_VP;
data['invoiceNo_VP'] = this.invoiceNo_VP;
return data;
}
}
@ -155,8 +160,7 @@ class PatientLabOrdersList {
String filterName = "";
List<PatientLabOrders> patientLabOrdersList = List();
PatientLabOrdersList(
{this.filterName, PatientLabOrders patientDoctorAppointment}) {
PatientLabOrdersList({this.filterName, PatientLabOrders patientDoctorAppointment}) {
patientLabOrdersList.add(patientDoctorAppointment);
}
}

@ -1,6 +1,7 @@
class RequestPatientLabSpecialResult {
String invoiceNo;
String invoiceNoVP;
String invoiceType;
String orderNo;
String setupID;
String projectID;
@ -22,27 +23,29 @@ class RequestPatientLabSpecialResult {
RequestPatientLabSpecialResult(
{this.invoiceNo,
this.invoiceNoVP,
this.orderNo,
this.setupID,
this.projectID,
this.clinicID,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.patientID,
this.tokenID,
this.patientTypeID,
this.patientType});
this.invoiceType,
this.orderNo,
this.setupID,
this.projectID,
this.clinicID,
this.versionID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.patientID,
this.tokenID,
this.patientTypeID,
this.patientType});
RequestPatientLabSpecialResult.fromJson(Map<String, dynamic> json) {
invoiceNo = json['InvoiceNo'];
invoiceNo = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
orderNo = json['OrderNo'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
@ -66,6 +69,7 @@ class RequestPatientLabSpecialResult {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP;
data['InvoiceType'] = this.invoiceType;
data['OrderNo'] = this.orderNo;
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;

@ -24,6 +24,7 @@ class RequestSendLabReportEmail {
String projectID;
String invoiceNo;
String invoiceNoVP;
String invoiceType;
String orderDate;
String orderNo;
bool isDownload;
@ -55,6 +56,7 @@ class RequestSendLabReportEmail {
this.projectID,
this.invoiceNo,
this.invoiceNoVP,
this.invoiceType,
this.orderDate,
this.orderNo,
this.isDownload,
@ -86,6 +88,7 @@ class RequestSendLabReportEmail {
projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo'];
invoiceNoVP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
orderDate = json['OrderDate'];
orderNo = json['OrderNo'];
isDownload = json['IsDownload'];
@ -119,6 +122,7 @@ class RequestSendLabReportEmail {
data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP;
data['InvoiceType'] = this.invoiceType;
data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo;
data['IsDownload'] = this.isDownload;

@ -0,0 +1,15 @@
class HMCProjectListModel {
int projectID;
HMCProjectListModel({this.projectID});
HMCProjectListModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
return data;
}
}

@ -0,0 +1,32 @@
class ProjectDetailListModel {
int projectID;
String latitude;
String longitude;
int geofenceRadius;
String checkInQrCode;
ProjectDetailListModel(
{this.projectID,
this.latitude,
this.longitude,
this.geofenceRadius,
this.checkInQrCode});
ProjectDetailListModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
latitude = json['Latitude'];
longitude = json['Longitude'];
geofenceRadius = json['GeofenceRadius'];
checkInQrCode = json['CheckInQrCode'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['GeofenceRadius'] = this.geofenceRadius;
data['CheckInQrCode'] = this.checkInQrCode;
return data;
}
}

@ -7,6 +7,7 @@ class FinalRadiology {
int invoiceLineItemNo;
int invoiceNo;
dynamic invoiceNo_VP;
String invoiceType;
int doctorID;
int clinicID;
DateTime orderDate;
@ -50,7 +51,8 @@ class FinalRadiology {
this.patientID,
this.invoiceLineItemNo,
this.invoiceNo,
this.invoiceNo_VP,
this.invoiceNo_VP,
this.invoiceType,
this.doctorID,
this.clinicID,
this.orderDate,
@ -85,7 +87,8 @@ class FinalRadiology {
this.reportDataTextString,
this.speciality,
this.isCVI,
this.isRadMedicalReport,this.isLiveCareAppointment});
this.isRadMedicalReport,
this.isLiveCareAppointment});
FinalRadiology.fromJson(Map<String, dynamic> json) {
try {
@ -95,6 +98,7 @@ class FinalRadiology {
invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
orderDate = DateUtil.convertStringToDate(json['OrderDate']);
@ -128,10 +132,9 @@ class FinalRadiology {
isLiveCareAppointment = json['IsLiveCareAppointment'];
reportDataHTML = json['ReportDataHTML'];
reportDataTextString = json['ReportDataTextString'];
// speciality = json['Speciality'].cast<String>();
// speciality = json['Speciality'].cast<String>();
isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport'];
} catch (e) {
print(e);
}
@ -145,6 +148,7 @@ class FinalRadiology {
data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['InvoiceType'] = this.invoiceType;
data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate;
@ -189,7 +193,7 @@ class FinalRadiologyList {
List<FinalRadiology> finalRadiologyList = List();
FinalRadiologyList({this.filterName, this.finalRadiologyList});
// {
// finalRadiologyList.add(finalRadiology);
// }
// {
// finalRadiologyList.add(finalRadiology);
// }
}

@ -7,6 +7,7 @@ class RequestSendRadReportEmail {
String generalid;
int invoiceNo;
int invoiceNo_VP;
String invoiceType;
String iPAdress;
bool isDentalAllowedBackend;
int languageID;
@ -37,6 +38,7 @@ class RequestSendRadReportEmail {
this.generalid,
this.invoiceNo,
this.invoiceNo_VP,
this.invoiceType,
this.iPAdress,
this.isDentalAllowedBackend,
this.languageID,
@ -66,6 +68,7 @@ class RequestSendRadReportEmail {
generalid = json['generalid'];
invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
iPAdress = json['IPAdress'];
isDentalAllowedBackend = json['isDentalAllowedBackend'];
languageID = json['LanguageID'];
@ -98,6 +101,7 @@ class RequestSendRadReportEmail {
data['generalid'] = this.generalid;
data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['InvoiceType'] = this.invoiceType;
data['IPAdress'] = this.iPAdress;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['LanguageID'] = this.languageID;

@ -26,12 +26,12 @@ class AppoitmentRated {
String arrivedOn;
int editedBy;
String editedOn;
Null doctorName;
dynamic doctorName;
String doctorNameN;
String statusDesc;
String statusDescN;
bool vitalStatus;
Null vitalSignAppointmentNo;
dynamic vitalSignAppointmentNo;
int episodeID;
String doctorTitle;
bool isAppoitmentLiveCare;

@ -54,15 +54,18 @@ class AncillaryOrdersService extends BaseService {
return Future.value(localRes);
}
Future getOrdersDetails(appointmentNo, orderNo, projectID) async {
Future<Map> getOrdersDetails(appointmentNo, orderNo, projectID) async {
Map<String, dynamic> body = Map();
body['AppointmentNo_Vida'] = appointmentNo;
body['OrderNo'] = orderNo;
body['ProjectID'] = projectID;
hasError = false;
dynamic localRes;
await baseAppClient.post(GET_ANCILLARY_ORDERS_DETAILS, onSuccess: (dynamic response, int statusCode) {
localRes = response;
_ancillaryProcLists = [];
response['AncillaryOrderProcList'].forEach((item) {
ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
});
@ -70,5 +73,6 @@ class AncillaryOrdersService extends BaseService {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
}

@ -79,8 +79,11 @@ class BaseAppClient {
body['generalid'] = GENERAL_ID;
// body['isVidaPlus'] = true;
body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT);
body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG);
double lat = await AppSharedPreferences().getDouble(USER_LAT);
double long = await AppSharedPreferences().getDouble(USER_LONG);
body['Latitude'] = lat == null ? 0.0 : lat;
body['Longitude'] = long == null ? 0.0 : long;
if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
@ -90,7 +93,11 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND;
}
body['DeviceTypeID'] = Platform.isIOS ? 1 : 2;
body['DeviceTypeID'] = Platform.isIOS
? 1
: await Utils.isGoogleServicesAvailable()
? 2
: 3;
if (!body.containsKey('IsPublicRequest')) {
// if (!body.containsKey('PatientType')) {
@ -150,7 +157,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021";
// body['PatientID'] = 2001273; //3844083
// body['PatientID'] = 2941698; //3844083
// body['TokenID'] = "@dm!n";
// Patient ID: 3027574
@ -159,11 +166,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null);
// if (AppGlobal.isNetworkDebugEnabled) {
if (AppGlobal.isNetworkDebugEnabled) {
print("URL : $url");
final jsonBody = json.encode(body);
print(jsonBody);
// }
}
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

@ -34,7 +34,7 @@ class LabsService extends BaseService {
List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = List();
Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async {
Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async {
hasError = false;
_requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID;
@ -42,6 +42,8 @@ class LabsService extends BaseService {
_requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo;
_requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0";
_requestPatientLabSpecialResult.invoiceType = invoiceType;
_requestPatientLabSpecialResult.orderNo = orderNo;
_requestPatientLabSpecialResult.setupID = setupID;
@ -61,6 +63,7 @@ class LabsService extends BaseService {
Map<String, dynamic> body = Map();
body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0";
body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
body['InvoiceType'] = patientLabOrder.invoiceType;
body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID;
@ -205,6 +208,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID;
_requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0";
_requestSendLabReportEmail.invoiceType = patientLabOrder.invoiceType;
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName;

@ -10,13 +10,14 @@ class RadiologyService extends BaseService {
bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async {
Future getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async {
hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;
body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0";
body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId;
body['InvoiceType'] = invoiceType;
await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
url = response['Data'];
@ -79,6 +80,7 @@ class RadiologyService extends BaseService {
_requestSendRadReportEmail.radResult = finalRadiology.reportData;
_requestSendRadReportEmail.to = userObj.emailAddress;
_requestSendRadReportEmail.dateofBirth = userObj.dateofBirth;
_requestSendRadReportEmail.invoiceType = finalRadiology.invoiceType;
hasError = false;
await baseAppClient.post(SEND_RAD_REPORT_EMAIL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {

@ -1,11 +1,15 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PrivilegeService extends BaseService {
List<PrivilegeModel> privilegeModelList = List();
List<VidaPlusProjectListModel> vidaPlusProjectListModel = List();
List<PrivilegeModel> privilegeModelList = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];
List<HMCProjectListModel> hMCProjectListModel = [];
List<ProjectDetailListModel> projectDetailListModel = [];
Future getPrivilege() async {
Map<String, dynamic> body = Map();
@ -20,6 +24,18 @@ class PrivilegeService extends BaseService {
vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
}
if (response['HMCProjectList'].length != 0) {
response['HMCProjectList'].forEach((item) {
hMCProjectListModel.add(HMCProjectListModel.fromJson(item));
});
}
if (response['ProjectDetailList'].length != 0) {
response['ProjectDetailList'].forEach((item) {
projectDetailListModel.add(ProjectDetailListModel.fromJson(item));
});
}
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;

@ -10,11 +10,10 @@ class AnciallryOrdersViewModel extends BaseViewModel {
bool hasError = false;
AncillaryOrdersService _ancillaryService = locator<AncillaryOrdersService>();
List<AncillaryOrdersListModel> get ancillaryLists =>
_ancillaryService.ancillaryLists;
List<AncillaryOrdersListProcListModel> get ancillaryListsDetails =>
_ancillaryService.ancillaryProcLists;
List<AncillaryOrdersListModel> get ancillaryLists => _ancillaryService.ancillaryLists;
List<AncillaryOrdersListProcListModel> get ancillaryListsDetails => _ancillaryService.ancillaryProcLists;
Future getOrders() async {
hasError = false;
@ -30,7 +29,7 @@ class AnciallryOrdersViewModel extends BaseViewModel {
Future getOrdersDetails(appointmentNo, orderNo, projectID) async {
hasError = false;
setState(ViewState.Busy);
await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID );
await _ancillaryService.getOrdersDetails(appointmentNo, orderNo, projectID);
if (_ancillaryService.hasError) {
error = _ancillaryService.error;
setState(ViewState.ErrorLocal);

@ -74,9 +74,10 @@ class LabsViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List();
getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID, bool isVidaPlus}) async {
getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async {
setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,
invoiceType: invoiceType,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,

@ -48,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async {
getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async {
setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, invoiceType: invoiceType, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus);
if (_radiologyService.hasError) {
error = _radiologyService.error;
setState(ViewState.Error);

@ -4,7 +4,9 @@ import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
@ -60,11 +62,17 @@ class ProjectViewModel extends BaseViewModel {
List<PrivilegeModel> privilegeRootUser = List();
List<PrivilegeModel> privilegeChildUser = List();
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<HMCProjectListModel> _hMCProjectListModel = [];
List<ProjectDetailListModel> _projectDetailListModel = [];
List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
List<HMCProjectListModel> get hMCProjectListModel => _hMCProjectListModel;
List<ProjectDetailListModel> get projectDetailListModel => _projectDetailListModel;
List<LaserBodyPart> selectedBodyPartList = [];
StreamSubscription subscription;
@ -130,6 +138,16 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners();
}
setProjectsDetailList(List<ProjectDetailListModel> projectDetailListModel) {
_projectDetailListModel = projectDetailListModel;
notifyListeners();
}
setHMCProjectList(List<HMCProjectListModel> hMCProjectListModel) {
_hMCProjectListModel = hMCProjectListModel;
notifyListeners();
}
setPrivilege({privilegeList, bool isLoginChild = false}) {
List<PrivilegeModel> privilege = List();

@ -2,6 +2,7 @@ import 'dart:io';
import "package:collection/collection.dart";
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/service/ancillary_orders_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/ancillary_orders_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
@ -24,6 +25,7 @@ import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:flutter_svg/flutter_svg.dart';
class AnicllaryOrdersDetails extends StatefulWidget {
final dynamic appoNo;
@ -47,10 +49,15 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
List<AncillaryOrderProcDetailsList> selectedProcList = [];
List<AncillaryOrdersListProcListModel> _ancillaryProcLists = [];
String tamaraPaymentStatus;
String tamaraOrderID;
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) {
getAncillaryOrderDetails();
});
super.initState();
}
@ -58,12 +65,21 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
super.dispose();
}
void getAncillaryOrderDetails(AnciallryOrdersViewModel model) {
void getAncillaryOrderDetails() {
GifLoaderDialogUtils.showMyDialog(context);
model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) {
addToSelectedProcedures(model);
AncillaryOrdersService ancillaryOrdersService = new AncillaryOrdersService();
ancillaryOrdersService.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((response) {
_ancillaryProcLists = [];
selectedProcList = [];
if (response['AncillaryOrderProcList'] != null && response['AncillaryOrderProcList'].length != 0) {
response['AncillaryOrderProcList'].forEach((item) {
_ancillaryProcLists.add(AncillaryOrdersListProcListModel.fromJson(item));
});
addToSelectedProcedures();
}
GifLoaderDialogUtils.hideDialog(context);
}).catchError((err) {
AppToast.showErrorToast(message: err.toString());
GifLoaderDialogUtils.hideDialog(context);
});
}
@ -73,79 +89,74 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
projectViewModel = Provider.of(context);
localContext = context;
AppGlobal.context = context;
return BaseView<AnciallryOrdersViewModel>(
onModelReady: (model) {
// getAncillaryOrderDetails(model);
model.getOrdersDetails(widget.appoNo, widget.orderNo, widget.projectID).then((value) {
addToSelectedProcedures(model);
});
},
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: model.ancillaryListsDetails.length > 0
? Column(children: [
getPatientInfo(model),
getAncillaryDetails(model),
])
: getNoDataWidget(context),
),
bottomSheet: model.ancillaryListsDetails.length > 0
? Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
width: double.infinity,
// color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
child: getPaymentMethods(),
),
_amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).payNow.toUpperCase(),
selectedProcList.length > 0 && getTotalValue() != "0.00"
? () {
makePayment(model);
}
: null,
color: CustomColors.green,
disabledColor: CustomColors.grey2,
),
],
),
return AppScaffold(
isShowAppBar: true,
showNewAppBar: true,
showNewAppBarTitle: true,
appBarTitle: TranslationBase.of(context).anicllaryOrders,
body: SingleChildScrollView(
padding: EdgeInsets.all(12),
child: _ancillaryProcLists.isNotEmpty
? Column(
children: [
getPatientInfo(),
getAncillaryDetails(),
],
)
: Container(),
: getNoDataWidget(context),
),
bottomSheet: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 5,
blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow
),
],
),
padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15),
width: double.infinity,
// color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 12),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 16.0,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.64,
),
),
SizedBox(
width: MediaQuery.of(context).size.width * 0.75,
child: getPaymentMethods(),
),
_amountView(TranslationBase.of(context).patientShareTotalToDo, getTotalValue() + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true),
SizedBox(height: 12),
DefaultButton(
TranslationBase.of(context).payNow.toUpperCase(),
selectedProcList.length > 0
? () {
if (getTotalValue() != "0.00") {
makePayment();
} else {
autoGenerateInvoice();
}
}
: null,
color: selectedProcList.length > 0 ? CustomColors.green : CustomColors.grey2,
disabledColor: CustomColors.grey2,
),
],
),
),
);
}
@ -180,7 +191,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
);
}
Widget getPatientInfo(AnciallryOrdersViewModel model) {
Widget getPatientInfo() {
return Padding(
child: Column(
children: [
@ -273,7 +284,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].appointmentNo.toString(),
_ancillaryProcLists[0].appointmentNo.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -296,7 +307,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList[0].orderNo.toString(),
_ancillaryProcLists[0].ancillaryOrderProcDetailsList[0].orderNo.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -321,7 +332,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
mWidth(3),
Expanded(
child: Text(
model.ancillaryListsDetails[0].companyName.toString(),
_ancillaryProcLists[0].companyName.toString(),
overflow: TextOverflow.clip,
style: TextStyle(
fontWeight: FontWeight.w600,
@ -346,7 +357,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
),
mWidth(3),
Text(
model.ancillaryListsDetails[0].insurancePolicyNo.toString(),
_ancillaryProcLists[0].insurancePolicyNo.toString(),
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 12,
@ -366,8 +377,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
);
}
Widget getAncillaryDetails(model) {
Map newMap = groupBy(model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName);
Widget getAncillaryDetails() {
Map newMap = groupBy(_ancillaryProcLists[0].ancillaryOrderProcDetailsList, (obj) => obj.procedureCategoryName);
return Padding(padding: EdgeInsets.only(top: 0, bottom: 200), child: getHeaderDetails(newMap));
}
@ -489,21 +500,21 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
return tableRow;
}
makePayment(AnciallryOrdersViewModel model) {
makePayment() {
showDraggableDialog(
context,
PaymentMethod(
onSelectedMethod: (String method, [String selectedInstallmentPlan]) {
selectedPaymentMethod = method;
this.selectedInstallmentPlan = selectedInstallmentPlan;
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan);
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan);
},
patientShare: double.parse(getTotalValue()),
isFromAdvancePayment: !projectViewModel.havePrivilege(94),
));
}
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String selectedInstallmentPlan]) {
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, [String selectedInstallmentPlan]) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart);
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID);
@ -525,10 +536,10 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
// Need to get new Service ID from Ayman for Ancillary Tamara
"",
context,
model.ancillaryListsDetails[0].appointmentDate,
model.ancillaryListsDetails[0].appointmentNo,
model.ancillaryListsDetails[0].clinicID,
model.ancillaryListsDetails[0].doctorID,
_ancillaryProcLists[0].appointmentDate,
_ancillaryProcLists[0].appointmentNo,
_ancillaryProcLists[0].clinicID,
_ancillaryProcLists[0].doctorID,
selectedInstallmentPlan);
}
@ -677,6 +688,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
});
});
GifLoaderDialogUtils.showMyDialog(localContext);
DoctorsListService service = new DoctorsListService();
service.autoGenerateAncillaryOrdersInvoice(widget.orderNo, widget.projectID, widget.appoNo, selectedProcListAPI, localContext).then((res) {
GifLoaderDialogUtils.hideDialog(localContext);
@ -711,16 +724,18 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
}
}
addToSelectedProcedures(AnciallryOrdersViewModel model) {
if (model.ancillaryListsDetails.isNotEmpty) {
addToSelectedProcedures() {
if (_ancillaryProcLists.isNotEmpty) {
selectedProcList.clear();
model.ancillaryListsDetails[0].ancillaryOrderProcDetailsList.forEach((element) {
if (!isProcedureDisabled(element)) {
selectedProcList.add(element);
}
});
setState(() {});
if (_ancillaryProcLists[0].ancillaryOrderProcDetailsList.isNotEmpty) {
_ancillaryProcLists[0].ancillaryOrderProcDetailsList.forEach((element) {
if (!isProcedureDisabled(element)) {
selectedProcList.add(element);
}
});
} else {}
}
setState(() {});
}
String getInsuranceText(value) {

@ -446,18 +446,19 @@ class _BookConfirmState extends State<BookConfirm> {
widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0;
print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
if(res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
}
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
} else {
if (isInsured && isEligible) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
} else {
if (isInsured && !isEligible) {
errorMsg = TranslationBase.of(context).invalidEligibility;
@ -489,7 +490,7 @@ class _BookConfirmState extends State<BookConfirm> {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse);
navigateToBookSuccess(context, docObject, widget.patientShareResponse, false);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
@ -553,7 +554,7 @@ class _BookConfirmState extends State<BookConfirm> {
Navigator.of(context).popAndPushNamed(HOME);
}
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async {
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse, bool isCash) async {
GifLoaderDialogUtils.hideDialog(context);
this.sharedPref.remove(IS_LIVECARE_APPOINTMENT);
Navigator.push(
@ -565,6 +566,7 @@ class _BookConfirmState extends State<BookConfirm> {
appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.selectedTime,
dateTime: getDateTime(),
isCash: isCash,
),
),
);

@ -7,6 +7,8 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.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/theme/colors.dart';
@ -17,6 +19,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -36,8 +39,9 @@ class BookSuccess extends StatefulWidget {
String appoDateFormatted;
String appoTimeFormatted;
bool isCash;
BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted});
BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.isCash = false});
@override
_BookSuccessState createState() => _BookSuccessState();
@ -155,25 +159,54 @@ class _BookSuccessState extends State<BookSuccess> {
Widget _getQRButtons() {
return Container(
alignment: Alignment.bottomCenter,
margin: EdgeInsets.all(14),
height: MediaQuery.of(context).size.height * 0.18,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xFF60686b),
elevation: 0,
onPressed: () {
// navigateToQR(context);
getAppoQR(context);
},
child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
Row(
children: [
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
GifLoaderDialogUtils.showMyDialog(context);
getAppoQR(context);
},
child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
),
mWidth(7),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () {
navigateToHome(context);
// GifLoaderDialogUtils.showMyDialog(context);
// getAppoQR(context);
},
child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
),
],
),
],
),
@ -186,51 +219,85 @@ class _BookSuccessState extends State<BookSuccess> {
child: Container(
color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.all(14),
height: 45.0,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
startPaymentProcess();
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true);
},
child: Text(TranslationBase.of(context).payNow.toUpperCase(),
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
)),
),
),
),
mWidth(7),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
height: widget.isCash ? 150.0 : 50,
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
startPaymentProcess();
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true);
},
child: Text(TranslationBase.of(context).payNow.toUpperCase(),
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
)),
),
),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () {
navigateToHome(context);
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
},
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
mWidth(7),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () {
navigateToHome(context);
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
},
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
),
),
],
),
widget.isCash
? Column(
children: [
mHeight(10.0),
Text(
TranslationBase.of(context).cashAmountUpdateInsurance,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
),
),
mHeight(5.0),
DefaultButton(
TranslationBase.of(context).updateInsuranceText,
() {
Navigator.pop(context, null);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
color: Color(0xffEAA118),
textColor: Colors.white,
),
],
)
: Container(),
],
),
),

@ -1,7 +1,10 @@
import 'dart:typed_data';
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
@ -15,8 +18,12 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart';
@ -24,6 +31,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse;
@ -43,6 +51,10 @@ class _QRCodeState extends State<QRCode> {
bool _supportsNFC = false;
BuildContext _context;
ProjectViewModel projectViewModel;
LocationUtils locationUtils;
ProjectDetailListModel projectDetailListModel;
@override
void initState() {
// TODO: implement initState
@ -55,7 +67,7 @@ class _QRCodeState extends State<QRCode> {
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
startNFCScan();
// startNFCScan();
});
super.initState();
@ -65,7 +77,7 @@ class _QRCodeState extends State<QRCode> {
Future.delayed(const Duration(milliseconds: 500), () {
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
sendNfcCheckInRequest(nfcId, 1);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment);
});
}, onCancel: () {
@ -75,9 +87,33 @@ class _QRCodeState extends State<QRCode> {
});
}
startQRCodeScan() async {
String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent;
if (onlineCheckInQRCode != "") {
sendNfcCheckInRequest(onlineCheckInQRCode, 2);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment);
} else {}
}
startLocationCheckIn() async {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(callBack: (value) {
projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment.projectID);
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000;
print(dist);
if (dist <= projectDetailListModel.geofenceRadius) {
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
}
});
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
_context = context;
List<Widget> checkInOptionsList = getCheckInOptionsList(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).onlineCheckIn,
isShowAppBar: true,
@ -111,78 +147,125 @@ class _QRCodeState extends State<QRCode> {
onTap: () {},
onRatingAndReviewTap: () {},
),
InkWell(
child: Container(
margin: EdgeInsets.only(top: 30.0),
padding: EdgeInsets.all(8),
child: SvgPicture.asset(
"assets/images/nfc/contactless.svg",
width: 80.0,
height: 80.0,
),
),
onTap: () {
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment);
});
}, onCancel: () {
// Navigator.of(context).pop();
locator<GAnalytics>().todoList.to_do_list_nfc_cancel(widget.appointment);
});
},
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).scanQRHospital,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
)),
),
Row(
children: <Widget>[
Expanded(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).scanQRHospital,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w600,
letterSpacing: -0.48,
)),
),
),
],
mHeight(21),
Padding(
padding: EdgeInsets.only(left: 21, right: 21),
child: GridView.builder(
shrinkWrap: true,
primary: false,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 2 / 2, crossAxisSpacing: 12, mainAxisSpacing: 12),
padding: EdgeInsets.zero,
itemCount: checkInOptionsList.length,
itemBuilder: (BuildContext context, int index) {
return checkInOptionsList[index];
},
),
),
],
),
),
bottomSheet: Container(
color: CustomColors.appBackgroudGreyColor,
padding: EdgeInsets.all(21),
// height: 45.0,
child: Row(
children: [
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () {
startNFCScan();
},
child: Text(TranslationBase.of(context).scanNFC,
style: TextStyle(
fontSize: 18.0,
color: Colors.white,
)),
),
),
),
],
// bottomSheet: Container(
// color: CustomColors.appBackgroudGreyColor,
// padding: EdgeInsets.all(21),
// // height: 45.0,
// child: Row(
// children: [
// Expanded(
// flex: 1,
// child: ButtonTheme(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10.0),
// ),
// height: 45.0,
// child: CustomTextButton(
// backgroundColor: CustomColors.green,
// elevation: 0,
// onPressed: () {
// startNFCScan();
// },
// child: Text(TranslationBase.of(context).scanNFC,
// style: TextStyle(
// fontSize: 18.0,
// color: Colors.white,
// )),
// ),
// ),
// ),
// ],
// ),
// ),
);
}
List<Widget> getCheckInOptionsList(BuildContext context) {
List<Widget> optionsList = [];
optionsList.add(
InkWell(
onTap: () {
if (projectViewModel.havePrivilege(80)) {
startNFCScan();
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).scanNFC,
imagePath: 'contactless.svg',
subTitle: "",
isEnable: projectViewModel.havePrivilege(80),
width: 80.0,
height: 80.0,
),
),
);
optionsList.add(
InkWell(
onTap: () {
if (projectViewModel.havePrivilege(79)) {
startQRCodeScan();
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).pharmaLiveCareScanQR,
imagePath: 'qr_code.svg',
subTitle: "",
isEnable: projectViewModel.havePrivilege(79),
width: 80.0,
height: 80.0,
),
),
);
optionsList.add(
InkWell(
onTap: () {
if (projectViewModel.havePrivilege(102)) {
startLocationCheckIn();
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).checkInViaLocation,
imagePath: 'location.svg',
subTitle: "",
isEnable: projectViewModel.havePrivilege(102),
width: 70.0,
height: 70.0,
),
),
);
return optionsList;
}
sendEmail() async {
@ -258,12 +341,12 @@ class _QRCodeState extends State<QRCode> {
return docSpeciality;
}
sendNfcCheckInRequest(String nfcId) {
sendNfcCheckInRequest(String nfcId, int checkInBy) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) {
service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, checkInBy, context).then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);

@ -27,8 +27,9 @@ class BookReminderPage extends StatefulWidget {
String appoDateFormatted;
String appoTimeFormatted;
DateTime dateTime;
bool isCash;
BookReminderPage({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.dateTime});
BookReminderPage({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.dateTime, this.isCash = false});
@override
_BookReminderPageState createState() => _BookReminderPageState();
@ -184,8 +185,8 @@ class _BookReminderPageState extends State<BookReminderPage> {
),
height: 45.0,
child: CustomTextButton(
backgroundColor: CustomColors.green,
elevation: 0,
backgroundColor: CustomColors.green,
elevation: 0,
onPressed: () async {
print(widget.patientShareResponse.appointmentNo);
showReminderDialog(
@ -215,10 +216,17 @@ class _BookReminderPageState extends State<BookReminderPage> {
Future navigateToBookSuccess(BuildContext context) async {
Navigator.push(
context,
FadePage(
page:
BookSuccess(docObject: widget.docObject, patientShareResponse: widget.patientShareResponse, appoDateFormatted: widget.appoDateFormatted, appoTimeFormatted: widget.appoTimeFormatted)));
context,
FadePage(
page: BookSuccess(
docObject: widget.docObject,
patientShareResponse: widget.patientShareResponse,
appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.appoTimeFormatted,
isCash: widget.isCash,
),
),
);
}
Future<Map<Permission, PermissionStatus>> requestPermissions() async {

@ -79,6 +79,16 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
letterSpacing: -0.64,
),
),
SizedBox(height: 18),
Text(
widget.notification.message.trim(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.48,
),
),
if (widget.notification.notificationType == "2")
Padding(
padding: const EdgeInsets.only(top: 18),
@ -103,15 +113,15 @@ class _NotificationsDetailsPageState extends State<NotificationsDetailsPage> {
}, fit: BoxFit.fill),
),
SizedBox(height: 18),
Text(
widget.notification.message.trim(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Color(0xff575757),
letterSpacing: -0.48,
),
),
// Text(
// widget.notification.message.trim(),
// style: TextStyle(
// fontSize: 12,
// fontWeight: FontWeight.w600,
// color: Color(0xff575757),
// letterSpacing: -0.48,
// ),
// ),
],
),
);

@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -52,6 +54,8 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
int _currentPage = 0;
ToDoCountProviderModel toDoProvider;
@override
void initState() {
filterType = FilterType.Clinic;
@ -72,6 +76,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
@override
Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).myAppointmentsList,
isShowAppBar: true,
@ -168,6 +173,19 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
print(err);
AppToast.showErrorToast(message: err);
});
getToDoCount();
}
getToDoCount() {
toDoProvider.setState(0, true, "0");
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {}
}).catchError((err) {
print(err);
});
}
bool isConfirmed(AppoitmentAllHistoryResultList appo) {
@ -371,6 +389,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
}),
isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj,
projectID: _appointmentResult.projectID,
// billNo: _appointmentResult.invoiceNo,
profileUrl: _appointmentResult.doctorImageURL,
subName: _isSortByClinic ? _appointmentResult.projectName : _appointmentResult.clinicName,
@ -378,7 +397,9 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate),
isSortByClinic: _isSortByClinic,
rating: _appointmentResult.actualDoctorRate + 0.0,
appointmentTime: _appointmentResult.isLiveCareAppointment ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime.substring(0, 5),
appointmentTime: _appointmentResult.isLiveCareAppointment
? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5)
: _appointmentResult.startTime.substring(0, 5),
// appointmentTime: _appointmentResult.startTime.substring(0, 5),
remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)
? _appointmentResult.remaniningHoursTocanPay

@ -38,6 +38,7 @@ class BookedButtons {
"subtitle": TranslationBase.of(AppGlobal.context).location,
"icon": "hosp_location.svg",
"caller": "navigateToProject",
}
},
{"title": TranslationBase.of(AppGlobal.context).online, "subtitle": TranslationBase.of(AppGlobal.context).payment, "icon": "online_payment.svg", "caller": "goToTodoList"}
];
}

@ -30,19 +30,19 @@ class BookedButtonsAllowCheckIn {
{
"title": TranslationBase.of(AppGlobal.context).add,
"subtitle": TranslationBase.of(AppGlobal.context).reminder,
"icon": "reminder_icon.png",
"icon": "assets/images/new-design/reminder_icon.png",
"caller": "addReminder",
},
{
"title": TranslationBase.of(AppGlobal.context).hospital,
"subtitle": TranslationBase.of(AppGlobal.context).location,
"icon": "location_icon.png",
"icon": "assets/images/new-design/location_icon.png",
"caller": "navigateToProject",
},
{
"title": TranslationBase.of(AppGlobal.context).online,
"subtitle": TranslationBase.of(AppGlobal.context).payment,
"icon": "check-in.png",
"icon": "assets/images/new-design/check-in.png",
"caller": "goToTodoList",
}
];

@ -29,6 +29,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -73,7 +74,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
shrinkWrap: true,
itemBuilder: (context, index) {
// bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule");
bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc"));
bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") ||
(widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") ||
(Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) &&
widget.appo.clinicID == 10 &&
(appoButtonsList[index].caller == "prescriptions" || appoButtonsList[index].caller == "radiology" || appoButtonsList[index].caller == "labResult")));
return InkWell(
onTap: shouldEnable
? null
@ -87,6 +92,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
hasBadge: true,
isEnable: !shouldEnable,
imgColor: Color(0xff28323A),
isPngImage: appoButtonsList[index].icon.contains(".png") ? true : false,
),
);
},
@ -582,16 +588,50 @@ class _AppointmentActionsState extends State<AppointmentActions> {
navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) {
if (widget.projectViewModel.isLogin) {
if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
}
// if (model.count != 0) {
getPatientAppointmentHistoryWithAppo();
// } else {
// AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
// }
} else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
Navigator.push(
context,
FadePage(
page: ToDo(
isShowAppBar: true,
isFromMyAppointments: true,
appointment: widget.appo,
)));
}
}
getPatientAppointmentHistoryWithAppo() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]);
Navigator.push(
context,
FadePage(
page: ToDo(
isShowAppBar: true,
isFromMyAppointments: true,
appointment: appo,
),
),
);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err);
});
}
rateAppointment() {
widget.browser = new MyInAppBrowser();
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';

@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -51,12 +52,13 @@ class ToDo extends StatefulWidget {
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
var languageID;
MyInAppBrowser browser;
bool isShowAppBar = true;
Function onBackClick;
bool isFromMyAppointments;
AppoitmentAllHistoryResultList appointment;
ToDo({@required this.isShowAppBar, this.onBackClick});
ToDo({@required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment});
@override
_ToDoState createState() => _ToDoState();
@ -82,6 +84,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool isInsured = false;
bool isEligible = false;
bool isCash = false;
MyInAppBrowser browser;
@override
void initState() {
@ -543,9 +546,15 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
performNextAction(AppoitmentAllHistoryResultList appo) {
switch (appo.nextAction) {
case 0:
// getAppoQR(context, appo);
break;
case 10:
confirmAppointment(appo);
break;
case 15:
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingPaymentPending);
break;
case 20:
getPatientShare(context, appo);
// checkPatientNphiesEligibility(context, appo);
@ -833,6 +842,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
});
}
dataLoaded = true;
if (widget.isFromMyAppointments) {
performNextAction(widget.appointment);
widget.isFromMyAppointments = false;
}
});
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -842,7 +855,19 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err);
});
// getAncillaryOrders();
getToDoCount();
}
getToDoCount() {
toDoProvider.setState(0, true, "0");
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {}
}).catchError((err) {
print(err);
});
}
checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) {
@ -901,7 +926,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
if (res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
}
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
@ -962,23 +989,23 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup;
FlutterNfcKit.nfcAvailability.then((value) {
if (value == NFCAvailability.available) {
PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj;
patientShareResponse.doctorSpeciality = appo.doctorSpeciality;
patientShareResponse.projectName = appo.projectName;
patientShareResponse.appointmentDate = appo.appointmentDate;
patientShareResponse.appointmentNo = appo.appointmentNo;
patientShareResponse.clinicID = appo.clinicID;
patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup;
navigateToQR(context, "", patientShareResponse, appo);
projectViewModel.analytics.todoList.to_do_list_check_in(appo);
} else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
}
});
// FlutterNfcKit.nfcAvailability.then((value) {
// if (value == NFCAvailability.available) {
// PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj;
patientShareResponse.doctorSpeciality = appo.doctorSpeciality;
patientShareResponse.projectName = appo.projectName;
patientShareResponse.appointmentDate = appo.appointmentDate;
patientShareResponse.appointmentNo = appo.appointmentNo;
patientShareResponse.clinicID = appo.clinicID;
patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup;
navigateToQR(context, "", patientShareResponse, appo);
projectViewModel.analytics.todoList.to_do_list_check_in(appo);
// } else {
// Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
// }
// });
projectViewModel.analytics.todoList.to_do_list_check_in(appo);
DoctorsListService service = new DoctorsListService();
@ -1002,7 +1029,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse),
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, isCashPatient: isCash),
),
);
},
@ -1024,9 +1051,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser(
browser.openPaymentBrowser(
amount,
"Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
@ -1037,7 +1064,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
widget.browser,
browser,
appo.isLiveCareAppointment,
"2",
appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "",
@ -1068,7 +1095,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
browser.close();
MyInAppBrowser.isPaymentDone = true;
return;
}
@ -1078,7 +1105,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
// if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close();
browser.close();
MyInAppBrowser.isPaymentDone = false;
return;
}

@ -3,20 +3,24 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
class PaymentDialog extends StatefulWidget {
AppoitmentAllHistoryResultList appo;
PatientShareResponse patientShareResponse;
bool isCashPatient;
final Function onPaymentMethodSelected;
PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse});
PaymentDialog({@required this.appo, @required this.onPaymentMethodSelected, this.patientShareResponse, this.isCashPatient = false});
@override
_PaymentDialogState createState() => _PaymentDialogState();
@ -31,84 +35,118 @@ class _PaymentDialogState extends State<PaymentDialog> {
//height: 550.0,
width: 450.0,
padding: EdgeInsets.all(21),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[
Text(
TranslationBase.of(context).invoiceDetails,
style: TextStyle(
fontSize: 24.0,
fontWeight: FontWeight.w600,
letterSpacing: -1.14,
color: Color(0xff2B353E),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
TranslationBase.of(context).invoiceDetails,
style: TextStyle(
fontSize: 24.0,
fontWeight: FontWeight.w600,
letterSpacing: -1.14,
color: Color(0xff2B353E),
),
),
),
Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600,letterSpacing: -0.64)),
Text(getDate(widget.appo.appointmentDate), style: getTextStyle()),
Text(widget.appo.projectName, style: getTextStyle()),
Divider(
color: Colors.grey,
),
Table(
children: [
TableRow(decoration: BoxDecoration(), children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())),
]),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())),
]),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())),
]),
],
),
Divider(color: Colors.grey),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
Text(widget.appo.doctorTitle + " " + widget.appo.doctorNameObj, style: TextStyle(color: Color(0xff2E303A), fontSize: 16.0, fontWeight: FontWeight.w600, letterSpacing: -0.64)),
Text(getDate(widget.appo.appointmentDate), style: getTextStyle()),
Text(widget.appo.projectName, style: getTextStyle()),
Divider(
color: Colors.grey,
),
),
getPaymentMethods(),
SizedBox(height: 12),
Text(
TranslationBase.of(context).appoPaymentConfirm,
style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.56),
),
SizedBox(height: 12),
Container(
alignment: Alignment.center,
child: Row(
// direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel_nocaps,
() {
Navigator.pop(context, null);
},
color: CustomColors.accentColor,
textColor: Colors.white,
Table(
children: [
TableRow(decoration: BoxDecoration(), children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShare.toString())),
]),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientTaxToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientTaxAmount.toString())),
]),
TableRow(children: [
TableCell(child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo)),
TableCell(child: _getNormalText(widget.patientShareResponse.patientShareWithTax.toString())),
]),
],
),
Divider(color: Colors.grey),
Text(
TranslationBase.of(context).YouCanPayByTheFollowingOptions,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
),
),
getPaymentMethods(),
SizedBox(height: 12),
Text(
TranslationBase.of(context).appoPaymentConfirm,
style: TextStyle(fontSize: 14.0, color: CustomColors.accentColor, fontWeight: FontWeight.w600, letterSpacing: -0.56),
),
SizedBox(height: 12),
Container(
alignment: Alignment.center,
child: Row(
// direction: Axis.horizontal,
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).cancel_nocaps,
() {
Navigator.pop(context, null);
},
color: CustomColors.accentColor,
textColor: Colors.white,
),
),
),
mWidth(10.0),
Expanded(
child: DefaultButton(
TranslationBase.of(context).confirm,
() {
Navigator.pop(context, widget.patientShareResponse);
},
color: CustomColors.green,
textColor: Colors.white,
mWidth(10.0),
Expanded(
child: DefaultButton(
TranslationBase.of(context).confirm,
() {
Navigator.pop(context, widget.patientShareResponse);
},
color: CustomColors.green,
textColor: Colors.white,
),
),
),
],
],
),
),
),
]),
widget.isCashPatient
? Column(
children: [
mHeight(10.0),
Text(
TranslationBase.of(context).cashAmountUpdateInsurance,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
),
),
mHeight(5.0),
DefaultButton(
TranslationBase.of(context).updateInsuranceText,
() {
Navigator.pop(context, null);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
color: Color(0xffEAA118),
textColor: Colors.white,
),
],
)
: Container(),
],
),
),
);
}

@ -133,31 +133,32 @@ class _AttachInsuranceCardImageDialogState extends State<AttachInsuranceCardImag
Padding(
padding: const EdgeInsets.all(18.0),
child:
// Text(TranslationBase.of(context).habibCallCenter,
// style: TextStyle(
// fontSize: 16,
// letterSpacing: -0.48,
// fontWeight: FontWeight.w600,
// ),
// ),
DefaultButton(
TranslationBase.of(context).updateInsuranceManually,
() {
Navigator.pop(context);
Navigator.push(
context,
FadePage(
page: UpdateInsuranceManually(
patientIdentificationNo: widget.identificationNo,
patientMobileNumber: widget.mobileNo,
patientID: num.parse(widget.fileNo),
),
),
);
},
textColor: Colors.white,
color: CustomColors.accentColor,
Text(TranslationBase.of(context).habibCallCenter,
style: TextStyle(
fontSize: 16,
letterSpacing: -0.48,
fontWeight: FontWeight.w600,
),
),
// DefaultButton(
// TranslationBase.of(context).updateInsuranceManually,
// () {
// Navigator.pop(context);
// Navigator.push(
// context,
// FadePage(
// page: UpdateInsuranceManually(
// patientIdentificationNo: widget.identificationNo,
// patientMobileNumber: widget.mobileNo,
// patientID: num.parse(widget.fileNo),
// ),
// ),
// );
// },
// textColor: Colors.white,
// color: CustomColors.accentColor,
// ),
),
SizedBox(
height: 25.0,

@ -184,24 +184,24 @@ class InsurancePage extends StatelessWidget {
void updateManually(BuildContext context, String errorMsg, String patientIdentificationID, int patientID, String mobileNumber) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
// confirmMessage: errorMsg + ". " + TranslationBase.of(context).habibCallCenter,
// okText: TranslationBase.of(context).ok,
// cancelText: TranslationBase.of(context).cancel,
confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
confirmMessage: errorMsg + ". " + TranslationBase.of(context).habibCallCenter,
okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel,
// confirmMessage: errorMsg + ". " + TranslationBase.of(context).updateInsuranceManuallyDialog,
// okText: TranslationBase.of(context).yes,
// cancelText: TranslationBase.of(context).no,
okFunction: () => {
Navigator.pop(context),
Navigator.push(
context,
FadePage(
page: UpdateInsuranceManually(
patientIdentificationNo: patientIdentificationID,
patientID: patientID,
patientMobileNumber: mobileNumber,
),
),
),
// Navigator.push(
// context,
// FadePage(
// page: UpdateInsuranceManually(
// patientIdentificationNo: patientIdentificationID,
// patientID: patientID,
// patientMobileNumber: mobileNumber,
// ),
// ),
// ),
},
cancelFunction: () => {});
dialog.showAlertDialog(context);

@ -59,9 +59,9 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
isScrollable: false,
indicatorWeight: 3.0,
indicatorColor: CustomColors.accentColor,
labelColor: Theme.of(context).primaryColor,
labelColor: CustomColors.textDarkColor,
labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey,
unselectedLabelColor: CustomColors.textDarkColor,
tabs: <Widget>[
Container(
child: Center(

@ -417,7 +417,8 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
flex: 1,
child: InkWell(
onTap: () {
if (projectViewModel.havePrivilege(100)) widget.onPharmacyClick();
if (projectViewModel.havePrivilege(100))
widget.onPharmacyClick();
},
child: Stack(children: [
Container(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
@ -11,6 +12,8 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
import 'fragments/home_page_fragment2.dart';
import 'landing_page_pharmcy.dart';
@ -48,7 +51,9 @@ class _HomePageState2 extends State<HomePage2> {
widget.onLoginClick();
},
onPharmacyClick: () {
getPharmacyToken(model);
// getPharmacyToken(model);
Uri uri = Uri.parse(PHARMACY_REDIRECT_URL);
launchUrl(uri, mode: LaunchMode.externalApplication);
},
onMedicalFileClick: () {
widget.onMedicalFileClick();

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/geofencing/GeofencingServices.dart';
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -17,6 +18,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page_2.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page_new.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/pages/videocall-webrtc-rnd/webrtc/start_video_call.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
@ -36,6 +38,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/not_auh_page.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -71,6 +74,7 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
var authProvider = new AuthProvider();
AppointmentRateViewModel appointmentRateViewModel = locator<AppointmentRateViewModel>();
int currentTab = 0;
PageController pageController;
@ -636,21 +640,36 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
void checkUserStatus(token) async {
await PushNotificationHandler.getInstance().isAndroidPermissionGranted();
authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value));
// authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value));
if (authenticatedUserObject.isLogin) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {});
authService.getDashboard().then((value) => {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
}
}),
authService.getDashboard().then((value) async {
setState(() {
if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
}
});
if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) {
appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) async {
if (appointmentRateViewModel.isHaveAppointmentNotRate) {
await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true);
Navigator.push(
context,
FadePage(
page: RateAppointmentDoctor(),
),
);
}
}).catchError((err) {
print(err);
});
}
});
}
projectViewModel.analytics.setUser(data);
} else {

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -209,7 +210,9 @@ class ServicesView extends StatelessWidget {
Navigator.push(context, FadePage(page: CMCPage()));
locator<GAnalytics>().hmgServices.logServiceName('comprehensive medical checkup');
} else if (hmgServices.action == 5) {
getPharmacyToken(context);
// getPharmacyToken(context);
Uri uri = Uri.parse(PHARMACY_REDIRECT_URL);
launchUrl(uri, mode: LaunchMode.externalApplication);
locator<GAnalytics>().hmgServices.logServiceName('al habib pharmacy');
} else if (hmgServices.action == 6) {
Navigator.push(context, FadePage(page: MedicalProfilePageNew()));

@ -42,8 +42,9 @@ import 'package:provider/provider.dart';
class ConfirmLogin extends StatefulWidget {
final Function changePageViewIndex;
final fromRegistration;
final bool isDubai;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai =false}) : super(key: key);
final bool isDubai;
const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false, this.isDubai = false}) : super(key: key);
@override
_ConfirmLogin createState() => _ConfirmLogin();
@ -386,9 +387,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
request.sMSSignature = await SMSOTP.getSignature();
GifLoaderDialogUtils.showMyDialog(context);
if (healthId != null || widget.isDubai) {
if(!widget.isDubai){
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
if (!widget.isDubai) {
request.dob = dob; //isHijri == 1 ? dob : dateFormat2.format(dateFormat.parse(dob));
}
request.healthId = healthId;
request.isHijri = isHijri;
await this.authService.sendActivationCodeRegister(request).then((result) {
@ -568,7 +569,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
var request = this.getCommonRequest().toJson();
dynamic res;
if (healthId != null || widget.isDubai) {
if(!widget.isDubai) {
if (!widget.isDubai) {
request['DOB'] = dob;
}
request['HealthId'] = healthId;
@ -583,7 +584,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
result = CheckActivationCode.fromJson(result),
if (this.registerd_data != null && this.registerd_data.isRegister == true)
{
// if(widget.isDubai ==false){
// if(widget.isDubai ==false){
widget.changePageViewIndex(1),
Navigator.popUntil(context, (route) => Utils.route(route, equalsTo: RegisterNew)),
}
@ -694,36 +695,16 @@ class _ConfirmLogin extends State<ConfirmLogin> {
projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true);
// getToDoCount();
GifLoaderDialogUtils.hideDialog(context);
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(AppGlobal.context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
},
insertIMEI()
})
.catchError((err) {
print(err);
});
getToDoCount();
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false);
}
loading(flag) {

@ -345,34 +345,45 @@ class _Login extends State<Login> {
authenticatedUserObject.user = result.list;
projectViewModel.user = authenticatedUserObject.user;
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
GifLoaderDialogUtils.hideDialog(context);
getToDoCount();
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false);
// appointmentRateViewModel
// .getIsLastAppointmentRatedList()
// .then((value) => {
// getToDoCount(),
// GifLoaderDialogUtils.hideDialog(context),
// if (appointmentRateViewModel.isHaveAppointmentNotRate)
// {
// Navigator.pushAndRemoveUntil(
// context,
// FadePage(
// page: RateAppointmentDoctor(),
// ),
// (r) => false)
// }
// else
// {
// Navigator.pushAndRemoveUntil(
// context,
// FadePage(
// page: LandingPage(),
// ),
// (r) => false)
// }
// })
// .catchError((err) {
// print(err);
// GifLoaderDialogUtils.hideDialog(context);
// });
});
}

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Authentication/check_activation_code
import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/countries_list.dart';
import 'package:diplomaticquarterapp/models/Authentication/register_info_response.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/routes.dart';
@ -704,31 +705,41 @@ class _RegisterInfo extends State<RegisterInfo> {
projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true);
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(AppGlobal.context),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
appointmentRateViewModel.getIsLastAppointmentRatedList().then((value) {
getToDoCount();
GifLoaderDialogUtils.hideDialog(AppGlobal.context);
if (appointmentRateViewModel.isHaveAppointmentNotRate) {
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(isFromRegistration: true),
),
(r) => false);
} else {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).validInsurance,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () {
ConfirmDialog.closeAlertDialog(context);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
cancelFunction: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
});
dialog.showAlertDialog(context);
}
}).catchError((err) {
print(err);
//GifLoaderDialogUtils.hideDialog(context);
});

@ -27,7 +27,8 @@ class _RequestTypePageState extends State<RequestTypePage> {
@override
Widget build(BuildContext context) {
return BaseView<AskDoctorViewModel>(
onModelReady: (model) => model.getQuestionTypes(),
// onModelReady: (model) => model.getQuestionTypes(),
onModelReady: (model) => model.getCallRequestTypeLOVs(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).requestType,

@ -35,6 +35,7 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLaboratoryResult(
invoiceNo: widget.patientLabOrders.invoiceNo,
invoiceType: widget.patientLabOrders.invoiceType,
clinicID: widget.patientLabOrders.clinicID,
projectID: widget.patientLabOrders.projectID,
orderNo: widget.patientLabOrders.orderNo,
@ -75,34 +76,34 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
],
),
),
bottomSheet: Container(
color: Colors.white,
height: MediaQuery.of(context).size.height * 0.081,
width: double.infinity,
padding: EdgeInsets.all(12.0),
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: DefaultButton(
TranslationBase.of(context).downloadReport,
() async {
GifLoaderDialogUtils.showMyDialog(context);
await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true);
GifLoaderDialogUtils.hideDialog(context);
try {
String path = await _createFileFromString(model.labReportPDF, "pdf");
OpenFilex.open(path);
} catch (ex) {
AppToast.showErrorToast(message: "Cannot open file.");
}
},
textColor: Colors.white,
),
),
],
),
),
// bottomSheet: Container(
// color: Colors.white,
// height: MediaQuery.of(context).size.height * 0.081,
// width: double.infinity,
// padding: EdgeInsets.all(12.0),
// child: Column(
// children: <Widget>[
// Container(
// width: MediaQuery.of(context).size.width * 0.9,
// child: DefaultButton(
// TranslationBase.of(context).downloadReport,
// () async {
// GifLoaderDialogUtils.showMyDialog(context);
// await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true);
// GifLoaderDialogUtils.hideDialog(context);
// try {
// String path = await _createFileFromString(model.labReportPDF, "pdf");
// OpenFilex.open(path);
// } catch (ex) {
// AppToast.showErrorToast(message: "Cannot open file.");
// }
// },
// textColor: Colors.white,
// ),
// ),
// ],
// ),
// ),
),
);
}

@ -28,6 +28,7 @@ class RadiologyDetailsPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(
invoiceType: finalRadiology.invoiceType,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,

@ -191,11 +191,17 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: DefaultButton(
TranslationBase.of(context).later,
() {
Navigator.pushReplacement(
// Navigator.pushReplacement(
// context,
// FadePage(
// page: LandingPage(),
// ),
// );
Navigator.pop(
context,
);
Navigator.pop(
context,
FadePage(
page: LandingPage(),
),
);
},
color: CustomColors.accentColor,

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/viewModels/appointment_rate_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_clinic.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
@ -9,12 +11,19 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class RateAppointmentDoctor extends StatefulWidget {
bool isFromRegistration;
RateAppointmentDoctor({Key key, this.isFromRegistration = false}) : super(key: key);
@override
_RateAppointmentDoctorState createState() => _RateAppointmentDoctorState();
}
@ -23,9 +32,11 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
final formKey = GlobalKey<FormState>();
String note = "";
int rating = 0;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
@ -158,12 +169,46 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
child: DefaultButton(
TranslationBase.of(context).later,
() {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
if(widget.isFromRegistration) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).validInsurance,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () {
ConfirmDialog.closeAlertDialog(context);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
cancelFunction: () {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
});
dialog.showAlertDialog(context);
} else {
if(projectViewModel.isLoginChild) {
Navigator.pushReplacement(
context,
FadePage(
page: LandingPage(),
),
);
} else {
Navigator.pop(
context,
// FadePage(
// page: LandingPage(),
// ),
);
}
}
},
color: CustomColors.accentColor,
textColor: Colors.white,

@ -48,16 +48,16 @@ class DoctorsListService extends BaseService {
}
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
// Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
// "LanguageID": languageID == 'ar' ? 1 : 2,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
// "DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID,
"ProjectID": projectID,
@ -614,6 +614,19 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistoryWithAppoNo(int appoNo) async {
Map<String, dynamic> request;
request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async {
Map<String, dynamic> request;
@ -1540,13 +1553,14 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async {
Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async {
Map<String, dynamic> request;
request = {
"AppointmentNo": appointmentNo,
"NFC_Code": nfcCode,
"ProjectID": projectId,
"CheckinBy": checkInBy
};
dynamic localRes;
await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async {
@ -1843,6 +1857,4 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
}

@ -18,19 +18,7 @@ class ClinicListService extends BaseService {
double long;
Future<Map> getClinicsList(context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
Map<String, dynamic> request = {};
dynamic localRes;
@ -44,21 +32,10 @@ class ClinicListService extends BaseService {
}
Future<Map> getActiveAppointmentNo(context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
Map<String, dynamic> request = {};
request = {
// "LanguageID": languageID == 'ar' ? 1 : 2,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
// "PatientOutSA": user.outSA,
"IsActiveAppointment": true,
// "DeviceTypeID": req.DeviceTypeID,
// "PatientType": user.patientType,
// "PatientTypeID": user.patientType,
// "SessionID": null
};
dynamic localRes;
@ -72,19 +49,7 @@ class ClinicListService extends BaseService {
}
Future<Map> getProjectsList(context) async {
Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
Map<String, dynamic> request = {};
dynamic localRes;
@ -113,9 +78,9 @@ class ClinicListService extends BaseService {
"SelectedDate": "",
"SelectedTime": "",
"License": true,
"VersionID": 5.6,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
// "VersionID": 5.6,
// "Channel": 3,
// "LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958",
"SessionID": null,
@ -155,11 +120,11 @@ class ClinicListService extends BaseService {
request = {
"ChiefComplaintID": chiefComplaintID,
"ProjectID": projectID,
"VersionID": 5.6,
"Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress,
"generalid": req.generalid,
// "VersionID": 5.6,
// "Channel": 3,
// "LanguageID": languageID == 'ar' ? 1 : 2,
// "IPAdress": req.IPAdress,
// "generalid": req.generalid,
"SessionID": null,
"isDentalAllowedBackend": true,
"Latitude": lat != null ? lat.toString() : "0.0",

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:convert';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
@ -32,8 +33,8 @@ class _SplashScreenState extends State<SplashScreen> {
super.initState();
Timer(
Duration(seconds: 1, milliseconds: 500),
() {
loadPrivilege().then((value) {
() async {
await loadPrivilege().then((value) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),
@ -42,11 +43,6 @@ class _SplashScreenState extends State<SplashScreen> {
});
},
);
AppSharedPreferences().getAll().then((value) {
// debugPrint("ALL SHARED PREFERENCES!!!!!");
// debugPrint(jsonEncode(value));
});
}
/// load the Privilege from service
@ -55,11 +51,17 @@ class _SplashScreenState extends State<SplashScreen> {
ProjectViewModel projectProvider = Provider.of<ProjectViewModel>(context, listen: false);
projectProvider.setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel);
projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel);
projectProvider.setProjectsDetailList(_privilegeService.projectDetailListModel);
AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch
AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en");
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));
PushNotificationHandler(context).init(); // Asyncronously
AppSharedPreferences().getAll().then((value) {
// debugPrint("ALL SHARED PREFERENCES!!!!!");
// debugPrint(jsonEncode(value));
});
}
@override

@ -303,9 +303,11 @@ class PushNotificationHandler {
onToken(token);
});
FirebaseMessaging.instance.getAPNSToken().then((value) {
print("Push APNS getToken: " + value);
});
if(Platform.isIOS) {
FirebaseMessaging.instance.getAPNSToken().then((value) {
print("Push APNS getToken: " + value);
});
}
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
}
@ -336,7 +338,7 @@ class PushNotificationHandler {
onToken(String token) async {
print("Push Notification Token: " + token);
AppSharedPreferences().setString(PUSH_TOKEN, token);
await AppSharedPreferences().setString(PUSH_TOKEN, token);
DEVICE_TOKEN = token;
}

@ -2908,6 +2908,10 @@ class TranslationBase {
String get updateInsuranceText => localizedValues["updateInsurance"][locale.languageCode];
String get downloadReport => localizedValues["downloadReport"][locale.languageCode];
String get habibCallCenter => localizedValues["habibCallCenter"][locale.languageCode];
String get cashAmountUpdateInsurance => localizedValues["cashAmountUpdateInsurance"][locale.languageCode];
String get validInsurance => localizedValues["validInsurance"][locale.languageCode];
String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode];
String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode];
}

@ -10,6 +10,7 @@ import 'package:connectivity/connectivity.dart';
import 'package:crypto/crypto.dart' as crypto;
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
@ -45,6 +46,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:google_api_availability/google_api_availability.dart';
import 'dart:math' show asin, cos, pi, pow, sin, sqrt;
// import 'package:flutter_hms_gms_availability/flutter_hms_gms_availability.dart';
import 'package:provider/provider.dart';
@ -294,15 +296,17 @@ class Utils {
));
}
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg',
subTitle: TranslationBase.of(context).radiologySubtitle,
isEnable: projectViewModel.havePrivilege(7),
medical.add(
InkWell(
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology.svg',
subTitle: TranslationBase.of(context).radiologySubtitle,
isEnable: projectViewModel.havePrivilege(7),
),
),
));
);
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
@ -782,6 +786,24 @@ class Utils {
return false;
}
static double distance(double lat1, double lon1, double lat2, double lon2) {
const r = 6372.8; // Earth radius in kilometers
final dLat = _toRadians(lat2 - lat1);
final dLon = _toRadians(lon2 - lon1);
final lat1Radians = _toRadians(lat1);
final lat2Radians = _toRadians(lat2);
final a = _haversin(dLat) + cos(lat1Radians) * cos(lat2Radians) * _haversin(dLon);
final c = 2 * asin(sqrt(a));
return r * c;
}
static double _toRadians(double degrees) => degrees * pi / 180;
static double _haversin(double radians) => pow(sin(radians / 2), 2);
static Widget tableColumnValueWithUnderLine(String text, {bool isLast = false, bool isCapitable = true}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -820,10 +842,27 @@ class Utils {
return isVidaPlus;
}
static String generateSignature() {
static bool isHMCProject(ProjectViewModel projectViewModel, int projectID) {
bool isHMCProject = false;
projectViewModel.hMCProjectListModel.forEach((element) {
if (element.projectID == projectID) {
isHMCProject = true;
}
});
return isHMCProject;
}
static ProjectDetailListModel getProjectDetailObj(ProjectViewModel projectViewModel, int projectID) {
ProjectDetailListModel projectDetailListModel;
projectViewModel.projectDetailListModel.forEach((element) {
if (element.projectID == projectID) {
projectDetailListModel = element;
}
});
return projectDetailListModel;
}
static String generateSignature() {}
}
Widget applyShadow({Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}) {

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/extensions/string_extensions.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -32,6 +33,7 @@ class DoctorCard extends StatelessWidget {
final String vaccineName;
final bool isSickLeave;
final int sickLeaveStatus;
final int projectID;
DoctorCard(
{this.name,
@ -51,7 +53,8 @@ class DoctorCard extends StatelessWidget {
this.vaccineName = "",
this.isParentAppointment = false,
this.isSickLeave = false,
this.sickLeaveStatus = 0});
this.sickLeaveStatus = 0,
this.projectID = 0});
ProjectViewModel projectViewModel;
@ -87,11 +90,13 @@ class DoctorCard extends StatelessWidget {
decoration: isShowInOutPatient
? BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: isLiveCareAppointment
? Color(0xff2E303A)
: !isInOutPatient
? Color(0xffD02127)
: Color(0xffa9a089),
color: Utils.isHMCProject(projectViewModel, projectID)
? Color(0xff3FACC8)
: isLiveCareAppointment
? Color(0xff2E303A)
: !isInOutPatient
? Color(0xffD02127)
: Color(0xffa9a089),
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10),
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(10),

@ -51,8 +51,8 @@ class MedicalProfileItem extends StatelessWidget {
)
: SvgPicture.asset(
"assets/images/new/services/$imagePath",
height: SizeConfig.widthMultiplier * 7,
width: SizeConfig.widthMultiplier * 7,
height: height != null ? height : SizeConfig.widthMultiplier * 7,
width: width != null ? width : SizeConfig.widthMultiplier * 7,
color: imgColor,
),
mFlex(2),

@ -99,9 +99,9 @@ class Mdialog extends StatelessWidget {
cancelFunction();
},
child: Container(
decoration: containerRadius(CustomColors.lightGreyColor, 12),
decoration: containerRadius(CustomColors.accentColor, 12),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Center(child: Texts(cancelText, variant: "caption3")),
child: Center(child: Texts(cancelText, variant: "caption3", color: CustomColors.white,)),
),
),
),
@ -110,7 +110,7 @@ class Mdialog extends StatelessWidget {
child: InkWell(
onTap: okFunction,
child: Container(
decoration: containerRadius(CustomColors.accentColor, 12),
decoration: containerRadius(CustomColors.green, 12),
padding: EdgeInsets.only(top: 8,bottom: 8),
child: Center(
child: Texts(

@ -1,7 +1,7 @@
name: diplomaticquarterapp
description: A new Flutter application.
version: 4.5.028+4050028
version: 4.5.73+1
environment:
sdk: ">=2.7.0 <3.0.0"
@ -57,8 +57,8 @@ dependencies:
shared_preferences: ^2.0.0
# flutter_flexible_toast: ^0.1.4
fluttertoast: ^8.0.8
firebase_messaging: ^14.1.0
firebase_analytics: ^10.0.5
firebase_messaging: 14.1.0
firebase_analytics: 10.0.5
# Progress bar
@ -100,7 +100,7 @@ dependencies:
location: ^4.3.0
# Qr code Scanner
# barcode_scan_fix: ^1.0.2
barcode_scan2: ^4.2.2
barcode_scan2: 4.2.2
# Rating Stars
rating_bar: ^0.2.0
@ -139,10 +139,10 @@ dependencies:
# TEMPORAL FIX for https://github.com/builttoroam/device_calendar/issues/507
# device_calendar: ^4.3.1
# device_calendar:
# git:
# url: https://github.com/builttoroam/device_calendar.git
# ref: develop
# device_calendar:
# git:
# url: https://github.com/builttoroam/device_calendar.git
# ref: develop
#Handle Geolocation
geolocator: ^9.0.2
@ -178,7 +178,7 @@ dependencies:
wifi: ^0.1.5
vibration: ^1.7.3
flutter_nfc_kit: ^3.3.1
flutter_nfc_kit: 3.3.1
geofencing: ^0.1.0
@ -187,7 +187,7 @@ dependencies:
in_app_update: ^3.0.0
# in_app_review: ^2.0.6
in_app_review: 2.0.3
badges: ^2.0.1
flutter_app_icon_badge: ^2.0.0

Loading…
Cancel
Save