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

# Conflicts:
#	lib/config/config.dart
#	lib/config/localized_values.dart
#	lib/uitl/translations_delegate_base.dart
dev_3.3_AmbulanceRequestCR
haroon amjad 9 months ago
commit a12558076f

@ -0,0 +1,216 @@
package com.oohyugi.sms_otp_auto_verify
import android.app.Activity
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.IntentSender
import android.os.Build
import android.telephony.TelephonyManager
import android.util.Log
import androidx.annotation.RequiresApi
import com.google.android.gms.auth.api.credentials.Credential
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import com.google.android.gms.auth.api.phone.SmsRetriever;
import com.google.android.gms.auth.api.phone.SmsRetrieverClient
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
import io.flutter.plugin.common.BinaryMessenger
import io.flutter.plugin.common.PluginRegistry
import com.google.android.gms.auth.api.credentials.Credentials
import com.google.android.gms.auth.api.credentials.HintRequest
import io.flutter.plugin.common.PluginRegistry.Registrar
import androidx.core.content.ContextCompat
import androidx.core.content.ContextCompat.RECEIVER_EXPORTED
/** SmsOtpAutoVerifyPlugin */
class SmsOtpAutoVerifyPlugin : FlutterPlugin, MethodCallHandler,
MySmsListener, ActivityAware {
private var channel: MethodChannel? = null
private var pendingResult: MethodChannel.Result? = null
private var receiver: SmsBroadcastReceiver? = null
private var alreadyCalledSmsRetrieve = false
private var client: SmsRetrieverClient? = null
private var activity: Activity? = null
private var binding: ActivityPluginBinding? = null
private val activityResultListener: PluginRegistry.ActivityResultListener =
object : PluginRegistry.ActivityResultListener {
override fun onActivityResult(
requestCode: Int,
resultCode: Int,
data: Intent?
): Boolean {
if (requestCode == REQUEST_RESOLVE_HINT) {
if (resultCode == Activity.RESULT_OK && data != null) {
val credential: Credential? = data.getParcelableExtra(Credential.EXTRA_KEY)
val phoneNumber: String? = credential?.id
pendingResult?.success(phoneNumber)
} else {
pendingResult?.success(null)
}
return true
}
return false
}
}
companion object {
private const val channelName = "sms_otp_auto_verify"
private const val REQUEST_RESOLVE_HINT = 1256
@JvmStatic
fun setup(plugin: SmsOtpAutoVerifyPlugin, binaryMessenger: BinaryMessenger) {
plugin.channel = MethodChannel(binaryMessenger, channelName)
plugin.channel?.setMethodCallHandler(plugin)
plugin.binding?.addActivityResultListener(plugin.activityResultListener)
}
}
override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
setup(plugin = this, binding.binaryMessenger)
}
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
unregister()
}
@RequiresApi(Build.VERSION_CODES.O)
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
when (call.method) {
"getAppSignature" -> {
activity?.let {
val signature = AppSignatureHelper(it).getAppSignatures()[0]
result.success(signature)
}
}
"startListening" -> {
this.pendingResult = result
receiver = SmsBroadcastReceiver()
startListening()
}
"stopListening" -> {
pendingResult = null
unregister()
}
"requestPhoneHint" -> {
this.pendingResult = result
requestHint()
}
else -> result.notImplemented()
}
}
private fun requestHint() {
if (!isSimSupport()) {
pendingResult?.success(null)
return
}
val hintRequest = HintRequest.Builder()
.setPhoneNumberIdentifierSupported(true)
.build()
activity?.apply {
val intent = Credentials.getClient(this).getHintPickerIntent(hintRequest)
try {
startIntentSenderForResult(
intent.intentSender,
REQUEST_RESOLVE_HINT, null, 0, 0, 0
)
} catch (e: IntentSender.SendIntentException) {
e.printStackTrace()
}
}
}
private fun isSimSupport(): Boolean {
val telephonyManager: TelephonyManager =
activity!!.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager
return (telephonyManager.simState == TelephonyManager.SIM_STATE_ABSENT)
}
@RequiresApi(Build.VERSION_CODES.O)
private fun startListening() {
activity?.let {
client = SmsRetriever.getClient(it)
}
val task = client?.startSmsRetriever()
task?.addOnSuccessListener {
// Successfully started retriever, expect broadcast intent
unregister()
Log.e(javaClass::getSimpleName.name, "task started")
receiver?.setSmsListener(this)
activity?.applicationContext?.let { it1 ->
ContextCompat.registerReceiver(
it1, receiver,
IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION), RECEIVER_EXPORTED)
}
}
}
private fun unregister() {
alreadyCalledSmsRetrieve = false
if (receiver != null) {
try {
activity?.unregisterReceiver(receiver)
Log.d(javaClass::getSimpleName.name, "task stoped")
receiver = null
} catch (e: Exception) {
}
}
}
override fun onOtpReceived(message: String?) {
message?.let {
if (!alreadyCalledSmsRetrieve) {
pendingResult?.success(it)
alreadyCalledSmsRetrieve = true
} else {
Log.d("onOtpReceived: ", "already called")
}
}
}
override fun onOtpTimeout() {
}
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
activity = binding.activity
this.binding = binding
binding.addActivityResultListener(activityResultListener); }
override fun onDetachedFromActivityForConfigChanges() {
unregister()
}
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
activity = binding.activity
this.binding = binding
binding.addActivityResultListener(activityResultListener);
}
override fun onDetachedFromActivity() {
unregister()
}
}

