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

# Conflicts:
#	lib/config/config.dart
#	lib/pages/DrawerPages/family/my-family.dart
#	lib/uitl/push-notification-handler.dart
merge-update-with-lab-changes
Sultan khan 2 years ago
commit 98a2545a9b

@ -32,6 +32,7 @@ target 'Runner' do
use_modular_headers! use_modular_headers!
pod 'OpenTok', '~> 2.22.0' pod 'OpenTok', '~> 2.22.0'
pod 'VTO2Lib'
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end end
@ -53,9 +54,34 @@ post_install do |installer|
] ]
build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386'
build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
xcconfig_path = build_configuration.base_configuration_reference.real_path
xcconfig = File.read(xcconfig_path)
xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle' if build_configuration.build_settings['WRAPPER_EXTENSION'] == 'bundle'
build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF' build_configuration.build_settings['DEVELOPMENT_TEAM'] = '3A359E86ZF'
end end
end end
end end
end
post_integrate do |installer|
compiler_flags_key = 'COMPILER_FLAGS'
project_path = 'Pods/Pods.xcodeproj'
project = Xcodeproj::Project.open(project_path)
project.targets.each do |target|
target.build_phases.each do |build_phase|
if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase)
build_phase.files.each do |file|
if !file.settings.nil? && file.settings.key?(compiler_flags_key)
compiler_flags = file.settings[compiler_flags_key]
file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '')
end
end
end
end
end
project.save()
end end

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 51; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -322,6 +322,7 @@
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
@ -392,6 +393,7 @@
}; };
9740EEB61CF901F6004384FC /* Run Script */ = { 9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
@ -538,7 +540,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.63; MARKETING_VERSION = 4.5.75;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -682,7 +684,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.63; MARKETING_VERSION = 4.5.75;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -720,7 +722,7 @@
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/Flutter", "$(PROJECT_DIR)/Flutter",
); );
MARKETING_VERSION = 4.5.63; MARKETING_VERSION = 4.5.75;
PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

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

@ -20,10 +20,18 @@ 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:4422/'; // var BASE_URL = 'http://10.50.100.198:4422/';
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.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/';
// var BASE_URL = 'https://webservices.hmg.com/';
// var BASE_URL = 'http://10.50.100.198:4422/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
// var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
@ -33,6 +41,12 @@ var BASE_URL = 'https://uat.hmgwebservices.com/';
var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
var PHARMACY_REDIRECT_URL = 'https://bit.ly/AlhabibPharmacy';
// Pharmacy VidaPlus URLs
// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// // Pharmacy Pre-Production URLs // // Pharmacy Pre-Production URLs
// var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapitest/api/';
// var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/'; // var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapitest/api/';
@ -40,6 +54,8 @@ var PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
// RC API URL // RC API URL
var RC_BASE_URL = 'https://rc.hmg.com/'; var RC_BASE_URL = 'https://rc.hmg.com/';
// var RC_BASE_URL = 'https://ms.hmg.com/rc/';
var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; var PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
var GET_PROJECT = 'Services/Lists.svc/REST/GetProject'; var GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
@ -326,7 +342,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
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 = 10.8; var VERSION_ID = 11.6;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;

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

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

