Compare commits

..

7 Commits

@ -21,8 +21,8 @@ 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.50.100.198:2018/'; // var BASE_URL = 'http://10.50.100.198:2018/';
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 = 'http://10.201.204.103/'; // var BASE_URL = 'http://10.201.204.103/';
// 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/';
@ -354,7 +354,7 @@ var CAN_PAY_FOR_FOR_WALKIN_APPOINTMENT = 'Services/Doctors.svc/REST/CanPayForWal
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 50.0; var VERSION_ID = 18.7;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;

@ -2326,7 +2326,5 @@ const Map localizedValues = {
"liveCareTermsHeading16": {"en": "14. COMPLAINTS", "ar": "14. الشكاوى"}, "liveCareTermsHeading16": {"en": "14. COMPLAINTS", "ar": "14. الشكاوى"},
"liveCareTermsConditions47": {"en": "Our Telehealth Services will be for specific medical specialties or follow-up or medication refill appointments.", "ar": "خدمات الرعاية الصحية عن بُعد الخاصة بنا سوف تكون لتخصصات طبية محددة أو لمواعيد المتابعة أو إعادة صرف الدواء. "}, "liveCareTermsConditions47": {"en": "Our Telehealth Services will be for specific medical specialties or follow-up or medication refill appointments.", "ar": "خدمات الرعاية الصحية عن بُعد الخاصة بنا سوف تكون لتخصصات طبية محددة أو لمواعيد المتابعة أو إعادة صرف الدواء. "},
"liveCareTermsConditions48": {"en": "If you have any complaints or concerns about the Application and or the Website, Our Services, or how we handle your personal information please contact us on: EServices.HMG@drsulaimanalhabib.com or call 011 525 9553", "ar": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011"}, "liveCareTermsConditions48": {"en": "If you have any complaints or concerns about the Application and or the Website, Our Services, or how we handle your personal information please contact us on: EServices.HMG@drsulaimanalhabib.com or call 011 525 9553", "ar": "إذا كانت لديك أي شكاوى أو مخاوف بشأن التطبيق و/أو موقع الويب أو خدماتنا أو كيفية تعاملنا مع معلوماتك الشخصية، فيرجى التواصل معنا على: EServices.HMG@drsulaimanalhabib.com أو الاتصال على الرقم: 9553 525 011"},
"searchLabResult": {"en": "Search Lab Results", "ar": "نتائج البحث في المختبر"}, "clickPrivacyPolicy": {"en": "Please click here to view the privacy policy", "ar": "الرجاء الضغط هنا لعرض سياسة الخصوصية"},
"searchRadiology": {"en": "Search Radiology", "ar": "البحث في الأشعة"},
}; };

@ -1,4 +1,3 @@
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class PatientLabOrders { class PatientLabOrders {
@ -40,7 +39,6 @@ class PatientLabOrders {
bool? isLiveCareAppointment; bool? isLiveCareAppointment;
int? status; int? status;
String? statusDesc; String? statusDesc;
List<TestDetail>? testDetails;
PatientLabOrders( PatientLabOrders(
{this.actualDoctorRate, {this.actualDoctorRate,
this.clinicDescription, this.clinicDescription,
@ -79,9 +77,7 @@ class PatientLabOrders {
this.speciality, this.speciality,
this.isLiveCareAppointment, this.isLiveCareAppointment,
this.status, this.status,
this.statusDesc, this.statusDesc,});
this.testDetails
});
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
@ -121,12 +117,6 @@ class PatientLabOrders {
isLiveCareAppointment = json['IsLiveCareAppointment']; isLiveCareAppointment = json['IsLiveCareAppointment'];
status = json['Status']; status = json['Status'];
statusDesc = json['StatusDesc']; statusDesc = json['StatusDesc'];
if (json['TestDetails'] != null) {
testDetails = <TestDetail>[];
json['TestDetails'].forEach((v) {
testDetails!.add(new TestDetail.fromJson(v));
});
}
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
} }
@ -169,32 +159,6 @@ class PatientLabOrders {
data['invoiceNo_VP'] = this.invoiceNo_VP; data['invoiceNo_VP'] = this.invoiceNo_VP;
data['Status'] = this.status; data['Status'] = this.status;
data['StatusDesc'] = this.statusDesc; data['StatusDesc'] = this.statusDesc;
data['TestDetails'] = this.testDetails;
if (this.testDetails != null) {
data['TestDetails'] = this.testDetails!.map((v) => v.toJson()).toList();
}
return data;
}
}
class TestDetail {
String? description;
String? testCode;
String? testID;
TestDetail({this.description, this.testCode, this.testID});
TestDetail.fromJson(Map<String, dynamic> json) {
description = json['Description'];
testCode = json['TestCode'];
testID = json['TestID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Description'] = this.description;
data['TestCode'] = this.testCode;
data['TestID'] = this.testID;
return data; return data;
} }
} }