@ -41,7 +41,7 @@ configurations.all {
} }
android { android {
compileSdkVersion 33 compileSdkVersion 34
sourceSets { sourceSets {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
@ -57,7 +57,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.ejada.hmg" applicationId "com.ejada.hmg"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 33 targetSdkVersion 34
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
multiDexEnabled true multiDexEnabled true

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.kotlin_version = '1.7.20' ext.kotlin_version = '1.8.0'
repositories { repositories {
google() google()
jcenter() jcenter()

@ -0,0 +1,11 @@
{
"applinks": {
"apps": [],
"details": [
{
"appID": "3A359E86ZF.com.HMG.HMG-Smartphone",
"paths": ["*"]
}
]
}
}

@ -0,0 +1,26 @@
[
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.ejada.hmg",
"sha256_cert_fingerprints": [
"57:EA:97:F9:C2:03:52:83:C1:13:E7:D9:9E:AD:55:B3:77:07:C5:14:6C:AA:1E:C8:70:24:73:DD:7F:25:A8:7B"
]
}
},
{
"relation": [
"delegate_permission/common.handle_all_urls"
],
"target": {
"namespace": "android_app",
"package_name": "com.ejada.hmg",
"sha256_cert_fingerprints": [
"10:AC:36:05:DD:D5:63:3F:FF:0D:88:C3:9C:92:F1:12:1D:EE:1A:A8:4D:0C:85:AE:6C:B9:A9:C0:0C:7F:03:B5"
]
}
}
]

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

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

@ -4,10 +4,20 @@
<dict> <dict>
<key>aps-environment</key> <key>aps-environment</key>
<string>development</string> <string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:hmg.com</string>
</array>
<key>com.apple.developer.healthkit</key> <key>com.apple.developer.healthkit</key>
<true/> <true/>
<key>com.apple.developer.healthkit.access</key> <key>com.apple.developer.healthkit.access</key>
<array/> <array/>
<key>com.apple.developer.in-app-payments</key>
<array>
<string>merchant.com.hmgwebsersives</string>
<string>merchant.com.hmgwebservices.uat</string>
<string>merchant.com.hmgwebservices</string>
</array>
<key>com.apple.developer.networking.HotspotConfiguration</key> <key>com.apple.developer.networking.HotspotConfiguration</key>
<true/> <true/>
<key>com.apple.developer.networking.wifi-info</key> <key>com.apple.developer.networking.wifi-info</key>

@ -1,5 +1,6 @@
import 'dart:io'; import 'dart:io';
import 'package:amazon_payfort/amazon_payfort.dart';
import 'package:diplomaticquarterapp/models/Request.dart'; import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -19,8 +20,11 @@ var PACKAGES_SHOPPING_CART = '/api/shopping_cart_items';
var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:2018/'; // 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 = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/';
// var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/';
@ -38,6 +42,8 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
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 // Pharmacy VidaPlus 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/';
@ -339,7 +345,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 = 11.3; var VERSION_ID = 12.3;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;
@ -620,6 +626,17 @@ var PAYFORT_PROD_URL = 'https://paymentservices.payfort.com/FortAPI/paymentApi';
var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity'; var CHECK_PATIENT_NPHIES_ELIGIBILITY = 'Services/Doctors.svc/REST/checkPatientInsuranceCompanyValidity';
var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany'; var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceCompany';
//PAYFORT
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
var payFortEnvironment = FortEnvironment.production;
var applePayMerchantId = "merchant.com.hmgwebservices";
// var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat";
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -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": "استلام التنبيهات بالرسائل القصيرة"},
@ -1902,4 +1902,9 @@ const Map localizedValues = {
"cashAmountUpdateInsurance": {"en": "Please note that this is the cash amount, If you want to update your insurance, Please tap below:", "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": "هل لديك تأمين صالح؟"}, "validInsurance": {"en": "Do you have a valid insurance?", "ar": "هل لديك تأمين صالح؟"},
"contactRRT": {"en": "Contact RRT", "ar": "تواصل مع فريق الاستجابة السريعة"}, "contactRRT": {"en": "Contact RRT", "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": "يرجى التأكد من تواجدك داخل موقع المستشفى لإجراء تسجيل الوصول عبر الإنترنت."},
"upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"},
"noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"},
"locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "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';

@ -0,0 +1,44 @@
enum ServiceTypeEnum {
advancePayment, //3
ancillaryOrder, //3
appointmentPayment, //2
covidPayment, //2
erOnlineCheckIn, //3
liveCareAppointment //4
}
extension ServiceTypeEnumExt on ServiceTypeEnum {
String value() {
switch (this) {
case ServiceTypeEnum.advancePayment:
return "Advance Payment";
case ServiceTypeEnum.ancillaryOrder:
return "Ancillary Order";
case ServiceTypeEnum.appointmentPayment:
return "Appointment Payment";
case ServiceTypeEnum.covidPayment:
return "Covid Payment";
case ServiceTypeEnum.erOnlineCheckIn:
return "ER Online Check In";
case ServiceTypeEnum.liveCareAppointment:
return "LiveCare Appointment";
}
}
int getIdFromServiceEnum() {
switch (this) {
case ServiceTypeEnum.advancePayment:
return 3;
case ServiceTypeEnum.ancillaryOrder:
return 3;
case ServiceTypeEnum.appointmentPayment:
return 2;
case ServiceTypeEnum.covidPayment:
return 2;
case ServiceTypeEnum.erOnlineCheckIn:
return 3;
case ServiceTypeEnum.liveCareAppointment:
return 4;
}
}
}

@ -17,6 +17,7 @@ class PatientLabOrders {
String genderDescription; String genderDescription;
String invoiceNo; String invoiceNo;
String invoiceNo_VP; String invoiceNo_VP;
String invoiceType;
bool isActiveDoctorProfile; bool isActiveDoctorProfile;
bool isDoctorAllowVedioCall; bool isDoctorAllowVedioCall;
bool isExecludeDoctor; bool isExecludeDoctor;
@ -36,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,
@ -69,8 +71,10 @@ class PatientLabOrders {
this.projectNameN, this.projectNameN,
this.qR, this.qR,
this.setupID, this.setupID,
this.invoiceNo_VP, this.invoiceNo_VP,
this.speciality,this.isLiveCareAppointment}); this.invoiceType,
this.speciality,
this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) { PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate']; actualDoctorRate = json['ActualDoctorRate'];
@ -106,8 +110,9 @@ class PatientLabOrders {
qR = json['QR']; qR = json['QR'];
setupID = json['SetupID']; setupID = json['SetupID'];
invoiceNo_VP = json['invoiceNo_VP']; 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() {
@ -146,7 +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; data['invoiceNo_VP'] = this.invoiceNo_VP;
return data; return data;
} }
} }
@ -155,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,6 +1,7 @@
class RequestPatientLabSpecialResult { class RequestPatientLabSpecialResult {
String invoiceNo; String invoiceNo;
String invoiceNoVP; String invoiceNoVP;
String invoiceType;
String orderNo; String orderNo;
String setupID; String setupID;
String projectID; String projectID;
@ -22,27 +23,29 @@ class RequestPatientLabSpecialResult {
RequestPatientLabSpecialResult( RequestPatientLabSpecialResult(
{this.invoiceNo, {this.invoiceNo,
this.invoiceNoVP, this.invoiceNoVP,
this.orderNo, this.invoiceType,
this.setupID, this.orderNo,
this.projectID, this.setupID,
this.clinicID, this.projectID,
this.versionID, this.clinicID,
this.channel, this.versionID,
this.languageID, this.channel,
this.iPAdress, this.languageID,
this.generalid, this.iPAdress,
this.patientOutSA, this.generalid,
this.sessionID, this.patientOutSA,
this.isDentalAllowedBackend, this.sessionID,
this.deviceTypeID, this.isDentalAllowedBackend,
this.patientID, this.deviceTypeID,
this.tokenID, this.patientID,
this.patientTypeID, this.tokenID,
this.patientType}); 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']; 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'];
@ -66,6 +69,7 @@ class RequestPatientLabSpecialResult {
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['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;

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

@ -18,7 +18,7 @@ class PrescriptionReportINP {
int days; int days;
String startDate; String startDate;
String orderDate; String orderDate;
int doseDailyQuantity; num doseDailyQuantity;
int itemID; int itemID;
Null productImage; Null productImage;
String sKU; String sKU;

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

@ -7,6 +7,7 @@ class FinalRadiology {
int invoiceLineItemNo; int invoiceLineItemNo;
int invoiceNo; int invoiceNo;
dynamic invoiceNo_VP; dynamic invoiceNo_VP;
String invoiceType;
int doctorID; int doctorID;
int clinicID; int clinicID;
DateTime orderDate; DateTime orderDate;
@ -50,7 +51,8 @@ class FinalRadiology {
this.patientID, this.patientID,
this.invoiceLineItemNo, this.invoiceLineItemNo,
this.invoiceNo, this.invoiceNo,
this.invoiceNo_VP, this.invoiceNo_VP,
this.invoiceType,
this.doctorID, this.doctorID,
this.clinicID, this.clinicID,
this.orderDate, this.orderDate,
@ -85,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 {
@ -95,6 +98,7 @@ class FinalRadiology {
invoiceLineItemNo = json['InvoiceLineItemNo']; invoiceLineItemNo = json['InvoiceLineItemNo'];
invoiceNo = json['InvoiceNo']; invoiceNo = json['InvoiceNo'];
invoiceNo_VP = json['InvoiceNo_VP']; 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']);
@ -128,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);
} }
@ -145,6 +148,7 @@ class FinalRadiology {
data['InvoiceLineItemNo'] = this.invoiceLineItemNo; data['InvoiceLineItemNo'] = this.invoiceLineItemNo;
data['InvoiceNo'] = this.invoiceNo; data['InvoiceNo'] = this.invoiceNo;
data['InvoiceNo_VP'] = this.invoiceNo_VP; 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;
@ -189,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);
// } // }
} }

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

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

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

@ -73,14 +73,34 @@ 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['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')
@ -90,7 +110,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')) {
@ -134,7 +158,8 @@ class BaseAppClient {
? body['PatientOutSA'] ? body['PatientOutSA']
: user['OutSA'] : user['OutSA']
: user['OutSA']; : user['OutSA'];
body['SessionID'] = getSessionId(body['TokenID']); //getSe body['SessionID'] = getSessionId(body['TokenID'] != null ? body['TokenID'] : ""); //getSe
// body['SessionID'] = body['TokenID']; //getSe
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
@ -149,8 +174,8 @@ class BaseAppClient {
} }
// body['IdentificationNo'] = 1023854217; // body['IdentificationNo'] = 1023854217;
// body['MobileNo'] = "531940021"; // body['MobileNo'] = "531940021"; //0560717232
// body['PatientID'] = 2621536; //3844083 // body['PatientID'] = 1374756; //4609100
// body['TokenID'] = "@dm!n"; // body['TokenID'] = "@dm!n";
// Patient ID: 3027574 // Patient ID: 3027574
@ -159,11 +184,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);
@ -255,7 +280,7 @@ class BaseAppClient {
} catch (e) { } catch (e) {
print(e); print(e);
onFailure(e.toString(), -1); onFailure(e.toString(), -1);
_analytics.errorTracking.log(endPoint, error: "api exception: $e"); _analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url");
} }
} }
@ -425,7 +450,7 @@ class BaseAppClient {
} catch (e) { } catch (e) {
print(e); print(e);
onFailure(e.toString(), -1); onFailure(e.toString(), -1);
_analytics.errorTracking.log(endPoint, error: "api exception: $e"); _analytics.errorTracking.log(endPoint, error: "api exception: $e - API Path: $url");
} }
} }
@ -690,12 +715,13 @@ class BaseAppClient {
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false); var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
model.setState(0, false, null); model.setState(0, 0, false, null);
Navigator.of(AppGlobal.context).pushReplacementNamed(HOME); Navigator.of(AppGlobal.context).pushReplacementNamed(HOME);
} }
String getSessionId(String id) { String getSessionId(String id) {
///return id.replaceAll(RegExp('/[^\w\s]/'), ''); ///return id.replaceAll(RegExp('/[^\w\s]/'), '');
// if (id != null) return id.replaceAll(RegExp('/[^a-zA-Z]'), '');
return id.replaceAll(RegExp('/[^a-zA-Z]'), ''); return id.replaceAll(RegExp('/[^a-zA-Z]'), '');
} }

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

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