@ -16,6 +16,8 @@ class PatientLabOrders {
int gender; int gender;
String genderDescription; String genderDescription;
String invoiceNo; String invoiceNo;
String invoiceNo_VP;
String invoiceType;
bool isActiveDoctorProfile; bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall; bool isDoctorAllowVedioCall;
bool isExecludeDoctor; bool isExecludeDoctor;
@ -35,6 +37,7 @@ class PatientLabOrders {
String setupID; String setupID;
List<String> speciality; List<String> speciality;
bool isLiveCareAppointment; bool isLiveCareAppointment;
PatientLabOrders( PatientLabOrders(
{this.actualDoctorRate, {this.actualDoctorRate,
this.clinicDescription, this.clinicDescription,
@ -68,7 +71,10 @@ class PatientLabOrders {
this.projectNameN, this.projectNameN,
this.qR, this.qR,
this.setupID, this.setupID,
this.speciality,this.isLiveCareAppointment}); this.invoiceNo_VP,
this.invoiceType,
this.speciality,
this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
@ -103,8 +109,10 @@ class PatientLabOrders {
projectNameN = json['ProjectNameN']; projectNameN = json['ProjectNameN'];
qR = json['QR']; qR = json['QR'];
setupID = json['SetupID']; setupID = json['SetupID'];
invoiceNo_VP = json['invoiceNo_VP'];
invoiceType = json['InvoiceType'];
isLiveCareAppointment = json['IsLiveCareAppointment']; isLiveCareAppointment = json['IsLiveCareAppointment'];
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -143,6 +151,7 @@ class PatientLabOrders {
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality; data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment; data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['invoiceNo_VP'] = this.invoiceNo_VP;
return data; return data;
} }
} }
@ -151,8 +160,7 @@ class PatientLabOrdersList {
String filterName = ""; String filterName = "";
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = List();
PatientLabOrdersList( PatientLabOrdersList({this.filterName, PatientLabOrders patientDoctorAppointment}) {
{this.filterName, PatientLabOrders patientDoctorAppointment}) {
patientLabOrdersList.add(patientDoctorAppointment); patientLabOrdersList.add(patientDoctorAppointment);
} }
} }

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

@ -23,8 +23,12 @@ class RequestSendLabReportEmail {
String doctorName; String doctorName;
String projectID; String projectID;
String invoiceNo; String invoiceNo;
String invoiceNoVP;
String invoiceType;
String orderDate; String orderDate;
String orderNo; String orderNo;
bool isDownload;
int doctorID;
RequestSendLabReportEmail( RequestSendLabReportEmail(
{this.versionID, {this.versionID,
@ -51,8 +55,12 @@ class RequestSendLabReportEmail {
this.doctorName, this.doctorName,
this.projectID, this.projectID,
this.invoiceNo, this.invoiceNo,
this.invoiceNoVP,
this.invoiceType,
this.orderDate, this.orderDate,
this.orderNo}); this.orderNo,
this.isDownload,
this.doctorID});
RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) { RequestSendLabReportEmail.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
@ -79,8 +87,12 @@ class RequestSendLabReportEmail {
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNoVP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
isDownload = json['IsDownload'];
doctorID = json['DoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -109,8 +121,12 @@ class RequestSendLabReportEmail {
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNoVP;
data['InvoiceType'] = this.invoiceType;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
data['OrderNo'] = this.orderNo; data['OrderNo'] = this.orderNo;
data['IsDownload'] = this.isDownload;
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

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

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

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

@ -3,9 +3,11 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
class FinalRadiology { class FinalRadiology {
String setupID; String setupID;
int projectID; int projectID;
Null patientID; dynamic patientID;
int invoiceLineItemNo; int invoiceLineItemNo;
int invoiceNo; int invoiceNo;
dynamic invoiceNo_VP;
String invoiceType;
int doctorID; int doctorID;
int clinicID; int clinicID;
DateTime orderDate; DateTime orderDate;
@ -49,6 +51,8 @@ class FinalRadiology {
this.patientID, this.patientID,
this.invoiceLineItemNo, this.invoiceLineItemNo,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP,
this.invoiceType,
this.doctorID, this.doctorID,
this.clinicID, this.clinicID,
this.orderDate, this.orderDate,
@ -83,7 +87,8 @@ class FinalRadiology {
this.reportDataTextString, this.reportDataTextString,
this.speciality, this.speciality,
this.isCVI, this.isCVI,
this.isRadMedicalReport,this.isLiveCareAppointment}); this.isRadMedicalReport,
this.isLiveCareAppointment});
FinalRadiology.fromJson(Map<String, dynamic> json) { FinalRadiology.fromJson(Map<String, dynamic> json) {
try { try {
@ -92,6 +97,8 @@ class FinalRadiology {
patientID = json['PatientID']; patientID = json['PatientID'];
invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
orderDate = DateUtil.convertStringToDate(json['OrderDate']); orderDate = DateUtil.convertStringToDate(json['OrderDate']);
@ -125,10 +132,9 @@ class FinalRadiology {
isLiveCareAppointment = json['IsLiveCareAppointment']; isLiveCareAppointment = json['IsLiveCareAppointment'];
reportDataHTML = json['ReportDataHTML']; reportDataHTML = json['ReportDataHTML'];
reportDataTextString = json['ReportDataTextString']; reportDataTextString = json['ReportDataTextString'];
// speciality = json['Speciality'].cast<String>(); // speciality = json['Speciality'].cast<String>();
isCVI = json['isCVI']; isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport']; isRadMedicalReport = json['isRadMedicalReport'];
} catch (e) { } catch (e) {
print(e); print(e);
} }
@ -141,6 +147,8 @@ class FinalRadiology {
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['InvoiceType'] = this.invoiceType;
data['DoctorID'] = this.doctorID; data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
@ -185,7 +193,7 @@ class FinalRadiologyList {
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = List();
FinalRadiologyList({this.filterName, this.finalRadiologyList}); FinalRadiologyList({this.filterName, this.finalRadiologyList});
// { // {
// finalRadiologyList.add(finalRadiology); // finalRadiologyList.add(finalRadiology);
// } // }
} }

@ -6,6 +6,8 @@ class RequestSendRadReportEmail {
String doctorName; String doctorName;
String generalid; String generalid;
int invoiceNo; int invoiceNo;
int invoiceNo_VP;
String invoiceType;
String iPAdress; String iPAdress;
bool isDentalAllowedBackend; bool isDentalAllowedBackend;
int languageID; int languageID;
@ -35,6 +37,8 @@ class RequestSendRadReportEmail {
this.doctorName, this.doctorName,
this.generalid, this.generalid,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP,
this.invoiceType,
this.iPAdress, this.iPAdress,
this.isDentalAllowedBackend, this.isDentalAllowedBackend,
this.languageID, this.languageID,
@ -63,6 +67,8 @@ class RequestSendRadReportEmail {
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
generalid = json['generalid']; generalid = json['generalid'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP'];
invoiceType = json['InvoiceType'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
isDentalAllowedBackend = json['isDentalAllowedBackend']; isDentalAllowedBackend = json['isDentalAllowedBackend'];
languageID = json['LanguageID']; languageID = json['LanguageID'];
@ -94,6 +100,8 @@ class RequestSendRadReportEmail {
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP;
data['InvoiceType'] = this.invoiceType;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['LanguageID'] = this.languageID; data['LanguageID'] = this.languageID;

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

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

@ -8,8 +8,10 @@ class AppointmentRateService extends BaseService {
List<AppoitmentRated> appointmentRatedList = List(); List<AppoitmentRated> appointmentRatedList = List();
AppointmentDetails appointmentDetails; AppointmentDetails appointmentDetails;
Future getIsLastAppointmentRatedList() async { Future getIsLastAppointmentRatedList(int languageID) async {
hasError = false; hasError = false;
Map<String, dynamic> bodyData = Map();
bodyData['LanguageID'] = languageID;
await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(IS_LAST_APPOITMENT_RATED, onSuccess: (dynamic response, int statusCode) {
appointmentRatedList.clear(); appointmentRatedList.clear();
response['IsLastAppoitmentRatedList'].forEach((appoint) { response['IsLastAppoitmentRatedList'].forEach((appoint) {
@ -18,7 +20,7 @@ class AppointmentRateService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: Map()); }, body: bodyData);
} }
Future getAppointmentDetails() async { Future getAppointmentDetails() async {

@ -73,13 +73,30 @@ class BaseAppClient {
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL; body['Channel'] = CHANNEL;
body['LanguageID'] = (languageID == 'ar' ? 1 : 2);
if (body.containsKey('LanguageID')) {
if(body['LanguageID'] != null) {
//change this line because language issue happened on dental
body['LanguageID'] = body['LanguageID'] =='ar' ? "1" : body['LanguageID'] =='en' ? '2' : body['LanguageID'];
} else {
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
} else {
// body['LanguageID'] = (languageID.toString().toLowerCase() == 'ar' ? 1 : 2);
body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
}
// body['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
// body['isVidaPlus'] = true;
body['Latitude'] = await AppSharedPreferences().getDouble(USER_LAT); double lat = await AppSharedPreferences().getDouble(USER_LAT);
body['Longitude'] = await AppSharedPreferences().getDouble(USER_LONG); double long = await AppSharedPreferences().getDouble(USER_LONG);
body['Latitude'] = lat == null ? 0.0 : lat;
body['Longitude'] = long == null ? 0.0 : long;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend') body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
@ -89,7 +106,11 @@ class BaseAppClient {
: IS_DENTAL_ALLOWED_BACKEND; : IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isIOS ? 1 : 2; body['DeviceTypeID'] = Platform.isIOS
? 1
: await Utils.isGoogleServicesAvailable()
? 2
: 3;
if (!body.containsKey('IsPublicRequest')) { if (!body.containsKey('IsPublicRequest')) {
// if (!body.containsKey('PatientType')) { // if (!body.containsKey('PatientType')) {
@ -149,7 +170,7 @@ class BaseAppClient {
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021";
// body['PatientID'] = 4767370; //3844083 // body['PatientID'] = 1231755; //3844083
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -158,11 +179,11 @@ class BaseAppClient {
body.removeWhere((key, value) => key == null || value == null); body.removeWhere((key, value) => key == null || value == null);
// if (AppGlobal.isNetworkDebugEnabled) { if (AppGlobal.isNetworkDebugEnabled) {
print("URL : $url"); print("URL : $url");
final jsonBody = json.encode(body); final jsonBody = json.encode(body);
print(jsonBody); print(jsonBody);
// } }
if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) { if (await Utils.checkConnection(bypassConnectionCheck: bypassConnectionCheck)) {
final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers); final response = await http.post(Uri.parse(url.trim()), body: json.encode(body), headers: headers);

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

@ -11,9 +11,11 @@ class PatientSickLeaveService extends BaseService {
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();
response['List_SickLeave'].forEach((sickLeave) { if(response['List_SickLeave'] != null && response['List_SickLeave'].length != 0) {
sickLeaveList.add(SickLeave.fromJson(sickLeave)); response['List_SickLeave'].forEach((sickLeave) {
}); sickLeaveList.add(SickLeave.fromJson(sickLeave));
});
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -148,4 +148,5 @@ class AskDoctorService extends BaseService {
}, body: body); }, body: body);
return Future.value(localRes); return Future.value(localRes);
} }
} }

@ -11,6 +11,8 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da
class LabsService extends BaseService { class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = List();
String labReportPDF = "";
Future getPatientLabOrdersList() async { Future getPatientLabOrdersList() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
@ -32,11 +34,16 @@ class LabsService extends BaseService {
List<LabResult> labResultList = List(); List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = List(); List<LabOrderResult> labOrdersResultsList = List();
Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async {
hasError = false; hasError = false;
_requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo;
_requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo;
_requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0";
_requestPatientLabSpecialResult.invoiceType = invoiceType;
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
_requestPatientLabSpecialResult.setupID = setupID; _requestPatientLabSpecialResult.setupID = setupID;
@ -51,10 +58,12 @@ class LabsService extends BaseService {
}, body: _requestPatientLabSpecialResult.toJson()); }, body: _requestPatientLabSpecialResult.toJson());
} }
Future getPatientLabResult({PatientLabOrders patientLabOrder}) async { Future getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0";
body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
body['InvoiceType'] = patientLabOrder.invoiceType;
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
@ -171,10 +180,11 @@ class LabsService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0";
body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo; body['OrderNo'] = patientLabOrder.orderNo;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
@ -194,9 +204,11 @@ class LabsService extends BaseService {
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail(); RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj}) async { Future sendLabReportEmail({PatientLabOrders patientLabOrder, AuthenticatedUser userObj, bool isVidaPlus, bool isDownload = false}) async {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
_requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0";
_requestSendLabReportEmail.invoiceType = patientLabOrder.invoiceType;
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName; _requestSendLabReportEmail.patientName = userObj.firstName + " " + userObj.lastName;
@ -208,8 +220,15 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.projectName = patientLabOrder.projectName;
_requestSendLabReportEmail.setupID = patientLabOrder.setupID; _requestSendLabReportEmail.setupID = patientLabOrder.setupID;
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.isDownload = isDownload;
_requestSendLabReportEmail.doctorID = patientLabOrder.doctorID;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
if (isDownload) {
labReportPDF = response['LabReportsPDFContent'];
}
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestSendLabReportEmail.toJson()); }, body: _requestSendLabReportEmail.toJson());

@ -1,7 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart'; import 'package:diplomaticquarterapp/core/model/radiology/request_send_rad_report_email.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -9,12 +8,16 @@ class RadiologyService extends BaseService {
List<FinalRadiology> finalRadiologyList = List(); List<FinalRadiology> finalRadiologyList = List();
String url = ''; String url = '';
Future getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) 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'] = invoiceNo; body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;
body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0";
body['LineItemNo'] = lineItem; body['LineItemNo'] = lineItem;
body['ProjectID'] = projectId; body['ProjectID'] = projectId;
body['InvoiceType'] = invoiceType;
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'];
@ -28,9 +31,18 @@ class RadiologyService extends BaseService {
hasError = false; hasError = false;
await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PATIENT_ORDERS, onSuccess: (dynamic response, int statusCode) {
finalRadiologyList.clear(); finalRadiologyList.clear();
response['FinalRadiologyList'].forEach((radiology) { // response['FinalRadiologyList'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology)); if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) {
}); isRadiologyVIDAPlus = false;
response['FinalRadiologyList'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
} else {
isRadiologyVIDAPlus = true;
response['FinalRadiologyListAPI'].forEach((radiology) {
finalRadiologyList.add(FinalRadiology.fromJson(radiology));
});
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -56,6 +68,7 @@ class RadiologyService extends BaseService {
_requestSendRadReportEmail.projectID = finalRadiology.projectID; _requestSendRadReportEmail.projectID = finalRadiology.projectID;
_requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription; _requestSendRadReportEmail.clinicName = finalRadiology.clinicDescription;
_requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo; _requestSendRadReportEmail.invoiceNo = finalRadiology.invoiceNo;
_requestSendRadReportEmail.invoiceNo_VP = finalRadiology.invoiceNo_VP;
_requestSendRadReportEmail.invoiceLineItemNo = finalRadiology.invoiceLineItemNo; _requestSendRadReportEmail.invoiceLineItemNo = finalRadiology.invoiceLineItemNo;
_requestSendRadReportEmail.setupID = finalRadiology.setupID; _requestSendRadReportEmail.setupID = finalRadiology.setupID;
_requestSendRadReportEmail.doctorName = finalRadiology.doctorName; _requestSendRadReportEmail.doctorName = finalRadiology.doctorName;
@ -67,6 +80,7 @@ class RadiologyService extends BaseService {
_requestSendRadReportEmail.radResult = finalRadiology.reportData; _requestSendRadReportEmail.radResult = finalRadiology.reportData;
_requestSendRadReportEmail.to = userObj.emailAddress; _requestSendRadReportEmail.to = userObj.emailAddress;
_requestSendRadReportEmail.dateofBirth = userObj.dateofBirth; _requestSendRadReportEmail.dateofBirth = userObj.dateofBirth;
_requestSendRadReportEmail.invoiceType = finalRadiology.invoiceType;
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) {}, onFailure: (String error, int statusCode) {

@ -29,7 +29,7 @@ class ReportsService extends BaseService {
} }
Future getInPatientReports() async { Future getInPatientReports() async {
RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 2, patientOutSA: 0, projectID: 0); RequestReports _requestReportsInpatient = RequestReports(isReport: true, encounterType: 2, requestType: 1, patientOutSA: 0, projectID: 0);
hasError = false; hasError = false;
await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(REPORTS, onSuccess: (dynamic response, int statusCode) {
inpatientReportsList.clear(); inpatientReportsList.clear();
@ -137,7 +137,7 @@ class ReportsService extends BaseService {
body['ProjectID'] = projectID; body['ProjectID'] = projectID;
body['Remarks'] = ""; body['Remarks'] = "";
body['ProcedureId'] = ""; body['ProcedureId'] = "";
body['RequestType'] = 2; body['RequestType'] = 1;
body['Source'] = 2; body['Source'] = 2;
body['Status'] = 1; body['Status'] = 1;
body['CreatedBy'] = 102; body['CreatedBy'] = 102;

@ -1,19 +1,42 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PrivilegeService extends BaseService { class PrivilegeService extends BaseService {
List<PrivilegeModel> privilegeModelList = [];
List<PrivilegeModel> privilegeModelList = List(); List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];
List<HMCProjectListModel> hMCProjectListModel = [];
List<ProjectDetailListModel> projectDetailListModel = [];
Future getPrivilege() async { Future getPrivilege() async {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientType'] = 4; body['PatientType'] = 4;
await baseAppClient.post(GET_PRIVILEGE, body['LanguageID'] = 1;
onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_PRIVILEGE, onSuccess: (dynamic response, int statusCode) {
response['ServicePrivilegeList'].forEach((item) { response['ServicePrivilegeList'].forEach((item) {
privilegeModelList.add(PrivilegeModel.fromJson(item)); privilegeModelList.add(PrivilegeModel.fromJson(item));
}); });
if (response['ProjectListVidaPlus'].length != 0) {
response['ProjectListVidaPlus'].forEach((item) {
vidaPlusProjectListModel.add(VidaPlusProjectListModel.fromJson(item));
});
}
if (response['HMCProjectList'].length != 0) {
response['HMCProjectList'].forEach((item) {
hMCProjectListModel.add(HMCProjectListModel.fromJson(item));
});
}
if (response['ProjectDetailList'].length != 0) {
response['ProjectDetailList'].forEach((item) {
projectDetailListModel.add(ProjectDetailListModel.fromJson(item));
});
}
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

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

@ -12,10 +12,10 @@ class AppointmentRateViewModel extends BaseViewModel {
AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails; AppointmentDetails get appointmentDetails => _appointmentRateService.appointmentDetails;
Future getIsLastAppointmentRatedList() async { Future getIsLastAppointmentRatedList(int languageID) async {
isHaveAppointmentNotRate = false; isHaveAppointmentNotRate = false;
setState(ViewState.Busy); setState(ViewState.Busy);
await _appointmentRateService.getIsLastAppointmentRatedList(); await _appointmentRateService.getIsLastAppointmentRatedList(languageID);
if (_appointmentRateService.hasError) { if (_appointmentRateService.hasError) {
error = _appointmentRateService.error; error = _appointmentRateService.error;
setState(ViewState.Error); setState(ViewState.Error);

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

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

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

@ -20,6 +20,8 @@ class LabsViewModel extends BaseViewModel {
List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList; List<LabOrderResult> get labOrdersResultsList => _labsService.labOrdersResultsList;
List<TimeSeriesSales2> timeSeries = []; List<TimeSeriesSales2> timeSeries = [];
String get labReportPDF => _labsService.labReportPDF;
List<PatientLabOrdersList> _patientLabOrdersListClinic = List(); List<PatientLabOrdersList> _patientLabOrdersListClinic = List();
List<PatientLabOrdersList> _patientLabOrdersListHospital = List(); List<PatientLabOrdersList> _patientLabOrdersListHospital = List();
@ -46,7 +48,7 @@ class LabsViewModel extends BaseViewModel {
List<PatientLabOrdersList> patientLabOrdersHospital = _patientLabOrdersListHospital List<PatientLabOrdersList> patientLabOrdersHospital = _patientLabOrdersListHospital
.where( .where(
(elementClinic) => elementClinic.filterName == element.projectName, (elementClinic) => elementClinic.filterName == element.projectName,
) )
.toList(); .toList();
if (patientLabOrdersHospital.length != 0) { if (patientLabOrdersHospital.length != 0) {
@ -72,9 +74,15 @@ class LabsViewModel extends BaseViewModel {
List<LabResultList> labResultLists = List(); List<LabResultList> labResultLists = List();
getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo, String setupID}) async { getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String invoiceType, String orderNo, String setupID, bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getLaboratoryResult(invoiceNo: invoiceNo, orderNo: orderNo, projectID: projectID, clinicID: clinicID, setupID: setupID); await _labsService.getLaboratoryResult(invoiceNo: invoiceNo,
invoiceType: invoiceType,
orderNo: orderNo,
projectID: projectID,
clinicID: clinicID,
setupID: setupID,
isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -83,9 +91,9 @@ class LabsViewModel extends BaseViewModel {
} }
} }
getPatientLabResult({PatientLabOrders patientLabOrder}) async { getPatientLabResult({PatientLabOrders patientLabOrder, bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder); await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder, isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -107,9 +115,9 @@ class LabsViewModel extends BaseViewModel {
} }
} }
getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async { getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure, bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure); await _labsService.getPatientLabOrdersResults(patientLabOrder: patientLabOrder, procedure: procedure, isVidaPlus: isVidaPlus);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -135,11 +143,14 @@ class LabsViewModel extends BaseViewModel {
} }
} }
sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj}) async { sendLabReportEmail({PatientLabOrders patientLabOrder, String mes, AuthenticatedUser userObj, bool isVidaPlus, bool isDownload = false}) async {
await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj); await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder, userObj: userObj, isVidaPlus: isVidaPlus, isDownload: isDownload);
if (_labsService.hasError) { if (_labsService.hasError) {
error = _labsService.error; error = _labsService.error;
} else } else {
AppToast.showSuccessToast(message: mes); if (isDownload) {} else {
AppToast.showSuccessToast(message: mes);
}
}
} }
} }

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

@ -18,9 +18,14 @@ 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 get isRadiologyVIDAPlus => _isRadiologyVIDAPlus;
void getPatientRadOrders() async { void getPatientRadOrders() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getPatientRadOrders(); await _radiologyService.getPatientRadOrders();
_isRadiologyVIDAPlus = _radiologyService.isRadiologyVIDAPlus;
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -43,9 +48,9 @@ class RadiologyViewModel extends BaseViewModel {
String get radImageURL => _radiologyService.url; String get radImageURL => _radiologyService.url;
getRadImageURL({int invoiceNo, int lineItem, int projectId}) async { getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId); await _radiologyService.getRadImageURL(invoiceNo: invoiceNo, invoiceType: invoiceType, lineItem: lineItem, projectId: projectId, isVidaPlus: isVidaPlus);
if (_radiologyService.hasError) { if (_radiologyService.hasError) {
error = _radiologyService.error; error = _radiologyService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -4,7 +4,10 @@ import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/HMCProjectListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
import 'package:diplomaticquarterapp/core/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
@ -15,8 +18,8 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
var isAppArabic = false; var isAppArabic = false;
class ProjectViewModel extends BaseViewModel {
class ProjectViewModel extends BaseViewModel {
GAnalytics get analytics => locator<GAnalytics>(); GAnalytics get analytics => locator<GAnalytics>();
// Platform Bridge // Platform Bridge
@ -39,10 +42,14 @@ class ProjectViewModel extends BaseViewModel {
double _latitude; double _latitude;
double _longitude; double _longitude;
RegisterInfoResponse _registerInfo =RegisterInfoResponse(); RegisterInfoResponse _registerInfo = RegisterInfoResponse();
double get latitude => _latitude; double get latitude => _latitude;
double get longitude => _longitude; double get longitude => _longitude;
RegisterInfoResponse get registerInfo=> _registerInfo;
RegisterInfoResponse get registerInfo => _registerInfo;
dynamic get searchValue => searchvalue; dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale; Locale get appLocal => _appLocale;
@ -54,9 +61,17 @@ class ProjectViewModel extends BaseViewModel {
bool isLoginChild = false; bool isLoginChild = false;
List<PrivilegeModel> privilegeRootUser = List(); List<PrivilegeModel> privilegeRootUser = List();
List<PrivilegeModel> privilegeChildUser = List(); List<PrivilegeModel> privilegeChildUser = List();
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<HMCProjectListModel> _hMCProjectListModel = [];
List<ProjectDetailListModel> _projectDetailListModel = [];
List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser;
List<VidaPlusProjectListModel> get vidaPlusProjectList => _vidaPlusProjectListModel;
List<PrivilegeModel> get privileges => List<HMCProjectListModel> get hMCProjectListModel => _hMCProjectListModel;
isLoginChild ? privilegeChildUser : privilegeChildUser;
List<ProjectDetailListModel> get projectDetailListModel => _projectDetailListModel;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
@ -64,9 +79,7 @@ class ProjectViewModel extends BaseViewModel {
ProjectViewModel() { ProjectViewModel() {
loadSharedPrefLanguage(); loadSharedPrefLanguage();
subscription = Connectivity() subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
.onConnectivityChanged
.listen((ConnectivityResult result) {
switch (result) { switch (result) {
case ConnectivityResult.wifi: case ConnectivityResult.wifi:
isInternetConnection = true; isInternetConnection = true;
@ -89,8 +102,7 @@ class ProjectViewModel extends BaseViewModel {
} }
Future loadSharedPrefLanguage() async { Future loadSharedPrefLanguage() async {
currentLanguage = currentLanguage = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_appLocale = Locale(currentLanguage); _appLocale = Locale(currentLanguage);
isAppArabic = _isArabic = currentLanguage == 'ar'; isAppArabic = _isArabic = currentLanguage == 'ar';
notifyListeners(); notifyListeners();
@ -121,6 +133,21 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
setVidaPlusProjectList(List<VidaPlusProjectListModel> vidaPlusProjectListModelInput) {
_vidaPlusProjectListModel = vidaPlusProjectListModelInput;
notifyListeners();
}
setProjectsDetailList(List<ProjectDetailListModel> projectDetailListModel) {
_projectDetailListModel = projectDetailListModel;
notifyListeners();
}
setHMCProjectList(List<HMCProjectListModel> hMCProjectListModel) {
_hMCProjectListModel = hMCProjectListModel;
notifyListeners();
}
setPrivilege({privilegeList, bool isLoginChild = false}) { setPrivilege({privilegeList, bool isLoginChild = false}) {
List<PrivilegeModel> privilege = List(); List<PrivilegeModel> privilege = List();
@ -166,8 +193,9 @@ class ProjectViewModel extends BaseViewModel {
searchvalue = data; searchvalue = data;
notifyListeners(); notifyListeners();
} }
setRegisterData(RegisterInfoResponse data){
_registerInfo =data; setRegisterData(RegisterInfoResponse data) {
_registerInfo = data;
notifyListeners(); notifyListeners();
} }
} }

@ -70,7 +70,7 @@ class _MyApp extends State<MyApp> {
// var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans'; // var font = projectProvider.isArabic ? 'Cairo' : 'WorkSans';
// Re-enable once going live // Re-enable once going live
if (Platform.isAndroid) checkForUpdate(); // if (Platform.isAndroid) checkForUpdate();
ThemeNotifier(defaultTheme()); ThemeNotifier(defaultTheme());
super.initState(); super.initState();

@ -15,7 +15,7 @@ class CheckActivationCodeReq {
bool isSilentLogin; bool isSilentLogin;
double versionID; double versionID;
int channel; int channel;
int languageID; // int languageID;
String iPAdress; String iPAdress;
String generalid; String generalid;
int patientOutSA; int patientOutSA;
@ -41,7 +41,7 @@ class CheckActivationCodeReq {
this.isSilentLogin, this.isSilentLogin,
this.versionID, this.versionID,
this.channel, this.channel,
this.languageID, // this.languageID,
this.iPAdress, this.iPAdress,
this.generalid, this.generalid,
this.patientOutSA, this.patientOutSA,
@ -68,7 +68,7 @@ class CheckActivationCodeReq {
isSilentLogin = json['IsSilentLogin']; isSilentLogin = json['IsSilentLogin'];
versionID = json['VersionID']; versionID = json['VersionID'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; // languageID = json['LanguageID'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
generalid = json['generalid']; generalid = json['generalid'];
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
@ -96,7 +96,7 @@ class CheckActivationCodeReq {
data['IsSilentLogin'] = this.isSilentLogin; data['IsSilentLogin'] = this.isSilentLogin;
data['VersionID'] = this.versionID; data['VersionID'] = this.versionID;
data['Channel'] = this.channel; data['Channel'] = this.channel;
data['LanguageID'] = this.languageID; // data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;

@ -1,7 +1,7 @@
class GetAllSharedRecordsByStatusReq { class GetAllSharedRecordsByStatusReq {
double versionID; double versionID;
int channel; int channel;
int languageID; // int languageID;
String iPAdress; String iPAdress;
String generalid; String generalid;
int patientOutSA; int patientOutSA;
@ -17,7 +17,7 @@ class GetAllSharedRecordsByStatusReq {
GetAllSharedRecordsByStatusReq( GetAllSharedRecordsByStatusReq(
{this.versionID, {this.versionID,
this.channel, this.channel,
this.languageID, // this.languageID,
this.iPAdress, this.iPAdress,
this.generalid, this.generalid,
this.patientOutSA, this.patientOutSA,
@ -33,7 +33,7 @@ class GetAllSharedRecordsByStatusReq {
GetAllSharedRecordsByStatusReq.fromJson(Map<String, dynamic> json) { GetAllSharedRecordsByStatusReq.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; // languageID = json['LanguageID'];
iPAdress = json['IPAdress']; iPAdress = json['IPAdress'];
generalid = json['generalid']; generalid = json['generalid'];
patientOutSA = json['PatientOutSA']; patientOutSA = json['PatientOutSA'];
@ -51,7 +51,7 @@ class GetAllSharedRecordsByStatusReq {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID; data['VersionID'] = this.versionID;
data['Channel'] = this.channel; data['Channel'] = this.channel;
data['LanguageID'] = this.languageID; // data['LanguageID'] = this.languageID;
data['IPAdress'] = this.iPAdress; data['IPAdress'] = this.iPAdress;
data['generalid'] = this.generalid; data['generalid'] = this.generalid;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;

@ -1,6 +1,6 @@
class AncillaryOrdersListModel { class AncillaryOrdersListModel {
List<AncillaryOrderList> ancillaryOrderList; List<AncillaryOrderList> ancillaryOrderList;
Null errCode; dynamic errCode;
String message; String message;
int patientID; int patientID;
String patientName; String patientName;
@ -32,7 +32,7 @@ class AncillaryOrdersListModel {
errCode = json['ErrCode']; errCode = json['ErrCode'];
message = json['Message']; message = json['Message'];
patientID = json['PatientID']; patientID = json['PatientID'];
patientName = json['PatientName']; patientName = json['PatientName'] != null ? json['PatientName'] : "";
patientType = json['PatientType']; patientType = json['PatientType'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
projectName = json['ProjectName']; projectName = json['ProjectName'];
@ -83,7 +83,7 @@ class AncillaryOrderList {
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
clinicName = json['ClinicName']; clinicName = json['ClinicName'] != null ? json['ClinicName'] : "";
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];

@ -0,0 +1,18 @@
class AncillaryOrdersProcedureList {
int procedureID;
String procedureDescription;
AncillaryOrdersProcedureList({this.procedureID, this.procedureDescription});
AncillaryOrdersProcedureList.fromJson(Map<String, dynamic> json) {
procedureID = json['ProcedureID'];
procedureDescription = json['ProcedureDescription'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProcedureID'] = this.procedureID;
data['ProcedureDescription'] = this.procedureDescription;
return data;
}
}

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

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

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

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

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

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'dialogs/ConfirmSMSDialog.dart'; import 'dialogs/ConfirmSMSDialog.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
@ -31,11 +33,13 @@ class ConfirmPaymentPage extends StatelessWidget {
MyInAppBrowser browser; MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel;
ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser}); ConfirmPaymentPage({this.advanceModel, this.patientInfoAndMobileNumber, this.selectedPaymentMethod, this.authenticatedUser});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
void showSMSDialog() { void showSMSDialog() {
showDialog( showDialog(
context: context, context: context,
@ -250,8 +254,13 @@ class ConfirmPaymentPage extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(AppGlobal.context); GifLoaderDialogUtils.showMyDialog(AppGlobal.context);
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], AppGlobal.context).then((res) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest(
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);

@ -59,6 +59,10 @@ class _BookConfirmState extends State<BookConfirm> {
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
bool isInsured = false;
bool isEligible = false;
bool isCash = false;
@override @override
void initState() { void initState() {
// widget.authUser = new AuthenticatedUser(); // widget.authUser = new AuthenticatedUser();
@ -331,9 +335,9 @@ class _BookConfirmState extends State<BookConfirm> {
AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {
checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context); // checkPatientNphiesEligibility(docObject, res['AppointmentNo'], context);
// getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getToDoCount();
// getToDoCount(); getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject);
}); });
widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) { widget.service.logDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, decodedLogs, res['AppointmentNo'], context).then((res) {
@ -437,13 +441,41 @@ class _BookConfirmState extends State<BookConfirm> {
} }
getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {
String errorMsg = "";
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
projectViewModel.selectedBodyPartList.clear(); projectViewModel.selectedBodyPartList.clear();
projectViewModel.laserSelectionDuration = 0; projectViewModel.laserSelectionDuration = 0;
print(res); if(res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); }
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
} else {
if (isInsured && isEligible) {
navigateToBookSuccess(context, docObject, widget.patientShareResponse, isCash);
} else {
if (isInsured && !isEligible) {
errorMsg = TranslationBase.of(context).invalidEligibility;
} else {
errorMsg = TranslationBase.of(context).invalidInsurance;
}
ConfirmDialog dialog = new ConfirmDialog(
isDissmissable: false,
context: context,
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
cancelFunction: () => {continueAsCash(docObject, appointmentNo)});
dialog.showAlertDialog(context);
}
}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
// AppToast.showErrorToast(message: err); // AppToast.showErrorToast(message: err);
@ -458,7 +490,7 @@ class _BookConfirmState extends State<BookConfirm> {
widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) { widget.service.getLiveCareAppointmentPatientShare(appointmentNo, clinicID, projectID, context).then((res) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToBookSuccess(context, docObject, widget.patientShareResponse); navigateToBookSuccess(context, docObject, widget.patientShareResponse, false);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -522,7 +554,7 @@ class _BookConfirmState extends State<BookConfirm> {
Navigator.of(context).popAndPushNamed(HOME); Navigator.of(context).popAndPushNamed(HOME);
} }
Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse) async { Future navigateToBookSuccess(context, DoctorList docObject, PatientShareResponse patientShareResponse, bool isCash) async {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
this.sharedPref.remove(IS_LIVECARE_APPOINTMENT); this.sharedPref.remove(IS_LIVECARE_APPOINTMENT);
Navigator.push( Navigator.push(
@ -534,6 +566,7 @@ class _BookConfirmState extends State<BookConfirm> {
appoDateFormatted: widget.appoDateFormatted, appoDateFormatted: widget.appoDateFormatted,
appoTimeFormatted: widget.selectedTime, appoTimeFormatted: widget.selectedTime,
dateTime: getDateTime(), dateTime: getDateTime(),
isCash: isCash,
), ),
), ),
); );

@ -1,6 +1,5 @@
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
@ -8,6 +7,8 @@ import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.da
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/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -18,6 +19,7 @@ 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';
import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/custom_text_button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart'; import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
@ -37,8 +39,9 @@ class BookSuccess extends StatefulWidget {
String appoDateFormatted; String appoDateFormatted;
String appoTimeFormatted; String appoTimeFormatted;
bool isCash;
BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted}); BookSuccess({@required this.patientShareResponse, @required this.docObject, @required this.appoDateFormatted, @required this.appoTimeFormatted, this.isCash = false});
@override @override
_BookSuccessState createState() => _BookSuccessState(); _BookSuccessState createState() => _BookSuccessState();
@ -46,6 +49,7 @@ class BookSuccess extends StatefulWidget {
class _BookSuccessState extends State<BookSuccess> { class _BookSuccessState extends State<BookSuccess> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
// AuthenticatedUser authUser; // AuthenticatedUser authUser;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@ -155,25 +159,54 @@ class _BookSuccessState extends State<BookSuccess> {
Widget _getQRButtons() { Widget _getQRButtons() {
return Container( return Container(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
margin: EdgeInsets.all(14),
height: MediaQuery.of(context).size.height * 0.18, height: MediaQuery.of(context).size.height * 0.18,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
ButtonTheme( Row(
shape: RoundedRectangleBorder( children: [
borderRadius: BorderRadius.circular(10.0), Expanded(
), flex: 1,
minWidth: MediaQuery.of(context).size.width * 0.7, child: ButtonTheme(
height: 45.0, shape: RoundedRectangleBorder(
child: CustomTextButton( borderRadius: BorderRadius.circular(10.0),
backgroundColor: Color(0xFF60686b), ),
elevation: 0, minWidth: MediaQuery.of(context).size.width * 0.7,
onPressed: () { height: 45.0,
// navigateToQR(context); child: CustomTextButton(
getAppoQR(context); backgroundColor: CustomColors.green,
}, elevation: 0,
child: Text(TranslationBase.of(context).viewQR.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), onPressed: () {
), GifLoaderDialogUtils.showMyDialog(context);
getAppoQR(context);
},
child: Text(TranslationBase.of(context).checkinOptions, style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
),
mWidth(7),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
height: 45.0,
child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () {
navigateToHome(context);
// GifLoaderDialogUtils.showMyDialog(context);
// getAppoQR(context);
},
child: Text(TranslationBase.of(context).done, style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
),
],
), ),
], ],
), ),
@ -186,51 +219,85 @@ class _BookSuccessState extends State<BookSuccess> {
child: Container( child: Container(
color: CustomColors.appBackgroudGreyColor, color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.all(14), margin: EdgeInsets.all(14),
height: 45.0, height: widget.isCash ? 150.0 : 50,
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.end, children: [
children: <Widget>[ Row(
Expanded( mainAxisAlignment: MainAxisAlignment.end,
flex: 1, children: <Widget>[
child: ButtonTheme( Expanded(
shape: RoundedRectangleBorder( flex: 1,
borderRadius: BorderRadius.circular(10.0), child: ButtonTheme(
), shape: RoundedRectangleBorder(
height: 45.0, borderRadius: BorderRadius.circular(10.0),
child: CustomTextButton( ),
backgroundColor: CustomColors.green, height: 45.0,
elevation: 0, child: CustomTextButton(
onPressed: () { backgroundColor: CustomColors.green,
startPaymentProcess(); elevation: 0,
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); onPressed: () {
}, startPaymentProcess();
child: Text(TranslationBase.of(context).payNow.toUpperCase(), projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true);
style: TextStyle( },
fontSize: 18.0, child: Text(TranslationBase.of(context).payNow.toUpperCase(),
color: Colors.white, style: TextStyle(
)), fontSize: 18.0,
), color: Colors.white,
), )),
), ),
mWidth(7), ),
Expanded(
flex: 1,
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
), ),
height: 45.0, mWidth(7),
child: CustomTextButton( Expanded(
backgroundColor: Color(0xffc5272d), flex: 1,
elevation: 0, child: ButtonTheme(
onPressed: () { shape: RoundedRectangleBorder(
navigateToHome(context); borderRadius: BorderRadius.circular(10.0),
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false); ),
}, height: 45.0,
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)), child: CustomTextButton(
backgroundColor: Color(0xffc5272d),
elevation: 0,
onPressed: () {
navigateToHome(context);
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
},
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0, color: Colors.white)),
),
),
), ),
), ],
), ),
widget.isCash
? Column(
children: [
mHeight(10.0),
Text(
TranslationBase.of(context).cashAmountUpdateInsurance,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.w600,
color: Color(0xff2E303A),
),
),
mHeight(5.0),
DefaultButton(
TranslationBase.of(context).updateInsuranceText,
() {
Navigator.pop(context, null);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (context) => LandingPage()),
(Route<dynamic> route) => false,
);
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
color: Color(0xffEAA118),
textColor: Colors.white,
),
],
)
: Container(),
], ],
), ),
), ),
@ -775,7 +842,13 @@ class _BookSuccessState extends State<BookSuccess> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo); addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);

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

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

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

@ -376,10 +376,11 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
} }
getCurrentLanguage() async { getCurrentLanguage() async {
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); this.language = projectViewModel.isArabic ? "ar" : "en";
setState(() { // var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
this.language = languageID; // setState(() {
}); // this.language = languageID;
// });
} }
} }

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

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

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

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

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

@ -126,7 +126,7 @@ class _CovidDrivethruLocationState extends State<CovidDrivethruLocation> {
value: item, value: item,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [Text(item.projectName), getCovidTestTypeImage(item)], children: [Text(item.projectName ?? ""), getCovidTestTypeImage(item)],
), ),
); );
}).toList(), }).toList(),

@ -402,8 +402,12 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
print(res['OnlineCheckInAppointments'][0]['AdvanceNumber']); addAdvancedNumberRequest(
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString()); Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString());
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);

@ -451,20 +451,20 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
refreshFamily(context) async { refreshFamily(context) async {
await sharedPref.remove(FAMILY_FILE);
await sharedPref.remove(FAMILY_FILE); await checkUserData();
await checkUserData();
} }
switchUser(user, context) { switchUser(user, context) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
// this // this
// .familyFileProvider // .familyFileProvider
// .silentLoggin(user) // .silentLoggin(user)
// .then((value) => loginAfter(value, context)); // .then((value) => loginAfter(value, context));
// Utils.showProgressDialog(context); // Utils.showProgressDialog(context);
this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) { this.familyFileProvider.silentLoggin(user is AuthenticatedUser ? null : user, languageID, mainUser: user is AuthenticatedUser).then((value) => loginAfter(value, context)).catchError((err) {
print("err:$err"); print("err:$err");
AppToast.showErrorToast(message: err.toString()); AppToast.showErrorToast(message: err.toString());
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -528,9 +528,8 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request["ID"] = ID; request["ID"] = ID;
request["Status"] = status; request["Status"] = status;
this.familyFileProvider.acceptRejectFamily(request).then((value) async{ this.familyFileProvider.acceptRejectFamily(request).then((value) async {
await refreshFamily(context);
await refreshFamily(context);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
} }
@ -540,7 +539,6 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
// var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER)); // var data2 = AuthenticatedUser.fromJson(await this.sharedPref.getObject(MAIN_USER));
await getFamilyFiles(); await getFamilyFiles();
this.user = data; this.user = data;
setState(() { setState(() {
@ -562,19 +560,19 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
try { try {
if (familySharedRecords == null) { if (familySharedRecords == null) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
familySharedRecords = await familyFileProvider.getSharedRecordByStatus(); familySharedRecords = await familyFileProvider.getSharedRecordByStatus(languageID);
} }
sentRecordsList =[];
familySharedRecordsList =[]; familySharedRecordsList =[];
sentRecordsList = [];
familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) { familySharedRecords.getAllSharedRecordsByStatusList.forEach((element) {
if (element.status == 3) { if (element.status == 3) {
familySharedRecordsList.add(element); familySharedRecordsList.add(element);
} }
sentRecordsList.add(element); sentRecordsList.add(element);
}); });
approvedRecordsList =[]; approvedRecordsList = [];
pendingRecordsList =[]; pendingRecordsList = [];
GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest(); GetAllSharedRecordsByStatusResponse pendingAndApprovedRecords = await getUserViewRequest();
pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) { pendingAndApprovedRecords.getAllSharedRecordsByStatusList.forEach((element) {
@ -586,7 +584,6 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
} }
}); });
} catch (ex) { } catch (ex) {
familySharedRecords = GetAllSharedRecordsByStatusResponse(getAllSharedRecordsByStatusList: []); familySharedRecords = GetAllSharedRecordsByStatusResponse(getAllSharedRecordsByStatusList: []);
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

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

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

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

@ -592,12 +592,16 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate);
await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) { try {
Result<UnmodifiableListView<Event>> events = value; await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) {
events.data.forEach((element) { Result<UnmodifiableListView<Event>> events = value;
if (element.title.contains(widget.appo.doctorNameObj)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); events.data.forEach((element) {
if (element.title.contains(widget.appo.doctorNameObj)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element);
});
}); });
}); } catch (ex) {
print(ex);
}
} }
cancelAppointment() { cancelAppointment() {

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

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

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

@ -29,6 +29,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
@ -73,7 +74,11 @@ 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 = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") || (widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc")); bool shouldEnable = (((widget.appo.clinicID == 17 || widget.appo.clinicID == 47) && appoButtonsList[index].caller == "openReschedule") ||
(widget.appo.isLiveCareAppointment && appoButtonsList[index].caller == "askDoc") ||
(Utils.isVidaPlusProject(projectViewModel, widget.appo.projectID) &&
widget.appo.clinicID == 10 &&
(appoButtonsList[index].caller == "prescriptions" || appoButtonsList[index].caller == "radiology" || appoButtonsList[index].caller == "labResult")));
return InkWell( return InkWell(
onTap: shouldEnable onTap: shouldEnable
? null ? null
@ -87,6 +92,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
hasBadge: true, hasBadge: true,
isEnable: !shouldEnable, isEnable: !shouldEnable,
imgColor: Color(0xff28323A), imgColor: Color(0xff28323A),
isPngImage: appoButtonsList[index].icon.contains(".png") ? true : false,
), ),
); );
}, },
@ -461,7 +467,8 @@ class _AppointmentActionsState extends State<AppointmentActions> {
askYourDoc() { askYourDoc() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.isAllowedToAskDoctor(widget.appo.doctorID, context).then((res) { int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
service.isAllowedToAskDoctor(widget.appo.doctorID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['PatientDoctorAppointmentResultList']); print(res['PatientDoctorAppointmentResultList']);
if (res['PatientDoctorAppointmentResultList'].length != 0) { if (res['PatientDoctorAppointmentResultList'].length != 0) {
@ -477,9 +484,10 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
getCallRequestType() { getCallRequestType() {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getCallRequestType(context).then((res) { service.getCallRequestType(languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
List<AskDocRequestType> requestData = new List<AskDocRequestType>(); List<AskDocRequestType> requestData = new List<AskDocRequestType>();
res['ListReqTypes'].forEach((element) { res['ListReqTypes'].forEach((element) {
@ -522,9 +530,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
sendAskDocRequest(int requestType) { sendAskDocRequest(int requestType) {
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.sendAskDocCallRequest(widget.appo, requestType.toString(), context).then((res) {
service.sendAskDocCallRequest(widget.appo, requestType.toString(), languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
AppToast.showSuccessToast(message: "Request Sent Successfully"); AppToast.showSuccessToast(message: "Request Sent Successfully");
@ -582,16 +592,51 @@ class _AppointmentActionsState extends State<AppointmentActions> {
navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) { navigateToToDoPage(BuildContext context, ToDoCountProviderModel model) {
if (widget.projectViewModel.isLogin) { if (widget.projectViewModel.isLogin) {
if (model.count != 0) { // if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); getPatientAppointmentHistoryWithAppo();
} else { // } else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty); // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
} // }
} else { } else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))); Navigator.push(
context,
FadePage(
page: ToDo(
isShowAppBar: true,
isFromMyAppointments: true,
appointment: widget.appo,
)));
} }
} }
getPatientAppointmentHistoryWithAppo() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
service.getPatientAppointmentHistoryWithAppoNo(widget.appo.appointmentNo, languageID).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList.fromJson(res['AppoimentAllHistoryResultList'][0]);
Navigator.push(
context,
FadePage(
page: ToDo(
isShowAppBar: true,
isFromMyAppointments: true,
appointment: appo,
),
),
);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err);
});
}
rateAppointment() { rateAppointment() {
widget.browser = new MyInAppBrowser(); widget.browser = new MyInAppBrowser();
var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1'; var url = 'http://hmg.com/SitePages/pso.aspx?p=' + widget.appo.projectID.toString() + '.' + widget.appo.appointmentNo.toString() + '&c=1';

@ -20,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -51,12 +52,13 @@ class ToDo extends StatefulWidget {
List<AncillaryOrdersListModel> ancillaryLists = []; List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = []; List<OBGyneProcedureListResponse> obGyneAppoList = [];
var languageID; var languageID;
MyInAppBrowser browser;
bool isShowAppBar = true; bool isShowAppBar = true;
Function onBackClick; Function onBackClick;
bool isFromMyAppointments;
AppoitmentAllHistoryResultList appointment;
ToDo({@required this.isShowAppBar, this.onBackClick}); ToDo({@required this.isShowAppBar, this.onBackClick, this.isFromMyAppointments = false, this.appointment});
@override @override
_ToDoState createState() => _ToDoState(); _ToDoState createState() => _ToDoState();
@ -79,6 +81,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool dataLoaded = false; bool dataLoaded = false;
bool isInsured = false;
bool isEligible = false;
bool isCash = false;
MyInAppBrowser browser;
@override @override
void initState() { void initState() {
widget.patientShareResponse = new PatientShareResponse(); widget.patientShareResponse = new PatientShareResponse();
@ -539,12 +546,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
performNextAction(AppoitmentAllHistoryResultList appo) { performNextAction(AppoitmentAllHistoryResultList appo) {
switch (appo.nextAction) { switch (appo.nextAction) {
case 0:
// getAppoQR(context, appo);
break;
case 10: case 10:
confirmAppointment(appo); confirmAppointment(appo);
break; break;
case 15:
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingPaymentPending);
break;
case 20: case 20:
// getPatientShare(context, appo); getPatientShare(context, appo);
checkPatientNphiesEligibility(context, appo); // checkPatientNphiesEligibility(context, appo);
break; break;
case 30: case 30:
getAppoQR(context, appo); getAppoQR(context, appo);
@ -829,6 +842,10 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
}); });
} }
dataLoaded = true; dataLoaded = true;
if (widget.isFromMyAppointments) {
performNextAction(widget.appointment);
widget.isFromMyAppointments = false;
}
}); });
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
@ -838,7 +855,19 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
err != null ?? AppToast.showErrorToast(message: err); err != null ?? AppToast.showErrorToast(message: err);
}); });
// getAncillaryOrders(); getToDoCount();
}
getToDoCount() {
toDoProvider.setState(0, true, "0");
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {}
}).catchError((err) {
print(err);
});
} }
checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) { checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) {
@ -889,6 +918,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
String errorMsg = "";
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) { if (appo.isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo); getLiveCareAppointmentPatientShare(context, service, appo);
@ -896,8 +926,35 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); if (res['OnlineCheckInAppointments'].length != 0) {
openPaymentDialog(appo, widget.patientShareResponse); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
}
isInsured = res["IsInsured"];
isEligible = res["IsEligible"];
isCash = res["IsCash"];
if (isCash) {
openPaymentDialog(appo, widget.patientShareResponse);
} else {
if (isInsured && isEligible) {
openPaymentDialog(appo, widget.patientShareResponse);
} else {
if (isInsured && !isEligible) {
errorMsg = TranslationBase.of(context).invalidEligibility;
} else {
errorMsg = TranslationBase.of(context).invalidInsurance;
}
ConfirmDialog dialog = new ConfirmDialog(
isDissmissable: false,
context: context,
confirmMessage: errorMsg,
okText: TranslationBase.of(context).updateInsuranceText,
cancelText: TranslationBase.of(context).continueCash,
okFunction: () => {openUpdateInsurance()},
cancelFunction: () => {continueAsCash(appo)});
dialog.showAlertDialog(context);
}
}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);
@ -932,23 +989,23 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
patientShareResponse.projectID = appo.projectID; patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup; patientShareResponse.isFollowup = appo.isFollowup;
FlutterNfcKit.nfcAvailability.then((value) { // FlutterNfcKit.nfcAvailability.then((value) {
if (value == NFCAvailability.available) { // if (value == NFCAvailability.available) {
PatientShareResponse patientShareResponse = new PatientShareResponse(); // PatientShareResponse patientShareResponse = new PatientShareResponse();
patientShareResponse.doctorNameObj = appo.doctorNameObj; patientShareResponse.doctorNameObj = appo.doctorNameObj;
patientShareResponse.doctorSpeciality = appo.doctorSpeciality; patientShareResponse.doctorSpeciality = appo.doctorSpeciality;
patientShareResponse.projectName = appo.projectName; patientShareResponse.projectName = appo.projectName;
patientShareResponse.appointmentDate = appo.appointmentDate; patientShareResponse.appointmentDate = appo.appointmentDate;
patientShareResponse.appointmentNo = appo.appointmentNo; patientShareResponse.appointmentNo = appo.appointmentNo;
patientShareResponse.clinicID = appo.clinicID; patientShareResponse.clinicID = appo.clinicID;
patientShareResponse.projectID = appo.projectID; patientShareResponse.projectID = appo.projectID;
patientShareResponse.isFollowup = appo.isFollowup; patientShareResponse.isFollowup = appo.isFollowup;
navigateToQR(context, "", patientShareResponse, appo); navigateToQR(context, "", patientShareResponse, appo);
projectViewModel.analytics.todoList.to_do_list_check_in(appo); projectViewModel.analytics.todoList.to_do_list_check_in(appo);
} else { // } else {
Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported); // Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
} // }
}); // });
projectViewModel.analytics.todoList.to_do_list_check_in(appo); projectViewModel.analytics.todoList.to_do_list_check_in(appo);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
@ -972,7 +1029,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0), transform: Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity( child: Opacity(
opacity: a1.value, opacity: a1.value,
child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse), child: PaymentDialog(appo: appo, patientShareResponse: patientShareResponse, isCashPatient: isCash),
), ),
); );
}, },
@ -994,9 +1051,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
widget.browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
@ -1007,7 +1064,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
authenticatedUser.firstName, authenticatedUser.firstName,
authenticatedUser.patientID, authenticatedUser.patientID,
authenticatedUser, authenticatedUser,
widget.browser, browser,
appo.isLiveCareAppointment, appo.isLiveCareAppointment,
"2", "2",
appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "", appo.isLiveCareAppointment ? widget.patientShareResponse.clinicID.toString() : "",
@ -1038,7 +1095,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
// if(selectedPaymentMethod != "TAMARA") { // if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.successURLS.forEach((element) { MyInAppBrowser.successURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); browser.close();
MyInAppBrowser.isPaymentDone = true; MyInAppBrowser.isPaymentDone = true;
return; return;
} }
@ -1048,7 +1105,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
// if(selectedPaymentMethod != "TAMARA") { // if(selectedPaymentMethod != "TAMARA") {
MyInAppBrowser.errorURLS.forEach((element) { MyInAppBrowser.errorURLS.forEach((element) {
if (url.contains(element)) { if (url.contains(element)) {
if (widget.browser.isOpened()) widget.browser.close(); browser.close();
MyInAppBrowser.isPaymentDone = false; MyInAppBrowser.isPaymentDone = false;
return; return;
} }
@ -1181,7 +1238,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
String paymentReference = res['Fort_id'].toString(); String paymentReference = res['Fort_id'].toString();
service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) { service.createAdvancePayment(appo, appo.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, appo.appointmentNo.toString(), appo, res['OnlineCheckInAppointments'][0]); addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, appo.projectID)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
appo.appointmentNo.toString(),
appo,
res['OnlineCheckInAppointments'][0]);
}).catchError((err) { }).catchError((err) {
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);

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

@ -218,17 +218,17 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
inputWidget(TranslationBase.of(context).subject, "", titleController), inputWidget(TranslationBase.of(context).subject, "", titleController),
SizedBox(height: 12), SizedBox(height: 12),
inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async { inputWidget(TranslationBase.of(context).message, "", messageController, lines: 11, suffixTap: () async {
// if (Platform.isAndroid) { if (Platform.isAndroid) {
// if (await PermissionService.isMicrophonePermissionEnabled()) { if (await PermissionService.isMicrophonePermissionEnabled()) {
// openSpeechReco(); openSpeechReco();
// } else { } else {
// Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () { Utils.showPermissionConsentDialog(context, TranslationBase.of(context).recordAudioPermission, () {
// openSpeechReco(); openSpeechReco();
// }); });
// } }
// } else { } else {
// openSpeechReco(); openSpeechReco();
// } }
}), }),
SizedBox(height: 12), SizedBox(height: 12),
InkWell( InkWell(
@ -340,7 +340,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
}); });
} }
}, },
color: (titleController.text.toString().isEmpty || messageController.text.toString().isEmpty) ? Color(0xffEAEAEA) : Color(0xffD02127), color: Color(0xffD02127),
textColor: Colors.white, textColor: Colors.white,
disabledColor: Color(0xffEAEAEA), disabledColor: Color(0xffEAEAEA),
), ),
@ -405,8 +405,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
color: Color(0xff575757), color: Color(0xff575757),
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
// suffixIconConstraints: BoxConstraints(minWidth: 50), suffixIconConstraints: BoxConstraints(minWidth: 50),
// suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap), suffixIcon: suffixTap == null ? null : IconButton(icon: Icon(Icons.mic, color: Color(0xff2E303A)), onPressed: suffixTap),
contentPadding: EdgeInsets.zero, contentPadding: EdgeInsets.zero,
border: InputBorder.none, border: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
@ -517,25 +517,25 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
return; return;
} }
// openSpeechReco() async { openSpeechReco() async {
// new RoboSearch(context: context).showAlertDialog(context); new RoboSearch(context: context).showAlertDialog(context);
// _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode; _currentLocaleId = TranslationBase.of(AppGlobal.context).locale.languageCode;
// bool available = await speech.initialize(onStatus: statusListener, onError: errorListener); // bool available = await speech.initialize(onStatus: statusListener, onError: errorListener);
// if (available) { // if (available) {
// speech.listen( // speech.listen(
// onResult: resultListener, // onResult: resultListener,
// listenMode: stt.ListenMode.confirmation, // listenMode: stt.ListenMode.confirmation,
// localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', // localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
// ); // );
// } else { // } else {
// print("The user has denied the use of speech recognition."); // print("The user has denied the use of speech recognition.");
// } // }
// } }
//
// void errorListener(SpeechRecognitionError error) { // void errorListener(SpeechRecognitionError error) {
// event.setValue({"searchText": 'null'}); // event.setValue({"searchText": 'null'});
// //SpeechToText.closeAlertDialog(context); // SpeechToText.closeAlertDialog(context);
// print(error); // print(error);
// } // }
void statusListener(String status) { void statusListener(String status) {
@ -561,9 +561,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
} }
} }
// Future<void> initSpeechState() async { Future<void> initSpeechState() async {
// bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener); // bool hasSpeech = await speech.initialize(onError: errorListener, onStatus: statusListener);
// print(hasSpeech); // print(hasSpeech);
// if (!mounted) return; // if (!mounted) return;
// } }
} }

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

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

@ -59,9 +59,9 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
isScrollable: false, isScrollable: false,
indicatorWeight: 3.0, indicatorWeight: 3.0,
indicatorColor: CustomColors.accentColor, indicatorColor: CustomColors.accentColor,
labelColor: Theme.of(context).primaryColor, labelColor: CustomColors.textDarkColor,
labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0), labelPadding: EdgeInsets.symmetric(horizontal: 13.0, vertical: 2.0),
unselectedLabelColor: Colors.grey, unselectedLabelColor: CustomColors.textDarkColor,
tabs: <Widget>[ tabs: <Widget>[
Container( Container(
child: Center( child: Center(
@ -167,7 +167,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate> with SingleTickerProv
Container( Container(
margin: EdgeInsets.only(top: 6.5, left: 2.0), margin: EdgeInsets.only(top: 6.5, left: 2.0),
child: Text( child: Text(
model.insuranceUpdate[index].statusDescription, model.insuranceUpdate[index].statusDescription ?? "",
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,

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

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

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

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

@ -102,25 +102,25 @@ class _clinic_listState extends State<ClinicList> {
}); });
} }
}); });
getLanguageID();
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
getLanguageID();
return Container( return Container(
child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(), child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(),
); );
} }
void startLiveCare() { void startLiveCare() {
int languageID = projectViewModel.isArabic ? 1 : 2;
bool isError = false; bool isError = false;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse(); ERAppointmentFeesResponse erAppointmentFeesResponse = new ERAppointmentFeesResponse();
service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { service.getERAppointmentFees(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['HasAppointment'] == true) { if (res['HasAppointment'] == true) {
isError = true; isError = true;
@ -183,9 +183,10 @@ class _clinic_listState extends State<ClinicList> {
} }
getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) { getERAppointmentTime(GetERAppointmentFeesList getERAppointmentFeesList) {
int languageID = projectViewModel.isArabic ? 1 : 2;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, context).then((res) { service.getERAppointmentTime(selectedClinicID, widget.isPharmacyLiveCare, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']); showLiveCarePaymentDialog(getERAppointmentFeesList, res['WatingtimeInteger']);
}).catchError((err) { }).catchError((err) {
@ -504,7 +505,8 @@ class _clinic_listState extends State<ClinicList> {
} }
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); languageID = projectViewModel.isArabic ? "ar" : "en";
// languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
} }
getLiveCareClinicsList() { getLiveCareClinicsList() {
@ -757,11 +759,12 @@ class _clinic_listState extends State<ClinicList> {
} }
void startScheduleLiveCare() { void startScheduleLiveCare() {
int languageID = projectViewModel.isArabic ? 1 : 2;
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List(); List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = List();
service.getLiveCareScheduledDoctorList(context, selectedClinicID).then((res) { service.getLiveCareScheduledDoctorList(context, selectedClinicID, languageID).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

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

@ -256,7 +256,7 @@ class _Login extends State<Login> {
sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
authService.checkPatientAuthentication(request).then((value) { authService.checkPatientAuthentication(request).then((value) {
if (value['UserAccountIsActivated']) { // if (value['UserAccountIsActivated']) {
if (value['isSMSSent']) { if (value['isSMSSent']) {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']); sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']);
sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request);
@ -267,17 +267,17 @@ class _Login extends State<Login> {
this.checkActivationCode(); this.checkActivationCode();
} }
} }
} else { // } else {
ConfirmDialog activationDialog = new ConfirmDialog( // ConfirmDialog activationDialog = new ConfirmDialog(
context: context, // context: context,
confirmMessage: TranslationBase.of(context).accountDeactivatedMsg, // confirmMessage: TranslationBase.of(context).accountDeactivatedMsg,
okText: TranslationBase.of(context).yes, // okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no, // cancelText: TranslationBase.of(context).no,
okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()}, // okFunction: () => {ConfirmDialog.closeAlertDialog(context), this.activatePatientFile()},
cancelFunction: () => {}); // cancelFunction: () => {});
GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
activationDialog.showAlertDialog(context); // activationDialog.showAlertDialog(context);
} // }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
@ -345,34 +345,45 @@ class _Login extends State<Login> {
authenticatedUserObject.user = result.list; authenticatedUserObject.user = result.list;
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
appointmentRateViewModel GifLoaderDialogUtils.hideDialog(context);
.getIsLastAppointmentRatedList()
.then((value) => { getToDoCount();
getToDoCount(),
GifLoaderDialogUtils.hideDialog(context), Navigator.pushAndRemoveUntil(
if (appointmentRateViewModel.isHaveAppointmentNotRate) context,
{ FadePage(
Navigator.pushAndRemoveUntil( page: LandingPage(),
context, ),
FadePage( (r) => false);
page: RateAppointmentDoctor(),
), // appointmentRateViewModel
(r) => false) // .getIsLastAppointmentRatedList()
} // .then((value) => {
else // getToDoCount(),
{ // GifLoaderDialogUtils.hideDialog(context),
Navigator.pushAndRemoveUntil( // if (appointmentRateViewModel.isHaveAppointmentNotRate)
context, // {
FadePage( // Navigator.pushAndRemoveUntil(
page: LandingPage(), // context,
), // FadePage(
(r) => false) // page: RateAppointmentDoctor(),
} // ),
}) // (r) => false)
.catchError((err) { // }
print(err); // else
GifLoaderDialogUtils.hideDialog(context); // {
}); // Navigator.pushAndRemoveUntil(
// context,
// FadePage(
// page: LandingPage(),
// ),
// (r) => false)
// }
// })
// .catchError((err) {
// print(err);
// GifLoaderDialogUtils.hideDialog(context);
// });
}); });
} }

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

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.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/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -22,7 +23,7 @@ class AllergiesPage extends StatelessWidget {
baseViewModel: model, baseViewModel: model,
description: TranslationBase.of(context).infoAllergies, description: TranslationBase.of(context).infoAllergies,
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
body: ListView.builder( body: model.allergies.isNotEmpty ? ListView.builder(
itemCount: model.allergies.length, itemCount: model.allergies.length,
itemBuilder: (context, index) => Container( itemBuilder: (context, index) => Container(
margin: EdgeInsets.all(15), margin: EdgeInsets.all(15),
@ -54,7 +55,7 @@ class AllergiesPage extends StatelessWidget {
], ],
), ),
), ),
), ) : getNoDataWidget(context),
), ),
); );
} }

@ -60,6 +60,7 @@ class AskDoctorPage extends StatelessWidget {
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
DoctorList _doctor = _doctorList[_index]; DoctorList _doctor = _doctorList[_index];
DoctorList doctorList = DoctorList( DoctorList doctorList = DoctorList(
date: _doctor.date,
projectID: _doctor.projectID, projectID: _doctor.projectID,
setupID: _doctor.setupID, setupID: _doctor.setupID,
clinicID: _doctor.clinicID, clinicID: _doctor.clinicID,

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/ask_doctor_view_mod
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; 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/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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';
@ -27,7 +28,7 @@ class DoctorResponse extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
height: 65, height: 16,
), ),
AppExpandableNotifier( AppExpandableNotifier(
headerWidget: Padding( headerWidget: Padding(
@ -61,14 +62,18 @@ class DoctorResponse extends StatelessWidget {
return InkWell( return InkWell(
onTap: () { onTap: () {
///go to page ViewDoctorResponsesPage ///go to page ViewDoctorResponsesPage
Navigator.push( if (doctor.transactions != null && doctor.transactions.isNotEmpty) {
context, Navigator.push(
FadePage( context,
page: ViewDoctorResponsesPage( FadePage(
doctorResponse: doctor, page: ViewDoctorResponsesPage(
doctorResponse: doctor,
),
), ),
), );
); } else {
Utils.showErrorToast("There are no doctor responses for this request.");
}
}, },
child: Container( child: Container(
height: 100, height: 100,

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

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

@ -468,7 +468,13 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType, service.HIS_createAdvancePayment(appo, widget.advanceModel.hospitalsModel.iD.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], widget.patientInfoAndMobileNumber.patientType,
widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context) widget.advanceModel.patientName, widget.advanceModel.fileNumber, AppGlobal.context)
.then((res) { .then((res) {
addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, widget.advanceModel.hospitalsModel.iD)
? res['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString()
: res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(),
paymentReference,
0,
appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
AppToast.showErrorToast(message: err); AppToast.showErrorToast(message: err);

@ -106,7 +106,7 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
Text( Text(
TranslationBase.of(context).sar, projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -157,7 +157,7 @@ class MyBalancePage extends StatelessWidget {
), ),
), ),
Text( Text(
amount.toStringAsFixed(2) + " " + TranslationBase.of(context).sar, amount.toStringAsFixed(2) + " " + (projectViewModel.user.outSA == 1 ? TranslationBase.of(context).aed : TranslationBase.of(context).sar),
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
letterSpacing: -0.64, letterSpacing: -0.64,

@ -1,13 +1,22 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/labs_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; 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/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/LabResult/laboratory_result_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:open_filex/open_filex.dart';
import 'package:path_provider/path_provider.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class LaboratoryResultPage extends StatefulWidget { class LaboratoryResultPage extends StatefulWidget {
@ -25,11 +34,14 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLaboratoryResult( onModelReady: (model) => model.getLaboratoryResult(
invoiceNo: widget.patientLabOrders.invoiceNo, invoiceNo: widget.patientLabOrders.invoiceNo,
clinicID: widget.patientLabOrders.clinicID, invoiceType: widget.patientLabOrders.invoiceType,
projectID: widget.patientLabOrders.projectID, clinicID: widget.patientLabOrders.clinicID,
orderNo: widget.patientLabOrders.orderNo, projectID: widget.patientLabOrders.projectID,
setupID: widget.patientLabOrders.setupID), orderNo: widget.patientLabOrders.orderNo,
setupID: widget.patientLabOrders.setupID,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)),
),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.patientLabOrders.doctorName, appBarTitle: widget.patientLabOrders.doctorName,
@ -37,27 +49,73 @@ class _LaboratoryResultPageState extends State<LaboratoryResultPage> {
showNewAppBar: true, showNewAppBar: true,
showNewAppBarTitle: true, showNewAppBarTitle: true,
backgroundColor: Color(0xffF8F8F8), backgroundColor: Color(0xffF8F8F8),
body: ListView.builder( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), child: Column(
padding: EdgeInsets.only(bottom: 12), children: [
itemBuilder: (context, index) => LaboratoryResultWidget( ListView.builder(
onTap: () async { physics: BouncingScrollPhysics(),
GifLoaderDialogUtils.showMyDialog(context); shrinkWrap: true,
await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user); padding: EdgeInsets.only(bottom: 12),
GifLoaderDialogUtils.hideDialog(context); itemBuilder: (context, index) => LaboratoryResultWidget(
}, onTap: () async {
billNo: widget.patientLabOrders.invoiceNo, GifLoaderDialogUtils.showMyDialog(context);
// details: model.patientLabSpecialResult[index].resultDataHTML, await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)));
details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model), GifLoaderDialogUtils.hideDialog(context);
orderNo: widget.patientLabOrders.orderNo, },
patientLabOrder: widget.patientLabOrders, billNo: widget.patientLabOrders.invoiceNo,
// details: model.patientLabSpecialResult[index].resultDataHTML,
details: model.patientLabSpecialResult.isEmpty ? null : getSpecialResults(model),
orderNo: widget.patientLabOrders.orderNo,
patientLabOrder: widget.patientLabOrders,
),
itemCount: 1,
),
SizedBox(
height: 120.0,
)
],
), ),
itemCount: 1,
), ),
// bottomSheet: Container(
// color: Colors.white,
// height: MediaQuery.of(context).size.height * 0.081,
// width: double.infinity,
// padding: EdgeInsets.all(12.0),
// child: Column(
// children: <Widget>[
// Container(
// width: MediaQuery.of(context).size.width * 0.9,
// child: DefaultButton(
// TranslationBase.of(context).downloadReport,
// () async {
// GifLoaderDialogUtils.showMyDialog(context);
// await model.sendLabReportEmail(patientLabOrder: widget.patientLabOrders, mes: TranslationBase.of(context).sendSuc, userObj: projectViewModel.user, isVidaPlus: Utils.isVidaPlusProject(projectViewModel, num.parse(widget.patientLabOrders.projectID)), isDownload: true);
// GifLoaderDialogUtils.hideDialog(context);
// try {
// String path = await _createFileFromString(model.labReportPDF, "pdf");
// OpenFilex.open(path);
// } catch (ex) {
// AppToast.showErrorToast(message: "Cannot open file.");
// }
// },
// textColor: Colors.white,
// ),
// ),
// ],
// ),
// ),
), ),
); );
} }
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;
}
String getSpecialResults(LabsViewModel model) { String getSpecialResults(LabsViewModel model) {
String labResults = ""; String labResults = "";
model.patientLabSpecialResult.forEach((element) { model.patientLabSpecialResult.forEach((element) {

@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/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/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
@ -49,7 +50,7 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
backgroundColor: Color(0xffF7F7F7), backgroundColor: Color(0xffF7F7F7),
imagesInfo: imagesInfo, imagesInfo: imagesInfo,
baseViewModel: model, baseViewModel: model,
body: 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),
@ -69,7 +70,7 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
showConfirmMessage(model, index); showConfirmMessage(model, index);
}, },
), ),
), ) : getNoDataWidget(context),
), ),
); );
} }