@ -28,6 +28,7 @@ class RequestSendPrescriptionEmail {
int? projectID; int? projectID;
List<PrescriptionReport>? listPrescriptions; List<PrescriptionReport>? listPrescriptions;
List<PrescriptionReportINP>? listPrescriptionsINP; List<PrescriptionReportINP>? listPrescriptionsINP;
bool? isDownload;
RequestSendPrescriptionEmail( RequestSendPrescriptionEmail(
{this.appointmentDate, {this.appointmentDate,
@ -53,7 +54,8 @@ class RequestSendPrescriptionEmail {
this.clinicName, this.clinicName,
this.doctorName, this.doctorName,
this.projectID, this.projectID,
this.doctorID}); this.doctorID,
this.isDownload});
RequestSendPrescriptionEmail.fromJson(Map<String, dynamic> json) { RequestSendPrescriptionEmail.fromJson(Map<String, dynamic> json) {
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
@ -114,6 +116,7 @@ class RequestSendPrescriptionEmail {
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['IsDownload'] = this.isDownload;
return data; return data;
} }
} }

@ -44,7 +44,8 @@ class FinalRadiology {
bool? isCVI; bool? isCVI;
bool? isRadMedicalReport; bool? isRadMedicalReport;
bool? isLiveCareAppointment; bool? isLiveCareAppointment;
String? description; String? exam_Id;
FinalRadiology( FinalRadiology(
{this.setupID, {this.setupID,
this.projectID, this.projectID,
@ -89,8 +90,7 @@ class FinalRadiology {
this.isCVI, this.isCVI,
this.isRadMedicalReport, this.isRadMedicalReport,
this.isLiveCareAppointment, this.isLiveCareAppointment,
this.description this.exam_Id});
});
FinalRadiology.fromJson(Map<String, dynamic> json) { FinalRadiology.fromJson(Map<String, dynamic> json) {
try { try {
@ -137,7 +137,7 @@ class FinalRadiology {
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
isCVI = json['isCVI']; isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport']; isRadMedicalReport = json['isRadMedicalReport'];
description = json['Description']; exam_Id = json['Exam_id'];
} catch (e) { } catch (e) {
print(e); print(e);
} }
@ -187,7 +187,6 @@ class FinalRadiology {
data['Speciality'] = this.speciality; data['Speciality'] = this.speciality;
data['isCVI'] = this.isCVI; data['isCVI'] = this.isCVI;
data['isRadMedicalReport'] = this.isRadMedicalReport; data['isRadMedicalReport'] = this.isRadMedicalReport;
data['Description'] =this.description;
return data; return data;
} }
} }

@ -28,6 +28,7 @@ class RequestSendRadReportEmail {
String? tokenID; String? tokenID;
double? versionID; double? versionID;
int? invoiceLineItemNo; int? invoiceLineItemNo;
bool? isDownload;
RequestSendRadReportEmail( RequestSendRadReportEmail(
{this.channel, {this.channel,
@ -57,7 +58,7 @@ class RequestSendRadReportEmail {
this.setupID, this.setupID,
this.to, this.to,
this.tokenID, this.tokenID,
this.versionID}); this.versionID, this.isDownload});
RequestSendRadReportEmail.fromJson(Map<String, dynamic> json) { RequestSendRadReportEmail.fromJson(Map<String, dynamic> json) {
channel = json['Channel']; channel = json['Channel'];
@ -122,6 +123,7 @@ class RequestSendRadReportEmail {
data['TokenID'] = this.tokenID; data['TokenID'] = this.tokenID;
data['VersionID'] = this.versionID; data['VersionID'] = this.versionID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['IsDownload'] = this.isDownload;
return data; return data;
} }
} }

@ -187,7 +187,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; //0560717232 // body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 814121; //4609100 // body['PatientID'] = 5690832; //4609100
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -196,10 +196,10 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
if (url == 'https://webservices.hmg.com/Services/Patients.svc/REST/GetPatientLabOrders' || url=='https://webservices.hmg.com/Services/Patients.svc/REST/GetPatientRadOrders') { // if (url == 'https://uat.hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo') {
// url = "https://hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo"; // url = "https://hmgwebservices.com/Services/NHIC.svc/REST/GetPatientInfo";
body['VersionID'] = 50.0; // body['TokenID'] = "@dm!n";
} // }
// if (AppGlobal.isNetworkDebugEnabled) { // if (AppGlobal.isNetworkDebugEnabled) {
debugPrint("URL : $url"); debugPrint("URL : $url");

@ -5,11 +5,12 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PatientSickLeaveService extends BaseService { class PatientSickLeaveService extends BaseService {
List<SickLeave> sickLeaveList = []; List<SickLeave> sickLeaveList = [];
String sickLeavePDF = "";
getSickLeave() async { getSickLeave() async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
await baseAppClient.post(GET_PATIENT_SICK_LEAVE_STATUS, await baseAppClient.post(GET_PATIENT_SICK_LEAVE_STATUS, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
sickLeaveList.clear(); sickLeaveList.clear();
if (response['List_SickLeave'] != null && response['List_SickLeave'].length != 0) { if (response['List_SickLeave'] != null && response['List_SickLeave'].length != 0) {
response['List_SickLeave'].forEach((sickLeave) { response['List_SickLeave'].forEach((sickLeave) {
@ -22,12 +23,7 @@ class PatientSickLeaveService extends BaseService {
}, body: Map()); }, body: Map());
} }
sendSickLeaveEmail( sendSickLeaveEmail({required int requestNo, required String projectName, required String doctorName, required int projectID, required String setupID, required bool isDownload}) async {
{required int requestNo,
required String projectName,
required String doctorName,
required int projectID,
required String setupID}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -41,9 +37,12 @@ class PatientSickLeaveService extends BaseService {
body['DoctorName'] = doctorName; body['DoctorName'] = doctorName;
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
body['SetupID'] = setupID; body['SetupID'] = setupID;
await baseAppClient body['IsDownload'] = isDownload;
.post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {}, await baseAppClient.post(SendSickLeaveEmail, onSuccess: (response, statusCode) async {
onFailure: (String error, int statusCode) { if(isDownload) {
sickLeavePDF = response['Base64Data'];
}
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);

@ -55,7 +55,7 @@ class MedicalService extends BaseService {
getSchedule(DoctorList doctorRequest) async { getSchedule(DoctorList doctorRequest) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {'DoctorID': doctorRequest.doctorID, 'ProjectID': doctorRequest.projectID, 'ClinicID': doctorRequest.clinicID, 'DoctorWorkingHoursDays': 7}; request = {'DoctorID': doctorRequest.doctorID, 'ProjectID': doctorRequest.projectID, 'ClinicID': doctorRequest.clinicID, 'DoctorWorkingHoursDays': 90};
dynamic localRes; dynamic localRes;
await baseAppClient.post(DOCTOR_SCHEDULE_URL, onSuccess: (response, statusCode) async { await baseAppClient.post(DOCTOR_SCHEDULE_URL, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -68,7 +68,7 @@ class MedicalService extends BaseService {
getFreeSlot(DoctorList doctorRequest) async { getFreeSlot(DoctorList doctorRequest) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = {'DoctorID': doctorRequest.doctorID, 'ProjectID': doctorRequest.projectID, 'ClinicID': doctorRequest.clinicID, 'DoctorWorkingHoursDays': 7}; request = {'DoctorID': doctorRequest.doctorID, 'ProjectID': doctorRequest.projectID, 'ClinicID': doctorRequest.clinicID, 'DoctorWorkingHoursDays': 90};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_DOCTOR_FREE_SLOTS, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;

@ -22,6 +22,8 @@ class PrescriptionsService extends BaseService {
List<PrescriptionInfoRCModel> prescriptionsOrderListRC = []; List<PrescriptionInfoRCModel> prescriptionsOrderListRC = [];
var isMedDeliveryAllowed; var isMedDeliveryAllowed;
String prescriptionReportPDF = "";
Future getPrescriptions() async { Future getPrescriptions() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -121,7 +123,7 @@ class PrescriptionsService extends BaseService {
isDentalAllowedBackend: false, isDentalAllowedBackend: false,
); );
Future sendPrescriptionEmail(String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID, bool isInOutPatient) async { Future sendPrescriptionEmail(String appointmentDate, int patientID, String clinicName, String doctorName, int doctorID, int projectID, bool isInOutPatient, bool isDownload) async {
_requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList; _requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList;
_requestSendPrescriptionEmail.listPrescriptionsINP = prescriptionReportListINP; _requestSendPrescriptionEmail.listPrescriptionsINP = prescriptionReportListINP;
_requestSendPrescriptionEmail.appointmentDate = appointmentDate; _requestSendPrescriptionEmail.appointmentDate = appointmentDate;
@ -137,8 +139,13 @@ class PrescriptionsService extends BaseService {
_requestSendPrescriptionEmail.patientName = user.firstName! + " " + user.lastName!; _requestSendPrescriptionEmail.patientName = user.firstName! + " " + user.lastName!;
_requestSendPrescriptionEmail.setupID = user.setupID; _requestSendPrescriptionEmail.setupID = user.setupID;
_requestSendPrescriptionEmail.to = user.emailAddress; _requestSendPrescriptionEmail.to = user.emailAddress;
_requestSendPrescriptionEmail.isDownload = isDownload;
hasError = false; hasError = false;
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {
if (isDownload) {
prescriptionReportPDF = response["Base64Data"];
}
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestSendPrescriptionEmail.toJson()); }, body: _requestSendPrescriptionEmail.toJson());

@ -10,7 +10,9 @@ class RadiologyService extends BaseService {
bool isRadiologyVIDAPlus = false; bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int? invoiceNo, String? invoiceType, int? lineItem, int? projectId, bool? isVidaPlus}) async { String radReportPDF = "";
Future getRadImageURL({int? invoiceNo, String? invoiceType, int? lineItem, int? projectId, bool? isVidaPlus, String? examId}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = isVidaPlus! ? "0" : invoiceNo; body['InvoiceNo'] = isVidaPlus! ? "0" : invoiceNo;
@ -18,6 +20,7 @@ class RadiologyService extends BaseService {
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
body['InvoiceType'] = invoiceType; body['InvoiceType'] = invoiceType;
body['ExamId'] = examId;
await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_RAD_IMAGE_URL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
url = response['Data']; url = response['Data'];
@ -64,7 +67,7 @@ class RadiologyService extends BaseService {
RequestSendRadReportEmail _requestSendRadReportEmail = RequestSendRadReportEmail(); RequestSendRadReportEmail _requestSendRadReportEmail = RequestSendRadReportEmail();
Future sendRadReportEmail({FinalRadiology? finalRadiology, AuthenticatedUser? userObj}) async { Future sendRadReportEmail({FinalRadiology? finalRadiology, AuthenticatedUser? userObj, required bool isDownload}) async {
_requestSendRadReportEmail.projectID = finalRadiology!.projectID; _requestSendRadReportEmail.projectID = finalRadiology!.projectID;
_requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription;
_requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo;
@ -81,9 +84,14 @@ class RadiologyService extends BaseService {
_requestSendRadReportEmail.to = userObj.emailAddress; _requestSendRadReportEmail.to = userObj.emailAddress;
_requestSendRadReportEmail.dateofBirth = userObj.dateofBirth; _requestSendRadReportEmail.dateofBirth = userObj.dateofBirth;
_requestSendRadReportEmail.invoiceType = finalRadiology.invoiceType; _requestSendRadReportEmail.invoiceType = finalRadiology.invoiceType;
_requestSendRadReportEmail.isDownload = isDownload;
hasError = false; hasError = false;
await baseAppClient.post(SEND_RAD_REPORT_EMAIL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(SEND_RAD_REPORT_EMAIL, isAllowAny: true, onSuccess: (dynamic response, int statusCode) {
if(isDownload) {
radReportPDF = response["Base64Data"];
}
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestSendRadReportEmail.toJson()); }, body: _requestSendRadReportEmail.toJson());

@ -33,10 +33,6 @@ class LabsViewModel extends BaseViewModel {
List<PatientLabOrdersList> get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital; List<PatientLabOrdersList> get patientLabOrdersList => filterType == FilterType.Clinic ? _patientLabOrdersListClinic : _patientLabOrdersListHospital;
List<PatientLabOrders> tempPatientLabOrdersList = [];
List<String> autoCompleteList = [];
bool _showSuggestions = false;
bool get showSuggestions => _showSuggestions;
void getLabs() async { void getLabs() async {
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -45,22 +41,6 @@ class LabsViewModel extends BaseViewModel {
error = _labsService.error!; error = _labsService.error!;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
tempPatientLabOrdersList = List.from(_labsService.patientLabOrdersList);
tempPatientLabOrdersList.forEach((item1){
item1.testDetails!.forEach((item2){
if (!autoCompleteList.contains(item2.description)) {
autoCompleteList.add(item2.description!);
}
});
});
runFilerTest();
}
}
}
runFilerTest() {
_labsService.patientLabOrdersList.forEach((element) { _labsService.patientLabOrdersList.forEach((element) {
List<PatientLabOrdersList> patientLabOrdersClinic = _patientLabOrdersListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList(); List<PatientLabOrdersList> patientLabOrdersClinic = _patientLabOrdersListClinic.where((elementClinic) => elementClinic.filterName == element.clinicDescription).toList();
@ -86,6 +66,8 @@ class LabsViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
}
}
setFilterType(FilterType filterType) { setFilterType(FilterType filterType) {
this.filterType = filterType; this.filterType = filterType;
@ -195,43 +177,4 @@ class LabsViewModel extends BaseViewModel {
await file.writeAsBytes(bytes); await file.writeAsBytes(bytes);
return file.path; return file.path;
} }
searchLab(String searchParam, {bool isAutocomplete = false}) {
_showSuggestions = isAutocomplete;
if (searchParam.isEmpty) {
_showSuggestions =false;
_labsService.patientLabOrdersList = List.from(tempPatientLabOrdersList);
_patientLabOrdersListClinic.clear();
_patientLabOrdersListHospital.clear();
runFilerTest();
notifyListeners();
return;
}
if (isAutocomplete) {
notifyListeners();
return;
}
filterList(searchParam);
}
List<String> getFilteredSuggestions(String query) {
if (query.isEmpty) return [];
return autoCompleteList.where((suggestion) =>
suggestion.toLowerCase().contains(query.toLowerCase())
).toList();
}
filterList(String searchParam){
final lowerCaseQuery = searchParam.toLowerCase();
_labsService.patientLabOrdersList = tempPatientLabOrdersList.where((item) {
if (item.testDetails != null && item.testDetails!.isNotEmpty) {
return item.testDetails!.any((test) {
return test.description?.toLowerCase().contains(lowerCaseQuery) ?? false;
});
}
return false;
}).toList();
_patientLabOrdersListClinic.clear();
_patientLabOrdersListHospital.clear();
runFilerTest();
notifyListeners();
}
} }

@ -5,11 +5,19 @@ import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:open_filex/open_filex.dart';
import 'package:path_provider/path_provider.dart';
class PatientSickLeaveViewMode extends BaseViewModel { class PatientSickLeaveViewMode extends BaseViewModel {
PatientSickLeaveService _patientSickLeaveService = locator<PatientSickLeaveService>(); PatientSickLeaveService _patientSickLeaveService = locator<PatientSickLeaveService>();
List<SickLeave> get sickLeaveList => _patientSickLeaveService.sickLeaveList; List<SickLeave> get sickLeaveList => _patientSickLeaveService.sickLeaveList;
String get sickLeavePDF => _patientSickLeaveService.sickLeavePDF;
getSickLeave() async { getSickLeave() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _patientSickLeaveService.getSickLeave(); await _patientSickLeaveService.getSickLeave();
@ -21,16 +29,36 @@ class PatientSickLeaveViewMode extends BaseViewModel {
} }
} }
Future sendSickLeaveEmail({required String message, required int requestNo, required String projectName, required String doctorName, required int projectID, required String setupID}) async { Future sendSickLeaveEmail(
{required String message, required int requestNo, required String projectName, required String doctorName, required int projectID, required String setupID, required bool isDownload}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _patientSickLeaveService.sendSickLeaveEmail(requestNo: requestNo, projectName: projectName, doctorName: doctorName, projectID: projectID, setupID: setupID); await _patientSickLeaveService.sendSickLeaveEmail(requestNo: requestNo, projectName: projectName, doctorName: doctorName, projectID: projectID, setupID: setupID, isDownload: isDownload);
if (_patientSickLeaveService.hasError) { if (_patientSickLeaveService.hasError) {
error = _patientSickLeaveService.error!; error = _patientSickLeaveService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
} else {
if (isDownload) {
if (sickLeavePDF.isNotEmpty) {
String path = await _createFileFromString(sickLeavePDF, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
AppToast.showErrorToast(message: "Cannot open file.");
}
}
} else { } else {
AppToast.showSuccessToast(message: message); AppToast.showSuccessToast(message: message);
}
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future<String> _createFileFromString(String encodedStr, String ext) async {
Uint8List bytes = base64.decode(encodedStr);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
await file.writeAsBytes(bytes);
return file.path;
}
} }

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:open_filex/open_filex.dart';
import '../../../core/enum/filter_type.dart'; import '../../../core/enum/filter_type.dart';
import '../../../core/enum/viewstate.dart'; import '../../../core/enum/viewstate.dart';
@ -15,6 +16,11 @@ import '../../../core/service/medical/prescriptions_service.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:path_provider/path_provider.dart';
class PrescriptionsViewModel extends BaseViewModel { class PrescriptionsViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
PrescriptionsService _prescriptionsService = locator<PrescriptionsService>(); PrescriptionsService _prescriptionsService = locator<PrescriptionsService>();
@ -24,8 +30,6 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PrescriptionReport> get prescriptionReportList => _prescriptionsService.prescriptionReportList; List<PrescriptionReport> get prescriptionReportList => _prescriptionsService.prescriptionReportList;
List<PrescriptionReportINP> get prescriptionReportListINP => _prescriptionsService.prescriptionReportListINP; List<PrescriptionReportINP> get prescriptionReportListINP => _prescriptionsService.prescriptionReportListINP;
List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionsService.prescriptionsList;
@ -45,6 +49,9 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
get isMedDeliveryAllowed => _prescriptionsService.isMedDeliveryAllowed; get isMedDeliveryAllowed => _prescriptionsService.isMedDeliveryAllowed;
String get prescriptionReportPDF => _prescriptionsService.prescriptionReportPDF;
getPrescriptions() async { getPrescriptions() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptions(); await _prescriptionsService.getPrescriptions();
@ -114,15 +121,36 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
sendPrescriptionEmail({required String appointmentDate, required int patientID, required String clinicName, required String doctorName, required int doctorID, required String mes, required int projectID, required bool isInOutPatient}) async { sendPrescriptionEmail(
{required String appointmentDate,
required int patientID,
required String clinicName,
required String doctorName,
required int doctorID,
required String mes,
required int projectID,
required bool isInOutPatient,
required bool isDownload}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _prescriptionsService.sendPrescriptionEmail(appointmentDate, patientID, clinicName, doctorName, doctorID, projectID, isInOutPatient); await _prescriptionsService.sendPrescriptionEmail(appointmentDate, patientID, clinicName, doctorName, doctorID, projectID, isInOutPatient, isDownload);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error!; error = _prescriptionsService.error!;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
} else {
if (isDownload) {
if (prescriptionReportPDF.isNotEmpty) {
String path = await _createFileFromString(prescriptionReportPDF, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
AppToast.showErrorToast(message: "Cannot open file.");
}
}
} else { } else {
AppToast.showSuccessToast(message: mes); AppToast.showSuccessToast(message: mes);
}
// AppToast.showSuccessToast(message: mes);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
@ -160,6 +188,14 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
Future<String> _createFileFromString(String encodedStr, String ext) async {
Uint8List bytes = base64.decode(encodedStr);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
await file.writeAsBytes(bytes);
return file.path;
}
Future updatePressOrder({required int presOrderID}) async { Future updatePressOrder({required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
// await _prescriptionsService.updatePressOrder(presOrderID: presOrderID); // await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);

@ -9,6 +9,12 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import '../../../locator.dart'; import '../../../locator.dart';
import '../base_view_model.dart'; import '../base_view_model.dart';
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:open_filex/open_filex.dart';
import 'package:path_provider/path_provider.dart';
class RadiologyViewModel extends BaseViewModel { class RadiologyViewModel extends BaseViewModel {
FilterType filterType = FilterType.Clinic; FilterType filterType = FilterType.Clinic;
RadiologyService _radiologyService = locator<RadiologyService>(); RadiologyService _radiologyService = locator<RadiologyService>();
@ -19,11 +25,11 @@ class RadiologyViewModel extends BaseViewModel {
List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital; List<FinalRadiologyList> get finalRadiologyList => filterType == FilterType.Clinic ? _finalRadiologyListClinic : _finalRadiologyListHospital;
bool _isRadiologyVIDAPlus = false; bool _isRadiologyVIDAPlus = false;
bool _showSuggestions = false;
bool get showSuggestions => _showSuggestions;
bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus; bool get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
List<FinalRadiology> tempFinalRadiologyList =[];
List<String> autoCompleteList =[]; String get radReportPDF => _radiologyService.radReportPDF;
void getPatientRadOrders() async { void getPatientRadOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(); await _radiologyService.getPatientRadOrders();
@ -33,17 +39,6 @@ class RadiologyViewModel extends BaseViewModel {
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
//Clinic Sorting //Clinic Sorting
filterRadiology();
tempFinalRadiologyList = List.from(_radiologyService.finalRadiologyList);
// tempFinalRadiologyList.forEach((item) {
// if(!autoCompleteList.contains(item.description!)) {
// autoCompleteList.add(item.description!);
// }});
setState(ViewState.Idle);
}
}
filterRadiology(){
var clinicMap = groupBy(_radiologyService.finalRadiologyList, (FinalRadiology obj) => obj.clinicDescription); var clinicMap = groupBy(_radiologyService.finalRadiologyList, (FinalRadiology obj) => obj.clinicDescription);
clinicMap.forEach((key, value) { clinicMap.forEach((key, value) {
_finalRadiologyListClinic.add(FinalRadiologyList(filterName: key, finalRadiologyList: value.toList())); _finalRadiologyListClinic.add(FinalRadiologyList(filterName: key, finalRadiologyList: value.toList()));
@ -54,12 +49,16 @@ class RadiologyViewModel extends BaseViewModel {
hospitalMap.forEach((key, value) { hospitalMap.forEach((key, value) {
_finalRadiologyListHospital.add(FinalRadiologyList(filterName: key, finalRadiologyList: value.toList())); _finalRadiologyListHospital.add(FinalRadiologyList(filterName: key, finalRadiologyList: value.toList()));
}); });
setState(ViewState.Idle);
} }
}
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({required int invoiceNo, String? invoiceType, required int lineItem, required int projectId, required bool isVidaPlus}) async { getRadImageURL({required int invoiceNo, String? invoiceType, required int lineItem, required int projectId, required bool isVidaPlus, required String examId}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, invoiceType: invoiceType, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, invoiceType: invoiceType, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus, examId: examId);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error!; error = _radiologyService.error!;
setState(ViewState.Error); setState(ViewState.Error);
@ -67,53 +66,40 @@ class RadiologyViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
sendRadReportEmail({required FinalRadiology finalRadiology, required String mes, required AuthenticatedUser userObj}) async { sendRadReportEmail({required FinalRadiology finalRadiology, required String mes, required AuthenticatedUser userObj, required isDownload}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _radiologyService.sendRadReportEmail(finalRadiology: finalRadiology, userObj: userObj); await _radiologyService.sendRadReportEmail(finalRadiology: finalRadiology, userObj: userObj, isDownload: isDownload);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error!; error = _radiologyService.error!;
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
} else { } else {
AppToast.showSuccessToast(message: mes); if (isDownload) {
if (radReportPDF.isNotEmpty) {
String path = await _createFileFromString(radReportPDF, "pdf");
try {
OpenFilex.open(path);
} catch (ex) {
AppToast.showErrorToast(message: "Cannot open file.");
} }
setState(ViewState.Idle);
} }
} else {
setFilterType(FilterType filterType) { AppToast.showSuccessToast(message: mes);
this.filterType = filterType;
notifyListeners();
} }
// AppToast.showSuccessToast(message: mes);
searchRadiology(String searchParam, {bool isAutocomplete = false}){
_showSuggestions = isAutocomplete;
if (searchParam.isEmpty) {
_finalRadiologyListClinic.clear();
_finalRadiologyListClinic.clear();
_radiologyService.finalRadiologyList = List.from(tempFinalRadiologyList);
filterRadiology();
notifyListeners();
return;
} }
if (isAutocomplete) { setState(ViewState.Idle);
notifyListeners();
return;
} }
final lowerCaseQuery = searchParam.toLowerCase();
_finalRadiologyListClinic.clear();
_finalRadiologyListClinic.clear();
_radiologyService.finalRadiologyList = tempFinalRadiologyList.where((item) {
return item.description?.toLowerCase().contains(lowerCaseQuery) ?? false;
}).toList();
filterRadiology();
Future<String> _createFileFromString(String encodedStr, String ext) async {
Uint8List bytes = base64.decode(encodedStr);
String dir = (await getApplicationDocumentsDirectory()).path;
File file = File("$dir/" + DateTime.now().millisecondsSinceEpoch.toString() + "." + ext);
await file.writeAsBytes(bytes);
return file.path;
}
setFilterType(FilterType filterType) {
this.filterType = filterType;
notifyListeners(); notifyListeners();
} }
List<String> getFilteredSuggestions(String query) {
if (query.isEmpty) return [];
return autoCompleteList.where((suggestion) =>
suggestion.toLowerCase().contains(query.toLowerCase())
).toList();
}
} }

@ -51,10 +51,10 @@ class _SearchByHospitalState extends State<SearchByHospital> {
@override @override
void initState() { void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
locationUtils.getCurrentLocation();
getProjectsList(); getProjectsList();
}); });
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
} }
@override @override
@ -293,15 +293,12 @@ class _SearchByHospitalState extends State<SearchByHospital> {
projectsListLocal.add(new HospitalsModel.fromJson(v)); projectsListLocal.add(new HospitalsModel.fromJson(v));
}); });
projectsList = projectsListLocal; projectsList = projectsListLocal;
hospitalList = await DoctorMapper.getMappedHospitals(projectsList, hospitalList = await DoctorMapper.getMappedHospitals(projectsList, isArabic: context.read<ProjectViewModel>().isArabic);
isArabic: context.read<ProjectViewModel>().isArabic);
var lat = await sharedPref.getDouble(USER_LAT); var lat = await sharedPref.getDouble(USER_LAT);
var lng = await sharedPref.getDouble(USER_LONG); var lng = await sharedPref.getDouble(USER_LONG);
var isLocationEnabled = var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
(lat != null && lat != 0.0) && (lng != null && lng != 0.0); hospitalList = await DoctorMapper.sortList(isLocationEnabled, hospitalList!);
hospitalList =
await DoctorMapper.sortList(isLocationEnabled, hospitalList!);
setState(() {}); setState(() {});
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} else {} } else {}
@ -428,14 +425,7 @@ class _SearchByHospitalState extends State<SearchByHospital> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getDoctorsList( .getDoctorsList(clinicID, selectedHospital?.mainProjectID.toString() != "" ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") : 0, nearestAppo, languageID, null)
clinicID,
selectedHospital?.mainProjectID.toString() != ""
? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1")
: 0,
nearestAppo,
languageID,
null)
.then((res) async { .then((res) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -448,15 +438,12 @@ class _SearchByHospitalState extends State<SearchByHospital> {
)); ));
}); });
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, isArabic: isArabic);
isArabic: isArabic);
var lat = await sharedPref.getDouble(USER_LAT); var lat = await sharedPref.getDouble(USER_LAT);
var lng = await sharedPref.getDouble(USER_LONG); var lng = await sharedPref.getDouble(USER_LONG);
var isLocationEnabled = (lat != null && lat != 0.0) && var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
(lng != null && lng != 0.0); regionHospitalList = await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
regionHospitalList =
await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
setState(() {}); setState(() {});
} else { } else {

@ -25,10 +25,9 @@ import '../../../uitl/gif_loader_dialog_utils.dart';
class ResultByClinic extends StatefulWidget { class ResultByClinic extends StatefulWidget {
HospitalsModel? selectedValue; HospitalsModel? selectedValue;
Function(RegionList) onClinicSelected; Function(RegionList, int?) onClinicSelected;
ResultByClinic( ResultByClinic({super.key, this.selectedValue, required this.onClinicSelected});
{super.key, this.selectedValue, required this.onClinicSelected});
@override @override
State<ResultByClinic> createState() => _ResultByClinicState(); State<ResultByClinic> createState() => _ResultByClinicState();
@ -40,8 +39,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback( WidgetsBinding.instance.addPostFrameCallback((_) => getClinicWrtHospital(widget.selectedValue));
(_) => getClinicWrtHospital(widget.selectedValue));
} }
@override @override
@ -63,8 +61,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
child: Material( child: Material(
color: CustomColors.white, color: CustomColors.white,
child: Padding( child: Padding(
padding: padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
@ -73,10 +70,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
children: [ children: [
Text( Text(
clinicIds?[index].clinicDescription ?? '', clinicIds?[index].clinicDescription ?? '',
style: TextStyle( style: TextStyle(fontSize: 22, color: Colors.black, fontWeight: FontWeight.w700),
fontSize: 22,
color: Colors.black,
fontWeight: FontWeight.w700),
), ),
], ],
), ),
@ -102,16 +96,10 @@ class _ResultByClinicState extends State<ResultByClinic> {
); );
} }
getDoctorsList( getDoctorsList(BuildContext context, String? dropdownValue, String? dropdownTitle, HospitalsModel? selectedHospital, ListClinicCentralized? selectedClinic) {
BuildContext context,
String? dropdownValue,
String? dropdownTitle,
HospitalsModel? selectedHospital,
ListClinicCentralized? selectedClinic) {
SearchInfo searchInfo = new SearchInfo(); SearchInfo searchInfo = new SearchInfo();
if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") { if (dropdownValue != null) if (dropdownValue!.split("-")[0] == "17") {
searchInfo.ProjectID = searchInfo.ProjectID = int.parse(selectedHospital?.mainProjectID.toString() ?? "");
int.parse(selectedHospital?.mainProjectID.toString() ?? "");
searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]); searchInfo.ClinicID = int.parse(dropdownValue!.split("-")[0]);
searchInfo.hospital = selectedHospital; searchInfo.hospital = selectedHospital;
searchInfo.clinic = selectedClinic; searchInfo.clinic = selectedClinic;
@ -136,10 +124,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: LiveCareBookAppointment( page: LiveCareBookAppointment(clinicName: dropdownTitle, liveCareClinicID: dropdownValue!.split("-")[2], liveCareServiceID: dropdownValue!.split("-")[3]),
clinicName: dropdownTitle,
liveCareClinicID: dropdownValue!.split("-")[2],
liveCareServiceID: dropdownValue!.split("-")[3]),
), ),
).then((value) { ).then((value) {
print("navigation return "); print("navigation return ");
@ -169,8 +154,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
).then((value) {}); ).then((value) {});
} }
Future navigateToDentalComplaints( Future navigateToDentalComplaints(BuildContext context, SearchInfo searchInfo) async {
BuildContext context, SearchInfo searchInfo) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -181,7 +165,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
), ),
).then((value) { ).then((value) {
if (value is RegionList) { if (value is RegionList) {
widget.onClinicSelected(value); widget.onClinicSelected(value,null);
} }
}); });
} }
@ -195,20 +179,11 @@ class _ResultByClinicState extends State<ResultByClinic> {
List<String> arrDistance = []; List<String> arrDistance = [];
List<String> result; List<String> result;
int numAll; int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
[];
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.getDoctorsList( .getDoctorsList(clinicID, widget.selectedValue?.mainProjectID.toString() != "" ? int.parse(widget.selectedValue?.mainProjectID.toString() ?? "-1") : 0, false, languageID, null)
clinicID,
widget.selectedValue?.mainProjectID.toString() != ""
? int.parse(
widget.selectedValue?.mainProjectID.toString() ?? "-1")
: 0,
false,
languageID,
null)
.then((res) async { .then((res) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -221,16 +196,13 @@ class _ResultByClinicState extends State<ResultByClinic> {
)); ));
}); });
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, isArabic: isArabic);
isArabic: isArabic);
var lat = await sharedPref.getDouble(USER_LAT); var lat = await sharedPref.getDouble(USER_LAT);
var lng = await sharedPref.getDouble(USER_LONG); var lng = await sharedPref.getDouble(USER_LONG);
var isLocationEnabled = var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
(lat != null && lat != 0.0) && (lng != null && lng != 0.0); regionHospitalList = await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
regionHospitalList = await DoctorMapper.sortList( widget.onClinicSelected(regionHospitalList, clinicID);
isLocationEnabled, regionHospitalList);
widget.onClinicSelected(regionHospitalList);
setState(() {}); setState(() {});
} else { } else {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -258,8 +230,7 @@ class _ResultByClinicState extends State<ResultByClinic> {
clinicIds = List.empty(); clinicIds = List.empty();
List<ListClinicCentralized> clinicId = []; List<ListClinicCentralized> clinicId = [];
try { try {
Map res = await service.getClinicByHospital( Map res = await service.getClinicByHospital(projectID: newValue?.mainProjectID.toString() ?? "");
projectID: newValue?.mainProjectID.toString() ?? "");
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
List list = res['ListClinic']; List list = res['ListClinic'];

@ -1,7 +1,11 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.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/OBGyneProcedureListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -13,15 +17,22 @@ class ResultByDoctor extends StatefulWidget {
final bool isObGyneAppointment; final bool isObGyneAppointment;
final bool isDoctorNameSearch; final bool isDoctorNameSearch;
final bool isDoctorSearchResult; final bool isDoctorSearchResult;
final bool showNearestAppointment;
final bool nearestAppointmentDoctors;
final OBGyneProcedureListResponse? obGyneProcedureListResponse; final OBGyneProcedureListResponse? obGyneProcedureListResponse;
ResultByDoctor( final Function(bool)? refreshDoctorList;
{required this.doctorsList,
ResultByDoctor({
required this.doctorsList,
required this.patientDoctorAppointmentListHospital, required this.patientDoctorAppointmentListHospital,
required this.isLiveCareAppointment, required this.isLiveCareAppointment,
required this.isObGyneAppointment, required this.isObGyneAppointment,
required this.isDoctorNameSearch, required this.isDoctorNameSearch,
required this.isDoctorSearchResult, required this.isDoctorSearchResult,
this.showNearestAppointment = false,
this.nearestAppointmentDoctors = false,
this.obGyneProcedureListResponse, this.obGyneProcedureListResponse,
this.refreshDoctorList
}); });
@override @override
@ -29,12 +40,53 @@ class ResultByDoctor extends StatefulWidget {
} }
class _ResultByDoctorState extends State<ResultByDoctor> { class _ResultByDoctorState extends State<ResultByDoctor> {
bool nearestAppo = false;
@override
void initState() {
nearestAppo = widget.nearestAppointmentDoctors;
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return Column(
child: widget.patientDoctorAppointmentListHospital?.isNotEmpty == true children: [
? Padding(
padding: const EdgeInsets.all(12.0), Visibility(
visible: widget.showNearestAppointment,
child: Padding(
padding: const EdgeInsets.only(left: 6, right: 6,),
child: Row(
children: <Widget>[
Checkbox(
activeColor: CustomColors.accentColor,
value: nearestAppo,
onChanged: (bool? value) {
setState(() {
nearestAppo = value ?? false;
});
widget.refreshDoctorList?.call(nearestAppo);
},
),
AutoSizeText(
TranslationBase.of(context).nearestAppo.trim(),
maxLines: 1,
minFontSize: 10,
style: TextStyle(
fontSize: SizeConfig.textMultiplier! * 1.4,
fontWeight: FontWeight.w600,
letterSpacing: -0.39,
height: 0.8,
),
),
// Text(TranslationBase.of(context).nearestAppo, style: TextStyle(fontSize: 14.0, letterSpacing: -0.56)),
],
),
),
),
widget.patientDoctorAppointmentListHospital?.isNotEmpty == true
? Expanded(
child: ListView.separated( child: ListView.separated(
addAutomaticKeepAlives: true, addAutomaticKeepAlives: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -47,31 +99,27 @@ class _ResultByDoctorState extends State<ResultByDoctor> {
); );
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
final doctor = final doctor = widget.patientDoctorAppointmentListHospital![index];
widget.patientDoctorAppointmentListHospital![index];
return DoctorView( return Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
child: DoctorView(
doctor: doctor, doctor: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment, isLiveCareAppointment: widget.isLiveCareAppointment,
isObGyneAppointment: widget.isObGyneAppointment, isObGyneAppointment: widget.isObGyneAppointment,
isDoctorNameSearch: widget.isDoctorNameSearch, isDoctorNameSearch: widget.isDoctorNameSearch,
obGyneProcedureListResponse: obGyneProcedureListResponse: widget.obGyneProcedureListResponse,
widget.obGyneProcedureListResponse,
isShowDate: false, isShowDate: false,
onTap: () { onTap: () {
context context.read<ProjectViewModel>().analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
.read<ProjectViewModel>() }),
.analytics );
.appointment
.book_appointment_select_doctor(
appointment_type: 'regular', doctor: doctor);
});
}, },
itemCount: itemCount: widget.patientDoctorAppointmentListHospital?.length ?? 0,
widget.patientDoctorAppointmentListHospital?.length ?? 0,
), ),
) )
: getNoDataWidget(context), : getNoDataWidget(context),
],
); );
} }

@ -9,7 +9,11 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultB
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByHospital.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/search_result/ResultByRegion.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/doctor_response_mapper.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
@ -17,6 +21,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart';
import '../../../core/service/client/base_app_client.dart';
class SearchResultWithTabForHospital extends StatefulWidget { class SearchResultWithTabForHospital extends StatefulWidget {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
RegionList patientDoctorAppointmentListHospital; RegionList patientDoctorAppointmentListHospital;
@ -54,6 +61,8 @@ class _SearchResultWithTabForHospitalState
int selectedHospitalIndex = -1; int selectedHospitalIndex = -1;
ScrollController scrollController = ScrollController(); ScrollController scrollController = ScrollController();
RegionList? doctorList; RegionList? doctorList;
bool nearestAppointment= false;
int clinicId = -1;
@override @override
void initState() { void initState() {
@ -135,6 +144,8 @@ class _SearchResultWithTabForHospitalState
doctorList = null; doctorList = null;
_currentIndex = 0; _currentIndex = 0;
changePageViewIndex(0); changePageViewIndex(0);
nearestAppointment = false;
clinicId = -1;
}); });
}, },
), ),
@ -159,6 +170,9 @@ class _SearchResultWithTabForHospitalState
doctorList = null; doctorList = null;
_currentIndex = 1; _currentIndex = 1;
changePageViewIndex(1); changePageViewIndex(1);
nearestAppointment = false;
clinicId = -1;
}); });
}, },
), ),
@ -183,6 +197,9 @@ class _SearchResultWithTabForHospitalState
doctorList = null; doctorList = null;
_currentIndex = 2; _currentIndex = 2;
changePageViewIndex(2); changePageViewIndex(2);
nearestAppointment = false;
clinicId = -1;
}); });
}, },
), ),
@ -203,9 +220,12 @@ class _SearchResultWithTabForHospitalState
: CustomColors.grey2, : CustomColors.grey2,
onTap: () { onTap: () {
setState(() { setState(() {
_currentIndex = 3;
doctorList = null; doctorList = null;
changePageViewIndex(3); changePageViewIndex(3);
_currentIndex = 3;
nearestAppointment= false;
clinicId = -1;
}); });
}, },
), ),
@ -350,11 +370,14 @@ class _SearchResultWithTabForHospitalState
selectedRegion != '' && selectedRegion != '' &&
selectedHospitalIndex != -1) selectedHospitalIndex != -1)
? ResultByClinic( ? ResultByClinic(
onClinicSelected: (doctorList) { onClinicSelected: (doctorList, clinicId) {
setState(() { setState(() {
this.nearestAppointment = false;
this.doctorList = doctorList; this.doctorList = doctorList;
_currentIndex = 4; _currentIndex = 4;
changePageViewIndex(4); changePageViewIndex(4);
if(clinicId != null)
this.clinicId = clinicId;
}); });
}, },
selectedValue: selectedHospital) selectedValue: selectedHospital)
@ -384,7 +407,19 @@ class _SearchResultWithTabForHospitalState
widget.isLiveCareAppointment, widget.isLiveCareAppointment,
isDoctorSearchResult: widget.isDoctorSearchResult, isDoctorSearchResult: widget.isDoctorSearchResult,
isObGyneAppointment: widget.isObGyneAppointment, isObGyneAppointment: widget.isObGyneAppointment,
isDoctorNameSearch: widget.isDoctorNameSearch) isDoctorNameSearch: widget.isDoctorNameSearch,
showNearestAppointment: clinicId != -1 ,
nearestAppointmentDoctors: nearestAppointment,
refreshDoctorList: (isNearestAppointmentChecked){
setState(() {
// changePageViewIndex(3);
// _currentIndex = 3;
nearestAppointment= false;
});
callDoctorsSearchAPI(clinicId, isNearestAppointmentChecked);
},
)
: SizedBox.shrink(), : SizedBox.shrink(),
], ],
), ),
@ -395,6 +430,62 @@ class _SearchResultWithTabForHospitalState
); );
} }
callDoctorsSearchAPI(int clinicID, bool nearestAppointment) {
var isArabic = context.read<ProjectViewModel>().isArabic;
int languageID = isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context);
List<DoctorList> doctorsList = [];
List<String> arr = [];
List<String> arrDistance = [];
List<String> result;
int numAll;
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
DoctorsListService service = new DoctorsListService();
service
.getDoctorsList(clinicID, selectedHospital?.mainProjectID.toString() != "" ? int.parse(selectedHospital?.mainProjectID.toString() ?? "-1") : 0, nearestAppointment, languageID, null)
.then((res) async {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
RegionList regionHospitalList = RegionList();
if (res['DoctorList'].length != 0) {
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(
v,
));
});
regionHospitalList = await DoctorMapper.getMappedDoctor(doctorsList, isArabic: isArabic);
var lat = await sharedPref.getDouble(USER_LAT);
var lng = await sharedPref.getDouble(USER_LONG);
var isLocationEnabled = (lat != null && lat != 0.0) && (lng != null && lng != 0.0);
regionHospitalList = await DoctorMapper.sortList(isLocationEnabled, regionHospitalList);
setState(() {
this.doctorList = regionHospitalList;
_currentIndex = 4;
changePageViewIndex(4);
this.nearestAppointment = nearestAppointment;
});
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorSearchMsg']);
}
GifLoaderDialogUtils.hideDialog(context);
// navigateToSearchResults(context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err, localContext: context);
});
}
String getTitle() { String getTitle() {
switch (_currentIndex) { switch (_currentIndex) {
case 0: case 0:

@ -154,7 +154,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
onTap: (index) { onTap: (index) {
setState(() { setState(() {
if (index == 1) { if (index == 1) {
if (widget.appo.clinicID == 17 || if (
// widget.appo.clinicID == 17 ||
widget.appo.clinicID == 47 || widget.appo.clinicID == 47 ||
widget.appo.clinicID == 23 || widget.appo.clinicID == 23 ||
widget.appo.clinicID == 253 || widget.appo.clinicID == 253 ||
@ -173,7 +174,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
}, },
tabs: [ tabs: [
Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))), Tab(child: Text(TranslationBase.of(context).appoActions, style: TextStyle(color: Colors.black))),
widget.appo.clinicID == 17 || // widget.appo.clinicID == 17 ||
widget.appo.clinicID == 23 || widget.appo.clinicID == 23 ||
widget.appo.clinicID == 47 || widget.appo.clinicID == 47 ||
widget.appo.clinicID == 265 || widget.appo.clinicID == 265 ||

@ -8,8 +8,10 @@ import 'package:diplomaticquarterapp/core/viewModels/feedback/feedback_view_mode
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart'; import 'package:diplomaticquarterapp/models/Appointments/appoDetailsButtons.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/DentalComplaints.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/ArrivedButtons.dart';
@ -83,8 +85,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
// bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule"); // bool shouldEnable = ((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") || appoButtonsList[index].caller == "openReschedule");
bool shouldEnable = bool shouldEnable = (((widget.appo.clinicID == 47 || widget.appo.clinicID == 134 || widget.appo.clinicID == 253) && appoButtonsList[index].caller == "openReschedule") ||
(((widget.appo.clinicID == 17 || widget.appo.clinicID == 47 || widget.appo.clinicID == 134 || widget.appo.clinicID == 253) && appoButtonsList[index].caller == "openReschedule") ||
(widget.appo.isLiveCareAppointment! && appoButtonsList[index].caller == "askDoc") || (widget.appo.isLiveCareAppointment! && appoButtonsList[index].caller == "askDoc") ||
(Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) && (Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) &&
widget.appo.clinicID == 10 && widget.appo.clinicID == 10 &&

@ -96,7 +96,7 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
child: Button( child: Button(
label: 'Send Copy', label: 'Send Copy',
onTap: () { onTap: () {
sendPrescriptionReportEmail(); sendPrescriptionReportEmail(true);
}, },
), ),
), ),
@ -112,10 +112,10 @@ class _PrescriptionReportState extends State<PrescriptionReportPage> {
); );
} }
sendPrescriptionReportEmail() { sendPrescriptionReportEmail(bool isDownload) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.sendPrescriptionEmail(widget.appo.appointmentDate!, widget.appo.setupID!, projectViewModel!.isArabic ? 1 : 2, widget.listPres, context).then((res) { service.sendPrescriptionEmail(widget.appo.appointmentDate!, widget.appo.setupID!, projectViewModel!.isArabic ? 1 : 2, widget.listPres, isDownload, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail'); AppToast.showSuccessToast(message: 'A copy has been sent to the e-mail');
}).catchError((err) { }).catchError((err) {

@ -15,6 +15,7 @@ import 'package:flutter_zoom_videosdk/native/zoom_videosdk_event_listener.dart';
import 'package:flutter_zoom_videosdk/native/zoom_videosdk_live_transcription_message_info.dart'; import 'package:flutter_zoom_videosdk/native/zoom_videosdk_live_transcription_message_info.dart';
import 'package:flutter_zoom_videosdk/native/zoom_videosdk_user.dart'; import 'package:flutter_zoom_videosdk/native/zoom_videosdk_user.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:wakelock_plus/wakelock_plus.dart';
// import '../components/video_view.dart'; // import '../components/video_view.dart';
// import '../components/comment_list.dart'; // import '../components/comment_list.dart';
@ -76,6 +77,7 @@ class _CallScreenState extends State<CallScreen> {
useEffect(() { useEffect(() {
Future<void>.microtask(() async { Future<void>.microtask(() async {
WakelockPlus.enable();
var token = generateJwt(args.sessionName, args.role); var token = generateJwt(args.sessionName, args.role);
try { try {
Map<String, bool> SDKaudioOptions = {"connect": true, "mute": false, "autoAdjustSpeakerVolume": false}; Map<String, bool> SDKaudioOptions = {"connect": true, "mute": false, "autoAdjustSpeakerVolume": false};
@ -170,6 +172,7 @@ class _CallScreenState extends State<CallScreen> {
fullScreenUser.value = null; fullScreenUser.value = null;
await zoom.leaveSession(false); await zoom.leaveSession(false);
Navigator.pop(context); Navigator.pop(context);
WakelockPlus.disable();
}); });
final sessionNeedPasswordListener = emitter.on(EventType.onSessionNeedPassword, (data) async { final sessionNeedPasswordListener = emitter.on(EventType.onSessionNeedPassword, (data) async {
@ -472,8 +475,7 @@ class _CallScreenState extends State<CallScreen> {
], ],
), ),
); );
if (errorType == Errors.SessionJoinFailed || if (errorType == Errors.SessionJoinFailed || errorType == Errors.SessionDisconnecting) {
errorType == Errors.SessionDisconnecting) {
Timer( Timer(
const Duration(milliseconds: 1000), const Duration(milliseconds: 1000),
() => Navigator.pop(context), () => Navigator.pop(context),
@ -1157,6 +1159,7 @@ class _CallScreenState extends State<CallScreen> {
} }
void onLeaveSession(bool isEndSession) async { void onLeaveSession(bool isEndSession) async {
WakelockPlus.disable();
await zoom.leaveSession(isEndSession); await zoom.leaveSession(isEndSession);
Navigator.pop(context); Navigator.pop(context);
// Navigator.pop(context); // Navigator.pop(context);

@ -99,7 +99,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
late ToDoCountProviderModel toDoProvider; late ToDoCountProviderModel toDoProvider;
var dob; var dob;
late int isHijri; int isHijri = 0;
var healthId; var healthId;
@override @override

@ -44,7 +44,7 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
final authService = AuthProvider(); final authService = AuthProvider();
late final WebViewController _controller; late final WebViewController _controller;
bool isPageLoaded = true; bool isPageLoaded = false;
bool isTermsAndConditionsPage = true; bool isTermsAndConditionsPage = true;
bool acceptTerms = false; bool acceptTerms = false;
@ -76,7 +76,7 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
}, },
), ),
) )
..loadRequest(Uri.parse(widget.isArabic ? "https://hmg.com/ar/Pages/Privacy.aspx" : "https://hmg.com/en/Pages/Privacy.aspx")); ..loadRequest(Uri.parse(widget.isArabic ? "https://hmg.com/ar/Pages/MBTerms.aspx" : "https://hmg.com/en/Pages/MBTerms.aspx"));
} }
@override @override
@ -90,9 +90,12 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
showNewAppBar: true, showNewAppBar: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: TranslationBase.of(context).userAgreement, appBarTitle: TranslationBase.of(context).userAgreement,
body: isTermsAndConditionsPage body:
? getTermsAndConditionsContent() // isTermsAndConditionsPage
: isPageLoaded // ?
// getTermsAndConditionsContent(),
// :
isPageLoaded
? WebViewWidget(controller: _controller) ? WebViewWidget(controller: _controller)
: Container( : Container(
child: Center( child: Center(
@ -139,6 +142,24 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
letterSpacing: -0.64, letterSpacing: -0.64,
), ),
), ),
mHeight(24.0),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Checkbox(
value: acceptTerms,
onChanged: (v) {
setState(() => acceptTerms = v!);
}),
Expanded(
child: Text(
TranslationBase.of(context).termsConditionsRead,
style: TextStyle(
fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
),
),
],
),
SizedBox(height: 12), SizedBox(height: 12),
Row( Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
@ -155,17 +176,18 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
elevation: 0, elevation: 0,
onPressed: isPageLoaded onPressed: isPageLoaded
? () { ? () {
if (isTermsAndConditionsPage) { // if (isTermsAndConditionsPage) {
if (acceptTerms) { if (acceptTerms) {
setState(() { addUsageAgreement();
isTermsAndConditionsPage = false; // setState(() {
}); // isTermsAndConditionsPage = false;
// });
} else { } else {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
} }
} else { // } else {
addUsageAgreement(); // addUsageAgreement();
} // }
} }
: null, : null,
child: Text(TranslationBase.of(context).acceptLbl.toUpperCase(), child: Text(TranslationBase.of(context).acceptLbl.toUpperCase(),
@ -238,6 +260,24 @@ class _UserLoginAgreementPageState extends State<UserLoginAgreementPage> {
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),
), ),
mHeight(12.0), mHeight(12.0),
// InkWell(
// onTap: () async {
// await launchUrl(uri);
// Uri.parse(widget.isArabic ? "https://hmg.com/ar/Pages/Privacy.aspx" : "https://hmg.com/en/Pages/Privacy.aspx");
// },
// child: Text(
// TranslationBase.of(context).clickPrivacyPolicy,
// style: TextStyle(
// fontSize: 16,
// fontWeight: FontWeight.bold,
// fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
// color: Colors.blue,
// letterSpacing: -1.44,
// height: 35 / 24,
// decoration: TextDecoration.underline),
// ),
// ),
mHeight(12.0),
Text( Text(
TranslationBase.of(context).termsConditions4, TranslationBase.of(context).termsConditions4,
style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), style: TextStyle(fontSize: 16, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24),

@ -6,7 +6,6 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/input/input_widget.dart';
import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -17,33 +16,15 @@ import 'package:provider/provider.dart';
import 'laboratory_result_page.dart'; import 'laboratory_result_page.dart';
class LabsHomePage extends StatefulWidget { class LabsHomePage extends StatelessWidget {
LabsHomePage();
@override
_LabsHomePageState createState() => _LabsHomePageState();
}
class _LabsHomePageState extends State<LabsHomePage> {
List<ImagesInfo> imagesInfo = []; List<ImagesInfo> imagesInfo = [];
TextEditingController searchController = new TextEditingController();
List<PatientLabOrders> tempList = [];
List<PatientLabOrdersList> originalList = [];
@override
void initState() {
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png')); imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png'));
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) { onModelReady: (model) => model.getLabs(),
model.getLabs();
originalList = model.patientLabOrdersList;
},
builder: (context, LabsViewModel model, widget) => AppScaffold( builder: (context, LabsViewModel model, widget) => AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
@ -65,25 +46,6 @@ class _LabsHomePageState extends State<LabsHomePage> {
}), }),
], ],
), ),
Container(
padding: EdgeInsets.only(bottom: 5, top: 14, left: 21, right: 21),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
inputWidget(TranslationBase.of(context).searchLabResult, '', searchController,
suffix: IconButton(
onPressed: () {
if (searchController.text.isNotEmpty) {
searchController.clear();
model.searchLab('');
}
},
icon: Icon(
searchController.text.isNotEmpty ? Icons.close : Icons.search,
size: 28,
)), onChanged: (String? searchParam) {
model.searchLab(searchParam!, isAutocomplete: true);
})
])),
if (model.showSuggestions) _buildSuggestionsList(model),
Expanded( Expanded(
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 1.0, widthFactor: 1.0,
@ -100,18 +62,8 @@ class _LabsHomePageState extends State<LabsHomePage> {
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
return AppExpandableNotifier( return AppExpandableNotifier(
isExpand: true,
title: model.patientLabOrdersList[index].filterName, title: model.patientLabOrdersList[index].filterName,
bodyWidget: bodyWidget: ListView.separated(
// Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
//
// padding: EdgeInsets.only(left:21, right: 21),
// child: Text(model.patientLabOrdersList[index].filterName!, style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold), )),
ListView.separated(
shrinkWrap: true, shrinkWrap: true,
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21), padding: EdgeInsets.only(bottom: 14, top: 14, left: 21, right: 21),
@ -142,7 +94,8 @@ class _LabsHomePageState extends State<LabsHomePage> {
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: model.patientLabOrdersList[index].patientLabOrdersList.length)); itemCount: model.patientLabOrdersList[index].patientLabOrdersList.length),
);
}, },
itemCount: model.patientLabOrdersList.length), itemCount: model.patientLabOrdersList.length),
), ),
@ -152,46 +105,4 @@ class _LabsHomePageState extends State<LabsHomePage> {
), ),
); );
} }
Widget _buildSuggestionsList(LabsViewModel model) {
final suggestions = model.getFilteredSuggestions(searchController.text);
return ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.4,
),
child: Container(
padding: EdgeInsets.only(bottom: 5, top: 0, left: 21, right: 21),
child: Material(
elevation: 4,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
child: ListView.builder(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
itemCount: suggestions.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
searchController.text = suggestions[index];
model.searchLab(suggestions[index]);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
border: Border(
bottom: index < suggestions.length - 1 ? BorderSide(color: Colors.grey.shade200) : BorderSide.none,
),
),
child: Text(suggestions[index]),
),
);
},
),
)),
);
}
} }