@ -34,7 +34,7 @@ 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, bool isVidaPlus}) 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;
@ -42,6 +42,8 @@ class LabsService extends BaseService {
_requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo; _requestPatientLabSpecialResult.invoiceNo = isVidaPlus ? "0" : invoiceNo;
_requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0"; _requestPatientLabSpecialResult.invoiceNoVP = isVidaPlus ? invoiceNo : "0";
_requestPatientLabSpecialResult.invoiceType = invoiceType;
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
_requestPatientLabSpecialResult.setupID = setupID; _requestPatientLabSpecialResult.setupID = setupID;
@ -61,6 +63,7 @@ class LabsService extends BaseService {
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0"; body['InvoiceNo_VP'] = isVidaPlus ? patientLabOrder.invoiceNo : "0";
body['InvoiceNo'] = isVidaPlus ? "0" : patientLabOrder.invoiceNo; 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;
@ -188,6 +191,8 @@ class LabsService extends BaseService {
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
body['Procedure'] = procedure; body['Procedure'] = procedure;
body['Procedure'] = procedure;
body['LanguageID'] = 1;
await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear(); labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
@ -205,6 +210,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
_requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNo = isVidaPlus ? "0" : patientLabOrder.invoiceNo;
_requestSendLabReportEmail.invoiceNoVP = isVidaPlus ? patientLabOrder.invoiceNo : "0"; _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;
@ -219,6 +225,7 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.orderNo = patientLabOrder.orderNo; _requestSendLabReportEmail.orderNo = patientLabOrder.orderNo;
_requestSendLabReportEmail.isDownload = isDownload; _requestSendLabReportEmail.isDownload = isDownload;
_requestSendLabReportEmail.doctorID = patientLabOrder.doctorID; _requestSendLabReportEmail.doctorID = patientLabOrder.doctorID;
_requestSendLabReportEmail.languageID = 1;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
if (isDownload) { if (isDownload) {

@ -10,13 +10,14 @@ class RadiologyService extends BaseService {
bool isRadiologyVIDAPlus = false; bool isRadiologyVIDAPlus = false;
Future getRadImageURL({int invoiceNo, int lineItem, int projectId, bool isVidaPlus}) async { Future getRadImageURL({int invoiceNo, String invoiceType, int lineItem, int projectId, bool isVidaPlus}) async {
hasError = false; hasError = false;
final Map<String, dynamic> body = new Map<String, dynamic>(); final Map<String, dynamic> body = new Map<String, dynamic>();
body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo; body['InvoiceNo'] = isVidaPlus ? "0" : invoiceNo;
body['InvoiceNo_VP'] = isVidaPlus ? invoiceNo : "0"; 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'];
@ -79,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) {

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

@ -1,6 +1,7 @@
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/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/model/privilege/VidaPlusProjectListModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
@ -8,10 +9,12 @@ class PrivilegeService extends BaseService {
List<PrivilegeModel> privilegeModelList = []; List<PrivilegeModel> privilegeModelList = [];
List<VidaPlusProjectListModel> vidaPlusProjectListModel = []; List<VidaPlusProjectListModel> vidaPlusProjectListModel = [];
List<HMCProjectListModel> hMCProjectListModel = []; 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;
body['LanguageID'] = 1;
await baseAppClient.post(GET_PRIVILEGE, 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));
@ -28,6 +31,12 @@ class PrivilegeService extends BaseService {
hMCProjectListModel.add(HMCProjectListModel.fromJson(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);
@ -35,9 +35,9 @@ class AppointmentRateViewModel extends BaseViewModel {
} }
} }
Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note) async { Future sendAppointmentRate(int rate, int appointmentNo, int projectID, int doctorID, int clinicID, String note, int languageID) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note); await _appointmentRateService.sendAppointmentRate(rate, appointmentNo, projectID, doctorID, clinicID, note, languageID);
if (_appointmentRateService.hasError) { if (_appointmentRateService.hasError) {
error = _appointmentRateService.error; error = _appointmentRateService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

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

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

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

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

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

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

@ -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);

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

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

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

@ -6,6 +6,7 @@ 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/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/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';
@ -62,6 +63,7 @@ class ProjectViewModel extends BaseViewModel {
List<PrivilegeModel> privilegeChildUser = List(); List<PrivilegeModel> privilegeChildUser = List();
List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List(); List<VidaPlusProjectListModel> _vidaPlusProjectListModel = List();
List<HMCProjectListModel> _hMCProjectListModel = []; List<HMCProjectListModel> _hMCProjectListModel = [];
List<ProjectDetailListModel> _projectDetailListModel = [];
List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser; List<PrivilegeModel> get privileges => isLoginChild ? privilegeChildUser : privilegeChildUser;
@ -69,6 +71,8 @@ class ProjectViewModel extends BaseViewModel {
List<HMCProjectListModel> get hMCProjectListModel => _hMCProjectListModel; List<HMCProjectListModel> get hMCProjectListModel => _hMCProjectListModel;
List<ProjectDetailListModel> get projectDetailListModel => _projectDetailListModel;
List<LaserBodyPart> selectedBodyPartList = []; List<LaserBodyPart> selectedBodyPartList = [];
StreamSubscription subscription; StreamSubscription subscription;
@ -134,6 +138,11 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners(); notifyListeners();
} }
setProjectsDetailList(List<ProjectDetailListModel> projectDetailListModel) {
_projectDetailListModel = projectDetailListModel;
notifyListeners();
}
setHMCProjectList(List<HMCProjectListModel> hMCProjectListModel) { setHMCProjectList(List<HMCProjectListModel> hMCProjectListModel) {
_hMCProjectListModel = hMCProjectListModel; _hMCProjectListModel = hMCProjectListModel;
notifyListeners(); notifyListeners();

@ -13,6 +13,8 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/PharmacyAddr
import 'package:diplomaticquarterapp/core/viewModels/product_categories_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/product_categories_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_service.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/cancelOrder_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart';
import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart'; import 'package:diplomaticquarterapp/services/pharmacy_services/recommendedProduct_service.dart';
@ -202,6 +204,7 @@ void setupLocator() {
locator.registerLazySingleton(() => VaccinationTableService()); locator.registerLazySingleton(() => VaccinationTableService());
locator.registerLazySingleton(() => AncillaryOrdersService()); locator.registerLazySingleton(() => AncillaryOrdersService());
locator.registerLazySingleton(() => EdOnlineServices()); locator.registerLazySingleton(() => EdOnlineServices());
locator.registerLazySingleton(() => PayfortService());
//pharmacy //pharmacy
// locator.registerLazySingleton(() => PharmacyCategoriseService()); // locator.registerLazySingleton(() => PharmacyCategoriseService());
@ -309,6 +312,7 @@ void setupLocator() {
locator.registerFactory(() => BestSellerViewModel()); locator.registerFactory(() => BestSellerViewModel());
locator.registerFactory(() => LastVisitedViewModel()); locator.registerFactory(() => LastVisitedViewModel());
locator.registerFactory(() => MostViewedViewModel()); locator.registerFactory(() => MostViewedViewModel());
locator.registerFactory(() => PayfortViewModel());
// Offer And Packages // Offer And Packages
//---------------------- //----------------------

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/viewModels/PharmacyPagesViewModel.dart
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
@ -118,12 +119,15 @@ class _MyApp extends State<MyApp> {
), ),
ChangeNotifierProvider<CompareList>(create: (context) => CompareList()), ChangeNotifierProvider<CompareList>(create: (context) => CompareList()),
ChangeNotifierProvider<OrderPreviewViewModel>(create: (context) => OrderPreviewViewModel()), ChangeNotifierProvider<OrderPreviewViewModel>(create: (context) => OrderPreviewViewModel()),
ChangeNotifierProvider<PayfortViewModel>(create: (context) => PayfortViewModel()),
], ],
child: Consumer<ProjectViewModel>( child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp( builder: (context, projectProvider, child) => MaterialApp(
builder: (BuildContext context, Widget child) { builder: (BuildContext context, Widget child) {
return MediaQuery( return MediaQuery(
data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0,), //set desired text scale factor here data: MediaQuery.of(context).copyWith(
textScaleFactor: 1.0,
), //set desired text scale factor here
child: child, child: child,
); );
}, },

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

@ -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;

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

@ -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;

@ -35,6 +35,24 @@ class ApplePayInsertRequest {
String sessionID; String sessionID;
bool isDentalAllowedBackend; bool isDentalAllowedBackend;
int deviceTypeID; int deviceTypeID;
bool isMobSDK;
String merchantReference;
String merchantIdentifier;
String commandType;
String signature;
String accessCode;
String shaRequestPhrase;
String shaResponsePhrase;
String returnURL;
// IsMobSDK ==> bool
// Merchant_Reference ==> string
// Merchant_Identifier ==> string
// CommandType ==> string
// Signature ==> string
// Access_code ==> string
// SHA_RequestPhase ==> string
// SHA_ResponsePhase ==> string
ApplePayInsertRequest( ApplePayInsertRequest(
{this.clientRequestID, {this.clientRequestID,
@ -72,7 +90,18 @@ class ApplePayInsertRequest {
this.generalid, this.generalid,
this.sessionID, this.sessionID,
this.isDentalAllowedBackend, this.isDentalAllowedBackend,
this.deviceTypeID}); this.deviceTypeID,
this.isMobSDK,
this.merchantReference,
this.merchantIdentifier,
this.commandType,
this.signature,
this.accessCode,
this.shaRequestPhrase,
this.shaResponsePhrase,
this.returnURL,
});
ApplePayInsertRequest.fromJson(Map<String, dynamic> json) { ApplePayInsertRequest.fromJson(Map<String, dynamic> json) {
clientRequestID = json['ClientRequestID']; clientRequestID = json['ClientRequestID'];
@ -128,6 +157,7 @@ class ApplePayInsertRequest {
data['Service_ID'] = this.serviceID; data['Service_ID'] = this.serviceID;
data['Channel_ID'] = this.channelID; data['Channel_ID'] = this.channelID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['PatientId'] = this.patientID;
data['PatientTypeID'] = this.patientTypeID; data['PatientTypeID'] = this.patientTypeID;
data['PatientOutSA'] = this.patientOutSA; data['PatientOutSA'] = this.patientOutSA;
data['AppointmentDate'] = this.appointmentDate; data['AppointmentDate'] = this.appointmentDate;
@ -151,6 +181,17 @@ class ApplePayInsertRequest {
data['SessionID'] = this.sessionID; data['SessionID'] = this.sessionID;
data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
data['DeviceTypeID'] = this.deviceTypeID; data['DeviceTypeID'] = this.deviceTypeID;
data['IsMobSDK'] = this.isMobSDK;
data['Merchant_Reference'] = this.merchantReference;
data['Merchant_Identifier'] = this.merchantIdentifier;
data['CommandType'] = this.commandType;
data['Signature'] = this.signature;
data['Access_code'] = this.accessCode;
data['SHA_RequestPhase'] = this.shaRequestPhrase;
data['SHA_ResponsePhase'] = this.shaResponsePhrase;
data['ReturnURL'] = this.returnURL;
return data; return data;
} }
} }

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

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

@ -104,14 +104,6 @@ class _NewHomeHealthCareStepThreePageState extends State<NewHomeHealthCareStepTh
), ),
Container( Container(
height: 200, height: 200,
// child: GoogleMap(
// mapType: MapType.normal,
// markers: markers,
// initialCameraPosition: _kGooglePlex,
// onMapCreated: (GoogleMapController controller) {
// _controller.complete(controller);
// },
// ),
decoration: containerColorRadiusBorderWidth(Colors.transparent, 12,Colors.transparent,0.5), decoration: containerColorRadiusBorderWidth(Colors.transparent, 12,Colors.transparent,0.5),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Image.network( child: Image.network(

@ -1,17 +1,27 @@
import 'dart:developer';
import 'dart:io'; 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/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/PayfortEnums.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/LiveCare/ApplePayInsertRequest.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/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/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/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.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_toast.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';
@ -24,6 +34,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;
@ -47,10 +58,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();
} }
@ -58,12 +74,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);
}); });
} }
@ -73,83 +98,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
? () {
if (getTotalValue() != "0.00") {
makePayment(model);
} else {
autoGenerateInvoice();
}
}
: 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,
),
],
),
), ),
); );
} }
@ -184,7 +200,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
); );
} }
Widget getPatientInfo(AnciallryOrdersViewModel model) { Widget getPatientInfo() {
return Padding( return Padding(
child: Column( child: Column(
children: [ children: [
@ -277,7 +293,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,
@ -300,7 +316,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,
@ -325,7 +341,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,
@ -350,7 +366,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,
@ -370,8 +386,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));
} }
@ -493,21 +509,113 @@ 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); if (selectedPaymentMethod == "ApplePay") {
if (projectViewModel.havePrivilege(103)) {
startApplePay();
} else {
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan);
}
} else {
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]) { void startApplePay() async {
transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID);
print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel payfortProjectDetailsRespModel;
await context.read<PayfortViewModel>().getProjectDetailsForPayfort(projectId: widget.projectID, serviceId: ServiceTypeEnum.ancillaryOrder.getIdFromServiceEnum()).then((value) {
payfortProjectDetailsRespModel = value;
});
applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = 0;
applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR";
// applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com";
applePayInsertRequest.customerID = projectViewModel.user.patientID;
applePayInsertRequest.customerName = projectViewModel.user.firstName + " " + projectViewModel.user.lastName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = 0;
applePayInsertRequest.projectID = widget.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.advancePayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = projectViewModel.user.patientID;
applePayInsertRequest.patientTypeID = projectViewModel.user.patientType;
applePayInsertRequest.patientOutSA = projectViewModel.user.outSA;
applePayInsertRequest.appointmentDate = null;
applePayInsertRequest.appointmentNo = widget.appoNo;
applePayInsertRequest.orderDescription = "Ancillary Order Payment";
applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = double.parse(getTotalValue()).toString();
applePayInsertRequest.isSchedule = "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
applePayInsertRequest.userName = projectViewModel.user.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel.merchantIdentifier;
applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel.signature;
applePayInsertRequest.accessCode = payfortProjectDetailsRespModel.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel.shaRequest;
applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel.shaResponse;
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Ancillary Order Payment",
orderAmount: double.parse(getTotalValue()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.projectID,
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
);
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
}
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);
@ -529,10 +637,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);
} }
@ -702,6 +810,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
}).showAlertDialog(context); }).showAlertDialog(context);
} }
@ -717,16 +826,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(() {

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

@ -1,16 +1,22 @@
import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/core/enum/PayfortEnums.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';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.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/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.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/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.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';
@ -28,6 +34,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart';
import 'QRCode.dart'; import 'QRCode.dart';
class BookSuccess extends StatefulWidget { class BookSuccess extends StatefulWidget {
@ -57,6 +64,7 @@ class _BookSuccessState extends State<BookSuccess> {
String selectedInstallments = ""; String selectedInstallments = "";
String tamaraPaymentStatus; String tamaraPaymentStatus;
String tamaraOrderID; String tamaraOrderID;
String transID;
@override @override
initState() { initState() {
@ -159,25 +167,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)),
),
),
),
],
), ),
], ],
), ),
@ -190,7 +227,7 @@ class _BookSuccessState extends State<BookSuccess> {
child: Container( child: Container(
color: CustomColors.appBackgroudGreyColor, color: CustomColors.appBackgroudGreyColor,
margin: EdgeInsets.all(14), margin: EdgeInsets.all(14),
height: 150.0, height: widget.isCash ? 150.0 : 50,
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -464,7 +501,7 @@ class _BookSuccessState extends State<BookSuccess> {
setOnlineCheckInForAppointment() { setOnlineCheckInForAppointment() {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, context).then((res) { service.setOnlineCheckInForAppointment(widget.patientShareResponse.appointmentNo.toString(), widget.patientShareResponse.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.clinicID = widget.docObject.clinicID; appo.clinicID = widget.docObject.clinicID;
appo.projectID = widget.docObject.projectID; appo.projectID = widget.docObject.projectID;
@ -509,7 +546,7 @@ class _BookSuccessState extends State<BookSuccess> {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -593,21 +630,114 @@ class _BookSuccessState extends State<BookSuccess> {
}, },
patientShare: widget.patientShareResponse.patientShareWithTax))) patientShare: widget.patientShareResponse.patientShareWithTax)))
.then((value) { .then((value) {
selectedPaymentMethod = value[0];
if (value != null) { if (value != null) {
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); if (selectedPaymentMethod == "ApplePay") {
if (projectViewModel.havePrivilege(103)) {
startApplePay(appo, patientShareResponse);
} else {
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
}
} else {
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
}
projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment'); projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment');
} }
}); });
} }
void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async {
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel payfortProjectDetailsRespModel;
await context.read<PayfortViewModel>().getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()).then((value) {
payfortProjectDetailsRespModel = value;
});
applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = appo.clinicID;
applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR";
// applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com";
applePayInsertRequest.customerID = projectViewModel.user.patientID;
applePayInsertRequest.customerName = projectViewModel.user.firstName + " " + projectViewModel.user.lastName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = appo.doctorID;
applePayInsertRequest.projectID = appo.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = projectViewModel.user.patientID;
applePayInsertRequest.patientTypeID = projectViewModel.user.patientType;
applePayInsertRequest.patientOutSA = projectViewModel.user.outSA;
applePayInsertRequest.appointmentDate = appo.appointmentDate;
applePayInsertRequest.appointmentNo = appo.appointmentNo;
applePayInsertRequest.orderDescription = "Appointment Payment";
applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = patientShareResponse.patientShareWithTax.toString();
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment ? "1" : "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
applePayInsertRequest.userName = projectViewModel.user.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel.merchantIdentifier;
applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel.signature;
applePayInsertRequest.accessCode = payfortProjectDetailsRespModel.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel.shaRequest;
applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel.shaResponse;
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
}
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];
selectedInstallments = paymentMethod[1]; selectedInstallments = paymentMethod[1];
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), transID,
appo.projectID.toString(), appo.projectID.toString(),
authenticatedUser.emailAddress, authenticatedUser.emailAddress,
paymentMethod[0], paymentMethod[0],
@ -661,13 +791,13 @@ class _BookSuccessState extends State<BookSuccess> {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
try { try {
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); checkTamaraPaymentStatus(transID, appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// } else { } else {
// updateTamaraRequestStatus( updateTamaraRequestStatus(
// "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo); "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
// } }
} else { } else {
checkPaymentStatus(appo); checkPaymentStatus(appo);
} }
@ -762,7 +892,7 @@ class _BookSuccessState extends State<BookSuccess> {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { service.checkPaymentStatus(transID, false, context).then((res) {
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
txn_ref = res['Merchant_Reference']; txn_ref = res['Merchant_Reference'];

@ -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) {
@ -116,6 +118,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
return DoctorView( return DoctorView(
doctor: doctor, doctor: doctor,
isLiveCareAppointment: false, isLiveCareAppointment: false,
isContinueDentalPlan: hasDentalPlan,
); );
}).toList(), }).toList(),
)), )),
@ -144,8 +147,8 @@ class _DentalComplaintsState extends State<DentalComplaints> {
confirmMessage: TranslationBase.of(context).continuePlan, confirmMessage: TranslationBase.of(context).continuePlan,
okText: TranslationBase.of(context).yes, okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no, cancelText: TranslationBase.of(context).no,
okFunction: () => {Navigator.of(context).pop(), continueDentalPlan()}, okFunction: () => {Navigator.of(context).pop(), continueDentalPlan(), hasDentalPlan = true},
cancelFunction: () => {getChiefComplaintsList()}); cancelFunction: () => {getChiefComplaintsList(), hasDentalPlan = false});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
} else { } else {
getChiefComplaintsList(); getChiefComplaintsList();
@ -207,11 +210,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 +258,12 @@ class _DentalComplaintsState extends State<DentalComplaints> {
} }
getChiefComplaintsList() { getChiefComplaintsList() {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
getLanguageID(); getLanguageID();
hasDentalPlan = false;
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, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -39,8 +39,9 @@ class DoctorProfile extends StatefulWidget {
final bool isOpenAppt; final bool isOpenAppt;
bool isLiveCareAppointment; bool isLiveCareAppointment;
bool isDoctorNameSearch; bool isDoctorNameSearch;
bool isContinueDentalPlan;
DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false}); DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false, this.isContinueDentalPlan = false});
AuthenticatedUser authUser; AuthenticatedUser authUser;
@ -203,6 +204,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
doctor: widget.doctor, doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment, isLiveCareAppointment: widget.isLiveCareAppointment,
doctorSchedule: doctorSchedule, doctorSchedule: doctorSchedule,
isContinueDentalPlan: widget.isContinueDentalPlan,
), ),
], ],
controller: _tabController, controller: _tabController,
@ -234,7 +236,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatings() { getDoctorRatings() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRating(widget.doctor.doctorID, context).then((res) { service.getDoctorsRating(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['NotesDoctorRatingList']); print(res['NotesDoctorRatingList']);
@ -251,7 +253,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
getDoctorRatingsDetails() { getDoctorRatingsDetails() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorsRatingDetails(widget.doctor.doctorID, context).then((res) { service.getDoctorsRatingDetails(widget.doctor.doctorID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
doctorDetailsList.clear(); doctorDetailsList.clear();

@ -3,6 +3,7 @@ import 'dart:typed_data';
import 'package:barcode_scan2/barcode_scan2.dart'; 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/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';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/models/header_model.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -17,7 +19,9 @@ 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/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/data_display/medical/medical_profile_item.dart';
@ -49,6 +53,8 @@ class _QRCodeState extends State<QRCode> {
BuildContext _context; BuildContext _context;
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
LocationUtils locationUtils;
ProjectDetailListModel projectDetailListModel;
@override @override
void initState() { void initState() {
@ -57,13 +63,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();
} }
@ -72,7 +74,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: () {
@ -85,15 +87,37 @@ class _QRCodeState extends State<QRCode> {
startQRCodeScan() async { startQRCodeScan() async {
String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent; String onlineCheckInQRCode = (await BarcodeScanner.scan())?.rawContent;
if (onlineCheckInQRCode != "") { if (onlineCheckInQRCode != "") {
sendNfcCheckInRequest(onlineCheckInQRCode); sendNfcCheckInRequest(onlineCheckInQRCode, 2);
locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment); locator<GAnalytics>().todoList.to_do_list_nfc(widget.appointment);
} else {} } else {}
} }
startLocationCheckIn() async {
GifLoaderDialogUtils.showMyDialog(context);
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) {
GifLoaderDialogUtils.hideDialog(context);
sendNfcCheckInRequest(projectDetailListModel.checkInQrCode, 3);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
}
}, failureCallBack: () {
GifLoaderDialogUtils.hideDialog(context);
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
_context = context; _context = context;
FlutterNfcKit.nfcAvailability.then((value) {
_supportsNFC = (value == NFCAvailability.available);
});
List<Widget> checkInOptionsList = getCheckInOptionsList(context); List<Widget> checkInOptionsList = getCheckInOptionsList(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).onlineCheckIn, appBarTitle: TranslationBase.of(context).onlineCheckIn,
@ -195,17 +219,17 @@ class _QRCodeState extends State<QRCode> {
optionsList.add( optionsList.add(
InkWell( InkWell(
onTap: () { onTap: () {
if (projectViewModel.havePrivilege(80)) { if (projectViewModel.havePrivilege(102)) {
startNFCScan(); startLocationCheckIn();
} }
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
title: TranslationBase.of(context).scanNFC, title: TranslationBase.of(context).checkInViaLocation,
imagePath: 'contactless.svg', imagePath: 'location.svg',
subTitle: "", subTitle: "",
isEnable: projectViewModel.havePrivilege(80), isEnable: projectViewModel.havePrivilege(102),
width: 80.0, width: 70.0,
height: 80.0, height: 70.0,
), ),
), ),
); );
@ -228,6 +252,26 @@ class _QRCodeState extends State<QRCode> {
), ),
); );
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,
),
),
);
return optionsList; return optionsList;
} }
@ -304,12 +348,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);
@ -340,6 +384,7 @@ class _QRCodeState extends State<QRCode> {
child: const Text('OK'), child: const Text('OK'),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
}, },
), ),
], ],