@ -1,12 +1,12 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart'; import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/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/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/uitl/utils_new.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
@ -19,14 +19,20 @@ import 'package:url_launcher/url_launcher.dart';
class RadiologyDetailsPage extends StatelessWidget { class RadiologyDetailsPage extends StatelessWidget {
final FinalRadiology finalRadiology; final FinalRadiology finalRadiology;
bool isRadiologyVidaPlus;
RadiologyDetailsPage({Key key, this.finalRadiology}); RadiologyDetailsPage({Key key, this.finalRadiology, this.isRadiologyVidaPlus});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>( return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(projectId: finalRadiology.projectID, lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), onModelReady: (model) => model.getRadImageURL(
invoiceType: finalRadiology.invoiceType,
projectId: finalRadiology.projectID,
lineItem: finalRadiology.invoiceLineItemNo,
invoiceNo: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP : finalRadiology.invoiceNo,
isVidaPlus: Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID)),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).report, appBarTitle: TranslationBase.of(context).report,
isShowAppBar: true, isShowAppBar: true,
@ -45,7 +51,7 @@ class RadiologyDetailsPage extends StatelessWidget {
finalRadiology.doctorID, finalRadiology.doctorID,
finalRadiology.doctorImageURL, finalRadiology.doctorImageURL,
finalRadiology.speciality, finalRadiology.speciality,
finalRadiology.invoiceNo.toString(), Utils.isVidaPlusProject(projectViewModel, finalRadiology.projectID) ? finalRadiology.invoiceNo_VP.toString() : finalRadiology.invoiceNo.toString(),
finalRadiology.projectName, finalRadiology.projectName,
finalRadiology.orderDate, finalRadiology.orderDate,
null, null,

@ -6,6 +6,7 @@ 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/pages/medical/radiology/radiology_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/radiology/radiology_details_page.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/widgets/data_display/medical/doctor_card.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.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';
@ -78,12 +79,14 @@ class RadiologyHomePage extends StatelessWidget {
FadePage( FadePage(
page: RadiologyDetailsPage( page: RadiologyDetailsPage(
finalRadiology: radiology, finalRadiology: radiology,
isRadiologyVidaPlus: Utils.isVidaPlusProject(projectViewModel, radiology.projectID),
), ),
), ),
), ),
isInOutPatient: radiology.isInOutPatient, isInOutPatient: radiology.isInOutPatient,
name: TranslationBase.of(context).dr + " " + radiology.doctorName, name: TranslationBase.of(context).dr + " " + radiology.doctorName,
billNo: radiology.invoiceNo.toString(), billNo: Utils.isVidaPlusProject(projectViewModel, radiology.projectID) ? radiology.invoiceNo_VP.toString() : radiology.invoiceNo.toString(),
// billNo: radiology.invoiceNo_VP.toString(),
profileUrl: radiology.doctorImageURL, profileUrl: radiology.doctorImageURL,
subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription, subName: _isSortByClinic ? radiology.projectName : radiology.clinicDescription,
isLiveCareAppointment: radiology.isLiveCareAppointment, isLiveCareAppointment: radiology.isLiveCareAppointment,

@ -70,74 +70,73 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
body: Container( body: Container(
child: Column( child: Column(
children: [ children: [
TabBar( // TabBar(
controller: _tabController_new, // controller: _tabController_new,
indicatorWeight: 3.0, // indicatorWeight: 3.0,
indicatorSize: TabBarIndicatorSize.tab, // indicatorSize: TabBarIndicatorSize.tab,
labelColor: Color(0xff2B353E), // labelColor: Color(0xff2B353E),
unselectedLabelColor: Color(0xff575757), // unselectedLabelColor: Color(0xff575757),
labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), // labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20),
labelStyle: TextStyle( // labelStyle: TextStyle(
fontSize: 16, // fontSize: 16,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
letterSpacing: -0.48, // letterSpacing: -0.48,
), // ),
unselectedLabelStyle: TextStyle( // unselectedLabelStyle: TextStyle(
fontSize: 16, // fontSize: 16,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
letterSpacing: -0.48, // letterSpacing: -0.48,
), // ),
onTap: (int value) { // onTap: (int value) {
print(value); // print(value);
setState(() {}); // setState(() {});
}, // },
tabs: [ // tabs: [
Text( // Text(
TranslationBase.of(context).outpatient, // TranslationBase.of(context).outpatient,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), // ),
Text( // Text(
TranslationBase.of(context).inPatient, // TranslationBase.of(context).inPatient,
style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'), // style: TextStyle(fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins'),
), // ),
], // ],
), // ),
if (model.user != null) if (model.user != null)
Expanded( Expanded(
child: child: TabBarView(
TabBarView( physics: BouncingScrollPhysics(),
physics: BouncingScrollPhysics(), controller: _tabController_new,
controller: _tabController_new, children: <Widget>[
children: <Widget>[
Container( Container(
child: Column( child: Column(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.all(21), padding: EdgeInsets.all(21),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
myRadioButton(TranslationBase.of(context).requested, 0), myRadioButton(TranslationBase.of(context).requested, 0),
myRadioButton(TranslationBase.of(context).ready, 1), myRadioButton(TranslationBase.of(context).ready, 1),
myRadioButton(TranslationBase.of(context).cancelled, 2), myRadioButton(TranslationBase.of(context).cancelled, 2),
], ],
), ),
),
Expanded(
child: IndexedStack(
index: _currentPage,
children: [
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
],
),
)
],
), ),
Expanded( ),
child: IndexedStack( // InPatient Medical Reports
index: _currentPage, Container(
children: [
ReportListWidget(reportList: model.reportsOrderRequestList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderReadyList, emailAddress: model.user.emailAddress),
ReportListWidget(reportList: model.reportsOrderCanceledList, emailAddress: model.user.emailAddress),
],
),
)
],
),
),
// InPatient Medical Reports
Container(
child: model.admissionsMedicalReportList.isNotEmpty child: model.admissionsMedicalReportList.isNotEmpty
? Column( ? Column(
children: [ children: [
@ -249,20 +248,21 @@ class _HomeReportPageState extends State<HomeReportPage> with SingleTickerProvid
if (projectViewModel.havePrivilege(21) if (projectViewModel.havePrivilege(21)
// && _tabController_new.index == 0 // && _tabController_new.index == 0
) )
Padding( if (_tabController_new.index == 0)
padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), Padding(
child: DefaultButton( padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21),
TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach, child: DefaultButton(
() => Navigator.push( TranslationBase.of(context).requestMedicalReport.toLowerCase().capitalizeFirstofEach,
context, () => Navigator.push(
FadePage( context,
page: MedicalReports(), FadePage(
), page: MedicalReports(),
).then((value) { ),
model.getReports(); ).then((value) {
}), model.getReports();
), }),
) ),
)
], ],
), ),
), ),

@ -117,23 +117,23 @@ class ReportListWidget extends StatelessWidget {
if (reportList[index].status == 2) if (reportList[index].status == 2)
Row( Row(
children: [ children: [
InkWell( // InkWell(
onTap: () { // onTap: () {
getMedicalReportPDF(report); // getMedicalReportPDF(report);
}, // },
child: Padding( // child: Padding(
padding: const EdgeInsets.only(right: 11.0, left: 11.0), // padding: const EdgeInsets.only(right: 11.0, left: 11.0),
child: Text(TranslationBase.of(context).viewReport, // child: Text(TranslationBase.of(context).viewReport,
style: TextStyle( // style: TextStyle(
fontSize: 12, // fontSize: 12,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
fontStyle: FontStyle.italic, // fontStyle: FontStyle.italic,
color: CustomColors.accentColor, // color: CustomColors.accentColor,
letterSpacing: -0.48, // letterSpacing: -0.48,
height: 18 / 12, // height: 18 / 12,
decoration: TextDecoration.underline)), // decoration: TextDecoration.underline)),
), // ),
), // ),
IconButton( IconButton(
icon: Icon(Icons.email), icon: Icon(Icons.email),
color: Color(0xff28323A), color: Color(0xff28323A),

@ -1,4 +1,4 @@
import 'package:badges/badges.dart'; import 'package:badges/badges.dart' as badge_import;
import 'package:diplomaticquarterapp/Constants.dart'; import 'package:diplomaticquarterapp/Constants.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
@ -95,11 +95,11 @@ class PaymentService extends StatelessWidget {
? Positioned( ? Positioned(
left: 8, left: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
@ -111,11 +111,11 @@ class PaymentService extends StatelessWidget {
: Positioned( : Positioned(
right: 8, right: 8,
top: 4, top: 4,
child: Badge( child: badge_import.Badge(
toAnimate: false, toAnimate: false,
elevation: 0, elevation: 0,
position: BadgePosition.topEnd(), position: badge_import.BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: badge_import.BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(

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

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

@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.d
import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart'; import 'package:diplomaticquarterapp/models/Appointments/laser_body_parts.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -33,7 +34,7 @@ class DoctorsListService extends BaseService {
String tokenID; String tokenID;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async { Future<Map> getDoctorsList(int clinicID, int projectID, bool isNearest, int languageID, BuildContext context, {doctorId, doctorName, isContinueDentalPlan = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -46,17 +47,16 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); // Request req = appGlobal.getPublicRequest();
Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2, //
"IPAdress": "10.20.10.20", // "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, // "VersionID": req.VersionID,
"Channel": req.Channel, // "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', // "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
"TokenID": "", "TokenID": "",
"DeviceTypeID": req.DeviceTypeID, // "DeviceTypeID": req.DeviceTypeID,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
@ -74,6 +74,7 @@ class DoctorsListService extends BaseService {
"Longitude": long != null ? long.toString() : 0, "Longitude": long != null ? long.toString() : 0,
"isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan, "isDentalAllowedBackend": clinicID == 17 ? true : isContinueDentalPlan,
"IsGetNearAppointment": isNearest, "IsGetNearAppointment": isNearest,
"LanguageID": languageID,
if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()), if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()),
"License": true "License": true
}; };
@ -88,7 +89,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorsListByName(String docName, BuildContext context) async { Future<Map> getDoctorsListByName(String docName, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
double lat; double lat;
@ -104,10 +105,8 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -128,6 +127,7 @@ class DoctorsListService extends BaseService {
"IsGetNearAppointment": false, "IsGetNearAppointment": false,
"Latitude": lat == null ? 0.0 : lat, "Latitude": lat == null ? 0.0 : lat,
"Longitude": long == null ? 0.0 : long, "Longitude": long == null ? 0.0 : long,
"LanguageID": languageID,
"License": true "License": true
}; };
@ -141,12 +141,11 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, context) async { Future<Map> getDoctorsProfile(int docID, int clinicID, int projectID, int languageID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -161,7 +160,8 @@ class DoctorsListService extends BaseService {
"License": true, "License": true,
"IsRegistered": true, "IsRegistered": true,
"ProjectID": projectID, "ProjectID": projectID,
"isDentalAllowedBackend": false "isDentalAllowedBackend": false,
"LanguageID": languageID,
}; };
dynamic localRes; dynamic localRes;
@ -176,10 +176,9 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsRating(int docID, context) async { Future<Map> getDoctorsRating(int docID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -227,10 +226,9 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsRatingDetails(int docID, context) async { Future<Map> getDoctorsRatingDetails(int docID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
@ -258,7 +256,7 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async { Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"DoctorID": docID, "DoctorID": docID,
@ -270,7 +268,6 @@ class DoctorsListService extends BaseService {
"isReschadual": false, "isReschadual": false,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": 3, "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,
@ -301,7 +298,7 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async { Future<Map> getDoctorScheduledFreeSlots(int docID, int clinicID, int projectID, int serviceID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"DoctorID": docID, "DoctorID": docID,
@ -314,7 +311,6 @@ class DoctorsListService extends BaseService {
"isReschadual": false, "isReschadual": false,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": 3, "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -342,7 +338,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsForLiveCare": false, "IsForLiveCare": false,
@ -366,7 +361,6 @@ class DoctorsListService extends BaseService {
"Age": authUser.age != null ? authUser.age : 0, "Age": authUser.age != null ? authUser.age : 0,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -406,7 +400,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsForLiveCare": true, "IsForLiveCare": true,
@ -429,7 +422,6 @@ class DoctorsListService extends BaseService {
"GenderID": authUser.gender, "GenderID": authUser.gender,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -459,7 +451,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -469,7 +460,6 @@ class DoctorsListService extends BaseService {
"IsActiveAppointment": true, "IsActiveAppointment": true,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -484,7 +474,7 @@ class DoctorsListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_PATIENT_SHARE, onSuccess: (response, statusCode) async {
localRes = response['OnlineCheckInAppointments'][0]; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
@ -518,7 +508,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -529,7 +518,6 @@ class DoctorsListService extends BaseService {
"IsForLiveCare": true, "IsForLiveCare": true,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -559,17 +547,9 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {"ProjectID": 15, "DeviceTypeID": req.DeviceTypeID, "PatientID": authUser.patientID, "PatientTypeID": authUser.patientType, "PatientType": authUser.patientType};
"LanguageID": languageID == 'ar' ? 1 : 2,
"ProjectID": 15,
"DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType,
"PatientType": authUser.patientType
};
dynamic localRes; dynamic localRes;
@ -589,11 +569,9 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"ProjectID": projectID, "ProjectID": projectID,
"SetupID": setupID, "SetupID": setupID,
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
@ -613,6 +591,19 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getPatientAppointmentHistoryWithAppoNo(int appoNo, int languageID) async {
Map<String, dynamic> request;
request = {"IsActiveAppointment": true, "AppointmentNo": appoNo, "IsComingFromCOC": false, "LanguageID": languageID};
dynamic localRes;
await baseAppClient.post(GET_PATIENT_APPOINTMENT_HISTORY, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async { Future<Map> getPatientAppointmentHistory(bool isActiveAppointment, BuildContext context, {bool isForCOC = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
@ -621,14 +612,12 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsActiveAppointment": isActiveAppointment, "IsActiveAppointment": isActiveAppointment,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
@ -652,14 +641,13 @@ class DoctorsListService extends BaseService {
Future<Map> getPatientAppointmentCurfewHistory(bool isActiveAppointment) async { Future<Map> getPatientAppointmentCurfewHistory(bool isActiveAppointment) async {
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsActiveAppointment": isActiveAppointment, "IsActiveAppointment": isActiveAppointment,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
@ -688,7 +676,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -699,7 +686,6 @@ class DoctorsListService extends BaseService {
"ConfirmationBy": 102, "ConfirmationBy": 102,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
@ -735,7 +721,6 @@ class DoctorsListService extends BaseService {
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -753,7 +738,6 @@ class DoctorsListService extends BaseService {
"DeviceType": req.DeviceType, "DeviceType": req.DeviceType,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -784,7 +768,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -801,7 +784,6 @@ class DoctorsListService extends BaseService {
"StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate), "StrAppointmentDate": DateUtil.getDateFormatted(appo.appointmentDate),
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -831,7 +813,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -841,7 +822,6 @@ class DoctorsListService extends BaseService {
"IsFollowup": patientShareResponse.isFollowup, "IsFollowup": patientShareResponse.isFollowup,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -871,7 +851,6 @@ class DoctorsListService extends BaseService {
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -884,7 +863,6 @@ class DoctorsListService extends BaseService {
"To": to, "To": to,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -912,14 +890,13 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"ClientRequestID": transactionID, "ClientRequestID": transactionID,
"IsPharmacy": isPharma, "IsPharmacy": isPharma,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -957,15 +934,15 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AdvanceNumber": advanceNumber, "AdvanceNumber": advanceNumber,
"AdvanceNumber_VP": advanceNumber,
"PaymentReferenceNumber": paymentReference, "PaymentReferenceNumber": paymentReference,
"AppointmentID": appointmentID, "AppointmentID": appointmentID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -991,7 +968,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AdvanceNumber": advanceNumber, "AdvanceNumber": advanceNumber,
@ -1006,7 +983,6 @@ class DoctorsListService extends BaseService {
"DeviceType": Platform.isIOS ? "iOS" : "Android", "DeviceType": Platform.isIOS ? "iOS" : "Android",
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1046,12 +1022,18 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); List<String> procedureOrderIDs = [];
selectedProcListAPI.forEach((element) {
procedureOrderIDs.add(element["ProcedureID"]);
});
request = { request = {
"RequestAncillaryOrderInvoice": [ "RequestAncillaryOrderInvoice": [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
] ],
"ProcedureOrderIds": procedureOrderIDs
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(GENERATE_ANCILLARY_ORDERS_INVOICE, onSuccess: (response, statusCode) async { await baseAppClient.post(GENERATE_ANCILLARY_ORDERS_INVOICE, onSuccess: (response, statusCode) async {
@ -1062,13 +1044,13 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> isAllowedToAskDoctor(int docID, BuildContext context) async { Future<Map> isAllowedToAskDoctor(int docID, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"IsForAskYourDoctor": true, "IsForAskYourDoctor": true,
@ -1076,9 +1058,9 @@ class DoctorsListService extends BaseService {
"Top": 25, "Top": 25,
"beforeDays": 15, "beforeDays": 15,
"exludType": 4, "exludType": 4,
"LanguageID": languageID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1099,18 +1081,17 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getCallRequestType(BuildContext context) async { Future<Map> getCallRequestType(int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1119,6 +1100,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1131,19 +1113,20 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, BuildContext context) async { Future<Map> sendAskDocCallRequest(AppoitmentAllHistoryResultList appo, String requestType, int languageID, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"ProjectID": appo.projectID, "ProjectID": appo.projectID,
"SetupID": appo.setupID, "SetupID": appo.setupID,
"DoctorID": appo.doctorID, "DoctorID": appo.doctorID,
"ClinicID": appo.clinicID,
"RequestType": requestType, "RequestType": requestType,
"RequestTypeID": requestType, "RequestTypeID": requestType,
"PatientMobileNumber": authUser.mobileNumber, "PatientMobileNumber": authUser.mobileNumber,
@ -1158,7 +1141,6 @@ class DoctorsListService extends BaseService {
"EditedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0], "EditedOn": DateUtil.getYearMonthDayHourMinSecDateFormatted(DateTime.now()).split(" ")[0],
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1167,6 +1149,7 @@ class DoctorsListService extends BaseService {
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"PatientID": authUser.patientID, "PatientID": authUser.patientID,
"PatientTypeID": authUser.patientType, "PatientTypeID": authUser.patientType,
"LanguageID": languageID,
"PatientType": authUser.patientType "PatientType": authUser.patientType
}; };
@ -1185,13 +1168,12 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appoNo, "AppointmentNo": appoNo,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1218,7 +1200,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appoNo, "AppointmentNo": appoNo,
@ -1226,7 +1208,6 @@ class DoctorsListService extends BaseService {
"ClinicID": clinicID, "ClinicID": clinicID,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1253,7 +1234,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appo.appointmentNo, "AppointmentNo": appo.appointmentNo,
@ -1263,7 +1244,6 @@ class DoctorsListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"SetupID": appo.setupID, "SetupID": appo.setupID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1290,7 +1270,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentDate": appoDate, "AppointmentDate": appoDate,
@ -1303,7 +1283,6 @@ class DoctorsListService extends BaseService {
"SetupID": setupId, "SetupID": setupId,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1330,7 +1309,7 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"ProjectID": projectID, "ProjectID": projectID,
@ -1348,7 +1327,6 @@ class DoctorsListService extends BaseService {
}, },
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1368,13 +1346,14 @@ class DoctorsListService extends BaseService {
} }
Future<Map> HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, Future<Map> HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType,
String patientName, dynamic patientID, BuildContext context) async { String patientName, dynamic patientID, BuildContext context,
{bool isAncillaryOrder = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
@ -1393,13 +1372,15 @@ class DoctorsListService extends BaseService {
"PaymentMethod": paymentMethodName, "PaymentMethod": paymentMethodName,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
"SessionID": "YckwoXhUmWBsnHKEKig", "SessionID": "YckwoXhUmWBsnHKEKig",
"isDentalAllowedBackend": false, "isDentalAllowedBackend": false,
"PatientTypeID": patientType, "PatientTypeID": patientType,
"IsAncillaryOrder": isAncillaryOrder,
// "AncillaryProcedureList": ancillaryOrdersProcedureList,
"PatientType": patientType "PatientType": patientType
}; };
dynamic localRes; dynamic localRes;
@ -1417,13 +1398,12 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1458,13 +1438,12 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1502,14 +1481,13 @@ class DoctorsListService extends BaseService {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
request = { request = {
"MedCategoryID": medCategoryId, "MedCategoryID": medCategoryId,
"MedGetStsID": medCategoryStsId, "MedGetStsID": medCategoryStsId,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": req.IPAdress, "IPAdress": req.IPAdress,
"generalid": req.generalid, "generalid": req.generalid,
"PatientOutSA": authUser.outSA, "PatientOutSA": authUser.outSA,
@ -1529,14 +1507,10 @@ class DoctorsListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, BuildContext context) async { Future<Map> sendCheckinNfcRequest(int appointmentNo, String nfcCode, int projectId, int checkInBy, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {"AppointmentNo": appointmentNo, "NFC_Code": nfcCode, "ProjectID": projectId, "CheckinBy": checkInBy};
"AppointmentNo": appointmentNo,
"NFC_Code": nfcCode,
"ProjectID": projectId,
};
dynamic localRes; dynamic localRes;
await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async { await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
@ -1801,7 +1775,6 @@ class DoctorsListService extends BaseService {
Map<String, dynamic> requestFreeSlots; Map<String, dynamic> requestFreeSlots;
Map<String, dynamic> request; Map<String, dynamic> request;
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); Request req = appGlobal.getPublicRequest();
requestFreeSlots = { requestFreeSlots = {
"DoctorID": docID, "DoctorID": docID,
@ -1813,7 +1786,6 @@ class DoctorsListService extends BaseService {
"isReschadual": false, "isReschadual": false,
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": 3, "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"PatientOutSA": authProvider.isLogin ? authUser.outSA : 0, "PatientOutSA": authProvider.isLogin ? authUser.outSA : 0,

@ -155,6 +155,7 @@ class AuthProvider with ChangeNotifier {
dynamic localRes; dynamic localRes;
Map<String, dynamic> request = {}; Map<String, dynamic> request = {};
request['IMEI'] = imei; request['IMEI'] = imei;
request['LanguageID'] = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isArabic ? 1 : 2;
await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { await new BaseAppClient().post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) {
localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]); localRes = SelectDeviceIMEIRES.fromJson(response['Patient_SELECTDeviceIMEIbyIMEIList'][0]);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
@ -247,7 +248,7 @@ class AuthProvider with ChangeNotifier {
return Future.value(localRes); return Future.value(localRes);
} }
Future<dynamic> checkActivationCode(request, [value]) async { Future<dynamic> checkActivationCode(request, [value]) async {
var neRequest = CheckActivationCodeReq.fromJson(request); var neRequest = CheckActivationCodeReq.fromJson(request);
neRequest.activationCode = value ?? "0000"; neRequest.activationCode = value ?? "0000";
@ -376,16 +377,14 @@ class AuthProvider with ChangeNotifier {
requestN.patientOutSA = requestN.patientobject.patientOutSA; requestN.patientOutSA = requestN.patientobject.patientOutSA;
final DateFormat dateFormat = DateFormat('MM/dd/yyyy'); final DateFormat dateFormat = DateFormat('MM/dd/yyyy');
final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy'); final DateFormat dateFormat2 = DateFormat('dd/MM/yyyy');
if(nhic !=null) { if (nhic != null) {
requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format( requestN.dob = nhic['IsHijri'] ? nhic['DateOfBirth'] : dateFormat2.format(dateFormat.parse(nhic['DateOfBirth']));
dateFormat.parse(nhic['DateOfBirth']));
requestN.isHijri = nhic['IsHijri'] ? 1 : 0; requestN.isHijri = nhic['IsHijri'] ? 1 : 0;
requestN.healthId = requestN.patientobject.eHealthIDField; requestN.healthId = requestN.patientobject.eHealthIDField;
} }
requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966'; requestN.zipCode = requestN.patientOutSA == 1 ? '971' : '966';
await sharedPref.remove(USER_PROFILE); await sharedPref.remove(USER_PROFILE);
dynamic localRes; dynamic localRes;

@ -18,19 +18,7 @@ class ClinicListService extends BaseService {
double long; double long;
Future<Map> getClinicsList(context) async { Future<Map> getClinicsList(context) async {
Map<String, dynamic> request; Map<String, dynamic> request = {};
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest();
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
dynamic localRes; dynamic localRes;
@ -44,22 +32,9 @@ class ClinicListService extends BaseService {
} }
Future<Map> getActiveAppointmentNo(context) async { Future<Map> getActiveAppointmentNo(context) async {
Map<String, dynamic> request; Map<String, dynamic> request = {};
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); request = {"IsActiveAppointment": true, "LanguageID": 1};
request = {
// "LanguageID": languageID == 'ar' ? 1 : 2,
// "IPAdress": "10.20.10.20",
// "VersionID": req.VersionID,
// "Channel": req.Channel,
// "generalid": 'Cs2020@2016\$2958',
// "PatientOutSA": user.outSA,
"IsActiveAppointment": true,
// "DeviceTypeID": req.DeviceTypeID,
// "PatientType": user.patientType,
// "PatientTypeID": user.patientType,
// "SessionID": null
};
dynamic localRes; dynamic localRes;
@ -71,20 +46,10 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getProjectsList(context) async { Future<Map> getProjectsList(int languageID, context) async {
Map<String, dynamic> request; Map<String, dynamic> request = {};
var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
Request req = appGlobal.getPublicRequest(); request = {"LanguageID": languageID};
request = {
"LanguageID": languageID == 'ar' ? 1 : 2,
"IPAdress": "10.20.10.20",
"VersionID": req.VersionID,
"Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958',
"TokenID": "",
"DeviceTypeID": req.DeviceTypeID,
"SessionID": null
};
dynamic localRes; dynamic localRes;
@ -96,7 +61,7 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintsList(int clinicID, int projectID, BuildContext context, {doctorId}) async { Future<Map> getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async {
//Utils.showProgressDialog(context); //Utils.showProgressDialog(context);
Map<String, dynamic> request; Map<String, dynamic> request;
@ -113,9 +78,9 @@ class ClinicListService extends BaseService {
"SelectedDate": "", "SelectedDate": "",
"SelectedTime": "", "SelectedTime": "",
"License": true, "License": true,
"VersionID": 5.6, // "VersionID": 5.6,
"Channel": 3, // "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID,
"IPAdress": "10.20.10.20", "IPAdress": "10.20.10.20",
"generalid": "Cs2020@2016\$2958", "generalid": "Cs2020@2016\$2958",
"SessionID": null, "SessionID": null,
@ -137,7 +102,7 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, BuildContext context, {doctorId}) async { Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, int languageID, BuildContext context, {doctorId}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -155,11 +120,11 @@ class ClinicListService extends BaseService {
request = { request = {
"ChiefComplaintID": chiefComplaintID, "ChiefComplaintID": chiefComplaintID,
"ProjectID": projectID, "ProjectID": projectID,
"VersionID": 5.6, // "VersionID": 5.6,
"Channel": 3, // "Channel": 3,
"LanguageID": languageID == 'ar' ? 1 : 2, "LanguageID": languageID,
"IPAdress": req.IPAdress, // "IPAdress": req.IPAdress,
"generalid": req.generalid, // "generalid": req.generalid,
"SessionID": null, "SessionID": null,
"isDentalAllowedBackend": true, "isDentalAllowedBackend": true,
"Latitude": lat != null ? lat.toString() : "0.0", "Latitude": lat != null ? lat.toString() : "0.0",
@ -177,14 +142,15 @@ class ClinicListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getCountries() async { Future<Map> getCountries() async {
Map<String, dynamic> request ={}; Map<String, dynamic> request = {};
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async { await baseAppClient.post(GET_NATIONALITY, onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save