@ -37,7 +37,6 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientSickLeaveViewMode>( return BaseView<PatientSickLeaveViewMode>(
onModelReady: (model) => model.getSickLeave(), onModelReady: (model) => model.getSickLeave(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
@ -50,7 +49,8 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
backgroundColor: Color(0xffF7F7F7), backgroundColor: Color(0xffF7F7F7),
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
baseViewModel: model, baseViewModel: model,
body: model.sickLeaveList.isNotEmpty ? ListView.separated( body: model.sickLeaveList.isNotEmpty
? ListView.separated(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
itemCount: model.sickLeaveList.length, itemCount: model.sickLeaveList.length,
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
@ -70,7 +70,8 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
showConfirmMessage(model, index); showConfirmMessage(model, index);
}, },
), ),
) : getNoDataWidget(context), )
: getNoDataWidget(context),
), ),
); );
} }
@ -79,7 +80,15 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
if (model.sickLeaveList[index].status == 1) { if (model.sickLeaveList[index].status == 1) {
openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo!, model.sickLeaveList[index]!.setupID!, model, index, model.sickLeaveList[index]!.projectID!); openWorkPlaceUpdatePage(model.sickLeaveList[index].requestNo!, model.sickLeaveList[index]!.setupID!, model, index, model.sickLeaveList[index]!.projectID!);
} else if (model.sickLeaveList[index].status == 2) { } else if (model.sickLeaveList[index].status == 2) {
showEmailDialog(model, index); // showEmailDialog(model, index);
model.sendSickLeaveEmail(
message: TranslationBase.of(context).emailSentSuccessfully,
requestNo: model.sickLeaveList[index].requestNo!,
doctorName: model.sickLeaveList[index].doctorName!,
projectName: model.sickLeaveList[index].projectName!,
setupID: model.sickLeaveList[index].setupID!,
projectID: model.sickLeaveList[index].projectID!,
isDownload: true);
} else { } else {
showApprovalDialog(); showApprovalDialog();
} }
@ -110,7 +119,8 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
doctorName: model.sickLeaveList[index].doctorName!, doctorName: model.sickLeaveList[index].doctorName!,
projectName: model.sickLeaveList[index].projectName!, projectName: model.sickLeaveList[index].projectName!,
setupID: model.sickLeaveList[index].setupID!, setupID: model.sickLeaveList[index].setupID!,
projectID: model.sickLeaveList[index].projectID!); projectID: model.sickLeaveList[index].projectID!,
isDownload: true);
model.getSickLeave(); model.getSickLeave();
}, },
), ),
@ -169,7 +179,15 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
print(value); print(value);
if (value != null && value == true) { if (value != null && value == true) {
model.getSickLeave(); model.getSickLeave();
showEmailDialog(model, index); // showEmailDialog(model, index);
model.sendSickLeaveEmail(
message: TranslationBase.of(context).emailSentSuccessfully,
requestNo: model.sickLeaveList[index].requestNo!,
doctorName: model.sickLeaveList[index].doctorName!,
projectName: model.sickLeaveList[index].projectName!,
setupID: model.sickLeaveList[index].setupID!,
projectID: model.sickLeaveList[index].projectID!,
isDownload: true);
} }
}, },
); );

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_de
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; 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/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -74,9 +75,24 @@ class PrescriptionItemsPage extends StatelessWidget {
projectViewModel.user.emailAddress!, projectViewModel.user.emailAddress!,
), ),
isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false, isNeedToShowButton: (model.prescriptionReportListINP.length > 0 || model.prescriptionReportEnhList.length > 0) ? projectViewModel.havePrivilege(13) : false,
buttonTitle: TranslationBase.of(context).download,
buttonIcon: "assets/images/new/download_1.svg",
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
onTap: () { isDownload: true,
showConfirmMessage(context, model); onTap: () async {
// showConfirmMessage(context, model);
GifLoaderDialogUtils.showMyDialog(context);
await model.sendPrescriptionEmail(
appointmentDate: prescriptions.appointmentDate!,
patientID: prescriptions.patientID!,
clinicName: prescriptions.companyName!,
doctorName: prescriptions.doctorName!,
doctorID: prescriptions.doctorID!,
mes: TranslationBase.of(context).sendSuc,
projectID: prescriptions.projectID!,
isInOutPatient: prescriptions.isInOutPatient!,
isDownload: true);
GifLoaderDialogUtils.hideDialog(context);
}, },
), ),
if (!prescriptions.isInOutPatient!) if (!prescriptions.isInOutPatient!)
@ -436,9 +452,8 @@ class PrescriptionItemsPage extends StatelessWidget {
doctorID: prescriptions.doctorID!, doctorID: prescriptions.doctorID!,
mes: TranslationBase.of(context).sendSuc, mes: TranslationBase.of(context).sendSuc,
projectID: prescriptions.projectID!, projectID: prescriptions.projectID!,
isInOutPatient: prescriptions.isInOutPatient! isInOutPatient: prescriptions.isInOutPatient!,
isDownload: true);
);
}, },
), ),
); );