@ -65,6 +65,7 @@ class _SearchResultsState extends State<SearchResults> {
isObGyneAppointment: widget.isObGyneAppointment, isObGyneAppointment: widget.isObGyneAppointment,
isDoctorNameSearch: widget.isDoctorNameSearch, isDoctorNameSearch: widget.isDoctorNameSearch,
obGyneProcedureListResponse: widget.obGyneProcedureListResponse, obGyneProcedureListResponse: widget.obGyneProcedureListResponse,
isShowDate: false,
onTap: () { onTap: () {
projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor); projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
}); });

@ -27,10 +27,11 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedDate; static String selectedDate;
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
bool isContinueDentalPlan;
final dynamic doctorSchedule; final dynamic doctorSchedule;
static int initialSlotDuration; static int initialSlotDuration;
DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment}); DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment, this.isContinueDentalPlan = false});
@override @override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState(); _DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState();
@ -320,7 +321,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
print(DocAvailableAppointments.initialSlotDuration); print(DocAvailableAppointments.initialSlotDuration);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context, projectViewModel).then((res) { service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.isContinueDentalPlan, context, projectViewModel).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
if (res['FreeTimeSlots'].length != 0) { if (res['FreeTimeSlots'].length != 0) {
@ -376,10 +377,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;
// });
} }
} }

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

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

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

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

