Merge branch 'development_v3.3' into dev_3.3_faiz_payfort

dev_3.3_faiz_payfort
haroon amjad 2 years ago
commit bea15150aa

@ -540,7 +540,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.75; MARKETING_VERSION = 4.5.77;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -684,7 +684,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.75; MARKETING_VERSION = 4.5.77;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -722,7 +722,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.75; MARKETING_VERSION = 4.5.77;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

@ -1,97 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArgument
argument = "-FIRAnalyticsDebugEnabled"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-v"
isEnabled = "NO">
</CommandLineArgument>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

@ -20,9 +20,12 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'http://10.50.100.198:4422/';
var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';

@ -1903,4 +1903,6 @@ const Map localizedValues = {
"validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"},
"checkInViaLocation": {"en": "Check-In Via Location", "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": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."}, "locationCheckInError": {"en": "Please make sure that you're within the hospital location to perform online check-in.", "ar": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."},
"upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"},
"noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"},
}; };

@ -5,6 +5,7 @@ class Reports {
DateTime encounterDate; DateTime encounterDate;
int projectID; int projectID;
int invoiceNo; int invoiceNo;
int invoiceNo_VP;
int encounterNo; int encounterNo;
String procedureId; String procedureId;
int requestType; int requestType;
@ -35,6 +36,7 @@ class Reports {
this.encounterDate, this.encounterDate,
this.projectID, this.projectID,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP,
this.encounterNo, this.encounterNo,
this.procedureId, this.procedureId,
this.requestType, this.requestType,
@ -67,6 +69,7 @@ class Reports {
json['EncounterDate']); //json['EncounterDate']; json['EncounterDate']); //json['EncounterDate'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
encounterNo = json['EncounterNo']; encounterNo = json['EncounterNo'];
procedureId = json['ProcedureId']; procedureId = json['ProcedureId'];
requestType = json['RequestType']; requestType = json['RequestType'];
@ -104,6 +107,7 @@ class Reports {
data['EncounterDate'] = this.encounterDate; data['EncounterDate'] = this.encounterDate;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['EncounterNo'] = this.encounterNo; data['EncounterNo'] = this.encounterNo;
data['ProcedureId'] = this.procedureId; data['ProcedureId'] = this.procedureId;
data['RequestType'] = this.requestType; data['RequestType'] = this.requestType;

@ -36,7 +36,7 @@ class AppointmentRateService extends BaseService {
}, body: bodyData); }, body: bodyData);
} }
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, int languageID) async {
hasError = false; hasError = false;
AppointmentRate appointmentRate = AppointmentRate(); AppointmentRate appointmentRate = AppointmentRate();
appointmentRate.rate = rate; appointmentRate.rate = rate;
@ -47,6 +47,7 @@ class AppointmentRateService extends BaseService {
appointmentRate.note = note; appointmentRate.note = note;
appointmentRate.createdBy = 2; appointmentRate.createdBy = 2;
appointmentRate.editedBy = 2; appointmentRate.editedBy = 2;
appointmentRate.languageID = languageID;
await baseAppClient.post(NEW_RATE_APPOINTMENT_URL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(NEW_RATE_APPOINTMENT_URL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;

@ -75,8 +75,13 @@ class BaseAppClient {
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
if (body.containsKey('LanguageID')) { if (body.containsKey('LanguageID')) {
if(body['LanguageID'] != null) { if (body['LanguageID'] != null) {
body['LanguageID'] = body['LanguageID']; //change this line because language issue happened on dental
body['LanguageID'] = body['LanguageID'] == 'ar'
? 1
: body['LanguageID'] == 'en'
? 2
: body['LanguageID'];
} else { } else {
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2; body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
} }
@ -153,7 +158,8 @@ class BaseAppClient {
? body['PatientOutSA'] ? body['PatientOutSA']
: user['OutSA'] : user['OutSA']
: user['OutSA']; : user['OutSA'];
body['SessionID'] = getSessionId(body['TokenID']); //getSe body['SessionID'] = getSessionId(body['TokenID'] != null ? body['TokenID'] : ""); //getSe
// body['SessionID'] = body['TokenID']; //getSe
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -169,7 +175,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body['PatientID'] = 1231755; //3844083 // body['PatientID'] = 1400563; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -709,12 +715,13 @@ class BaseAppClient {
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
model.setState(0, false, null); model.setState(0, 0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
String getSessionId(String id) { String getSessionId(String id) {
///return id.replaceAll(RegExp('/[^\w\s]/'), ''); ///return id.replaceAll(RegExp('/[^\w\s]/'), '');
// if (id != null) return id.replaceAll(RegExp('/[^a-zA-Z]'), '');
return id.replaceAll(RegExp('/[^a-zA-Z]'), ''); return id.replaceAll(RegExp('/[^a-zA-Z]'), '');
} }

@ -20,6 +20,7 @@ class ErService extends BaseService {
var long = await sharedPref.getDouble(USER_LONG); var long = await sharedPref.getDouble(USER_LONG);
body['Latitude'] = lat ?? 0; body['Latitude'] = lat ?? 0;
body['Longitude'] = long ?? 0; body['Longitude'] = long ?? 0;
body['IsForER'] = true;
dynamic localRes; dynamic localRes;

@ -51,13 +51,15 @@ class HospitalService extends BaseService {
} }
} }
Future getHospitals({bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async { Future getHospitals(int languageID, {bool isResBasedOnLoc = true, bool isAdvancePayment = false}) async {
if (isResBasedOnLoc) await _getCurrentLocation(); if (isResBasedOnLoc) await _getCurrentLocation();
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['Latitude'] = await this.sharedPref.getDouble(USER_LAT); body['Latitude'] = await this.sharedPref.getDouble(USER_LAT);
body['Longitude'] = await this.sharedPref.getDouble(USER_LONG); body['Longitude'] = await this.sharedPref.getDouble(USER_LONG);
body['IsOnlineCheckIn'] = isResBasedOnLoc; body['IsOnlineCheckIn'] = isResBasedOnLoc;
body['IsAdvancePayment'] = isAdvancePayment; body['IsAdvancePayment'] = isAdvancePayment;
body['LanguageID'] = languageID;
body['IsForER'] = true;
await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PROJECT, onSuccess: (dynamic response, int statusCode) {
_hospitals.clear(); _hospitals.clear();

@ -191,6 +191,8 @@ class LabsService extends BaseService {
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
body['Procedure'] = procedure; body['Procedure'] = procedure;
body['Procedure'] = procedure;
body['LanguageID'] = 1;
await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear(); labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
@ -223,6 +225,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.isDownload = isDownload; _requestSendLabReportEmail.isDownload = isDownload;
_requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID;
_requestSendLabReportEmail.languageID = 1;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
if (isDownload) { if (isDownload) {

@ -42,9 +42,10 @@ class ReportsService extends BaseService {
}, body: _requestReportsInpatient.toJson()); }, body: _requestReportsInpatient.toJson());
} }
Future getInpatientAdmissionsList() async { Future getInpatientAdmissionsList(int languageID) async {
Map<String, dynamic> body = new Map<String, dynamic>(); Map<String, dynamic> body = new Map<String, dynamic>();
body['IsForMedicalReport'] = true; body['IsForMedicalReport'] = true;
body['LanguageID'] = languageID;
hasError = false; hasError = false;
await baseAppClient.post(GET_INPATIENT_ADMISSIONS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_INPATIENT_ADMISSIONS, onSuccess: (dynamic response, int statusCode) {
admissionsMedicalReport.clear(); admissionsMedicalReport.clear();

@ -35,9 +35,9 @@ class AppointmentRateViewModel extends BaseViewModel {
} }
} }
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, int languageID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note); await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note, languageID);
if (_appointmentRateService.hasError) { if (_appointmentRateService.hasError) {
error = _appointmentRateService.error; error = _appointmentRateService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -20,10 +20,10 @@ class EdOnlineViewModel extends BaseViewModel {
ErPatientShareModel get erPatientShareModel => _edOnlineServices.erPatientShareModel; ErPatientShareModel get erPatientShareModel => _edOnlineServices.erPatientShareModel;
Future getHospitals() async { Future getHospitals(int languageID) async {
if(_hospitalService.hospitals.isEmpty){ if(_hospitalService.hospitals.isEmpty){
setState(ViewState.Busy); setState(ViewState.Busy);
await _hospitalService.getHospitals(); await _hospitalService.getHospitals(languageID);
if (_hospitalService.hasError) { if (_hospitalService.hasError) {
error = _hospitalService.error; error = _hospitalService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -50,19 +50,19 @@ class AmRequestViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getAmRequestOrders() async { Future getAmRequestOrders(int languageID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _amService.getAllTransportationOrders(); await _amService.getAllTransportationOrders();
if (_amService.hasError) { if (_amService.hasError) {
error = _amService.error; error = _amService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else } else
getHospitals(); getHospitals(languageID);
} }
Future getHospitals() async { Future getHospitals(int languageID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _hospitalService.getHospitals(isResBasedOnLoc: false); await _hospitalService.getHospitals(languageID, isResBasedOnLoc: false);
if (_hospitalService.hasError) { if (_hospitalService.hasError) {
error = _hospitalService.error; error = _hospitalService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -38,10 +38,10 @@ class RRTViewModel extends BaseViewModel {
_RRTServiceData rrtServiceData = _RRTServiceData(); _RRTServiceData rrtServiceData = _RRTServiceData();
Future<_RRTServiceData> loadRequiredData() async { Future<_RRTServiceData> loadRequiredData(int languageID) async {
// await getServicePrice(); // await getServicePrice();
// await getAllOrders(); // await getAllOrders();
await getProcedureDetails(); await getProcedureDetails(languageID);
await getAllOrdersRC(); await getAllOrdersRC();
// getProcedureDetails(); // getProcedureDetails();
return rrtServiceData; return rrtServiceData;
@ -120,9 +120,9 @@ class RRTViewModel extends BaseViewModel {
return rrtServiceData; return rrtServiceData;
} }
Future<_RRTServiceData> getProcedureDetails() async { Future<_RRTServiceData> getProcedureDetails(int languageID) async {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
await service.getRRTProcedures(15).then((res) { await service.getRRTProcedures(15, languageID).then((res) {
rrtProcedureList.clear(); rrtProcedureList.clear();
var data = res["Vida_ProcedureList"]; var data = res["Vida_ProcedureList"];
data.forEach((json) { data.forEach((json) {

@ -10,9 +10,9 @@ class HospitalViewModel extends BaseViewModel {
List<HospitalsModel> get hospitals => _hospitalService.hospitals; List<HospitalsModel> get hospitals => _hospitalService.hospitals;
Future getHospitals() async { Future getHospitals(int languageID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _hospitalService.getHospitals(); await _hospitalService.getHospitals(languageID);
if (_hospitalService.hasError) { if (_hospitalService.hasError) {
error = _hospitalService.error; error = _hospitalService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -28,12 +28,14 @@ class AskDoctorViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else if (_myDoctorService.patientDoctorAppointmentList.length != 0) { } else if (_myDoctorService.patientDoctorAppointmentList.length != 0) {
_myDoctorService.patientDoctorAppointmentList.forEach((element) { _myDoctorService.patientDoctorAppointmentList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList(); if (!element.isLiveCareClinic) {
List<PatientDoctorAppointmentList> doctorByClinic = patientDoctorAppointmentListHospital.where((elementClinic) => elementClinic.filterName == element.projectName).toList();
if (doctorByClinic.length != 0) { if (doctorByClinic.length != 0) {
patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element);
} else { } else {
patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); patientDoctorAppointmentListHospital.add(PatientDoctorAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
}
} }
setState(ViewState.Idle); setState(ViewState.Idle);
}); });

@ -70,9 +70,9 @@ class MyBalanceViewModel extends BaseViewModel {
} }
} }
Future getHospitals({bool isAdvancePayment = false}) async { Future getHospitals(int languageID, {bool isAdvancePayment = false}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _hospitalService.getHospitals(isAdvancePayment: isAdvancePayment); await _hospitalService.getHospitals(languageID, isAdvancePayment: isAdvancePayment);
if (_hospitalService.hasError) { if (_hospitalService.hasError) {
error = _hospitalService.error; error = _hospitalService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -26,7 +26,7 @@ class ReportsViewModel extends BaseViewModel {
List<AdmissionMedicalReport> get admissionsMedicalReportList => _reportsService.admissionsMedicalReport; List<AdmissionMedicalReport> get admissionsMedicalReportList => _reportsService.admissionsMedicalReport;
getReports() async { getReports(int languageID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
reportsOrderRequestList.clear(); reportsOrderRequestList.clear();
reportsOrderReadyList.clear(); reportsOrderReadyList.clear();
@ -37,7 +37,7 @@ class ReportsViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
_filterList(); _filterList();
await _reportsService.getInpatientAdmissionsList(); await _reportsService.getInpatientAdmissionsList(languageID);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -39,7 +39,7 @@ class NotificationViewModel extends BaseViewModel {
await authService.getDashboard().then((value) { await authService.getDashboard().then((value) {
var notificationCount = ''; var notificationCount = '';
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}); });

@ -2,19 +2,23 @@ import 'package:flutter/cupertino.dart';
class ToDoCountProviderModel with ChangeNotifier { class ToDoCountProviderModel with ChangeNotifier {
int _count; int _count;
int _ancillaryCount;
String _notificationsCount; String _notificationsCount;
bool _isShowBadge = false; bool _isShowBadge = false;
int get count => _count == null ? 0 : _count; int get count => _count == null ? 0 : _count;
int get ancillaryCount => _ancillaryCount == null ? 0 : _ancillaryCount;
String get notificationsCount => _notificationsCount == null ? "0" : _notificationsCount; String get notificationsCount => _notificationsCount == null ? "0" : _notificationsCount;
bool get isShowBadge => _isShowBadge; bool get isShowBadge => _isShowBadge;
void setState(int count, bool isShowBadge, String notifCount) { void setState(int count, int ancillaryCount, bool isShowBadge, String notifCount) {
_count = count; _count = count;
_isShowBadge = isShowBadge; _isShowBadge = isShowBadge;
_notificationsCount = notifCount; _notificationsCount = notifCount;
_ancillaryCount = ancillaryCount;
notifyListeners(); notifyListeners();
} }
} }

@ -28,7 +28,7 @@ class SendActivationRequest {
int responseID; int responseID;
int status; int status;
int familyRegionID; int familyRegionID;
bool isPatientExcluded;
SendActivationRequest( SendActivationRequest(
{this.patientMobileNumber, {this.patientMobileNumber,
this.mobileNo, this.mobileNo,
@ -58,7 +58,9 @@ class SendActivationRequest {
this.healthId, this.healthId,
this.responseID, this.responseID,
this.status, this.status,
this.familyRegionID}); this.familyRegionID,
this.isPatientExcluded
});
SendActivationRequest.fromJson(Map<String, dynamic> json) { SendActivationRequest.fromJson(Map<String, dynamic> json) {
patientMobileNumber = json['PatientMobileNumber']; patientMobileNumber = json['PatientMobileNumber'];
@ -90,6 +92,7 @@ class SendActivationRequest {
responseID = json['ReponseID']; responseID = json['ReponseID'];
status = json['Status']; status = json['Status'];
familyRegionID = json['FamilyRegionID']; familyRegionID = json['FamilyRegionID'];
isPatientExcluded = json['IsPatientExcluded'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -123,6 +126,7 @@ class SendActivationRequest {
data['ResponseID'] = responseID; data['ResponseID'] = responseID;
data['Status'] = status; data['Status'] = status;
data['FamilyRegionID'] = familyRegionID; data['FamilyRegionID'] = familyRegionID;
data['IsPatientExcluded'] = isPatientExcluded;
return data; return data;
} }
} }

@ -41,6 +41,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
HospitalsModel selectedHospital; HospitalsModel selectedHospital;
final GlobalKey projectDropdownKey = GlobalKey(); final GlobalKey projectDropdownKey = GlobalKey();
bool isLocationSelected = false; bool isLocationSelected = false;
ProjectViewModel projectViewModel;
static CameraPosition _kGooglePlex = CameraPosition( static CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962), target: LatLng(37.42796133580664, -122.085749655962),
@ -74,7 +75,7 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
description: TranslationBase.of(context).infoCMC, description: TranslationBase.of(context).infoCMC,
@ -360,10 +361,11 @@ class _NewCMCStepThreePageState extends State<NewCMCStepThreePage> {
} }
getProjectsList() { getProjectsList() {
int languageID = projectViewModel.isArabic ? 1 : 2;
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<HospitalsModel> projectsListLocal = []; List<HospitalsModel> projectsListLocal = [];
service.getProjectsList(context).then((res) { service.getProjectsList(languageID, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
res['ListProject'].forEach((v) { res['ListProject'].forEach((v) {

@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/EReferral/get_all_cities_response_model.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/all_habib_medical_services/e_referral_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/Dialog/confirm_dialog.dart';
@ -22,6 +23,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../dialogs/select_city_dialog.dart'; import '../dialogs/select_city_dialog.dart';
@ -436,9 +438,10 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
} }
void getAllProjects() { void getAllProjects() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = []; List<HospitalsModel> projectsListLocal = [];
service.getProjectsList(context).then((res) { service.getProjectsList(languageID, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
res['ListProject'].forEach((v) { res['ListProject'].forEach((v) {

@ -32,10 +32,11 @@ class BariatricsPage extends StatefulWidget {
class _BariatricsPageState extends State<BariatricsPage> { class _BariatricsPageState extends State<BariatricsPage> {
DiseasesByClinic _selectedDisease; DiseasesByClinic _selectedDisease;
ProjectViewModel projectProvider;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectProvider = Provider.of(context); projectProvider = Provider.of(context);
return BaseView<BariatricsViewModel>( return BaseView<BariatricsViewModel>(
onModelReady: (model) => model.getClinicCategory(), onModelReady: (model) => model.getClinicCategory(),
@ -139,6 +140,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
} }
callDoctorsSearchAPI() { callDoctorsSearchAPI() {
int languageID = projectProvider.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<String> arr = []; List<String> arr = [];
@ -148,7 +150,7 @@ class _BariatricsPageState extends State<BariatricsPage> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List(); List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsList(108, 0, false, context).then((res) { service.getDoctorsList(108, 0, false, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -1,8 +1,8 @@
import 'dart:collection'; import 'dart:collection';
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bariatrics-screen.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
class ResultPage extends StatefulWidget { class ResultPage extends StatefulWidget {
final double finalResult; final double finalResult;
@ -137,6 +138,7 @@ class _ResultPageState extends State<ResultPage> {
} }
callDoctorsSearchAPI() { callDoctorsSearchAPI() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<String> arr = []; List<String> arr = [];
@ -146,7 +148,7 @@ class _ResultPageState extends State<ResultPage> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List(); List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsList(108, 0, false, context).then((res) { service.getDoctorsList(108, 0, false, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -329,7 +329,7 @@ class _BookConfirmState extends State<BookConfirm> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service widget.service
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, null, null, null, projectViewModel) .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, projectViewModel.isArabic ? 1 : 2, context, null, null, null, projectViewModel)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -385,7 +385,7 @@ class _BookConfirmState extends State<BookConfirm> {
widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5); widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) { widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']); print(res['AppointmentNo']);
@ -428,12 +428,13 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
// toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -441,9 +442,10 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
int languageID = projectViewModel.isArabic ? 1 : 2;
String errorMsg = ""; String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) {
projectViewModel.selectedBodyPartList.clear(); projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0; projectViewModel.laserSelectionDuration = 0;
if(res['OnlineCheckInAppointments'].length != 0) { if(res['OnlineCheckInAppointments'].length != 0) {
@ -487,7 +489,7 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getLiveCareAppointmentPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse, false); navigateToBookSuccess(context, docObject, widget.patientShareResponse, false);

@ -500,7 +500,7 @@ class _BookSuccessState extends State<BookSuccess> {
setOnlineCheckInForAppointment() { setOnlineCheckInForAppointment() {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, context).then((res) { service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
@ -545,7 +545,7 @@ class _BookSuccessState extends State<BookSuccess> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -75,10 +75,12 @@ class _DentalComplaintsState extends State<DentalComplaints> {
languageID: languageID, languageID: languageID,
isDoctorNameSearch: widget.isDoctorNameSearch, isDoctorNameSearch: widget.isDoctorNameSearch,
onSelectedMethod: widget.onSelectedMethod, onSelectedMethod: widget.onSelectedMethod,
)..logAnalytics = (){ )..logAnalytics = () {
final info = widget.searchInfo; final info = widget.searchInfo;
locator<GAnalytics>().appointment.book_appointment_chief_complaints(appointment_type: 'regular', hospital: info.hospital, clinic: info.clinic, treatment: complaintsList[index]); locator<GAnalytics>()
}, .appointment
.book_appointment_chief_complaints(appointment_type: 'regular', hospital: info.hospital, clinic: info.clinic, treatment: complaintsList[index]);
},
); );
}, },
separatorBuilder: (BuildContext context, int index) { separatorBuilder: (BuildContext context, int index) {
@ -207,11 +209,12 @@ class _DentalComplaintsState extends State<DentalComplaints> {
} }
continueDentalPlan() { continueDentalPlan() {
int languageID = projectViewModel.isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
int appoTime = 0; int appoTime = 0;
service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) { service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, languageID, context, isContinueDentalPlan: true).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
dentalProceduresModel = DentalProceduresModel.fromJson(res); dentalProceduresModel = DentalProceduresModel.fromJson(res);
@ -254,10 +257,11 @@ class _DentalComplaintsState extends State<DentalComplaints> {
} }
getChiefComplaintsList() { getChiefComplaintsList() {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
getLanguageID(); getLanguageID();
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) { service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -234,7 +234,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatings() { getDoctorRatings() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { service.getDoctorsRating(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['NotesDoctorRatingList']); print(res['NotesDoctorRatingList']);
@ -251,7 +251,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatingsDetails() { getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) { service.getDoctorsRatingDetails(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -63,7 +64,7 @@ class _QRCodeState extends State<QRCode> {
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
// WidgetsBinding.instance.addPostFrameCallback((timeStamp) { // WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
// startNFCScan(); // startNFCScan();
// }); // });
super.initState(); super.initState();
@ -92,16 +93,21 @@ class _QRCodeState extends State<QRCode> {
} }
startLocationCheckIn() async { startLocationCheckIn() async {
GifLoaderDialogUtils.showMyDialog(context);
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context); locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation(callBack: (value) { locationUtils.getCurrentLocation(callBack: (value) {
projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment.projectID); 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; double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude), double.parse(projectDetailListModel.longitude)).ceilToDouble() * 1000;
print(dist); print(dist);
if (dist <= projectDetailListModel.geofenceRadius) { if (dist <= projectDetailListModel.geofenceRadius) {
GifLoaderDialogUtils.hideDialog(context);
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3); sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3);
} else { } else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError); AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
} }
}, failureCallBack: () {
GifLoaderDialogUtils.hideDialog(context);
}); });
} }
@ -213,19 +219,17 @@ class _QRCodeState extends State<QRCode> {
optionsList.add( optionsList.add(
InkWell( InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(80) && _supportsNFC) { if (projectViewModel.havePrivilege(102)) {
startNFCScan(); startLocationCheckIn();
} else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
} }
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).scanNFC, title: TranslationBase.of(context).checkInViaLocation,
imagePath: 'contactless.svg', imagePath: 'location.svg',
subTitle: "", subTitle: "",
isEnable: projectViewModel.havePrivilege(80), isEnable: projectViewModel.havePrivilege(102),
width: 80.0, width: 70.0,
height: 80.0, height: 70.0,
), ),
), ),
); );
@ -251,17 +255,19 @@ class _QRCodeState extends State<QRCode> {
optionsList.add( optionsList.add(
InkWell( InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(102)) { if (projectViewModel.havePrivilege(80) && _supportsNFC) {
startLocationCheckIn(); startNFCScan();
} else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
} }
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).checkInViaLocation, title: TranslationBase.of(context).scanNFC,
imagePath: 'location.svg', imagePath: 'contactless.svg',
subTitle: "", subTitle: "",
isEnable: projectViewModel.havePrivilege(102), isEnable: projectViewModel.havePrivilege(80),
width: 70.0, width: 80.0,
height: 70.0, height: 80.0,
), ),
), ),
); );
@ -378,6 +384,7 @@ class _QRCodeState extends State<QRCode> {
child: const Text('OK'), child: const Text('OK'),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
}, },
), ),
], ],

@ -69,7 +69,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD).then((res) { service.getLaserBodyPartsList(laserCategoryId, widget.selectedHospital.iD, projectViewModel.isArabic ? 1 : 2).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['Laser_GetBodyPartsByCategoryList'].length != 0) { if (res['Laser_GetBodyPartsByCategoryList'].length != 0) {
@ -204,6 +204,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
} }
callDoctorsSearchAPI() { callDoctorsSearchAPI() {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<String> arr = []; List<String> arr = [];
@ -214,7 +215,7 @@ class _LaserClinicState extends State<LaserClinic> with SingleTickerProviderStat
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
projectViewModel.selectedBodyPartList = _selectedBodyPartList; projectViewModel.selectedBodyPartList = _selectedBodyPartList;
service.getDoctorsList(253, 0, false, context).then((res) { service.getDoctorsList(253, 0, false, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -499,10 +499,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
} }
getProjectsList() { getProjectsList() {
int languageID = projectViewModel.isArabic ? 1 : 2;
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = []; List<HospitalsModel> projectsListLocal = [];
service service
.getProjectsList(context) .getProjectsList(languageID, context)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
@ -572,6 +573,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
} }
callDoctorsSearchAPI(int clinicID) { callDoctorsSearchAPI(int clinicID) {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<String> arr = []; List<String> arr = [];
@ -581,7 +583,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List(); List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, context).then((res) { service.getDoctorsList(clinicID, projectDropdownValue != "" ? int.parse(projectDropdownValue) : 0, nearestAppo, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -90,13 +90,14 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
} }
getDoctorsList(BuildContext context) { getDoctorsList(BuildContext context) {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List(); List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getDoctorsListByName(doctorNameController.text, context).then((res) { service.getDoctorsListByName(doctorNameController.text, languageID, context).then((res) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart';
@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
// ignore: must_be_immutable // ignore: must_be_immutable
class DentalComplaintCard extends StatefulWidget { class DentalComplaintCard extends StatefulWidget {
@ -60,12 +62,13 @@ class _DentalComplaintCardState extends State<DentalComplaintCard> {
} }
getChiefComplaintsList() { getChiefComplaintsList() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List(); List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, context).then((res) { service.getChiefComplaintDoctorList(widget.listDentalChiefComplain.iD, widget.listDentalChiefComplain.projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['List_DentalDoctorChiefComplaintMapping']); print(res['List_DentalDoctorChiefComplaintMapping']);

@ -183,10 +183,11 @@ class DoctorView extends StatelessWidget {
} }
getDoctorsProfile(context, DoctorList docObject, {isAppo}) { getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<DoctorProfileList> docProfileList = []; List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsProfile(docObject.doctorID, docObject.clinicID, docObject.projectID, context).then((res) { service.getDoctorsProfile(docObject.doctorID, docObject.clinicID, docObject.projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) { if (res['DoctorProfileList'].length != 0) {

@ -412,7 +412,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
insertCovidQuestionnaire(context, DoctorList docObject) async { insertCovidQuestionnaire(context, DoctorList docObject) async {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List qa = await sharedPref.getObject(COVID_QA_LIST); List qa = await sharedPref.getObject(COVID_QA_LIST);
service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum).then((res) { service.insertCovidQuestionnaire(qa, widget.projectID, widget.selectedProject.testTypeEnum, projectViewModel.isArabic ? 1 : 2, widget.selectedProject.testProcedureEnum).then((res) {
insertAppointmentCovidTest(context, docObject); insertAppointmentCovidTest(context, docObject);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -430,7 +430,7 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
service service
.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, context, widget.selectedProcedure.procedureID, .insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, CovidTimeSlots.selectedTime, CovidTimeSlots.selectedDate, 0, projectViewModel.isArabic ? 1 : 2, context, widget.selectedProcedure.procedureID,
widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum) widget.selectedProject.testTypeEnum, widget.selectedProject.testProcedureEnum)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -468,12 +468,13 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
// toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -499,8 +500,9 @@ class _CovidTimeSlotsState extends State<CovidTimeSlots> with TickerProviderStat
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
int languageID = projectViewModel.isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res); print(res);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);

@ -161,7 +161,8 @@ class _AddMember extends State<AddMember> {
} }
insertFamilyData(addMemberResult) { insertFamilyData(addMemberResult) {
sendActivationCode(addMemberResult);
sendActivationCode(addMemberResult, addMemberResult['ShareFamilyFileObj']['IsPatientExcluded']);
// var request = InsertSharePatientFileReq(); // var request = InsertSharePatientFileReq();
// request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID']; // request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
// request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName']; // request.shareFamilyPatientName = addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
@ -178,13 +179,21 @@ class _AddMember extends State<AddMember> {
// }); // });
} }
sendActivationCode(result) { sendActivationCode(result, bool isExcluded) {
// var request = this.getCommonRequest(); // var request = this.getCommonRequest();
loading(true); loading(true);
patientShareResponseID = result['ShareFamilyFileObj']['ReponseID']; patientShareResponseID = result['ShareFamilyFileObj']['ReponseID'];
familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text, patientShareResponseID).then((res) => { familyFileProvider.sendActivationCode(mobileNo, countryCode, nationalIDorFile.text, patientShareResponseID, isExcluded).then((res) {
patientShareRequestID = res['PatientShareRequestID'], patientShareRequestID = res['PatientShareRequestID'];
if (res != null && res['isSMSSent'] == true) {this.startSMSService(1, res)} if (res != null && res['isSMSSent'] == true)
{
this.startSMSService(1, res);
}else
{
this.checkActivationCodeExcluded('0000', res);
}
}); });
} }
@ -206,12 +215,19 @@ class _AddMember extends State<AddMember> {
).displayDialog(context); ).displayDialog(context);
} }
checkActivationCodeExcluded(value, result){
familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo, patientShareRequestID, patientShareResponseID).then((result) {
SMSOTP.hideSMSBox(context);
handleFamilyRequests();
});
}
checkActivationCode(value, result) { checkActivationCode(value, result) {
Navigator.pop(context); Navigator.pop(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo, patientShareRequestID, patientShareResponseID).then((result) { familyFileProvider.checkActivationCode(result['LogInTokenID'], value, nationalIDorFile.text, mobileNo, patientShareRequestID, patientShareResponseID).then((result) {
SMSOTP.hideSMSBox(context); SMSOTP.hideSMSBox(context);
handleFamilyRequests(this.patientShareRequestID, 3); handleFamilyRequests();
}).catchError((err) { }).catchError((err) {
Future.delayed(Duration(seconds: 1), () { Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -220,13 +236,12 @@ class _AddMember extends State<AddMember> {
}); });
} }
handleFamilyRequests(id, stauts) { handleFamilyRequests() {
// familyFileProvider.acceptAndRejectRecievedRequests(id, stauts).then((result) => { Navigator.pop(context);
sharedPref.remove(FAMILY_FILE); sharedPref.remove(FAMILY_FILE);
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
MY_FAMILIY, MY_FAMILIY
); );
// });
} }
loading(flag) { loading(flag) {

@ -341,8 +341,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
return requestDecoratedContainerWithExpandable( return requestDecoratedContainerWithExpandable(
TranslationBase.of(context).sentRequest, TranslationBase.of(context).sentRequest,
[ [
Expanded(flex: 4, child: columnText(TranslationBase.of(context).name)), Expanded(flex: 3, child: columnText(TranslationBase.of(context).name)),
Expanded(flex: 2, child: columnText(TranslationBase.of(context).status)), Expanded(flex: 1, child: columnText(TranslationBase.of(context).status)),
], ],
sentRecordsList.map<Widget>((result) { sentRecordsList.map<Widget>((result) {
return sentItemView(result); return sentItemView(result);
@ -351,29 +351,26 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget sentItemView(GetAllSharedRecordsByStatusList result) { Widget sentItemView(GetAllSharedRecordsByStatusList result) {
return Row( return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Expanded(flex: 2, child: rowText(result.patientName)), Expanded(flex: 3, child: rowText(result.patientName)),
Expanded( Expanded(
flex: 1, flex: 1,
child: Row( child: Container(
children: [ padding: EdgeInsets.only(top: 3, bottom: 3, left: 8, right: 8),
Container( decoration: BoxDecoration(
padding: EdgeInsets.only(top: 3, bottom: 3, left: 8, right: 8), borderRadius: BorderRadius.circular(50),
decoration: BoxDecoration( color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127),
borderRadius: BorderRadius.circular(50), ),
color: result.status == 3 ? Color(0xff349745) : Color(0xffD02127), child: Text(
), result.statusDescription != null ? result.statusDescription : "",
child: Text( style: TextStyle(
result.statusDescription != null ? result.statusDescription : "", fontSize: 10,
style: TextStyle( color: Colors.white,
fontSize: 10, letterSpacing: -0.4,
color: Colors.white, fontWeight: FontWeight.w600,
letterSpacing: -0.4,
fontWeight: FontWeight.w600,
),
),
), ),
], ),
), ),
), ),
], ],
@ -443,7 +440,11 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['ID'] = this.userID; request['ID'] = this.userID;
request['IsActive'] = false; request['IsActive'] = false;
this.familyFileProvider.deativateActivateMemberFile(request).then((value) => refreshFamily(context)); this.familyFileProvider.deativateActivateMemberFile(request).then((value) {
refreshFamily(context);
GifLoaderDialogUtils.hideDialog(context);
});
} }
refreshFamily(context) async { refreshFamily(context) async {
@ -476,7 +477,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
var bloodType = await sharedPref.getString(BLOOD_TYPE); var bloodType = await sharedPref.getString(BLOOD_TYPE);
var mainUser = await sharedPref.getObject(MAIN_USER); var mainUser = await sharedPref.getObject(MAIN_USER);
var loginType = await sharedPref.getInt(LAST_LOGIN); var loginType = await sharedPref.getInt(LAST_LOGIN);
this.sharedPref.clear(); // this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) { if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true; result.list.isFamily = true;
} }
@ -535,9 +536,11 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
// var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER)); // var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER));
await getFamilyFiles(); await getFamilyFiles();
this.user = data;
setState(() {
});
this.user = data;
setState(() {});
} }
} }
@ -547,6 +550,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
List<GetAllSharedRecordsByStatusList> sentRecordsList = []; List<GetAllSharedRecordsByStatusList> sentRecordsList = [];
Future getFamilyFiles() async { Future getFamilyFiles() async {
int languageID = projectViewModel.isArabic ? 1 : 2;
GetAllSharedRecordsByStatusResponse familySharedRecords; GetAllSharedRecordsByStatusResponse familySharedRecords;
if (await sharedPref.getObject(FAMILY_FILE) != null) { if (await sharedPref.getObject(FAMILY_FILE) != null) {
familySharedRecords = GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE)); familySharedRecords = GetAllSharedRecordsByStatusResponse.fromJson(await sharedPref.getObject(FAMILY_FILE));
@ -554,9 +558,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
try { try {
if (familySharedRecords == null) { if (familySharedRecords == null) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID); familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID);
} }
familySharedRecordsList =[];
sentRecordsList = []; sentRecordsList = [];
familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) { familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) {
if (element.status == 3) { if (element.status == 3) {
@ -566,7 +570,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}); });
approvedRecordsList = []; approvedRecordsList = [];
pendingRecordsList = []; pendingRecordsList = [];
GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(languageID);
pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) { pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) {
print(element.toJson()); print(element.toJson());
@ -582,9 +586,9 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
Future getUserViewRequest() async { Future getUserViewRequest(int languageID) async {
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
return familyFileProvider.getUserViewRequest(user['PatientID']); return familyFileProvider.getUserViewRequest(user['PatientID'], languageID);
} }
Future<GetAllSharedRecordsByStatusResponse> getSentRequest() async { Future<GetAllSharedRecordsByStatusResponse> getSentRequest() async {
@ -593,13 +597,14 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
getToDoCount() async { getToDoCount() async {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = ClinicListService(); ClinicListService service = ClinicListService();
try { try {
var res = await service.getActiveAppointmentNo(context); var res = await service.getActiveAppointmentNo(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
} catch (ex) { } catch (ex) {
print("getToDoCount:$ex"); print("getToDoCount:$ex");
@ -609,7 +614,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget columnText(String title) { Widget columnText(String title) {
return Text( return Text(
title, title,
textAlign: TextAlign.left, // textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
fontSize: 12, fontSize: 12,
color: CustomColors.textDarkColor, color: CustomColors.textDarkColor,
@ -622,7 +627,7 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Widget rowText(String title) { Widget rowText(String title) {
return Text( return Text(
title, title,
textAlign: TextAlign.left, // textAlign: TextAlign.left,
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
color: CustomColors.textColor, color: CustomColors.textColor,

@ -40,7 +40,7 @@ class _AmbulanceReqState extends State<AmbulanceReq> with SingleTickerProviderSt
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png')); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png'));
return BaseView<AmRequestViewModel>( return BaseView<AmRequestViewModel>(
onModelReady: (model) => model.getAmRequestOrders(), onModelReady: (model) => model.getAmRequestOrders(projectViewModel.isArabic ? 1 : 2),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,

@ -33,7 +33,7 @@ class _EdOnlineSelectedHospitalPageState extends State<EdOnlineSelectedHospitalP
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<EdOnlineViewModel>( return BaseView<EdOnlineViewModel>(
onModelReady: (model) => model.getHospitals(), onModelReady: (model) => model.getHospitals(projectViewModel.isArabic ? 1 : 2),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: SingleChildScrollView(

@ -56,7 +56,7 @@ class RRTMainScreenState extends State<RRTMainScreen> with SingleTickerProviderS
onModelReady: (vm) async { onModelReady: (vm) async {
viewModel = vm; viewModel = vm;
loadingData = true; loadingData = true;
await vm.loadRequiredData().then((value) {}).whenComplete(() => setState(() => loadingData = false)); await vm.loadRequiredData(projectViewModel.isArabic ? 1 : 2).then((value) {}).whenComplete(() => setState(() => loadingData = false));
}, },
builder: (ctx, vm, widget) => content(), builder: (ctx, vm, widget) => content(),
)); ));

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/ComprehensiveMedicalCheckup/GetCMCAllOrdersResponseModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart'; import 'package:diplomaticquarterapp/core/viewModels/er/rrt-view-model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart'; import 'package:diplomaticquarterapp/models/rrt/RRTProcedureList.dart';
import 'package:diplomaticquarterapp/models/rrt/service_price.dart'; import 'package:diplomaticquarterapp/models/rrt/service_price.dart';
import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart'; import 'package:diplomaticquarterapp/pages/ErService/rapid-response-team/rrt-order-list-item.dart';
@ -16,6 +17,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class RRTRequestPage extends StatefulWidget { class RRTRequestPage extends StatefulWidget {
final List<GetCMCAllOrdersResponseModel> pendingOrders; final List<GetCMCAllOrdersResponseModel> pendingOrders;
@ -32,6 +34,8 @@ class RRTRequestPageState extends State<RRTRequestPage> {
bool acceptTerms = false; bool acceptTerms = false;
VidaProcedureList selectedProcedure; VidaProcedureList selectedProcedure;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
// getProcedureDetails(); // getProcedureDetails();
@ -40,6 +44,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<RRTViewModel>( return BaseView<RRTViewModel>(
onModelReady: (vm) { onModelReady: (vm) {
// viewModel = vm; // viewModel = vm;
@ -272,7 +277,7 @@ class RRTRequestPageState extends State<RRTRequestPage> {
getProcedureDetails() { getProcedureDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getRRTProcedures(15).then((res) { service.getRRTProcedures(15, projectViewModel.isArabic ? 1 : 2).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['Vida_ProcedureList']); print(res['Vida_ProcedureList']);
}).catchError((err) { }).catchError((err) {

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookConfirm.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/DocAvailableAppointments.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -260,6 +261,19 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
), ),
), ),
); );
list.add(
SizedBox(width: 8),
);
if (AppointmentType.isBooked(widget.appo))
list.add(
Expanded(
child: DefaultButton(
TranslationBase.of(context).confirm,
confirmAppointment,
color: Color(0xff359846),
),
),
);
} else if (_tabController.index == 1) { } else if (_tabController.index == 1) {
list.add( list.add(
Expanded( Expanded(
@ -314,7 +328,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
void getDoctorRatingsDetails() { void getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.appo.doctorID, context).then((res) { service.getDoctorsRatingDetails(widget.appo.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();
@ -489,10 +503,10 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
minWidth: MediaQuery.of(context).size.width, minWidth: MediaQuery.of(context).size.width,
height: 40.0, height: 40.0,
child: CustomTextButton( child: CustomTextButton(
elevation: 0.0, elevation: 0.0,
backgroundColor: Colors.white, backgroundColor: Colors.white,
disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38), disabledForegroundColor: new Color(0xFFbcc2c4).withOpacity(0.38),
disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12), disabledBackgroundColor: new Color(0xFFbcc2c4).withOpacity(0.12),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
}, },
@ -627,11 +641,12 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -25,7 +25,13 @@ import 'package:provider/provider.dart';
import 'AppointmentDetails.dart'; import 'AppointmentDetails.dart';
class MyAppointments extends StatefulWidget { class MyAppointments extends StatefulWidget {
List<AppoitmentAllHistoryResultList> appoList = []; @override
_MyAppointmentsState createState() => _MyAppointmentsState();
}
class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProviderStateMixin {
List<AppoitmentAllHistoryResultList> upcomingAppoList = [];
List<AppoitmentAllHistoryResultList> arrivedAppoListNew = [];
List<AppoitmentAllHistoryResultList> bookedAppoList = []; List<AppoitmentAllHistoryResultList> bookedAppoList = [];
List<AppoitmentAllHistoryResultList> confirmedAppoList = []; List<AppoitmentAllHistoryResultList> confirmedAppoList = [];
@ -39,11 +45,9 @@ class MyAppointments extends StatefulWidget {
List<PatientAppointmentList> _patientConfirmedAppointmentListClinic = List(); List<PatientAppointmentList> _patientConfirmedAppointmentListClinic = List();
List<PatientAppointmentList> _patientArrivedAppointmentListClinic = List(); List<PatientAppointmentList> _patientArrivedAppointmentListClinic = List();
@override List<PatientAppointmentList> _patientBookedAndConfirmedAppointmentListHospital = List();
_MyAppointmentsState createState() => _MyAppointmentsState(); List<PatientAppointmentList> _patientBookedAndConfirmedAppointmentListClinic = List();
}
class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProviderStateMixin {
bool isDataLoaded = false; bool isDataLoaded = false;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
@ -52,15 +56,16 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
FilterType filterType; FilterType filterType;
int _currentPage = 0; int _currentPage = 1;
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
filterType = FilterType.Clinic; filterType = FilterType.Clinic;
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
if (Provider.of<ProjectViewModel>(context, listen: false).isLogin) getPatientAppointmentHistory(); if (Provider.of<ProjectViewModel>(context, listen: false).isLogin) getPatientAppointmentHistory(true, false);
}); });
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png')); imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png'));
@ -76,6 +81,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).myAppointmentsList, appBarTitle: TranslationBase.of(context).myAppointmentsList,
@ -84,7 +90,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
showNewAppBar: true, showNewAppBar: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
showNewAppBarTitle: true, showNewAppBarTitle: true,
showDropDown: true, showDropDown: false,
dropdownIndexValue: _currentPage, dropdownIndexValue: _currentPage,
dropDownIndexChange: (index) { dropDownIndexChange: (index) {
setState(() { setState(() {
@ -92,8 +98,8 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
}); });
}, },
dropDownList: [ dropDownList: [
TranslationBase.of(context).booked, // TranslationBase.of(context).booked,
TranslationBase.of(context).confirmed, TranslationBase.of(context).upcoming,
TranslationBase.of(context).arrived, TranslationBase.of(context).arrived,
], ],
description: TranslationBase.of(context).infoMyAppointments, description: TranslationBase.of(context).infoMyAppointments,
@ -113,10 +119,10 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
Padding( Padding(
padding: EdgeInsets.only(left: 21, right: 21), padding: EdgeInsets.only(left: 21, right: 21),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
myRadioButton(TranslationBase.of(context).booked, 0), myRadioButton(TranslationBase.of(context).upcoming, 1),
myRadioButton(TranslationBase.of(context).confirmed, 1), // myRadioButton(TranslationBase.of(context).upcoming, 1),
myRadioButton(TranslationBase.of(context).arrived, 2), myRadioButton(TranslationBase.of(context).arrived, 2),
], ],
), ),
@ -125,7 +131,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
? Expanded( ? Expanded(
child: IndexedStack( child: IndexedStack(
index: _currentPage, index: _currentPage,
children: [getBookedAppointments(), getConfirmedAppointments(), getArrivedAppointments()], children: [getBookedAppointments(), getBookedAndConfirmedAppointments(), getArrivedAppointments()],
), ),
) )
: Container(), : Container(),
@ -134,35 +140,43 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
); );
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory(bool isForUpcoming, bool isForArrived) {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
widget.appoList.clear();
widget.bookedAppoList.clear();
widget.confirmedAppoList.clear();
widget.arrivedAppoList.clear();
widget._patientBookedAppointmentListHospital.clear(); upcomingAppoList.clear();
widget._patientConfirmedAppointmentListHospital.clear(); arrivedAppoListNew.clear();
widget._patientArrivedAppointmentListHospital.clear();
widget._patientBookedAppointmentListClinic.clear(); bookedAppoList.clear();
widget._patientConfirmedAppointmentListClinic.clear(); confirmedAppoList.clear();
widget._patientArrivedAppointmentListClinic.clear(); arrivedAppoList.clear();
service.getPatientAppointmentHistory(false, context).then((res) { _patientBookedAppointmentListHospital.clear();
_patientConfirmedAppointmentListHospital.clear();
_patientArrivedAppointmentListHospital.clear();
_patientBookedAppointmentListClinic.clear();
_patientConfirmedAppointmentListClinic.clear();
_patientArrivedAppointmentListClinic.clear();
_patientBookedAndConfirmedAppointmentListHospital.clear();
_patientBookedAndConfirmedAppointmentListClinic.clear();
service.getPatientAppointmentHistory(false, languageID, context, isForUpcomming: isForUpcoming, IsForArrived: isForArrived).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// setState(() {
if (res['AppoimentAllHistoryResultList'].length != 0) { if (res['AppoimentAllHistoryResultList'].length != 0) {
// isDataLoaded = true;
res['AppoimentAllHistoryResultList'].forEach((v) { res['AppoimentAllHistoryResultList'].forEach((v) {
widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); if (isForArrived) {
arrivedAppoListNew.add(new AppoitmentAllHistoryResultList.fromJson(v));
} else {
upcomingAppoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
}
}); });
sortAppointmentList(); sortAppointmentList(isForUpcoming, isForArrived);
} else {} } else {}
// });
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -177,11 +191,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -200,100 +215,125 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
return AppointmentType.isBooked(appo); return AppointmentType.isBooked(appo);
} }
sortAppointmentList() { sortAppointmentList(bool isForUpcoming, bool isForArrived) {
widget.appoList.forEach((v) { if (isForArrived) {
if (isBooked(v)) { arrivedAppoListNew.forEach((v) {
widget.bookedAppoList.add(v); if (isBooked(v)) {
} bookedAppoList.add(v);
}
if (isConfirmed(v)) { if (isConfirmed(v)) {
widget.confirmedAppoList.add(v); confirmedAppoList.add(v);
} }
if (isArrived(v)) { if (isArrived(v)) {
widget.arrivedAppoList.add(v); arrivedAppoList.add(v);
} }
}); });
} else {
upcomingAppoList.forEach((v) {
if (isBooked(v)) {
bookedAppoList.add(v);
}
if (isConfirmed(v)) {
confirmedAppoList.add(v);
}
if (isArrived(v)) {
arrivedAppoList.add(v);
}
});
}
widget.bookedAppoList.forEach((element) { bookedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = widget._patientBookedAppointmentListClinic List<PatientAppointmentList> doctorByClinic = _patientBookedAppointmentListClinic
.where( .where(
(elementClinic) => elementClinic.filterName == element.clinicName, (elementClinic) => elementClinic.filterName == element.clinicName,
) )
.toList(); .toList();
if (doctorByClinic.length != 0) { if (doctorByClinic.length != 0) {
widget._patientBookedAppointmentListClinic[widget._patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); _patientBookedAppointmentListClinic[_patientBookedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element);
} else { } else {
widget._patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); _patientBookedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
} }
List<PatientAppointmentList> doctorByHospital = widget._patientBookedAppointmentListHospital List<PatientAppointmentList> doctorByHospital = _patientBookedAppointmentListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
widget._patientBookedAppointmentListHospital[widget._patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientBookedAppointmentListHospital[_patientBookedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
widget._patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); _patientBookedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
} }
}); });
widget.confirmedAppoList.forEach((element) { confirmedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = widget._patientConfirmedAppointmentListClinic List<PatientAppointmentList> doctorByClinic = _patientConfirmedAppointmentListClinic
.where( .where(
(elementClinic) => elementClinic.filterName == element.clinicName, (elementClinic) => elementClinic.filterName == element.clinicName,
) )
.toList(); .toList();
if (doctorByClinic.length != 0) { if (doctorByClinic.length != 0) {
widget._patientConfirmedAppointmentListClinic[widget._patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); _patientConfirmedAppointmentListClinic[_patientConfirmedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element);
} else { } else {
widget._patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); _patientConfirmedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
} }
List<PatientAppointmentList> doctorByHospital = widget._patientConfirmedAppointmentListHospital List<PatientAppointmentList> doctorByHospital = _patientConfirmedAppointmentListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
widget._patientConfirmedAppointmentListHospital[widget._patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientConfirmedAppointmentListHospital[_patientConfirmedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
widget._patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); _patientConfirmedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
} }
//Merging Booked & Confirmed Appointments into Upcoming Tab
// _patientBookedAndConfirmedAppointmentListHospital.addAll(_patientConfirmedAppointmentListHospital);
// _patientBookedAndConfirmedAppointmentListClinic.addAll(_patientConfirmedAppointmentListClinic);
}); });
widget.arrivedAppoList.forEach((element) { arrivedAppoList.forEach((element) {
List<PatientAppointmentList> doctorByClinic = widget._patientArrivedAppointmentListClinic List<PatientAppointmentList> doctorByClinic = _patientArrivedAppointmentListClinic
.where( .where(
(elementClinic) => elementClinic.filterName == element.clinicName, (elementClinic) => elementClinic.filterName == element.clinicName,
) )
.toList(); .toList();
if (doctorByClinic.length != 0) { if (doctorByClinic.length != 0) {
widget._patientArrivedAppointmentListClinic[widget._patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element); _patientArrivedAppointmentListClinic[_patientArrivedAppointmentListClinic.indexOf(doctorByClinic[0])].patientDoctorAppointmentList.add(element);
} else { } else {
widget._patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element)); _patientArrivedAppointmentListClinic.add(PatientAppointmentList(filterName: element.clinicName, patientDoctorAppointment: element));
} }
List<PatientAppointmentList> doctorByHospital = widget._patientArrivedAppointmentListHospital List<PatientAppointmentList> doctorByHospital = _patientArrivedAppointmentListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (doctorByHospital.length != 0) { if (doctorByHospital.length != 0) {
widget._patientArrivedAppointmentListHospital[widget._patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); _patientArrivedAppointmentListHospital[_patientArrivedAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else { } else {
widget._patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element)); _patientArrivedAppointmentListHospital.add(PatientAppointmentList(filterName: element.projectName, patientDoctorAppointment: element));
} }
openAppointmentsTab(); // openAppointmentsTab();
}); });
//Merging Booked & Confirmed Appointments into Upcoming Tab
_patientBookedAndConfirmedAppointmentListHospital.addAll(_patientBookedAppointmentListHospital);
_patientBookedAndConfirmedAppointmentListClinic.addAll(_patientBookedAppointmentListClinic);
} }
openAppointmentsTab() async { openAppointmentsTab() async {
@ -306,11 +346,11 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} else if (flag == 3) { } else if (flag == 3) {
index = 2; index = 2;
} else { } else {
if (widget._patientBookedAppointmentListClinic.length != 0) { if (_patientBookedAppointmentListClinic.length != 0) {
index = 0; index = 0;
} else if (widget._patientConfirmedAppointmentListClinic.length != 0) { } else if (_patientConfirmedAppointmentListClinic.length != 0) {
index = 1; index = 1;
} else if (widget._patientArrivedAppointmentListClinic.length != 0) { } else if (_patientArrivedAppointmentListClinic.length != 0) {
index = 2; index = 2;
// return; // return;
} }
@ -320,7 +360,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} }
Widget getBookedAppointments() { Widget getBookedAppointments() {
return _getAppointment(widget.bookedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientBookedAppointmentListClinic : widget._patientBookedAppointmentListHospital); return _getAppointment(bookedAppoList.length, (filterType == FilterType.Clinic) ? _patientBookedAppointmentListClinic : _patientBookedAppointmentListHospital);
}
Widget getBookedAndConfirmedAppointments() {
return _getAppointment(
(bookedAppoList.length + confirmedAppoList.length), (filterType == FilterType.Clinic) ? _patientBookedAndConfirmedAppointmentListClinic : _patientBookedAndConfirmedAppointmentListHospital);
} }
Widget _getAppointment(int _listLength, List<PatientAppointmentList> _list) { Widget _getAppointment(int _listLength, List<PatientAppointmentList> _list) {
@ -338,7 +383,9 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
Container( Container(
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: Text( child: Text(
_currentPage == 0 ? TranslationBase.of(context).noBookedAppo : (_currentPage == 1 ? TranslationBase.of(context).noConfirmedAppo : TranslationBase.of(context).noArrivedAppo), _currentPage == 0
? TranslationBase.of(context).noBookedAppo
: (_currentPage == 1 ? TranslationBase.of(context).noUpcomingAppointment : TranslationBase.of(context).noArrivedAppo),
style: TextStyle( style: TextStyle(
fontSize: 16.0, fontSize: 16.0,
), ),
@ -385,7 +432,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
), ),
), ),
).then((value) { ).then((value) {
getPatientAppointmentHistory(); if(_currentPage == 1) {
getPatientAppointmentHistory(true, false);
}
if(_currentPage == 2) {
getPatientAppointmentHistory(false, true);
}
}), }),
isInOutPatient: _appointmentResult.isInOutPatient, isInOutPatient: _appointmentResult.isInOutPatient,
name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj, name: _appointmentResult.doctorTitle + " " + _appointmentResult.doctorNameObj,
@ -417,11 +469,11 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
} }
Widget getConfirmedAppointments() { Widget getConfirmedAppointments() {
return _getAppointment(widget.confirmedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientConfirmedAppointmentListClinic : widget._patientConfirmedAppointmentListHospital); return _getAppointment(confirmedAppoList.length, (filterType == FilterType.Clinic) ? _patientConfirmedAppointmentListClinic : _patientConfirmedAppointmentListHospital);
} }
Widget getArrivedAppointments() { Widget getArrivedAppointments() {
return _getAppointment(widget.arrivedAppoList.length, (filterType == FilterType.Clinic) ? widget._patientArrivedAppointmentListClinic : widget._patientArrivedAppointmentListHospital); return _getAppointment(arrivedAppoList.length, (filterType == FilterType.Clinic) ? _patientArrivedAppointmentListClinic : _patientArrivedAppointmentListHospital);
} }
setFilterType(FilterType filterType) { setFilterType(FilterType filterType) {
@ -435,6 +487,12 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
onTap: () { onTap: () {
setState(() { setState(() {
_currentPage = _value; _currentPage = _value;
if (_value == 1) {
getPatientAppointmentHistory(true, false);
}
if (_value == 2) {
getPatientAppointmentHistory(false, true);
}
}); });
}, },
child: Row( child: Row(
@ -450,8 +508,13 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
onChanged: (index) { onChanged: (index) {
setState(() { setState(() {
_currentPage = index; _currentPage = index;
if (_value == 1) {
getPatientAppointmentHistory(true, false);
}
if (_value == 2) {
getPatientAppointmentHistory(false, true);
}
}); });
//_pageController.animateToPage(index, duration: Duration(milliseconds: 250), curve: Curves.easeInOut);
}, },
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -7,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class VisitTicket extends StatefulWidget { class VisitTicket extends StatefulWidget {
List<DoctorList> appoList = []; List<DoctorList> appoList = [];
@ -17,6 +19,7 @@ class VisitTicket extends StatefulWidget {
class _VisitTicketState extends State<VisitTicket> { class _VisitTicketState extends State<VisitTicket> {
bool isLoading = false; bool isLoading = false;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -26,6 +29,7 @@ class _VisitTicketState extends State<VisitTicket> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).todoList, appBarTitle: TranslationBase.of(context).todoList,
body: isLoading == false body: isLoading == false
@ -48,9 +52,10 @@ class _VisitTicketState extends State<VisitTicket> {
} }
getPatientAppointmentCurfewHistory(BuildContext context) { getPatientAppointmentCurfewHistory(BuildContext context) {
int languageID = projectViewModel.isArabic ? 1 : 2;
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientAppointmentHistory(true, context).then((res) { service.getPatientAppointmentHistory(true, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -365,10 +365,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
// } // }
openAppointmentLabResults() { openAppointmentLabResults() {
int languageID = widget.projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
PatientLabOrders patientLabOrders = new PatientLabOrders(); PatientLabOrders patientLabOrders = new PatientLabOrders();
service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, context).then((res) { service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, languageID, context).then((res) {
print(res['ListLabResultsByAppNo']); print(res['ListLabResultsByAppNo']);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['ListLabResultsByAppNo'] != null) { if (res['ListLabResultsByAppNo'] != null) {
@ -400,10 +401,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
openAppointmentRadiology() { openAppointmentRadiology() {
int languageID = widget.projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology(); FinalRadiology finalRadiology = new FinalRadiology();
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context).then((res) { service.getPatientRadOrders(widget.appo.appointmentNo.toString(), languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['FinalRadiologyList'] != null) { if (res['FinalRadiologyList'] != null) {
print(res['FinalRadiologyList']); print(res['FinalRadiologyList']);

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionReportPage extends StatefulWidget { class PrescriptionReportPage extends StatefulWidget {
List<PrescriptionReportEnh> prescriptionReportEnhList; List<PrescriptionReportEnh> prescriptionReportEnhList;
@ -26,6 +28,9 @@ class PrescriptionReportPage extends StatefulWidget {
} }
class _PrescriptionReportState extends State<PrescriptionReportPage> { class _PrescriptionReportState extends State<PrescriptionReportPage> {
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -33,6 +38,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: 'Items', appBarTitle: 'Items',
@ -117,7 +123,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, .sendPrescriptionEmail(widget.appo.appointmentDate, widget.appo.setupID, projectViewModel.isArabic ? 1 : 2,
widget.listPres, context) widget.listPres, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

@ -353,7 +353,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
service service
.insertAppointment( .insertAppointment(
docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, context, widget.obGyneProcedureListResponse.procedureId) docObject.doctorID, docObject.clinicID, docObject.projectID, ObGyneTimeSlots.selectedTime, ObGyneTimeSlots.selectedDate, 0, projectViewModel.isArabic ? 1 : 2, context, widget.obGyneProcedureListResponse.procedureId)
.then((res) { .then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
@ -394,7 +394,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.updateObGyneAppointment(widget.obGyneProcedureListResponse.episodeID, int.parse(appoNo), widget.obGyneProcedureListResponse.orderNo, widget.obGyneProcedureListResponse.procedureId, .updateObGyneAppointment(widget.obGyneProcedureListResponse.episodeID, int.parse(appoNo), widget.obGyneProcedureListResponse.orderNo, widget.obGyneProcedureListResponse.procedureId,
widget.obGyneProcedureListResponse.lineItemNo, widget.obGyneProcedureListResponse.uniqueRowID) widget.obGyneProcedureListResponse.lineItemNo, widget.obGyneProcedureListResponse.uniqueRowID, projectViewModel.isArabic ? 1 : 2)
.then((res) {}) .then((res) {})
.catchError((err) { .catchError((err) {
print(err); print(err);
@ -402,13 +402,14 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> with TickerProviderSta
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
context, context,

@ -54,9 +54,6 @@ import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
var languageID; var languageID;
bool isShowAppBar = true; bool isShowAppBar = true;
@ -92,6 +89,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool isCash = false; bool isCash = false;
MyInAppBrowser browser; MyInAppBrowser browser;
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
@override @override
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
@ -109,6 +110,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
// getToDoCount();
_tabController.dispose(); _tabController.dispose();
} }
@ -168,15 +170,15 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier( child: AppExpandableNotifier(
isExpand: true, isExpand: true,
hasCounter: true, hasCounter: true,
counter: widget.appoList.length.toString(), counter: appoList.length.toString(),
title: TranslationBase.of(context).appointments, title: TranslationBase.of(context).appointments,
bodyWidget: widget.appoList.length != 0 bodyWidget: appoList.length != 0
? ListView.builder( ? ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -196,12 +198,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top: 4.0), padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265 child: appoList[index].clinicID == 265
? Container( ? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
) )
: widget.appoList[index].isLiveCareAppointment : appoList[index].isLiveCareAppointment
? SvgPicture.asset("assets/images/new/virtual.svg") ? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"), : SvgPicture.asset("assets/images/new/hospital-visit.svg"),
), ),
@ -211,9 +213,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text( child: Text(
widget.appoList[index].clinicID == 265 appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo ? TranslationBase.of(context).covidTestTodo
: widget.appoList[index].isLiveCareAppointment : appoList[index].isLiveCareAppointment
? TranslationBase.of(context).liveCareAppo ? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo, : TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
@ -221,8 +223,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer( child: CountdownTimer(
controller: new CountdownTimerController( controller:
endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) { widgetBuilder: (_, CurrentRemainingTime time) {
return time != null return time != null
? Text( ? Text(
@ -242,17 +244,17 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: Container( child: Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
performNextAction(widget.appoList[index]); performNextAction(appoList[index]);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration( decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction), color: getNextActionButtonColor(appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1), border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
child: Text( child: Text(
getNextActionText(widget.appoList[index].nextAction), getNextActionText(appoList[index].nextAction),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
), ),
@ -265,7 +267,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -273,8 +275,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
url: widget.appoList[index].doctorImageURL, url: appoList[index].doctorImageURL,
width: 52, width: 52,
height: 52, height: 52,
), ),
@ -284,32 +286,32 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName, projectViewModel.isArabic),
// MyRichText(TranslationBase.of(context).appointmentDate + ": ", // MyRichText(TranslationBase.of(context).appointmentDate + ": ",
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// Timezone changes // Timezone changes
widget.appoList[index].isLiveCareAppointment appoList[index].isLiveCareAppointment
? MyRichText( ? MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " + " " +
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
projectViewModel.isArabic) projectViewModel.isArabic)
: MyRichText( : MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " + " " +
widget.appoList[index].startTime.substring(0, 5), appoList[index].startTime.substring(0, 5),
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, appoList[index].projectName, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(), initialRating: appoList[index].actualDoctorRate.toDouble(),
size: 16.0, size: 16.0,
filledColor: Color(0XFFD02127), filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), emptyColor: Color(0XFFD02127),
@ -328,13 +330,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 12.0), padding: const EdgeInsets.only(top: 12.0),
child: Text( child: Text(
getNextActionDescription(widget.appoList[index].nextAction), getNextActionDescription(appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]); navigateToAppointmentDetails(context, appoList[index]);
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 0.0), padding: const EdgeInsets.only(top: 0.0),
@ -363,9 +365,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier( child: AppExpandableNotifier(
isExpand: true, isExpand: true,
hasCounter: true, hasCounter: true,
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0", counter: (ancillaryLists.isNotEmpty) ? ancillaryLists[0].ancillaryOrderList.length.toString() : "0",
title: TranslationBase.of(context).anicllaryOrders, title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: widget.ancillaryLists.length != 0 bodyWidget: ancillaryLists.length != 0
? Container( ? Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: ListView.separated( child: ListView.separated(
@ -374,18 +376,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
reverse: true, reverse: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList[index], ancillaryLists[0].projectID),
isInOutPatient: true, isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""),
billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), billNo: ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName, subName: ancillaryLists[0].projectName,
isLiveCareAppointment: false, isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate), date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList[index].orderDate),
isSortByClinic: true, isSortByClinic: true,
); );
}, },
itemCount: widget.ancillaryLists[0].ancillaryOrderList.length, itemCount: ancillaryLists[0].ancillaryOrderList.length,
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
), ),
) )
@ -395,13 +397,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
), ),
), ),
Container( Container(
child: widget.obGyneAppoList.length != 0 child: obGyneAppoList.length != 0
? ListView.builder( ? ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.obGyneAppoList.length, itemCount: obGyneAppoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -439,7 +441,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Container( Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]); getOBGyneDoctorsList(obGyneAppoList[index].projectID, obGyneAppoList[index].setupID, obGyneAppoList[index]);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -460,7 +462,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -468,7 +470,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52, width: 52,
height: 52, height: 52,
@ -479,12 +481,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription, projectViewModel.isArabic),
MyRichText( MyRichText(
TranslationBase.of(context).orderDate + ": ", TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0], DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription, projectViewModel.isArabic),
], ],
), ),
), ),
@ -755,14 +757,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getOBGyneOrdersList(context).then((res) { service.getOBGyneOrdersList(context).then((res) {
widget.obGyneAppoList.clear(); obGyneAppoList.clear();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['HIS_OBGYNEProcedureGet_List'].length != 0) { if (res['HIS_OBGYNEProcedureGet_List'].length != 0) {
widget.obGyneAppoList.clear(); obGyneAppoList.clear();
res['HIS_OBGYNEProcedureGet_List'].forEach((v) { res['HIS_OBGYNEProcedureGet_List'].forEach((v) {
widget.obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v)); obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v));
}); });
} else { } else {
// Navigator.of(context).popAndPushNamed(HOME); // Navigator.of(context).popAndPushNamed(HOME);
@ -782,7 +784,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = []; List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
service.getOBGyneDoctorsList(projectID, setupID, context).then((res) { service.getOBGyneDoctorsList(projectID, setupID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['HIS_ObgyneUltrasoundDoctorsList'][0]); print(res['HIS_ObgyneUltrasoundDoctorsList'][0]);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -828,31 +830,31 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
obGyneProcedureListResponse: obGyneProcedureListResponse))); obGyneProcedureListResponse: obGyneProcedureListResponse)));
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() async {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) { service.getPatientAppointmentHistory(true, languageID, context).then((res) {
widget.appoList.clear(); appoList.clear();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { if (res['AppoimentAllHistoryResultList'].length != 0) {
if (res['AppoimentAllHistoryResultList'].length != 0) { appoList.clear();
widget.appoList.clear(); res['AppoimentAllHistoryResultList'].forEach((v) {
res['AppoimentAllHistoryResultList'].forEach((v) { appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); });
}); }
} if (res['AncillaryOrderList'].length != 0) {
if (res['AncillaryOrderList'].length != 0) { res['AncillaryOrderList'].forEach((item) {
res['AncillaryOrderList'].forEach((item) { ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
widget.ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); });
}); }
} dataLoaded = true;
dataLoaded = true; if (widget.isFromMyAppointments) {
if (widget.isFromMyAppointments) { performNextAction(widget.appointment);
performNextAction(widget.appointment); widget.isFromMyAppointments = false;
widget.isFromMyAppointments = false; }
} setState(() {});
});
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -865,11 +867,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -924,13 +926,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
int languageID = projectViewModel.isArabic ? 1 : 2;
String errorMsg = ""; String errorMsg = "";
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) { if (appo.isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo); getLiveCareAppointmentPatientShare(context, service, appo);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['OnlineCheckInAppointments'].length != 0) { if (res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
@ -971,7 +974,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) { getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
@ -1278,7 +1281,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
@ -1423,7 +1426,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -56,6 +56,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
ProjectViewModel projectViewModel;
String getSelected(BuildContext context) { String getSelected(BuildContext context) {
switch (messageType) { switch (messageType) {
case MessageType.ComplaintOnAnAppointment: case MessageType.ComplaintOnAnAppointment:
@ -106,7 +108,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<FeedbackViewModel>( return BaseView<FeedbackViewModel>(
allowAny: true, allowAny: true,
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
@ -466,6 +468,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
listData: list, listData: list,
selectedIndex: selectedStatusIndex, selectedIndex: selectedStatusIndex,
onValueSelected: (index) { onValueSelected: (index) {
int languageID = projectViewModel.isArabic ? 1 : 2;
selectedStatusIndex = index; selectedStatusIndex = index;
if (index == 1) { if (index == 1) {
@ -485,7 +488,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (messageType == MessageType.ComplaintOnAnAppointment) { if (messageType == MessageType.ComplaintOnAnAppointment) {
appoList.clear(); appoList.clear();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientAppointmentHistory(false, context, isForCOC: true).then((res) { service.getPatientAppointmentHistory(false, languageID, context, isForCOC: true).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
setState(() { setState(() {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -67,7 +67,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
initialiseHmgServices(false); initialiseHmgServices(false);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
var userProvider = Provider.of<ToDoCountProviderModel>(context); // var userProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
return Container( return Container(
width: double.infinity, width: double.infinity,

@ -254,13 +254,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -457,7 +458,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() { setState(() {
notificationCount = notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
} }
@ -653,28 +654,28 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
authService.getDashboard().then((value) async { authService.getDashboard().then((value) async {
setState(() { setState(() {
if (value != null) { if (value != null) {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); notificationCount = value ['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
} }
}); });
if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) { // if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; // int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) async { // appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) async {
if (appointmentRateViewModel.isHaveAppointmentNotRate) { // if (appointmentRateViewModel.isHaveAppointmentNotRate) {
await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true); // await AppSharedPreferences().setBool(IS_LAST_APPOINTMENT_RATE_SHOWN, true);
Navigator.push( // Navigator.push(
context, // context,
FadePage( // FadePage(
page: RateAppointmentDoctor(), // page: RateAppointmentDoctor(),
), // ),
); // );
} // }
}).catchError((err) { // }).catchError((err) {
print(err); // print(err);
}); // });
} // }
}); });
} }
projectViewModel.analytics.setUser(data); projectViewModel.analytics.setUser(data);

@ -163,10 +163,10 @@ class _State extends State<ClinicCard> {
} }
getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) {
int languageID = widget.languageID == 'ar' ? 1 : 2;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) { service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -588,8 +588,9 @@ class _clinic_listState extends State<ClinicList> {
addNewCallForPatientER(String clientRequestID) { addNewCallForPatientER(String clientRequestID) {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.addNewCallForPatientER(selectedClinicID, clientRequestID, widget.isPharmacyLiveCare, context).then((res) { service.addNewCallForPatientER(selectedClinicID, clientRequestID, languageID, widget.isPharmacyLiveCare, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "New Call has been added successfully"); AppToast.showSuccessToast(message: "New Call has been added successfully");
widget.getLiveCareHistory(); widget.getLiveCareHistory();
@ -609,7 +610,7 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded = false; isDataLoaded = false;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinics(context).then((res) { service.getLivecareClinics(languageID == 'ar' ? 1: 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['PatientER_GetClinicsList'].length); print(res['PatientER_GetClinicsList'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -663,11 +663,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
checkIfUserAgreedBefore(CheckActivationCode result) { checkIfUserAgreedBefore(CheckActivationCode result) {
if (result.isNeedUserAgreement == true) { // if (result.isNeedUserAgreement == true) {
//move to agreement page. //move to agreement page.
} else { // } else {
goToHome(); goToHome();
} // }
} }
insertIMEI() { insertIMEI() {
@ -677,11 +677,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
// toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -695,17 +696,45 @@ class _ConfirmLogin extends State<ConfirmLogin> {
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await authenticatedUserObject.getUser(getUser: true); await authenticatedUserObject.getUser(getUser: true);
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
getToDoCount(); getToDoCount();
appointmentRateViewModel
.getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
.then((value) => {
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);
});
Navigator.pushAndRemoveUntil( // getToDoCount();
context,
FadePage( // Navigator.pushAndRemoveUntil(
page: LandingPage(), // context,
), // FadePage(
(r) => false); // page: LandingPage(),
insertIMEI(); // ),
// (r) => false);
// insertIMEI();
} }
loading(flag) { loading(flag) {

@ -345,55 +345,55 @@ class _Login extends State<Login> {
authenticatedUserObject.user = result.list; authenticatedUserObject.user = result.list;
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
//
// getToDoCount();
//
// Navigator.pushAndRemoveUntil(
// context,
// FadePage(
// page: LandingPage(),
// ),
// (r) => false);
getToDoCount(); getToDoCount();
appointmentRateViewModel
Navigator.pushAndRemoveUntil( .getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
context, .then((value) => {
FadePage( GifLoaderDialogUtils.hideDialog(context),
page: LandingPage(), if (appointmentRateViewModel.isHaveAppointmentNotRate)
), {
(r) => false); Navigator.pushAndRemoveUntil(
context,
// appointmentRateViewModel FadePage(
// .getIsLastAppointmentRatedList() page: RateAppointmentDoctor(),
// .then((value) => { ),
// getToDoCount(), (r) => false)
// GifLoaderDialogUtils.hideDialog(context), }
// if (appointmentRateViewModel.isHaveAppointmentNotRate) else
// { {
// Navigator.pushAndRemoveUntil( Navigator.pushAndRemoveUntil(
// context, context,
// FadePage( FadePage(
// page: RateAppointmentDoctor(), page: LandingPage(),
// ), ),
// (r) => false) (r) => false)
// } }
// else })
// { .catchError((err) {
// Navigator.pushAndRemoveUntil( print(err);
// context, GifLoaderDialogUtils.hideDialog(context);
// FadePage( });
// page: LandingPage(),
// ),
// (r) => false)
// }
// })
// .catchError((err) {
// print(err);
// GifLoaderDialogUtils.hideDialog(context);
// });
}); });
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -748,11 +748,12 @@ class _RegisterInfo extends State<RegisterInfo> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -67,7 +67,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getHospitals(isAdvancePayment: true); model.getHospitals(projectViewModel.isArabic ? 1 : 2, isAdvancePayment: true);
model.getFamilyFiles(); model.getFamilyFiles();
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(

@ -36,6 +36,7 @@ class EyeHomePage extends StatefulWidget {
class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStateMixin { class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStateMixin {
TabController _tabController; TabController _tabController;
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = List();
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -54,7 +55,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<EyeViewModel>( return BaseView<EyeViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -180,7 +181,7 @@ class _EyeHomePageState extends State<EyeHomePage> with SingleTickerProviderStat
void getDoctorRatingsDetails() { void getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, context).then((res) { service.getDoctorsRatingDetails(widget.appointmentAllHistoryResultList.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();

@ -31,6 +31,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
TabController _tabController_new; TabController _tabController_new;
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
int _currentPage = 0; int _currentPage = 0;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -46,7 +47,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png')); imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
@ -55,7 +56,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png')); imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
return BaseView<ReportsViewModel>( return BaseView<ReportsViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getReports(); model.getReports(projectViewModel.isArabic ? 1 : 2);
}, },
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -156,11 +157,13 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: InPatientMedicalReports( page: InPatientMedicalReports(
admissionMedicalReport: admissionMedicalReport, admissionMedicalReport: admissionMedicalReport,
))); ),
),
);
}, },
child: Container( child: Container(
// height: 100.0, // height: 100.0,
@ -259,7 +262,7 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
page: MedicalReports(), page: MedicalReports(),
), ),
).then((value) { ).then((value) {
model.getReports(); model.getReports(projectViewModel.isArabic ? 1 : 2);
}), }),
), ),
) )

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
@ -197,7 +198,9 @@ class ReportListWidget extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
ReportsService _reportsService = locator<ReportsService>(); ReportsService _reportsService = locator<ReportsService>();
_reportsService _reportsService
.sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate), report.invoiceNo.toString(), report.projectID, .sendEmailForMedicalReport(report.projectName, report.clinicDescription, report.doctorName, DateUtil.convertDateToString(report.requestDate),
Utils.isVidaPlusProject(projectViewModel, report.projectID) ? report.invoiceNo_VP.toString() : report.invoiceNo.toString(),
report.projectID,
DateUtil.convertDateToString(report.requestDate), report.setupId) DateUtil.convertDateToString(report.requestDate), report.setupId)
.then((value) { .then((value) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);

@ -32,10 +32,11 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
String note = ""; String note = "";
int rating = 0; int rating = 0;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return BaseView<AppointmentRateViewModel>( return BaseView<AppointmentRateViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -191,18 +192,27 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).later, TranslationBase.of(context).later,
() { () {
// Navigator.pushReplacement( Navigator.pushReplacement(
// context,
// FadePage(
// page: LandingPage(),
// ),
// );
Navigator.pop(
context,
);
Navigator.pop(
context, context,
FadePage(
page: LandingPage(),
),
); );
// if (projectViewModel.isLoginChild) {
// Navigator.pushReplacement(
// context,
// FadePage(
// page: LandingPage(),
// ),
// );
// } else {
// Navigator.pop(
// context,
// // FadePage(
// // page: LandingPage(),
// // ),
// );
// }
}, },
color: CustomColors.accentColor, color: CustomColors.accentColor,
textColor: Colors.white, textColor: Colors.white,
@ -215,9 +225,10 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
rating <= 0 rating <= 0
? null ? null
: () { : () {
int languageID = projectViewModel.isArabic ? 1 : 2;
model model
.sendAppointmentRate( .sendAppointmentRate(rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID,
rating, widget.appointmentDetails.appointmentNo, widget.appointmentDetails.projectID, widget.appointmentDetails.doctorID, widget.appointmentDetails.clinicID, note) widget.appointmentDetails.clinicID, note, languageID)
.then( .then(
(value) => { (value) => {
model model

@ -193,21 +193,27 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
}); });
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} else { } else {
if(projectViewModel.isLoginChild) { Navigator.pushReplacement(
Navigator.pushReplacement( context,
context, FadePage(
FadePage( page: LandingPage(),
page: LandingPage(), ),
), );
); // if(projectViewModel.isLoginChild) {
} else { // Navigator.pushReplacement(
Navigator.pop( // context,
context, // FadePage(
// FadePage( // page: LandingPage(),
// page: LandingPage(), // ),
// ), // );
); // } else {
} // Navigator.pop(
// context,
// // FadePage(
// // page: LandingPage(),
// // ),
// );
// }
} }
}, },
color: CustomColors.accentColor, color: CustomColors.accentColor,

@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart';
import 'package:diplomaticquarterapp/pages/final_products_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -34,7 +35,7 @@ class DoctorsListService extends BaseService {
String tokenID; String tokenID;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, int languageID, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -74,6 +75,7 @@ class DoctorsListService extends BaseService {
"Longitude": long != null ? long.toString() : 0, "Longitude": long != null ? long.toString() : 0,
"isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan, "isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan,
"IsGetNearAppointment": isNearest, "IsGetNearAppointment": isNearest,
"LanguageID": languageID,
if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()), if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()),
"License": true "License": true
}; };
@ -88,7 +90,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorsListByName(String docName, BuildContext context) async { Future<Map> getDoctorsListByName(String docName, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
double lat; double lat;
@ -126,6 +128,7 @@ class DoctorsListService extends BaseService {
"IsGetNearAppointment": false, "IsGetNearAppointment": false,
"Latitude": lat == null ? 0.0 : lat, "Latitude": lat == null ? 0.0 : lat,
"Longitude": long == null ? 0.0 : long, "Longitude": long == null ? 0.0 : long,
"LanguageID": languageID,
"License": true "License": true
}; };
@ -139,7 +142,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, context) async { Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, int languageID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
@ -158,7 +161,8 @@ class DoctorsListService extends BaseService {
"License": true, "License": true,
"IsRegistered": true, "IsRegistered": true,
"ProjectID": projectID, "ProjectID": projectID,
"isDentalAllowedBackend": false "isDentalAllowedBackend": false,
"LanguageID": languageID,
}; };
dynamic localRes; dynamic localRes;
@ -171,7 +175,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorsRating(int docID, context) async { Future<Map> getDoctorsRating(int docID,int languageID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
@ -188,6 +192,7 @@ class DoctorsListService extends BaseService {
"PatientID": 0, "PatientID": 0,
"License": true, "License": true,
"IsRegistered": true, "IsRegistered": true,
"LanguageID": languageID,
"isDentalAllowedBackend": false "isDentalAllowedBackend": false
}; };
@ -221,7 +226,7 @@ class DoctorsListService extends BaseService {
return Future.value(images); return Future.value(images);
} }
Future<Map> getDoctorsRatingDetails(int docID, context) async { Future<Map> getDoctorsRatingDetails(int docID,int languageID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
@ -238,6 +243,7 @@ class DoctorsListService extends BaseService {
"PatientID": 0, "PatientID": 0,
"License": true, "License": true,
"IsRegistered": true, "IsRegistered": true,
"LanguageID": languageID,
"isDentalAllowedBackend": false "isDentalAllowedBackend": false
}; };
@ -270,6 +276,7 @@ class DoctorsListService extends BaseService {
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
"SessionID": null, "SessionID": null,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"LanguageID": 1,
"DeviceTypeID": 1 "DeviceTypeID": 1
}; };
@ -313,6 +320,7 @@ class DoctorsListService extends BaseService {
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
"SessionID": null, "SessionID": null,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"LanguageID": 1,
"DeviceTypeID": 1 "DeviceTypeID": 1
}; };
@ -326,7 +334,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, BuildContext context, Future<Map> insertAppointment(int docID, int clinicID, int projectID, String selectedTime, String selectedDate, int initialSlotDuration, int languageID, BuildContext context,
[String procedureID, num testTypeEnum, num testProcedureEnum, ProjectViewModel projectViewModel]) async { [String procedureID, num testTypeEnum, num testProcedureEnum, ProjectViewModel projectViewModel]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
@ -389,7 +397,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, BuildContext context) async { Future<Map> insertLiveCareScheduleAppointment(int docID, int clinicID, int projectID, int serviceID, String selectedTime, String selectedDate, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -440,7 +448,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { Future<Map> getPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -465,6 +473,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -478,14 +487,14 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> setOnlineCheckInForAppointment(String appoID, int projectID, BuildContext context) async { Future<Map> setOnlineCheckInForAppointment(String appoID, int projectID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
request = {"ProjectID": projectID, "AppointmentNo": appoID}; request = {"ProjectID": projectID, "AppointmentNo": appoID, "LanguageID": languageID};
dynamic localRes; dynamic localRes;
@ -497,7 +506,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, BuildContext context) async { Future<Map> getLiveCareAppointmentPatientShare(String appoID, int clinicID, int projectID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -523,6 +532,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -558,7 +568,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getOBGyneDoctorsList(int projectID, String setupID, BuildContext context) async { Future<Map> getOBGyneDoctorsList(int projectID, String setupID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -575,6 +585,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -601,7 +612,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async { Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, int languageID, BuildContext context, {bool isForCOC = false, isForUpcomming = false, IsForArrived = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -623,7 +634,10 @@ class DoctorsListService extends BaseService {
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"IsComingFromCOC": isForCOC, "IsComingFromCOC": isForCOC,
"PatientType": authUser.patientType "PatientType": authUser.patientType,
"LanguageID": languageID,
"isForUpcomming": isForUpcomming,
"IsForArrived": IsForArrived
}; };
dynamic localRes; dynamic localRes;
@ -690,6 +704,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -703,7 +718,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, BuildContext context) async { Future<Map> insertVIDARequest(int appoNo, int clinicID, int projectID, int serviceID, int docID, String appoDate, String clientRequestID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -744,6 +759,7 @@ class DoctorsListService extends BaseService {
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType, "PatientType": authUser.patientType,
"VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN), "VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN),
"LanguageID": languageID,
"IsVoip": Platform.isIOS ? true : false "IsVoip": Platform.isIOS ? true : false
}; };
@ -789,6 +805,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -827,6 +844,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -902,6 +920,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
dynamic localRes; dynamic localRes;
@ -948,6 +967,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
dynamic localRes; dynamic localRes;
@ -991,6 +1011,7 @@ class DoctorsListService extends BaseService {
"PatientType": authUser.patientType, "PatientType": authUser.patientType,
"DeviceToken": await sharedPref.getString(PUSH_TOKEN), "DeviceToken": await sharedPref.getString(PUSH_TOKEN),
"VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN), "VoipToken": await sharedPref.getString(ONESIGNAL_APNS_TOKEN),
"LanguageID": 1,
"IsVoip": Platform.isIOS ? true : false "IsVoip": Platform.isIOS ? true : false
}; };
@ -1027,6 +1048,7 @@ class DoctorsListService extends BaseService {
}); });
request = { request = {
"LanguageID": 1,
"RequestAncillaryOrderInvoice": [ "RequestAncillaryOrderInvoice": [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
], ],
@ -1159,7 +1181,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientRadOrders(String appoNo, BuildContext context) async { Future<Map> getPatientRadOrders(String appoNo, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1179,6 +1201,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1191,7 +1214,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, BuildContext context) async { Future<Map> getPatientLabOrdersByAppoNo(dynamic appoNo, dynamic projID, dynamic clinicID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1213,6 +1236,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1225,7 +1249,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, BuildContext context) async { Future<Map> getPatientPrescriptionReports(AppoitmentAllHistoryResultList appo, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1249,6 +1273,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1261,7 +1286,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendPrescriptionEmail(String appoDate, String setupId, dynamic prescriptionReportEnhList, BuildContext context) async { Future<Map> sendPrescriptionEmail(String appoDate, String setupId, int languageID, dynamic prescriptionReportEnhList, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1288,6 +1313,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": authUser.patientType,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1331,6 +1357,7 @@ class DoctorsListService extends BaseService {
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
dynamic localRes; dynamic localRes;
@ -1369,7 +1396,7 @@ class DoctorsListService extends BaseService {
"PaymentMethod": paymentMethodName, "PaymentMethod": paymentMethodName,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": 1,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1405,6 +1432,7 @@ class DoctorsListService extends BaseService {
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"ERAdvanceAmount": { "ERAdvanceAmount": {
"ProjectId": projectID, "ProjectId": projectID,
"PatientId": authUser.patientID, "PatientId": authUser.patientID,
@ -1445,6 +1473,7 @@ class DoctorsListService extends BaseService {
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": 1,
"EROnlineCheckinPaymentDetails": { "EROnlineCheckinPaymentDetails": {
"CheckinDate": DateUtil.convertDateToString(DateTime.now()), "CheckinDate": DateUtil.convertDateToString(DateTime.now()),
"ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()), "ExpectedArrivalTime": DateUtil.convertDateToString(DateTime.now()),
@ -1522,6 +1551,7 @@ class DoctorsListService extends BaseService {
request = { request = {
"ProjectID": projectID, "ProjectID": projectID,
"LanguageID": 1,
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(HAS_DENTAL_PLAN, onSuccess: (response, statusCode) async { await baseAppClient.post(HAS_DENTAL_PLAN, onSuccess: (response, statusCode) async {
@ -1583,12 +1613,13 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getLaserBodyPartsList(int laserCategoryID, int projectID) async { Future<Map> getLaserBodyPartsList(int laserCategoryID, int projectID, int languageID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"LaserCategoryID": laserCategoryID, "LaserCategoryID": laserCategoryID,
"ProjectID": projectID, "ProjectID": projectID,
"LanguageID": languageID,
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async { await baseAppClient.post(LASER_BODY_PARTS, onSuccess: (response, statusCode) async {
@ -1599,11 +1630,12 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int testProcedureEnum) async { Future<Map> insertCovidQuestionnaire(List qa, int projectID, int testTypeEnum, int languageID, int testProcedureEnum) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"ProjectID": projectID, "ProjectID": projectID,
"LanguageID": languageID,
"IsForTravel": qa[0]['ans'].toString(), "IsForTravel": qa[0]['ans'].toString(),
"IsComingOutSA": qa[1]['ans'].toString(), "IsComingOutSA": qa[1]['ans'].toString(),
"IsFeverCurrently": qa[2]['ans'].toString(), "IsFeverCurrently": qa[2]['ans'].toString(),
@ -1646,11 +1678,12 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID) async { Future<Map> updateObGyneAppointment(int episodeID, int appointmentNo, int orderNo, String procedureId, int lineItemNo, int uniqueRowID, int languageID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
"EpisodeID": episodeID, "EpisodeID": episodeID,
"LanguageID": languageID,
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
"OrderNo": orderNo, "OrderNo": orderNo,
"ProcedureId": procedureId, "ProcedureId": procedureId,
@ -1669,10 +1702,10 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getRRTProcedures(int projectID) async { Future<Map> getRRTProcedures(int projectID, int languageID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"ProjectID": projectID}; request = {"ProjectID": projectID, "LanguageID": languageID};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_RRT_PROCEDURE_LIST, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_RRT_PROCEDURE_LIST, onSuccess: (response, statusCode) async {
@ -1690,6 +1723,7 @@ class DoctorsListService extends BaseService {
"ClientRequestID": clientRequestID, "ClientRequestID": clientRequestID,
"Status": status, "Status": status,
"FortID": tamaraOrderID, // Tamara order ID "FortID": tamaraOrderID, // Tamara order ID
"LanguageID": 1,
"Installments_Number": selectedInstallments "Installments_Number": selectedInstallments
}; };
@ -1705,7 +1739,7 @@ class DoctorsListService extends BaseService {
Future<Map> markAppointmentForTamara(int projectID, String appoNo) async { Future<Map> markAppointmentForTamara(int projectID, String appoNo) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"ProjectID": projectID, "AppointmentNo": appoNo}; request = {"ProjectID": projectID, "AppointmentNo": appoNo, "LanguageID": 1};
dynamic localRes; dynamic localRes;
await baseAppClient.post(MARK_APPOINTMENT_TAMARA_STATUS, onSuccess: (response, statusCode) async { await baseAppClient.post(MARK_APPOINTMENT_TAMARA_STATUS, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -1718,7 +1752,7 @@ class DoctorsListService extends BaseService {
Future<Map> autoGenerateInvoiceTamara(int projectID, String appoNo, String mobileNo) async { Future<Map> autoGenerateInvoiceTamara(int projectID, String appoNo, String mobileNo) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102}; request = {"ProjectID": projectID, "AppointmentNo": appoNo, "MobileNo": mobileNo, "UserID": 102, "LanguageID": 1};
dynamic localRes; dynamic localRes;
await baseAppClient.post(AUTO_GENERATE_INVOICE_TAMARA, onSuccess: (response, statusCode) async { await baseAppClient.post(AUTO_GENERATE_INVOICE_TAMARA, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -1731,7 +1765,7 @@ class DoctorsListService extends BaseService {
Future<Map> checkPatientNphiesEligibility(int projectID) async { Future<Map> checkPatientNphiesEligibility(int projectID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"ProjectID": projectID}; request = {"ProjectID": projectID, "LanguageID": 1};
dynamic localRes; dynamic localRes;
await baseAppClient.post(CHECK_PATIENT_NPHIES_ELIGIBILITY, onSuccess: (response, statusCode) async { await baseAppClient.post(CHECK_PATIENT_NPHIES_ELIGIBILITY, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -1744,7 +1778,7 @@ class DoctorsListService extends BaseService {
Future<Map> convertPatientToCash(int projectID) async { Future<Map> convertPatientToCash(int projectID) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {"ProjectID": projectID}; request = {"ProjectID": projectID, "LanguageID": 1};
dynamic localRes; dynamic localRes;
await baseAppClient.post(CONVERT_PATIENT_TO_CASH, onSuccess: (response, statusCode) async { await baseAppClient.post(CONVERT_PATIENT_TO_CASH, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -1788,6 +1822,7 @@ class DoctorsListService extends BaseService {
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
"SessionID": null, "SessionID": null,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"LanguageID": 1,
"DeviceTypeID": 1 "DeviceTypeID": 1
}; };

@ -565,7 +565,7 @@ class AuthProvider with ChangeNotifier {
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false; Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
model.setState(0, false, null); model.setState(0, 0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
} }

@ -34,10 +34,7 @@ class ClinicListService extends BaseService {
Future<Map> getActiveAppointmentNo(context) async { Future<Map> getActiveAppointmentNo(context) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request = { request = {"IsActiveAppointment": true, "LanguageID": 1};
"IsActiveAppointment": true,
"LanguageID": 1
};
dynamic localRes; dynamic localRes;
@ -49,12 +46,10 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getProjectsList(context) async { Future<Map> getProjectsList(int languageID, context) async {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request = { request = {"LanguageID": languageID};
"LanguageID": null
};
dynamic localRes; dynamic localRes;
@ -66,7 +61,7 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintsList(int clinicID, int projectID, BuildContext context, {doctorId}) async { Future<Map> getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async {
//Utils.showProgressDialog(context); //Utils.showProgressDialog(context);
Map<String, dynamic> request; Map<String, dynamic> request;
@ -85,7 +80,7 @@ class ClinicListService extends BaseService {
"License": true, "License": true,
// "VersionID": 5.6, // "VersionID": 5.6,
// "Channel": 3, // "Channel": 3,
// "LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"SessionID": null, "SessionID": null,
@ -107,7 +102,7 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, BuildContext context, {doctorId}) async { Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, int languageID, BuildContext context, {doctorId}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -127,7 +122,7 @@ class ClinicListService extends BaseService {
"ProjectID": projectID, "ProjectID": projectID,
// "VersionID": 5.6, // "VersionID": 5.6,
// "Channel": 3, // "Channel": 3,
// "LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID,
// "IPAdress": req.IPAdress, // "IPAdress": req.IPAdress,
// "generalid": req.generalid, // "generalid": req.generalid,
"SessionID": null, "SessionID": null,
@ -147,14 +142,15 @@ class ClinicListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getCountries() async { Future<Map> getCountries() async {
Map<String, dynamic> request ={}; Map<String, dynamic> request = {};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -43,6 +43,7 @@ class FamilyFilesProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
try { try {
var request = GetAllSharedRecordsByStatusReq(); var request = GetAllSharedRecordsByStatusReq();
// var request = {"LanguageID": languageID};
// var result = await sharedPref.getObject(MAIN_USER); // var result = await sharedPref.getObject(MAIN_USER);
// request.status = 0; // request.status = 0;
// request.patientID = result["PatientID"]; // request.patientID = result["PatientID"];
@ -61,7 +62,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(responseID) async { Future<GetAllSharedRecordsByStatusResponse> getUserViewRequest(responseID, int languageID) async {
try { try {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
@ -141,7 +142,7 @@ class FamilyFilesProvider with ChangeNotifier {
} }
} }
Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID, responseID) async { Future<dynamic> sendActivationCode(cellNumber, zipCode, patientIdentificationID, responseID, bool isExcluded) async {
try { try {
dynamic localRes; dynamic localRes;
var request = SendActivationRequest(); var request = SendActivationRequest();
@ -155,6 +156,7 @@ class FamilyFilesProvider with ChangeNotifier {
request.responseID = responseID; request.responseID = responseID;
request.status = 2; request.status = 2;
request.familyRegionID = zipCode == '966' ? 1 : 2; request.familyRegionID = zipCode == '966' ? 1 : 2;
request.isPatientExcluded = isExcluded;
await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SEND_FAMILY_FILE_ACTIVATION, onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -17,7 +17,7 @@ class LiveCareService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
Future<Map> getLivecareClinics(BuildContext context) async { Future<Map> getLivecareClinics(int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -25,7 +25,12 @@ class LiveCareService extends BaseService {
authUser = data; authUser = data;
} }
request = {"Age": authUser.age != null ? authUser.age : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "Gender": authUser.gender != null ? authUser.gender : 0}; request = {
"Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0,
"LanguageID": languageID
};
dynamic localRes; dynamic localRes;
@ -122,7 +127,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getLivecareClinicTiming(int serviceID, BuildContext context) async { Future<Map> getLivecareClinicTiming(int serviceID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -132,6 +137,7 @@ class LiveCareService extends BaseService {
request = { request = {
"ServiceID": serviceID, "ServiceID": serviceID,
"LanguageID": languageID,
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0 "Gender": authUser.gender != null ? authUser.gender : 0
@ -203,7 +209,7 @@ class LiveCareService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, bool isPharma, BuildContext context) async { Future<Map> addNewCallForPatientER(int serviceID, String clientRequestID, int languageID, bool isPharma, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
String deviceToken; String deviceToken;
@ -231,6 +237,7 @@ class LiveCareService extends BaseService {
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"Gender": authUser.gender != null ? authUser.gender : 0, "Gender": authUser.gender != null ? authUser.gender : 0,
"LanguageID": languageID,
"IsVoip": Platform.isIOS ? true : false "IsVoip": Platform.isIOS ? true : false
}; };
@ -354,5 +361,4 @@ class LiveCareService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -31,24 +31,24 @@ class LocalNotification {
_initialize() async { _initialize() async {
try { try {
var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null); // var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null);
var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); // var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS);
await flutterLocalNotificationsPlugin.initialize( // await flutterLocalNotificationsPlugin.initialize(
initializationSettings, // initializationSettings,
onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) { // onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) {
switch (notificationResponse.notificationResponseType) { // switch (notificationResponse.notificationResponseType) {
case NotificationResponseType.selectedNotification: // case NotificationResponseType.selectedNotification:
// selectNotificationStream.add(notificationResponse.payload); // // selectNotificationStream.add(notificationResponse.payload);
break; // break;
case NotificationResponseType.selectedNotificationAction: // case NotificationResponseType.selectedNotificationAction:
// if (notificationResponse.actionId == navigationActionId) { // // if (notificationResponse.actionId == navigationActionId) {
// selectNotificationStream.add(notificationResponse.payload); // // selectNotificationStream.add(notificationResponse.payload);
// } // // }
break; // break;
} // }
}, // },
onDidReceiveBackgroundNotificationResponse: notificationTapBackground, // onDidReceiveBackgroundNotificationResponse: notificationTapBackground,
); // );
} catch (ex) {} } catch (ex) {}
// flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) // flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse notificationResponse)
// { // {
@ -68,16 +68,16 @@ class LocalNotification {
// ); // );
} }
void notificationTapBackground(NotificationResponse notificationResponse) { // void notificationTapBackground(NotificationResponse notificationResponse) {
// ignore: avoid_print // // ignore: avoid_print
print('notification(${notificationResponse.id}) action tapped: ' // print('notification(${notificationResponse.id}) action tapped: '
'${notificationResponse.actionId} with' // '${notificationResponse.actionId} with'
' payload: ${notificationResponse.payload}'); // ' payload: ${notificationResponse.payload}');
if (notificationResponse.input?.isNotEmpty ?? false) { // if (notificationResponse.input?.isNotEmpty ?? false) {
// ignore: avoid_print // // ignore: avoid_print
print('notification action tapped with input: ${notificationResponse.input}'); // print('notification action tapped with input: ${notificationResponse.input}');
} // }
} // }
var _random = new Random(); var _random = new Random();
@ -96,15 +96,15 @@ class LocalNotification {
} }
Future showNow({@required String title, @required String subtitle, String payload}) { Future showNow({@required String title, @required String subtitle, String payload}) {
Future.delayed(Duration(seconds: 1)).then((result) async { // Future.delayed(Duration(seconds: 1)).then((result) async {
var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', // var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG',
channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern()); // channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern());
var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); // var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { // await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) {
print(err); // print(err);
}); // });
}); // });
} }
Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async { Future scheduleNotification({@required DateTime scheduledNotificationDateTime, @required String title, @required String description}) async {
@ -115,31 +115,31 @@ class LocalNotification {
vibrationPattern[2] = 5000; vibrationPattern[2] = 5000;
vibrationPattern[3] = 2000; vibrationPattern[3] = 2000;
var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', // var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions',
channelDescription: 'ActivePrescriptionsDescription', // channelDescription: 'ActivePrescriptionsDescription',
// icon: 'secondary_icon', // // icon: 'secondary_icon',
sound: RawResourceAndroidNotificationSound('slow_spring_board'), // sound: RawResourceAndroidNotificationSound('slow_spring_board'),
//
///change it to be as ionic // ///change it to be as ionic
// largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic // // largeIcon: DrawableResourceAndroidBitmap('sample_large_icon'),///change it to be as ionic
vibrationPattern: vibrationPattern, // vibrationPattern: vibrationPattern,
enableLights: true, // enableLights: true,
color: const Color.fromARGB(255, 255, 0, 0), // color: const Color.fromARGB(255, 255, 0, 0),
ledColor: const Color.fromARGB(255, 255, 0, 0), // ledColor: const Color.fromARGB(255, 255, 0, 0),
ledOnMs: 1000, // ledOnMs: 1000,
ledOffMs: 500); // ledOffMs: 500);
var iOSPlatformChannelSpecifics = DarwinNotificationDetails(sound: 'slow_spring_board.aiff'); // var iOSPlatformChannelSpecifics = DarwinNotificationDetails(sound: 'slow_spring_board.aiff');
// /change it to be as ionic // /change it to be as ionic
var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics);
await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics); // await flutterLocalNotificationsPlugin.schedule(0, title, description, scheduledNotificationDateTime, platformChannelSpecifics);
} }
///Repeat notification every day at approximately 10:00:00 am ///Repeat notification every day at approximately 10:00:00 am
Future showDailyAtTime() async { Future showDailyAtTime() async {
var time = Time(10, 0, 0); var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description'); // var androidPlatformChannelSpecifics = AndroidNotificationDetails('repeatDailyAtTime channel id', 'repeatDailyAtTime channel name', channelDescription: 'repeatDailyAtTime description');
var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); // var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.showDailyAtTime( // await flutterLocalNotificationsPlugin.showDailyAtTime(
@ -153,8 +153,8 @@ class LocalNotification {
///Repeat notification weekly on Monday at approximately 10:00:00 am ///Repeat notification weekly on Monday at approximately 10:00:00 am
Future showWeeklyAtDayAndTime() async { Future showWeeklyAtDayAndTime() async {
var time = Time(10, 0, 0); var time = Time(10, 0, 0);
var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description'); // var androidPlatformChannelSpecifics = AndroidNotificationDetails('show weekly channel id', 'show weekly channel name', channelDescription: 'show weekly description');
var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); // var iOSPlatformChannelSpecifics = DarwinNotificationDetails();
// var platformChannelSpecifics = NotificationDetails( // var platformChannelSpecifics = NotificationDetails(
// androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics); // androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
// await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( // await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(

@ -28,7 +28,7 @@ class LocationUtils {
LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false}); LocationUtils({@required this.isShowConfirmDialog, @required this.context, this.isHuawei = false});
void getCurrentLocation({Function(LatLng) callBack}) async { void getCurrentLocation({Function(LatLng) callBack, Function() failureCallBack}) async {
if (Platform.isAndroid && isHuawei) { if (Platform.isAndroid && isHuawei) {
_getHMSCurrentLocation(callBack); _getHMSCurrentLocation(callBack);
} else { } else {
@ -68,7 +68,7 @@ class LocationUtils {
print(err); print(err);
}); });
} else { } else {
if (isShowConfirmDialog) showErrorLocationDialog(false); if (isShowConfirmDialog) showErrorLocationDialog(false, failureCallBack: failureCallBack);
} }
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -141,14 +141,28 @@ class LocationUtils {
} }
} }
showErrorLocationDialog(bool isPermissionError) { showErrorLocationDialog(bool isPermissionError, {Function() failureCallBack}) {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: TranslationBase.of(context).locationDialogMessage, confirmMessage: TranslationBase.of(context).locationDialogMessage,
okText: TranslationBase.of(context).confirm, okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps, cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), if (isPermissionError) Geolocator.openAppSettings() else Geolocator.openLocationSettings(), Navigator.of(context).canPop()}, okFunction: () {
cancelFunction: () => {}); ConfirmDialog.closeAlertDialog(context);
if (isPermissionError)
Geolocator.openAppSettings();
else
Geolocator.openLocationSettings();
Navigator.of(context).canPop();
if (failureCallBack != null) {
failureCallBack();
}
},
cancelFunction: () {
if (failureCallBack != null) {
failureCallBack();
}
});
return dialog.showAlertDialog(context); return dialog.showAlertDialog(context);
} }

@ -303,6 +303,7 @@ class PushNotificationHandler {
onToken(token); onToken(token);
}); });
if(Platform.isIOS) { if(Platform.isIOS) {
FirebaseMessaging.instance.getAPNSToken().then((value) { FirebaseMessaging.instance.getAPNSToken().then((value) {
print("Push APNS getToken: " + value); print("Push APNS getToken: " + value);
@ -351,10 +352,10 @@ class PushNotificationHandler {
Future<void> isAndroidPermissionGranted() async { Future<void> isAndroidPermissionGranted() async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
final bool granted = await flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()?.areNotificationsEnabled() ?? false; // final bool granted = await flutterLocalNotificationsPlugin.resolvePlatfxormSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()?.areNotificationsEnabled() ?? false;
if (!granted) { // if (!granted) {
await requestPermissions(); // await requestPermissions();
} // }
} }
} }

@ -2912,6 +2912,8 @@ class TranslationBase {
String get validInsurance => localizedValues["validInsurance"][locale.languageCode]; String get validInsurance => localizedValues["validInsurance"][locale.languageCode];
String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode]; String get checkInViaLocation => localizedValues["checkInViaLocation"][locale.languageCode];
String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode]; String get locationCheckInError => localizedValues["locationCheckInError"][locale.languageCode];
String get upcoming => localizedValues["upcoming"][locale.languageCode];
String get noUpcomingAppointment => localizedValues["noUpcomingAppointment"][locale.languageCode];
} }

@ -614,42 +614,38 @@ class Utils {
hasBadge: true, hasBadge: true,
isEnable: projectViewModel.havePrivilege(5)), isEnable: projectViewModel.havePrivilege(5)),
projectViewModel.isArabic projectViewModel.isArabic
? !projectViewModel.isLoginChild ? Positioned(
? Positioned( left: 8,
left: 8, top: 4,
top: 4, child: badge_import.Badge(
child: badge_import.Badge( toAnimate: false,
toAnimate: false, elevation: 0,
elevation: 0, position: badge_import.BadgePosition.topEnd(),
position: badge_import.BadgePosition.topEnd(), shape: badge_import.BadgeShape.circle,
shape: badge_import.BadgeShape.circle, badgeColor: secondaryColor.withOpacity(1.0),
badgeColor: secondaryColor.withOpacity(1.0), borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), badgeContent: Container(
badgeContent: Container( padding: EdgeInsets.all(2.0),
padding: EdgeInsets.all(2.0), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), ),
), ),
), )
) : Positioned(
: Container() right: 8,
: !projectViewModel.isLoginChild top: 4,
? Positioned( child: badge_import.Badge(
right: 8, toAnimate: false,
top: 4, elevation: 0,
child: badge_import.Badge( position: badge_import.BadgePosition.topEnd(),
toAnimate: false, shape: badge_import.BadgeShape.circle,
elevation: 0, badgeColor: secondaryColor.withOpacity(1.0),
position: badge_import.BadgePosition.topEnd(), borderRadius: BorderRadius.circular(8),
shape: badge_import.BadgeShape.circle, badgeContent: Container(
badgeColor: secondaryColor.withOpacity(1.0), padding: EdgeInsets.all(2.0),
borderRadius: BorderRadius.circular(8), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)),
badgeContent: Container( ),
padding: EdgeInsets.all(2.0), ),
child: Text(count.toString(), style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12.0)), ),
),
),
)
: Container(),
]) ])
: MedicalProfileItem( : MedicalProfileItem(
title: TranslationBase.of(context).myAppointments, title: TranslationBase.of(context).myAppointments,

@ -114,7 +114,7 @@ class BottomNavigationItem extends StatelessWidget {
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(model.count.toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)), child: Text((model.count + model.ancillaryCount).toString(), style: TextStyle(color: Colors.white, fontSize: 14.0)),
), ),
), ),
), ),

@ -42,6 +42,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
// import 'package:flutter_amazonpaymentservices/environment_type.dart'; // import 'package:flutter_amazonpaymentservices/environment_type.dart';
// import 'package:flutter_amazonpaymentservices/flutter_amazonpaymentservices.dart'; // import 'package:flutter_amazonpaymentservices/flutter_amazonpaymentservices.dart';
@ -66,12 +67,6 @@ class AppDrawer extends StatefulWidget {
class _AppDrawerState extends State<AppDrawer> { class _AppDrawerState extends State<AppDrawer> {
final InAppReview _inAppReview = InAppReview.instance; final InAppReview _inAppReview = InAppReview.instance;
@override
void initState() {
super.initState();
checkUserData();
}
ProjectViewModel projectProvider; ProjectViewModel projectProvider;
var sharedPref = new AppSharedPreferences(); var sharedPref = new AppSharedPreferences();
var familyFileProvider = FamilyFilesProvider(); var familyFileProvider = FamilyFilesProvider();
@ -88,6 +83,12 @@ class _AppDrawerState extends State<AppDrawer> {
final authService = new AuthProvider(); final authService = new AuthProvider();
String pharmacyLiveCareQRCode = ""; String pharmacyLiveCareQRCode = "";
@override
void initState() {
super.initState();
checkUserData();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context); projectProvider = Provider.of(context);
@ -221,7 +222,7 @@ class _AppDrawerState extends State<AppDrawer> {
builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) { builder: (BuildContext context, AsyncSnapshot<GetAllSharedRecordsByStatusResponse> snapshot) {
switch (snapshot.connectionState) { switch (snapshot.connectionState) {
case ConnectionState.waiting: case ConnectionState.waiting:
return Padding(padding: EdgeInsets.all(10), child: Text('')); return Padding(padding: EdgeInsets.all(10), child:CircularProgressIndicator());
default: default:
if (snapshot.hasError) if (snapshot.hasError)
return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error)); return Padding(padding: EdgeInsets.all(10), child: Text(snapshot.error));
@ -668,7 +669,7 @@ class _AppDrawerState extends State<AppDrawer> {
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
AppToast.showErrorToast(message: err.toString()); // AppToast.showErrorToast(message: err.toString());
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
} }
@ -683,16 +684,16 @@ class _AppDrawerState extends State<AppDrawer> {
var currentLang = await sharedPref.getString(APP_LANGUAGE); var currentLang = await sharedPref.getString(APP_LANGUAGE);
var mainUser = await sharedPref.getObject(MAIN_USER); var mainUser = await sharedPref.getObject(MAIN_USER);
var loginType = await sharedPref.getInt(LAST_LOGIN); var loginType = await sharedPref.getInt(LAST_LOGIN);
this.sharedPref.clear(); // this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) { if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true; result.list.isFamily = true;
} else { } else {
result.list.isFamily = false; result.list.isFamily = false;
} }
// result.list.cRSVerificationStatus = result['CRSVerificationStatus']; // result.list.cRSVerificationStatus = result['CRSVerificationStatus'];
this.sharedPref.setString(APP_LANGUAGE, currentLang); await this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setString(BLOOD_TYPE, bloodType); await this.sharedPref.setString(BLOOD_TYPE, bloodType);
this.sharedPref.setInt(LAST_LOGIN, loginType); await this.sharedPref.setInt(LAST_LOGIN, loginType);
await this.sharedPref.setObject(MAIN_USER, mainUser); await this.sharedPref.setObject(MAIN_USER, mainUser);
await this.sharedPref.setObject(USER_PROFILE, result.list); await this.sharedPref.setObject(USER_PROFILE, result.list);
await this.sharedPref.setObject(FAMILY_FILE, familyFile); await this.sharedPref.setObject(FAMILY_FILE, familyFile);
@ -705,7 +706,7 @@ class _AppDrawerState extends State<AppDrawer> {
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); // if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser();
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2; int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
@ -751,12 +752,13 @@ class _AppDrawerState extends State<AppDrawer> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) { if (res['MessageStatus'] == 1 && res['AppointmentActiveNumber'] != null) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -203,7 +203,7 @@ class DoctorHeader extends StatelessWidget {
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = List();
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(headerModel.doctorId, context).then((res) { service.getDoctorsRatingDetails(headerModel.doctorId, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();

@ -2,6 +2,7 @@ import 'dart:collection';
import 'dart:math'; import 'dart:math';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart';
@ -33,6 +34,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_tts/flutter_tts.dart'; import 'package:flutter_tts/flutter_tts.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
// import 'package:speech_to_text/speech_recognition_error.dart'; // import 'package:speech_to_text/speech_recognition_error.dart';
// import 'package:speech_to_text/speech_recognition_result.dart'; // import 'package:speech_to_text/speech_recognition_result.dart';
// import 'package:speech_to_text/speech_to_text.dart'; // import 'package:speech_to_text/speech_to_text.dart';
@ -44,9 +47,10 @@ class BottomBarSearch extends StatefulWidget {
class _SearchBot extends State<BottomBarSearch> { class _SearchBot extends State<BottomBarSearch> {
SearchProvider searchProvider = new SearchProvider(); SearchProvider searchProvider = new SearchProvider();
RobotProvider Provider = RobotProvider(); RobotProvider robotProvider = RobotProvider();
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
// final SpeechToText speech = SpeechToText(); // final SpeechToText speech = SpeechToText();
String error = ''; String error = '';
String _currentLocaleId = ""; String _currentLocaleId = "";
@ -64,6 +68,7 @@ class _SearchBot extends State<BottomBarSearch> {
bool _isInit = true; bool _isInit = true;
TextEditingController searchController = TextEditingController(); TextEditingController searchController = TextEditingController();
ProjectViewModel projectProvider;
@override @override
void initState() { void initState() {
@ -74,40 +79,37 @@ class _SearchBot extends State<BottomBarSearch> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectProvider = Provider.of(context);
return BottomAppBar( return BottomAppBar(
child: Row( child: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceAround, children: [
mainAxisSize: MainAxisSize.max, Expanded(
mainAxisAlignment: MainAxisAlignment.spaceAround, child: SizedBox(
children: [ height: 64,
Expanded( child: Material(
child: SizedBox( type: MaterialType.transparency,
height: 64, child: TextField(
child: Material( keyboardType: TextInputType.multiline,
type: MaterialType.transparency, maxLines: null,
child: TextField( controller: searchController,
keyboardType: TextInputType.multiline, decoration: InputDecoration(
maxLines: null, hintText: TranslationBase.of(context).textToSpeech,
controller: searchController, suffixIcon: IconButton(
decoration: InputDecoration( icon: Icon(Icons.mic),
hintText: TranslationBase.of(context).textToSpeech, onPressed: () async {
suffixIcon: IconButton( setState(() {
icon: Icon(Icons.mic), searchController.text = '';
onPressed: () async { });
setState(() { // await flutterTts.speak("Hello!");
searchController.text = ''; //Future.delayed(const Duration(seconds: 1), () {
}); initSpeechState().then((value) => startVoiceSearch());
// await flutterTts.speak("Hello!"); //});
//Future.delayed(const Duration(seconds: 1), () { },
initSpeechState() )),
.then((value) => startVoiceSearch());
//});
},
)),
),
),
), ),
), ),
]), ),
),
]),
); );
} }
@ -164,10 +166,7 @@ class _SearchBot extends State<BottomBarSearch> {
Future<void> initSpeechState() async { Future<void> initSpeechState() async {
// await speech.initialize(onError: errorListener, onStatus: statusListener); // await speech.initialize(onError: errorListener, onStatus: statusListener);
_currentLocaleId = _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'en-GB' : 'ar-SA'; // systemLocale.localeId;
TranslationBase.of(AppGlobal.context).locale.languageCode == 'en'
? 'en-GB'
: 'ar-SA'; // systemLocale.localeId;
flutterTts.setLanguage(_currentLocaleId); flutterTts.setLanguage(_currentLocaleId);
// if (!mounted) return; // if (!mounted) return;
@ -187,16 +186,9 @@ class _SearchBot extends State<BottomBarSearch> {
} }
getPages(text) { getPages(text) {
var request = { var request = {'VoiceMessage': text, 'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' ? 'En' : 'Ar'};
'VoiceMessage': text,
'Lang': TranslationBase.of(AppGlobal.context).locale.languageCode == 'en' searchProvider.getBotPages(request).then((value) => {getCommands(value['Understand'])});
? 'En'
: 'Ar'
};
searchProvider
.getBotPages(request)
.then((value) => {getCommands(value['Understand'])});
} }
getCommands(result) async { getCommands(result) async {
@ -207,9 +199,7 @@ class _SearchBot extends State<BottomBarSearch> {
case '100': case '100':
{ {
List clnicID = unique(result['ClinicId']); List clnicID = unique(result['ClinicId']);
if (result['ProjectId'] != 0 && if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length > 0) {
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
if (clnicID.length == 1) { if (clnicID.length == 1) {
getDoctorsList( getDoctorsList(
result['ProjectId'], result['ProjectId'],
@ -221,9 +211,7 @@ class _SearchBot extends State<BottomBarSearch> {
} else { } else {
goToClinic(clnicID); goToClinic(clnicID);
} }
} else if (result['ProjectId'] != 0 && } else if (result['ProjectId'] != 0 && clnicID.length > 0 && result['DoctorId'].length == 0) {
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) { if (clnicID.length == 1) {
getDoctorsList( getDoctorsList(
result['ProjectId'], result['ProjectId'],
@ -233,9 +221,7 @@ class _SearchBot extends State<BottomBarSearch> {
} else { } else {
goToClinic(clnicID); goToClinic(clnicID);
} }
} else if (result['ProjectId'] == 0 && } else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length == 0) {
clnicID.length > 0 &&
result['DoctorId'].length == 0) {
if (clnicID.length == 1) { if (clnicID.length == 1) {
getDoctorsList( getDoctorsList(
result['ProjectId'], result['ProjectId'],
@ -245,9 +231,7 @@ class _SearchBot extends State<BottomBarSearch> {
} else { } else {
goToClinic(clnicID); goToClinic(clnicID);
} }
} else if (result['ProjectId'] == 0 && } else if (result['ProjectId'] == 0 && clnicID.length > 0 && result['DoctorId'].length > 0) {
clnicID.length > 0 &&
result['DoctorId'].length > 0) {
if (clnicID.length == 1) { if (clnicID.length == 1) {
getDoctorsList( getDoctorsList(
result['ProjectId'], result['ProjectId'],
@ -394,12 +378,11 @@ class _SearchBot extends State<BottomBarSearch> {
} }
getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) {
int languageID = projectProvider.isArabic ? 1 : 2;
List<DoctorProfileList> docProfileList = []; List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) {
.getDoctorsProfile(doctorId, clinicId, projectId, context)
.then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) { if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) { res['DoctorProfileList'].forEach((v) {
@ -407,8 +390,7 @@ class _SearchBot extends State<BottomBarSearch> {
}); });
} }
navigateToDoctorProfile(context, doctorData[0], docProfileList[0], navigateToDoctorProfile(context, doctorData[0], docProfileList[0], isAppo: true);
isAppo: true);
//speak(); //speak();
} }
}).catchError((err) { }).catchError((err) {
@ -417,33 +399,27 @@ class _SearchBot extends State<BottomBarSearch> {
} }
getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) { getDoctorsList(projectId, clinicId, context, {doctorId, doctorName}) {
int languageID = projectProvider.isArabic ? 1 : 2;
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<String> arr = []; List<String> arr = [];
List<String> arrDistance = []; List<String> arrDistance = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.getDoctorsList(clinicId, projectId, false, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) {
.getDoctorsList(clinicId, projectId, false, context,
doctorId: doctorId, doctorName: doctorName)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && if (res['SearchDoctorsByTime_IsVoiceCommandList'] != null && res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) {
res['SearchDoctorsByTime_IsVoiceCommandList'].length != 0) {
doctorsList.clear(); doctorsList.clear();
res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) { res['SearchDoctorsByTime_IsVoiceCommandList'].forEach((v1) {
v1['DoctorList'].forEach((v) { v1['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v)); doctorsList.add(new DoctorList.fromJson(v));
arr.add(new DoctorList.fromJson(v).projectName); arr.add(new DoctorList.fromJson(v).projectName);
arrDistance.add(new DoctorList.fromJson(v) arrDistance.add(new DoctorList.fromJson(v).projectDistanceInKiloMeters.toString());
.projectDistanceInKiloMeters
.toString());
}); });
}); });
if (doctorsList.length == 1) { if (doctorsList.length == 1) {
getDoctorProfile( getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList);
projectId, clinicId, doctorId[0], context, doctorsList);
//speak(); //speak();
} else { } else {
@ -455,14 +431,11 @@ class _SearchBot extends State<BottomBarSearch> {
res['DoctorList'].forEach((v) { res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v)); doctorsList.add(new DoctorList.fromJson(v));
arr.add(new DoctorList.fromJson(v).projectName); arr.add(new DoctorList.fromJson(v).projectName);
arrDistance.add(new DoctorList.fromJson(v) arrDistance.add(new DoctorList.fromJson(v).projectDistanceInKiloMeters.toString());
.projectDistanceInKiloMeters
.toString());
}); });
if (doctorsList.length == 1) { if (doctorsList.length == 1) {
getDoctorProfile( getDoctorProfile(projectId, clinicId, doctorId[0], context, doctorsList);
projectId, clinicId, doctorId[0], context, doctorsList);
//speak(); //speak();
} else { } else {
@ -479,8 +452,7 @@ class _SearchBot extends State<BottomBarSearch> {
}); });
} }
Future navigateToDoctorProfile(context, docObject, docProfile, Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async {
{isAppo}) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -497,11 +469,7 @@ class _SearchBot extends State<BottomBarSearch> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: BranchView( page: BranchView(doctorsList: docList, result: result, num: numAll, resultDistance: arrDistance),
doctorsList: docList,
result: result,
num: numAll,
resultDistance: arrDistance),
), ),
); );
} }

@ -729,10 +729,11 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
} }
getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) { getDoctorProfile(projectId, clinicId, doctorId, context, doctorData) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
List<DoctorProfileList> docProfileList = []; List<DoctorProfileList> docProfileList = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsProfile(doctorId, clinicId, projectId, context).then((res) { service.getDoctorsProfile(doctorId, clinicId, projectId, languageID, context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) { if (res['DoctorProfileList'].length != 0) {
res['DoctorProfileList'].forEach((v) { res['DoctorProfileList'].forEach((v) {
@ -749,12 +750,13 @@ class _FloatingSearchButton extends State<FloatingSearchButton> with TickerProvi
} }
getDoctorsList(projectId, clinicId, context, {doctorId, doctorName, isNearest = false}) { getDoctorsList(projectId, clinicId, context, {doctorId, doctorName, isNearest = false}) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<String> arr = []; List<String> arr = [];
List<String> arrDistance = []; List<String> arrDistance = [];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getDoctorsList(clinicId, projectId, isNearest, context, doctorId: doctorId, doctorName: doctorName).then((res) { service.getDoctorsList(clinicId, projectId, isNearest, languageID, context, doctorId: doctorId, doctorName: doctorName).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -1,7 +1,7 @@
name: diplomaticquarterapp name: diplomaticquarterapp
description: A new Flutter application. description: A new Flutter application.
version: 4.5.035+4050035 version: 4.5.79+1
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.7.0 <3.0.0"

Loading…
Cancel
Save