@ -5,6 +5,7 @@ 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/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
@ -32,8 +33,8 @@ class RadiologyDetailsPage extends StatelessWidget {
invoiceType: finalRadiology!.invoiceType, invoiceType: finalRadiology!.invoiceType,
lineItem: finalRadiology!.invoiceLineItemNo!, lineItem: finalRadiology!.invoiceLineItemNo!,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP : finalRadiology!.invoiceNo, invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!) ? finalRadiology!.invoiceNo_VP : finalRadiology!.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!)), isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology!.projectID!),
examId: finalRadiology!.exam_Id!),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).report, appBarTitle: TranslationBase.of(context).report,
isShowAppBar: true, isShowAppBar: true,
@ -62,12 +63,18 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology!.noOfPatientsRate, finalRadiology!.noOfPatientsRate,
projectViewModel.user.emailAddress!, projectViewModel.user.emailAddress!,
), ),
onTap: () { onTap: () async {
showConfirmMessage(finalRadiology: finalRadiology!, model: model, userObj: projectViewModel.user!); GifLoaderDialogUtils.showMyDialog(context);
await model.sendRadReportEmail(mes: TranslationBase.of(AppGlobal.context).sendSuc, finalRadiology: finalRadiology!, userObj: projectViewModel.user, isDownload: true);
GifLoaderDialogUtils.hideDialog(context);
// showConfirmMessage(finalRadiology: finalRadiology!, model: model, userObj: projectViewModel.user!, isDownload: true);
}, },
buttonTitle: TranslationBase.of(context).sendCopyRad, buttonTitle: TranslationBase.of(context).download,
isNeedToShowButton: projectViewModel.havePrivilege(8), buttonIcon: "assets/images/new/download_1.svg",
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
isDownload: true,
isNeedToShowButton: projectViewModel.havePrivilege(8),
// showConfirmMessageDialog: false,
), ),
Container( Container(
margin: EdgeInsets.all(24), margin: EdgeInsets.all(24),
@ -117,13 +124,13 @@ class RadiologyDetailsPage extends StatelessWidget {
); );
} }
void showConfirmMessage({FinalRadiology? finalRadiology, RadiologyViewModel? model, AuthenticatedUser? userObj}) { void showConfirmMessage({FinalRadiology? finalRadiology, RadiologyViewModel? model, AuthenticatedUser? userObj, required bool isDownload}) {
showDialog( showDialog(
context: AppGlobal.context, context: AppGlobal.context,
builder: (cxt) => ConfirmSendEmailDialog( builder: (cxt) => ConfirmSendEmailDialog(
email: model!.user!.emailAddress, email: model!.user!.emailAddress,
onTapSendEmail: () { onTapSendEmail: () {
model.sendRadReportEmail(mes: TranslationBase.of(AppGlobal.context).sendSuc, finalRadiology: finalRadiology!, userObj: userObj!); model.sendRadReportEmail(mes: TranslationBase.of(AppGlobal.context).sendSuc, finalRadiology: finalRadiology!, userObj: userObj!, isDownload: isDownload);
}, },
), ),
); );

@ -8,33 +8,16 @@ import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_p
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.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/input/input_widget.dart';
import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart'; import 'package:diplomaticquarterapp/widgets/new_design/my_tab_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
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/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class RadiologyHomePage extends StatefulWidget { class RadiologyHomePage extends StatelessWidget {
RadiologyHomePage();
@override
_RadiologyHomePageState createState() => _RadiologyHomePageState();
}
bool isExpand = false;
class _RadiologyHomePageState extends State<RadiologyHomePage> {
List<ImagesInfo> imagesInfo =[]; List<ImagesInfo> imagesInfo =[];
TextEditingController searchController = new TextEditingController();
@override
void initState() {
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -66,30 +49,6 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
}), }),
], ],
), ),
Container(
padding: EdgeInsets.only(bottom: 5, top: 14, left: 21, right: 21),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
inputWidget(TranslationBase.of(context).searchRadiology, '', searchController,
suffix: IconButton(
onPressed: () {
if (searchController.text.isNotEmpty) {
searchController.clear();
model.searchRadiology('');
}
},
icon: Icon(
searchController.text.isNotEmpty ? Icons.close : Icons.search,
size: 28,
)), onChanged: (String? searchParam) {
// if (searchParam!.length > 2) {
model.searchRadiology(searchParam!, isAutocomplete: true);
// setState(() {});
// } else {
// model.searchRadiology(searchParam!, isAutocomplete: false);
// }
}, onTap: () {})
])),
if (model.showSuggestions) _buildSuggestionsList(model),
Expanded( Expanded(
child: FractionallySizedBox( child: FractionallySizedBox(
@ -106,14 +65,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
); );
}, },
itemBuilder: (context, index) { itemBuilder: (context, index) {
// return Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// padding: EdgeInsets.only(left:21, right: 21),
// child: Text(model.finalRadiologyList[index].filterName!, style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold), )),
return AppExpandableNotifier( return AppExpandableNotifier(
isExpand: true,
title: model.finalRadiologyList[index].filterName, title: model.finalRadiologyList[index].filterName,
bodyWidget: ListView.separated( bodyWidget: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
@ -145,8 +97,8 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: model.finalRadiologyList[index].finalRadiologyList!.length)); itemCount: model.finalRadiologyList[index].finalRadiologyList!.length),
//); );
}, },
itemCount: model.finalRadiologyList.length), itemCount: model.finalRadiologyList.length),
), ),
@ -187,43 +139,4 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
), ),
); );
} }
Widget _buildSuggestionsList(RadiologyViewModel model) {
final suggestions = model.getFilteredSuggestions(searchController.text);
return ConstrainedBox(
constraints: BoxConstraints(
maxHeight: MediaQuery.of(context).size.height * 0.4,
),
child: Material(
elevation: 4,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
child: ListView.builder(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
itemCount: suggestions.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
searchController.text = suggestions[index];
model.searchRadiology(suggestions[index]);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 12),
decoration: BoxDecoration(
border: Border(
bottom: index < suggestions.length - 1 ? BorderSide(color: Colors.grey.shade200) : BorderSide.none,
),
),
child: Text(suggestions[index]),
),
);
},
),
),
);
}
} }