@ -28,15 +28,19 @@ class DoctorView extends StatelessWidget {
bool isObGyneAppointment; bool isObGyneAppointment;
bool isShowFlag; bool isShowFlag;
bool isDoctorNameSearch; bool isDoctorNameSearch;
bool isContinueDentalPlan;
OBGyneProcedureListResponse obGyneProcedureListResponse; OBGyneProcedureListResponse obGyneProcedureListResponse;
final VoidCallback onTap; final VoidCallback onTap;
bool isShowDate;
DoctorView( DoctorView(
{@required this.doctor, {@required this.doctor,
@required this.isLiveCareAppointment, @required this.isLiveCareAppointment,
this.isObGyneAppointment = false, this.isObGyneAppointment = false,
this.isDoctorNameSearch = false, this.isDoctorNameSearch = false,
this.isContinueDentalPlan = false,
this.isShowFlag = true, this.isShowFlag = true,
this.isShowDate = true,
this.onTap, this.onTap,
this.obGyneProcedureListResponse}); this.obGyneProcedureListResponse});
@ -53,8 +57,8 @@ class DoctorView extends StatelessWidget {
// if (doctor.clinicID == 17 && isDoctorNameSearch) { // if (doctor.clinicID == 17 && isDoctorNameSearch) {
// showDentalChiefComplaintsList(context); // showDentalChiefComplaintsList(context);
// } else // } else
if (isShowFlag) { if (isShowFlag) {
getDoctorsProfile(context, doctor, isAppo: true); getDoctorsProfile(context, doctor, isAppo: true, isContinueDentalPlan: isContinueDentalPlan);
} }
(onTap ?? () {})(); // For log analytics of doctor click from book appointment (onTap ?? () {})(); // For log analytics of doctor click from book appointment
} }
@ -87,10 +91,10 @@ class DoctorView extends StatelessWidget {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
Text( isShowDate ? Text(
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)), DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)),
style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12),
), ) : Container(),
], ],
), ),
if (doctor.doctorTitle != null) SizedBox(height: 6), if (doctor.doctorTitle != null) SizedBox(height: 6),
@ -169,9 +173,14 @@ class DoctorView extends StatelessWidget {
searchInfo.hospital = selectedHospital; searchInfo.hospital = selectedHospital;
searchInfo.clinic = selectedClinic; searchInfo.clinic = selectedClinic;
showDraggableDialog(context, DentalComplaints(isDoctorNameSearch: true, onSelectedMethod: () { showDraggableDialog(
Navigator.pop(context); context,
}, searchInfo: searchInfo)); DentalComplaints(
isDoctorNameSearch: true,
onSelectedMethod: () {
Navigator.pop(context);
},
searchInfo: searchInfo));
} }
String getDoctorSpeciality(List<String> docSpecial) { String getDoctorSpeciality(List<String> docSpecial) {
@ -182,11 +191,12 @@ class DoctorView extends StatelessWidget {
return docSpeciality; return docSpeciality;
} }
getDoctorsProfile(context, DoctorList docObject, {isAppo}) { getDoctorsProfile(context, DoctorList docObject, {isAppo, bool isContinueDentalPlan = false}) {
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) {
@ -194,7 +204,7 @@ class DoctorView extends StatelessWidget {
docProfileList.add(new DoctorProfileList.fromJson(v)); docProfileList.add(new DoctorProfileList.fromJson(v));
}); });
} else {} } else {}
navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo); navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo, isContinueDentalPlan: isContinueDentalPlan);
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -233,7 +243,7 @@ class DoctorView extends StatelessWidget {
FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID, selectedClinicID: doctor.clinicID, selectedDoctorID: doctor.doctorID, obGyneProcedureListResponse: obGyneProcedureListResponse))); FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID, selectedClinicID: doctor.clinicID, selectedDoctorID: doctor.doctorID, obGyneProcedureListResponse: obGyneProcedureListResponse)));
} }
Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo, bool isContinueDentalPlan = false}) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -243,6 +253,7 @@ class DoctorView extends StatelessWidget {
docProfileList: docProfile, docProfileList: docProfile,
isOpenAppt: isAppo, isOpenAppt: isAppo,
isDoctorNameSearch: isDoctorNameSearch, isDoctorNameSearch: isDoctorNameSearch,
isContinueDentalPlan: isContinueDentalPlan,
), ),
), ),
); );

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