@ -1392,7 +1392,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendPrescriptionEmail(String appoDate, String setupId, int languageID, dynamic prescriptionReportEnhList, BuildContext context) async { Future<Map> sendPrescriptionEmail(String appoDate, String setupId, int languageID, dynamic prescriptionReportEnhList, bool isDownload, 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));
@ -1420,7 +1420,9 @@ class DoctorsListService extends BaseService {
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": authUser.patientType, "LanguageID": authUser.patientType,
"PatientType": authUser.patientType "PatientType": authUser.patientType,
"IsDownload": isDownload,
}; };
dynamic localRes; dynamic localRes;

@ -168,7 +168,7 @@ class PayfortService extends BaseService {
/// Step 4: Processing Payment [Don't multiply with 100] /// Step 4: Processing Payment [Don't multiply with 100]
/// Amount value send always round ex. [100] not [100.00, 100.21] /// Amount value send always round ex. [100] not [100.00, 100.21]
FortRequest request = FortRequest( FortRequest request = FortRequest(
// command: FortCommand.purchase, command: FortCommand.purchase,
amount: orderAmount!, amount: orderAmount!,
customerName: customerName!, customerName: customerName!,
customerEmail: customerEmail!, customerEmail: customerEmail!,
@ -178,7 +178,7 @@ class PayfortService extends BaseService {
merchantReference: merchantReference!, merchantReference: merchantReference!,
currency: currency, currency: currency,
customerIp: (await _info.getWifiIP() ?? ''), customerIp: (await _info.getWifiIP() ?? ''),
language: 'en', command: FortCommand.purchase); language: 'en');
_payfort.callPayFortForApplePay( _payfort.callPayFortForApplePay(
request: request, request: request,

@ -79,7 +79,11 @@ class _SplashScreenState extends State<SplashScreen> {
projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel); projectProvider.setVidaPlusProjectList(_privilegeService.vidaPlusProjectListModel);
projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel); projectProvider.setHMCProjectList(_privilegeService.hMCProjectListModel);
projectProvider.setProjectsDetailList(_privilegeService.projectDetailListModel); projectProvider.setProjectsDetailList(_privilegeService.projectDetailListModel);
double lat = await AppSharedPreferences().getDouble(USER_LAT) ?? 0.0;
double long = await AppSharedPreferences().getDouble(USER_LONG) ?? 0.0;
AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch AppSharedPreferences().clear(); // Clearing Shared Preferences On App Launch
await AppSharedPreferences().setDouble(USER_LAT, lat);
await AppSharedPreferences().setDouble(USER_LONG, long);
AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en"); AppSharedPreferences().setString(APP_LANGUAGE, projectProvider.isArabic ? "ar" : "en");
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false); var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));