@ -31,7 +31,6 @@ class CovidPaymentSummary extends StatefulWidget {
MyInAppBrowser browser; MyInAppBrowser browser;
AuthenticatedUser authenticatedUser; AuthenticatedUser authenticatedUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
String transID = "";
CovidPaymentSummary({@required this.patientShareResponse, this.selectedPaymentMethod}); CovidPaymentSummary({@required this.patientShareResponse, this.selectedPaymentMethod});
@ -44,6 +43,8 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
String tamaraPaymentStatus; String tamaraPaymentStatus;
String tamaraOrderID; String tamaraOrderID;
String transID = "";
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -216,7 +217,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Covid appointment payment", "Covid appointment payment",
@ -276,7 +277,8 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
try { try {
if (widget.selectedPaymentMethod == "TAMARA") { if (widget.selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); // checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo);
checkTamaraPaymentStatus(transID, appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
// } else { // } else {
@ -299,7 +301,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
if (res["status"].toString().toLowerCase() == "success") { if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo); updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(widget.selectedInstallmentPlan), appo);
} else { } else {
updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "",
num.parse(widget.selectedInstallmentPlan), appo); num.parse(widget.selectedInstallmentPlan), appo);
} }
}).catchError((err) { }).catchError((err) {
@ -376,7 +378,7 @@ class _CovidPaymentSummaryState extends State<CovidPaymentSummary> {
checkPaymentStatus(AppoitmentAllHistoryResultList appo) { checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { service.checkPaymentStatus(transID, false, context).then((res) {
print("Printing Payment Status Reponse!!!!"); print("Printing Payment Status Reponse!!!!");
print(res); print(res);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];

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

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

@ -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(

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

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

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

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

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

@ -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",
} }
]; ];

@ -92,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,
), ),
); );
}, },
@ -364,10 +365,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
// } // }
openAppointmentLabResults() { openAppointmentLabResults() {
int languageID = widget.projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
PatientLabOrders patientLabOrders = new PatientLabOrders(); PatientLabOrders patientLabOrders = new PatientLabOrders();
service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, context).then((res) { service.getPatientLabOrdersByAppoNo(widget.appo.appointmentNo, widget.appo.projectID, widget.appo.clinicID, languageID, context).then((res) {
print(res['ListLabResultsByAppNo']); print(res['ListLabResultsByAppNo']);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['ListLabResultsByAppNo'] != null) { if (res['ListLabResultsByAppNo'] != null) {
@ -399,10 +401,11 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
openAppointmentRadiology() { openAppointmentRadiology() {
int languageID = widget.projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
FinalRadiology finalRadiology = new FinalRadiology(); FinalRadiology finalRadiology = new FinalRadiology();
service.getPatientRadOrders(widget.appo.appointmentNo.toString(), context).then((res) { service.getPatientRadOrders(widget.appo.appointmentNo.toString(), languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['FinalRadiologyList'] != null) { if (res['FinalRadiologyList'] != null) {
print(res['FinalRadiologyList']); print(res['FinalRadiologyList']);
@ -466,7 +469,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) {
@ -482,9 +486,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) {
@ -527,9 +532,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");
@ -587,18 +594,11 @@ 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( getPatientAppointmentHistoryWithAppo();
context, // } else {
FadePage( // AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
page: ToDo( // }
isShowAppBar: true,
isFromMyAppointments: true,
appointment: widget.appo,
)));
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).upcomingEmpty);
}
} else { } else {
Navigator.push( Navigator.push(
context, context,
@ -611,6 +611,34 @@ class _AppointmentActionsState extends State<AppointmentActions> {
} }
} }
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';

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

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

@ -1,7 +1,9 @@
import 'dart:developer';
import 'dart:io'; import 'dart:io';
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/enum/PayfortEnums.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.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';
@ -10,6 +12,7 @@ import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResp
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.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';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_list_model.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
@ -20,6 +23,10 @@ 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/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.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';
@ -47,11 +54,7 @@ import 'package:rating_bar/rating_bar.dart';
class ToDo extends StatefulWidget { class ToDo extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
var languageID; var languageID;
MyInAppBrowser browser;
bool isShowAppBar = true; bool isShowAppBar = true;
Function onBackClick; Function onBackClick;
@ -84,6 +87,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
bool isInsured = false; bool isInsured = false;
bool isEligible = false; bool isEligible = false;
bool isCash = false; bool isCash = false;
MyInAppBrowser browser;
List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = [];
String transID;
@override @override
void initState() { void initState() {
@ -102,6 +111,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
// getToDoCount();
_tabController.dispose(); _tabController.dispose();
} }
@ -161,15 +171,15 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier( child: AppExpandableNotifier(
isExpand: true, isExpand: true,
hasCounter: true, hasCounter: true,
counter: widget.appoList.length.toString(), counter: appoList.length.toString(),
title: TranslationBase.of(context).appointments, title: TranslationBase.of(context).appointments,
bodyWidget: widget.appoList.length != 0 bodyWidget: appoList.length != 0
? ListView.builder( ? ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -189,12 +199,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(top: 4.0), padding: const EdgeInsets.only(top: 4.0),
child: widget.appoList[index].clinicID == 265 child: appoList[index].clinicID == 265
? Container( ? Container(
margin: EdgeInsets.only(left: 5.0, right: 5.0), margin: EdgeInsets.only(left: 5.0, right: 5.0),
child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0), child: SvgPicture.asset("assets/images/new/CoronaIcon.svg", width: 35.0, height: 35.0),
) )
: widget.appoList[index].isLiveCareAppointment : appoList[index].isLiveCareAppointment
? SvgPicture.asset("assets/images/new/virtual.svg") ? SvgPicture.asset("assets/images/new/virtual.svg")
: SvgPicture.asset("assets/images/new/hospital-visit.svg"), : SvgPicture.asset("assets/images/new/hospital-visit.svg"),
), ),
@ -204,9 +214,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: Text( child: Text(
widget.appoList[index].clinicID == 265 appoList[index].clinicID == 265
? TranslationBase.of(context).covidTestTodo ? TranslationBase.of(context).covidTestTodo
: widget.appoList[index].isLiveCareAppointment : appoList[index].isLiveCareAppointment
? TranslationBase.of(context).liveCareAppo ? TranslationBase.of(context).liveCareAppo
: TranslationBase.of(context).walkinAppo, : TranslationBase.of(context).walkinAppo,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48)),
@ -214,8 +224,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(left: 8.0, right: 8.0), padding: const EdgeInsets.only(left: 8.0, right: 8.0),
child: CountdownTimer( child: CountdownTimer(
controller: new CountdownTimerController( controller:
endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60), new CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (appoList[index].remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) { widgetBuilder: (_, CurrentRemainingTime time) {
return time != null return time != null
? Text( ? Text(
@ -235,17 +245,17 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: Container( child: Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
performNextAction(widget.appoList[index]); performNextAction(appoList[index]);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
decoration: BoxDecoration( decoration: BoxDecoration(
color: getNextActionButtonColor(widget.appoList[index].nextAction), color: getNextActionButtonColor(appoList[index].nextAction),
border: Border.all(color: Colors.white, width: 1), border: Border.all(color: Colors.white, width: 1),
borderRadius: BorderRadius.circular(6), borderRadius: BorderRadius.circular(6),
), ),
child: Text( child: Text(
getNextActionText(widget.appoList[index].nextAction), getNextActionText(appoList[index].nextAction),
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4), style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.4),
), ),
@ -258,7 +268,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -266,8 +276,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: widget.appoList[index].doctorTitle + " " + widget.appoList[index].doctorNameObj, name: appoList[index].doctorTitle + " " + appoList[index].doctorNameObj,
url: widget.appoList[index].doctorImageURL, url: appoList[index].doctorImageURL,
width: 52, width: 52,
height: 52, height: 52,
), ),
@ -277,32 +287,32 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.appoList[index].clinicName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", appoList[index].clinicName, projectViewModel.isArabic),
// MyRichText(TranslationBase.of(context).appointmentDate + ": ", // MyRichText(TranslationBase.of(context).appointmentDate + ": ",
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + " " + widget.appoList[index].startTime.substring(0, 5), projectViewModel.isArabic), // DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) + " " + appoList[index].startTime.substring(0, 5), projectViewModel.isArabic),
// Timezone changes // Timezone changes
widget.appoList[index].isLiveCareAppointment appoList[index].isLiveCareAppointment
? MyRichText( ? MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " + " " +
DateUtil.convertStringToDate(widget.appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5), DateUtil.convertStringToDate(appoList[index].appointmentDate).toString().split(" ")[1].substring(0, 5),
projectViewModel.isArabic) projectViewModel.isArabic)
: MyRichText( : MyRichText(
TranslationBase.of(context).appointmentDate + ": ", TranslationBase.of(context).appointmentDate + ": ",
DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(widget.appoList[index].appointmentDate)) + DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(appoList[index].appointmentDate)) +
" " + " " +
widget.appoList[index].startTime.substring(0, 5), appoList[index].startTime.substring(0, 5),
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.appoList[index].projectName, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, appoList[index].projectName, projectViewModel.isArabic),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
RatingBar.readOnly( RatingBar.readOnly(
initialRating: widget.appoList[index].actualDoctorRate.toDouble(), initialRating: appoList[index].actualDoctorRate.toDouble(),
size: 16.0, size: 16.0,
filledColor: Color(0XFFD02127), filledColor: Color(0XFFD02127),
emptyColor: Color(0XFFD02127), emptyColor: Color(0XFFD02127),
@ -321,13 +331,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 12.0), padding: const EdgeInsets.only(top: 12.0),
child: Text( child: Text(
getNextActionDescription(widget.appoList[index].nextAction), getNextActionDescription(appoList[index].nextAction),
style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16), style: TextStyle(fontSize: 10, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48, height: 25 / 16),
), ),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
navigateToAppointmentDetails(context, widget.appoList[index]); navigateToAppointmentDetails(context, appoList[index]);
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 0.0), padding: const EdgeInsets.only(top: 0.0),
@ -356,9 +366,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
child: AppExpandableNotifier( child: AppExpandableNotifier(
isExpand: true, isExpand: true,
hasCounter: true, hasCounter: true,
counter: (widget.ancillaryLists.isNotEmpty) ? widget.ancillaryLists[0].ancillaryOrderList.length.toString() : "0", counter: (ancillaryLists.isNotEmpty) ? ancillaryLists[0].ancillaryOrderList.length.toString() : "0",
title: TranslationBase.of(context).anicllaryOrders, title: TranslationBase.of(context).anicllaryOrders,
bodyWidget: widget.ancillaryLists.length != 0 bodyWidget: ancillaryLists.length != 0
? Container( ? Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: ListView.separated( child: ListView.separated(
@ -367,18 +377,18 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
reverse: true, reverse: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return DoctorCard( return DoctorCard(
onTap: () => ancillaryOrdersDetails(widget.ancillaryLists[0].ancillaryOrderList[index], widget.ancillaryLists[0].projectID), onTap: () => ancillaryOrdersDetails(ancillaryLists[0].ancillaryOrderList[index], ancillaryLists[0].projectID),
isInOutPatient: true, isInOutPatient: true,
name: TranslationBase.of(context).dr.toString() + " " + (widget.ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""), name: TranslationBase.of(context).dr.toString() + " " + (ancillaryLists[0].ancillaryOrderList[index].doctorName ?? ""),
billNo: widget.ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(), billNo: ancillaryLists[0].ancillaryOrderList[index].orderNo.toString(),
profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", profileUrl: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
subName: widget.ancillaryLists[0].projectName, subName: ancillaryLists[0].projectName,
isLiveCareAppointment: false, isLiveCareAppointment: false,
date: DateUtil.convertStringToDate(widget.ancillaryLists[0].ancillaryOrderList[index].orderDate), date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList[index].orderDate),
isSortByClinic: true, isSortByClinic: true,
); );
}, },
itemCount: widget.ancillaryLists[0].ancillaryOrderList.length, itemCount: ancillaryLists[0].ancillaryOrderList.length,
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),
), ),
) )
@ -388,13 +398,13 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
), ),
), ),
Container( Container(
child: widget.obGyneAppoList.length != 0 child: obGyneAppoList.length != 0
? ListView.builder( ? ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.obGyneAppoList.length, itemCount: obGyneAppoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -432,7 +442,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Container( Container(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
getOBGyneDoctorsList(widget.obGyneAppoList[index].projectID, widget.obGyneAppoList[index].setupID, widget.obGyneAppoList[index]); getOBGyneDoctorsList(obGyneAppoList[index].projectID, obGyneAppoList[index].setupID, obGyneAppoList[index]);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14), padding: EdgeInsets.symmetric(vertical: 8, horizontal: 14),
@ -453,7 +463,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
Padding( Padding(
padding: const EdgeInsets.only(top: 8.0), padding: const EdgeInsets.only(top: 8.0),
child: Text( child: Text(
TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName,
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
), ),
), ),
@ -461,7 +471,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
LargeAvatar( LargeAvatar(
name: TranslationBase.of(context).dr + " " + widget.obGyneAppoList[index].doctorName, name: TranslationBase.of(context).dr + " " + obGyneAppoList[index].doctorName,
url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png", url: "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png",
width: 52, width: 52,
height: 52, height: 52,
@ -472,12 +482,12 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
MyRichText(TranslationBase.of(context).clinic + ": ", widget.obGyneAppoList[index].clinicDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).clinic + ": ", obGyneAppoList[index].clinicDescription, projectViewModel.isArabic),
MyRichText( MyRichText(
TranslationBase.of(context).orderDate + ": ", TranslationBase.of(context).orderDate + ": ",
DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(widget.obGyneAppoList[index].orderDate)).split(" ")[0], DateUtil.getDayMonthYearHourMinuteDateFormatted(DateUtil.convertStringToDate(obGyneAppoList[index].orderDate)).split(" ")[0],
projectViewModel.isArabic), projectViewModel.isArabic),
MyRichText(TranslationBase.of(context).branch, widget.obGyneAppoList[index].projectDescription, projectViewModel.isArabic), MyRichText(TranslationBase.of(context).branch, obGyneAppoList[index].projectDescription, projectViewModel.isArabic),
], ],
), ),
), ),
@ -545,9 +555,15 @@ 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);
@ -742,14 +758,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getOBGyneOrdersList(context).then((res) { service.getOBGyneOrdersList(context).then((res) {
widget.obGyneAppoList.clear(); obGyneAppoList.clear();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {
if (res['HIS_OBGYNEProcedureGet_List'].length != 0) { if (res['HIS_OBGYNEProcedureGet_List'].length != 0) {
widget.obGyneAppoList.clear(); obGyneAppoList.clear();
res['HIS_OBGYNEProcedureGet_List'].forEach((v) { res['HIS_OBGYNEProcedureGet_List'].forEach((v) {
widget.obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v)); obGyneAppoList.add(new OBGyneProcedureListResponse.fromJson(v));
}); });
} else { } else {
// Navigator.of(context).popAndPushNamed(HOME); // Navigator.of(context).popAndPushNamed(HOME);
@ -769,7 +785,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = []; List<PatientDoctorAppointmentList> _patientDoctorAppointmentListHospital = [];
service.getOBGyneDoctorsList(projectID, setupID, context).then((res) { service.getOBGyneDoctorsList(projectID, setupID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['HIS_ObgyneUltrasoundDoctorsList'][0]); print(res['HIS_ObgyneUltrasoundDoctorsList'][0]);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -815,30 +831,31 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
obGyneProcedureListResponse: obGyneProcedureListResponse))); obGyneProcedureListResponse: obGyneProcedureListResponse)));
} }
getPatientAppointmentHistory() { getPatientAppointmentHistory() async {
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) { service.getPatientAppointmentHistory(true, languageID, context).then((res) {
widget.appoList.clear(); appoList.clear();
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { if (res['AppoimentAllHistoryResultList'].length != 0) {
if (res['AppoimentAllHistoryResultList'].length != 0) { appoList.clear();
widget.appoList.clear(); res['AppoimentAllHistoryResultList'].forEach((v) {
res['AppoimentAllHistoryResultList'].forEach((v) { appoList.add(new AppoitmentAllHistoryResultList.fromJson(v));
widget.appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); });
}); }
} if (res['AncillaryOrderList'].length != 0) {
if (res['AncillaryOrderList'].length != 0) { res['AncillaryOrderList'].forEach((item) {
res['AncillaryOrderList'].forEach((item) { ancillaryLists.add(AncillaryOrdersListModel.fromJson(item));
widget.ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); });
}); }
} dataLoaded = true;
dataLoaded = true; if (widget.isFromMyAppointments) {
if (widget.isFromMyAppointments) { performNextAction(widget.appointment);
getPatientShare(context, widget.appointment); widget.isFromMyAppointments = false;
} }
}); setState(() {});
} else { } else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']); AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
} }
@ -847,7 +864,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, 0, true, "0");
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
} else {}
}).catchError((err) {
print(err);
});
} }
checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) { checkPatientNphiesEligibility(context, AppoitmentAllHistoryResultList appo) {
@ -898,13 +927,14 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
getPatientShare(context, AppoitmentAllHistoryResultList appo) { getPatientShare(context, AppoitmentAllHistoryResultList appo) {
int languageID = projectViewModel.isArabic ? 1 : 2;
String errorMsg = ""; String errorMsg = "";
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
if (appo.isLiveCareAppointment) { if (appo.isLiveCareAppointment) {
getLiveCareAppointmentPatientShare(context, service, appo); getLiveCareAppointmentPatientShare(context, service, appo);
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, languageID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['OnlineCheckInAppointments'].length != 0) { if (res['OnlineCheckInAppointments'].length != 0) {
widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]); widget.patientShareResponse = new PatientShareResponse.fromJson(res['OnlineCheckInAppointments'][0]);
@ -945,7 +975,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) { getLiveCareAppointmentPatientShare(context, DoctorsListService service, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, context).then((res) { service.getLiveCareAppointmentPatientShare(appo.appointmentNo.toString(), appo.clinicID, appo.projectID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
widget.patientShareResponse = new PatientShareResponse.fromJson(res); widget.patientShareResponse = new PatientShareResponse.fromJson(res);
openPaymentDialog(appo, widget.patientShareResponse); openPaymentDialog(appo, widget.patientShareResponse);
@ -969,23 +999,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();
@ -1031,12 +1061,12 @@ 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);
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
widget.browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), transID,
appo.projectID.toString(), appo.projectID.toString(),
authenticatedUser.emailAddress, authenticatedUser.emailAddress,
paymentMethod[0], paymentMethod[0],
@ -1044,7 +1074,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() : "",
@ -1075,7 +1105,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;
} }
@ -1085,7 +1115,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;
} }
@ -1096,7 +1126,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); checkTamaraPaymentStatus(transID, appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo);
// } else { // } else {
@ -1115,8 +1145,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
if (res["status"].toString().toLowerCase() == "success") { if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo); updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo);
} else { } else {
updateTamaraRequestStatus( updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -1185,7 +1214,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { service.checkPaymentStatus(transID, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
@ -1250,10 +1279,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) { addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, transID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}).catchError((err) { }).catchError((err) {
@ -1279,12 +1305,103 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
if (value != null) { if (value != null) {
final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular'; final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular';
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); if (selectedPaymentMethod == "ApplePay") {
if (projectViewModel.havePrivilege(103)) {
startApplePay(appo, patientShareResponse);
} else {
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
}
} else {
openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo);
}
projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment'); projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment');
} }
}); });
} }
void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async {
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context);
LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel payfortProjectDetailsRespModel;
await context.read<PayfortViewModel>().getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum()).then((value) {
payfortProjectDetailsRespModel = value;
});
applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = appo.clinicID;
applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR";
// applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com";
applePayInsertRequest.customerID = projectViewModel.user.patientID;
applePayInsertRequest.customerName = projectViewModel.user.firstName + " " + projectViewModel.user.lastName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = appo.doctorID;
applePayInsertRequest.projectID = appo.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = projectViewModel.user.patientID;
applePayInsertRequest.patientTypeID = projectViewModel.user.patientType;
applePayInsertRequest.patientOutSA = projectViewModel.user.outSA;
applePayInsertRequest.appointmentDate = appo.appointmentDate;
applePayInsertRequest.appointmentNo = appo.appointmentNo;
applePayInsertRequest.orderDescription = "Appointment Payment";
applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = patientShareResponse.patientShareWithTax.toString();
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment ? "1" : "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
applePayInsertRequest.userName = projectViewModel.user.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel.merchantIdentifier;
applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel.signature;
applePayInsertRequest.accessCode = payfortProjectDetailsRespModel.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel.shaRequest;
applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel.shaResponse;
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
});
}
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
@ -1312,7 +1429,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service service
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context) Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context)
.then((res) { .then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

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

@ -67,7 +67,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
initialiseHmgServices(false); initialiseHmgServices(false);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context); var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
var userProvider = Provider.of<ToDoCountProviderModel>(context); // var userProvider = Provider.of<ToDoCountProviderModel>(context);
List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin); List<Widget> myMedicalList = Utils.myMedicalListHomePage(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel.isLogin);
return Container( return Container(
width: double.infinity, width: double.infinity,
@ -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,11 +18,13 @@ 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';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family; import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart' as family;
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
@ -36,6 +39,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 +75,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;
@ -249,13 +254,14 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, toDoProvider.notificationsCount); toDoProvider.setState(0, 0, true, toDoProvider.notificationsCount);
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['AppointmentActiveNumber']); print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount); // toDoProvider.setState(res['AppointmentActiveNumber'], true, toDoProvider.notificationsCount);
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, toDoProvider.notificationsCount);
} else {} } else {}
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -294,10 +300,14 @@ 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);
} }
}); });
PayfortViewModel payfortViewModel = context.read<PayfortViewModel>();
payfortViewModel.initPayfort();
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
// for now commented to reduce this call will enable it when needed // for now commented to reduce this call will enable it when needed
// HMGNetworkConnectivity(context).start(); // HMGNetworkConnectivity(context).start();
@ -448,7 +458,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
setState(() { setState(() {
notificationCount = notificationCount =
value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString(); value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'] > 99 ? '99+' : value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
model.setState(model.count, true, notificationCount); model.setState(model.count, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
}) })
} }
@ -636,21 +646,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, 0, true, notificationCount);
sharedPref.setString(NOTIFICATION_COUNT, notificationCount); sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
FlutterAppIconBadge.updateBadge(num.parse(notificationCount)); FlutterAppIconBadge.updateBadge(num.parse(notificationCount));
} }
}), });
}); // if (await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN) == null || !await AppSharedPreferences().getBool(IS_LAST_APPOINTMENT_RATE_SHOWN)) {
// 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()));

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