@ -3473,9 +3473,7 @@ class TranslationBase {
String get liveCareTermsHeading16 => localizedValues["liveCareTermsHeading16"][locale.languageCode]; String get liveCareTermsHeading16 => localizedValues["liveCareTermsHeading16"][locale.languageCode];
String get liveCareTermsConditions47 => localizedValues["liveCareTermsConditions47"][locale.languageCode]; String get liveCareTermsConditions47 => localizedValues["liveCareTermsConditions47"][locale.languageCode];
String get liveCareTermsConditions48 => localizedValues["liveCareTermsConditions48"][locale.languageCode]; String get liveCareTermsConditions48 => localizedValues["liveCareTermsConditions48"][locale.languageCode];
String get searchLabResult => localizedValues["searchLabResult"][locale.languageCode]; String get clickPrivacyPolicy => localizedValues["clickPrivacyPolicy"][locale.languageCode];
String get searchRadiology => localizedValues["searchRadiology"][locale.languageCode];
} }

@ -257,10 +257,21 @@ class DoctorCard extends StatelessWidget {
child: (onEmailTap != null && projectViewModel!.havePrivilege(17)) child: (onEmailTap != null && projectViewModel!.havePrivilege(17))
? InkWell( ? InkWell(
onTap: onEmailTap, onTap: onEmailTap,
child: Icon( child: Text(
Icons.email, TranslationBase.of(context).download,
color: sickLeaveStatus != 3 ? Theme.of(context).primaryColor : Colors.grey[400], style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
fontStyle: FontStyle.italic,
color: CustomColors.accentColor,
letterSpacing: -0.48,
height: 18 / 12,
decoration: TextDecoration.underline),
), ),
// Icon(
// Icons.email,
// color: sickLeaveStatus != 3 ? Theme.of(context).primaryColor : Colors.grey[400],
// ),
) )
: onTap != null : onTap != null
? Icon( ? Icon(

@ -343,7 +343,7 @@ class MyInAppBrowser extends InAppBrowser {
form = form.replaceFirst('PROJECT_ID_VALUE', projId); form = form.replaceFirst('PROJECT_ID_VALUE', projId);
form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod); form = form.replaceFirst('PAYMENT_OPTION_VALUE', paymentMethod);
form = form.replaceFirst('LANG_VALUE', currentLanguageID); form = form.replaceFirst('LANG_VALUE', currentLanguageID);
form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamara/Home/Checkout"); form = form.replaceFirst('SERVICE_URL_VALUE', "https://mdlaboratories.com/tamaralive/Home/Checkout");
form = form.replaceFirst('INSTALLMENTS_VALUE', installments); form = form.replaceFirst('INSTALLMENTS_VALUE', installments);
form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo!); form = form.replaceFirst('CUSTNATIONALID_VALUE', authUser.patientIdentificationNo!);

@ -1,89 +0,0 @@
import 'package:flutter/material.dart';
Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String? prefix, bool isEnable = true, bool hasSelection = false, Widget? suffix, void Function(String)? onChanged,GestureTapCallback? onTap }) {
return Container(
padding: EdgeInsets.only(left: 10, right: 10, bottom: 5, top: 5),
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15),
color: Colors.white,
border: Border.all(
color: Color(0xffefefef),
width: 1,
),
),
child: InkWell(
onTap: hasSelection ? () {} : null,
child: Row(
children: [
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_labelText,
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
),
TextField(
enabled: isEnable,
onChanged: onChanged,
scrollPadding: EdgeInsets.zero,
onTap: onTap,
controller: _controller,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff2B353E),
letterSpacing: -0.44,
),
decoration: InputDecoration(
isDense: true,
hintText: _hintText,
hintStyle: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w400,
color: Color(0xff575757),
letterSpacing: -0.56,
),
prefixIconConstraints: BoxConstraints(minWidth: 50),
prefixIcon: prefix == null
? null
: Text(
"+" + prefix,
style: TextStyle(
fontSize: 14,
height: 21 / 14,
fontWeight: FontWeight.w500,
color: Color(0xff2E303A),
letterSpacing: -0.56,
),
),
contentPadding: EdgeInsets.zero,
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
),
),
],
),
),
suffix ?? SizedBox()
],
),
),
);
}

@ -1,7 +1,7 @@
name: diplomaticquarterapp name: diplomaticquarterapp
description: A new Flutter application. description: A new Flutter application.
version: 4.6.092+4050092 version: 4.6.014+1
environment: environment:
sdk: ">=3.0.0 <3.13.0" sdk: ">=3.0.0 <3.13.0"

Loading…
Cancel
Save