@ -1,10 +1,14 @@
import 'dart:developer';
import 'dart:io'; import 'dart:io';
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/enum/PayfortEnums.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';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ERAppointmentFeesResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareScheduleClinicsListResponse.dart';
@ -18,6 +22,8 @@ import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart'; import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -83,6 +89,9 @@ class _clinic_listState extends State<ClinicList> {
String tamaraOrderID; String tamaraOrderID;
String selectedInstallmentPlan; String selectedInstallmentPlan;
String transID;
BuildContext localContext;
@override @override
void initState() { void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse(); liveCareClinicsListResponse = new LiveCareClinicsListResponse();
@ -102,25 +111,26 @@ 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);
localContext = 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 +193,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) {
@ -295,7 +306,8 @@ class _clinic_listState extends State<ClinicList> {
appo.clinicID = selectedClinicID; appo.clinicID = selectedClinicID;
appo.appointmentNo = DateTime.now().millisecondsSinceEpoch; appo.appointmentNo = DateTime.now().millisecondsSinceEpoch;
appo.projectID = 12; appo.projectID = BASE_URL.contains("uat.") ? 15 : 12;
appo.isLiveCareAppointment = false;
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));
@ -317,44 +329,129 @@ class _clinic_listState extends State<ClinicList> {
patientShare: num.parse(getERAppointmentFeesList.total), patientShare: num.parse(getERAppointmentFeesList.total),
isFromAdvancePayment: widget.isPharmacyLiveCare, isFromAdvancePayment: widget.isPharmacyLiveCare,
))).then((value) { ))).then((value) {
print(value);
widget.isPharmacyLiveCare = isPharmacyLiveCare;
widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue;
if (value != null) { if (value != null) {
openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo); selectedPaymentMethod = value[0];
projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment'); print(value);
widget.isPharmacyLiveCare = isPharmacyLiveCare;
widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue;
if (value != null) {
if (selectedPaymentMethod == "ApplePay") {
if (projectViewModel.havePrivilege(103)) {
startApplePay(appo, getERAppointmentFeesList.total);
} else {
openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo);
}
} else {
openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo);
}
projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment');
}
} }
}); });
} }
void startApplePay(AppoitmentAllHistoryResultList appo, String amount) async {
try {
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo, isAddMilliseconds: false);
print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(localContext);
LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel payfortProjectDetailsRespModel;
await localContext
.read<PayfortViewModel>()
.getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum(), languageID: projectViewModel.isArabic ? 1 : 2)
.then((value) {
payfortProjectDetailsRespModel = value;
});
applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = appo.clinicID;
applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR";
// applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com";
applePayInsertRequest.customerID = projectViewModel.user.patientID;
applePayInsertRequest.customerName = projectViewModel.user.firstName + " " + projectViewModel.user.lastName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = appo.doctorID;
applePayInsertRequest.projectID = appo.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = projectViewModel.user.patientID;
applePayInsertRequest.patientTypeID = projectViewModel.user.patientType;
applePayInsertRequest.patientOutSA = projectViewModel.user.outSA;
applePayInsertRequest.appointmentDate = appo.appointmentDate;
applePayInsertRequest.appointmentNo = appo.appointmentNo;
applePayInsertRequest.orderDescription = "LiveCare Payment";
applePayInsertRequest.liveServiceID = selectedClinicID.toString();
applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = amount;
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment ? "1" : "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
applePayInsertRequest.userName = projectViewModel.user.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay";
applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel.merchantIdentifier;
applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel.signature;
applePayInsertRequest.accessCode = payfortProjectDetailsRespModel.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel.shaRequest;
applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel.shaResponse;
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, localContext).then((res) async {
await localContext.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
GifLoaderDialogUtils.hideDialog(localContext);
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
GifLoaderDialogUtils.hideDialog(localContext);
log("Payfort: ${successResult.responseMessage}");
await localContext.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(localContext);
AppToast.showErrorToast(message: err);
});
} catch (ex) {
print(ex.toString());
GifLoaderDialogUtils.hideDialog(localContext);
}
}
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo, isAddMilliseconds: false);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];
selectedInstallmentPlan = paymentMethod[1]; selectedInstallmentPlan = paymentMethod[1];
this.amount = amount.toString(); this.amount = amount.toString();
browser.openPaymentBrowser( browser.openPaymentBrowser(amount, "LiveCare Payment", widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : transID, "12", authenticatedUser.emailAddress, paymentMethod[0],
amount, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, context, "", "", "", "", paymentMethod[1]);
"LiveCare Payment",
widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
"12",
authenticatedUser.emailAddress,
paymentMethod[0],
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser,
false,
"4",
selectedClinicID,
context,
"",
"",
"",
"",
paymentMethod[1]);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -394,7 +491,7 @@ class _clinic_listState extends State<ClinicList> {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called!!!!");
try { try {
if (selectedPaymentMethod == "TAMARA") { if (selectedPaymentMethod == "TAMARA") {
checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); checkTamaraPaymentStatus(transID, appo);
// if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
// updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo); // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
// } else { // } else {
@ -417,8 +514,7 @@ class _clinic_listState extends State<ClinicList> {
if (res["status"].toString().toLowerCase() == "success") { if (res["status"].toString().toLowerCase() == "success") {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(selectedInstallmentPlan), appo); updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(selectedInstallmentPlan), appo);
} else { } else {
updateTamaraRequestStatus( updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
"Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
} }
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
@ -435,7 +531,7 @@ class _clinic_listState extends State<ClinicList> {
service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) { service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") {
addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); addNewCallForPatientER(transID);
} else { } else {
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
@ -462,16 +558,13 @@ class _clinic_listState extends State<ClinicList> {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.checkPaymentStatus(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : transID, widget.isPharmacyLiveCare, context).then((res) {
.checkPaymentStatus(
widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
amount = res['Amount'].toString(); amount = res['Amount'].toString();
payment_method = res['PaymentMethod']; payment_method = res['PaymentMethod'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
addNewCallForPatientER(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); addNewCallForPatientER(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : transID);
} else { } else {
AppToast.showErrorToast(message: res['Response_Message']); AppToast.showErrorToast(message: res['Response_Message']);
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
@ -491,8 +584,9 @@ class _clinic_listState extends State<ClinicList> {
addNewCallForPatientER(String clientRequestID) { addNewCallForPatientER(String clientRequestID) {
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
int languageID = projectViewModel.isArabic ? 1 : 2;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.addNewCallForPatientER(selectedClinicID, clientRequestID, widget.isPharmacyLiveCare, context).then((res) { service.addNewCallForPatientER(selectedClinicID, clientRequestID, languageID, widget.isPharmacyLiveCare, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: "New Call has been added successfully"); AppToast.showSuccessToast(message: "New Call has been added successfully");
widget.getLiveCareHistory(); widget.getLiveCareHistory();
@ -504,14 +598,15 @@ 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() {
isDataLoaded = false; isDataLoaded = false;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinics(context).then((res) { service.getLivecareClinics(languageID == 'ar' ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['PatientER_GetClinicsList'].length); print(res['PatientER_GetClinicsList'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -757,11 +852,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)),
} }
@ -662,11 +663,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
checkIfUserAgreedBefore(CheckActivationCode result) { checkIfUserAgreedBefore(CheckActivationCode result) {
if (result.isNeedUserAgreement == true) { // if (result.isNeedUserAgreement == true) {
//move to agreement page. //move to agreement page.
} else { // } else {
goToHome(); goToHome();
} // }
} }
insertIMEI() { insertIMEI() {
@ -676,11 +677,12 @@ class _ConfirmLogin extends State<ConfirmLogin> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
// toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
@ -694,12 +696,11 @@ 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);
getToDoCount();
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList(projectViewModel.isArabic ? 1 : 2)
.then((value) => { .then((value) => {
getToDoCount(),
GifLoaderDialogUtils.hideDialog(AppGlobal.context), GifLoaderDialogUtils.hideDialog(AppGlobal.context),
if (appointmentRateViewModel.isHaveAppointmentNotRate) if (appointmentRateViewModel.isHaveAppointmentNotRate)
{ {
@ -724,6 +725,16 @@ class _ConfirmLogin extends State<ConfirmLogin> {
.catchError((err) { .catchError((err) {
print(err); print(err);
}); });
// getToDoCount();
// Navigator.pushAndRemoveUntil(
// context,
// FadePage(
// page: LandingPage(),
// ),
// (r) => false);
// insertIMEI();
} }
loading(flag) { loading(flag) {

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

@ -705,7 +705,8 @@ 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.getIsLastAppointmentRatedList().then((value) { int languageID = Provider.of<ProjectViewModel>(context, listen: false).isArabic ? 1 : 2;
appointmentRateViewModel.getIsLastAppointmentRatedList(languageID).then((value) {
getToDoCount(); getToDoCount();
GifLoaderDialogUtils.hideDialog(AppGlobal.context); GifLoaderDialogUtils.hideDialog(AppGlobal.context);
if (appointmentRateViewModel.isHaveAppointmentNotRate) { if (appointmentRateViewModel.isHaveAppointmentNotRate) {
@ -747,11 +748,12 @@ class _RegisterInfo extends State<RegisterInfo> {
} }
getToDoCount() { getToDoCount() {
toDoProvider.setState(0, true, "0"); toDoProvider.setState(0, 0, true, "0");
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) { service.getActiveAppointmentNo(context).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0"); // toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
toDoProvider.setState(res['AppointmentActiveNumber'], res['AncillaryOrderListCount'], true, "0");
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);

@ -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(

@ -1,5 +1,8 @@
import 'dart:developer';
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/enum/PayfortEnums.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; 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';
@ -7,11 +10,15 @@ import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_mod
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/LiveCare/ApplePayInsertRequest.dart';
import 'package:diplomaticquarterapp/models/apple_pay_request.dart'; import 'package:diplomaticquarterapp/models/apple_pay_request.dart';
import 'package:diplomaticquarterapp/models/apple_pay_response.dart'; import 'package:diplomaticquarterapp/models/apple_pay_response.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.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/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_view_model.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';
@ -24,10 +31,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.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:pay/pay.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
class ConfirmPaymentPage extends StatefulWidget { class ConfirmPaymentPage extends StatefulWidget {
@ -72,12 +76,19 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
Navigator.pop(context, true); Navigator.pop(context, true);
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
appo.projectID = widget.patientInfoAndMobileNumber.projectID; appo.projectID = widget.patientInfoAndMobileNumber.projectID;
// if (widget.selectedPaymentMethod == "ApplePay") {
// startApplePay(); if (widget.selectedPaymentMethod == "ApplePay") {
// } else { if (projectViewModel.havePrivilege(103)) {
startApplePay();
} else {
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), AppoitmentAllHistoryResultList());
}
} else {
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), AppoitmentAllHistoryResultList());
}
projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet'); projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet');
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); // openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null);
// }
}); });
} }
@ -214,9 +225,17 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).confirm.toUpperCase(), TranslationBase.of(context).confirm.toUpperCase(),
() { () async {
if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) { if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) {
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); if (widget.selectedPaymentMethod == "ApplePay") {
if (projectViewModel.havePrivilege(103)) {
startApplePay();
} else {
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), AppoitmentAllHistoryResultList());
}
} else {
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), AppoitmentAllHistoryResultList());
}
} else { } else {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
@ -225,14 +244,6 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
}); });
} }
projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet'); projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet');
// startApplePay();
// if()
// GifLoaderDialogUtils.showMyDialog(context);
// model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
// GifLoaderDialogUtils.hideDialog(context);
// if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model);
// });
}, },
), ),
), ),
@ -241,70 +252,89 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
); );
} }
// startApplePay() { void startApplePay() async {
// ApplePayResponse applePayResponse; transID = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber));
// var _paymentItems = [ print("TransactionID: $transID");
// PaymentItem( GifLoaderDialogUtils.showMyDialog(context);
// label: 'Total',
// amount: widget.advanceModel.amount, LiveCareService service = new LiveCareService();
// status: PaymentItemStatus.final_price, ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
// )
// ]; PayfortProjectDetailsRespModel payfortProjectDetailsRespModel;
// await context
// _payClient.userCanPay(PayProvider.apple_pay).then((value) async { .read<PayfortViewModel>()
// print(value); .getProjectDetailsForPayfort(projectId: widget.advanceModel.hospitalsModel.iD, serviceId: ServiceTypeEnum.advancePayment.getIdFromServiceEnum())
// final result = await _payClient.showPaymentSelector( .then((value) {
// provider: PayProvider.apple_pay, payfortProjectDetailsRespModel = value;
// paymentItems: _paymentItems, });
// );
// print(result); applePayInsertRequest.clientRequestID = transID;
// applePayResponse = ApplePayResponse.fromJson(result); applePayInsertRequest.clinicID = 0;
// callPayfortApplePayAPI(applePayResponse); applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR";
// }).catchError((err) { // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
// print(err); applePayInsertRequest.customerEmail = "CustID_${widget.advanceModel.fileNumber}@HMG.com";
// }); applePayInsertRequest.customerID = widget.advanceModel.fileNumber;
// } applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
callPayfortApplePayAPI(ApplePayResponse applePayResponse) async { applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
DoctorsListService service = new DoctorsListService(); applePayInsertRequest.doctorID = 0;
ApplePayRequest applePayRequest = new ApplePayRequest(); applePayInsertRequest.projectID = widget.advanceModel.hospitalsModel.iD.toString();
AppleHeader appleHeader = new AppleHeader(); applePayInsertRequest.serviceID = ServiceTypeEnum.advancePayment.getIdFromServiceEnum().toString();
ApplePaymentMethod applePaymentMethod = new ApplePaymentMethod(); applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = widget.advanceModel.fileNumber;
applePayRequest.amount = widget.advanceModel.amount; applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType;
applePayRequest.currency = "SAR"; applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA;
applePayRequest.language = projectViewModel.isArabic ? "ar" : "en"; applePayInsertRequest.appointmentDate = null;
applePayRequest.customername = projectViewModel.user.firstName; applePayInsertRequest.appointmentNo = 0;
applePayRequest.customerEmail = projectViewModel.user.emailAddress; applePayInsertRequest.orderDescription = "Advance Payment";
applePayRequest.orderdescription = "Advance Payment"; applePayInsertRequest.liveServiceID = "0";
applePayRequest.liveServiceid = ""; applePayInsertRequest.latitude = "0.0";
applePayRequest.latitude = await this.sharedPref.getDouble(USER_LAT); applePayInsertRequest.longitude = "0.0";
applePayRequest.longitude = await this.sharedPref.getDouble(USER_LONG); applePayInsertRequest.amount = widget.advanceModel.amount.toString();
applePayRequest.devicetoken = await sharedPref.getString(PUSH_TOKEN); applePayInsertRequest.isSchedule = "0";
applePayRequest.clientrequestid = Utils.getAdvancePaymentTransID(widget.advanceModel.hospitalsModel.iD, int.parse(widget.advanceModel.fileNumber)); applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayRequest.projectid = widget.advanceModel.hospitalsModel.iD.toString(); applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
applePayRequest.serviceid = "3"; applePayInsertRequest.userName = num.parse(widget.advanceModel.fileNumber);
applePayRequest.patientid = projectViewModel.user.patientID.toString(); applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayRequest.appleData = applePayResponse.token.data; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayRequest.appleSignature = applePayResponse.token.signature; applePayInsertRequest.paymentOption = "ApplePay";
appleHeader.appleEphemeralPublicKey = applePayResponse.token.header.ephemeralPublicKey; applePayInsertRequest.isMobSDK = true;
appleHeader.appleTransactionId = applePayResponse.token.header.transactionId; applePayInsertRequest.merchantReference = transID;
appleHeader.applePublicKeyHash = applePayResponse.token.header.publicKeyHash; applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel.merchantIdentifier;
applePaymentMethod.appleType = getApplePayPaymentType(applePayResponse.paymentMethod.type); applePayInsertRequest.commandType = "PURCHASE";
applePaymentMethod.appleNetwork = applePayResponse.paymentMethod.network; applePayInsertRequest.signature = payfortProjectDetailsRespModel.signature;
applePaymentMethod.appleDisplayName = applePayResponse.paymentMethod.displayName; applePayInsertRequest.accessCode = payfortProjectDetailsRespModel.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel.shaRequest;
applePayRequest.appleHeader = appleHeader; applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel.shaResponse;
applePayRequest.applePaymentMethod = applePaymentMethod; applePayInsertRequest.returnURL = "";
service.callPayfortApplePayAPI(applePayRequest, context).then((res) { service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
print(res); await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
GifLoaderDialogUtils.hideDialog(context); customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${widget.advanceModel.fileNumber}@HMG.com",
orderDescription: "Advance Payment",
orderAmount: double.parse(widget.advanceModel.amount),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(num.parse(widget.advanceModel.fileNumber), result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.advanceModel.hospitalsModel.iD,
serviceTypeEnum: ServiceTypeEnum.advancePayment,
);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
// _showMyDialog(err, this.context); GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: err);
}); });
} }
@ -410,7 +440,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
} }
onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) {
print("onBrowserExit Called!!!!"); print("onBrowserExit Called");
if (widget.selectedPaymentMethod == "TAMARA" && tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") { if (widget.selectedPaymentMethod == "TAMARA" && tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") {
var res = { var res = {
"Amount": double.parse(widget.advanceModel.amount), "Amount": double.parse(widget.advanceModel.amount),

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

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

Loading…
Cancel
Save